/* ============================================================
   GED Prep — Global styles
   All values reference tokens.css. No raw hex here.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--text-md);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: var(--leading-tight);
  margin: 0 0 var(--sp-3);
  letter-spacing: -0.01em;
  font-weight: 700;
}
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
p { margin: 0 0 var(--sp-4); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { font-weight: 700; }
code, .mono { font-family: var(--font-mono); font-size: 0.95em; }

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-sm); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

.skip-link {
  position: absolute; left: var(--sp-4); top: -60px; z-index: 100;
  background: var(--surface); color: var(--ink); padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-sm); box-shadow: var(--shadow-2); transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: var(--sp-4); }

/* ---------------- Layout ---------------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--sp-5); }
.container--narrow { max-width: var(--container-narrow); }
main { min-height: 70vh; padding-bottom: var(--sp-20); }

/* ---------------- Top bar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  max-width: var(--container); margin: 0 auto; padding: var(--sp-3) var(--sp-5);
  display: flex; align-items: center; gap: var(--sp-4);
}
.brand {
  font-family: var(--font-display); font-weight: 800; font-size: var(--text-lg);
  color: var(--ink); display: flex; align-items: center; gap: var(--sp-2);
}
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--brand);
  color: var(--on-brand); display: grid; place-items: center;
  font-size: var(--text-xs); font-weight: 800; letter-spacing: 0;
}
.topbar__nav { display: flex; gap: var(--sp-1); margin-left: auto; align-items: center; }
.topbar__link {
  color: var(--ink-soft); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-full);
  font-size: var(--text-sm); font-weight: 600;
}
.topbar__link:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.topbar__link[aria-current="page"] { background: var(--brand-tint); color: var(--brand-strong); }

.streak-pill {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-full); padding: 4px 10px; color: var(--ink-soft);
}

/* Mobile nav */
.tabbar { display: none; }
@media (max-width: 720px) {
  .topbar__nav { display: none; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(14px) saturate(1.3);
    border-top: 1px solid var(--line);
    padding: var(--sp-1) var(--sp-2) calc(var(--sp-1) + env(safe-area-inset-bottom));
  }
  .tabbar a {
    flex: 1; text-align: center; padding: var(--sp-2) 0; color: var(--ink-faint);
    font-size: 0.6875rem; font-weight: 700; border-radius: var(--r-sm);
    display: flex; flex-direction: column; align-items: center; gap: 2px;
  }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--brand); }
  .tabbar a:hover { text-decoration: none; }
  main { padding-bottom: 96px; }
}

/* ---------------- Breadcrumbs ---------------- */
.crumbs {
  display: flex; flex-wrap: wrap; gap: var(--sp-1); align-items: center;
  font-size: var(--text-xs); color: var(--ink-faint); margin: var(--sp-5) 0 var(--sp-3);
}
.crumbs a { color: var(--ink-faint); font-weight: 600; }
.crumbs a:hover { color: var(--brand); }
.crumbs .sep { opacity: .6; }
.crumbs .here { color: var(--ink-soft); font-weight: 700; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  font-family: var(--font-text); font-weight: 700; font-size: var(--text-sm);
  padding: 10px 20px; border-radius: var(--r-full); border: 1px solid transparent;
  cursor: pointer; transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--brand); color: var(--on-brand); box-shadow: var(--shadow-1); }
.btn--primary:hover { background: var(--brand-strong); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--soft { background: var(--surface-2); color: var(--ink); }
.btn--soft:hover { background: var(--line); }
.btn--sm { padding: 6px 14px; font-size: var(--text-xs); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------------- Cards & wells ---------------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-1);
}
.well { background: var(--surface-2); border-radius: var(--r-md); }

/* ---------------- Progress ---------------- */
.meter {
  height: 8px; border-radius: var(--r-full); background: var(--surface-2);
  overflow: hidden; position: relative;
}
.meter > span {
  display: block; height: 100%; border-radius: var(--r-full);
  background: var(--accent, var(--brand));
  transition: width var(--t-med) var(--ease);
}
.ring { display: grid; place-items: center; position: relative; }
.ring svg { transform: rotate(-90deg); }
.ring__label {
  position: absolute; font-family: var(--font-mono); font-weight: 700;
  font-size: var(--text-sm);
}

