/* ECEdge — styles
   Tokens: one neutral ink for shared foundation, one hue per path group.
   Colours validated for colour-vision deficiency (light and dark). */

@font-face { font-family: 'Barlow'; font-weight: 400; font-display: swap; src: url('../fonts/barlow-400.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 500; font-display: swap; src: url('../fonts/barlow-500.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 600; font-display: swap; src: url('../fonts/barlow-600.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Semi Condensed'; font-weight: 600; font-display: swap; src: url('../fonts/barlow-sc-600.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Semi Condensed'; font-weight: 700; font-display: swap; src: url('../fonts/barlow-sc-700.woff2') format('woff2'); }

:root {
  --paper: #F4F6F8;
  --surface: #FFFFFF;
  --ink: #15212B;
  --ink-2: #4A5966;
  --ink-3: #647280;
  --rule: #D3DAE0;
  --rule-strong: #A9B5BF;
  --c-found: #15212B;
  --c-chip: #3557D6;
  --c-hardware: #B88600;
  --c-beyond: #B1307A;
  --ok: #1F7A4D;
  --focus: #3557D6;
  /* Status colours are reserved for state (never reused for path groups). */
  --err: #B42318; --warn: #B54708; --info: #3557D6;
  --err-bg: #FEF3F2; --warn-bg: #FFFAEB; --ok-bg: #ECFDF3;
  /* Geometry */
  --radius-sm: 4px; --radius-lg: 10px; --control-h: 2.5rem;
  --shadow-1: 0 1px 2px rgba(21, 33, 43, .06), 0 1px 3px rgba(21, 33, 43, .08);
  --shadow-2: 0 8px 28px rgba(21, 33, 43, .16);
  --seq-1: #E6ECFA; --seq-2: #C3D0F2; --seq-3: #94A9E6; --seq-4: #5F7BD8; --seq-5: #3557D6;
  --seq-ink-dark: #15212B; --seq-ink-light: #FFFFFF;

  --font-body: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Barlow Semi Condensed', 'Barlow', system-ui, sans-serif;

  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem; --s-5: 1.5rem; --s-6: 2rem; --s-7: 3rem; --s-8: 4.5rem;
  --t-sm: 0.875rem; --t-base: 1.0625rem; --t-md: 1.3125rem; --t-lg: 1.625rem; --t-xl: 2.0625rem; --t-2xl: 2.625rem; --t-3xl: 3.25rem;
  --radius: 6px;
  --wrap: 72rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #111B23; --surface: #17232D; --ink: #E4EAEF; --ink-2: #A3B0BB; --ink-3: #8A98A4;
    --rule: #283743; --rule-strong: #3C4D5A; --c-found: #E4EAEF;
    --c-chip: #6F87F2; --c-hardware: #B98A14; --c-beyond: #D4609C; --ok: #4CB884; --focus: #8DA2F2; --err: #F97066; --warn: #F79009; --info: #8DA2F2; --err-bg: #2A1416; --warn-bg: #2A1F0E; --ok-bg: #0F2A1E; --shadow-1: 0 1px 2px rgba(0,0,0,.4); --shadow-2: 0 10px 30px rgba(0,0,0,.5);
    --seq-1: #1E2A4A; --seq-2: #2A3D73; --seq-3: #3A55A0; --seq-4: #5A76D0; --seq-5: #8DA2F2;
    --seq-ink-dark: #E4EAEF; --seq-ink-light: #111B23;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --paper: #111B23; --surface: #17232D; --ink: #E4EAEF; --ink-2: #A3B0BB; --ink-3: #8A98A4;
  --rule: #283743; --rule-strong: #3C4D5A; --c-found: #E4EAEF;
  --c-chip: #6F87F2; --c-hardware: #B98A14; --c-beyond: #D4609C; --ok: #4CB884; --focus: #8DA2F2; --err: #F97066; --warn: #F79009; --info: #8DA2F2; --err-bg: #2A1416; --warn-bg: #2A1F0E; --ok-bg: #0F2A1E; --shadow-1: 0 1px 2px rgba(0,0,0,.4); --shadow-2: 0 10px 30px rgba(0,0,0,.5);
  --seq-1: #1E2A4A; --seq-2: #2A3D73; --seq-3: #3A55A0; --seq-4: #5A76D0; --seq-5: #8DA2F2;
  --seq-ink-dark: #E4EAEF; --seq-ink-light: #111B23;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-body); font-size: var(--t-base); line-height: 1.55;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: var(--s-2) var(--s-4); z-index: 10; }
.skip:focus { left: var(--s-4); }

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.15; margin: 0 0 var(--s-3); letter-spacing: -0.005em; }
h1 { font-size: clamp(2.1rem, 4.4vw + 0.6rem, var(--t-3xl)); font-weight: 700; letter-spacing: -0.015em; }
h2 { font-size: clamp(1.6rem, 2vw + 0.8rem, var(--t-xl)); }
h3 { font-size: var(--t-md); }
h4 { font-size: var(--t-base); }
p { margin: 0 0 var(--s-4); max-width: 68ch; }
.lede { font-size: var(--t-md); color: var(--ink-2); line-height: 1.45; max-width: 52ch; }
.muted { color: var(--ink-2); }
.small { font-size: var(--t-sm); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s-5); }
@media (max-width: 40rem) { .wrap { padding: 0 var(--s-4); } }

/* ── Header ─────────────────────────────────────────────── */
.site-head { border-bottom: 1px solid var(--rule); background: var(--paper); position: sticky; top: 0; z-index: 5; }
.site-head .wrap { display: flex; align-items: center; gap: var(--s-5); min-height: 3.75rem; }
.brand { display: flex; align-items: center; gap: var(--s-2); text-decoration: none; font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em; }
.brand svg { width: 28px; height: 28px; }
.nav { display: flex; gap: var(--s-1); margin-left: auto; }
.nav a { text-decoration: none; padding: var(--s-2) var(--s-3); border-radius: var(--radius); color: var(--ink-2); font-weight: 500; }
.nav a:hover { color: var(--ink); background: var(--surface); }
.nav a[aria-current='page'] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); border-radius: 0; }
.head-tools { display: flex; align-items: center; gap: var(--s-2); }
.streak-chip { display: none; align-items: center; gap: 6px; font-size: var(--t-sm); color: var(--ink-2); padding: 4px 10px; border: 1px solid var(--rule); border-radius: 999px; text-decoration: none; white-space: nowrap; }
.streak-chip.on { display: inline-flex; }
.streak-chip svg { width: 14px; height: 14px; }
.icon-btn { background: none; border: 1px solid var(--rule); color: var(--ink-2); width: 2.25rem; height: 2.25rem; border-radius: var(--radius); cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { color: var(--ink); border-color: var(--rule-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }

@media (max-width: 74rem) {
  .menu-btn { display: inline-grid; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--paper); border-bottom: 1px solid var(--rule); flex-direction: column; padding: var(--s-2) var(--s-4) var(--s-4); }
  .nav.open { display: flex; }
  .nav a { padding: var(--s-3) var(--s-2); }
  .nav a[aria-current='page'] { box-shadow: inset 3px 0 0 var(--ink); padding-left: var(--s-4); }
  .head-tools { margin-left: auto; }
}

/* ── Buttons ────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: var(--s-2); font: inherit; font-weight: 600; padding: 0.65rem 1.1rem; border-radius: var(--radius); border: 1px solid var(--ink); background: var(--ink); color: var(--paper); text-decoration: none; cursor: pointer; line-height: 1.2; }
.btn:hover { background: color-mix(in srgb, var(--ink) 86%, var(--paper)); text-decoration: none; }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn.secondary:hover { border-color: var(--ink); background: var(--surface); }
.btn.small { padding: 0.4rem 0.75rem; font-size: var(--t-sm); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-3); margin: var(--s-5) 0; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ── Sections ───────────────────────────────────────────── */
main { display: block; }
.section { padding: var(--s-7) 0; border-top: 1px solid var(--rule); }
.section:first-child { border-top: 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-5); }
.section-head p { margin: 0; color: var(--ink-2); }
.page-head { padding: var(--s-7) 0 var(--s-5); }
.crumbs { font-size: var(--t-sm); color: var(--ink-2); margin-bottom: var(--s-4); }
.crumbs a { color: var(--ink-2); }
.explain { font-size: var(--t-sm); color: var(--ink-2); border-left: 2px solid var(--rule-strong); padding: 2px 0 2px var(--s-3); margin: 0 0 var(--s-5); max-width: 68ch; }

/* ── Hero with route map ────────────────────────────────── */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 26rem); gap: var(--s-7); padding: var(--s-7) 0 var(--s-6); align-items: start; }
.hero-copy { padding-top: var(--s-5); position: sticky; top: 5rem; }
.hero h1 { max-width: 14ch; }
@media (max-width: 60rem) { .hero { grid-template-columns: minmax(0, 1fr); gap: var(--s-5); } .hero-copy { position: static; padding-top: 0; } }

.year-pick { margin-top: var(--s-6); }
.year-pick fieldset { border: 0; padding: 0; margin: 0; }
.year-pick legend { font-weight: 600; margin-bottom: var(--s-2); }
.seg { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: var(--radius); overflow: hidden; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; padding: 0.5rem 0.95rem; border-right: 1px solid var(--rule); cursor: pointer; font-weight: 500; }
.seg label:last-child span { border-right: 0; }
.seg input:checked + span { background: var(--ink); color: var(--paper); }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: -2px; }
.next-step { margin-top: var(--s-4); padding: var(--s-4); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); max-width: 34rem; }
.next-step[hidden] { display: none; }
.next-step h3 { font-size: var(--t-base); margin-bottom: var(--s-2); }
.next-step p { margin-bottom: var(--s-2); color: var(--ink-2); }

.routemap { width: 100%; height: auto; display: block; font-family: var(--font-body); }
.routemap .trunk { stroke: var(--c-found); stroke-width: 6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.routemap .rail { stroke-width: 6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.routemap .rail.chip { stroke: var(--c-chip); } .routemap .rail.hardware { stroke: var(--c-hardware); } .routemap .rail.beyond { stroke: var(--c-beyond); }
.routemap .stop { fill: var(--paper); stroke-width: 3; }
.routemap .stop.found { stroke: var(--c-found); }
.routemap .stop.chip { stroke: var(--c-chip); } .routemap .stop.hardware { stroke: var(--c-hardware); } .routemap .stop.beyond { stroke: var(--c-beyond); }
.routemap .stop.done.chip { fill: var(--c-chip); } .routemap .stop.done.hardware { fill: var(--c-hardware); } .routemap .stop.done.beyond { fill: var(--c-beyond); }
.routemap .name { font-family: var(--font-head); font-weight: 600; font-size: 16px; fill: var(--ink); }
.routemap .meta { font-size: 12.5px; fill: var(--ink-2); }
.routemap .gname { font-family: var(--font-head); font-weight: 700; font-size: 13px; fill: var(--ink-2); letter-spacing: .02em; }
.routemap a:hover .name, .routemap a:focus .name { text-decoration: underline; }
.routemap a:focus { outline: none; }
.routemap a:focus-visible .hit { stroke: var(--focus); stroke-width: 2; }
.routemap .hit { fill: transparent; }
.routemap .pct { font-size: 12.5px; font-weight: 600; fill: var(--ink); }
.map-caption { font-size: var(--t-sm); color: var(--ink-2); margin-top: var(--s-3); }

/* ── Group / path list ──────────────────────────────────── */
.group { margin-bottom: var(--s-7); }
.group:last-child { margin-bottom: 0; }
.group-head { display: grid; grid-template-columns: 6px 1fr; gap: var(--s-4); margin-bottom: var(--s-4); }
.group-head .bar { border-radius: 3px; }
.group-head h3 { margin-bottom: 2px; font-size: var(--t-lg); }
.group-head p { margin: 0; color: var(--ink-2); }
.bar.chip, .sw.chip { background: var(--c-chip); } .bar.hardware, .sw.hardware { background: var(--c-hardware); } .bar.beyond, .sw.beyond { background: var(--c-beyond); } .bar.found, .sw.found { background: var(--c-found); }

.path-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.path-item { border-bottom: 1px solid var(--rule); }
.path-item a { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr) auto; gap: var(--s-5); align-items: baseline; padding: var(--s-4) var(--s-2); text-decoration: none; }
.path-item a:hover { background: var(--surface); }
.path-item h3, .path-item h4 { font-size: var(--t-md); margin: 0; display: flex; align-items: center; gap: var(--s-3); }
.path-item h3 .sw, .path-item h4 .sw { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.path-item p { margin: 0; color: var(--ink-2); }
.path-item .when { font-size: var(--t-sm); color: var(--ink-2); white-space: nowrap; text-align: right; }
.path-item .when b { display: block; color: var(--ink); font-weight: 600; }
@media (max-width: 48rem) {
  .path-item a { grid-template-columns: minmax(0, 1fr); gap: var(--s-1); }
  .path-item .when { text-align: left; white-space: normal; }
  .path-item .when b { display: inline; margin-right: var(--s-2); }
}

/* ── Path page ──────────────────────────────────────────── */
.path-hero { padding: var(--s-7) 0 var(--s-5); border-bottom: 1px solid var(--rule); }
.path-hero .line { height: 6px; border-radius: 3px; width: 5rem; margin-bottom: var(--s-5); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--s-5) var(--s-6); margin-top: var(--s-6); }
.facts h3 { font-size: var(--t-base); margin-bottom: var(--s-2); }
.facts ul { margin: 0; padding-left: 1.1rem; }
.facts p { margin: 0; color: var(--ink-2); }
.overall { display: flex; align-items: center; gap: var(--s-4); margin-top: var(--s-6); flex-wrap: wrap; }
.meter { flex: 1 1 14rem; max-width: 22rem; height: 8px; background: var(--rule); border-radius: 4px; overflow: hidden; }
.meter > i { display: block; height: 100%; width: 0; border-radius: 4px; transition: width .3s ease; }
.meter.chip > i { background: var(--c-chip); } .meter.hardware > i { background: var(--c-hardware); } .meter.beyond > i { background: var(--c-beyond); } .meter.found > i { background: var(--c-found); }
.overall .num { font-weight: 600; font-variant-numeric: tabular-nums; }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-7); }
@media (max-width: 52rem) { .two-col { grid-template-columns: minmax(0, 1fr); gap: var(--s-6); } }

/* Route diagram: stages as stations, ending in job roles */
.route { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)) minmax(0, 1.2fr); position: relative; counter-reset: st; }
.route::before { content: ''; position: absolute; left: 14px; right: 0; top: 13px; height: 6px; border-radius: 3px; background: var(--line); }
.route > li { position: relative; padding: 42px var(--s-3) 0 0; counter-increment: st; }
.route > li a { text-decoration: none; display: block; }
.route > li a:hover strong { text-decoration: underline; }
.route .dot { position: absolute; top: 2px; left: 2px; width: 28px; height: 28px; border-radius: 50%; background: var(--paper); border: 4px solid var(--line); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--ink); }
.route .dot::after { content: counter(st); }
.route > li.done .dot { background: var(--line); color: var(--paper); }
.route > li.done .dot::after { content: '✓'; }
.route strong { display: block; font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; line-height: 1.2; }
.route small { display: block; color: var(--ink-2); font-size: var(--t-sm); margin-top: 2px; font-variant-numeric: tabular-nums; }
.route > li.end .dot { border-radius: 4px; background: var(--ink); border-color: var(--ink); }
.route > li.end .dot::after { content: ''; }
.route li.end ul { margin: 4px 0 0; padding-left: 1rem; font-size: var(--t-sm); color: var(--ink-2); }
@media (max-width: 52rem) {
  .route { grid-template-columns: minmax(0, 1fr); }
  .route::before { left: 13px; right: auto; top: 14px; bottom: 14px; width: 6px; height: auto; }
  .route > li { padding: 2px 0 var(--s-5) 48px; }
}

