/* Anaesthesia Training Companion — design system
 * Calm, clinical, editorial. Geist for UI and headings, Geist Mono for codes and numbers,
 * Instrument Serif as an occasional accent. Light by default; dark via the header toggle. */

:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --surface-3: #e9edf3;
  --line: #e4e7ee;
  --line-strong: #cfd5df;
  --text: #0d1424;
  --text-2: #364055;
  --muted: #687289;
  --brand: #2853e0;
  --brand-hover: #1f45c4;
  --brand-ink: #ffffff;
  --brand-soft: #edf1ff;
  --brand-line: #c9d5ff;
  --teal: #0b8f89;
  --teal-soft: #e2f5f3;
  --violet: #6b46f0;
  --violet-soft: #f0ecff;
  --amber: #a15c00;
  --amber-soft: #fff4dd;
  --red: #c42a36;
  --red-soft: #fdecee;
  --green: #137a45;
  --green-soft: #e3f5ea;
  --first: #9a4d00;
  --first-soft: #fff1dc;
  /* stages of training */
  --s0: #c7780f; --s1: #2853e0; --s2: #0b8f89; --s3: #6b46f0;

  --font: "Geist", Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --shadow-xs: 0 1px 1px rgba(13, 20, 36, .04);
  --shadow-sm: 0 1px 2px rgba(13, 20, 36, .06), 0 0 0 1px rgba(13, 20, 36, .02);
  --shadow: 0 2px 6px -2px rgba(13, 20, 36, .08), 0 1px 2px rgba(13, 20, 36, .05);
  --shadow-lg: 0 16px 40px -12px rgba(13, 20, 36, .22), 0 4px 12px -4px rgba(13, 20, 36, .08);

  --topbar-h: 60px;
  --sidebar-w: 268px;
  --content-max: 1120px;
  --read-max: 72ch;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0a0e16;
  --surface: #111723;
  --surface-2: #171f2d;
  --surface-3: #1f2939;
  --line: #232d3d;
  --line-strong: #334055;
  --text: #edf1f7;
  --text-2: #c3cbd8;
  --muted: #8b96aa;
  --brand: #7b9cff;
  --brand-hover: #98b2ff;
  --brand-ink: #0a1020;
  --brand-soft: #16223f;
  --brand-line: #2b3d6e;
  --teal: #45cfc6;
  --teal-soft: #0f2c2d;
  --violet: #ae97ff;
  --violet-soft: #221c3d;
  --amber: #f2bd62;
  --amber-soft: #2e2311;
  --red: #ff8d95;
  --red-soft: #3a1a1e;
  --green: #6fd79c;
  --green-soft: #13301f;
  --first: #f3b866;
  --first-soft: #33260f;
  --s0: #f0ad4e; --s1: #7b9cff; --s2: #45cfc6; --s3: #ae97ff;
  --shadow-xs: none;
  --shadow-sm: 0 0 0 1px rgba(255, 255, 255, .02);
  --shadow: 0 2px 8px -2px rgba(0, 0, 0, .5);
  --shadow-lg: 0 20px 50px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.65 var(--font);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
h1, h2, h3, h4 { color: var(--text); font-weight: 650; letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: clamp(1.85rem, 1.3rem + 1.6vw, 2.6rem); letter-spacing: -.035em; margin: 0 0 .6rem; font-weight: 680; }
h2 { font-size: 1.35rem; margin: 0 0 .6rem; }
h3 { font-size: 1.06rem; margin: 0 0 .4rem; letter-spacing: -.01em; }
p { margin: 0 0 1rem; }
ul, ol { padding-left: 1.25rem; margin: 0 0 1rem; }
li { margin: .3rem 0; }
li::marker { color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
code, kbd { font-family: var(--mono); }
code { font-size: .84em; background: var(--surface-2); border: 1px solid var(--line); padding: .08em .38em; border-radius: 6px; }
kbd { font-size: .72rem; padding: .1rem .38rem; border-radius: 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; background: var(--surface); color: var(--muted); line-height: 1.4; }
strong { font-weight: 620; color: var(--text); }
::selection { background: var(--brand-soft); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.small { font-size: .875rem; color: var(--muted); }
.lede { font-size: 1.12rem; line-height: 1.6; color: var(--text-2); max-width: 64ch; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--brand); color: var(--brand-ink); padding: .5rem 1rem; z-index: 100; border-radius: 0 0 8px 0; }
.skip:focus { left: 0; }
.wrap { max-width: var(--content-max); margin: 0 auto; }
.loading { color: var(--muted); padding: 3rem 0; }
.loading::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: .6rem; vertical-align: -2px; border: 2px solid var(--line-strong); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- app shell ---------- */
.app { min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 1rem;
  padding: 0 1.25rem;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .7rem; color: var(--text); text-decoration: none !important; min-width: 0; }
.brand-mark { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff;
  background: linear-gradient(140deg, #3b67f2 0%, #2853e0 45%, #0b8f89 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 4px 10px -4px rgba(40, 83, 224, .6); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; font-weight: 650; font-size: .95rem; letter-spacing: -.01em; white-space: nowrap; }
.brand-text small { font-weight: 450; font-size: .74rem; color: var(--muted); letter-spacing: 0; }
.search-trigger {
  margin-left: auto; flex: 0 1 360px; display: flex; align-items: center; gap: .6rem;
  height: 38px; padding: 0 .6rem 0 .8rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--muted);
  font: inherit; font-size: .88rem; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
}
.search-trigger:hover { border-color: var(--line-strong); background: var(--surface); box-shadow: var(--shadow-sm); }
.search-trigger .search-label { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: .4rem; }
.topbar-link { font-size: .88rem; font-weight: 550; color: var(--text-2); padding: .4rem .7rem; border-radius: 8px; white-space: nowrap; }
.topbar-link:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; flex: none; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.menu-btn { display: none; margin-left: -.4rem; }
#theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] #theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] #theme-toggle .i-moon { display: none; }

.sidebar {
  position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: var(--sidebar-w); z-index: 30;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 1.1rem .8rem 1rem; overflow-y: auto; scrollbar-width: thin;
  background: var(--bg); border-right: 1px solid var(--line);
}
.nav-group { margin-bottom: 1.1rem; }
.nav-group ul { list-style: none; padding: 0; margin: 0; }
.nav-group li { margin: 1px 0; }
.nav-label { margin: 0 0 .3rem .7rem; font-size: .7rem; font-weight: 650; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.nav-link { display: flex; align-items: center; gap: .65rem; padding: .44rem .7rem; border-radius: 9px; color: var(--text-2); font-size: .9rem; font-weight: 500; text-decoration: none !important; transition: background .12s, color .12s; }
.nav-link svg { color: var(--muted); flex: none; transition: color .12s; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link:hover svg { color: var(--text-2); }
.nav-group li.active > .nav-link { background: var(--surface); color: var(--text); font-weight: 620; box-shadow: var(--shadow-sm); border: 1px solid var(--line); padding: calc(.44rem - 1px) calc(.7rem - 1px); }
.nav-group li.active > .nav-link svg { color: var(--brand); }
.nav-sub { margin: .25rem 0 .5rem 1.55rem !important; padding-left: .7rem !important; border-left: 1px solid var(--line); }
.nav-sub a { display: block; padding: .3rem .6rem; border-radius: 7px; font-size: .85rem; color: var(--muted); text-decoration: none !important; position: relative; }
.nav-sub a:hover { color: var(--text); background: var(--surface-2); }
.nav-sub a[aria-current="page"] { color: var(--brand); font-weight: 600; background: var(--brand-soft); }
.nav-sub a[aria-current="page"]::before { content: ""; position: absolute; left: calc(-.7rem - 1px); top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: var(--brand); }
.sidebar-foot { padding: .9rem .7rem 0; border-top: 1px solid var(--line); font-size: .82rem; }
.sidebar-foot p { margin: 0 0 .3rem; }
.sidebar-foot a { color: var(--text-2); }
.scrim { position: fixed; inset: 0; z-index: 25; background: rgba(8, 12, 20, .45); backdrop-filter: blur(2px); }

.main-col { margin-left: var(--sidebar-w); min-width: 0; padding: 0 clamp(1rem, 3vw, 2.75rem); }
main { max-width: var(--content-max); margin: 0 auto; padding: 1.75rem 0 4rem; min-height: 70vh; }
.view { animation: rise .28s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 1023px) {
  .menu-btn { display: grid; }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; background: var(--surface); box-shadow: var(--shadow-lg); z-index: 45; top: 0; padding-top: 1.2rem; }
  body.drawer-open .sidebar { transform: none; }
  .main-col { margin-left: 0; }
  .topbar-link { display: none; }
}
@media (max-width: 640px) {
  .topbar { gap: .5rem; padding: 0 .75rem; }
  .brand-text small { display: none; }
  .brand-text { font-size: .86rem; white-space: normal; }
  .search-trigger { flex: 0 0 38px; width: 38px; padding: 0; justify-content: center; margin-left: auto; }
  .search-trigger .search-label, .search-trigger kbd { display: none; }
  .main-col { padding: 0 1rem; }
  main { padding-top: 1.2rem; }
}

/* ---------- command palette ---------- */
.palette { position: fixed; inset: 0; z-index: 60; background: rgba(8, 12, 20, .42); backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 1rem 1rem; }
.palette[hidden] { display: none; }
.palette-box { width: min(640px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .16s ease both; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.985); } to { opacity: 1; transform: none; } }
.palette-input { display: flex; align-items: center; gap: .7rem; padding: 0 1rem; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-input input { flex: 1; height: 56px; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 1.05rem; }
.palette-input input::-webkit-search-cancel-button { display: none; }
.palette-results { max-height: min(60vh, 520px); overflow-y: auto; padding: .4rem; }
.search-hit { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0 .8rem; padding: .6rem .75rem; border-radius: 10px; color: var(--text); text-decoration: none !important; }
.search-hit.sel, .search-hit:hover { background: var(--brand-soft); }
.hit-type { grid-row: span 2; font-size: .7rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding-top: .2rem; }
.hit-title { font-weight: 580; font-size: .95rem; }
.hit-sub { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-all { display: block; margin: .3rem .2rem .2rem; padding: .6rem .75rem; border-radius: 10px; font-size: .88rem; font-weight: 600; }
.search-all:hover { background: var(--surface-2); text-decoration: none; }
.palette-empty { padding: 1.2rem; margin: 0; color: var(--muted); }
.palette-hint { padding: .8rem .8rem 1rem; }
.palette-hint-title { margin: 0 0 .6rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 650; color: var(--muted); }
.palette-quick { display: flex; flex-wrap: wrap; gap: .4rem; }
.palette-quick a { padding: .38rem .75rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); font-size: .86rem; }
.palette-quick a:hover { border-color: var(--brand-line); color: var(--brand); text-decoration: none; }
body.palette-open { overflow: hidden; }

/* ---------- disclaimer banner ---------- */
.disclaimer-banner { max-width: var(--content-max); margin: 1.1rem auto 0; display: flex; gap: .85rem; align-items: center; padding: .75rem .9rem .75rem 1rem; border-radius: var(--r); background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--amber) 28%, transparent); color: var(--text-2); font-size: .9rem; }
.disclaimer-banner svg { color: var(--amber); flex: none; }
.disclaimer-banner p { margin: 0; flex: 1; }
.disclaimer-banner .btn { margin: 0; flex: none; }
@media (max-width: 640px) { .disclaimer-banner { flex-wrap: wrap; } .disclaimer-banner svg { display: none; } }

/* ---------- buttons, chips, badges ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 40px; padding: 0 1.05rem; margin: .15rem .35rem .15rem 0;
  border-radius: 10px; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink);
  font: inherit; font-size: .92rem; font-weight: 600; letter-spacing: -.005em; text-decoration: none !important; cursor: pointer;
  box-shadow: 0 1px 2px rgba(13, 20, 36, .12), inset 0 1px 0 rgba(255, 255, 255, .15);
  transition: background .15s, border-color .15s, box-shadow .15s, transform .06s;
}
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn.danger { background: var(--surface); color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); box-shadow: none; }
.btn.small { min-height: 32px; padding: 0 .75rem; font-size: .83rem; border-radius: 8px; }
.btn.big { min-height: 46px; padding: 0 1.4rem; font-size: 1rem; border-radius: 12px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.done { background: var(--green); border-color: var(--green); }
.btn.flagged { color: var(--amber); border-color: var(--amber); }
.linklike { font: inherit; background: none; border: 0; color: var(--brand); cursor: pointer; text-align: left; padding: 0; }
.linklike:hover { text-decoration: underline; }

.badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 600; padding: .14rem .55rem; border-radius: 999px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.badge.first { background: var(--first-soft); color: var(--first); border-color: transparent; }
.badge.case { background: var(--violet-soft); color: var(--violet); border-color: transparent; }
.badge.fcpe { background: var(--teal-soft); color: var(--teal); border-color: transparent; }
.badge.done { background: var(--green-soft); color: var(--green); border-color: transparent; }
.status { display: inline-flex; align-items: center; gap: .35rem; font-size: .7rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; padding: .12rem .5rem; border-radius: 6px; vertical-align: middle; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.draft { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.status.reviewed { background: var(--green-soft); color: var(--green); }

.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { font: inherit; font-size: .84rem; font-weight: 520; padding: .32rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); cursor: pointer; text-decoration: none !important; transition: all .12s; }
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--surface); }
.chip-list, .topic-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .7rem 0 1.2rem; }
.topic-chip { font-size: .84rem; padding: .3rem .75rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); text-decoration: none !important; transition: all .12s; }
.topic-chip:hover { border-color: var(--brand-line); color: var(--brand); background: var(--brand-soft); }
.topic-chip.done { background: var(--green-soft); border-color: transparent; color: var(--green); }
.topic-chip.done::before { content: "✓ "; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button, .seg a { font: inherit; font-size: .86rem; font-weight: 520; padding: .38rem .85rem; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; text-decoration: none !important; transition: all .12s; }
.seg button:hover, .seg a:hover { color: var(--text); }
.seg [aria-checked="true"], .seg [aria-selected="true"] { background: var(--surface); color: var(--text); font-weight: 620; box-shadow: var(--shadow); }
.seg.small button { font-size: .76rem; padding: .26rem .5rem; }

.meters { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: .4rem; }
.meter { display: inline-flex; align-items: center; gap: .55rem; font-size: .84rem; color: var(--muted); }
.meter-label { font-weight: 560; color: var(--text-2); }
.meter-num { font-family: var(--mono); font-size: .8rem; }
.bar { width: 120px; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--teal)); transition: width .3s; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.25rem 1.35rem; margin: 1rem 0; box-shadow: var(--shadow-sm); }
.card > :last-child { margin-bottom: 0; }
.card h2 { font-size: 1.12rem; }
.grid-2, .grid-3 { display: grid; gap: 1rem; margin: 1rem 0; }
.grid-2 > .card, .grid-3 > .card { margin: 0; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.callout { border-left: 3px solid var(--brand); }
.section-h { margin: 2.6rem 0 1rem; font-size: 1.3rem; }
.empty { color: var(--muted); text-align: center; padding: 3rem 1rem; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; margin: 0 0 .7rem; font-size: .76rem; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--brand); }
.eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: currentColor; }
.meta-line { display: flex; align-items: center; gap: .5rem; font-size: .82rem; color: var(--muted); margin: .2rem 0 0; }
.dot-ok { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

/* ---------- page header + doc layout ---------- */
.page-head { margin: .4rem 0 1.8rem; padding-bottom: 1.4rem; border-bottom: 1px solid var(--line); }
.page-head h1 { max-width: 26ch; }
.page-head .lede { margin-bottom: .6rem; }
.page-foot { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--line); text-align: right; font-size: .84rem; }
.crumbs { font-size: .84rem; color: var(--muted); margin: 0 0 .9rem; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.doc-layout { display: block; }
.doc-rail { display: none; }
@media (min-width: 1320px) {
  .doc-layout.has-rail { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 3rem; }
  .doc-rail { display: block; }
  .doc-rail .toc { position: sticky; top: calc(var(--topbar-h) + 1.5rem); }
}
.toc { font-size: .84rem; }
.toc-title { margin: 0 0 .6rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 650; color: var(--muted); }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line); }
.toc li { margin: 0; }
.toc a { display: block; padding: .28rem .8rem; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); line-height: 1.4; }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.on { color: var(--brand); border-left-color: var(--brand); font-weight: 560; }
.note-aside .toc { margin-bottom: 1rem; padding: 1rem 1rem .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }

