/* Ausgeology · Too much, too little: water in the world (Year 7 Geography)
   The shared lesson design system: one reading column (about 68 characters)
   inside a 1080px frame; models and scenes use the full frame. The first
   block is shared by every lesson; the lesson's own tokens and blocks follow. */

:root {
  --bg: #eef0ec;
  --surface: #fbfcfa;
  --surface-2: #e2e7e2;
  --ink: #1a2124;
  --ink-2: #4a565a;
  --line: #c6cec9;
  --accent: #1f5f8b;
  --accent-ink: #ffffff;
  --accent-soft: #d6e5ef;
  --ochre: #b4501c;
  --ochre-band: #a5481a;
  --ochre-soft: #f6e2d4;
  --carbon: #1d2124;
  --carbon-ink: #ffffff;
  --sp-atm: #5b9fd0;
  --sp-atm-soft: #d9ebf7;
  --sp-hyd: #1f6f8a;
  --sp-hyd-soft: #d2e7ec;
  --sp-bio: #4f8a35;
  --sp-bio-soft: #dcecd2;
  --sp-geo: #9a5a2b;
  --sp-geo-soft: #efdcc9;
  --good: #2b7449;
  --good-soft: #dcefe3;
  --bad: #b3261e;
  --bad-soft: #f7dedc;
  --focus: #d99a00;
  --pop-bg: #1a2124;
  --pop-ink: #f2f4f2;
  --shadow: 0 1px 2px rgba(20, 30, 34, 0.06), 0 8px 24px rgba(20, 30, 34, 0.07);
  /* chart roles (validated with the dataviz palette script) */
  --viz-surface: #fbfcfa;
  --viz-1: #2a78d6;
  --viz-2: #eb6834;
  --viz-3: #1baf7a;
  --viz-dim: #b9b8ae;
  --viz-grid: #e1e0d9;
  --viz-axis: #c3c2b7;
  --viz-muted: #6f6e68;
  /* type */
  --font-display: "Archivo", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Atkinson Hyperlegible Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --scale: 1;
  --radius: 12px;
  --steps: 10;
  --i-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.4 16.6 4.8 12l-1.6 1.6 6.2 6.2L21 8.2l-1.6-1.6z'/%3E%3C/svg%3E");
  --i-cross: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18.4 4.2 12 10.6 5.6 4.2 4.2 5.6l6.4 6.4-6.4 6.4 1.4 1.4 6.4-6.4 6.4 6.4 1.4-1.4-6.4-6.4 6.4-6.4z'/%3E%3C/svg%3E");
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111517;
    --surface: #182024;
    --surface-2: #212a2f;
    --ink: #e6ebeb;
    --ink-2: #a9b5b8;
    --line: #2f3a3f;
    --accent: #7fb9e4;
    --accent-ink: #0b1822;
    --accent-soft: #1d3446;
    --ochre: #ec8a52;
    --ochre-band: #a5481a;
    --ochre-soft: #3d2416;
    --carbon: #0b0e10;
    --carbon-ink: #f2f4f2;
    --sp-atm: #7fb6dc;
    --sp-atm-soft: #1b3447;
    --sp-hyd: #5aa6bf;
    --sp-hyd-soft: #163640;
    --sp-bio: #7fb861;
    --sp-bio-soft: #1f3618;
    --sp-geo: #c98a55;
    --sp-geo-soft: #3d2816;
    --good: #66c792;
    --good-soft: #17372a;
    --bad: #f38b84;
    --bad-soft: #43201e;
    --focus: #ffcc4d;
    --pop-bg: #e6ebeb;
    --pop-ink: #111517;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    --viz-surface: #182024;
    --viz-1: #3987e5;
    --viz-2: #d95926;
    --viz-3: #199e70;
    --viz-dim: #5d6a6e;
    --viz-grid: #263034;
    --viz-axis: #3a464b;
    --viz-muted: #95a2a6;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #111517;
  --surface: #182024;
  --surface-2: #212a2f;
  --ink: #e6ebeb;
  --ink-2: #a9b5b8;
  --line: #2f3a3f;
  --accent: #7fb9e4;
  --accent-ink: #0b1822;
  --accent-soft: #1d3446;
  --ochre: #ec8a52;
  --ochre-band: #a5481a;
  --ochre-soft: #3d2416;
  --carbon: #0b0e10;
  --carbon-ink: #f2f4f2;
  --sp-atm: #7fb6dc;
  --sp-atm-soft: #1b3447;
  --sp-hyd: #5aa6bf;
  --sp-hyd-soft: #163640;
  --sp-bio: #7fb861;
  --sp-bio-soft: #1f3618;
  --sp-geo: #c98a55;
  --sp-geo-soft: #3d2816;
  --good: #66c792;
  --good-soft: #17372a;
  --bad: #f38b84;
  --bad-soft: #43201e;
  --focus: #ffcc4d;
  --pop-bg: #e6ebeb;
  --pop-ink: #111517;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  --viz-surface: #182024;
  --viz-1: #3987e5;
  --viz-2: #d95926;
  --viz-3: #199e70;
  --viz-dim: #5d6a6e;
  --viz-grid: #263034;
  --viz-axis: #3a464b;
  --viz-muted: #95a2a6;
  color-scheme: dark;
}