/* Mastery states */
.mastery {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-xs); font-weight: 700; border-radius: var(--r-full);
  padding: 3px 10px;
}
.mastery--none { background: var(--surface-2); color: var(--ink-faint); }
.mastery--learning { background: var(--warn-tint); color: var(--warn); }
.mastery--developing { background: var(--brand-tint); color: var(--brand-strong); }
.mastery--mastered { background: var(--good-tint); color: var(--good); }
.mastery .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* ---------------- Subject theming ---------------- */
[data-subject="math"] { --accent: var(--math); --accent-deep: var(--math-deep); --accent-tint: var(--math-tint); --accent-soft: var(--math-soft); }
[data-subject="rla"]  { --accent: var(--rla);  --accent-deep: var(--rla-deep);  --accent-tint: var(--rla-tint);  --accent-soft: var(--rla-soft); }
[data-subject="sci"]  { --accent: var(--sci);  --accent-deep: var(--sci-deep);  --accent-tint: var(--sci-tint);  --accent-soft: var(--sci-soft); }
[data-subject="ss"]   { --accent: var(--ss);   --accent-deep: var(--ss-deep);   --accent-tint: var(--ss-tint);   --accent-soft: var(--ss-soft); }

/* ---------------- Home: subject cards ---------------- */
.hero { padding: var(--sp-12) 0 var(--sp-8); }
.hero h1 { max-width: 640px; }
.hero .lede { font-size: var(--text-lg); color: var(--ink-soft); max-width: 560px; }

.subject-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-5);
}
@media (max-width: 860px) { .subject-grid { grid-template-columns: 1fr; } }

.subject-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  gap: var(--sp-3); padding: var(--sp-6); min-height: 250px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-1);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.subject-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); text-decoration: none; }
.subject-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 6px;
  background: var(--accent);
}
.subject-card__art {
  position: absolute; right: -24px; bottom: -20px; width: 200px; opacity: .95;
  pointer-events: none;
}
@media (max-width: 480px) { .subject-card__art { width: 140px; right: -18px; } }
.subject-card h3 { color: var(--ink); margin-bottom: 0; }
.subject-card .desc { color: var(--ink-soft); font-size: var(--text-sm); max-width: 34ch; }
.subject-card .stat-row {
  margin-top: auto; display: flex; flex-direction: column; gap: var(--sp-2);
  position: relative; z-index: 1; max-width: 70%;
}
@media (max-width: 480px) { .subject-card .stat-row { max-width: 100%; } }
.subject-card .continue {
  font-weight: 700; font-size: var(--text-sm); color: var(--accent-deep);
}
.subject-card .meta { font-size: var(--text-xs); color: var(--ink-faint); font-family: var(--font-mono); }

/* ---------------- Unit / lesson lists ---------------- */
.unit-list { display: flex; flex-direction: column; gap: var(--sp-4); margin: var(--sp-6) 0; }
.unit-row {
  display: flex; gap: var(--sp-4); align-items: center; padding: var(--sp-4) var(--sp-5);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.unit-row:hover { transform: translateY(-2px); box-shadow: var(--shadow-1); text-decoration: none; }
.unit-row__num {
  flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: var(--accent-tint); color: var(--accent-deep);
  font-family: var(--font-display); font-weight: 800;
}
.unit-row__body { flex: 1; min-width: 0; }
.unit-row__body h4 { margin: 0; color: var(--ink); }
.unit-row__body .sub { font-size: var(--text-xs); color: var(--ink-faint); }
.unit-row .meter { width: 90px; flex: none; }
@media (max-width: 560px) { .unit-row .meter { display: none; } }

.lesson-list { display: flex; flex-direction: column; gap: var(--sp-2); margin: var(--sp-5) 0; }
.lesson-row {
  display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface);
  color: var(--ink);
}
.lesson-row:hover { background: var(--surface-2); text-decoration: none; }
.lesson-row__state { flex: none; width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--line-strong); display: grid; place-items: center; color: var(--on-brand); }
.lesson-row__state.is-done { background: var(--accent); border-color: var(--accent); }
.lesson-row__title { flex: 1; font-weight: 600; font-size: var(--text-sm); }
.lesson-row__meta { font-size: var(--text-xs); color: var(--ink-faint); font-family: var(--font-mono); }

