/*
 * Surface Water Data Portal — the visual world.
 *
 * The one non-obvious decision this file embodies: brand colour and flood
 * status are kept in two token families that must never touch. `--accent-*` is
 * channel blue-green, the dark waterline of Coyote Creek, and it carries links,
 * buttons and identity. `--stage-*` carries how high the water is against a
 * published threshold, and nothing else. On a site whose entire job is telling
 * a resident whether a creek is about to leave its channel, a brand colour that
 * can be read as a warning state is a safety defect, not a taste question.
 *
 * Everything else follows one primitive: the stage column. A vertical bar with
 * the thresholds ruled across it, at every scale from a 30px sparkline in a row
 * to the full-height instrument on a gauge page.
 */

/* ── Faces ─────────────────────────────────────────────────────────────────
 * Display is condensed because gauge plates and topographic sheets are; body
 * is open because it gets read at 3am on a phone; mono is reserved strictly
 * for measured values so a column of readings aligns on the decimal.
 */
@font-face {
  font-family: "Sofia Sans Extra Condensed";
  src: url("fonts/sofia-sans-extra-condensed-var.woff2") format("woff2-variations");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fustat";
  src: url("fonts/fustat-var.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
:root {
  /* Channel ramp — shifted toward Valley Water's official mark blue
     (#0082ca) while keeping AA-safe link/button contrast. Status tokens
     stay separate; this family never carries flood stage. */
  --accent-50: #e8f4f9;
  --accent-100: #cce7f2;
  --accent-200: #9dcee5;
  --accent-300: #6bb0d0;
  --accent-400: #3d93b8;
  --accent-500: #1a7aa0;
  --accent-600: #0a5f7a;
  --accent-700: #084c63;
  --accent-800: #06384a;
  --accent-900: #042636;

  /* The dry room: a creek bed in July. Bone stays the field; paper is the
     surface role for instruments and records so the field never reads as a
     single beige pour. */
  --bone: #faf6ee;
  --bone-2: #f1ece1;
  --paper: #fefdfa;
  --gravel: #d3cfc5;
  --silt: #5f5b53;
  --ink: #252118;

  /* The storm room. */
  --storm: #061d20;
  --storm-2: #163033;

  /* ──────────────────────────────────────────────────────────────────────
   * STATUS TOKENS. These four express how high the water is against Valley
   * Water's published thresholds. Do not use them for links, buttons, focus,
   * headings, or any brand surface. Do not use --accent-* for a stage state.
   * The separation is the whole point; see the file header.
   * ────────────────────────────────────────────────────────────────────── */
  --stage-normal: #516b56;
  --stage-monitor: #e3a42e;
  --stage-flood: #c74c09;
  --stage-danger: #a9131f;
  --stage-normal-ink: var(--bone);
  --stage-monitor-ink: var(--ink);
  --stage-flood-ink: var(--bone);
  --stage-danger-ink: var(--bone);
  --stage-quiet: #b9b4a7; /* a gauge that is not reporting */

  /* Fluid scale, solved through 360px and 1280px anchors on one curve. */
  --fs-fine: clamp(0.83rem, 0.8rem + 0.13vw, 0.9rem);
  --fs-sm: clamp(0.94rem, 0.9rem + 0.17vw, 1.03rem);
  --fs-base: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --fs-lg: clamp(1.2rem, 1.11rem + 0.4vw, 1.44rem);
  --fs-xl: clamp(1.44rem, 1.28rem + 0.7vw, 1.84rem);
  --fs-2xl: clamp(1.73rem, 1.44rem + 1.27vw, 2.36rem);
  --fs-3xl: clamp(2.07rem, 1.58rem + 2.17vw, 3.02rem);
  --fs-4xl: clamp(2.49rem, 1.66rem + 3.66vw, 3.87rem);
  --fs-display: clamp(3rem, 1.62rem + 6.1vw, 5.3rem);

  --measure: 68ch;
  --gutter: clamp(1.15rem, 0.7rem + 2vw, 2.5rem);
  --rule: 1px solid var(--gravel);
  --radius: 3px;

  --font-display: "Sofia Sans Extra Condensed", "Arial Narrow", sans-serif;
  --font-body: "Fustat", system-ui, sans-serif;
  --font-mono: "Sofia Sans Extra Condensed", "Arial Narrow", ui-sans-serif, sans-serif;

  color-scheme: light;
  font-optical-sizing: auto;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 173px;
}

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.005em;
  margin: 0 0 0.4em;
  text-wrap: balance;
}
h3 { line-height: 1.2; }
h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

p { margin: 0 0 1em; max-width: var(--measure); }

a { color: var(--accent-700); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent-800); }

:focus-visible {
  outline: 2px solid var(--accent-500);
  outline-offset: 2px;
  border-radius: 1px;
}

img { max-width: 100%; height: auto; display: block; }

.u-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "ss01";
  letter-spacing: -0.02em;
}
.u-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.u-wrap { width: min(100% - (var(--gutter) * 2), 1240px); margin-inline: auto; }
.u-narrow { width: min(100% - (var(--gutter) * 2), 760px); margin-inline: auto; }

/* ── The gaugemark motif ───────────────────────────────────────────────────
 * A staff gauge plate: long rule at the whole foot, short ticks at tenths.
 * Used as a divider, a list marker, an empty state, the 404, and a hover
 * gesture. Drawn entirely from gradients — no shipped SVG.
 */
.gaugemark {
  --gaugemark-ink: var(--accent-600);
  height: 11px;
  background-image:
    linear-gradient(to right, var(--gaugemark-ink) 0 1.5px, transparent 1.5px),
    linear-gradient(to right, var(--gaugemark-ink) 0 1px, transparent 1px);
  background-size: 96px 11px, 19.2px 5px;
  background-repeat: repeat-x;
  background-position: 0 0, 0 100%;
  border-top: 1px solid var(--gaugemark-ink);
  opacity: 0.55;
}
.gaugemark--divider { margin: clamp(2rem, 5vw, 3.6rem) 0; }
.gaugemark--dark { --gaugemark-ink: var(--accent-300); }

.gaugemark-list { list-style: none; margin: 0; padding: 0; }
.gaugemark-list > li {
  position: relative;
  padding-left: 1.9rem;
  margin-bottom: 0.85rem;
}
.gaugemark-list > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 1.15rem;
  height: 2px;
  background: var(--accent-600);
}
.gaugemark-list > li[aria-current]::before,
.gaugemark-list > li.is-current::before { width: 1.6rem; height: 3px; }

.gaugemark-empty {
  border: var(--rule);
  border-left: 3px solid var(--gravel);
  background: var(--bone-2);
  padding: clamp(1.4rem, 4vw, 2.4rem);
  font-family: var(--font-body);
  color: var(--silt);
}
.gaugemark-empty p { margin-bottom: 0; }

/* ── Chrome ────────────────────────────────────────────────────────────────
 * The masthead is a gauge plate: bone field, a serpentine rule under it, the
 * wordmark set narrow and tall, and the reading time in mono at the right.
 */
