/* Station EI5GJB — dashboard
 *
 * Dark first, because this ends up on a wall and gets looked at after dark more
 * than before it. The light theme is for a phone in daylight, not an
 * afterthought inversion.
 *
 * Two rules do most of the work here:
 *   - tabular numerals everywhere a value updates, so digits do not shuffle
 *     sideways every sixteen seconds. Without it the whole page looks unstable
 *     no matter how good everything else is.
 *   - one accent, and semantic colour reserved strictly for state. If the
 *     accent is also the alert colour then nothing reads as urgent.
 */

:root {
  /* Both palettes are defined once, here, and the theme blocks below only
   * remap which set is active. Previously the light values were written out
   * twice — once for the media query and once for the explicit choice — which
   * is two places to keep in step and one to forget. */

  /* Dark */
  --d-bg:        #0A1017;
  --d-surface:   #101A23;
  --d-surface-2: #16242F;
  --d-line:      #1E2E3A;
  --d-line-2:    #2B3F4E;
  --d-ink:       #E2EAF0;
  --d-ink-2:     #97AAB8;
  --d-ink-3:     #66798A;
  --d-accent:      #4FA3DC;
  --d-accent-soft: #12293B;
  --d-ok:   #4FB489;
  --d-warn: #D9A441;
  --d-crit: #E2705E;
  /* A shadow that reads on a dark ground has to be heavier than one on a light
   * ground, or it disappears; the same value on light looks like a smudge. */
  --d-shadow: 0 6px 20px rgba(0, 0, 0, .45);

  /* Light. Deliberately not a bright one: the page is a soft warm-grey and
   * panels are off-white rather than #FFF, because white cards on a near-white
   * page is most of what makes a light dashboard glare. Text is a soft charcoal
   * rather than near-black for the same reason — contrast stays well above
   * requirements without the harshness. */
  /* Built around #EFE9E9 — a warm neutral rather than the blue-grey the dark
   * theme uses. Everything else is derived from it so the whole light theme
   * shares that warmth: panels lift very slightly off the page rather than
   * being white, greys carry the same red bias, and the neutrals never go
   * cold against it. The accent stays marine blue, which is the one deliberate
   * cool note and is what makes it read as an accent at all. */
  --l-bg:        #EFE9E9;
  --l-surface:   #F7F3F3;
  --l-surface-2: #E2D9D9;
  --l-line:      #D5CACA;
  --l-line-2:    #B7A9A9;
  --l-ink:       #221B1B;
  --l-ink-2:     #4A3F3F;
  --l-ink-3:     #665A5A;
  --l-accent:      #12557C;
  --l-accent-soft: #DCE7EE;
  --l-ok:   #1B5C41;
  --l-warn: #74500C;
  --l-crit: #8C3226;
  --l-shadow: 0 5px 16px rgba(60, 45, 45, .14);

  /* Active palette — dark, because this ends up on a wall. */
  --bg:        var(--d-bg);
  --surface:   var(--d-surface);
  --surface-2: var(--d-surface-2);
  --line:      var(--d-line);
  --line-2:    var(--d-line-2);
  --ink:       var(--d-ink);
  --ink-2:     var(--d-ink-2);
  --ink-3:     var(--d-ink-3);
  --accent:      var(--d-accent);
  --accent-soft: var(--d-accent-soft);
  --ok:   var(--d-ok);
  --warn: var(--d-warn);
  --crit: var(--d-crit);
  --shadow: var(--d-shadow);

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --gap: 14px;
  --radius: 3px;
}

/* Optional vendored faces. ops/fetch-vendor.sh downloads these; if it has not
 * been run the stacks above apply and the page still looks deliberate. */
@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/plex-mono.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}
:root { --sans: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }

