/* Soggy Crow web. Palette from the mascot: cream paper, ink, and the raincoat orange as the one
   accent. Data colours (rain blue, wintry violet, the radar palette) stay apart from the accent. */
:root {
  --bg: #f6ecd9;            /* the mascot's paper */
  --card: #fffaf1;
  --text: #1d1a17;          /* ink */
  --muted: #5c5247;
  --line: #e2d3b8;
  --accent: #e8932a;        /* raincoat orange: fills, rings, the brand; never body text */
  --accent-ink: #94500a;    /* orange dark enough for text and links on paper */
  --accent-soft: rgba(232, 147, 42, 0.28);
  --focus: #b8620d;
  --wet: #1d64b3;
  --wintry: #6446c4;
  --warn: #8f4a00;
  --error: #b3261e;
  --chance: rgba(29, 100, 179, 0.18);
  --chance-edge: #1d64b3;
  --rate: #1d1a17;
  --rateband: rgba(29, 26, 23, 0.16);
  --radar: #2b8a52;
  --bar: #e2d6c2;
  --bar-iqr: #8d8170;
  --hl: #8d8170;
  --alert: #fde9cc;
  --alert-winter: #ece6ff;
  --chip: #f1e5cd;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1815;          /* deep warm charcoal */
    --card: #25211d;
    --text: #f2eadd;
    --muted: #b9ad9c;
    --line: #3b342c;
    --accent: #f0a043;
    --accent-ink: #f4b66a;
    --accent-soft: rgba(240, 160, 67, 0.3);
    --focus: #f6b562;
    --wet: #7db6f2;
    --wintry: #bba7ff;
    --warn: #ffb766;
    --error: #ff8f85;
    --chance: rgba(125, 182, 242, 0.22);
    --chance-edge: #7db6f2;
    --rate: #f2eadd;
    --rateband: rgba(242, 234, 221, 0.16);
    --radar: #5fcf8c;
    --bar: #3d362e;
    --bar-iqr: #9c8f7d;
    --hl: #9c8f7d;
    --alert: #3b2a14;
    --alert-winter: #2b2543;
    --chip: #2f2a24;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--bar-iqr) var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--text); caret-color: var(--accent);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding: 0 0 env(safe-area-inset-bottom);
  overflow-wrap: break-word;
}
::selection { background: var(--accent-soft); color: var(--text); }
main { max-width: 760px; margin: 0 auto; padding: 0 12px 24px; }