.proto-banner {
  display: block;
  width: 100%;
  max-width: none; /* beat global `p { max-width: var(--measure) }` */
  margin: 0;
  box-sizing: border-box;
  background: #000;
  color: #e8e8e8;
  font-size: var(--fs-fine);
  padding: 0.5rem var(--gutter);
  text-align: center;
  letter-spacing: 0.01em;
}
.proto-banner strong { color: #fff; font-weight: 600; }

.site-header {
  background: #fff;
  border-bottom: 2px solid var(--accent-700);
  position: sticky;
  top: 0;
  z-index: 40;
  container-type: scroll-state;
}
.site-header__bar {
  width: min(100% - (var(--gutter) * 2), 1240px);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 2vw, 2rem);
  padding: 0.75rem 0;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.brand__logo {
  display: block;
  height: clamp(2.4rem, 2rem + 1.2vw, 3rem);
  width: auto;
  flex: none;
}
.brand__sub {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent-800);
  letter-spacing: -0.01em;
  line-height: 1.2;
  max-width: 12rem;
}
.site-header__reading {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: var(--fs-fine);
  color: var(--silt);
  white-space: nowrap;
}

/* Scroll-state stuck affordance. Chromium-only, so it layers on top of a
   header that is already complete without it. */
@container scroll-state(stuck: top) {
  .site-header__bar { padding-block: 0.45rem; }
  .site-header { box-shadow: 0 2px 0 rgb(0 65 62 / 0.18); }
}

.site-nav { border-top: 1px solid var(--gravel); background: var(--bone-2); }
.site-nav__rail { display: contents; }
.site-nav__list {
  width: min(100% - (var(--gutter) * 2), 1240px);
  margin-inline: auto;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0;
}
.site-nav__list a {
  position: relative;
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  color: var(--accent-900);
  text-decoration: none;
  padding: 0.72rem clamp(0.6rem, 1.5vw, 1.15rem);
  min-height: 44px;
  border-bottom: 3px solid transparent;
}
.site-nav__list a:hover { background: var(--accent-50); border-bottom-color: var(--accent-400); }
.site-nav__list a[aria-current="page"] {
  border-bottom-color: transparent;
  background: var(--bone);
}
.site-nav__list a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0.65rem;
  right: 0.65rem;
  bottom: 0;
  height: 3px;
  background: repeating-linear-gradient(90deg, var(--accent-700) 0 12px, transparent 12px 16px);
}
.site-nav__list li + li { border-left: 1px solid var(--gravel); }

.menu-btn {
  display: none;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: var(--fs-lg);
  background: var(--accent-800);
  color: var(--bone);
  border: 0;
  border-radius: var(--radius);
  padding: 0.5rem 0.95rem;
  min-height: 44px;
}

/* ── Omnibox ───────────────────────────────────────────────────────────── */
.omnibox { position: relative; flex: 1 1 20rem; min-width: 14rem; }
.omnibox__row { display: flex; }
.omnibox input {
  flex: 1;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  padding: 0.6rem 0.85rem;
  min-height: 44px;
  border: 1px solid var(--silt);
  border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  background: #fff;
  color: var(--ink);
}
.omnibox input::placeholder {
  color: var(--silt);
  font-weight: 400;
  opacity: 1;
}
.omnibox button {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 700;
  letter-spacing: -0.01em;
  background: var(--accent-700);
  color: #fff;
  border: 1px solid var(--accent-700);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0 1.1rem;
  min-height: 44px;
  cursor: pointer;
}
.omnibox button:hover { background: var(--accent-900); }
.omnibox__list {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid var(--silt);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgb(6 29 32 / 0.16);
  list-style: none;
  margin: 0;
  padding: 0.25rem;
  max-height: 24rem;
  overflow-y: auto;
  z-index: 60;
}
.omnibox__list[hidden] { display: none; }
.omnibox__group {
  font-family: var(--font-mono);
  font-size: var(--fs-fine);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--silt);
  padding: 0.5rem 0.6rem 0.2rem;
}
.omnibox__opt { padding: 0.5rem 0.6rem; cursor: pointer; border-radius: 2px; }
.omnibox__opt[aria-selected="true"], .omnibox__opt:hover { background: var(--accent-50); }
.omnibox__opt small { display: block; color: var(--silt); font-size: var(--fs-fine); }

/* ── The stage column ─────────────────────────────────────────────────────
 * The primitive. A vertical channel with the water filled from the bottom and
 * every published threshold ruled across it. Sizes are set by --col-h so the
 * same markup serves a 44px row sparkline and a 340px instrument.
 */