/* ---------------- Lesson page ---------------- */
.lesson-header { margin: var(--sp-4) 0 var(--sp-8); }
.lesson-header .kicker {
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 600;
  color: var(--accent-deep); text-transform: uppercase; letter-spacing: .08em;
}
.lesson-header h1 { font-size: var(--text-2xl); margin-top: var(--sp-2); }

.block { margin: 0 0 var(--sp-8); }

/* A. What you are learning */
.block--learn {
  border-left: 4px solid var(--accent); padding: var(--sp-4) var(--sp-5);
  background: var(--accent-tint); border-radius: 0 var(--r-md) var(--r-md) 0;
}
.block--learn .tag, .block-tag {
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint);
  display: block; margin-bottom: var(--sp-1);
}
.block--learn .tag { color: var(--accent-deep); }
.block--learn p { margin: 0; font-size: var(--text-lg); font-weight: 600; }
.block--why p { margin: 0; color: var(--ink-soft); font-size: var(--text-md); }

/* C. Visual figure */
.figure { margin: 0; }
.figure__stage {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: var(--sp-5); overflow-x: auto;
}
.figure__stage--flush { background: none; border: none; padding: 0; overflow: visible; }
.figure figcaption {
  font-size: var(--text-sm); color: var(--ink-soft); margin-top: var(--sp-3);
  text-align: center;
}
.figure--edge { margin-inline: calc(-1 * var(--sp-5)); }
@media (min-width: 1100px) {
  .figure--edge { margin-inline: calc(-1 * var(--sp-10)); }
}

/* Editorial spread: illustration + floating labels */
.spread {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  background: var(--accent-tint);
}
.spread img { width: 100%; }
.spread__note {
  position: absolute; max-width: 220px; padding: var(--sp-3) var(--sp-4);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-1);
  font-size: var(--text-xs); line-height: 1.45;
}
.spread__note strong { display: block; font-family: var(--font-display); font-size: var(--text-sm); }
@media (max-width: 720px) {
  .spread__note { position: static; max-width: none; margin: var(--sp-3); }
  .spread { display: flex; flex-direction: column; padding-bottom: var(--sp-2); }
}
/* Fallback when a scene image is unavailable: notes become stacked cards */
.spread--noimg { display: flex; flex-direction: column; padding: var(--sp-2); }
.spread--noimg .spread__note { position: static; max-width: none; margin: var(--sp-2); }

/* Annotation label (editorial, hand-set feel) */
.anno {
  font-family: var(--font-display); font-style: italic; font-weight: 600;
  font-size: var(--text-sm); color: var(--accent-deep);
}

/* D. Steps */
.steps { counter-reset: step; display: flex; flex-direction: column; gap: var(--sp-3); }
.steps__problem {
  font-family: var(--font-mono); font-size: var(--text-lg); font-weight: 600;
  background: var(--surface-2); border-radius: var(--r-sm); padding: var(--sp-3) var(--sp-4);
}
.step {
  display: grid; grid-template-columns: 34px 1fr; gap: var(--sp-3); align-items: start;
  padding: var(--sp-3) var(--sp-4); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-sm);
}
.step::before {
  counter-increment: step; content: counter(step);
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-tint); color: var(--accent-deep);
  font-family: var(--font-display); font-weight: 800; font-size: var(--text-sm);
}
.step .do { font-weight: 600; }
.step .show { font-family: var(--font-mono); font-size: var(--text-lg); margin-top: 4px; }
.step .note { font-size: var(--text-sm); color: var(--ink-soft); margin-top: 4px; }
.steps.is-stepping .step[hidden] { display: none; }

