/* Ausgeology · Energy (SACE Stage 2 Earth and Environmental Science)
   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-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 blockquote p { margin: 0; }
.teacher blockquote ul { margin: 6px 0 0; padding-left: 22px; display: grid; gap: 3px; }
.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; }
}




/* ---------- shared lesson blocks ---------- */
.steps > li::before { background: var(--accent); }
input[type="range"] { accent-color: var(--accent); }
/* the phase chip on each screen head */
.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-start i { background: #17694f; } .phase.p-home i { background: #8a5a12; } .phase.p-life i { background: #3d4852; } .phase.p-show i { background: #6c4fa8; }
.phase.p-a i { background: #b8501a; } .phase.p-b i { background: #1d6f8f; } .phase.p-c i { background: #6a4fa3; }
.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; margin: 0; }
.note textarea, .note input[type="text"] {
  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; }
.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; }
.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; }
.scroll-hint { display: none; }
@media (max-width: 700px) {
  .stage.scroll-x { overflow-x: auto; }
  .stage.scroll-x svg { min-width: 720px; }
  .scroll-hint { display: block; }
}
.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.moved { background: var(--sc-moved); }
.legend .sw.line-dash { width: 22px; height: 0; border-radius: 0; border-top: 2px dashed var(--sc-ink); }
.legend .sw.wall { background: var(--sc-rock); border: 1px solid var(--sc-rock-3); }
.legend .sw.sea { background: var(--sc-sea); }
.legend .sw.dot { border-radius: 50%; }
.legend .sw.line { height: 3px; width: 18px; border-radius: 2px; }
/* ---------- charts ---------- */
.chart { display: grid; gap: 10px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; max-width: 820px; }
.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-val { font-family: var(--font-body); font-size: 13.5px; font-weight: 700; fill: var(--ink); font-variant-numeric: tabular-nums; }
.c-bar { fill: var(--viz-1); }
.c-bar2 { fill: var(--viz-2); }
.c-range { fill: var(--viz-1); fill-opacity: 0.28; stroke: var(--viz-1); stroke-width: 1.5; stroke-dasharray: 4 3; }
.c-fade0 { stop-color: var(--viz-1); stop-opacity: 1; }
.c-fade1 { stop-color: var(--viz-1); stop-opacity: 0; }
.c-hit { fill: transparent; cursor: pointer; }
.c-mark:focus { outline: none; }
.c-mark:focus-visible .c-focus, .c-mark:hover .c-focus, .c-mark.is-on .c-focus { stroke: var(--focus); stroke-width: 3; }
.c-focus { fill: none; stroke: transparent; }
.c-readout { margin: 0; min-height: 1.6em; font-size: 0.98rem; }
.tbl-num { text-align: right; font-variant-numeric: tabular-nums; }
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; }
.picks { 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); }
.tl-item .fb, .icard .fb { font-size: 0.93rem; padding: 8px 10px; }
.chain { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: c; max-width: 820px; }
.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(--accent-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: var(--accent-ink); background: var(--accent); }
.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.97rem; line-height: 1.45; }
.icard .yr { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.05em; color: var(--ink-2); }
.icard.is-done { border-color: var(--good); }

/* ---------- step-through cross-sections ---------- */
.geo-stage { background: var(--sc-air); }
.stp-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px; }
.stp-btn { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 6px 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; font-size: 0.92rem; line-height: 1.2; cursor: pointer; text-align: left; }
.stp-btn i { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-family: var(--font-mono); font-size: 0.78rem; background: var(--surface-2); }
.stp-btn.is-past i { background: var(--accent-soft); color: var(--accent); }
.stp-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.stp-btn[aria-pressed="true"] i { background: var(--accent); color: var(--accent-ink); }
.stp-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.stp-out { max-width: 820px; display: grid; gap: 6px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); min-height: 7.6em; }
.stp-out h4 { margin: 0; font-size: 1.08rem; }
.stp-out p { margin: 0; line-height: 1.55; }
.stp-nav { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; max-width: 820px; }

/* ---------- cards for everyday resources, older uses and the cases ---------- */
.ucards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.ucard { display: grid; gap: 6px; align-content: start; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.ucard h4 { margin: 0; font-size: 1.04rem; }
.ucard p { margin: 0; font-size: 0.97rem; line-height: 1.5; }
.ucard .where { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-2); }
.ucard .src { font-size: 0.82rem; color: var(--ink-2); }
.ucard.old { border-top: 6px solid #9a5a2b; }
.ucard.case { border-top: 6px solid var(--g-rust); }

/* ---------- line charts ---------- */
.c-line { fill: none; stroke: var(--viz-1); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.c-band { fill: var(--cl-band); }
.c-band-lab { font-weight: 600; }
.c-line2 { fill: none; stroke: var(--viz-2); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.c-dot { fill: var(--viz-1); stroke: var(--viz-surface); stroke-width: 2; }
.c-cross { stroke: var(--viz-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.c-area { fill: var(--viz-1); opacity: 0.12; }
.c-dot2 { fill: var(--viz-2); }
.legend .sw.c-sw1 { background: var(--viz-1); height: 4px; border-radius: 2px; }
.legend .sw.c-sw2 { background: var(--viz-2); height: 4px; border-radius: 2px; }
.legend .sw.c-sw3 { background: var(--viz-3); height: 4px; border-radius: 2px; }



/* ---------- carried over from the climate lessons ---------- */
/* ---------- the station map ---------- */
.st-map { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 960px) { .st-map { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .st-map { grid-template-columns: minmax(0, 1fr); } }
.st-card { position: relative; display: grid; gap: 6px; align-content: start; height: 100%; padding: 14px 16px 16px; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--line); color: var(--ink); text-decoration: none; }
.st-card:hover { border-color: var(--accent); }
.st-card:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.st-top { display: flex; align-items: center; gap: 8px; }
.st-ico { width: 26px; height: 26px; flex: none; color: var(--accent); }
.st-num { font-family: var(--font-mono); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.st-state { font-size: 0.78rem; font-weight: 700; color: var(--ink-2); padding: 2px 8px; border-radius: 999px; background: var(--surface-2); white-space: nowrap; }
.st-title { font-family: var(--font-display); font-weight: 750; font-stretch: 108%; font-size: 1.12rem; line-height: 1.2; }
.st-q { font-size: 0.94rem; line-height: 1.45; color: var(--ink-2); }
.st-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 6px; }
.st-card { grid-template-rows: auto auto 1fr auto; }
.st-bar { display: block; flex: 1; height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.st-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; }
.st-card.is-started .st-state { background: var(--accent-soft); color: var(--ink); }
.st-card.is-done { border-color: var(--st-done); }
.st-card.is-done .st-state { background: var(--st-done-soft); color: var(--st-done); }
.st-card.is-done .st-bar i { background: var(--st-done); }
.st-sum { margin: 0; font-weight: 700; }
.st-how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .st-how { grid-template-columns: minmax(0, 1fr); } }
.st-how > div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 6px; align-content: start; }
.st-how p { font-size: 0.97rem; line-height: 1.5; }
.st-how h3 { font-size: 1.04rem; }

/* the task card at the start of a station, and the checklist at the end */
.st-task { max-width: 820px; display: grid; gap: 8px; padding: 14px 18px 16px; border-radius: 14px; background: var(--accent-soft); border-left: 6px solid var(--accent); }
.st-task .label { color: var(--ink); }
.st-task ol { margin: 0; padding-left: 1.3em; display: grid; gap: 4px; }
.st-task li { line-height: 1.45; }
.st-list { max-width: 820px; display: grid; gap: 10px; padding: 16px 18px; border-radius: 14px; background: var(--surface); border: 1.5px dashed var(--line); }
.st-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.st-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; align-items: start; line-height: 1.45; }
.st-tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); margin-top: 1px; }
.st-list li.is-done .st-tick { border: 0; background: var(--st-done); -webkit-mask: var(--i-check) center / 20px no-repeat; mask: var(--i-check) center / 20px no-repeat; }
.st-rec { line-height: 1.5; }
.st-go { line-height: 1.5; font-size: 0.98rem; }

