/* dashboard -- the Regional Dashboard (WeatherD / weatherd.html) in either house look.
 *
 * Served by the weather-data plane at https://weather-data.legal2carry.workers.dev/dashboard.css.
 * Load order on the dashboard pages: theme sheet (chart.css for DAW, vitals.css for RMW) THEN this file, both
 * last in <head>. This file reads only the shared tokens (--chart-*, --wx-*) and the --db-* chrome tokens that each
 * theme sheet defines, so one stylesheet serves both looks. Fail-soft: unreachable = the page's own light-blue look.
 *
 * The dashboard is a TV/kiosk carousel, so type stays large and spacing generous; this only re-skins colour,
 * borders, corners and chrome. Maps: Local/Regional/Road/Lake use light bases; the Wind page stays a dark map
 * (particles need it) with paper-coloured controls.
 */
@import url('https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;600;700;800&family=Libre+Baskerville:ital@0;1&display=swap');

html, body { background: var(--chart-land, #f1e7c8); font-family: var(--wx-font, 'Segoe UI', Arial, sans-serif); font-variant-numeric: tabular-nums; }

/* ── Chrome: top bar, page tabs, progress, dots ── */
#top-nav { background: var(--db-bar-bg, #1d3d5c); border-bottom: 3px solid var(--chart-ink, #1d3d5c); box-shadow: none; }
#tnav-home, #tnav-back, #tnav-fwd { color: var(--db-bar-fg, #f1e7c8); }
#tnav-home:hover, #tnav-home:active, #tnav-back:active, #tnav-fwd:active { color: var(--db-bar-fg, #f1e7c8); opacity: 0.8; }
#tnav-back.tnav-end, #tnav-fwd.tnav-end { color: var(--db-bar-dim, #b9cbd8); opacity: 0.4; }
.tnp { color: var(--db-bar-dim, #b9cbd8); }
.tnp + .tnp::before { color: var(--db-bar-dim, #b9cbd8); opacity: 0.5; }
.tnp.active, .tnp:hover:not(.active) { color: var(--db-bar-fg, #f1e7c8); }
.tnp.active { text-decoration: underline; text-decoration-color: var(--chart-mag, #a8285f); text-decoration-thickness: 2px; text-underline-offset: 5px; }
#progress-bar, #progress-bar-3, [id^="progress-bar"] { background: var(--chart-mag, #a8285f); box-shadow: none; }
#dots .dot { background: transparent; border: 2px solid var(--chart-ink, #1d3d5c); }
#dots .dot.active { background: var(--chart-ink, #1d3d5c); box-shadow: none; }
#nav-hint { color: var(--wx-text-dim, #35526b); }
#nav-hint:hover { color: var(--wx-text, #16324d); }
#whats-new-btn { background: transparent; border: 1.5px solid var(--db-bar-dim, #b9cbd8); color: var(--db-bar-fg, #f1e7c8); border-radius: 0; }
#whats-new-btn:hover, #whats-new-btn.active { background: rgba(255,255,255,0.12); border-color: var(--db-bar-fg, #f1e7c8); }

/* ── Page title band ── */
.wx-head { background: var(--db-band-bg, #f8f2dd); border-bottom: 2px solid var(--db-band-border, #1d3d5c); }
.wx-head h1 { color: var(--db-band-fg, #0f2740); font-family: var(--db-title-font, 'Libre Baskerville', Georgia, serif);
  font-style: var(--db-title-style, italic); font-weight: var(--db-title-weight, 400); text-transform: var(--db-title-case, none);
  letter-spacing: var(--db-title-ls, 0); text-shadow: none; }
.wx-head .subtitle { color: var(--db-band-fg, #0f2740); opacity: 0.85; }
.wx-head .subtitle b { color: var(--db-band-fg, #0f2740); }

/* ── Page grounds ── */
#phase1 { background: var(--chart-land, #f1e7c8); }
#phase2, #phase3 { background: var(--chart-land, #f1e7c8); }
#phase4 { background: var(--chart-shoal, #cfe3ea); }
.leaflet-container { background: var(--chart-shoal, #cfe3ea); }

/* ── Local page: station cards as flowsheet panels ── */
.stn-card { background: var(--chart-land-2, #f8f2dd); border: 2px solid var(--chart-ink, #1d3d5c); border-radius: 3px; box-shadow: none; }
.stn-card::before, .stn-card.primary::before { height: 6px; background: var(--chart-ink, #1d3d5c); }
.stn-card.primary::before { background: var(--chart-mag, #a8285f); }
.stn-name, .popup-fc-day, .fc-day { color: var(--chart-ink-2, #0f2740); }
.stn-id { color: var(--wx-text-dim, #35526b); font-family: var(--wx-font, sans-serif); }
.stn-age, .stn-feels, .fc-desc, .stn-cell .lbl, .stn-cell .val small, .popup-fc-desc { color: var(--wx-text-dim, #35526b); }
.stn-badge { color: var(--chart-mag, #a8285f); border-color: var(--chart-mag, #a8285f); border-radius: 0; }
.stn-wind-lbl { color: var(--chart-ink, #1d3d5c); }
.stn-cond { color: var(--wx-text, #16324d); }
.stn-temp.cold, .wx-temp.cold { color: #0b5a8a; } .stn-temp.cool, .wx-temp.cool { color: #0a6d86; }
.stn-temp.warm, .wx-temp.warm { color: #b23a00; } .stn-temp.hot, .wx-temp.hot { color: #a3231b; }
.stn-temp.na, .wx-temp.na { color: var(--wx-text-dim, #35526b); }
.stn-grid { background: var(--chart-ink, #1d3d5c); border: 1px solid var(--chart-ink, #1d3d5c); border-radius: 0; gap: 1px; }
.stn-cell { background: var(--chart-land-2, #f8f2dd); }
.stn-cell .val { color: var(--chart-ink-2, #0f2740); }
.fc-card { background: var(--chart-land-2, #f8f2dd); border: 2px solid var(--chart-ink, #1d3d5c); border-radius: 3px; box-shadow: none; }
.fc-hi { color: #b23a00; } .fc-lo { color: #0b5a8a; }
.stn-emoji, .fc-emoji, .popup-fc-emoji { line-height: 0; display: flex; align-items: center; justify-content: center; }
.stn-emoji .wx-ico { width: clamp(2.6rem, 5vw, 4.4rem); height: clamp(2.6rem, 5vw, 4.4rem); }
.fc-emoji .wx-ico { width: clamp(2.2rem, 3.8vw, 3.6rem); height: clamp(2.2rem, 3.8vw, 3.6rem); }
.popup-fc-emoji .wx-ico { width: 2rem; height: 2rem; }

/* ── Drawn icons ── */
.wx-ico { display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--chart-ink-2, #0f2740); }
.wx-ico .wx-fill { fill: var(--chart-land-2, #f8f2dd); } .wx-ico .wx-solid { fill: currentColor; stroke: none; }
.cam-icon svg { width: 1.1em; height: 1.1em; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Alerts ticker ── */
#crawler { background: var(--db-bar-bg, #1d3d5c); border-top: 3px solid var(--chart-ink, #1d3d5c); }
.cr-badge { border-radius: 0; }
.stn-alert-warning { border-radius: 0; background: #f6d9d4; border-color: #a3231b; color: #6d130d; }
.stn-alert-watch { border-radius: 0; background: #f7e3bf; border-color: #8a5200; color: #5a3600; }
.stn-alert-advisory { border-radius: 0; background: #f4eab8; border-color: #7a5a00; color: #4d3a00; }
.stn-alert-none { border-radius: 0; background: #dcebd9; border-color: #2e6b32; color: #1f5a23; }

/* ── Map bubbles, labels, legends, controls ── */
.wx-circle { background: var(--chart-land-2, #f8f2dd); border: 2.5px solid var(--chart-ink, #1d3d5c); box-shadow: none; }
.wx-circle.sz-primary { border-color: var(--chart-mag, #a8285f); box-shadow: none; background: var(--chart-land-2, #f8f2dd); }
.wx-circle.stale { background: #e4e4de; border-color: #6a6a66; }
.wx-circle .wx-ico { width: 1.15em; height: 1.15em; margin: 0 auto; }
.wx-id { color: var(--wx-text-dim, #35526b); font-family: var(--wx-font, sans-serif); }
.wx-name-label, .cam-lbl, .rwis-name-label { color: var(--chart-ink-2, #0f2740); background: var(--chart-land-2, #f8f2dd); box-shadow: none; border: 1px solid var(--chart-ink, #1d3d5c); border-radius: 0; }
.wx-wind-label { color: #1f5a23; background: var(--chart-land-2, #f8f2dd); } .wx-humid-label { color: #0a5a6e; background: var(--chart-land-2, #f8f2dd); }
.wx-windarrow-inline { color: #1f5a23; }
.road-legend, #wind-legend, .lk-stat, #lake-fcast-panel, #lake-fcast-btn, #lake-ice-btn, #lake-depth-btn {
  background: rgba(248,242,221,0.96); border: 2px solid var(--chart-ink, #1d3d5c); color: var(--chart-ink-2, #0f2740); box-shadow: none; border-radius: 0; }
.road-legend b, #wind-legend b { color: var(--chart-ink-2, #0f2740); }
#lake-ice-btn.active, #lake-depth-btn.active { background: var(--chart-ink, #1d3d5c); color: var(--chart-land, #f1e7c8); }
#wind-legend-lbls, #lake-fcast-text, #lake-fcast-hdr { color: var(--chart-ink-2, #0f2740); }
#lake-fcast-close { color: var(--wx-text-dim, #35526b); }
.lk-lbl, .lk-sub, .lk-flat { color: var(--wx-text-dim, #35526b); } .lk-val { color: var(--chart-ink-2, #0f2740); }
.lk-up { color: #a3231b; } .lk-down { color: #0b5a8a; }
.buoy-circle { background: var(--chart-land-2, #f8f2dd); border: 2.5px solid var(--chart-ink, #1d3d5c); box-shadow: none; }
.buoy-circle.offline { background: #e4e4de; border-color: #6a6a66; }
.buoy-temp { color: var(--chart-ink-2, #0f2740); } .buoy-wave, .buoy-id { color: var(--wx-text-dim, #35526b); }
.buoy-circle.offline .buoy-temp, .buoy-circle.offline .buoy-wave { color: #55554f; }
.buoy-name { background: var(--chart-land-2, #f8f2dd); color: var(--chart-ink-2, #0f2740); border: 1px solid var(--chart-ink, #1d3d5c); }
.gauge-box { background: #dcebe6; border: 2px solid var(--chart-ink, #1d3d5c); } .gauge-temp { color: var(--chart-ink-2, #0f2740); } .gauge-lbl { color: var(--wx-text-dim, #35526b); }
.leaflet-control-zoom a { background: var(--chart-land-2, #f8f2dd) !important; color: var(--chart-ink, #1d3d5c) !important; border-color: var(--chart-ink, #1d3d5c) !important; }
.leaflet-control-attribution { background: rgba(248,242,221,0.88) !important; color: var(--wx-text-dim, #35526b) !important; }

/* ── Station popup + What's New panel ── */
#stn-popup-overlay { background: rgba(15,39,64,0.55); }
#stn-popup { background: var(--chart-land-2, #f8f2dd); border: 2px solid var(--chart-ink, #1d3d5c); border-radius: 3px; box-shadow: none; }
#stn-popup::before { background: var(--chart-ink, #1d3d5c); }
.popup-fc-card { background: var(--chart-shoal, #cfe3ea); border: 1px solid var(--chart-ink, #1d3d5c); border-radius: 0; }
#whats-new-panel { background: var(--chart-land-2, #f8f2dd); border: 2px solid var(--chart-ink, #1d3d5c); box-shadow: none; }
.wn-head, .wn-section-title, .wn-title { color: var(--chart-ink-2, #0f2740); }
.wn-help-list, .wn-help-list b, .wn-desc { color: var(--wx-text, #16324d); } .wn-date { color: var(--wx-text-dim, #35526b); }
.wn-entry { border-top: 1px solid #b9c4cb; } #whats-new-close { color: var(--wx-text-dim, #35526b); }

/* Station cell grid: flat paper cells (the old page used a blue gradient) */
.stn-cell { background-image: none; }
/* Wind page keeps a dark ground: the particle layer needs it */
#phase5 { background: #0b1020; }
#wind-map.leaflet-container { background: #0b1020; }

/* Page-1 rules in the dashboard are id-scoped (#phase1 ...), so match their specificity */
#phase1 .stn-cell { background: var(--chart-land-2, #f8f2dd); }
#phase1 .stn-grid { border-radius: 0; }
#phase1 .fc-card:first-child { border-color: var(--chart-mag, #a8285f); border-width: 2px; box-shadow: none; }

/* Phone floor for the dashboard's small labels */
@media (max-width: 700px) {
  #phase1 .stn-cell .lbl, #phase1 .stn-xlbl, .stn-cell .lbl { font-size: 10.5px; }
  .stn-badge, .stn-age, .stn-wind-lbl, .lk-lbl, .stn-cell .val small { font-size: 10.5px; }
}

/* Radar maps: a mid-grey base (not the pale one) so faint echoes such as snow stay visible. Only the base tiles are dimmed; labels, bubbles and the radar layers are not. */
#radar-map .leaflet-tile[src*="World_Light_Gray_Base"], #main-map .leaflet-tile[src*="World_Light_Gray_Base"], .cmp-map .leaflet-tile[src*="World_Light_Gray_Base"],
#phase2 .leaflet-tile[src*="World_Light_Gray_Base"], #phase3 .leaflet-tile[src*="World_Light_Gray_Base"] { filter: brightness(0.68) contrast(1.12); }
#radar-map.leaflet-container, #main-map.leaflet-container, .cmp-map.leaflet-container { background: #8e9499; }

/* Regional map legend: paper panel, ink title (its title used the panel token as a text colour, which is light in these looks) */
.map-legend { background: rgba(248,242,221,0.96); border: 2px solid var(--chart-ink, #1d3d5c); border-radius: 0; box-shadow: none; color: var(--chart-ink-2, #0f2740); }
.map-legend b { color: var(--chart-ink-2, #0f2740); }

/* Popup temperature graph in the site's colours */
.tg-head, .tg-cap { color: var(--wx-text-dim, #35526b); }
.tg-grid { stroke: var(--wx-border-soft, #9fb3c2); }
.tg-obs { stroke: var(--chart-ink-2, #0f2740); } .tg-fc { stroke: var(--chart-ink, #1d3d5c); }
.tg-now { stroke: var(--chart-mag, #a8285f); } .tg-dot { fill: var(--chart-mag, #a8285f); stroke: var(--chart-land-2, #f8f2dd); }
.tg-txt { fill: var(--wx-text-dim, #35526b); }

/* Local page card graph in the site's colours */
.stn-graph .tg-head, .stn-graph .tg-cap { color: var(--wx-text-dim, #35526b); }
.stn-graph .tg-grid { stroke: var(--wx-border-soft, #9fb3c2); }
.stn-graph .tg-obs { stroke: var(--chart-ink-2, #0f2740); } .stn-graph .tg-fc { stroke: var(--chart-ink, #1d3d5c); }
.stn-graph .tg-now { stroke: var(--chart-mag, #a8285f); } .stn-graph .tg-dot { fill: var(--chart-mag, #a8285f); stroke: var(--chart-land-2, #f8f2dd); stroke-width: 2; }
.stn-graph .tg-txt { fill: var(--wx-text-dim, #35526b); }
