/* style.css — First Paycheck
   Art direction: printed pay stubs and check paper. Warm cream paper, warm black
   ink, and ONE accent: copper, like your first penny. The copper is punctuation
   (dots, the progress bar, tiny labels), never a background.

   Two type scales: huge, calm, sentence-case headlines, and tiny monospace labels
   that read like a pay stub printout.

   All colors live in these tokens, so the whole look changes from one place. */

/* ---------- Fonts (served from /fonts, both under the SIL Open Font License) ---------- */

@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/schibsted-grotesk-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/schibsted-grotesk-latin-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(../fonts/schibsted-grotesk-latin-500-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(../fonts/schibsted-grotesk-latin-ext-500-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/jetbrains-mono-latin-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(../fonts/jetbrains-mono-latin-500-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(../fonts/jetbrains-mono-latin-ext-500-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

:root {
  --paper: oklch(95.5% 0.018 85);
  --paper-2: oklch(92% 0.022 82);
  --card: oklch(98.5% 0.008 85);
  --ink: oklch(20% 0.015 60);
  --muted: oklch(45% 0.02 65);
  --line: oklch(87% 0.02 80);
  --panel: oklch(17% 0.018 55);
  --panel-ink: oklch(93% 0.02 85);
  --copper: oklch(58% 0.13 48);
  --copper-ink: oklch(50% 0.12 45); /* copper for small text: 5.5:1 contrast on paper */

  /* Status colors: money you keep / money you owe */
  --good: oklch(48% 0.11 155);
  --owe: oklch(50% 0.16 30);
  --warn-bg: oklch(93% 0.05 85);
  --warn-text: oklch(42% 0.09 70);

  /* Data colors (charts and bars only, never text) */
  --c-net: #1f9d5c;
  --c-federal: #3b5bdb;
  --c-ss: #8e5cd9;
  --c-medicare: #c2459c;
  --c-state: #e8793a;
  --c-city: #d9a91a;
  --c-small: #9a9486;
  --c-needs: #3b5bdb;
  --c-wants: #e8793a;
  --c-save: #1f9d5c;
  --chart-growth: #1f9d5c;
  --chart-input: #3b5bdb;

  --radius: 24px;
  --gutter: clamp(16px, 3.4vw, 44px);
  --font: "Schibsted Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-weight: 400; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
button { font-family: inherit; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--copper); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; border-radius: 2px; }

/* Hidden until a keyboard user presses Tab on arrival. */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}
.skip-link:focus { top: 12px; }
#main:focus { outline: none; }
.noscript { margin: 0; padding: 14px var(--gutter); background: var(--warn-bg); color: var(--warn-text); }

/* ---------- The two type scales ---------- */

.display {
  font-size: clamp(44px, 7.5vw, 120px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.035em;
  margin: 0;
}
.annotation, .index, .scroll-cue, .pill, .paystub-kicker, .panel-label, .sub-index, .story-step, .ledger dt {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.annotation { max-width: 30ch; color: var(--muted); line-height: 1.6; margin: 0; }
.split-line { overflow: hidden; }

/* ---------- Nav ---------- */

.nav {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 26px var(--gutter);
}
.wordmark {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.nav-statement { font-size: clamp(16px, 1.6vw, 22px); max-width: 36ch; line-height: 1.3; margin: 0; }
.nav-actions { display: flex; gap: 10px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 999px;
  border: 0;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.pill .dot { color: var(--copper); font-size: 1.4em; line-height: 0; }
.pill.light { background: var(--panel-ink); color: var(--panel); }
.ghost-pill { background: transparent; color: inherit; box-shadow: inset 0 0 0 1px currentColor; }
.pill:focus-visible, .job:focus-visible, .story-option:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }

@media (max-width: 760px) {
  .nav-statement { display: none; }
}

/* ---------- Hero ---------- */

.hero { padding: 4px var(--gutter) 0; }
.hero-title {
  font-size: clamp(34px, 5.4vw, 80px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  max-width: 17ch;
  margin: 2vh 0 4vh;
}
.hero-panel {
  position: relative;
  height: min(72vh, 720px);
  min-height: 440px;
  background: var(--panel);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--panel-ink);
}
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; }
.mark { position: absolute; font-size: 13px; opacity: 0.55; z-index: 2; pointer-events: none; }
.mark.tl { top: 10px; left: 12px; } .mark.tr { top: 10px; right: 12px; }
.mark.bl { bottom: 8px; left: 12px; } .mark.br { bottom: 8px; right: 12px; }
.panel-label { position: absolute; margin: 0; opacity: 0.8; z-index: 2; pointer-events: none; text-shadow: 0 1px 8px var(--panel), 0 0 2px var(--panel); }
.panel-label.tl { top: 28px; left: 32px; }
.panel-label.br { bottom: 28px; right: 32px; text-align: right; }
.hero-actions { position: absolute; left: 32px; bottom: 28px; display: flex; gap: 10px; flex-wrap: wrap; z-index: 3; }
.scroll-cue { text-align: center; color: var(--muted); padding: 18px 0 0; margin: 0; }

@media (max-width: 760px) {
  .panel-label.br { display: none; }
  .hero-actions { left: 20px; right: 20px; bottom: 20px; }
  .panel-label.tl { left: 20px; top: 20px; }
}

/* ---------- Section heads ---------- */

.section-head {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 8px 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 22vh var(--gutter) 6vh;
}
.section-head.inset { padding: 0 0 2vh; max-width: none; margin: 0; }
.section-head .index { align-self: start; color: var(--copper-ink); margin: 0; }
.section-head .annotation { text-align: right; justify-self: end; }
.section-head::before, .section-head::after {
  content: "+";
  position: absolute;
  top: calc(22vh - 36px);
  font-size: 13px;
  opacity: 0.45;
}
.section-head::before { left: var(--gutter); }
.section-head::after { right: var(--gutter); }
.section-head.inset::before, .section-head.inset::after { display: none; }
@media (max-width: 760px) {
  .section-head { grid-template-columns: 1fr; }
  .section-head .annotation { text-align: left; justify-self: start; }
}

/* ---------- Layout ---------- */

.simulator {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.results { display: grid; gap: 24px; position: sticky; top: 16px; }
@media (max-width: 900px) {
  .simulator { grid-template-columns: minmax(0, 1fr); }
  .results { position: static; }
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 2.4vw, 32px);
}

.sub { display: flex; align-items: baseline; gap: 12px; font-size: 22px; letter-spacing: -0.01em; margin: 0 0 16px; }
.sub:not(:first-child) { margin-top: 36px; }
.sub-index { color: var(--copper-ink); }

/* ---------- Controls ---------- */

.job-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.job {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.2s, background 0.2s;
}
.job:hover { transform: translateY(-3px); }
.job.selected { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.job.selected .career-meta { color: color-mix(in oklch, var(--paper) 70%, transparent); }
.job-icon { font-size: 1.5rem; }
.job-title { font-weight: 500; font-size: 0.95rem; line-height: 1.25; }
.job-tag { position: absolute; top: 10px; right: 12px; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--copper-ink); }

.field { display: block; border: 0; padding: 0; margin: 0 0 24px; }
.field > span, legend { display: block; font-weight: 500; margin-bottom: 10px; }
.hint { display: block; color: var(--muted); margin-top: 6px; font-size: 0.88rem; }

.segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.segmented label {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.92rem;
  background: var(--paper);
  transition: background 0.2s, color 0.2s;
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--copper); outline-offset: 2px; }

.money-input {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 180px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 1.15rem;
}
.money-input input { width: 100%; border: 0; background: transparent; color: var(--ink); font: inherit; outline: none; }

input[type="range"] { width: 100%; accent-color: var(--ink); }

.warning { background: var(--warn-bg); color: var(--warn-text); padding: 12px 14px; border-radius: 12px; font-size: 0.92rem; margin: 0; }

/* ---------- Pay stub (styled like the real thing: dashed perforations, printout type) ---------- */

.paystub { font-size: 0.95rem; }
.paystub-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 14px;
  margin-bottom: 14px;
}
.paystub-kicker { color: var(--muted); margin: 0 0 6px; }
.paystub-job { font-weight: 500; font-size: 1.1rem; margin: 0; }
.paystub-period { font-family: var(--font-mono); font-size: 0.85rem; color: var(--muted); margin: 0; }

.stub-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.stub-lines { list-style: none; margin: 0; padding: 0 0 10px; border-bottom: 1px dashed var(--line); }
.stub-lines .mono { color: var(--muted); }
.stub-note { color: var(--muted); font-size: 0.88rem; padding: 4px 0; }
.stub-gross { font-weight: 500; }
.stub-net { font-weight: 500; font-size: 1.1rem; padding-top: 14px; align-items: baseline; }
.stub-net .mono { font-size: clamp(1.7rem, 3.4vw, 2.3rem); color: var(--ink); }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; }
.pill .dot { width: auto; height: auto; margin: 0; }

.where { margin-top: 22px; }
.where-title { font-weight: 500; margin: 0 0 8px; }
.where-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; gap: 2px; }
.where-bar span { flex-basis: 0; min-width: 2px; transition: flex-grow 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.where-legend {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 4px 16px;
  font-size: 0.85rem;
  color: var(--muted);
}
.where-legend strong { color: var(--ink); font-family: var(--font-mono); font-weight: 500; margin-left: 4px; }

/* ---------- Tax time ---------- */

.tax-headline { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.03em; line-height: 1.05; margin: 4px 0 6px; color: var(--good); }
.tax-headline.owe { color: var(--owe); }
.tax-sub { color: var(--muted); margin: 0 0 16px; }
.tax-explain { margin: 0; padding-left: 18px; display: grid; gap: 10px; }
.tax-explain li::marker { color: var(--copper); }

.method summary { cursor: pointer; font-weight: 500; }
.method p { color: var(--muted); font-size: 0.9rem; }

/* ---------- First visit: the growing "Start my story" button ---------- */

/* A tall section with a pinned center. motion.js grows --grow from 0 to 1 as you scroll. */
.locked { position: relative; height: 190vh; --grow: 1; }
.locked-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: calc(16px + var(--grow) * 16px);
  padding: 0 var(--gutter);
  text-align: center;
}
.big-cta {
  font-size: calc(12px + var(--grow) * clamp(14px, 3.4vw, 40px));
  padding: calc(14px + var(--grow) * 22px) calc(22px + var(--grow) * clamp(8px, 3vw, 44px));
  max-width: 100%;
  letter-spacing: 0.02em;
  box-shadow: 0 calc(var(--grow) * 24px) calc(var(--grow) * 60px) oklch(20% 0.02 60 / 0.18);
}
.locked-note { max-width: none; opacity: calc(0.4 + var(--grow) * 0.6); }
.locked-hint { max-width: 44ch; margin: 0; color: var(--muted); opacity: var(--grow); }
.locked[hidden] { display: none; }

/* ---------- Dashboard: "Your plan" ---------- */

.dashboard { max-width: 1280px; margin: 0 auto; padding: 18vh var(--gutter) 0; display: grid; gap: 20px; }
.dash-path { font-size: clamp(1.4rem, 3vw, 2.2rem); letter-spacing: -0.02em; line-height: 1.15; margin: 4px 0 8px; }
.dash-path .arrow { color: var(--copper-ink); }
.dash-path-meta { color: var(--muted); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }
.dash-whatif { position: sticky; top: 16px; }
@media (max-width: 900px) { .dash-whatif { position: static; } }
.select.wide { width: 100%; padding: 10px 12px; }
.check.disabled { opacity: 0.45; }

.stats.dash-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .stats.dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat-note { margin: 4px 0 0; color: var(--muted); font-size: 0.8rem; }
.dash-insights { padding-left: 18px; margin: 4px 0 0; }
.month-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; margin-bottom: 12px; }
.month-table th { text-align: left; font-weight: 400; padding: 7px 0; }
.month-table td { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; padding: 7px 0; color: var(--muted); white-space: nowrap; }
.month-table tr { border-bottom: 1px dashed var(--line); }
.month-table .month-pay th, .month-table .month-pay td { font-weight: 500; color: var(--ink); }
.month-table .month-invest td { color: var(--good); }
.month-table .month-left { border-bottom: 0; }
.month-table .month-left th, .month-table .month-left td { font-weight: 500; color: var(--ink); font-size: 1.1rem; padding-top: 12px; }
.month-table .month-left.short th, .month-table .month-left.short td { color: var(--owe); }
.story .month-table { max-width: 640px; }
.dash-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