/* ---------- prose (Markdown) ---------- */
.prose { max-width: var(--read-max); color: var(--text-2); font-size: 1.02rem; line-height: 1.72; }
.prose h2 { font-size: 1.42rem; margin: 2.6rem 0 .8rem; color: var(--text); scroll-margin-top: calc(var(--topbar-h) + 20px); }
.prose > h2:first-child { margin-top: .5rem; }
.prose h3 { font-size: 1.1rem; margin: 1.9rem 0 .5rem; color: var(--text); }
.prose h4 { font-size: .8rem; margin: 1.5rem 0 .4rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.prose p, .prose li { max-width: var(--read-max); }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin: .35rem 0; padding-left: .15rem; }
.prose li > ul, .prose li > ol { margin: .3rem 0; }
.prose a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--brand) 35%, transparent); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--brand); }
.prose .ext::after, .refs .ext::after, .linklist .ext::after, .res .ext::after { content: "↗"; display: inline-block; margin-left: .15em; font-size: .78em; text-decoration: none; opacity: .75; }
.prose blockquote { margin: 1.2rem 0; padding: .2rem 1rem; border-left: 3px solid var(--line-strong); color: var(--muted); }
.prose .formula, .formula { font-family: var(--mono); font-size: .92rem; background: var(--surface-2); border: 1px solid var(--line); padding: .6rem .85rem; border-radius: 10px; display: inline-block; max-width: 100%; overflow-x: auto; color: var(--text); }
.table-wrap { overflow-x: auto; margin: 1.4rem 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-xs); }
.prose .table-wrap { max-width: 100%; }
.table-wrap table { border-collapse: collapse; width: 100%; font-size: .92rem; line-height: 1.5; }
.table-wrap th, .table-wrap td { padding: .65rem .9rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table-wrap th { background: var(--surface-2); color: var(--text); font-size: .78rem; font-weight: 650; letter-spacing: .02em; }
.table-wrap tbody tr:last-child td { border-bottom: 0; }
.table-wrap tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.table-wrap td:first-child { color: var(--text); font-weight: 500; }
.md-tags { list-style: none; padding: 0 !important; margin: .4rem 0 .6rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.md-tags li { margin: 0 !important; padding: .28rem .7rem !important; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: .86rem; color: var(--text-2); line-height: 1.4; }
.md-cols { display: grid; gap: 1rem; margin: 1.3rem 0; }
@media (min-width: 760px) { .md-cols { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }
.md-card, .md-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.15rem 1.25rem; box-shadow: var(--shadow-sm); }
.md-card h3 { font-size: 1rem; margin: 0 0 .6rem; }
.md-card > :last-child, .md-box > :last-child { margin-bottom: 0; }
.md-card ul { padding-left: 1.1rem; }
.md-box-title { font-weight: 650; color: var(--text); }
.md-steps ol { counter-reset: s; list-style: none; padding: 0; }
.md-steps ol > li { counter-increment: s; position: relative; padding: 0 0 0 3rem; margin: 0 0 1.1rem; min-height: 2rem; }
.md-steps ol > li::before { content: counter(s); position: absolute; left: 0; top: -.05rem; width: 2rem; height: 2rem; border-radius: 10px; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .9rem; display: grid; place-items: center; font-family: var(--mono); }
.callout-box { position: relative; border-radius: var(--r-lg); padding: 1rem 1.15rem 1rem 1.2rem; margin: 1.5rem 0; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-xs); }
.callout-box::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.callout-box > :first-child { margin-top: 0; }
.callout-box > :last-child { margin-bottom: 0; }
.callout-box ul { margin-bottom: 0; }
.callout-title { display: flex; align-items: center; gap: .5rem; font-weight: 650; color: var(--text); margin: 0 0 .45rem; }
.callout-box.tip { background: color-mix(in srgb, var(--green-soft) 55%, var(--surface)); border-color: color-mix(in srgb, var(--green) 18%, var(--line)); }
.callout-box.tip::before { background: var(--green); }
.callout-box.warn { background: color-mix(in srgb, var(--amber-soft) 65%, var(--surface)); border-color: color-mix(in srgb, var(--amber) 20%, var(--line)); }
.callout-box.warn::before { background: var(--amber); }
.callout-box.exam { background: linear-gradient(135deg, color-mix(in srgb, var(--violet-soft) 70%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, var(--violet) 22%, var(--line)); }
.callout-box.exam::before { background: var(--violet); }
.callout-box.exam .callout-title { color: var(--violet); }
.callout-box.key { background: color-mix(in srgb, var(--brand-soft) 65%, var(--surface)); border-color: color-mix(in srgb, var(--brand) 20%, var(--line)); }
.callout-box.station { background: color-mix(in srgb, var(--teal-soft) 60%, var(--surface)); }
.callout-box.station::before { background: var(--teal); }
.small-callout { font-size: .88rem; }

/* ---------- home ---------- */
.home-hero {
  position: relative; overflow: hidden; isolation: isolate;
  margin: .2rem 0 2.4rem; padding: clamp(2rem, 5vw, 3.6rem) clamp(1.3rem, 4vw, 3.2rem) clamp(1.6rem, 3vw, 2.4rem);
  border-radius: var(--r-xl); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow);
}
.home-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 80% at 100% 0%, color-mix(in srgb, var(--teal) 16%, transparent) 0%, transparent 60%),
    radial-gradient(50% 70% at 70% 110%, color-mix(in srgb, var(--violet) 12%, transparent) 0%, transparent 60%),
    radial-gradient(45% 60% at 0% 0%, color-mix(in srgb, var(--brand) 12%, transparent) 0%, transparent 65%);
}
.home-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(70% 90% at 85% 10%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(70% 90% at 85% 10%, #000 0%, transparent 70%);
}
.home-hero .eyebrow { padding: .3rem .75rem .3rem .6rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-xs); color: var(--text-2); font-size: .72rem; }
.home-hero .eyebrow::before { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.home-hero h1 { font-size: clamp(2.2rem, 1.2rem + 3.6vw, 3.9rem); line-height: 1.02; letter-spacing: -.045em; max-width: 15ch; margin: .2rem 0 1.1rem; font-weight: 700; }
.home-hero h1 em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; color: var(--brand); padding-right: .05em; }
.home-hero .lede { font-size: clamp(1.02rem, .95rem + .3vw, 1.18rem); max-width: 58ch; }
.hero-actions { margin: 1.6rem 0 2.2rem; display: flex; flex-wrap: wrap; gap: .55rem; }
.hero-actions .btn { margin: 0; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--r-lg); background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(6px); overflow: hidden; }
.stat { display: flex; flex-direction: column; gap: .15rem; padding: 1rem 1.2rem; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat-n { font-size: 1.85rem; font-weight: 700; letter-spacing: -.04em; line-height: 1.05; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-l { font-size: .8rem; color: var(--muted); }
@media (max-width: 720px) { .stat-row { grid-template-columns: 1fr 1fr; } .stat:nth-child(3) { border-left: 0; } .stat:nth-child(n+3) { border-top: 1px solid var(--line); } }

.home-section-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin: 2.8rem 0 1.1rem; }
.home-section-head h2 { margin: 0; font-size: 1.4rem; letter-spacing: -.025em; }
.home-section-head p { margin: 0; color: var(--muted); font-size: .92rem; }
.stage-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.stage-card { position: relative; display: flex; flex-direction: column; gap: .35rem; padding: 1.25rem 1.3rem 1.4rem; border-radius: var(--r-lg); text-decoration: none !important; color: var(--text); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease, border-color .18s; overflow: hidden; }
.stage-card::after { content: ""; position: absolute; inset: auto -30% -60% auto; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--c) 18%, transparent), transparent); transition: transform .3s ease; }
.stage-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--c) 40%, var(--line)); }
.stage-card:hover::after { transform: scale(1.25); }
.stage-card.s0 { --c: var(--s0); } .stage-card.s1 { --c: var(--s1); } .stage-card.s2 { --c: var(--s2); } .stage-card.s3 { --c: var(--s3); }
.stage-years { display: inline-flex; align-self: flex-start; font-family: var(--mono); font-size: .72rem; font-weight: 500; padding: .12rem .5rem; border-radius: 6px; color: var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); }
.stage-label { font-size: 1.4rem; font-weight: 700; letter-spacing: -.03em; margin-top: .45rem; }
.stage-text { font-size: .9rem; color: var(--muted); line-height: 1.5; }
.stage-go { position: absolute; right: 1.1rem; top: 1.1rem; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--c); border: 1px solid var(--line); background: var(--surface); transition: transform .18s; }
.stage-card:hover .stage-go { transform: translateX(3px); }
.home-exam { margin: 2.6rem 0 0; padding: 1.3rem 1.4rem; }
.tile-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tile { position: relative; display: flex; flex-direction: column; gap: .4rem; padding: 1.3rem 1.3rem 1.2rem; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); text-decoration: none !important; color: var(--text); box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s, border-color .18s; }
.tile:hover { transform: translateY(-2px); border-color: var(--brand-line); box-shadow: var(--shadow-lg); }
.tile-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; margin-bottom: .45rem; background: var(--brand-soft); color: var(--brand); border: 1px solid var(--brand-line); }
.tile:nth-child(2) .tile-icon { background: var(--teal-soft); color: var(--teal); border-color: color-mix(in srgb, var(--teal) 25%, transparent); }
.tile:nth-child(3) .tile-icon { background: var(--violet-soft); color: var(--violet); border-color: color-mix(in srgb, var(--violet) 25%, transparent); }
.tile:nth-child(4) .tile-icon { background: var(--amber-soft); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 25%, transparent); }
.tile-icon svg { width: 22px; height: 22px; }
.tile-title { font-weight: 650; font-size: 1.05rem; letter-spacing: -.015em; }
.tile-text { font-size: .9rem; color: var(--muted); line-height: 1.5; }
.tile-meta { margin-top: auto; padding-top: .6rem; font-family: var(--mono); font-size: .76rem; color: var(--text-2); }
.home-foot { margin-top: 2.4rem; }
.home-cards { margin-top: 2.6rem; }
.timeline { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .6rem; margin: 1.2rem 0 2rem; counter-reset: t; }
.timeline li { margin: 0; }
.timeline a { position: relative; display: flex; flex-direction: column; gap: .1rem; padding: .95rem 1rem 1rem; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); text-decoration: none !important; color: var(--text); height: 100%; box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s; }
.timeline a:hover { border-color: var(--brand-line); box-shadow: var(--shadow); }
.tl-name { font-weight: 680; letter-spacing: -.015em; }
.tl-years { font-family: var(--mono); font-size: .74rem; color: var(--muted); }
.tl-milestone { font-size: .84rem; margin-top: .35rem; color: var(--text-2); line-height: 1.45; }