/* Light applies in two cases and both are needed: when the device asks for it
 * and nothing overrides, and when the viewer explicitly chooses it. Without the
 * second, a toggle has nothing to switch to on a system set to dark. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:        var(--l-bg);
    --surface:   var(--l-surface);
    --surface-2: var(--l-surface-2);
    --line:      var(--l-line);
    --line-2:    var(--l-line-2);
    --ink:       var(--l-ink);
    --ink-2:     var(--l-ink-2);
    --ink-3:     var(--l-ink-3);
    --accent:      var(--l-accent);
    --accent-soft: var(--l-accent-soft);
    --ok:   var(--l-ok);
    --warn: var(--l-warn);
    --crit: var(--l-crit);
    --shadow: var(--l-shadow);
  }
}

:root[data-theme="light"] {
  --bg:        var(--l-bg);
  --surface:   var(--l-surface);
  --surface-2: var(--l-surface-2);
  --line:      var(--l-line);
  --line-2:    var(--l-line-2);
  --ink:       var(--l-ink);
  --ink-2:     var(--l-ink-2);
  --ink-3:     var(--l-ink-3);
  --accent:      var(--l-accent);
  --accent-soft: var(--l-accent-soft);
  --ok:   var(--l-ok);
  --warn: var(--l-warn);
  --crit: var(--l-crit);
  --shadow: var(--l-shadow);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1360px; margin: 0 auto; padding: 0 18px 64px; }

/* ---------------------------------------------------------------- header -- */

.topbar {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 18px;
  padding: 18px 0 14px; border-bottom: 1px solid var(--line);
}
.callsign {
  font-family: var(--mono); font-size: 20px; font-weight: 600;
  letter-spacing: .06em; color: var(--ink);
}
.place { color: var(--ink-2); font-size: 14px; }
.coords {
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.topbar .spacer { flex: 1 1 auto; }

/* Site navigation, injected by station.js so there is one copy of it. */
.site-nav { display: flex; gap: 2px; margin-left: 4px; }
.site-nav a {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em;
  text-transform: uppercase; text-decoration: none; color: var(--ink-3);
  padding: 4px 9px; border-radius: var(--radius);
  border: 1px solid transparent;
}
.site-nav a:hover { color: var(--ink); background: var(--surface); }
.site-nav a.on {
  color: var(--accent); background: var(--accent-soft);
  border-color: var(--accent);
}

.theme-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 4px 10px; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .08em; text-transform: uppercase;
}
.theme-btn:hover { color: var(--ink); border-color: var(--line-2); }
.theme-btn svg { width: 13px; height: 13px; flex: none; }

.link-state {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-3);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex: none; }
.link-state[data-state="live"] .dot  { background: var(--ok); }
.link-state[data-state="stale"] .dot { background: var(--warn); }
.link-state[data-state="down"] .dot  { background: var(--crit); }
.link-state[data-state="live"]  { color: var(--ok); }
.link-state[data-state="stale"] { color: var(--warn); }
.link-state[data-state="down"]  { color: var(--crit); }

/* --------------------------------------------------------------- layout -- */

/* One column on a phone, two from tablet width up. The readings column comes
 * second in source order but first on screen at width, so a phone gets the
 * tiles and charts before a long table of numbers — on a small screen the
 * summary IS the tiles. */
