/* MoneyPlanIt
   Layout: sticky top bar; strategy index on a wide grid (max 1120px); lessons in a
   single reading column (max 760px) on chart-paper ground; quiz zone as a framed panel. */
:root {
  --paper: #EEF1F3;
  --surface: #FFFFFF;
  --surface-2: #F5F7F8;
  --ink: #15202B;
  --muted: #536070;
  --line: #D4DBE1;
  --grid: rgba(21, 32, 43, 0.045);
  --accent: #946010;
  --accent-strong: #7A4E08;
  --accent-soft: #F3E6CC;
  --on-accent: #FFFFFF;
  --up: #16774A;
  --up-soft: #DCEFE4;
  --down: #B0342E;
  --down-soft: #F6DFDC;
  --ln-0: #946010;
  --ln-1: #2E5D8A;
  --ln-2: #7A4E9C;
  --font-display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 10px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0C1218; --surface: #131B24; --surface-2: #18222D; --ink: #E3E8EE; --muted: #95A2B1;
    --line: #26323F; --grid: rgba(227, 232, 238, 0.035);
    --accent: #E2A945; --accent-strong: #F0BE63; --accent-soft: #2B2215; --on-accent: #1A1205;
    --up: #45BC80; --up-soft: #12291E; --down: #EF716A; --down-soft: #351B1B;
    --ln-0: #E2A945; --ln-1: #74A8DC; --ln-2: #B990DA;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0C1218; --surface: #131B24; --surface-2: #18222D; --ink: #E3E8EE; --muted: #95A2B1;
  --line: #26323F; --grid: rgba(227, 232, 238, 0.035);
  --accent: #E2A945; --accent-strong: #F0BE63; --accent-soft: #2B2215; --on-accent: #1A1205;
  --up: #45BC80; --up-soft: #12291E; --down: #EF716A; --down-soft: #351B1B;
  --ln-0: #E2A945; --ln-1: #74A8DC; --ln-2: #B990DA;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--ink);
  font: 400 16px/1.65 var(--font-body);
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--surface); }
img, svg { max-width: 100%; }
a { color: var(--accent-strong); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; color: var(--ink); }
h1 { font-size: clamp(2rem, 1.2rem + 3.6vw, 3.25rem); line-height: 1.04; font-weight: 800; font-stretch: 112%; letter-spacing: -0.02em; margin: 0.2em 0 0.4em; }
h2 { font-size: 1.45rem; line-height: 1.2; font-weight: 750; font-stretch: 108%; margin: 0 0 0.6em; }
h3 { font-size: 1.08rem; line-height: 1.3; font-weight: 700; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }
.eyebrow { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-strong); margin: 0; }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 62ch; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.wrap { max-width: 1120px; margin-inline: auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
main.wrap { padding-block: 28px 72px; display: block; }

/* top bar */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1120px; margin-inline: auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); min-height: 56px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-family: var(--font-display); font-weight: 800; font-stretch: 116%; font-size: 1.08rem; letter-spacing: -0.01em; }
.logo { width: 38px; height: 38px; flex: none; overflow: visible; }
.logo .logo-ring-back { fill: none; stroke: var(--ink); stroke-width: 3.4; stroke-linecap: round; opacity: 0.4; }
.logo .logo-gap { fill: none; stroke: var(--surface); stroke-width: 7.5; stroke-linecap: round; }
.logo .logo-ring { fill: none; stroke: var(--ink); stroke-width: 3.8; stroke-linecap: round; }
.logo .logo-moon-gap { fill: var(--surface); }
.logo .logo-moon { fill: var(--ink); }
.brand { gap: 6px; font-stretch: 100%; font-size: 1.14rem; letter-spacing: -0.02em; }
.brand-text { font-weight: 600; }
.brand-accent { color: var(--accent); font-weight: 800; }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 0.94rem; padding: 6px 10px; border-radius: 6px; }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.xp-chip { font-family: var(--font-mono); font-size: 0.78rem; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; white-space: nowrap; color: var(--muted); }
.xp-chip:empty { display: none; }
.xp-chip b { color: var(--ink); font-weight: 500; }
@media (max-width: 560px) { .brand-text, .chip-rank { display: none; } .topbar-inner { gap: 8px; } }
@media (max-width: 480px) { .brand-text { display: none; } .nav-progress { display: none; } .topbar-inner { gap: 4px; } .nav { gap: 0; } .nav a { padding: 6px 5px; font-size: 0.82rem; } .topbar .acct-btn { padding: 4px 9px; font-size: 0.78rem; } .xp-chip { display: none; } .acct-btn { margin-left: 4px !important; } .topbar .search-btn { padding: 0 6px; } .search-btn-text, .search-btn kbd { display: none; } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); font: 600 0.95rem/1.2 var(--font-body); text-decoration: none; cursor: pointer; transition: transform .12s ease, background .12s ease; }
.btn:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--muted); }
.btn-danger { background: var(--down); border-color: var(--down); color: #fff; }

/* home */
.hero { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 36px; align-items: end; padding-block: 12px 36px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.hero-stats { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stat-label { display: block; font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 4px; }
.stat-big { font-family: var(--font-display); font-weight: 800; font-stretch: 112%; font-size: 2.6rem; line-height: 1; margin: 0 0 14px; font-variant-numeric: tabular-nums; }
.stat-of { font-family: var(--font-body); font-weight: 500; font-size: 0.95rem; color: var(--muted); font-stretch: 100%; }
.tape { display: grid; grid-template-columns: repeat(50, 1fr); gap: 2px; height: 56px; align-items: end; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tape span { --fill: 0; display: block; height: calc(8% + var(--fill) * 92%); background: var(--line); border-radius: 1px; }
.tape span:not(.off) { background: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.tape span.done { background: var(--up); }
.tape span.off { opacity: .5; }
.stat-note { font-size: 0.88rem; color: var(--muted); margin: 0; display: grid; gap: 6px; }
.rank-line b { color: var(--ink); }
.meter { display: block; height: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--accent); }
.rank-next { font-family: var(--font-mono); font-size: 0.78rem; }

.how { border-top: 1px solid var(--line); padding-block: 28px; }
.how-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.how-list li { display: grid; gap: 6px; font-size: 0.92rem; color: var(--muted); align-content: start; }
.how-list strong { color: var(--ink); }
.how-n { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent-strong); border-bottom: 2px solid var(--accent); width: fit-content; }
.how-note { font-size: 0.92rem; color: var(--muted); }

.index { border-top: 1px solid var(--line); padding-top: 28px; }
.index-head { display: grid; gap: 14px; margin-bottom: 8px; }
.filters { display: grid; gap: 12px; }
.search input { width: 100%; max-width: 420px; min-height: 44px; padding: 10px 14px; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 36px; padding: 6px 12px; font: 500 0.88rem var(--font-body); color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.cat { padding-top: 22px; }
.cat-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px; align-items: baseline; margin-bottom: 12px; }
.cat-head h3 { font-size: 1.2rem; margin: 0; font-stretch: 108%; }
.cat-head p { margin: 0; color: var(--muted); font-size: 0.93rem; max-width: 70ch; }
.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.cards li { display: flex; }
.card { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
a.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card.is-soon { background: transparent; border-style: dashed; color: var(--muted); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.num { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }
.tag { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.card-title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; line-height: 1.25; font-stretch: 104%; }
.card-sum { font-size: 0.9rem; color: var(--muted); line-height: 1.5; flex: 1; }
.card-foot { display: flex; align-items: flex-end; gap: 10px; margin-top: 4px; }
.mini-ladder { display: inline-flex; align-items: flex-end; gap: 2px; height: 18px; }
.mini-ladder span { width: 5px; height: calc(var(--i) * 3.4px + 1px); background: var(--line); border-radius: 1px; }
.mini-ladder span.on { background: var(--up); }
.status { font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted); }
.status.done { color: var(--up); }
.empty { color: var(--muted); padding: 20px 0; }
.faq { border-top: 1px solid var(--line); margin-top: 36px; padding-top: 28px; max-width: 760px; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 8px 0 0; color: var(--muted); }

/* lesson */
.lesson { max-width: 760px; margin-inline: auto; display: grid; gap: 30px; }
.lesson > * { min-width: 0; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.85rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.lesson-head h1 { margin-bottom: 0.35em; }
.facts { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 18px 0 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts div { display: grid; gap: 2px; }
.facts dt { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; font-size: 0.94rem; }
.jump { margin: 12px 0 0; font-size: 0.92rem; }
.prose p, .example li, .rule li, .pc li { max-width: 68ch; }
.viz { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.viz-scroll { overflow-x: auto; }
.viz svg { display: block; width: 100%; height: auto; min-width: 300px; }
.viz figcaption { margin-top: 10px; font-size: 0.88rem; color: var(--muted); }
.viz figcaption p { margin: 6px 0 0; }
.legend { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 0.8rem; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 16px; height: 3px; border-radius: 2px; background: var(--muted); }
.sw-candle { width: 8px; height: 12px; background: linear-gradient(var(--up) 50%, var(--down) 50%); border-radius: 1px; }
.sw-ln-0 { background: var(--ln-0); } .sw-ln-1 { background: var(--ln-1); } .sw-ln-2 { background: var(--ln-2); }
.sw-band { height: 10px; background: var(--accent-soft); border: 1px solid var(--ln-1); }
.sw-buy { width: 0; height: 0; background: none; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 10px solid var(--up); border-radius: 0; }
.sw-sell { width: 0; height: 0; background: none; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 10px solid var(--down); border-radius: 0; }
.sw-lvl-support, .sw-lvl-target { background: repeating-linear-gradient(90deg, var(--up) 0 5px, transparent 5px 8px); }
.sw-lvl-resistance, .sw-lvl-stop { background: repeating-linear-gradient(90deg, var(--down) 0 5px, transparent 5px 8px); }
.sw-lvl-entry { background: repeating-linear-gradient(90deg, var(--accent) 0 5px, transparent 5px 8px); }
.sw-ind { background: var(--ln-1); }
.sw-payoff { background: var(--ink); }
.sw-profit { height: 10px; background: var(--up-soft); border: 1px solid var(--up); }
.sw-loss { height: 10px; background: var(--down-soft); border: 1px solid var(--down); }
.sw-be { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }

.viz text { font-family: var(--font-mono); font-size: 11px; fill: var(--muted); }
.viz .g-grid { stroke: var(--line); stroke-width: 1; }
.viz .wick { stroke-width: 1.2; }
.viz .c-up { fill: var(--up); stroke: var(--up); }
.viz .c-down { fill: var(--down); stroke: var(--down); }
.viz .ln { fill: none; stroke-width: 2.2; stroke-linejoin: round; }
.viz .ln-0 { stroke: var(--ln-0); } .viz .ln-1 { stroke: var(--ln-1); } .viz .ln-2 { stroke: var(--ln-2); }
.viz .band-fill { fill: var(--accent-soft); opacity: .75; }
.viz .band-line { fill: none; stroke: var(--ln-1); stroke-width: 1.3; }
.viz .band-mid { stroke-dasharray: 4 4; }
.viz .lvl { stroke-width: 1.4; stroke-dasharray: 6 5; }
.viz .lvl-support, .viz .lvl-target { stroke: var(--up); }
.viz .lvl-resistance, .viz .lvl-stop { stroke: var(--down); }
.viz .lvl-entry { stroke: var(--accent); }
.viz .lbl-bg { fill: var(--surface); opacity: .92; }
.viz .lvl-label { fill: var(--ink); font-size: 10.5px; }
.viz .box { fill: var(--ln-1); fill-opacity: .07; stroke: var(--ln-1); stroke-dasharray: 3 3; }
.viz .box-label { fill: var(--ln-1); font-size: 10.5px; }
.viz .mk-buy { fill: var(--up); } .viz .mk-sell { fill: var(--down); }
.viz .mk-text { fill: var(--ink); font-size: 10.5px; font-weight: 500; }
.viz .panel-bg { fill: var(--surface-2); }
.viz .ind-line { fill: none; stroke: var(--ln-1); stroke-width: 1.6; }
.viz .payoff-line { fill: none; stroke: var(--ink); stroke-width: 2.4; }
.viz .pay-pos { fill: var(--up); fill-opacity: .16; }
.viz .pay-neg { fill: var(--down); fill-opacity: .16; }
.viz .zero { stroke: var(--muted); stroke-width: 1.2; }
.viz .strike { stroke: var(--muted); stroke-dasharray: 2 4; }
.viz .spot { stroke: var(--accent); stroke-width: 1.2; opacity: .7; }
.viz .be { fill: var(--accent); }

.calc-head p { color: var(--muted); font-size: 0.92rem; }
.calc-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.calc-field { display: grid; gap: 4px; font-size: 0.86rem; color: var(--muted); }
.calc-field input { min-height: 42px; padding: 8px 10px; font: 500 1rem var(--font-mono); color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; width: 100%; }
.calc-field small { font-size: 0.75rem; }
.calc-out { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.calc-out div { display: grid; gap: 2px; }
.calc-out dt { font-size: 0.78rem; color: var(--muted); }
.calc-out dd { margin: 0; font: 600 1.15rem var(--font-mono); font-variant-numeric: tabular-nums; }
.calc-note { grid-column: 1 / -1; color: var(--down); margin: 0; font-size: 0.9rem; }

.rule-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rule { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.rule h3 { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
.rule-entry h3 { color: var(--accent-strong); } .rule-exit h3 { color: var(--ink); } .rule-risk h3 { color: var(--down); }
.rule ul, .pc ul { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; font-size: 0.94rem; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 2.2em minmax(0, 1fr); gap: 8px; }
.steps li::before { content: counter(s, decimal-leading-zero); font-family: var(--font-mono); font-size: 0.82rem; color: var(--accent-strong); padding-top: 3px; }
.pc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pc h3 { font-size: 0.95rem; }
.pc-pro ul { list-style: none; padding: 0; } .pc-con ul { list-style: none; padding: 0; }
.pc-pro li::before { content: "+ "; color: var(--up); font-weight: 700; font-family: var(--font-mono); }
.pc-con li::before { content: "− "; color: var(--down); font-weight: 700; font-family: var(--font-mono); }
.term-list { display: grid; gap: 10px; margin: 0; }
.term-list > div { display: grid; grid-template-columns: minmax(0, 11em) minmax(0, 1fr); gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.term-list dt { font-weight: 600; }
.term-list dd { margin: 0; color: var(--muted); }
.disclaimer { font-size: 0.9rem; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); padding: 12px 14px; }
.disclaimer strong { color: var(--ink); }

/* quiz zone */
.quiz { scroll-margin-top: 72px; border-top: 1px solid var(--line); padding-top: 24px; }
.quiz-head h2 { margin-top: 4px; }
.quiz-sub { color: var(--muted); font-size: 0.94rem; }
.level-list { padding-left: 1.2em; color: var(--muted); }
.quiz-nojs { font-size: 0.9rem; color: var(--muted); }
.ladder { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; align-items: end; margin-bottom: 18px; }
.rung { display: flex; flex-direction: column; align-items: stretch; gap: 6px; background: none; border: 0; padding: 0; cursor: pointer; color: var(--ink); font: inherit; text-align: left; }
.rung-bar { height: var(--h); border-radius: 4px; display: grid; place-items: center; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--muted); transition: background .2s ease, border-color .2s ease; }
.rung-bar svg { width: 16px; height: 16px; }
.rung.is-open .rung-bar { border-color: var(--accent); background: var(--accent-soft); }
.rung.is-passed .rung-bar { border-color: var(--up); background: var(--up); color: var(--surface); }
.rung.is-locked .rung-bar { border-style: dashed; }
.rung.is-current .rung-bar { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink); }
.rung-label { display: grid; font-size: 0.78rem; line-height: 1.25; color: var(--muted); }
.rung-label b { font-family: var(--font-mono); font-weight: 500; color: var(--ink); }
@media (max-width: 480px) { .rung-label span { font-size: 0.68rem; } }
.panel { display: grid; gap: 12px; }
.panel > * { min-width: 0; }
.panel-title { font-size: 1.2rem; margin: 0; }
.panel-facts { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }
.best { margin: 0; font-size: 0.92rem; }
.locked-note { margin: 0; color: var(--muted); }
.panel .btn { justify-self: start; }
.q-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.dots { display: inline-flex; gap: 5px; }
.dot { width: 18px; height: 4px; border-radius: 2px; background: var(--line); }
.dot.done { background: var(--muted); } .dot.now { background: var(--accent); }
.q-text { font-size: 1.1rem; font-weight: 500; line-height: 1.5; margin: 0; outline: none; }
.choices { display: grid; gap: 8px; }
.choice { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; text-align: left; width: 100%; min-height: 48px; padding: 11px 14px; font: 400 0.98rem/1.45 var(--font-body); color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; transition: border-color .12s ease, background .12s ease; }
.choice:hover:not(:disabled) { border-color: var(--accent); }
.choice .key { font-family: var(--font-mono); font-size: 0.8rem; width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); }
.choice:disabled { cursor: default; }
.choice.is-right { background: var(--up-soft); border-color: var(--up); }
.choice.is-right .key { background: var(--up); border-color: var(--up); color: var(--surface); }
.choice.is-wrong { background: var(--down-soft); border-color: var(--down); }
.choice.is-wrong .key { background: var(--down); border-color: var(--down); color: var(--surface); }
.choice.is-dim { opacity: .55; }
.num-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.num-form input { min-height: 46px; width: 11em; max-width: 100%; padding: 10px 12px; font: 500 1.05rem var(--font-mono); color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; }
.num-form input[aria-invalid="true"] { border-color: var(--down); }
.unit { font-family: var(--font-mono); color: var(--muted); }
.fb { border-radius: 8px; padding: 12px 14px; outline: none; }
.fb p { margin: 0 0 6px; } .fb p:last-child { margin: 0; }
.fb-ok { background: var(--up-soft); border: 1px solid var(--up); }
.fb-bad { background: var(--down-soft); border: 1px solid var(--down); }
.fb-title { font-weight: 700; }
.fb-ok .fb-title { color: var(--up); } .fb-bad .fb-title { color: var(--down); }
.q-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.result { display: grid; gap: 10px; }
.result h3 { outline: none; margin: 0; }
.score { font-family: var(--font-display); font-weight: 800; font-stretch: 112%; font-size: 1.4rem; margin: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.score span { font-size: 3.4rem; line-height: 1; color: var(--ink); }
.result.is-pass .score span { color: var(--up); }
.xp-gain { font-family: var(--font-mono); color: var(--accent-strong); margin: 0; }
.xp-gain.muted { color: var(--muted); }

.related ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.related a { display: inline-block; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); text-decoration: none; color: var(--ink); font-size: 0.9rem; }
.related a:hover { border-color: var(--accent); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border-top: 1px solid var(--line); padding-top: 18px; }
.pager a { display: grid; gap: 2px; text-decoration: none; color: var(--ink); font-weight: 600; }
.pager a span { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 400; }
.pager-next { text-align: right; }

/* card decks: lessons and quiz show one card at a time with Back / Next */
.deck { display: grid; gap: 12px; scroll-margin-top: 72px; }
.deck-cards { display: grid; gap: 14px; }
.deck-card { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px 26px; display: grid; gap: 14px; align-content: start; }
.deck-card > * { min-width: 0; margin: 0; }
.deck.is-live .deck-card { min-height: 17rem; }
.deck.is-live .deck-card { scroll-margin-top: 112px; }
.card-h { font-size: 1.35rem; line-height: 1.25; outline: none; scroll-margin-top: 80px; }
.card-h:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.card-part { display: inline-block; font-family: var(--font-mono); font-size: 0.72rem; font-weight: 400; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); vertical-align: middle; margin-left: 6px; }
.deck-card .prose { display: grid; gap: 0.9em; }
.deck-card .prose p { margin: 0; }
.deck-card .lede { margin: 0; }
.deck-card .facts { margin: 0; }
.deck-card .viz { border: 0; padding: 0; background: transparent; }
.deck-card .rule { background: var(--surface-2); }
.deck-top { display: grid; gap: 8px; }
.deck-pos { margin: 0; font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-pos-n { color: var(--ink); font-weight: 500; }
.deck-pos-t { font-family: var(--font-body); }
.deck-bar { display: flex; gap: 3px; height: 5px; }
.deck-bar span { flex: 1; border-radius: 3px; background: var(--line); transition: background .2s ease; }
.deck-bar span.done { background: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.deck-bar span.now { background: var(--accent); }
.deck-bar span.ok { background: var(--up); }
.deck-bar span.bad { background: var(--down); }
.deck-bar span.now.ok, .deck-bar span.now.bad { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--ink); }
.deck-nav { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to bottom, transparent, var(--paper) 30%); }
.btn-nav { min-width: 7.5rem; }
.btn:disabled, .btn[disabled] { opacity: .4; cursor: not-allowed; transform: none; }
.btn:disabled:hover { background: var(--accent); border-color: var(--accent); }
.btn-ghost:disabled:hover { background: transparent; border-color: var(--line); }
.hint { font-size: 0.88rem; color: var(--muted); }
.link-btn { background: none; border: 0; padding: 4px 0; font: inherit; color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.enter-next { animation: card-in-next .22s ease-out; }
.enter-back { animation: card-in-back .22s ease-out; }
@keyframes card-in-next { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes card-in-back { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.quiz-deck .deck-card { min-height: 15rem; }
.quiz-deck .q-text { font-size: 1.12rem; font-family: var(--font-body); font-weight: 600; line-height: 1.45; }
@media (max-width: 560px) {
  .deck-card { padding: 18px 16px 20px; }
  .card-h { font-size: 1.2rem; }
  .btn-nav { min-width: 0; flex: 1; }
}

/* sign-up gate, account button and panel */
.acct-btn { min-height: 32px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--accent); background: transparent; color: var(--accent-strong); font: 600 0.82rem var(--font-body); cursor: pointer; white-space: nowrap; }
.acct-btn:hover { background: var(--accent-soft); }
.xp-chip + .acct-btn { margin-left: 8px; }
.xp-chip:empty + .acct-btn { margin-left: 8px; }
.gate { width: min(30rem, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 0; border: 0; background: transparent; color: var(--ink); overflow: visible; }
.gate::backdrop { background: rgba(10, 16, 22, 0.55); }
.gate[open] { animation: card-in-next .2s ease-out; }
.gate-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 26px 24px 24px; max-height: calc(100vh - 48px); overflow-y: auto; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25); }
.gate-body { display: grid; gap: 12px; }
.gate-body > * { margin: 0; min-width: 0; }
.gate-body h2 { font-size: 1.4rem; line-height: 1.2; margin: 0; padding-right: 28px; }
.gate-lede { color: var(--muted); }
.gate-addr { color: var(--ink); overflow-wrap: anywhere; }
.gate-close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.gate-close:hover { background: var(--surface-2); color: var(--ink); }
.gate-form { display: grid; gap: 10px; }
.gate-label { font-weight: 600; font-size: 0.92rem; }
.gate-form input[type="email"], .gate-form input[type="text"] { min-height: 48px; width: 100%; padding: 10px 12px; font: 500 1rem var(--font-body); color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; }
.gate-form input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.gate-form input[aria-invalid="true"] { border-color: var(--down); }
.gate-code-input { font-family: var(--font-mono) !important; font-size: 1.4rem !important; letter-spacing: 0.3em; text-align: center; }
.gate-err { color: var(--down); font-size: 0.9rem; margin: 0; }
.gate-err:empty { display: none; }
.gate-suggest { background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; display: grid; gap: 8px; }
.gate-suggest p { margin: 0; overflow-wrap: anywhere; }
.gate-suggest-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.gate-suggest-btns .btn { min-height: 38px; padding: 6px 12px; font-size: 0.88rem; max-width: 100%; overflow-wrap: anywhere; }
.gate-check { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 0.92rem; cursor: pointer; }
.gate-check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); }
.gate-small { font-size: 0.84rem; color: var(--muted); }
.gate-switch { font-size: 0.92rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.gate-demo { font-size: 0.86rem; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; color: var(--muted); }
.gate-demo b { color: var(--ink); font-size: 1.05rem; letter-spacing: .15em; }
.gate .btn.gate-submit { width: 100%; }
.link-btn:disabled { color: var(--muted); text-decoration: none; cursor: default; }
.rung.is-gated .rung-bar { border-color: var(--accent); border-style: dashed; color: var(--accent-strong); }
.account { margin-block: 18px 6px; }
.account:empty, .account:has(#account-root:empty) { display: none; }
#account-root { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 10px; }
#account-root:empty { display: none; }
#account-root h2 { margin: 0; font-size: 1.2rem; }
#account-root p { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .gate-card { padding: 22px 16px 18px; } .acct-btn { padding: 4px 10px; } }

/* investing guides */
.guides-home { border-top: 1px solid var(--line); padding-block: 28px; }
.guides-home .cat-head h2 { margin: 0; }
.country-switch { margin: 6px 0 0; font-size: 0.92rem; color: var(--muted); }
.country-switch b { color: var(--ink); }
.guide .disclaimer { margin: 0; }
.quick { background: var(--surface-2); border-radius: var(--radius); padding: 14px 16px; }
.quick ul { margin: 6px 0 0; padding-left: 1.1em; display: grid; gap: 6px; }
.guide-meta { font-size: 0.86rem; color: var(--muted); }
.deck-card h3 { font-size: 1rem; margin: 6px 0 0; font-family: var(--font-display); }
.deck-card[data-kind="route"] > ul, .deck-card[data-kind="safety"] > ul { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; }
.route-tag { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); }
.risk-pill { display: inline-block; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.risk-low { color: var(--up); } .risk-medium { color: var(--accent-strong); } .risk-high { color: var(--down); }
.risk-very-high { color: var(--down); }
.risk-pill.risk-very-high { color: var(--surface); background: var(--down); border-color: var(--down); }
.compare-table { font-size: 0.86rem; min-width: 640px; }
.compare-table td { text-align: left; font-family: var(--font-body); color: var(--ink); vertical-align: top; }
.compare-table th[scope="row"] { min-width: 9em; }
.where-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.where-list li { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.where-list a { font-weight: 600; }
.where-note { font-size: 0.88rem; color: var(--muted); }
.where-flag { font-size: 0.78rem; color: var(--accent-strong); font-family: var(--font-mono); }
.see-also { font-size: 0.9rem; color: var(--muted); }
.see-also span { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: .08em; }
.faq-list { display: grid; gap: 4px; }
.faq-list h3 { margin-top: 10px; }
.faq-list p { margin: 0; }
.next-list { margin: 0; padding-left: 1.1em; display: grid; gap: 8px; }
.next-list .soon { color: var(--muted); }
.chooser { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: grid; gap: 12px; }
.chooser h2 { margin: 0; }
.chooser p { margin: 0; }
.chooser-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.chooser-btn { display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: 12px; align-items: center; padding: 14px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink); text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
.chooser-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.chooser-btn b { display: block; font-family: var(--font-display); font-size: 1rem; line-height: 1.25; }
.chooser-btn span span { display: block; font-size: 0.86rem; color: var(--muted); margin-top: 2px; }
.chooser-flag { display: grid; place-items: center; height: 3rem; border-radius: 8px; background: var(--ink); color: var(--paper); font-family: var(--font-mono); font-weight: 500; letter-spacing: .06em; }
.hub-summary ul { padding-left: 1.1em; display: grid; gap: 6px; }
.country-dialog .chooser-btns { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 640px) {
  .compare-table, .compare-table tbody, .compare-table tr, .compare-table th, .compare-table td { display: block; }
  .compare-table { min-width: 0; }
  .compare-table thead { display: none; }
  .compare-table tr { padding: 12px 14px; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
  .compare-table tr:last-child { border-bottom: 0; }
  .compare-table th, .compare-table td { border: 0; padding: 0; }
  .compare-table th[scope="row"] { font-size: 1rem; }
  .compare-table td::before { content: attr(data-label); display: block; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
}

/* ---- guide pages: long-form reference layout (replaces the card deck on guides only) ---- */
.guide { display: grid; gap: 22px; }
.guide > * { min-width: 0; }
.guide-head h1 { margin-bottom: 0.3em; max-width: 22ch; }
.guide-byline { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 16px; font-size: 0.88rem; color: var(--muted); }
.guide-byline > span + span:not(.level-tag)::before { content: "·"; margin-right: 18px; color: var(--line); }
.guide-head .country-switch { margin: 0; }
.guide-head .disclaimer { margin: 0; max-width: 72ch; }
.guide-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; align-items: start; }
.guide-body { min-width: 0; max-width: 720px; display: grid; gap: 0; }
.toc { position: sticky; top: calc(72px + env(safe-area-inset-top, 0px)); max-height: calc(100vh - 96px); overflow-y: auto; font-size: 0.88rem; }
.toc-box > summary { list-style: none; cursor: default; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-bottom: 10px; }
.toc-box > summary::-webkit-details-marker { display: none; }
.toc-current { display: none; }
.toc-list, .toc-list ol { list-style: none; margin: 0; padding: 0; }
.toc-list { border-left: 2px solid var(--line); display: grid; gap: 1px; }
.toc-list a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 0 5px 12px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.35; }
.toc-list a:hover { color: var(--ink); }
.toc-list a.is-active { color: var(--ink); border-left-color: var(--accent); font-weight: 600; }
.toc-group > span { display: block; padding: 10px 0 4px 12px; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-strong); }
.toc-group ol a { padding-left: 22px; font-size: 0.85rem; }
.toc-risk { flex: none; width: 7px; height: 7px; border-radius: 2px; background: var(--line); }
.toc-risk.risk-medium { background: var(--accent); } .toc-risk.risk-high { background: var(--down); opacity: .7; } .toc-risk.risk-very-high { background: var(--down); }
.g-section { padding-block: 34px; border-top: 1px solid var(--line); scroll-margin-top: calc(80px + env(safe-area-inset-top, 0px)); display: grid; gap: 14px; }
.g-section:first-child { border-top: 0; padding-top: 4px; }
.g-section > * { margin: 0; min-width: 0; }
.g-section h2 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.75rem); margin: 0; }
.g-section h4 { font-family: var(--font-display); font-size: 1rem; margin: 6px 0 0; }
.g-section .prose p { margin: 0 0 0.85em; max-width: 68ch; } .g-section .prose p:last-child { margin-bottom: 0; }
.g-group-h { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.75rem); margin: 0; padding-top: 34px; border-top: 1px solid var(--line); scroll-margin-top: calc(80px + env(safe-area-inset-top, 0px)); }
.g-group-h + .g-route { border-top: 0; padding-top: 18px; }
.quick-list { list-style: none; margin: 0; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 10px; }
.quick-list li { position: relative; padding-left: 20px; }
.quick-list li::before { content: ""; position: absolute; left: 0; top: .6em; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.glossary { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin: 0; }
.glossary > div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.glossary dt { font-weight: 600; margin-bottom: 2px; }
.glossary dd { margin: 0; color: var(--muted); font-size: 0.92rem; }
.g-route { gap: 12px; }
.route-head { display: grid; gap: 4px; }
.route-head h3 { font-size: clamp(1.25rem, 1.05rem + .7vw, 1.5rem); margin: 0; }
.route-num { margin: 0; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-strong); }
.route-tagline { margin: 0; color: var(--muted); font-size: 1.02rem; }
.fact-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 4px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.fact-strip > div { padding: 12px 14px; border-left: 1px solid var(--line); display: grid; gap: 4px; align-content: start; }
.fact-strip > div:first-child { border-left: 0; }
.fact-strip dt { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fact-strip dd { margin: 0; font-size: 0.9rem; line-height: 1.45; }
.risk-meter { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.risk-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.risk-bars span { width: 5px; background: var(--line); border-radius: 1px; }
.risk-bars span:nth-child(1) { height: 5px; } .risk-bars span:nth-child(2) { height: 8px; } .risk-bars span:nth-child(3) { height: 11px; } .risk-bars span:nth-child(4) { height: 14px; }
.risk-low .risk-bars .on { background: var(--up); } .risk-medium .risk-bars .on { background: var(--accent); }
.risk-high .risk-bars .on, .risk-very-high .risk-bars .on { background: var(--down); }
.risk-label { font-size: 0.85rem; font-weight: 600; }
.pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pros-cons > div { padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.pros-cons h4 { margin: 0 0 8px; }
.pros-cons ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 0.94rem; }
.pros-cons li { position: relative; padding-left: 20px; }
.pros-cons li::before { position: absolute; left: 0; top: 0; }
.pc-suits li::before { content: "+"; font-family: var(--font-mono); font-weight: 700; color: var(--up); }
.pc-risks li::before { content: "!"; font-family: var(--font-mono); font-weight: 700; color: var(--down); }
.pc-suits { border-top: 3px solid var(--up) !important; } .pc-risks { border-top: 3px solid var(--down) !important; }
.g-route .steps { margin: 0; }
.tax-item { display: grid; gap: 6px; padding-left: 14px; border-left: 3px solid var(--accent-soft); }
.tax-item h3 { font-size: 1.05rem; margin: 0; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist li { position: relative; padding: 10px 12px 10px 46px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.checklist li::before { content: "✓"; position: absolute; left: 12px; top: 10px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--up-soft); color: var(--up); font-weight: 700; font-size: 0.85rem; }
.faq-acc { display: grid; gap: 8px; }
.faq-acc details { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); scroll-margin-top: calc(80px + env(safe-area-inset-top, 0px)); }
.faq-acc summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; }
.faq-acc summary::-webkit-details-marker { display: none; }
.faq-acc summary h3 { font-family: var(--font-body); font-weight: 600; font-size: 1rem; margin: 0; }
.faq-acc summary::after { content: "+"; flex: none; font-family: var(--font-mono); font-size: 1.2rem; color: var(--accent-strong); transition: transform .2s ease; }
.faq-acc details[open] summary::after { transform: rotate(45deg); }
.faq-acc .prose { padding: 0 14px 14px; }
.to-top { margin: 24px 0 0; font-size: 0.9rem; }
.reading-progress { position: fixed; left: 0; right: 0; top: calc(56px + env(safe-area-inset-top, 0px)); height: 3px; z-index: 19; pointer-events: none; }
.reading-progress span { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }
.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 30% { background-color: var(--accent-soft); box-shadow: 0 0 0 8px var(--accent-soft); } 100% { background-color: transparent; box-shadow: 0 0 0 8px transparent; } }
details.flash { animation-name: flash-box; }
@keyframes flash-box { 0%, 30% { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); } 100% { box-shadow: none; } }
@media (max-width: 900px) {
  .guide-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { position: sticky; top: calc(56px + env(safe-area-inset-top, 0px)); z-index: 6; max-height: none; overflow: visible; margin: 0 calc(-1 * max(16px, env(safe-area-inset-right, 0px))) 0 calc(-1 * max(16px, env(safe-area-inset-left, 0px))); background: var(--paper); border-bottom: 1px solid var(--line); }
  .toc-box > summary { cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); }
  .toc-box > summary::after { content: "▾"; margin-left: auto; font-size: 0.9rem; }
  .toc-box[open] > summary::after { content: "▴"; }
  .toc-current { display: block; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-size: 0.9rem; color: var(--ink); }
  .toc-box .toc-list { max-height: 60vh; overflow-y: auto; margin: 0 max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); background: var(--paper); }
  .reading-progress { top: calc(56px + env(safe-area-inset-top, 0px)); }
  .g-section, .g-group-h, .faq-acc details { scroll-margin-top: calc(124px + env(safe-area-inset-top, 0px)); }
}
@media (max-width: 640px) {
  .fact-strip { grid-template-columns: 1fr 1fr; }
  .fact-strip > div:nth-child(3) { border-left: 0; }
  .fact-strip > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .pros-cons { grid-template-columns: minmax(0, 1fr); }
}

/* learning path, citations, sources */
.path { border-top: 1px solid var(--line); padding-block: 28px; }
.path-note { color: var(--muted); font-size: 0.94rem; }
.path-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.path-list a { display: grid; grid-template-columns: 2.4em minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.path-list a:hover { border-color: var(--accent); }
.path-n { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent-strong); }
.builds { margin: 12px 0 0; font-size: 0.92rem; color: var(--muted); }
.builds span { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: .08em; }
sup.cite { font-family: var(--font-mono); font-size: 0.68em; line-height: 0; margin-left: 1px; }
sup.cite a { text-decoration: none; padding: 0 2px; border-radius: 3px; background: var(--accent-soft); color: var(--accent-strong); }
.src-list { padding-left: 2.2em; display: grid; gap: 6px; font-size: 0.9rem; color: var(--muted); }
.src-list li.is-target, .src-list li:target { background: var(--accent-soft); border-radius: 4px; }
.src-note { font-size: 0.88rem; color: var(--muted); }

/* progress page */
.progress-page { max-width: 760px; margin-inline: auto; }
.progress-page h2 { margin-top: 30px; }
.pg-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pg-summary > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.pg-summary b { font-family: var(--font-display); font-size: 1.4rem; font-stretch: 108%; }
.ranks { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.ranks li { display: flex; justify-content: space-between; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); }
.ranks li.got { color: var(--ink); background: var(--surface); }
.ranks li.now { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.cat-bars { display: grid; gap: 10px; }
.cat-bar { display: grid; grid-template-columns: minmax(0, 10em) minmax(0, 1fr) 4em; gap: 12px; align-items: center; font-size: 0.92rem; }
.cat-bar .mono { text-align: right; font-size: 0.82rem; color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; }
td { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--muted); text-align: center; }
td.pass { color: var(--up); font-weight: 500; }
thead th { font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; color: var(--muted); }
.reset { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.reset p { width: 100%; margin: 0; }

.site-foot { border-top: 1px solid var(--line); background: var(--surface); padding-block: 22px 28px; padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); font-size: 0.86rem; color: var(--muted); }
.site-foot p { max-width: 90ch; }
.foot-meta { margin: 0; }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); opacity: 0; z-index: 40; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 10px; font-size: 0.92rem; text-align: center; max-width: calc(100% - 32px); transition: opacity .25s ease, transform .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 820px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .how-list { grid-template-columns: minmax(0, 1fr); }
  .how-list li { grid-template-columns: 2.4em minmax(0, 1fr); }
  .cat-head { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .rule-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .term-list > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .pc-grid { grid-template-columns: minmax(0, 1fr); }
  .terms dl > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .pg-summary { grid-template-columns: minmax(0, 1fr); }
  .cat-bar { grid-template-columns: minmax(0, 1fr) 4em; }
  .cat-bar .meter { grid-column: 1 / -1; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ---------- site search ---------- */
.search-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 8px 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--muted); font: 500 0.88rem var(--font-body); cursor: pointer; white-space: nowrap; }
.search-btn:hover { color: var(--ink); border-color: var(--muted); }
.search-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.search-btn svg { width: 16px; height: 16px; flex: none; }
.search-btn-text { min-width: 5.5em; text-align: left; }
kbd { font: 500 0.72rem var(--font-mono); padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: var(--surface); color: var(--muted); }
.search-btn + .xp-chip:not(:empty) { margin-left: 4px; }
.search-dialog { width: min(42rem, calc(100% - 32px)); max-height: min(36rem, calc(100% - 96px)); margin: 72px auto auto; padding: 0; border: 0; background: transparent; color: var(--ink); overflow: visible; }
.search-dialog::backdrop { background: rgba(10, 16, 22, 0.55); }
.search-dialog[open] { animation: card-in-next .16s ease-out; }
.search-panel { display: flex; flex-direction: column; max-height: min(36rem, calc(100vh - 96px)); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25); overflow: hidden; }
.search-field { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); }
.search-field svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search-field input { flex: 1; min-width: 0; min-height: 44px; border: 0; background: transparent; color: var(--ink); font: 500 1.05rem var(--font-body); outline: none; }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-close { flex: none; min-height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); font: 500 0.82rem var(--font-body); cursor: pointer; }
.search-close:hover { color: var(--ink); background: var(--surface-2); }
.search-status { margin: 0; padding: 8px 16px 0; font: 500 0.76rem var(--font-mono); color: var(--muted); }
.search-status:empty { display: none; }
.search-results { list-style: none; margin: 0; padding: 8px; overflow-y: auto; overscroll-behavior: contain; flex: 1; }
.search-results [role="option"] a { display: grid; gap: 3px; padding: 10px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; border-left: 3px solid transparent; }
.search-results [aria-selected="true"] a { background: var(--surface-2); border-left-color: var(--accent); }
.sr-top { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.sr-kind { flex: none; font: 600 0.68rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-strong); }
.sr-kind.is-soon { color: var(--muted); }
.sr-page { font-size: 0.8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-title { font-weight: 650; line-height: 1.3; }
.sr-snippet { font-size: 0.86rem; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-results mark { background: var(--accent-soft); color: inherit; border-radius: 2px; padding: 0 1px; }
.search-suggest, .search-empty { padding: 10px 8px; color: var(--muted); }
.search-suggest div { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.search-suggest .chip { cursor: pointer; }
.search-foot { margin: 0; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 0.76rem; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
@media (max-width: 640px), (pointer: coarse) { .search-foot { display: none; } }
@media (max-width: 640px) {
  .search-dialog { width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; }
  .search-panel { height: 100%; max-height: none; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top, 0px); }
}

/* ---------- method guides (ways to trade and invest) ---------- */
.dot-list { margin: 0; padding-left: 1.15em; display: grid; gap: 8px; }
.dot-list li { max-width: 68ch; }
.example-box, .warn-box, .safe-box { margin: 18px 0; padding: 14px 18px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.example-box { border-left: 4px solid var(--accent); }
.example-box h3 { margin: 0 0 8px; font-size: 1.05rem; }
.example-box p, .warn-box p, .safe-box p { max-width: 68ch; }
.example-box p:last-child, .warn-box p:last-child, .safe-box p:last-child { margin-bottom: 0; }
.warn-box { border-color: color-mix(in srgb, var(--down) 45%, var(--line)); background: color-mix(in srgb, var(--down) 7%, var(--surface)); border-left: 4px solid var(--down); }
.safe-box { border-left: 4px solid color-mix(in srgb, var(--up) 70%, var(--line)); }
.box-label { margin: 0 0 6px; font: 600 0.7rem var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.warn-box .box-label { color: var(--down); }
.fact-strip .lose-yes dd { color: var(--down); font-weight: 600; }
.rules-list { margin: 0; display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.rules-list > div { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 16px; padding: 12px 16px; border-top: 1px solid var(--line); }
.rules-list > div:first-child { border-top: 0; }
.rules-list dt { font-weight: 650; }
.rules-list dd { margin: 0; font-size: 0.95rem; max-width: 70ch; }
@media (max-width: 560px) { .rules-list > div { grid-template-columns: 1fr; gap: 4px; } }
.level-tag { display: inline-block; font: 600 0.68rem var(--font-mono); text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.level-advanced { border-color: color-mix(in srgb, var(--down) 50%, var(--line)); color: var(--down); }
.level-intermediate { border-color: var(--accent); color: var(--accent-strong); }
.method-table th[scope="row"] .level-tag { display: table; margin-top: 6px; }
.lose-tag { font-weight: 600; }
.lose-yes { color: var(--down); }
.lose-no { color: var(--muted); font-weight: 500; }
.idea-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.idea { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.idea h3 { margin: 0 0 6px; font-size: 1.02rem; }
.idea p { font-size: 0.94rem; }
.idea p:last-child { margin-bottom: 0; }
.idea-num { margin: 0 0 4px; font: 600 0.8rem var(--font-mono); color: var(--accent-strong); }
.situations { display: grid; gap: 10px; }
.situation { padding: 12px 16px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); background: var(--surface); }
.situation h3 { margin: 0 0 4px; font-size: 1rem; }
.situation p { margin: 0 0 8px; font-size: 0.94rem; color: var(--muted); }
.situation-links { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 !important; }
.situation-links a { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); font-size: 0.86rem; background: var(--surface-2); }
.situation-links a:hover { border-color: var(--accent); }
.method-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.method-cards a { height: 100%; display: grid; gap: 6px; align-content: start; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; }
.method-cards a:hover { border-color: var(--accent); }
.mc-top { display: flex; justify-content: space-between; align-items: center; }
.mc-num { font: 600 0.8rem var(--font-mono); color: var(--muted); }
.mc-title { font-weight: 650; line-height: 1.3; }
.mc-sum { font-size: 0.88rem; color: var(--muted); }
.mc-lose { font-size: 0.8rem; }
.method-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.method-pager a { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); background: var(--surface); font-weight: 600; }
.method-pager a span { font: 500 0.72rem var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.method-pager .pager-next { text-align: right; }
.method-pager a:hover { border-color: var(--accent); }
.guides-sub { font-size: 1.02rem; margin: 18px 0 10px; }
.cards-compact .card-sum { font-size: 0.86rem; }
.card-feature { border-color: var(--accent); background: var(--accent-soft); }
@media (max-width: 640px) { .idea-grid { grid-template-columns: 1fr; } .method-pager { grid-template-columns: 1fr; } .method-pager .pager-next { text-align: left; } }

@media (max-width: 370px) { .nav a { padding: 6px 4px; font-size: 0.8rem; } }

/* =====================================================================
   Presentation update (November 2026): welcome homepage, lesson layout
   and quiz. Layout and styling only; lesson and quiz content unchanged.
   ===================================================================== */
.btn-lg { min-height: 50px; padding: 12px 22px; font-size: 1rem; border-radius: 10px; }
.page-head { max-width: 760px; padding-block: 8px 12px; }
.page-head h1 { margin-bottom: 0.25em; }

/* ---------- welcome homepage ---------- */
.welcome-hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 48px; align-items: center; padding-block: 24px 48px; }
.wh-text h1 { font-size: clamp(2.2rem, 1.3rem + 3.8vw, 3.6rem); margin: 0.25em 0 0.35em; }
.wh-text .lede { font-size: 1.18rem; color: var(--ink); opacity: .82; max-width: 56ch; margin-bottom: 1.4em; }
.assure { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 0.9rem; color: var(--muted); }
.assure li { display: inline-flex; align-items: center; gap: 7px; }
.assure li::before { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--up-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%2316774A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat; flex: none; }
.wh-ladder { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px 22px 18px; box-shadow: 0 1px 0 var(--line), 0 18px 40px -28px rgba(21, 32, 43, .35); }
.ladder-steps { list-style: none; margin: 10px 0 0; padding: 0 18px; display: flex; flex-direction: column-reverse; gap: 12px; position: relative; }
.ladder-steps::before, .ladder-steps::after { content: ""; position: absolute; top: -6px; bottom: -6px; width: 4px; border-radius: 2px; background: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.ladder-steps::before { left: 6px; } .ladder-steps::after { right: 6px; }
.ladder-steps a { position: relative; z-index: 1; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: center; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink); text-decoration: none; transition: border-color .15s ease, transform .15s ease, background .15s ease; }
.ladder-steps a:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateX(2px); }
.ladder-steps b { display: block; font-weight: 650; line-height: 1.3; }
.ladder-steps small { display: block; color: var(--muted); font-size: 0.84rem; line-height: 1.35; }
.ls-n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font: 700 0.95rem var(--font-mono); }
.welcome-back { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; padding: 16px 20px; margin-bottom: 8px; border: 1px solid var(--accent); border-radius: 14px; background: var(--accent-soft); }
.welcome-back .wb-line { margin: 2px 0 0; }
.w-section { border-top: 1px solid var(--line); padding-block: 48px; }
.w-section > h2 { font-size: clamp(1.45rem, 1.1rem + 1.2vw, 1.95rem); max-width: 30ch; margin: 6px 0 22px; }
.w-why { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.w-why h2 { font-size: clamp(1.45rem, 1.1rem + 1.2vw, 1.95rem); margin: 6px 0 14px; }
.w-why p { max-width: 62ch; font-size: 1.05rem; }
.w-facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.w-facts li { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr); gap: 14px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.w-facts b { font: 800 2rem/1 var(--font-display); font-stretch: 112%; color: var(--accent-strong); font-variant-numeric: tabular-nums; }
.w-facts span { color: var(--muted); font-size: 0.94rem; line-height: 1.4; }
.w-features { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.w-features li, .w-routes li { display: flex; }
.w-features a { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
.w-features a:hover, .w-routes a:hover { border-color: var(--accent); transform: translateY(-2px); }
.wf-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); }
.wf-ic svg { width: 24px; height: 24px; }
.wf-t { font: 700 1.08rem/1.25 var(--font-display); font-stretch: 104%; }
.wf-d { color: var(--muted); font-size: 0.93rem; line-height: 1.5; flex: 1; }
.wf-cta, .wr-cta { font-weight: 600; font-size: 0.92rem; color: var(--accent-strong); }
.w-steps { list-style: none; counter-reset: ws; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.w-steps li { counter-increment: ws; display: grid; gap: 6px; align-content: start; padding-top: 16px; border-top: 3px solid var(--accent); }
.w-steps li::before { content: "Step " counter(ws); font: 600 0.75rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent-strong); }
.w-steps b { font: 700 1.12rem var(--font-display); font-stretch: 104%; }
.w-steps span { color: var(--muted); font-size: 0.96rem; }
.w-routes { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.w-routes a { flex: 1; display: grid; gap: 4px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; color: var(--ink); text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
.wr-q { font: 700 1.05rem var(--font-display); font-stretch: 104%; }
.wr-a { color: var(--muted); font-size: 0.93rem; }
.w-promises { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.w-promises li { display: grid; gap: 6px; align-content: start; }
.w-promises b { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.w-promises b::before { content: ""; width: 18px; height: 18px; border-radius: 50%; background: var(--up-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%2316774A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 13px no-repeat; flex: none; }
.w-promises span { color: var(--muted); font-size: 0.93rem; }
.w-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; margin-top: 8px; padding: 30px 32px; border-radius: 18px; background: var(--ink); color: var(--paper); }
.w-cta h2 { color: var(--paper); margin: 0 0 6px; font-size: clamp(1.4rem, 1.1rem + 1vw, 1.8rem); }
.w-cta p { margin: 0; color: var(--paper); opacity: .8; max-width: 52ch; }
@media (max-width: 1000px) { .w-features, .w-promises { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) {
  .welcome-hero, .w-why { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .w-steps { grid-template-columns: minmax(0, 1fr); gap: 18px; }
}
@media (max-width: 600px) {
  .w-features, .w-routes, .w-promises { grid-template-columns: minmax(0, 1fr); }
  .w-section { padding-block: 36px; }
  .w-cta { padding: 24px 20px; }
  .hero-actions .btn-lg { flex: 1 1 100%; }
}

/* ---------- lesson layout ---------- */
.lesson.lesson-v2 { max-width: 1100px; gap: 22px; }
.lesson-v2 .lesson-head { max-width: 780px; }
.lesson-v2 .lesson-head h1 { font-size: clamp(2rem, 1.3rem + 2.8vw, 3rem); margin: 0.2em 0 0.4em; }
.lesson-meta { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.lesson-meta li { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 0.86rem; color: var(--muted); }
.lesson-meta b { color: var(--ink); font-weight: 600; }
.lesson-v2 .jump { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; font-size: inherit; }
.lesson-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 44px; align-items: start; }
.lesson-main { display: grid; gap: 30px; min-width: 0; max-width: 800px; }
.lesson-main > * { min-width: 0; }
.lesson-outline { position: sticky; top: calc(76px + env(safe-area-inset-top, 0px)); max-height: calc(100vh - 100px); overflow-y: auto; }
.outline-box summary { list-style: none; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 0 0 10px; cursor: default; }
.outline-box summary::-webkit-details-marker { display: none; }
.outline-label { font: 600 0.72rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.outline-now { font: 500 0.75rem var(--font-mono); color: var(--accent-strong); }
.outline-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; border-left: 2px solid var(--line); }
.outline-list a, .outline-quiz { display: grid; grid-template-columns: 1.9em minmax(0, 1fr); gap: 6px; padding: 6px 10px 6px 12px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: 0.88rem; line-height: 1.35; border-radius: 0 6px 6px 0; }
.outline-list a:hover, .outline-quiz:hover { color: var(--ink); background: var(--surface); }
.ol-n { font: 500 0.74rem var(--font-mono); padding-top: 2px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ol-part { font: 400 0.72rem var(--font-mono); color: var(--muted); }
.outline-list a.is-done .ol-n { color: var(--up); }
.outline-list a.is-current { color: var(--ink); font-weight: 600; border-left-color: var(--accent); background: var(--surface); }
.outline-list a.is-current .ol-n { color: var(--accent-strong); }
.outline-quiz { margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--accent-strong); font-weight: 600; }
.outline-quiz .ol-n { color: var(--accent-strong); }
@media (max-width: 1023px) {
  .lesson-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .lesson-main { max-width: none; }
  .lesson-outline { position: static; max-height: none; overflow: visible; }
  .outline-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
  .outline-box summary { padding: 12px 16px; cursor: pointer; align-items: center; }
  .outline-box summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: -4px 2px 0 6px; transition: transform .15s ease; }
  .outline-box[open] summary::after { transform: rotate(225deg); margin-top: 4px; }
  .outline-box summary .outline-now { margin-left: auto; }
  .outline-list { margin: 0 16px; }
  .outline-quiz { margin: 10px 16px 14px; }
}

/* ---------- lesson cards ---------- */
.lesson-v2 .deck { gap: 14px; scroll-margin-top: 80px; }
.lesson-v2 .deck-card { padding: 30px 34px 34px; border-radius: 16px; gap: 16px; box-shadow: 0 1px 0 var(--line), 0 20px 44px -34px rgba(21, 32, 43, .4); }
.lesson-v2 .deck.is-live .deck-card { min-height: 19rem; }
.lesson-v2 .card-h { font-size: clamp(1.35rem, 1.15rem + 0.8vw, 1.65rem); line-height: 1.2; }
.lesson-v2 .deck-card .prose { font-size: 1.06rem; line-height: 1.72; gap: 1em; }
.lesson-v2 .deck-card .lede { font-size: 1.15rem; color: var(--ink); line-height: 1.6; }
.deck-top-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.deck-top-row .deck-pos { flex: 1; min-width: 0; }
.deck-keys { margin: 0; font-size: 0.75rem; color: var(--muted); white-space: nowrap; display: flex; gap: 4px; align-items: center; }
.deck-keys kbd { font-size: 0.68rem; }
.lesson-v2 .deck-bar { height: 6px; gap: 4px; }
.deck-nav { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; }
.deck-peek { margin: 0; text-align: center; font-size: 0.84rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-inline: 6px; }
.deck-peek:empty { visibility: hidden; }
.quiz-deck .deck-nav { grid-template-columns: auto auto; justify-content: space-between; }
.lesson-v2 .disclaimer { background: var(--surface); border-style: solid; }
@media (hover: none), (max-width: 760px) { .deck-keys { display: none; } }
@media (max-width: 560px) {
  .lesson-v2 .deck-card { padding: 20px 18px 24px; }
  .deck-nav { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .deck-peek { display: none; }
}

/* ---------- quiz ---------- */
.lesson-v2 .quiz { border-top: 0; padding: 26px 28px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: inset 0 4px 0 var(--accent); scroll-margin-top: 76px; }
.lesson-v2 .quiz-head { margin-bottom: 18px; }
.lesson-v2 .quiz-head h2 { font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.6rem); margin: 6px 0 4px; }
.lesson-v2 .quiz-sub { margin: 0; }
.level-pills { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; align-items: stretch; margin-bottom: 20px; }
.level-pills .rung { display: grid; gap: 2px; align-content: start; padding: 10px 12px 11px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--ink); text-align: left; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.level-pills .rung:hover { border-color: var(--muted); }
.lp-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.lp-n { font: 600 0.72rem var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.level-pills .rung-bar { width: 22px; height: 22px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--line); color: var(--muted); box-shadow: none; }
.level-pills .rung-bar svg { width: 12px; height: 12px; }
.lp-name { font-weight: 650; font-size: 0.92rem; line-height: 1.25; }
.lp-status { font-size: 0.76rem; color: var(--muted); font-family: var(--font-mono); }
.level-pills .rung.is-open .rung-bar { background: var(--accent); color: var(--on-accent); }
.level-pills .rung.is-passed { background: var(--up-soft); border-color: color-mix(in srgb, var(--up) 45%, var(--line)); }
.level-pills .rung.is-passed .rung-bar { background: var(--up); color: var(--surface); }
.level-pills .rung.is-passed .lp-status { color: var(--up); }
.level-pills .rung.is-locked { border-style: dashed; background: transparent; }
.level-pills .rung.is-locked .lp-name { color: var(--muted); }
.level-pills .rung.is-gated { border-color: var(--accent); }
.level-pills .rung.is-gated .rung-bar { background: var(--accent-soft); color: var(--accent-strong); }
.level-pills .rung.is-gated .lp-status { color: var(--accent-strong); }
.level-pills .rung.is-current { border: 2px solid var(--accent); background: var(--accent-soft); box-shadow: none; }
.level-pills .rung.is-current .rung-bar { box-shadow: none; }
@media (max-width: 700px) {
  .level-pills { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(118px, 1fr); overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; }
  .level-pills .rung { scroll-snap-align: start; }
  .lesson-v2 .quiz { padding: 20px 16px 16px; }
}
.quiz-deck .deck-card { background: var(--surface-2); border-color: var(--line); box-shadow: none; padding: 24px 26px 26px; border-radius: 14px; }
.quiz-deck .q-text { font-size: 1.18rem; line-height: 1.45; }
.quiz-deck .choices { gap: 10px; }
.quiz-deck .choice { grid-template-columns: 32px minmax(0, 1fr); gap: 12px; align-items: center; min-height: 56px; padding: 12px 16px; font-size: 1rem; background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; }
.quiz-deck .choice:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.quiz-deck .choice .key { width: 30px; height: 30px; border-radius: 8px; font-weight: 600; background: var(--surface-2); }
.quiz-deck .choice:hover:not(:disabled) .key { border-color: var(--accent); color: var(--accent-strong); }
.choice-text { display: grid; gap: 4px; justify-items: start; }
.choice-tag { font: 600 0.7rem var(--font-mono); letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; }
.tag-right { background: var(--up); color: var(--surface); }
.tag-wrong { background: var(--down); color: var(--surface); }
.quiz-deck .choice.is-right { border-width: 2px; }
.quiz-deck .choice.is-wrong { border-width: 2px; }
.quiz-deck .choice.is-dim { opacity: .5; }
.quiz-deck .fb { border-width: 0 0 0 4px; border-style: solid; border-radius: 10px; padding: 14px 16px; }
.fb-title { display: flex; align-items: center; gap: 8px; font-size: 1.02rem; }
.fb-ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 0.8rem; color: var(--surface); }
.fb-ok .fb-ic { background: var(--up); } .fb-bad .fb-ic { background: var(--down); }
.quiz-deck .panel-facts { gap: 8px; }
.quiz-deck .panel-facts li { padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.quiz-deck .hint { margin: 0; }
.score-meter { position: relative; height: 10px; border-radius: 999px; background: var(--line); max-width: 360px; }
.sm-fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--down); }
.result.is-pass .sm-fill { background: var(--up); }
.sm-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.sm-note { margin: 0; font: 500 0.78rem var(--font-mono); color: var(--muted); }
.result .q-actions { margin-top: 6px; }
.quiz-deck .choice.is-right .key { background: var(--up); border-color: var(--up); color: var(--surface); }
.quiz-deck .choice.is-wrong .key { background: var(--down); border-color: var(--down); color: var(--surface); }
.lesson-v2 .quiz .deck-nav { background: linear-gradient(to bottom, transparent, var(--surface) 30%); }

.w-why .eyebrow { font-size: 0.75rem; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 14px; font-size: 0.92rem; }
.foot-nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.foot-nav a:hover { color: var(--accent-strong); text-decoration: underline; }
/* headings that receive focus only so screen readers announce them: no box needed */
.card-h[tabindex="-1"]:focus, .card-h[tabindex="-1"]:focus-visible, .result h3[tabindex="-1"]:focus-visible { outline: none; }
/* legal pages */
.info-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-size: 0.94rem; }
.info-table th, .info-table td { text-align: left; vertical-align: top; padding: 10px 14px; border-top: 1px solid var(--line); }
.info-table thead th { border-top: 0; background: var(--surface-2); font: 600 0.72rem var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.info-table tbody th { font-weight: 600; width: 32%; }
.info-table tbody tr:first-child th, .info-table tbody tr:first-child td { border-top: 0; }
.info-table thead + tbody tr:first-child th, .info-table thead + tbody tr:first-child td { border-top: 1px solid var(--line); }
.legal-page .g-section h3 { margin: 10px 0 0; font-size: 1.05rem; }
mark.fill-in { background: var(--accent-soft); color: var(--accent-strong); border: 1px dashed var(--accent); border-radius: 4px; padding: 0 4px; font-weight: 600; }
@media (max-width: 640px) {
  .info-table, .info-table tbody, .info-table tr, .info-table th, .info-table td { display: block; width: 100%; }
  .info-table thead { display: none; }
  .info-table tr { border-top: 1px solid var(--line); padding: 8px 0; }
  .info-table tbody tr:first-child { border-top: 0; }
  .info-table th, .info-table td { border: 0; padding: 4px 14px; }
  .info-table tbody th { width: 100%; }
}
.info-table td, .info-table th { font-family: var(--font-body); font-size: 0.94rem; letter-spacing: normal; text-transform: none; }
.info-table thead th { font: 600 0.72rem var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }

/* ---------- cookie consent ---------- */
.foot-link { background: none; border: 0; padding: 0; font: 500 0.92rem var(--font-body); color: var(--ink); cursor: pointer; }
.foot-link:hover { color: var(--accent-strong); text-decoration: underline; }
.consent-banner { position: fixed; z-index: 40; left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); margin-inline: auto; max-width: 980px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 50px -18px rgba(10, 16, 22, .45); animation: card-in-next .25s ease-out; }
.cb-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; padding: 18px 20px; }
.cb-text { flex: 1 1 420px; min-width: 0; }
.cb-text p { margin: 0; font-size: 0.93rem; color: var(--muted); }
.cb-text .cb-title { font: 700 1rem var(--font-display); color: var(--ink); margin-bottom: 4px; }
.cb-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cb-actions .btn { min-height: 42px; }
body.has-consent-banner .deck-nav { padding-bottom: 0; }
.consent-cats { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.consent-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.consent-copy { display: grid; gap: 2px; }
.consent-copy span { font-size: 0.86rem; color: var(--muted); }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .15s ease; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s ease; }
.switch input:checked + span { background: var(--up); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:disabled + span { opacity: .6; }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.consent-btns { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 560px) {
  .cb-inner { padding: 16px; }
  .cb-actions { width: 100%; }
  .cb-actions .btn { flex: 1 1 auto; }
  .consent-btns .btn { flex: 1 1 100%; }
}

/* ---------- Research Library ---------- */
.research-head { max-width: 820px; }
.rs-how { max-width: 820px; margin: 8px 0 26px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.rs-how h2 { font-size: 1.05rem; margin: 0 0 8px; }
.rs-how ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.rs-grid { list-style: none; padding: 0; margin: 0 0 28px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; }
.rs-card { display: flex; flex-direction: column; gap: 8px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); scroll-margin-top: 80px; }
.rs-card:target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.rs-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tag-ready { color: var(--up); }
.rs-title { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.25; margin: 2px 0 2px; }
.rs-card p { margin: 0; font-size: 0.93rem; line-height: 1.5; }
.rs-label { display: block; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.rs-catch { padding-top: 8px; border-top: 1px dashed var(--line); }
.rs-foot { margin-top: auto; padding-top: 6px; }
.rs-soon { font-size: 0.86rem; color: var(--muted); }
.btn-small { min-height: 40px; padding: 8px 14px; font-size: 0.9rem; }
.research-card { margin: 0 0 18px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--radius); }
.rc-eyebrow { margin: 0 0 8px; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-strong); }
.research-card dl { margin: 0; display: grid; gap: 8px; }
.rc-row { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr); gap: 4px 14px; }
.rc-row dt { font-size: 0.86rem; font-weight: 600; color: var(--muted); }
.rc-row dd { margin: 0; font-size: 0.93rem; line-height: 1.5; }
.rc-note { margin: 12px 0 0; font-size: 0.84rem; color: var(--muted); }
@media (max-width: 560px) { .rc-row { grid-template-columns: minmax(0, 1fr); } }
/* With five sections the phone header can't fit every link: let the menu scroll sideways instead of overflowing */
@media (max-width: 480px) {
  .topbar .nav { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .topbar .nav::-webkit-scrollbar { display: none; }
  .topbar .nav a { flex: none; white-space: nowrap; }
}
.research-promo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin: 8px 0 28px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-left: 0; border-radius: var(--radius); box-shadow: inset 0 3px 0 var(--accent); }
.research-promo > div { flex: 1 1 420px; min-width: 0; }
.research-promo .eyebrow { margin: 0 0 4px; }
.rp-t { margin: 0 0 4px; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.rp-d { margin: 0; color: var(--muted); font-size: 0.94rem; }
.w-features { grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
@media (max-width: 1000px) { .w-features { grid-template-columns: repeat(2, minmax(0, 1fr)); } .w-features li:last-child:nth-child(odd) { grid-column: 1 / -1; } }
@media (max-width: 640px) { .w-features { grid-template-columns: minmax(0, 1fr); } }

/* numbered steps inside guides */
.step-list { margin: 0; padding-left: 1.4em; display: grid; gap: 10px; }
.step-list li { max-width: 68ch; padding-left: 4px; }
.step-list li::marker { font-family: var(--font-mono); font-weight: 600; color: var(--accent); }

/* all quiz questions, readable without JavaScript */
.quiz-all { max-width: 760px; margin: 18px auto 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 0 18px; }
.quiz-all > summary { cursor: pointer; padding: 14px 0; font-weight: 600; color: var(--ink); min-height: 44px; }
.quiz-all[open] { padding-bottom: 16px; }
.quiz-all-note { color: var(--muted); margin: 0 0 8px; font-size: 0.92rem; }
.qa-level h3 { font-family: var(--font-display); font-size: 1.02rem; margin: 18px 0 8px; }
.qa-level ol { margin: 0; padding-left: 1.4em; display: grid; gap: 12px; }
.qa-level li p { margin: 0; }
.qa-choices { margin: 6px 0 0; padding-left: 1.1em; color: var(--muted); list-style: lower-alpha; display: grid; gap: 2px; }
.qa-kind { color: var(--muted); font-size: 0.9rem; margin-top: 4px !important; }

/* ---------- placement quiz (level-quiz.html) and rung pages ---------- */
.placement { max-width: 760px; margin: 0 auto; padding: 40px var(--gutter-r) 64px var(--gutter-l); }
.placement h1 { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 2.8rem); line-height: 1.08; margin: 6px 0 12px; letter-spacing: -0.02em; }
.hero-level { margin: 14px 0 0; font-size: 0.95rem; color: var(--muted); }
.hero-level a { color: var(--accent); font-weight: 600; }
.pq-last { background: var(--accent-soft); border-radius: var(--radius); padding: 12px 16px; margin: 0 0 18px; }
.pq-last a { color: var(--accent-strong); font-weight: 600; }
.pq-form { display: grid; gap: 14px; margin-top: 22px; }
.pq-q { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 16px 18px 14px; margin: 0; min-width: 0; }
.pq-q legend { display: flex; gap: 10px; align-items: baseline; font-weight: 600; padding: 0; float: left; width: 100%; margin-bottom: 12px; }
.pq-q legend + * { clear: both; }
.pq-num { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent); flex: none; }
.pq-choices { display: grid; gap: 6px; }
.pq-choice { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; min-height: 44px; background: var(--surface-2); }
.pq-choice input { margin-top: 4px; accent-color: var(--accent); flex: none; }
.pq-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pq-skip { color: var(--muted); font-size: 0.93rem; }
.pq-q.right { border-color: var(--up); }
.pq-q.wrong { border-color: var(--down); }
.marked .pq-choice.is-answer { border-color: var(--up); background: var(--up-soft); }
.pq-why { margin: 10px 0 0; font-size: 0.94rem; }
.pq-q.right .pq-why b { color: var(--up); }
.pq-q.wrong .pq-why b { color: var(--down); }
.pq-missing { color: var(--down); font-weight: 600; margin: 0; }
.pq-actions { display: flex; justify-content: flex-start; }
.pq-result { margin: 28px 0 8px; outline: none; }
.pq-card { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; background: #0C1218; color: #F6F3EC; border-radius: 16px; padding: 26px 28px; }
.pq-card .eyebrow { color: #E2A945; }
.pq-card h1, .pq-card h2 { font-family: var(--font-display); color: #F6F3EC; margin: 4px 0 6px; font-size: clamp(1.6rem, 4.5vw, 2.3rem); line-height: 1.1; }
.pq-card p { margin: 0 0 8px; color: #C9D1D9; }
.pq-card .pq-short { color: #E2A945; font-weight: 600; }
.pq-ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; min-width: 190px; }
.pq-ladder li { display: flex; gap: 10px; align-items: center; padding: 6px 12px; border-radius: 8px; border: 1px solid rgba(246, 243, 236, 0.16); color: #95A2B1; font-size: 0.9rem; }
.pq-ladder li.below { color: #C9D1D9; border-color: rgba(226, 169, 69, 0.35); }
.pq-ladder li.on { background: #E2A945; border-color: #E2A945; color: #1A1205; font-weight: 700; }
.pq-rn { font-family: var(--font-mono); width: 1.2em; text-align: center; }
.pq-rungs .pq-ladder li { color: var(--muted); border-color: var(--line); }
.pq-next { margin: 8px 0 18px; padding-left: 1.4em; display: grid; gap: 6px; }
.pq-next a { color: var(--accent); font-weight: 600; }
.pq-share { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.pq-review-note { color: var(--muted); font-size: 0.92rem; }
.pq-rungs { margin-top: 48px; border-top: 1px solid var(--line); padding-top: 24px; }
.pq-rungs h2, .rung-page h2 { font-family: var(--font-display); font-size: 1.3rem; }
.pq-rungs > .pq-ladder { display: none; }
.pq-rung-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.pq-rung-list a { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; }
.pq-rung-list a span { color: var(--muted); font-size: 0.93rem; }
.rung-page .pq-card { margin-top: 14px; }
.pq-cta { margin-top: 28px; padding: 20px; border-radius: var(--radius); background: var(--accent-soft); display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.pq-cta p { margin: 0; }
@media (max-width: 640px) {
  .pq-card { grid-template-columns: 1fr; padding: 22px 18px; }
  .pq-ladder { min-width: 0; }
  .pq-share .btn { flex: 1 1 calc(50% - 8px); justify-content: center; }
}
.pq-result h3, .rung-page h2 { margin: 24px 0 6px; font-family: var(--font-display); }

/* loading states */
.spinner { display: inline-block; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -0.15em; margin-right: 8px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
.quiz-loading { color: var(--muted); margin: 12px 0 0; }
.btn.is-busy::before { content: ""; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.gate-terms { margin-top: 10px; }
.gate-welcome-link { margin-top: 12px; text-align: center; }

/* sticky quiz bar on lesson pages (phones only) */
.quiz-bar { display: none; }
@media (max-width: 760px) {
  .quiz-bar:not([hidden]) { display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 25;
    align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 10px 16px; border-radius: 14px;
    background: #0C1218; color: #F6F3EC; text-decoration: none; box-shadow: 0 8px 24px rgba(0,0,0,.28); font-size: 0.92rem; }
  .quiz-bar-cta { color: #E2A945; font-weight: 700; white-space: nowrap; }
  .is-app .quiz-bar:not([hidden]) { bottom: calc(var(--tabbar-h, 58px) + 10px + env(safe-area-inset-bottom, 0px)); }
}

/* 404 page */
.notfound { max-width: 860px; margin: 0 auto; padding: 56px var(--gutter-r) 72px var(--gutter-l); }
.notfound h1 { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3rem); line-height: 1.05; margin: 6px 0 12px; }
.nf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; margin-top: 36px; }
.nf-grid h2 { font-family: var(--font-display); font-size: 1.15rem; margin: 0 0 10px; }
.nf-list { margin: 0; padding-left: 1.1em; display: grid; gap: 8px; }
.nf-list a { color: var(--accent); font-weight: 600; }

/* account deletion */
.acct-delete { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.acct-delete > summary { cursor: pointer; color: var(--down); font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.acct-deleted { background: var(--up-soft); border-radius: var(--radius); padding: 12px 16px; }

/* ---------- calculators ---------- */
.calc-page { max-width: 1000px; margin: 0 auto; padding: 40px var(--gutter-r) 64px var(--gutter-l); }
.calc-page h1 { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 2.7rem); line-height: 1.08; margin: 6px 0 12px; letter-spacing: -0.02em; }
.calc-page .lede { max-width: 68ch; }
.calc-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; margin-top: 24px; align-items: start; }
.calc-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 14px; }
.calc-field label { display: block; font-weight: 600; font-size: 0.93rem; margin-bottom: 6px; }
.calc-input { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.calc-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.calc-input input { flex: 1 1 auto; min-width: 0; border: 0; background: transparent; color: var(--ink); font: 600 1.05rem var(--font-mono); padding: 10px 12px; min-height: 44px; outline: none; }
.calc-unit { display: flex; align-items: center; padding: 0 12px; color: var(--muted); font-size: 0.9rem; background: var(--surface); }
.calc-unit.pre { border-right: 1px solid var(--line); } .calc-unit.post { border-left: 1px solid var(--line); white-space: nowrap; }
.calc-note { margin: 0; color: var(--muted); font-size: 0.88rem; }
.cx-out { background: #0C1218; color: #F6F3EC; border-radius: 16px; padding: 22px 24px; min-height: 220px; }
.cx-out .eyebrow { color: #E2A945; margin: 0 0 4px; }
.cx-out .co-gap { margin-top: 18px; }
.co-big { font-family: var(--font-display); font-size: clamp(1.4rem, 3.6vw, 1.9rem); line-height: 1.15; margin: 0 0 12px; color: #F6F3EC; }
.co-sub { color: #C9D1D9; font-size: 0.95rem; margin: 10px 0 0; }
.co-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: rgba(246, 243, 236, 0.12); }
.co-bar .b-shares { background: #E2A945; } .co-bar .b-bonds { background: #74A8DC; } .co-bar .b-cost { background: #EF716A; }
.co-verdict { margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; font-weight: 600; }
.co-verdict.ok { background: rgba(69, 188, 128, 0.16); color: #8FE0B5; } .co-verdict.act { background: rgba(226, 169, 69, 0.16); color: #F0BE63; }
.co-steps { margin: 6px 0 0; padding-left: 1.2em; display: grid; gap: 6px; color: #E3E8EE; }
.co-steps b { color: #F6F3EC; }
.co-list { margin: 14px 0 0; display: grid; gap: 0; }
.co-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid rgba(246, 243, 236, 0.12); }
.co-row dt { color: #C9D1D9; } .co-row dd { margin: 0; font-family: var(--font-mono); font-weight: 600; white-space: nowrap; }
.co-row.co-strong dd { color: #E2A945; }
.co-msg { color: #C9D1D9; }
.calc-loading { color: #C9D1D9; }
.calc-how { max-width: 72ch; margin-top: 36px; }
.calc-how h2, .calc-more h2 { font-family: var(--font-display); font-size: 1.3rem; }
.calc-disclaimer { color: var(--muted); font-size: 0.9rem; }
.calc-more { margin-top: 28px; }
.calc-cards { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.calc-cards a { display: grid; gap: 6px; height: 100%; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; }
.cc-t { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; } .cc-d { color: var(--muted); } .cc-cta { color: var(--accent); font-weight: 600; margin-top: auto; }
.calc-promo { max-width: 760px; margin: 24px auto; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; padding: 18px 20px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid var(--line); }
.calc-promo .eyebrow { margin: 0; } .calc-promo .rp-t { font-weight: 700; margin: 2px 0; } .calc-promo .rp-d { margin: 0; color: var(--muted); }
@media (max-width: 760px) { .calc-wrap { grid-template-columns: 1fr; } .cx-out { min-height: 0; } }
.gate-captcha:empty { display: none; } .gate-captcha { margin: 0 20px 16px; display: flex; justify-content: center; }

/* ---------- teaching aids inside lesson cards (worked examples, tables, comparisons, flows, data charts) ---------- */
.aid-wrap { margin: 16px 0; }
.aid { display: grid; gap: 10px; }
.aid .aid-t { margin: 0; font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-strong); }
.aid figcaption { margin-top: 0; }
.tone-up { --tone: var(--up); --tone-soft: var(--up-soft); } .tone-down { --tone: var(--down); --tone-soft: var(--down-soft); }
.tone-accent { --tone: var(--accent); --tone-soft: var(--accent-soft); } .tone-blue { --tone: var(--ln-1); --tone-soft: color-mix(in srgb, var(--ln-1) 14%, var(--surface)); }
.tone-muted { --tone: var(--muted); --tone-soft: var(--surface-2); }
.wk { margin: 0; display: grid; gap: 0; font-size: 0.95rem; }
.wk-row { display: flex; justify-content: space-between; gap: 14px; padding: 8px 2px; border-bottom: 1px dashed var(--line); }
.wk-row dt { color: var(--ink); } .wk-row dd { margin: 0; font-family: var(--font-mono); font-weight: 500; text-align: right; white-space: nowrap; }
.wk-row[class*="tone-"] dd { color: var(--tone); }
.wk-total { border-bottom: 0; border-top: 2px solid var(--ink); margin-top: 2px; font-weight: 700; }
.wk-total dd { font-weight: 700; }
.aid-scroll { overflow-x: auto; }
.aid-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.aid-table th, .aid-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.aid-table thead th { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.aid-table tbody th { font-weight: 600; }
.aid-table tr.is-hl { background: var(--accent-soft); }
.cmp { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.cmp-col { border: 1px solid var(--line); border-top: 4px solid var(--tone, var(--line)); border-radius: 8px; padding: 10px 12px; background: var(--tone-soft, var(--surface-2)); }
.cmp-h { margin: 0 0 6px; font-weight: 700; }
.cmp-col ul { margin: 0; padding-left: 1.1em; display: grid; gap: 4px; font-size: 0.93rem; }
.flow { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.flow-step { position: relative; flex: 1 1 130px; display: grid; gap: 2px; align-content: start; padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--tone, var(--accent)); border-radius: 8px; background: var(--surface-2); font-size: 0.93rem; }
.flow-step:not(:last-child)::after { content: "→"; position: absolute; right: -18px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.flow-n { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); }
.flow-t { font-weight: 600; } .flow-d { color: var(--muted); font-size: 0.88rem; }
@media (max-width: 560px) { .flow { flex-direction: column; gap: 18px; } .flow-step:not(:last-child)::after { content: "↓"; right: auto; left: 18px; top: auto; bottom: -18px; transform: none; } }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hb { display: grid; grid-template-columns: minmax(90px, 34%) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 0.92rem; }
.hb-track { position: relative; height: 16px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.hb-fill { position: absolute; top: 0; bottom: 0; left: 0; background: var(--tone, var(--accent)); border-radius: 4px; }
.has-neg .hb-track::before { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--muted); }
.hb-v { font-family: var(--font-mono); font-size: 0.86rem; font-weight: 500; min-width: 4.5em; text-align: right; }
@media (max-width: 480px) { .hb { grid-template-columns: 1fr auto; } .hb-track { grid-column: 1 / -1; grid-row: 2; } }
.viz .ln-dash { stroke-dasharray: 6 5; }
.sc { position: relative; padding: 26px 0 22px; }
.sc-bar { position: relative; height: 26px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); }
.sc-zone { position: absolute; top: 0; bottom: 0; background: var(--tone-soft, var(--surface-2)); border-left: 1px solid var(--line); display: grid; place-items: center; font-size: 0.76rem; color: var(--tone, var(--muted)); font-weight: 600; overflow: hidden; }
.sc-mark { position: absolute; top: -8px; bottom: -8px; width: 2px; background: var(--tone, var(--ink)); }
.sc-mark > span { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); white-space: nowrap; font-family: var(--font-mono); font-size: 0.74rem; padding-bottom: 2px; }
.sc-mark.sc-low > span { bottom: auto; top: 100%; padding: 2px 0 0; }
.sc-end { position: absolute; bottom: 0; font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); } .sc-a { left: 0; } .sc-b { right: 0; }

/* ---------- quiz: level briefing, help, calculator, teaching feedback, summary, feedback form ---------- */
.lv-what { margin: 0; }
.lv-brief { border-left: 3px solid var(--accent); padding: 4px 0 4px 12px; }
.lv-brief-h, .lv-sum-h, .q-ref-h, .fb-steps-h { margin: 0 0 4px; font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.lv-brief ul, .lv-sum ul, .lv-miss ul { margin: 0; padding-left: 1.15em; display: grid; gap: 4px; }
.q-help { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.q-help-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 500 0.88rem/1.2 var(--font-body); cursor: pointer; }
.q-help-btn:hover:not(:disabled) { border-color: var(--accent); }
.q-help-btn:disabled { opacity: .7; cursor: default; }
.q-help-btn[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--accent); }
.q-cost { font-family: var(--font-mono); font-size: 0.74rem; color: var(--accent-strong); }
.q-clue { background: var(--accent-soft); border-radius: 8px; padding: 10px 14px; outline: none; }
.q-clue p { margin: 0; }
.q-ref { border: 1px solid var(--line); border-left: 4px solid var(--ln-1); border-radius: 8px; padding: 10px 14px; background: var(--surface-2); outline: none; font-size: 0.95rem; }
.q-ref p { margin: 0 0 8px; } .q-ref .q-ref-open { margin: 0; font-size: 0.88rem; }
.q-ref .rule-grid { grid-template-columns: 1fr; }
.fb .q-ref { margin-top: 8px; background: var(--surface); }
.fb-why { margin: 0 0 6px; }
.fb-answer { margin: 0 0 6px; }
.fb-working { margin-top: 8px; padding-top: 8px; border-top: 1px dashed color-mix(in srgb, currentColor 25%, transparent); }
.fb-working summary { cursor: pointer; font-weight: 600; font-size: 0.92rem; }
.fb-steps { margin: 4px 0 0; padding-left: 1.3em; display: grid; gap: 4px; }
.fb-steps li { padding-left: 2px; }
.qcalc { border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: var(--surface-2); display: grid; gap: 8px; max-width: 320px; }
.qcalc-in { width: 100%; min-height: 44px; padding: 8px 10px; font: 500 1.05rem var(--font-mono); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.qcalc-res { margin: 0; font-family: var(--font-mono); min-height: 1.4em; text-align: right; }
.qcalc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.qk { min-height: 44px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 1.05rem var(--font-mono); cursor: pointer; }
.qk:active { transform: translateY(1px); }
.qk-op { background: var(--accent-soft); } .qk-fn { color: var(--down); }
.qcalc-use { justify-self: stretch; }
.unit-pre { font-family: var(--font-mono); font-weight: 600; }
.lv-sum, .lv-miss { text-align: left; border-top: 1px solid var(--line); padding-top: 10px; }
.sum-link { font-size: 0.86rem; white-space: nowrap; }
.qfb { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: var(--surface-2); text-align: left; }
.qfb summary { cursor: pointer; font-weight: 600; }
.qfb-form { display: grid; gap: 8px; margin-top: 10px; }
.qfb-form fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 6px; }
.qfb-form legend { font-size: 0.9rem; color: var(--muted); margin-bottom: 4px; }
.qfb-opt { display: flex; gap: 8px; align-items: flex-start; font-size: 0.93rem; }
.qfb-opt input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.qfb-c { font-size: 0.9rem; font-weight: 600; }
.qfb-form textarea { width: 100%; padding: 8px 10px; font: 0.95rem var(--font-body); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; resize: vertical; }
.qfb-note { margin: 0; font-size: 0.82rem; color: var(--muted); }
.qfb-err { margin: 0; color: var(--down); font-size: 0.88rem; }
.qfb-done p { margin: 0; }
.back-to-q { position: fixed; z-index: 40; left: 50%; transform: translateX(-50%); bottom: max(16px, env(safe-area-inset-bottom, 0px)); box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.back-to-q[hidden] { display: none; }
.aid-table td { font-family: var(--font-body); color: var(--ink); text-align: left; }
@media (max-width: 560px) { .flow-step { flex: 0 0 auto; } }
.wk-row dt { flex: 1 1 auto; min-width: 0; }
.wk-row dd { white-space: normal; max-width: 55%; overflow-wrap: anywhere; }
.aid-line svg text { font-size: 15px; }
.sc-mark.sc-l > span { left: 0; transform: none; }
.sc-mark.sc-r > span { left: auto; right: 0; transform: none; }
.sc-zone > span { padding: 0 4px; white-space: nowrap; }
.wk-total dd { white-space: nowrap; overflow-wrap: normal; }