.stage { padding: var(--s-7) 0; border-top: 1px solid var(--rule); scroll-margin-top: 4.5rem; }
.stage-head { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) auto; gap: var(--s-4); align-items: start; margin-bottom: var(--s-5); }
.stage-num { width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 4px solid var(--line); display: grid; place-items: center; font-weight: 700; font-family: var(--font-head); }
.stage.done .stage-num { background: var(--line); color: var(--paper); }
.stage-head h2 { margin-bottom: 4px; font-size: var(--t-lg); }
.stage-head p { margin: 0; color: var(--ink-2); }
.stage-count { font-size: var(--t-sm); color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; padding-top: 6px; }
.stage-body { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: var(--s-7); padding-left: calc(2.5rem + var(--s-4)); }
@media (max-width: 52rem) { .stage-body { grid-template-columns: minmax(0, 1fr); gap: var(--s-6); padding-left: 0; } .stage-head { grid-template-columns: 2.5rem 1fr; } .stage-count { grid-column: 2; padding-top: 0; } }
.stage-body h3 { font-size: var(--t-base); color: var(--ink-2); font-family: var(--font-body); font-weight: 600; margin-bottom: var(--s-3); }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { border-bottom: 1px solid var(--rule); }
.checklist li:first-child { border-top: 1px solid var(--rule); }
.checklist label { display: flex; gap: var(--s-3); align-items: flex-start; padding: 0.7rem 0; cursor: pointer; }
.checklist input { appearance: none; -webkit-appearance: none; width: 1.25rem; height: 1.25rem; border: 2px solid var(--rule-strong); border-radius: 4px; margin: 2px 0 0; flex: none; display: grid; place-items: center; cursor: pointer; background: var(--surface); }
.checklist input::after { content: ''; width: 0.65rem; height: 0.35rem; border-left: 2px solid var(--paper); border-bottom: 2px solid var(--paper); transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.checklist input:checked { background: var(--line, var(--ink)); border-color: var(--line, var(--ink)); }
.checklist input:checked::after { opacity: 1; }
.checklist input:checked + span { color: var(--ink-2); }
.checklist .when-done { margin-left: auto; font-size: var(--t-sm); color: var(--ink-3); white-space: nowrap; }

.resources { list-style: none; margin: 0; padding: 0; }
.resources li { padding: var(--s-3) 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 5.25rem minmax(0, 1fr); gap: var(--s-3); }
.resources li:first-child { border-top: 1px solid var(--rule); }
.rtype { font-size: 0.75rem; font-weight: 600; color: var(--ink-2); border: 1px solid var(--rule-strong); border-radius: 4px; padding: 1px 6px; height: fit-content; text-align: center; margin-top: 3px; }
.resources a { font-weight: 600; }
.resources .by { color: var(--ink-2); font-size: var(--t-sm); }
.resources .note { display: block; font-size: var(--t-sm); color: var(--ink-2); margin-top: 2px; }
.project { margin-top: var(--s-5); padding: var(--s-4); background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--line); border-radius: var(--radius); }
.project h4 { margin-bottom: 4px; font-family: var(--font-body); font-weight: 600; }
.project p { margin: 0; color: var(--ink-2); }

/* ── Charts ─────────────────────────────────────────────── */
.chart-title { font-size: var(--t-base); font-family: var(--font-body); font-weight: 600; margin-bottom: 2px; }
.chart-sub { font-size: var(--t-sm); color: var(--ink-2); margin-bottom: var(--s-4); }
.hbars { display: grid; grid-template-columns: max-content minmax(0, 1fr) 2.5rem; gap: 10px var(--s-3); align-items: center; }
.hbars .lbl { font-size: var(--t-sm); color: var(--ink); }
.hbars .track { position: relative; height: 14px; background-image: linear-gradient(to right, var(--rule) 1px, transparent 1px); background-size: 20% 100%; border-left: 1px solid var(--rule-strong); }
.hbars .fill { height: 100%; border-radius: 0 4px 4px 0; display: block; }
.hbars .val { font-size: var(--t-sm); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.tip { position: relative; }
.tip:hover::after, .tip:focus-visible::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); background: var(--ink); color: var(--paper); font-size: 0.8125rem; line-height: 1.35; padding: 6px 9px; border-radius: 4px; white-space: nowrap; z-index: 3; pointer-events: none; }

.heat { border-collapse: separate; border-spacing: 2px; width: 100%; font-size: var(--t-sm); }
.heat th { font-weight: 600; text-align: left; padding: 6px 8px; vertical-align: bottom; }
.heat thead th { font-size: 0.8125rem; color: var(--ink-2); text-align: center; }
.heat tbody th a { text-decoration: none; display: flex; align-items: center; gap: 8px; }
.heat tbody th a:hover { text-decoration: underline; }
.heat tbody th .sw { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.heat td { text-align: center; padding: 8px 4px; border-radius: 4px; font-variant-numeric: tabular-nums; font-weight: 600; min-width: 3.25rem; }
.heat td.v1 { background: var(--seq-1); color: var(--seq-ink-dark); } .heat td.v2 { background: var(--seq-2); color: var(--seq-ink-dark); }
.heat td.v3 { background: var(--seq-3); color: var(--seq-ink-dark); } .heat td.v4 { background: var(--seq-4); color: var(--seq-ink-light); } .heat td.v5 { background: var(--seq-5); color: var(--seq-ink-light); }
.heat-wrap { overflow-x: auto; }
.legend-seq { display: flex; align-items: center; gap: 6px; font-size: var(--t-sm); color: var(--ink-2); margin-top: var(--s-3); }
.legend-seq i { width: 22px; height: 12px; border-radius: 2px; display: inline-block; }

.ranges { display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); gap: 10px var(--s-4); align-items: center; }
.ranges .lbl { font-size: var(--t-sm); display: flex; align-items: center; gap: 8px; }
.ranges .lbl .sw { width: 8px; height: 8px; border-radius: 50%; }
.ranges .track { position: relative; height: 18px; background-image: linear-gradient(to right, var(--rule) 1px, transparent 1px); background-size: calc(100% / 6) 100%; border-left: 1px solid var(--rule-strong); }
.ranges .span { position: absolute; top: 5px; height: 8px; border-radius: 4px; }
.ranges .span.chip { background: var(--c-chip); } .ranges .span.hardware { background: var(--c-hardware); } .ranges .span.beyond { background: var(--c-beyond); }
.ranges .axis { grid-column: 2; display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ── Foundation timeline ────────────────────────────────── */
.years { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6); }
@media (max-width: 48rem) { .years { grid-template-columns: minmax(0, 1fr); } }
.year h3 { display: flex; align-items: center; gap: var(--s-3); }
.year h3::before { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--c-found); }
.subjects { list-style: none; margin: 0; padding: 0 0 0 6px; border-left: 4px solid var(--c-found); }
.subjects li { padding: var(--s-3) 0 var(--s-3) var(--s-4); position: relative; }
.subjects li::before { content: ''; position: absolute; left: -4px; top: 1.15rem; width: 12px; height: 2px; background: var(--c-found); }
.subjects strong { display: block; font-weight: 600; }
.feeds { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 4px; }
.feeds a { font-size: 0.8125rem; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); border: 1px solid var(--rule); border-radius: 999px; padding: 1px 8px 1px 6px; }
.feeds a:hover { color: var(--ink); border-color: var(--rule-strong); }
.feeds .sw { width: 7px; height: 7px; border-radius: 50%; }

/* ── Daily ──────────────────────────────────────────────── */
.daily-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: var(--s-7); }
@media (max-width: 52rem) { .daily-grid { grid-template-columns: minmax(0, 1fr); } }
.concept .subject, .iq .subject { font-size: var(--t-sm); color: var(--ink-2); margin-bottom: var(--s-2); }
.concept .formula { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 0.95rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--s-3) var(--s-4); display: inline-block; margin-bottom: var(--s-4); }
.concept .diagram { color: var(--ink); max-width: 22rem; margin: var(--s-2) 0 var(--s-4); }
.concept .diagram svg { width: 100%; height: auto; }
.qz { counter-reset: q; }
.qz fieldset { border: 0; padding: 0; margin: 0 0 var(--s-5); counter-increment: q; }
.qz legend { font-weight: 600; margin-bottom: var(--s-2); }
.qz legend::before { content: counter(q) '. '; color: var(--ink-2); }
.qz label { display: flex; gap: var(--s-3); align-items: flex-start; padding: 0.45rem 0.6rem; border: 1px solid var(--rule); border-radius: var(--radius); margin-bottom: 6px; cursor: pointer; background: var(--surface); }
.qz label:hover { border-color: var(--rule-strong); }
.qz input { margin-top: 5px; accent-color: var(--ink); }
.qz label.right { border-color: var(--ok); box-shadow: inset 3px 0 0 var(--ok); }
.qz label.wrong { border-color: var(--err); box-shadow: inset 3px 0 0 var(--err); }
.qz .why { font-size: var(--t-sm); color: var(--ink-2); margin: 4px 0 0; }
.score { font-family: var(--font-head); font-size: var(--t-xl); font-weight: 700; }
.iq details { border-top: 1px solid var(--rule); padding: var(--s-3) 0; }
.iq summary { cursor: pointer; font-weight: 600; }

/* ── Tools ──────────────────────────────────────────────── */
.tool-index { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-5); }
.tool-index a { font-size: var(--t-sm); text-decoration: none; border: 1px solid var(--rule); padding: 4px 10px; border-radius: 999px; color: var(--ink-2); }
.tool-index a:hover { color: var(--ink); border-color: var(--rule-strong); }
.tool { padding: var(--s-6) 0; border-top: 1px solid var(--rule); scroll-margin-top: 4.5rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-6); }
@media (max-width: 52rem) { .tool { grid-template-columns: minmax(0, 1fr); gap: var(--s-4); } }
.tool h2 { font-size: var(--t-lg); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: var(--s-3); }
.field { display: flex; flex-direction: column; gap: 4px; font-size: var(--t-sm); font-weight: 500; }
.field input, .field select { font: inherit; font-size: var(--t-base); padding: 0.5rem 0.6rem; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); width: 100%; }
.result { margin-top: var(--s-4); padding: var(--s-4); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); font-variant-numeric: tabular-nums; }
.result strong { font-family: var(--font-head); font-size: var(--t-lg); display: block; }
.resistor-svg { width: 100%; max-width: 20rem; height: auto; display: block; margin-top: var(--s-3); }

/* ── Progress ───────────────────────────────────────────── */
.stat-row { display: flex; flex-wrap: wrap; gap: var(--s-6); margin: var(--s-5) 0; }
.stat b { display: block; font-family: var(--font-head); font-size: var(--t-2xl); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--ink-2); font-size: var(--t-sm); }
.prog-table { width: 100%; border-collapse: collapse; }
.prog-table th, .prog-table td { text-align: left; padding: var(--s-3) var(--s-2); border-bottom: 1px solid var(--rule); vertical-align: middle; }
.prog-table th { font-size: var(--t-sm); color: var(--ink-2); font-weight: 600; }
.prog-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.prog-table .meter { max-width: 12rem; }
.cal { display: grid; grid-template-columns: repeat(auto-fill, 14px); gap: 3px; max-width: 40rem; }
.cal i { width: 14px; height: 14px; border-radius: 3px; background: var(--rule); }
.cal i.on { background: var(--ok); }
.panel { padding: var(--s-5); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.panel + .panel { margin-top: var(--s-4); }
.panel h3 { font-size: var(--t-md); }
.notice { padding: var(--s-3) var(--s-4); border-radius: var(--radius); border: 1px solid var(--rule-strong); background: var(--surface); margin: var(--s-4) 0; font-size: var(--t-sm); }
.notice[hidden] { display: none; }
.notice.ok { border-color: var(--ok); }
.notice.warn { border-color: var(--warn); background: var(--warn-bg); }
.notice.error { border-color: var(--err); background: var(--err-bg); }
.notice.ok { background: var(--ok-bg); }
.share-preview { width: 100%; max-width: 36rem; height: auto; border: 1px solid var(--rule); border-radius: var(--radius); display: block; margin: var(--s-4) 0; }

/* ── Finder ─────────────────────────────────────────────── */
.finder { max-width: 44rem; }
.finder .step-count { font-size: var(--t-sm); color: var(--ink-2); margin-bottom: var(--s-2); font-variant-numeric: tabular-nums; }
.finder .q { font-size: var(--t-lg); font-family: var(--font-head); font-weight: 600; margin-bottom: var(--s-4); }
.finder .opts { display: grid; gap: var(--s-2); }
.finder .opt { text-align: left; font: inherit; padding: var(--s-3) var(--s-4); border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink); border-radius: var(--radius); cursor: pointer; }
.finder .opt:hover { border-color: var(--ink); }
.finder .progressbar { height: 4px; background: var(--rule); border-radius: 2px; margin-bottom: var(--s-5); overflow: hidden; }
.finder .progressbar i { display: block; height: 100%; background: var(--ink); transition: width .25s ease; }
.match { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: var(--s-4); padding: var(--s-4) 0; border-bottom: 1px solid var(--rule); }
.match .rank { font-family: var(--font-head); font-weight: 700; font-size: var(--t-xl); color: var(--ink-2); line-height: 1; }
.match h3 { margin-bottom: 4px; }
.match p { margin: 0 0 var(--s-2); color: var(--ink-2); }

/* ── Ads ────────────────────────────────────────────────── */
.ad { margin: var(--s-6) auto; max-width: 100%; text-align: center; }
.ad .ad-label { display: block; font-size: 0.6875rem; color: var(--ink-3); margin-bottom: 4px; letter-spacing: .02em; }
.ad .ad-box { margin: 0 auto; display: grid; place-items: center; color: var(--ink-3); font-size: var(--t-sm); }
.ad.placeholder .ad-box { border: 1px dashed var(--rule-strong); border-radius: var(--radius); }
.ad.banner .ad-box { width: 100%; max-width: 728px; min-height: 90px; }
.ad.inline .ad-box { width: 100%; max-width: 336px; min-height: 280px; }
@media (max-width: 40rem) { .ad.banner .ad-box { min-height: 100px; max-width: 320px; } }
.ad.wide .ad-box { width: 100%; min-height: 120px; }

/* ── Footer ─────────────────────────────────────────────── */
.site-foot { border-top: 1px solid var(--rule); margin-top: var(--s-8); padding: var(--s-6) 0 var(--s-7); color: var(--ink-2); font-size: var(--t-sm); }
.site-foot .wrap { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)); gap: var(--s-6); }
@media (max-width: 48rem) { .site-foot .wrap { grid-template-columns: minmax(0, 1fr); gap: var(--s-4); } }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-foot h4 { color: var(--ink); font-family: var(--font-body); font-weight: 600; font-size: var(--t-sm); }

/* ── Install / update toast ─────────────────────────────── */
.toast { position: fixed; left: 50%; bottom: var(--s-4); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: var(--s-3) var(--s-4); border-radius: var(--radius); font-size: var(--t-sm); display: flex; gap: var(--s-4); align-items: center; z-index: 20; max-width: calc(100% - 2rem); }
.toast[hidden] { display: none; }
.toast button { background: none; border: 1px solid color-mix(in srgb, var(--paper) 50%, transparent); color: var(--paper); border-radius: 4px; padding: 4px 10px; font: inherit; cursor: pointer; }