.layout { display: block; }
.main { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.sidebar {
  display: flex; flex-direction: column; gap: var(--gap);
  margin-top: var(--gap); min-width: 0;
}

@media (min-width: 1000px) {
  .layout {
    display: grid; grid-template-columns: 310px minmax(0, 1fr);
    gap: var(--gap); align-items: start; margin-top: var(--gap);
  }
  .sidebar { margin-top: 0; position: sticky; top: var(--gap); }
  /* Sticky, but never taller than the viewport, or the bottom panels become
   * unreachable while the main column scrolls past them. */
  .sidebar { max-height: calc(100vh - var(--gap) * 2); overflow-y: auto; }
}

/* A dense readings table wants tighter rows than a four-column one. */
table.data.compact th, table.data.compact td { padding: 5px 8px 5px 0; font-size: 13px; }
table.data.compact td.num { font-size: 12px; }
table.data.compact .note { font-size: 10px; }

.sidebar .panel .body { padding: 10px 14px 12px; }

/* ------------------------------------------------------------------ now -- */

/* Cells separated by a gap showing the page through, NOT by a line-coloured
 * container behind them. The container trick draws dividers for free but any
 * empty trailing cell — and there is always one, since the wind tile spans two
 * columns and the column count varies with width — renders as a solid block of
 * line colour with nothing in it. */
.now {
  display: grid; gap: 2px; background: transparent;
  margin-top: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.now .hero { grid-column: span 2; }

.cell {
  background: var(--surface); padding: 16px 18px 18px;
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.cell .label {
  font-family: var(--mono); font-size: 10px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--ink-3);
}
.cell .value {
  font-variant-numeric: tabular-nums; font-weight: 600;
  font-size: 30px; line-height: 1.05; letter-spacing: -.02em;
}
.hero .value { font-size: clamp(52px, 9vw, 84px); font-weight: 500; }
.cell .unit { font-size: .45em; font-weight: 500; color: var(--ink-2); margin-left: 2px; }
.hero .unit { font-size: .3em; }
.cell .sub {
  font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums;
  min-height: 1.2em;
}
.cell.pending .value { color: var(--ink-3); }

/* Tiles are the way into the detail view, so they have to look like they do
 * something. A hover state alone is invisible on a wall display. */
.cell[data-obs] { cursor: pointer; position: relative; transition: background .12s; }
.cell[data-obs]::after {
  content: ""; position: absolute; inset: 0; border: 1px solid transparent;
  pointer-events: none; transition: border-color .12s;
}
.cell[data-obs]:hover { background: var(--surface-2); }
.cell[data-obs]:hover::after,
.cell[data-obs].open::after { border-color: var(--accent); }
.cell[data-obs]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* A tile showing one number tells you the value. With four hours of shape
 * behind it, it tells you what the weather is doing. */
canvas.spark {
  width: 100%; height: 26px; display: block; margin-top: 6px; opacity: .85;
}

/* ---------------------------------------------------------------- ranges -- */

.rangebar { display: flex; align-items: center; gap: 6px; margin-top: var(--gap); }
.rangebar button {
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; padding: 6px 12px; cursor: pointer;
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.rangebar button:hover { color: var(--ink); border-color: var(--line-2); }
.rangebar button.on {
  background: var(--accent-soft); color: var(--accent); border-color: var(--accent);
}
.rangebar-note {
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); margin-left: 6px;
}

/* ---------------------------------------------------------------- detail -- */

.detail { margin-top: var(--gap); border-color: var(--accent); }
.detail .close {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em;
  text-transform: uppercase; background: none; border: 0; cursor: pointer;
  color: var(--ink-3); padding: 2px 4px;
}
.detail .close:hover { color: var(--ink); }
.chart.tall { height: 280px; }
.detail-stats {
  display: flex; flex-wrap: wrap; gap: 0 28px; margin-bottom: 12px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.detail-stats div { display: flex; flex-direction: column; gap: 2px; }
.detail-stats dt {
  font-family: var(--mono); font-size: 10px; letter-spacing: .11em;
  text-transform: uppercase; color: var(--ink-3);
}
.detail-stats dd {
  margin: 0; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.detail-stats .when { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }

/* -------------------------------------------------------------- compass -- */

.now .wind-cell { grid-column: span 2; }
@media (max-width: 560px) { .now .wind-cell { grid-column: span 1; } }

.wind-row { display: flex; align-items: center; gap: 16px; }
.compass { width: 104px; height: 104px; flex: none; }
.wind-figures { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.wind-figures .value { font-size: 30px; }
.wind-dir {
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  color: var(--accent); letter-spacing: .04em;
}

.c-ring { fill: none; stroke: var(--line-2); stroke-width: 1; }
.c-tick { stroke: var(--line-2); stroke-width: 1; }
.c-tick.major { stroke: var(--ink-3); stroke-width: 1.4; }
.c-card {
  fill: var(--ink-3); font-family: var(--mono); font-size: 9px;
  font-weight: 600; text-anchor: middle; dominant-baseline: middle;
}
.c-hub { fill: var(--ink-3); }
.c-head { fill: var(--accent); }
.c-tail { fill: var(--line-2); }
/* Recent readings as rim dots: a steady wind clusters, a shifty one scatters.
   Direction is never one number and this shows that without a second chart. */
.c-mark { fill: var(--accent); }

.c-needle {
  transform-origin: 50px 50px;
  transition: transform .6s cubic-bezier(.4, 0, .2, 1);
}
@media (prefers-reduced-motion: reduce) { .c-needle { transition: none; } }
.cell.pending .c-head { fill: var(--ink-3); }

/* Pressure direction is information, not a fault state, so it does not get
 * semantic colour — amber for rising pressure would read as a warning about
 * improving weather. Falling takes the accent because it is the one worth
 * noticing; rising and steady stay neutral, and the arrow and words carry the
 * rest. */
.trend { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.trend.down { color: var(--accent); }

/* ---------------------------------------------------------------- panels -- */

.grid {
  display: grid; gap: var(--gap); margin-top: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.grid.wide { grid-template-columns: repeat(auto-fit, minmax(430px, 1fr)); }

.panel { background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.panel > header {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.panel h2 {
  margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-2);
}
.panel .note { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.panel .body { padding: 14px 16px 16px; }
.chart { height: 190px; }

/* ---------------------------------------------------------------- health -- */

table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td {
  text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line);
}
table.data thead th {
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3); font-weight: 500;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.num {
  font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12.5px;
}

.pill {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .06em;
  text-transform: uppercase; border: 1px solid currentColor;
}
.pill.ok   { color: var(--ok); }
.pill.warn { color: var(--warn); }
.pill.crit { color: var(--crit); }

.bar { height: 4px; background: var(--surface-2); border-radius: 2px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); }

/* ---------------------------------------------------------------- alerts -- */

/* Severity carried by a left rule and a colour, not by colour alone — the
 * strongest signal on the page has to survive being looked at by someone who
 * cannot separate red from amber. */
#alerts { display: flex; flex-direction: column; gap: 1px; margin-top: var(--gap); }
.alert {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  padding: 12px 16px; display: flex; flex-direction: column; gap: 3px;
}
.alert.crit { border-left-color: var(--crit); }
.alert strong { font-size: 14px; color: var(--warn); }
.alert.crit strong { color: var(--crit); }
.alert span { font-size: 13px; color: var(--ink-2); }
/* Says where the alert came from. A forecaster warning a region and your own
 * thermometer crossing a line you set are not the same claim, and a banner
 * that blurred them would overstate the second. */
.alert-src {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3);
}
.alert-since { text-transform: none; letter-spacing: 0; }

/* -------------------------------------------------------------- forecast -- */

/* --- daily summary -------------------------------------------------------
 * The row that answers "which day". Without it the panel was 36 unlabelled
 * hours, and after about eighteen of them nobody knows what day they are on. */
/* Same reasoning as .now: gap over the page, not over a line-coloured
 * container, so a short final row leaves nothing showing. */
.fd-row {
  display: grid; gap: 2px; background: transparent;
  margin-bottom: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
}
.fd {
  background: var(--surface); padding: 12px 10px 13px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  text-align: center; min-width: 0;
}
.fd.now { background: var(--accent-soft); }
.fd-day {
  font-size: 13px; font-weight: 600; color: var(--ink); letter-spacing: -.01em;
}
.fd.now .fd-day { color: var(--accent); }
.fd-date {
  font-family: var(--mono); font-size: 10px; color: var(--ink-3);
  letter-spacing: .04em;
}
.fd-ico { width: 30px; height: 30px; color: var(--ink-2); margin: 2px 0; }
.fd.now .fd-ico { color: var(--accent); }

/* Low and high with a bar between, scaled across the whole week — so the bars
 * compare days rather than each being its own private scale. */
.fd-range {
  display: flex; align-items: center; gap: 6px; width: 100%;
  font-variant-numeric: tabular-nums;
}
.fd-lo, .fd-hi { font-size: 13px; font-weight: 600; }
.fd-lo { color: var(--ink-3); }
.fd-hi { color: var(--ink); }
.fd-bar {
  position: relative; flex: 1 1 auto; height: 3px;
  background: var(--surface-2); border-radius: 2px; overflow: hidden;
}
.fd-bar > span {
  position: absolute; top: 0; height: 100%;
  background: var(--accent); border-radius: 2px;
}
.fd-rain, .fd-gust, .fd-part {
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.fd-rain.wet { color: var(--accent); font-weight: 500; }
.fd-part { color: var(--warn); }

/* --- hourly strip --------------------------------------------------------
 * Horizontal scroll rather than wrapping: a forecast is a sequence, and
 * breaking it onto a second line loses that. The strip scrolls, the page does
 * not. */
.fc-strip {
  display: flex; gap: 1px; overflow-x: auto; background: var(--line);
  border: 1px solid var(--line); scroll-snap-type: x proximity;
}
/* Fixed row grid rather than a flex stack, so every tile - including the label
 * column - puts the same thing on the same line. With a flex stack the labels
 * drift out of step the moment a row's content differs in height. */
.fc {
  flex: 0 0 78px; background: var(--surface); scroll-snap-align: start;
  display: grid; grid-template-rows: 13px 15px 28px 22px 20px 15px;
  justify-items: center; align-items: center;
  padding: 8px 6px 10px; text-align: center;
}
.fc.now { background: var(--accent-soft); }
/* Night hours sit a shade back, so the shape of the night reads along the
 * strip without checking a single time. */
.fc.night { background: color-mix(in srgb, var(--surface) 86%, var(--bg)); }
.fc.now.night { background: var(--accent-soft); }
/* A visible seam where the date rolls over, so midnight is not just another
 * hour that happens to say 00:00. */
.fc.newday { box-shadow: inset 2px 0 0 var(--accent); }

/* Names every row and stays put while the hours scroll behind it. Without it
 * a column of bare numbers means nothing: "0 / 15 W" under a temperature
 * needs telling which row is rain, which is wind, and in what units. */
.fc-labels {
  position: sticky; left: 0; z-index: 2; flex: 0 0 88px;
  background: var(--surface-2); justify-items: end; text-align: right;
  padding-right: 10px; box-shadow: 3px 0 8px rgba(0, 0, 0, .22);
}
.fc-lbl, .fc-labels .fc-time {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .06em;
  color: var(--ink-3); text-transform: uppercase; white-space: nowrap;
}

.fc-day {
  font-family: var(--mono); font-size: 9.5px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--accent);
}
.fc-time {
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.fc .ico { width: 24px; height: 24px; color: var(--ink-2); }
.fc.now .ico { color: var(--accent); }
.fc-temp {
  font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* Bar and figure share one row, so rainfall is one line needing one label
 * rather than two rows needing two. The bar is transparent when dry: drawn
 * unconditionally it puts an empty box on every dry hour, which is most of
 * them. */
.fc-wet { display: flex; align-items: center; gap: 5px; }
.fc-bar {
  width: 7px; height: 16px; background: transparent;
  border-radius: 1px; display: flex; align-items: flex-end; overflow: hidden;
}
.fc-bar.wet { background: var(--surface-2); }
.fc-bar > span { width: 100%; background: var(--accent); border-radius: 1px; }
.fc-rain {
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.fc-rain.wet { color: var(--accent); font-weight: 500; }
.fc-wind {
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.fc-dir { color: var(--ink-2); }

/* --------------------------------------------------------- chart cursor -- */

.uptip {
  position: absolute; pointer-events: none; z-index: 10;
  background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: var(--radius); padding: 7px 10px; min-width: 130px;
  box-shadow: var(--shadow);
}
.uptip-time {
  font-family: var(--mono); font-size: 10px; letter-spacing: .06em;
  color: var(--ink-3); margin-bottom: 5px; white-space: nowrap;
}
.uptip-row {
  display: flex; align-items: center; gap: 7px; font-size: 12.5px;
  white-space: nowrap; line-height: 1.7;
}
.uptip-row .swatch { width: 8px; height: 2px; flex: none; border-radius: 1px; }
.uptip-row .k { color: var(--ink-2); }
.uptip-row .v {
  margin-left: auto; font-family: var(--mono); font-variant-numeric: tabular-nums;
  color: var(--ink); font-weight: 500;
}

/* uPlot draws its own crosshair; make it read as ours. */
.u-cursor-x, .u-cursor-y { border-color: var(--line-2) !important; }
.u-cursor-pt { border-color: var(--accent) !important; }

/* ------------------------------------------------------------ conditions -- */

.hero-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.cond { display: flex; align-items: center; gap: 9px; color: var(--accent); }
.cond-ico { width: 38px; height: 38px; flex: none; }
.cond-text {
  font-size: 15px; font-weight: 500; color: var(--ink-2); white-space: nowrap;
}

/* ---------------------------------------------------------------- radar -- */

.radar-map {
  height: 420px; width: 100%; background: var(--surface-2);
  border: 1px solid var(--line);
}
@media (max-width: 620px) { .radar-map { height: 300px; } }

.radar-foot {
  margin-top: 8px; font-family: var(--mono); font-size: 10px; color: var(--ink-3);
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
}
.radar-legend { display: inline-flex; align-items: center; gap: 6px; }
/* RainViewer's "Universal Blue" scheme, approximated. */
.radar-legend .ramp {
  width: 96px; height: 7px; border-radius: 2px;
  background: linear-gradient(90deg,
    #8ED8F8 0%, #34B5E8 22%, #1B87D4 40%,
    #2FA33A 58%, #E8D338 74%, #E8862F 87%, #D6362F 100%);
}
.radar-foot a { color: var(--ink-3); }
.radar-foot a:hover { color: var(--accent); }

/* Nowcast frames are predictions. Marked, never blended silently into observed
 * radar — the same rule as not showing a forecast icon as current conditions. */
#radar-time.forecast { color: var(--warn); }

/* Leaflet defaults are built for a white page. */
.leaflet-container { background: var(--surface-2); font-family: var(--sans); }
.leaflet-control-zoom a {
  background: var(--surface); color: var(--ink-2);
  border-color: var(--line-2);
}
.leaflet-control-zoom a:hover { background: var(--surface-2); color: var(--ink); }
/* The base map is a reference, not the subject; the radar is what matters.
 *
 * Scoped to .basemap, NOT the tile pane. Radar tiles are in that same pane, and
 * filtering the pane drains the colour out of the precipitation as well — which
 * removes the only thing on the map carrying information. */
/* Dark-first, matching the palette: the default inverts the map, and light
 * overrides it. The previous order had this backwards, so a dark page carried
 * a bright map unless the OS happened to be set to dark. */
.leaflet-tile-pane .basemap { filter: grayscale(1) invert(1) brightness(.8) contrast(.85); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .leaflet-tile-pane .basemap {
    filter: grayscale(1) brightness(.9) contrast(.9);
  }
}
:root[data-theme="light"] .leaflet-tile-pane .basemap {
  filter: grayscale(1) brightness(.9) contrast(.9);
}

/* Radar sits above the base map and keeps every bit of its colour. */
.leaflet-tile-pane .leaflet-layer:not(.basemap) { filter: none; }

/* ----------------------------------------------------------- sun & moon -- */

.sky { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 460px) { .sky { grid-template-columns: 1.1fr .9fr; } }
.sky-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3);
}
.sky-head .ico, .sky-head .moon { width: 16px; height: 16px; color: var(--accent); }
.sky .data td { padding: 5px 8px 5px 0; }
.moon-face {
  display: flex; justify-content: center; padding: 6px 0 12px;
  color: var(--ink);
}
.daylight { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.daylight .note { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }

/* -------------------------------------------------------------- windrose -- */

.rose-wrap { display: flex; align-items: center; justify-content: center; padding: 4px 0; }
canvas.rose { width: 100%; max-width: 300px; height: auto; }

/* ----------------------------------------------------------------- misc -- */

.empty { color: var(--ink-3); font-size: 13px; padding: 10px 0; }

/* --------------------------------------------------------------- pages -- */

/* Project pages: prose with structure, not a dashboard. Wider measure than a
 * data table wants, narrower than the window. */
.page-head { margin: 24px 0 4px; }
.page-head h1 {
  font-size: 26px; margin: 0 0 8px; letter-spacing: -.02em; line-height: 1.15;
}
.page-head .lede {
  color: var(--ink-2); font-size: 15.5px; line-height: 1.6; max-width: 72ch; margin: 0;
}
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; }
.badge {
  font-family: var(--mono); font-size: 10px; letter-spacing: .08em;
  text-transform: uppercase; padding: 3px 9px; border-radius: var(--radius);
  border: 1px solid var(--line-2); color: var(--ink-2); background: var(--surface);
}
.badge.key { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.prose-body { padding: 16px 18px 18px; }
.prose-body p {
  color: var(--ink-2); font-size: 14.5px; line-height: 1.65;
  max-width: 74ch; margin: 0 0 14px;
}
.prose-body p:last-child { margin-bottom: 0; }
.prose-body strong { color: var(--ink); font-weight: 600; }
.prose-body ul { margin: 0 0 14px; padding-left: 20px; max-width: 74ch; }
.prose-body li { color: var(--ink-2); font-size: 14.5px; line-height: 1.6; margin-bottom: 7px; }
.prose-body li::marker { color: var(--ink-3); }
.prose-body li strong { color: var(--ink); }

/* A label and a sentence, which scans faster than paragraphs for someone
 * checking whether a tool does the one thing they need. */
.features { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (min-width: 780px) { .features { grid-template-columns: 1fr 1fr; } }
.feature { background: var(--surface); padding: 14px 16px 16px; }
.feature h3 { margin: 0 0 5px; font-size: 14px; font-weight: 600; }
.feature p { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }

/* The thing every visitor to a project page is actually looking for. */
.repo-link {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  font-family: var(--mono); font-size: 12px; letter-spacing: .04em;
  padding: 9px 14px; border-radius: var(--radius);
  border: 1px solid var(--accent); color: var(--accent); background: var(--accent-soft);
}
.repo-link:hover { background: var(--accent); color: var(--surface); }
.repo-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

pre.diagram {
  margin: 0; padding: 14px 16px; overflow-x: auto; background: var(--surface-2);
  border: 1px solid var(--line); font-family: var(--mono);
  font-size: 11.5px; line-height: 1.5; color: var(--ink-2);
}

.proj-grid { display: grid; gap: var(--gap); margin-top: var(--gap); }
@media (min-width: 900px) { .proj-grid { grid-template-columns: 1fr 1fr; } }
.proj-card { display: flex; flex-direction: column; }
.proj-card .body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 12px; }

/* A panel showing numbers nobody can interpret is decoration. Explanations sit
 * in the panel rather than in a tooltip or a wiki, because that is where the
 * question is asked. */
.explain {
  margin: 0 0 12px; max-width: 78ch;
  font-size: 13.5px; line-height: 1.6; color: var(--ink-2);
}
.explain strong { color: var(--ink); font-weight: 600; }
.explain + .explain { margin-top: -4px; }

footer.meta {
  margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 6px 20px;
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-3);
}

a { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Kiosk route: strip everything that is only useful to a person holding a mouse.
 * The readings column stays — on a wall display it is the most useful thing
 * there, being readable without touching anything. */
body.kiosk .topbar .coords,
body.kiosk footer.meta { display: none; }
body.kiosk .hero .value { font-size: clamp(64px, 12vw, 130px); }
body.kiosk .rangebar { display: none; }