.stagecol {
  --col-h: 128px;
  --col-w: 30px;
  --fill: 0%;
  position: relative;
  width: var(--col-w);
  height: var(--col-h);
  background:
    repeating-linear-gradient(to top, rgb(37 33 24 / 0.16) 0 1px, transparent 1px 8px),
    var(--paper);
  border: 1px solid var(--gravel);
  border-radius: 2px 2px 0 0;
  overflow: hidden;
  flex: none;
}
.stagecol__fill {
  position: absolute;
  inset: auto 0 0 0;
  height: var(--fill);
  background: linear-gradient(to top, var(--accent-800), var(--accent-500));
  transition: height 220ms ease-out;
}
.stagecol[data-stage="monitor"] .stagecol__fill { background: linear-gradient(to top, #a8781d, var(--stage-monitor)); }
.stagecol[data-stage="flood"] .stagecol__fill { background: linear-gradient(to top, #8f3606, var(--stage-flood)); }
.stagecol[data-stage="danger"] .stagecol__fill { background: linear-gradient(to top, #6e0c14, var(--stage-danger)); }
.stagecol[data-reporting="false"] { border-style: dashed; }
.stagecol[data-reporting="false"] .stagecol__fill { background: var(--stage-quiet); }

.stagecol__th {
  position: absolute;
  inset-inline: 0;
  height: 0;
  border-top: 1px dashed var(--silt);
}
.stagecol__th[data-level="1"] { border-top-color: var(--stage-monitor); }
.stagecol__th[data-level="2"],
.stagecol__th[data-level="3"] { border-top-color: var(--stage-flood); }
.stagecol__th[data-level="4"] { border-top-color: var(--stage-danger); border-top-style: solid; }

.stagecol--lg { --col-h: clamp(220px, 34vw, 340px); --col-w: clamp(56px, 9vw, 82px); }
.stagecol--sm { --col-h: 46px; --col-w: 24px; }

/* ── The ladder ───────────────────────────────────────────────────────────
 * A watershed read top to bottom, ridge to Bay. The rail is the creek.
 */
.ladder { list-style: none; margin: 0; padding: 0; position: relative; }
.ladder::before {
  content: "";
  position: absolute;
  left: calc(var(--col-w, 30px) / 2);
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-200), var(--accent-600));
}
.ladder__rung {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(0.9rem, 2.5vw, 1.6rem);
  align-items: center;
  padding: clamp(0.7rem, 2vw, 1.1rem) 0;
  border-bottom: 1px solid var(--gravel);
}
.ladder__rung:last-child { border-bottom: 0; }
.ladder__body { min-width: 0; }
.ladder__name {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 700;
  margin: 0 0 0.15rem;
  line-height: 1.05;
}
.ladder__name a { color: var(--ink); text-decoration: none; }
.ladder__name a:hover { color: var(--accent-800); text-decoration: underline; }
.ladder__reading { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--silt); }
.ladder__reading b { color: var(--ink); font-weight: 600; }
.ladder__rung:hover .ladder__name::after,
.ladder__rung:focus-within .ladder__name::after {
  content: "";
  display: inline-block;
  width: 1.1rem;
  height: 2px;
  background: var(--accent-600);
  margin-left: 0.5rem;
  vertical-align: 0.3em;
}
.ladder__marker {
  font-family: var(--font-mono);
  font-size: var(--fs-fine);
  color: var(--silt);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Stage chips ──────────────────────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: var(--fs-fine);
  letter-spacing: -0.01em;
  padding: 0.2rem 0.55rem;
  border-radius: 2px;
  background: var(--bone-2);
  color: var(--ink);
  border: 1px solid var(--gravel);
}
.chip[data-stage="normal"] { background: var(--stage-normal); color: var(--stage-normal-ink); border-color: transparent; }
.chip[data-stage="monitor"] { background: var(--stage-monitor); color: var(--stage-monitor-ink); border-color: transparent; }
.chip[data-stage="flood"] { background: var(--stage-flood); color: var(--stage-flood-ink); border-color: transparent; }
.chip[data-stage="danger"] { background: var(--stage-danger); color: var(--stage-danger-ink); border-color: transparent; }

/* ── Rooms ────────────────────────────────────────────────────────────── */
.room-storm {
  background: var(--storm);
  color: var(--bone);
  padding-block: clamp(2.6rem, 7vw, 5rem);
}
.room-storm h2, .room-storm h3 { color: var(--bone); }
.room-storm a { color: var(--accent-300); }
.room-storm a:hover { color: var(--accent-200); }
.room-storm .u-mono, .room-storm .ladder__reading { color: var(--accent-200); }
.room-storm .card { background: var(--storm-2); border-color: #2b4448; color: var(--bone); }

.room-quiet { background: var(--bone-2); padding-block: clamp(2.2rem, 6vw, 4rem); }

/* ── The answer ───────────────────────────────────────────────────────────
 * Home leads with one sentence, set large. It is the product.
 */
.answer { padding-block: clamp(2.2rem, 6vw, 4.2rem); }
.answer__label {
  font-family: var(--font-mono);
  font-size: var(--fs-fine);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-700);
  margin-bottom: 0.9rem;
}
.answer__line {
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0.004em;
  margin: 0 0 0.6rem;
  max-width: 20ch;
  text-wrap: balance;
}
.home-hero .answer__line { max-width: min(30ch, 100%); }
.home-hero .answer__label { display: none; }
.answer__sub { font-size: var(--fs-lg); color: var(--silt); max-width: 46ch; }

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(18rem, 0.55fr);
  gap: clamp(1.4rem, 4vw, 3.4rem);
  align-items: center;
}
.home-status {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(1rem, 2vw, 1.5rem);
  align-items: center;
  min-height: 22rem;
  padding: clamp(1rem, 2.5vw, 1.5rem);
  background: var(--storm);
  color: var(--bone);
  text-decoration: none;
  box-shadow: 0 18px 42px rgb(6 29 32 / 0.18);
}
.home-status:hover { color: var(--bone); background: var(--storm-2); }
.home-status__instrument { display: grid; place-items: center; }
.home-status__copy { display: grid; gap: 0.45rem; }
.home-status__copy .answer__label { color: var(--accent-300); margin: 0; }
.home-status__copy strong { font-family: var(--font-display); font-size: var(--fs-2xl); line-height: 1.08; }
.home-status__copy small { color: var(--accent-200); font-family: var(--font-mono); }
@media (max-width: 760px) {
  .home-hero { grid-template-columns: 1fr; }
  .home-status {
    order: -1;
    min-height: 8.5rem;
    grid-template-columns: 4rem minmax(0, 1fr);
  }
  .home-status .stagecol--lg { --col-h: 6.5rem; --col-w: 2.25rem; }
  .home-status__copy strong { font-size: var(--fs-xl); }
}

/* ── Cards, tables, panels ────────────────────────────────────────────── */
.card {
  background: #fff;
  border: var(--rule);
  border-top: 3px solid var(--accent-600);
  padding: clamp(1rem, 2.5vw, 1.5rem);
}
.card h3 { margin-bottom: 0.8rem; }

.grid { display: grid; gap: clamp(0.9rem, 2.4vw, 1.6rem); align-items: start; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }

.reading-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.reading-table th, .reading-table td { text-align: left; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--gravel); }
.reading-table th {
  font-family: var(--font-display);
  font-size: var(--fs-base);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-900);
  border-bottom: 2px solid var(--accent-700);
}
.reading-table td.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.reading-table tbody tr:hover { background: var(--accent-50); }

.table-scroll { overflow-x: auto; }

/* Storm tables carry consequential readings, so on a phone they become
   labeled records instead of hiding rightmost columns behind a clipped edge. */
@media (max-width: 600px) {
  .storm-table,
  .storm-table tbody,
  .storm-table tr,
  .storm-table td { display: block; width: 100%; }
  .storm-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
  .storm-table tr {
    border-top: 3px solid var(--accent-600);
    padding-block: 0.35rem;
    margin-bottom: 0.85rem;
    background: var(--bone-2);
  }
  .storm-table td,
  .storm-table td.num {
    display: grid;
    grid-template-columns: minmax(7.4rem, 0.8fr) minmax(0, 1.2fr);
    gap: 0.75rem;
    white-space: normal;
    overflow-wrap: anywhere;
    padding: 0.48rem 0.6rem;
  }
  .storm-table td::before {
    content: attr(data-label);
    color: var(--accent-800);
    font-family: var(--font-display);
    font-size: var(--fs-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
}

/* ── Verbatim source ──────────────────────────────────────────────────────
 * Valley Water's own threshold prose. Set apart so a reader can see the line
 * between what the agency wrote and what this site computed.
 */
[data-verbatim].source-quote {
  border-left: 3px solid var(--accent-600);
  border-top: 1px solid var(--gravel);
  border-bottom: 1px solid var(--gravel);
  background: var(--paper);
  padding: 0.85rem 1.1rem;
  margin: 0 0 0.9rem;
  font-size: var(--fs-sm);
  max-width: var(--measure);
}
.source-quote p { overflow-wrap: anywhere; }
.source-quote__attr {
  display: block;
  margin: 0.5rem 0 0;
  font-family: var(--font-mono);
  font-size: var(--fs-fine);
  color: var(--silt);
}

/* ── Waterline photography ────────────────────────────────────────────── */
.waterline { position: relative; margin: 0; }
.waterline img { width: 100%; object-fit: cover; }
.waterline::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: var(--waterline, 62%);
  height: 2px;
  background: var(--accent-400);
  box-shadow: 0 0 0 1px rgb(6 29 32 / 0.35);
}
.waterline--duotone img { filter: grayscale(1) contrast(1.05); }
.waterline--duotone::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgb(0 65 62 / 0.72), rgb(6 29 32 / 0.82));
  mix-blend-mode: multiply;
}
.waterline--scrim::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgb(6 29 32 / 0.88) 0%, rgb(6 29 32 / 0.55) 42%, rgb(6 29 32 / 0.08) 100%);
}
.waterline figcaption {
  font-family: var(--font-mono);
  font-size: var(--fs-fine);
  color: var(--silt);
  padding-top: 0.5rem;
}
.waterline__over {
  position: absolute;
  inset: auto 0 0 0;
  padding: clamp(1rem, 3vw, 2rem);
  color: var(--bone);
}
.waterline__over h1, .waterline__over h2 { color: var(--bone); margin-bottom: 0.2rem; }

/* ── Published watershed layer ────────────────────────────────────────────
 * The WebP below is rendered from Valley Water's issued GeoJSON. Exact sensor
 * positions remain HTML markers on top so one raster base can serve hundreds
 * of routes without rounding, moving, or redrawing the source coordinates.
 */