.prose h2 { margin-top: var(--s-6); font-size: var(--t-lg); }
.prose ul { padding-left: 1.2rem; max-width: 68ch; }
.prose li { margin-bottom: 6px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
@media print { .site-head, .site-foot, .ad, .toast { display: none !important; } body { background: #fff; } }

/* ── Announcements ──────────────────────────────────────── */
.announce-bar { background: var(--surface); border-bottom: 1px solid var(--rule); font-size: var(--t-sm); }
.announce-bar[hidden] { display: none; }
.announce-bar .wrap { display: flex; align-items: center; gap: var(--s-3); min-height: 2.5rem; }
.announce-bar p { margin: 0; max-width: none; flex: 1; padding: 6px 0; }
.announce-close { background: none; border: 0; color: var(--ink-2); font-size: 1.25rem; line-height: 1; width: 2rem; height: 2rem; cursor: pointer; border-radius: var(--radius); }
.announce-close:hover { color: var(--ink); background: var(--paper); }
.updates { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.updates li { padding: var(--s-4) 0; border-bottom: 1px solid var(--rule); }
.updates li[hidden] { display: none; }
.updates h3 { margin: 6px 0 4px; font-size: var(--t-md); }
.updates p { margin: 0 0 6px; color: var(--ink-2); }
.update-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); font-size: var(--t-sm); color: var(--ink-2); }
.update-meta .rtype { margin-top: 0; }
.update-meta .deadline { color: var(--ink); font-weight: 600; }
.past-updates { margin-top: var(--s-6); }
.past-updates summary { cursor: pointer; font-weight: 600; margin-bottom: var(--s-3); }
.updates-home { padding-bottom: var(--s-5); }

/* ── Year focus and folded stages ───────────────────────── */
.year-focus { margin-top: var(--s-5); max-width: 44rem; }
.later-note { display: none; color: var(--ink-2); padding-left: calc(2.5rem + var(--s-4)); margin: 0; }
.stage.later { padding: var(--s-5) 0; }
.stage.later .stage-body { display: none; }
.stage.later .later-note { display: block; }
.stage.later .stage-head { margin-bottom: var(--s-2); opacity: .7; }
@media (max-width: 52rem) { .later-note { padding-left: 0; } }

/* ── Badges ─────────────────────────────────────────────── */
.badge-list { list-style: none; margin: var(--s-3) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: var(--s-3); }
.badge { display: flex; gap: var(--s-3); align-items: center; padding: var(--s-3); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.badge strong { display: block; font-family: var(--font-head); font-weight: 600; }
.badge-mark { width: 2.25rem; height: 2.25rem; flex: none; border-radius: 50%; display: grid; place-items: center; color: var(--paper); font-weight: 700; background: var(--c-found); }
.badge.chip .badge-mark { background: var(--c-chip); } .badge.hardware .badge-mark { background: var(--c-hardware); } .badge.beyond .badge-mark { background: var(--c-beyond); }

/* ── Chips (quiz subject, input toggles) ────────────────── */
.subject-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: var(--s-4); }
.pill, .toggle { font: inherit; font-size: var(--t-sm); padding: 4px 11px; border: 1px solid var(--rule-strong); border-radius: 999px; background: var(--surface); color: var(--ink); cursor: pointer; }
.pill:hover, .toggle:hover { border-color: var(--ink); }
.pill[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ── Finder mini route ──────────────────────────────────── */
.mini-route { list-style: none; margin: var(--s-3) 0; padding: 0 0 0 4px; border-left: 4px solid var(--c-found); counter-reset: mr; }
.mini-route.chip { border-color: var(--c-chip); } .mini-route.hardware { border-color: var(--c-hardware); } .mini-route.beyond { border-color: var(--c-beyond); }
.mini-route li { padding: 3px 0 3px var(--s-3); font-size: var(--t-sm); counter-increment: mr; }
.mini-route li::before { content: counter(mr) ". "; color: var(--ink-2); }

/* ── Logic tools ────────────────────────────────────────── */
.mono, .field input.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.result strong.mono { font-size: 1.15rem; word-break: break-word; margin-bottom: var(--s-2); }
.kv { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: var(--s-3); font-size: var(--t-sm); padding: 3px 0; }
.kv .k, .groups .k { color: var(--ink-2); }
.kv .v { word-break: break-word; }
.error-text { color: var(--err); margin: 0; font-weight: 500; }
.tt-wrap { max-height: 22rem; overflow: auto; margin-top: var(--s-3); border: 1px solid var(--rule); border-radius: var(--radius); }
.tt { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: var(--t-sm); text-align: center; }
.tt th { position: sticky; top: 0; background: var(--surface); border-bottom: 1px solid var(--rule-strong); padding: 5px 8px; }
.tt td { padding: 3px 8px; border-bottom: 1px solid var(--rule); }
.tt .idx { color: var(--ink-3); }
.tt .out { font-weight: 700; border-left: 1px solid var(--rule-strong); }
.tt tr.one td { background: color-mix(in srgb, var(--c-chip) 12%, transparent); }
.kmap-wrap { margin-top: var(--s-4); overflow-x: auto; }
.kmap { border-collapse: separate; border-spacing: 4px; font-variant-numeric: tabular-nums; }
.kmap th { font-size: var(--t-sm); color: var(--ink-2); font-weight: 600; padding: 2px 6px; }
.kmap th.corner { position: relative; width: 3.25rem; height: 2.5rem; background: linear-gradient(to top right, transparent calc(50% - 1px), var(--rule-strong) 50%, transparent calc(50% + 1px)); }
.kmap .corner .cv { position: absolute; right: 4px; top: 0; }
.kmap .corner .rv { position: absolute; left: 4px; bottom: 0; }
.kmap .cell { position: relative; width: 3.25rem; height: 3.25rem; font: inherit; font-size: 1.2rem; font-weight: 700; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink-3); cursor: pointer; }
.kmap .cell.v1 { color: var(--ink); background: color-mix(in srgb, var(--c-chip) 14%, var(--surface)); border-color: var(--c-chip); }
.kmap .cell.v2 { color: var(--c-hardware); }
.kmap .cell.hl { outline: 3px solid var(--c-beyond); outline-offset: -3px; }
.kmap .cell .m { position: absolute; left: 4px; top: 2px; font-size: 0.625rem; font-weight: 500; color: var(--ink-3); }
.groups { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: var(--s-2); font-size: var(--t-sm); }
.group-chip { font-size: 0.9rem; padding: 3px 10px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--paper); color: var(--ink); cursor: pointer; }
.group-chip:hover, .group-chip:focus-visible { border-color: var(--c-beyond); }
.toggles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s-3); }
.toggle { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; border-radius: var(--radius); }
.toggle[aria-pressed="true"] { background: var(--c-chip); border-color: var(--c-chip); color: #fff; }
.gate-canvas { grid-column: 1 / -1; overflow-x: auto; }
.circuit { display: block; max-width: 100%; height: auto; margin: var(--s-4) auto 0; font-family: var(--font-body); }
.circuit .wire { fill: none; stroke-linejoin: round; }
.circuit .wire.off { stroke: var(--rule-strong); stroke-width: 2; }
.circuit .wire.on { stroke: var(--c-chip); stroke-width: 3.5; }
.circuit .gate path, .circuit .gate circle { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.circuit .gate .xor-back { fill: none; }
.circuit .glabel { font-size: 10px; font-weight: 600; fill: var(--ink-2); }
.circuit .gval { font-size: 11px; font-weight: 700; fill: var(--ink); }
.circuit .pin { font-size: 15px; font-weight: 600; fill: var(--ink); }
.circuit .node.on, .circuit .led.on { fill: var(--c-chip); }
.circuit .node.off, .circuit .led.off { fill: var(--rule-strong); }
.circuit .led { stroke: var(--ink); stroke-width: 2; }

/* ── SGPA ───────────────────────────────────────────────── */
.sg-rows { display: grid; gap: 6px; margin-top: var(--s-3); }
.sg-row { display: grid; grid-template-columns: minmax(0, 1fr) 5.5rem 5.5rem 2.25rem; gap: 6px; }
.sg-row input, .sg-row select { font: inherit; padding: 0.45rem 0.55rem; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); min-width: 0; }
.grade-scale { margin-bottom: var(--s-2); font-size: var(--t-sm); }
.grade-scale summary { cursor: pointer; color: var(--ink-2); }
.grade-scale .form-grid { grid-template-columns: repeat(auto-fill, minmax(6rem, 1fr)); margin-top: var(--s-2); }

/* ── Daily motivation card ──────────────────────────────── */
.quote-card { position: fixed; right: var(--s-4); bottom: var(--s-4); max-width: 24rem; background: var(--surface); border: 1px solid var(--rule-strong); border-left: 4px solid var(--c-chip); border-radius: var(--radius); padding: var(--s-4) var(--s-6) var(--s-4) var(--s-4); z-index: 21; box-shadow: 0 6px 24px color-mix(in srgb, var(--ink) 14%, transparent); transition: opacity .5s ease; }
.quote-card.fade { opacity: 0; }
.quote-card p { margin: 4px 0 0; font-size: var(--t-md); line-height: 1.4; font-family: var(--font-head); font-weight: 600; }
.quote-label { font-size: var(--t-sm); color: var(--ink-2); }
.quote-card .announce-close { position: absolute; top: 6px; right: 6px; }
@media (max-width: 40rem) { .quote-card { left: var(--s-3); right: var(--s-3); bottom: var(--s-3); max-width: none; } }

/* ── Settings ───────────────────────────────────────────── */
.switch { display: inline-flex; align-items: center; gap: var(--s-3); font-weight: 600; cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; width: 2.75rem; height: 1.5rem; border-radius: 999px; background: var(--rule-strong); position: relative; cursor: pointer; margin: 0; transition: background .2s ease; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 1.125rem; height: 1.125rem; border-radius: 50%; background: var(--surface); transition: transform .2s ease; }
.switch input:checked { background: var(--c-chip); }
.switch input:checked::after { transform: translateX(1.25rem); }
.how-works { margin-top: var(--s-4); max-width: 44rem; }
.how-works summary { cursor: pointer; font-weight: 600; }
.how-works li { color: var(--ink-2); margin-bottom: 6px; }

/* ── Formula sheets ─────────────────────────────────────── */
.sheet-list, .game-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: var(--s-4); }
.sheet-list a, .game-list a { display: block; height: 100%; padding: var(--s-4) var(--s-5); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); text-decoration: none; }
.sheet-list a:hover, .game-list a:hover { border-color: var(--ink); }
.sheet-list h3, .game-list h2 { margin-bottom: 4px; font-size: var(--t-md); }
.sheet-list p, .game-list p { color: var(--ink-2); margin-bottom: var(--s-2); }
.sheet-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }
.sheet-body { columns: 2 26rem; column-gap: var(--s-7); }
.sheet-sec { break-inside: avoid-column; margin-bottom: var(--s-6); }
.sheet-sec h2 { font-size: var(--t-md); border-bottom: 2px solid var(--ink); padding-bottom: 4px; margin-bottom: var(--s-2); }
.sheet-sec dl { margin: 0; }
.fx { padding: 6px 0; border-bottom: 1px solid var(--rule); break-inside: avoid; }
.fx dt { font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); }
.fx dd { margin: 2px 0 0; }
.fx dd.mono { font-size: 0.95rem; line-height: 1.45; }
.fx-note { font-size: var(--t-sm); color: var(--ink-2); }
.print-only { display: none; }

@media print {
  @page { margin: 12mm; }
  .no-print, .announce-bar, .quote-card { display: none !important; }
  .print-only { display: block; }
  body { font-size: 10.5pt; color: #000; }
  .wrap { max-width: none; padding: 0; }
  .page-head { padding: 0 0 6pt; }
  .sheet-head h1 { font-size: 18pt; }
  .sheet-head .lede { font-size: 10pt; }
  .sheet-body { columns: 2; column-gap: 10mm; }
  .sheet-sec { margin-bottom: 8pt; }
  .sheet-sec h2 { font-size: 11.5pt; border-bottom-color: #000; }
  .fx { padding: 2pt 0; border-bottom-color: #ccc; }
  .fx dt { color: #333; font-size: 8.5pt; }
  .fx dd.mono { font-size: 9pt; }
  .fx-note { font-size: 8pt; }
  a { text-decoration: none; }
}

/* ── Games ──────────────────────────────────────────────── */
.game { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--s-4) var(--s-5) var(--s-5); max-width: 46rem; }
.game-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); padding-bottom: var(--s-3); border-bottom: 1px solid var(--rule); margin-bottom: var(--s-4); }
.game-modes { display: flex; gap: 6px; }
.game-timer, .game-score { font-family: var(--font-head); font-weight: 700; font-size: var(--t-md); font-variant-numeric: tabular-nums; }
.game-timer { margin-left: auto; }
.game-stage { min-height: 16rem; border-radius: var(--radius); }
.game-stage.ok { animation: flash-ok .45s ease; }
.game-stage.bad { animation: flash-bad .45s ease; }
@keyframes flash-ok { from { background: color-mix(in srgb, var(--ok) 18%, transparent); } to { background: transparent; } }
@keyframes flash-bad { from { background: color-mix(in srgb, var(--err) 16%, transparent); } to { background: transparent; } }
.game-q { font-family: var(--font-head); font-weight: 600; font-size: var(--t-lg); margin-bottom: var(--s-3); }
.game-intro, .game-result { padding: var(--s-5) 0; }
.game-result .score { display: block; font-family: var(--font-head); font-size: var(--t-3xl); font-weight: 700; line-height: 1.1; margin: 4px 0 var(--s-2); }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); margin-top: var(--s-3); }
.choice { font: inherit; font-weight: 600; font-size: 1.05rem; padding: 0.8rem 1rem; text-align: left; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--paper); color: var(--ink); cursor: pointer; font-variant-numeric: tabular-nums; }
.choice:hover { border-color: var(--ink); }
.choice.right { border-color: var(--ok); box-shadow: inset 4px 0 0 var(--ok); }
.choice.wrong { border-color: var(--err); box-shadow: inset 4px 0 0 var(--err); }
.rr-resistor { display: block; width: 100%; max-width: 26rem; height: auto; color: var(--ink); margin: var(--s-2) 0; }
.bb-form { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.bb-input { flex: 1 1 12rem; font-size: 1.25rem; padding: 0.6rem 0.75rem; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--paper); color: var(--ink); }
.scope { display: block; width: 100%; max-width: 30rem; height: auto; }
.scope-bg { fill: #0E1A16; }
.scope-grid { stroke: #2A3D36; stroke-width: 1; }
.scope-axis { stroke: #3E5A50; stroke-width: 1.5; }
.scope-trace { fill: none; stroke: #F2C94C; stroke-width: 2.5; stroke-linejoin: round; }
.scope-label { fill: #F2C94C; font-size: 13px; font-weight: 700; }
.scope-settings { font-size: var(--t-sm); color: var(--ink-2); margin: 6px 0 0; }
.gp-wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--s-4); align-items: start; }
@media (max-width: 40rem) { .gp-wrap { grid-template-columns: minmax(0, 1fr); } .choices { grid-template-columns: minmax(0, 1fr); } }
.gp-svg { display: block; width: 100%; height: auto; }
.gp-wire { fill: none; stroke: var(--ink-2); stroke-width: 2; }
.gp-gate { fill: var(--paper); stroke: var(--ink-3); stroke-width: 2; stroke-dasharray: 4 3; }
.gp-gate.set { stroke: var(--ink); stroke-dasharray: none; }
.gp-sym { font-size: 18px; font-weight: 700; fill: var(--ink); }
.gp-name { font-size: 10px; fill: var(--ink-2); }
.gp-svg .pin { font-size: 16px; font-weight: 600; fill: var(--ink); }
.gp-table .tt { font-size: var(--t-sm); }
.gp-table tr.match td.out:last-child { color: var(--ok); }
.gp-table tr.miss td.out:last-child { color: var(--err); }
.gp-selects { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-3); margin-top: var(--s-3); }
.gp-selects .field { min-width: 7rem; }
.gp-selects select { font: inherit; padding: 0.45rem 0.55rem; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--paper); color: var(--ink); }

/* ── Flashcards ─────────────────────────────────────────── */
.fc-all { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); margin-bottom: var(--s-4); }
.deck-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.deck { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-3) 0; border-bottom: 1px solid var(--rule); }
.deck strong { display: block; font-family: var(--font-head); font-weight: 600; font-size: var(--t-md); }
.fc-stage { max-width: 44rem; }
.fc-card { background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--radius); padding: var(--s-5); min-height: 15rem; display: flex; flex-direction: column; }
.fc-front { font-family: var(--font-head); font-weight: 700; font-size: var(--t-xl); line-height: 1.2; margin: var(--s-2) 0 var(--s-4); }
.fc-back { border-top: 1px dashed var(--rule-strong); padding-top: var(--s-4); margin-bottom: var(--s-4); }
.fc-formula { font-size: 1.15rem; line-height: 1.5; margin-bottom: var(--s-2); }
.fc-controls { margin-top: auto; }
.fc-grades { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-2); }
.fc-grades .btn { flex-direction: column; align-items: flex-start; gap: 2px; }
.fc-grades small { font-weight: 400; font-size: 0.75rem; opacity: .85; }
@media (max-width: 40rem) { .fc-grades { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fc-done { padding: var(--s-5) 0; }

/* ── Study timer ────────────────────────────────────────── */
.tm-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-7); align-items: start; }
@media (max-width: 52rem) { .tm-grid { grid-template-columns: minmax(0, 1fr); } }
.tm-main { position: relative; text-align: center; max-width: 24rem; margin: 0 auto; }
.tm-dial { width: 100%; max-width: 20rem; height: auto; display: block; margin: 0 auto; }
.tm-track { fill: none; stroke: var(--rule); stroke-width: 10; }
.tm-ring { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset .9s linear; }
.tm-ring.focus { stroke: var(--c-chip); } .tm-ring.break { stroke: var(--ok); } .tm-ring.idle { stroke: var(--rule-strong); }
.tm-center { position: absolute; left: 0; right: 0; top: 0; aspect-ratio: 1 / 1; max-width: 20rem; margin: 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.tm-phase { font-size: var(--t-sm); color: var(--ink-2); }
.tm-time { font-family: var(--font-head); font-weight: 700; font-size: 4rem; line-height: 1; font-variant-numeric: tabular-nums; }
.tm-buttons { justify-content: center; }
.tm-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; height: 7rem; align-items: end; }
.tm-day { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.tm-bar { width: 100%; max-width: 2rem; background: var(--c-chip); border-radius: 4px 4px 0 0; display: block; }
.tm-day small { font-size: 0.75rem; color: var(--ink-2); }
.timer-chip.on { border-color: var(--c-chip); color: var(--ink); }

@media (max-width: 40rem) {
  .ranges { grid-template-columns: minmax(0, 1fr); row-gap: 4px; }
  .ranges .lbl { margin-top: 6px; }
  .ranges .axis { grid-column: 1; }
}
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll > table { min-width: 34rem; }

/* ── Search dialog ──────────────────────────────────────── */
.search-dlg { width: min(42rem, calc(100% - 2rem)); max-height: min(36rem, calc(100% - 4rem)); margin: 8vh auto auto; padding: 0; border: 1px solid var(--rule-strong); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); }
.search-dlg[open] { display: flex; flex-direction: column; }
.search-dlg::backdrop { background: rgba(10, 18, 24, .45); }
.search-head { display: flex; gap: var(--s-2); align-items: center; padding: var(--s-3); border-bottom: 1px solid var(--rule); }
.search-head input { flex: 1; font: inherit; font-size: 1.1rem; padding: 0.55rem 0.7rem; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--paper); color: var(--ink); min-width: 0; }
.search-status { margin: var(--s-2) var(--s-4) 0; }
.search-list { list-style: none; margin: 0; padding: var(--s-2); overflow-y: auto; flex: 1; }
.sr-item a { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: var(--s-3); padding: var(--s-2) var(--s-3); border-radius: var(--radius); text-decoration: none; align-items: start; }
.sr-item[aria-selected="true"] a { background: color-mix(in srgb, var(--c-chip) 12%, transparent); outline: 2px solid var(--focus); outline-offset: -2px; }
.sr-text strong { display: block; font-weight: 600; }
.sr-text .small { display: block; }
.search-hint { margin: 0; padding: var(--s-2) var(--s-4); border-top: 1px solid var(--rule); }
@media (max-width: 40rem) { .search-dlg { margin-top: 2vh; max-height: calc(100% - 2rem); } .sr-item a { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

/* ── Breadcrumbs ────────────────────────────────────────── */
nav.crumbs { font-size: var(--t-sm); color: var(--ink-2); margin-bottom: var(--s-4); }
nav.crumbs a { color: var(--ink-2); }

/* ── Offline indicator ──────────────────────────────────── */
.offline-chip { display: inline-flex; border-color: var(--warn); color: var(--ink); }
.offline-chip[hidden] { display: none; }
@media (max-width: 40rem) { .offline-chip { font-size: 0.75rem; padding: 2px 8px; } }

/* ── Home: continue panel ───────────────────────────────── */
.continue { margin-top: var(--s-5); padding: var(--s-4); border: 1px solid var(--rule); border-left: 4px solid var(--c-chip); border-radius: var(--radius); background: var(--surface); max-width: 34rem; }
.continue-h { font-size: var(--t-base); font-family: var(--font-body); font-weight: 600; margin-bottom: var(--s-2); }
.continue p { margin: 0 0 6px; color: var(--ink-2); }
.continue p:last-child { margin-bottom: 0; }
.continue a { color: var(--ink); font-weight: 600; }

/* ── Paths filter ───────────────────────────────────────── */
.path-filter { display: grid; gap: var(--s-3); margin-bottom: var(--s-6); max-width: 46rem; }
.path-filter input { font: inherit; padding: 0.55rem 0.7rem; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); width: 100%; }
.filter-groups { display: flex; flex-wrap: wrap; gap: 6px; }
.path-filter p { margin: 0; }
.path-item[hidden], .group[hidden] { display: none; }

/* ── Footer headings (correct level, same look) ─────────── */
.site-foot .foot-h { color: var(--ink); font-family: var(--font-body); font-weight: 600; font-size: var(--t-sm); margin-bottom: var(--s-3); }

/* ── Badges still to earn ───────────────────────────────── */
.badge.locked { background: transparent; border-style: dashed; }
.badge.locked .badge-mark { background: var(--paper); color: var(--ink-2); border: 2px dashed var(--rule-strong); font-size: var(--t-sm); }
#badges .chart-title { margin-top: var(--s-5); }

/* ── Your data / import preview ─────────────────────────── */
.kv-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px var(--s-5); margin: 0 0 var(--s-4); }
.kv-list dt { font-weight: 600; }
.kv-list dd { margin: 0; color: var(--ink-2); }
@media (max-width: 40rem) { .kv-list { grid-template-columns: minmax(0, 1fr); } .kv-list dd { margin-bottom: var(--s-2); } }
.import-list { margin: 6px 0; padding-left: 1.2rem; }
.notice strong { display: block; }