.story-options.welcome-options { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); max-width: 640px; }
.story-options.welcome-options .story-option { padding: 24px; }

/* ---------- Budget builder ---------- */

.budget, .life { max-width: 1280px; margin: 0 auto; padding: 22vh var(--gutter) 0; }
.budget-head { margin-bottom: 24px; }
.budget-lede { font-size: clamp(1.05rem, 1.5vw, 1.3rem); max-width: 46ch; margin: 18px 0 12px; }
.budget-lede strong { font-weight: 500; }

.budget-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.budget-groups { display: grid; gap: 16px; }
.budget-side { display: grid; gap: 24px; position: sticky; top: 16px; }
@media (max-width: 900px) {
  .budget-grid { grid-template-columns: minmax(0, 1fr); }
  .budget-side { position: static; }
}

.budget-group { position: relative; overflow: hidden; }
.budget-group::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--group-color); }
.group-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.group-head h3 { font-size: 1.3rem; letter-spacing: -0.01em; margin: 0; }
.group-head .hint { margin: 2px 0 0; }
.group-total { font-family: var(--font-mono); font-size: 1.1rem; margin: 0; }

.category { display: block; padding: 8px 0; }
.category-top { display: flex; justify-content: space-between; gap: 12px; font-size: 0.93rem; margin-bottom: 4px; }
.category-top .mono { color: var(--muted); white-space: nowrap; }
.category input[type="range"] { accent-color: var(--group-color); }