/* ---------- novice section (original pages) ---------- */
.hero h1 { margin-top: .4rem; }
.step { position: relative; }
.step-n { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-family: var(--mono); font-size: .9rem; margin-bottom: .6rem; }
.tips li { margin: .5rem 0; }
.progress-card h2 { font-size: 1rem; }
.journey { list-style: none; padding: 0; counter-reset: stage; margin: 1.5rem 0; }
.journey > li { position: relative; padding-left: 3rem; margin: 0 0 1rem; }
.journey > li::before { counter-increment: stage; content: counter(stage); position: absolute; left: 0; top: 1.1rem; width: 32px; height: 32px; border-radius: 10px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; font-size: .9rem; font-family: var(--mono); box-shadow: 0 4px 10px -4px rgba(40, 83, 224, .6); }
.journey > li::after { content: ""; position: absolute; left: 15px; top: 3.4rem; bottom: -1rem; width: 2px; background: var(--line); }
.journey > li:last-child::after { display: none; }
.journey .card { margin: 0; }
.filters { display: grid; gap: .8rem; padding: 1rem 1.1rem; }
.search input, .filters input[type="search"] { width: 100%; font: inherit; font-size: .95rem; padding: .6rem .85rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); transition: border-color .15s, background .15s; }
.search input:focus, .filters input[type="search"]:focus { outline: 0; border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-soft); }
.toggles { display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem; font-size: .88rem; color: var(--muted); }
.toggles input { accent-color: var(--brand); }
.print-link { margin-left: auto; font-size: .88rem; font-weight: 550; }
.domain { margin: 2.2rem 0 0; }
.domain > h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-size: 1.25rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); }
.count { font-size: .8rem; font-weight: 500; color: var(--muted); margin-left: .5rem; font-family: var(--mono); letter-spacing: 0; }
.group > h3 { margin: 1.4rem 0 .4rem; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; }
.topic { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin: .55rem 0; padding: .9rem 1.05rem; box-shadow: var(--shadow-xs); scroll-margin-top: calc(var(--topbar-h) + 20px); transition: border-color .2s, box-shadow .2s; }
.topic:hover { border-color: var(--line-strong); }
.topic.is-done { border-color: color-mix(in srgb, var(--green) 35%, var(--line)); background: color-mix(in srgb, var(--green-soft) 30%, var(--surface)); }
.topic.flash { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.topic-head { display: flex; gap: .8rem; align-items: flex-start; }
.topic-head input, .res input, .kf-list input { width: 18px; height: 18px; accent-color: var(--green); flex: none; }
.topic-head input { margin-top: .22rem; }
.topic-title { font-weight: 600; cursor: pointer; }
.topic.is-done .topic-title { color: var(--muted); }
.topic-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .35rem; }
.topic-note { margin: .5rem 0 0 1.95rem; font-size: .93rem; color: var(--text-2); }
.res { list-style: none; margin: .55rem 0 0 1.95rem; padding: 0; }
.res li { display: flex; align-items: baseline; gap: .55rem; margin: .25rem 0; font-size: .92rem; }
.res input { position: relative; top: 3px; width: 15px; height: 15px; }
.res code { font-size: .74rem; color: var(--muted); flex: none; }
.res li.done a { color: var(--muted); }
.topic-foot { margin: .4rem 0 0; text-align: right; }
.suggest { font-size: .8rem; color: var(--muted); }
.suggest:hover { color: var(--brand); }
.scale { list-style: none; padding: 0; margin: .7rem 0 0; display: grid; gap: .35rem; }
.scale li { display: flex; gap: .8rem; align-items: center; padding: .5rem .75rem; margin: 0; border-radius: 9px; background: var(--surface-2); font-size: .92rem; }
.scale b { min-width: 2.4rem; font-family: var(--mono); }
.scale li.target { background: var(--brand-soft); color: var(--text); font-weight: 600; border: 1px solid var(--brand-line); }
.clusters { display: grid; gap: 1rem; }
@media (min-width: 760px) { .clusters { grid-template-columns: 1fr 1fr; } }
.cluster { margin: 0; }
.cluster h3 { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.cluster .caps { font-size: .9rem; color: var(--muted); margin: .2rem 0 .6rem; }
.steps li { margin: .45rem 0; }
.source-note { font-size: .86rem; color: var(--muted); margin-top: 1.6rem; }
.linklist { padding-left: 1.1rem; }
.linklist li { margin: .5rem 0; }
.further .desc { display: block; font-size: .88rem; color: var(--muted); }
#resources-more { margin-top: 2rem; max-width: none; }
.glossary { margin: 1rem 0; display: grid; gap: .1rem; }
.glossary dt { font-weight: 650; margin-top: 1rem; color: var(--text); }
.glossary dd { margin: .2rem 0 0; color: var(--text-2); max-width: 75ch; }
.term { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: help; text-decoration: underline dotted color-mix(in srgb, var(--brand) 60%, transparent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.term:hover, .term:focus-visible { color: var(--brand); }
.term.demo { cursor: default; }
.term-pop { position: absolute; z-index: 50; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--r); padding: .85rem 1rem; box-shadow: var(--shadow-lg); font-size: .92rem; line-height: 1.5; }
.term-pop p { margin: .35rem 0 .5rem; color: var(--text-2); }
.term-pop a { font-size: .84rem; font-weight: 550; }
.checklist-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.checklist-meta { margin: .3rem 0; }
.cl-domain h2 { margin: 1.4rem 0 .5rem; }
.cl { width: 100%; border-collapse: collapse; font-size: .9rem; background: var(--surface); }
.cl th, .cl td { border: 1px solid var(--line); padding: .35rem .55rem; text-align: left; vertical-align: top; }
.cl th { background: var(--surface-2); font-size: .8rem; }
.cl-have { width: 3.5rem; text-align: center !important; font-size: 1.05rem; }
.cl-iac { width: 7rem; font-size: .8rem; color: var(--muted); }
.cl-ela { font-size: .76rem; color: var(--muted); font-family: var(--mono); }
.cl-group td { background: var(--surface-2); font-weight: 650; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.actions { display: flex; flex-wrap: wrap; gap: .3rem; }
.file-btn { position: relative; }

/* ---------- notes ---------- */
.note-group { margin: 2.2rem 0; }
.note-group > h2 { display: flex; align-items: baseline; font-size: 1.15rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); }
.note-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-top: 1rem; }
.note-card { position: relative; display: flex; flex-direction: column; gap: .35rem; padding: 1rem 1.1rem; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none !important; color: var(--text); box-shadow: var(--shadow-xs); transition: transform .15s, border-color .15s, box-shadow .15s; }
.note-card:hover { transform: translateY(-2px); border-color: var(--brand-line); box-shadow: var(--shadow); }
.note-card.is-read { background: color-mix(in srgb, var(--green-soft) 28%, var(--surface)); }
.note-card-title { font-weight: 620; line-height: 1.35; letter-spacing: -.01em; }
.note-card-sum { font-size: .86rem; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.note-card-meta { margin-top: auto; padding-top: .5rem; display: flex; gap: .6rem; align-items: center; font-size: .76rem; color: var(--muted); font-family: var(--mono); }
.read-tick { color: var(--green); font-weight: 600; font-family: var(--font); }
.note-head { border-bottom: 0; padding-bottom: 0; margin-bottom: 1.4rem; }
.note-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-top: .6rem; }
.note-meta .btn { margin: 0; }
.note-layout { display: grid; gap: 2.4rem; align-items: start; }
@media (min-width: 1100px) { .note-layout { grid-template-columns: minmax(0, 1fr) 280px; } .note-aside { position: sticky; top: calc(var(--topbar-h) + 1.2rem); max-height: calc(100vh - var(--topbar-h) - 2rem); overflow-y: auto; scrollbar-width: thin; } }
.note-aside .card { margin: 0 0 1rem; padding: 1rem 1.05rem; }
.note-aside h3 { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .6rem; }
.note-body { padding-top: 1.4rem; border-top: 1px solid var(--line); }
.code-chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.code-chip { font: 500 .72rem/1.5 var(--mono); padding: .12rem .45rem; border-radius: 6px; background: var(--surface-2); color: var(--muted); text-decoration: none !important; border: 1px solid var(--line); }
.code-chip:hover { color: var(--brand); border-color: var(--brand-line); background: var(--brand-soft); }
.note-refs { margin-top: 2.6rem; }
.note-refs h2 { font-size: 1.05rem; }
.refs { padding-left: 1.3rem; font-size: .9rem; }
.refs li { margin: .45rem 0; }
.ref-src { color: var(--muted); }
.ela-list code { font-size: .74rem; color: var(--muted); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 2.4rem 0 0; }
.pager a { display: flex; flex-direction: column; gap: .15rem; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none !important; background: var(--surface); color: var(--text); font-weight: 560; transition: border-color .15s, box-shadow .15s; }
.pager a:hover { border-color: var(--brand-line); box-shadow: var(--shadow); }
.pager .small { font-weight: 500; }
.pager-next { text-align: right; }

.coverage-layout { display: grid; gap: 1.4rem; align-items: start; }
@media (min-width: 1000px) { .coverage-layout { grid-template-columns: minmax(0, 1fr) 300px; } .coverage-detail { position: sticky; top: calc(var(--topbar-h) + 1.2rem); } }
.coverage-detail { margin: 0; }
.cov-group h2 { font-size: .95rem; margin: 1.5rem 0 .6rem; display: flex; align-items: baseline; }
.cov-codes { display: flex; flex-wrap: wrap; gap: 4px; }
.cov-code { font: 500 .7rem/1.3 var(--mono); padding: .24rem .4rem; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; transition: all .1s; }
.cov-code:hover { border-color: var(--line-strong); color: var(--text); }
.cov-code.on { background: var(--green-soft); color: var(--green); border-color: transparent; }
.cov-code.sel { outline: 2px solid var(--brand); outline-offset: 1px; }

/* ---------- question bank ---------- */
.qsetup { display: grid; gap: 1.1rem; padding: 1.4rem 1.5rem; }
.qsetup-row { display: grid; gap: .5rem; }
@media (min-width: 760px) { .qsetup-row { grid-template-columns: 9rem 1fr; align-items: center; } }
.qsetup-label { font-weight: 620; font-size: .88rem; color: var(--text); }
.qsetup-go { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 1.1rem; margin-top: .2rem; }
.resume { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; }
.resume p { margin: 0; }
.q-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.q-title { font-weight: 650; margin: 0; letter-spacing: -.01em; }
.q-top .small { margin: .1rem 0 0; }
.q-tools { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.q-tools .btn { margin: 0; }
.timer { font-family: var(--mono); font-weight: 600; font-size: .9rem; padding: .35rem .75rem; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.timer.late { background: var(--red-soft); color: var(--red); border-color: transparent; }
.progress-line { height: 4px; background: var(--surface-3); border-radius: 99px; margin: 1rem 0 1.3rem; overflow: hidden; }
.progress-line span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--teal)); transition: width .25s; }
.q-layout { display: grid; gap: 1.3rem; align-items: start; }
@media (min-width: 1000px) { .q-layout { grid-template-columns: minmax(0, 1fr) 250px; } .q-side { position: sticky; top: calc(var(--topbar-h) + 1.2rem); } }
.q-main { margin: 0; padding: clamp(1.2rem, 3vw, 2rem); border-radius: var(--r-xl); }
.stem { font-size: 1.08rem; line-height: 1.7; max-width: 70ch; color: var(--text); }
.stem p:last-child { font-weight: 620; }
.options { list-style: none; padding: 0; margin: 1.4rem 0; display: grid; gap: .55rem; }
.opt { display: flex; align-items: stretch; gap: .45rem; margin: 0; }
.opt-btn { flex: 1; display: flex; gap: .9rem; align-items: flex-start; text-align: left; font: inherit; font-size: .98rem; padding: .8rem 1rem; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; box-shadow: var(--shadow-xs); transition: border-color .12s, background .12s, box-shadow .12s; }
.opt-btn:hover:not([disabled]) { border-color: var(--brand-line); box-shadow: var(--shadow); }
.opt-letter { flex: none; width: 1.8rem; height: 1.8rem; border-radius: 8px; display: grid; place-items: center; font-weight: 650; font-size: .82rem; font-family: var(--mono); background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.opt-text { padding-top: .15rem; }
.opt.chosen .opt-btn { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
.opt.chosen .opt-letter { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.opt.correct .opt-btn { border-color: var(--green); background: var(--green-soft); box-shadow: 0 0 0 1px var(--green); }
.opt.correct .opt-letter { background: var(--green); color: #fff; border-color: transparent; }
.opt.wrong .opt-btn { border-color: var(--red); background: var(--red-soft); box-shadow: 0 0 0 1px var(--red); }
.opt.wrong .opt-letter { background: var(--red); color: #fff; border-color: transparent; }
.opt.struck .opt-text { text-decoration: line-through; color: var(--muted); }
.opt-btn[disabled] { cursor: default; }
.strike { flex: none; width: 2.4rem; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; font-size: .85rem; transition: all .12s; }
.strike:hover { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); background: var(--red-soft); }
.explain { border-radius: var(--r-lg); padding: 1.1rem 1.25rem; margin: 1.2rem 0; background: var(--surface-2); border: 1px solid var(--line); }
.explain.right { background: color-mix(in srgb, var(--green-soft) 60%, var(--surface)); border-color: color-mix(in srgb, var(--green) 25%, var(--line)); }
.explain.wrong { background: color-mix(in srgb, var(--red-soft) 60%, var(--surface)); border-color: color-mix(in srgb, var(--red) 22%, var(--line)); }
.verdict { font-weight: 680; margin: 0 0 .5rem; letter-spacing: -.01em; }
.explain.right .verdict { color: var(--green); }
.explain.wrong .verdict { color: var(--red); }
.explain .prose { max-width: none; font-size: .96rem; }
.explain-links { font-size: .9rem; border-top: 1px solid var(--line); margin-top: .9rem; padding-top: .7rem; }
.q-foot { font-size: .78rem; color: var(--muted); display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin: .7rem 0 0; font-family: var(--mono); }
.q-actions { display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin-top: 1.3rem; }
.q-actions .btn { margin: 0; }
.q-side .card { margin: 0; }
.q-side h3 { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.q-nav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 5px; max-height: 50vh; overflow-y: auto; scrollbar-width: thin; }
.qn { font: 600 .74rem/1 var(--mono); height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; min-width: 22px; transition: all .1s; }
.qn:hover { border-color: var(--line-strong); color: var(--text); }
.qn.ans { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.qn.ok { background: var(--green-soft); color: var(--green); border-color: transparent; }
.qn.bad { background: var(--red-soft); color: var(--red); border-color: transparent; }
.qn.flag { box-shadow: inset 0 -3px 0 var(--amber); }
.qn.here { outline: 2px solid var(--brand); outline-offset: 1px; }
.legend { display: flex; align-items: center; gap: .35rem; margin-top: .8rem; }
.legend .qn { width: 18px; height: 14px; min-width: 18px; cursor: default; }
.mocks .mock-card { display: flex; flex-direction: column; }
.mock-card h2 { font-size: 1.1rem; }
.mock-actions { margin-top: auto; padding-top: 1rem; display: flex; flex-wrap: wrap; gap: .35rem; }
.mini-table { width: 100%; border-collapse: collapse; font-size: .88rem; margin-top: .6rem; }
.mini-table td { padding: .45rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.mini-table tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: .6rem !important; font-family: var(--mono); font-size: .86em; }
.result-hero { display: flex; gap: 1.8rem; align-items: center; flex-wrap: wrap; padding: 1.6rem; }
.ring { --p: 0; width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--surface-3) 0); flex: none; }
.ring span { width: 104px; height: 104px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 1.8rem; font-weight: 750; letter-spacing: -.03em; }
.result-score { font-size: 1.35rem; font-weight: 700; margin: 0 0 .2rem; letter-spacing: -.02em; }
.data-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.data-table th, .data-table td { text-align: left; padding: .55rem .4rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table th { font-size: .74rem; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }
.data-table tr:last-child td { border-bottom: 0; }
.result-list { padding-left: 1.4rem; font-size: .92rem; }
.result-list li { margin: .4rem 0; }
.result-list li.ok .linklike { color: var(--green); }
.result-list li.bad .linklike { color: var(--red); }

/* ---------- stations ---------- */
.station-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); margin-top: 1.2rem; }
.station-card { display: flex; flex-direction: column; gap: .45rem; padding: 1.15rem 1.2rem; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); text-decoration: none !important; color: var(--text); box-shadow: var(--shadow-sm); transition: transform .15s, border-color .15s, box-shadow .15s; }
.station-card:hover { transform: translateY(-2px); border-color: var(--brand-line); box-shadow: var(--shadow-lg); }
.station-tags { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin: .2rem 0 .6rem; }
.station-title { font-weight: 650; font-size: 1.04rem; line-height: 1.35; letter-spacing: -.012em; }
.station-sum { font-size: .88rem; color: var(--muted); line-height: 1.5; }
.station-meta { margin-top: auto; padding-top: .4rem; }
.station-timer { position: sticky; top: calc(var(--topbar-h) + .75rem); z-index: 20; padding: .9rem 1.1rem; border-radius: var(--r-lg); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); box-shadow: var(--shadow); }
.timer-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.timer-label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; }
.timer-clock { font-family: var(--mono); font-size: 2.1rem; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.03em; line-height: 1.1; }
.timer-clock.late { color: var(--red); }
.timer-btns { display: flex; gap: .35rem; }
.timer-btns .btn { margin: 0; }
.timer-bar { display: block; height: 4px; background: var(--surface-3); border-radius: 99px; margin-top: .7rem; overflow: hidden; }
.timer-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--teal)); transition: width .25s linear; }
.brief { position: relative; overflow: hidden; }
.brief::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(var(--brand), var(--teal)); }
.reveal summary { cursor: pointer; font-weight: 620; list-style: none; display: flex; align-items: center; gap: .5rem; }
.reveal summary::before { content: "›"; font-size: 1.2rem; color: var(--muted); transition: transform .15s; }
.reveal[open] summary::before { transform: rotate(90deg); }
.examiner-layout { display: grid; gap: 1.3rem; align-items: start; }
@media (min-width: 1150px) { .examiner-layout { grid-template-columns: minmax(0, 1fr) 380px; } .mark-sheet { position: sticky; top: calc(var(--topbar-h) + 7.5rem); max-height: calc(100vh - var(--topbar-h) - 8.5rem); overflow-y: auto; scrollbar-width: thin; } }
.examiner-layout .card { margin-top: 0; }
.mark-sheet h2 { font-size: 1.05rem; }
.mark-sheet h3 { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: 1.3rem; }
.kf-list { list-style: none; padding: 0; margin: 0; }
.kf-list li { margin: .15rem 0; font-size: .9rem; }
.kf-list label { display: flex; gap: .6rem; align-items: flex-start; cursor: pointer; padding: .35rem .45rem; border-radius: 8px; }
.kf-list label:hover { background: var(--surface-2); }
.kf-list input { margin-top: .2rem; width: 16px; height: 16px; }
.kf-level { font-size: .88rem; padding: .55rem .7rem; border-radius: 9px; background: var(--surface-2); margin-top: .5rem; }
.rating { display: grid; gap: .3rem; margin: .6rem 0; }
.rating-name { font-size: .86rem; font-weight: 600; }
.grs { display: grid; gap: .35rem; }
.grs-opt { display: flex; gap: .55rem; align-items: flex-start; padding: .5rem .6rem; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; font-size: .86rem; transition: border-color .12s, background .12s; }
.grs-opt:hover { border-color: var(--line-strong); }
.grs-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.grs-opt span { display: flex; flex-direction: column; }
.grs-opt input { margin-top: .2rem; accent-color: var(--brand); }
.mark-sheet textarea { width: 100%; font: inherit; font-size: .9rem; padding: .6rem .7rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); resize: vertical; }
.mark-sheet textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: var(--surface); }
.mark-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .7rem; }
.summary-out { white-space: pre-wrap; font: .78rem/1.5 var(--mono); background: var(--surface-2); padding: .8rem; border-radius: 10px; max-height: 260px; overflow: auto; border: 1px solid var(--line); }