/* Visual QA fixes */
.brand svg { flex: none; }
.search-head input::-webkit-search-cancel-button { display: none; }
.search-head .icon-btn { font-size: 1.4rem; line-height: 1; flex: none; }
@media (max-width: 26rem) { .brand span { font-size: 1.05rem; } .head-tools { gap: 4px; } .head-tools .icon-btn { width: 2.1rem; height: 2.1rem; } }

/* ════════════════════════════════════════════════════════════════════════
   Theme upgrade: one brand colour (deep petrol, like a PCB solder mask seen
   under lab light) for actions, links and focus. Path-group colours stay
   reserved for the three career groups; status colours stay reserved for
   state. Both themes tested for contrast (≥ 6.5:1 for brand text).
   ════════════════════════════════════════════════════════════════════════ */
:root {
  --brand: #0B5C6E; --brand-ink: #FFFFFF; --brand-tint: #E3F0F2; --brand-strong: #084756;
  --math: 'Cambria Math', Cambria, 'STIX Two Math', 'STIX Two Text', 'Latin Modern Math', 'Noto Serif', 'Times New Roman', serif;
  --grid-line: rgba(11, 92, 110, .07);
  --focus: #0B5C6E;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) { --brand: #4CB6C9; --brand-ink: #0B1A20; --brand-tint: #12313A; --brand-strong: #7ACBD9; --grid-line: rgba(76, 182, 201, .08); --focus: #4CB6C9; }
}
:root[data-theme='dark'] { --brand: #4CB6C9; --brand-ink: #0B1A20; --brand-tint: #12313A; --brand-strong: #7ACBD9; --grid-line: rgba(76, 182, 201, .08); --focus: #4CB6C9; }

/* Actions */
.btn { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn.secondary:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-tint); }
a:hover { color: var(--brand); }
.seg input:checked + span, .pill[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.continue { border-left-color: var(--brand); }

/* Header: thin brand rule and brand underline for the current page */
.site-head { border-top: 3px solid var(--brand); }
.nav a[aria-current='page'] { box-shadow: inset 0 -2px 0 var(--brand); color: var(--ink); }
.nav a:hover { color: var(--brand); }
@media (max-width: 74rem) { .nav a[aria-current='page'] { box-shadow: inset 3px 0 0 var(--brand); } }

/* Engineering graph paper, used only behind the home route map and reference headers */
.hero > div:last-child { background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 24px 24px; border-radius: var(--radius-lg); padding: var(--s-4); }

/* Footer as its own band */
.site-foot { background: #13232B; color: #C9D4DC; border-top: 0; }
.site-foot a { color: #E4EAEF; }
.site-foot a:hover { color: #7ACBD9; }
.site-foot .foot-h, .site-foot strong { color: #FFFFFF; }
.site-foot .small { color: #8FA3B0; }

/* ── Formula reference ─────────────────────────────────── */
.math { font-family: var(--math); font-size: 1.08rem; line-height: 1.55; font-feature-settings: 'lnum'; }
.math sub, .math sup, .fx sub, .fx sup, .fc-front sub, .fc-front sup { font-size: 0.72em; line-height: 0; }
.ref-hero { border-bottom: 1px solid var(--rule); background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 24px 24px; }
.ref-hero .wrap { padding-top: var(--s-6); padding-bottom: var(--s-6); }
.ref-hero h1 { margin-bottom: var(--s-3); }
.ref-stats { list-style: none; margin: var(--s-4) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-6); }
.ref-stats li { color: var(--ink-2); }
.ref-stats b { font-family: var(--font-head); font-size: var(--t-lg); color: var(--ink); margin-right: 4px; font-variant-numeric: tabular-nums; }

/* Catalogue of sheets */
.sheet-cat { list-style: none; margin: var(--s-6) 0; padding: 0; border-top: 2px solid var(--ink); }
.cat-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border-bottom: 1px solid var(--rule); }
.cat-main { display: grid; grid-template-columns: 3.5rem 2.25rem minmax(0, 1fr); gap: var(--s-4); align-items: start; padding: var(--s-4) var(--s-2); text-decoration: none; }
.cat-main:hover { background: var(--surface); }
.cat-main:hover .cat-title { color: var(--brand); }
.cat-no { font-family: var(--font-head); font-weight: 700; font-size: var(--t-2xl); line-height: 1; color: var(--brand); font-variant-numeric: tabular-nums; }
.cat-main .sheet-glyph { width: 2.25rem; height: 2.25rem; color: var(--ink-2); margin-top: 2px; }
.cat-title { display: block; font-family: var(--font-head); font-weight: 600; font-size: var(--t-md); }
.cat-intro { display: block; color: var(--ink-2); margin-top: 2px; max-width: 62ch; }
.cat-count { display: block; font-size: var(--t-sm); color: var(--ink-3); margin-top: 4px; }
.cat-fc { margin-right: var(--s-2); font-size: var(--t-sm); font-weight: 600; text-decoration: none; padding: 6px 12px; border: 1px solid var(--rule-strong); border-radius: 999px; white-space: nowrap; }
.cat-fc:hover { border-color: var(--brand); background: var(--brand-tint); }
@media (max-width: 40rem) {
  .cat-row { grid-template-columns: minmax(0, 1fr); }
  .cat-main { grid-template-columns: 2.5rem minmax(0, 1fr); }
  .cat-main .sheet-glyph { display: none; }
  .cat-fc { justify-self: start; margin: 0 0 var(--s-3) calc(2.5rem + var(--s-4) + var(--s-2)); }
}

/* One sheet */
.sheet-title { display: flex; align-items: center; gap: var(--s-4); }
.sheet-title .sheet-glyph { width: 3rem; height: 3rem; flex: none; color: var(--brand); border: 1.5px solid var(--brand); border-radius: var(--radius-lg); padding: 8px; background: var(--surface); }
.sheet-kicker { margin: 0 0 4px; color: var(--ink-2); font-size: var(--t-sm); }
.sheet-title h1 { margin: 0; }
.sheet-layout { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: var(--s-7); padding-top: var(--s-6); padding-bottom: var(--s-6); align-items: start; }
.sheet-side-inner { position: sticky; top: 5rem; }
.sheet-find input { font: inherit; padding: 0.5rem 0.65rem; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); width: 100%; }
.sheet-toc { list-style: none; margin: var(--s-3) 0 0; padding: 0; border-left: 2px solid var(--rule); }
.sheet-toc a { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); padding: 5px 0 5px var(--s-3); margin-left: -2px; border-left: 2px solid transparent; text-decoration: none; font-size: var(--t-sm); color: var(--ink-2); }
.sheet-toc a:hover, .sheet-toc a.on { color: var(--ink); border-left-color: var(--brand); }
.sheet-toc a.on { font-weight: 600; }
.toc-no { font-variant-numeric: tabular-nums; color: var(--ink-3); }
.sheet-body { columns: auto; }
.sheet-sec { break-inside: auto; margin: 0 0 var(--s-7); scroll-margin-top: 5rem; }
.sheet-sec[hidden], .fx[hidden] { display: none; }
.sheet-sec h2 { display: flex; align-items: baseline; gap: var(--s-3); font-size: var(--t-lg); border-bottom: 2px solid var(--ink); padding-bottom: 6px; margin-bottom: 0; }
.sec-no { font-family: var(--font-head); color: var(--brand); font-variant-numeric: tabular-nums; font-size: var(--t-md); }
.fx-list { margin: 0; }
.fx { display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr) auto; column-gap: var(--s-5); align-items: baseline; padding: 0.7rem 0; border-bottom: 1px solid var(--rule); break-inside: avoid; }
.fx dt { font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); grid-column: 1; grid-row: 1 / span 2; }
.fx dd { margin: 0; }
.fx-eq { grid-column: 2; color: var(--ink); }
.fx-note { grid-column: 2; font-size: var(--t-sm); color: var(--ink-2); margin-top: 2px !important; }
.fx-no { grid-column: 3; grid-row: 1; font-size: 0.75rem; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fx:hover { background: linear-gradient(90deg, var(--brand-tint), transparent 70%); }
@media (max-width: 60rem) {
  .sheet-layout { grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
  .sheet-side-inner { position: static; }
  .sheet-toc { display: flex; flex-wrap: wrap; gap: 6px; border-left: 0; }
  .sheet-toc a { display: inline-flex; gap: 6px; border: 1px solid var(--rule); border-radius: 999px; padding: 3px 10px; margin: 0; }
  .sheet-toc a.on, .sheet-toc a:hover { border-color: var(--brand); }
}
@media (max-width: 40rem) {
  .fx { grid-template-columns: minmax(0, 1fr) auto; }
  .fx dt { grid-row: auto; grid-column: 1; }
  .fx-no { grid-column: 2; }
  .fx-eq, .fx-note { grid-column: 1 / -1; }
}

/* Flashcards use the same equation face */
.fc-formula.math { font-size: 1.3rem; }

@media print {
  .ref-hero { background: none; border: 0; }
  .ref-hero .wrap { padding: 0 0 6pt; }
  .ref-stats, .sheet-side { display: none !important; }
  .sheet-layout { display: block; padding: 0; }
  .sheet-body { columns: 2; column-gap: 9mm; }
  .sheet-sec { margin-bottom: 8pt; break-inside: auto; }
  .sheet-sec h2 { font-size: 11pt; border-bottom: 1.5pt solid #000; }
  .sec-no { color: #000; }
  .fx { grid-template-columns: minmax(0, 1fr) auto; padding: 3pt 0; border-bottom-color: #ccc; }
  .fx dt { grid-row: auto; font-size: 8pt; color: #333; }
  .fx-eq, .fx-note { grid-column: 1 / -1; }
  .math { font-size: 9.5pt; }
  .fx-note { font-size: 7.5pt; }
  .fx-no { font-size: 7pt; color: #555; }
  .fx:hover { background: none; }
  .sheet-title .sheet-glyph { border-color: #000; color: #000; }
}
@media (max-width: 60rem) { .hero > div:last-child { max-width: 30rem; } }
@media print { .sheet-sec h2 { break-after: avoid; page-break-after: avoid; } .fx:first-of-type { break-before: avoid; } }

/* ── "When you feel like giving up" ─────────────────────── */
.giveup { margin: var(--s-7) 0 var(--s-5); display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: var(--s-6); padding: var(--s-6); border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--surface); }
.giveup-head h2 { font-size: var(--t-xl); line-height: 1.1; margin-bottom: var(--s-3); }
.giveup-head p { color: var(--ink-2); margin: 0; }
.story { border-left: 3px solid var(--brand); padding-left: var(--s-5); }
.story-title { font-size: var(--t-lg); margin-bottom: 4px; }
.story-who { color: var(--ink-2); font-size: var(--t-sm); margin-bottom: var(--s-3); }
.story-body { font-size: 1.1rem; line-height: 1.65; max-width: 62ch; }
.story-lesson { background: var(--brand-tint); border-radius: var(--radius); padding: var(--s-3) var(--s-4); max-width: 62ch; }
.story-lesson strong { color: var(--ink); }
@media (max-width: 52rem) { .giveup { grid-template-columns: minmax(0, 1fr); padding: var(--s-5); gap: var(--s-4); } .story { padding-left: var(--s-4); } }
.giveup-link { display: grid; gap: 2px; margin: var(--s-4) 0 0; padding: var(--s-4) var(--s-5); border: 1px solid var(--rule); border-left: 3px solid var(--brand); border-radius: var(--radius); background: var(--surface); text-decoration: none; max-width: 46rem; }
.giveup-link:hover { border-color: var(--brand); }
.giveup-link-k { font-size: var(--t-sm); color: var(--ink-2); }
.giveup-link-t { font-family: var(--font-head); font-weight: 600; font-size: var(--t-md); color: var(--ink); }

/* ════════════════════════════════════════════════════════════════════════
   Printed formula sheet: an A4 reference card.
   Title block, dark numbered topic tabs, shaded rows for scanning, a column
   rule, running footer with page numbers, and a notes box at the end.
   ════════════════════════════════════════════════════════════════════════ */
.notes-box, .print-meta { display: none; }
@media print {
  @page {
    size: A4;
    margin: 13mm 12mm 15mm;
    @bottom-left { content: "ECEdge formula sheet"; font: 7.5pt Barlow, sans-serif; color: #6b7a86; }
    @bottom-right { content: "Page " counter(page) " of " counter(pages); font: 7.5pt Barlow, sans-serif; color: #6b7a86; }
  }
  body[data-page="sheet"] { -webkit-print-color-adjust: exact; print-color-adjust: exact; background: #fff; color: #111; }
  body[data-page="sheet"] main { display: block; }

  /* Title block */
  body[data-page="sheet"] .sheet-hero { border: 0; margin: 0 0 4mm; }
  body[data-page="sheet"] .sheet-hero .wrap { border: 1.4pt solid #0B5C6E; border-radius: 3mm; padding: 4mm 5mm 3.5mm; }
  body[data-page="sheet"] .sheet-title { gap: 4mm; }
  body[data-page="sheet"] .sheet-title .sheet-glyph { width: 12mm; height: 12mm; padding: 2mm; border: 0; border-radius: 2mm; background: #0B5C6E; color: #fff; }
  body[data-page="sheet"] .sheet-kicker { font-size: 8pt; letter-spacing: .02em; color: #0B5C6E; margin-bottom: 1mm; }
  body[data-page="sheet"] .sheet-title h1 { font-size: 21pt; line-height: 1.05; }
  body[data-page="sheet"] .sheet-hero .lede { font-size: 9.5pt; line-height: 1.4; color: #333; margin: 2.5mm 0 1.5mm; max-width: none; }
  body[data-page="sheet"] .print-meta { display: block; font-size: 8pt; color: #555; margin: 0; padding-top: 1.5mm; border-top: 0.5pt solid #c9d2d8; }

  /* Two columns with a rule between them */
  body[data-page="sheet"] .sheet-body { columns: 2; column-gap: 8mm; column-rule: 0.5pt solid #c9d2d8; }

  /* Topic headings as dark numbered tabs */
  body[data-page="sheet"] .sheet-sec { margin: 0 0 4mm; }
  body[data-page="sheet"] .sheet-sec h2 { display: flex; align-items: stretch; gap: 0; border: 0; padding: 0; margin: 0 0 1mm; font-size: 10pt; background: #E8EEF0; border-radius: 1.2mm; overflow: hidden; break-after: avoid; }
  body[data-page="sheet"] .sec-no { background: #0B5C6E; color: #fff; padding: 1mm 2.2mm; font-size: 9.5pt; font-weight: 700; }
  body[data-page="sheet"] .sheet-sec h2 { line-height: 1.6; }
  body[data-page="sheet"] .sheet-sec h2 > :not(.sec-no) { padding-left: 2mm; }
  body[data-page="sheet"] .sheet-sec h2 { padding-right: 2mm; }

  /* Formula rows: label line, equation, note; light shading on every other row */
  body[data-page="sheet"] .fx { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 2mm; padding: 1.4mm 1.6mm; border: 0; border-radius: 1mm; break-inside: avoid; }
  body[data-page="sheet"] .fx:nth-child(even) { background: #F3F6F7; }
  body[data-page="sheet"] .fx dt { grid-row: auto; grid-column: 1; font-size: 7.6pt; font-weight: 600; color: #3d4b55; }
  body[data-page="sheet"] .fx-no { grid-column: 2; grid-row: 1; font-size: 6.8pt; color: #7a8893; }
  body[data-page="sheet"] .fx-eq { grid-column: 1 / -1; font-size: 9.6pt; line-height: 1.45; color: #000; margin-top: 0.4mm; }
  body[data-page="sheet"] .fx-note { grid-column: 1 / -1; font-size: 7.4pt; color: #4a5966; font-style: italic; }
  body[data-page="sheet"] .fx:hover { background: inherit; }

  /* Notes box at the end */
  body[data-page="sheet"] .notes-box { display: block; break-inside: avoid; margin-top: 3mm; border: 0.8pt solid #9aa8b2; border-radius: 2mm; padding: 2mm 3mm 3mm; }
  body[data-page="sheet"] .notes-box h2 { font-size: 9pt; margin: 0 0 1mm; color: #0B5C6E; }
  body[data-page="sheet"] .note-lines { height: 36mm; background-image: linear-gradient(#cfd8de 0.4pt, transparent 0.4pt); background-size: 100% 6mm; background-position: 0 5.6mm; }
  body[data-page="sheet"] .print-foot { display: none; }
}

@media print { body[data-page="sheet"] .sec-no { margin-right: 2.2mm; } }

.giveup { scroll-margin-top: 5rem; }

/* A4 PDF tuning: roomier type and spacing so each sheet fills its two pages */
@media print {
  @page { size: A4 portrait; margin: 14mm 13mm 16mm; }
  body[data-page="sheet"] .sheet-hero { margin-bottom: 5mm; }
  body[data-page="sheet"] .sheet-hero .wrap { padding: 5mm 6mm 4.5mm; }
  body[data-page="sheet"] .sheet-title h1 { font-size: 23pt; }
  body[data-page="sheet"] .sheet-hero .lede { font-size: 10pt; }
  body[data-page="sheet"] .sheet-body { column-gap: 9mm; }
  body[data-page="sheet"] .sheet-sec { margin-bottom: 5.5mm; }
  body[data-page="sheet"] .sheet-sec h2 { font-size: 10.5pt; margin-bottom: 1.6mm; }
  body[data-page="sheet"] .sec-no { font-size: 10pt; padding: 1.2mm 2.4mm; }
  body[data-page="sheet"] .fx { padding: 2mm 2mm; margin-bottom: 0.3mm; }
  body[data-page="sheet"] .fx dt { font-size: 8pt; }
  body[data-page="sheet"] .fx-eq { font-size: 10.4pt; line-height: 1.5; margin-top: 0.6mm; }
  body[data-page="sheet"] .fx-note { font-size: 7.8pt; margin-top: 0.4mm; }
  body[data-page="sheet"] .fx-no { font-size: 7pt; }
  body[data-page="sheet"] .notes-box { margin-top: 5mm; }
  body[data-page="sheet"] .note-lines { height: 54mm; background-size: 100% 6.5mm; background-position: 0 6.1mm; }
}
@media print { body[data-page="sheet"] .note-lines { height: 40mm; } }
@media print { body[data-page="sheet"] .sheet-body { column-fill: auto; } }
/* Long sheets (50+ formulas) print a little tighter so they still fit two A4 pages */
@media print {
  body[data-page="sheet"] .compact .fx { padding: 1.3mm 1.8mm; }
  body[data-page="sheet"] .compact .fx-eq { font-size: 9.8pt; line-height: 1.4; }
  body[data-page="sheet"] .compact .fx dt { font-size: 7.6pt; }
  body[data-page="sheet"] .compact .sheet-sec { margin-bottom: 4mm; }
  body[data-page="sheet"] .compact .note-lines { height: 30mm; }
}

.cat-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-right: var(--s-2); }
.cat-actions .cat-fc { margin: 0; }
@media (max-width: 40rem) { .cat-actions { margin: 0 0 var(--s-3) calc(2.5rem + var(--s-4) + var(--s-2)); } }

/* ════════════════════════════════════════════════════════════════════════
   Motion. One short moment per page, all CSS, no libraries:
   - home: the route map grows from the foundation out to each path
   - path pages: the stage line extends and the stops appear in order
   - meters fill from zero; a ticked box gives a small press
   Everything here is off when the device asks for reduced motion.
   ════════════════════════════════════════════════════════════════════════ */
@keyframes sp-draw { to { stroke-dashoffset: 0; } }
@keyframes sp-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sp-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes sp-pop { 0% { opacity: 0; transform: scale(.4); } 70% { opacity: 1; transform: scale(1.08); } 100% { opacity: 1; transform: scale(1); } }
@keyframes sp-grow-x { from { transform: scaleX(0); } }
@keyframes sp-grow-y { from { transform: scaleY(0); } }
@keyframes sp-press { 50% { transform: scale(1.18); } }
@keyframes sp-sheet-in { from { opacity: 0; transform: translate(-50%, 28px); } }
@keyframes sp-sheet-out { to { opacity: 0; transform: translate(-50%, 28px); } }

@media (prefers-reduced-motion: no-preference) {
  .routemap .trunk, .routemap .rail { stroke-dasharray: 1 2; stroke-dashoffset: 1; animation: sp-draw .6s cubic-bezier(.45, 0, .2, 1) forwards; animation-delay: var(--d, 0s); }
  .routemap .trunk { animation-duration: .55s; }
  .routemap .spur { animation-duration: .22s; }
  .routemap a, .routemap .gname { animation: sp-fade .35s ease-out both; animation-delay: calc(var(--d, 0s) + .12s); }
  .routemap .stop { transform-box: fill-box; transform-origin: center; animation: sp-pop .4s cubic-bezier(.3, 1.4, .5, 1) both; animation-delay: calc(var(--d, 0s) + .12s); }

  .route::before { transform-origin: left center; animation: sp-grow-x .8s cubic-bezier(.45, 0, .2, 1) both; }
  .route > li { animation: sp-rise .4s ease-out both; animation-delay: .2s; }
  .route > li:nth-child(2) { animation-delay: .3s; } .route > li:nth-child(3) { animation-delay: .4s; } .route > li:nth-child(4) { animation-delay: .5s; }
  .route > li:nth-child(5) { animation-delay: .6s; } .route > li:nth-child(6) { animation-delay: .7s; } .route > li:nth-child(n+7) { animation-delay: .8s; }
  @media (max-width: 52rem) { .route::before { transform-origin: center top; animation-name: sp-grow-y; } }
  .route .dot, .stage-num { transition: background-color .3s ease, color .3s ease; }

  .meter > i { transition: width .9s cubic-bezier(.45, 0, .2, 1); }
  .checklist input:checked::after { transition: opacity .15s ease; }
  .checklist input.pop { animation: sp-press .28s ease-out; }
}

/* ── Badges as IC chips ─────────────────────────────────── */
.badge { gap: var(--s-4); padding: var(--s-3) var(--s-4) var(--s-3) var(--s-3); }
.chipb { width: 4rem; height: 4rem; flex: none; overflow: visible; color: var(--c-found); }
.chipb.chip { color: var(--c-chip); } .chipb.hardware { color: var(--c-hardware); } .chipb.beyond { color: var(--c-beyond); }
.chipb-label { font-family: var(--font-head); font-weight: 700; font-size: 17px; }
.chipb.earned .chipb-pins, .chipb.earned .chipb-body { fill: currentColor; }
.chipb.earned .chipb-notch { fill: var(--surface); }
.chipb.earned .chipb-die { fill: none; stroke: var(--paper); stroke-opacity: .5; stroke-width: 1.2; }
.chipb.earned .chipb-label { fill: var(--paper); }
.chipb.locked .chipb-pins { fill: var(--rule-strong); }
.chipb.locked .chipb-body { fill: var(--surface); stroke: var(--rule-strong); stroke-width: 1.6; stroke-dasharray: 3 2.5; }
.chipb.locked .chipb-fill { fill: currentColor; fill-opacity: .2; }
.chipb.locked .chipb-notch { fill: var(--paper); stroke: var(--rule-strong); stroke-width: 1.6; }
.chipb.locked .chipb-label { fill: var(--ink-2); }
.badge.earned { box-shadow: inset 3px 0 0 var(--c-found); }
.badge.earned.chip { box-shadow: inset 3px 0 0 var(--c-chip); } .badge.earned.hardware { box-shadow: inset 3px 0 0 var(--c-hardware); } .badge.earned.beyond { box-shadow: inset 3px 0 0 var(--c-beyond); }
@media (prefers-reduced-motion: no-preference) {
  .badge.earned .chipb { transition: transform .2s ease; }
  .badge.earned:hover .chipb { transform: translateY(-2px) rotate(-3deg); }
}
@media (forced-colors: active) { .chipb.earned .chipb-body, .chipb.earned .chipb-pins { fill: CanvasText; } .chipb.earned .chipb-label { fill: Canvas; } }

/* ── Install card ───────────────────────────────────────── */
.install-sheet { position: fixed; left: 50%; bottom: var(--s-4); transform: translateX(-50%); width: min(27rem, calc(100% - 1.5rem)); background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); padding: calc(var(--s-5) + 4px) var(--s-5) var(--s-5); z-index: 22; overflow: hidden; }
.install-sheet::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--c-chip) 0 33.4%, var(--c-hardware) 33.4% 66.7%, var(--c-beyond) 66.7%); }
.install-head { display: flex; gap: var(--s-4); align-items: center; padding-right: var(--s-5); }
.install-logo { width: 3rem; height: 3rem; flex: none; }
.install-sheet h2 { font-size: var(--t-md); line-height: 1.15; margin: 0 0 2px; }
.install-sub { margin: 0; font-size: var(--t-sm); color: var(--ink-2); }
.install-perks { list-style: none; margin: var(--s-4) 0 0; padding: 0; display: grid; gap: var(--s-2); }
.install-perks li { display: flex; gap: var(--s-3); align-items: center; font-size: var(--t-sm); }
.perk-ic { width: .625rem; height: .625rem; border-radius: 50%; flex: none; background: var(--c-chip); }
.perk-ic.off { background: var(--c-hardware); } .perk-ic.bell { background: var(--c-beyond); }
.install-steps { margin: var(--s-4) 0 0; padding-left: 1.25rem; font-size: var(--t-sm); display: grid; gap: 4px; }
.install-actions { display: flex; gap: var(--s-2); margin-top: var(--s-5); }
.install-actions .btn { flex: 1 1 0; justify-content: center; }
.install-x { position: absolute; top: 10px; right: 8px; }
@media (prefers-reduced-motion: no-preference) {
  .install-sheet { animation: sp-sheet-in .38s cubic-bezier(.2, .9, .3, 1.1) both; }
  .install-sheet.leaving { animation: sp-sheet-out .24s ease-in both; }
}
@media print { .install-sheet { display: none !important; } }

/* ── Guide page ─────────────────────────────────────────── */
.guide-setup { border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--surface); padding: var(--s-5) var(--s-6) var(--s-3); }
.guide-setup-top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-2) var(--s-4); flex-wrap: wrap; }
.guide-setup-top h2 { font-size: var(--t-lg); margin: 0; }
.guide-setup-top p { margin: 0; font-variant-numeric: tabular-nums; }
.guide-setup .meter { max-width: none; margin: var(--s-3) 0 var(--s-2); }
.guide-setup .meter > i { background: var(--ok); }
.setup-list { list-style: none; margin: 0; padding: 0; }
.setup-list li { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); gap: var(--s-3); padding: var(--s-4) 0; border-top: 1px solid var(--rule); }
.setup-list li:first-child { border-top: 0; }
.setup-list strong { font-family: var(--font-head); font-weight: 600; font-size: var(--t-md); line-height: 1.2; }
.setup-list p { margin: 2px 0 var(--s-3); color: var(--ink-2); font-size: var(--t-sm); max-width: 60ch; }
.setup-tick { width: 1.5rem; height: 1.5rem; margin-top: 1px; border-radius: 50%; border: 2px solid var(--rule-strong); display: grid; place-items: center; background: var(--surface); }
.setup-tick::after { content: ""; width: .6rem; height: .32rem; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.setup-list li.done .setup-tick { background: var(--ok); border-color: var(--ok); }
.setup-list li.done .setup-tick::after { opacity: 1; }
.setup-list li.done strong { color: var(--ink-2); }
.setup-list li.done .btn { display: none; }
.setup-list li.done p { margin-bottom: 0; }
.setup-list li[data-step="year"].done p { margin-bottom: var(--s-3); }
@media (prefers-reduced-motion: no-preference) { .setup-list li.just .setup-tick { animation: sp-pop .4s cubic-bezier(.3, 1.4, .5, 1); } }
.want-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.want-list a { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.5fr); gap: var(--s-2) var(--s-6); padding: var(--s-4) var(--s-3); border-bottom: 1px solid var(--rule); text-decoration: none; color: inherit; }
.want-list a:hover { background: var(--surface); }
.want-list a:hover strong { text-decoration: underline; }
.want-q { font-family: var(--font-head); font-weight: 600; font-size: var(--t-md); line-height: 1.25; }
.want-a strong { display: block; color: var(--brand); font-weight: 600; }
.want-a span { display: block; color: var(--ink-2); font-size: var(--t-sm); margin-top: 2px; max-width: 62ch; }
@media (max-width: 40rem) { .want-list a { grid-template-columns: minmax(0, 1fr); padding: var(--s-4) 0; } .guide-setup { padding: var(--s-4) var(--s-4) var(--s-2); } }
.guide-end { margin: var(--s-6) 0 var(--s-7); padding-top: var(--s-6); border-top: 1px solid var(--rule); }
.guide-end h2 { font-size: var(--t-lg); }

/* ── Ad space before an ad fills it: a short note on why ads are here ── */
.ad.placeholder .ad-box { position: relative; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); padding: var(--s-4) var(--s-5) var(--s-4) calc(var(--s-5) + 4px); text-align: left; place-items: center start; align-content: center; gap: 4px; overflow: hidden; }
.ad.placeholder .ad-box::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(var(--c-chip) 0 33.4%, var(--c-hardware) 33.4% 66.7%, var(--c-beyond) 66.7%); }
.ad-note { margin: 0; font-family: var(--font-head); font-weight: 700; font-size: var(--t-base); line-height: 1.25; color: var(--ink); text-transform: uppercase; letter-spacing: .03em; }
.ad-sub { margin: 0; font-size: var(--t-sm); color: var(--ink-2); }
@media (max-width: 40rem) { .ad-note { font-size: .9375rem; } }
/* Extra distance where an ad would sit under buttons students tap quickly. */
.ad.far { margin-top: var(--s-8); }

/* ── This week: goal, seven days, streak freeze ─────────── */
.wk-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-2) var(--s-5); }
.wk-count { margin: 0; }
.wk-count b { font-family: var(--font-head); font-size: var(--t-2xl); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.wk-count span { color: var(--ink-2); }
.wk-msg { margin: 0; color: var(--ink-2); }
.wk-days { list-style: none; margin: var(--s-4) 0 var(--s-3); padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 3.25rem)); gap: var(--s-2); }
.wk-day { display: grid; justify-items: center; gap: 6px; }
.wk-mark { width: 100%; aspect-ratio: 1; max-width: 3.25rem; border-radius: var(--radius); border: 2px solid var(--rule); background: var(--surface); display: grid; place-items: center; }
.wk-name { font-size: var(--t-sm); color: var(--ink-2); }
.wk-day.on .wk-mark { background: var(--ok); border-color: var(--ok); }
.wk-day.on .wk-mark::after { content: ""; width: 40%; height: 20%; border-left: 3px solid #fff; border-bottom: 3px solid #fff; transform: rotate(-45deg) translate(1px, -2px); }
.wk-day.today .wk-mark { border-color: var(--brand); border-style: dashed; }
.wk-day.today .wk-name { color: var(--ink); font-weight: 600; }
.wk-day.missed .wk-mark { background: transparent; }
.wk-day.later .wk-mark { background: transparent; border-style: dotted; }
.wk-day.frozen .wk-mark { border-color: var(--c-chip); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c-chip) 22%, transparent) 0 5px, transparent 5px 10px); }
.wk-freeze { display: flex; gap: var(--s-3); align-items: flex-start; margin: var(--s-3) 0; color: var(--ink-2); font-size: var(--t-sm); max-width: 44rem; }
.wk-ice { width: 1.1rem; height: 1.1rem; flex: none; margin-top: 1px; border-radius: 4px; border: 2px solid var(--c-chip); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c-chip) 30%, transparent) 0 3px, transparent 3px 6px); }
.wk-freeze.used .wk-ice { background: var(--c-chip); }
.wk-goal { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* ════════════════════════════════════════════════════════════════════════
   Declutter pass: home hero, path pages, daily, progress, shared parts
   ════════════════════════════════════════════════════════════════════════ */

/* ── Shared components ──────────────────────────────────── */
/* Dropdown: the native select (works with every keyboard and screen reader),
   with a small chevron and the site's control height. */
.select { appearance: none; -webkit-appearance: none; font: inherit; font-size: var(--t-sm); color: var(--ink); background-color: var(--surface);
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  border: 1px solid var(--rule-strong); border-radius: var(--radius); min-height: 2.25rem; padding: 0.35rem 2rem 0.35rem 0.7rem; cursor: pointer; max-width: 100%; }
.select:hover { border-color: var(--ink-2); }
.select:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.select-field { display: inline-flex; align-items: center; gap: var(--s-2); font-size: var(--t-sm); color: var(--ink-2); }
.select-field[hidden] { display: none; }

/* Tabs: two or three choices that swap one panel. */
.tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--rule); border-radius: calc(var(--radius) + 3px); margin-bottom: var(--s-4); }
.tab { font: inherit; font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); background: transparent; border: 0; border-radius: var(--radius); padding: 0.4rem 0.95rem; cursor: pointer; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.tab:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

/* Disclosure box: a clickable row that opens extra detail. */
details.more { margin-top: var(--s-5); border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); max-width: 60rem; }
details.more > summary { list-style: none; cursor: pointer; padding: var(--s-3) var(--s-4); font-weight: 600; display: flex; align-items: center; gap: var(--s-3); }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(-45deg); flex: none; }
details.more[open] > summary::before { transform: rotate(45deg) translate(-2px, -1px); }
details.more > summary:hover { color: var(--brand); }
.more-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-5) var(--s-6); padding: 0 var(--s-4) var(--s-4) calc(var(--s-4) + 7px + var(--s-3)); }
.more-body h3 { font-size: var(--t-base); margin-bottom: var(--s-2); }
.more-body p { margin: 0; color: var(--ink-2); }
@media (max-width: 52rem) { .more-body { grid-template-columns: minmax(0, 1fr); padding-left: var(--s-4); } }

/* ── Home ───────────────────────────────────────────────── */
.hero { grid-template-columns: minmax(0, 1fr) minmax(0, 26rem); grid-template-areas: "copy map" "act map"; row-gap: 0; }
.hero-copy { grid-area: copy; position: static; }
.hero-act { grid-area: act; }
.hero-map { grid-area: map; }
.hero-map { background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 24px 24px; border-radius: var(--radius-lg); padding: var(--s-4); }
.year-pick[hidden], .continue[hidden] { display: none; }
.continue { max-width: 34rem; }
.continue .linkbtn { color: var(--ink-2); font-size: var(--t-sm); }
@media (max-width: 60rem) {
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: "copy" "act" "map"; row-gap: var(--s-5); }
  .year-pick { margin-top: 0; }
  .continue { margin-top: 0; }
}
.home-today .section-head p { color: var(--ink-2); }
.today-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.today-item { display: grid; align-content: start; gap: 4px; padding: var(--s-4) var(--s-5); text-decoration: none; color: inherit; border-left: 1px solid var(--rule); }
.today-item:first-child { border-left: 0; }
.today-item:hover { background: color-mix(in srgb, var(--brand) 5%, var(--surface)); }
.today-item:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.today-k { font-size: var(--t-sm); color: var(--ink-2); }
.today-item strong { font-family: var(--font-head); font-weight: 600; font-size: var(--t-md); line-height: 1.2; color: var(--ink); }
.today-sub { font-size: var(--t-sm); color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.today-item.story { box-shadow: inset 3px 0 0 var(--brand); }
@media (max-width: 52rem) { .today-grid { grid-template-columns: minmax(0, 1fr); } .today-item { border-left: 0; border-top: 1px solid var(--rule); } .today-item:first-child { border-top: 0; } }
.home-update { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-2) var(--s-3); margin: var(--s-5) 0 0; padding: var(--s-3) 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.home-update .tag { font-size: 0.75rem; font-weight: 600; color: var(--ink-2); border: 1px solid var(--rule-strong); border-radius: 4px; padding: 0 6px; }
.home-update a:first-of-type { font-weight: 600; color: var(--ink); }
.home-update .small { margin-left: auto; color: var(--ink-2); }
#how-sec[hidden] { display: none; }

/* ── Path pages ─────────────────────────────────────────── */
.hero-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 26rem); gap: var(--s-7); align-items: start; }
.hero-split .what { color: var(--ink-2); max-width: 62ch; }
.path-fig { margin: 0; }
.path-fig img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--rule); background: var(--rule); }
.path-fig figcaption { font-size: 0.8125rem; color: var(--ink-2); margin-top: var(--s-2); line-height: 1.4; }
.path-fig .credit { display: block; color: var(--ink-3); font-size: 0.75rem; margin-top: 2px; }
.path-fig .credit a { color: inherit; }
@media (max-width: 52rem) { .hero-split { grid-template-columns: minmax(0, 1fr); gap: var(--s-5); } .path-fig { max-width: 24rem; } .path-fig img { aspect-ratio: 16 / 9; } }
.overall .small { color: var(--ink-2); }
.facts { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); max-width: 60rem; }
.route-h { margin-bottom: var(--s-5); }
.route-tip { font-size: var(--t-sm); color: var(--ink-2); margin: var(--s-5) 0 0; max-width: 68ch; }
.stage-side { display: grid; justify-items: end; gap: 6px; padding-top: 6px; }
.stage-side .stage-count { padding-top: 0; }
.stage-badge { display: none; align-items: center; gap: 6px; font-size: var(--t-sm); font-weight: 600; color: var(--line, var(--ink)); white-space: nowrap; }
.stage-badge svg { width: 16px; height: 16px; }
.stage.done .stage-badge { display: inline-flex; }
.stage-toggle { font: inherit; font-size: var(--t-sm); color: var(--ink); background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 999px; padding: 3px 12px; cursor: pointer; white-space: nowrap; }
.stage-toggle:hover { border-color: var(--ink); }
.stage-toggle[hidden] { display: none; }
.stage.folded { padding: var(--s-5) 0; }
.stage.folded .stage-body, .stage.folded .later-note { display: none; }
.stage.folded .stage-head { margin-bottom: 0; }
.stage.folded .stage-head p { display: none; }
@media (max-width: 52rem) { .stage-side { grid-column: 2; justify-items: start; padding-top: 0; grid-auto-flow: column; justify-content: start; align-items: center; gap: var(--s-3); } }
/* Resource type: a quiet icon and word instead of a boxed tag. */
.resources li { grid-template-columns: 5.5rem minmax(0, 1fr); }
.rtype { display: inline-flex; align-items: center; gap: 5px; border: 0; padding: 0; margin-top: 3px; text-align: left; font-weight: 500; color: var(--ink-2); font-size: 0.8125rem; }
.rtype svg { width: 14px; height: 14px; flex: none; color: var(--ink-3); }
/* Tick dates only when the row is pointed at or focused. */
.checklist .when-done { opacity: 0; transition: opacity .15s ease; }
.checklist label:hover .when-done, .checklist label:focus-within .when-done { opacity: 1; }
@media (hover: none) { .checklist .when-done { display: none; } }