/* ---------- base ---------- */
html { font-size: calc(100% * var(--scale)); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
img, svg, canvas { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 0.18em; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
p { margin: 0; }
.ul { text-decoration: underline; text-decoration-thickness: 0.09em; text-underline-offset: 0.16em; text-decoration-skip-ink: none; }

.wrap {
  max-width: 1080px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.prose { max-width: 68ch; }
.prose > * + * { margin-top: 0.85em; }
.prose ul, .prose ol { padding-left: 1.3em; margin-bottom: 0; }
.prose li + li { margin-top: 0.4em; }
.small { font-size: 0.92rem; color: var(--ink-2); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 8px;
  font-weight: 700; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- header ---------- */
.site-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; padding-block: 12px 10px; }
.brand {
  font-family: var(--font-display); font-weight: 800; font-stretch: 118%;
  font-size: 1.2rem; letter-spacing: -0.01em; line-height: 1;
}
.brand i { font-style: normal; color: var(--ochre); }
.back {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.92rem; font-weight: 600; text-decoration: none; margin-right: auto;
}
.back:hover { text-decoration: underline; }
.back svg { width: 18px; height: 18px; }
.tools { display: flex; gap: 6px; flex-wrap: wrap; }
.tool {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 6px 12px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--bg); color: var(--ink);
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
}
.tool:hover { border-color: var(--accent); }
.tool svg { width: 18px; height: 18px; flex: none; }
.tool[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tool-val { font-family: var(--font-mono); font-size: 0.78rem; font-weight: 500; }

.rail-nav { padding-block: 2px 12px; }
.rail { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--steps, 10), minmax(0, 1fr)); gap: 4px; }
.rail-btn {
  width: 100%; display: grid; gap: 5px; padding: 4px 0; border: 0; background: none;
  text-align: left; cursor: pointer; color: var(--ink-2); border-radius: 4px;
}
.rail-bar { height: 6px; border-radius: 3px; background: var(--surface-2); transition: background-color 0.2s; }
.rail-btn:hover .rail-bar { background: var(--line); }
.rail-btn.is-done .rail-bar { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.rail-btn[aria-current="step"] .rail-bar { background: var(--accent); box-shadow: none; }
.rail-t { font-family: var(--font-mono); font-size: 0.7rem; line-height: 1.25; letter-spacing: 0.02em; }
.rail-t b { display: block; font-weight: 600; color: var(--ink); }
.rail-btn[aria-current="step"] .rail-t { color: var(--ink); }
.rail-now { display: none; font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-2); margin-top: 6px; }
.rail-now b { color: var(--ink); font-weight: 600; }

/* ---------- screens ---------- */
.js .screen:not(.is-active) { display: none; }
.screen { padding-block: 36px 56px; }
.screen-inner { display: grid; gap: 28px; }
.screen-inner > *, .section > *, .hero > *, .checks > *, .lab-body > * { min-width: 0; }
.screen-head { display: grid; gap: 8px; }
.eyebrow {
  font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--ink-2);
}
.display {
  font-family: var(--font-display); font-weight: 800; font-stretch: 116%;
  letter-spacing: -0.015em; line-height: 1; margin: 0; text-wrap: balance;
}
h1.display { font-size: clamp(2.7rem, 1.3rem + 5.6vw, 5.4rem); line-height: 0.95; }
h2.display { font-size: clamp(2rem, 1.25rem + 2.8vw, 3.1rem); }
h2.display:focus, h1.display:focus { outline: none; }
h3 {
  font-family: var(--font-display); font-weight: 750; font-stretch: 108%;
  font-size: 1.32rem; line-height: 1.2; margin: 0; text-wrap: balance; letter-spacing: -0.005em;
}
.display .dot { color: var(--ochre); }
.lede { font-size: 1.28rem; line-height: 1.5; max-width: 60ch; }
.section { display: grid; gap: 14px; }

/* ---------- hero ---------- */
.hero { display: grid; gap: 20px; padding-bottom: 8px; }
.fig-tag {
  position: absolute; right: 8px; top: 8px; font-family: var(--font-mono); font-size: 0.66rem;
  letter-spacing: 0.06em; text-transform: uppercase; background: rgba(0, 0, 0, 0.45); color: #fff;
  padding: 2px 6px; border-radius: 4px;
}
.country {
  max-width: 76ch; background: var(--surface-2); border-radius: var(--radius);
  padding: 16px 18px; font-size: 1rem; display: grid; gap: 6px;
}
.country b { font-weight: 700; }

.goals { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.goal-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; display: grid; gap: 10px; align-content: start; }
.goal-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.goal-card li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; align-items: start; line-height: 1.45; }
.sc-num {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600;
  border: 1.5px solid var(--accent); color: var(--accent); margin-top: 1px;
}
.label {
  font-family: var(--font-mono); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-2);
}

/* ---------- teaching blocks ---------- */
.key-idea {
  max-width: 68ch; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 20px 18px; display: grid; gap: 6px;
}
.key-idea .label { display: inline-flex; align-items: center; gap: 8px; }
.key-idea .label::before { content: ""; width: 14px; height: 14px; border-radius: 3px; background: var(--accent); }
.key-idea p { font-size: 1.26rem; font-weight: 700; line-height: 1.4; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-width: 72ch; counter-reset: step; }
.steps > li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; counter-increment: step; }
.steps > li::before {
  content: counter(step); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ochre-band); color: #fff; font-family: var(--font-mono); font-weight: 600; font-size: 0.85rem; margin-top: 1px;
}
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 1rem; line-height: 1.45; }
caption { text-align: left; padding: 12px 14px 0; font-weight: 700; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
thead th {
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-2); background: var(--surface-2);
}
tbody tr:last-child > * { border-bottom: 0; }
tbody th { font-weight: 700; }
td.time, th.time { font-variant-numeric: tabular-nums; }

