:root, :host {
    color-scheme: light;
    --ink: #202030;
    --ink-soft: #626276;
    --surface: #ffffff;
    --surface-soft: #f8f9fb;
    --surface-accent: #f3f1ff;
    --primary: #594ae2;
    --primary-dark: #4032c5;
    --primary-soft: #e8e5ff;
    --success: #167d68;
    --warning: #9a5a09;
    --danger: #b42318;
    --line: #e7e8ee;
    --shadow: 0 10px 30px rgba(32, 31, 58, .08);
    --radius: 14px;
    --content: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.learner-web {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--surface-soft);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.learner-web [hidden] { display: none !important; }
.learner-web.home-page, .learner-web.subject-page, .learner-web.not-found-page { min-width: 0; }

a { color: inherit; }
button, input, select, textarea { font: inherit; }
img, svg { display: block; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: 8px;
    left: 8px;
    padding: 10px 14px;
    border-radius: 4px;
    color: #fff;
    background: var(--primary-dark);
    transform: translateY(-150%);
}

.skip-link:focus { transform: none; }

:focus-visible {
    outline: 3px solid rgba(89, 74, 226, .38);
    outline-offset: 3px;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid rgba(229, 228, 236, .9);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(14px);
}

.app-header__inner,
.app-footer__inner {
    display: flex;
    width: min(100% - 32px, var(--content));
    min-height: 68px;
    margin: 0 auto;
    align-items: center;
    justify-content: space-between;
}

.app-brand {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    color: var(--ink);
    font-size: 20px;
    font-weight: 750;
    letter-spacing: -.03em;
    text-decoration: none;
}

.header-login {
    color: var(--primary-dark);
    font-weight: 700;
    text-decoration: none;
}

.profile-menu { position: relative; }
.profile-menu summary {
    display: flex;
    min-height: 44px;
    gap: 8px;
    padding: 4px 6px 4px 4px;
    align-items: center;
    border-radius: 8px;
    cursor: pointer;
    list-style: none;
    font-weight: 650;
}
.profile-menu summary::-webkit-details-marker { display: none; }
.profile-menu summary:hover { background: var(--surface-soft); }
.profile-menu summary svg { fill: none; stroke: currentColor; stroke-width: 1.8; }
.profile-menu[open] summary svg { transform: rotate(180deg); }

.profile-menu__avatar,
.identity-card__avatar {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .03em;
}

.profile-menu__panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 250px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.profile-menu__panel a,
.profile-menu__identity {
    display: block;
    padding: 11px 16px;
    text-decoration: none;
}
.profile-menu__panel a:hover { background: var(--surface-soft); }
.profile-menu__identity { border-bottom: 1px solid var(--line); }
.profile-menu__identity strong,
.profile-menu__identity span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-menu__identity span { color: var(--ink-soft); font-size: 13px; }

.app-main { min-height: calc(100vh - 142px); }
.page-shell {
    width: min(100% - 32px, var(--content));
    margin: 0 auto;
    padding: 46px 0 80px;
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.035em; }
h1 { margin-bottom: 14px; font-size: clamp(32px, 4.5vw, 46px); }
h2 { margin-bottom: 10px; font-size: clamp(23px, 2.6vw, 30px); }
h3 { font-size: 20px; }

.eyebrow {
    margin-bottom: 8px;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
}

/* A compact greeting leaves the next action and subjects in the first view. */
.home-hero {
    margin-bottom: 24px;
    padding: 20px 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(135deg, #fff 0%, #f7f6ff 100%);
}
.home-hero h1 { margin-bottom: 8px; font-size: clamp(32px, 3.4vw, 38px); }
.home-hero__lead,
.page-heading > p:last-child,
.subject-hero__copy > p:last-child {
    max-width: 650px;
    margin-bottom: 0;
    color: var(--ink-soft);
    font-size: 18px;
}
.home-hero__lead { font-size: 16px; }

.review-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
.review-summary--recommended { border-color: var(--primary); box-shadow: 0 4px 16px rgba(89, 74, 226, .08); }
.review-summary__icon { display: grid; flex: 0 0 44px; height: 44px; place-items: center; border-radius: 8px; color: #fff; background: var(--primary); }
.review-summary__icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.review-summary__body { flex: 1; min-width: 0; }
.review-summary h2 { margin: 0; font-size: 18px; }
.review-summary p { margin: 5px 0 0; color: var(--ink-soft); font-size: 14px; }
.review-summary--quiet { gap: 12px; padding: 12px 16px; background: transparent; }
.review-summary--quiet .review-summary__icon { flex-basis: 24px; height: 24px; color: var(--warning); background: transparent; }
.review-summary--quiet h2 { font-size: 14px; font-weight: 600; }
.review-summary > a { flex-shrink: 0; min-height: 44px; display: inline-flex; align-items: center; }

.continue-card,
.active-test {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 20px;
    padding: 22px;
    align-items: center;
    border-radius: var(--radius);
}
.continue-card {
    margin-bottom: 32px;
    padding: 22px;
    border: 1px solid #5b51ca;
    color: #fff;
    background: #5b51ca;
    box-shadow: 0 10px 28px rgba(65, 54, 160, .16);
}
.continue-card__icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, .15);
}
.continue-card__icon svg { width: 21px; fill: currentColor; }
.continue-card .eyebrow { margin-bottom: 3px; color: rgba(255, 255, 255, .75); }
.continue-card h2 { margin-bottom: 3px; font-size: 21px; }
.continue-card p { margin-bottom: 9px; color: rgba(255, 255, 255, .82); font-size: 14px; }
.continue-card__answered { display: block; margin-top: 6px; color: rgba(255, 255, 255, .82); font-size: 12px; }

.button {
    display: inline-flex;
    min-height: 44px;
    gap: 8px;
    padding: 10px 17px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 750;
    text-decoration: none;
}
.button--primary { color: #fff; background: var(--primary); }
.continue-card .button--primary { border-color: #fff; color: var(--primary-dark); background: #fff; }
.button--primary:hover { background: var(--primary-dark); }
.continue-card .button--primary:hover { background: #f2f0ff; }
.button--secondary { border-color: var(--line); background: var(--surface); }
.button:disabled { opacity: .46; cursor: default; }
.button--danger { color: #fff; background: var(--danger); }
.button--danger-outline { border-color: #e4aaa5; color: var(--danger); background: #fff; }
.button--danger-outline:hover { background: #fff4f3; }
.button--quiet { color: var(--ink-soft); background: transparent; }

.section-heading {
    display: flex;
    gap: 24px;
    margin-bottom: 22px;
    align-items: end;
    justify-content: space-between;
}
.section-heading h2 { margin-bottom: 0; }
.section-heading > p { max-width: 440px; margin-bottom: 4px; color: var(--ink-soft); }

.subject-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.subject-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 48px 1fr auto;
    gap: 16px 12px;
    min-height: 230px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: inherit;
    background: var(--surface);
    box-shadow: 0 2px 5px rgba(35,31,74,.02);
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.subject-card:hover { border-color: #c9c3fb; box-shadow: var(--shadow); transform: translateY(-2px); }

.subject-icon,
.category-row__icon,
.action-card__icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 8px;
    color: var(--primary-dark);
    background: var(--primary-soft);
}
.subject-icon svg { width: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.subject-icon { border: 1px solid #dedafd; background: transparent; }
.subject-card__arrow { align-self: center; color: var(--primary); font-size: 24px; }
.subject-card__identity { grid-column: 1 / -1; min-width: 0; }
.subject-card h3 { margin: 0 0 6px; font-size: 18px; }
.subject-card__identity > p { margin: 0; color: var(--ink-soft); font-size: 14px; }
.subject-card__progress { grid-column: 1 / -1; align-self: end; }
/* Shared by home subject cards, the subject summary, and every topic row.
   Keep typography and knowledge states here; parent layouts only set placement. */
.knowledge-summary { min-width: 0; }
.knowledge-summary__heading { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; align-items: baseline; margin-bottom: 8px; color: var(--ink-soft); font-size: 13px; line-height: 1.5; }
.knowledge-summary__heading strong { color: var(--ink); font-size: 15px; font-weight: 750; font-variant-numeric: tabular-nums; }
.knowledge-summary__not-started { display: block; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.5; }
.knowledge-summary__previous { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.knowledge-summary__guidance { display: block; margin-top: 7px; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.knowledge-summary__guidance--due { color: var(--warning); font-weight: 700; }

.knowledge-meter {
    position: relative;
    display: block;
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: #ecebf1;
}
.knowledge-meter__demonstrated,
.knowledge-meter__current {
    position: absolute;
    inset: 0 auto 0 0;
    display: block;
    border-radius: inherit;
}
.knowledge-meter__demonstrated { background: #c9c3f7; }
.knowledge-meter__current { background: var(--primary); }
.knowledge-meter__legend {
    display: flex;
    min-height: 18px;
    gap: 4px 13px;
    margin-top: 6px;
    flex-wrap: wrap;
    color: var(--ink-soft);
    font-size: 12px;
}
.knowledge-meter__legend span { display: inline-flex; gap: 5px; align-items: center; }
.knowledge-meter__key { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.knowledge-meter__key--current { background: var(--primary); }
.knowledge-meter__key--demonstrated { border: 1px solid #8175dd; background: #c9c3f7; }
.knowledge-guidance { display: block; margin-top: 7px; color: var(--ink-soft); font-size: 12px; line-height: 1.35; }
.knowledge-guidance--due { color: var(--warning); font-weight: 700; }

.knowledge-explainer {
    margin-top: 18px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--ink-soft);
    background: rgba(255,255,255,.65);
}
.knowledge-explainer summary {
    display: flex;
    min-height: 44px;
    padding: 9px 13px;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    list-style: none;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 700;
}
.knowledge-explainer summary::-webkit-details-marker { display: none; }
.knowledge-explainer summary:hover { color: var(--primary-dark); }
.knowledge-explainer__chevron {
    display: grid;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    place-items: center;
    transition: transform .15s ease;
}
.knowledge-explainer__chevron svg {
    display: block;
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.knowledge-explainer[open] .knowledge-explainer__chevron { transform: rotate(180deg); }
.knowledge-explainer > div { padding: 0 13px 12px; font-size: 12px; line-height: 1.5; }
.knowledge-explainer p { margin: 0; }
.knowledge-explainer p + p { margin-top: 5px; }
.subject-section > .knowledge-explainer { max-width: 720px; margin-top: 20px; }

.meter {
    display: block;
    height: 7px;
    overflow: hidden;
    border-radius: 4px;
    background: rgba(255,255,255,.2);
}
.subject-card .meter,
.category-row .meter,
.subject-progress .meter,
.active-test .meter { background: #ecebf1; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.continue-card .meter { background: rgba(255, 255, 255, .22); }
.continue-card .meter > span { background: rgba(255, 255, 255, .92); }
.meter--large { height: 10px; }

.breadcrumb {
    display: flex;
    gap: 10px;
    margin-bottom: 28px;
    align-items: center;
    color: var(--ink-soft);
    font-size: 14px;
}
.breadcrumb a { color: var(--primary-dark); font-weight: 700; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.subject-shell > .breadcrumb { margin-bottom: 20px; }
.subject-shell #topics, .subject-shell #tests, .subject-shell #next-actions { scroll-margin-top: 90px; }
.subject-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
    gap: 28px;
    padding: 24px;
    align-items: start;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
}
.subject-hero__copy { min-width: 0; }
.subject-hero h1 { font-size: clamp(32px, 3.8vw, 42px); overflow-wrap: anywhere; margin-bottom: 10px; }
.subject-hero__intro { margin-bottom: 8px; color: var(--ink-soft); font-size: 16px; }
.subject-shortcuts { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.subject-shortcuts a { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; color: var(--primary-dark); font-size: 14px; font-weight: 700; text-decoration: none; }
.subject-shortcuts a:hover { text-decoration: underline; }
.subject-about { color: var(--ink-soft); font-size: 14px; }
.subject-about summary { width: fit-content; min-height: 44px; padding: 10px 0; cursor: pointer; font-weight: 600; }
.subject-about summary:hover { color: var(--primary-dark); }
.subject-about p { margin: 0; padding: 4px 0 0; }
.subject-progress { padding-left: 24px; border-left: 1px solid var(--line); }
.subject-progress .knowledge-explainer { margin-top: 12px; background: transparent; border: 0; }
.subject-progress .knowledge-explainer summary { padding-right: 0; padding-left: 0; }
.subject-progress .knowledge-explainer > div { padding-right: 0; padding-left: 0; }

.next-actions,
.category-section,
.test-section { margin-top: 48px; }
.next-actions { margin-top: 28px; }
.next-actions .section-heading { margin-bottom: 16px; }
.next-actions h2 { font-size: 24px; }
.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.action-card {
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    min-height: 112px;
    gap: 14px;
    padding: 18px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    text-decoration: none;
}
.action-card:hover { border-color: #c9c3fb; box-shadow: 0 7px 20px rgba(35,31,74,.07); }
.action-card--primary {
    border-color: #7466ec;
    background: var(--surface);
    box-shadow: 0 8px 22px rgba(74, 57, 212, .1);
}
.action-card--primary:hover { border-color: var(--primary-dark); box-shadow: 0 10px 26px rgba(74, 57, 212, .14); }
.action-card__icon { width: 44px; height: 44px; border-radius: 6px; }
.action-card__icon svg { width: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.action-card--primary .action-card__icon { color: #fff; background: var(--primary); }
.action-card--primary .action-card__icon svg { fill: currentColor; stroke: none; }
.action-card--primary .action-card__icon--stroke svg { fill: none; stroke: currentColor; }
.action-card__badge {
    display: inline-block;
    margin-bottom: 5px;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    line-height: 1;
    text-transform: uppercase;
}
.action-card strong, .action-card small { display: block; }
.action-card small { margin-top: 3px; color: var(--ink-soft); }
.action-card > span:last-child { color: var(--primary); font-size: 20px; }

.category-section {
    padding-top: 40px;
    border-top: 1px solid var(--line);
}
.category-list {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
.category-row {
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    gap: 16px;
    padding: 18px 20px;
    align-items: center;
    text-decoration: none;
}
.category-row:focus-visible { outline-offset: -3px; }
.category-row:hover { background: #faf9ff; }
.category-row__icon {
    width: 46px;
    height: 46px;
    border: 1px solid #dedafd;
    border-radius: 6px;
    background: transparent;
}
.category-row__content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 16px;
    align-items: center;
}
.category-row__identity { min-width: 0; overflow-wrap: anywhere; }
.category-row__icon svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.category-row strong, .category-row small { display: block; }
.category-row small { margin-top: 3px; color: var(--ink-soft); font-size: 13px; }
.category-row small.knowledge-guidance--due { color: var(--warning); }
.category-row__knowledge { width: 230px; }
.category-row__arrow { color: var(--primary); font-size: 20px; }

/* Match the subject-card grid on wider screens, retaining compact mobile rows. */
@media (min-width: 681px) {
    .category-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
    }
    .category-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: 48px 1fr auto;
        gap: 16px 12px;
        min-height: 230px;
        padding: 20px;
        align-items: start;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: var(--surface);
        box-shadow: 0 2px 5px rgba(35, 31, 74, .02);
        transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
    }
    .category-row:hover { border-color: #c9c3fb; background: var(--surface); box-shadow: var(--shadow); transform: translateY(-2px); }
    .category-row:focus-visible { outline-offset: 3px; }
    .category-row__icon { width: 48px; height: 48px; border-radius: 8px; }
    .category-row__content { display: contents; }
    .category-row__identity { grid-column: 1 / -1; grid-row: 2; font-size: 18px; line-height: 1.15; }
    .category-row__knowledge { grid-column: 1 / -1; grid-row: 3; width: 100%; align-self: end; }
    .category-row__arrow { grid-column: 2; grid-row: 1; align-self: center; font-size: 24px; }
}

@media (min-width: 1001px) {
    .category-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.subject-shell .test-history { margin-top: 20px; }
.subject-shell .result-list__identity strong { white-space: normal; overflow-wrap: anywhere; }
.subject-shell .result-list a:focus-visible { outline-offset: -3px; }

.text-link { color: var(--primary-dark); font-weight: 750; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.test-section { padding-top: 40px; border-top: 1px solid var(--line); }
.active-test { grid-template-columns: minmax(0, 1fr) auto; margin-bottom: 18px; color: var(--ink); background: var(--surface); box-shadow: none; }
.active-test .button { min-width: 118px; }
.active-test > div > strong,
.active-test > div > span { display: block; }
.active-test > div > span { margin: 3px 0 10px; color: var(--ink-soft); }
.active-test .meter { width: min(100%, 430px); }

.test-history { margin-top: 30px; }
.test-history__heading {
    display: flex;
    margin-bottom: 13px;
    padding: 0 3px;
    align-items: end;
    justify-content: space-between;
}
.test-history__heading .eyebrow { margin-bottom: 3px; font-size: 10px; }
.test-history__heading h3 { margin: 0; font-size: 18px; }
.test-history__heading > span { color: var(--ink-soft); font-size: 12px; }
.result-list {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 5px 18px rgba(35, 31, 74, .035);
}
.result-list a {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto auto;
    gap: 24px;
    min-height: 86px;
    padding: 14px 18px;
    align-items: center;
    text-decoration: none;
    transition: background .15s ease;
}
.result-list a + a { border-top: 1px solid var(--line); }
.result-list a:hover { background: #faf9ff; }
.result-list strong, .result-list small { display: block; }
.result-list small { color: var(--ink-soft); }
.result-list__identity { display: flex; min-width: 0; gap: 13px; align-items: center; }
.result-list__identity > span:last-child { min-width: 0; }
.result-list__identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-list__identity small { margin-top: 3px; font-size: 12px; }
.result-list__icon {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    border: 1px solid #dedafd;
    border-radius: 8px;
    color: var(--primary-dark);
    background: transparent;
}
.result-list__icon svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.result-list__score { display: grid; width: 155px; gap: 7px; }
.result-list__score > span:first-child { display: flex; gap: 7px; align-items: baseline; }
.result-list__score strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.result-list__score small { font-size: 11px; }
.result-list__meter { display: block; height: 5px; overflow: hidden; border-radius: 999px; background: #ecebf1; }
.result-list__meter i { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.result-list__arrow {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid #dedafd;
    border-radius: 50%;
    color: var(--primary);
    transition: color .15s ease, background .15s ease, transform .15s ease;
}
.result-list a:hover .result-list__arrow { color: #fff; background: var(--primary); transform: translateX(2px); }

.empty-state {
    padding: 40px;
    border: 1px dashed #cac8d4;
    border-radius: var(--radius);
    text-align: center;
    background: rgba(255,255,255,.55);
}
.empty-state > :last-child { margin-bottom: 0; }
.empty-state--compact { padding: 24px; }

.not-found-shell {
    display: grid;
    min-height: calc(100vh - 142px);
    place-items: center;
}
.not-found-card {
    display: grid;
    width: min(100%, 720px);
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 20px;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
}
.not-found-card__icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 1px solid #dedafd;
    border-radius: 8px;
    color: var(--primary-dark);
}
.not-found-card__icon svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.not-found-card__content { min-width: 0; }
.not-found-card h1 { margin-bottom: 10px; font-size: clamp(30px, 4vw, 40px); }
.not-found-card__content > p:not(.eyebrow) {
    max-width: 560px;
    margin-bottom: 22px;
    color: var(--ink-soft);
    font-size: 17px;
}
.not-found-card__actions {
    display: flex;
    gap: 14px 20px;
    flex-wrap: wrap;
    align-items: center;
}
.not-found-card__actions .text-link {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
}

.account-shell { max-width: 1000px; }
.page-heading { max-width: 700px; margin-bottom: 30px; }
.account-workspace { display: grid; grid-template-columns: 230px minmax(0,1fr); gap: 20px; align-items: start; }
.page-account-nav {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
.page-account-nav > p { margin: 4px 8px 8px; color: #8a8c99; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.page-account-nav__link {
    display: grid;
    grid-template-columns: 28px minmax(0,1fr);
    min-height: 56px;
    padding: 9px 10px;
    align-items: center;
    border-radius: 9px;
    color: var(--ink-soft);
    font-weight: 700;
    text-decoration: none;
}
.page-account-nav__link svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.page-account-nav__link strong, .page-account-nav__link small { display: block; }
.page-account-nav__link strong { color: inherit; font-size: 13px; }
.page-account-nav__link small { margin-top: 1px; color: #989aa5; font-size: 11px; font-weight: 500; }
.page-account-nav__link:hover { color: var(--ink); background: var(--surface-soft); }
.page-account-nav__link.is-current { color: var(--primary-dark); background: var(--primary-soft); }
.page-account-nav__link.is-current small { color: #736ab1; }

.account-panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.panel-heading { padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; font-size: 18px; }
.panel-heading p { margin: 3px 0 0; color: var(--ink-soft); font-size: 13px; }
.panel-heading--action { display: flex; gap: 20px; align-items: center; justify-content: space-between; }
.panel-heading--action .text-link { flex: 0 0 auto; font-size: 13px; }
.account-usage-stats { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; padding: 18px 18px 0; }
.account-stat { display: flex; min-width: 0; gap: 12px; padding: 16px; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.account-stat__icon { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 9px; color: var(--primary-dark); background: var(--primary-soft); }
.account-stat__icon--success { color: #17654f; background: #e7f6f0; }
.account-stat__icon svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.account-stat small, .account-stat strong, .account-stat em { display: block; }
.account-stat small { color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.account-stat strong { margin-top: 1px; font-size: 24px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.account-stat em { margin-top: 2px; color: #989aa5; font-size: 11px; font-style: normal; }
.weekly-activity { margin: 10px 18px 20px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; }
.weekly-activity > header { display: flex; gap: 20px; align-items: start; justify-content: space-between; }
.weekly-activity h3 { margin: 0; font-size: 15px; }
.weekly-activity p { margin: 2px 0 0; color: var(--ink-soft); font-size: 12px; }
.weekly-activity__hint { max-width: 230px; color: var(--ink-soft); font-size: 11px; text-align: right; }
.weekly-bars { display: grid; height: 92px; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 10px; margin-top: 15px; align-items: end; }
.weekly-bar { position: relative; display: grid; width: 100%; height: 100%; grid-template-rows: minmax(0,1fr) auto; gap: 7px; padding: 0; border: 0; color: inherit; background: transparent; font: inherit; text-align: center; cursor: pointer; appearance: none; }
.weekly-bar i { position: relative; display: block; height: 100%; border-radius: 5px; background: var(--surface-soft); }
.weekly-bar b { position: absolute; right: 0; bottom: 0; left: 0; min-height: 3px; border-radius: inherit; background: var(--primary); }
.weekly-bar small { color: var(--ink-soft); font-size: 10px; }
.weekly-bar__tooltip {
    position: absolute;
    z-index: 2;
    top: 5px;
    left: 50%;
    width: max-content;
    max-width: 150px;
    padding: 6px 8px;
    border-radius: 6px;
    color: #fff;
    background: var(--ink);
    box-shadow: 0 5px 16px rgba(24, 37, 56, .18);
    font-size: 10px;
    font-style: normal;
    line-height: 1.25;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -5px);
    transition: opacity .12s ease, transform .12s ease;
}
.weekly-bar__tooltip strong { font-size: 12px; font-variant-numeric: tabular-nums; }
.weekly-bar:first-child .weekly-bar__tooltip { left: 3px; transform: translate(0, -5px); }
.weekly-bar:last-child .weekly-bar__tooltip { right: 3px; left: auto; transform: translate(0, -5px); }
.weekly-bar[aria-expanded="true"] .weekly-bar__tooltip,
.weekly-bar:focus-visible .weekly-bar__tooltip { opacity: 1; transform: translate(-50%, 0); }
.weekly-bar:first-child[aria-expanded="true"] .weekly-bar__tooltip,
.weekly-bar:first-child:focus-visible .weekly-bar__tooltip,
.weekly-bar:last-child[aria-expanded="true"] .weekly-bar__tooltip,
.weekly-bar:last-child:focus-visible .weekly-bar__tooltip { transform: translate(0, 0); }
.weekly-bar:focus-visible { outline: none; }
.weekly-bar:focus-visible i { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
    .weekly-bar:hover .weekly-bar__tooltip { opacity: 1; transform: translate(-50%, 0); }
    .weekly-bar:first-child:hover .weekly-bar__tooltip,
    .weekly-bar:last-child:hover .weekly-bar__tooltip { transform: translate(0, 0); }
}
.identity-card,
.subscription-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
.identity-card { display: flex; gap: 14px; margin: 18px; padding: 17px; align-items: center; align-self: start; background: var(--surface-soft); }
.identity-card--top { margin-bottom: 0; }
.identity-card__avatar { width: 48px; height: 48px; flex: 0 0 auto; font-size: 15px; }
.identity-card strong, .identity-card small { display: block; overflow: hidden; text-overflow: ellipsis; }
.identity-card small { color: var(--ink-soft); }
.identity-badge { margin-left: auto; padding: 5px 9px; border-radius: 999px; color: #17654f; background: #e7f6f0; font-size: 11px; font-weight: 750; }
.account-logout { display: flex; gap: 18px; padding: 16px 18px 18px; align-items: center; justify-content: flex-end; border-top: 1px solid var(--line); }
.account-logout > span { margin-right: auto; color: var(--ink-soft); font-size: 12px; }
.logout-button { display: inline-flex; min-height: 40px; gap: 8px; padding: 8px 13px; align-items: center; border: 1px solid #e3b6b2; border-radius: 8px; color: #963c35; background: #fff7f6; font-size: 13px; font-weight: 750; text-decoration: none; transition: border-color .15s ease, color .15s ease, background .15s ease; }
.logout-button:hover { border-color: #d48d86; color: #7f2923; background: #fff0ee; }
.logout-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.login-panel {
    width: min(100%, 480px);
    margin: 25px auto;
    padding: 36px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow);
    text-align: center;
}
.login-panel__mark { display: flex; margin-bottom: 20px; justify-content: center; }
.login-panel > p:not(.eyebrow) { color: var(--ink-soft); }
.login-actions { display: grid; gap: 12px; margin: 26px 0 18px; }
.provider-button {
    display: flex;
    width: 100%;
    min-height: 50px;
    gap: 12px;
    padding: 10px 16px;
    align-items: center;
    justify-content: center;
    border: 1px solid #ceccd7;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-weight: 700;
}
.provider-button:hover { background: var(--surface-soft); }

.status-message { margin-bottom: 20px; padding: 13px 16px; border-radius: 6px; color: #105c4d; background: #e9f7f3; }
.status-message--error { color: #8f1c14; background: #fff0ee; }
.account-panel--subscription { padding: 0; }
.subscription-panel-heading { display: flex; gap: 14px; padding: 20px 22px; align-items: center; border-bottom: 1px solid var(--line); }
.subscription-panel-heading__icon { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border-radius: 10px; color: var(--primary-dark); background: var(--primary-soft); }
.subscription-panel-heading__icon svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.subscription-panel-heading h2 { margin: 0; font-size: 18px; }
.subscription-panel-heading p { margin: 3px 0 0; color: var(--ink-soft); font-size: 13px; }
.account-panel--subscription > .status-message { margin: 18px 18px 0; }
.account-panel--subscription > .empty-state { margin: 18px; }
.subscription-list { display: grid; gap: 14px; padding: 18px; }
.subscription-card { padding: 0; overflow: hidden; }
.subscription-card > header { display: flex; gap: 20px; align-items: start; justify-content: space-between; }
.subscription-card > header { padding: 22px 22px 19px; }
.subscription-plan { display: flex; min-width: 0; gap: 14px; align-items: center; }
.subscription-plan__mark { display: grid; width: 46px; height: 46px; flex: 0 0 46px; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(145deg, var(--primary), var(--primary-dark)); box-shadow: 0 7px 18px rgba(89,74,226,.22); }
.subscription-plan__mark svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.subscription-plan .eyebrow { margin-bottom: 1px; }
.subscription-card h2 { margin: 0; font-size: 23px; }
.subscription-plan > div > p:last-child { margin: 4px 0 0; color: var(--ink-soft); font-size: 12px; }
.status-pill { padding: 5px 10px; border-radius: 999px; font-size: 13px; font-weight: 750; }
.status-pill--active { color: #105c4d; background: #e5f5f0; }
.status-pill--cancelled { color: #80500e; background: #fff3dd; }
.status-pill--stopped { color: var(--ink-soft); background: #ededf2; }
.subscription-facts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin: 0 22px 22px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.subscription-facts div { min-width: 0; padding: 15px 16px; background: var(--surface-soft); }
.subscription-facts div + div { border-left: 1px solid var(--line); }
.subscription-facts dt { color: var(--ink-soft); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.subscription-facts dd { margin: 4px 0 0; font-size: 15px; font-weight: 750; }
.subscription-facts small { display: block; margin-top: 3px; color: #9293a0; font-size: 10px; }
.subscription-card__footer { display: flex; gap: 18px; padding: 16px 22px; align-items: center; justify-content: flex-end; border-top: 1px solid var(--line); background: #fcfcfe; }
.subscription-renewal-note { display: flex; max-width: 390px; gap: 9px; margin-right: auto; align-items: center; color: var(--ink-soft); font-size: 11px; line-height: 1.4; }
.subscription-renewal-note svg { width: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.subscription-cancel-button { padding: 7px 2px; border: 0; color: #9b423b; background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
.subscription-cancel-button:hover { color: #7f2923; text-decoration-color: currentColor; }
.subscription-empty .button { margin-top: 10px; }

.cancel-dialog {
    width: min(680px, calc(100% - 28px));
    max-height: min(800px, calc(100vh - 28px));
    margin: auto;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 14px;
    color: var(--ink);
    background: var(--surface);
    box-shadow: 0 24px 80px rgba(25, 22, 52, .28);
}
.cancel-dialog::backdrop { background: rgba(25, 22, 45, .55); backdrop-filter: blur(2px); }
.cancel-dialog [hidden] { display: none !important; }
.cancel-dialog form { display: grid; max-height: min(800px, calc(100vh - 28px)); grid-template-rows: auto minmax(0, 1fr) auto; }
.cancel-dialog__header { display: flex; gap: 24px; padding: 21px 24px 18px; align-items: start; justify-content: space-between; border-bottom: 1px solid var(--line); background: #fcfcfe; }
.cancel-dialog__heading { min-width: 0; flex: 1; }
.cancel-dialog__header .eyebrow { margin-bottom: 2px; }
.cancel-dialog__header h2 { margin: 0; font-size: 22px; }
.cancel-progress-row { display: flex; gap: 14px; margin-top: 13px; align-items: center; color: var(--ink-soft); font-size: 11px; }
.cancel-progress-row > span { flex: 0 0 auto; }
.cancel-progress { height: 5px; overflow: hidden; flex: 1; border-radius: 999px; background: #e9e7f1; }
.cancel-progress i { display: block; width: 20%; height: 100%; border-radius: inherit; background: var(--primary); transition: width .2s ease; }
.dialog-close { display: grid; width: 40px; height: 40px; padding: 0; place-items: center; border: 0; border-radius: 50%; color: var(--ink-soft); background: transparent; cursor: pointer; font-size: 28px; line-height: 1; }
.dialog-close:hover { color: var(--ink); background: var(--surface-soft); }
.cancel-dialog__body { min-height: 410px; padding: 26px 28px 28px; overflow-y: auto; }
.cancel-step-heading { display: flex; max-width: 570px; gap: 13px; margin: 0 auto 23px; align-items: start; }
.cancel-step-heading__icon { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 9px; color: var(--primary-dark); background: var(--primary-soft); }
.cancel-step-heading__icon svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cancel-step-heading h3 { margin: 0; font-size: 19px; line-height: 1.35; }
.cancel-step-heading p { margin: 5px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.cancel-step-heading--centered { display: grid; justify-items: center; text-align: center; }
.cancel-dialog textarea,
.other-reason input { width: 100%; padding: 12px 13px; border: 1px solid #c9c7d2; border-radius: 7px; color: var(--ink); background: #fff; resize: vertical; transition: border-color .15s ease, box-shadow .15s ease; }
.cancel-dialog textarea:focus,
.other-reason input:focus { border-color: var(--primary); outline: 0; box-shadow: 0 0 0 3px rgba(89,74,226,.12); }
.cancel-dialog textarea { min-height: 145px; line-height: 1.5; }
.choice-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin: 0; padding: 0; border: 0; }
.choice-list label { position: relative; display: flex; min-height: 48px; gap: 10px; padding: 9px 11px; align-items: center; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 12px; line-height: 1.35; transition: border-color .15s ease, background .15s ease; }
.choice-list label:hover { border-color: #c8c3ee; background: #faf9ff; }
.choice-list label:has(input:checked) { border-color: #aaa1ef; background: var(--primary-soft); }
.choice-list input { position: absolute; opacity: 0; }
.choice-list__control { display: grid; width: 17px; height: 17px; flex: 0 0 17px; place-items: center; border: 1.5px solid #aaa8b4; border-radius: 50%; background: #fff; }
.choice-list__control::after { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); content: ""; transform: scale(0); transition: transform .15s ease; }
.choice-list input:checked + .choice-list__control { border-color: var(--primary); }
.choice-list input:checked + .choice-list__control::after { transform: scale(1); }
.choice-list input:focus-visible + .choice-list__control { outline: 3px solid rgba(89,74,226,.2); outline-offset: 2px; }
.field-error { margin: 9px 0 0; color: var(--danger); font-size: 12px; }
.other-reason, .cancel-text-field { display: block; margin-top: 16px; }
.other-reason > span, .cancel-text-field > span { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 700; }
.other-reason small, .cancel-text-field small { color: var(--ink-soft); font-weight: 500; }
.cancel-text-field { max-width: 570px; margin-right: auto; margin-left: auto; }
.rating-fieldset { max-width: 440px; margin: 44px auto 0; padding: 0; border: 0; }
.rating-choices { display: flex; gap: 15px; justify-content: center; }
.rating-choices label { cursor: pointer; }
.rating-choices input { position: absolute; opacity: 0; }
.rating-choices span { display: grid; width: 52px; height: 52px; place-items: center; color: #bbb8c5; transition: color .15s ease, transform .15s ease; }
.rating-choices svg { width: 43px; fill: transparent; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.rating-choices label:hover span,
.rating-choices label:has(~ label:hover) span,
.rating-choices label:has(input:checked) span,
.rating-choices label:has(~ label input:checked) span { color: #e5a91a; transform: translateY(-2px); }
.rating-choices label:hover svg,
.rating-choices label:has(~ label:hover) svg,
.rating-choices label:has(input:checked) svg,
.rating-choices label:has(~ label input:checked) svg { fill: currentColor; }
.rating-choices input:focus-visible + span { outline: 3px solid rgba(89, 74, 226, .38); outline-offset: 3px; }
.rating-scale { display: flex; margin-top: 8px; justify-content: space-between; color: var(--ink-soft); font-size: 11px; }
.cancel-confirmation { max-width: 500px; margin: 0 auto; padding: 20px 10px; text-align: center; }
.cancel-confirmation__icon { display: grid; width: 58px; height: 58px; margin: 0 auto 15px; place-items: center; border-radius: 50%; color: var(--danger); background: #fff0ee; }
.cancel-confirmation__icon svg { width: 30px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.cancel-confirmation .eyebrow { margin-bottom: 5px; color: var(--danger); }
.cancel-confirmation h3 { margin: 0; font-size: 21px; }
.cancel-confirmation > p:not(.eyebrow) { max-width: 470px; margin: 9px auto 0; color: var(--ink-soft); line-height: 1.55; }
.cancel-dialog__footer { display: flex; gap: 10px; padding: 16px 24px 20px; justify-content: flex-end; border-top: 1px solid var(--line); background: #fcfcfe; }
.cancel-dialog__footer .button--quiet { margin-right: auto; }

.app-footer { border-top: 1px solid var(--line); color: var(--ink-soft); background: var(--surface); font-size: 13px; }
.app-footer__inner { min-height: 74px; }
.app-footer__inner span:last-child { display: flex; gap: 18px; }
.app-footer a { text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }

@media (max-width: 860px) {
    .action-grid { grid-template-columns: 1fr; }
    .action-card { min-height: 90px; }
    .subject-hero { grid-template-columns: 1fr; gap: 18px; }
    .subject-progress { padding: 18px 0 0; border-left: 0; border-top: 1px solid var(--line); }
    .settings-overview { grid-template-columns: 1fr; }
    .account-workspace { grid-template-columns: 1fr; }
    .page-account-nav { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .page-account-nav > p { display: none; }
}

@media (max-width: 1000px) and (min-width: 681px) {
    .subject-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
    .app-header__inner, .app-footer__inner, .page-shell { width: min(100% - 24px, var(--content)); }
    .app-header__inner { min-height: 60px; }
    .app-brand { font-size: 18px; }
    .app-brand img { width: 31px; height: 31px; }
    .profile-menu__name { display: none; }
    .profile-menu summary { padding-right: 2px; }
    .profile-menu summary > svg { display: none; }
    .page-shell { padding: 30px 0 55px; }
    .not-found-shell { min-height: calc(100vh - 134px); }
    .not-found-card { grid-template-columns: 1fr; gap: 16px; padding: 24px 20px; }
    .not-found-card__actions { align-items: stretch; flex-direction: column; }
    .not-found-card__actions .button { width: 100%; }
    .not-found-card__actions .text-link { justify-content: center; text-align: center; }
    .home-shell { padding-top: 20px; }
    .home-hero { margin-bottom: 20px; padding: 18px; }
    .review-summary { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 16px; }
    .review-summary > a { grid-column: 1 / -1; justify-content: center; }
    .review-summary--quiet { grid-template-columns: 24px minmax(0, 1fr); gap: 4px 10px; }
    .review-summary--quiet > a { grid-column: 2; justify-self: start; }
    .continue-card { grid-template-columns: auto minmax(0,1fr); }
    .continue-card .button { grid-column: 1 / -1; width: 100%; }
    .subject-grid { grid-template-columns: 1fr; }
    .subject-card { min-height: 0; padding: 18px; grid-template-columns: 42px minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 16px 12px; }
    .subject-card .subject-icon { width: 42px; height: 42px; align-self: start; }
    .subject-card__identity { grid-column: 2; grid-row: 1; }
    .subject-card__arrow { grid-column: 3; grid-row: 1; }
    .subject-card__progress { grid-row: 2; }
    .home-shell .section-heading { margin-bottom: 18px; }
    .home-shell .section-heading > p { display: none; }
    .section-heading { display: block; }
    .section-heading > p, .section-heading > .text-link { display: inline-block; margin-top: 10px; }
    .subject-shell { padding-top: 20px; }
    .subject-shell > .breadcrumb { margin-bottom: 16px; }
    .subject-hero { padding: 18px; }
    .subject-hero h1 { font-size: clamp(24px, 7.5vw, 32px); text-wrap: balance; }
    .next-actions, .category-section, .test-section { margin-top: 32px; }
    .subject-shell .next-actions { margin-top: 24px; }
    .subject-shell .action-card { min-height: 80px; padding: 14px 16px; }
    .subject-shell .test-section .section-heading { margin-bottom: 16px; }
    .category-section { padding-top: 32px; }
    .test-section { padding-top: 32px; }
    .category-row { padding: 15px 14px; }
    .category-row + .category-row { border-top: 1px solid var(--line); }
    .category-row__content { grid-template-columns: minmax(0,1fr) auto; }
    .category-row__knowledge { grid-column: 1 / -1; width: 100%; }
    .category-row__icon { width: 42px; height: 42px; }
    .active-test { grid-template-columns: 1fr; }
    .active-test .button { width: 100%; }
    .page-account-nav { overflow-x: auto; }
    .page-account-nav__link { min-height: 48px; grid-template-columns: 24px minmax(0,1fr); padding: 7px 9px; }
    .page-account-nav__link small { display: none; }
    .panel-heading--action { align-items: start; }
    .account-usage-stats { padding: 12px 12px 0; }
    .account-stat { padding: 13px; }
    .account-stat__icon { width: 34px; height: 34px; flex-basis: 34px; }
    .account-stat strong { font-size: 21px; }
    .weekly-activity { margin: 10px 12px 14px; padding: 14px; }
    .weekly-bars { gap: 6px; }
    .identity-badge { display: none; }
    .account-panel--subscription { padding: 0; }
    .subscription-panel-heading { padding: 17px 18px; }
    .subscription-list { padding: 12px; }
    .subscription-card > header { padding: 18px 16px 16px; }
    .subscription-plan { align-items: start; }
    .subscription-facts { grid-template-columns: 1fr; margin: 0 16px 16px; }
    .subscription-facts div + div { border-top: 1px solid var(--line); border-left: 0; }
    .subscription-card__footer { align-items: stretch; flex-direction: column; padding: 14px 16px 16px; }
    .subscription-renewal-note { max-width: none; margin: 0; }
    .subscription-card__footer .button,
    .subscription-cancel-button { width: 100%; }
    .cancel-dialog__header { padding: 18px 18px 14px; }
    .cancel-dialog__body { min-height: 330px; padding: 20px 18px; }
    .cancel-dialog__footer { padding: 14px 18px 18px; }
    .choice-list { grid-template-columns: 1fr; }
    .rating-choices { gap: 8px; }
    .rating-choices span { width: 44px; height: 44px; }
    .rating-choices svg { width: 37px; }
    .app-footer__inner { gap: 10px; padding: 18px 0; flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
    .breadcrumb__desktop { display: none; }
    .home-hero__lead, .page-heading > p:last-child, .subject-hero__copy > p:last-child { font-size: 16px; }
    .continue-card { padding: 18px; }
    .continue-card__icon { display: none; }
    .continue-card__body { grid-column: 1 / -1; }
    .subject-card__arrow { display: none; }
    .subject-card { grid-template-columns: 42px minmax(0, 1fr); }
    .action-card { grid-template-columns: auto minmax(0,1fr); }
    .action-card > span:last-child { display: none; }
    .category-row__arrow { display: none; }
    .category-row { grid-template-columns: auto minmax(0,1fr); }
    .result-list a { grid-template-columns: minmax(0,1fr) 104px; gap: 12px; padding-right: 14px; padding-left: 14px; }
    .result-list a > span:last-child { display: none; }
    .result-list__icon { display: none; }
    .result-list__score { width: 104px; }
    .panel-heading--action { display: block; }
    .panel-heading--action .text-link { display: inline-block; margin-top: 10px; }
    .account-usage-stats { grid-template-columns: 1fr; }
    .weekly-activity__hint { display: none; }
    .account-logout { align-items: stretch; flex-direction: column; }
    .account-logout > span { margin: 0; }
    .logout-button { justify-content: center; }
    .result-list__score > span:first-child { justify-content: flex-end; }
    .result-list__score small { display: none; }
    .subject-shell .result-list a { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .subject-shell .result-list__score { width: 100%; }
    .subject-shell .result-list__score > span:first-child { justify-content: space-between; }
    .subject-shell .result-list__score small { display: block; font-size: 12px; }
    .login-panel { padding: 28px 20px; }
    .cancel-dialog__footer { display: grid; grid-template-columns: 1fr 1fr; }
    .cancel-dialog__footer .button--quiet { grid-column: 1 / -1; grid-row: 2; margin: 2px 0 0; }
    .cancel-dialog__footer [data-cancel-back] { grid-column: 1; grid-row: 1; }
    .cancel-dialog__footer [data-cancel-next],
    .cancel-dialog__footer [data-cancel-submit] { grid-column: 2; grid-row: 1; }
    .cancel-dialog__footer:has([data-cancel-back][hidden]) [data-cancel-next] { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; }
}

/* Server-rendered learning and test flows */
.flow-shell { max-width: 860px; }
.flow-shell[data-exam-root] { max-width: var(--content); }
.flow-card {
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 8px 28px rgba(35, 31, 74, .06);
}
.flow-heading { margin: 28px auto; }
.flow-heading--center { max-width: 650px; text-align: center; }
.flow-heading h1 { margin-bottom: 10px; font-size: clamp(29px, 4vw, 38px); }
.flow-heading > p:last-child { margin-bottom: 0; color: var(--ink-soft); font-size: 17px; }
.back-link {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    color: var(--primary-dark);
    font-size: 14px;
    font-weight: 750;
    text-decoration: none;
}
.back-link:hover { text-decoration: underline; }
.button--wide { width: 100%; }
.flow-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.flow-actions--center { justify-content: center; }
.flow-error {
    margin: 16px 0;
    padding: 12px 14px;
    border: 1px solid #f0c5c0;
    border-radius: 7px;
    color: #8f1c14;
    background: #fff2f0;
    font-size: 14px;
}
.flow-loading {
    display: flex;
    min-height: 240px;
    gap: 13px;
    align-items: center;
    justify-content: center;
    color: var(--ink-soft);
}
.flow-loading[hidden] { display: none; }
.spinner {
    width: 23px;
    height: 23px;
    border: 3px solid #ddd9fa;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: flow-spin .75s linear infinite;
}
@keyframes flow-spin { to { transform: rotate(360deg); } }

.access-card {
    max-width: 620px;
    margin: 28px auto;
    padding: 48px 36px;
    border: 1px solid #ddd8fa;
    border-radius: 18px;
    background: linear-gradient(145deg, #fff 0%, #f5f3ff 100%);
    text-align: center;
}
.access-card__icon { display: block; margin-bottom: 16px; color: var(--primary); font-size: 38px; }
.access-card > p:not(.eyebrow) { max-width: 500px; margin: 0 auto 25px; color: var(--ink-soft); }

.exercise-workspace { position: relative; }
[data-exercise-view],
[data-session-complete] { scroll-margin-top: 84px; }
.exercise-card { padding: 26px 38px 36px; }
.exercise-card__header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    margin-bottom: 24px;
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding-bottom: 20px;
}
.exercise-context {
    display: flex;
    grid-column: 1 / -1;
    gap: 11px;
    align-items: center;
    justify-content: center;
}
.exercise-context__icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid #dedafd;
    border-radius: 8px;
    background: transparent;
}
.exercise-context > span:last-child { min-width: 0; }
.exercise-context small,
.exercise-context strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exercise-context small { color: var(--ink-soft); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.exercise-context strong { margin-top: 2px; font-size: 16px; }
.review-count {
    display: inline-flex;
    gap: 5px;
    padding: 7px 10px;
    align-items: baseline;
    border: 1px solid #ddd8ff;
    border-radius: 999px;
    color: var(--primary-dark);
    background: var(--surface-accent);
    font-size: 12px;
}
.review-count strong { font-size: 15px; }
.exercise-prompt { max-width: 690px; margin: 0 auto 28px; text-align: center; }
.exercise-description { color: var(--ink-soft); line-height: 1.7; }
.exercise-question { margin-top: 8px; color: var(--ink); font-size: 18px; font-weight: 750; line-height: 1.6; }
.exercise-description > :last-child,
.exercise-question > :last-child { margin-bottom: 0; }
.answer-input { max-width: 650px; margin: 0 auto; }
.answer-input.is-disabled { opacity: .75; }
.input-guidance { color: var(--ink-soft); font-size: 14px; text-align: center; }
.answer-text,
.answer-select {
    min-height: 48px;
    padding: 10px 13px;
    border: 1px solid #c8c9d2;
    border-radius: 7px;
    color: var(--ink);
    background: #fff;
}
.answer-text:focus,
.answer-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(89, 74, 226, .12); outline: none; }
.answer-text--number { display: block; width: min(100%, 270px); margin: 0 auto; font-size: 21px; text-align: center; }
.answer-submit { margin-top: 34px; }
.option-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.answer-option {
    min-height: 56px;
    padding: 12px 15px;
    border: 1px solid #d5d4dd;
    border-radius: 8px;
    color: var(--ink);
    background: #fff;
    cursor: pointer;
    font-weight: 700;
    text-align: center;
}
.answer-option:hover { border-color: #a9a2e9; background: #faf9ff; }
.answer-option.is-selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.exercise-prompt:has(+ [data-answer-host] .answer-input--long-options) { margin-bottom: 38px; }
.answer-choice-label {
    margin: 0 0 10px;
    color: #7a7888;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.option-grid--long { grid-template-columns: 1fr; gap: 9px; }
.option-grid--long .answer-option {
    position: relative;
    display: grid;
    min-height: 0;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 13px;
    padding: 14px 16px;
    align-items: center;
    color: #3f4050;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    text-align: left;
}
.option-grid--long .answer-option::before {
    width: 18px;
    height: 18px;
    border: 1.5px solid #aaa8b7;
    border-radius: 50%;
    background: #fff;
    box-shadow: inset 0 0 0 4px #fff;
    content: "";
}
.option-grid--long .answer-option:hover { border-color: #bbb7dd; background: #fcfbff; }
.option-grid--long .answer-option.is-selected::before { border-color: var(--primary); background: var(--primary); }
.answer-option--boolean { display: flex; gap: 9px; align-items: center; justify-content: center; font-weight: 400; }
.answer-option--boolean > span { font-size: 20px; }
.answer-option--boolean > strong { font-weight: inherit; }
.time-answer { display: flex; gap: 10px; align-items: end; justify-content: center; }
.time-field { display: grid; gap: 5px; color: var(--ink-soft); font-size: 12px; font-weight: 700; text-align: center; }
.time-field .answer-text { width: 88px; text-align: center; }
.time-answer--clock .answer-text { width: 110px; font-size: 20px; }
.time-separator { padding-bottom: 10px; color: var(--ink-soft); font-size: 25px; }
.input-hint {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    padding: 11px 13px;
    border-radius: 8px;
    color: #4d5570;
    background: #f3f5fa;
    font-size: 13px;
}
.input-hint > span { display: grid; width: 21px; height: 21px; flex: 0 0 21px; place-items: center; border-radius: 50%; color: #fff; background: #68749b; font-size: 12px; font-weight: 800; }
.input-hint strong { display: block; font-size: 12px; }
.input-hint p { margin: 1px 0 0; }
.selection-grid { display: grid; gap: 9px; }
.selection-option {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    min-height: 52px;
    gap: 10px;
    padding: 11px 13px;
    align-items: center;
    border: 1px solid #d5d4dd;
    border-radius: 8px;
    cursor: pointer;
}
.selection-option:hover { border-color: #aaa4e6; }
.selection-option.is-selected { border-color: var(--primary); background: #f8f7ff; }
.selection-option input { position: absolute; opacity: 0; pointer-events: none; }
.selection-check { display: grid; width: 22px; height: 22px; place-items: center; border: 1px solid #bbb9c5; border-radius: 5px; color: #fff; }
.selection-check svg {
    display: block;
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0;
}
.selection-option.is-selected .selection-check { border-color: var(--primary); color: #fff; background: var(--primary); }
.selection-option.is-selected .selection-check svg { opacity: 1; }
.ordering-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ordering-caption {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    margin: 2px 4px 9px;
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}
.ordering-caption span:nth-child(2) { text-align: center; }
.ordering-caption span:last-child { text-align: right; }
.ordering-row {
    position: relative;
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    min-height: 54px;
    gap: 10px;
    padding: 9px 10px;
    align-items: center;
    border: 1px solid #d8d7df;
    border-radius: 8px;
    background: #fff;
    transition: border-color .16s ease, box-shadow .16s ease, opacity .16s ease, transform .16s ease;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.ordering-row:active { cursor: grabbing; }
.ordering-row.dragging { opacity: .38; }
.ordering-row.drop-target { border-color: #aaa4e6; background: #faf9ff; }
.ordering-row.drop-before::before,
.ordering-row.drop-after::after {
    position: absolute;
    right: 8px;
    left: 8px;
    height: 3px;
    border-radius: 999px;
    background: var(--primary);
    content: "";
}
.ordering-row.drop-before::before { top: -6px; }
.ordering-row.drop-after::after { bottom: -6px; }
.ordering-position { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; color: var(--primary-dark); background: var(--primary-soft); font-weight: 800; }
.ordering-handle {
    display: grid;
    width: 44px;
    height: 44px;
    margin: -4px;
    place-items: center;
    color: #777485;
    cursor: grab;
    letter-spacing: -3px;
    touch-action: none;
    user-select: none;
}
.ordering-actions { display: flex; gap: 4px; }
.ordering-actions button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; }
.ordering-actions button:disabled { opacity: .35; cursor: default; }
.matching-list { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.matching-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, .8fr); gap: 15px; padding: 13px; align-items: center; }
.matching-row + .matching-row { border-top: 1px solid var(--line); }
.matching-term { font-weight: 700; }
.answer-select { width: 100%; }
.fill-blanks-card { padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: #fbfbfd; font-size: 16px; line-height: 3.2; }
.blank-select { width: auto; min-width: 135px; margin: 0 5px; padding: 7px 9px; border: 1px solid #aaa7ba; border-radius: 6px; color: var(--primary-dark); background: #fff; font-weight: 700; }

.structured-input-state { display: grid; gap: 16px; }
.input-progress {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 7px 14px;
    align-items: center;
    color: #5f6072;
    font-size: 12px;
}
.input-progress strong { color: #3c3d4b; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.input-progress__track { grid-column: 1 / -1; height: 5px; overflow: hidden; border-radius: 999px; background: #eeedf3; }
.input-progress__track i { display: block; height: 100%; border-radius: inherit; background: var(--primary); transition: width .22s ease; }
.answer-bank,
.category-item-bank {
    padding: 15px;
    border: 1px solid #dfdde8;
    border-radius: 11px;
    background: #faf9fc;
}
.bank-heading,
.cloze-card > h3,
.category-drop-zone h3 { margin: 0; min-width: 0; color: #656477; font-size: 11px; font-weight: 800; line-height: 1.4; letter-spacing: .08em; text-transform: uppercase; overflow-wrap: anywhere; }
.bank-options,
.category-items { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.bank-option,
.category-item {
    border: 1px solid #cfccd9;
    border-radius: 8px;
    color: #343542;
    background: #fff;
    box-shadow: 0 2px 5px rgba(35, 34, 49, .04);
    font: inherit;
    font-size: 14px;
    font-weight: 650;
    touch-action: pan-y;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.bank-option { display: flex; min-height: 40px; padding: 0; align-items: stretch; cursor: grab; }
.structured-drag-handle {
    display: grid;
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    flex: 0 0 44px;
    align-self: stretch;
    place-items: center;
    color: #777485;
    cursor: grab;
    letter-spacing: -3px;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.structured-drag-handle:active { cursor: grabbing; }
.bank-option__select {
    min-width: 0;
    flex: 1;
    padding: 10px 13px 10px 2px;
    border: 0;
    color: inherit;
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 650;
    text-align: left;
}
.bank-option:hover,
.category-item:hover { border-color: #aaa4e6; }
.bank-option.selected,
.category-item.selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 2px rgba(88, 72, 222, .11); }
.bank-option.assigned,
.bank-option.used { color: #6d6b79; background: #f3f2f6; }
.bank-option.dragging,
.category-item.dragging { opacity: .36; }
.structured-drag-ghost {
    position: fixed;
    z-index: 10000;
    width: min(310px, 62vw);
    margin: 0;
    padding: 10px 13px;
    pointer-events: none;
    opacity: .95;
    border: 1px solid var(--primary);
    border-radius: 8px;
    color: #302d5f;
    background: #fff;
    box-shadow: 0 14px 32px rgba(43, 39, 89, .2);
    font-size: 14px;
    font-weight: 700;
    transform: rotate(1deg);
}
.structured-drag-ghost .structured-drag-handle { display: none; }
.structured-drag-ghost .bank-option__select { padding: 0; }
.ordering-drag-ghost { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 10px; align-items: center; }
.ordering-drag-ghost .ordering-actions,
.category-drag-ghost .category-item__clear { display: none; }

.matching-rows { display: grid; gap: 8px; }
.match-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 24px minmax(210px, 1fr) auto;
    min-height: 62px;
    gap: 10px;
    padding: 10px;
    align-items: center;
    border: 1px solid #dedce5;
    border-radius: 10px;
    background: #fff;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.match-row.drop-target { border-color: var(--primary); background: #faf9ff; box-shadow: 0 0 0 3px rgba(88, 72, 222, .09); }
.match-term { display: flex; gap: 10px; align-items: center; }
.pair-number { display: grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; border-radius: 50%; color: var(--primary-dark); background: var(--primary-soft); font-size: 12px; font-weight: 800; }
.pair-connector { color: #aaa7b5; font-size: 18px; text-align: center; }
.match-target {
    min-height: 42px;
    padding: 9px 12px;
    border: 1px dashed #bdb9ca;
    border-radius: 8px;
    color: #757385;
    background: #fafafd;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    text-align: left;
}
.match-target.is-filled { border-style: solid; border-color: #bab5e6; color: #393552; background: #f7f5ff; font-weight: 700; }
.match-clear,
.category-item__clear { display: grid; width: 30px; height: 30px; padding: 0; place-items: center; border: 0; border-radius: 50%; color: #777485; background: transparent; cursor: pointer; font-size: 19px; }
.match-clear:hover,
.category-item__clear:hover { color: #9b3029; background: #feecea; }

.cloze-card { padding: 22px; border: 1px solid #dedce5; border-radius: 12px; background: #fff; }
.cloze-text { margin-top: 13px; color: #30313d; font-size: 16px; line-height: 2.9; }
.cloze-blank {
    min-width: 112px;
    margin: 3px 4px;
    padding: 7px 11px;
    border: 1px dashed #aaa6ba;
    border-radius: 7px;
    color: #706e7e;
    background: #fafafd;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    vertical-align: middle;
}
.cloze-blank.is-filled { border-style: solid; border-color: #aaa4e6; color: var(--primary-dark); background: var(--primary-soft); }
.cloze-blank.drop-target { border-color: var(--primary); color: var(--primary-dark); background: #efedff; box-shadow: 0 0 0 3px rgba(88, 72, 222, .11); }

.category-item-bank.drop-target,
.category-drop-zone.drop-target { border-color: var(--primary); background: #f8f7ff; box-shadow: 0 0 0 3px rgba(88, 72, 222, .09); }
.category-drop-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.category-drop-zone { min-height: 130px; padding: 14px; border: 1px solid #dedce5; border-radius: 11px; background: #fff; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.category-drop-zone header { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.category-drop-zone header h3 { flex: 1 1 140px; }
.category-place { padding: 6px 8px; border: 0; border-radius: 6px; color: var(--primary-dark); background: var(--primary-soft); cursor: pointer; font-size: 11px; font-weight: 700; }
.category-place:disabled { color: #9693a2; background: #f2f1f5; cursor: default; }
.category-item { position: relative; display: flex; min-height: 40px; align-items: center; cursor: grab; }
.category-item__select { min-width: 0; flex: 1; padding: 9px 12px 9px 2px; border: 0; color: inherit; background: transparent; cursor: pointer; font: inherit; font-size: 14px; font-weight: 650; text-align: left; }
.category-item__clear { margin-right: 5px; flex: 0 0 30px; }
.category-item.category-drag-ghost { position: fixed; display: flex; align-items: center; cursor: grabbing; }
.category-drag-ghost .category-item__select { padding: 0; }
.answer-input.drag-active,
.answer-input.drag-active * { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.drop-empty { width: 100%; margin: 4px 0; color: #9693a2; font-size: 13px; font-style: italic; }
.choice-grid-scroll { overflow-x: auto; }
.exam-workspace .answer-input--choice-grid { max-width: none; }
.choice-grid { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: 9px; }
.choice-grid th,
.choice-grid td { padding: 10px; border-bottom: 1px solid var(--line); text-align: center; }
.choice-grid th:first-child { text-align: left; }
.choice-grid tr:last-child > * { border-bottom: 0; }
.choice-grid thead { background: var(--surface-soft); }
.choice-grid label { display: grid; min-width: 58px; place-items: center; cursor: pointer; }
.choice-grid input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }
.choice-grid label span { display: none; }

.pre-answer-tools { display: flex; margin: 13px 0; justify-content: center; }
.text-button { padding: 9px 12px; border: 0; border-radius: 6px; color: var(--primary-dark); background: transparent; cursor: pointer; font-weight: 700; }
.text-button:hover { background: var(--primary-soft); }
.solution-panel {
    margin-top: 14px;
    padding: 24px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}
.solution-heading { display: flex; gap: 8px; margin-bottom: 13px; align-items: center; color: #45506c; }
.solution-heading h2 { margin: 0; font-size: 17px; }
.answer-result { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.answer-result__header { display: flex; gap: 12px; margin-bottom: 16px; align-items: center; }
.answer-result__header strong,
.answer-result__header small { display: block; }
.answer-result__header small { color: var(--ink-soft); font-size: 13px; }
.answer-state,
.result-state { display: grid; width: 40px; height: 40px; flex: 0 0 40px; place-items: center; border-radius: 50%; font-size: 23px; font-weight: 800; }
.is-correct > .answer-result__header .answer-state,
.result-state.is-correct { color: #14634f; background: #e1f5ed; }
.is-incorrect > .answer-result__header .answer-state,
.result-state.is-incorrect { color: #a22c23; background: #feeae7; }
.answer-comparison {
    display: grid;
    width: min(100%, 760px);
    gap: 7px;
}
.answer-comparison__item {
    position: relative;
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 14px;
    padding: 10px 13px;
    align-items: baseline;
    border: 1px solid #e5e4e9;
    border-radius: 8px;
    background: #fbfbfc;
}
.answer-comparison__item::before { width: 6px; height: 6px; border-radius: 50%; background: #9d9aa7; content: ""; }
.answer-comparison__item.is-correct::before { background: #4f8a79; }
.answer-comparison__item.is-incorrect::before { background: #b86a64; }
.answer-comparison__item::before { position: absolute; top: 17px; left: 13px; }
.answer-comparison span,
.answer-comparison strong { display: block; }
.answer-comparison span {
    padding-left: 12px;
    color: #777684;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.answer-comparison strong {
    color: #41414d;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
.answer-comparison--long .answer-comparison__item { padding-block: 11px; align-items: start; }
.answer-comparison--long strong {
    color: #4a4a56;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
}
.inline-solution { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); overflow-x: auto; }
.result-help-button { display: block; width: fit-content; margin: 24px auto; }
.result-help-button + .knowledge-update { margin-top: 0; }
.knowledge-update {
    position: relative;
    display: grid;
    gap: 18px;
    margin-top: 24px;
    padding: 20px;
    overflow: hidden;
    border: 1px solid #dedaff;
    border-radius: 16px;
    background: #f7f6ff;
    box-shadow: 0 10px 26px rgba(55, 43, 143, .08), inset 0 1px 0 rgba(255, 255, 255, .9);
    animation: knowledge-card-in .45s ease both;
}
.knowledge-update::before {
    position: absolute;
    top: -24px;
    right: -18px;
    width: 132px;
    height: 132px;
    border-radius: 50%;
    background-image: radial-gradient(rgba(89, 74, 226, .22) 1px, transparent 1px);
    background-size: 11px 11px;
    content: "";
    opacity: .65;
    pointer-events: none;
}
.knowledge-update__heading {
    position: relative;
    display: flex;
    gap: 18px;
    align-items: center;
    justify-content: space-between;
}
.knowledge-update__identity { display: flex; min-width: 0; gap: 12px; align-items: center; }
.knowledge-update__identity > div { min-width: 0; }
.knowledge-update__icon {
    display: grid;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    place-items: center;
    border: 1px solid rgba(89, 74, 226, .15);
    border-radius: 13px;
    color: var(--primary);
    background: transparent;
    font-size: 21px;
}
.knowledge-update__eyebrow {
    display: block;
    margin-bottom: 3px;
    color: var(--primary-dark);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .11em;
    text-transform: uppercase;
}
.knowledge-update__eyebrow i { font-size: 12px; font-style: normal; }
.knowledge-update__identity strong {
    display: block;
    overflow: hidden;
    color: #25253a;
    font-size: 16px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.knowledge-update__identity > div { min-width: 0; }
.knowledge-update__score { position: relative; display: grid; flex: 0 0 auto; justify-items: end; line-height: 1; }
.knowledge-update__score > span { color: var(--primary-dark); font-size: 18px; font-weight: 750; }
.knowledge-update__score strong { font-size: 31px; letter-spacing: -.04em; }
.knowledge-update__meter { position: relative; }
.knowledge-update__track {
    position: relative;
    height: 13px;
    border: 1px solid rgba(89, 74, 226, .09);
    border-radius: 999px;
    background: rgba(255, 255, 255, .82);
    box-shadow: inset 0 2px 4px rgba(43, 35, 91, .07);
}
.knowledge-update__fill {
    display: block;
    width: var(--knowledge-progress);
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
    box-shadow: 0 0 12px rgba(89, 74, 226, .28);
    animation: knowledge-meter-grow .85s cubic-bezier(.22, .8, .26, 1) both .12s;
}
.knowledge-update__marker {
    position: absolute;
    top: 50%;
    left: clamp(6px, var(--knowledge-progress), calc(100% - 6px));
    z-index: 3;
    width: 17px;
    height: 17px;
    border: 4px solid #fff;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 2px 7px rgba(54, 42, 139, .34);
    transform: translate(-50%, -50%);
    animation: knowledge-marker-in .35s ease both .72s;
}
.knowledge-update { grid-template-columns: minmax(0, 1fr); }
.knowledge-update__change {
    position: absolute;
    inset-block: 0;
    left: var(--knowledge-change-start);
    width: var(--knowledge-change-size);
    border-radius: 999px;
    background: repeating-linear-gradient(120deg, #a4ddc5 0 3px, #def3e9 3px 6px);
}
.knowledge-update.is-loss .knowledge-update__change {
    background: repeating-linear-gradient(120deg, #e8b998 0 3px, #fae2d0 3px 6px);
}
.knowledge-update__previous {
    position: absolute;
    top: -4px;
    left: clamp(1px, var(--knowledge-previous), calc(100% - 1px));
    width: 2px;
    height: 19px;
    background: #655d7e;
    transform: translateX(-50%);
}
.knowledge-update__labels { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; color: #706b7d; font-size: 11px; }
.knowledge-update__labels strong { color: var(--primary-dark); font-weight: 750; }
.knowledge-update.has-change .knowledge-update__marker { animation: knowledge-marker-move .85s cubic-bezier(.22, .8, .26, 1) both .12s; }
@keyframes knowledge-marker-move {
    from { left: clamp(6px, var(--knowledge-previous), calc(100% - 6px)); }
}
.knowledge-update__status {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 9px;
    padding: 11px 13px;
    border: 1px solid rgba(89, 74, 226, .1);
    border-radius: 10px;
    background: rgba(255, 255, 255, .68);
}
.knowledge-update__status > span {
    display: grid;
    width: 25px;
    height: 25px;
    grid-row: 1 / 3;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--primary);
    font-size: 13px;
    font-weight: 850;
}
.knowledge-update__status p { margin: 0; color: #34334c; font-size: 12px; font-weight: 800; }
.knowledge-update__status small { color: #706b7d; font-size: 11px; }
.next-exercise { display: flex; margin: 28px 0 0 auto; }
.session-complete { padding: 45px 20px; text-align: center; }
.session-complete__icon { display: grid; width: 56px; height: 56px; margin: 0 auto 17px; place-items: center; border-radius: 50%; color: #fff; background: var(--success); font-size: 27px; }
.session-complete > p:not(.eyebrow) { max-width: 520px; margin: 0 auto 24px; color: var(--ink-soft); }

.structured-feedback { display: grid; gap: 14px; }
.cloze-review {
    padding: 17px 19px 18px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fbfbfd;
}
.cloze-review__label {
    display: block;
    margin-bottom: 8px;
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}
.cloze-review p { margin: 0; color: #343443; font-size: 16px; line-height: 2.15; overflow-wrap: anywhere; }
.cloze-review__answer {
    padding: 3px 8px;
    border-radius: 6px;
    box-decoration-break: clone;
    font-weight: 750;
    -webkit-box-decoration-break: clone;
}
.cloze-review__answer.is-correct { color: #12634d; background: #e4f4ed; }
.cloze-review__answer.is-incorrect { color: #992d25; background: #fde8e5; }
@keyframes knowledge-card-in {
    from { opacity: 0; transform: translateY(8px); }
}

@keyframes knowledge-meter-grow {
    from { width: var(--knowledge-previous, 0%); }
}

@keyframes knowledge-marker-in {
    from { opacity: 0; transform: translate(-50%, -50%) scale(.55); }
}

.exam-setup { max-width: 780px; margin: 0 auto; }
.exam-scope { display: grid; gap: 14px; margin: 0; padding: 0; border: 0; }
.scope-option {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: 12px;
    padding: 17px;
    align-items: start;
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
}
.scope-option:hover { border-color: #b7b0ed; }
.scope-option.is-selected { border-color: var(--primary); background: #f8f7ff; box-shadow: inset 0 0 0 1px var(--primary); }
.scope-option input { position: absolute; opacity: 0; }
.scope-option__marker { width: 20px; height: 20px; border: 2px solid #aaa7ba; border-radius: 50%; }
.scope-option.is-selected .scope-option__marker { border: 6px solid var(--primary); }
.scope-option strong,
.scope-option small,
.scope-option em { display: block; }
.scope-option small { margin-top: 2px; color: var(--ink-soft); }
.scope-option em { margin-top: 6px; color: var(--primary-dark); font-size: 12px; font-style: normal; font-weight: 700; }
.category-picker { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.category-picker > header { display: flex; padding: 13px 15px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.category-picker > header strong,
.category-picker > header small { display: block; }
.category-picker > header small,
.category-picker > header > span:last-child { color: var(--ink-soft); font-size: 12px; }
.category-picker__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; }
.category-choice { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; min-height: 60px; gap: 10px; padding: 10px; align-items: center; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.category-choice:hover { border-color: #b7b0ed; }
.category-choice.is-selected { border-color: var(--primary); background: #f8f7ff; }
.category-choice input { position: absolute; opacity: 0; }
.category-choice__icon { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid #dedafd; border-radius: 6px; background: transparent; }
.category-choice strong,
.category-choice small { display: block; }
.category-choice strong { font-size: 13px; }
.category-choice small { color: var(--ink-soft); font-size: 11px; }
.category-choice__check { display: grid; width: 21px; height: 21px; box-sizing: border-box; place-items: center; border: 1px solid #c4c1ce; border-radius: 4px; color: transparent; }
.category-choice__check::after { width: 6px; height: 11px; box-sizing: border-box; border: solid #fff; border-width: 0 2px 2px 0; content: ""; opacity: 0; transform: translateY(-1px) rotate(45deg); }
.category-choice.is-selected .category-choice__check { border-color: var(--primary); background: var(--primary); }
.category-choice.is-selected .category-choice__check::after { opacity: 1; }
.exam-size-note { margin: 18px 0; color: var(--ink-soft); text-align: center; }
.exam-workspace { padding: 30px 46px 40px; }
.exam-header { display: flex; gap: 20px; align-items: start; justify-content: space-between; }
.exam-position { color: var(--ink-soft); font-size: 13px; font-weight: 750; }
.exam-title { margin-bottom: 22px; }
.exam-progress { height: 8px; margin: 20px auto 0; overflow: hidden; border-radius: 999px; background: #eae9ef; }
.exam-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--primary); transition: width .2s ease; }
.exam-exercises { min-height: 360px; }
.exam-exercise { padding: 34px 0 40px; }
.exam-exercise[hidden] { display: none; }
.exam-exercise > header { display: flex; margin-bottom: 17px; align-items: center; justify-content: center; }
.exam-exercise h2 { margin: 0; font-size: 22px; }
.exam-exercise h2:focus { outline: 0; }
.exam-exercise__prompt { margin-bottom: 22px; text-align: center; }
.exam-exercise__prompt > div { color: var(--ink-soft); }
.exam-exercise__prompt > strong { display: block; margin-top: 8px; font-size: 17px; line-height: 1.55; }
.exam-submit { padding-top: 25px; border-top: 1px solid var(--line); text-align: center; }
.exam-submit > p { margin: 10px 0 0; color: var(--ink-soft); font-size: 13px; }
.exam-navigation__actions { display: flex; gap: 12px; justify-content: center; }
.exam-navigation__actions [data-submit-exam] { min-width: 220px; }
.autosave-status { font-size: 12px !important; }

.web-calculator { position: fixed; right: 22px; bottom: 22px; z-index: 15; }
.calculator-toggle { display: grid; width: 52px; height: 52px; margin: 10px 0 0 auto; place-items: center; border: 0; border-radius: 50%; color: #fff; background: #2d2d3d; box-shadow: 0 7px 20px rgba(20,20,35,.2); cursor: pointer; font-size: 22px; }
.calculator-toggle svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.calculator-panel { width: 260px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 14px 38px rgba(20,20,35,.2); }
.calculator-display { width: 100%; min-height: 52px; margin-bottom: 8px; padding: 10px; border: 0; border-radius: 7px; color: var(--ink); background: #f2f2f6; font-size: 22px; font-weight: 700; text-align: right; }
.calculator-display:focus-visible { outline: 2px solid rgba(89, 74, 226, .5); outline-offset: 1px; }
.calculator-keyboard-hint { margin: 0 0 9px; color: var(--ink-soft); font-size: 10px; text-align: center; }
.calculator-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.calculator-keys button { min-height: 42px; border: 0; border-radius: 6px; background: #f2f2f6; cursor: pointer; font-weight: 700; }
.calculator-keys button:hover { background: #e8e6f7; }
.calculator-keys .is-operator { color: #fff; background: var(--primary); }

.result-shell { max-width: 900px; }
.result-card { padding: 30px 46px 42px; }
.result-hero { padding: 35px 0 42px; text-align: center; }
.result-score-ring { position: relative; display: grid; width: 170px; height: 170px; margin: 28px auto 23px; place-content: center; border-radius: 50%; background: conic-gradient(var(--primary) calc(var(--score) * 1%), var(--primary-soft) 0); }
.result-score-ring::before { position: absolute; content: ""; inset: 10px; border-radius: inherit; background: var(--surface); box-shadow: inset 0 0 0 2px #d7d2fb; }
.result-score-ring strong,
.result-score-ring span { position: relative; z-index: 1; }
.result-score-ring strong { color: var(--primary-dark); font-size: 45px; line-height: 1; }
.result-score-ring span { margin-top: 5px; color: var(--ink-soft); font-size: 12px; }
.result-jump-list { display: flex; gap: 7px; flex-wrap: wrap; justify-content: center; }
.result-jump-list a { display: grid; width: 36px; height: 36px; place-items: center; border: 2px solid; border-radius: 8px; font-size: 13px; font-weight: 800; text-decoration: none; }
.result-jump-list a.is-correct { border-color: #8fcab8; color: #17654f; background: #edf9f5; }
.result-jump-list a.is-incorrect { border-color: #e7aaa4; color: #9b2d25; background: #fff3f1; }
.result-exercise { padding: 38px 0; border-top: 1px solid var(--line); scroll-margin-top: 85px; }
.result-exercise > header { display: flex; gap: 12px; margin-bottom: 19px; align-items: center; }
.result-exercise > header .eyebrow { margin-bottom: 2px; }
.result-exercise h2 { margin: 0; font-size: 22px; }
.result-exercise__prompt { width: min(100%, 760px); margin-bottom: 20px; text-align: left; }
.result-exercise__prompt > div { color: var(--ink-soft); }
.result-exercise__prompt > strong { display: block; margin-top: 7px; }
.result-breakdown { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.result-breakdown__summary {
    display: flex;
    gap: 5px;
    margin: 0;
    padding: 10px 14px;
    align-items: baseline;
    color: var(--ink-soft);
    background: var(--surface-soft);
    font-size: 12px;
}
.result-breakdown__summary strong { color: var(--ink); font-size: 13px; }
.result-breakdown__summary.is-correct strong { color: #17654f; }
.result-breakdown__summary.is-incorrect strong { color: #9b2d25; }
.result-breakdown__row {
    display: grid;
    grid-template-columns: minmax(220px, .9fr) minmax(300px, 1.45fr);
    gap: 24px;
    padding: 15px 16px;
    align-items: center;
}
.result-breakdown__row + .result-breakdown__row { border-top: 1px solid var(--line); }
.result-breakdown__row.is-correct { background: #fcfdfd; }
.result-breakdown__row.is-incorrect { background: #fffafa; box-shadow: inset 3px 0 #d78078; }
.result-breakdown__item { display: flex; gap: 10px; min-width: 0; align-items: flex-start; }
.result-breakdown__item strong { color: #3f3f4b; line-height: 1.4; overflow-wrap: anywhere; }
.result-breakdown__state {
    display: grid;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    margin-top: 1px;
    place-items: center;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 800;
}
.result-breakdown__row.is-correct .result-breakdown__state { color: #14634f; background: #e1f5ed; }
.result-breakdown__row.is-incorrect .result-breakdown__state { color: #a22c23; background: #feeae7; }
.result-breakdown__answers {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}
.result-breakdown__row.is-correct .result-breakdown__answers { grid-template-columns: minmax(0, 1fr); }
.result-breakdown__answer { display: grid; min-width: 0; gap: 2px; }
.result-breakdown__answer-label {
    color: var(--ink-soft);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .055em;
    text-transform: uppercase;
}
.result-breakdown__answer-value { color: #444450; line-height: 1.4; overflow-wrap: anywhere; }
.result-breakdown__answer.is-submitted .result-breakdown__answer-value { color: #8f3b34; text-decoration: line-through; text-decoration-color: #d9a09b; }
.result-breakdown__answer.is-correct .result-breakdown__answer-value { color: #17654f; font-weight: 650; }
.result-breakdown__arrow { color: #9b98a6; font-size: 18px; }
.result-solution { margin-top: 18px; border: 1px solid var(--line); border-radius: 9px; background: #fbfbfd; }
.result-solution summary { display: flex; padding: 12px 14px; align-items: center; justify-content: space-between; color: var(--primary-dark); cursor: pointer; font-weight: 750; list-style: none; }
.result-solution summary::-webkit-details-marker { display: none; }
.result-solution[open] summary span { transform: rotate(180deg); }
.result-solution > div { padding: 15px; border-top: 1px solid var(--line); overflow-x: auto; }
.result-footer { display: flex; gap: 10px; padding-top: 30px; justify-content: center; border-top: 1px solid var(--line); }

@media (max-width: 680px) {
    .flow-card { padding: 22px 18px; border-radius: 14px; }
    .exercise-card { padding: 18px 16px 25px; }
    .exercise-card__header { grid-template-columns: 1fr; }
    .review-count { grid-row: 1; justify-self: end; }
    .exercise-card__header > .back-link { grid-row: 1; }
    .exercise-context { justify-content: flex-start; }
    .option-grid { grid-template-columns: 1fr; }
    .time-answer { gap: 5px; }
    .time-field .answer-text { width: 64px; }
    .time-answer--clock .answer-text { width: 86px; }
    .matching-row { grid-template-columns: 1fr; gap: 6px; }
    .match-row { grid-template-columns: minmax(0, 1fr) auto; }
    .match-term { grid-column: 1 / -1; }
    .pair-connector { display: none; }
    .match-target { grid-column: 1; }
    .ordering-row { grid-template-columns: auto auto minmax(0, 1fr) auto; }
    .ordering-actions { flex-direction: column; }
    .ordering-actions button { width: 30px; height: 28px; }
    .category-drop-grid { grid-template-columns: 1fr; }
    .bank-options { display: grid; grid-template-columns: 1fr; }
    .bank-option { text-align: left; }
    .cloze-card { padding: 16px; }
    .cloze-text { font-size: 15px; line-height: 2.65; }
    .category-picker__grid { grid-template-columns: 1fr; }
    .exam-workspace { padding: 20px 16px 30px; }
    .exam-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
    .exam-exercises { min-height: 0; }
    .exam-exercise { padding: 28px 0 32px; }
    .exam-navigation__actions .button { width: 100%; min-width: 0; }
    .answer-comparison { width: 100%; }
    .result-breakdown__row { grid-template-columns: minmax(0, 1fr); gap: 11px; padding: 14px; }
    .result-breakdown__answers { padding-left: 32px; }
    .result-breakdown__row.is-incorrect .result-breakdown__answers { grid-template-columns: minmax(0, 1fr); gap: 7px; }
    .result-breakdown__row.is-incorrect .result-breakdown__arrow { display: none; }
    .knowledge-update { gap: 15px; padding: 17px 15px; }
    .knowledge-update__heading { align-items: flex-start; }
    .knowledge-update__icon { width: 40px; height: 40px; flex-basis: 40px; border-radius: 11px; }
    .knowledge-update__identity strong { max-width: 170px; font-size: 14px; }
    .knowledge-update__score strong { font-size: 27px; }
    .result-card { padding: 20px 16px 30px; }
    .result-hero { padding: 30px 0; }
    .result-footer { flex-direction: column; }
    .web-calculator { right: 12px; bottom: 12px; }
    .calculator-panel { width: min(260px, calc(100vw - 24px)); }
}

@media (prefers-reduced-motion: reduce) {
    .knowledge-update,
    .knowledge-update__fill,
    .knowledge-update__marker,
    .knowledge-update.has-change .knowledge-update__marker { animation: none; }
}

@media (pointer: coarse) {
    .calculator-keyboard-hint { display: none; }
}

/* Server-rendered public pages */
.narrow-shell { max-width: 780px; }
.content-panel {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
.page-heading--with-icon { display: flex; gap: 18px; align-items: flex-start; }
.page-heading--with-icon .subject-icon { flex: 0 0 48px; }
.form-stack { display: grid; gap: 18px; }
.form-stack > .button { justify-self: start; }
.field { display: grid; gap: 7px; color: var(--ink); font-size: 14px; font-weight: 700; }
.field input,
.field textarea,
.field select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #cfd0d8;
    border-radius: 6px;
    color: var(--ink);
    background: #fff;
    font-weight: 450;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus,
.field textarea:focus,
.field select:focus { border-color: var(--primary); outline: 3px solid rgba(89,74,226,.15); }
.field input:disabled,
.field textarea:disabled { color: var(--ink-soft); background: #f1f1f4; }
.field small,
.field-hint { margin: 0; color: var(--ink-soft); font-size: 12px; font-weight: 450; }
.field-error,
.validation-summary { color: var(--danger); font-size: 13px; font-weight: 600; }
.field-error:empty,
.validation-summary:empty { display: none; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.check-field { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check-field input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--primary); }
.check-field a,
.text-link,
.notice a { color: var(--primary-dark); font-weight: 700; }
.button--full { width: 100%; }
.notice { padding: 13px 15px; border: 1px solid var(--line); border-radius: 8px; background: #f8f9fb; }
.notice--info { border-color: #cbc5fb; background: #f7f5ff; }
.notice--success { border-color: #aad8ca; color: #0e6553; background: #f0faf7; }
.notice--warning { border-color: #ead3b2; color: #7a4708; background: #fff9ef; }
.notice--error { border-color: #edb8b3; color: #8e241c; background: #fff5f4; }
.success-state,
.pricing-card,
.install-card { text-align: center; }
.success-state .button { margin-top: 12px; }
.status-icon { display: grid; width: 52px; height: 52px; margin: 0 auto 18px; place-items: center; border-radius: 50%; color: var(--primary-dark); background: var(--primary-soft); font-size: 25px; font-weight: 800; }
.status-icon--success { color: #fff; background: var(--success); }
.status-icon--error { color: #fff; background: var(--danger); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 34px; }
.stat-card { display: flex; min-height: 142px; padding: 18px; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.stat-card > span { color: var(--ink-soft); font-size: 13px; }
.stat-card strong { margin-top: auto; font-size: 24px; }
.stat-card small { color: var(--ink-soft); }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chart-grid h2 { font-size: 19px; }
.chart-frame { position: relative; height: 280px; }
.chart-frame canvas { width: 100%; height: 100%; }
.avatar { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid #c8c1fb; border-radius: 50%; color: var(--primary-dark); background: #fff; font-size: 11px; font-weight: 800; }
.business-login { max-width: 500px; margin: 0 auto; }
.business-login .form-stack { margin-top: 24px; text-align: left; }
.price-note { color: var(--ink-soft); font-size: 13px; text-align: center; }
.pricing-card,
.install-card { padding: 30px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.pricing-card > p:not(.eyebrow) { color: var(--ink-soft); }
.feature-list { display: grid; gap: 10px; max-width: 500px; margin: 28px auto; padding: 0; text-align: left; list-style: none; }
.feature-list li { display: flex; gap: 10px; align-items: center; }
.feature-list li > span { display: grid; width: 25px; height: 25px; flex: 0 0 25px; place-items: center; border-radius: 50%; color: #fff; background: var(--success); font-size: 13px; font-weight: 800; }
.price-block { display: grid; gap: 1px; margin: 28px 0; }
.price-block span,
.price-block small { color: var(--ink-soft); }
.price-block strong { color: var(--primary-dark); font-size: 36px; }
.checkout-form { display: grid; gap: 17px; }
.checkout-form .check-field { justify-self: center; text-align: left; }
.checkout-form > small { color: var(--ink-soft); }
.vipps-continue-button { display: block; width: min(100%, 214px); min-height: 43px; margin: 0 auto; padding: 0; border: 0; border-radius: 5px; color: #fff; background: #ff5b24; cursor: pointer; font-weight: 700; line-height: 1; }
.vipps-continue-button img { display: block; width: 100%; height: auto; }
.vipps-continue-button:hover { filter: brightness(.96); }

.referral-promotion {
    position: relative;
    display: flex;
    gap: 20px;
    align-items: center;
    margin: 32px 0;
    padding: 24px 80px 24px 24px;
    border: 1px solid #dcd6fb;
    border-radius: 18px;
    background: #f0edff;
}
.referral-promotion__icon {
    display: grid;
    width: 54px;
    height: 58px;
    flex: 0 0 54px;
    place-items: center;
    border: 1px solid #f2dfac;
    border-radius: 16px;
    color: #594199;
    background: #fff0c5;
    transform: rotate(-6deg);
}
.referral-promotion__icon svg { width: 34px; height: 34px; }
.referral-promotion__copy { flex: 1; min-width: 0; }
.referral-promotion h2 { margin: 0 0 6px; color: var(--ink); font-size: 20px; line-height: 1.3; letter-spacing: -.025em; }
.referral-promotion p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }
.referral-promotion p strong { color: var(--primary-dark); font-weight: 650; }
.referral-promotion__actions { display: grid; flex-shrink: 0; text-align: center; }
.referral-promotion__dismiss-form { position: absolute; top: 8px; right: 8px; margin: 0; }
.referral-promotion__dismiss { display: grid; width: 44px; height: 44px; padding: 12px; place-items: center; border: 0; border-radius: 8px; color: var(--ink-soft); background: transparent; cursor: pointer; }
.referral-promotion__dismiss svg { width: 20px; height: 20px; }
.referral-promotion__dismiss:hover { color: var(--primary-dark); background: #e5dfff; }
.referral-promotion__dismiss:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.referral-promotion__dismiss:disabled { opacity: .6; cursor: wait; }
.referral-promotion .referral-promotion__error { max-width: 220px; color: var(--danger); font-size: 12px; }
@media (max-width: 700px) {
    .referral-promotion { flex-wrap: wrap; gap: 16px; padding: 20px; margin: 28px 0; }
    .referral-promotion__icon { width: 42px; height: 46px; flex-basis: 42px; border-radius: 12px; }
    .referral-promotion__icon svg { width: 28px; height: 28px; }
    .referral-promotion__copy { padding-right: 40px; }
    .referral-promotion h2 { font-size: 18px; }
    .referral-promotion__actions { width: 100%; }
}

/* Kogny Pro */
.pro-payment-page { background: #fbfbfd; }
.pro-shell { --pro-notice-gap: 48px; max-width: 1080px; padding-top: 72px; }
.pro-shell:has(> .pro-access-notice) { padding-top: var(--pro-notice-gap); }
.pro-page-notice { margin: 0 0 24px; }
.pro-invitation {
    display: flex;
    gap: 32px;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 56px;
    padding: 30px 32px;
    overflow: hidden;
    border: 1px solid #6555dd;
    border-radius: 22px;
    color: #fff;
    background: #5140cb;
    box-shadow: 0 12px 32px -16px rgb(64 50 197 / 45%);
}
.pro-invitation__welcome { display: flex; min-width: 0; gap: 22px; align-items: center; }
.pro-invitation__icon {
    display: grid;
    width: 68px;
    height: 72px;
    flex: 0 0 68px;
    place-items: center;
    border: 1px solid #fff0be;
    border-radius: 20px;
    color: #594199;
    background: #fff0c5;
    box-shadow: 0 6px 16px rgb(27 16 84 / 16%);
    transform: rotate(-7deg);
}
.pro-invitation__icon svg { width: 40px; height: 40px; }
.pro-invitation__copy { min-width: 0; }
.pro-invitation__eyebrow { margin: 0 0 7px; color: #fff0c5; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.pro-invitation h2 { margin: 0 0 9px; color: #fff; font-size: clamp(23px, 2.5vw, 29px); line-height: 1.2; letter-spacing: -.035em; }
.pro-invitation__description { max-width: 460px; margin: 0; color: #e6e1ff; font-size: 14px; line-height: 1.65; }
.pro-invitation__description strong { color: #fff; font-weight: 650; }
@media (max-width: 700px) {
    .pro-invitation { flex-direction: column; gap: 22px; align-items: stretch; margin-bottom: 40px; padding: 24px; border-radius: 18px; }
    .pro-invitation__welcome { gap: 16px; align-items: flex-start; }
    .pro-invitation__icon { width: 48px; height: 52px; flex-basis: 48px; border-radius: 14px; }
    .pro-invitation__icon svg { width: 30px; height: 30px; }
}
@media (max-width: 380px) {
    .pro-invitation { padding: 20px; }
    .pro-invitation__welcome { flex-wrap: wrap; }
}
.pro-access-notice {
    display: flex;
    gap: 16px;
    align-items: center;
    margin: 0 0 var(--pro-notice-gap);
    padding: 24px;
    border: 1px solid #e7e3f2;
    border-inline-start: 3px solid var(--primary);
    border-radius: 16px;
    background: #f7f6fb;
}
.pro-access-notice__icon {
    display: grid;
    flex: 0 0 36px;
    height: 36px;
    place-items: center;
    color: var(--primary-dark);
}
.pro-access-notice__icon svg { width: 36px; height: 36px; }
.pro-access-notice__content { min-width: 0; }
.pro-access-notice__title { margin: 0 0 5px; color: var(--ink); font-size: 17px; font-weight: 750; line-height: 1.4; }
.pro-access-notice__description { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }
@media (max-width: 600px) {
    .pro-access-notice { gap: 12px; padding: 18px 16px; border-radius: 12px; }
    .pro-access-notice__icon { flex-basis: 30px; height: 30px; }
    .pro-access-notice__icon svg { width: 30px; height: 30px; }
    .pro-access-notice__title { font-size: 16px; }
}
.pro-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 410px;
    gap: clamp(56px, 8vw, 96px);
    align-items: center;
}
.pro-hero__content { min-width: 0; padding-bottom: 14px; }
.pro-kicker {
    display: inline-flex;
    gap: 8px;
    margin: 0 0 18px;
    align-items: center;
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.pro-kicker > span {
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    border-radius: 7px;
    color: #fff;
    background: var(--primary);
    font-size: 12px;
}
.pro-hero h1 {
    max-width: 590px;
    margin-bottom: 22px;
    font-size: clamp(42px, 5vw, 60px);
    line-height: 1.04;
    letter-spacing: -.05em;
}
.pro-hero h1 span { color: var(--primary); }
.pro-hero__lead { max-width: 540px; margin-bottom: 32px; color: var(--ink-soft); font-size: clamp(18px, 2vw, 20px); line-height: 1.55; }
.pro-highlights { display: grid; max-width: 530px; gap: 18px; margin: 0; padding: 0; list-style: none; }
.pro-highlights li { display: flex; min-width: 0; gap: 13px; align-items: flex-start; }
.pro-highlight__copy { display: grid; min-width: 0; gap: 2px; }
.pro-highlights strong { color: var(--ink); font-size: 14px; line-height: 1.35; }
.pro-highlights small { color: var(--ink-soft); font-size: 12px; line-height: 1.45; }
.pro-check {
    display: grid;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    margin-top: 2px;
    place-items: center;
    border-radius: 8px;
    color: var(--success);
    background: #e8f5f1;
    font-size: 12px;
    font-weight: 850;
}
.pro-rating { display: flex; width: fit-content; gap: 20px; margin-top: 36px; padding-top: 25px; align-items: center; border-top: 1px solid var(--line); }
.pro-rating__stars { display: flex; gap: 2px; color: #f5a01a; font-size: 25px; line-height: 1; letter-spacing: -.05em; }
.pro-rating__stars .is-half { color: transparent; background: linear-gradient(90deg, #f5a01a 50%, #d9dbe3 50%); background-clip: text; -webkit-background-clip: text; }
.pro-rating__copy { display: grid; gap: 1px; }
.pro-rating__copy strong { font-size: 16px; }
.pro-rating__copy small { color: var(--ink-soft); font-size: 13px; }
.pro-offer-card {
    position: sticky;
    top: 94px;
    overflow: hidden;
    border: 1px solid #cbc5f7;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(49, 42, 110, .16);
}
.pro-offer-card__top { padding: 33px 32px 25px; border-bottom: 1px solid #e7e3fb; background: #f8f7ff; }
.pro-offer-card__body { padding: 27px 32px 30px; }
.pro-offer-badge { display: inline-flex; min-height: 27px; padding: 5px 10px; align-items: center; border-radius: 999px; color: #fff; background: var(--primary); font-size: 10px; font-weight: 850; letter-spacing: .09em; }
.pro-offer-card h2 { margin: 16px 0 6px; font-size: 29px; }
.pro-offer-card__top > p { margin-bottom: 0; color: var(--ink-soft); font-size: 14px; }
.pro-price { display: flex; gap: 10px; align-items: baseline; }
.pro-price__amount { color: var(--ink); font-size: 48px; font-weight: 850; line-height: 1; letter-spacing: -.055em; }
.pro-price__period { color: var(--ink-soft); font-size: 14px; }
.pro-price-followup { margin: 7px 0 0; color: var(--ink-soft); font-size: 13px; }
.pro-offer-list { display: grid; gap: 10px; margin: 24px 0 22px; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); list-style: none; }
.pro-offer-list li { display: flex; gap: 9px; align-items: center; font-size: 13px; font-weight: 700; }
.pro-offer-list li > span { color: var(--success); font-weight: 900; }
.pro-checkout { gap: 20px; padding: 5px 0 4px; }
.pro-checkout .pro-terms { justify-self: stretch; color: var(--ink-soft); font-size: 12px; line-height: 1.45; }
.pro-checkout .pro-terms input { width: 18px; height: 18px; flex: 0 0 18px; }
.pro-vipps-button { width: min(100%, 320px); min-height: 52px; border-radius: 9px; box-shadow: 0 5px 14px rgba(255, 91, 36, .16); transition: filter .15s ease, transform .15s ease, box-shadow .15s ease; }
.pro-vipps-button img { width: 249px; max-width: 100%; margin: 0 auto; }
.pro-vipps-button:hover { box-shadow: 0 7px 18px rgba(255, 91, 36, .2); transform: translateY(-1px); }
.pro-vipps-button:disabled { opacity: .65; cursor: wait; }
.pro-payment-note { display: flex; gap: 7px; margin-top: 20px; align-items: center; justify-content: center; color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.pro-payment-note svg { width: 16px; flex: 0 0 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.pro-benefits { margin-top: 96px; padding: 72px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pro-section-heading { max-width: 650px; margin-bottom: 34px; }
.pro-section-heading h2 { margin-bottom: 12px; font-size: clamp(30px, 4vw, 42px); }
.pro-section-heading > p:last-child { margin-bottom: 0; color: var(--ink-soft); font-size: 17px; }
.pro-benefit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.pro-benefit-card { position: relative; min-height: 270px; padding: 26px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.pro-benefit-card__icon { display: grid; width: 46px; height: 46px; margin-bottom: 43px; place-items: center; border: 1px solid #dedafd; border-radius: 11px; color: var(--primary-dark); background: #f8f7ff; }
.pro-benefit-card__icon svg { width: 23px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.pro-benefit-card h3 { margin-bottom: 9px; }
.pro-benefit-card p { margin-bottom: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.65; }
.pro-faq { display: grid; grid-template-columns: minmax(0, .8fr) minmax(420px, 1.2fr); gap: clamp(50px, 8vw, 100px); padding: 80px 0 18px; }
.pro-faq__intro h2 { margin-bottom: 16px; font-size: clamp(30px, 4vw, 40px); }
.pro-faq__intro > p:not(.eyebrow) { max-width: 390px; margin-bottom: 22px; color: var(--ink-soft); }
.pro-faq__questions { border-top: 1px solid var(--line); }
.pro-faq__questions details { border-bottom: 1px solid var(--line); }
.pro-faq__questions summary { display: flex; min-height: 69px; gap: 20px; padding: 18px 2px; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; font-weight: 750; }
.pro-faq__questions summary::-webkit-details-marker { display: none; }
.pro-faq__questions summary span { display: grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; border-radius: 50%; color: var(--primary-dark); background: var(--primary-soft); font-size: 18px; font-weight: 500; transition: transform .15s ease; }
.pro-faq__questions details[open] summary span { transform: rotate(45deg); }
.pro-faq__questions details p { max-width: 620px; margin: -3px 45px 19px 2px; color: var(--ink-soft); font-size: 14px; line-height: 1.65; }
.pro-subjects { margin-top: 82px; padding: 68px 58px; border: 1px solid #e1deef; border-radius: 24px; background: #f5f4fb; }
.pro-subjects__heading { max-width: 650px; margin: 0 auto 36px; text-align: center; }
.pro-subjects__heading h2 { margin-bottom: 12px; font-size: clamp(30px, 4vw, 42px); }
.pro-subjects__heading > p:last-child { margin-bottom: 0; color: var(--ink-soft); font-size: 16px; }
.pro-subject-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.pro-subject-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 104px;
    gap: 15px;
    padding: 18px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--ink);
    background: #fff;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.pro-subject-card:hover { border-color: #c7c1f4; box-shadow: 0 12px 28px rgba(49, 42, 110, .09); transform: translateY(-2px); }
.pro-subject-card__icon { display: grid; width: 54px; height: 54px; place-items: center; border: 1px solid #dedafd; border-radius: 13px; background: #f8f7ff; }
.pro-subject-card__icon img { width: 34px; height: 34px; object-fit: contain; }
.pro-subject-card__copy { display: grid; gap: 4px; min-width: 0; }
.pro-subject-card__copy strong { font-size: 16px; }
.pro-subject-card__copy small { display: -webkit-box; overflow: hidden; color: var(--ink-soft); font-size: 12px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.pro-subject-card__arrow { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; color: var(--primary-dark); background: var(--primary-soft); transition: color .15s ease, background .15s ease, transform .15s ease; }
.pro-subject-card:hover .pro-subject-card__arrow { color: #fff; background: var(--primary); transform: translateX(2px); }
.pro-final-cta {
    position: relative;
    top: auto;
    width: 100%;
    margin-top: 24px;
    box-shadow: 0 18px 50px rgba(49, 42, 110, .12);
}
.pro-subjects + .pro-final-cta { margin-top: 72px; }
.pro-faq + .pro-final-cta { margin-top: 82px; }
.pro-final-cta .pro-offer-card__top { padding: 34px 48px 28px; }
.pro-final-cta__body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 410px); gap: clamp(44px, 8vw, 88px); padding: 34px 48px 38px; align-items: center; }
.pro-final-cta__offer .pro-offer-list { margin-bottom: 0; }
.pro-final-cta__action { display: grid; width: min(100%, 346px); margin: 0 auto; justify-items: center; }
.pro-final-cta__checkout { width: 100%; gap: 18px; padding: 0; }
.pro-final-cta__checkout .pro-terms { width: 100%; }
.pro-final-cta__checkout .pro-vipps-button { width: min(100%, 320px); }
.pro-final-cta__action .pro-payment-note { margin-top: 17px; }
.spinner { display: inline-block; width: 30px; height: 30px; border: 3px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.more-login-options { margin-top: 18px; }
.more-login-options summary { color: var(--primary-dark); cursor: pointer; font-weight: 700; }
.more-login-options form { margin-top: 14px; }

/* Pro confirmation and cancellation */
.pro-confirmation-shell { max-width: 740px; padding-top: 56px; }
.pro-confirmation-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 14px 38px rgba(32, 31, 58, .09);
}
.pro-confirmation-card__header {
    display: flex;
    min-height: 70px;
    gap: 20px;
    padding: 15px 24px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}
.pro-confirmation-brand,
.pro-confirmation-secure { display: inline-flex; align-items: center; }
.pro-confirmation-brand { gap: 10px; letter-spacing: -.015em; }
.pro-confirmation-brand__mark {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 9px;
    color: #fff;
    background: var(--primary);
}
.pro-confirmation-brand__mark svg { width: 20px; fill: currentColor; }
.pro-confirmation-secure { gap: 7px; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.pro-confirmation-secure svg,
.confirmation-receipt svg,
.confirmation-signin-note svg,
.confirmation-state__icon svg,
.confirmation-login-actions .provider-button svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.pro-confirmation-secure svg { width: 16px; }
.pro-confirmation-card__body { padding: 42px 46px 40px; }
.confirmation-state { text-align: center; }
.confirmation-state__icon {
    display: grid;
    width: 64px;
    height: 64px;
    margin: 0 auto 22px;
    place-items: center;
    border-radius: 50%;
    font-size: 29px;
    font-weight: 800;
}
.confirmation-state__icon--pending { background: var(--surface-accent); }
.confirmation-state__icon--pending .spinner { width: 34px; height: 34px; }
.confirmation-state__icon--success { color: #fff; background: var(--primary); box-shadow: 0 8px 20px rgba(89, 74, 226, .2); }
.confirmation-state__icon--error { color: #fff; background: var(--danger); }
.confirmation-state__icon--account { color: var(--primary-dark); background: var(--primary-soft); }
.confirmation-state__icon--account svg { width: 30px; }
.confirmation-state .eyebrow { margin-bottom: 9px; }
.confirmation-state h1 { margin-bottom: 13px; font-size: clamp(31px, 5vw, 40px); }
.confirmation-state__lead { max-width: 550px; margin: 0 auto; color: var(--ink-soft); font-size: 17px; line-height: 1.6; }
.confirmation-progress {
    display: grid;
    max-width: 490px;
    grid-template-columns: minmax(0, 1fr) 38px minmax(0, 1fr);
    gap: 9px;
    margin: 30px auto 0;
    padding: 14px 16px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
}
.confirmation-progress__step { display: inline-flex; gap: 8px; align-items: center; color: var(--ink-soft); font-size: 13px; font-weight: 750; }
.confirmation-progress__step > span { display: grid; width: 21px; height: 21px; flex: 0 0 21px; place-items: center; border-radius: 50%; }
.confirmation-progress__step.is-complete > span { color: #fff; background: var(--primary); font-size: 11px; }
.confirmation-progress__step.is-current { color: var(--ink); }
.confirmation-progress__step.is-current > span { border: 6px solid var(--primary-soft); background: var(--primary); }
.confirmation-progress__line { height: 1px; background: #d9d9e1; }
.confirmation-state__note { margin: 16px 0 0; color: var(--ink-soft); font-size: 12px; }
.confirmation-benefits {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 30px 0 22px;
    padding: 20px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    list-style: none;
    text-align: left;
}
.confirmation-benefits li { display: flex; gap: 9px; padding: 0 14px; align-items: flex-start; }
.confirmation-benefits li + li { border-left: 1px solid var(--line); }
.confirmation-benefits li > span:first-child { color: var(--primary); font-weight: 850; }
.confirmation-benefits strong,
.confirmation-benefits small,
.confirmation-receipt small,
.confirmation-receipt strong,
.confirmation-signin-note strong,
.confirmation-signin-note small { display: block; }
.confirmation-benefits strong { font-size: 13px; }
.confirmation-benefits small { margin-top: 2px; color: var(--ink-soft); font-size: 11px; line-height: 1.4; }
.confirmation-receipt,
.confirmation-signin-note {
    display: flex;
    max-width: 490px;
    gap: 13px;
    margin: 0 auto;
    padding: 14px 16px;
    align-items: center;
    border-radius: 9px;
    text-align: left;
}
.confirmation-receipt { border: 1px solid #cce3dc; color: #105c4d; background: #f4fbf8; }
.confirmation-receipt svg,
.confirmation-signin-note svg { width: 23px; flex: 0 0 23px; }
.confirmation-receipt small,
.confirmation-signin-note small { font-size: 12px; font-weight: 500; }
.confirmation-receipt strong { overflow-wrap: anywhere; font-size: 13px; }
.confirmation-actions { display: flex; gap: 18px; margin-top: 26px; align-items: center; justify-content: center; }
.confirmation-actions .text-link { font-size: 14px; }
.confirmation-signin-note { margin-top: 27px; border: 1px solid #dcd8fb; color: var(--primary-dark); background: #f8f7ff; }
.confirmation-login-actions { width: min(100%, 390px); margin: 20px auto 0; }
.confirmation-login-actions .provider-button svg { width: 24px; }
.confirmation-login-actions .more-login-options { padding-top: 2px; border-top: 1px solid var(--line); }
.confirmation-login-actions .more-login-options summary { min-height: 44px; padding-top: 14px; list-style-position: inside; font-size: 13px; }
.confirmation-login-actions .more-login-options > div { display: grid; gap: 10px; margin-top: 4px; }
.confirmation-login-actions .more-login-options form { margin-top: 0; }
.pro-confirmation-card__footer { padding: 16px 24px; border-top: 1px solid var(--line); color: var(--ink-soft); background: var(--surface-soft); font-size: 12px; text-align: center; }
.pro-confirmation-card__footer a { color: var(--primary-dark); font-weight: 750; }
.pro-cancelled-page { background: #fbfbfd; }
.pro-cancelled-card .pro-confirmation-card__header { justify-content: flex-start; }
.pro-cancelled-card__body { padding: 52px 46px 48px; }
.confirmation-state--cancelled { max-width: 540px; margin: 0 auto; }
.confirmation-state--cancelled .eyebrow { margin-bottom: 10px; }
.confirmation-state--cancelled h1 { margin-bottom: 12px; font-size: clamp(31px, 5vw, 38px); }
.cancellation-summary {
    max-width: 500px;
    margin: 32px auto 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface-soft);
    text-align: left;
}
.cancellation-detail {
    display: flex;
    gap: 14px;
    padding: 17px 18px;
    align-items: center;
}
.cancellation-detail + .cancellation-detail { border-top: 1px solid var(--line); }
.cancellation-detail__icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 9px;
    color: var(--primary-dark);
    background: var(--primary-soft);
}
.cancellation-detail__icon svg {
    width: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.cancellation-detail small,
.cancellation-detail strong,
.cancellation-detail__note { display: block; }
.cancellation-detail small,
.cancellation-detail__note { color: var(--ink-soft); font-size: 12px; font-weight: 500; }
.cancellation-detail strong { margin-top: 1px; overflow-wrap: anywhere; font-size: 14px; }
.cancellation-detail__note { margin-top: 3px; }
.cancellation-actions { margin-top: 28px; }
.install-card__icon { margin: 0 auto 22px; border-radius: 20px; }
.install-card [data-pwa-state] { margin-top: 26px; }
.install-card [data-pwa-state="loading"] { display: flex; gap: 12px; align-items: center; justify-content: center; }
.instruction-card { padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); text-align: left; }
.instruction-card h2 { font-size: 20px; }
.instruction-card li + li { margin-top: 10px; }

@media (max-width: 820px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .chart-grid { grid-template-columns: 1fr; }
    .pro-shell { padding-top: 38px; }
    .pro-hero { grid-template-columns: 1fr; gap: 45px; }
    .pro-hero__content { padding-bottom: 0; }
    .pro-offer-card { position: relative; top: auto; width: min(100%, 560px); }
    .pro-benefits { margin-top: 78px; padding: 60px 0; }
    .pro-faq { grid-template-columns: 1fr; gap: 38px; padding-top: 62px; }
    .pro-subjects { margin-top: 66px; padding: 56px 34px; }
    .pro-subject-grid { grid-template-columns: 1fr; }
    .pro-offer-card.pro-final-cta { width: 100%; }
    .pro-subjects + .pro-final-cta { margin-top: 60px; }
    .pro-final-cta__body { grid-template-columns: 1fr; gap: 30px; padding: 32px 42px 38px; }
    .pro-final-cta__offer { width: min(100%, 440px); margin: 0 auto; }
    .pro-final-cta__action { width: min(100%, 346px); }
}

@media (max-width: 600px) {
    .field-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-card { min-height: 125px; }
    .pricing-card,
    .install-card { padding: 24px 18px; }
    .pro-shell { --pro-notice-gap: 36px; width: min(100% - 24px, var(--content)); padding-top: 26px; }
    .pro-page-notice { margin-bottom: 20px; }
    .pro-hero h1 { font-size: clamp(39px, 12vw, 54px); }
    .pro-hero__lead { font-size: 17px; }
    .pro-highlights { grid-template-columns: 1fr; gap: 13px; }
    .pro-rating { gap: 15px; margin-top: 30px; padding-top: 22px; }
    .pro-rating__stars { font-size: 22px; }
    .pro-offer-card { border-radius: 17px; }
    .pro-offer-card__top { padding: 29px 22px 22px; }
    .pro-offer-card__body { padding: 24px 22px 25px; }
    .pro-offer-card h2 { font-size: 25px; }
    .pro-benefits { margin-top: 65px; padding: 52px 0; }
    .pro-benefit-grid { grid-template-columns: 1fr; }
    .pro-benefit-card { min-height: 0; }
    .pro-faq { padding-top: 54px; }
    .pro-faq__questions summary { min-height: 64px; font-size: 14px; }
    .pro-subjects { margin-top: 54px; padding: 45px 14px 14px; border-radius: 19px; }
    .pro-subjects__heading { margin-bottom: 28px; padding: 0 8px; }
    .pro-subjects__heading > p:last-child { font-size: 14px; }
    .pro-subject-card { min-height: 94px; gap: 12px; padding: 14px; }
    .pro-subject-card__icon { width: 48px; height: 48px; }
    .pro-subject-card__icon img { width: 30px; height: 30px; }
    .pro-final-cta { margin-top: 16px; }
    .pro-subjects + .pro-final-cta { margin-top: 44px; }
    .pro-faq + .pro-final-cta { margin-top: 54px; }
    .pro-final-cta .pro-offer-card__top { padding: 29px 22px 22px; }
    .pro-final-cta__body { padding: 24px 22px 27px; }
    .form-stack > .button { width: 100%; }
    .pro-confirmation-shell { padding-top: 28px; }
    .pro-confirmation-card__header { min-height: 64px; padding: 13px 17px; }
    .pro-confirmation-card__body { padding: 32px 18px; }
    .pro-cancelled-card__body { padding: 38px 18px 34px; }
    .confirmation-state__icon { width: 58px; height: 58px; margin-bottom: 19px; }
    .confirmation-state__lead { font-size: 16px; }
    .confirmation-progress { grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr); gap: 5px; padding: 12px 9px; }
    .confirmation-progress__step { flex-direction: column; gap: 5px; font-size: 11px; line-height: 1.3; text-align: center; }
    .confirmation-benefits { grid-template-columns: 1fr; gap: 13px; padding: 18px 0; }
    .confirmation-benefits li { padding: 0 6px; }
    .confirmation-benefits li + li { padding-top: 13px; border-top: 1px solid var(--line); border-left: 0; }
    .confirmation-actions { flex-direction: column; gap: 12px; }
    .confirmation-actions .button { width: 100%; }
    .cancellation-detail { padding: 15px 14px; }
}

@media (max-width: 420px) {
    .stats-grid { grid-template-columns: 1fr; }
    .pro-confirmation-secure { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .spinner { animation: none; }
}

/* Article library */
.article-shell { --article-copy: #454557; max-width: 940px; }
.article-index-hero,
.article-hero { margin-bottom: 46px; }
.article-index-hero { padding: 30px; border: 1px solid var(--line); border-radius: 18px; background: #fff; text-align: center; }
.article-index-hero > p:last-child,
.article-hero > p:last-of-type { color: var(--article-copy); font-size: 18px; }
.article-topic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.article-topic-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; min-height: 82px; padding: 16px; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-decoration: none; }
.article-topic-card:hover { border-color: #c9c3fb; box-shadow: var(--shadow); transform: translateY(-1px); }
.article-topic-card__icon { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid #dedafd; border-radius: 7px; color: var(--primary-dark); }
.article-topic-card__icon img { width: 35px; height: 35px; object-fit: contain; }
.article-index-copy { margin-top: 48px; padding-top: 38px; border-top: 1px solid var(--line); }
.article-index-copy p { max-width: 780px; color: var(--article-copy); }
.article-index-copy .button { margin-top: 10px; }
.article-hero { padding-bottom: 8px; }
.article-hero > p:last-of-type { max-width: 780px; }
.article-lead { max-width: 780px; color: var(--article-copy); font-size: 18px; line-height: 1.65; }
.article-cta {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 20px;
    margin-top: 34px;
    padding: 26px;
    align-items: center;
    border: 1px solid #4d43a4;
    border-radius: 18px;
    color: #fff;
    background: #302777;
    box-shadow: 0 16px 34px rgba(37, 31, 100, .18);
}
.article-cta__icon {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 13px;
    color: #fff;
    background: rgba(255, 255, 255, .1);
}
.article-cta__icon svg { width: 25px; fill: currentColor; }
.article-cta__body { min-width: 0; }
.article-cta .eyebrow { margin-bottom: 5px; color: #c9c3ff; }
.article-cta h2 { margin-bottom: 7px; color: #fff; font-size: 22px; letter-spacing: -.025em; }
.article-cta__body > p:not(.eyebrow) { max-width: 610px; margin: 0; color: rgba(255, 255, 255, .78); font-size: 14px; line-height: 1.55; }
.article-cta ul { display: flex; gap: 7px 18px; margin: 13px 0 0; padding: 0; flex-wrap: wrap; color: rgba(255, 255, 255, .9); font-size: 13px; list-style: none; }
.article-cta li { display: flex; gap: 7px; align-items: center; }
.article-cta li::before { content: "✓"; color: #89e0c3; font-weight: 800; }
.article-cta__button {
    min-height: 48px;
    padding-inline: 20px;
    color: #352aa4;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 10, 65, .16);
    white-space: nowrap;
}
.article-cta__button:hover { color: #271e82; background: #f2f0ff; }
.article-cta__button:focus-visible { outline-color: #fff; }
.article-content { display: grid; grid-template-columns: minmax(0, 1fr); gap: 52px; }
.article-content > .article-cta { margin-top: 0; }
.article-cta + .article-pagination { margin-top: 52px; }
.article-section { padding-top: 38px; border-top: 1px solid var(--line); }
.article-section:first-child { padding-top: 0; border-top: 0; }
.article-section > header { margin-bottom: 18px; }
.article-section > p { max-width: 780px; color: var(--article-copy); }
.article-section__body { max-width: 780px; color: var(--article-copy); line-height: 1.7; }
.article-section__body > :first-child { margin-top: 0; }
.article-section__body > :last-child { margin-bottom: 0; }
.article-section__body p + p { margin-top: 16px; }
.article-content--formula .article-section__body { max-width: none; }
.formula-callout { margin-top: 24px; padding: 18px 20px; border: 1px solid #cec8fb; border-radius: 10px; color: var(--ink); background: #fff; font-size: 19px; font-weight: 750; text-align: center; }
.fraction { display: inline-grid; min-width: 1.5em; margin: 0 .12em; grid-template-rows: auto auto; vertical-align: middle; line-height: 1.15; text-align: center; }
.fraction > span:first-child { padding: 0 .2em .08em; border-bottom: 1px solid currentColor; }
.fraction > span:last-child { padding: .08em .2em 0; }
.conversion-table { max-width: 100%; margin: 24px 0; overflow-x: auto; }
.conversion-table--narrow { max-width: 560px; }
.conversion-table table { min-width: 560px; color: var(--ink); background: #fff; }
.conversion-table th { font-weight: 750; }
.legacy-examples { display: grid; gap: 10px; color: var(--ink); }
.legacy-example { border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.legacy-example[open] { border-color: #cec8fb; }
.legacy-example summary { padding: 14px 16px; color: var(--primary-dark); cursor: pointer; font-weight: 750; }
.legacy-example > div { padding: 18px; border-top: 1px solid var(--line); overflow-x: auto; }
.legacy-example p:first-child { margin-top: 0; }
.legacy-example p:last-child { margin-bottom: 0; }
.formula-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; max-width: none; color: var(--ink); }
.formula-card { padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 4px 12px rgb(31 29 58 / 5%); }
.formula-card h2 { margin-bottom: 18px; font-size: 22px; }
.formula-card p { margin: 0 0 10px; }
.formula-card p:last-child { margin-bottom: 0; }
.formula-card--dsm,
.formula-card--dilution { grid-column: 1 / -1; }
.article-good-luck { margin-top: 44px !important; color: var(--ink); font-weight: 650; text-align: center; }
.article-topic-grid--compact { margin-top: 24px; }
.worked-example,
.practice-exercise { margin-top: 22px; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.worked-example > strong { display: block; margin-top: 10px; font-size: 17px; }
.worked-example details { margin-top: 20px; border: 1px solid var(--line); border-radius: 8px; }
.worked-example details summary { padding: 12px 14px; color: var(--primary-dark); cursor: pointer; font-weight: 750; }
.worked-example details > div { padding: 16px; border-top: 1px solid var(--line); overflow-x: auto; }
.practice-exercise { border-color: #d5d0fb; }
.practice-position { display: block; margin-bottom: 20px; color: var(--ink-soft); text-align: center; }
.practice-description { color: var(--ink-soft); text-align: center; }
.practice-question { margin: 9px 0 20px; font-size: 18px; font-weight: 750; text-align: center; }
.practice-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.practice-option { min-height: 48px; padding: 10px 13px; border: 1px solid #cfd0d8; border-radius: 7px; color: var(--ink); background: #fff; cursor: pointer; }
.practice-option:hover:not(:disabled) { border-color: var(--primary); background: #faf9ff; }
.practice-option.is-correct { border-color: #79bca8; color: #0e6553; background: #edf9f5; }
.practice-option.is-incorrect { border-color: #df9891; color: #8e241c; background: #fff2f0; }
.practice-result { display: flex; min-height: 48px; gap: 14px; margin-top: 18px; align-items: center; justify-content: center; }
.practice-result .is-success { color: var(--success); }
.practice-result .is-error { color: var(--danger); }
.article-pagination { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding-top: 28px; border-top: 1px solid var(--line); }
.article-pagination a { display: grid; gap: 3px; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-decoration: none; }
.article-pagination a:hover { border-color: #c9c3fb; }
.article-pagination small { color: var(--ink-soft); }
.article-pagination__next { grid-column: 2; text-align: right; }
.article-section table { width: 100%; border-collapse: collapse; }
.article-section th,
.article-section td { padding: 10px; border: 1px solid var(--line); text-align: left; }

@media (max-width: 760px) {
    .article-topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .formula-grid { grid-template-columns: 1fr; }
    .formula-card--dsm,
    .formula-card--dilution { grid-column: 1; }
    .article-cta { grid-template-columns: auto minmax(0, 1fr); }
    .article-cta__button { grid-column: 1 / -1; width: 100%; }
}

@media (max-width: 520px) {
    .article-topic-grid,
    .practice-options,
    .article-pagination { grid-template-columns: 1fr; }
    .article-pagination__next { grid-column: 1; }
    .worked-example,
    .practice-exercise { padding: 18px 14px; }
    .practice-result { align-items: stretch; flex-direction: column; }
    .article-cta { gap: 15px; padding: 21px 18px; border-radius: 15px; }
    .article-cta__icon { width: 44px; height: 44px; border-radius: 11px; }
    .article-cta__icon svg { width: 22px; }
    .article-cta h2 { font-size: 20px; }
    .article-cta ul { display: grid; gap: 6px; }
}
