/* Belton Dam page (/dam/). Loaded after /css/base.css; everything is scoped to .dam or .dam-hero except the
   colour tokens and the page background, so the shared nav and footer keep their look.
   Layout: the model is the header (B-025): the tabbed stage (3D model / section cut) full bleed from the top of
   the window, the capsule, the title card and the view switch on it. Then the breadcrumb, the model controls, the
   live sentence, the "gates are upstream" idea, readouts, timeline, explainers and the cited facts. Light palette only. */
/* Metric-matched fallbacks, so text does not reflow (and move the 3D stage) when the web fonts arrive. */
@font-face { font-family: "Source Sans 3 Fallback"; src: local("Arial"), local("Helvetica"); size-adjust: 93.76%; ascent-override: 109.21%; descent-override: 42.66%; line-gap-override: 0%; }
@font-face { font-family: "Montserrat Fallback"; src: local("Arial"), local("Helvetica"); size-adjust: 112.83%; ascent-override: 85.79%; descent-override: 22.25%; line-gap-override: 0%; }
:root {
  --liveT: #187A42; --repT: #0D6E72; /* /wind/'s state colours (Live, Replay), each with a glyph and a word */
  --bg: #F3F7FA; --surface: #FFFFFF; --ink: #102A3C; --muted: #4E6A7F; --line: #D2DFE9;
  --accent: #3498DB; --accent-ink: #1C6AA6; --sky-top: #DCEBF5; --sky-bot: #F4F8FB;
  --water: #2F7FB8; --water-deep: #174E78; --water-hi: #8CC4E8; --tail: #3C7FA6;
  --earth: #C9B48F; --earth-dark: #A08C6A; --rock: #7E7A72; --foundation: #8F8676;
  --riprap: #A3A29C; --grassface: #C8A86E; --land: #B5A37E; --woods: #4C6339; --bare: #BDB49E;
  --lakebed: #8C7B5C; --road: #4A5056; --shoulder: #A9A396; --concrete: #C9CDD0; --concrete-dark: #8E969C;
  --steel: #7F8C95; --car: #C0392B; --flow: #FFFFFF; --flow-ink: #0E3A5B; --river: #6F8A9C;
  --warn: #9A5C00; --flood: #B83227; --ok: #2E7D4F; --gate: #E67E22;
  --prov: #62707C; /* provenance notes: 5.1:1 on white, 4.7:1 on --bg and the cite box */
  --font-display: "Montserrat", "Montserrat Fallback", "Segoe UI", system-ui, sans-serif;
  --font-body: "Source Sans 3", "Source Sans 3 Fallback", "Segoe UI", system-ui, sans-serif;
  --step--1: 0.8125rem; --step-0: 1rem; --step-1: 1.1875rem; --step-2: 1.5rem; --step-3: 2.125rem;
  --radius: 10px;
  color-scheme: light;
}
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body.dam-page { background: var(--bg); }
.dam {
  color: var(--ink);
  font-family: var(--font-body); font-size: var(--step-0); line-height: 1.5;
  padding-block: 24px 48px; /* 24 px after the breadcrumb, as every content page (B-019) */
  display: grid; gap: 20px; min-width: 0;
}
.dam .wrap {
  width: 100%; margin: 0; display: grid; gap: 20px; min-width: 0;
  padding-left: max(var(--page-gut), env(safe-area-inset-left, 0px));
  padding-right: max(var(--page-gut), env(safe-area-inset-right, 0px));
}
.dam .wrap > * { min-width: 0; }
.dam h1, .dam h2, .dam h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
.dam h2 { font-size: var(--h-section); font-weight: 700; } /* the site's heading scale (/css/base.css, B-029) */
.dam h2.lead { font-size: var(--step-3); font-weight: 800; line-height: 1.1; }
.dam p { margin: 0; }
.dam a { color: var(--accent-ink); }
.dam .intro { max-width: 75ch; }
.dam .now { font-size: var(--step-1); line-height: 1.45; max-width: 70ch; }
.dam .now strong { font-variant-numeric: tabular-nums; }
.eyebrow { font-family: var(--font-display); font-size: var(--step--1); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
sup.c { font-size: 0.68em; line-height: 0; margin-left: 1px; white-space: nowrap; }
sup.c a { text-decoration: none; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--prov); }
sup.c a:hover { text-decoration: underline; }