/* ---------- search results, toast, footer ---------- */
.search-group h2 { font-size: 1.05rem; margin-top: 2rem; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: .65rem 1.1rem; border-radius: 12px; font-size: .9rem; font-weight: 550; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 70; box-shadow: var(--shadow-lg); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.site-footer { max-width: var(--content-max); margin: 0 auto; border-top: 1px solid var(--line); color: var(--muted); font-size: .84rem; padding: 1.6rem 0 2.4rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.footer-inner p { margin: .2rem 0; max-width: 60ch; }
.footer-brand { font-weight: 650; color: var(--text); }
.footer-links { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; align-items: center; }
.footer-links a { color: var(--text-2); }

/* ---------- print ---------- */
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #f0f0f0; --text: #000; --muted: #333; --line: #999; }
  body { font-size: 11pt; background: #fff; }
  .topbar, .sidebar, .scrim, .palette, .site-footer, .no-print, .filters, .actions, .term-pop, .topic-foot, .disclaimer-banner, .note-aside, .doc-rail, .pager, .station-timer, .mark-actions { display: none !important; }
  .main-col { margin: 0; padding: 0; }
  .card, .topic { box-shadow: none; break-inside: avoid; }
  .cl tr { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  .term { text-decoration: none; }
  .view { animation: none; }
}

/* widgets inside prose */
.prose .timeline { padding: 0; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.prose .timeline li { max-width: none; padding: 0; }
.prose .stage-grid, .prose .note-grid, .prose .station-grid, .prose .stat-row { max-width: none; }
.q-nav-grid { padding: 3px; }
.legend .qn { border-radius: 4px; }

/* sidebar: sub-menu subheadings, counts and the novice progress block */
.nav-sub .nav-sub-label { margin: .75rem 0 .15rem; padding: 0 .6rem; font-size: .66rem; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); opacity: .85; }
.nav-sub .nav-sub-label:first-child { margin-top: .2rem; }
.nav-sub a { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.nav-count { font: 500 .68rem/1 var(--mono); color: var(--muted); padding: .18rem .35rem; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); }
.nav-sub a[aria-current="page"] .nav-count { color: var(--brand); border-color: var(--brand-line); background: var(--surface); }
.nav-progress { margin: .4rem 0 .6rem 1.55rem; padding: .75rem .8rem .8rem; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-xs); }
.nav-progress-title { margin: 0 0 .5rem; font-size: .66rem; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.nav-progress-row + .nav-progress-row { margin-top: .6rem; }
.nav-progress-top { display: flex; justify-content: space-between; font-size: .8rem; color: var(--text-2); margin-bottom: .3rem; }
.nav-progress-num { font-family: var(--mono); font-size: .74rem; color: var(--muted); }
.nav-progress .bar { display: block; width: 100%; height: 5px; }

/* novice topic cards: links on to notes and questions */
.topic-deeper { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin: .7rem 0 0 1.95rem; padding-top: .65rem; border-top: 1px dashed var(--line); }
.topic-deeper-label { font-size: .68rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-right: .2rem; }
.deeper-link { font-size: .82rem; padding: .22rem .6rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand); border: 1px solid transparent; text-decoration: none !important; transition: border-color .12s; }
.deeper-link:hover { border-color: var(--brand-line); }
.deeper-link.deeper-q { background: var(--violet-soft); color: var(--violet); }
.deeper-link.deeper-q::before { content: "? "; font-weight: 700; }
.domain { scroll-margin-top: calc(var(--topbar-h) + 16px); }
.view > .pager { margin-top: 3rem; }

/* notes widget on stage pages: one fold per subject */
.note-folds { display: grid; gap: .5rem; margin: 1rem 0 1.4rem; max-width: none; }
.note-fold { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-xs); }
.note-fold summary { display: flex; align-items: center; gap: .8rem; padding: .7rem 1rem; cursor: pointer; list-style: none; font-weight: 600; color: var(--text); }
.note-fold summary::-webkit-details-marker { display: none; }
.note-fold summary::after { content: "›"; margin-left: .2rem; font-size: 1.2rem; line-height: 1; color: var(--muted); transition: transform .15s; }
.note-fold[open] summary::after { transform: rotate(90deg); }
.note-fold summary:hover { background: var(--surface-2); border-radius: var(--r); }
.note-fold-name { flex: 1; }
.note-fold-count { font: 500 .74rem/1 var(--mono); color: var(--muted); }
.note-fold .chip-list { margin: 0; padding: .2rem 1rem 1rem; }
.prose .glance { margin: 1.2rem 0 1.8rem; }
.prose .glance .md-card h3 { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .35rem; }
.prose .glance .md-card p { margin: 0; color: var(--text); font-weight: 560; line-height: 1.45; }
.prose .glance .md-card { padding: .95rem 1.05rem; }
.domain-meters { display: grid; gap: .6rem 1.4rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.domain-meter { display: flex; flex-direction: column; gap: .35rem; color: var(--text-2); text-decoration: none !important; font-size: .86rem; }
.domain-meter:hover { color: var(--brand); }
.domain-meter-top { display: flex; justify-content: space-between; gap: .5rem; }
.domain-meter .bar { width: 100%; }
.prose .md-cols.glance { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
@media (min-width: 900px) { .prose .md-cols.glance { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.prose .glance .md-card p { font-size: .92rem; }

/* ---------- stage colours: menu entries and the pages within each stage ---------- */
.s0 { --c: var(--s0); } .s1 { --c: var(--s1); } .s2 { --c: var(--s2); } .s3 { --c: var(--s3); }
.stage-item > .nav-link svg { color: color-mix(in srgb, var(--c) 75%, var(--muted)); }
.stage-item > .nav-link:hover { background: color-mix(in srgb, var(--c) 7%, transparent); }
.nav-group li.stage-item.active > .nav-link { background: color-mix(in srgb, var(--c) 8%, var(--surface)); border-color: color-mix(in srgb, var(--c) 28%, var(--line)); }
.nav-group li.stage-item.active > .nav-link svg { color: var(--c); }
.nav-group li.stage-item.active > .nav-link::before { content: ""; width: 3px; align-self: stretch; margin: -.1rem 0 -.1rem -.35rem; border-radius: 3px; background: var(--c); }
.stage-item .nav-sub { border-left-color: color-mix(in srgb, var(--c) 30%, var(--line)); }
.stage-item .nav-sub a[aria-current="page"] { color: var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); }
.stage-item .nav-sub a[aria-current="page"]::before { background: var(--c); }
.stage-item .nav-sub a[aria-current="page"] .nav-count { color: var(--c); border-color: color-mix(in srgb, var(--c) 30%, var(--line)); }
.stage-item .nav-progress { border-color: color-mix(in srgb, var(--c) 22%, var(--line)); }
.stage-item .nav-progress .bar > span { background: var(--c); }

body[data-stage="0"] { --stage: var(--s0); } body[data-stage="1"] { --stage: var(--s1); }
body[data-stage="2"] { --stage: var(--s2); } body[data-stage="3"] { --stage: var(--s3); }
body[data-stage] main .eyebrow { color: var(--stage); }
body[data-stage] main .page-head { border-bottom: 0; background: linear-gradient(90deg, var(--stage), color-mix(in srgb, var(--stage) 0%, transparent)) bottom / 100% 2px no-repeat; }
body[data-stage] .toc a.on { color: var(--stage); border-left-color: var(--stage); }
body[data-stage] .prose .glance .md-card { border-top: 3px solid var(--stage); }
body[data-stage] .prose h2::before { content: ""; display: inline-block; width: .5rem; height: .5rem; margin-right: .6rem; border-radius: 2px; vertical-align: .18em; background: var(--stage); }
body[data-stage] .timeline a { position: relative; }
body[data-stage] main .bar > span, body[data-stage] .progress-line span { background: var(--stage); }
body[data-stage] .deeper-link:not(.deeper-q) { background: color-mix(in srgb, var(--stage) 10%, var(--surface)); color: color-mix(in srgb, var(--stage) 85%, var(--text)); }
a.nav-progress-row { display: block; color: inherit; text-decoration: none !important; border-radius: 6px; }
a.nav-progress-row:hover .nav-progress-top span:first-child { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.nav-progress-foot { margin: .55rem 0 0; font-size: .74rem; color: var(--muted); }

/* ---------- stage capabilities, unit guides and SIAs ---------- */
.stage-hub { margin: 0 0 2.4rem; }
.stage-hub .tile { border-top: 3px solid var(--stage, var(--brand)); }
.stage-hub .tile-meta { color: var(--stage, var(--brand)); font-weight: 600; }
.cap-summary { padding: 1.2rem 1.35rem; }
.cap-summary-top { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.cap-summary-top .small { margin: 0; }
.cap-summary-n { margin: 0; font-size: 1.05rem; color: var(--muted); }
.cap-summary-n span { font-size: 2rem; font-weight: 750; letter-spacing: -.04em; color: var(--text); margin-right: .2rem; }
.cap-summary-bar { flex: 1; min-width: 180px; }
.cap-summary-bar .bar { width: 100%; height: 8px; }
.cap-domains { display: grid; gap: 1.2rem; margin-top: 1.2rem; }
.cap-domain { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.3rem 1.4rem 1rem; box-shadow: var(--shadow-sm); scroll-margin-top: calc(var(--topbar-h) + 16px); }
.cap-domain.kind-generic { border-left: 3px solid color-mix(in srgb, var(--violet) 55%, var(--line)); }
.cap-domain.kind-clinical { border-left: 3px solid var(--stage, var(--brand)); }
.cap-head { display: flex; justify-content: space-between; gap: 1.2rem; align-items: flex-start; }
.cap-head h2 { font-size: 1.2rem; margin: 0 0 .35rem; scroll-margin-top: calc(var(--topbar-h) + 16px); }
.cap-outcome { margin: 0; color: var(--text-2); font-size: .95rem; max-width: 68ch; }
.cap-count { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; min-width: 96px; }
.cap-count-n { font: 600 .82rem/1 var(--mono); color: var(--muted); }
.cap-count .bar { width: 96px; }
.cap-meta { display: flex; gap: .4rem; margin: .7rem 0 0; }
.cap-group h4 { margin: 1.2rem 0 .35rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cap-list { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; gap: 2px; }
.cap { display: flex; align-items: flex-start; gap: .7rem; margin: 0; padding: .5rem .6rem; border-radius: 10px; transition: background .12s; }
.cap:hover { background: var(--surface-2); }
.cap input { flex: none; width: 18px; height: 18px; margin-top: .15rem; accent-color: var(--green); cursor: pointer; }
.cap label { flex: 1; display: flex; gap: .65rem; cursor: pointer; font-size: .95rem; line-height: 1.5; color: var(--text); }
.cap-k { flex: none; min-width: 1.9rem; height: 1.45rem; padding: 0 .3rem; border-radius: 6px; display: inline-grid; place-items: center; font: 600 .72rem/1 var(--mono); background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); margin-top: .05rem; }
.cap.is-done .cap-text { color: var(--muted); }
.cap.is-done .cap-k { background: var(--green-soft); color: var(--green); border-color: transparent; }
.cap-level { flex: none; margin-top: .1rem; font: 600 .68rem/1 var(--mono); padding: .3rem .45rem; border-radius: 6px; background: color-mix(in srgb, var(--stage, var(--brand)) 10%, var(--surface)); color: color-mix(in srgb, var(--stage, var(--brand)) 85%, var(--text)); cursor: help; white-space: nowrap; }
.cap-evidence { margin: 1rem 0 0; border-top: 1px solid var(--line); padding-top: .7rem; }
.cap-evidence summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--text-2); }
.cap-evidence ul { margin: .6rem 0 .2rem; font-size: .9rem; color: var(--text-2); }
.cap-study { margin-left: 0; }
.cap-study .small { margin-left: .2rem; }
.deeper-link.deeper-st { background: var(--teal-soft); color: var(--teal); }
.deeper-link.deeper-ela { background: var(--amber-soft); color: var(--amber); }
.cap-foot { margin: .8rem 0 0; font-size: .84rem; text-align: right; }
.cap-inline { margin: 1.2rem 0 1.6rem; padding: .9rem 1rem .6rem; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-xs); }
.cap-inline-title { margin: 0 0 .2rem; font-size: .84rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.cap-inline .cap-list { margin: .3rem 0 0; }
.cap-inline .cap label { font-size: .93rem; }
.prose .cap-inline li { max-width: none; }
.unit-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); margin: 1rem 0 1.5rem; }
.unit-card { display: flex; flex-direction: column; gap: .45rem; padding: 1.15rem 1.2rem 1.1rem; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--stage, var(--brand)); color: var(--text); text-decoration: none !important; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s; }
.unit-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.unit-card-title { font-weight: 650; font-size: 1.04rem; letter-spacing: -.012em; }
.unit-card-lede { font-size: .88rem; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.unit-card-go { margin-top: auto; padding-top: .3rem; font-size: .85rem; font-weight: 600; color: var(--stage, var(--brand)); }
.unit-card-meta { margin-top: auto; display: flex; align-items: center; gap: .6rem; padding-top: .4rem; }
.unit-card-meta .bar { flex: 1; }
.sia-group .section-h { font-size: 1.1rem; }
@media (max-width: 640px) {
  .cap-head { flex-direction: column; }
  .cap-count { align-items: flex-start; }
  .cap-level { display: none; }
  .cap-domain { padding: 1.1rem 1rem .9rem; }
}
@media print {
  .cap-domain, .cap-inline { box-shadow: none; break-inside: auto; }
  .cap input { accent-color: #000; }
}
.stage-hub .tile-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: .8rem; }
@media (min-width: 900px) { .stage-hub .tile-grid { grid-template-columns: 1fr 1fr; } }
.stage-hub .tile { padding: 1rem 1.15rem; gap: .3rem; }
.prose .stage-hub { max-width: none; margin: 0 0 2.2rem; }

/* ---------- syllabus map ---------- */
:root { --rag-g: #1f9d55; --rag-a: #e5a50a; --rag-r: #d64545; --rag-n: var(--surface-3); }
:root[data-theme="dark"] { --rag-g: #4fcf86; --rag-a: #f2c14e; --rag-r: #ff7b7b; }
.rag-bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--rag-n); min-width: 80px; }
.rag-bar > span { display: block; height: 100%; }
.rag-bar .rag-g { background: var(--rag-g); } .rag-bar .rag-a { background: var(--rag-a); } .rag-bar .rag-r { background: var(--rag-r); } .rag-bar .rag-n { background: transparent; }
.rag-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: 0; margin-left: .5rem; }
.rag-dot.rag-g { background: var(--rag-g); } .rag-dot.rag-a { background: var(--rag-a); } .rag-dot.rag-r { background: var(--rag-r); } .rag-dot.rag-n { background: var(--line-strong); }
.map-dash { padding: 1.2rem 1.35rem; }
.map-dash-top { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.map-dash-top .small { margin: 0; }
.map-dash-bar { flex: 1; min-width: 220px; }
.map-dash-bar .rag-bar { height: 12px; }
.rag-legend { margin: .5rem 0 0; }
.map-focus { margin: 1rem 0 0; padding-top: .8rem; border-top: 1px solid var(--line); }
.map-how { margin: .6rem 0 0; }
.map-controls .toggles { gap: .8rem; }
.map-paper { margin: 2rem 0 0; }
.map-paper > h2 { font-size: 1.3rem; margin: 0 0 .9rem; scroll-margin-top: calc(var(--topbar-h) + 16px); }
.map-subject { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.1rem 1.25rem .9rem; margin: 0 0 1rem; box-shadow: var(--shadow-sm); }
.map-subject-head { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.map-subject-head h3 { margin: 0; font-size: 1.1rem; }
.map-subject-n { font: 500 .78rem/1 var(--mono); color: var(--muted); }
.map-subject-head .rag-bar { flex: 1; min-width: 120px; max-width: 260px; margin-left: auto; }
.map-group h4 { margin: 1.1rem 0 .3rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.map-topics { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: 1px; }
.map-topic { display: flex; align-items: center; gap: .8rem; margin: 0; padding: .45rem .5rem; border-radius: 10px; }
.map-topic:hover { background: var(--surface-2); }
.rag-pick { display: inline-flex; gap: 4px; flex: none; }
.rag-btn { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); cursor: pointer; padding: 0; transition: transform .1s, background .12s, border-color .12s; }
.rag-btn:hover { transform: scale(1.12); }
.rag-btn.rag-r:hover, .rag-btn.rag-r[aria-checked="true"] { border-color: var(--rag-r); }
.rag-btn.rag-a:hover, .rag-btn.rag-a[aria-checked="true"] { border-color: var(--rag-a); }
.rag-btn.rag-g:hover, .rag-btn.rag-g[aria-checked="true"] { border-color: var(--rag-g); }
.rag-btn.rag-r[aria-checked="true"] { background: var(--rag-r); }
.rag-btn.rag-a[aria-checked="true"] { background: var(--rag-a); }
.rag-btn.rag-g[aria-checked="true"] { background: var(--rag-g); }
.map-topic-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .8rem; }
.map-topic-title { font-weight: 560; color: var(--text); }
.map-topic-meta { display: inline-flex; gap: .7rem; font-size: .78rem; color: var(--muted); font-family: var(--mono); }
.map-topic-meta a { font-family: var(--font); font-size: .82rem; }
.map-topic[data-rag="g"] .map-topic-title { color: var(--muted); }
.map-reading { margin: 1rem 0 0; border-top: 1px solid var(--line); padding-top: .7rem; }
.map-reading summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--text-2); }
.map-reading-cols { display: grid; gap: 1rem 2rem; margin-top: .6rem; }
@media (min-width: 900px) { .map-reading-cols { grid-template-columns: 1.3fr 1fr; } }
.map-reading-h { margin: 0 0 .3rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; }
.text-meta { color: var(--muted); font-size: .86rem; }
.map-sections { display: grid; gap: .6rem; }
.map-section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .8rem 1rem; }
.map-section-head { display: flex; gap: .7rem; align-items: flex-start; margin-bottom: .5rem; }
.map-section-label { flex: 1; font-size: .93rem; color: var(--text); }
.map-section-codes { flex: none; font: 500 .74rem/1.4 var(--mono); color: var(--muted); }
.topic-chip.rated-g { border-color: color-mix(in srgb, var(--rag-g) 50%, var(--line)); }
.topic-chip.rated-a { border-color: color-mix(in srgb, var(--rag-a) 60%, var(--line)); }
.topic-chip.rated-r { border-color: color-mix(in srgb, var(--rag-r) 55%, var(--line)); }
@media (max-width: 640px) { .map-topic-meta { display: none; } .map-subject-head .rag-bar { max-width: none; } }
.map-reading { margin: .7rem 0 .2rem; padding: .7rem .9rem; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); border-top: 1px solid var(--line); font-size: .86rem; line-height: 1.6; }
.map-reading p { margin: 0; }
.map-reading p + p { margin-top: .35rem; }
.map-reading .map-reading-h { display: inline-block; min-width: 5.5rem; margin: 0 .4rem 0 0; }
.map-reading .sep { color: var(--muted); }
.rag-btn.rag-r { border-color: color-mix(in srgb, var(--rag-r) 45%, var(--line-strong)); }
.rag-btn.rag-a { border-color: color-mix(in srgb, var(--rag-a) 50%, var(--line-strong)); }
.rag-btn.rag-g { border-color: color-mix(in srgb, var(--rag-g) 45%, var(--line-strong)); }
.bjaed-list { padding-left: 1.2rem; font-size: .93rem; }
.bjaed-list li { margin: .45rem 0; }
.note-bjaed { padding: 1rem 1.2rem; border-radius: var(--r-lg); background: color-mix(in srgb, var(--brand-soft) 55%, var(--surface)); border: 1px solid var(--brand-line); }
.note-bjaed h2 { margin-top: 0; }
.note-bjaed .small { margin: 0 0 .4rem; }

