/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.header-row { display: flex; align-items: center; gap: var(--space-2); min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-family: var(--font-display); font-weight: 750; font-size: 1.3rem; letter-spacing: -0.03em; color: var(--text); text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(140deg, var(--g-300), var(--g-600)); color: #06281c; font-size: 1rem; font-weight: 800; }
.brand-small { font-size: 1.1rem; margin-bottom: var(--space-3); }
.site-nav { display: flex; margin-left: auto; }
.site-nav a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--space-3); border-radius: 999px; color: var(--text); text-decoration: none; font-weight: 400; font-size: var(--step-0); }
/* Current section: an accent underline, never a filled pill (a fill reads as "selected button"). */
.site-nav a:hover { text-decoration: underline; text-decoration-color: var(--border); text-decoration-thickness: 2px; text-underline-offset: 0.45em; }
.site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--focus); text-decoration-thickness: 2px; text-underline-offset: 0.45em; }
.theme-toggle { flex: none; display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); border: 0; border-radius: 50%; background: transparent; color: var(--text); cursor: pointer; }
.theme-toggle:hover { background: var(--accent-soft); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding-block: var(--space-7); }
.footer-grid { display: grid; gap: var(--space-5); }
.footer-grid p { max-width: 34rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); align-content: start; }
.footer-links a { color: var(--muted); text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.footer-links a:hover { color: var(--text); }
@media (min-width: 48rem) { .footer-grid { grid-template-columns: 2fr 1fr; } }

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-5); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 1.4rem; border: 1.5px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 700; text-decoration: none; cursor: pointer; transition: border-color .15s, transform .15s var(--ease); }
.btn:hover { border-color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { border-color: var(--accent); filter: brightness(1.08); }
.btn-quiet { min-height: var(--tap); padding: 0 1rem; background: transparent; }
.btn-light { background: var(--g-300); border-color: var(--g-300); color: #06281c; }
.btn-light:hover { border-color: var(--g-200); background: var(--g-200); }

/* ---------- Sections ---------- */
.section { margin-top: var(--space-8); }
.section > h2 { margin-bottom: var(--space-3); }
.section > .lead { margin-bottom: var(--space-6); }

/* ---------- Hero ---------- */
.hero { display: grid; gap: var(--space-6); align-items: center; padding-block: var(--space-5) 0; }
.hero-copy h1 { max-width: 13ch; }
.hero-solo { min-height: 50vh; }
@media (min-width: 60rem) {
  .hero { grid-template-columns: 1.05fr 1fr; gap: var(--space-8); padding-block: var(--space-7) var(--space-4); align-items: start; }
  .hero-copy { padding-top: var(--space-7); }
}

/* ---------- Sample question: the answer sheet ---------- */
.sheet { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: var(--space-5); }
@media (min-width: 30rem) { .sheet { padding: var(--space-6); } }
.q-domain { font-size: var(--step-0); color: var(--muted); font-weight: 400; margin-bottom: var(--space-2); }
.q-text { font-family: var(--font-display); font-size: var(--step-1); font-weight: 650; line-height: 1.3; letter-spacing: -0.01em; margin-bottom: var(--space-4); }
/* Code, config or trace excerpt under a stem (F21 #5). Wraps instead of scrolling the page at 320px. */
.q-code { margin: 0 0 var(--space-4); padding: var(--space-3); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); font: 400 0.875rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.q-code code { font: inherit; }
.opts { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.opt { width: 100%; display: flex; align-items: flex-start; gap: var(--space-3); min-height: 52px; padding: var(--space-3); border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: transparent; text-align: left; line-height: 1.4; cursor: pointer; transition: border-color .15s, background-color .15s; }
.opt:hover:not(:disabled) { border-color: var(--text); }
.opt:disabled { cursor: default; }
.bubble { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid currentColor; font-size: 0.8rem; font-weight: 700; transition: transform .25s var(--ease), background-color .2s; }
.opt-text { padding-top: 2px; }
.opt.is-picked .bubble { background: var(--mark); border-color: var(--mark); color: var(--mark-text); transform: scale(1.08); }
.opt.is-correct { border-color: var(--success); background: var(--success-soft); }
.opt.is-correct .bubble { background: var(--success); border-color: var(--success); color: var(--surface); }
.opt.is-wrong { border-color: var(--danger); background: var(--danger-soft); }
.feedback { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border); animation: reveal .3s var(--ease); }
.feedback p { font-size: var(--step--1); }
.verdict { font-weight: 700; font-size: var(--step-0) !important; }
.verdict.ok { color: var(--success); }
.verdict.no { color: var(--danger); }
.sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-4); }
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- Bubbles (difficulty) ---------- */
.bubbles { display: inline-flex; gap: 3px; vertical-align: -1px; }
.bubbles i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid currentColor; }
.bubbles i.on { background: currentColor; }