details.more { max-width: 72ch; border: 1px dashed var(--line); border-radius: var(--radius); padding: 0 18px; background: transparent; }
details.more > summary { cursor: pointer; padding: 14px 0; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 10px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before {
  content: "+"; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none;
  border: 1.5px solid var(--accent); color: var(--accent); font-family: var(--font-mono); font-size: 0.95rem; line-height: 1;
}
details.more[open] > summary::before { content: "\2212"; }
details.more > .more-body { padding: 0 0 18px; display: grid; gap: 12px; }
details.reveal > summary { list-style: none; width: fit-content; }
details.reveal > summary::-webkit-details-marker { display: none; }
details.reveal[open] > summary { display: none; }
.tag-ext { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); font-weight: 500; }

/* ---------- labs ---------- */
.lab { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.lab-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.lab-head h3 { font-size: 1.15rem; }
.lab-head .label { color: var(--accent); }
.lab-body { padding: 16px 18px 18px; display: grid; gap: 14px; }
.lab-body > p.small { max-width: 72ch; }
.lab canvas { display: block; width: 100%; border-radius: 10px; background: #2a1810; }
.lab .canvas-light { background: #cfe3ec; }
.lab-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.status {
  margin: 0; min-height: 3.3em; padding: 12px 14px; border-radius: 10px;
  background: var(--surface-2); font-size: 1rem; line-height: 1.5;
}
.model-note { font-size: 0.92rem; color: var(--ink-2); max-width: 75ch; }
.model-note b { color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 9px 16px;
  border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 1rem; font-weight: 650; line-height: 1.2; cursor: pointer; text-align: left; text-decoration: none;
}
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn small { font-weight: 500; font-size: 0.82rem; opacity: 0.85; }

.slider-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.slider-row .label { white-space: nowrap; }
input[type="range"] { width: 100%; accent-color: var(--ochre); height: 32px; cursor: pointer; }
.stage-name { font-family: var(--font-display); font-weight: 800; font-stretch: 112%; font-size: 1.3rem; }

/* ---------- checks for understanding ---------- */
.checks { display: grid; gap: 16px; }
.check {
  max-width: 780px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 20px 20px; display: grid; gap: 12px;
}
.check-head { display: flex; justify-content: space-between; gap: 12px; }
.check-q { font-weight: 700; font-size: 1.12rem; line-height: 1.45; }
.check-opts { display: grid; gap: 8px; }
.opt {
  position: relative; display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 12px 14px 12px 48px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--bg); color: var(--ink); line-height: 1.45; font-size: 1.02rem;
}
.opt:hover:not(:disabled) { border-color: var(--accent); }
.opt::before {
  content: attr(data-letter); position: absolute; left: 13px; top: 11px; width: 24px; height: 24px;
  border-radius: 50%; border: 1.5px solid var(--ink-2); color: var(--ink-2);
  font-family: var(--font-mono); font-size: 0.78rem; font-weight: 600; line-height: 21px; text-align: center;
}
.opt.is-right { border-color: var(--good); background: var(--good-soft); }
.opt.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.is-right::before, .opt.is-wrong::before { content: ""; border: 0; border-radius: 0; }
.opt.is-right::before { background: var(--good); -webkit-mask: var(--i-check) center / 22px no-repeat; mask: var(--i-check) center / 22px no-repeat; }
.opt.is-wrong::before { background: var(--bad); -webkit-mask: var(--i-cross) center / 20px no-repeat; mask: var(--i-cross) center / 20px no-repeat; }
.opt:disabled { cursor: default; }
.opt:disabled:not(.is-right):not(.is-wrong) { opacity: 0.6; }
.fb { padding: 12px 14px; border-radius: 10px; font-size: 1rem; line-height: 1.5; background: var(--surface-2); }
.fb.is-right { background: var(--good-soft); }
.fb.is-wrong { background: var(--bad-soft); }
.fb strong { font-weight: 800; }
.fb.is-right strong { color: var(--good); }
.fb.is-wrong strong { color: var(--bad); }

/* ---------- exit check and results ---------- */
.results { max-width: 820px; background: var(--surface); border: 1.5px solid var(--accent); border-radius: 16px; padding: 18px 20px; display: grid; gap: 12px; }
.results-score { font-family: var(--font-display); font-weight: 800; font-stretch: 112%; font-size: 2rem; line-height: 1.1; }
.sc-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sc-results li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; line-height: 1.45; }
.sc-icon { width: 24px; height: 24px; border-radius: 50%; margin-top: 1px; }
.sc-icon.ok { background: var(--good); -webkit-mask: var(--i-check) center / 20px no-repeat; mask: var(--i-check) center / 20px no-repeat; }
.sc-icon.todo { border: 2px solid var(--line); }
.sc-review { font-size: 0.95rem; }
.offline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.offline-links { display: flex; flex-wrap: wrap; gap: 8px; }
.teacher { max-width: 80ch; }
.teacher .more-body h3 { font-size: 1.05rem; margin-top: 6px; }
.teacher blockquote { margin: 0; padding: 10px 14px; border-radius: 10px; background: var(--surface-2); font-style: italic; }
.teacher ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.confirm-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- screen navigation ---------- */
.screen-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 22px; border-top: 1px solid var(--line); }
.screen-nav .next { margin-left: auto; }
.screen-nav .btn { max-width: 100%; }