.budget-left { font-size: clamp(2.2rem, 5vw, 3.2rem); letter-spacing: -0.02em; margin: 0 0 16px; }
.budget-left.over { color: var(--owe); }
.budget-left.done { color: var(--good); }
.compare { margin-bottom: 18px; }
.compare-label { font-size: 0.85rem; color: var(--muted); margin: 10px 0 6px; }

.ghost {
  margin-top: 18px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.88rem;
  cursor: pointer;
}
.ghost:hover { color: var(--ink); border-color: var(--ink); }

.goal .segmented { margin: 8px 0 16px; }
.goal-custom { margin-bottom: 14px; }
.goal-result { margin: 0 0 12px; }
.goal-track { height: 10px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.goal-track span { display: block; height: 100%; background: var(--c-save); border-radius: 999px; transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }

/* ---------- Life plan ---------- */

.life { display: grid; gap: 24px; }
.life .budget-head { margin-bottom: 0; }
.life-subhead { font-size: 1.3rem; letter-spacing: -0.01em; margin: 0 0 14px; }
.career-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; margin-bottom: 10px; }
.career-meta { font-size: 0.78rem; color: var(--muted); line-height: 1.3; }

.life-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .life-grid { grid-template-columns: minmax(0, 1fr); } }

.select { padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font: inherit; }
.check { display: flex; gap: 10px; align-items: center; margin-bottom: 4px; }
.check > span { margin: 0; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }

.timeline { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 8px; }
.stage { display: grid; gap: 2px; padding: 10px 14px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); font-size: 0.92rem; }
.stage.career { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.stage.career span { color: color-mix(in oklch, var(--paper) 70%, transparent); }
.stage strong { font-family: var(--font-mono); font-weight: 500; margin-right: 6px; }
.stage span { color: var(--muted); font-size: 0.85rem; }

.life-total { font-weight: 500; font-size: clamp(3rem, 7vw, 5rem); letter-spacing: -0.04em; line-height: 1; margin: 4px 0 10px; }
.chart-legend { margin: 0 0 8px; }
.line-key { display: inline-block; width: 14px; height: 2px; border-radius: 2px; vertical-align: middle; margin-right: 8px; }

.life-chart { position: relative; width: 100%; }
.life-chart svg { display: block; overflow: visible; }
.life-chart .band { fill: var(--paper-2); opacity: 0.6; }
.life-chart .band-label { fill: var(--muted); font-size: 11px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.04em; }
.life-chart .grid { stroke: var(--line); stroke-width: 1; }
.life-chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.life-chart .wash { stroke: none; }
.life-chart .wash.growth { fill: color-mix(in srgb, var(--chart-growth) 10%, transparent); }
.life-chart .wash.input { fill: color-mix(in srgb, var(--chart-input) 10%, transparent); }
.life-chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.life-chart .line.growth { stroke: var(--chart-growth); }
.life-chart .line.input { stroke: var(--chart-input); }
.life-chart .dot-mark { stroke: var(--card); stroke-width: 2; }
.life-chart .dot-mark.growth { fill: var(--chart-growth); }
.life-chart .dot-mark.input { fill: var(--chart-input); }
.life-chart .end-label { fill: var(--ink); font-size: 13px; font-weight: 500; font-family: var(--font); }
.life-chart .end-label.muted { fill: var(--muted); font-weight: 400; }
.life-chart .crosshair { stroke: var(--muted); stroke-width: 1; }
.life-chart rect[tabindex]:focus-visible { outline: 2px solid var(--copper); }

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 10px 30px oklch(20% 0.02 60 / 0.12);
  font-size: 0.85rem;
  min-width: 150px;
}
.tt-title { margin: 0 0 6px; color: var(--muted); font-size: 0.78rem; }
.tt-row { margin: 2px 0; }
.tt-row strong { font-weight: 500; }
.tt-row span { color: var(--muted); }