.scv-map { margin: clamp(1.1rem, 3vw, 2rem) 0; }
.scv-map__plot {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--gravel);
  background: #f2f4ee;
  box-shadow: 0 16px 40px rgb(37 33 24 / 0.08);
}
.scv-map__plot img { display: block; width: 100%; height: auto; }
.scv-map__markers { position: absolute; inset: 0; pointer-events: none; }
.scv-map__marker {
  position: absolute;
  left: var(--map-x);
  top: var(--map-y);
  width: var(--map-size);
  height: var(--map-size);
  transform: translate(-50%, -50%);
  border: 2px solid var(--bone);
  background: var(--storm);
  box-shadow: 0 0 0 1px rgb(6 29 32 / 0.55), 0 2px 7px rgb(6 29 32 / 0.35);
}
.scv-map__marker--stream { border-radius: 50%; }
.scv-map__marker--rain {
  border-radius: 1px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: var(--accent-700);
}
.scv-map__marker--reservoir { border-radius: 3px; background: var(--accent-900); }
.scv-map__marker.is-featured { background: var(--stage-flood); z-index: 2; }
.scv-map figcaption {
  max-width: 86ch;
  margin-top: 0.65rem;
  color: var(--silt);
  font-family: var(--font-mono);
  font-size: var(--fs-fine);
}
.scv-map__sensor-key,
.scv-map__polygons {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.1rem;
  color: var(--silt);
  font-family: var(--font-mono);
  font-size: var(--fs-fine);
}
.scv-map__sensor-key li,
.scv-map__polygons li { display: inline-flex; align-items: center; gap: 0.42rem; }
.scv-map__key,
.scv-map__polygons span {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  border: 1px solid var(--silt);
  color: var(--ink);
  background: var(--bone-2);
  font-size: 0.72rem;
  line-height: 1;
}
.scv-map__key--stream { border-radius: 50%; background: var(--storm); border: 2px solid var(--bone); box-shadow: 0 0 0 1px var(--storm); }
.scv-map__key--rain { width: 1rem; height: 1rem; margin-inline: 0.18rem; transform: rotate(45deg); background: var(--accent-700); border: 2px solid var(--bone); box-shadow: 0 0 0 1px var(--storm); }
.scv-map__key--reservoir { border-radius: 3px; background: var(--accent-900); border: 2px solid var(--bone); box-shadow: 0 0 0 1px var(--storm); }
.scv-map__polygons { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); }
.scv-map__polygons .is-selected { color: var(--ink); font-weight: 700; }
.scv-map__polygons .is-selected span { color: var(--bone); background: var(--storm); border-color: var(--storm); }

/* Documentary place photography stays separate from live readings: every
   caption names the date and says when an image is context rather than state. */
.place-photo-wrap {
  display: grid;
  grid-template-columns: minmax(14rem, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(1.2rem, 4vw, 3.2rem);
  align-items: center;
  padding-block: clamp(1.4rem, 4vw, 3rem);
}
.place-photo-wrap--reverse .place-photo-copy { order: 2; }
.place-photo-wrap--reverse .place-photo { order: 1; }
.place-photo-copy h2 { margin-top: 0.12rem; }
.place-photo-copy p:last-child { margin-bottom: 0; }
.place-photo { margin: 0; border: 1px solid var(--gravel); background: #fff; padding: 0.45rem; }
.place-photo img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.place-photo figcaption { padding: 0.55rem 0.2rem 0.08rem; color: var(--silt); font-family: var(--font-mono); font-size: var(--fs-fine); }
.home-network-map { grid-column: 1 / -1; margin: 0; border-top: 1px solid var(--gravel); padding-top: 0.8rem; }
.home-network-map img { display: block; width: 100%; aspect-ratio: 8 / 5; object-fit: cover; }
.home-network-map figcaption { margin-top: 0.45rem; color: var(--silt); font-family: var(--font-mono); font-size: var(--fs-fine); }
@media (max-width: 700px) {
  .place-photo-wrap { grid-template-columns: 1fr; }
  .place-photo-wrap--reverse .place-photo-copy,
  .place-photo-wrap--reverse .place-photo { order: initial; }
}

/* ── Footer ───────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--storm);
  color: var(--gravel);
  padding-block: clamp(2rem, 5vw, 3.4rem);
  margin-top: clamp(2.5rem, 7vw, 5rem);
}
.site-footer a { color: var(--accent-300); }
.site-footer__grid { display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.site-footer h2 {
  font-size: var(--fs-lg);
  color: var(--bone);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.45rem; }
.site-footer__note {
  margin-top: 1.8rem;
  padding-top: 1.1rem;
  border-top: 1px solid #2b4448;
  font-family: var(--font-mono);
  font-size: var(--fs-fine);
}

/* ── Mobile ───────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  html { scroll-padding-top: 213px; }
  .site-header__bar { display: flex; }
  .brand { order: 1; flex: 1 1 auto; min-width: 0; }
  .menu-btn { display: inline-block; order: 3; margin-left: auto; }
  .omnibox { flex: 1 1 100%; min-width: 0; order: 5; }
  .site-nav { display: none; }
  .site-nav.is-open { display: block; }
  .site-nav__list { flex-direction: column; }
  .site-nav__list a { border-bottom: 1px solid var(--gravel); }
  .site-header__reading { width: 100%; margin-left: 0; order: 9; white-space: normal; overflow-wrap: anywhere; }
  .site-nav__list li + li { border-left: 0; }
}
/* Core tasks survive with JavaScript off: hide the toggle, show the nav. */
.no-js .menu-btn { display: none; }
.no-js .site-nav { display: block; }

/* ── Motion ────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .ladder__rung { transition: background 150ms ease; }
  .ladder__rung:hover { background: var(--accent-50); }
}
@media (prefers-reduced-motion: reduce) {
  .stagecol__fill { transition: none; }
  ::view-transition-group(*) { animation: none; }
}

/* ── Print ────────────────────────────────────────────────────────────── */
@media print {
  .proto-banner, .site-nav, .omnibox, .site-footer, .menu-btn { display: none !important; }
  .site-header { position: static; border-bottom: 1px solid #000; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .room-storm { background: #fff; color: #000; }
  a { text-decoration: underline; }
}

/* ── The valley strip ─────────────────────────────────────────────────────
 * Every reporting gauge in the county as one row of columns per watershed.
 * Grouped and ordered downstream, so the whole county reads in one glance.
 */
.valley-strip {
  display: grid;
  gap: clamp(1.4rem, 3vw, 2.4rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  margin-top: 1.6rem;
}
.valley-strip__ws { border-top: 2px solid var(--accent-700); padding-top: 0.8rem; }
.valley-strip__ws h3 { font-size: var(--fs-xl); margin-bottom: 0.1rem; }
.valley-strip__ws h3 a { color: var(--ink); text-decoration: none; }
.valley-strip__ws h3 a:hover { color: var(--accent-800); text-decoration: underline; }
.valley-strip__meta { color: var(--silt); font-size: var(--fs-fine); margin: 0 0 0.8rem; }
.valley-strip__cols {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  min-height: 56px;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-bottom: 0.15rem;
}
.valley-strip__col { display: block; border-radius: 2px; flex: 0 0 auto; }
.valley-strip__col:hover .stagecol { outline: 2px solid var(--accent-500); outline-offset: 1px; }

/* ── Reservoir row and instrument ─────────────────────────────────────── */
.res-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(50%, 6.5rem), 1fr));
  gap: clamp(0.6rem, 1.6vw, 1.1rem);
  margin-top: 1.4rem;
}
.res-cell {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--ink);
  padding: 0.6rem 0.3rem;
  border: 1px solid var(--gravel);
  background: var(--bone);
  border-radius: var(--radius);
}
.res-cell:hover { border-color: var(--accent-600); background: #fff; }
.res-cell__gauge {
  position: relative;
  width: 34px;
  height: 84px;
  background: repeating-linear-gradient(to top, var(--bone-2) 0 3px, transparent 3px 12px), var(--bone-2);
  border: 1px solid var(--gravel);
  border-radius: 2px 2px 0 0;
  overflow: hidden;
}
.res-cell__fill,
.res-instrument__fill {
  position: absolute;
  inset: auto 0 0 0;
  background: linear-gradient(to top, var(--accent-800), var(--accent-400));
}
.res-cell__name { font-family: var(--font-display); font-size: var(--fs-base); text-transform: uppercase; letter-spacing: 0.03em; text-align: center; line-height: 1.05; }
.res-cell__num { font-size: var(--fs-fine); color: var(--silt); }

.res-instrument {
  position: relative;
  width: clamp(72px, 12vw, 108px);
  height: clamp(220px, 34vw, 320px);
  background: repeating-linear-gradient(to top, var(--bone-2) 0 4px, transparent 4px 16px), var(--bone-2);
  border: 1px solid var(--gravel);
  border-radius: 3px 3px 0 0;
  overflow: hidden;
  flex: none;
}

/* ── Gauge instrument layout ──────────────────────────────────────────── */
.gauge-instrument {
  display: flex;
  align-items: flex-end;
  gap: clamp(1.2rem, 4vw, 3rem);
  flex-wrap: wrap;
  padding-block: clamp(1.2rem, 3vw, 2rem);
}
.gauge-instrument__read {
  font-size: var(--fs-3xl);
  font-weight: 600;
  margin: 0 0 0.2rem;
  line-height: 1;
  color: var(--accent-800);
}

/* ── Thresholds ───────────────────────────────────────────────────────── */
.threshold {
  border-left: 3px solid var(--gravel);
  padding: 0 0 0.4rem 1.1rem;
  margin-bottom: 1.6rem;
}
.threshold[data-level="1"] { border-left-color: var(--stage-monitor); }
.threshold[data-level="2"], .threshold[data-level="3"] { border-left-color: var(--stage-flood); }
.threshold[data-level="4"] { border-left-color: var(--stage-danger); }
.threshold h3 { margin-bottom: 0.15rem; }

/* ── Index controls and lists ─────────────────────────────────────────── */
.index-controls {
  position: sticky;
  top: 108px;
  z-index: 20;
  background: #ffffff;
  padding: 0.8rem 0;
  margin-bottom: 0.6rem;
  border-bottom: 1px solid var(--gravel);
  box-shadow: 0 12px 24px -16px rgb(37 33 24 / 0.35);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.index-controls label {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-900);
}
.index-controls input {
  font: inherit;
  font-size: var(--fs-sm);
  padding: 0.55rem 0.7rem;
  min-height: 44px;
  min-width: min(100%, 22rem);
  border: 1px solid var(--silt);
  border-radius: var(--radius);
  background: #fff;
}

.street-index { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: clamp(1.2rem, 4vw, 3rem); }
@media (min-width: 900px) { .street-index { columns: 3; } }
.street-row {
  break-inside: avoid;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gravel);
  display: grid;
  gap: 0.1rem;
}
.street-row a { font-family: var(--font-display); font-size: var(--fs-lg); text-decoration: none; color: var(--ink); }
.street-row a:hover { color: var(--accent-800); text-decoration: underline; }
.street-row .u-mono { font-size: var(--fs-fine); color: var(--silt); }

