/* Playa Weather — phone-first, high-contrast, goggle-readable. */

:root {
  --bg:        #0d0906;
  --bg-card:   #171008;
  --bg-raised: #241a0f;
  --line:      #3a2a18;
  --text:      #f6ecdd;
  --text-dim:  #b39c7e;
  --text-mute: #7d6a53;
  --accent:    #ff9d2e;
  --accent-2:  #ffd08a;
  --good:      #58c07a;
  --warn:      #ffc043;
  --alert:     #ff8a3d;
  --danger:    #ff4d3d;
  --shadow:    0 1px 0 rgba(255,255,255,.04) inset;
  --radius:    16px;

  /* Severity ramps. Redefined for night mode so nothing leaks blue-white light. */
  --risk-calm:     #58c07a;
  --risk-dusty:    #a8c862;
  --risk-gusty:    #ffc043;
  --risk-whiteout: #ff8a3d;
  --risk-severe:   #ff4d3d;
  --aqi-good:      #58c07a;
  --aqi-moderate:  #ffc043;
  --aqi-usg:       #ff8a3d;
  --aqi-unhealthy: #ff4d3d;
  --aqi-very:      #c451d6;
  --aqi-hazard:    #a3423c;
}

/* Red night-vision mode: no blue or white light, preserves dark adaptation. */
html[data-theme-active="night"] {
  --bg:        #000000;
  --bg-card:   #0e0201;
  --bg-raised: #1a0503;
  --line:      #3d0d07;
  --text:      #ff5436;
  --text-dim:  #b8321c;
  --text-mute: #7a1f11;
  --accent:    #ff3b1f;
  --accent-2:  #ff7053;
  --good:      #c23a20;
  --warn:      #e8452a;
  --alert:     #ff4a28;
  --danger:    #ff6a4a;

  /* Severity still has to read as severity, so the ramp climbs in brightness
     within the red band rather than changing hue. */
  --risk-calm:     #6b1a0e;
  --risk-dusty:    #93250f;
  --risk-gusty:    #bf3117;
  --risk-whiteout: #e5411f;
  --risk-severe:   #ff5436;
  --aqi-good:      #6b1a0e;
  --aqi-moderate:  #93250f;
  --aqi-usg:       #bf3117;
  --aqi-unhealthy: #e5411f;
  --aqi-very:      #ff5436;
  --aqi-hazard:    #ff7a5c;
}
html[data-theme-active="night"] img { filter: saturate(.3) hue-rotate(-15deg) brightness(.8); }

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: contain;
}
body { padding-bottom: env(safe-area-inset-bottom); }

main { padding: 0 14px 40px; max-width: 640px; margin: 0 auto; }

h1 { font-size: 1.15rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; margin: 0; }
h2 { font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
     color: var(--text-dim); margin: 0 0 12px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 12px) 14px 10px;
  background: linear-gradient(var(--bg) 72%, transparent);
  max-width: 640px; margin: 0 auto;
}
.topbar-left { min-width: 0; flex: 1 1 auto; }
.topbar-left h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { flex: none; }
.coords { margin: 2px 0 0; font-size: .78rem; color: var(--text-mute); font-variant-numeric: tabular-nums; }
.mode-btn {
  width: 48px; height: 48px; flex: none;
  border-radius: 50%; border: 1px solid var(--line);
  background: var(--bg-raised); color: var(--accent);
  font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.mode-btn:active { transform: scale(.94); }

/* ---------- staleness ---------- */
.staleness {
  display: flex; align-items: center; gap: 8px;
  max-width: 640px; margin: 0 auto 14px; padding: 8px 14px;
  font-size: .78rem; color: var(--text-dim);
}
.staleness .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-mute); flex: none; }
.staleness[data-state="fresh"] .dot { background: var(--good); }
.staleness[data-state="stale"] .dot { background: var(--warn); }
.staleness[data-state="offline"] .dot { background: var(--danger); }
.staleness[data-state="loading"] .dot { background: var(--accent); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.refresh {
  margin-left: auto; background: var(--bg-raised); color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; font-size: .75rem; font-weight: 600; cursor: pointer;
}

/* ---------- cards ---------- */
.card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
  box-shadow: var(--shadow);
}