/* Flow (vertical arrows) */
.flow { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: var(--sp-5) 0; }
.flow__item {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-5); font-weight: 600; text-align: center; max-width: 420px;
}
.flow__item .sub { display: block; font-weight: 400; font-size: var(--text-sm); color: var(--ink-soft); }
.flow__arrow { color: var(--accent, var(--brand)); font-size: var(--text-lg); line-height: 1; padding: 2px 0; }
.flow--wide { flex-direction: row; flex-wrap: wrap; justify-content: center; }
.flow--wide .flow__arrow { transform: rotate(-90deg); }

/* Compare (before/after, two columns) */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
@media (max-width: 640px) { .compare { grid-template-columns: 1fr; } }
.compare__col { border-radius: var(--r-md); padding: var(--sp-4) var(--sp-5); border: 1px solid var(--line); background: var(--surface); }
.compare__col.is-bad { background: var(--bad-tint); border-color: transparent; }
.compare__col.is-good { background: var(--good-tint); border-color: transparent; }
.compare__col h5 { margin: 0 0 var(--sp-2); font-family: var(--font-display); font-size: var(--text-sm); }

/* G. Common mistake */
.block--mistake {
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: var(--sp-5); background: var(--surface);
  border-top: 4px solid var(--warn);
}
.block--mistake .block-tag { color: var(--warn); }

/* H. Remember card */
.remember {
  background: var(--ink); color: var(--paper); border-radius: var(--r-lg);
  padding: var(--sp-6); text-align: center; box-shadow: var(--shadow-2);
}
[data-theme="dark"] .remember { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-strong); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .remember { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-strong); }
}
.remember .block-tag { color: inherit; opacity: .7; }
.remember .big { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 800; margin: var(--sp-2) 0; }
.remember .line { font-size: var(--text-sm); opacity: .9; }

/* ---------------- Vocab ---------------- */
.vocab {
  border-bottom: 2px dotted var(--accent, var(--brand)); cursor: help;
  font-weight: 600; position: relative; background: none; border-top: none; border-left: none; border-right: none;
  font-size: inherit; font-family: inherit; color: inherit; padding: 0;
}
.vocab-pop {
  position: absolute; z-index: 80; max-width: 280px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: var(--shadow-2); padding: var(--sp-3) var(--sp-4); font-size: var(--text-sm);
}
.vocab-pop strong { font-family: var(--font-display); display: block; }
.vocab-pop .ex { color: var(--ink-soft); font-size: var(--text-xs); margin-top: 4px; }

/* ---------------- Disclosure: simpler / show me / translator / hint ---------------- */
.reveal { margin-top: var(--sp-3); }
.reveal__btn { }
.reveal__panel {
  margin-top: var(--sp-3); padding: var(--sp-4) var(--sp-5);
  background: var(--surface-2); border-radius: var(--r-sm);
  border-left: 3px solid var(--accent, var(--brand));
  font-size: var(--text-md);
}
.reveal__panel .label {
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint);
  display: block; margin-bottom: var(--sp-1);
}

/* ---------------- Questions ---------------- */
.q {
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); overflow: hidden;
}
.q__head {
  padding: var(--sp-3) var(--sp-5); background: var(--surface-2);
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
}
.q__level {
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 700;
  color: var(--accent-deep, var(--brand-strong));
}
.q__body { padding: var(--sp-5); }
.q__passage {
  background: var(--surface-2); border-radius: var(--r-sm); padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-4); font-size: var(--text-md);
}
.q__passage mark {
  background: var(--warn-tint); color: inherit; border-radius: 3px; padding: 0 2px;
  box-shadow: inset 0 -2px 0 var(--warn);
}
.q__prompt { font-weight: 600; font-size: var(--text-md); }
.q__opts { display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-4); }
.q-opt {
  display: flex; gap: var(--sp-3); align-items: flex-start; text-align: left;
  width: 100%; padding: var(--sp-3) var(--sp-4);
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--r-sm);
  cursor: pointer; font: inherit; color: inherit;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.q-opt:hover:not([disabled]) { border-color: var(--accent, var(--brand)); background: var(--surface-2); }