/* ── Daily ──────────────────────────────────────────────── */
.daily-grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
.daily-side { display: grid; gap: var(--s-6); align-content: start; }
.daily-side .iq { border-top: 1px solid var(--rule); padding-top: var(--s-5); }
.quiz-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); margin-bottom: var(--s-4); }
.quiz-head h2 { margin: 0; }
.page-head .small { margin: var(--s-2) 0 0; }

/* ── My progress: your week ─────────────────────────────── */
.week-box .wk-head { margin-bottom: 0; }
.wk-msg { font-size: var(--t-sm); }
.wk-goal { display: inline-flex; align-items: center; gap: var(--s-3); font-size: var(--t-sm); color: var(--ink-2); margin-bottom: var(--s-4); }
.wk-stats { margin: var(--s-4) 0 var(--s-3); padding-top: var(--s-4); border-top: 1px solid var(--rule); gap: var(--s-6); }
.wk-stats .stat b { font-size: var(--t-xl); }
.wk-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-5); }
.wk-foot p { margin: 0; }
#prog-table + .linkbtn, #prog-table .linkbtn { margin-top: var(--s-3); color: var(--ink-2); font-size: var(--t-sm); }

/* ── Footer: the long Explore list in two columns ───────── */
.site-foot .wrap > div:nth-child(2) ul { grid-template-columns: repeat(2, minmax(0, max-content)); column-gap: var(--s-6); }
.hero { grid-template-rows: auto 1fr; }
.hero-act { align-self: start; }
.hero-act .year-pick { margin-top: var(--s-6); }
.home-update { max-width: none; }
@media (max-width: 60rem) { .hero { grid-template-rows: none; } .hero-act .year-pick { margin-top: 0; } }
.select { min-width: 0; }
@media (max-width: 40rem) { .quiz-head { display: grid; justify-content: stretch; } .quiz-head .select-field { display: flex; width: 100%; } .quiz-head .select { flex: 1 1 auto; } }
@media (max-width: 52rem) { .daily-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 52rem) { .path-fig { max-width: none; } .path-fig img { aspect-ratio: 5 / 2; } }