.table-view { margin-top: 14px; }
.table-view summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; }
.table-scroll { max-height: 320px; overflow: auto; margin-top: 10px; }
.table-view table { width: 100%; border-collapse: collapse; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.table-view th, .table-view td { text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-view th:nth-child(2), .table-view td:nth-child(2) { text-align: left; }
.table-view th { position: sticky; top: 0; background: var(--card); color: var(--muted); font-weight: 500; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.stat { position: relative; overflow: hidden; padding: 18px 20px; }
.stat-label { margin: 0 0 6px; color: var(--muted); font-size: 0.85rem; }
.stat-value { margin: 0; font-size: 1.5rem; font-weight: 500; letter-spacing: -0.02em; }

/* ---------- Footer ---------- */

.footer {
  max-width: 1280px;
  margin: 0 auto;
  padding: 26vh var(--gutter) 48px;
  display: grid;
  gap: 40px;
  justify-items: start;
}
.footer .display { max-width: 14ch; }
.footer-notes {
  width: 100%;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer-notes p { margin: 0; }

/* ---------- Story mode ---------- */

.story {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
}
.story[open] { display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: minmax(0, 1fr); }
.story::backdrop { background: var(--paper); }

.story-top { display: flex; align-items: center; gap: 20px; padding: 22px var(--gutter); }
.story-step { margin: 0; color: var(--muted); white-space: nowrap; }
.story-progress { flex: 1; height: 2px; background: var(--line); border-radius: 2px; overflow: hidden; }
.story-progress span { display: block; height: 100%; width: 0; background: var(--copper); transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.story-skip { background: none; border: 0; color: var(--muted); font-size: 0.9rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.story-skip:hover { color: var(--ink); }

.story-stage { overflow: auto; padding: 4vh var(--gutter) 24px; }
.story-inner { max-width: 1100px; }
.story-kicker { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--copper-ink); margin: 0 0 14px; }
.story-title { font-size: clamp(36px, 5.4vw, 80px); line-height: 1.02; letter-spacing: -0.035em; margin: 0 0 18px; max-width: 18ch; }
.story-text { font-size: clamp(1.05rem, 1.5vw, 1.25rem); max-width: 52ch; color: var(--muted); margin: 0 0 28px; }
.story-text strong { color: var(--ink); font-weight: 500; }

.story-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 24px; }
.story-option {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.2s, color 0.2s;
}
.story-option:hover { transform: translateY(-3px); }
.story-option.selected { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.story-option .opt-title { font-size: 1.1rem; font-weight: 500; }
.story-option .opt-note { font-size: 0.85rem; opacity: 0.7; }
.story-option .opt-icon { font-size: 1.5rem; }

.story-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 32px; max-width: 900px; }

.story-reveal { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 40px; align-items: start; }
@media (max-width: 900px) { .story-reveal { grid-template-columns: minmax(0, 1fr); } }
.reveal-number { font-weight: 500; font-size: clamp(3rem, 5.4vw, 5.75rem); letter-spacing: -0.045em; line-height: 0.95; margin: 0 0 12px; white-space: nowrap; }
.story .where-legend { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.story .where-legend li { white-space: nowrap; }
.story-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; gap: 2px; margin: 8px 0 12px; max-width: 640px; }
.story-bar span { flex-basis: 0; min-width: 2px; }

.story-bottom {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px var(--gutter) 22px;
  border-top: 1px solid var(--line);
}
.ledger { display: flex; gap: clamp(16px, 4vw, 56px); margin: 0; flex-wrap: wrap; }
.ledger div { display: grid; gap: 2px; }
.ledger dt { color: var(--muted); }
.ledger dd { margin: 0; font-size: clamp(1.2rem, 2vw, 1.6rem); font-weight: 500; letter-spacing: -0.02em; }
.ledger dd.pending { color: var(--line); }
.ledger[hidden] { display: none; }
.story-nav { display: flex; gap: 10px; }
.story-nav [hidden] { display: none; }

/* ---------- Quiz ---------- */

.quiz-list { display: grid; gap: 14px; max-width: 900px; margin-bottom: 24px; }
.quiz-q { border: 1px solid var(--line); border-radius: 18px; background: var(--card); padding: 18px 20px; margin: 0; }
.quiz-q legend { display: flex; gap: 12px; font-weight: 500; font-size: 1.05rem; line-height: 1.35; padding: 0; margin-bottom: 12px; float: left; width: 100%; }
.quiz-num { font-family: var(--font-mono); font-size: 11px; color: var(--copper-ink); padding-top: 4px; }
.quiz-options { clear: both; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.quiz-option { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); cursor: pointer; font-size: 0.95rem; transition: background 0.2s, color 0.2s; }
.quiz-option input { accent-color: var(--copper); margin: 0; }
.quiz-option:has(input:checked) { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.quiz-option:has(input:focus-visible) { outline: 2px solid var(--copper); outline-offset: 2px; }

.quiz-review { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 10px; max-width: 900px; }
.quiz-review li { border: 1px solid var(--line); border-radius: 16px; background: var(--card); padding: 14px 18px; border-left: 4px solid var(--good); }
.quiz-review li.wrong { border-left-color: var(--owe); }
.review-q { margin: 0 0 4px; font-weight: 500; }
.review-marks { margin: 0 0 6px; font-size: 0.8rem; color: var(--muted); }
.review-a { margin: 0; color: var(--muted); font-size: 0.95rem; }
.review-a strong { color: var(--ink); font-weight: 500; }
.grade-options { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); max-width: 760px; }
.grade-options .opt-title { white-space: nowrap; }
.grade-options .story-option { padding: 12px 14px; }

.impact { font-size: clamp(1.1rem, 2vw, 1.5rem); max-width: 40ch; margin: 0; }
.impact strong { font-weight: 500; }

@media (max-width: 760px) {
  .story-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .story-option { padding: 14px; border-radius: 14px; }
  .story-option .opt-icon { font-size: 1.2rem; }
  .story-bottom { padding: 12px var(--gutter) 14px; gap: 12px; }
  .story-top { gap: 12px; }
  .story-step { white-space: normal; min-width: 0; line-height: 1.5; }
  .ledger { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; }
  .ledger dt { font-size: 9px; }
  .ledger dd { font-size: 1rem; }
  .story-nav { width: 100%; justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}


/* ---------- Footer: legal links ---------- */

.footer-legal {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 32px;
  align-items: start;
  color: var(--muted);
  font-size: 0.85rem;
}
.footer-disclaimer { margin: 0; max-width: 60ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: flex-end; }
.footer-links a { color: var(--ink); }
.footer-copy { margin: 0; grid-column: 1 / -1; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; }
@media (max-width: 760px) {
  .footer-legal { grid-template-columns: minmax(0, 1fr); }
  .footer-links { justify-content: flex-start; }
}

.consent { align-items: flex-start; max-width: 62ch; color: var(--muted); font-size: 0.92rem; }
.consent input { flex: none; margin-top: 2px; }
.consent span { font-weight: 400; }

/* ---------- Legal and info pages (privacy.html, terms.html, credits.html, ...) ---------- */

.doc { max-width: 760px; margin: 0 auto; padding: 8vh var(--gutter) 12vh; }
.doc .index { color: var(--copper-ink); margin: 0 0 14px; }
.doc h1 { font-size: clamp(40px, 6vw, 80px); line-height: 1; letter-spacing: -0.035em; margin: 0 0 18px; }
.doc .updated { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: 0 0 40px; }
.doc h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -0.02em; line-height: 1.15; margin: 56px 0 14px; scroll-margin-top: 24px; }
.doc h3 { font-size: 1.15rem; font-weight: 500; margin: 28px 0 8px; }
.doc p, .doc li { font-size: 1.05rem; }
.doc ul, .doc ol { padding-left: 20px; display: grid; gap: 8px; }
.doc li::marker { color: var(--copper); }
.doc .lede { font-size: clamp(1.15rem, 1.8vw, 1.4rem); line-height: 1.4; }
.doc .summary { margin: 0 0 16px; }
.doc .summary h2 { margin-top: 0; font-size: 1.3rem; }
.doc .summary ul { margin: 0; }
.doc table { width: 100%; border-collapse: collapse; font-size: 0.95rem; margin: 12px 0; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); }
.doc th { font-weight: 500; color: var(--muted); font-size: 0.85rem; }
.doc .table-scroll { max-height: none; overflow-x: auto; }
.doc code { font-family: var(--font-mono); font-size: 0.88em; background: var(--paper-2); padding: 1px 6px; border-radius: 6px; }
.doc-nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0 0 32px; font-size: 0.95rem; }
.doc-nav a[aria-current="page"] { text-decoration: none; color: var(--muted); }
.doc .footer-legal { margin-top: 72px; padding-top: 20px; border-top: 1px solid var(--line); }
.doc strong { font-weight: 500; }

/* ---------- Tax forms, exempt, and tax time (story chapters 3–5) ---------- */

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

/* Jobs you're too young for stay visible, but grayed out. */
.job:disabled, .story-option:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.job-age { display: none; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.job:disabled .job-age { display: block; }

.story-sub { font-size: clamp(1.2rem, 2vw, 1.5rem); letter-spacing: -0.01em; font-weight: 500; margin: 36px 0 12px; }
.story-note { max-width: 62ch; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--copper); border-radius: 14px; padding: 14px 18px; margin: 0 0 24px; font-size: 0.98rem; }
.story-note p { margin: 0 0 8px; } .story-note p:last-child { margin: 0; }
.story-note strong { font-weight: 500; }
.group-badge { display: inline-block; margin: 0 0 18px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 0.9rem; }

.check-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; max-width: 70ch; }
.check-line { display: grid; grid-template-columns: 24px 1fr; gap: 8px; padding: 12px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.check-line > span[aria-hidden] { font-weight: 500; }
.check-text { min-width: 0; }
.check-line.ok > span[aria-hidden] { color: var(--good); }
.check-line.no > span[aria-hidden] { color: var(--owe); }
.check-line strong { font-weight: 500; }

.compare-table { width: 100%; max-width: 640px; border-collapse: collapse; font-size: 0.95rem; margin: 0 0 20px; }
.compare-table th, .compare-table td { padding: 9px 10px 9px 0; border-bottom: 1px dashed var(--line); text-align: right; }
.compare-table th[scope="row"], .compare-table thead th:first-child { text-align: left; font-weight: 400; }
.compare-table thead th { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.compare-table td { font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.compare-table tr.same td { color: var(--muted); }
.compare-table tr.total th, .compare-table tr.total td { font-weight: 500; color: var(--ink); }
.story .table-scroll { max-height: none; }

.steps { max-width: 64ch; padding-left: 22px; margin: 0 0 24px; display: grid; gap: 10px; }
.steps li::marker { color: var(--copper-ink); font-family: var(--font-mono); }
.steps strong, .free-list strong { font-weight: 500; }
.need-list { margin: 0 0 24px !important; }
.story .need-list li { white-space: normal; }
.free-list { max-width: 64ch; padding-left: 20px; margin: 0 0 24px; display: grid; gap: 10px; }
.free-list li::marker { color: var(--copper); }

/* A sample form: styled like a printed form, clearly stamped "Sample". */
.taxform { position: relative; max-width: 720px; margin: 0 0 8px; background: var(--card); border: 1.5px solid var(--ink); border-radius: 6px; padding: 14px; overflow: hidden; }
.taxform::after {
  content: "SAMPLE";
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: clamp(48px, 12vw, 110px); letter-spacing: 0.2em;
  color: var(--ink); opacity: 0.05; transform: rotate(-12deg); pointer-events: none;
}
.tf-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; border-bottom: 1.5px solid var(--ink); padding-bottom: 8px; margin-bottom: 8px; }
.tf-name { margin: 0; font-size: 0.95rem; }
.tf-form { font-weight: 500; font-size: 1.15rem; margin-right: 6px; }
.tf-sample { margin: 0; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--owe); font-weight: 500; }
.tf-employer { margin: 0 0 8px; font-size: 0.8rem; color: var(--muted); }
.tf-employer strong { color: var(--ink); font-weight: 500; }
.tf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.tf-box { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 2px 8px; padding: 8px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.tf-num { grid-row: 1 / 3; font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--copper-ink); padding-top: 2px; }
.tf-label { font-size: 0.75rem; color: var(--muted); line-height: 1.25; }
.tf-val { font-size: 0.98rem; color: var(--ink); overflow-wrap: anywhere; }
.tf-when { margin: 10px 0 0; font-size: 0.85rem; color: var(--muted); }
.tf-explain { max-width: 720px; margin: 0 0 24px; }
.tf-explain summary { cursor: pointer; color: var(--muted); font-size: 0.92rem; padding: 6px 0; }
.tf-explain dl { margin: 8px 0 0; display: grid; gap: 8px; }
.tf-explain dl div { display: grid; grid-template-columns: 80px 1fr; gap: 12px; }
.tf-explain dt { font-family: var(--font-mono); font-size: 0.8rem; color: var(--copper-ink); }
.tf-explain dd { margin: 0; font-size: 0.95rem; }
@media (max-width: 760px) {
  .tf-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tf-explain dl div { grid-template-columns: 64px 1fr; }
}

/* ---------- Counselor pages: guide, results, privacy for schools ---------- */

.doc.wide { max-width: 980px; }
.text-input { width: 100%; max-width: 360px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); font: inherit; font-size: 1.05rem; }
.text-input:focus-visible, .ghost:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.form-actions .ghost { margin-top: 0; }
.results-form { display: grid; gap: 4px; margin: 0 0 24px; }
.results-form .field { margin-bottom: 16px; }

.sample-banner { background: var(--warn-bg); color: var(--warn-text); border: 2px dashed var(--warn-text); border-radius: 14px; padding: 14px 18px; margin: 0 0 16px; }
.sample-banner strong { font-weight: 500; }
.report { margin: 0 0 20px; }
.report.is-sample { border-style: dashed; }
.report-count { font-size: 1.4rem; margin: 6px 0; }
.report-count strong { font-weight: 500; }
.report-head { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 12px 0 20px; }
.report-head .stat-value.good { color: var(--good); }
@media (max-width: 760px) { .report-head { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.report-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.doc .report-table th, .doc .report-table td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.doc .report-table tbody th { font-weight: 400; color: var(--ink); font-size: 0.92rem; min-width: 220px; }
.rcell { display: grid; grid-template-columns: 70px auto; align-items: center; gap: 8px; min-width: 120px; }
.rbar { display: block; height: 8px; border-radius: 999px; }
.rbar.before { background: var(--c-small); }
.rbar.after { background: var(--c-net); }
.rcell::before { content: ""; grid-row: 1; grid-column: 1; height: 8px; border-radius: 999px; background: var(--paper-2); }
.rcell .rbar { grid-row: 1; grid-column: 1; }
.grade-list { margin: 16px 0 !important; }
/* Phones: each question becomes a small card, so nothing needs sideways scrolling. */
@media (max-width: 560px) {
  .report-table thead { display: none; }
  .report-table, .report-table tbody { display: block; }
  .report-table tr { display: grid; grid-template-columns: 24px repeat(3, minmax(0, 1fr)); gap: 6px 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .doc .report-table th, .doc .report-table td { border: 0; padding: 0; min-width: 0; }
  .doc .report-table tbody th { grid-column: 2 / -1; }
  .report-table .rnum { grid-row: 1; }
  .report-table td[data-label] { grid-row: 2; font-size: 0.85rem; }
  .report-table td[data-label="Before"] { grid-column: 2; }
  .report-table td[data-label="After"] { grid-column: 3; }
  .report-table td[data-label="Change"] { grid-column: 4; }
  .report-table td[data-label]::before { content: attr(data-label); display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
  .rcell { grid-template-columns: minmax(0, 1fr) auto; min-width: 0; }
}

.guide-code h2 { margin-top: 0; }
.qr-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: center; margin-top: 16px; }
.qr { width: 180px; height: 180px; }
.qr svg { width: 100%; height: 100%; display: block; }
.qr-bg { fill: #fff; }
.qr-fg { fill: #000; }
.student-link { font-size: clamp(1.1rem, 2.4vw, 1.6rem); margin: 4px 0 8px; overflow-wrap: anywhere; }
@media (max-width: 560px) { .qr-row { grid-template-columns: minmax(0, 1fr); } }
.doc .guide-steps { padding-left: 30px; }
.guide-steps li::marker { color: var(--copper-ink); font-family: var(--font-mono); }
.guide-time { max-width: 520px; }
.doc .guide-time td:last-child, .doc .guide-time th:last-child { text-align: right; font-family: var(--font-mono); }

/* Print: black on white, no buttons, links written out, fits on paper. */
@media print {
  :root { --paper: #fff; --card: #fff; --ink: #000; --muted: #333; --line: #bbb; }
  html, body { background: #fff; }
  .no-print, .skip-link, .pill, .ghost, #print-guide { display: none !important; }
  .doc { padding: 0; max-width: none; }
  .doc h1 { font-size: 30pt; }
  .doc h2 { font-size: 15pt; margin: 18pt 0 6pt; break-after: avoid; }
  .doc p, .doc li { font-size: 10.5pt; }
  .panel { border: 1px solid #999; border-radius: 8px; break-inside: avoid; }
  .guide-code { padding: 12pt; }
  .qr { width: 1.6in; height: 1.6in; }
  .lede { font-size: 12pt !important; }
  a { text-decoration: none; }
  .report-table { font-size: 9pt; }
  table, .guide-steps li { break-inside: avoid; }
  .doc .footer-legal { margin-top: 18pt; padding-top: 8pt; }
  .guide-page .footer-legal { display: none; }
  .guide-page .doc h2 { margin-top: 14pt; }
  .guide-page .doc p, .guide-page .doc li { font-size: 10pt; }
  .doc .guide-steps { padding-left: 30px; }
  .sample-banner { border: 2px dashed #000; color: #000; background: #fff; }
}

/* ---------- Hands-on story: guess, sort, find, takeaway ---------- */

/* The "do this first" box: the one thing to do before you can go on. */
.task { max-width: 720px; margin: 0 0 24px; padding: 18px 20px; border-radius: 18px; background: var(--card); border: 1.5px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.task-label { margin: 0 0 8px; font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--copper-ink); }
.task-ask { margin: 0 0 12px; font-size: 1.1rem; line-height: 1.4; }
.task-ask strong { font-weight: 500; }
.task-ask:focus { outline: none; }
.task-options { display: flex; flex-wrap: wrap; gap: 8px; }
.task-options .pill, .sort-buttons .pill { white-space: normal; text-align: left; font-family: var(--font); font-size: 0.98rem; letter-spacing: 0; text-transform: none; }
.task-options .pill:disabled { cursor: default; opacity: 0.45; }
.task-options .pill.is-answer { opacity: 1; box-shadow: inset 0 0 0 2px var(--good); color: var(--good); }
.task-options .pill.is-answer:not(.ghost-pill) { color: var(--paper); background: var(--good); }
.task-hint { margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--warn-bg); color: var(--warn-text); font-size: 0.95rem; }
.task .pill { margin-top: 4px; }

.guess { margin-bottom: 14px; }
.guess > span { font-weight: 400; font-size: 1.1rem; line-height: 1.4; }
.guess-value { display: block; font-size: clamp(2rem, 6vw, 3rem); font-weight: 500; letter-spacing: -0.02em; margin: 4px 0 6px; }
.guess-result { color: var(--ink); }

/* Pay stub lines you can tap open. */
.why-list { max-width: 640px; margin: 0 0 12px; border-top: 1px dashed var(--line); }
.why-line { border-bottom: 1px dashed var(--line); }
.why-line summary, .why-line.keep { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; padding: 11px 2px; cursor: pointer; list-style: none; }
.why-line summary::-webkit-details-marker { display: none; }
.why-line summary::after { content: "+"; font-family: var(--font-mono); color: var(--copper-ink); width: 14px; text-align: center; }
.why-line[open] summary::after { content: "–"; }
.why-line summary .mono { color: var(--muted); }
.why-line summary:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; border-radius: 6px; }
.why-line p { margin: 0 0 12px 18px; color: var(--muted); font-size: 0.95rem; max-width: 56ch; }
.why-line.keep { cursor: default; grid-template-columns: 1fr auto; font-weight: 500; }
.why-line summary .dot { margin: 0; }
.why-line.keep .mono { color: var(--good); font-size: 1.1rem; }

.takeaway { max-width: 640px; margin: 8px 0 24px; padding: 18px 20px; border-radius: 18px; background: var(--ink); color: var(--paper); position: relative; }
.takeaway-kicker { margin: 0 0 6px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: color-mix(in oklch, var(--paper) 70%, transparent); }
.takeaway-text { margin: 0; font-size: 1.15rem; line-height: 1.4; }

/* Practice teens to sort. */
.sort-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; max-width: 900px; margin: 0 0 24px; }
.sort-card { display: grid; align-content: start; gap: 6px; padding: 16px 18px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--line); }
.sort-card.right { border-top-color: var(--good); }
.sort-card.wrong { border-top-color: var(--owe); }
.sort-name { margin: 0; font-weight: 500; font-size: 1.15rem; }
.sort-story { margin: 0 0 6px; color: var(--muted); font-size: 0.95rem; }
.sort-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.sort-buttons .pill { padding: 10px 16px; }
.sort-verdict p { margin: 0 0 6px; font-size: 0.95rem; }
.sort-verdict strong { font-weight: 500; }
.sort-card.right .sort-verdict strong { color: var(--good); }
.sort-card.wrong .sort-verdict strong { color: var(--owe); }
.sort-verdict:focus { outline: none; }

.stepper { max-width: 640px; padding-left: 0; margin: 0 0 14px; list-style: none; counter-reset: step; display: grid; gap: 8px; }
.stepper li { counter-increment: step; display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: start; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.stepper li::before { content: counter(step); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--paper); font-family: var(--font-mono); font-size: 12px; }
.stepper strong { font-weight: 500; }
.stepper li:focus { outline: none; }
.bring-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 4px; max-width: 640px; }
.bring-list .field { margin: 0; padding: 8px 0; }
.bring-list .check span { font-weight: 400; }
.bring-list input:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--good); }

/* The compound growth race. */
.race { max-width: 640px; margin: 0 0 24px; }
.race:focus { outline: none; }
.race-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; align-items: center; margin: 0 0 10px; font-size: 0.95rem; }
.race-track { display: block; height: 12px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.race-fill { display: block; height: 100%; border-radius: 999px; transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
.race-fill.maya { background: var(--c-net); }
.race-fill.leo { background: var(--c-small); }
.race-fill.you { background: var(--c-federal); }
.race-you { margin-top: 18px; }
.race-you > span:first-child { font-weight: 400; margin-bottom: 8px; }
.race-you strong { font-weight: 500; }
.race-you .race-track { margin-bottom: 10px; }

.reveal-card { max-width: 640px; margin: 0 0 20px; padding: 18px 20px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--c-net); }
.reveal-card:focus { outline: none; }
.reveal-card p { margin: 0 0 6px; }
.reveal-card strong { font-weight: 500; }
.reveal-big { font-size: clamp(2rem, 6vw, 3.2rem); font-weight: 500; letter-spacing: -0.02em; }
.reveal-big span { font-family: var(--font); font-size: 1rem; font-weight: 400; color: var(--muted); letter-spacing: 0; }

.cheat-sheet { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 10px; max-width: 760px; }
.cheat-sheet li { display: grid; grid-template-columns: 36px 1fr; gap: 12px; padding: 14px 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.cheat-sheet p { margin: 0; font-size: 1.05rem; }
.cheat-num { color: var(--copper-ink); padding-top: 3px; }

/* Takeaway pins in the top bar, and the "answer first" hint by Next. */
.story-pins { display: flex; gap: 5px; margin: 0; }
.pin { display: block; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--copper); }
.pin.on { background: var(--copper); }
.story-hint { margin: 0; align-self: center; color: var(--muted); font-size: 0.85rem; max-width: 20ch; text-align: right; }
.story-hint:empty { display: none; }

/* Sample forms: the find-the-box game. */
button.tf-box { font: inherit; color: inherit; text-align: left; background: transparent; border-top: 0; border-left: 0; cursor: pointer; transition: background 0.2s; }
button.tf-box:hover { background: var(--paper); }
button.tf-box:focus-visible { outline: 2px solid var(--copper); outline-offset: -2px; }
.tf-box.found { background: color-mix(in oklch, var(--good) 14%, var(--card)); }
.tf-box.found .tf-num::after { content: " ✓"; color: var(--good); }
.tf-box.wrong { background: color-mix(in oklch, var(--owe) 10%, var(--card)); }
.tf-box.filled { background: color-mix(in oklch, var(--c-federal) 10%, var(--card)); }
.taxform.is-game { box-shadow: 4px 4px 0 var(--ink); }
.tf-stamp {
  position: absolute; right: 18px; bottom: 48px; z-index: 1;
  padding: 6px 12px; border: 2.5px solid var(--good); border-radius: 8px; color: var(--good);
  font-family: var(--font-mono); font-size: 14px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
  transform: rotate(-8deg); background: color-mix(in oklch, var(--card) 85%, transparent);
}

@media (max-width: 760px) {
  .task { padding: 16px; box-shadow: 3px 3px 0 var(--ink); }
  .race-row { grid-template-columns: 88px 1fr auto; font-size: 0.85rem; }
  .story-top { flex-wrap: wrap; row-gap: 8px; }
  .story-progress { order: 3; flex-basis: 100%; }
  .story-hint { max-width: none; text-align: left; flex: 1 1 100%; }
  .story-nav { flex-wrap: wrap; }
}

/* v2: the session flow, the session-code screen, and plain tables in the story. */
.story-track { flex: 1; min-width: 0; display: grid; gap: 6px; }
.story-flow { display: flex; gap: 14px; margin: 0; padding: 0; list-style: none; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.story-flow li.now { color: var(--copper-ink); font-weight: 500; }
.story-flow li.done { color: var(--good); }
.code-form { max-width: 460px; margin: 0 0 22px; }
.code-form .text-input { text-transform: uppercase; }
.code-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.consent { max-width: 60ch; }
.plain-list { max-width: 62ch; margin: 0 0 22px; padding-left: 20px; display: grid; gap: 6px; }
.reveal-card .plain-list { margin: 6px 0 0; }
.plain-table { width: 100%; max-width: 760px; border-collapse: collapse; font-size: 0.95rem; margin: 0 0 16px; }
.plain-table caption { text-align: left; color: var(--muted); font-size: 0.9rem; padding-bottom: 8px; }
.plain-table caption.sr-only { padding: 0; }
.plain-table th, .plain-table td { padding: 9px 12px 9px 0; border-bottom: 1px dashed var(--line); text-align: left; vertical-align: top; }
.plain-table th[scope="row"] { font-weight: 500; }
.plain-table thead th { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.growth-table td { white-space: nowrap; }
.growth-table strong { font-weight: 500; }
.rating label { flex: 1 1 44px; text-align: center; }
.intent-list { display: grid; gap: 4px; max-width: 560px; }
.intent-list .field { margin: 0; padding: 6px 0; }
.intent-list .check span { font-weight: 400; }
.delivery-note { max-width: 62ch; margin: 0 0 22px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-size: 0.95rem; }
.story-note .tf-explain { margin-top: 8px; }
.status-key { max-width: 74ch; padding-left: 20px; }
.sources-table { font-size: 0.9rem; }
.sources-table th[scope="row"] { font-weight: 400; min-width: 200px; }
.fact-value { max-width: 280px; overflow-wrap: anywhere; font-size: 0.85rem; }
.status { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.02em; white-space: nowrap; }
.status-unverified { color: var(--owe); font-weight: 500; }
.status-verified { color: var(--good); }
.session-table td, .session-table th { white-space: nowrap; }
.goal-track + .table-scroll { margin-top: 18px; }
@media (max-width: 760px) {
  .story-track { order: 3; flex: 1 1 100%; }
  .story-flow { gap: 10px; font-size: 10px; }
  .story-progress { order: 0; flex-basis: auto; }
}
.quiz-details { max-width: 760px; margin-bottom: 24px; }
.story-inner > .tf-explain { max-width: 720px; margin-bottom: 14px; }
.story-inner > .tf-explain + .story-sub { margin-top: 28px; }
.race .tf-explain { margin-bottom: 14px; }
@media (max-width: 420px) {
  .nav:has(> a.pill) { flex-wrap: wrap; row-gap: 10px; }
  .nav > a.pill { white-space: normal; }
}