/* ---------- glossary ---------- */
.term { cursor: help; border-bottom: 2px dotted var(--accent); border-radius: 2px; }
.term:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.term:hover, .term[aria-expanded="true"] { color: var(--accent); }
.term-pop {
  position: absolute; z-index: 60; width: max-content; max-width: min(340px, calc(100vw - 32px));
  background: var(--pop-bg); color: var(--pop-ink); border-radius: 12px; padding: 12px 14px 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); font-size: 0.98rem; line-height: 1.45; display: grid; gap: 4px;
}
.term-pop b { font-size: 1.02rem; }
.term-pop button { justify-self: start; margin-top: 4px; background: none; border: 0; padding: 4px 0; color: inherit; text-decoration: underline; cursor: pointer; font-size: 0.9rem; }
dialog.glossary {
  border: 0; border-radius: 18px; padding: 0; width: min(680px, calc(100vw - 32px)); max-height: min(84vh, 760px);
  background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
dialog.glossary::backdrop { background: rgba(10, 14, 16, 0.55); }
.gl-head { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.gl-head h2 { font-family: var(--font-display); font-weight: 800; font-stretch: 112%; font-size: 1.5rem; margin: 0; }
.gl-list { margin: 0; padding: 12px 20px 20px; display: grid; gap: 12px; }
.gl-list dt { font-weight: 800; }
.gl-list dd { margin: 2px 0 0; color: var(--ink-2); line-height: 1.5; }

/* read aloud */
.is-reading { background: var(--accent-soft); box-shadow: 0 0 0 4px var(--accent-soft); border-radius: 4px; }

.site-foot { border-top: 1px solid var(--line); background: var(--surface); }
.site-foot .wrap { padding-block: 18px 24px; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; font-size: 0.9rem; color: var(--ink-2); }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .goals { grid-template-columns: minmax(0, 1fr); }
  .rail-t { display: none; }
  .rail-now { display: block; }
  .offline { grid-template-columns: minmax(0, 1fr); }
  .tool-label { display: none; }
  .tool { padding: 6px 10px; }
}
@media (max-width: 520px) {
  body { font-size: 1.0625rem; }
  .screen { padding-block: 26px 44px; }
  .lab-head, .lab-body { padding-left: 14px; padding-right: 14px; }
  .check { padding: 16px; }
  .slider-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .slider-row input { grid-column: 1 / -1; grid-row: 1; }
  .slider-row .hi { text-align: right; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}




/* ---------- Too much, too little (Year 7 Geography): lesson tokens and shared blocks ----------
   River teal is the accent: the colour of the Katherine River in the dry season.
   Two water colours carry the lesson's two halves through every scene: clear
   spring blue for groundwater and the dry-season river, muddy brown for floodwater. */
:root {
  --accent: #11645d;
  --accent-ink: #ffffff;
  --accent-soft: #d5ece8;
  --spring: #1f78a6;
  --spring-soft: #d8eaf4;
  --flood: #8a5a2b;
  --flood-soft: #f2e5d4;
  --sun: #e9a83a;
  --sun-soft: #fdf0d2;
  --st-minor: #fab219;
  --st-moderate: #ec835a;
  --st-major: #d03b3b;
  /* scene colours */
  --sc-sky: #d3e8f5;
  --sc-sky-2: #a9d1ec;
  --sc-sky-wet: #9aa6ad;
  --sc-sky-wet-2: #6f7c84;
  --sc-cloud: #ffffff;
  --sc-cloud-wet: #5d6870;
  --sc-range: #c47a4a;
  --sc-range-2: #a5603a;
  --sc-grass: #9ab65a;
  --sc-grass-dry: #cdb46a;
  --sc-tree: #4f7a3a;
  --sc-tree-2: #3d6630;
  --sc-trunk: #7a5637;
  --sc-soil: #9a6a3e;
  --sc-lime: #d9d0bb;
  --sc-lime-2: #c4b99f;
  --sc-crack: #6f6553;
  --sc-gw: #3c8fc6;
  --sc-gw-2: #2a72a8;
  --sc-river: #3f9d93;
  --sc-river-2: #2e8178;
  --sc-floodw: #b09066;
  --sc-floodw-2: #866845;
  --sc-floodw-hi: #d6c19c;
  --sc-sand: #e3cf9c;
  --sc-house: #f4efe6;
  --sc-roof: #8f9ca3;
  --sc-ink: #1a2124;
  --sc-halo: rgba(255, 255, 255, 0.9);
  --sc-panel: rgba(255, 255, 255, 0.92);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #6fd1c4; --accent-ink: #062a26; --accent-soft: #12312e;
    --spring: #6bb8e0; --spring-soft: #16303d;
    --flood: #d7a46d; --flood-soft: #3a2a1a;
    --sun: #f0b94f; --sun-soft: #3d3014;
    --sc-sky: #27465c; --sc-sky-2: #1c3447; --sc-sky-wet: #39434a; --sc-sky-wet-2: #2b3338;
    --sc-cloud: #dfe7ee; --sc-cloud-wet: #4a545b;
    --sc-range: #8f5a37; --sc-range-2: #74462b;
    --sc-grass: #6b8a3f; --sc-grass-dry: #9a8650; --sc-tree: #3b5e2c; --sc-tree-2: #2e4c22; --sc-trunk: #5e4229;
    --sc-soil: #74502f; --sc-lime: #8f8774; --sc-lime-2: #7a725f; --sc-crack: #3f392e;
    --sc-gw: #4f9fd6; --sc-gw-2: #3a86bd; --sc-river: #3b8f86; --sc-river-2: #2c746c;
    --sc-floodw: #7d6446; --sc-floodw-2: #5c4732; --sc-floodw-hi: #a38b68; --sc-sand: #a8946a; --sc-house: #c9c3b8; --sc-roof: #6b777e;
    --sc-ink: #e6ebeb; --sc-halo: rgba(17, 21, 23, 0.88); --sc-panel: rgba(24, 32, 36, 0.94);
  }
}
:root[data-theme="dark"] {
  --accent: #6fd1c4; --accent-ink: #062a26; --accent-soft: #12312e;
  --spring: #6bb8e0; --spring-soft: #16303d;
  --flood: #d7a46d; --flood-soft: #3a2a1a;
  --sun: #f0b94f; --sun-soft: #3d3014;
  --sc-sky: #27465c; --sc-sky-2: #1c3447; --sc-sky-wet: #39434a; --sc-sky-wet-2: #2b3338;
  --sc-cloud: #dfe7ee; --sc-cloud-wet: #4a545b;
  --sc-range: #8f5a37; --sc-range-2: #74462b;
  --sc-grass: #6b8a3f; --sc-grass-dry: #9a8650; --sc-tree: #3b5e2c; --sc-tree-2: #2e4c22; --sc-trunk: #5e4229;
  --sc-soil: #74502f; --sc-lime: #8f8774; --sc-lime-2: #7a725f; --sc-crack: #3f392e;
  --sc-gw: #4f9fd6; --sc-gw-2: #3a86bd; --sc-river: #3b8f86; --sc-river-2: #2c746c;
  --sc-floodw: #7d6446; --sc-floodw-2: #5c4732; --sc-floodw-hi: #a38b68; --sc-sand: #a8946a; --sc-house: #c9c3b8; --sc-roof: #6b777e;
  --sc-ink: #e6ebeb; --sc-halo: rgba(17, 21, 23, 0.88); --sc-panel: rgba(24, 32, 36, 0.94);
}

.steps > li::before { background: var(--accent); }
input[type="range"] { accent-color: var(--accent); }

/* the hero scene */
.hero-fig { position: relative; margin: 0; border-radius: 18px; overflow: hidden; background: var(--sc-sky); box-shadow: var(--shadow); }
.hero-fig svg { display: block; width: 100%; height: auto; }
.hero-fig figcaption { padding: 12px 16px; background: var(--surface); border-top: 1px solid var(--line); font-size: 0.98rem; color: var(--ink-2); }

/* the problem, set out as a case file */
.problem { max-width: 820px; display: grid; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--accent); border-radius: 6px 16px 16px 6px; padding: 18px 20px 20px; }
.problem .dq { font-family: var(--font-display); font-weight: 800; font-stretch: 108%; font-size: 1.32rem; line-height: 1.25; margin: 0; }
.two-sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.side { border-radius: 12px; padding: 14px 16px; display: grid; gap: 6px; align-content: start; }
.side h3 { font-size: 1.08rem; margin: 0; }
.side p { margin: 0; font-size: 0.98rem; line-height: 1.5; }
.side.wet { background: var(--flood-soft); border-top: 5px solid var(--flood); }
.side.dry { background: var(--spring-soft); border-top: 5px solid var(--spring); }