/* ── Paths page: one fold-out per group, one open at a time ── */
.groups-acc { display: grid; gap: var(--s-3); }
.group-acc { border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.group-acc > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 6px minmax(0, 1fr) auto 1.25rem; gap: var(--s-4); align-items: center; padding: var(--s-4) var(--s-5) var(--s-4) var(--s-4); }
.group-acc > summary::-webkit-details-marker { display: none; }
.group-acc > summary:hover { background: color-mix(in srgb, var(--ink) 3%, var(--surface)); }
.group-acc > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.group-acc .bar { align-self: stretch; border-radius: 3px; min-height: 2.75rem; }
.ga-text { display: grid; gap: 2px; min-width: 0; }
.ga-name { font-family: var(--font-head); font-weight: 600; font-size: var(--t-lg); line-height: 1.15; color: var(--ink); }
.ga-blurb { color: var(--ink-2); font-size: var(--t-sm); }
.ga-count { font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ga-chev { width: 10px; height: 10px; justify-self: center; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(45deg) translate(-2px, -2px); }
.group-acc[open] .ga-chev { transform: rotate(-135deg) translate(-2px, -2px); }
.group-acc[open] > summary { border-bottom: 1px solid var(--rule); }
.group-acc.chip[open] { border-color: color-mix(in srgb, var(--c-chip) 45%, var(--rule)); }
.group-acc.hardware[open] { border-color: color-mix(in srgb, var(--c-hardware) 45%, var(--rule)); }
.group-acc.beyond[open] { border-color: color-mix(in srgb, var(--c-beyond) 45%, var(--rule)); }
.group-acc .path-list { border-top: 0; padding: 0 var(--s-4); }
.group-acc .path-item:last-child { border-bottom: 0; }
@media (prefers-reduced-motion: no-preference) {
  .ga-chev { transition: transform .2s ease; }
}
@media (max-width: 40rem) {
  .group-acc > summary { grid-template-columns: 5px minmax(0, 1fr) 1rem; gap: var(--s-3); padding: var(--s-3) var(--s-4) var(--s-3) var(--s-3); }
  .ga-count { grid-column: 2; grid-row: 2; }
  .ga-chev { grid-column: 3; grid-row: 1 / span 2; }
  .group-acc .bar { grid-row: 1 / span 2; }
  .ga-name { font-size: var(--t-md); }
  .group-acc .path-list { padding: 0 var(--s-3); }
}
.group-acc { scroll-margin-top: 5rem; }
.group-acc .path-list { overflow: hidden; }
.group-acc.closing .ga-chev { transform: rotate(45deg) translate(-2px, -2px); }
@media (prefers-reduced-motion: no-preference) {
  .groups-acc .group-acc { animation: sp-rise .45s cubic-bezier(.2, .7, .2, 1) both; }
  .groups-acc .group-acc:nth-child(2) { animation-delay: .08s; }
  .groups-acc .group-acc:nth-child(3) { animation-delay: .16s; }
  .group-acc .bar { transition: transform .25s ease; transform-origin: center; }
  .group-acc[open]:not(.closing) .bar { transform: scaleY(1.08); }
}

/* ── Path illustrations ─────────────────────────────────────
   A panel in the opposite colour of the theme (dark on the light site,
   light on the dark site), so it reads as a figure placed on the page. */
:root {
  --fig-bg: #15212B; --fig-ink: #DCE4EA; --fig-ink2: #A9B8C4; --fig-mu: #5F7383; --fig-dot: rgba(220, 228, 234, .16); --fig-node: #1E2D38;
  --fig-found: #4CB6C9; --fig-chip: #8DA2F2; --fig-hardware: #E2B53A; --fig-beyond: #EA8CC0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --fig-bg: #E8EDF1; --fig-ink: #15212B; --fig-ink2: #44525E; --fig-mu: #8695A1; --fig-dot: rgba(21, 33, 43, .14); --fig-node: #FFFFFF;
    --fig-found: #0B5C6E; --fig-chip: #3557D6; --fig-hardware: #8F6700; --fig-beyond: #B1307A;
  }
}
:root[data-theme='dark'] {
  --fig-bg: #E8EDF1; --fig-ink: #15212B; --fig-ink2: #44525E; --fig-mu: #8695A1; --fig-dot: rgba(21, 33, 43, .14); --fig-node: #FFFFFF;
  --fig-found: #0B5C6E; --fig-chip: #3557D6; --fig-hardware: #8F6700; --fig-beyond: #B1307A;
}
.path-fig.art { --fa: var(--fig-found); }
.path-fig.art.chip { --fa: var(--fig-chip); } .path-fig.art.hardware { --fa: var(--fig-hardware); } .path-fig.art.beyond { --fa: var(--fig-beyond); }
.art-svg { display: block; width: 100%; height: auto; border-radius: var(--radius-lg); box-shadow: var(--shadow-1); }
.art-svg .bg { fill: var(--fig-bg); }
.art-svg .dots path { stroke: var(--fig-dot); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 0 24; }
.art-svg .ln, .art-svg .mu, .art-svg .ac, .art-svg .bgline { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.art-svg .ln { stroke: var(--fig-ink); }
.art-svg .mu { stroke: var(--fig-mu); stroke-width: 1.5; }
.art-svg .ac { stroke: var(--fa); stroke-width: 2.4; }
.art-svg .dash { stroke-dasharray: 4 5; }
.art-svg .acf { fill: var(--fa); }
.art-svg .muf { fill: var(--fig-mu); }
.art-svg .inkf { fill: var(--fig-ink); }
.art-svg .bgline { stroke: var(--fig-bg); stroke-width: 2.6; }
.art-svg .cell { fill: none; stroke: var(--fig-mu); stroke-width: 1; }
.art-svg .pad { fill: var(--fig-mu); }
.art-svg .trace { stroke-width: 3; }
.art-svg .via { fill: var(--fig-bg); stroke: var(--fa); stroke-width: 2.4; }
.art-svg .nodef { fill: var(--fig-node); stroke: var(--fig-ink); stroke-width: 2; }
.art-svg .arc { stroke-width: 5; opacity: .5; }
.art-svg .t { fill: var(--fig-mu); font: 600 12px var(--font-body); }
.art-svg .th { fill: var(--fig-ink); font: 700 18px var(--font-head); }
.art-svg .tl { fill: var(--fig-ink); font: 600 14px var(--font-body); }
.art-svg .ts { fill: var(--fig-ink2); font: 500 13px var(--font-body); }
.art-svg .tsb { fill: var(--fig-ink); font: 700 13px var(--font-body); }
.art-svg .ta { fill: var(--fa); font: 600 13.5px var(--font-body); }
.art-svg .tb { fill: var(--fig-bg); font: 700 14px var(--font-body); }
.art-svg .big { fill: var(--fig-ink); font: 700 28px var(--font-head); }
.art-svg .tm { fill: var(--fig-ink); font: 500 12.5px ui-monospace, 'Cascadia Mono', Consolas, 'Courier New', monospace; white-space: pre; }
.art-svg .tka { fill: var(--fa); font-weight: 700; }
.art-svg .bx { fill: var(--fig-node); stroke: var(--fig-ink); stroke-width: 1.6; }
.art-svg .bx.acc { stroke: var(--fa); stroke-width: 2.4; }
.art-svg .panel { fill: var(--fig-node); stroke: var(--fig-mu); stroke-width: 1; }
.art-svg .pill { fill: var(--fig-node); stroke: var(--fig-mu); stroke-width: 1.2; }
.art-svg .pill.acc { stroke: var(--fa); stroke-width: 2.2; }
.art-svg .thick { stroke-width: 3; }
.art-svg .thin { stroke-width: 1.4; }
.art-svg .soft { opacity: .35; }
.path-fig.art figcaption { margin-top: var(--s-2); }
@media (max-width: 52rem) { .path-fig.art { max-width: 30rem; } }
@media (forced-colors: active) { .art-svg .bg { fill: Canvas; } .art-svg .ln, .art-svg .ac, .art-svg .bx { stroke: CanvasText; } .art-svg text { fill: CanvasText; } }

/* ── Home: where to start (any year) ───────────────────── */
.start-here { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); margin-top: var(--s-6); max-width: 36rem; }
.start-here[hidden] { display: none; }
.start-card { display: grid; align-content: start; gap: 3px; padding: var(--s-4); border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: inherit; }
.start-card:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.start-card:hover { border-color: var(--rule-strong); }
.start-card:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.start-k { font-size: var(--t-sm); color: var(--ink-2); }
.start-card strong { font-family: var(--font-head); font-weight: 600; font-size: var(--t-md); line-height: 1.2; color: var(--ink); }
.start-card span:last-child { font-size: var(--t-sm); color: var(--ink-2); }
@media (max-width: 60rem) { .start-here { margin-top: 0; } }
@media (max-width: 30rem) { .start-here { grid-template-columns: minmax(0, 1fr); } }