.street-sample { list-style: none; margin: 1.2rem 0; padding: 0; }
.street-sample li { border-bottom: 1px solid rgb(211 207 197 / 0.35); padding-bottom: 0.35rem; }
.street-sample a { font-family: var(--font-display); font-size: var(--fs-lg); text-decoration: none; }
.room-storm .street-sample a { color: var(--accent-300); }
.room-storm .street-sample a:hover { color: var(--accent-200); text-decoration: underline; }

.street-card .source-quote { background: var(--bone); }

/* ── Long-index contract (Streets and Landmarks) ─────────────────────────
 * index-navigation.css owns sticky positioning, viewport budgets and target
 * sizes; this build only supplies color/type and the one measured value the
 * shared contract asks every build to provide itself: the pixel height this
 * build's own sticky masthead (.site-header) actually renders at each
 * breakpoint, so the page-local search box sticks directly under it instead
 * of guessing. Measured with a headless browser against the built page, not
 * eyeballed; the mobile figure is taller even though .site-nav collapses
 * behind the hamburger button below 860px, because the omnibox and the
 * reading-time line wrap onto their own rows in the narrower bar and that
 * costs more height than the nav row saved. Breakpoint matches .site-header's
 * own (860px).
 */
:where([data-stoa-index]) {
  --scv-index-sticky-top: 173px;
  --stoa-index-sticky-top: 173px;
  padding-block-end: 0;
}
:where([data-stoa-index])::after { content: ""; display: block; height: 14rem; }
@media (max-width: 860px) {
  :where([data-stoa-index]) {
    --scv-index-sticky-top: 213px;
    --stoa-index-sticky-top: 213px;
  }
}

[data-stoa-index-controls] {
  position: sticky;
  top: var(--stoa-index-sticky-top);
  z-index: 20;
  max-height: 30vh;
  overflow: auto;
  background: #ffffff;
  border-bottom: 1px solid var(--gravel);
  box-shadow: 0 12px 24px -16px rgb(37 33 24 / 0.35);
  padding-block: 0.8rem;
  margin-bottom: 0.6rem;
}
[data-stoa-index-controls] form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
[data-stoa-index-controls] label {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-900);
}
[data-stoa-index-controls] input[type="search"] {
  font: inherit;
  font-size: var(--fs-sm);
  padding: 0.55rem 0.7rem;
  min-width: min(100%, 22rem);
  border: 1px solid var(--silt);
  border-radius: var(--radius);
  background: #fff;
}
[data-stoa-index-controls] button {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--accent-700);
  border-radius: var(--radius);
  background: var(--accent-700);
  color: var(--bone);
  cursor: pointer;
}
[data-stoa-index-controls] button:hover { background: var(--accent-800); }
[data-stoa-index-summary] {
  flex-basis: 100%;
  margin: 0.4rem 0 0;
  font-family: var(--font-mono);
  font-size: var(--fs-fine);
  color: var(--silt);
}
.street-noscript { color: var(--silt); font-size: var(--fs-fine); margin: 0.6rem 0 0; }

.street-az { margin: 0.8rem 0 1.2rem; }
.street-az ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.street-az a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 44px;
  padding: 0 0.7rem;
  font-family: var(--font-display);
  font-size: var(--fs-base);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--accent-800);
  border: 1px solid var(--gravel);
  border-radius: var(--radius);
}
.street-az a:hover { background: var(--accent-50); }
.street-az a[aria-current="true"] { background: var(--accent-700); color: var(--bone); border-color: var(--accent-700); }
.street-az .u-mono { font-size: var(--fs-fine); color: inherit; opacity: 0.75; }

