/* Open map extras (base/templates/base/open_map.html): the USGS gauge
   overlay drawn by static/js/open_map_usgs.js. Everything else on the page is
   map_page.css, shared with a saved map. */

/* One-line status under the map: how many gauges and how fresh their colours
   are, "loading…", or "unavailable". (The gauges themselves are one MapLibre
   circle layer — there is no per-pin element to style.) */
.usgs-status {
  margin: 6px 0 0;
  min-height: 1.2em;
  font-size: 0.82rem;
  color: var(--ink-3, #6b7280);
}
/* A hint is ordinary text, not a link (2026-11-18, uiux.md finding 15): in
   brand blue it read as something to click, and in dark mode it measured
   2.85:1. --ink-2 is the token both themes keep above 4.5:1. */
.usgs-status.is-hint { color: var(--ink-2, #56534c); }
/* An empty line takes no room. They are live regions, so they stay in the
   tree (a hidden region can miss its first announcement); they just collapse,
   which closes the large blank gaps a phone showed between them. */
.usgs-status:empty { min-height: 0; margin: 0; }
/* The pins come from our own catalogue in milliseconds, but USGS takes 3-14
   seconds to say what each one reads; while it is thinking the line ticks the
   elapsed seconds and wears a turning mark, so the wait is visible work
   rather than a map that seems to have stopped. */
.usgs-status.is-loading { color: var(--link); }
body.dark-mode .usgs-status.is-loading { color: var(--nh-glass-link); }
.usgs-status.is-loading::before {
  content: "";
  display: inline-block;
  width: 0.72em; height: 0.72em;
  margin-right: 0.45em;
  vertical-align: -0.06em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: usgs-spin 0.9s linear infinite;
}
/* The elapsed seconds: hidden from the accessibility tree by the script, so
   it is decoration for the eye and wants no weight of its own. */
.usgs-status__tick { font-variant-numeric: tabular-nums; opacity: 0.85; }
@keyframes usgs-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .usgs-status.is-loading::before { animation: none; }
}
.usgs-status.is-error { color: var(--nh-glass-critical); }
body.dark-mode .usgs-status.is-error { color: var(--nh-glass-critical); }

/* A gauge's popup (static/js/open_map_usgs.js): name, site number, the
   condition class as a coloured dot beside its label, the latest value with
   its time and age, today's normal range, and the way out to USGS. The dot's
   colour is an SVG attribute set from the class table — no style attribute is
   written anywhere (CSP), and the palette lives in one place, the JS table
   pinned to base/usgs_conditions.py. */
.usgs-popup { font-size: 0.85rem; line-height: 1.35; }
.usgs-popup__name { display: block; }
.usgs-popup__site { color: var(--ink-3, #6b7280); font-size: 0.78rem; margin-bottom: 4px; }
/* What the station measures — a standing fact about the station, so it must
   not read as one of the numbers below it. */
.usgs-popup__measures { color: var(--ink-2, #4b5563); font-size: 0.78rem; margin-bottom: 4px; }
.usgs-popup__condition { display: flex; align-items: flex-start; gap: 6px; margin: 6px 0 2px; }
.usgs-popup__dot { flex: none; margin-top: 2px; }
.usgs-popup__conditionText { display: block; }
.usgs-popup__conditionLabel { display: block; font-weight: 600; }
.usgs-popup__conditionNote { display: block; color: var(--ink-3, #6b7280); font-size: 0.74rem; }
.usgs-popup__value { margin-top: 2px; font-variant-numeric: tabular-nums; }
.usgs-popup__flag { color: var(--nh-glass-warning); font-size: 0.78rem; }
body.dark-mode .usgs-popup__flag { color: var(--nh-glass-warning); }
.usgs-popup__normals { margin-top: 3px; color: var(--ink-2, #4b5563); font-size: 0.78rem; }
.usgs-popup__none { margin-top: 4px; color: var(--ink-3, #6b7280); }
/* The detail request is in flight: said in a different voice from a fact. */
.usgs-popup__pending { color: var(--link); font-style: italic; }
/* THE SAFETY AND ACCESS LINES on a mineral record, and the scope line on a
 * bedrock answer. Emphasised because a card row that reads like another
 * attribute is a row people skim: "never enter a mine opening" has to look
 * different from "Quadrangle q39124NEF4". Not red — red on this map is
 * reserved for a station in alarm, and borrowing it here would say a mine is
 * an emergency. A rule and a warm ink instead: it stops the eye without
 * claiming an urgency the record does not have. */
.usgs-popup__warn {
  margin-top: 5px;
  padding-left: 7px;
  border-left: 2px solid #b45309;
  color: var(--nh-glass-warning);
  font-size: 0.78rem;
}
body.dark-mode .usgs-popup__warn { border-left-color: #f59e0b; color: var(--nh-glass-warning); }
.usgs-popup__error { color: var(--nh-glass-critical); }
body.dark-mode .usgs-popup__error { color: var(--nh-glass-critical); }
.usgs-popup__link { display: inline-block; margin-top: 6px; text-decoration: underline; }
.usgs-popup__source { margin-top: 6px; font-size: 0.72rem; color: var(--ink-3, #6b7280); }

/* ---------------------------------------------------------------------- */
/* MapLibre (Wave 25)                                                      */
/*                                                                         */
/* This page is the site's one MapLibre map; every other map is Leaflet and */
/* keeps map.css. What is below is only what MapLibre needs and Leaflet did */
/* not: the DOM markers for the platform's own sensors and the handful of   */
/* vendor classes that have to be pulled into the site's own palette so the */
/* map does not arrive wearing MapLibre's.                                  */
/* ---------------------------------------------------------------------- */

/* One sensor pin: the shape plus its permanent name label. A grid rather
   than absolute positioning, so the label sits above the shape and the pair
   stays centred on the coordinate however long the name is. */
.nh-gl-pin {
  display: grid;
  justify-items: center;
  gap: 2px;
  cursor: pointer;
  line-height: 1;
}
.nh-gl-pin__shape { display: block; }
/* `hidden` must win over the `display: grid` above. open_map_gl.js hides a
   pin by setting `hidden` (the "Sensors on this platform" toggle and the
   measurement filter); an author `display` beats the UA's [hidden] rule, so
   without this the toggle unticked and every pin stayed (owner, 2026-11-23). */
.nh-gl-pin[hidden] { display: none; }
/* Our pins are buttons now (open_map_gl.js sensorMarkers), so a keyboard
   reader needs to see which one has focus. */
.nh-gl-pin:focus-visible {
  outline: 3px solid var(--brand-blue-deep, #1f6f93);
  outline-offset: 2px;
  border-radius: var(--r-xs, 4px);
}
/* Two sites that share a spot at this zoom are drawn side by side; a faint
   ring says the pin is near, not exactly at, its place. */
.nh-gl-pin.is-spread .nh-gl-pin__shape {
  filter: drop-shadow(0 0 1.5px rgba(0, 0, 0, 0.55));
}
/* A pin drawn inside a count bubble (open_map_gl.js planPins). A class, not
   `hidden`: `hidden` is the layer toggle and the measurement filter, and the
   bubble must not be mistaken for either. */
.nh-gl-pin.is-clustered { display: none; }
/* The count bubble for a crowd of our pins at a zoomed-out view. */
.nh-gl-cluster {
  min-width: 30px;
  height: 30px;
  padding: 0 7px;
  border-radius: 15px;
  border: 2px solid #fff;
  background: var(--brand-blue-deep, #1f6f93);
  color: #fff;
  font: 700 0.8rem/1 system-ui, sans-serif;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}
.nh-gl-cluster:hover { filter: brightness(1.15); }
.nh-gl-cluster:focus-visible {
  outline: 3px solid var(--brand-blue-deep, #1f6f93);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   The colour key chip (open_map_gl.js colourKey, 2026-11-18, uiux.md
   finding 5). Folded it is one small line in the bottom-left corner; open it
   is a short list, capped so it never covers more than half the map. */
.maplibregl-ctrl.nh-colour-key {
  pointer-events: auto;
  background: var(--nh-glass);
  color: var(--ink, #23211c);
  border-radius: var(--r-sm, 6px);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
  font-size: 0.75rem;
  line-height: 1.3;
  max-width: 17rem;
}
.nh-colour-key__head {
  cursor: pointer;
  padding: 6px 10px;
  min-height: 24px;
  font-weight: 600;
  list-style-position: inside;
}
.nh-colour-key__head:focus-visible {
  outline: 3px solid var(--brand-blue-deep, #1f6f93);
  outline-offset: 1px;
}
.nh-colour-key__body {
  padding: 0 10px 8px;
  max-height: 45vh;
  overflow-y: auto;
}
.nh-colour-key__lead { margin: 0 0 4px; font-weight: 600; }
.nh-colour-key__note { margin: 6px 0 0; color: var(--ink-2, #4b4740); }
.nh-colour-key__row { display: flex; align-items: center; gap: 6px; margin: 2px 0; }
.nh-colour-key__row svg { flex: none; }
.nh-colour-key__pin { display: inline-flex; width: 14px; justify-content: center; flex: none; }
body.dark-mode .maplibregl-ctrl.nh-colour-key { color: var(--ink, #ece9e2); }
body.dark-mode .nh-colour-key__note { color: var(--ink-2, #c9c4bb); }
@media (max-width: 640px) {
  .maplibregl-ctrl.nh-colour-key { max-width: 14rem; }
  .nh-colour-key__head { padding: 8px 10px; }
}

/* Frosted rather than solid, for the reason map.css records for the Leaflet
   tooltip it replaces: a translucent fill with a backdrop blur lifts the text
   off the tiles while still letting the map read through, so a dense cluster
   of labels does not become a wall of white boxes. Where backdrop-filter is
   unsupported the fill alone still carries it.

   The fill is the MAP GLASS token (--nh-glass, further down), not a colour of
   its own. It used to be white at 0.55 / #1A1A19 at 0.60: in the dark theme
   over a white roof, a cloud or a salt pond on the satellite basemap that
   composites to about #767676, and #F2F2EF on it is 4.2:1 (measured 4.1:1 in
   the browser, 2026-11-19, /root/agent-reports/pin-contrast). The glass is
   worked out for exactly that worst case (pure white under the dark theme,
   pure black under the light one, no credit for the blur) and
   base/tests/test_open_map_glass.py holds --ink on it to 4.5:1, so the labels
   now inherit that guarantee, follow the theme without a dark-mode rule, and
   firm up with the rest of the chrome where blur or transparency is off. */
.nh-gl-pin__label {
  background: var(--nh-glass);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  border-radius: var(--r-xs, 4px);
  padding: 1px 6px;
  color: var(--ink);
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.7);
}
.nh-gl-pin__label:empty { display: none; }
body.dark-mode .nh-gl-pin__label {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

/* The pin dropped by the "Go to lat, long" box. */
.nh-gl-coordpin {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 3px solid var(--brand-gold, #cb8616);
  background: rgba(203, 134, 22, 0.25);
}

/* The map could not load at all (offline, blocked, a failed deploy): say so
   where the map would have been rather than leaving an empty grey box. */
.nh-gl-failed { padding: 1.5rem; color: var(--ink-3, #6b7280); text-align: center; }

/* LAZILY LOADED PARTS (2026-11-28, static/js/nh_lazy.js). A card, a layer or a
   tool whose code has not arrived yet says so: one line over the top of the
   map while a reader waits on it, and a line in the Layers panel and the Tools
   menu while theirs load. Glass like every other surface over the map. */
.nh-lazy-busy {
  position: absolute; z-index: 5; top: 10px; left: 50%; transform: translateX(-50%);
  margin: 0; padding: 4px 12px; border-radius: 999px;
  background: var(--nh-glass, #fff); color: var(--ink, #1a1a19);
  -webkit-backdrop-filter: blur(var(--nh-glass-blur, 6px));
  backdrop-filter: blur(var(--nh-glass-blur, 6px));
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.18);
  font-size: 0.8rem; pointer-events: none;
}
.nh-lazy-busy[hidden] { display: none; }
.nh-lazy-busy.is-error { color: var(--nh-glass-critical, #8A1414); }
.open-panel__lazy, .nh-tools__loading {
  margin: 4px 0; padding: 2px 0; font-size: 0.8rem; font-style: italic; color: var(--ink-2, #3f3f3c);
}
.open-panel__lazy.is-error, .nh-tools__loading.is-error { color: var(--nh-glass-critical, #8A1414); font-style: normal; }
.mp-empty { padding: 1rem; color: var(--ink-3, #6b7280); }

/* MapLibre's own chrome, brought into the site's palette. Only the four
   surfaces a visitor actually sees on this page — popup, controls,
   attribution and the cooperative-gesture veil — and only colour, radius and
   type; none of MapLibre's geometry is overridden, because that is what makes
   its anchors and tips line up. */
.maplibregl-map .maplibregl-popup-content {
  background: var(--nh-glass-card);
  color: var(--ink);
  border: 1px solid var(--line, #e3e0d7);
  border-radius: var(--r-sm, 6px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
  padding: 10px 12px;
  font-family: inherit;
}
.maplibregl-map .maplibregl-popup-tip { border-top-color: var(--nh-glass-card); }
.maplibregl-popup-anchor-top .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {
  border-bottom-color: var(--nh-glass-card);
  border-top-color: transparent;
}
.maplibregl-popup-close-button {
  color: var(--ink-3, #6b7280);
  font-size: 1.1rem;
  padding: 0 6px;
  background: transparent;
}
.maplibregl-popup-close-button:hover { background: var(--surface-2, #f4f2ec); }
.maplibregl-popup-close-button:focus-visible {
  outline: 3px solid var(--accent-ring, #2887b1);
  outline-offset: -2px;
}
.maplibregl-map .maplibregl-ctrl-group {
  background: var(--nh-glass);
  border-radius: var(--r-sm, 6px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
}
.maplibregl-ctrl-attrib.maplibregl-compact { font-size: 0.7rem; }

/* Both of these are MapLibre controls, so they arrive inside a
   .maplibregl-ctrl slot rather than a .leaflet-control one; the panel and the
   coordinate box themselves are styled by map.css exactly as on every other
   map, and only the positioning context differs. */
.maplibregl-ctrl.map-panel,
.maplibregl-ctrl.coord-search { clear: both; pointer-events: auto; }


/* The pointer over a clickable gauge. A class rather than a style write,
   because nothing in open_map_usgs.js writes a style attribute. */
.nh-gl-hoverable { cursor: pointer; }

/* ---------------------------------------------------------------------- */
/* The control panel (static/js/open_map_panel.js)                         */
/*                                                                         */
/* Built on .map-panel from map.css, so this map's controls are the same    */
/* object every other map on the site has — same box, same head, same fold. */
/* What is here is only what the three views add: the active list at rest,  */
/* the grouped picker, the info card, the two legends and the filters.      */
/*                                                                         */
/* QUIET AT REST is the whole idea. Seventeen sources will not fit as       */
/* seventeen checkboxes, and a panel that covers a third of the map is not  */
/* a legend, so at rest this is a short list of what is ON and two ways in. */
/* ---------------------------------------------------------------------- */
/* A swatch whose layer handed over a bare CSS colour rather than markup — see
   `paintSwatch` in open_map_panel.js, which is the only thing that builds this
   node. Sized and ringed like the small circles the vector layers draw, so the
   flood-warning layer's key reads as the same kind of mark as its neighbours'
   rather than as a different shape that happens to be the right colour. */
.map-panel__dot {
  display: inline-block;
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.45);
  align-self: center;
}

/* Design B (2026-11-18) is a list with a second line per network ("Federal ·
   mostly stage, flow, w temp +3") and an in-view count in a right-hand
   column, which needs the prototype's ~340px, not the old 17rem. Folded it is
   only its head, so it shrinks back to that. */
.maplibregl-ctrl.open-panel { width: 21rem; max-width: calc(100vw - 24px); }
.maplibregl-ctrl.open-panel.is-collapsed { width: auto; min-width: 11rem; }
/* The body is a scroll region and says so — see `.nh-scrollcue` in map.css
   for why, and open_map_panel.js for where the class is put on. Measured at
   1440x900 the rest view is 1168px of content in a 540px box, so more than
   half of this panel — the legend and the basemap among it — is below the
   fold on every visit. `--nh-cue-surface` is the panel's own background,
   because the technique paints opaque covers over the shadows at each end
   and a cover in the wrong colour is a stripe. */
.open-panel .map-panel__body {
  max-height: 60vh;
  overflow-y: auto;
}

/* Secondary ink on the map's furniture: see MAP GLASS further down this file,
   where every grey resolves to --ink. These two cards are also drawn inside
   the station card, and say so themselves for the case where they are not. */
body.dark-mode .tide-card,
body.dark-mode .glofas-card { --ink-3: var(--ink); }

/* A count of what is switched on, in the head, so the fold is not a way to
   lose track of it. */
.open-panel__badge {
  display: inline-block;
  min-width: 1.15rem;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent-tint, #E6F0F5);
  color: var(--accent-tint-ink, #175571);
  font-size: 0.7rem; font-weight: 700; text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ---- Design B: the grouped list (open_map_panel.js `create`) ----------
   One search box over everything, then folds by what a layer IS — stations
   and gauges, the measurement filter, hazards, weather and ocean, boundaries
   and reference, the key — each head saying how many are on and in view. */
.open-panel__top { padding: 0 10px 8px; }
.open-panel.is-collapsed .open-panel__top { display: none; }
.open-panel__find { position: relative; }
/* A magnifier drawn in CSS: no image request, and nothing for the CSP. */
.open-panel__find::before,
.open-panel__find::after {
  content: ""; position: absolute; pointer-events: none;
  border-color: var(--ink-3, #746E62);
}
.open-panel__find::before {
  left: 9px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border: 1.6px solid var(--ink-3, #746E62); border-radius: 50%;
}
.open-panel__find::after {
  left: 17px; top: 50%; width: 5px; height: 0; margin-top: 3px;
  border-top: 1.6px solid var(--ink-3, #746E62);
  transform: rotate(45deg); transform-origin: left center;
}
.open-panel__findInput {
  display: block; width: 100%; box-sizing: border-box;
  padding: 6px 8px 6px 27px;
  border: 1px solid var(--line-strong, #CFCABD);
  border-radius: var(--r-xs, 4px);
  background: var(--field, #fff);
  color: var(--ink);
  font: inherit; font-size: 0.8rem;
}
.open-panel__findInput:focus-visible { outline: 3px solid var(--accent-ring, #2887b1); outline-offset: 0; }
.open-panel__headFilters { font-weight: 600; font-size: 0.72rem; color: var(--link, #1F6D8F); }

/* "pH: 312 in view now; 4 networks carry it  [Show only these]" */
.open-panel__offer {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px;
  margin: 0 0 8px; padding: 7px 9px;
  border: 1px dashed var(--link, #1F6D8F); border-radius: 8px;
  background: rgba(31, 109, 143, 0.07);
}
.open-panel__offerText { flex: 1 1 11rem; margin: 0; font-size: 0.76rem; line-height: 1.35; }
.open-panel__offerBtn {
  flex: none; min-height: 28px; padding: 4px 10px;
  border: 0; border-radius: 6px;
  background: var(--accent, #1F6D8F); color: var(--accent-ink, #fff);
  font: inherit; font-size: 0.74rem; font-weight: 700; cursor: pointer;
}
.open-panel__offerBtn:focus-visible { outline: 3px solid var(--accent-ring, #2887b1); outline-offset: 2px; }

/* The summary: stations in view, every filter in force as a chip, one Reset. */
.open-panel__summary { display: flex; flex-direction: column; gap: 6px; margin: 0 0 8px; }
.open-panel__summaryLine { display: flex; align-items: center; gap: 8px; font-size: 0.76rem; color: var(--ink-3, #746E62); }
.open-panel__summaryText strong { color: var(--ink, #1A1A19); font-variant-numeric: tabular-nums; }
.open-panel__reset {
  margin-left: auto; flex: none; min-height: 24px; padding: 2px 11px;
  border: 1px solid var(--line-strong, #CFCABD); border-radius: 999px;
  background: var(--surface, #fff); color: var(--link, #1F6D8F);
  font: inherit; font-size: 0.72rem; font-weight: 700; cursor: pointer;
}
.open-panel__reset:disabled { opacity: 0.5; cursor: default; }
.open-panel__reset:focus-visible { outline: 3px solid var(--accent-ring, #2887b1); outline-offset: 1px; }
.open-panel__sumChips { display: flex; flex-wrap: wrap; gap: 4px; }
/* Honest about what a measurement filter cannot judge: not a warning colour,
   the provisional rule the caveats use — this is "worth knowing", not wrong. */
.open-panel__unknown {
  margin: 0; padding: 3px 0 3px 7px;
  border-left: 2px solid var(--provisional, #8A5A0D);
  color: var(--ink-2, #56534C); font-size: 0.71rem; line-height: 1.35;
}

/* A fold: a bordered box with a tinted head; the head is ONE button
   (aria-expanded) and, for the stations, a master tick box before it. */
.open-panel__fold { border: 1px solid var(--line, #e3e0d7); border-radius: 8px; overflow: hidden; }
.open-panel__fold + .open-panel__fold { margin-top: 6px; }
.open-panel__foldHead {
  display: flex; align-items: center; gap: 6px;
  padding: 0 8px 0 6px;
  background: var(--surface-2, #F4F2EC);
}
.open-panel__master { flex: none; width: 15px; height: 15px; margin: 0 0 0 3px; accent-color: var(--accent, #1F6D8F); cursor: pointer; }
.open-panel__foldBtn {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: 7px;
  padding: 7px 2px; border: 0; background: transparent;
  font: inherit; font-size: 0.78rem; font-weight: 700; color: var(--ink, #1A1A19);
  text-align: left; cursor: pointer;
}
.open-panel__foldBtn:focus-visible,
.open-panel__master:focus-visible,
.open-panel__toggle:focus-visible,
.open-panel__repBox:focus-visible,
.open-panel__linkBtn:focus-visible {
  outline: 3px solid var(--accent-ring, #2887b1); outline-offset: 1px;
}
.open-panel__foldChev {
  flex: none; width: 0; height: 0;
  border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  border-left: 5px solid var(--ink-3, #746E62);
  transition: transform 0.15s ease;
}
.open-panel__foldBtn[aria-expanded="true"] .open-panel__foldChev { transform: rotate(90deg); }
.open-panel__foldLabel { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.open-panel__foldMeta {
  margin-left: auto; flex: none;
  font-weight: 400; font-size: 0.7rem; color: var(--ink-3, #746E62);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.open-panel__foldBody { padding: 2px 8px 6px; }
.open-panel__foldBody[hidden] { display: none; }

/* A layer's row: tick box, swatch, name and in-view count on one line, who
   runs it and what it mostly measures on the next. */
.open-panel__item { border-top: 1px solid var(--line, #e3e0d7); }
.open-panel__item:first-child { border-top: 0; }
.open-panel__itemHead { display: flex; align-items: flex-start; gap: 6px; }
.open-panel__row {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: flex-start; gap: 7px;
  padding: 5px 0; cursor: pointer;
}
.open-panel__row .map-panel__swatch { margin-top: 1px; }
.open-panel__toggle { flex: none; width: 15px; height: 15px; margin: 1px 0 0; accent-color: var(--accent, #1F6D8F); cursor: pointer; }
.open-panel__rowText { flex: 1 1 auto; min-width: 0; display: block; }
.open-panel__nameLine { display: flex; align-items: baseline; gap: 6px; }
.open-panel__nameLine .map-panel__name { flex: 1 1 auto; min-width: 0; }
.open-panel__n {
  flex: none; margin-left: auto;
  color: var(--ink-3, #746E62); font-size: 0.72rem; font-variant-numeric: tabular-nums;
}
.map-panel__key .open-panel__n { padding-left: 6px; }
.open-panel__sub { display: block; color: var(--ink-3, #746E62); font-size: 0.7rem; line-height: 1.3; }
.open-panel__itemHead .open-panel__filterBtn { margin-top: 3px; }
/* The word and the funnel are what make it findable; the count stays in its
   accessible name, and the width goes back to the layer's own name. */
.open-panel__itemHead .open-panel__filterCount { display: none; }
/* ON, BUT NOTHING IN VIEW: one short line, quieter than a working row. */
.open-panel__item.is-compact .open-panel__row { padding: 2px 0; font-size: 0.72rem; }
.open-panel__item.is-compact .map-panel__name,
.open-panel__item.is-compact .open-panel__n { color: var(--ink-3, #746E62); }
.open-panel__item.is-compact .open-panel__layerNote { display: inline; margin-left: 4px; }
.open-panel__subhead,
.open-panel__foldBody .map-panel__subhead {
  margin: 8px 0 1px;
  font-size: var(--fs-0, 0.68rem); text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-3, #746E62); font-weight: 700;
}
.open-panel__measure + .open-panel__measure { border-top: 1px solid var(--line, #e3e0d7); }
.open-panel__measure.is-zero .map-panel__name { color: var(--ink-3, #746E62); }
.open-panel__rep { margin: 4px 0 0; padding-top: 6px; border-top: 1px solid var(--line, #e3e0d7); }
.open-panel__rep small { display: inline; }
.open-panel__linkBtn {
  border: 0; background: none; padding: 4px 0;
  color: var(--link, #1F6D8F); font: inherit; font-size: 0.74rem;
  text-decoration: underline; cursor: pointer;
}
.open-panel__colourBy { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 2px; }
.open-panel__colourByLabel { font-size: 0.72rem; color: var(--ink-3, #746E62); }
.open-panel__view { margin-top: 6px; }
.open-panel__empty, .open-panel__note {
  margin: 4px 0; color: var(--ink-3, #746E62); font-size: 0.72rem; line-height: 1.35;
}
.open-panel__back {
  display: block; width: 100%;
  margin: 2px 0 2px; padding: 5px 8px;
  border: 1px solid var(--line-strong, #CFCABD);
  border-radius: var(--r-xs, 4px);
  background: var(--surface-2, #F4F2EC);
  font: inherit; font-size: 0.76rem; font-weight: 600;
  color: var(--ink-2, #56534C);
  cursor: pointer; text-align: left;
}
.open-panel__back:hover { background: var(--band, #F0ECE2); }
.open-panel__back::before { content: "\2190\00a0"; }
.open-panel__back:focus-visible,
.open-panel__info:focus-visible,
.open-panel__segment:focus-visible {
  outline: 3px solid var(--accent-ring, #2887b1); outline-offset: 1px;
}
/* The count of a layer's answer and its age, under its name. */
.open-panel__age {
  display: block;
  color: var(--ink-3, #746E62);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}
/* A layer past its OWN promise. Not red: this is "worth a look", not an
   error. THE TOKEN IS `--warning-ink` (the old `--warn-ink` was defined
   nowhere and fell through to the light value, 1.95:1 on the dark panel). */
.open-panel__age.is-stale {
  color: var(--warning-ink, #8A5A0D);
  font-weight: 600;
}
/* The one summary line that names the catalogues that are NOT current. */
.open-panel__freshness {
  margin: 0;
  color: var(--ink-3, #746E62);
  font-size: 0.72rem;
  line-height: 1.35;
}
body.dark-mode .open-panel__foldBtn,
body.dark-mode .open-panel__summaryText strong { color: var(--ink); }
body.dark-mode .open-panel__offer { background: rgba(124, 193, 224, 0.08); }

/* The info affordance: hover gives the one-liner (title), the button gives
   the card. Same information, two depths, and the cheap one costs no click. */
.open-panel__info {
  flex: none; margin-top: 5px;
  width: 17px; height: 17px;
  border: 1px solid var(--line-strong, #CFCABD);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-3, #746E62);
  font: inherit; font-size: 0.66rem; font-weight: 700; font-style: italic;
  line-height: 1; cursor: pointer;
}
.open-panel__info:hover { background: var(--accent-tint, #E6F0F5); color: var(--accent-tint-ink, #175571); }

/* The info card. A definition list in all but name — key above value, because
   the panel is too narrow for two columns and a wrapped value beside a key is
   harder to read than one beneath it. */
.open-panel__card { margin-top: 6px; }
.open-panel__cardName { margin: 0 0 4px; font-size: 0.86rem; }
.open-panel__cardKey {
  margin-top: 6px;
  font-size: var(--fs-0, 0.7rem); text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--ink-3, #746E62);
}
.open-panel__cardValue { margin: 1px 0 0; font-size: 0.74rem; line-height: 1.4; }
/* A caveat is not fine print: it is the sentence that stops a reader treating
   a provisional number, or a three-month-old lab sample, as a live reading. */
.open-panel__caveat {
  margin: 6px 0 0;
  padding-left: 7px;
  border-left: 2px solid var(--provisional, #8A5A0D);
  color: var(--ink-2, #56534C);
  font-size: 0.72rem; line-height: 1.4;
}
.open-panel__link { display: inline-block; margin-top: 8px; font-size: 0.74rem; }

/* The legend: every source that is on, and under a source that registered
   one, its own key — the USGS layer's eleven condition classes. The "Shape:
   the station" block is drawn only for an overlay that asks for it. */
.open-panel__legend { margin-top: 2px; }
.open-panel__legendBlock { margin-bottom: 4px; }
.open-panel__state { align-items: flex-start; }
.open-panel__stateText { display: block; }
.open-panel__state .open-panel__note { margin: 0; }
/* A source's own rows, indented past its swatch so they read as an
   explanation of that source rather than more sources. */
.open-panel__legendRows { margin: 1px 0 4px 10px; }
.open-panel__legendRows .map-panel__key { margin: 1px 0; }
.open-panel__legendRows .open-panel__note { font-size: 0.68rem; }
/* A key row is a NAME and, under it, the sentence explaining it. Both are
   spans, so they need saying: without this the two run together as one
   paragraph ("FloodingAt or above an official flood stage"), which is how the
   shared water scale's key first drew on 2026-09-06. */
.open-panel__state .map-panel__name,
.open-panel__state .open-panel__note { display: block; }
/* The state swatches take their stroke from the text colour, so the key is
   drawn in whatever ink the panel is using and reads in both themes. */
.open-panel__state .map-panel__swatch { color: var(--ink-2, #56534C); }

/* ==================================================== THE SHARED WATER SCALE
   One key for "how is the water?", drawn once above every layer that paints
   it (2026-09-06, audit/open-map-colour/STUDY.md Part 3). It is IN THE OPEN
   rather than behind the fold below, because it is now the primary encoding
   of nine thousand pins rather than one layer's private vocabulary. */
.open-panel__scale {
  margin: 8px 0 0;
  padding-top: 7px;
  border-top: 1px solid var(--line, #e3e0d7);
}
.open-panel__scale > .open-panel__note { margin: 2px 0 4px; }
.open-panel__scale .open-panel__legendRows { margin-left: 0; }
/* How old each layer's answer is and how often it is recomputed. Set apart
   from the key by a hairline so it reads as provenance, not as more classes. */
.open-panel__scaleAges {
  margin: 5px 0 3px;
  padding-top: 4px;
  border-top: 1px dashed var(--line, #e3e0d7);
}
.open-panel__scaleAges .open-panel__note { margin: 1px 0; font-size: 0.68rem; }
/* The Agency colours switch: a checkbox and its label on one line, the
   sentence explaining it beneath, indented past the box. */
.open-panel__switch {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 6px;
  align-items: center;
  margin: 6px 0 2px;
  font-size: 0.73rem;
  cursor: pointer;
}
.open-panel__switch input { margin: 0; }
.open-panel__switch .open-panel__note {
  grid-column: 2;
  margin: 0;
  font-size: 0.67rem;
  line-height: 1.35;
}

/* THE ONE VISIBLE BUTTON. A MapLibre control beside the zoom, so the pins the
   map is holding back are never held back silently. It is a whole sentence
   wide on purpose — "Show 12,431 unranked / stale" says the rule, the number
   and the way out in the space a bare icon would have said nothing. */
/* MapLibre's control group is sized for a 29px icon; this one is a sentence,
   so it takes its own width and keeps the group's card and shadow. */
.nh-stale-ctrl.maplibregl-ctrl-group {
  pointer-events: auto;
  width: auto;
  max-width: 15rem;
  background: var(--nh-glass);
  overflow: hidden;
}
/* MapLibre sizes every button in a control group to a 29px SQUARE, at a
   higher specificity than a single class — so this one says its own size at
   the same weight. A sentence in a 29px box is what the button first drew as. */
.nh-stale-ctrl.maplibregl-ctrl-group button.nh-stale-ctrl__btn {
  display: block;
  width: 100%;
  height: auto;
  border: 0;
  border-radius: inherit;
  background: none;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.72rem;
  line-height: 1.3;
  text-align: left;
  white-space: normal;
  color: var(--ink);
  cursor: pointer;
}
.nh-stale-ctrl.maplibregl-ctrl-group button.nh-stale-ctrl__btn:hover {
  background: var(--surface-2, #f4f2ec);
}
.nh-stale-ctrl.maplibregl-ctrl-group button.nh-stale-ctrl__btn:focus-visible {
  outline: 3px solid var(--accent-ring, #2887b1);
  outline-offset: -2px;
}
.nh-stale-ctrl.maplibregl-ctrl-group button.nh-stale-ctrl__btn[aria-pressed="true"] {
  font-weight: 600;
}
body.dark-mode .nh-stale-ctrl.maplibregl-ctrl-group button.nh-stale-ctrl__btn {
  color: var(--ink);
}

/* THE HOVER TOOLTIP — the first legend surface that is on the map itself.
   It says the state, or the REASON a pin is grey, without a click. Narrow,
   quiet, and never in the way of the pointer (`pointer-events: none`). */
.nh-scale-hover { pointer-events: none; }
.nh-scale-hover .maplibregl-popup-content {
  padding: 5px 8px;
  font-size: 0.72rem;
  line-height: 1.3;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

/* THE CARD'S TWO ROWS. The shared scale first — what the pin was painted
   from — and the agency's own class beneath it, stepped in and quieter, as
   the second opinion it now is rather than the headline it used to be. */
.usgs-popup__state { margin-top: 7px; }
.usgs-popup__stateDot { display: inline-flex; flex: none; }
.usgs-popup__stateDot svg { display: block; }
.usgs-popup__agency { margin-left: 10px; opacity: 0.86; }
.usgs-popup__agency .usgs-popup__conditionLabel {
  font-weight: 500;
  font-size: 0.76rem;
}

/* The one sentence that says what colour MEANS, above the folded key. It is
   the rule the whole map obeys, so it is not typeset as a footnote. */
.open-panel__legendRule {
  margin: 8px 0 0;
  padding-top: 7px;
  border-top: 1px solid var(--line, #e3e0d7);
  font-size: 0.71rem; line-height: 1.4;
  color: var(--ink-2, #56534C);
}
.open-panel__legendRule strong { font-weight: 700; }

/* A layer's filters say "show me ONLY these". A one-choice filter is a
   dropdown; a filter of categories is a group of tick boxes (2026-11-28,
   owner: select more than one option), boxed and titled as one control so it
   never reads as more layer switches ("also show me these"). */
.open-panel__filter { display: block; margin: 3px 0; }
.open-panel__filterLabel { display: block; font-size: 0.72rem; color: var(--ink-3, #746E62); }
.open-panel__select {
  width: 100%;
  padding: 3px 5px;
  border: 1px solid var(--line-strong, #CFCABD);
  border-radius: var(--r-xs, 4px);
  background: var(--field, #fff);
  color: var(--ink);
  font: inherit; font-size: 0.75rem;
}
.open-panel__select:disabled { opacity: 0.55; cursor: not-allowed; }
.open-panel__select:focus-visible { outline: 3px solid var(--accent-ring, #2887b1); outline-offset: 1px; }

/* The tick-box group. Its fill is --field, which on the map is the glass
   field token, so the group stays see-through like the dropdown beside it.
   A long list (organisations, storms) scrolls inside its box. */
fieldset.open-panel__filter--multi { margin: 4px 0; padding: 0; border: 0; min-width: 0; }
.open-panel__filter--multi > legend { padding: 0; margin-bottom: 2px; }
.open-panel__checks {
  max-height: 11.5em; overflow-y: auto; overscroll-behavior: contain;
  padding: 2px 4px;
  border: 1px solid var(--line-strong, #CFCABD);
  border-radius: var(--r-xs, 4px);
  background: var(--field, #fff);
}
.open-panel__check {
  display: flex; align-items: flex-start; gap: 6px;
  padding: 2px 0; font-size: 0.75rem; color: var(--ink); cursor: pointer;
}
.open-panel__checkBox { flex: none; margin: 2px 0 0; accent-color: var(--link, #1F6D8F); }
.open-panel__checkBox:focus-visible { outline: 3px solid var(--accent-ring, #2887b1); outline-offset: 1px; }
.open-panel__checkBox:disabled + .open-panel__checkText { opacity: 0.55; }
.open-panel__checkText { min-width: 0; overflow-wrap: anywhere; }
.open-panel__checksFoot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 2px;
}
.open-panel__checksFoot .open-panel__note { margin: 0; }
.maplibregl-ctrl button.open-panel__checksAll,
.open-panel__checksAll {
  flex: none; width: auto; height: auto; padding: 1px 8px;
  border: 1px solid var(--line-strong, #CFCABD); border-radius: 999px;
  background: transparent; color: var(--link, #1F6D8F);
  font: inherit; font-size: 0.7rem; cursor: pointer;
}

/* --- per-layer filters (2026-11-18, open_map_panel.js drawLayerFilters) ---
   A small outlined button on the row of each switched-on layer that has
   filters. Quiet enough to sit on every such row without the list turning
   into a toolbar, labelled in words because an icon alone is exactly the
   "nobody knew it was there" this replaces. */
.open-panel__filterBtn {
  flex: none;
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 26px; margin-top: 2px; padding: 2px 7px;
  border: 1px solid var(--line-strong, #CFCABD);
  border-radius: 999px;
  background: var(--surface, #fff);
  color: var(--link, #1F6D8F);
  font: inherit; font-size: 0.72rem; font-weight: 600; line-height: 1;
  cursor: pointer;
}
.open-panel__filterBtn:hover { border-color: var(--link, #1F6D8F); }
.open-panel__filterBtn[aria-expanded="true"] {
  background: var(--link, #1F6D8F); border-color: var(--link, #1F6D8F);
  color: var(--nh-glass-solid);
}
.open-panel__filterBtn:focus-visible,
.open-panel__chip:focus-visible {
  outline: 3px solid var(--accent-ring, #2887b1); outline-offset: 1px;
}
.open-panel__filterIcon { display: inline-flex; }
.open-panel__filterIcon svg { display: block; }
.open-panel__filterCount {
  min-width: 1.3em; padding: 1px 4px; border-radius: 999px;
  background: rgba(31, 109, 143, 0.12);
  font-variant-numeric: tabular-nums; text-align: center;
}
.open-panel__filterBtn[aria-expanded="true"] .open-panel__filterCount { background: rgba(255, 255, 255, 0.25); }
/* A narrowing is in force: the funnel fills, so the button itself still
   reads as "this layer is showing part of itself" beside its chip. */
.open-panel__filterBtn.is-narrowed .open-panel__filterIcon svg path { fill: currentColor; }

/* The once-a-session "this is here": two slow beats of a ring. */
@keyframes open-panel-filter-hint {
  0%, 100% { box-shadow: 0 0 0 0 rgba(40, 135, 177, 0); }
  35% { box-shadow: 0 0 0 4px rgba(40, 135, 177, 0.45); }
}
.open-panel__filterBtn.is-hinted {
  border-color: var(--link, #1F6D8F);
  animation: open-panel-filter-hint 1.2s ease-in-out 2;
}
@media (prefers-reduced-motion: reduce) {
  /* No movement: the ring is simply there for the same two beats. */
  .open-panel__filterBtn.is-hinted {
    animation: none;
    box-shadow: 0 0 0 3px rgba(40, 135, 177, 0.35);
  }
}

/* The narrowing in force, under the row, with its own way out. */
.open-panel__chips { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 0 5px 23px; }
.open-panel__chip {
  display: inline-flex; align-items: center; gap: 5px;
  max-width: 100%; min-height: 24px; padding: 2px 6px 2px 8px;
  border: 1px solid var(--link, #1F6D8F); border-radius: 999px;
  background: rgba(31, 109, 143, 0.08);
  color: var(--ink, #1A1A19);
  font: inherit; font-size: 0.72rem; line-height: 1.2;
  cursor: pointer;
}
.open-panel__chip:hover { background: rgba(31, 109, 143, 0.16); }
.open-panel__chipText { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.open-panel__chipX { flex: none; color: var(--link, #1F6D8F); font-size: 0.7rem; }

/* The layer's dropdowns, opened in place under its row. */
.open-panel__inline {
  margin: 0 0 6px 23px; padding: 2px 0 2px 8px;
  border-left: 2px solid var(--line-strong, #CFCABD);
}
.open-panel__inline .open-panel__filter:first-child { margin-top: 0; }
body.dark-mode .open-panel__chip { color: var(--ink, #ece9e2); }

/* Phone: every one of these is a thumb target — 32px at least. */
@media (max-width: 620px) {
  .open-panel__filterBtn { min-height: 32px; padding: 4px 10px; font-size: 0.78rem; }
  .open-panel__chip { min-height: 32px; padding: 4px 8px 4px 10px; font-size: 0.78rem; }
  .open-panel__inline .open-panel__select { min-height: 32px; font-size: 16px; }
  /* Each box is a thumb target, and the list may run longer in a sheet. */
  .open-panel__check { min-height: 32px; align-items: center; font-size: 0.85rem; }
  .open-panel__checkBox { width: 18px; height: 18px; margin: 0; }
  .open-panel__checks { max-height: 14em; }
  .maplibregl-ctrl button.open-panel__checksAll,
  .open-panel__checksAll { min-height: 32px; padding: 4px 12px; font-size: 0.78rem; }
}

.open-panel__segmented {
  display: flex;
  border: 1px solid var(--line-strong, #CFCABD);
  border-radius: var(--r-xs, 4px);
  overflow: hidden;
}
.open-panel__segment {
  flex: 1 1 0;
  border: 0; border-left: 1px solid var(--line-strong, #CFCABD);
  padding: 4px 6px;
  background: var(--surface, #fff);
  font: inherit; font-size: 0.74rem;
  color: var(--ink-2, #56534C);
  cursor: pointer;
}
.open-panel__segment:first-child { border-left: 0; }
.open-panel__segment.is-on {
  background: var(--accent, #1F6D8F); color: var(--accent-ink, #fff); font-weight: 600;
}

/* Find a station: the one question this map answers that is not about the
   viewport. Debounced and bounded in the script; here it is just a box. */
.station-search {
  background: var(--nh-glass);
  border-radius: var(--r-sm, 6px);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
  padding: 6px 8px;
  width: 14rem;
  max-width: 60vw;
}
.station-search__label {
  display: block;
  font-size: var(--fs-0, 0.7rem); text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--ink-3, #746E62);
}
.station-search__input {
  width: 100%;
  padding: 4px 7px;
  border: 1px solid var(--line-strong, #CFCABD);
  border-radius: var(--r-xs, 4px);
  background: var(--field, #fff);
  color: var(--ink);
  font: inherit; font-size: 0.78rem;
}
.station-search__input:focus-visible { outline: 3px solid var(--accent-ring, #2887b1); outline-offset: 1px; }
.station-search__status {
  margin: 3px 0 0; min-height: 1em;
  color: var(--ink-3, #746E62); font-size: 0.7rem;
}
.station-search__list { list-style: none; margin: 2px 0 0; padding: 0; max-height: 40vh; overflow-y: auto; }
.station-search__hit {
  display: block; width: 100%;
  padding: 4px 5px;
  border: 0; border-radius: var(--r-xs, 4px);
  background: none;
  font: inherit; text-align: left; cursor: pointer;
  color: var(--ink);
}
.station-search__hit:hover { background: var(--surface-2, #F4F2EC); }
.station-search__hit:focus-visible { outline: 3px solid var(--accent-ring, #2887b1); outline-offset: -1px; }
/* The two halves of an answer, each under its source (Wave 25). Without the
   heading a row reading "Headworks" and a row reading "SACRAMENTO R AT FREEPORT"
   sit in one undifferentiated list and the reader has to click to find out
   which is one of ours. Sticky, because the list scrolls at 40vh and a heading
   that scrolls away takes the answer to that question with it. */
.station-search__group {
  position: sticky; top: 0;
  padding: 3px 5px 2px;
  background: var(--nh-glass-solid);
  color: var(--ink-3, #746E62);
  font-size: 0.64rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
}
/* Every row is an <li>, headings included, so the separator is "a heading that
   is not the first thing in the list". */
.station-search__list li + .station-search__group { margin-top: 4px; }
.station-search__name { display: block; font-size: 0.76rem; line-height: 1.25; }
.station-search__id {
  display: block;
  color: var(--ink-3, #746E62); font-size: 0.68rem; font-variant-numeric: tabular-nums;
}

body.dark-mode .open-panel__segment.is-on { color: #fff; }
body.dark-mode .station-search { color: var(--ink); }
body.dark-mode .open-panel__state .map-panel__swatch { color: var(--ink); }

/* On a phone the panel is a BOTTOM SHEET, not a shrunken desktop panel: it
   spans the width, sits against the bottom edge where a thumb is, and folds
   to its header so the map is never mostly panel. MapLibre positions its
   control corners absolutely, so the corner itself is what moves.

   DESIGN B's PHONE BREAKPOINT IS 620px (the prototype's), and the sheet has
   two states, both held to the bottom of the SCREEN. FOLDED it is its 44px
   head — "Layers 11 of 30 · 2 filters" — and nearly all of the map is map.
   (On the map's own bottom edge it was half off the screen: at 390x844 the
   map runs to y866.) OPEN it is at most min(40vh, 340px): the prototype's 64%
   was the upper bound, and this leaves about half of the 694px map showing
   while the list scrolls inside the sheet. */
@media (max-width: 620px) {
  .maplibregl-ctrl-top-right:has(.open-panel) {
    position: absolute;
    top: auto; right: 0; bottom: 0; left: 0;
    display: block;
    /* WHY THIS LINE EXISTS (2026-09-04). Moving the corner to the bottom put
       it in the same place as `.maplibregl-ctrl-bottom-right`, which MapLibre
       appends to the control container AFTER this one — so with no z-index
       the attribution painted on top of the sheet. Measured at 360x780:
       the Layers header was a 176x30 box at y539-569 and
       `document.elementFromPoint()` at its centre returned
       `DIV.maplibregl-ctrl-attrib-inner`; a click on it timed out. There
       were no layer toggles, no legend and no source browser on a phone at
       all. The sheet is the reader's control surface and the attribution is
       a line of credit, so the sheet is on top and the credit lifts clear
       of it (below) rather than the other way round. */
    z-index: 3;
  }
  /* Selector deliberately as specific as MapLibre's own
     `.maplibregl-ctrl-top-right .maplibregl-ctrl`, which sets `float: right`
     and `margin: 10px 10px 0 0`. A plain `.open-panel` lost to it: the float
     and the right margin survived, so `width: 100%` made a 330px box inside a
     320px corner and it floated 10px off the map's left edge. */
  .maplibregl-ctrl-top-right .maplibregl-ctrl.open-panel {
    max-width: none;
    margin: 0;
    border-radius: var(--r-sm, 6px) var(--r-sm, 6px) 0 0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.28);
    /* MapLibre floats every `.maplibregl-ctrl`, so `max-width: none` alone
       left the sheet shrink-wrapped to its own text — measured 176px of a
       320px map, a sheet in name only and a small target for a thumb. */
    float: none;
    width: 100%;
  }
  /* THE SHEET IS THE SCREEN'S, NOT THE MAP'S (2026-09-04, and folded too since
     2026-11-18): what a phone bottom sheet is, anchored to the VIEWPORT, with
     the map showing through above it. Anchoring an OPEN sheet to the map instead is what
     made this unusable — measured at 360x780 the map is 351px tall, the
     unfolded panel 381px, so the sheet was taller than the box it hung
     inside: its own header sat above the map's top edge, and the bottom
     controls, lifted by its full height, were thrown off the map
     altogether. Same argument as the card dock's phone block at the foot of
     this file. */
  .maplibregl-ctrl-top-right:has(.open-panel) {
    position: fixed;
    top: auto; bottom: 0; left: 0; right: 0;
    /* Below the station card (`#plotOverlay` is z-index 2000 in map.css): a
       card a reader opened is the thing they are reading, and the sheet
       must not land on top of it. */
    z-index: 900;
  }
  .maplibregl-ctrl-top-right .maplibregl-ctrl.open-panel:not(.is-collapsed) {
    border-radius: var(--r-sm, 6px) var(--r-sm, 6px) 0 0;
  }
  /* The open sheet is a column: head, search, then the list as the one
     scroll region, the whole capped so the map above it stays a map. */
  .maplibregl-ctrl-top-right .maplibregl-ctrl.open-panel:not(.is-collapsed) {
    display: flex; flex-direction: column;
    max-height: min(40vh, 340px);
  }
  .open-panel:not(.is-collapsed) .map-panel__body {
    flex: 1 1 auto; min-height: 0; max-height: none;
  }
  /* A 44px head with a grab bar: the whole head is the fold button. */
  .open-panel .map-panel__head { position: relative; min-height: 44px; padding-top: 12px; }
  .open-panel .map-panel__head::before {
    content: ""; position: absolute; top: 5px; left: 50%;
    width: 36px; height: 4px; margin-left: -18px; border-radius: 2px;
    background: var(--line-strong, #CFCABD);
  }
  .open-panel__findInput { font-size: 16px; min-height: 36px; }
  .open-panel__foldBtn { min-height: 40px; }
  .open-panel__toggle, .open-panel__master { width: 20px; height: 20px; }
  .open-panel__row { padding: 7px 0; }
  .open-panel__reset, .open-panel__offerBtn { min-height: 32px; }
  .station-search { width: auto; max-width: none; }

  /* The scale bar and the OSM/Esri attribution lift by however tall the
     Layers sheet currently is (`--nh-panel-lift`, measured by
     open_map_panel.js with a ResizeObserver, so folding and unfolding the
     sheet moves them). Attribution is a licence condition, not decoration:
     it must be legible, and burying it under our own panel is not a
     trade-off we are entitled to make. It stacks with the card dock's own
     lift, because on a phone a station card and the Layers sheet can be
     over the map at the same time. */
  /* NOT the time bar's lift, on a phone alone — and this is a measurement,
     not an oversight. At 390x844 the map is 350x380 and the furniture over it
     already exceeds that: the top-left stack (search, flood answer, watershed
     answer, plus MapLibre's own zoom and locate) runs to ~355 of those 380px,
     and MapLibre's compact attribution opens to 330x84 on its own. Adding the
     bar's 122px to these corners lifted the attribution INTO the search box —
     `elementFromPoint()` at the search input's centre came back
     `DIV.maplibregl-ctrl-attrib-inner`, a control that had been reachable
     before. Trading a buried attribution for a buried search box is not a fix.
     So on a phone the bar clears the Layers sheet by sitting above it (which
     is what recovered the sheet's header) and the two bottom corners stay
     where they were. The attribution is still under the bar here, which is
     wrong and is written down rather than papered over: it needs a decision
     about which controls a 380px map shows at all, not another lift. */
  .maplibregl-ctrl-bottom-right,
  .maplibregl-ctrl-bottom-left {
    margin-bottom: calc(var(--nh-dock-map-overlap, 0px) + var(--nh-panel-lift, 0px));
  }
  /* And the sheet itself gets out of the way of an open station card, which
     is anchored to the VIEWPORT and would otherwise bury the Layers header
     the same way the attribution buried it. */
  body.nh-card-docked .maplibregl-ctrl-top-right:has(.open-panel) {
    margin-bottom: var(--nh-dock-map-overlap, 0px);
  }
  /* Under a docked card the folded head goes back on the map's edge, above
     the card, where that overlap is measured from. */
  body.nh-card-docked .maplibregl-ctrl-top-right:has(.open-panel.is-collapsed) {
    position: absolute;
    z-index: 3;
  }

  /* THE DECISION THE NOTE ABOVE ASKED FOR (2026-09-06, sweep finding L1-5).
     Measured at 390x844 the map was 380px tall (map.css gives it 45vh on a
     phone) and at 360x740 it was 333px, while the top-left stack — zoom,
     locate, the station search, the Watershed answer, Draw a shape — ran
     331px from the map's top edge. So Draw a shape sat under the coordinate
     box, the scale bar, the attribution AND the folded Layers bar, all of
     which are pinned to the bottom edge: five measured overlaps, and at
     360x740 `elementFromPoint()` at the draw button's centre could answer
     with any of them. Two decisions, not another lift:

       - The map is never shorter than 480px on a phone. The furniture that
         has to fit on it is ~340px of controls down the left plus ~75px of
         bottom edge (the folded sheet and the scale bar lifted above it),
         and 45vh of a 740px screen is less than that. 480px still sits
         inside a 740px viewport under the page header.
       - The coordinate box is not shown on a phone at all. The station
         search above it already takes "38.53, -121.97" and lists it as a
         Coordinates hit, so nothing a thumb could do is lost, and the
         bottom-left corner then holds the scale bar and nothing else.

     Verified with Playwright at 390x844 and 360x740 after the change: no
     two visible controls intersect and the draw button answers
     elementFromPoint() with itself (audit/playwright-sweep/shots/fix-l1/). */
  #map { min-height: 480px; }
}

/* --------------------------------------------------------------------------
   Monitor My Watershed overlay (static/js/open_map_mmw.js)
   --------------------------------------------------------------------------
   The status line reuses `.usgs-status` — it is the same control in the same
   place doing the same job, and duplicating forty declarations to rename them
   would leave two blocks to keep in step. `.mmw-status` only carries what is
   genuinely different: it sits under the USGS line rather than beside it.

   The popup and chart do get their own block, because they are a different
   shape: an MMW popup carries an organisation and a row of measurement
   buttons where a USGS one carries a reading list, and the accent is teal
   rather than green so the two layers stay distinguishable inside a popup as
   well as on the map. */
.mmw-status { margin-top: 2px; }

.mmw-popup { font-size: 0.85rem; line-height: 1.35; }
.mmw-popup__name { display: block; }
.mmw-popup__site { color: var(--ink-3, #6b7280); font-size: 0.78rem; }
.mmw-popup__org { color: var(--ink-2, #4b5563); font-size: 0.78rem; }
.mmw-popup__type { color: var(--ink-3, #6b7280); font-size: 0.78rem; }
.mmw-popup__state { margin: 4px 0; color: var(--ink-2, #4b5563); font-size: 0.78rem; }
.mmw-popup__link { display: inline-block; margin-top: 4px; text-decoration: underline; }
.mmw-popup__source { margin-top: 6px; font-size: 0.72rem; color: var(--ink-3, #6b7280); }

.mmw-chart { margin-top: 8px; border-top: 1px solid var(--line, #e5e7eb); padding-top: 6px; }
.mmw-chart__svg { display: block; max-width: 100%; height: auto; }
.mmw-chart__state { margin: 6px 0; color: var(--ink-3, #6b7280); font-size: 0.8rem; }
.mmw-chart__state.is-loading { color: var(--link); font-style: italic; }
.mmw-chart__state.is-error { color: var(--nh-glass-critical); }
.mmw-chart__line { fill: none; stroke: #0f766e; stroke-width: 1.6;
                   stroke-linejoin: round; stroke-linecap: round; }
.mmw-chart__now { fill: #0f766e; }
.mmw-chart__axis { fill: none; stroke: var(--line-strong, #cbd5e1); stroke-width: 1; }
.mmw-chart__tick { font-size: 8px; fill: var(--ink-3, #6b7280); }
.mmw-chart__summary { margin: 4px 0 0; font-size: 0.72rem; line-height: 1.35;
                      color: var(--ink-2, #4b5563); }
/* Wraps, unlike the USGS chart's two tabs: an EnviroDIY station can offer nine
   measurements and a single row of nine buttons would push the popup wider
   than the map. */
.mmw-chart__tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.mmw-chart__tab { font: inherit; font-size: 0.72rem; padding: 2px 7px; cursor: pointer;
                  border: 1px solid var(--line-strong, #cbd5e1); border-radius: 999px;
                  background: var(--surface-2, #f8fafc); color: inherit; }
.mmw-chart__tab.is-on { background: #0f766e; border-color: #0f766e; color: #ffffff; }

.mmw-cell-tip { font-size: 0.82rem; font-weight: 600; line-height: 1.3; }
.mmw-cell-tip__hint { font-weight: 400; font-size: 0.72rem; color: var(--ink-3, #6b7280); }
.mmw-cell-popup { pointer-events: none; }
.mmw-cell-popup .maplibregl-popup-content { padding: 6px 9px; }
/* The public land card is long (the record, then what PAD-US is not), so it
   scrolls inside a cap rather than running under the bottom controls. */
.padus-popup .maplibregl-popup-content { max-height: min(56vh, 460px); overflow-y: auto; }
@media (max-width: 640px) {
  .padus-popup .maplibregl-popup-content { max-height: 46vh; }
}

/* The series window (static/js/open_map_series_window.js): the platform's
   plot dialog, fed by a USGS gauge or a Monitor My Watershed station. The
   charts wear .plot-window__chart so map_dashboard.js purges them on close;
   these are only the pieces around them. */
.series-window__charts { margin-top: 6px; }
.series-window__series + .series-window__series { margin-top: 10px; border-top: 1px solid var(--line, #e5e7eb); padding-top: 8px; }
.series-window__label { margin: 4px 0 0; font-weight: 600; }
/* THE THRESHOLDS THAT DID NOT FIT. A flood stage far above a gauge reading
   below action stage used to set the y-axis and flatten the fortnight of data
   into a line on the floor (see chartRange in open_map_series_window.js). The
   axis now belongs to the data, so a stage that is off the top of the chart is
   said HERE instead — with its distance, so "off the chart" is a measurement
   rather than an absence. Marked with the same red the lines are drawn in. */
.series-window__offscale {
  margin: 4px 0 0;
  padding-left: 8px;
  border-left: 2px dotted #e63232;
  font-size: 0.76rem;
  line-height: 1.35;
  color: var(--ink-2, #4b5563);
  font-variant-numeric: tabular-nums;
}
body.dark-mode .series-window__offscale { border-left-color: #fca5a5; color: var(--ink-3); }
.plot-window__msg.is-error { color: var(--nh-glass-critical); }
body.dark-mode .plot-window__msg.is-error { color: var(--nh-glass-critical); }
/* A station's own summary block above its charts (the USGS condition card,
   the MMW organisation line): the popup styles, reused in the window. */
.series-window__head { margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line, #e5e7eb); }
/* One button per further variable a station records — the first is charted
   on open, the rest on request, so a click costs one upstream request. */
.series-window__vars { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.series-window__var { font: inherit; font-size: 0.8rem; padding: 3px 10px; cursor: pointer;
  border: 1px solid var(--line-strong, #cbd5e1); border-radius: 999px;
  background: transparent; color: var(--ink-2, #4b5563); }
.series-window__var.is-on { background: #1f6f93; border-color: #1f6f93; color: #ffffff; }
.series-window__var:disabled { opacity: 0.6; cursor: default; }

/* --------------------------------------------------------------------------
   Monitor My Watershed, whole-catalogue shape (static/js/open_map_mmw.js,
   2026-09-02). The pins are one circle layer; the legend rows are constant
   SVG swatches drawn with the paint's own numbers; a click opens the series
   window rather than a popup, so what is left to style is the head block
   above the charts and the meta link beside the title. The .mmw-popup and
   .mmw-chart rules above are the old popup's and no longer have a caller. */
.mmw-head { font-size: 0.85rem; line-height: 1.4; }
.mmw-head__site { color: var(--ink-3, #6b7280); font-size: 0.8rem; }
.mmw-head__state { margin-top: 3px; color: var(--ink-2, #4b5563); }
.mmw-head__source { margin-top: 4px; font-size: 0.74rem; color: var(--ink-3, #6b7280); }
.mmw-head__link { text-decoration: underline; }
/* The teal is the layer's: a charted MMW variable's button matches its pin. */
.series-window__vars--mmw .series-window__var.is-on { background: #0f766e; border-color: #0f766e; }
.plot-window__msg.is-loading { color: var(--link); font-style: italic; }
/* static/js/plotly_on_demand.js: a chart whose drawing library is still on
   its way. Same voice as the loading message above. */
.plot-window__loading-chart { margin: 0.5rem 0; font-size: 0.85rem;
  color: var(--link); font-style: italic; }
body.dark-mode .plot-window__loading-chart { color: var(--nh-glass-link); }
.plot-window__msg.is-hint { color: var(--ink-2, #4b5563); }
/* The two things a reader can do with a third-party station, as links styled
   as buttons: open it on the analytics page, or adopt it as a sensor so an
   alert can hang off it. Same-origin, so no external-link affordance. */
.series-window__actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.series-window__action { display: inline-block; font-size: 0.8rem; padding: 4px 12px;
  border: 1px solid #0f766e; border-radius: 999px; color: var(--nh-glass-good);
  background: transparent; text-decoration: none; }
.series-window__action:hover, .series-window__action:focus-visible {
  background: #0f766e; color: #ffffff; }
/* The river buttons (Upstream / Downstream / Watershed) are <button>, not
   <a>: they draw on the map rather than navigating anywhere. A button
   inherits neither the page font nor a pointer cursor, so without this it
   renders in the browser's own UI font beside its identical-looking
   neighbours. */
button.series-window__action { font: inherit; font-size: 0.8rem; cursor: pointer;
  line-height: 1.45; }
button.series-window__action:disabled { opacity: 0.6; cursor: default; }
button.series-window__action.is-error { border-color: #991b1b; color: var(--nh-glass-critical); }
body.dark-mode button.series-window__action.is-error { border-color: #fca5a5; color: var(--nh-glass-critical); }
/* A PARTIAL walk: the river IS drawn, so this is not an error — amber rather
   than red, and the button keeps working. The sentence naming what is missing
   (usually the basin, when the index used up the twenty-five seconds one walk
   is allowed) is in the tooltip. See `shortfall` in static/js/open_map_river.js. */
button.series-window__action.is-partial { border-color: #b45309; color: var(--nh-glass-warning); }
body.dark-mode button.series-window__action.is-partial { border-color: #fcd34d; color: var(--nh-glass-warning); }
/* The river row inside the PLOT WINDOW — the platform's own sensors, which
   have no provider card and use the shared dialog instead. The window is a
   flex column with its own 20px gutters, so a row borrowed from a station
   card takes those rather than sitting flush against the edge. */
.plot-window .series-window__actions--river { padding: 0 20px; flex: none; }

/* THE WAYS OUT of one of this platform's own station cards
   (open_map_card_dock.installStationLinks). Each link is a
   `.series-window__action` pill, the same as "View on open analytics page"
   on an outside-data card. Owner request 2026-11-25: they were underlined
   text links before, so the same action looked different depending on
   which kind of pin was tapped. */
.plot-window .station-links { padding: 0 20px; flex: none; }
body.dark-mode .series-window__action { border-color: #5eead4; color: var(--nh-glass-good); }
body.dark-mode .series-window__action:hover, body.dark-mode .series-window__action:focus-visible {
  background: #5eead4; color: #0b0f14; }

/* THE CARD'S ACTIONS, LAYOUT "B + D variant 1" (owner, 2026-11-27).
   Before: the river row and the station-links row were two flex rows whose
   margins (4 + 8 px) added up inside the card's flex column, so the lines sat
   6 / 13 / 6 px apart and "Along this creek" and "Open in analytics" each
   wrapped onto a line of their own. Now:
     1. the three map tools are ONE joined control, full width, equal segments
        (they are one choice: what to draw from this station);
     2. the ways out are equal-width pills with an arrow, "Along this creek"
        first (open_map_river.js creekHome);
     3. the group is a quiet "Part of <group>" line (open_map_card_dock.js).
   Every gap is 8 px between blocks and 6 px inside one. */
.series-window__actions--river {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0;
  border: 1px solid #0f766e; border-radius: 999px; overflow: hidden; }
.series-window__actions--river .series-window__action {
  border: 0; border-left: 1px solid #0f766e; border-radius: 0;
  padding-inline: 6px; text-align: center; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.series-window__actions--river .series-window__action:first-child { border-left: 0; }
.series-window__actions--river .series-window__action:focus-visible {
  outline: none; box-shadow: inset 0 0 0 2px #ffffff; }
/* A failed or partial walk keeps its colour cue: the text colour from the
   rules above, plus an underline bar, since the segment has no border of its
   own to recolour. */
.series-window__actions--river .series-window__action.is-error { box-shadow: inset 0 -3px 0 #991b1b; }
.series-window__actions--river .series-window__action.is-partial { box-shadow: inset 0 -3px 0 #b45309; }
body.dark-mode .series-window__actions--river,
body.dark-mode .series-window__actions--river .series-window__action { border-color: #5eead4; }
body.dark-mode .series-window__actions--river .series-window__action.is-error { box-shadow: inset 0 -3px 0 #fca5a5; }
body.dark-mode .series-window__actions--river .series-window__action.is-partial { box-shadow: inset 0 -3px 0 #fcd34d; }
body.dark-mode .series-window__actions--river .series-window__action:focus-visible { box-shadow: inset 0 0 0 2px #0b0f14; }

.station-links { display: flex; flex-wrap: wrap; gap: 6px; }
.station-links > .series-window__action { flex: 1 1 140px; text-align: center; }
.station-links > .series-window__action::after { content: " \2192"; }
.station-links__part-of { flex: 1 1 100%; font-size: 0.78rem; color: var(--ink-3, #5b6563); padding-top: 2px; }
.station-links__group { color: var(--nh-glass-good); font-weight: 600; text-decoration: none; }
.station-links__group:hover, .station-links__group:focus-visible { text-decoration: underline; text-underline-offset: 3px; }

/* In the plot window the rows sit in a flex column, where margins do not
   collapse: one 8 px step between blocks, and the 20 px gutter as MARGIN so
   the joined control's border lines up with the text above it. */
.plot-window .series-window__actions--river,
.plot-window .station-links { margin: 8px 20px 0; padding: 0; }

/* THE SAME ROWS ON AN OUTSIDE-DATA CARD (owner, 2026-11-28: "styling didnt
   get fixed for all sensor cards"). An NWPS, USGS, CDEC, factory, MMW or
   Portal card builds its own head and open_map_analytics.js `waysOut` puts
   its ways out into the rows above. That head already sits inside the
   window's 20 px gutter, so the rows take no gutter of their own there: the
   joined control lined up 20 px to the right of the text before. */
.plot-window > * .series-window__actions--river,
.plot-window > * .station-links { margin: 8px 0 0; }
/* The outbound "Open at …" link, now a pill like the rest: an arrow that
   says it leaves this site, no underline, no extra top margin. */
.station-links > .usgs-popup__link { margin-top: 0; text-decoration: none; }
.station-links > .station-links__link--external::after { content: " \2197"; }

/* CDEC's sensor buttons (static/js/open_map_cdec.js): the same row the MMW
   layer draws, in the reservoir blue the layer paints with. */
.series-window__vars--cdec .series-window__var.is-on { background: #1f6f93; border-color: #1f6f93; color: #ffffff; }

/* ---------------------------------------------------------------------- */
/* The GloFAS panel in the plot window (static/js/open_map_glofas.js).     */
/*                                                                        */
/* It sits below the charts and is styled as a NORMAL panel in all three   */
/* of its states, including the refusal — which is the ordinary answer     */
/* (only ~87 of 3,491 linked stations passed the drainage-area guard on    */
/* 2026-09-04). A refusal painted in error colours would read as a broken  */
/* card on nine stations in ten; it is a statement, so it looks like one.  */
/* The only tinted state is the near-miss warning, which is a caveat on an */
/* attribution that stands.                                               */
.glofas-card {
  margin: 4px 20px 20px; padding: 14px 16px;
  border: 1px solid var(--line, #d9dde1); border-radius: 8px;
  background: var(--surface-2, #f7f9fa);
}
.glofas-card__title { margin: 0 0 6px; font-size: 0.95rem; font-weight: 600; }
.glofas-card__lede { margin: 0 0 8px; font-size: 0.85rem; line-height: 1.5; }
.glofas-card__working {
  margin: 0 0 8px; font-size: 0.78rem; color: var(--ink-3, #6b7280);
  font-variant-numeric: tabular-nums;
}
/* As .tide-card__warning, and for the same reason: the attribution's own
   caveats, set in from the left in full ink instead of boxed in amber. */
.glofas-card__warning {
  margin: 0 0 8px; padding: 0 0 0 12px; font-size: 0.78rem; line-height: 1.45;
  color: var(--ink, #1A1A19);
}
.glofas-card__section { margin-top: 14px; }
.glofas-card__heading {
  margin: 0 0 4px; font-size: 0.82rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--ink-2, #4b5156);
}
.glofas-card__note, .glofas-card__method {
  margin: 4px 0 0; font-size: 0.75rem; line-height: 1.5;
  color: var(--ink-3, #6b7280);
}
.glofas-card__method { margin: 2px 0 0; }
.glofas-card__source {
  margin: 12px 0 0; font-size: 0.72rem; color: var(--ink-3, #6b7280);
}
/* The source link inherits the page's link colour, which is a dark blue that
   all but disappears on this panel's dark ground. Named here rather than left
   to inheritance: the attribution is the one thing on the card that must stay
   readable in both themes. */
body.dark-mode .glofas-card a { color: var(--nh-glass-link); }
@media (max-width: 640px) { .glofas-card { margin: 4px 12px 16px; } }

/* --------------------------------------------------------------------------
   THE FLOOD ANSWER FOR A PLACE (static/js/open_map_flood.js, 2026-09-04).
   Not a layer: a control that arms one map click and answers for the 0.05deg
   model cell the click lands in. Three things need styling — the control, the
   crosshair the armed mode wears, and the block of words above the chart that
   says what the number is and is not.
   -------------------------------------------------------------------------- */
.flood-ctrl {
  background: var(--nh-glass);
  border-radius: var(--r-sm, 6px);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
  padding: 6px 8px;
  width: 14rem;
  max-width: 60vw;
}
.flood-ctrl__button {
  display: block; width: 100%;
  font: inherit; font-size: 0.78rem; font-weight: 600;
  padding: 5px 10px; cursor: pointer;
  border: 1px solid #6d28d9; border-radius: var(--r-xs, 4px);
  background: transparent; color: var(--nh-glass-violet);
}
.flood-ctrl__button:hover, .flood-ctrl__button:focus-visible {
  background: #6d28d9; color: #ffffff;
}
/* Armed. The button says "Cancel" and looks pressed, because a mode that is
   on and does not look on is a map that has stopped responding to clicks. */
.flood-ctrl__button.is-on { background: #6d28d9; color: #ffffff; }
.flood-ctrl__hint {
  margin: 3px 0 0; font-size: 0.7rem; line-height: 1.35;
  color: var(--ink-3, #746E62);
}
.flood-ctrl__hint.is-armed { color: var(--nh-glass-violet); font-weight: 600; }
/* The armed cursor, on the canvas container — the same element the one-shot
   click listener sits on. !important because MapLibre sets `cursor` inline on
   that element as it drags and hovers. */
.nh-flood-picking, .nh-flood-picking canvas { cursor: crosshair !important; }
body.dark-mode .flood-ctrl__button { border-color: #c4b5fd; color: var(--nh-glass-violet); }
body.dark-mode .flood-ctrl__button:hover,
body.dark-mode .flood-ctrl__button:focus-visible,
body.dark-mode .flood-ctrl__button.is-on { background: #c4b5fd; color: #0b0f14; }
body.dark-mode .flood-ctrl__hint.is-armed { color: var(--nh-glass-violet); }

/* The head block above the chart. The order on the page is the argument: the
   number, then the cell it belongs to, then what it cannot promise — and the
   caveats are ABOVE the chart and never behind a disclosure control, because
   a modelled discharge beside a small creek without them is confidently
   wrong. */
/* Set a little tighter than the rest of the card, on purpose. This head is
   five blocks of prose standing between the reader and the chart that the
   button they pressed exists to draw — measured 551px of a 589px scroll box
   on 2026-09-04, with none of the chart on screen. Not a word of it is cut
   (the caveats especially: see the block comment above), but every line of
   leading it does not need is a line of the chart the reader does get. */
.flood-head { font-size: 0.82rem; line-height: 1.42; }
.flood-head__value { margin: 0; }
.flood-head__flow { font-size: 1.15rem; color: var(--nh-glass-violet); }
/* The cell sentence — the twin of the rectangle drawn on the map. Ruled and
   tinted so it reads as a statement about the answer rather than as prose. */
.flood-head__cell {
  margin: 6px 0 0; padding: 5px 9px;
  border-left: 3px solid #6d28d9;
  background: rgba(109, 40, 217, 0.07);
  color: var(--ink-2, #4b5156); font-size: 0.8rem;
}
.flood-head__caveats {
  margin: 7px 0 0; padding-left: 16px;
  color: var(--ink-2, #4b5156); font-size: 0.75rem; line-height: 1.4;
}
.flood-head__caveats li + li { margin-top: 4px; }
/* The unit switch, beside the number it governs. Two buttons rather than a
   select: there are exactly two, and the one in force has to be readable at
   a glance from across the card. */
.flood-head__units {
  display: inline-flex; margin-top: 6px;
  border: 1px solid var(--line-strong, #CFCABD);
  border-radius: var(--r-xs, 4px);
  overflow: hidden;
}
.flood-head__unit {
  border: 0; padding: 3px 9px;
  background: var(--surface-2, #F4F2EC);
  font: inherit; font-size: 0.74rem; font-weight: 600;
  color: var(--ink-2, #56534C); cursor: pointer;
}
.flood-head__unit + .flood-head__unit { border-left: 1px solid var(--line-strong, #CFCABD); }
.flood-head__unit.is-on { background: #6d28d9; color: #fff; cursor: default; }
.flood-head__unit:focus-visible { outline: 3px solid var(--accent-ring, #2887b1); outline-offset: -3px; }
body.dark-mode .flood-head__unit.is-on { background: #7c3aed; color: #fff; }

/* Under the chart, not above it — open_map_flood.js says why. */
.flood-foot { margin-top: 2px; }
.flood-head__seam, .flood-head__source {
  margin: 8px 0 0; font-size: 0.74rem; color: var(--ink-3, #6b7280);
}
.flood-head__link { text-decoration: underline; }
body.dark-mode .flood-head__flow { color: var(--nh-glass-violet); }
body.dark-mode .flood-head__cell {
  border-left-color: #c4b5fd; background: rgba(196, 181, 253, 0.12);
}

/* ------------------------------------------------------------------------
   THE STATION CARD, DOCKED BESIDE THE MAP INSTEAD OF ON TOP OF IT (2026-09-04)

   #plotOverlay is a full-viewport modal with a 55% scrim (map.css). On a group
   map beside a column of cards that is right: the dialog IS the answer. On the
   open map it is not. Upstream / Downstream / Watershed draw a basin polygon
   and a river network ON THE MAP — measured at ~9.5 s of work — and then the
   reader sees none of it, because a 1440x900 viewport was covered by a 900x792
   card and everything left over was dimmed. The Flood answer panel says
   "drawn on the map" over a map nobody can see.

   So on THIS page the card docks to the right-hand edge of the map: no scrim,
   and `pointer-events: none` on the overlay so every pixel of map outside the
   card is still live — pannable, zoomable, clickable. The top/bottom of the
   dock are set from the map's own bounding box by open_map_card_dock.js, so it
   covers the map and not the site header.

   Only the two RIGHT-hand MapLibre control corners move out of its way: the
   layers panel and the attribution. The left-hand corners carry the station
   search, the Flood answer panel, the zoom buttons, the scale and the
   coordinate box, and none of them move.

   Scoped with the id so it wins over `.plot-overlay { inset: 0 }` regardless of
   which stylesheet a future page loads first, and applied only where the
   template asks for it — every other page's dialog is untouched.
   ------------------------------------------------------------------------ */
:root { --nh-dock-width: min(440px, 38vw); }

#plotOverlay.plot-overlay--docked {
  --nh-dock-top: 0px;
  --nh-dock-bottom: 0px;
  top: var(--nh-dock-top);
  bottom: var(--nh-dock-bottom);
  right: 0;
  left: auto;
  width: var(--nh-dock-width);
  padding: 8px 8px 8px 0;
  background: none;               /* no scrim: the map is the subject */
  align-items: stretch;
  justify-content: flex-end;
  /* The overlay is a frame, not a surface. Without this it would still eat
     every click aimed at the map even while fully transparent. */
  pointer-events: none;
}
#plotOverlay.plot-overlay--docked .plot-window {
  pointer-events: auto;
  width: 100%;
  height: 100%;
  max-height: 100%;
  border-radius: var(--r-md);
  box-shadow: 0 10px 34px rgba(15, 23, 42, 0.30);
}

/* The layers panel and the attribution slide left while a card is docked.
   `transition` keeps that legible rather than a jump. */
body.nh-card-docked .maplibregl-ctrl-top-right,
body.nh-card-docked .maplibregl-ctrl-bottom-right {
  margin-right: var(--nh-dock-width);
}
.maplibregl-ctrl-top-right, .maplibregl-ctrl-bottom-right {
  transition: margin-right 0.15s ease, margin-bottom 0.15s ease;
}
@media (prefers-reduced-motion: reduce) {
  .maplibregl-ctrl-top-right, .maplibregl-ctrl-bottom-right { transition: none; }
}

/* A tablet-width window has a narrower panel but is still a panel: 38vw of
   900px is 342px, which reads. */
@media (max-width: 1024px) {
  :root { --nh-dock-width: min(400px, 46vw); }
}

/* ==========================================================================
   SIMPLER MAP CHROME (2026-10-08, operator: "simple is good")
   --------------------------------------------------------------------------
   One search bar, one Tools button, a folded Layers panel with tick boxes,
   an ⓘ menu for everything read once, and cards that say a name once.
   Layout only: every control that was on the map is still reachable, by
   mouse and by keyboard. Each block names the file that builds it.
   ========================================================================== */

/* --- the head row (base/templates/base/open_map.html) ------------------- */
.map-head .mp-analytics {
  font-size: 0.85rem;
  color: var(--brand-blue-deep, var(--link));
  text-decoration: underline;
  text-underline-offset: 2px;
}
body.dark-mode .map-head .mp-analytics { color: var(--brand-blue-light, var(--link)); }
.mp-more > summary.mp-more__summary {
  list-style: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border: 1px solid var(--line-strong, #CFCABD);
  border-radius: 999px;
  font-size: 1.05rem; line-height: 1;
  color: var(--ink-2, #4b5563);
}
.mp-more > summary.mp-more__summary::-webkit-details-marker { display: none; }
.mp-more[open] > summary.mp-more__summary { background: var(--surface-2, #F4F2EC); }
.mp-more__panel {
  max-height: min(70vh, 640px);
  overflow-y: auto;
  width: min(60ch, calc(100vw - 40px));
}
.mp-more .mp-id { gap: 6px 14px; margin-bottom: 8px; }
.mp-more__list {
  border: 0; background: none; padding: 0;
  font: inherit; font-size: 0.85rem;
  color: var(--brand-blue-deep, var(--link));
  text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer;
}
body.dark-mode .mp-more__list { color: var(--brand-blue-light, var(--link)); }
.mp-sub { border-top: 1px solid var(--line, #e3e0d7); padding: 6px 0; }
.mp-sub > summary { cursor: pointer; font-size: 0.85rem; font-weight: 600; color: var(--ink-2, #4b5563); }
.mp-sub > summary:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; }
.mp-sub__panel { padding-top: 6px; }
/* The theme toggle, moved here from the window's corner by
   static/js/open_map_chrome.js. Same button, in the row's flow. */
.map-head .dark-mode-toggle.is-in-head {
  position: static;
  width: 36px; height: 36px;
  margin-left: auto;
  opacity: 1; pointer-events: auto;
}

/* "Map as list" lives in the ⓘ menu now; the list's own toggle below the map
   stays the one control (and the skip link's target) but is drawn only
   while it is focused or the list is open. Off-screen, not display:none, so
   it can still take focus. */
.map-list__toggle[aria-expanded="false"]:not(:focus) {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; padding: 0; border: 0;
}

/* --- the search bar (open_map_panel.js stationSearch) ------------------- */
.station-search { width: 17rem; }
.station-search__open { display: none; }
.station-search__glyph {
  position: relative; display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid currentColor; border-radius: 50%;
}
.station-search__glyph::after {
  content: ""; position: absolute; right: -6px; bottom: -5px;
  width: 7px; height: 2px; background: currentColor; transform: rotate(45deg);
}

/* --- the Tools menu (open_map_panel.js toolsMenu) ------------------------ */
.nh-tools {
  background: var(--nh-glass);
  border-radius: var(--r-sm, 6px);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
  width: 17rem; max-width: 60vw;
}
body.dark-mode .nh-tools { color: var(--ink); }
.nh-tools__toggle {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 6px 10px;
  border: 0; background: none; border-radius: var(--r-sm, 6px);
  font: inherit; font-size: 0.82rem; font-weight: 600; color: inherit;
  cursor: pointer;
}
.nh-tools__toggle::after { content: "\25BE"; font-size: 0.75rem; color: var(--ink-3, #746E62); }
.nh-tools.is-open .nh-tools__toggle::after { content: "\25B4"; }
/* A tool is armed: the button says so even with the menu folded. */
.nh-tools.has-armed .nh-tools__toggle::before {
  content: ""; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%;
  background: #15803d; order: 0;
}
.nh-tools__toggle:focus-visible,
.nh-tools__close:focus-visible { outline: 3px solid var(--accent-ring, #2887b1); outline-offset: 1px; }
.nh-tools__menu { padding: 0 8px 8px; }
.nh-tools__head { display: none; }        /* the sheet's head, on a phone */
.nh-tools__close {
  width: 30px; height: 30px; border: 0; border-radius: var(--r-sm, 6px);
  background: var(--surface-2, #F4F2EC); color: inherit; font-size: 1.2rem; cursor: pointer;
}
/* The tools' own boxes become rows of the menu rather than cards on the map. */
.nh-tools__items .maplibregl-ctrl {
  float: none; margin: 0; max-width: none;
  background: transparent; box-shadow: none; border-radius: 0;
  padding: 6px 0;
}
.nh-tools__items .maplibregl-ctrl + .maplibregl-ctrl { border-top: 1px solid var(--line, #e3e0d7); }
body.dark-mode .nh-tools__items .maplibregl-ctrl { background: transparent; }

/* --- the Layers panel (open_map_panel.js create) ------------------------ */
/* A row is a <label> around its tick box now, so the whole row is the
   target. The box is the native control, in the brand colour. */
.open-panel__terrain { cursor: pointer; align-items: center; }
.open-panel__terrain { display: flex; gap: 7px; padding: 4px 0 8px; }
input.open-panel__terrainBox {
  flex: none; width: 16px; height: 16px; margin: 0;
  accent-color: var(--brand-blue-deep, #1f6f93);
  cursor: pointer;
}
input.open-panel__terrainBox:focus-visible { outline: 3px solid var(--accent-ring, #2887b1); outline-offset: 1px; }

/* --- the station card (open_map_series_window.js) ----------------------- */
/* A long name wraps to a second line rather than losing its end to "…";
   past two lines it clamps, and the close button never moves. */
#plotOverlay .plot-window__title {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.25;
}
/* The chart first, the chips that choose it under it: the chart is what a
   reader opened the card for. Order only — the DOM keeps the layer's order,
   so a screen reader still meets the choices before the result. */
.series-window__charts { display: flex; flex-direction: column; }
.series-window__charts > * { order: 1; min-width: 0; }
.series-window__charts > .series-window__series,
.series-window__charts > .plot-window__msg { order: 0; }
/* One switch for a station that reports at more than one cadence. */
.series-window__durs { display: inline-flex; flex: 0 0 100%; gap: 0; margin-bottom: 2px; }
.series-window__durs .series-window__dur {
  font: inherit; font-size: 0.78rem; padding: 3px 12px; cursor: pointer;
  border: 1px solid var(--line-strong, #cbd5e1); background: transparent; color: var(--ink-2, #4b5563);
}
.series-window__durs .series-window__dur:first-child { border-radius: 999px 0 0 999px; }
.series-window__durs .series-window__dur:last-child { border-radius: 0 999px 999px 0; }
.series-window__durs .series-window__dur + .series-window__dur { border-left: 0; }
.series-window__durs .series-window__dur.is-on { background: var(--ink, #374151); color: var(--nh-glass-solid); border-color: var(--ink, #374151); }
.series-window__durs .series-window__dur:focus-visible,
.series-window__var:focus-visible { outline: 3px solid var(--accent-ring, #2887b1); outline-offset: 1px; }
/* The name is the window's title; the head's own copy of it stands down. */
.usgs-popup__name.is-in-title { display: none; }
/* The search's status line takes no room until it has something to say. */
.station-search__status:empty { display: none; }
/* The source paragraph, folded to "Source: <agency>". */
.usgs-popup__sourceFold { margin-top: 6px; font-size: 0.72rem; color: var(--ink-3, #6b7280); }
.usgs-popup__sourceFold > summary { cursor: pointer; }
.usgs-popup__sourceFold > .usgs-popup__source { margin-top: 3px; }

/* --- phone: the simpler chrome (2026-10-08; the rest of it is the
   SIMPLER MAP CHROME section just above)  */
@media (max-width: 640px) {
  /* The map takes the screen under the header and the one-row head; 480px
     stays the floor (the furniture still has to fit). */
  #map { height: calc(100svh - 150px); }
  .map-head { column-gap: 14px; }

  /* Search is an icon until it is asked for. */
  .station-search { padding: 0; width: auto; background: transparent; box-shadow: none; }
  .station-search__open {
    display: inline-flex; align-items: center; justify-content: center;
    width: 29px; height: 29px; border: 0; border-radius: 4px;
    background: var(--nh-glass); color: var(--ink, #1a1a19);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1); cursor: pointer;
  }
  .station-search:not(.is-open) .station-search__form { display: none; }
  .station-search.is-open { padding: 6px 8px; width: calc(100vw - 60px); background: var(--nh-glass);
                            box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35); }
  .station-search.is-open .station-search__open { display: none; }
  body.dark-mode .station-search__open,
  body.dark-mode .station-search.is-open { color: var(--ink); }

  /* Tools: a small button on the map, and its menu a bottom sheet.
     MapLibre gives every control `transform: translate(0)`, which makes the
     control the containing block of anything fixed inside it — the sheet
     came out 60px wide, pinned to the button. The Tools control has nothing
     to composite, so it drops the transform and the sheet is the screen's. */
  .maplibregl-ctrl.nh-tools { width: auto; transform: none; }
  .nh-tools__menu:not([hidden]) {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 950;
    max-height: var(--nh-dock-height, 56vh); overflow-y: auto;
    padding: 0 14px 14px;
    background: var(--nh-glass-card);
    border-radius: var(--r-md, 10px) var(--r-md, 10px) 0 0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.28);
  }
  /* MapLibre's corners are stacking contexts at z-index 2, so the sheet
     could rise no higher than its own corner and the Layers bar, scale and
     attribution (later corners, same z) painted over it. While the sheet is
     open its corner goes on top. */
  .maplibregl-ctrl-top-left:has(.nh-tools.is-open) { z-index: 950; }
  .nh-tools__head {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; padding: 10px 0 6px; background: var(--nh-glass-solid);
    font-weight: 700;
  }
  /* A tool armed: the sheet shrinks to that tool alone, so the map above it
     can take the tap the tool is waiting for. */
  .nh-tools.has-armed .nh-tools__head,
  .nh-tools.has-armed .nh-tools__items > :not(.is-armed) { display: none; }
  .nh-tools.has-armed .nh-tools__menu:not([hidden]) { padding-top: 10px; }
}

/* ==========================================================================
   MAP GLASS (2026-11-18, owner: "can we also make the map cards/icons/stuff
   transparent like it is on the qpe too?")
   --------------------------------------------------------------------------
   Everything that floats over the map is slightly see-through, so the map
   reads as one surface under its controls. Same recipe as the QPE tool
   (QPE frontend/src/index.css, "Map chrome"): 0.70 alpha, a 6px backdrop blur,
   and a solid fallback wherever the see-through cannot be trusted.

   THE KNOBS are the three below; every surface takes --nh-glass (a control) or
   --nh-glass-card (something with sentences in it). This file is only loaded
   by the open map, so the saved-map pages that share map.css stay solid.

   CONTRAST IS WORKED OUT FOR THE WORST CASE, not the typical one: the glass
   over pure black in the light theme and over pure white in the dark theme,
   with no credit for the blur. That is why the dark glass is a deeper blue-grey
   than the old #2A3B4A panel (#F2F2EF on that at 0.70 over white is 4.2:1; on
   this it is 5.7:1), and why the accent text colours are their own set here:
   the site's --link is 2.7:1 on the light glass over black, and #FCA5A5 is
   3.1:1 on the dark glass over white. base/tests/test_open_map_glass.py holds
   every one of these to 4.5:1, so a change to a knob that breaks them fails. */
body {
  --nh-glass-alpha: 0.70;
  --nh-glass-card-alpha: 0.70;
  --nh-glass-blur: 6px;

  --nh-glass-rgb: 255 255 255;
  --nh-glass: rgb(var(--nh-glass-rgb) / var(--nh-glass-alpha));
  --nh-glass-card: rgb(var(--nh-glass-rgb) / var(--nh-glass-card-alpha));
  --nh-glass-solid: rgb(var(--nh-glass-rgb));

  /* What sits ON the glass. Each moves AWAY from the text colour (lighter under
     dark text, darker under light text), so a nested fill can only raise the
     contrast worked out above, never lower it. */
  --nh-glass-well: rgb(255 255 255 / 0.35);
  --nh-glass-field: rgb(255 255 255 / 0.55);
  --nh-glass-line: rgb(26 26 25 / 0.22);
  --nh-glass-line-strong: rgb(26 26 25 / 0.40);

  --nh-glass-link: #0E4865;
  --nh-glass-warning: #5F3B00;
  --nh-glass-critical: #8A1414;
  --nh-glass-good: #0B4D20;
  --nh-glass-violet: #5516B8;
}
body.dark-mode {
  --nh-glass-rgb: 20 27 34;
  --nh-glass-well: rgb(0 0 0 / 0.22);
  --nh-glass-field: rgb(0 0 0 / 0.28);
  --nh-glass-line: rgb(255 255 255 / 0.20);
  --nh-glass-line-strong: rgb(255 255 255 / 0.36);

  --nh-glass-link: #BFE3F5;
  --nh-glass-warning: #F7DDA8;
  --nh-glass-critical: #FFD0D0;
  --nh-glass-good: #BFEFC8;
  --nh-glass-violet: #DFD6FF;
}

/* Inside the glass the page's palette is re-pointed, so the hundreds of rules
   that say var(--surface-2) or var(--ink-3) become right without being edited,
   including ones written later. The greys all resolve to the main ink: at 0.70
   neither --ink-2 nor --ink-3 holds 4.5:1 in the worst case (the QPE tool made
   the same call). */
.maplibregl-ctrl.map-panel,
.maplibregl-ctrl-group,
.maplibregl-ctrl-attrib,
.maplibregl-ctrl-scale,
.maplibregl-popup-content,
.coord-search,
.station-search,
.nh-tools,
.nh-tools__menu,
.flood-ctrl,
.nh-wsctrl,
.nh-drawctrl,
.nh-bundle,
.nh-colour-key,
.nh-r3d-legend,
.nh-r3d-tip,
.nh-storm,
.nh-storm-transport,
#plotOverlay.plot-overlay--docked .plot-window {
  color: var(--ink);
  --ink-2: var(--ink);
  --ink-3: var(--ink);
  --muted: var(--ink);
  --surface: var(--nh-glass-well);
  --surface-2: var(--nh-glass-well);
  --band: var(--nh-glass-well);
  --field: var(--nh-glass-field);
  --line: var(--nh-glass-line);
  --line-strong: var(--nh-glass-line-strong);
  --link: var(--nh-glass-link);
  --warning-ink: var(--nh-glass-warning);
  --provisional: var(--nh-glass-warning);
  --critical-ink: var(--nh-glass-critical);
  --good-ink: var(--nh-glass-good);
}

/* The surfaces map.css and MapLibre paint: the shared sheet stays solid for
   every other page, and MapLibre's own sheet is injected after this one, hence
   the extra class on each. */
.maplibregl-ctrl.map-panel { background: var(--nh-glass-card); }
.maplibregl-ctrl .map-panel__key,
.maplibregl-ctrl .map-panel__head { color: var(--ink); }
#plotOverlay.plot-overlay--docked .plot-window { background: var(--nh-glass-card); }
.maplibregl-map .maplibregl-ctrl-scale {
  background: var(--nh-glass); color: var(--ink); border-color: var(--ink);
}
.maplibregl-map .maplibregl-ctrl-attrib,
.maplibregl-map .maplibregl-ctrl-attrib.maplibregl-compact,
.maplibregl-map .maplibregl-ctrl-attrib.maplibregl-compact-show {
  background: var(--nh-glass); color: var(--ink);
}
.maplibregl-map .maplibregl-ctrl-attrib a { color: var(--ink); }
.maplibregl-map .maplibregl-ctrl-group button + button { border-top-color: var(--nh-glass-line); }
.coord-search .coord-search__input {
  background: var(--nh-glass); color: var(--ink); border-color: var(--nh-glass-line-strong);
}
/* MapLibre's icons are dark pictures on what used to be a white button. */
body.dark-mode .maplibregl-ctrl-group .maplibregl-ctrl-icon,
body.dark-mode .maplibregl-ctrl-attrib-button { filter: invert(1) hue-rotate(180deg); }

/* MapLibre tints every hovered button in a control with 5% black, at a
   specificity that also beats the fill of a button that HAS one, so white text
   lost its ground the moment the pointer reached it (1.1:1 on the old white
   panel, 2.3:1 here). The filled buttons keep their fill under the pointer. */
.maplibregl-ctrl button.open-panel__segment.is-on:not(:disabled):hover,
.maplibregl-ctrl button.open-panel__offerBtn:not(:disabled):hover,
.maplibregl-ctrl button.coord-search__go:not(:disabled):hover { background-color: var(--accent, #1F6D8F); }
.maplibregl-ctrl button.open-panel__filterBtn[aria-expanded="true"]:not(:disabled):hover { background-color: var(--link); }
.maplibregl-ctrl button.flood-ctrl__button:not(:disabled):hover,
.maplibregl-ctrl button.flood-ctrl__button.is-on:not(:disabled) { background-color: #6d28d9; }
body.dark-mode .maplibregl-ctrl button.flood-ctrl__button:not(:disabled):hover,
body.dark-mode .maplibregl-ctrl button.flood-ctrl__button.is-on:not(:disabled) { background-color: #c4b5fd; }
.maplibregl-ctrl.nh-wsctrl.is-armed button.nh-wsctrl__button:not(:disabled):hover { background-color: #15803d; }
.maplibregl-ctrl.nh-drawctrl.is-armed button.nh-drawctrl__button:not(:disabled):hover { background-color: #B45309; }
.maplibregl-ctrl button.nh-drawctrl__done:not(:disabled):hover { background-color: #9A3412; }
.maplibregl-ctrl button.nh-drawctrl__bundle:not(:disabled):hover { background-color: #163a5a; }

/* The station card's charts: Plotly paints an opaque sheet and sets its own ink,
   both as inline styles, so only !important reaches them. Without this each
   chart is a white (or near-black) slab in the middle of the glass. */
#plotOverlay.plot-overlay--docked .js-plotly-plot .main-svg { background: transparent !important; }
#plotOverlay.plot-overlay--docked .js-plotly-plot .bglayer .bg { fill: transparent !important; }
#plotOverlay.plot-overlay--docked .js-plotly-plot :is(.gtitle, .xtick text, .ytick text, .g-xtitle text, .g-ytitle text, .legendtext) {
  fill: var(--ink) !important;
}
#plotOverlay.plot-overlay--docked .nh-chart-table__toggle { color: var(--link); }

/* A scroll region's cue hides its end shadows behind covers in the surface's
   own colour, and on glass a cover would be a visible band. Without covers the
   top shadow would sit there at rest saying "more above" when there is none, so
   only the bottom one stays: the half of the cue a reader actually needs. */
.open-panel .map-panel__body,
#plotOverlay.plot-overlay--docked .plot-window__body {
  background-image: radial-gradient(farthest-side at 50% 100%, var(--nh-cue-shadow), transparent);
  background-size: 100% 11px;
  background-position: 0 100%;
  background-attachment: scroll;
}

/* A native list draws its options on its own opaque layer, from these colours:
   left to inherit a see-through background it can come out as light text on
   the browser's white. */
.maplibregl-map select option,
.nh-storm select option,
#plotOverlay select option { background: var(--nh-glass-solid); color: var(--ink); }
.maplibregl-map input::placeholder,
#plotOverlay input::placeholder { color: var(--ink); opacity: 0.85; }

/* THE BLUR, and where it is deliberately absent. A backdrop blur is recomputed
   whenever what is behind it changes, which over a map is every frame of a pan,
   so it goes only on the handful of surfaces that are large enough to need it.
   Not on: pin labels' neighbours (anything numerous), what follows the pointer
   (.nh-scale-hover, .mmw-cell-popup, .nh-r3d-tip), the scale bar and the
   attribution (one line each). They keep the alpha; the contrast above never
   counted on the blur.

   Not on anything inside another blurred surface either: a nested
   backdrop-filter sees only its parent, not the map. And a backdrop-filter makes
   its element the containing block for position:fixed children, so on a phone it
   moves off .nh-tools (below), whose menu is a fixed bottom sheet. */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .maplibregl-ctrl.map-panel,
  .maplibregl-map .maplibregl-ctrl-group,
  .maplibregl-map .maplibregl-popup-content,
  .station-search,
  .nh-tools,
  .nh-tools__menu:not([hidden]),
  .flood-ctrl,
  .nh-wsctrl,
  .nh-drawctrl,
  .nh-bundle,
  .maplibregl-ctrl.nh-colour-key,
  .maplibregl-ctrl.nh-r3d-legend,
  .nh-storm,
  .nh-storm-transport,
  #plotOverlay.plot-overlay--docked .plot-window {
    -webkit-backdrop-filter: blur(var(--nh-glass-blur));
    backdrop-filter: blur(var(--nh-glass-blur));
  }
  .nh-tools .nh-tools__menu,
  .nh-tools__items .maplibregl-ctrl,
  .nh-storm > .nh-storm-transport,
  .nh-scale-hover .maplibregl-popup-content,
  .mmw-cell-popup .maplibregl-popup-content {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  @media (max-width: 640px) {
    /* On a phone the box around the search icon and the Tools button is empty
       or holds a fixed sheet, so the glass moves onto the button itself.

       The bottom sheets keep their alpha and lose the blur. They are the width
       of the screen, and blurring that much on every frame is what a phone
       feels: panning at 390x844 with the Layers sheet and a station card open
       (software rendering, three rounds) drew 105 frames with the blur, 131
       with it off the sheets alone and 129 with it off everything. */
    .station-search:not(.is-open),
    .maplibregl-ctrl.nh-tools,
    .maplibregl-ctrl.map-panel,
    .nh-tools__menu:not([hidden]),
    .nh-storm,
    #plotOverlay.plot-overlay--docked .plot-window {
      -webkit-backdrop-filter: none;
      backdrop-filter: none;
    }
    .station-search__open,
    .nh-tools__toggle {
      -webkit-backdrop-filter: blur(var(--nh-glass-blur));
      backdrop-filter: blur(var(--nh-glass-blur));
    }
  }
}
@media (max-width: 640px) {
  .maplibregl-ctrl.nh-tools { background: transparent; box-shadow: none; }
  .nh-tools__toggle { background: var(--nh-glass); box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35); }
}

/* A FIRMER GLASS ON A PHONE (2026-11-28, owner: "on mobile the see thru feature
   on the map is slightly too see thru and hard to see the content"). The phone
   sheets and cards lose the blur above (the panning cost), and 0.70 with no
   blur shows roads and labels sharply under the text. Still glass, not solid:
   the same reasoning as the no-backdrop-filter fallback below, a smaller step.
   Before that fallback and the reduced-transparency block, so both still win. */
@media (max-width: 640px) {
  body, body.dark-mode { --nh-glass-alpha: 0.82; --nh-glass-card-alpha: 0.88; }
}

/* Firmer where nothing softens what shows through, solid where see-through is
   unwanted or meaningless. Last, so it wins over both themes. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  body, body.dark-mode { --nh-glass-alpha: 0.95; --nh-glass-card-alpha: 0.98; }
}
@media (prefers-reduced-transparency: reduce), (forced-colors: active), print {
  body, body.dark-mode {
    --nh-glass-alpha: 1;
    --nh-glass-card-alpha: 1;
    --nh-glass-blur: 0px;
  }
  .maplibregl-map *,
  .nh-storm,
  .nh-storm-transport,
  .nh-bundle,
  #plotOverlay .plot-window {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
}

/* A PHONE has no room for one at all — 46vw of 360px is 166px — so at the same
   breakpoint where map.css shortens the map to 45vh the card becomes a BOTTOM
   SHEET.

   WHAT THE SHEET IS ANCHORED TO, AND WHY IT CHANGED (2026-09-04). The sheet
   used to take its bottom edge from `--nh-dock-bottom` — the gap between the
   MAP's bottom and the bottom of the screen — like the desktop panel does, and
   it capped its height against the map's measured height. Measured at 360x780
   that produced a 218px sheet with a 123px readable body holding 956px of
   content (a CDEC station; a USGS one is longer still), floating in the middle
   of the screen with page text below it. Worse, the map is part of the PAGE:
   scroll down to read the status lines under it and the map's box leaves the
   viewport, taking the open card with it — measured at scrollY 600 the sheet
   sat at y -249..-31, entirely above the screen and unrecoverable without
   scrolling back.

   The map's box is the right anchor for the DESKTOP dock, which sits beside
   the map and is read at the same time as it. It is the wrong anchor for a
   phone, where the card is the thing being read and the map is context behind
   it. So on a phone the sheet is anchored to the VIEWPORT: `bottom: 0`, height
   from vh. It cannot drift off-screen, it does not move when the page scrolls,
   and 56vh of a 780px screen is a 437px sheet with a ~340px readable body.

   Two things still hold. The sheet never takes the whole screen — 56vh leaves
   44vh above it, which is a guarantee about the SCREEN rather than about the
   map's box, so it survives any scroll position; that strip is where the map
   shows through and, with no Escape key on a phone, is the surface a reader
   taps to dismiss the card. And the bottom control corners lift clear of the
   sheet so the scale bar and the OSM attribution — a licence condition, not a
   decoration — are never buried. They lift by exactly how much of the map the
   sheet covers (`--nh-dock-map-overlap`, measured by open_map_card_dock.js),
   not by the sheet's whole height: the controls live inside the map, and on a
   351px map a 437px lift would throw them off the top of it. */
/* 42vh, not 56vh (2026-11-18, uiux.md finding 12). Measured at 390x844 the
   56vh sheet covered 66% of the map and the pin the reader had just tapped
   was underneath it, so the card described a place nobody could see. At
   42vh the sheet still holds the headline and a first chart, and scrolls for
   the rest; open_map_card_dock.js then pans the map so the tapped pin sits in
   the strip above the sheet. */
@media (max-width: 640px) {
  :root { --nh-dock-height: min(42vh, 380px); }
  #plotOverlay.plot-overlay--docked {
    top: auto;
    bottom: 0;                    /* the VIEWPORT's bottom, not the map's */
    left: 0;
    right: 0;
    width: auto;
    height: var(--nh-dock-height);
    padding: 0;
  }
  /* The WHOLE sheet scrolls on a phone, not just the body (2026-11-25).
     Everything above #plotWindowBody (title, date line, river buttons, the
     station-links row) is `flex: none`, and on a 390x844 phone those rows sum
     to ~275px of a 279px sheet. The body was left 32px of padding, below the
     bottom of the screen and clipped by the window's `overflow: hidden`. A
     swipe on the card found nothing to scroll and moved the page instead,
     so a reader never got past the first rows. Measured on prod: 41/41 pins. */
  #plotOverlay.plot-overlay--docked .plot-window {
    border-radius: var(--r-md) var(--r-md) 0 0;
    overflow-y: auto;
    overscroll-behavior: contain;   /* the end of the card does not scroll the page */
  }
  #plotOverlay.plot-overlay--docked .plot-window > * { flex: none; }
  #plotOverlay.plot-overlay--docked .plot-window__body { overflow: visible; }
  body.nh-card-docked .maplibregl-ctrl-top-right { margin-right: 0; }
  body.nh-card-docked .maplibregl-ctrl-bottom-right,
  body.nh-card-docked .maplibregl-ctrl-bottom-left {
    margin-right: 0;
    /* Both lifts, not just the card's: the Layers sheet is still over the
       map's bottom edge while a card is open, and dropping its term here
       (which this rule did until 2026-09-04, by winning on specificity)
       put the attribution back under the sheet. The time bar's lift is
       deliberately absent from both phone rules — see the note above. */
    margin-bottom: calc(var(--nh-dock-map-overlap, 0px) + var(--nh-panel-lift, 0px));
  }
}

/* --- The white-labelled chrome (base/templates/base/open_map.html) ---------
   Only a member whose workbench wears one group's face sees any of this: the
   anonymous page, which is the platform-wide one, renders the deployment's own
   bar and footer and none of these classes appear in its markup.

   Here rather than in site.css because the public shell paints every other page
   in this deployment and these three rules belong to one page's branded chrome;
   a stylesheet that is one feature's can be removed with that feature.

   Both theme variants are in the markup and CSS picks one — dark mode is a
   class on <body>, which a <picture> media query cannot see. Same arrangement
   as the app bar (app_nav.css) and the group site's own (group_site.css). */
.om-brandmark {
  display: block;
  height: 46px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  object-position: left center;
}
.om-brandmark--dark { display: none; }
body.dark-mode .om-brandmark--light { display: none; }
body.dark-mode .om-brandmark--dark { display: block; }

/* A group branded by its typeface or its site title alone has no mark to draw,
   and an <img> with an empty src is a broken picture where the way home is. */
.om-brandword { font-weight: 800; font-size: 1.25rem; }

/* The credit, in the head row beside the site and group counts. It inherits
   `.meta`'s size and colour so it reads as one more fact about the map rather
   than as a badge, and it is never inside a details/summary. */
.om-credit { white-space: nowrap; }

/* The footer's mark sits centred over the group's name, at the size the
   platform's own mark uses there. */
.om-footmark {
  margin: 0 auto 0.5rem;
  max-height: 64px;
  max-width: 150px;
  height: auto;
}
.om-footname { font-weight: 700; }

/* Hash bust 2026-09-07 — drill-window CDN 404 cache; see audit/failover-drill-2026-09-07.md */

/* Foldable map tools (NHOpenMapPanel.foldable): a small chevron in the corner
   folds a control down to its own button or label. */
.nh-foldable { position: relative; padding-right: 26px; }
.nh-fold {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px; padding: 0;
  border: 0; border-radius: 4px; background: transparent;
  color: var(--ink-3, #746E62); cursor: pointer;
  font-size: 0.75rem; line-height: 20px; text-align: center;
}
.nh-fold::before { content: "\25BE"; }                 /* ▾ open */
.nh-foldable.is-folded .nh-fold::before { content: "\25B8"; }  /* ▸ folded */
.nh-fold:hover { background: var(--surface-2, #F4F2EC); }
.nh-fold:focus-visible { outline: 3px solid var(--accent-ring, #2887b1); outline-offset: 1px; }
.nh-foldable.is-folded .nh-fold-host > :not(.nh-fold-keep) { display: none; }

/* --- Radar 3D (open_map_radar3d.js) ---------------------------------------- */
/* The switch and its two sliders sit under 3D terrain in the Layers panel. */
.open-panel__r3d { padding-left: 23px; }
.open-panel__r3d .open-panel__terrain { margin-left: -23px; }
.open-panel__r3dRange { display: grid; gap: 2px; padding: 2px 0 6px; font-size: .82rem; }
.open-panel__r3dRange output { font-variant-numeric: tabular-nums; font-weight: 600; }
.open-panel__r3dRange input[type="range"] { width: 100%; accent-color: var(--brand-blue-deep, #1f6f93); }
.open-panel__r3dRange input[type="range"]:focus-visible { outline: 3px solid var(--accent-ring, #2887b1); outline-offset: 1px; }

/* The legend: a map control at the bottom left, folded to its title on a phone. */
.maplibregl-ctrl.nh-r3d-legend {
  background: var(--nh-glass); color: var(--ink, #1d2329);
  border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.25);
  padding: 6px 10px 8px; max-width: 230px; font-size: .78rem; line-height: 1.35;
}
.nh-r3d-legend.is-folded { padding-bottom: 6px; }
.nh-r3d-legend__title {
  all: unset; cursor: pointer; font-weight: 700; font-size: .82rem; display: block;
}
.nh-r3d-legend__title:focus-visible { outline: 3px solid var(--accent-ring, #2887b1); outline-offset: 2px; border-radius: 3px; }
.nh-r3d-legend__enc { margin: 4px 0 2px; color: var(--muted, #5b636b); }
.nh-r3d-legend__bands { list-style: none; margin: 0; padding: 0; }
.nh-r3d-legend__bands li { display: grid; grid-template-columns: 18px 3.2em 1fr; align-items: end; gap: 6px; padding: 1px 0; }
.nh-r3d-legend__bar { display: block; width: 18px; border-radius: 1px; }
.nh-r3d-legend__num { font-variant-numeric: tabular-nums; }
.nh-r3d-legend__status { margin: 6px 0 2px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.nh-r3d-legend__status.is-warn { color: var(--nh-glass-warning); font-weight: 600; }
.nh-r3d-legend__show {
  font: inherit; padding: 1px 8px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--brand-blue-deep, #1f6f93); background: transparent; color: var(--link);
}
.nh-r3d-legend__show:focus-visible { outline: 3px solid var(--accent-ring, #2887b1); outline-offset: 1px; }
.nh-r3d-legend__foot { margin: 4px 0 0; color: var(--muted, #5b636b); font-size: .72rem; }
body.dark-mode .nh-r3d-legend__show { color: var(--nh-glass-link); border-color: #8cc8e6; }
body.dark-mode .nh-r3d-legend__status.is-warn { color: var(--nh-glass-warning); }

/* The tooltip over a block: dBZ, its band in words, the rain rate it implies. */
.nh-r3d-tip {
  position: absolute; z-index: 3; transform: translate(-50%, calc(-100% - 12px));
  min-width: 170px; max-width: 210px; padding: 6px 10px; border-radius: 8px;
  background: var(--nh-glass-card); color: var(--ink, #1d2329);
  box-shadow: 0 2px 8px rgba(0,0,0,.3); font-size: .78rem; pointer-events: none;
}
.nh-r3d-tip.is-below { transform: translate(-50%, 14px); }
.nh-r3d-tip.is-pinned { pointer-events: auto; padding-right: 26px; }
.nh-r3d-tip__val { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.nh-r3d-tip__val small { font-size: .7rem; font-weight: 600; }
.nh-r3d-tip__band { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.nh-r3d-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.nh-r3d-tip__sub small { color: var(--muted, #5b636b); }
.nh-r3d-tip__x {
  position: absolute; top: 3px; right: 4px; border: 0; background: transparent;
  font-size: 1rem; line-height: 1; padding: 2px 5px; cursor: pointer; color: inherit;
}
.nh-r3d-tip__x:focus-visible { outline: 3px solid var(--accent-ring, #2887b1); }

/* A switched-on layer's own one-line state, on its row (2026-11-06) — "zoom
   in to see the flood zones", "no modelled flooding in view", "USGS did not
   answer". See noteNode in static/js/open_map_panel.js. Same size as the
   count above it; a hint is the warning ink because it explains a blank map,
   an error is the error ink because the blank means nothing is known. */
.open-panel__layerNote {
  display: block;
  color: var(--ink-2, #56534C);
  font-size: 0.72rem;
  line-height: 1.3;
}
.open-panel__layerNote.is-hint {
  color: var(--warning-ink, #8A5A0D);
}
.open-panel__layerNote.is-error {
  color: var(--critical-ink, #A82323);
  font-weight: 600;
}

/* A layer's notice — the FEMA "reference, not a determination" text — under
   its key and on its info card. It was built by the layer and never shown
   anywhere until 2026-11-06. */
.nh-overlay-notice {
  margin: 4px 0 6px;
  padding: 6px 8px;
  border-left: 3px solid var(--warning-ink, #8A5A0D);
  background: var(--warning-tint, #FDF3E3);
  font-size: 0.7rem;
  line-height: 1.35;
}
.nh-overlay-notice-head { display: block; margin-bottom: 2px; }
.nh-overlay-notice-body { margin: 0 0 3px; }
.nh-overlay-notice-link { font-size: 0.7rem; }

/* TOUCH TARGETS (2026-11-18, uiux.md finding 18). On a touch screen the
   inline action links on a card measured 18-22 px tall — "Open at USGS",
   "Open in analytics", the QPE link, "Open analytics" above the map — under
   the 24 px floor. Padding rather than a bigger font, so the text and the
   card's length do not change on a desktop at all. */
@media (pointer: coarse) {
  .usgs-popup__link,
  .station-links__link,
  .series-window__action,
  .nh-fa__link,
  .open-panel__link,
  .map-head .mp-analytics {
    display: inline-block;
    padding-block: 8px;
    min-height: 24px;
  }
}

/* ==========================================================================
   THE LAYERS BUTTON (static/js/open_map_basemaps.js, 2026-11-18): one small
   button beside the Layers panel that opens the basemap thumbnails and the 3D
   terrain switch. It sits in the panel's corner so it steps aside with it for
   a docked card or Storm replay.

   The thumbnails are this site's own images, referenced from here so that
   collectstatic hashes them, and a background on something inside a closed
   menu is never fetched: opening the menu is what costs its ~40 KB, and no
   thumbnail ever touches a map provider. USGS, NOAA and NASA pictures are US
   public domain; "Map" and "Dark map" are hand-drawn SVGs, because OSM's tile
   policy forbids keeping its tiles, and "Satellite" uses a USGS image for the
   same reason on Esri's side. */
.maplibregl-ctrl-top-right .maplibregl-ctrl.nh-basemap {
  position: relative;
  clear: none;
  margin-right: 8px;
  background: transparent;
  box-shadow: none;
}
.maplibregl-ctrl-top-right:has(.nh-basemap.is-open) { z-index: 6; }
.nh-basemap__toggle {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border: 0; cursor: pointer;
  border-radius: var(--r-xs, 4px);
  background: var(--nh-glass); color: var(--ink, #1a1a19);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}
.maplibregl-ctrl button.nh-basemap__toggle:not(:disabled):hover { background-color: var(--nh-glass-solid); }
.nh-basemap.is-open .nh-basemap__toggle { color: var(--link); }
.nh-basemap__toggle:focus-visible,
.nh-basemap__option:focus-visible,
.nh-basemap__close:focus-visible,
.nh-basemap__retry:focus-visible,
.nh-basemap__dateInput:focus-visible {
  outline: 3px solid var(--accent-ring, #2887b1); outline-offset: 1px;
}
.nh-basemap__menu:not([hidden]) {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 2;
  display: block; box-sizing: border-box;
  width: 19rem; max-width: calc(100vw - 24px);
  max-height: min(70vh, 460px); overflow-y: auto; overscroll-behavior: contain;
  padding: 6px 10px 8px;
  border-radius: var(--r-sm, 6px);
  background: var(--nh-glass-card); color: var(--ink, #1a1a19);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
  font-size: 0.78rem;
}
.nh-basemap__head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 4px; }
.nh-basemap__title { font-weight: 700; }
.maplibregl-ctrl button.nh-basemap__close {
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: var(--r-xs, 4px);
  background: transparent; color: inherit; font-size: 1.1rem; line-height: 1; cursor: pointer;
}
.nh-basemap__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.maplibregl-ctrl button.nh-basemap__option {
  display: block; width: 100%; height: auto; min-height: 44px; padding: 3px;
  border: 0; border-radius: var(--r-xs, 4px);
  background: transparent; color: inherit; cursor: pointer; text-align: center;
}
.maplibregl-ctrl button.nh-basemap__option:not(:disabled):hover { background-color: var(--nh-glass-line); }
.nh-basemap__thumb {
  display: block; width: 100%; aspect-ratio: 3 / 2;
  border-radius: 3px; background-size: cover; background-position: center;
  background-color: var(--line, #e3e0d7);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}
.nh-basemap__option.is-on .nh-basemap__thumb { box-shadow: 0 0 0 2px var(--link); }
.nh-basemap__label { display: block; margin-top: 2px; font-size: 0.7rem; line-height: 1.15; }
.nh-basemap__option.is-on .nh-basemap__label { font-weight: 700; }
.nh-basemap__thumb--light { background-image: url("../../img/basemaps/light.38aaf4272b2d.svg"); }
.nh-basemap__thumb--dark { background-image: url("../../img/basemaps/dark.758b638e3508.svg"); }
.nh-basemap__thumb--satellite { background-image: url("../../img/basemaps/satellite.d3a08c5d102a.webp"); }
.nh-basemap__thumb--usgs-imagery-labels { background-image: url("../../img/basemaps/usgs-imagery-labels.72ab5aeef361.webp"); }
.nh-basemap__thumb--usgs-topo { background-image: url("../../img/basemaps/usgs-topo.f66f6be6a5fb.webp"); }
.nh-basemap__thumb--usgs-hydro { background-image: url("../../img/basemaps/usgs-hydro.a0d3b0303f83.webp"); }
.nh-basemap__thumb--usgs-relief { background-image: url("../../img/basemaps/usgs-relief.018f963baf3e.webp"); }
.nh-basemap__thumb--noaa-charts { background-image: url("../../img/basemaps/noaa-charts.6740579a3641.webp"); }
.nh-basemap__thumb--nasa-daily { background-image: url("../../img/basemaps/nasa-daily.c60f07efeb68.webp"); }
.nh-basemap__terrain { margin-top: 8px; padding: 6px 0 0; border-top: 1px solid var(--nh-glass-line); }

/* The note under the button: NASA's date, or what is wrong with this map. */
.nh-basemap__note:not([hidden]) {
  position: absolute; right: 0; z-index: 1;
  top: calc(100% + 6px + var(--nh-basemap-note-top, 0px));
  display: block; box-sizing: border-box;
  width: max-content; max-width: 17.5rem;
  padding: 5px 8px; border-radius: var(--r-sm, 6px);
  background: var(--nh-glass-card); color: var(--ink, #1a1a19);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
  font-size: 0.72rem; line-height: 1.3;
}
.nh-basemap.is-open .nh-basemap__note { display: none; }
.nh-basemap__note.is-warning { border-left: 3px solid var(--nh-glass-warning); }
.nh-basemap__noteText { margin: 0; }
.nh-basemap__noteText:empty { display: none; }
.nh-basemap__date:not([hidden]) { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 4px; }
.nh-basemap__dateInput {
  min-height: 26px; padding: 1px 4px; font: inherit; color: inherit;
  background: var(--nh-glass); border: 1px solid var(--nh-glass-line-strong); border-radius: var(--r-xs, 4px);
}
body.dark-mode .nh-basemap__dateInput { color-scheme: dark; }
.nh-basemap__dateInput:disabled { opacity: 0.7; }
.maplibregl-ctrl button.nh-basemap__retry {
  display: inline-block; width: auto; height: auto; margin-top: 4px; padding: 3px 8px;
  border: 1px solid var(--nh-glass-line-strong); border-radius: var(--r-xs, 4px);
  background: transparent; color: var(--link); font: inherit; cursor: pointer;
}
.maplibregl-ctrl button.nh-basemap__retry[hidden] { display: none; }

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nh-basemap__toggle, .nh-basemap__menu, .nh-basemap__note {
    -webkit-backdrop-filter: blur(var(--nh-glass-blur));
    backdrop-filter: blur(var(--nh-glass-blur));
  }
}

/* A PHONE: the panel's corner is the sheet at the foot of the screen, so the
   button has a corner of its own at the map's top right, the menu is a bottom
   sheet like Tools, and every target is 44 px. The transform MapLibre gives a
   control would trap the fixed sheet inside the button, as it did for Tools. */
.nh-basemap-slot { position: absolute; top: 10px; right: 10px; z-index: 2; pointer-events: none; }
.nh-basemap-slot.is-open { z-index: 950; }
.nh-basemap-slot .maplibregl-ctrl.nh-basemap { margin: 0; float: none; transform: none; pointer-events: auto; }
@media (max-width: 620px) {
  .nh-basemap__toggle { width: 44px; height: 44px; }
  .nh-basemap__toggle svg { width: 22px; height: 22px; }
  .nh-basemap__menu:not([hidden]) {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 950;
    width: auto; max-width: none; max-height: min(72vh, 520px);
    padding: 4px 14px calc(12px + env(safe-area-inset-bottom, 0px));
    border-radius: var(--r-md, 10px) var(--r-md, 10px) 0 0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.28);
    font-size: 0.85rem;
  }
  .maplibregl-ctrl button.nh-basemap__close { width: 44px; height: 44px; margin-right: -10px; }
  .nh-basemap__list { gap: 8px; }
  .nh-basemap__label { font-size: 0.76rem; }
  .nh-basemap__terrain { min-height: 44px; align-items: center; }
  .nh-basemap__note:not([hidden]) { max-width: calc(100vw - 110px); width: calc(100vw - 110px); }
  .nh-basemap__dateInput { min-height: 44px; font-size: 16px; }
  .maplibregl-ctrl button.nh-basemap__retry { min-height: 44px; }
}
@media (pointer: coarse) {
  .nh-basemap__toggle { width: 44px; height: 44px; }
  .maplibregl-ctrl button.nh-basemap__close { width: 44px; height: 44px; }
  .nh-basemap__dateInput { min-height: 44px; }
  .maplibregl-ctrl button.nh-basemap__retry { min-height: 44px; }
}

/* A long credit (NASA's is one sentence) wraps rather than running over the
   scale bar, beside the controls on the left. */
@media (min-width: 621px) {
  .maplibregl-ctrl-bottom-right { max-width: calc(100% - 170px); }
  body.nh-storm-open .maplibregl-ctrl-bottom-right {
    max-width: calc(100% - var(--nh-storm-width, min(420px, 40vw)) - 170px);
  }
}