/* ---------- alerts ---------- */
.alerts { margin-bottom: 12px; }
.alert-item {
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 8px;
  border: 1px solid var(--danger);
  background: color-mix(in srgb, var(--danger) 14%, var(--bg-card));
}
.alert-item[data-sev="moderate"] { border-color: var(--warn);
  background: color-mix(in srgb, var(--warn) 12%, var(--bg-card)); }
.alert-title { font-weight: 800; font-size: .95rem; margin: 0 0 4px; }
.alert-body { margin: 0; font-size: .82rem; color: var(--text-dim); line-height: 1.45; }

/* ---------- hero ---------- */
.hero { padding: 20px 16px; }
.hero-main { display: flex; align-items: center; gap: 18px; }
.hero-temp { font-size: 4.6rem; font-weight: 800; line-height: .9; letter-spacing: -.03em;
             font-variant-numeric: tabular-nums; }
.hero-temp .deg { font-size: 2.4rem; color: var(--text-dim); vertical-align: top; }
.hero-meta { flex: 1; min-width: 0; }
.hero-cond { font-size: 1.02rem; font-weight: 700; margin-bottom: 4px; }
.hero-feels, .hero-range { font-size: .85rem; color: var(--text-dim); }
.hero-range { margin-top: 4px; font-variant-numeric: tabular-nums; }
.swing { color: var(--accent); font-weight: 700; margin-left: 6px; }

/* ---------- risk meter ---------- */
.risk-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.risk-head h2 { margin: 0; }
.risk-badge {
  font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px; border: 1px solid currentColor;
}
.risk-meter { height: 12px; border-radius: 999px; background: var(--bg-raised); overflow: hidden; }
.risk-fill { height: 100%; width: 0; border-radius: 999px; transition: width .5s ease, background .5s ease; }
.risk-advice { font-size: .92rem; line-height: 1.45; margin: 12px 0 0; font-weight: 600; }
.risk-why { margin-top: 10px; }
.risk-why summary { font-size: .75rem; color: var(--text-mute); cursor: pointer; }
.risk-why ul { margin: 8px 0 0; padding-left: 18px; font-size: .78rem; color: var(--text-dim); line-height: 1.6; }

/* ---------- gear ---------- */
.gear-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.gear-list li { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; line-height: 1.4; }
.gear-list .g-icon { font-size: 1.1rem; flex: none; width: 24px; text-align: center; }
.gear-list .g-sub { display: block; font-size: .76rem; color: var(--text-mute); margin-top: 2px; }