.q-opt:active:not([disabled]) { transform: scale(.99); }
.q-opt__key {
  flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  background: var(--surface-2); font-family: var(--font-mono); font-weight: 700; font-size: var(--text-xs);
}
.q-opt.is-picked { border-color: var(--accent, var(--brand)); }
.q-opt.is-right { border-color: var(--good); background: var(--good-tint); }
.q-opt.is-right .q-opt__key { background: var(--good); color: var(--surface); }
.q-opt.is-wrong { border-color: var(--bad); background: var(--bad-tint); }
.q-opt.is-wrong .q-opt__key { background: var(--bad); color: var(--surface); }
.q-opt[disabled] { cursor: default; }

.q__feedback { margin-top: var(--sp-4); border-radius: var(--r-sm); padding: var(--sp-4) var(--sp-5); font-size: var(--text-md); }
.q__feedback.is-nudge { background: var(--warn-tint); }
.q__feedback.is-good { background: var(--good-tint); }
.q__feedback.is-explain { background: var(--surface-2); }
.q__feedback .label {
  font-family: var(--font-display); font-weight: 700; display: block; margin-bottom: var(--sp-1);
}
.q__actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); flex-wrap: wrap; }
.q__work { margin-top: var(--sp-3); }
.q__work .step .show { font-size: var(--text-md); }

/* ---------------- Quiz / exam shell ---------------- */
.quiz-top {
  display: flex; align-items: center; gap: var(--sp-4); margin: var(--sp-5) 0;
  flex-wrap: wrap;
}
.quiz-top .meter { flex: 1; min-width: 160px; }
.quiz-timer { font-family: var(--font-mono); font-weight: 700; font-size: var(--text-md);
  background: var(--surface-2); border-radius: var(--r-full); padding: 6px 14px; }
.quiz-timer.is-low { background: var(--bad-tint); color: var(--bad); }

.result-band { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-6); align-items: center;
  padding: var(--sp-6); }
@media (max-width: 560px) { .result-band { grid-template-columns: 1fr; text-align: center; justify-items: center; } }
.skill-report { display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-4); }
.skill-report__row { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--text-sm); }
.skill-report__row .meter { width: 120px; flex: none; }
.skill-report__row .name { flex: 1; font-weight: 600; }

/* ---------------- Dashboard ---------------- */
.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--sp-5); align-items: start; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-continue {
  padding: var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-3);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1); position: relative; overflow: hidden;
}
.dash-continue::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--accent, var(--brand)); }
.dash-side { display: flex; flex-direction: column; gap: var(--sp-5); }
.dash-panel { padding: var(--sp-5); }
.dash-panel h4 { margin-bottom: var(--sp-3); }
.dash-subjects { display: flex; flex-direction: column; gap: var(--sp-3); }
.dash-subjects .row { display: flex; align-items: center; gap: var(--sp-3); }
.dash-subjects .row .name { width: 110px; flex: none; font-weight: 700; font-size: var(--text-sm); }
.dash-subjects .row .meter { flex: 1; }
.dash-subjects .row .pct { font-family: var(--font-mono); font-size: var(--text-xs); width: 40px; text-align: right; color: var(--ink-faint); }

.chip-list { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip {
  font-size: var(--text-xs); font-weight: 700; padding: 5px 12px; border-radius: var(--r-full);
  background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line);
}
a.chip:hover { background: var(--brand-tint); color: var(--brand-strong); text-decoration: none; }

/* ---------------- Course map ---------------- */
.map-track { display: flex; flex-direction: column; align-items: stretch; max-width: 460px; margin: var(--sp-8) auto; position: relative; }
.map-node {
  display: flex; gap: var(--sp-4); align-items: center; padding: var(--sp-4) var(--sp-5);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  color: var(--ink); position: relative; z-index: 1;
}
.map-node:hover { box-shadow: var(--shadow-1); text-decoration: none; }
.map-node.is-done { border-color: var(--accent-soft); background: var(--accent-tint); }
.map-link { width: 3px; height: 26px; background: var(--line-strong); margin-left: calc(var(--sp-5) + 20px); }
.map-node__badge {
  flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink-soft); font-family: var(--font-display); font-weight: 800;
}
.map-node.is-done .map-node__badge { background: var(--accent); color: var(--surface); }