/* the step chip on each screen head: the step of the problem-based cycle */
.phase { display: inline-flex; align-items: center; gap: 8px; width: fit-content; padding: 4px 12px 4px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 0.92rem; font-weight: 700; }
.phase i { min-width: 28px; height: 28px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; font-style: normal; font-family: var(--font-mono); font-size: 0.78rem; font-weight: 700; color: #fff; background: var(--accent); }
.phase.p-prob i { background: #9a3d6b; } .phase.p-ask i { background: #b4501c; } .phase.p-inv i { background: #11645d; } .phase.p-prop i { background: #2f6fb0; } .phase.p-show i { background: #6c4fa8; }
.inq-q { margin: 0; display: flex; gap: 10px; align-items: baseline; font-weight: 700; color: var(--ink-2); max-width: 70ch; }
.inq-q::before { content: "?"; flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent-ink); background: var(--accent); transform: translateY(2px); }

/* notebook boxes */
.note { display: grid; gap: 6px; max-width: 72ch; }
.note label, .note .field-label { font-weight: 700; line-height: 1.4; }
.note .hint { font-size: 0.95rem; color: var(--ink-2); font-weight: 400; }
.note textarea, .note input[type="text"], .note input[type="number"] {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 1.04rem;
  color: var(--ink); background-color: var(--surface);
}
.note textarea {
  min-height: 6.4em; resize: vertical; line-height: 2rem; padding-top: 6px;
  background-image: repeating-linear-gradient(180deg, transparent 0 calc(2rem - 1px), var(--line) calc(2rem - 1px) 2rem);
  background-attachment: local; background-position: 0 6px;
}
.note textarea:focus, .note input:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); outline-offset: 0; }
.notebook { display: grid; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px 20px; max-width: 820px; }
.notebook > h3 { display: flex; align-items: center; gap: 10px; }
.notebook > h3::before { content: ""; width: 20px; height: 22px; flex: none; border-radius: 3px 5px 5px 3px; background: var(--accent); box-shadow: inset 4px 0 0 rgba(255, 255, 255, 0.3); }
.readback { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); font-size: 1rem; line-height: 1.45; max-width: 72ch; }
.readback:empty { display: none; }
.key-idea p.label { font-size: 0.74rem; font-weight: 600; line-height: 1.3; }