.street-row--empty { color: var(--silt); }

[data-stoa-index-pagination] a,
[data-stoa-index-pagination] [aria-current="page"] {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  border: 1px solid var(--gravel);
  border-radius: var(--radius);
  padding: 0 0.6rem;
  color: var(--accent-800);
  text-decoration: none;
}
[data-stoa-index-pagination] a:hover { background: var(--accent-50); }
[data-stoa-index-pagination] [aria-current="page"] {
  background: var(--accent-700);
  color: var(--bone);
  border-color: var(--accent-700);
}

.creek-ladder { margin-bottom: clamp(2rem, 5vw, 3.2rem); }
.creek-ladder h3 { font-size: var(--fs-2xl); margin-bottom: 0.1rem; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--accent-800);
  color: var(--bone);
  text-decoration: none;
  padding: 0.6rem 1.4rem;
  min-height: 44px;
  border-radius: var(--radius);
}
.btn:hover { background: var(--accent-900); color: var(--bone); }

/* The answer block runs tight into the divider; it does not need a dead
   viewport under it. */
.answer { padding-bottom: clamp(1rem, 2.5vw, 1.8rem); }
.answer + .gaugemark--divider { margin-top: clamp(1.2rem, 3vw, 2rem); }

/* Fustat sets wide by default. At the sizes this build uses for lede copy that
   reads loose enough to be mistaken for a monospace, so pull the tracking in
   and let the measure do the work instead. */
body { letter-spacing: -0.006em; }
.answer__sub, .lede { letter-spacing: -0.014em; line-height: 1.45; }
.u-mono { letter-spacing: -0.02em; }

/* ── The storm room, as an instrument ──────────────────────────────────────
 * The replay is the one surface on this site that is a device rather than a
 * document, so it gets the dark register and a bezel. Everything inside it is
 * the stage column at a second scale: taller, ruled with NOAA's flood
 * categories instead of Valley Water's thresholds, and driven by a clock.
 *
 * The blind rungs are deliberately as tall as the live ones. Six of the eight
 * Coyote Creek stations recorded nothing in February 2017, and collapsing them
 * to a footnote would let the eye read a complete creek. The gap is the point.
 */
.replay {
  display: flex;
  flex-direction: column;
  background: var(--storm);
  color: var(--bone);
  padding: clamp(1.3rem, 4vw, 2.6rem);
  border-radius: var(--radius);
  margin-block: clamp(1.8rem, 5vw, 3rem);
}
.replay h2 { color: var(--bone); }
.replay a { color: var(--accent-300); }
.replay a:hover { color: var(--accent-200); }
.replay > p { color: var(--accent-100); max-width: var(--measure); }
.replay__controls { order: 1; }
.replay__jumps { order: 2; }
.replay__ladder { order: 3; }
.replay__note { order: 4; }
.replay .hydrograph { order: 5; }
.replay .peakline { order: 6; }
.answer .replay__note { color: var(--silt); }