/* ---------- Blueprint (stacked domain bar) ---------- */
.blueprint { display: flex; gap: 3px; height: 12px; margin: var(--space-3) 0; }
.seg { border-radius: 3px; min-width: 6px; }
.s0 { background: var(--g-800); }
.s1 { background: var(--g-600); }
.s2 { background: var(--g-400); }
.s3 { background: var(--g-300); }
.s4 { background: var(--g-200); }
.s5 { background: var(--g-700); }
.s6 { background: var(--g-500); }
.s7 { background: var(--g-100); outline: 1px solid var(--g-300); outline-offset: -1px; }
.legend { list-style: none; padding: 0; margin: var(--space-4) 0; display: grid; gap: var(--space-2); max-width: 40rem; }
.legend li { display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-3); align-items: center; padding-block: var(--space-1); border-bottom: 1px solid var(--border); }
.legend .num { font-weight: 700; }
.sw { width: 12px; height: 12px; border-radius: 3px; }

/* ---------- Exam cards ---------- */
.cards { display: grid; gap: var(--space-4); }
@media (min-width: 44rem) { .cards { grid-template-columns: repeat(2, 1fr); } }
.cards + p { margin-top: var(--space-4); }
.exam-card { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-5); background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none; transition: border-color .15s, transform .2s var(--ease); }
.exam-card:hover { border-color: var(--text); transform: translateY(-2px); }
.exam-code { font-family: var(--font-display); font-size: var(--step-3); font-weight: 750; letter-spacing: -0.03em; line-height: 1; }
.exam-name { color: var(--muted); margin-bottom: var(--space-2); }
.exam-meta { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); font-size: var(--step--1); color: var(--muted); }

/* ---------- Study path ---------- */
.path { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-5); counter-reset: step; }
.path li { position: relative; padding-left: 3.25rem; counter-increment: step; }
.path li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--g-500); background: var(--accent-soft); color: var(--text); display: grid; place-items: center; font-weight: 700; font-size: var(--step--1); }
.path li::after { content: ""; position: absolute; left: 17px; top: 42px; bottom: calc(-1 * var(--space-5) + 6px); width: 1.5px; background: linear-gradient(var(--g-400), var(--g-100)); }
.path li:last-child::after { display: none; }
.path h3 { margin-bottom: 0; padding-top: 4px; }
.path .verb { font-weight: 700; margin-bottom: var(--space-1); }
.path .muted { font-size: var(--step--1); margin-bottom: var(--space-2); }
.tag { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; font-size: var(--step--1); font-weight: 700; margin: 0; }
.tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--g-500); }
.soon { font-weight: 400; color: var(--muted); }
@media (min-width: 60rem) {
  .path { grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }
  .path li { padding-left: 0; padding-top: 3.25rem; }
  .path li::after { left: 44px; right: calc(-1 * var(--space-6) + 8px); top: 17px; bottom: auto; width: auto; height: 1.5px; background: linear-gradient(90deg, var(--g-400), var(--g-100)); }
}

/* ---------- Price band ---------- */
.price-band { margin-top: var(--space-8); display: grid; gap: var(--space-5); align-items: center; padding: var(--space-6); border-radius: var(--radius-lg); background: linear-gradient(120deg, var(--band-from), var(--band-to)); color: var(--band-text); }
.price-band h2 { margin-bottom: var(--space-2); }
.price-band p { margin: 0; max-width: 36rem; opacity: .85; }
@media (min-width: 48rem) { .price-band { grid-template-columns: 1fr auto; padding: var(--space-7); } }

/* ---------- Exam hub ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: var(--space-2); font-size: var(--step--1); color: var(--muted); margin-bottom: var(--space-5); }
.crumbs a { color: var(--muted); }
.exam-head h1 { display: flex; flex-direction: column; gap: var(--space-2); }
.exam-code-lg { font-size: var(--step-4); }
.exam-title { font-size: var(--step-2); font-weight: 600; letter-spacing: -0.015em; color: var(--muted); }
.facts { list-style: none; padding: 0; margin: var(--space-5) 0 var(--space-3); display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4) var(--space-5); max-width: 40rem; }
.facts li { display: flex; flex-direction: column; color: var(--muted); font-size: var(--step--1); }
.facts strong { font-family: var(--font-display); font-size: var(--step-3); line-height: 1.1; color: var(--text); letter-spacing: -0.02em; }
@media (min-width: 40rem) { .facts { grid-template-columns: repeat(4, auto); justify-content: start; } }
.panel { padding: var(--space-5); background: var(--surface); border-radius: var(--radius-lg); border: 1.5px solid var(--border); }
@media (min-width: 40rem) { .panel { padding: var(--space-6); } }
.diff-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.rows { display: grid; gap: var(--space-1) var(--space-5); margin: var(--space-5) 0 0; }
.rows dt { font-weight: 700; font-size: var(--step--1); color: var(--muted); margin-top: var(--space-3); }
.rows dd { margin: 0; }
@media (min-width: 40rem) { .rows { grid-template-columns: 10rem 1fr; } .rows dt { margin-top: 0; } }

/* ---------- Pricing ---------- */
.plans { display: grid; gap: var(--space-4); margin: var(--space-5) 0; }
@media (min-width: 44rem) { .plans { grid-template-columns: repeat(2, 1fr); } }
.plan { padding: var(--space-6); background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-lg); }
.plan h2 { font-size: var(--step-2); margin-bottom: var(--space-2); }
.plan-full { border-color: var(--accent); box-shadow: var(--shadow); }
.plan-price { font-family: var(--font-display); font-size: var(--step-4); font-weight: 750; letter-spacing: -0.03em; line-height: 1; margin-bottom: var(--space-3); }
.offer { font-weight: 700; }
.checks { list-style: none; padding: 0; display: grid; gap: var(--space-2); }
.checks li { position: relative; padding-left: 1.7em; }
.checks li::before { content: ""; position: absolute; left: 0; top: 0.45em; width: 0.9em; height: 0.9em; border-radius: 50%; background: var(--g-400); }