/* try it, ask first, place and case cards */
.tryit { max-width: 76ch; display: grid; gap: 10px; background: var(--sun-soft); border: 1px solid var(--line); border-left: 6px solid var(--sun); border-radius: 6px 16px 16px 6px; padding: 16px 20px 18px; }
.tryit h3 { font-size: 1.12rem; }
.tryit ol, .tryit ul { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; }
.askfirst { max-width: 76ch; display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid #6b5b4e; border-radius: 6px 16px 16px 6px; padding: 16px 20px 18px; }
.askfirst h3 { font-size: 1.08rem; }
.care { max-width: 76ch; margin: 0; padding: 12px 16px; border-radius: 12px; background: var(--surface-2); font-size: 0.98rem; line-height: 1.5; }

/* ---------- scenes ---------- */
.stage { position: relative; border-radius: 12px; overflow: hidden; background: var(--sc-sky); }
.stage svg { display: block; width: 100%; height: auto; }
.sc-text { font-family: var(--font-body); font-weight: 700; font-size: 18px; fill: var(--sc-ink); paint-order: stroke; stroke: var(--sc-halo); stroke-width: 5px; stroke-linejoin: round; text-anchor: middle; }
.sc-text-s { font-size: 15px; font-weight: 600; }
.sc-text-l { font-size: 22px; font-weight: 800; }
.sc-start { text-anchor: start; } .sc-end { text-anchor: end; }
.sc-tag { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; fill: var(--sc-ink); opacity: 0.8; }
.hit { cursor: pointer; }
.hit:focus { outline: none; }
.hit:focus-visible .ring, .hit:hover .ring { stroke: var(--focus); stroke-width: 4; opacity: 1; }

/* segmented toggles (seasons, map layers) */
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; padding: 4px; border-radius: 14px; background: var(--surface-2); width: fit-content; }
.seg button { min-height: 44px; padding: 8px 16px; border-radius: 10px; border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); color: var(--accent); }
.seg button:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.ctrl-row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }

/* ---------- 2 · what we need to know ---------- */
.know { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 900px; }
.know-box { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--surface); display: grid; gap: 8px; align-content: start; }
.know-box h3 { font-size: 1.04rem; margin: 0; }
.know-box ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; font-size: 0.98rem; }
.qcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.qcard { display: grid; gap: 8px; text-align: left; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; line-height: 1.35; cursor: pointer; min-height: 72px; }
.qcard:hover { border-color: var(--accent); }
.qcard:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.qcard .qtype { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; font-weight: 600; color: var(--ink-2); }
.qcard[aria-pressed="true"] { border-color: var(--good); background: var(--good-soft); }
.qcard.is-off { border-color: var(--bad); background: var(--bad-soft); }
.qcard .qfb { font-weight: 400; font-size: 0.94rem; color: var(--ink); }
.ourq { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; counter-reset: q; max-width: 820px; }
.ourq li { counter-increment: q; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); }
.ourq li::before { content: counter(q); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-mono); font-size: 0.82rem; font-weight: 700; color: var(--accent-ink); background: var(--accent); }
.ourq b { display: block; }
.ourq .where { font-size: 0.92rem; color: var(--ink-2); }
.ourq-empty { color: var(--ink-2); font-size: 0.98rem; margin: 0; }