/* Controls */
.dam button, .dam .chip {
  font: 600 var(--step--1)/1 var(--font-display); letter-spacing: 0.02em;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 9px 13px; cursor: pointer; min-height: 36px;
}
.dam button:hover, .dam .chip:hover { border-color: var(--accent); }
.dam button[aria-pressed="true"], .dam button[aria-selected="true"] { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.dam button:disabled { opacity: 0.45; cursor: not-allowed; }

/* Model controls, scale note, help and the live sentence, right under the breadcrumb */
.stage-card { display: grid; gap: 10px; }
.stage-card > .wrap { gap: 10px; }
.stage-card .now { margin-top: 6px; }
.stage {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--sky-top), var(--sky-bot) 75%);
}
.stage:active { cursor: grabbing; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.labels { position: absolute; inset: 0; pointer-events: none; }
.lbl {
  position: absolute; left: 0; top: 0; white-space: nowrap;
  font: 600 12px/1.2 var(--font-display); color: var(--ink);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px;
}
.lbl .v { font-variant-numeric: tabular-nums; }
.lbl.muted { font-weight: 500; color: var(--muted); }
.lbl.key { background: var(--accent-ink); color: #fff; border-color: #fff; }
.lbl.gate { background: var(--gate); color: #1b1206; border-color: var(--gate); }
.lbl.flow { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.lbl.spill { background: var(--flood); color: #fff; border-color: var(--flood); }
.lbl::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: 8px; background: currentColor; opacity: .45; }
.lbl.nostem::after { display: none; }
/* Replay (1): the live-value labels take a historic look (light fill, dashed border) whenever the model shows the past. */
.labels.replay .lbl.key, .labels.replay .lbl.flow { background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--ink); border: 1.5px dashed var(--repT); }
/* ============ The model as header (B-025) ============
   The stage fills the top of the window, full bleed (min(76vh, 700px), at least 520 px). The capsule floats on its sky
   in the light form, in the same place as on every page (nav.css). The card (title + the two readings) sits on the
   lower left, the view switch on the lower right, zoom on the right, the credit line under the switch.
   Phones: the stage is 58% of the small viewport, the card docks under it, and pinch replaces the zoom buttons.
   Touch: one-finger up/down swipes always scroll the page; sideways turns; two fingers tilt and zoom (dam.js "touch"). */
.dam-hero { position: relative; display: flex; flex-direction: column; background: var(--bg); font-family: var(--font-body); }
.dam-hero > .stage, .dam-hero > #stageSec {
  order: 1; height: min(76svh, 700px); min-height: min(520px, calc(100svh - 80px));
  touch-action: auto; cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.dam-hero > .stage:focus-visible { outline: none; }
.dam-hero > .stage:focus-visible::before { content: ""; position: absolute; inset: 0; z-index: 8; pointer-events: none; box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 6px var(--accent-ink); }
.dam-hero > .stage:focus-visible::after { content: "Arrow keys turn · + and − zoom"; position: absolute; z-index: 7; left: 50%; top: 86px; transform: translateX(-50%);
  font: 600 13px/1.3 var(--font-display); color: #fff; background: var(--accent-ink); padding: 7px 12px; border-radius: 999px; pointer-events: none; white-space: nowrap; }
#stageSec:focus-visible::after { content: "Arrow keys move · + and − zoom"; }
/* A soft shade under the capsule, so it reads on a bright sky. */
.dam-hero::before { content: ""; position: absolute; z-index: 2; inset: 0 0 auto; height: 120px; pointer-events: none; background: linear-gradient(180deg, rgba(16, 42, 60, 0.10), rgba(16, 42, 60, 0)); }

/* Poster: a still of this framing (labels included), until the first 3D frame and whenever WebGL is missing. */
.poster { position: absolute; inset: 0; z-index: 0; }
.poster img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.dam-hero.is-live .poster { opacity: 0; visibility: hidden; transition: opacity 0.35s ease, visibility 0s linear 0.35s; }
.dam-hero:not(.is-live) .labels { opacity: 0; }
.dam-hero .labels { transition: opacity 0.35s ease 0.15s; }
#stage3d canvas { z-index: 1; }
#stage3d .labels { z-index: 2; }

/* The card */
.dh-card {
  position: absolute; z-index: 6; left: max(var(--page-gut), env(safe-area-inset-left, 0px)); bottom: 28px;
  width: min(420px, calc(100% - 2 * var(--page-gut))); padding: 18px 20px 16px; border-radius: 16px;
  display: grid; gap: 8px; color: var(--ink);
  background: color-mix(in srgb, #fff 90%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: 0 1px 2px rgba(15, 38, 56, 0.06), 0 12px 34px -10px rgba(16, 42, 60, 0.30), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}
.dh-card:focus { outline: none; }
.dh-kicker { margin: 0; font: 600 11px/1.3 var(--font-display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.dh-title { margin: 0; font: 700 clamp(2rem, 3.6vw, 2.875rem)/1.02 var(--font-display); letter-spacing: -0.02em; color: var(--ink); } /* base.css .page-title sizes */
.dh-live { margin: 4px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 22px; border-top: 1px solid var(--line); padding-top: 10px; }
.dh-live > div { min-width: 0; }
.dh-live dt { font: 600 11px/1.3 var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.dh-live dd { margin: 0; }
.dh-v { font: 700 1.6rem/1.15 var(--font-display); font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.dh-v small { font-size: 0.6em; font-weight: 600; color: var(--muted); margin-left: 4px; }
.dh-v .dh-na { font: 600 1rem/1.9 var(--font-display); color: var(--muted); }
.dh-s { font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.dh-asof { margin: 0; font-size: 0.8125rem; line-height: 1.4; color: var(--muted); font-variant-numeric: tabular-nums; }
.dh-asof b { font: 700 0.75rem var(--font-display); letter-spacing: 0.04em; text-transform: uppercase; } /* the Live pill's spacing is the helper's (B-029) */
.dh-asof .st-live { color: var(--liveT); } .dh-asof .st-rec { color: var(--muted); }
.dh-asof .ic { margin-right: 5px; }
.dh-asof-more { display: block; margin-top: 2px; }
.dh-down { margin: 0; font-size: 0.8125rem; line-height: 1.35; color: var(--muted); }
.dh-down b { color: var(--ink); font-variant-numeric: tabular-nums; }
.dh-down sup.c a { color: var(--prov); }
.dh-model { margin: 0; font: 600 0.8125rem/1.3 var(--font-display); color: var(--repT); }
.dh-model .ic { margin-right: 5px; }
.dh-card.dim .dh-live, .dh-card.dim .dh-down { opacity: 0.6; }
.dh-replay.is-sample b { color: var(--muted); }
/* Glyphs shared with /wind/ (wind.css .ic): live dot, replay triangle, stale ring. */
.ic { display: inline-block; flex: none; width: 11px; height: 11px; vertical-align: -1px; background: center/contain no-repeat; }
.ic.live { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Ccircle cx='6' cy='6' r='5' fill='%231E8E4E'/%3E%3C/svg%3E"); }
.ic.rep { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 1L11 6L2 11Z' fill='%230F7C80'/%3E%3C/svg%3E"); }
.ic.stale { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Ccircle cx='6' cy='6' r='4.25' fill='none' stroke='%2356636D' stroke-width='1.5'/%3E%3C/svg%3E"); }
/* Replay badge on the model (1), in /wind/'s map-badge form: glyph + REPLAY + the date + a way back. */
.dh-replay { position: absolute; z-index: 6; left: max(var(--page-gut), env(safe-area-inset-left, 0px)); top: 84px; margin: 0;
  display: inline-flex; align-items: center; gap: 0.45rem; font: 600 13px/1.2 var(--font-display); color: var(--ink);
  background: rgba(255, 255, 255, 0.94); border-radius: 999px; padding: 4px 4px 4px 12px; box-shadow: 0 6px 18px -8px rgba(16, 42, 60, 0.35); }
.dh-replay b { color: var(--repT); font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; }
.dam-hero .dh-replay button { padding: 7px 11px; min-height: 30px; font-size: 0.75rem; }

/* View switch, zoom, credit and notes on the model */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.dh-tabs {
  position: absolute; z-index: 6; right: max(var(--page-gut), env(safe-area-inset-right, 0px)); bottom: 30px;
  gap: 2px; padding: 4px; border-radius: 999px; flex-wrap: nowrap;
  background: color-mix(in srgb, #fff 88%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 1px 2px rgba(15, 38, 56, 0.06), 0 8px 24px -8px rgba(16, 42, 60, 0.28);
}
.dam-hero button { font: 600 var(--step--1)/1 var(--font-display); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.dam-hero .dh-tabs [role="tab"] { border: 0; background: transparent; padding: 9px 15px; min-height: 36px; font: 600 0.875rem/1 var(--font-display); color: var(--ink); border-radius: 999px; }
.dam-hero .dh-tabs [role="tab"][aria-selected="true"] { background: var(--accent-ink); color: #fff; }
.dam-hero button:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 2px; box-shadow: 0 0 0 5px #fff; }
/* Without scripts the drawings and their controls do nothing, so none of them show (6). */
html:not(.js) .dh-tabs, html:not(.js) .zoom-btns, html:not(.js) .stage-tools, html:not(.js) #scaleNote, html:not(.js) #stageHelp { display: none; }
.zoom-btns { position: absolute; z-index: 5; right: max(var(--page-gut), env(safe-area-inset-right, 0px)); top: 50%; transform: translateY(-50%); display: grid; gap: 8px; }
.zoom-btns button { width: 40px; height: 40px; padding: 0; font-size: 18px; border-radius: 12px; box-shadow: 0 6px 18px -6px rgba(16, 42, 60, 0.3); }
.stage-note { position: absolute; z-index: 5; right: max(var(--page-gut), env(safe-area-inset-right, 0px)); bottom: 6px; max-width: min(560px, calc(100% - 20px)); font: 500 11px/1.3 var(--font-body); color: var(--ink); background: color-mix(in srgb, #fff 72%, transparent); padding: 2px 8px; border-radius: 6px; pointer-events: none; text-align: right; }
.stage-note--alert { position: absolute; z-index: 5; right: max(var(--page-gut), env(safe-area-inset-right, 0px)); bottom: 84px; max-width: min(460px, calc(100% - 20px)); font: 600 13px/1.35 var(--font-display); color: var(--ink); padding: 8px 12px; border-radius: 8px; background: color-mix(in srgb, #fff 92%, transparent); box-shadow: 0 6px 18px -8px rgba(16, 42, 60, 0.3); }
.dam-hero .stage-note--alert button { margin-left: 4px; padding: 6px 11px; min-height: 30px; font-size: 0.75rem; background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.stage-badge { position: absolute; z-index: 5; right: max(var(--page-gut), env(safe-area-inset-right, 0px)); top: 86px; background: var(--flood); color: #fff; font: 700 12px/1.2 var(--font-display); padding: 6px 10px; border-radius: 6px; pointer-events: none; }
/* Touch hint: one line, shown briefly (dam.js touchHint). */
.touch-hint { position: absolute; z-index: 5; left: 50%; bottom: 8px; transform: translate(-50%, 4px); max-width: calc(100% - 32px); width: max-content; margin: 0;
  font: 600 13px/1.3 var(--font-display); color: #fff; background: rgba(16, 42, 60, 0.84); padding: 8px 14px; border-radius: 999px; text-align: center;
  opacity: 0; transition: opacity 0.35s ease, transform 0.35s ease; pointer-events: none; }
.touch-hint.on { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 601px) { .touch-hint { top: 84px; bottom: auto; transform: translate(-50%, -4px); } }
@media (prefers-reduced-motion: reduce) {
  .dam-hero.is-live .poster, .dam-hero .labels, .touch-hint { transition: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .dh-card, .dh-tabs { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
/* 8: short landscape screens (phones on their side): a compact card, so the readings stay on the first screen. */
@media (min-width: 601px) and (max-height: 520px) {
  .dh-card { bottom: 12px; padding: 10px 14px 10px; gap: 4px; width: min(400px, calc(100% - 2 * var(--page-gut))); }
  .dh-kicker, .dh-live .dh-s { display: none; }
  .dh-title { font-size: 1.5rem; }
  .dh-live { padding-top: 6px; margin-top: 0; }
  .dh-v { font-size: 1.25rem; }
  /* the switch goes top right, so the basin and its Release label at the lower right stay clear */
  .dh-tabs { bottom: auto; top: 70px; }
  .touch-hint { top: 120px; }
  .stage-note { bottom: 4px; font-size: 10px; padding: 1px 6px; }
  .stage-note .nt-scale { display: none; }
  .zoom-btns { display: none; }
  .dh-replay, .dam-hero > .stage:focus-visible::after { top: 70px; }
}
@media (max-width: 600px) {
  .dam-hero > .stage, .dam-hero > #stageSec { height: 58svh; min-height: min(400px, calc(100svh - 80px)); }
  .dam-hero::before { height: 96px; }
  .dh-card { position: relative; order: 2; left: auto; bottom: auto; width: auto; margin: -24px 12px 0; padding: 14px 16px 12px; gap: 6px;
    background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 10px 28px -14px rgba(16, 42, 60, 0.35), 0 0 0 1px var(--line); }
  .dh-kicker-more { display: none; }
  .dh-title { font-size: clamp(1.625rem, 7.6vw, 1.9375rem); }
  .dh-v { font-size: 1.75rem; }
  /* Phones: the switch sits just under the docked card, centred, so only the capsule floats over the model (10). */
  .dh-tabs { position: static; order: 3; align-self: center; margin: 12px auto 0; }
  .dam-hero .dh-tabs [role="tab"] { padding: 8px 12px; font-size: 0.8125rem; min-height: 34px; }
  .zoom-btns { display: none; }
  /* The credit is one short line at the lower left, clear of the stilling basin and its "Release" label (25). */
  .stage-note { left: 12px; right: auto; bottom: 30px; max-width: none; white-space: nowrap; text-align: left; font-size: 10px; line-height: 1.25; background: color-mix(in srgb, #fff 70%, transparent); padding: 2px 6px; }
  .stage-note .nt-scale, .stage-note .nt-long { display: none; }
  .stage-note--alert { left: 12px; right: 12px; bottom: 74px; max-width: none; font-size: 12px; }
  .stage-badge { right: 12px; top: 80px; }
  .dh-replay { left: 12px; top: 74px; font-size: 12px; }
  .touch-hint { bottom: 28px; font-size: 13px; }
  .stage.hinting .stage-note { visibility: hidden; }
  .dam-hero > .stage:focus-visible::after { top: 74px; }
  /* 28: the three key labels a size up for outdoor reading */
  .lbl.key, .lbl.gate, .lbl.flow { font-size: 12.5px; }
}
.stage-tools { display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.stage-tools .group { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.stage-tools .glabel { font: 600 12px var(--font-display); color: var(--muted); margin-right: 2px; }
.stage-tools .opts .glabel { margin-left: 8px; }
/* 13: "Pause flow" / "Animate flow" is an action, not a selected chip */
.dam button.act { background: transparent; border-style: dashed; }
/* 16: phones: the "Go to" presets on one scrolling row, the options on a second; compact chips */
@media (max-width: 600px) {
  /* 7 (review 2): everything wraps, nothing sits off screen; compact chips */
  .stage-tools { display: grid; gap: 8px; }
  .stage-tools .group { gap: 6px 5px; }
  .stage-tools button { padding: 7px 10px; min-height: 34px; font-size: 0.78rem; }
  .stage-tools .opts .glabel { margin-left: 2px; }
}
.help .how { color: var(--ink); font-weight: 600; }
details.today { max-width: 75ch; }
details.today summary { font: 600 var(--step--1) var(--font-display); color: var(--accent-ink); cursor: pointer; padding: 4px 0; }
details.today .now { font-size: var(--step-0); margin-top: 6px; }
.to-model { font: 600 0.75rem/1 var(--font-display); color: var(--accent-ink); background: var(--surface); border: 1px solid var(--accent-ink); border-radius: 999px; padding: 7px 11px; cursor: pointer; }
.readouts.at-latest .ro-dup { display: none; }
@media (max-width: 600px) { .dam .readouts { grid-template-columns: 1fr 1fr; } .dam .readouts.at-latest { grid-template-columns: 1fr; } }
.ro-title { grid-column: 1 / -1; font: 600 var(--step--1) var(--font-display); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin: 2px 0 0; }
.scale-note { font: 600 13px/1.4 var(--font-display); color: var(--ink); }
.scale-note b { color: var(--accent-ink); }
.help { font-size: 0.78125rem; color: var(--prov); }

/* Key idea */
/* The text fills the box; on wide screens the two paragraphs sit side by side so lines stay a comfortable length. */
.keyidea { display: grid; grid-template-columns: auto 1fr; gap: 14px 20px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.keyidea svg { width: 200px; height: auto; display: block; }
.keyidea .txt { display: grid; gap: 8px; min-width: 0; }
@media (min-width: 1000px) {
  .keyidea .txt { grid-template-columns: 1fr 1fr; gap: 8px 28px; }
  .keyidea .txt > .eyebrow, .keyidea .txt > h2 { grid-column: 1 / -1; }
  .keyidea .txt > h2 { margin-bottom: 4px; }
}
@media (max-width: 560px) { .keyidea { grid-template-columns: 1fr; } .keyidea svg { width: 100%; max-width: 280px; } }

/* Readouts */
.readouts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.ro { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 2px; align-content: start; min-width: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease; }
/* Hover: the site's card lift (2px), only on pointers that hover; no movement with reduced motion. */
@media (hover: hover) {
  .ro:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(16, 42, 60, 0.08); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
}
@media (prefers-reduced-motion: reduce) { .ro { transition: none; } .ro:hover { transform: none; } }
.ro .k { font-size: var(--step--1); color: var(--muted); }
.ro .v { font: 700 var(--step-2)/1.15 var(--font-display); font-variant-numeric: tabular-nums; }
.ro .v small { font-size: 0.55em; font-weight: 600; color: var(--muted); margin-left: 3px; }
.ro .s { font-size: var(--step--1); color: var(--muted); }
.why { font-size: 0.78125rem; color: var(--prov); padding: 0 2px; max-width: 95ch; }

/* Timeline */
.dam .timeline { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.tl-head { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; align-items: center; }
.series { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.series-main, .series-floods, .flood-btns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.series-floods .glabel { font: 600 12px var(--font-display); color: var(--muted); }
.dam .flood-btns button { min-height: 30px; padding: 6px 10px; font-size: 0.75rem; font-weight: 600; background: transparent; color: var(--muted); border-color: var(--line); }
.dam .flood-btns button:hover { color: var(--ink); border-color: var(--accent); }
.dam .flood-btns button[aria-pressed="true"] { background: var(--surface); color: var(--accent-ink); border-color: var(--accent); }
.dam .icon-btn { width: 36px; padding: 0; font-size: 18px; line-height: 1; display: inline-grid; place-items: center; flex: none; }
/* Replay bar: fixed to the bottom of the window while a replay plays and the timeline is off screen, so the stage and its controls are visible together. */
.replay-bar { position: fixed; z-index: 40; left: 50%; transform: translateX(-50%); bottom: max(10px, env(safe-area-inset-bottom, 0px));
  width: min(560px, calc(100% - 24px)); display: flex; gap: 10px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 6px; box-shadow: 0 6px 24px rgba(16, 42, 60, 0.18); }
.replay-bar .rb-text { flex: 1; min-width: 0; font: 600 13px/1.25 var(--font-display); font-variant-numeric: tabular-nums; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) { .replay-bar { border-radius: 18px; } .replay-bar .rb-text { white-space: normal; font-size: 12.5px; } }
.tl-date { font: 700 var(--step-1)/1.2 var(--font-display); font-variant-numeric: tabular-nums; }
.tl-row { display: flex; gap: 10px; align-items: center; }
.tl-row input[type="range"] { flex: 1; min-width: 0; accent-color: var(--accent-ink); height: 28px; -webkit-appearance: none; appearance: none; background: transparent; }
.tl-row input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--accent-ink) var(--fill, 100%), var(--line) var(--fill, 100%)); }
.tl-row input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--line); }
.tl-row input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--accent-ink); }
.tl-row input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent-ink); box-shadow: 0 1px 4px rgba(16, 42, 60, 0.25); }
.tl-row input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent-ink); }
.charts { width: 100%; height: auto; display: block; touch-action: none; cursor: crosshair; }
.charts text { font: 500 11px var(--font-body); fill: var(--muted); }
.charts .ttl { font: 700 11px var(--font-display); fill: var(--ink); letter-spacing: 0.04em; }
.src { font-size: 0.78125rem; color: var(--prov); }
.dam h2 .h-sub { font: 600 var(--step--1) var(--font-body); color: var(--muted); letter-spacing: 0; white-space: nowrap; }
@media (max-width: 600px) { .dam h2 .h-sub { display: block; margin-top: 4px; } } /* phones: the note on its own line (B-029) */
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: var(--step--1); color: var(--muted); }
.legend i { display: inline-block; width: 18px; height: 0; border-top: 2.5px solid var(--accent); vertical-align: middle; margin-right: 6px; }
.legend i.dash { border-top: 2px dashed var(--river); }

.zone { display: grid; gap: 8px; }
.zonebar { position: relative; height: 34px; }
.zonebar .seg { position: absolute; top: 8px; height: 14px; }
.zonebar .mark { position: absolute; top: 4px; width: 2px; height: 22px; background: var(--ink); border-radius: 2px; transform: translateX(-1px); }
.zonebar .tick { position: absolute; top: 26px; font-size: 11px; color: var(--muted); transform: translateX(-50%); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pill { display: inline-flex; align-items: center; gap: 6px; font: 700 12px/1 var(--font-display); padding: 6px 10px; border-radius: 999px; border: 1px solid currentColor; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.panel p, .panel li { max-width: 68ch; }
.panel ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.meter { display: grid; gap: 4px; }
.meter .bar { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.meter .bar > span { display: block; height: 100%; background: var(--accent); border-radius: 5px; min-width: 2px; }
.meter .lab { display: flex; justify-content: space-between; gap: 8px; font-size: var(--step--1); color: var(--muted); }
.meter .lab b { color: var(--ink); font-variant-numeric: tabular-nums; }
.equiv { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.equiv div { display: grid; gap: 2px; }
.equiv b { font: 700 var(--step-1)/1.2 var(--font-display); font-variant-numeric: tabular-nums; }
.equiv span { font-size: var(--step--1); color: var(--muted); }
details.facts { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
details.facts summary { font: 700 var(--step-0) var(--font-display); cursor: pointer; }
.facts-body { display: grid; gap: 18px; margin-top: 12px; }
.facts-body h3 { font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 6px; }
.facts-body ul, .facts-body ol { margin: 0; padding-left: 20px; display: grid; gap: 5px; font-size: 0.875rem; color: var(--prov); }
.facts-body ul b { color: var(--muted); }
.facts-body a { color: var(--accent-ink); }
.facts-body ol li { scroll-margin-top: 16px; }
.facts-body ol li:target { background: color-mix(in srgb, var(--accent) 18%, transparent); border-radius: 4px; }
.tbl { overflow-x: auto; }
.tbl table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.tbl td, .tbl th { text-align: left; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font: 600 12px var(--font-display); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.tbl td.n { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.status { font-size: 0.78125rem; color: var(--prov); }
/* History list */
.hist { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.hist li { display: grid; grid-template-columns: 4.5rem 1fr; gap: 10px; max-width: 75ch; }
.hist .yr { font: 700 var(--step-0) var(--font-display); font-variant-numeric: tabular-nums; color: var(--accent-ink); }
@media (max-width: 560px) {
  .dam h2.lead { font-size: 1.75rem; }
  .ro .v { font-size: 1.3rem; }
  .lbl { font-size: 11px; padding: 2px 6px; }
}

@media (max-width: 600px) {
  .dam .now { font-size: 1.0625rem; }
}
/* Breadcrumb row (partials/breadcrumb.njk), lined up with .wrap and themed. */
/* body.dam-page .breadcrumb: the wide page column (base.css .page-wide) */
body.dam-page .breadcrumb ol, body.dam-page .breadcrumb [aria-current], body.dam-page .breadcrumb li + li::before { color: var(--muted); }
body.dam-page .breadcrumb a { color: var(--ink); }
body.dam-page .breadcrumb a:hover { color: var(--accent-ink); }
.dam .charts { height: 260px; } /* fixed, so redrawing at the real width does not shift the page */

/* Phone tap targets at least 44 px (B-029): the model controls, the timeline and the details toggles.
   html raises these over the rules above (some sit in their own phone media queries). */
@media (pointer: coarse), (max-width: 760px) {
  html .dam button, html .dam .chip, html .dam-hero .dh-tabs [role="tab"], html .stage-tools button,
  html .dam .flood-btns button, html .dam-hero .dh-replay button, html .dam-hero .stage-note--alert button { min-height: 44px; }
  html .dam .icon-btn { width: 44px; }
  html .zoom-btns button { width: 44px; height: 44px; }
  html .tl-row input[type="range"] { height: 44px; }
  html details.today summary, html details.facts summary { min-height: 44px; padding: 11px 0; box-sizing: border-box; }
}