/* ---------- Misc ---------- */
.notice { margin-top: var(--space-8); color: var(--muted); font-size: var(--step--1); max-width: 44rem; }
.notice-eligibility { margin-top: var(--space-5); }
.prose { max-width: 42rem; }
.prose h2 { font-size: var(--step-2); margin-top: var(--space-6); }

/* ---------- Utilities ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header progress chip ---------- */
.me-chip { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 36px; padding: 0 var(--space-3); margin-left: var(--space-1); border: 1.5px solid var(--border); border-radius: 999px; background: transparent; color: var(--text); font-size: var(--step-0); font-weight: 400; text-decoration: none; white-space: nowrap; transition: border-color .15s; }
.me-chip:hover { border-color: var(--text); }
.me-chip[hidden] { display: none; }
/* F17: level ring · streak flame · daily dot, and the +XP float */
.me-chip { position: relative; }
.me-chip.has-progress { gap: var(--space-2); padding: 0 var(--space-3) 0 3px; }
.lvl { position: relative; display: inline-grid; place-items: center; flex: none; }
.lvl svg { display: block; width: 100%; height: 100%; }
.lvl-sm { width: 30px; height: 30px; }
.lvl-lg { width: 72px; height: 72px; }
.lvl-track { fill: var(--surface); stroke: var(--border); }
.lvl-fill { fill: none; stroke: var(--progress); stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease); }
.lvl-n { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 650; line-height: 1; }
.lvl-sm .lvl-n { font-size: 0.8125rem; }
.lvl-lg .lvl-n { font-size: var(--step-3); font-weight: 700; letter-spacing: -0.02em; }
.ico { width: 1.25em; height: 1.25em; flex: none; }
.streak { display: inline-flex; align-items: center; gap: 3px; }
.flame path { fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linejoin: round; }
.flame .flame-core { stroke: none; fill: none; }
.flame.is-lit path { fill: var(--flame); stroke: var(--flame); }
.flame.is-lit .flame-core { fill: var(--mark); }
.dot { position: relative; display: inline-grid; place-items: center; width: 18px; height: 18px; color: var(--accent-text); }
.dot svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.dot-track { fill: none; stroke: var(--border); stroke-width: 3; }
.dot-fill { fill: none; stroke: var(--progress); stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset .6s var(--ease); }
.dot.is-done .dot-track { fill: var(--progress); stroke: var(--progress); }
.dot .ico-check { position: relative; width: 12px; height: 12px; stroke-width: 3; }
.xp-float { position: absolute; left: 50%; top: calc(100% + 8px); z-index: 6; display: grid; justify-items: center; gap: 1px; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: var(--mark); color: var(--mark-text); line-height: 1.2; white-space: nowrap; pointer-events: none; transform: translateX(-50%); box-shadow: 0 6px 16px -6px rgb(15 36 28 / 40%); animation: xp-drop 2.6s var(--ease) forwards; }
.xp-float strong { font-size: var(--step-0); font-weight: 700; }
.xp-float span { font-size: var(--step--1); }
.xp-float::before { content: ""; position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; background: var(--mark); transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
@keyframes xp-drop { 0% { opacity: 0; transform: translate(-50%, -6px) scale(.92); } 10% { opacity: 1; transform: translate(-50%, 0) scale(1); } 78% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 4px); } }
@media (prefers-reduced-motion: reduce) { .xp-float { animation: none; } }
/* Quiet level-up (levels that aren't a multiple of 5): one ring pulse on the chip */
@media (prefers-reduced-motion: no-preference) { .me-chip.is-levelup .lvl { animation: lvl-pulse .9s cubic-bezier(.16, 1, .3, 1); } }
@keyframes lvl-pulse { 0% { transform: scale(1); } 35% { transform: scale(1.18); } 100% { transform: scale(1); } }
.xp-float.is-level { background: var(--surface); color: var(--text); border: 1.5px solid var(--progress); }
.xp-float.is-level::before { background: var(--surface); border-left: 1.5px solid var(--progress); border-top: 1.5px solid var(--progress); top: -6px; }
@media (max-width: 24rem) { .me-chip .dot { display: none; } .me-chip { padding: 0 var(--space-2); margin-left: 0; } .me-chip.has-progress { gap: 5px; padding: 0 var(--space-2) 0 2px; } .me-chip .lvl-sm { width: 28px; height: 28px; } .me-chip .streak { gap: 1px; } .theme-toggle { margin-left: 0; } .site-nav a { padding: 0 6px; } .header-row { gap: var(--space-1); } .site-header .wrap { width: calc(100% - 1.5rem); } .header-row:has(.me-chip:not([hidden])) .brand-name { display: none; } }