/* ---------- time charts and the range chart ---------- */
.tc-views { margin-bottom: 2px; }
.tc-views button, .rc-periods button { min-height: 40px; padding: 6px 12px; font-size: 0.94rem; }
.tc-vline { stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 5 4; fill: none; }
.tc-vlab { font-weight: 700; fill: var(--ink-2); paint-order: stroke; stroke: var(--viz-surface); stroke-width: 4px; stroke-linejoin: round; }
.tc-mark { paint-order: stroke; stroke: var(--viz-surface); stroke-width: 5px; stroke-linejoin: round; }
.tc-leg { font-weight: 600; fill: var(--ink-2); }
.tc-legsw { stroke-width: 3; }
.tc-xtitle { font-weight: 600; }
/* ---------- benefits and risks ---------- */
.weigh { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 12px; }
.weigh > div { display: grid; gap: 8px; align-content: start; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.weigh > div:first-child { border-top: 6px solid var(--good); }
.weigh > div:last-child { border-top: 6px solid var(--ochre); }
.weigh h3 { font-size: 1.04rem; margin: 0; }
.weigh ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.weigh li { font-size: 0.97rem; line-height: 1.5; }

/* ---------- how a model runs ---------- */
.steps-list { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 8px; max-width: 860px; }
.steps-list li { counter-increment: s; position: relative; display: block; padding: 12px 16px 12px 58px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); line-height: 1.55; }
.steps-list li::before { content: counter(s); position: absolute; left: 16px; top: 11px; 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); }