/* ---------------- Search ---------------- */
.search-bar { display: flex; gap: var(--sp-2); margin: var(--sp-5) 0; }
.search-bar input {
  flex: 1; font: inherit; padding: 12px 18px; border-radius: var(--r-full);
  border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink);
}
.search-bar input:focus-visible { border-color: var(--brand); }
.result-kind {
  font-family: var(--font-mono); font-size: var(--text-xs); text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-faint);
}

/* ---------------- Bookmark button ---------------- */
.bookmark-btn {
  background: none; border: none; cursor: pointer; color: var(--ink-faint);
  padding: var(--sp-1); border-radius: var(--r-sm); display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-xs); font-weight: 700; font-family: var(--font-text);
}
.bookmark-btn:hover { color: var(--brand); }
.bookmark-btn.is-on { color: var(--warn); }

/* ---------------- Unit intro panel ---------------- */
.unit-intro {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: var(--sp-6);
  padding: var(--sp-6); margin: var(--sp-5) 0;
  background: var(--accent-tint); border-radius: var(--r-lg);
}
@media (max-width: 720px) { .unit-intro { grid-template-columns: 1fr; } }
.unit-intro h4 { font-size: var(--text-sm); text-transform: uppercase; letter-spacing: .06em; color: var(--accent-deep); margin-bottom: var(--sp-1); font-family: var(--font-mono); }
.unit-intro ul { margin: 0; padding-left: 1.2em; font-size: var(--text-sm); }
.unit-intro li { margin-bottom: 4px; }

/* ---------------- Lesson footer nav ---------------- */
.lesson-nav {
  display: flex; justify-content: space-between; gap: var(--sp-3);
  margin-top: var(--sp-10); padding-top: var(--sp-5); border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

/* ---------------- Full-bleed section (editorial) ---------------- */
.bleed {
  margin-inline: calc(50% - 50vw); padding-inline: max(var(--sp-5), calc(50vw - var(--container) / 2));
  background: var(--accent-tint);
  padding-block: var(--sp-8);
}

/* ---------------- Tables ---------------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
table.tbl { border-collapse: collapse; width: 100%; font-size: var(--text-sm); background: var(--surface); }
.tbl th, .tbl td { padding: var(--sp-3) var(--sp-4); text-align: left; border-bottom: 1px solid var(--line); }
.tbl th { font-family: var(--font-display); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); background: var(--surface-2); }
.tbl tr:last-child td { border-bottom: none; }
.tbl td.num, .tbl th.num { text-align: right; font-family: var(--font-mono); }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; bottom: var(--sp-6); left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--paper); padding: var(--sp-3) var(--sp-6);
  border-radius: var(--r-full); box-shadow: var(--shadow-2); opacity: 0; z-index: 90;
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease);
  font-weight: 600; font-size: var(--text-sm); pointer-events: none;
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 720px) { .toast { bottom: 100px; } }

/* ---------------- Misc ---------------- */
.section-head { display: flex; align-items: baseline; gap: var(--sp-4); margin: var(--sp-8) 0 var(--sp-4); }
.section-head h2, .section-head h3 { margin: 0; }
.section-head .more { margin-left: auto; font-size: var(--text-sm); font-weight: 700; }
.muted { color: var(--ink-soft); }
.tiny { font-size: var(--text-xs); color: var(--ink-faint); }
.center { text-align: center; }
.stack-2 { display: flex; flex-direction: column; gap: var(--sp-2); }
.stack-4 { display: flex; flex-direction: column; gap: var(--sp-4); }
hr.rule { border: none; border-top: 1px solid var(--line); margin: var(--sp-8) 0; }