/* ---------- Tool pickers ---------- */
.tool { margin-top: var(--space-5); }
.pick-list, .guide-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-3); max-width: 44rem; }
@media (min-width: 44rem) { .guide-list { grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); max-width: none; } }
.pick, .guide-card { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: var(--space-4) var(--space-5); border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-align: left; text-decoration: none; cursor: pointer; transition: border-color .15s, transform .15s var(--ease); }
.pick:hover, .guide-card:hover { border-color: var(--g-500); transform: translateY(-1px); }
.pick-name { font-family: var(--font-display); font-weight: 700; font-size: var(--step-1); }
.resume { border-left: 3px solid var(--g-500); padding-left: var(--space-4); margin: 0 0 var(--space-4); }

/* ---------- Question card ---------- */
.qcard { max-width: 46rem; scroll-margin-top: 5.5rem; }
.feedback, [data-next] { scroll-margin-bottom: var(--space-5); }
.diff { display: inline-block; font-size: 0.75rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; margin-right: var(--space-2); background: var(--accent-soft); color: var(--text); }
.diff.d3 { background: var(--mark); color: var(--mark-text); }
.qnav { display: flex; justify-content: space-between; max-width: 46rem; margin-top: var(--space-3); }
.result { max-width: 46rem; }
.result-score { font-family: var(--font-display); font-size: var(--step-4); font-weight: 750; letter-spacing: -0.03em; line-height: 1; margin-bottom: var(--space-3); }
.misses { margin-top: var(--space-5); }
.misses summary { cursor: pointer; font-weight: 700; min-height: var(--tap); display: flex; align-items: center; }
.miss { padding: var(--space-4) 0; border-top: 1px solid var(--border); }

/* ---------- Flashcards ---------- */
.deck-count { margin-bottom: var(--space-3); }
.flashcard { max-width: 40rem; }
.card-face { width: 100%; min-height: 15rem; display: flex; flex-direction: column; justify-content: center; gap: var(--space-3); padding: var(--space-6); border: 1.5px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); color: var(--text); text-align: left; cursor: pointer; }
.card-front { font-family: var(--font-display); font-size: var(--step-2); font-weight: 700; line-height: 1.2; }
.card-back { font-size: var(--step-0); line-height: 1.6; padding-top: var(--space-3); border-top: 1px solid var(--border); animation: reveal .25s var(--ease); }
.is-flipped .card-face { border-color: var(--g-400); }
.grades { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-2); max-width: 40rem; margin-top: var(--space-4); }
@media (min-width: 30rem) { .grades { grid-template-columns: repeat(4, 1fr); } }
.grade kbd { font: inherit; font-size: 0.75rem; opacity: .6; margin-left: 4px; }

/* ---------- Paywall ---------- */
.paywall { max-width: 46rem; margin-top: var(--space-5); padding: var(--space-6); border-radius: var(--radius-lg); background: linear-gradient(120deg, var(--band-from), var(--band-to)); color: var(--band-text); }
.paywall h2 { margin-bottom: var(--space-2); }
.paywall .checks li::before { background: var(--g-300); }
.btn-ghost { background: transparent; color: var(--band-text); border-color: color-mix(in srgb, var(--band-text) 40%, transparent); }
.btn-ghost:hover { border-color: var(--band-text); }

/* ---------- Study notes ---------- */
.notes { display: grid; gap: var(--space-4); max-width: 46rem; margin-top: var(--space-6); }
.note { padding: var(--space-5); background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius); }
.note h2 { font-size: var(--step-1); margin-bottom: var(--space-2); }
.note p:last-child { margin-bottom: 0; }