/* ── Phone layout fixes ─────────────────────────────────── */
@media (max-width: 40rem) {
  /* Stat numbers in a tidy grid instead of a ragged wrap. */
  .stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4) var(--s-3); }
  .stat b { font-size: var(--t-xl); }
  .wk-stats .stat b { font-size: var(--t-lg); }
  /* "Your paths": each row becomes a small block, nothing runs off screen. */
  .prog-table thead { display: none; }
  .prog-table, .prog-table tbody, .prog-table tr, .prog-table td { display: block; width: 100%; }
  .prog-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px var(--s-3); padding: var(--s-3) 0; border-bottom: 1px solid var(--rule); }
  .prog-table td { padding: 0; border: 0; }
  .prog-table td:nth-child(1) { grid-column: 1; font-weight: 600; }
  .prog-table td:nth-child(3) { grid-column: 2; grid-row: 1; text-align: right; white-space: nowrap; }
  .prog-table td:nth-child(2) { grid-column: 1 / -1; }
  .prog-table td:nth-child(2) .meter { max-width: none; }
  .prog-table td:nth-child(4) { grid-column: 1 / -1; color: var(--ink-2); }
  .table-scroll { overflow: visible; }
  /* Path drawing uses the full width. */
  .path-fig.art { max-width: none; }
  /* Folded stage: count, badge and button on one line under the title. */
  .stage-side { grid-column: 1 / -1; padding-left: calc(2.5rem + var(--s-4)); }
}
.ad.in-sheet { margin: var(--s-6) 0; }
@media (max-width: 40rem) { .table-scroll > table.prog-table { min-width: 0; } }

/* Chart tooltips: drawn by app.js as one floating label (no sideways scroll). */
.js-tips .tip:hover::after, .js-tips .tip:focus-visible::after { content: none; }
.float-tip { position: fixed; z-index: 30; max-width: min(20rem, calc(100vw - 16px)); background: var(--ink); color: var(--paper); font-size: 0.8125rem; line-height: 1.35; padding: 6px 9px; border-radius: 4px; pointer-events: none; box-shadow: var(--shadow-2); }
.float-tip[hidden] { display: none; }

/* ── Path stages as fold-outs (app.js adds .stage-acc) ──── */
.stage-btn { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; text-align: left; cursor: pointer; line-height: inherit; }
.stage-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
.stage-chev { display: none; }
.stage-acc .stage { padding: var(--s-5) 0; }
.stage-acc .stage.open { padding-bottom: var(--s-7); }
.stage-acc .stage-head { cursor: pointer; margin-bottom: 0; grid-template-columns: 2.5rem minmax(0, 1fr) auto 1.25rem; align-items: center; }
.stage-acc .stage.open .stage-head { margin-bottom: var(--s-5); }
.stage-acc .stage-head:hover .stage-btn { color: var(--brand); }
.stage-acc .stage-chev { display: block; width: 10px; height: 10px; justify-self: center; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(45deg) translate(-2px, -2px); }
.stage-acc .stage.open .stage-chev { transform: rotate(-135deg) translate(-2px, -2px); }
.stage-acc .stage:not(.open):not(.closing) .stage-body { display: none; }
.stage-acc .stage-body { overflow: clip; overflow-clip-margin: 6px; }
.stage-acc .stage-side { padding-top: 0; }
@media (prefers-reduced-motion: no-preference) { .stage-acc .stage-chev { transition: transform .2s ease; } }
@media (max-width: 52rem) {
  .stage-acc .stage-head { grid-template-columns: 2.5rem minmax(0, 1fr) 1rem; }
  .stage-acc .stage-side { grid-column: 2; grid-row: 2; padding-left: 0; }
  .stage-acc .stage-chev { grid-column: 3; grid-row: 1; }
}
@media print { .stage-acc .stage:not(.open) .stage-body { display: grid; } .stage-chev { display: none !important; } }

/* ── Badges pop in one by one (progress.js sets --bd) ───── */
@keyframes sp-badge { from { opacity: 0; transform: translateY(10px) scale(.94); } to { opacity: 1; transform: none; } }
.badge.pre { opacity: 0; }
.badge.pop { animation: sp-badge .42s cubic-bezier(.2, .8, .3, 1.15) both; animation-delay: var(--bd, 0ms); }
.badge.pop .chipb { animation: sp-pop .5s cubic-bezier(.3, 1.5, .5, 1) both; animation-delay: calc(var(--bd, 0ms) + 90ms); }
@media (prefers-reduced-motion: reduce) { .badge.pre { opacity: 1; } }

/* ── Daily page: status strip, panels, focus timer ──────── */
.daily-head { padding-bottom: var(--s-4); }
.today-strip { list-style: none; margin: 0 0 var(--s-5); padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.today-strip li { display: grid; gap: 2px; padding: var(--s-3) var(--s-4); border-left: 1px solid var(--rule); }
.today-strip li:first-child { border-left: 0; }
.ts-k { font-size: var(--t-sm); color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.ts-k::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--rule-strong); flex: none; }
.today-strip li.on .ts-k::before { background: var(--ok); border-color: var(--ok); }
.today-strip strong { font-family: var(--font-head); font-weight: 600; font-size: var(--t-md); font-variant-numeric: tabular-nums; }

.daily-grid2 { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); grid-template-areas: "timer quiz" "concept quiz" "iq quiz"; grid-template-rows: auto auto 1fr; gap: var(--s-4) var(--s-5); align-items: start; }
.d-timer { grid-area: timer; } .d-concept { grid-area: concept; } .d-iq { grid-area: iq; } .d-quiz { grid-area: quiz; }
.dpanel { border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--surface); padding: var(--s-5); min-width: 0; }
.dpanel-h { display: flex; align-items: center; gap: var(--s-2); font-size: var(--t-lg); margin: 0 0 var(--s-3); }
.dpanel-h svg { width: 20px; height: 20px; flex: none; color: var(--brand); }
.d-quiz .quiz-head { margin-bottom: var(--s-4); }
.d-quiz .quiz-head .dpanel-h { margin: 0; }
.d-concept .formula { background: var(--paper); }
.d-iq details { border-top: 1px solid var(--rule); }

.dt-row { display: flex; align-items: center; gap: var(--s-5); }
.dt-dial { width: 6.5rem; height: 6.5rem; flex: none; }
.dt-track { fill: none; stroke: var(--rule); stroke-width: 9; }
.dt-ring { fill: none; stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .9s linear; }
.dt-ring.focus { stroke: var(--brand); } .dt-ring.break { stroke: var(--ok); } .dt-ring.idle { stroke: var(--rule-strong); }
.dt-time { margin: 0; font-family: var(--font-head); font-weight: 700; font-size: 2.5rem; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.dt-phase { margin: 4px 0 0; color: var(--ink-2); font-size: var(--t-sm); }
.dt-buttons { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-4); }
.dt-note { margin: var(--s-3) 0 0; }
@media (prefers-reduced-motion: reduce) { .dt-ring { transition: none; } }

@media (max-width: 52rem) {
  .daily-grid2 { grid-template-columns: minmax(0, 1fr); grid-template-areas: "timer" "quiz" "concept" "iq"; grid-template-rows: none; }
}
@media (max-width: 40rem) {
  .today-strip { grid-template-columns: minmax(0, 1fr); }
  .today-strip li { border-left: 0; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: center; padding: var(--s-2) var(--s-4); }
  .today-strip li:first-child { border-top: 0; }
  .today-strip strong { font-size: var(--t-base); }
  .dpanel { padding: var(--s-4); }
  .dt-row { gap: var(--s-4); }
  .dt-dial { width: 5.25rem; height: 5.25rem; }
  .dt-time { font-size: 2.1rem; }
}

/* ── Tools index: one tile per calculator ───────────────── */
.tiles-h { font-size: var(--t-md); color: var(--ink-2); font-family: var(--font-body); font-weight: 600; margin: var(--s-6) 0 var(--s-3); }
.tool-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: var(--s-3); }
.tool-tiles.small { grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); }
.tool-tile { display: grid; align-content: start; gap: 6px; min-height: 9.5rem; height: 100%; padding: var(--s-4); border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--surface); text-decoration: none; color: inherit; }
.tool-tile strong { font-family: var(--font-head); font-weight: 600; font-size: var(--t-md); line-height: 1.2; color: var(--ink); margin-top: var(--s-2); }
.tool-tile > span:last-child { font-size: var(--t-sm); color: var(--ink-2); line-height: 1.4; }
.tt-ic { width: 2.75rem; height: 2.75rem; border-radius: 10px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand); flex: none; }
.tt-ic svg { width: 1.6rem; height: 1.6rem; }
.tool-tile:hover { border-color: var(--brand); }
.tool-tile:hover .tt-ic { background: var(--brand); color: var(--brand-ink); }
.tool-tile:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.tool-tiles.small .tool-tile { min-height: 0; }
.tool-tiles.small .tool-tile > span:last-child { display: none; }
@media (prefers-reduced-motion: no-preference) { .tt-ic { transition: background-color .2s ease, color .2s ease; } .tool-tile { transition: border-color .2s ease; } }
@media (max-width: 40rem) {
  .tool-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
  .tool-tile { min-height: 8.5rem; padding: var(--s-3); }
  .tool-tile strong { font-size: var(--t-base); }
}

/* ── A calculator's own page ────────────────────────────── */
.tool-title { display: flex; align-items: center; gap: var(--s-4); }
.tool-title h1 { margin: 0; font-size: var(--t-2xl); }
.tool-solo .tool > div:first-child h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tool-solo .tool { border-top: 0; padding-top: 0; }
.tool-explain-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-6); margin-bottom: var(--s-5); }
.tool-explain h2 { font-size: var(--t-lg); }
.tool-explain ul { padding-left: 1.2rem; margin: 0; display: grid; gap: 6px; }
.tool-explain p { margin: 0; max-width: 62ch; }
details.faq { border-top: 1px solid var(--rule); padding: var(--s-3) 0; max-width: 60rem; }
details.faq:last-of-type { border-bottom: 1px solid var(--rule); }
details.faq summary { cursor: pointer; font-weight: 600; }
details.faq p { margin: var(--s-2) 0 0; color: var(--ink-2); }
@media (max-width: 52rem) { .tool-explain-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s-4); } .tool-title h1 { font-size: var(--t-xl); } .tool-title .tt-ic { width: 2.5rem; height: 2.5rem; } }

/* ── Link lists used on paths, path and guide pages ─────── */
.link-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.link-list li { border-bottom: 1px solid var(--rule); }
.link-list a { display: block; padding: var(--s-3) var(--s-2); text-decoration: none; font-weight: 600; color: var(--ink); }
.link-list a::after { content: ""; float: right; width: 7px; height: 7px; margin-top: .45em; border-right: 2px solid var(--ink-3); border-top: 2px solid var(--ink-3); transform: rotate(45deg); }
.link-list a:hover { background: var(--surface); color: var(--brand); }
.ask h3 { font-size: var(--t-base); color: var(--ink-2); font-family: var(--font-body); margin-bottom: var(--s-2); }
.cmp-links { margin-bottom: var(--s-6); }
.link-row { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.link-row a { display: inline-block; padding: 5px 12px; border: 1px solid var(--rule-strong); border-radius: 999px; text-decoration: none; font-size: var(--t-sm); color: var(--ink); background: var(--surface); }
.link-row a:hover { border-color: var(--brand); color: var(--brand); }

/* ── Compare: index and pages ───────────────────────────── */
.cmp-list { list-style: none; margin: 0 0 var(--s-5); padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: var(--s-3); }
.cmp-list a { display: grid; gap: 4px; height: 100%; padding: var(--s-4); border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--surface); text-decoration: none; color: inherit; }
.cmp-list a:hover { border-color: var(--brand); }
.cmp-list strong { font-family: var(--font-head); font-weight: 600; font-size: var(--t-md); color: var(--ink); }
.cmp-list span:last-child { font-size: var(--t-sm); color: var(--ink-2); }
.cmp-list.small a { padding: var(--s-3) var(--s-4); }
.cmp-dots { display: flex; gap: 4px; }
.cmp-dots .sw, .cmp-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.cmp-legend .sw { margin-right: 6px; }
.cmp-heads { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-3); margin-bottom: var(--s-4); }
.cmp-head { position: relative; display: grid; gap: 4px; padding: var(--s-4) var(--s-4) var(--s-4) calc(var(--s-4) + 8px); border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--surface); text-decoration: none; color: inherit; overflow: hidden; }
.cmp-head .bar { position: absolute; inset: 0 auto 0 0; width: 5px; }
.cmp-head strong { font-family: var(--font-head); font-weight: 600; font-size: var(--t-lg); color: var(--ink); }
.cmp-head span { font-size: var(--t-sm); color: var(--ink-2); }
.cmp-head:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.cmp-table th, .cmp-table td { text-align: left; vertical-align: top; padding: var(--s-3); border-bottom: 1px solid var(--rule); }
.cmp-table thead th { font-family: var(--font-head); font-size: var(--t-base); color: var(--ink); }
.cmp-table tbody th { width: 11rem; color: var(--ink-2); font-weight: 600; }
.cmp-table td { width: 40%; color: var(--ink); line-height: 1.5; }
.cmp-table ul, .cmp-table ol { margin: 0; padding-left: 1.1rem; }
.cmp-skills { display: grid; gap: var(--s-2); max-width: 46rem; }
.cmp-skill-row { display: grid; grid-template-columns: 10rem minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-3); align-items: center; font-size: var(--t-sm); }
.cmp-legend { color: var(--ink-2); font-weight: 600; }
.cmp-bar { position: relative; height: 1.25rem; background: var(--rule); border-radius: 4px; overflow: hidden; }
.cmp-bar i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--c-found); }
.cmp-bar i.chip { background: var(--c-chip); } .cmp-bar i.hardware { background: var(--c-hardware); } .cmp-bar i.beyond { background: var(--c-beyond); }
.cmp-bar b { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: .75rem; color: var(--ink); }
.cmp-pick { padding: var(--s-4) var(--s-5); border: 1px solid var(--rule); border-left: 4px solid var(--c-found); border-radius: var(--radius); background: var(--surface); }
.cmp-pick { display: flex; flex-direction: column; align-items: flex-start; height: 100%; }
.cmp-pick p { flex: 1; }
.cmp-pick .btn { margin-top: var(--s-3); }
.cmp-pick.chip { border-left-color: var(--c-chip); } .cmp-pick.hardware { border-left-color: var(--c-hardware); } .cmp-pick.beyond { border-left-color: var(--c-beyond); }
.cmp-pick h3 { font-size: var(--t-md); margin-bottom: var(--s-2); }
.cmp-pick p { color: var(--ink-2); }
.cmp-choose > h3 { margin-top: var(--s-6); font-size: var(--t-md); }
@media (max-width: 40rem) {
  .cmp-heads { grid-template-columns: minmax(0, 1fr); }
  .cmp-wrap > table.cmp-table { min-width: 0; }
  .cmp-table thead { display: none; }
  .cmp-table, .cmp-table tbody, .cmp-table tr, .cmp-table th, .cmp-table td { display: block; width: 100%; }
  .cmp-table tr { padding: var(--s-3) 0; border-bottom: 1px solid var(--rule); }
  .cmp-table th, .cmp-table td { border: 0; padding: 4px 0; }
  .cmp-table td::before { display: block; font-size: .75rem; font-weight: 600; color: var(--ink-2); }
  .cmp-table td::before { content: attr(data-l); }
  .cmp-skill-row { grid-template-columns: 6.5rem minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-2); }
}

/* ── Fresher job guides ─────────────────────────────────── */
.career-tile { position: relative; padding-left: calc(var(--s-4) + 8px); overflow: hidden; }
.career-tile .bar { position: absolute; inset: 0 auto 0 0; width: 5px; }
.career-tile strong { margin-top: 0; }
.career-tiles .tool-tile { min-height: 6.5rem; }
.career-entry { margin: 0 0 var(--s-6); max-width: 60rem; }
.career-grid { margin-bottom: var(--s-4); }
.career-grid h2, .section h2 { scroll-margin-top: 5rem; }
.tick-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.tick-list li { position: relative; padding-left: 1.6rem; max-width: 62ch; }
.tick-list li::before { content: ""; position: absolute; left: 2px; top: .35em; width: .8rem; height: .45rem; border-left: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(-45deg); }
.career-plan { list-style: none; counter-reset: cp; margin: 0 0 var(--s-5); padding: 0; display: grid; gap: var(--s-2); max-width: 46rem; }
.career-plan li { counter-increment: cp; }
.career-plan a { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); column-gap: var(--s-3); padding: var(--s-3); border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: inherit; }
.career-plan a::before { content: counter(cp); grid-row: 1 / span 2; width: 2rem; height: 2rem; border-radius: 50%; border: 3px solid var(--line, var(--brand)); display: grid; place-items: center; font-weight: 700; font-size: var(--t-sm); }
.career-plan strong { font-family: var(--font-head); font-weight: 600; font-size: var(--t-md); }
.career-plan span { color: var(--ink-2); font-size: var(--t-sm); }
.career-plan a:hover { border-color: var(--brand); }