/* ---------- 3 · what kind of resource ---------- */
.rcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.rcard { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px 12px; align-content: start; padding: 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); }
.rcard svg { width: 64px; height: 64px; display: block; }
.rcard h4 { margin: 0; font-size: 1.02rem; line-height: 1.3; align-self: center; }
.rcard .rpicks { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.rpick { min-height: 40px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 0.92rem; font-weight: 700; cursor: pointer; }
.rpick:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.rpick.is-right { border-color: var(--good); background: var(--good-soft); }
.rpick.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.rcard .fb { grid-column: 1 / -1; font-size: 0.94rem; padding: 10px 12px; }
.rcard.is-done { border-color: var(--good); }
.rkey { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rkey div { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 0.96rem; line-height: 1.45; }
.rkey b { display: block; font-size: 1rem; }

/* ---------- charts ---------- */
.chart { display: grid; gap: 10px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
[data-rain] .chart svg { max-width: 760px; }
.chart .c-title { font-weight: 700; margin: 0; }
.chart .c-sub { margin: 0; font-size: 0.94rem; color: var(--ink-2); }
.c-grid { stroke: var(--viz-grid); stroke-width: 1; }
.c-axis { stroke: var(--viz-axis); stroke-width: 1; }
.c-tick { font-family: var(--font-body); font-size: 13px; fill: var(--viz-muted); font-variant-numeric: tabular-nums; }
.c-lab { font-family: var(--font-body); font-size: 14px; font-weight: 700; fill: var(--ink); }
.c-lab-s { font-family: var(--font-body); font-size: 13px; fill: var(--ink-2); }
.c-bar { fill: var(--viz-1); }
.c-bar2 { fill: var(--viz-2); }
.c-hit { fill: transparent; cursor: pointer; }
.c-hit:focus { outline: none; }
.c-mark.is-on .c-bar, .c-mark:hover .c-bar, .c-mark:focus-visible .c-bar { fill: #1f63b8; }
.c-mark:focus-visible .c-focus { stroke: var(--focus); stroke-width: 3; }
.c-band { fill: var(--surface-2); }
.c-readout { margin: 0; min-height: 1.6em; font-size: 0.98rem; }
.c-readout b { font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; font-size: 0.94rem; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.legend .sw { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.legend .sw.dot { border-radius: 50%; }
.legend .sw.line { height: 3px; width: 18px; border-radius: 2px; }
.tbl-num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap button.sort { all: unset; cursor: pointer; font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
.table-wrap button.sort:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.table-wrap button.sort::after { content: "\2195"; font-size: 0.8em; opacity: 0.5; }
.table-wrap button.sort[data-dir="asc"]::after { content: "\2191"; opacity: 1; }
.table-wrap button.sort[data-dir="desc"]::after { content: "\2193"; opacity: 1; }

/* ---------- 4 · how water moves ---------- */
.steps-row { display: flex; flex-wrap: wrap; gap: 6px; }
.steps-row button { min-width: 44px; min-height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 800; cursor: pointer; }
.steps-row button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.steps-row button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: relative; }
.flow::before { content: ""; position: absolute; left: 10%; right: 10%; top: 13px; height: 10px; border-radius: 5px; background: var(--sc-river); }
.flow li { position: relative; display: grid; justify-items: center; text-align: center; gap: 4px; padding: 40px 8px 0; }
.flow li::before { content: ""; position: absolute; top: 4px; left: 50%; width: 28px; height: 28px; margin-left: -14px; border-radius: 50%; background: var(--surface); border: 5px solid var(--sc-river-2); box-sizing: border-box; }
.flow b { font-size: 1rem; }
.flow span { font-size: 0.92rem; line-height: 1.4; color: var(--ink-2); }
.flow .flow-k span { color: var(--ink); font-weight: 600; }
.flow .flow-k::after { content: ""; position: absolute; top: 30px; left: 50%; width: 0; height: 12px; border-left: 3px dashed var(--sc-gw-2); }
.scroll-hint { display: none; }
@media (max-width: 700px) {
  .flow { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .flow::before { left: 13px; right: auto; top: 10px; bottom: 10px; width: 10px; height: auto; }
  .flow li { justify-items: start; text-align: left; padding: 0 0 0 48px; }
  .flow li::before { left: 4px; top: 0; margin-left: 0; }
  .flow .flow-k::after { display: none; }
  .stage.scroll-x { overflow-x: auto; }
  .stage.scroll-x svg { min-width: 700px; }
  .scroll-hint { display: block; }
}
.changes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.change { padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 6px; align-content: start; }
.change h4 { margin: 0; font-size: 1rem; }
.change p { margin: 0; font-size: 0.96rem; line-height: 1.5; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.hl-ring { fill: none; stroke: var(--focus); stroke-width: 4; stroke-dasharray: 10 7; }

/* ---------- 5 · Australia's water ---------- */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 4px; align-content: start; }
.stat .s-label { font-size: 0.9rem; color: var(--ink-2); line-height: 1.35; }
.stat .s-val { font-size: 2rem; font-weight: 700; line-height: 1.1; }
.stat .s-src { font-size: 0.8rem; color: var(--ink-2); }
.maps2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.map-panel { max-width: 560px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); padding: 14px 16px; display: grid; gap: 8px; min-height: 150px; align-content: start; }
.map-panel h4 { margin: 0; font-size: 1.1rem; }
.map-panel .mp-row { display: flex; justify-content: space-between; gap: 10px; font-size: 0.98rem; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.map-panel .mp-row b { font-variant-numeric: tabular-nums; }
.m-land { fill: var(--surface-2); stroke: var(--viz-axis); stroke-width: 1.2; }
.m-north { fill: var(--accent-soft); }
.m-border { fill: none; stroke: var(--viz-axis); stroke-width: 1; }
.m-tropic { fill: none; stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 8 6; }
.m-rain { fill: var(--viz-1); fill-opacity: 0.78; stroke: var(--viz-surface); stroke-width: 2; }
.m-people { fill: var(--viz-2); fill-opacity: 0.78; stroke: var(--viz-surface); stroke-width: 2; }
.m-dot { fill: var(--ink); }
.m-lab { font-family: var(--font-body); font-size: 15px; font-weight: 700; fill: var(--ink); paint-order: stroke; stroke: var(--surface-2); stroke-width: 4px; stroke-linejoin: round; }
.m-lab-s { font-family: var(--font-body); font-size: 13px; font-weight: 600; fill: var(--ink-2); }
.m-place.is-on .ring, .m-place:hover .ring { stroke: var(--focus); stroke-width: 4; opacity: 1; }
.m-place:focus { outline: none; }
.m-place:focus-visible .ring { stroke: var(--focus); stroke-width: 4; opacity: 1; }
.cases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.case { border-radius: 14px; background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--accent); padding: 14px 16px 16px; display: grid; gap: 8px; align-content: start; }
.case h4 { margin: 0; font-size: 1.06rem; }
.case .where { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-2); }
.case p, .case li { font-size: 0.96rem; line-height: 1.5; }
.case p { margin: 0; }
.case ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
.case .strat { display: flex; flex-wrap: wrap; gap: 6px; }
.case .strat span { font-size: 0.82rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); }
.hbars { display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: baseline; font-size: 0.92rem; }
.hbar b { font-variant-numeric: tabular-nums; }
.hbar .hb-track { grid-column: 1 / -1; position: relative; height: 12px; border-radius: 4px; background: var(--surface-2); }
.hbar .hb-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--viz-1); border-radius: 4px; min-width: 3px; }

/* ---------- 6 · who values the river ---------- */
.vcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.vcard { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px 12px; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); align-content: start; }
.vcard svg { width: 56px; height: 56px; display: block; }
.vcard p { margin: 0; font-size: 0.98rem; line-height: 1.5; }
.vcard .src { grid-column: 1 / -1; font-size: 0.8rem; color: var(--ink-2); }
.vcard .vchips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.vchip { min-height: 40px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 0.9rem; font-weight: 700; cursor: pointer; }
.vchip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.vchip:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.vcard .vcheck { grid-column: 1 / -1; justify-self: start; }
.vcard .fb { grid-column: 1 / -1; font-size: 0.94rem; padding: 10px 12px; }
.vcard.is-done { border-color: var(--good); }
.vkey { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.vkey div { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 0.94rem; line-height: 1.45; }
.vkey b { display: block; }

/* ---------- 7 · when the river floods ---------- */
.gauge-wrap { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.st-line { stroke-width: 2; }
.st-minor { stroke: var(--st-minor); } .st-moderate { stroke: var(--st-moderate); } .st-major { stroke: var(--st-major); }
.st-sw-minor { background: var(--st-minor); } .st-sw-moderate { background: var(--st-moderate); } .st-sw-major { background: var(--st-major); }
.g-dot { fill: var(--flood); stroke: var(--viz-surface); stroke-width: 2; }
.g-dot.approx { fill: var(--viz-surface); stroke: var(--flood); stroke-width: 3; }
.g-stem { stroke: var(--flood); stroke-width: 2; }
.g-mark { cursor: pointer; }
.g-mark:focus { outline: none; }
.g-mark .ring { fill: none; stroke: transparent; stroke-width: 3; }
.g-mark.is-on .ring, .g-mark:hover .ring, .g-mark:focus-visible .ring { stroke: var(--focus); }
.story { border-radius: 14px; background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--flood); padding: 14px 16px 16px; display: grid; gap: 8px; align-content: start; }
.story h4 { margin: 0; font-size: 1.1rem; }
.story dl { margin: 0; display: grid; gap: 6px; }
.story dt { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-2); }
.story dd { margin: 0 0 4px; font-size: 0.96rem; line-height: 1.5; }
.fclass { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.fclass li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; font-size: 0.94rem; line-height: 1.45; }
.fclass .sw { width: 14px; height: 14px; border-radius: 3px; margin-top: 4px; }
.chain { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: c; }
.chain li { counter-increment: c; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 14px; border-radius: 12px; background: var(--flood-soft); }
.chain li::before { content: counter(c); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-mono); font-size: 0.82rem; font-weight: 700; color: #fff; background: var(--flood); }
:root[data-theme="dark"] .chain li::before { color: #1d1206; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chain li::before { color: #1d1206; } }
.chain-pool { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.chain-pool button { text-align: left; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 0.96rem; line-height: 1.4; cursor: pointer; }
.chain-pool button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.chain-pool button.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.icards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; }
.icard { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); align-content: start; }
.icard p { margin: 0; font-size: 0.96rem; line-height: 1.45; }
.icard .yr { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.05em; color: var(--ink-2); }
.icard .ipicks { display: flex; flex-wrap: wrap; gap: 6px; }
.icard .fb { font-size: 0.92rem; padding: 8px 10px; }
.icard.is-done { border-color: var(--good); }

/* ---------- 8 · your strategy ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.plan-col { display: grid; gap: 10px; align-content: start; }
.plan-col > h3 { margin: 0; font-size: 1.14rem; display: flex; gap: 10px; align-items: center; }
.plan-col > h3 .sw { width: 14px; height: 14px; border-radius: 4px; }
.optlist { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.optlist legend { font-weight: 700; margin-bottom: 4px; padding: 0; }
.optcard { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; align-items: start; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; line-height: 1.4; }
.optcard input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); }
.optcard:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.optcard:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.impact { border-radius: 14px; background: var(--surface); border: 1px solid var(--line); padding: 14px 16px; display: grid; gap: 8px; }
.impact h4 { margin: 0; font-size: 1.02rem; }
.impact table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.impact th, .impact td { text-align: left; vertical-align: top; padding: 7px 6px; border-top: 1px solid var(--line); line-height: 1.45; }
.impact th { width: 8.5em; font-weight: 700; }
.mark { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-weight: 800; font-size: 0.9rem; margin-right: 6px; vertical-align: -4px; }
.mark.plus { background: var(--good-soft); color: var(--good); }
.mark.minus { background: var(--bad-soft); color: var(--bad); }
.mark.mixed { background: var(--sun-soft); color: #8a5a00; }
:root[data-theme="dark"] .mark.mixed { color: var(--sun); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mark.mixed { color: var(--sun); } }
.impact .real { font-size: 0.9rem; color: var(--ink-2); margin: 0; }
.mystrat { max-width: 820px; display: grid; gap: 8px; padding: 16px 18px; border-radius: 14px; background: var(--accent-soft); }
.mystrat h3 { margin: 0; font-size: 1.1rem; }
.mystrat p { margin: 0; line-height: 1.5; }

@media (max-width: 860px) {
  .gauge-wrap, .plan-grid { grid-template-columns: minmax(0, 1fr); }
  .cases, .changes { grid-template-columns: minmax(0, 1fr); }
  .vkey { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .two-sides, .know { grid-template-columns: minmax(0, 1fr); }
  .rkey, .stats { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .maps2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .vkey { grid-template-columns: minmax(0, 1fr); }
  .stat .s-val { font-size: 1.7rem; }
}

/* table views under the charts */
details.tview { max-width: 820px; }
details.tview > summary { cursor: pointer; font-weight: 700; color: var(--accent); width: fit-content; padding: 6px 0; }
details.tview > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
details.tview[open] > summary { margin-bottom: 8px; }
.hero-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; background: var(--surface); }
.hero-pair svg { display: block; width: 100%; height: auto; }
.hero-tab-t { fill: #ffffff; }
:root[data-theme="dark"] .hero-tab-t { fill: #10181c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-tab-t { fill: #10181c; } }
@media (max-width: 760px) { .hero-pair { grid-template-columns: minmax(0, 1fr); } }