/* ---------- hydration ---------- */
.hyd-main { font-size: 2.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.hyd-unit { font-size: .82rem; font-weight: 600; color: var(--text-dim); }
.hyd-note { font-size: .8rem; color: var(--text-dim); margin: 6px 0 0; line-height: 1.45; }

/* ---------- conditions grid ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.tile {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px 14px; min-height: 86px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.tile-label { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-mute); }
.tile-value { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile-value .u { font-size: .8rem; font-weight: 600; color: var(--text-dim); margin-left: 2px; }
.tile-sub { font-size: .74rem; color: var(--text-dim); }

/* ---------- countdowns ---------- */
.cd-strip { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.cd-strip::-webkit-scrollbar { display: none; }
.cd-item {
  flex: none; min-width: 108px; background: var(--bg-raised);
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px;
}
.cd-item[data-now="true"] { border-color: var(--accent); }
.cd-val { font-size: 1.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.cd-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-mute); margin-top: 3px; }

/* ---------- hourly ---------- */
.hourly-scroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
                 -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.hourly-scroll::-webkit-scrollbar { display: none; }
.hour {
  flex: none; width: 66px; text-align: center; padding: 10px 4px;
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: 12px;
}
.hour-t { font-size: .68rem; color: var(--text-mute); }
.hour-temp { font-size: 1.1rem; font-weight: 800; margin: 5px 0; font-variant-numeric: tabular-nums; }
.hour-wind { font-size: .68rem; color: var(--text-dim); }
.hour-dust { height: 4px; border-radius: 2px; margin-top: 7px; background: var(--line); }

/* ---------- daily ---------- */
.day { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.day:last-child { border-bottom: 0; }
.day-name { width: 46px; font-size: .84rem; font-weight: 700; flex: none; }
.day-bar { flex: 1; height: 7px; border-radius: 999px; background: var(--bg-raised); position: relative; overflow: hidden; }
.day-bar span { position: absolute; top: 0; bottom: 0; border-radius: 999px;
                background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.day-temps { width: 84px; text-align: right; font-size: .84rem; font-variant-numeric: tabular-nums; flex: none; }
.day-temps .lo { color: var(--text-mute); }
.day-wind { width: 54px; text-align: right; font-size: .7rem; color: var(--text-dim); flex: none; }

/* ---------- burn nights ---------- */
.burn-grid { display: flex; flex-direction: column; gap: 10px; }
.burn {
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: 12px; padding: 13px 14px;
}
.burn-name { font-size: .95rem; font-weight: 800; }
.burn-when { font-size: .74rem; color: var(--text-mute); margin-top: 2px; }
.burn-fc { font-size: .84rem; color: var(--text-dim); margin-top: 8px; line-height: 1.5; }

/* ---------- sun & moon ---------- */
.sunmoon { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 10px; }
.sm-item .sm-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-mute); }
.sm-item .sm-val { font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.moon-row { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px;
            border-top: 1px solid var(--line); padding-top: 12px; }
.moon-face { font-size: 2rem; line-height: 1; }

/* ---------- air quality ---------- */
.aq { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.aq-item { background: var(--bg-raised); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; }
.aq-val { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.aq-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-mute); }
.aq-cat { font-size: .72rem; font-weight: 700; margin-top: 3px; }

/* ---------- fires ---------- */
.fire-list { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.fire {
  background: var(--bg-raised); border: 1px solid var(--line);
  border-left: 3px solid var(--alert); border-radius: 12px; padding: 12px 13px;
}
.fire[data-close="true"] { border-left-color: var(--danger); }
.fire-name { font-size: .95rem; font-weight: 800; }
.fire-stats { font-size: .78rem; color: var(--text-dim); margin-top: 5px; line-height: 1.5; }
.fire-dist { font-weight: 700; color: var(--accent); }

/* ---------- roads ---------- */
.road-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.road {
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 13px;
}
.road-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.road-name { font-size: .92rem; font-weight: 800; }
.road-status {
  font-size: .66rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px; border: 1px solid currentColor; flex: none;
}
.road-desc { font-size: .78rem; color: var(--text-dim); margin-top: 6px; line-height: 1.5; }

/* ---------- radio ---------- */
.radio-grid { display: flex; flex-direction: column; gap: 10px; }
.radio-item { display: flex; align-items: baseline; gap: 12px; }
.radio-freq { font-size: 1.35rem; font-weight: 800; color: var(--accent);
              width: 62px; flex: none; font-variant-numeric: tabular-nums; }
.radio-label { font-size: .84rem; color: var(--text-dim); }

/* ---------- misc ---------- */
.link-row { display: flex; flex-wrap: wrap; gap: 8px; }
.link-row a {
  font-size: .76rem; font-weight: 600; text-decoration: none;
  color: var(--accent); background: var(--bg-raised);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 13px;
}
.fineprint { font-size: .74rem; color: var(--text-mute); line-height: 1.5; margin: 10px 0 0; }
.muted { color: var(--text-mute); font-size: .82rem; }
footer { text-align: center; padding: 24px 8px 8px; }
footer p { font-size: .72rem; color: var(--text-mute); line-height: 1.6; margin: 0 0 6px; }

@media (min-width: 520px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .aq { grid-template-columns: repeat(4, 1fr); }
}

/* ================================================================
   Arrival view (index.html)
   ================================================================ */

.viewswap {
  margin-left: auto; align-self: center;
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); text-decoration: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
}

/* --- 1. the verdict ------------------------------------------------ */

.verdict { border-left: 4px solid var(--text-mute); }
.verdict[data-level="good"] { border-left-color: var(--good); }
.verdict[data-level="warn"] { border-left-color: var(--warn); }
.verdict[data-level="bad"]  { border-left-color: var(--danger); }

.verdict-kicker {
  font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-mute); margin: 0 0 6px;
}
.verdict-text { margin: 0; font-size: 1.06rem; line-height: 1.45; font-weight: 600; }
.verdict[data-level="bad"] .verdict-text { color: var(--danger); }

/* --- 2. drive-in days ---------------------------------------------- */

.drive-strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(58px, 1fr);
  gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: 4px; margin-top: 10px;
}
.dd {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 4px 8px; border-radius: 12px; cursor: pointer;
  background: var(--bg-raised); color: var(--text);
  border: 1px solid transparent; font: inherit; text-align: center;
}
.dd[aria-pressed="true"] { border-color: var(--accent); }
.dd-day    { font-size: .74rem; font-weight: 700; }
.dd-date   { font-size: .62rem; color: var(--text-mute); }
.dd-verdict{ font-size: .62rem; font-weight: 800; letter-spacing: .05em; margin-top: 2px; }
.dd-flag   { font-size: .52rem; color: var(--text-mute); line-height: 1.1; }
.dd[data-v="good"]  .dd-verdict { color: var(--good); }
.dd[data-v="ok"]    .dd-verdict { color: var(--warn); }
.dd[data-v="avoid"] .dd-verdict { color: var(--danger); }
.dd[data-v="avoid"] { background: color-mix(in srgb, var(--danger) 14%, var(--bg-raised)); }