/* ---------- Progress panel ---------- */
.progress-panel[hidden] { display: none; }
/* F17 hub panel: status row → grade card → domain bars → achievements + time */
.prog-top { display: grid; gap: var(--space-4); margin-bottom: var(--space-5); }
@media (min-width: 48rem) { .prog-top { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; } }
.stat { display: flex; align-items: center; gap: var(--space-4); min-width: 0; }
.stat > div { display: grid; gap: 2px; min-width: 0; }
.stat strong { font-size: var(--step-1); font-weight: 650; }
.stat-flame { display: grid; place-items: center; width: 64px; height: 64px; flex: none; border-radius: 50%; background: var(--bg); }
.stat-flame .flame { width: 36px; height: 36px; }
.stat-streak.is-lit .stat-flame { background: color-mix(in srgb, var(--flame) 14%, var(--surface)); }
@media (prefers-reduced-motion: no-preference) { .stat-streak.is-lit .flame { transform-origin: 50% 90%; animation: flicker 2.8s ease-in-out infinite; } }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(0); } 40% { transform: scale(1.04, .97) rotate(-1.5deg); } 70% { transform: scale(.98, 1.03) rotate(1deg); } }

.grade { padding: var(--space-5); border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.grade p { margin: 0; }
.grade-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-4); }
.grade-title { font-size: var(--step-3); font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; }
.grade-meta { color: var(--muted); }
.grade-meta strong { color: var(--text); font-weight: 650; }
.grade-hint { margin-top: var(--space-4) !important; font-weight: 500; }
.grade > .muted { margin-top: var(--space-2) !important; }
.promo { display: inline-block; margin-bottom: var(--space-3) !important; padding: 2px var(--space-3); border-radius: 6px; background: var(--mark); color: var(--mark-text); transform: rotate(-1deg); }
@media (prefers-reduced-motion: no-preference) { .promo { animation: promo-in .7s var(--ease) both; } }
@keyframes promo-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* Career ladder as a commit line: passed nodes filled, current node highlighted */
.ladder { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: var(--space-4) 0 0; padding: 0; }
.ladder li { position: relative; display: grid; justify-items: center; gap: var(--space-2); text-align: center; font-size: var(--step--1); color: var(--muted); }
.ladder li::before { content: ""; position: absolute; top: 8px; left: -50%; width: 100%; height: 2px; background: var(--border); }
.ladder li:first-child::before { display: none; }
.ladder li.is-past::before, .ladder li.is-now::before { background: var(--progress); }
.ladder-node { position: relative; z-index: 1; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface); }
.ladder .is-past .ladder-node { border-color: var(--progress); background: var(--progress); }
.ladder .is-now .ladder-node { width: 22px; height: 22px; margin-top: -2px; border: 3px solid var(--text); background: var(--mark); }
.ladder .is-now { color: var(--text); font-weight: 650; }
@media (max-width: 30rem) { .ladder li { gap: 0; } .ladder-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } .grade { padding: var(--space-4); } }

.prog-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-5); margin-bottom: var(--space-4); }
.prog-foot p { margin: 0; }
.ach-strip { display: inline-flex; align-items: center; gap: var(--space-3); min-height: var(--tap); color: var(--text); text-decoration: none; }
.ach-strip:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.ach-row { list-style: none; display: flex; margin: 0; padding: 0 0 0 6px; }
.ach-row .ach-mini { margin-left: -6px; }

/* Achievement stickers: die-cut look (paper border + soft offset shadow), slight tilt; locked = empty spot */
.sticker { display: inline-grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 16px; transform: rotate(var(--tilt, 0deg)); box-shadow: 0 0 0 3px var(--surface), 0 2px 3px rgb(15 36 28 / 18%), 0 8px 16px -8px rgb(15 36 28 / 35%); }
.sticker .ico { width: 28px; height: 28px; }
.tone-mint { background: var(--g-200); color: var(--g-900); }
.tone-mark { background: var(--mark); color: #3d2e00; }
.tone-forest { background: var(--g-800); color: var(--g-50); }
.sticker.is-locked { background: transparent; color: var(--muted); box-shadow: none; outline: 2px dashed var(--border); outline-offset: -2px; }
.sticker.is-locked .ico { opacity: .55; }
.ach-mini .sticker { width: 34px; height: 34px; border-radius: 10px; }
.ach-mini .sticker .ico { width: 19px; height: 19px; }

/* Toasts: achievement unlocked, level up */
/* Top right under the header chip (where XP and levels live), so a toast never covers the question or the Next button */
.toasts { position: fixed; z-index: 50; top: calc(8rem + env(safe-area-inset-top)); right: max(var(--space-4), calc((100vw - var(--wrap)) / 2)); display: grid; gap: var(--space-2); width: min(24rem, calc(100% - 1.5rem)); pointer-events: none; }
@media (max-width: 40rem) { .toasts { right: 50%; transform: translateX(50%); top: calc(8rem + env(safe-area-inset-top)); } }
.toast { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow); pointer-events: auto; }
.toast-body { display: grid; gap: 2px; min-width: 0; flex: 1; }
.toast-body strong { font-weight: 650; }
.toast-art { flex: none; display: grid; place-items: center; }
.toast-x { flex: none; display: grid; place-items: center; width: var(--tap); height: var(--tap); margin: calc(-1 * var(--space-2)) 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.toast-x:hover { color: var(--text); background: var(--bg); }
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in .45s var(--ease) both; }
  .toast .sticker { animation: slap .6s cubic-bezier(.16, 1, .3, 1) .1s both; }
  .toast.is-leaving { animation: toast-out .25s ease-in forwards; }
}
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes slap { from { opacity: 0; transform: rotate(calc(var(--tilt) - 18deg)) scale(1.5); } to { opacity: 1; transform: rotate(var(--tilt)) scale(1); } }