/* ---------- spheres and policy levels ---------- */
.ucard.sph-atm { border-top: 6px solid var(--sp-atm); } .ucard.sph-hyd { border-top: 6px solid var(--sp-hyd); }
.ucard.sph-bio { border-top: 6px solid var(--sp-bio); } .ucard.sph-geo { border-top: 6px solid var(--sp-geo); }
.ucard.lvl-global { border-top: 6px solid #2f4f8f; } .ucard.lvl-national { border-top: 6px solid #0f6a6e; }
.ucard.lvl-state { border-top: 6px solid #8a5a12; } .ucard.lvl-local { border-top: 6px solid #4f8a35; }

/* wide tables scroll sideways on a phone rather than squeezing their columns */
.table-wrap table.wide { min-width: 680px; }

/* ======================================================================
   Water and soil (SACE Stage 2 Earth and Environmental Science)
   Deep blue is the accent. The lesson runs as a game in six rounds, each a
   model of a real problem with goals to meet; the scoreboard on the start
   screen tracks them. Cross-sections share one set of colours: sand and
   sandstone that hold water, clay and mudstone that stop it, fresh
   groundwater in light blue, and sea water in a deeper blue.
   ====================================================================== */
:root {
  --accent: #1d5f8a; --accent-ink: #ffffff; --accent-soft: #d8e6f0;
  --st-done: #2b7449; --st-done-soft: #dcefe3;
  --sc-sky: #e8f1f6; --sc-air: #e8f1f6; --sc-ink: #1a2124; --sc-halo: rgba(255, 255, 255, 0.92); --sc-sea: #3f83ab;
  --ws-land: #d8c7a3; --ws-sand: #e6d3a3; --ws-sand-dot: #b89c62; --ws-clay: #9da493; --ws-rock: #7d776d; --ws-soil: #b58f63;
  --ws-fresh: rgba(64, 145, 196, 0.42); --ws-fresh-solid: #b3d5ea; --ws-salt: #2f6788; --ws-sea: #3f83ab; --ws-sea-top: #2a6f97;
  --ws-wt: #0f5a8c; --ws-iface: #c0392b; --ws-crust: #f7f3ea; --ws-crust-line: #b9b0a0;
  --ws-tree: #4f8a35; --ws-crop: #b08d2a; --ws-dead: #8d7f6a;
  --pl-nitrate: #2b7449; --pl-fuel: #b4501c; --pl-tce: #6c4fa8; --pl-pfas: #b0306a; --pl-leach: #7a5c2e;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #7fb9e4; --accent-ink: #0b1822; --accent-soft: #1d3446;
    --st-done: #66c792; --st-done-soft: #17372a;
    --sc-sky: #16232b; --sc-air: #16232b; --sc-ink: #e6ebeb; --sc-halo: rgba(17, 21, 23, 0.9); --sc-sea: #2a6488;
    --ws-land: #5e5442; --ws-sand: #6d6040; --ws-sand-dot: #9a8558; --ws-clay: #4d5349; --ws-rock: #3e3b36; --ws-soil: #6b5536;
    --ws-fresh: rgba(90, 166, 208, 0.38); --ws-fresh-solid: #2b5670; --ws-salt: #1f4d68; --ws-sea: #2a6488; --ws-sea-top: #5aa6d0;
    --ws-wt: #8fcaf0; --ws-iface: #f38b84; --ws-crust: #ded8cb; --ws-crust-line: #8f877a;
    --ws-tree: #7fb861; --ws-crop: #d8b44a; --ws-dead: #a59885;
    --pl-nitrate: #66c792; --pl-fuel: #ec8a52; --pl-tce: #b39ae6; --pl-pfas: #f08ab8; --pl-leach: #c9a46a;
  }
}
:root[data-theme="dark"] {
  --accent: #7fb9e4; --accent-ink: #0b1822; --accent-soft: #1d3446;
  --st-done: #66c792; --st-done-soft: #17372a;
  --sc-sky: #16232b; --sc-air: #16232b; --sc-ink: #e6ebeb; --sc-halo: rgba(17, 21, 23, 0.9); --sc-sea: #2a6488;
  --ws-land: #5e5442; --ws-sand: #6d6040; --ws-sand-dot: #9a8558; --ws-clay: #4d5349; --ws-rock: #3e3b36; --ws-soil: #6b5536;
  --ws-fresh: rgba(90, 166, 208, 0.38); --ws-fresh-solid: #2b5670; --ws-salt: #1f4d68; --ws-sea: #2a6488; --ws-sea-top: #5aa6d0;
  --ws-wt: #8fcaf0; --ws-iface: #f38b84; --ws-crust: #ded8cb; --ws-crust-line: #8f877a;
  --ws-tree: #7fb861; --ws-crop: #d8b44a; --ws-dead: #a59885;
  --pl-nitrate: #66c792; --pl-fuel: #ec8a52; --pl-tce: #b39ae6; --pl-pfas: #f08ab8; --pl-leach: #c9a46a;
}
.phase.p-start i { background: var(--accent); } .phase.p-rd i { background: #1d5f8a; } .phase.p-tog i { background: #a5481a; } .phase.p-show i { background: #6c4fa8; }
.curric-line { max-width: 80ch; margin: 0; }

/* choices shown as chips, and rows of buttons under a model */
.pick-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 650; font-size: 0.97rem; cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip.is-done:not([aria-pressed="true"]) { border-color: var(--st-done); color: var(--st-done); background: var(--st-done-soft); }
.chip:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.pi-row { display: flex; flex-wrap: wrap; gap: 8px; }
.slider-row output { font-family: var(--font-mono); font-size: 0.9rem; min-width: 4.5em; text-align: right; }
.slider-row label { font-weight: 700; }
@media (max-width: 620px) { .slider-row { grid-template-columns: minmax(0, 1fr) auto; } .slider-row input { grid-column: 1 / -1; grid-row: 2; } }
.out-box { display: grid; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); max-width: 860px; }
.out-box p { margin: 0; line-height: 1.5; }

/* ---------- 1. a store that is refilled and used ---------- */
.tk-stage { background: var(--surface); }
.tk-desc { margin: 0; max-width: 75ch; line-height: 1.5; }
.tk-glass { fill: none; stroke: var(--ink-2); stroke-width: 3; }
.tk-water { fill: var(--ws-fresh); stroke: none; }
.tk-soil { fill: var(--ws-soil); stroke: none; }
.tk-in, .tk-outflow { fill: var(--ws-wt); }
.tk-lab { font-family: var(--font-body); font-size: 15px; font-weight: 700; fill: var(--ink); }
.tk-big { font-family: var(--font-display); font-size: 22px; font-weight: 800; fill: var(--ink); paint-order: stroke; stroke: var(--surface); stroke-width: 5px; stroke-linejoin: round; }
.tk-plot { fill: none; stroke: var(--viz-axis); stroke-width: 1; }
.tk-grid { stroke: var(--viz-grid); stroke-width: 1; }
.tk-tick { font-family: var(--font-body); font-size: 13px; fill: var(--viz-muted); }
.tk-line { fill: none; stroke: var(--ws-wt); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.tk-stop { stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 5 4; }
.tk-out { display: grid; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); max-width: 860px; }
div.tk-out p { margin: 0; line-height: 1.5; }
.tk-ok { color: var(--good); } .tk-bad { color: var(--bad); }

/* ---------- 2. the coastal aquifer ---------- */
.cz-sky { fill: var(--sc-sky); }
.cz-sand { fill: var(--ws-sand); }
.cz-base { fill: var(--ws-clay); }
.cz-fresh { fill: var(--ws-fresh-solid); }
.cz-salt { fill: var(--ws-salt); opacity: 0.85; }
.cz-sea { fill: var(--ws-sea); }
.cz-sea-top { stroke: var(--ws-sea-top); stroke-width: 3; }
.cz-sl { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 5; opacity: 0.7; }
.cz-wt { fill: none; stroke: var(--ws-wt); stroke-width: 3; stroke-linejoin: round; }
.cz-iface { fill: none; stroke: var(--ws-iface); stroke-width: 2.5; stroke-dasharray: 8 5; }
.cz-tick { stroke: var(--ink-2); stroke-width: 1.2; }
.cz-head { fill: var(--ink-2); }
.cz-pipe { fill: var(--surface); stroke: var(--ink-2); stroke-width: 1.4; }
.cz-screen { fill: var(--good); stroke: var(--ink); stroke-width: 1; }
.cz-screen.is-salty { fill: var(--bad); }
.cz-lab { font-family: var(--font-body); font-size: 15px; font-weight: 700; fill: var(--sc-ink); paint-order: stroke; stroke: var(--sc-halo); stroke-width: 4px; stroke-linejoin: round; }
.cz-lab-light { fill: #ffffff; stroke: rgba(15, 40, 60, 0.5); }
.cz-small { font-family: var(--font-body); font-size: 13px; fill: var(--sc-ink); paint-order: stroke; stroke: var(--sc-halo); stroke-width: 3.5px; stroke-linejoin: round; }
.cz-read { font-family: var(--font-body); font-size: 13.5px; font-weight: 700; fill: var(--sc-ink); paint-order: stroke; stroke: var(--sc-halo); stroke-width: 4px; stroke-linejoin: round; }
.cz-lead { stroke: var(--sc-ink); stroke-width: 1.2; }
.cz-status { font-family: var(--font-body); font-size: 14px; font-weight: 800; paint-order: stroke; stroke: var(--sc-halo); stroke-width: 4px; stroke-linejoin: round; }
.cz-status.is-fresh { fill: var(--good); } .cz-status.is-salty { fill: var(--bad); }
.cz-stage { background: var(--sc-sky); }
.cz-goal { padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); line-height: 1.5; max-width: 860px; }
.cz-ticks { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.cz-ticks span { display: inline-flex; align-items: center; gap: 6px; font-size: 0.95rem; }
.cz-ticks span::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ink-2); flex: none; }
.cz-ticks span.is-on::before { border: 0; background: var(--st-done); -webkit-mask: var(--i-check) center / 18px no-repeat; mask: var(--i-check) center / 18px no-repeat; }
.cz-out { display: grid; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); max-width: 860px; }
.cz-out p { margin: 0; line-height: 1.5; }
.cz-ok { color: var(--good); } .cz-bad { color: var(--bad); }