/* ---------- four-part syllabus overview (#map) ---------- */
/* Each box has its own colour (--q); level colours (novice/primary/final/stage 3) reuse the stage accents. */
.map-subject { scroll-margin-top: calc(var(--topbar-h) + 16px); }
.ovq-1 { --q: #2f5bea; --q2: #6d8bff; }
.ovq-2 { --q: #0d9467; --q2: #3cc79a; }
.ovq-3 { --q: #e0591b; --q2: #f7a14b; }
.ovq-4 { --q: #a23fcf; --q2: #e05fa8; }
.ovq-0 { --q: #52607a; --q2: #8a96ad; }
:root[data-theme="dark"] .ovq-1 { --q: #7b9cff; } :root[data-theme="dark"] .ovq-2 { --q: #43d3a3; }
:root[data-theme="dark"] .ovq-3 { --q: #ff9a5c; } :root[data-theme="dark"] .ovq-4 { --q: #d38cff; }
.lv-novice { --lv: var(--s0); } .lv-primary { --lv: var(--s1); } .lv-final { --lv: var(--s2); } .lv-stage3 { --lv: var(--s3); }
.seg a[aria-current] { background: var(--surface); color: var(--text); font-weight: 620; box-shadow: var(--shadow); }

/* landing */
.ov-hero { position: relative; padding: 1.2rem 0 1.4rem; }
.ov-hero h1 { font-size: clamp(2rem, 1.3rem + 2.6vw, 3.2rem); line-height: 1.05; letter-spacing: -.04em; max-width: 18ch; margin: .1rem 0 .9rem; }
.ov-hero h1 em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em;
  background: linear-gradient(90deg, #2f5bea, #0d9467 35%, #e0591b 68%, #a23fcf); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ov-stats { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; }
.ov-stat { display: inline-flex; align-items: baseline; gap: .4rem; padding: .35rem .8rem; border-radius: 999px; font-size: .84rem; color: var(--text-2); text-decoration: none !important;
  background: color-mix(in srgb, var(--lv) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--lv) 28%, var(--line)); }
.ov-stat strong { font: 650 .95rem/1 var(--mono); color: var(--lv); }
a.ov-stat:hover { border-color: var(--lv); }
.ov-bar { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; margin: .4rem 0 1.2rem; }

.ovq-grid { position: relative; display: grid; gap: 1.1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) {
  .ovq-grid { grid-template-columns: 1fr 1fr; grid-template-areas: "q1 q2" "q3 q4"; }
  .ovq-1 { grid-area: q1; } .ovq-2 { grid-area: q2; } .ovq-3 { grid-area: q3; } .ovq-4 { grid-area: q4; }
}
.ovq { position: relative; overflow: hidden; isolation: isolate; padding: 1.5rem 1.5rem 1.3rem; border-radius: 24px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--q) 13%, var(--surface)) 0%, var(--surface) 62%);
  border: 1px solid color-mix(in srgb, var(--q) 24%, var(--line)); box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s, border-color .2s; }
.ovq::after { content: ""; position: absolute; z-index: -1; width: 240px; height: 240px; border-radius: 50%; top: -110px; right: -80px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--q2) 30%, transparent), transparent); }
.ovq:hover { box-shadow: 0 18px 40px -22px color-mix(in srgb, var(--q) 55%, transparent); border-color: color-mix(in srgb, var(--q) 45%, var(--line)); }
.ovq-num { position: absolute; z-index: -1; right: 1.1rem; bottom: -1.6rem; font: 800 9rem/1 var(--font); letter-spacing: -.07em; pointer-events: none; user-select: none;
  color: color-mix(in srgb, var(--q) 16%, transparent); }
.ovq-head { display: flex; gap: .9rem; align-items: flex-start; }
.ovq-icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: #fff;
  background: linear-gradient(135deg, var(--q), var(--q2)); box-shadow: 0 8px 18px -8px var(--q); }