/* Moments: level up and promotion. Non-modal, centred, tap/Esc/timeout closes. */
.moment { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: var(--space-4); background: color-mix(in srgb, var(--bg) 62%, transparent); cursor: pointer; }
.moment-card { position: relative; width: min(24rem, 100%); padding: var(--space-6) var(--space-5) var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); text-align: center; cursor: default; }
.moment-card p { margin: 0 auto; }
.moment-burst { position: relative; display: grid; place-items: center; width: 96px; height: 96px; margin: 0 auto var(--space-4); }
.moment-burst .lvl-lg { width: 96px; height: 96px; }
.moment-burst .lvl-lg .lvl-n { font-size: var(--step-4); }
.moment-badge { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--mark); color: #3d2e00; box-shadow: 0 0 0 4px var(--surface), 0 10px 24px -10px rgb(15 36 28 / 45%); }
.moment-badge .ico { width: 44px; height: 44px; }
.moment-title { font-size: var(--step-3); font-weight: 750; letter-spacing: -0.025em; line-height: 1.1; text-wrap: balance; }
.moment-grade .moment-title { font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.25rem); }
.moment-sub { margin-top: var(--space-2) !important; color: var(--muted); }
.moment-sub strong { color: var(--text); }
.moment-next { margin-top: var(--space-4) !important; font-weight: 500; max-width: 30ch; }
.moment-card .ladder { margin-top: var(--space-5); }
.moment-card .btn { margin-top: var(--space-5); }
.moment-x { position: absolute; top: var(--space-2); right: var(--space-2); display: grid; place-items: center; width: var(--tap); height: var(--tap); border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.moment-x:hover { color: var(--text); background: var(--bg); }
.spark { position: absolute; left: 50%; top: 50%; width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2); border-radius: 3px; background: var(--c); opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .moment { animation: moment-dim .3s ease-out both; }
  .moment-card { animation: moment-in .55s cubic-bezier(.16, 1, .3, 1) both; }
  .moment.is-leaving { animation: moment-out .3s ease-in forwards; }
  .spark { animation: spark 1.1s cubic-bezier(.16, 1, .3, 1) calc(.45s + var(--t)) both; }
  .moment-level .lvl-fill { animation: ring-fill .8s cubic-bezier(.3, 0, .2, 1) .1s both; }
  .moment-level .lvl-n { animation: num-pop .45s cubic-bezier(.16, 1, .3, 1) .75s both; }
  .moment-badge { animation: num-pop .6s cubic-bezier(.16, 1, .3, 1) .2s both; }
  .ladder-moment li.is-now::before { transform-origin: left center; animation: grow .6s cubic-bezier(.16, 1, .3, 1) .5s both; }
  .ladder-moment .is-now .ladder-node { animation: num-pop .5s cubic-bezier(.16, 1, .3, 1) .9s both; }
}
@keyframes moment-dim { from { opacity: 0; } }
@keyframes moment-in { from { opacity: 0; transform: translateY(16px) scale(.94); } }
@keyframes moment-out { to { opacity: 0; } }
@keyframes spark { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(.4); } 70% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(-1 * var(--d))) scale(1) rotate(90deg); } }
@keyframes ring-fill { from { stroke-dashoffset: 195; } }
@keyframes num-pop { from { opacity: 0; transform: scale(.4); } }
@keyframes grow { from { transform: scaleX(0); } }