/* ── Announcement downloads ─────────────────────────────── */
.update-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); margin-top: var(--s-2); }
.dl-btn { display: inline-flex; align-items: center; gap: 8px; }
.dl-btn svg, .dl-link svg { width: 1.05rem; height: 1.05rem; flex: none; }
.dl-meta { font-weight: 400; opacity: .8; font-size: .8125rem; }
.dl-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }

/* ── "Built on the trust of students" ───────────────────── */
.trust-line { display: inline-flex; align-items: center; gap: 8px; margin: calc(var(--s-2) * -1) 0 0; padding: 6px 12px 6px 10px; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); color: var(--ink-2); font-size: var(--t-sm); font-weight: 600; letter-spacing: .01em; }
.trust-line svg { color: var(--brand); flex: none; }
.site-foot .foot-trust { margin-top: -4px; font-weight: 600; color: #E4EAEF; letter-spacing: .01em; }
@media (max-width: 40rem) { .trust-line { font-size: .8125rem; } }
.row-c { display: contents; }

/* Links to a section land below the sticky header. */
main [id] { scroll-margin-top: 5rem; }

/* ── Background sounds (timer and daily focus panel) ───── */
.snd { margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--rule); text-align: left; }
.snd-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); }
.snd-h { margin: 0; font-family: var(--font-body); font-size: var(--t-base); font-weight: 600; color: var(--ink); }
.snd-stop { background: none; border: 1px solid var(--rule-strong); border-radius: 999px; padding: 3px 12px; font: inherit; font-size: var(--t-sm); color: var(--ink-2); cursor: pointer; }
.snd-stop:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.snd-stop:disabled { opacity: .45; cursor: default; }
.snd-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-3) var(--s-2); }
.snd-btn { display: grid; justify-items: center; gap: 6px; width: 100%; padding: 2px 0; background: none; border: 0; cursor: pointer; color: var(--ink-2); font: inherit; -webkit-tap-highlight-color: transparent; }
.snd-ic { position: relative; display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 50%; border: 1.5px solid var(--rule-strong); background: var(--surface); color: var(--ink-2); }
.snd-ic svg { width: 1.6rem; height: 1.6rem; }
.snd-name { font-size: .8125rem; font-weight: 600; line-height: 1.2; text-align: center; }
.snd-btn:hover .snd-ic { border-color: var(--brand); color: var(--brand); }
.snd-btn:focus-visible { outline: none; }
.snd-btn:focus-visible .snd-ic { outline: 2px solid var(--focus); outline-offset: 3px; }
.snd-btn[aria-pressed="true"] .snd-ic { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.snd-btn[aria-pressed="true"] .snd-name { color: var(--ink); }
.snd-btn[aria-pressed="true"] .snd-ic::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--brand); opacity: .35; }
@media (prefers-reduced-motion: no-preference) {
  .snd-ic { transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .15s ease; }
  .snd-btn:active .snd-ic { transform: scale(.93); }
  .snd-btn[aria-pressed="true"] .snd-ic::after { animation: snd-pulse 2.4s ease-in-out infinite; }
  @keyframes snd-pulse { 0%, 100% { transform: scale(1); opacity: .35; } 50% { transform: scale(1.08); opacity: .12; } }
}
.snd-vol-row { display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-4); font-size: var(--t-sm); color: var(--ink-2); }
.snd-vol { flex: 1; accent-color: var(--brand); min-width: 0; }
.snd-status { margin: var(--s-2) 0 0; font-size: var(--t-sm); color: var(--ink-2); }
.d-timer .snd-ic { width: 3rem; height: 3rem; }
.d-timer .snd-ic svg { width: 1.4rem; height: 1.4rem; }
@media (max-width: 22rem) { .snd-ic, .d-timer .snd-ic { width: 2.75rem; height: 2.75rem; } .snd-name { font-size: .75rem; } }

/* ── Project ideas library ─────────────────────────────── */
.proj-filter { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-4); margin: 0 0 var(--s-5); }
.pf-label { font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); }
.seg { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: 999px; padding: 3px; background: var(--surface); }
.seg button { border: 0; background: none; font: inherit; font-size: var(--t-sm); padding: 5px 12px; border-radius: 999px; color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); font-weight: 600; }
.seg button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.pf-free { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-sm); color: var(--ink-2); cursor: pointer; }
.pf-free input { accent-color: var(--brand); width: 1rem; height: 1rem; }
.proj-group { margin: 0 0 var(--s-6); scroll-margin-top: 5rem; }
.proj-group[hidden] { display: none; }
.proj-group-h { display: flex; align-items: center; gap: var(--s-2); font-size: var(--t-lg); margin-bottom: var(--s-3); }
.proj-group-h .sw { width: 10px; height: 10px; border-radius: 50%; }
.proj-group-h .sw.found { background: var(--c-found); } .proj-group-h .sw.chip { background: var(--c-chip); } .proj-group-h .sw.hardware { background: var(--c-hardware); } .proj-group-h .sw.beyond { background: var(--c-beyond); }
.proj-group-h .muted { font-weight: 400; font-size: var(--t-base); }
.proj-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: var(--s-3); }
.proj-grid.small { grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.proj-card-li[hidden] { display: none; }
.proj-card { position: relative; display: grid; align-content: space-between; gap: var(--s-3); height: 100%; padding: var(--s-4) var(--s-4) var(--s-4) calc(var(--s-4) + 6px); border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--surface); text-decoration: none; color: inherit; overflow: hidden; }
.proj-card .bar { position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--c-found); }
.proj-card .bar.chip { background: var(--c-chip); } .proj-card .bar.hardware { background: var(--c-hardware); } .proj-card .bar.beyond { background: var(--c-beyond); }
.proj-card strong { font-family: var(--font-head); font-weight: 600; font-size: var(--t-md); line-height: 1.25; color: var(--ink); }
.proj-card:hover { border-color: var(--brand); }
.proj-card:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.proj-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.proj-chips span { font-size: .75rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--rule); color: var(--ink-2); }
.lv { font-weight: 600; }
.proj-chips .lv1, .proj-meta .lv1 { color: var(--c-found); }
.proj-chips .lv2, .proj-meta .lv2 { color: var(--c-hardware); }
.proj-chips .lv3, .proj-meta .lv3 { color: var(--c-beyond); }
.proj-chips .lv { border-color: currentColor; }
.proj-head h1 { max-width: 24ch; }
.proj-meta { list-style: none; margin: var(--s-4) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-6); }
.proj-meta li { display: grid; gap: 2px; }
.proj-meta span { font-size: .75rem; color: var(--ink-2); }
.proj-meta b, .proj-meta a { font-weight: 600; }
.proj-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 27rem); gap: var(--s-7); align-items: start; margin-bottom: var(--s-4); }
.proj-top .lede { margin-top: 0; }
.proj-top h2 { font-size: var(--t-lg); margin-top: var(--s-5); }
.skills-h { font-size: var(--t-base); font-family: var(--font-body); color: var(--ink-2); margin-top: var(--s-5); }
.skill-chips span { display: inline-block; padding: 4px 11px; border: 1px solid var(--rule-strong); border-radius: 999px; font-size: var(--t-sm); background: var(--surface); }
.proj-fig { margin: 0; }
.parts-table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); max-width: 52rem; }
.parts-table th, .parts-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.parts-table thead th { font-weight: 600; color: var(--ink-2); font-size: .8125rem; }
.parts-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.parts-table tfoot th, .parts-table tfoot td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--rule-strong); }
.parts-table .buy { width: 1%; white-space: nowrap; text-align: right; }
.shop-intro { margin: 0 0 var(--s-3); font-weight: 600; }
.shop-note { font-size: .8125rem; color: var(--ink-2); border-left: 3px solid var(--rule-strong); padding-left: var(--s-3); max-width: 52rem; }
.free-note { padding: var(--s-3) var(--s-4); border: 1px dashed var(--rule-strong); border-radius: var(--radius); max-width: 44rem; }
.free-list { padding-left: 1.2rem; display: grid; gap: 4px; }
.proj-steps { counter-reset: st; list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-3); max-width: 50rem; }
.proj-steps li { counter-increment: st; position: relative; padding: 2px 0 0 2.75rem; min-height: 2rem; line-height: 1.55; }
.proj-steps li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: var(--t-sm); border: 2px solid var(--line, var(--brand)); color: var(--ink); }
.resume-line { margin: 0 0 var(--s-2); padding: var(--s-4); border: 1px solid var(--rule); border-left: 4px solid var(--line, var(--brand)); border-radius: var(--radius); background: var(--surface); font-size: var(--t-base); line-height: 1.55; }
.resume-line mark, .proj-end mark { background: var(--brand-tint); color: var(--ink); padding: 0 3px; border-radius: 3px; }
.project-link { margin-top: var(--s-2); font-size: var(--t-sm); }
.art-svg .tsm { fill: var(--fig-ink2); font: 500 11.5px var(--font-body); }
.art-svg .tmsm { fill: var(--fig-ink); font: 600 11px ui-monospace, 'Cascadia Mono', Consolas, monospace; }
.art-svg .tmo { fill: var(--fig-ink2); font: 500 12.5px ui-monospace, 'Cascadia Mono', Consolas, monospace; white-space: pre; }
.art-svg .tcm { fill: var(--fig-mu); font-style: italic; }
.art-svg .term { fill: var(--fig-bg); stroke: var(--fig-mu); stroke-width: 1; stroke-dasharray: 4 3; }
.art-svg .ring { stroke: var(--fig-bg); stroke-width: 1.5; }
.art-svg .soft2 { opacity: .16; }
.art-svg .thick2 { stroke-width: 2.4; }
@media (max-width: 52rem) { .proj-top { grid-template-columns: minmax(0, 1fr); gap: var(--s-5); } .proj-fig { max-width: 32rem; } }
@media (max-width: 40rem) { .parts-table th, .parts-table td { padding: 8px 6px; } .proj-meta { gap: var(--s-2) var(--s-5); } }

/* ── Simulators ─────────────────────────────────────────── */
.sim { border-top: 1px solid var(--rule); padding-top: var(--s-5); }
.sim-controls { margin-bottom: var(--s-4); }
.sim-controls .form-grid { grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
.sim-range input[type="range"] { width: 100%; accent-color: var(--brand); margin-top: 6px; }
.sim-lab { display: flex; justify-content: space-between; gap: var(--s-2); }
.sim-lab output { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.sim-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: var(--s-3); }
.chip-btn { border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: var(--t-sm); cursor: pointer; }
.chip-btn:hover { border-color: var(--brand); color: var(--brand); }
.sim-seg { margin-bottom: var(--s-3); }
.sim-svg { display: block; width: 100%; height: auto; margin: 0 0 var(--s-3); border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--surface); }
.smith-wrap { max-width: 40rem; }
#sm-chart { cursor: crosshair; }
.sim-svg text { font-family: var(--font-body); font-size: 12px; font-weight: 500; fill: var(--ink-2); }
.sim-svg .stsm { font-size: 11px; }
.sim-svg .stb { font-weight: 700; fill: var(--ink); }
.sim-svg .sca { fill: var(--brand); font-weight: 600; }
.sim-svg .sg { fill: none; stroke: var(--rule); stroke-width: 1; }
.sim-svg .sg2 { fill: none; stroke: var(--rule); stroke-width: 0.5; opacity: .6; }
.sim-svg .sa { fill: none; stroke: var(--rule-strong); stroke-width: 1.2; }
.sim-svg .sd { fill: none; stroke: var(--ink-3, var(--ink-2)); stroke-width: 1.2; stroke-dasharray: 4 4; }
.sim-svg .sc { fill: none; stroke: var(--brand); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.sim-svg .sc.thinc { stroke-width: 1.6; }
.sim-svg .sm { fill: none; stroke: var(--ink-2); stroke-width: 1.6; stroke-linejoin: round; opacity: .7; }
.sim-svg .sdash { stroke-dasharray: 6 5; }
.sim-svg .thickline { stroke-width: 4; stroke-linecap: round; }
.sim-svg .sstem { fill: none; stroke: var(--ink); stroke-width: 1.4; }
.sim-svg .sdot { fill: var(--brand); stroke: var(--surface); stroke-width: 1.5; }
.sim-svg .sdot2 { fill: var(--ink); stroke: var(--surface); stroke-width: 1.5; }
.sim-svg .sdot3 { fill: var(--ink-2); }
.sim-svg .sdotsm { fill: var(--brand); opacity: .55; }
.sim-svg .sbar { fill: var(--brand); }
.sim-svg .sbar2 { fill: var(--rule-strong); }
.sim-svg .sbad { fill: var(--rule); opacity: .5; }
.sim-svg .sface { fill: var(--paper); }
.try-list { padding-left: 1.3rem; margin: 0; display: grid; gap: 6px; }
@media (max-width: 40rem) { .sim-controls .form-grid { grid-template-columns: minmax(0, 1fr); } }

/* ── Cheat sheets ───────────────────────────────────────── */
.cs-list .fx.cs { grid-template-columns: minmax(0, 12rem) minmax(0, 1fr); }
.cs-code { grid-column: 2; min-width: 0; }
.cs-code pre { margin: 0; padding: 8px 12px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow-x: auto; }
.cs-code code { font-family: ui-monospace, 'Cascadia Mono', Consolas, 'Courier New', monospace; font-size: 0.875rem; line-height: 1.5; color: var(--ink); white-space: pre; }
.cs .fx-note { grid-column: 2; }
.cheat-h { margin-top: var(--s-7); }
.cheat-links { margin-top: var(--s-4); }
@media (max-width: 40rem) { .cs-list .fx.cs { grid-template-columns: minmax(0, 1fr); } .cs-code, .cs .fx-note { grid-column: 1; } .cs .fx dt, .fx.cs dt { grid-row: auto; } }
@media print {
  body[data-page="sheet"] .cs-list .fx.cs { grid-template-columns: 34mm minmax(0, 1fr); padding: 1.2mm 0; }
  body[data-page="sheet"] .cs-code pre { padding: 1mm 2mm; background: #f3f5f7; border: 0.4pt solid #d5dbe0; }
  body[data-page="sheet"] .cs-code code { font-size: 7.6pt; white-space: pre-wrap; word-break: break-word; }
}
.table-scroll > table.parts-table { min-width: 0; }
@media print { body[data-page="sheet"] .cs-code code { color: #111 !important; } body[data-page="sheet"] .cs-code pre { background: #f3f5f7 !important; } }

/* Projects index: one fold-out per path (same behaviour as the Paths page) */
.proj-accs { margin-bottom: var(--s-6); }
.proj-accs .proj-group { margin: 0; }
.proj-accs .acc-body { padding: var(--s-4); overflow: hidden; }
.group-acc.found[open] { border-color: color-mix(in srgb, var(--c-found) 45%, var(--rule)); }
@media (max-width: 40rem) { .proj-accs .acc-body { padding: var(--s-3); } .proj-accs .ga-blurb { display: none; } }

/* Home: trust badge with the "free" line beside it */
.trust-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); margin-top: calc(var(--s-2) * -1); }
.trust-row .trust-line { margin: 0; }
.free-line { margin: 0; font-size: var(--t-sm); color: var(--ink-2); }
@media (max-width: 40rem) {
  .parts-table td:first-child { overflow-wrap: anywhere; }
  .parts-table .buy .btn { padding: 5px 8px; font-size: .78rem; white-space: normal; line-height: 1.2; text-align: center; }
  .parts-table th, .parts-table td { padding: 8px 4px; }
}

/* "Why this site shows ads" message, shown where an ad will go until real ads
   are connected. Its own class names (not ad-…) so ad blockers leave it alone. */
.site-note { margin: var(--s-6) auto; max-width: 100%; }
.site-note.far { margin-top: var(--s-8); }
.site-note.in-sheet { margin: var(--s-6) 0; }
.site-note-box { position: relative; display: grid; gap: 4px; align-content: center; margin: 0 auto; width: 100%; max-width: 728px; min-height: 90px; padding: var(--s-4) var(--s-5) var(--s-4) calc(var(--s-5) + 4px); border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); text-align: left; overflow: hidden; }
.site-note.inline .site-note-box { max-width: 336px; min-height: 0; }
.site-note.wide .site-note-box { max-width: none; }
.site-note-box::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(var(--c-chip) 0 33.4%, var(--c-hardware) 33.4% 66.7%, var(--c-beyond) 66.7%); }
.site-note-title { margin: 0; font-family: var(--font-head); font-weight: 700; font-size: var(--t-md); line-height: 1.25; color: var(--ink); }
.site-note-sub { margin: 0; font-size: var(--t-sm); color: var(--ink-2); }
@media (max-width: 40rem) { .site-note-box { min-height: 0; } .site-note-title { font-size: var(--t-base); } }
@media print { .site-note { display: none !important; } }