.ovq-head h2 { margin: .05rem 0 .2rem; font-size: 1.4rem; letter-spacing: -.025em; color: var(--text); }
.ovq-blurb { margin: 0; color: var(--text-2); font-size: .92rem; max-width: 40ch; }
.ovq-total { margin: .9rem 0 .2rem; font-size: .82rem; color: var(--muted); }
.ovq-total strong { font: 650 1rem/1 var(--mono); color: var(--q); margin-right: .1rem; }
.ovq-group-name { margin: .9rem 0 .35rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--q); }
.ovq-links { list-style: none; padding: 0; margin: .5rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.ovq-links li { margin: 0; }
.ovq-links a, .ovq-empty { display: inline-flex; align-items: center; gap: .5rem; padding: .38rem .45rem .38rem .8rem; border-radius: 999px; font-size: .88rem; font-weight: 540;
  background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid color-mix(in srgb, var(--q) 20%, var(--line)); color: var(--text); text-decoration: none !important;
  transition: background .15s, border-color .15s, color .15s, transform .15s; backdrop-filter: blur(4px); }
.ovq-links a:hover { background: var(--q); border-color: var(--q); color: #fff; transform: translateY(-1px); }
.ovq-n { font: 600 .72rem/1 var(--mono); padding: .22rem .45rem; border-radius: 999px; background: color-mix(in srgb, var(--q) 12%, var(--surface)); color: var(--q); }
.ovq-links a:hover .ovq-n { background: rgba(255,255,255,.22); color: #fff; }
.ovq-empty { color: var(--muted); opacity: .6; padding-right: .8rem; border-style: dashed; }
.ovq-hub { display: none; }
@media (min-width: 1000px) {
  .ovq-hub { display: grid; place-items: center; position: absolute; z-index: 2; left: 50%; top: 50%; width: 104px; height: 104px; transform: translate(-50%, -50%); border-radius: 50%;
    background: conic-gradient(from 180deg, #e0591b, #a23fcf 25%, #2f5bea 50%, #0d9467 75%, #e0591b); padding: 4px; box-shadow: 0 10px 30px -12px rgba(13,20,36,.45); pointer-events: none; }
  .ovq-hub span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: var(--surface);
    font: 400 1.25rem/1 var(--serif); font-style: italic; color: var(--text); }
}
.ov-across { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1.1rem; padding: 1rem 1.4rem; border-radius: 18px; text-decoration: none !important; color: var(--text);
  background: repeating-linear-gradient(135deg, var(--surface-2) 0 10px, var(--surface) 10px 20px); border: 1px dashed var(--line-strong); transition: border-color .15s; }
.ov-across:hover { border-color: var(--brand); }
.ov-arrow { font-size: 1.2rem; color: var(--muted); }
.ov-foot { margin-top: 1.6rem; }

/* section pages */
.ovs-hero { position: relative; margin: .2rem 0 1.2rem; padding: 1.6rem 1.6rem 1.4rem; border-radius: 24px; overflow: hidden; isolation: isolate;
  background: linear-gradient(135deg, color-mix(in srgb, var(--q) 16%, var(--surface)), var(--surface) 70%); border: 1px solid color-mix(in srgb, var(--q) 25%, var(--line)); }
.ovs-hero::after { content: ""; position: absolute; z-index: -1; width: 320px; height: 320px; right: -90px; top: -150px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--q2) 34%, transparent), transparent); }
.ovs-hero .crumbs { margin-bottom: 1rem; }
.ovs-title { display: flex; gap: 1rem; align-items: center; }
.ovs-title .ovq-icon { width: 54px; height: 54px; border-radius: 16px; }
.ovs-title h1 { margin: 0; font-size: clamp(1.8rem, 1.3rem + 1.8vw, 2.6rem); letter-spacing: -.035em; line-height: 1.05; }
.ovs-eyebrow { margin: 0 0 .25rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--q); }
.ovs-siblings { display: flex; gap: .35rem; overflow-x: auto; padding: .1rem 0 .6rem; margin-bottom: .4rem; scrollbar-width: thin; }
.ovs-siblings a { flex: none; font-size: .84rem; padding: .34rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); text-decoration: none !important; white-space: nowrap; }
.ovs-siblings a:hover { border-color: var(--q); color: var(--q); }
.ovs-siblings a[aria-current] { background: var(--q); border-color: var(--q); color: #fff; font-weight: 600; }
.ovs-siblings a.is-empty { opacity: .5; }
.ovs-block { margin: 1.6rem 0 0; }
.ovs-block-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: .3rem .7rem; padding-left: .9rem; border-left: 4px solid var(--lv, var(--q)); margin-bottom: .8rem; }
.ovs-block-head h2 { margin: 0; font-size: 1.2rem; scroll-margin-top: calc(var(--topbar-h) + 20px); }
.ovs-block-head .small { flex-basis: 100%; margin: 0; }
.ovs-block-n { font: 650 .8rem/1 var(--mono); padding: .25rem .5rem; border-radius: 999px; color: var(--lv); background: color-mix(in srgb, var(--lv) 12%, var(--surface)); }
.ovs-sub h3 { margin: 1.1rem 0 .5rem; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.ovs-cards { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.ovs-cards li { margin: 0; display: flex; }
.ovs-card { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: .45rem; padding: .75rem .9rem .7rem 1.05rem; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none !important; overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .15s; }
.ovs-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--lv); }
.ovs-card:hover { border-color: color-mix(in srgb, var(--lv) 50%, var(--line)); box-shadow: 0 10px 24px -16px var(--lv); transform: translateY(-1px); }
.ovs-card-title { font-weight: 580; font-size: .93rem; line-height: 1.35; }
.ovs-card-meta { display: flex; flex-wrap: wrap; gap: .3rem .7rem; font-size: .74rem; color: var(--muted); }
.ovs-kind { color: var(--lv); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; font-size: .68rem; }
.ovs-done { color: var(--green); font-weight: 600; }
.ovs-card.is-done { background: color-mix(in srgb, var(--green) 5%, var(--surface)); }
.ovs-reading { padding: 1.1rem 1.3rem; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); --lv: var(--q); }
.ovs-reading .ovs-sub h3 { text-transform: none; letter-spacing: 0; font-size: .92rem; }
.ovs-empty { padding: 2rem; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 18px; }
@media (max-width: 640px) {
  .ovq { padding: 1.2rem 1.1rem 1.1rem; border-radius: 20px; }
  .ovq-num { font-size: 6.5rem; }
  .ovs-hero { padding: 1.2rem 1.1rem; border-radius: 20px; }
}
@media print { .ovq, .ovs-card { box-shadow: none; } .ovq-hub { display: none; } }

/* four-box syllabus on the home page */
.home-syllabus { margin-top: 0; }
.home-syllabus-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .8rem 1.5rem; margin-bottom: 1rem; }
.home-syllabus-head .section-h { margin-bottom: .3rem; }
.home-syllabus-head .small { margin: 0; }

/* e-LA Revision Guide pointers on notes */
.ela-guide .linklist li { margin: .5rem 0; line-height: 1.45; }
.ela-guide-sessions { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .25rem; }
.ela-guide-sessions .code-link { font: 500 .74rem/1 var(--mono); padding: .22rem .45rem; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); text-decoration: none; }
.ela-guide-sessions .code-link:hover { border-color: var(--brand-line); }

/* BJA Education reviews on syllabus section pages */
.ovs-bjaed-block, .lv-bjaed { --lv: #8a3ffc; }
.ovs-bjaed { list-style: none; padding: 0; margin: 0 0 .7rem; columns: 2 340px; column-gap: 2rem; }
.ovs-bjaed li { break-inside: avoid; margin: 0 0 .5rem; font-size: .9rem; line-height: 1.4; }