/* F19 study plan: form chips, status, weeks on a vertical commit line */
.plan-form { margin-bottom: var(--space-6); }
.plan-form-title { margin-top: 0; }
.field-row { display: grid; gap: var(--space-2); margin: 0 0 var(--space-4); padding: 0; border: 0; }
.field-row .field[type="date"] { max-width: 14rem; }
.field-small { width: 6rem; }
.choices { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--space-4); border: 1.5px solid var(--border); border-radius: 999px; cursor: pointer; }
.choice input:checked + span { border-color: var(--text); background: var(--mark); color: var(--mark-text); }
.choice input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.plan-check { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tap); cursor: pointer; font-size: var(--step--1); }
.plan-check input { width: 18px; height: 18px; accent-color: var(--progress); }
.plan-status { display: grid; gap: var(--space-1); margin-bottom: var(--space-5); }
.plan-status p { margin: 0; }
.plan-count { font-size: var(--step-2); font-weight: 650; }
.plan-count strong { font-size: var(--step-3); font-weight: 750; letter-spacing: -0.02em; }
.plan-pace { margin-top: var(--space-2) !important; font-weight: 500; }
.pace-behind { color: var(--danger); }
.plan-summary { color: var(--muted); max-width: 65ch; }
.plan-summary strong { color: var(--text); }
.plan-summary.is-short { color: var(--text); }
.plan-weeks { list-style: none; margin: var(--space-5) 0; padding: 0; }
.plan-week { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: var(--space-4); padding-bottom: var(--space-5); }
.plan-week::before { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--border); }
.plan-week:last-child::before { display: none; }
.plan-week.is-past::before { background: var(--progress); }
.plan-node { position: relative; z-index: 1; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface); }
.plan-week.is-past .plan-node { border-color: var(--progress); background: var(--progress); }
.plan-week.is-now .plan-node { border: 3px solid var(--text); background: var(--mark); }
.plan-week-body { min-width: 0; }
.plan-week.is-now .plan-week-body { padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.plan-week-title { margin: 0; font-size: var(--step-1); }
.plan-week-body > p { margin: var(--space-1) 0 var(--space-2); }
.plan-items { list-style: none; display: grid; gap: var(--space-2); margin: var(--space-3) 0 0; padding: 0; }
.plan-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
.plan-item.is-done { border-color: color-mix(in srgb, var(--progress) 50%, var(--border)); }
.plan-what { display: grid; gap: 2px; min-width: 0; }
.plan-links { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); font-size: var(--step--1); }
.plan-progress { display: inline-flex; align-items: center; gap: var(--space-2); }
.plan-bar { display: block; width: 6rem; height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }
.plan-week-body > .plan-bar { width: 100%; max-width: 20rem; }
.plan-bar > span { display: block; height: 100%; background: var(--progress); }
.plan-done { color: var(--success); font-weight: 700; }
.plan-tag { display: inline-block; padding: 0 var(--space-2); border-radius: 6px; background: var(--accent-soft); font-size: var(--step--1); }
.plan-catchup { border-style: dashed; }
.plan-line { margin: 0 0 var(--space-4); }