.ddd { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--bg-raised); }
.ddd-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ddd-when { font-weight: 700; font-size: .92rem; }
.ddd-verdict { font-size: .72rem; font-weight: 800; letter-spacing: .06em; }
.ddd[data-v="good"]  .ddd-verdict { color: var(--good); }
.ddd[data-v="ok"]    .ddd-verdict { color: var(--warn); }
.ddd[data-v="avoid"] .ddd-verdict { color: var(--danger); }
.ddd-reasons { margin: 8px 0 0; padding-left: 18px; }
.ddd-reasons li { font-size: .84rem; line-height: 1.45; color: var(--text-dim); margin-bottom: 5px; }

/* --- 3. routes ------------------------------------------------------ */

.road-where { display: block; font-size: .68rem; color: var(--text-mute); font-weight: 500; }
.road-events { margin: 8px 0 0; padding-left: 18px; }
.road-events li { font-size: .78rem; line-height: 1.4; color: var(--text-dim); margin-bottom: 4px; }
.road[data-status="closed"] { border-left: 3px solid var(--danger); padding-left: 10px; }

/* --- 5. services ---------------------------------------------------- */

.svc-list { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.svc { padding: 11px 0; border-bottom: 1px solid var(--line); }
.svc:last-child { border-bottom: 0; }
.svc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.svc-town { font-weight: 800; font-size: .98rem; letter-spacing: .02em; }
.svc-mi { font-size: .72rem; color: var(--accent); font-weight: 700; white-space: nowrap; }
.svc-good { font-size: .84rem; font-weight: 600; margin-top: 2px; }
.svc-detail { font-size: .8rem; line-height: 1.45; color: var(--text-dim); margin-top: 4px; }

/* --- 7. the handoff -------------------------------------------------
   Styled as an amber terminal — a visual nod to BRC Forecast's own register.
   This card is a gift being passed on, and it should look like one. */

.handoff {
  background: #000; color: #ffb000;
  border: 1px solid #6b4a00; border-radius: var(--radius);
  padding: 16px 15px; margin: 18px 0;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: .84rem; line-height: 1.55;
}
.handoff-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.handoff-prompt { color: #ff7b00; font-weight: 700; }
.handoff h2 {
  font-family: inherit; font-size: .82rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: #ffb000; margin: 0;
}
.handoff p { margin: 0 0 10px; }
.handoff strong { color: #ffd479; font-weight: 700; }
.handoff-links { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.handoff-links a {
  color: #000; background: #ffb000; text-decoration: none;
  padding: 9px 12px; border-radius: 6px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; font-size: .74rem;
}
.handoff-alert {
  border: 1px dashed #6b4a00; border-radius: 6px; padding: 10px 11px; margin: 12px 0;
}
.handoff-credit { color: #b57d00; font-size: .74rem; margin-bottom: 0; }
.handoff-credit a { color: #ffb000; }

/* Night vision has to win here too — an amber card is still light in the face
   at 3am, and the whole point of the mode is that nothing escapes the red band. */
html[data-theme-active="night"] .handoff { border-color: #4a0f08; color: var(--text); }
html[data-theme-active="night"] .handoff h2,
html[data-theme-active="night"] .handoff-prompt,
html[data-theme-active="night"] .handoff strong { color: var(--accent-2); }
html[data-theme-active="night"] .handoff-links a { background: var(--accent); color: #1a0503; }
html[data-theme-active="night"] .handoff-alert { border-color: #4a0f08; }
html[data-theme-active="night"] .handoff-credit { color: var(--text-dim); }
html[data-theme-active="night"] .handoff-credit a { color: var(--accent); }

/* --- full-conditions link ------------------------------------------ */

.bigl { font-weight: 700; }

.fire-divider {
  margin: 14px 0 8px; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: .74rem; line-height: 1.45; color: var(--text-mute);
}

/* ================================================================
   Navigation chrome
   ================================================================ */

.backlink {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; margin-right: 4px; flex: none;
  font-size: 1.3rem; line-height: 1; text-decoration: none;
  color: var(--accent); background: var(--bg-card);
  border: 1px solid var(--line); border-radius: 50%;
}

/* The mode button carries a text label because three settings only ever produce
   two appearances — "auto" looks exactly like whichever of night or day it has
   resolved to, and without the word it reads as a broken toggle. Adding text to
   a fixed 48px circle overflowed the header, so it becomes a pill: auto width,
   the 48px kept as a minimum so it stays a comfortable tap target. */
.mode-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: auto; min-width: 48px; min-height: 48px; height: auto;
  padding: 0 12px; border-radius: 24px;
}
.mode-label {
  font-size: .58rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-mute); white-space: nowrap;
}
.mode-btn[data-pref="auto"] .mode-label { color: var(--text-dim); }

/* ================================================================
   Home: the big buttons
   ================================================================ */

.bigbtns { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }

.bigbtn {
  display: flex; align-items: center; gap: 13px;
  padding: 15px 14px; border-radius: var(--radius);
  background: var(--bg-card); border: 1px solid var(--line);
  color: var(--text); text-decoration: none;
  box-shadow: var(--shadow);
}
.bigbtn[data-alert="true"] { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--bg-card)); }
.bb-icon { font-size: 1.6rem; line-height: 1; flex: none; }
.bb-text { flex: 1 1 auto; min-width: 0; }
.bb-title {
  display: block; font-size: 1.02rem; font-weight: 800;
  letter-spacing: .03em; margin-bottom: 2px;
}
.bb-sub { display: block; font-size: .78rem; line-height: 1.4; color: var(--text-dim); }
.bigbtn[data-alert="true"] .bb-sub { color: var(--danger); font-weight: 600; }
.bb-go { flex: none; font-size: 1.2rem; color: var(--text-mute); }

.hero-line {
  margin: 12px 0 0; padding-top: 11px; border-top: 1px solid var(--line);
  font-size: .84rem; line-height: 1.45; color: var(--text-dim);
}

/* ================================================================
   Page summary banner
   ================================================================ */

.summary { border-left: 4px solid var(--text-mute); }
.summary[data-level="good"] { border-left-color: var(--good); }
.summary[data-level="warn"] { border-left-color: var(--warn); }
.summary[data-level="bad"]  { border-left-color: var(--danger); }
.summary p { margin: 0; font-size: .95rem; line-height: 1.5; font-weight: 600; }
.summary[data-level="bad"] p { color: var(--danger); }

/* ================================================================
   Map
   ================================================================ */

.mapwrap {
  margin: 10px -4px 0; border-radius: 12px; overflow: hidden;
  background: var(--bg-raised); border: 1px solid var(--line);
}
.brcmap { display: block; width: 100%; height: auto; touch-action: manipulation; }

.mp-route-hit { fill: none; stroke: transparent; stroke-width: 14; }
.mp-route-line { fill: none; stroke: var(--text-dim); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.mp-route[data-status="unknown"] .mp-route-line { stroke: var(--text-dim); }
.mp-route[data-status="open"]        .mp-route-line { stroke: var(--good); }
.mp-route[data-status="delays"]      .mp-route-line { stroke: var(--warn); }
.mp-route[data-status="advisory"]    .mp-route-line { stroke: var(--warn); }
.mp-route[data-status="fire nearby"] .mp-route-line { stroke: var(--alert); }
.mp-route[data-status="closed"]      .mp-route-line { stroke: var(--danger); stroke-width: 3.4; }
.mp-route[data-status="check"]       .mp-route-line { stroke: var(--text-mute); stroke-dasharray: 5 4; }
.mp-route[data-on="true"] .mp-route-line { stroke-width: 5; }
.mp-route[role="button"] { cursor: pointer; }
.mp-route:focus-visible .mp-route-line { stroke: var(--accent-2); stroke-width: 5; }
.mp-route:focus { outline: none; }

.mp-town circle { fill: var(--text-mute); }
.mp-town text { fill: var(--text-dim); font-size: 8px; font-weight: 600; }

.mp-fire-hit { fill: transparent; }
.mp-fire-dot { fill: none; stroke: var(--text-mute); stroke-width: 1.6; }
.mp-fire[data-live="true"] .mp-fire-dot {
  fill: color-mix(in srgb, var(--danger) 42%, transparent);
  stroke: var(--danger); stroke-width: 1.6;
}
.mp-fire[role="button"] { cursor: pointer; }
.mp-fire:focus-visible .mp-fire-dot { stroke: var(--accent-2); stroke-width: 3; }
.mp-fire:focus { outline: none; }

.mp-brc circle { fill: var(--accent); }
.mp-brc .mp-brc-ring { fill: none; stroke: var(--accent); stroke-width: 1.2; opacity: .55; }
.mp-brc text { fill: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .06em; }

.mp-scale line { stroke: var(--text-mute); stroke-width: 1.4; }
.mp-scale text { fill: var(--text-mute); font-size: 8px; font-weight: 600; }

/* ================================================================
   Expandable detail cards (fires, roads)
   ================================================================ */

.expandable { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 9px; overflow: hidden; }
.expandable[data-status="closed"] { border-color: var(--danger); }
.expandable[data-live="true"] { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); }

.fx-head {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 12px 13px; background: var(--bg-raised); border: 0;
  color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.fx-title { flex: 1 1 auto; min-width: 0; }
.fx-chevron { flex: none; color: var(--text-mute); font-size: .95rem; transition: transform .15s ease; }
.expandable[data-open="true"] .fx-chevron { transform: rotate(180deg); }

.fx-body { display: none; padding: 4px 13px 13px; }
.expandable[data-open="true"] .fx-body { display: block; }

.fx-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 7px 0; border-bottom: 1px solid var(--line);
  font-size: .82rem; line-height: 1.35;
}
.fx-row:last-child { border-bottom: 0; }
.fx-row > span:first-child { color: var(--text-dim); }
.fx-row > span:last-child { font-weight: 600; text-align: right; white-space: nowrap; }
.fx-route[data-near="true"] > span:last-child { color: var(--alert); }

.fx-sub {
  margin: 12px 0 2px; font-size: .68rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text-mute);
}
.fx-note { margin: 10px 0 0; font-size: .78rem; line-height: 1.5; color: var(--text-dim); }
.fx-group {
  margin: 16px 0 8px; font-size: .68rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text-mute);
}
.fx-group span {
  display: block; margin-top: 4px; font-size: .72rem; font-weight: 400;
  letter-spacing: 0; text-transform: none; line-height: 1.45;
}
.fx-group:first-child { margin-top: 0; }

.road-count { display: block; font-size: .7rem; color: var(--text-mute); margin-top: 3px; }
.road.expandable .road-status { flex: none; align-self: flex-start; }
.road.expandable .road-desc { display: block; font-size: .76rem; color: var(--text-dim); margin-top: 3px; }
.road.expandable[data-status="closed"]      .road-status { color: var(--danger); }
.road.expandable[data-status="delays"]      .road-status { color: var(--warn); }
.road.expandable[data-status="advisory"]    .road-status { color: var(--warn); }
.road.expandable[data-status="fire nearby"] .road-status { color: var(--alert); }
.road.expandable[data-status="open"]        .road-status { color: var(--good); }
.road.expandable[data-status="check"]       .road-status { color: var(--text-mute); }

/* ================================================================
   Trip times
   ================================================================ */

.trip-list { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.trip {
  display: grid; grid-template-columns: 1fr auto auto; gap: 4px 10px; align-items: baseline;
  width: 100%; padding: 11px 2px; background: none; border: 0;
  border-bottom: 1px solid var(--line); color: var(--text);
  font: inherit; text-align: left; cursor: pointer;
}
.trip:last-child { border-bottom: 0; }
.trip-from { font-weight: 700; font-size: .92rem; }
.trip-time { font-weight: 800; font-size: .88rem; color: var(--accent); white-space: nowrap; }
.trip-miles { font-size: .74rem; color: var(--text-mute); white-space: nowrap; }
.trip-via { grid-column: 1 / -1; font-size: .72rem; color: var(--text-mute); }

.mp-leader { stroke: var(--text-mute); stroke-width: .8; opacity: .6; }
.mp-note { fill: var(--text-mute); font-size: 8px; font-weight: 600; }

/* ---------- collapsible fire groups ---------- */

.fgroup { margin-bottom: 6px; }
.fgroup-head {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 12px 2px 6px; background: none; border: 0;
  color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.fgroup-title {
  flex: 1 1 auto; font-size: .7rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text-mute);
}
.fgroup-count {
  flex: none; font-size: .7rem; font-weight: 800; color: var(--accent);
  background: var(--bg-raised); border-radius: 999px; padding: 2px 9px;
}
.fgroup-blurb { margin: 0 2px 9px; font-size: .74rem; line-height: 1.45; color: var(--text-mute); }
.fgroup-body { display: none; }
.fgroup[data-open="true"] .fgroup-body { display: block; }
.fgroup[data-open="true"] .fx-chevron { transform: rotate(180deg); }

/* ---------- map legend ---------- */

.maplegend {
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  list-style: none; margin: 10px 0 0; padding: 0;
  font-size: .72rem; color: var(--text-dim);
}
.maplegend li { display: flex; align-items: center; gap: 6px; }
.maplegend li::before {
  content: ''; width: 16px; height: 3px; border-radius: 2px; background: var(--good);
}
.maplegend li[data-k="delays"]::before { background: var(--warn); }
.maplegend li[data-k="fire"]::before   { background: var(--alert); }
.maplegend li[data-k="closed"]::before { background: var(--danger); height: 4px; }
.maplegend li[data-k="check"]::before  {
  background: repeating-linear-gradient(90deg, var(--text-mute) 0 5px, transparent 5px 9px);
}

/* ---------- burn-night climatology fallback ---------- */

.burn[data-mode="climatology"] { border-left: 3px solid var(--text-mute); padding-left: 10px; }
.burn-odds {
  display: inline-block; margin-right: 6px; padding: 2px 7px; border-radius: 999px;
  background: var(--bg-raised); color: var(--text-mute);
  font-size: .6rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  vertical-align: 1px;
}
.burn-src { display: block; margin-top: 6px; font-size: .72rem; line-height: 1.45; color: var(--text-mute); }

/* ---------- nearest real instruments ---------- */

.inst-verdict {
  margin: 10px 0 12px; padding: 11px 12px; border-radius: 10px;
  background: var(--bg-raised); font-size: .82rem; line-height: 1.5;
  border-left: 3px solid var(--text-mute);
}
.inst-verdict[data-verdict="above"] { border-left-color: var(--alert); }
.inst-verdict[data-verdict="below"] { border-left-color: var(--good); }
.inst-verdict[data-verdict="close"] { border-left-color: var(--good); }

.inst-list { display: flex; flex-direction: column; gap: 2px; }
.inst { padding: 10px 0; border-bottom: 1px solid var(--line); }
.inst:last-child { border-bottom: 0; }
.inst[data-quiet="true"] { opacity: .6; }
.inst-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.inst-name { font-weight: 700; font-size: .88rem; }
.inst-gust { font-weight: 800; font-size: .88rem; color: var(--accent); white-space: nowrap; }
.inst-sub { margin-top: 3px; font-size: .74rem; line-height: 1.45; color: var(--text-mute); }

/* ================================================================
   Cross-page navigation
   ================================================================ */

.pagenav {
  display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 0 14px 10px; max-width: 640px; margin: 0 auto;
  scrollbar-width: none;
}
.pagenav::-webkit-scrollbar { display: none; }
.pn {
  flex: none; padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-card);
  color: var(--text-dim); text-decoration: none;
  font-size: .76rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
}
.pn[data-on="true"] { background: var(--accent); border-color: var(--accent); color: #1a0f04; }
html[data-theme-active="night"] .pn[data-on="true"] { color: #1a0503; }

/* A card that summarises what another page owns in full. */
.handover {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 12px; padding: 11px 12px; border-radius: 10px;
  background: var(--bg-raised); color: var(--accent);
  text-decoration: none; font-size: .82rem; font-weight: 700;
}
.handover span:last-child { flex: none; }

/* ---------- compact route strip (arrival page) ---------- */

.route-strip { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.rs {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 2px; border-bottom: 1px solid var(--line);
  color: var(--text); text-decoration: none;
}
.rs:last-of-type { border-bottom: 0; }
.rs-name { font-weight: 700; font-size: .92rem; }
.rs-where { display: block; font-size: .7rem; color: var(--text-mute); font-weight: 500; margin-top: 1px; }
.rs-status {
  flex: none; font-size: .72rem; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
a.fire { display: block; text-decoration: none; color: inherit; }