/* ---------- 3. tracing pollution ---------- */
.pl-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .pl-grid { grid-template-columns: minmax(0, 1fr); } }
.pl-stage { background: var(--ws-land); }
.pl-side { display: grid; gap: 12px; align-content: start; }
.pl-bores { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-card { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); display: grid; gap: 4px; }
.pl-card p { margin: 0; line-height: 1.5; }
.pl-chem { font-weight: 800; font-size: 1.05rem; }
.pl-sites { display: grid; gap: 6px; }
.pl-site { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.pl-site:hover { border-color: var(--accent); }
.pl-site.is-right { border-color: var(--good); background: var(--good-soft); }
.pl-site.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.pl-site:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.pl-ico { width: 16px; height: 16px; border-radius: 4px; flex: none; }
.pl-land { fill: var(--ws-land); }
.pl-sea { fill: var(--ws-sea); }
.pl-contour { fill: none; stroke: var(--ws-wt); stroke-width: 1.3; stroke-dasharray: 6 5; opacity: 0.7; }
.pl-clab { font-family: var(--font-body); font-size: 12.5px; font-weight: 700; fill: var(--ws-wt); paint-order: stroke; stroke: var(--ws-land); stroke-width: 4px; stroke-linejoin: round; }
.pl-flow { stroke: var(--ws-wt); stroke-width: 2.4; fill: none; }
.pl-arrowhead { fill: var(--ws-wt); }
.pl-scale { stroke: var(--sc-ink); stroke-width: 3; }
.pl-small, .pl-lab { font-family: var(--font-body); font-size: 14.5px; font-weight: 700; fill: var(--sc-ink); }
.pl-lab { fill: #ffffff; font-size: 16px; }
.pl-sq { stroke: #ffffff; stroke-width: 2; }
.pl-num { font-family: var(--font-mono); font-size: 13px; font-weight: 700; fill: #ffffff; }
.pl-name { font-family: var(--font-body); font-size: 15px; font-weight: 700; fill: var(--sc-ink); paint-order: stroke; stroke: var(--ws-land); stroke-width: 4px; stroke-linejoin: round; }
.pl-bore { fill: var(--surface); stroke: var(--sc-ink); stroke-width: 2.5; cursor: pointer; }
.pl-bore-dot { fill: var(--sc-ink); pointer-events: none; }
.pl-boremark.is-current .pl-bore { stroke: var(--focus); stroke-width: 4; }
.pl-blab { font-family: var(--font-body); font-size: 15.5px; font-weight: 800; fill: var(--sc-ink); paint-order: stroke; stroke: var(--ws-land); stroke-width: 4px; stroke-linejoin: round; pointer-events: none; }
.pl-plume { stroke-width: 1.5; fill-opacity: 0.35; }
.pl-nitrate { fill: var(--pl-nitrate); background: var(--pl-nitrate); } .pl-pnitrate { fill: var(--pl-nitrate); stroke: var(--pl-nitrate); }
.pl-fuel { fill: var(--pl-fuel); background: var(--pl-fuel); } .pl-pfuel { fill: var(--pl-fuel); stroke: var(--pl-fuel); }
.pl-tce { fill: var(--pl-tce); background: var(--pl-tce); } .pl-ptce { fill: var(--pl-tce); stroke: var(--pl-tce); }
.pl-pfas { fill: var(--pl-pfas); background: var(--pl-pfas); } .pl-ppfas { fill: var(--pl-pfas); stroke: var(--pl-pfas); }
.pl-leach { fill: var(--pl-leach); background: var(--pl-leach); } .pl-pleach { fill: var(--pl-leach); stroke: var(--pl-leach); }

/* ---------- 5. dryland salinity ---------- */
.sa-stage { background: var(--sc-sky); }
.sa-sky { fill: var(--sc-sky); }
.sa-regolith { fill: var(--ws-land); }
.sa-bedrock { fill: var(--ws-rock); }
.sa-ground-line { fill: none; stroke: var(--ws-soil); stroke-width: 4; }
.sa-wet { fill: var(--ws-fresh); }
.sa-wt { fill: none; stroke: var(--ws-wt); stroke-width: 3; }
.sa-salt { fill: var(--ws-crust); stroke: var(--ws-crust-line); stroke-width: 0.8; }
.sa-trunk { stroke: #6b4b2a; stroke-width: 3; }
.sa-tree { fill: var(--ws-tree); }
.sa-root { stroke: #6b4b2a; stroke-width: 1.5; stroke-dasharray: 3 3; opacity: 0.7; }
.sa-crop { stroke: var(--ws-crop); stroke-width: 2.2; stroke-linecap: round; fill: none; }
.sa-deadcrop { stroke: var(--ws-dead); stroke-width: 2; stroke-linecap: round; fill: none; }
.sa-soak { stroke: var(--ws-wt); stroke-width: 2.4; fill: none; }
.sa-arrowhead { fill: var(--ws-wt); }
.sa-small { font-family: var(--font-body); font-size: 13px; font-weight: 700; fill: var(--sc-ink); paint-order: stroke; stroke: var(--sc-halo); stroke-width: 3.5px; stroke-linejoin: round; }
.sa-wtlab { fill: var(--ws-wt); }
.sa-out { display: grid; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); max-width: 860px; }
.sa-out p { margin: 0; line-height: 1.5; }
.sa-bad { color: var(--bad); }
.cz-grain { fill: var(--ws-sand-dot); opacity: 0.55; }
.cz-grains { pointer-events: none; }
.pl-ask { margin: 0; font-weight: 700; }
.sa-light { fill: #ffffff; stroke: rgba(0, 0, 0, 0.35); }

/* ---------- 2. the Great Artesian Basin ---------- */
.gab-stage { background: var(--sc-sky); }
.gab-sky { fill: var(--sc-sky); }
.gab-confining { fill: var(--ws-clay); }
.gab-basement { fill: var(--ws-rock); }
.gab-aquifer { fill: var(--ws-fresh-solid); stroke: var(--ws-sand-dot); stroke-width: 1; }
.gab-ground { fill: none; stroke: var(--ws-soil); stroke-width: 4; stroke-linejoin: round; }
.gab-rain { stroke: var(--ws-wt); stroke-width: 2; stroke-linecap: round; }
.gab-pot { fill: none; stroke: var(--ws-wt); stroke-width: 2.6; stroke-dasharray: 9 6; }
.gab-small { font-family: var(--font-body); font-size: 13.5px; font-weight: 700; fill: var(--sc-ink); paint-order: stroke; stroke: var(--sc-halo); stroke-width: 3.5px; stroke-linejoin: round; }
.gab-light { fill: #ffffff; stroke: rgba(0, 0, 0, 0.35); }
.gab-potlab { fill: var(--ws-wt); }
.gab-lab { font-family: var(--font-body); font-size: 15px; font-weight: 800; fill: var(--sc-ink); paint-order: stroke; stroke: var(--sc-halo); stroke-width: 4px; stroke-linejoin: round; }
.gab-pipe { fill: var(--surface); stroke: var(--ink-2); stroke-width: 1.2; }
.gab-fountain { fill: none; stroke: var(--ws-wt); stroke-width: 2.4; stroke-linecap: round; }
.gab-drain { stroke: var(--ws-wt); stroke-width: 4; stroke-linecap: round; opacity: 0.8; }
.gab-steam { fill: none; stroke: var(--ink-2); stroke-width: 1.3; opacity: 0.6; }
.gab-valve { fill: var(--good); }
.gab-piped { fill: none; stroke: var(--ink-2); stroke-width: 2.5; }
.gab-trough { fill: var(--ws-fresh-solid); stroke: var(--ink-2); stroke-width: 1.4; }
.gab-pump { fill: var(--ink-2); }
.gab-mound { fill: #8f9a6a; stroke: #5d6a3c; stroke-width: 1.5; }
.gab-mound.is-dry { fill: var(--ws-land); stroke: var(--ws-dead); stroke-dasharray: 3 3; }
.gab-pool { fill: var(--ws-wt); }
.gab-time { display: grid; gap: 8px; }
.gab-decide { padding: 12px 14px; border-radius: 12px; border: 2px solid var(--accent); background: var(--surface); display: grid; gap: 8px; max-width: 860px; }
.gab-decide p { margin: 0; line-height: 1.5; }
.gab-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 700px) { .gab-charts { grid-template-columns: minmax(0, 1fr); } }
.gab-charts svg { display: block; width: 100%; height: auto; background: var(--viz-surface); border: 1px solid var(--line); border-radius: 10px; }
.gab-ct { font-family: var(--font-body); font-size: 13px; font-weight: 700; fill: var(--ink); }
.gab-cline { fill: none; stroke: var(--ws-wt); stroke-width: 2.6; stroke-linejoin: round; }
.gab-real { fill: var(--viz-2); stroke: var(--viz-surface); stroke-width: 2; }
.rd-map { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 960px) { .rd-map { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .rd-map { grid-template-columns: minmax(0, 1fr); } }
.gab-fault { stroke: var(--ws-wt); stroke-width: 1.6; stroke-dasharray: 3 3; }
.gab-dline { stroke: var(--ink-2); stroke-width: 1.2; stroke-dasharray: 4 4; }

/* ---------- 5. water for a city ---------- */
.sb-chart svg { display: block; width: 100%; height: auto; }
.sb-grid { stroke: var(--viz-grid); stroke-width: 1; }
.sb-tick { font-family: var(--font-body); font-size: 13px; fill: var(--viz-muted); }
.sb-year { font-family: var(--font-body); font-size: 14px; font-weight: 700; fill: var(--ink); }
.sb-in { font-family: var(--font-body); font-size: 13px; font-weight: 700; fill: #10171a; pointer-events: none; }
.sb-local { fill: var(--viz-1); } .sb-murray { fill: var(--viz-2); } .sb-desal { fill: var(--viz-3); }
.legend .sw.sb-local-sw { background: var(--viz-1); } .legend .sw.sb-murray-sw { background: var(--viz-2); } .legend .sw.sb-desal-sw { background: var(--viz-3); }
.cp-story { margin: 0; max-width: 75ch; line-height: 1.5; }
.cp-bar svg { display: block; width: 100%; height: auto; background: var(--viz-surface); border: 1px solid var(--line); border-radius: 10px; }
.cp-need { stroke: var(--ink); stroke-width: 2.5; stroke-dasharray: 6 4; }
.cp-needlab { font-family: var(--font-body); font-size: 14px; font-weight: 700; fill: var(--ink); }
.rc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; max-width: 860px; }
.rc-grid input, .rc-grid select { width: 100%; min-height: 44px; border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 12px; font: inherit; font-size: 1.04rem; color: var(--ink); background-color: var(--surface); }
.rc-grid input:focus, .rc-grid select:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); outline-offset: 0; }
.rc-out { display: grid; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); max-width: 860px; }
.rc-out p { margin: 0; line-height: 1.5; }
.rc-sum { font-size: 1.08rem; }
/* stormwater at Salisbury, step by step */
.sw-sky { fill: var(--sc-sky); }
.sw-ground { fill: var(--ws-land); }
.sw-clay { fill: var(--ws-clay); }
.sw-aquifer { fill: var(--ws-fresh-solid); stroke: var(--ws-sand-dot); stroke-width: 1; }
.sw-sea { fill: var(--ws-sea); }
.sw-seatop { stroke: var(--ws-sea-top); stroke-width: 3; }
.sw-small { font-family: var(--font-body); font-size: 13.5px; font-weight: 700; fill: var(--sc-ink); paint-order: stroke; stroke: var(--sc-halo); stroke-width: 3.5px; stroke-linejoin: round; }
.sw-light { fill: #ffffff; stroke: rgba(0, 0, 0, 0.35); }
.sw-lab { font-family: var(--font-body); font-size: 15px; font-weight: 800; fill: var(--sc-ink); paint-order: stroke; stroke: var(--sc-halo); stroke-width: 4px; stroke-linejoin: round; }
.sw-house { fill: var(--surface); stroke: var(--ink-2); stroke-width: 1.5; }
.sw-roof { fill: none; stroke: #a5481a; stroke-width: 3; stroke-linejoin: round; }
.sw-road { fill: var(--ink-2); }
.sw-wet { fill: var(--ws-fresh-solid); stroke: var(--ws-wt); stroke-width: 1.2; }
.sw-reed { stroke: var(--ws-tree); stroke-width: 2; stroke-linecap: round; }
.sw-pump { fill: var(--ink-2); }
.sw-pipe { fill: var(--surface); stroke: var(--ink-2); stroke-width: 1.2; }
.sw-grass { stroke: var(--ws-tree); stroke-width: 5; stroke-linecap: round; }
.sw-tree { fill: var(--ws-tree); }
.sw-trunk { stroke: #6b4b2a; stroke-width: 3; }
.sw-rain { stroke: var(--ws-wt); stroke-width: 2; stroke-linecap: round; }
.sw-flow { fill: none; stroke: var(--ws-wt); stroke-width: 3; stroke-linecap: round; }
.sw-arrowhead { fill: var(--ws-wt); }
.sw-badge { fill: var(--accent); }
.sw-badge-n { font-family: var(--font-mono); font-size: 14px; font-weight: 700; fill: #ffffff; }
.sw-clean { stroke: var(--ws-wt); stroke-width: 3; stroke-dasharray: 4 5; }
.sw-plume { fill: var(--ws-fresh); stroke: var(--ws-wt); stroke-width: 1.5; stroke-dasharray: 5 4; }
.sw-spray { fill: none; stroke: #6c4fa8; stroke-width: 2; }
.sw-purple { stroke: #6c4fa8; stroke-width: 5; stroke-linecap: round; }
.sw-seagrass { fill: none; stroke: var(--ws-tree); stroke-width: 3; stroke-linecap: round; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sw-spray, :root:not([data-theme="light"]) .sw-purple { stroke: #b39ae6; } }
:root[data-theme="dark"] .sw-spray, :root[data-theme="dark"] .sw-purple { stroke: #b39ae6; }
.sb-chart rect[data-i] { cursor: pointer; transition: opacity 0.15s; }
.sb-chart rect.is-dim { opacity: 0.45; }
@media (prefers-reduced-motion: reduce) { .sb-chart rect[data-i] { transition: none; } }
.ucards.c3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.ucards.c2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.ucards.c1 { grid-template-columns: minmax(0, 46rem); }
.st-sum { margin-top: 12px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pl-num { fill: #10171a; } }
:root[data-theme="dark"] .pl-num { fill: #10171a; }

/* ===================== Energy ===================== */
/* entity colours: one colour per source, the same everywhere in the lesson.
   Stacked in the order nuclear, coal, geothermal, wind, solar, bioenergy, battery, gas, other states;
   the chromatic neighbours were checked with the dataviz palette script in light and dark. */
:root { --e-nuclear: #e87ba4; --e-coal: #5c5b56; --e-geo: #1baf7a; --e-wind: #2a78d6; --e-solar: #eda100; --e-bio: #008300; --e-bat: #6250d6; --e-gas: #eb6834; --e-imp: #b9b8ae; --g-short: #d03b3b; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --e-nuclear: #d55181; --e-coal: #8f8e86; --e-geo: #199e70; --e-wind: #3987e5; --e-solar: #c98500; --e-bio: #008300; --e-bat: #9085e9; --e-gas: #d95926; --e-imp: #5d6a6e; }
}
:root[data-theme="dark"] { --e-nuclear: #d55181; --e-coal: #8f8e86; --e-geo: #199e70; --e-wind: #3987e5; --e-solar: #c98500; --e-bio: #008300; --e-bat: #9085e9; --e-gas: #d95926; --e-imp: #5d6a6e; }
.e-nuclear { fill: var(--e-nuclear); background: var(--e-nuclear); }
.e-coal { fill: var(--e-coal); background: var(--e-coal); }
.e-geo { fill: var(--e-geo); background: var(--e-geo); }
.e-wind { fill: var(--e-wind); background: var(--e-wind); }
.e-solar { fill: var(--e-solar); background: var(--e-solar); }
.e-bio { fill: var(--e-bio); background: var(--e-bio); }
.e-bat { fill: var(--e-bat); background: var(--e-bat); }
.e-gas { fill: var(--e-gas); background: var(--e-gas); }
.e-imp { fill: var(--e-imp); background: var(--e-imp); }
.sw.e-nuclear-sw { background: var(--e-nuclear); } .sw.e-coal-sw { background: var(--e-coal); } .sw.e-geo-sw { background: var(--e-geo); }
.sw.e-wind-sw { background: var(--e-wind); } .sw.e-solar-sw { background: var(--e-solar); } .sw.e-bio-sw { background: var(--e-bio); }
.sw.e-bat-sw { background: var(--e-bat); } .sw.e-gas-sw { background: var(--e-gas); } .sw.e-imp-sw { background: var(--e-imp); }
.sw.g-demand-sw { background: var(--ink); height: 3px; border-radius: 2px; }
.sw.g-short-sw { background: var(--g-short); }
.mx-name .sw, .slider-row label .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; }

/* the decision matrix: a column on an evidence screen */
.mx-block { display: grid; gap: 10px; }
.mx-block + .mx-block { border-top: 1px solid var(--line); padding-top: 16px; }
.mx-q { margin: 0; font-size: 1.02rem; max-width: 72ch; }
.mx-rule { margin: 0; color: var(--ink-2); }
.mx-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 8px; }
.mx-item { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; align-content: start; background: var(--surface); }
.mx-item.is-moved { border-color: var(--accent); }
.mx-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.mx-name b { font-size: 1rem; }
.mx-ctl { display: inline-flex; align-items: center; gap: 6px; }
.mx-btn { width: 36px; height: 36px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; font-size: 1.1rem; cursor: pointer; }
.mx-btn:hover:not(:disabled) { border-color: var(--accent); }
.mx-btn:disabled { opacity: 0.35; cursor: default; }
.mx-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.mx-sc { display: inline-flex; align-items: center; gap: 8px; }
.mx-sc output { font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink-2); min-width: 4.2em; }
.mx-dots { display: inline-flex; gap: 3px; }
.mx-dots i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--ink-2); display: block; }
.mx-dots i.on { background: var(--ink); border-color: var(--ink); }
.mx-ev { margin: 0; font-size: 0.93rem; line-height: 1.45; color: var(--ink-2); }
.mx-moved { margin: 0; color: var(--accent); }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.mx-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.mx-foot p { margin: 0; }
.is-added [data-add] { background: var(--st-done-soft, var(--good-soft)); border-color: var(--good); color: var(--good); }

/* the small picture of the whole matrix on the start screen */
.mx-mini { display: grid; grid-template-columns: minmax(84px, auto) repeat(6, minmax(0, 1fr)); gap: 3px; max-width: 560px; font-size: 0.8rem; }
.mx-mh { font-family: var(--font-mono); font-size: 0.7rem; color: var(--ink-2); text-align: center; padding: 2px 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-mh.on { color: var(--ink); font-weight: 700; }
.mx-mo { font-weight: 650; padding-right: 6px; align-self: center; }
.mx-mc { height: 22px; border-radius: 5px; border: 1px dashed var(--line); font-family: var(--font-mono); font-size: 0.75rem; display: grid; place-items: center; color: var(--ink); }
.mx-mc.s1 { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border-style: solid; }
.mx-mc.s2 { background: color-mix(in srgb, var(--accent) 25%, var(--surface)); border-style: solid; }
.mx-mc.s3 { background: color-mix(in srgb, var(--accent) 42%, var(--surface)); border-style: solid; }
.mx-mc.s4 { background: color-mix(in srgb, var(--accent) 62%, var(--surface)); border-style: solid; color: var(--accent-ink); }
.mx-mc.s5 { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.mx-mini-note { margin: 8px 0 0; }

/* the Weigh screen */
.mx-weights, .mx-cuts, .mx-rank, .mx-compare { display: grid; gap: 10px; }
.mx-weights h4, .mx-cuts h4, .mx-rank h4, .mx-compare h4 { margin: 0; font-size: 1.02rem; }
.mx-cuts p { margin: 0; }
.mx-cutlist { display: grid; gap: 6px; }
.mx-cut { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; }
.mx-cut input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.mx-cut:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.mx-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mx-bars li { display: grid; grid-template-columns: minmax(96px, 9.5em) minmax(0, 1fr) minmax(3.2em, auto); gap: 10px; align-items: center; }
.mx-bn { font-weight: 650; }
.mx-bt { height: 20px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.mx-bf { display: block; height: 100%; border-radius: 0 6px 6px 0; }
.mx-bv { font-family: var(--font-mono); font-size: 0.85rem; text-align: right; }
.mx-bars li.is-top .mx-bn { color: var(--accent); }
.mx-bars li.is-top .mx-bt { outline: 2px solid var(--accent); outline-offset: 2px; }
.mx-bars li.is-out { opacity: 0.6; }
.mx-bars li.is-out .mx-bf { background: var(--viz-dim); }
.mx-bars li.is-out .mx-bv { font-family: var(--font-body); font-size: 0.85rem; text-align: left; grid-column: 2 / -1; }
.mx-bars li.is-out .mx-bt { display: none; }
.mx-sens { margin: 0; max-width: 72ch; }
.mx-tablewrap summary { cursor: pointer; font-weight: 650; padding: 6px 0; }
.mx-table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
.mx-table caption { text-align: left; caption-side: top; padding: 8px 10px 6px; color: var(--ink-2); font-size: 0.88rem; }
.mx-table th, .mx-table td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; }
.mx-table .tbl-num { text-align: right; font-variant-numeric: tabular-nums; }
.mx-table .mx-wrow th, .mx-table .mx-wrow td { color: var(--ink-2); border-bottom: 0; }
.mx-notyet { font-weight: 400; color: var(--ink-2); font-size: 0.78rem; }
.mx-hi { font-weight: 800; color: var(--accent); }
@media (max-width: 620px) {
  .mx-list { grid-template-columns: minmax(0, 1fr); }
  .mx-bars li { grid-template-columns: minmax(0, 1fr) auto; }
  .mx-bars li .mx-bt { grid-column: 1 / -1; grid-row: 2; }
  .mx-mini { grid-template-columns: minmax(64px, auto) repeat(6, minmax(0, 1fr)); font-size: 0.72rem; }
}

/* the grid model */
.g-chart svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.g-chart svg:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.g-area { stroke: var(--viz-surface); stroke-width: 0.6; }
.g-area.e-nuclear { fill: var(--e-nuclear); } .g-area.e-coal { fill: var(--e-coal); } .g-area.e-geo { fill: var(--e-geo); }
.g-area.e-wind { fill: var(--e-wind); } .g-area.e-solar { fill: var(--e-solar); } .g-area.e-bio { fill: var(--e-bio); }
.g-area.e-bat { fill: var(--e-bat); } .g-area.e-gas { fill: var(--e-gas); } .g-area.e-imp { fill: var(--e-imp); }
.g-demand { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.g-short { fill: var(--g-short); opacity: 0.85; }
.g-socarea { fill: var(--e-bat); opacity: 0.55; }
.g-bad { color: var(--bad); }
.mix-sliders { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 12px 28px; margin: 6px 0 14px; }
.mix-sliders .slider-row label { font-weight: 650; }
.mix-sliders .slider-row .small { font-weight: 400; display: block; color: var(--ink-2); }
.mix-res { border-collapse: collapse; width: 100%; font-size: 0.92rem; min-width: 640px; }
.mix-res caption { text-align: left; padding: 8px 10px 6px; color: var(--ink-2); font-size: 0.88rem; }
.mix-res th, .mix-res td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; }
.mix-res .tbl-num { text-align: right; font-variant-numeric: tabular-nums; }
.mix-res tr.is-cur th { color: var(--accent); }
.mix-goals { margin: 4px 0 0; padding-left: 1.2em; display: grid; gap: 4px; }
.mix-goals li.is-done { color: var(--good); }

/* collecting the energy */
.fl-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fl-step { display: grid; gap: 4px; }
.fl-t { margin: 0; display: flex; justify-content: space-between; gap: 12px; }
.fl-v { font-family: var(--font-mono); font-size: 0.9rem; }
.fl-bar { display: flex; height: 18px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.fl-fill { display: block; height: 100%; }
.fl-lost { display: block; height: 100%; background: repeating-linear-gradient(135deg, var(--viz-dim) 0 4px, transparent 4px 8px); opacity: 0.9; }
.fl-l { margin: 0; color: var(--ink-2); }
.fl-sum { margin: 6px 0 0; font-weight: 650; max-width: 72ch; }
.fl-src { margin: 0; }
.wc-chart svg { display: block; width: 100%; height: auto; }
.wc-chart .c-dot2 { stroke: var(--viz-surface); stroke-width: 2; }

/* hot rocks cross-section */
:root { --hr-sed: #d9c49b; --hr-bed: #b79e70; --hr-gran: #b9a9a3; --hr-h0: #f2b27a; --hr-h1: #d4552b; --hr-xtal: #8e7f79; --hr-cold: #2a78d6; --hr-hot: #d43d2a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --hr-sed: #5e5240; --hr-bed: #7d6c4d; --hr-gran: #5d5552; --hr-h0: #8a4a28; --hr-h1: #a8361a; --hr-xtal: #8c807b; --hr-cold: #5d9be8; --hr-hot: #f07a5f; } }
:root[data-theme="dark"] { --hr-sed: #5e5240; --hr-bed: #7d6c4d; --hr-gran: #5d5552; --hr-h0: #8a4a28; --hr-h1: #a8361a; --hr-xtal: #8c807b; --hr-cold: #5d9be8; --hr-hot: #f07a5f; }
.hr-sky { fill: var(--sc-sky); }
.hr-sed { fill: var(--hr-sed); }
.hr-bed { fill: none; stroke: var(--hr-bed); stroke-width: 1.2; opacity: 0.8; }
.hr-granite { fill: var(--hr-gran); }
.hr-h0 { stop-color: var(--hr-h0); stop-opacity: 0.35; }
.hr-h1 { stop-color: var(--hr-h1); stop-opacity: 0.85; }
.hr-glow { transition: opacity 0.6s; }
.hr-xtal { fill: var(--hr-xtal); opacity: 0.55; }
.hr-tick { stroke: var(--sc-ink); stroke-width: 1.2; }
.hr-surface { stroke: var(--ws-soil); stroke-width: 4; }
.hr-shrub { fill: #8f9a6a; }
.hr-lab { font-family: var(--font-body); font-size: 15px; font-weight: 800; fill: var(--sc-ink); paint-order: stroke; stroke: var(--sc-halo); stroke-width: 4px; stroke-linejoin: round; }
.hr-small { font-family: var(--font-body); font-size: 13px; fill: var(--sc-ink); paint-order: stroke; stroke: var(--sc-halo); stroke-width: 3.5px; stroke-linejoin: round; }
.hr-lab-l, .hr-small-l { font-family: var(--font-body); fill: #ffffff; paint-order: stroke; stroke: rgba(40, 20, 10, 0.75); stroke-linejoin: round; }
.hr-lab-l { font-size: 15px; font-weight: 800; stroke-width: 4px; }
.hr-small-l { font-size: 13px; font-weight: 700; stroke-width: 3.5px; }
.hr-ah-ink { fill: var(--sc-ink); }
.hr-ah-heat { fill: #ffe08a; stroke: #b4501c; stroke-width: 0.8; }
.hr-ah-cold { fill: var(--hr-cold); }
.hr-ah-hot { fill: var(--hr-hot); }
.hr-badge { fill: var(--accent); stroke: var(--sc-halo); stroke-width: 2; }
.hr-badge-n { font-family: var(--font-body); font-size: 14px; font-weight: 800; fill: var(--accent-ink); }
.hr-decay { fill: #ffe08a; stroke: #b4501c; stroke-width: 1.2; }
.hr-heatup { stroke: #ffe08a; stroke-width: 2; opacity: 0.9; }
.hr-well { fill: var(--surface); stroke: var(--ink-2); stroke-width: 1.2; }
.hr-frac { stroke: #ffffff; stroke-width: 1.6; opacity: 0.8; }
.hr-cold, .hr-hot, .hr-flow { fill: none; stroke-width: 3; stroke-linecap: round; }
.hr-cold { stroke: var(--hr-cold); }
.hr-hot { stroke: var(--hr-hot); }
.hr-flow { stroke: var(--sc-ink); }
.hr-plant { fill: var(--surface); stroke: var(--ink-2); stroke-width: 1.4; }
.hr-plant-t { font-family: var(--font-body); font-size: 12.5px; font-weight: 700; fill: var(--ink); }
.hr-pipe-hot { stroke: var(--hr-hot); stroke-width: 4; }
.hr-pipe-cold { stroke: var(--hr-cold); stroke-width: 4; }
.hr-pylon { fill: none; stroke: var(--ink-2); stroke-width: 2; }
/* temperature against depth */
.gg-chart svg { display: block; width: 100%; height: auto; }
.gg-avg { fill: none; stroke: var(--viz-1); stroke-width: 2.4; }
.gg-hot { fill: none; stroke: var(--viz-2); stroke-width: 2.4; }
.gg-avg-dot { fill: var(--viz-1); stroke: var(--viz-surface); stroke-width: 2; }
.gg-hot-dot { fill: var(--viz-2); stroke: var(--viz-surface); stroke-width: 2; }
.legend .sw.gg-avg-sw { background: var(--viz-1); height: 4px; border-radius: 2px; }
.legend .sw.gg-hot-sw { background: var(--viz-2); height: 4px; border-radius: 2px; }
.mx-weights .slider-row { grid-template-columns: 10.5em minmax(0, 1fr) 7.5em; }
.mix-sliders .slider-row { grid-template-columns: 11em minmax(0, 1fr) 5.4em; }
@media (max-width: 620px) { .mx-weights .slider-row, .mix-sliders .slider-row { grid-template-columns: minmax(0, 1fr) auto; } }
.sb-in-l { fill: #ffffff; }
.sb-seg.e-coal { fill: var(--e-coal); } .sb-seg.e-gas { fill: var(--e-gas); } .sb-seg.e-wind { fill: var(--e-wind); } .sb-seg.e-solar { fill: var(--e-solar); }
.sb-seg.e-bat { fill: var(--e-bat); } .sb-seg.e-imp { fill: var(--e-imp); } .sb-seg.e-geo { fill: var(--e-geo); } .sb-seg.e-bio { fill: var(--e-bio); } .sb-seg.e-nuclear { fill: var(--e-nuclear); }
:root { --g-rust: #b4501c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --g-rust: #d9824f; } }
:root[data-theme="dark"] { --g-rust: #d9824f; }
.dl-sub { margin: 4px 0 -6px; }
/* entity-coloured lines on time charts */
.ln { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.ln.e-coal, .ln.e-gas, .ln.e-nuclear, .ln.e-wind, .ln.e-solar, .ln.e-bio, .ln.e-geo, .ln.e-oil { fill: none; background: none; }
.ln.e-coal { stroke: var(--e-coal); } .ln.e-gas { stroke: var(--e-gas); } .ln.e-nuclear { stroke: var(--e-nuclear); }
.ln.e-bio { stroke: var(--e-bio); } .ln.e-oil { stroke: var(--e-oil); } .ln.e-solar { stroke: var(--e-solar); } .ln.e-ink { stroke: var(--ink); }
.dot-e { stroke: var(--viz-surface); stroke-width: 2; }
.dot-e.e-coal { fill: var(--e-coal); } .dot-e.e-gas { fill: var(--e-gas); } .dot-e.e-nuclear { fill: var(--e-nuclear); } .dot-e.e-bio { fill: var(--e-bio); } .dot-e.e-oil { fill: var(--e-oil); } .dot-e.e-solar { fill: var(--e-solar); } .dot-e.e-ink { fill: var(--ink); }
.legend .sw.e-oil-sw { background: var(--e-oil); } .legend .sw.e-ink-sw { background: var(--ink); }
:root { --e-oil: #6250d6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --e-oil: #9085e9; } }
:root[data-theme="dark"] { --e-oil: #9085e9; }
/* bars that stand for no energy source, and the high part of a range */
.c-bar-n { fill: var(--ink-2); }
.c-rng { opacity: 0.45; }
/* long links in the references can break, so the notes fit a phone */
.more-body li { overflow-wrap: anywhere; }