/* Achievements page */
.ach-grid { list-style: none; display: grid; gap: var(--space-4); margin: 0; padding: 0; }
@media (min-width: 40rem) { .ach-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 60rem) { .ach-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ach { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.ach.is-locked { background: transparent; }
.ach-text { display: grid; gap: 2px; min-width: 0; }
.ach-text strong { font-weight: 650; }
.ach.is-locked .ach-text strong { color: var(--muted); }
.ach-summary { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); margin-bottom: var(--space-5); }
.ach-count { font-size: var(--step-3); font-weight: 700; letter-spacing: -0.02em; }
.ring { width: 64px; height: 64px; flex: none; }
.ring-track { fill: none; stroke: var(--border); stroke-width: 7; }
.ring-fill { fill: none; stroke: var(--progress); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .4s var(--ease); }
.ring-text { font: 700 13px var(--font-body); fill: var(--text); }
/* F13 readiness card */
.readiness { margin: var(--space-4) 0 var(--space-5); }
.readiness p { margin: 0 0 var(--space-2); }
.ready-list { list-style: none; padding: 0; margin: var(--space-3) 0 0; display: grid; gap: var(--space-2); }
.ready-list li { display: grid; grid-template-columns: minmax(0, 1fr) 2.75rem; column-gap: var(--space-3); row-gap: var(--space-1); align-items: center; font-size: var(--step--1); }
.ready-list li > span:first-child { grid-column: 1 / -1; }
@media (min-width: 40rem) { .ready-list li { grid-template-columns: minmax(10rem, 16rem) minmax(4rem, 1fr) 2.75rem; } .ready-list li > span:first-child { grid-column: auto; } }
.ready-bar { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.ready-bar > span { display: block; height: 100%; background: var(--accent); }
.ready-list .num { text-align: right; }

/* ---------- Account (M2) ---------- */
.account { max-width: 30rem; }
.signin { display: grid; gap: var(--space-3); margin-top: var(--space-5); }
.signin form { display: grid; gap: var(--space-3); }
.btn-wide { width: 100%; }
.or { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-2) 0; color: var(--muted); font-size: var(--step--1); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.field-label { font-weight: 700; font-size: var(--step--1); }
.field { width: 100%; min-height: 48px; padding: 0 var(--space-4); border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font: inherit; }
.field:hover { border-color: var(--muted); }
.field:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.turnstile:empty { display: none; }
.form-msg:empty, .checkout-msg:empty, [data-checkout-msg]:empty { display: none; }
.form-msg, .checkout-msg { margin: 0; font-size: var(--step--1); }
.account-card { margin-top: var(--space-5); }
/* F23 avatar: initial on a green disc, replaced by the Gravatar once it loads */
.account-id { display: flex; align-items: center; gap: var(--space-4); }
.account-id > div { min-width: 0; }
.account-id p { margin: 0; }
.avatar { position: relative; display: grid; place-items: center; width: 64px; height: 64px; flex: none; border-radius: 50%; overflow: hidden; background: var(--g-200); color: var(--g-900); font-size: var(--step-2); font-weight: 700; box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--border); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s var(--ease); }
.avatar.has-img img { opacity: 1; }
.avatar-opt { margin: var(--space-4) 0; padding-top: var(--space-4); border-top: 1px solid var(--border); }
.avatar-opt p { margin: var(--space-1) 0 0; }
.switch { display: inline-flex; align-items: center; gap: var(--space-3); min-height: var(--tap); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { position: relative; width: 44px; height: 26px; flex: none; border-radius: 999px; background: var(--border); transition: background .2s var(--ease); }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgb(15 36 28 / 30%); transition: transform .2s var(--ease); }
.switch input:checked + .switch-ui { background: var(--progress); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch input:disabled + .switch-ui { opacity: .6; }
.account-email { font-family: var(--font-display); font-size: var(--step-1); font-weight: 700; overflow-wrap: anywhere; margin: 0; }
.account-status { display: inline-block; margin-top: var(--space-2); padding: var(--space-1) var(--space-3); border-radius: 999px; background: var(--accent-soft); font-weight: 700; font-size: var(--step--1); }
.tax-note { margin-top: calc(-1 * var(--space-2)); }

/* ---------- Mock exam (M2) ---------- */
.mock { max-width: 46rem; }
.mock-start .facts { grid-template-columns: repeat(3, auto); justify-content: start; gap: var(--space-5); margin-top: 0; }
.mock-bar { position: sticky; top: 64px; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); border: 1.5px solid var(--border); border-radius: 999px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); }
.mock-clock { font-family: var(--font-display); font-size: var(--step-1); font-weight: 750; letter-spacing: -0.02em; }
.mock-clock .low { color: var(--danger); }
.mock-nav { flex-wrap: wrap; gap: var(--space-2); }
.flag.is-on { background: var(--mark); border-color: transparent; color: #2a2100; }
.mock-grid-wrap { margin-top: var(--space-4); }
.mock-grid-wrap summary { cursor: pointer; font-weight: 700; min-height: var(--tap); display: flex; align-items: center; }
.mock-grid { list-style: none; padding: 0; margin: var(--space-2) 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: var(--space-2); }
.mock-grid button { position: relative; width: 100%; min-height: var(--tap); border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: 700 var(--step--1) var(--font-body); cursor: pointer; }
.mock-grid button.is-answered { background: var(--accent-soft); border-color: var(--accent); }
.mock-grid button[aria-current="true"] { outline: 3px solid var(--focus); outline-offset: 1px; }
.mock-grid button span { position: absolute; top: 1px; right: 4px; font-size: 0.7rem; }
.legend-line .key { display: inline-block; width: 0.9em; height: 0.9em; vertical-align: -0.1em; border: 1.5px solid var(--border); border-radius: 3px; background: var(--surface); }
.legend-line .key.is-answered { background: var(--accent-soft); border-color: var(--accent); }
.confirm { max-width: min(28rem, calc(100vw - 2rem)); border: 0; color: var(--text); }
.confirm::backdrop { background: rgb(0 0 0 / 0.45); }
.confirm h2 { font-size: var(--step-2); margin-top: 0; }
.notice-inline { margin: 0 0 var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: var(--accent-soft); font-weight: 700; }
.review { margin-top: var(--space-6); }
.review-filter { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-3); }
.review-filter [aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.recent { margin-top: var(--space-6); }
.recent ol { padding-left: 1.2em; }
.bank-pick { margin-bottom: var(--space-6); padding-bottom: var(--space-5); border-bottom: 1px solid var(--border); }
.bank-pick h2 { font-size: var(--step-1); margin-bottom: var(--space-1); }
.mock-count { white-space: nowrap; }
@media (max-width: 24rem) { .mock-count-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }

/* F15 scenario block header in scenario-format mocks */
.scenario { margin: 0 0 var(--space-3); padding: var(--space-3) var(--space-4); border: 1.5px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius, 12px); background: var(--accent-soft); }
.scenario summary { cursor: pointer; font-weight: 600; display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: baseline; }
.scenario p { margin: var(--space-2) 0 0; line-height: 1.6; }
.scenario summary .small { font-weight: 400; }