.replay__ladder::before {
  content: "";
  position: absolute;
  left: calc(clamp(34px, 5vw, 46px) / 2);
  top: 0.5rem;
  bottom: 2.5rem;
  width: 2px;
  background: linear-gradient(to bottom, transparent, #1d4145 12%, #1d4145 88%, transparent);
}
.replay__ladder {
  position: relative;
  list-style: none;
  margin: clamp(1.4rem, 4vw, 2.2rem) 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.replay__rung {
  display: grid;
  grid-template-columns: clamp(34px, 5vw, 46px) 1fr;
  gap: clamp(0.8rem, 2.5vw, 1.4rem);
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #1f3a3e;
}
.replay__rung:last-child { border-bottom: 0; }
.replay__body { min-width: 0; }
.replay__name {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  line-height: 1.05;
  margin: 0 0 0.15rem;
  color: var(--bone);
}
.replay__name a { text-decoration: none; }
.replay__name a:hover { text-decoration: underline; }
.replay__meta { font-size: var(--fs-fine); color: var(--silt); margin: 0; }
.room-storm .replay__meta,
.replay .replay__meta { color: #8fb0b2; }
.replay__read { font-size: var(--fs-lg); color: var(--accent-100); margin: 0.25rem 0 0; }
.replay__read b { font-weight: 700; font-variant-numeric: tabular-nums; }
.replay__read span { color: var(--accent-300); }
.replay__levels { font-size: var(--fs-fine); color: #7fa2a4; margin: 0.15rem 0 0; }
/* "This station has peaked" is a fact about the replay clock, not about a
   flood threshold, so the flag takes the brand accent and leaves --stage-*
   to the columns, where it means what the token block says it means. */
.replay__flag {
  font-size: var(--fs-fine);
  color: var(--accent-300);
  margin: 0.2rem 0 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.replay__gap { color: #9db8ba; font-size: var(--fs-sm); margin: 0.25rem 0 0; max-width: 52ch; }

/* A gauge plate with no water line: the empty state from the motif set, at
   instrument scale, so a blind station reads as an instrument that was not
   there rather than as a creek that was dry. */
.replay__plate,
.replaycol {
  --col-h: clamp(118px, 17vw, 168px);
  --fill: 0%;
  position: relative;
  height: var(--col-h);
  width: 100%;
  background:
    repeating-linear-gradient(to top, #10292c 0 3px, transparent 3px 12px),
    #0b2225;
  border: 1px solid #24474b;
  border-radius: 2px 2px 0 0;
  overflow: hidden;
}
.replay__plate { border-style: dashed; opacity: 0.55; }
.replaycol__fill {
  position: absolute;
  inset: auto 0 0 0;
  height: var(--fill);
  background: linear-gradient(to top, var(--accent-800), var(--accent-400));
}
/* Status never borrows the brand accent: once a column crosses one of NOAA's
   named categories it changes to the stage token for that category. */
.replaycol[data-reached="action"] .replaycol__fill { background: linear-gradient(to top, #8a6318, var(--stage-monitor)); }
.replaycol[data-reached="minor"] .replaycol__fill { background: linear-gradient(to top, #8f3606, var(--stage-flood)); }
.replaycol[data-reached="moderate"] .replaycol__fill,
.replaycol[data-reached="major"] .replaycol__fill { background: linear-gradient(to top, #6e0c14, var(--stage-danger)); }

.replaycol__th { position: absolute; inset-inline: 0; height: 0; border-top: 1px dashed #6f9295; }
.replaycol__th[data-level="action"] { border-top-color: var(--stage-monitor); }
.replaycol__th[data-level="minor"] { border-top-color: var(--stage-flood); }
.replaycol__th[data-level="moderate"],
.replaycol__th[data-level="major"] { border-top-color: var(--stage-danger); border-top-style: solid; }

.replay__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(0.7rem, 2vw, 1.2rem);
  margin-top: clamp(1.2rem, 3vw, 1.8rem);
  padding-top: clamp(1rem, 2.5vw, 1.4rem);
  border-top: 1px solid #1f3a3e;
}
.replay__play { background: var(--accent-500); color: var(--storm); }
.replay__play:hover { background: var(--accent-400); color: var(--storm); }
.replay__scrub { flex: 1 1 16rem; min-width: 12rem; }
.replay__scrub label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-fine);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8fb0b2;
  margin-bottom: 0.3rem;
}
.replay__scrub input[type="range"] {
  width: 100%;
  min-height: 44px;
  accent-color: var(--accent-400);
  background: transparent;
}
.replay__now { margin: 0; flex: 0 1 auto; }
.replay__stamp { display: block; font-size: var(--fs-lg); color: var(--bone); font-variant-numeric: tabular-nums; }
.replay__elapsed { display: block; font-size: var(--fs-fine); color: var(--accent-300); }

.replay__jumps { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.9rem; }
.chip--btn {
  cursor: pointer;
  background: #122e31;
  border-color: #2b4d51;
  color: var(--accent-100);
  min-height: 44px;
  min-width: 44px;
  padding-inline: 0.7rem;
}
.chip--btn:hover { background: var(--accent-800); border-color: var(--accent-600); color: var(--bone); }

.replay__note { font-size: var(--fs-fine); color: #8fb0b2; margin-top: 1rem; max-width: 62ch; }

/* ── Hydrograph ───────────────────────────────────────────────────────────
 * Series are told apart by dash pattern and by a legend that repeats the peak
 * as a number, never by colour alone. Series colour is drawn from the neutral
 * and accent ramps only: a station's line is not a flood state, so it may not
 * borrow a --stage-* token however well amber would read on this ground.
 */
.hydrograph { margin: clamp(1.6rem, 4vw, 2.4rem) 0 0; }
.hydro__plot { position: relative; }
.hydro__plot picture,
.hydro__plot img { display: block; width: 100%; height: auto; }
.hydro__cursor {
  position: absolute;
  top: var(--hydro-top);
  bottom: var(--hydro-bottom);
  left: 9.375%;
  border-left: 2px dashed var(--bone);
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 2px var(--storm));
}
[data-replay-ready="true"] .hydro__cursor { opacity: 0.78; }

.hydro__legend {
  list-style: none;
  margin: 0.7rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  font-size: var(--fs-fine);
  color: var(--accent-100);
}
.hydro__legend li { display: flex; align-items: center; gap: 0.45rem; }
.hydro__legend .u-mono { color: var(--accent-300); }
.hydro__key { width: 26px; height: 0; border-top: 2px solid var(--accent-300); }
.hydro__key[data-line="1"] { border-top-color: var(--bone); border-top-style: dashed; }
.hydro__key[data-line="2"] { border-top-color: #c9b7e8; border-top-style: dotted; }
.hydro__key[data-line="3"] { border-top-color: var(--accent-500); border-top-style: dashed; }
.hydro__key[data-line="4"] { border-top-color: #c99a6a; border-top-style: dashed; }
.hydrograph figcaption {
  font-size: var(--fs-fine);
  color: #8fb0b2;
  margin-top: 0.7rem;
  max-width: 72ch;
}

.peakline { margin: clamp(1.5rem, 4vw, 2.3rem) 0 0; }
.peakline figcaption { max-width: 72ch; color: #8fb0b2; font-size: var(--fs-fine); }
.peakline ol { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 0.8rem; }
.peakline li {
  display: grid;
  grid-template-columns: minmax(11rem, 0.8fr) minmax(12rem, 1.5fr) minmax(10rem, auto);
  gap: 0.8rem;
  align-items: center;
}
.peakline__station { color: var(--accent-100); font-weight: 700; }
.peakline__track {
  position: relative;
  display: block;
  height: 2px;
  background: #365155;
}
.peakline__point {
  position: absolute;
  top: 50%;
  width: 13px;
  height: 13px;
  border: 2px solid var(--storm);
  border-radius: 50%;
  background: var(--accent-300);
  box-shadow: 0 0 0 1px var(--accent-300);
  transform: translate(-50%, -50%);
}
.peakline__time { color: #8fb0b2; font-size: var(--fs-fine); }

@media (max-width: 760px) {
  .peakline li { grid-template-columns: 1fr; gap: 0.35rem; }
  .peakline__track { height: 3px; margin: 0.3rem 0; }
}

/* ── Storm archive ────────────────────────────────────────────────────── */
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.storm-card h3 { font-size: var(--fs-2xl); line-height: 1.16; }
.storm-card h3 a { text-decoration: none; color: var(--ink); }
.storm-card h3 a:hover { color: var(--accent-800); text-decoration: underline; }
.storm-card[data-kind="flood"] { border-top-color: var(--stage-flood); }
.storm-card[data-kind="quiet"] { border-top-color: var(--gravel); }
.storm-card__stat {
  margin-top: 0.9rem;
  padding-top: 0.7rem;
  border-top: 1px dashed var(--gravel);
  font-size: var(--fs-sm);
  color: var(--ink);
}

.answer__stat {
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0.2rem 0 0.6rem;
  color: var(--accent-800);
}

/* ── Coverage ledger ──────────────────────────────────────────────────── */
.coverage { list-style: none; margin: 1.2rem 0 0; padding: 0; display: grid; gap: 0.9rem; }
.coverage > li {
  border-left: 3px solid var(--gravel);
  padding: 0.15rem 0 0.15rem 0.95rem;
  max-width: var(--measure);
}
.coverage__name { font-family: var(--font-display); font-size: var(--fs-lg); margin: 0; }
.coverage__name .u-mono { font-family: var(--font-mono); font-size: var(--fs-fine); color: var(--silt); }
.coverage > li > p { margin: 0.15rem 0 0; }
.coverage__spans { font-size: var(--fs-fine); color: var(--silt); }
.coverage__closing { max-width: var(--measure); margin-top: 1.4rem; }

.lag-table .is-quoted { background: var(--accent-50); }
.lag-table .is-quoted td { font-weight: 600; }

/* ── The alert surface ────────────────────────────────────────────────────
 * This is the product, so it is built as a form a person can actually work
 * rather than a call-to-action. The list of creeks is long by design: a
 * resident should be able to find exactly their creek instead of subscribing
 * to the whole county and learning to ignore it.
 */
.alert-form { max-width: 62rem; }
.alert-step { padding-block: clamp(1.2rem, 3vw, 2rem); border-top: 1px solid var(--gravel); }
.alert-step:first-child { border-top: 0; padding-top: 0; }
.alert-step__title { font-size: var(--fs-2xl); margin-bottom: 0.2rem; }
.alert-step__hint { color: #5f5b53; max-width: 54ch; margin-top: 0; }

.index-controls--flat { position: static; padding: 0; background: none; border: 0; margin-bottom: 1rem; }

.alert-groups { display: grid; gap: 1.1rem; }
.alert-group { border: 0; border-left: 3px solid var(--accent-600); margin: 0; padding: 0 0 0 0.95rem; }
.alert-group legend {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  padding: 0;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.alert-group__count { font-size: var(--fs-fine); color: #5f5b53; }

.alert-checks { list-style: none; margin: 0.4rem 0 0; padding: 0; display: grid; gap: 0.15rem; }
.alert-check {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.55rem 0.5rem;
  min-height: 44px;
  border-radius: 2px;
  cursor: pointer;
}
.alert-check:hover { background: var(--bone); }
.alert-check input { margin-top: 0.28rem; width: 20px; height: 20px; accent-color: var(--accent-600); flex: none; }
.alert-check__body { display: grid; gap: 0.05rem; }
.alert-check__name { font-size: var(--fs-sm); }
.alert-check__meta { font-size: var(--fs-fine); color: #5f5b53; }
.alert-count { color: var(--silt); margin-top: 0.9rem; }

.alert-levels, .alert-quiet { border: 0; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.alert-quiet { margin-top: 1.2rem; }
.alert-quiet legend {
  font-family: var(--font-mono);
  font-size: var(--fs-fine);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--silt);
  padding: 0 0 0.3rem;
}
.alert-level {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.7rem 0.8rem;
  min-height: 44px;
  border: 1px solid var(--gravel);
  background: #fff;
  border-radius: 2px;
  cursor: pointer;
}
.alert-level:hover { border-color: var(--accent-600); }
.alert-level input { margin-top: 0.3rem; width: 20px; height: 20px; accent-color: var(--accent-600); flex: none; }
.alert-level span { display: grid; gap: 0.1rem; }
.alert-level__note { font-size: var(--fs-fine); color: var(--silt); }
.alert-level:has(input:checked) { border-color: var(--accent-600); border-left-width: 3px; background: var(--accent-50); }

.alert-fields { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.field label {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  margin-bottom: 0.25rem;
}
.field input {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  padding: 0.6rem 0.7rem;
  min-height: 44px;
  border: 1px solid var(--silt);
  border-radius: 2px;
  background: #fff;
  color: var(--ink);
}
.field__hint { font-size: var(--fs-fine); color: var(--silt); margin: 0.3rem 0 0; }

.alert-submit { padding-top: clamp(1.2rem, 3vw, 1.8rem); border-top: 1px solid var(--gravel); }
.alert-submit__note { font-size: var(--fs-fine); color: var(--silt); margin-top: 0.7rem; }

.alert-result { margin-top: 1.2rem; padding: 1rem 1.15rem; border-left: 4px solid var(--accent-600); background: #fff; }
.alert-result:focus-visible { outline: 2px solid var(--accent-500); outline-offset: 2px; }
.alert-result--problem { border-left-color: var(--stage-flood); }
.alert-result p { max-width: 60ch; }
.alert-result p:last-child { margin-bottom: 0; }
.alert-result ul { margin: 0.3rem 0 0; padding-left: 1.1rem; }

/* The message preview: two shapes, because a text and an email are not the
   same object and pretending otherwise is how alerts get written badly. */
.msg-pair { display: grid; gap: clamp(1rem, 2.5vw, 1.6rem); grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); margin-top: 1.4rem; }
.msg { border: 1px solid var(--gravel); background: #fff; padding: clamp(0.9rem, 2.2vw, 1.3rem); }
.msg--sms { border-left: 3px solid var(--accent-600); }
.msg--email { border-left: 3px solid var(--stage-monitor); }
.msg__label { font-size: var(--fs-fine); text-transform: uppercase; letter-spacing: 0.12em; color: var(--silt); margin: 0 0 0.5rem; }
.msg__subject { font-family: var(--font-display); font-size: var(--fs-xl); margin: 0 0 0.4rem; }
.msg__body { font-size: var(--fs-sm); margin: 0 0 0.6rem; }
.msg--sms .msg__body {
  font-family: var(--font-mono);
  font-size: var(--fs-fine);
  background: var(--bone-2);
  padding: 0.7rem 0.8rem;
  border-radius: 2px;
}
.msg__note { font-size: var(--fs-fine); color: var(--silt); margin: 0.5rem 0 0; }
.msg .source-quote { background: var(--bone); margin-block: 0.6rem; }

/* ── Callouts, downloads, and the search page ─────────────────────────── */
.callout { border: 1px solid var(--gravel); border-left: 4px solid var(--accent-600); background: #fff; padding: clamp(1rem, 2.5vw, 1.5rem); }
.callout--warn { border-left-color: var(--stage-monitor); background: #fffdf6; }
.callout h2 { margin-top: 0; }
.callout p { max-width: 68ch; }
.callout p:last-child { margin-bottom: 0; }

.card__meta { font-family: var(--font-mono); font-size: var(--fs-fine); color: var(--silt); margin-top: -0.2rem; }

.corpus-counts {
  margin: 1.2rem 0 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid var(--gravel);
}
.corpus-counts > div { padding: 1rem; border-right: 1px solid var(--gravel); }
.corpus-counts > div:last-child { border-right: 0; }
.corpus-counts dt { color: var(--silt); font-family: var(--font-mono); font-size: var(--fs-fine); }
.corpus-counts dd { margin: 0.2rem 0 0; color: var(--accent-800); font-family: var(--font-display); font-size: var(--fs-4xl); line-height: 1; }
@media (max-width: 650px) {
  .corpus-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .corpus-counts > div:nth-child(2) { border-right: 0; }
  .corpus-counts > div:nth-child(-n + 2) { border-bottom: 1px solid var(--gravel); }
}

.download-list { list-style: none; margin: 1.1rem 0 0; padding: 0; display: grid; gap: 1rem; }
.download-list > li { border-left: 3px solid var(--gravel); padding-left: 0.95rem; max-width: var(--measure); }
.download-list__name { font-family: var(--font-display); font-size: var(--fs-xl); margin: 0; }
.download-list__name .u-mono { font-size: var(--fs-fine); color: var(--silt); }
.download-list > li > p { margin: 0.2rem 0 0; }

.u-narrow-p { max-width: var(--measure); }

.search-page { margin-bottom: 1.2rem; }
.search-page label {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  margin-bottom: 0.3rem;
}
.search-page__row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.search-page__row input {
  flex: 1 1 18rem;
  min-width: 0;
  font-family: var(--font-body);
  font-size: var(--fs-lg);
  padding: 0.55rem 0.75rem;
  min-height: 48px;
  border: 1px solid var(--silt);
  border-radius: 2px;
  background: #fff;
  color: var(--ink);
}
.search-facets { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.8rem; }
.chip--facet { background: var(--bone-2); color: var(--ink); border-color: var(--gravel); cursor: pointer; min-height: 32px; }
.chip--facet:hover { background: var(--accent-50); border-color: var(--accent-600); }
.chip--facet[aria-pressed="true"] { background: var(--accent-800); color: var(--bone); border-color: var(--accent-800); }
.search-status { color: var(--silt); }
.search-results { display: grid; gap: 0.1rem; }
.search-hit { padding: 0.75rem 0; border-bottom: 1px solid var(--gravel); }
.search-hit h3 { font-size: var(--fs-xl); margin: 0.05rem 0; }
.search-hit h3 a { text-decoration: none; }
.search-hit h3 a:hover { text-decoration: underline; }
.search-hit__kind { font-size: var(--fs-fine); text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent-700); margin: 0; }
.search-hit__meta { font-size: var(--fs-fine); color: var(--silt); margin: 0; }

/* ── 404: the gauge plate reading off scale ───────────────────────────── */
.notfound__plate {
  width: clamp(64px, 12vw, 96px);
  height: clamp(150px, 26vw, 220px);
  margin-bottom: 1.4rem;
  position: relative;
  background:
    repeating-linear-gradient(to top, var(--bone-2) 0 3px, transparent 3px 12px),
    var(--bone-2);
  border: 1px solid var(--gravel);
  border-radius: 2px 2px 0 0;
  overflow: hidden;
}
.notfound__fill {
  position: absolute;
  inset: auto 0 0 0;
  height: 100%;
  background: repeating-linear-gradient(135deg, var(--gravel) 0 6px, transparent 6px 12px);
  opacity: 0.6;
}

/* The phone source has its own fewer, larger labels instead of shrinking the
   desktop chart until technically present text becomes unreadable. */
@media (max-width: 700px) {
  .hydro__cursor {
    top: var(--hydro-mobile-top);
    bottom: var(--hydro-mobile-bottom);
    border-left-width: 3px;
  }
}