/* Type: 13 / 16 / 20 / 24, about 1.25x a step. */
h1 { font-size: 1.125rem; line-height: 1.2; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.5rem; line-height: 1.2; margin: 0 0 10px; letter-spacing: -0.015em; }
h3 { font-size: 1.25rem; line-height: 1.25; margin: 22px 0 8px; }
p { margin: 6px 0; }
a { color: var(--accent-ink); text-underline-offset: 2px; }
code { font-size: 0.95em; }
.src code { font-size: 1em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nw { white-space: nowrap; }

button, select, input[type=url] {
  font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px 12px; min-height: 40px;
}
button { cursor: pointer; font-weight: 600; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: 0.5; cursor: default; }
input[type=checkbox], input[type=range] { accent-color: var(--accent); }

/* Focus: an orange ring that shows on paper and on charcoal. */
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
summary:focus-visible { outline-offset: 0; }

/* ---------- header: one row ---------- */
.top {
  position: sticky; top: 0; z-index: 1000; background: var(--bg); border-bottom: 1px solid var(--line);
  padding: calc(6px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left));
  display: flex; align-items: center; gap: 10px;
}
.avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px var(--accent); background: #f6ecd9; }
.brand { flex: 1 1 auto; min-width: 0; }
.stamp { margin: 0; font-size: 0.8125rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.controls { display: flex; gap: 6px; flex: none; }
.controls select { max-width: 12rem; }
#refresh { display: inline-flex; align-items: center; gap: 6px; }
#refresh svg { width: 18px; height: 18px; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 14px 0; container-type: inline-size; }
.muted { color: var(--muted); }
.src, .sub, .range, .note { color: var(--muted); font-size: 0.8125rem; line-height: 1.45; }
.src { max-width: 62ch; }
p, .src, .sub, figcaption { text-wrap: pretty; }
.warn { color: var(--warn); }
.error { color: var(--error); }
.headline { font-weight: 650; font-size: 1.25rem; line-height: 1.3; margin: 0 0 8px; text-wrap: balance; }

.big { font-size: 3.5rem; font-weight: 300; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.big .unit { font-size: 1.25rem; color: var(--muted); margin-left: 2px; letter-spacing: 0; }
.cond { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 0; }
.cond .ico { width: 28px; height: 28px; }
.feels { margin: 8px 0 2px; }
.feels .sep { color: var(--muted); }
.wind { font-weight: 550; margin-top: 12px; }

.ico { width: 22px; height: 22px; display: block; color: inherit; }

/* The dry moment: the crow beside the "dry" headline. */
.dry { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.dry .headline { margin: 0; }
.crow { width: 80px; height: 80px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px var(--accent), 0 4px 14px rgba(0, 0, 0, 0.18); background: #f6ecd9; }

/* Method, folded away. */
details.how { margin-top: 10px; }
details.how > summary {
  font-size: 0.875rem; color: var(--accent-ink); cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px;
  list-style: none; width: fit-content; font-weight: 600;
}
details.how > summary::-webkit-details-marker, .ens > summary::-webkit-details-marker { display: none; }
.ens > summary { list-style: none; gap: 8px; }
.ens > summary::before, details.how > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
details.how[open] > summary::before, .ens[open] > summary::before { transform: rotate(45deg); }
.how-body { color: var(--muted); font-size: 0.875rem; max-width: 62ch; }
.how-body p { margin: 0 0 8px; }

/* ---------- minute chart ---------- */
.chart { margin: 8px 0; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-size: 12px; fill: var(--muted); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .band { stroke: var(--bar-iqr); stroke-dasharray: 3 3; stroke-width: 1; opacity: 0.6; }
.chart .chance { fill: var(--chance); stroke: var(--chance-edge); stroke-width: 1; }
.chart .rateband { fill: var(--rateband); }
.chart .rate { fill: none; stroke: var(--rate); stroke-width: 2; }
.chart figcaption { font-size: 0.8125rem; color: var(--muted); line-height: 1.6; }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin: 0 4px 0 0; vertical-align: -1px; }
.key.chance { background: var(--chance); border: 1px solid var(--chance-edge); }
.key.rate { background: var(--rate); height: 3px; vertical-align: 3px; }
.key.radar { background: var(--radar); }
figcaption .nw { margin-right: 8px; }

/* ---------- hours ---------- */
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.hours { list-style: none; padding: 0; margin: 4px 0 0; }
.dayhead { font-weight: 700; font-size: 1rem; padding: 14px 0 4px; border-bottom: 1px solid var(--line); }
.hour { border-bottom: 1px solid var(--line); }
.hour summary, .hourcols {
  display: grid; grid-template-columns: 4.3rem 24px 5.6rem minmax(0, 1fr) 4.4rem 16px; gap: 8px; align-items: center;
}
.hour summary { padding: 6px 0; min-height: 48px; cursor: pointer; list-style: none; border-radius: 6px; }
.hour summary:hover { background: var(--chip); }
.hour summary::-webkit-details-marker { display: none; }
.hourcols { font-size: 0.75rem; color: var(--muted); margin-top: 10px; }
.hourcols span:nth-child(5) { text-align: right; }
.hour .time { font-variant-numeric: tabular-nums; font-size: 0.9375rem; }
.hour .temp { font-variant-numeric: tabular-nums; display: flex; flex-direction: column; gap: 3px; }
.hour .rain { font-size: 0.9375rem; line-height: 1.3; min-width: 0; }
.hour .rain .range { display: block; }
.hour.wet .rain, .hour.wet .glyph { color: var(--wet); }
.hour.wintry .rain, .hour.wintry .glyph { color: var(--wintry); }
.hour.wintry .rain { font-weight: 600; }
.hour .windc { text-align: right; font-size: 0.9375rem; font-variant-numeric: tabular-nums; line-height: 1.3; }
.hour .windc .range { display: block; }
.glyph { display: flex; justify-content: center; }
.chev { width: 16px; height: 16px; color: var(--muted); transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
.hour details[open] .chev { transform: rotate(90deg); }
.tbar { position: relative; height: 6px; display: block; width: 100%; }
.tbar .full { position: absolute; top: 2px; height: 2px; background: var(--bar); border-radius: 1px; }
.tbar .iqr { position: absolute; top: 0; height: 6px; background: var(--bar-iqr); border-radius: 2px; }
.tbar .med { position: absolute; top: -1px; width: 2px; height: 8px; background: var(--text); }
.detail { padding: 2px 0 12px; }
.detail .sub { margin: 2px 0; }

.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
table { border-collapse: collapse; font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
th, td { padding: 4px 7px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child { text-align: left; }
.ref { color: var(--muted); font-style: italic; }
table.srcs td, table.srcs th { text-align: left; white-space: normal; vertical-align: top; }

/* ---------- frost and snow ---------- */
.nights li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.night.lvl1 .level, .night.lvl2 .level { color: var(--wintry); font-weight: 600; }
.night.lvl3 .level, .night.lvl4 .level { color: var(--wintry); font-weight: 700; }
li.snow { padding: 8px 0; border-bottom: 1px solid var(--line); }
li.snow summary { cursor: pointer; padding: 10px 0; }

/* ---------- days ---------- */
.days li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.dayrow, .daycols { display: grid; grid-template-columns: 6rem 24px 3.2rem 2.6rem minmax(0, 1fr) 2.6rem; gap: 8px; align-items: center; }
.daycols { font-size: 0.75rem; color: var(--muted); margin-bottom: -2px; }
.daycols span:nth-child(4), .daycols span:nth-child(6) { text-align: right; }
.dname { font-weight: 650; }
.rainc { color: var(--wet); font-variant-numeric: tabular-nums; font-weight: 600; }
.lo, .hi { font-variant-numeric: tabular-nums; text-align: right; }
.lo { color: var(--muted); }
.hlbar { position: relative; height: 6px; background: var(--bar); border-radius: 3px; }
.hlbar span { position: absolute; top: 0; height: 6px; border-radius: 3px; background: var(--hl); }
.timing { color: var(--wet); }
.day > .sub { margin-top: 4px; }
.ens summary { cursor: pointer; width: fit-content; min-height: 44px; display: flex; align-items: center; }
.ens p { margin: 0 0 4px; }

/* ---------- alerts, NWS text ---------- */
.alert { background: var(--alert); border-radius: 12px; padding: 10px 14px; margin: 14px 0; border: 1px solid var(--line); }
.alert.winter { background: var(--alert-winter); }
.alert summary { cursor: pointer; padding: 6px 0; }
.periods li { border-bottom: 1px solid var(--line); }
.periods summary { cursor: pointer; padding: 11px 0; }
.periods p { margin: 0 0 10px; }

/* ---------- map ---------- */
.mapwrap { position: relative; margin: 10px 0 6px; }
#map { height: 420px; border-radius: 12px; z-index: 0; }
.map-hint {
  position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 500; margin: 0; pointer-events: none;
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
  font-size: 0.8125rem; white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}
.map-hint[hidden] { display: none; }
.radar-key { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 0.8125rem; }
.radar-key .src { margin: 0; }
.radar-key .sw { display: inline-flex; align-items: center; gap: 6px; }
.wind-key { margin-top: 4px; }
.windramp { display: inline-flex; flex-direction: column; gap: 2px; width: 186px; }
.windramp .bar { display: block; width: 160px; height: 7px; border-radius: 3px; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.25); }
.windramp .ticks { display: flex; font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.windramp .ticks span { flex: 0 0 40px; }
.windramp .ticks span:last-child { flex: none; }
.swatch { display: inline-block; width: 28px; height: 10px; border-radius: 3px; opacity: 0.85; }
.maptools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 6px 0; }
.maptools label { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
.maptools input[type=range] { flex: 1 1 120px; min-width: 0; min-height: 32px; }
.maptools select { max-width: 100%; }
@media (prefers-color-scheme: dark) {
  #map .leaflet-tile-pane .leaflet-layer:first-child { filter: brightness(0.7) contrast(1.1) saturate(0.6); }
  .cloud-field { opacity: 0.8; }
}
.flow-canvas { pointer-events: none; }

.settings { margin-top: 12px; }
.settings > summary { cursor: pointer; padding: 11px 0; }
.settings .row { display: flex; gap: 6px; }
.settings input { flex: 1; min-width: 0; }
footer { max-width: 760px; margin: 0 auto; padding: 0 12px 32px; }

/* ---------- touch screens: 44 px targets ---------- */
@media (pointer: coarse) {
  button, select, input[type=url] { min-height: 44px; }
  .maptools label { min-height: 44px; }
  .maptools input[type=range] { min-height: 44px; }
  input[type=checkbox] { width: 20px; height: 20px; }
}

/* ---------- phones ---------- */
@media (max-width: 520px) {
  main { padding: 0 10px 20px; }
  .card { padding: 14px 12px; border-radius: 12px; }
  .top { gap: 8px; padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .avatar { width: 34px; height: 34px; }
  h1 { font-size: 1rem; }
  .controls select { max-width: 8.75rem; }
  #refresh .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  #refresh { padding: 0; width: 44px; justify-content: center; }
  .big { font-size: 3rem; }
  #map { height: 320px; }
  .crow { width: 64px; height: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .chev, details.how > summary::before { transition: none; }
}

/* ---------- narrow panels (phones, and the slimmer dashboard panels) ---------- */
@container (max-width: 560px) {
  .hour summary, .hourcols { grid-template-columns: 4.1rem 22px 3rem minmax(0, 1fr) 3.3rem 14px; gap: 6px; }
  .hour .time, .hour .rain, .hour .windc { font-size: 0.875rem; }
  .dayrow, .daycols { grid-template-columns: 5.4rem 22px 2.8rem 2.3rem minmax(0, 1fr) 2.3rem; gap: 6px; }
}
.hourcols.wide, .gw-hide { display: none; }

/* Panels that exist only on the dashboard. */
.tonight, .strip, .hdr-alerts, .csrc { display: none; }
.hdr-alerts { margin: 0; font-size: 0.8125rem; color: var(--muted); white-space: nowrap; }

/* ---------- the dashboard (1024 px and wider) ----------
   Spatial thesis: a console. Left rail = the three answers (now, next 2 hours, tonight), stacked
   in reading order; the live map fills the rest of the first screen. Below: the 48 hours as one
   wide strip and a dense table, then frost, days and the forecaster side by side; sources last.
   Rhythm: 4 px steps; 8–12 inside panels, 16 between them, 24 at the page edge. */
@media (min-width: 1024px) {
  :root { --gutter: 16px; --edge: 24px; }
  .top { padding: 8px var(--edge); }
  main.dash {
    max-width: none; padding: var(--gutter) var(--edge) 32px;
    display: grid; grid-template-columns: minmax(300px, 1fr) minmax(0, 1.75fr) minmax(280px, 1fr);
    column-gap: var(--gutter); row-gap: var(--gutter); align-items: stretch;
  }
  main.dash > .card { margin: 0; border-radius: 10px; padding: 14px 16px; }
  main.dash > .card > h2 { font-size: 1.125rem; font-weight: 700; letter-spacing: -0.005em; margin: 0 0 8px; }
  .top h1 { font-size: 1.375rem; }
  /* Alerts take a row only when there is one; "none" moves to the header. */
  #alerts { grid-column: 1 / -1; grid-row: 1; }
  #alerts.none { display: none; }
  #alerts .alert { margin: 0 0 8px; }
  .hdr-alerts { display: block; }
  #now-card { grid-column: 1; grid-row: 2; }
  #minute-card { grid-column: 2; grid-row: 2; }
  #tonight-card { grid-column: 3; grid-row: 2; display: block; }
  #map-card {
    grid-column: 1 / -1; grid-row: 3;
    display: flex; flex-direction: column; height: max(560px, calc(100vh - 96px));
  }
  #map-card > h2 { margin-bottom: 4px; }
  #map-card .mapwrap { flex: 1 1 auto; display: flex; min-height: 360px; margin: 6px 0; }
  #map-card #map { flex: 1 1 auto; height: auto; min-height: 360px; }
  #map-card .maptools { margin: 0; }
  #map-card .mapbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; }
  #map-card .mapbar .maptools:last-child { flex: 1 1 360px; }
  #map-card .keys { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 28px; }
  #map-card .wind-key { margin: 0; }
  #map-card .how { margin-top: 0; }
  #hourly-card { grid-column: 1 / -1; grid-row: 4; }
  #winter-card { grid-column: 1; grid-row: 5; }
  #daily-card { grid-column: 2; grid-row: 5; }
  #text-card { grid-column: 3; grid-row: 5; }
  #sources-card { grid-column: 1 / -1; grid-row: 6; }
  footer { max-width: none; padding: 0 var(--edge) 32px; }

  /* The hero: one big temperature, the rest quieter beside it. */
  #now-body { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 18px; align-items: center; }
  #now-body .big { grid-column: 1; grid-row: 1 / span 3; font-size: 4.75rem; }
  #now-body .cond { grid-column: 2; grid-row: 1; margin: 0; }
  #now-body .feels { grid-column: 2; grid-row: 2; margin: 2px 0; font-size: 0.9375rem; }
  #now-body .wind { grid-column: 2; grid-row: 3; margin: 0; font-size: 0.9375rem; }
  #now-body .tsrc { grid-column: 1 / -1; grid-row: 4; margin: 10px 0 0; }
  #now-body .wsrc { grid-column: 1 / -1; grid-row: 5; margin: 2px 0 0; }
  #now-body .warn { grid-column: 1 / -1; }
  #now-body .feels .sep { display: none; }
  #now-body .feels .nw { display: block; }
  #now-body .feels .nw:first-child::first-letter { text-transform: uppercase; }
  #now-body .cond .src { display: none; }
  #now-body .csrc { display: block; grid-column: 1 / -1; grid-row: 6; margin: 2px 0 0; }

  #minute-card .headline { font-size: 1.375rem; }
  #minute-card .chart { margin: 4px 0; }

  /* Tonight: the low, the frost level, snow. */
  .tn-row { display: flex; align-items: center; gap: 16px; }
  .tn-low { font-size: 3rem; font-weight: 300; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
  .tn-low .unit { font-size: 1rem; color: var(--muted); margin-left: 2px; }
  .tn-level { font-weight: 700; margin: 0; }
  .tn-level.lvl1, .tn-level.lvl2, .tn-level.lvl3, .tn-level.lvl4 { color: var(--wintry); }
  .tn-row .sub { margin: 2px 0 0; }
  .tn-snow { margin: 10px 0 4px; }
  .tonight .src { margin: 0; }
  .tn-next { margin: 0 0 8px; border-top: 1px solid var(--line); }
  .tn-next li { display: grid; grid-template-columns: 1fr 3rem 1fr; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 0.875rem; }
  .tn-next .num { text-align: right; font-variant-numeric: tabular-nums; }
  .tn-next .lvl0 { color: var(--muted); }
  .tn-next .lvl1, .tn-next .lvl2, .tn-next .lvl3, .tn-next .lvl4 { color: var(--wintry); font-weight: 600; }
  #tonight-card { display: flex; flex-direction: column; }
  #tonight-body { display: flex; flex-direction: column; flex: 1; }
  #tonight-body > .src { margin-top: auto; }
  @media (pointer: fine) { .ens summary { min-height: 30px; } .days li { padding: 8px 0; } }

  /* 48 hours: a wide strip, then a dense table that scrolls inside its panel. */
  .strip { display: block; margin: 8px 0 4px; }
  .strip svg { width: 100%; height: auto; display: block; overflow: visible; }
  .strip text { font-size: 12px; fill: var(--muted); font-variant-numeric: tabular-nums; }
  .strip .grid { stroke: var(--line); }
  .strip .day { stroke: var(--bar-iqr); stroke-width: 1; opacity: 0.5; }
  .strip .dayl { fill: var(--text); font-weight: 650; }
  .strip .base { stroke: var(--line); }
  .strip .tband { fill: var(--rateband); }
  .strip .tline { fill: none; stroke: var(--text); stroke-width: 2; stroke-linejoin: round; }
  .strip .freeze { stroke: var(--wintry); stroke-dasharray: 4 3; }
  .strip .freeze-l { fill: var(--wintry); }
  .strip .bar { fill: var(--wet); }
  .strip .bar.wintry { fill: var(--wintry); }
  .strip figcaption { font-size: 0.8125rem; color: var(--muted); }
  .key.tl { background: var(--text); height: 3px; vertical-align: 3px; }
  .key.tb { background: var(--rateband); }
  .key.rb { background: var(--wet); }
  #hourly-card ul.hours { max-height: 30rem; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--line); scrollbar-gutter: stable; }
  #hourly-card .dayhead { position: sticky; top: 0; z-index: 1; background: var(--card); padding-top: 8px; }

  @media (pointer: fine) { details.how > summary { min-height: 32px; } }
}

/* The hour table at full width: every value in its own aligned column. */
@container (min-width: 820px) {
  .hourcols.narrow { display: none; }
  .hourcols.wide { display: grid; }
  .hourcols.wide span:nth-child(5) { text-align: left; }
  .hour summary, .hourcols.wide {
    grid-template-columns: 5.5rem 26px 3.5rem minmax(140px, 1.3fr) minmax(9rem, 1fr) 4.5rem 9rem 6rem 4rem 16px; column-gap: 12px;
  }
  .hour summary { min-height: 38px; padding: 4px 0; }
  .hour .temp, .hour .rain, .hour .windc { display: contents; }
  .hour .tv, .hour .rc, .hour .ra, .hour .wv, .hour .gust, .hourcols .num { text-align: right; font-variant-numeric: tabular-nums; }
  .hour .rain .range { display: block; font-size: 0.875rem; }
  .hour .paren, .hour .gw { display: none; }
  .hour .gust { display: block; color: var(--muted); font-size: 0.875rem; }
  .hour .tbar { align-self: center; }
  .hour .rl { overflow: hidden; text-overflow: ellipsis; }
}

/* Leaflet's own surfaces in the page's palette. */
#map .leaflet-control-attribution { background: var(--card); color: var(--muted); opacity: 0.94; }
#map .leaflet-control-attribution a { color: var(--accent-ink); }
#map .leaflet-bar a { background: var(--card); color: var(--text); border-color: var(--line); }
