/* Layout: full-bleed 3D map with everything else tucked away. A thin contact banner and one toolbar on top; the fire list
   slides in from the left, layers/legend/incident/weather from the right, and the charts slide up from the timeline bar.
   Look: an operations-room console. Graphite glass, ember accent for fire, ice-blue for wind, Australian Warning System colours for alert levels. */
:root {
  --bg: #0b0d10;
  --glass: rgba(14, 16, 20, 0.86);
  --solid: #12151a;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --fg: #eef1f4;
  --fg-2: #b4bcc6;
  --muted: #7d8794;
  --ember: #ff6a2b;
  --ember-2: #ffb347;
  --wind: #7fd6ff;
  --hover: rgba(255, 255, 255, 0.06);
  --lv-emergency: #e3202c;
  --lv-watch: #ff7a00;
  --lv-advice: #f2c200;
  --lv-info: #6f9fc4;
  --lv-none: #8b949f;
  --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --left-w: 320px;
  --right-w: 340px;
  --banner-h: 28px;
  --bar-h: 44px;
  --top: calc(var(--banner-h) + var(--bar-h) + 16px);   /* where drawers start */
  --tl-h: 76px;
  --bottom-h: var(--tl-h);
  --gap: 10px;
  --l-off: 0px;
  --r-off: 0px;
  --ease: cubic-bezier(0.22, 0.8, 0.26, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body.charts-open { --bottom-h: 236px; }
body.left-open { --l-off: calc(var(--left-w) + var(--gap)); }
body.right-open { --r-off: calc(var(--right-w) + var(--gap)); }
body { background: var(--bg); color: var(--fg); font: 14px/1.45 var(--font-body); overflow: hidden; }
button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
#map { position: fixed; inset: 0; }
#wind { position: fixed; inset: 0; pointer-events: none; z-index: 2; }
body.fire #wind, body.national #wind { display: block; }

.panel {
  position: fixed; z-index: 5; background: var(--glass); border: 1px solid var(--line); border-radius: 12px;
  backdrop-filter: blur(16px) saturate(130%); -webkit-backdrop-filter: blur(16px) saturate(130%); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.note { margin: 0; font-size: 12.5px; color: var(--muted); }
.btn {
  border: 1px solid var(--line-2); background: var(--solid); border-radius: 8px; padding: 6px 11px; cursor: pointer; font-size: 13px; font-weight: 500;
}
.btn:hover { border-color: var(--ember); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn.icon { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; font-size: 13px; background: var(--ember); border-color: var(--ember); color: #160a04; }
.btn.icon:hover { filter: brightness(1.1); color: #160a04; }
.btn.primary { background: var(--ember); border-color: var(--ember); color: #160a04; font-weight: 600; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 9px; background: rgba(0, 0, 0, 0.3); }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 6px; cursor: pointer; font: 600 13px var(--font-display); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-2); }
.seg button:hover { color: var(--fg); }
.seg button[aria-pressed="true"] { background: var(--fg); color: #0b0d10; }
.seg.small button { padding: 4px 9px; font-size: 12px; }
select { background: var(--solid); border: 1px solid var(--line-2); border-radius: 7px; padding: 5px 8px; font-size: 12.5px; }

/* loading */
#loading { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--bg); transition: opacity 0.5s; }
#loading.done { opacity: 0; pointer-events: none; }
.ld { display: grid; gap: 10px; width: min(360px, 86vw); }
.ld b { font: 700 28px var(--font-display); letter-spacing: 0.04em; text-transform: uppercase; }
.ld span { font: 12.5px var(--font-mono); color: var(--fg-2); }
.ld i { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; display: block; }
.ld i span { display: block; height: 100%; width: 8%; background: linear-gradient(90deg, var(--ember-2), var(--ember)); transition: width 0.4s; }

/* top bar */
.top {
  position: fixed; z-index: 10; top: calc(var(--banner-h) + 8px); left: max(10px, env(safe-area-inset-left, 0px)); right: max(10px, env(safe-area-inset-right, 0px));
  display: flex; gap: 8px; align-items: stretch; height: var(--bar-h); pointer-events: none;
}
.top > * { pointer-events: auto; }
.brand { display: flex; gap: 9px; align-items: center; flex: 0 1 auto; min-width: 0; padding: 0 12px; background: var(--glass); border: 1px solid var(--line); border-radius: 12px; backdrop-filter: blur(16px); }
.logo { width: 26px; height: 26px; color: var(--ember); filter: drop-shadow(0 0 8px rgba(255, 106, 43, 0.6)); flex: none; }
.brand h1 { margin: 0; white-space: nowrap; font: 700 19px/1 var(--font-display); letter-spacing: 0.05em; text-transform: uppercase; }
.brand h1 span { color: var(--ember); }
.brand p { margin: 2px 0 0; font: 10.5px var(--font-mono); color: var(--muted); max-width: 210px; }
.search { position: relative; flex: 1 1 160px; min-width: 120px; max-width: 520px; display: flex; align-items: center; gap: 8px; padding: 0 12px; background: var(--glass); border: 1px solid var(--line); border-radius: 12px; backdrop-filter: blur(16px); }
.search:focus-within { border-color: var(--ember); }
.search > svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.search input { flex: 1; border: 0; outline: 0; background: transparent; padding: 0; font-size: 14px; min-width: 0; }
.search input::placeholder { color: var(--muted); }
.sr { position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 320px; background: var(--solid); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); max-height: min(70vh, 560px); overflow: auto; padding: 6px; }
.sr h5 { margin: 8px 8px 4px; font: 600 11.5px var(--font-display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; }
.sr button { all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.sr button:hover, .sr button.on { background: var(--hover); }
.sr .t { font-size: 13.5px; font-weight: 500; overflow-wrap: anywhere; }
.sr .m { font-size: 11.5px; color: var(--muted); grid-column: 2; overflow-wrap: anywhere; }
.sr .r { font: 11px var(--font-mono); color: var(--muted); grid-row: 1; grid-column: 3; }
.sr .d { width: 10px; height: 10px; border-radius: 50%; grid-row: span 2; }
.sr .empty { padding: 10px; font-size: 12.5px; color: var(--muted); }
/* left panel */
#left { left: max(10px, env(safe-area-inset-left, 0px)); top: var(--top); bottom: calc(var(--bottom-h) + 20px); width: var(--left-w); display: flex; flex-direction: column; overflow: hidden; }
#left > * { flex-shrink: 0; }
#back-row { position: fixed; z-index: 6; top: var(--top); left: calc(max(10px, env(safe-area-inset-left, 0px)) + var(--l-off)); transition: left 0.26s var(--ease); }
#back-row .btn { padding: 8px 14px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4); }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); margin: 0 12px 10px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.kpi { background: var(--solid); padding: 7px 10px; display: grid; gap: 1px; min-width: 0; }
.kpi b { font: 700 21px/1.05 var(--font-display); letter-spacing: 0.01em; }
.kpi span { font-size: 11.5px; color: var(--muted); }
.kpi.hot b { color: var(--ember); }
.filters { display: grid; gap: 8px; padding: 0 12px 8px; }
.lvl-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.lchip { all: unset; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-2); }
.lchip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.lchip.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 18%, transparent); }
.lchip:focus-visible { outline: 2px solid var(--ember); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.list-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.chk { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.chk input { accent-color: var(--ember); }
.fire-list { list-style: none; margin: 0; padding: 4px 6px 8px; overflow-y: auto; flex: 1 1 auto !important; min-height: 0; scrollbar-width: thin; }
.fire-list li button { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 10px; padding: 8px 8px; border-radius: 8px; }
.fire-list li button:hover { background: var(--hover); }
.fire-list li button:focus-visible { outline: 2px solid var(--ember); }
.fire-list li.on button { background: rgba(255, 106, 43, 0.12); }
.fire-list .bar { border-radius: 2px; background: var(--c); }
.fire-list .t { font-weight: 600; font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.fire-list .m { font-size: 11.5px; color: var(--fg-2); display: flex; flex-wrap: wrap; gap: 2px 8px; margin-top: 2px; }
.fire-list .r { text-align: right; font: 11px/1.35 var(--font-mono); color: var(--muted); white-space: nowrap; }
.fire-list .r b { display: block; font: 600 13px var(--font-mono); color: var(--fg); }
.lvl { display: inline-flex; align-items: center; gap: 5px; font: 600 11px var(--font-display); letter-spacing: 0.06em; text-transform: uppercase; color: var(--c); }
.lvl::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.sources { padding: 6px 14px 10px; border-top: 1px solid var(--line); font-size: 11px; }
.sources .bad { color: var(--lv-emergency); }

/* right panel */
#right { right: max(10px, env(safe-area-inset-right, 0px)); top: var(--top); bottom: calc(var(--bottom-h) + 20px); width: var(--right-w); display: flex; flex-direction: column; overflow: hidden; }
.tabs { display: flex; gap: 2px; align-items: center; padding: 4px 8px 0; border-bottom: 1px solid var(--line); flex: none; }
.tabs button[role="tab"] { all: unset; cursor: pointer; padding: 8px 11px 9px; font: 600 13px var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-2); border-bottom: 2px solid transparent; }
.tabs button[role="tab"][aria-selected="true"] { color: var(--fg); border-bottom-color: var(--ember); }
.tabs button[role="tab"]:focus-visible { outline: 2px solid var(--ember); }
.pane { overflow-y: auto; padding: 12px 14px 16px; flex: 1; min-height: 0; scrollbar-width: thin; display: flex; flex-direction: column; gap: 12px; }
.pane > * { flex-shrink: 0; }
.layers { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.layers li { display: grid; grid-template-columns: 18px 30px minmax(0, 1fr) 70px; gap: 9px; align-items: center; padding: 4px 4px; border-radius: 7px; }
.layers li:hover { background: var(--hover); }
.layers input[type="checkbox"] { accent-color: var(--ember); width: 15px; height: 15px; }
.layers .thumb { width: 30px; height: 22px; border-radius: 4px; border: 1px solid var(--line-2); }
.layers label { font-size: 13px; cursor: pointer; line-height: 1.25; }
.layers label small { display: block; font-size: 11px; color: var(--muted); }
.layers input[type="range"] { width: 70px; accent-color: var(--ember); }
.legend { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.legend h4, .pane h4 { margin: 0 0 6px; font: 600 12px var(--font-display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-2); }
.ramp { height: 8px; border-radius: 4px; }
.ramp-l { display: flex; justify-content: space-between; font: 10.5px var(--font-mono); color: var(--muted); margin-top: 3px; }
.keys { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; }
.keys span { display: inline-flex; gap: 6px; align-items: center; }
.keys i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }

/* incident card */
.inc-h { display: grid; gap: 4px; }
.inc-h h3 { margin: 0; font: 700 22px/1.15 var(--font-display); letter-spacing: 0.01em; overflow-wrap: anywhere; }
.inc-h .sub { font-size: 12.5px; color: var(--fg-2); }
.dl { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 5px 10px; margin: 0; font-size: 12.5px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; }
.est { font-size: 11.5px; color: var(--muted); }
.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.events li button { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 6px; font-size: 12.5px; }
.events li button:hover { background: var(--hover); }
.events li button:focus-visible { outline: 2px solid var(--ember); }
.events i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.events .tm { font: 11px var(--font-mono); color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 6px; }
.links a { color: var(--ember-2); font-size: 12.5px; }

/* weather */
.wx-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.wx { background: var(--solid); padding: 9px 10px; display: grid; gap: 2px; min-width: 0; }
.wx span { font-size: 11px; color: var(--muted); }
.wx b { font: 700 21px/1.05 var(--font-display); }
.wx small { font-size: 11px; color: var(--fg-2); }
.compass { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: center; }
.compass svg { width: 96px; height: 96px; }
.compass svg text { font: 600 10px var(--font-display); fill: var(--muted); }

/* bottom */
#bottom { left: max(10px, env(safe-area-inset-left, 0px)); right: max(10px, env(safe-area-inset-right, 0px)); bottom: max(10px, env(safe-area-inset-bottom, 0px)); height: var(--bottom-h); display: grid; grid-template-rows: 60px minmax(0, 1fr); padding: 8px 12px; gap: 8px; transition: height 0.26s var(--ease); }
.tl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; height: 60px; min-height: 0; overflow: hidden; }
.tl-ctl { display: flex; gap: 6px; align-items: center; }
.tl-track { display: grid; grid-template-rows: 18px 42px; min-width: 0; height: 60px; }
.tl-label { display: flex; gap: 12px; align-items: baseline; font-size: 12px; color: var(--muted); }
.tl-label b { font: 600 12.5px var(--font-display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-2); }
#tl-time { font: 500 12.5px var(--font-mono); color: var(--ember-2); }
#tl-range { margin-left: auto; font-family: var(--font-mono); font-size: 11px; }
#tl-svg { width: 100%; height: 42px; display: block; cursor: pointer; touch-action: none; user-select: none; overflow: hidden; }
#tl-svg text { font: 10.5px var(--font-mono); fill: var(--muted); }
.charts { display: none; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; min-height: 0; }
body.charts-open .charts { display: grid; animation: sheet-in 0.3s 0.12s both; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(8px); } }
.chart { margin: 0; border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px 4px; display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; position: relative; overflow: hidden; }
.chart figcaption { display: flex; justify-content: space-between; gap: 8px; font: 600 11.5px var(--font-display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-2); }
.chart figcaption span { font: 400 10.5px var(--font-mono); letter-spacing: 0; text-transform: none; color: var(--muted); }
.chart svg { width: 100%; height: 100%; min-height: 0; display: block; overflow: visible; }
.chart svg text { font: 10px var(--font-mono); fill: var(--muted); }
.chart .empty { align-self: center; justify-self: center; font-size: 12px; color: var(--muted); }

#tip { position: fixed; z-index: 40; pointer-events: none; max-width: 300px; padding: 8px 10px; border-radius: 8px; background: var(--solid); border: 1px solid var(--line-2); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); font-size: 12.5px; line-height: 1.4; }
#tip b { display: block; }
#tip .m { color: var(--muted); font-size: 11.5px; }
.marker-origin { pointer-events: none; display: grid; justify-items: center; gap: 3px; transform: translateY(-14px); }
.marker-origin i { width: 14px; height: 14px; border-radius: 50%; background: var(--ember-2); border: 2px solid #fff; box-shadow: 0 0 14px var(--ember); }
.marker-origin span { font: 600 12px var(--font-display); letter-spacing: 0.04em; background: rgba(10, 10, 12, 0.85); padding: 2px 7px; border-radius: 5px; white-space: nowrap; }
.maplibregl-ctrl-bottom-right { bottom: calc(var(--bottom-h) + 18px); right: var(--r-off); transition: right 0.26s var(--ease), bottom 0.26s var(--ease); }
.maplibregl-ctrl-bottom-left { bottom: calc(var(--bottom-h) + 18px); left: var(--l-off); transition: left 0.26s var(--ease), bottom 0.26s var(--ease); }
.maplibregl-ctrl-group { background: var(--solid); }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); }
.maplibregl-ctrl-attrib { font-size: 10px; }
@media (prefers-reduced-motion: reduce) { #loading { transition: none; } }
/* view tabs: Live · Replay · Prediction */
.modes { display: flex; gap: 2px; padding: 4px; background: var(--glass); border: 1px solid var(--line); border-radius: 12px; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.modes button { all: unset; cursor: pointer; padding: 0 13px; border-radius: 8px; font: 600 13px var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-2); display: inline-flex; gap: 8px; align-items: center; }
.modes button:hover { color: var(--fg); background: var(--hover); }
.modes button[aria-selected="true"] { background: var(--ember); color: #160a04; }
.modes button:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff3b3b; animation: livepulse 1.6s infinite; }
.modes button[aria-selected="true"] .live-dot { background: #160a04; animation: none; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(255, 59, 59, 0.7); } 70% { box-shadow: 0 0 0 7px rgba(255, 59, 59, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 59, 59, 0); } }
body[data-tab="prediction"] #tl-title { color: var(--ember-2); }
.chk.small { font-size: 12px; color: var(--fg-2); }

/* flares at the fire head and the ignition point */
.flare { pointer-events: none; position: relative; width: 0; height: 0; }
.flare i { position: absolute; left: -70px; top: -70px; width: 140px; height: 140px; border-radius: 50%; mix-blend-mode: screen;
  background: radial-gradient(circle, rgba(255, 251, 228, 0.95) 0%, rgba(255, 214, 90, 0.75) 11%, rgba(255, 122, 31, 0.35) 30%, rgba(255, 90, 31, 0) 66%); animation: flick 0.16s infinite alternate; }
.flare b { position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%; background: #fff8e0; box-shadow: 0 0 18px 7px rgba(255, 200, 80, 0.9); }
.flare.ign i { background: radial-gradient(circle, rgba(255, 244, 210, 0.95) 0%, rgba(255, 160, 70, 0.6) 16%, rgba(255, 80, 30, 0) 60%); }
.flare.head.pred i { opacity: 0.55; animation-duration: 0.4s; }
.flare.head.pred b { background: rgba(0, 0, 0, 0.35); border: 2px dashed #ffd65a; box-shadow: none; left: -8px; top: -8px; }
@keyframes flick { from { transform: scale(0.9); opacity: 0.82; } to { transform: scale(1.08); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .flare i, .live-dot { animation: none; } }

/* prediction summary and fire danger */
.box.pred { border-color: rgba(255, 106, 43, 0.5); background: rgba(255, 106, 43, 0.06); }
.box.pred h4 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.box.pred h4 .link, .link { all: unset; cursor: pointer; color: var(--ember-2); font: 500 12px var(--font-body); letter-spacing: 0; text-transform: none; }
.link:hover { text-decoration: underline; }
.ptab { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ptab th { text-align: left; color: var(--muted); font-weight: 500; font-size: 11.5px; padding: 3px 0; }
.ptab td { padding: 4px 0; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 12px; }
.ptab td b { font-family: var(--font-display); font-size: 15px; color: var(--ember-2); }
.danger { display: grid; gap: 3px; border-left: 4px solid var(--c); padding-left: 10px; }
.danger b { font: 700 20px var(--font-display); color: var(--c); }
.danger span { font-size: 11.5px; color: var(--muted); }

.lg-picker { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.flare i { background: radial-gradient(circle, rgba(255, 251, 228, 0.95) 0%, color-mix(in srgb, var(--flare, #ff7a1f) 70%, #ffd65a) 12%, color-mix(in srgb, var(--flare, #ff7a1f) 40%, transparent) 30%, transparent 66%); }

/* "Burning now" filter, left of the Live tab */
.burn-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; cursor: pointer; user-select: none;
  background: var(--glass); border: 1px solid var(--line); border-radius: 12px; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  font: 600 13px var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-2); white-space: nowrap; }
.burn-toggle:hover { color: var(--fg); border-color: var(--line-2); }
.burn-toggle input { width: 16px; height: 16px; accent-color: var(--ember); margin: 0; cursor: pointer; }
.burn-toggle svg { width: 16px; height: 16px; color: var(--muted); }
.burn-toggle b { font: 600 12px var(--font-mono); letter-spacing: 0; padding: 2px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); color: var(--fg); }
.burn-toggle:has(input:checked) { border-color: var(--ember); color: var(--fg); background: color-mix(in srgb, var(--ember) 16%, var(--glass)); }
.burn-toggle:has(input:checked) svg { color: var(--ember); filter: drop-shadow(0 0 6px rgba(255, 106, 43, 0.8)); }
.burn-toggle:has(input:checked) b { background: var(--ember); color: #160a04; }
.burn-toggle:focus-within { outline: 2px solid var(--ember); outline-offset: 2px; }
.burn-chip { display: inline-flex; align-items: center; gap: 4px; font: 600 10.5px var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ember); }
.burn-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 6px var(--ember); }
.kpi.wide { grid-column: 1 / -1; }
.brand > div { min-width: 0; }
.brand p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* contact banner */
.banner { position: fixed; z-index: 11; top: 0; left: 0; right: 0; height: var(--banner-h); display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 12px; background: rgba(8, 10, 13, 0.92); border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--fg-2); white-space: nowrap; }
.banner .b-short { display: none; }
.banner a { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 6px; border-radius: 999px; color: var(--fg); font-weight: 600; text-decoration: none; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.05); }
.banner a:hover { border-color: #4aa3e8; background: rgba(74, 163, 232, 0.16); }
.banner .li { width: 15px; height: 15px; color: #4aa3e8; border-radius: 3px; }

/* drawer buttons in the top bar */
.drawer-btn { display: inline-flex; align-items: center; gap: 8px; padding: 0 13px; cursor: pointer; background: var(--glass); border: 1px solid var(--line); border-radius: 12px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); font: 600 13px var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-2); white-space: nowrap; }
.drawer-btn svg { width: 18px; height: 18px; flex: none; }
.drawer-btn:hover { color: var(--fg); border-color: var(--line-2); }
.drawer-btn[aria-expanded="true"] { color: var(--fg); border-color: var(--ember); background: color-mix(in srgb, var(--ember) 16%, var(--glass)); }
.drawer-btn.icon-only { padding: 0; width: var(--bar-h); justify-content: center; }
.modes { align-items: stretch; }

/* drawers slide in from the sides */
.drawer { transition: transform 0.26s var(--ease), visibility 0.26s, bottom 0.26s var(--ease); visibility: hidden; }
#left.drawer { transform: translateX(calc(-100% - 24px)); }
#right.drawer { transform: translateX(calc(100% + 24px)); }
body.left-open #left, body.right-open #right { transform: none; visibility: visible; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 14px; }
.drawer-head b { font: 700 15px var(--font-display); letter-spacing: 0.1em; text-transform: uppercase; }
.x { all: unset; box-sizing: border-box; cursor: pointer; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; font-size: 20px; line-height: 1; color: var(--fg-2); }
.x:hover { background: var(--hover); color: var(--fg); }
.x:focus-visible { outline: 2px solid var(--ember); }
.tabs .x { margin-left: auto; margin-bottom: 4px; }
.mapstyle { position: fixed; z-index: 6; top: var(--top); right: calc(max(10px, env(safe-area-inset-right, 0px)) + var(--r-off)); display: flex; gap: 8px; transition: right 0.26s var(--ease); }
.mapstyle .seg { background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4); }

/* pull-up handle on the timeline bar */
.sheet-handle { all: unset; box-sizing: border-box; cursor: pointer; position: absolute; left: 50%; top: -15px; transform: translateX(-50%); height: 26px; padding: 0 14px 0 10px;
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; background: var(--solid); border: 1px solid var(--line-2); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  font: 600 12px var(--font-display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-2); }
.sheet-handle:hover { color: var(--fg); border-color: var(--ember); }
.sheet-handle:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
.sheet-handle svg { width: 16px; height: 16px; color: var(--ember); transition: transform 0.26s var(--ease); }
.sheet-handle[aria-expanded="true"] svg { transform: rotate(180deg); }

/* compact legend inside the Layers tab: swatch, name, and an "i" that holds the explanation */
.legend-box { left: calc(max(10px, env(safe-area-inset-left, 0px)) + var(--l-off)); bottom: calc(var(--bottom-h) + 56px); width: 214px; max-height: calc(100vh - var(--top) - var(--bottom-h) - 116px);
  overflow-y: auto; padding: 8px 10px; scrollbar-width: thin; z-index: 4; transition: left 0.26s var(--ease), bottom 0.26s var(--ease); }
.legend-box.shut { width: auto; }
.lg-head { display: flex; align-items: center; gap: 6px; }
.lg-head b { font: 600 12px var(--font-display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-2); }
.lg-head .link { margin-left: 8px; } .lg-head .lg-i + .link { margin-left: auto; }
.lg-body { display: grid; gap: 1px; margin-top: 2px; }
.lg-body h5 { margin: 5px 0 1px; font: 600 10.5px var(--font-display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.lg-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) 18px; gap: 6px; align-items: center; min-height: 26px; }
.lg-row b { font-size: 12px; font-weight: 500; line-height: 1.2; }
.lg-sw { all: unset; box-sizing: border-box; cursor: pointer; width: 30px; height: 22px; display: grid; place-items: center; border-radius: 6px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, 0.35); }
.lg-sw:hover { border-color: var(--ember); }
.lg-sw:focus-visible { outline: 2px solid var(--ember); }
.lg-sw.fixed { cursor: default; border-color: var(--line); }
.lg-i { all: unset; box-sizing: border-box; cursor: help; flex: none; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2);
  font: italic 600 11px Georgia, "Times New Roman", serif; color: var(--fg-2); }
.lg-i:hover, .lg-i:focus-visible { border-color: var(--wind); color: var(--wind); }
.lg-i:focus-visible { outline: 2px solid var(--ember); outline-offset: 1px; }

/* narrower windows: labels give way before controls do */
@media (max-width: 1320px) { .charts { grid-template-columns: repeat(2, minmax(0, 1fr)); } #c3, #c4 { display: none; } .brand p { display: none; } }
@media (max-width: 1120px) { .burn-toggle span { display: none; } .modes button { padding: 0 10px; } .brand h1 span { display: none; } }
@media (max-width: 900px) {
  :root { --left-w: min(86vw, 340px); --right-w: min(86vw, 340px); }
  body.left-open, body.right-open { --l-off: 0px; --r-off: 0px; }   /* drawers overlay the map */
  .top { flex-wrap: wrap; height: auto; row-gap: 6px; } .top > * { height: var(--bar-h); }
  :root { --top: calc(var(--banner-h) + var(--bar-h) * 2 + 22px); }
  .brand { display: none; } .search { flex-basis: 0; }
  .banner .b-long { display: none; } .banner .b-short { display: inline; }
  .charts { grid-template-columns: 1fr; } #c2 { display: none; }
  .chk.small, #speed { display: none; }
  .mapstyle .seg:first-child { display: none; } .legend-box { max-height: 34vh; }
  body.left-open .legend-box, body.right-open .legend-box, body.right-open .mapstyle { visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) { .drawer, #bottom, .sheet-handle svg, #back-row, .mapstyle, .legend-box, .maplibregl-ctrl-bottom-left, .maplibregl-ctrl-bottom-right { transition: none; } body.charts-open .charts { animation: none; } }

/* buildings at risk */
.box.houses { border-color: rgba(255, 18, 56, 0.45); }
.hgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.hk { border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: 8px; padding: 6px 7px; display: grid; gap: 1px; min-width: 0; }
.hk b { font: 700 19px var(--font-display); }
.hk span { font-size: 10.5px; color: var(--muted); line-height: 1.25; }
.prio { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.prio button { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; align-items: start; padding: 6px; border-radius: 7px; font-size: 12.5px; line-height: 1.35; }
.prio button:hover { background: var(--hover); }
.prio button:focus-visible { outline: 2px solid var(--ember); }
.prio button > b { width: 22px; height: 22px; border-radius: 50%; background: #ff1238; color: #fff; display: grid; place-items: center; font: 700 12px var(--font-display); }
.prio em { font-style: normal; color: var(--fg-2); font-size: 11.5px; }

/* "Only" quick filters in the fire list */
.only-chips { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; font-size: 12px; color: var(--muted); }
.ochip { all: unset; cursor: pointer; font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--fg-2); }
.ochip:hover { border-color: var(--ember); color: var(--fg); }
.ochip[aria-pressed="true"] { background: var(--ember); border-color: var(--ember); color: #160a04; font-weight: 600; }
.ochip:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
.windev { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.windev button { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; padding: 6px; border-radius: 7px; font-size: 12.5px; line-height: 1.4; }
.windev button:hover { background: var(--hover); }
.windev button:focus-visible { outline: 2px solid var(--ember); }
.windev svg { width: 26px; height: 26px; }
.windev em { font-style: normal; color: var(--fg-2); font-size: 11.5px; display: block; }

/* plain-language legend with click-to-spotlight rows */
.legend-box { width: 268px; }
.lg-hint { margin: 4px 0 2px; font-size: 11px; color: var(--muted); line-height: 1.35; }
.lg-all { all: unset; box-sizing: border-box; cursor: pointer; display: block; width: 100%; margin: 6px 0 2px; padding: 6px 8px; border-radius: 7px; background: var(--ember); color: #160a04; font-size: 11.5px; font-weight: 600; line-height: 1.3; }
.lg-all:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lg-row { align-items: start; padding: 3px 0; border-radius: 7px; }
.lg-row.spot { background: color-mix(in srgb, var(--ember) 18%, transparent); box-shadow: inset 3px 0 0 var(--ember); padding-left: 4px; }
.lg-row.dim { opacity: 0.45; }
.lg-name { all: unset; box-sizing: border-box; cursor: pointer; display: grid; gap: 1px; min-width: 0; padding: 1px 2px; border-radius: 5px; }
.lg-name:hover b { color: var(--ember-2); text-decoration: underline; }
.lg-name:focus-visible { outline: 2px solid var(--ember); outline-offset: 1px; }
.lg-name b { font-size: 12.5px; font-weight: 600; line-height: 1.25; color: var(--fg); }
.lg-name span { font-size: 11.5px; line-height: 1.3; color: var(--fg-2); }
.lg-body h5 { margin-top: 9px; color: var(--ember-2); }

/* ============================== compact, modern panels ============================== */
:root { --left-w: 296px; --right-w: 308px; --card: rgba(255, 255, 255, 0.045); }
.panel { border-radius: 14px; border-color: rgba(255, 255, 255, 0.08); background: linear-gradient(180deg, rgba(20, 23, 29, 0.9), rgba(12, 14, 18, 0.9)); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05); }
#left ::-webkit-scrollbar, #right ::-webkit-scrollbar, .legend-box::-webkit-scrollbar { width: 6px; }
#left ::-webkit-scrollbar-thumb, #right ::-webkit-scrollbar-thumb, .legend-box::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 3px; }

/* left: fires */
.drawer-head { padding: 6px 6px 4px 12px; }
.drawer-head b { font-size: 13px; color: var(--fg-2); }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 10px 8px; gap: 4px; background: none; border: 0; border-radius: 0; overflow: visible; }
.kpi { background: var(--card); border-radius: 9px; padding: 5px 7px; gap: 0; }
.kpi b { font-size: 17px; line-height: 1.1; }
.kpi span { font-size: 10.5px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.wide { display: flex; align-items: baseline; gap: 8px; padding: 6px 9px; background: linear-gradient(90deg, rgba(255, 106, 43, 0.2), rgba(255, 106, 43, 0.04)); }
.kpi.wide b { font-size: 24px; }
.kpi.wide span { font-size: 12px; color: var(--fg); display: grid; white-space: normal; }
.kpi.wide span i { font-style: normal; font-size: 10.5px; color: var(--muted); }
.filters { gap: 6px; padding: 0 10px 6px; }
.filters .seg { width: 100%; } .filters .seg button { flex: 1; text-align: center; padding: 4px 6px; font-size: 11.5px; }
.only-chips { gap: 4px; font-size: 11px; } .only-chips > span { display: none; }
.ochip, .lchip { font-size: 11px; padding: 2px 8px; }
.more-filters { border-radius: 9px; background: var(--card); padding: 0 8px; }
.more-filters > summary { cursor: pointer; list-style: none; padding: 5px 0; font-size: 11.5px; color: var(--fg-2); display: flex; align-items: center; gap: 6px; }
.more-filters > summary::-webkit-details-marker { display: none; }
.more-filters > summary::before { content: "+"; width: 14px; height: 14px; display: grid; place-items: center; border-radius: 4px; background: rgba(255, 255, 255, 0.08); font-size: 11px; }
.more-filters[open] > summary::before { content: "–"; }
.more-filters > summary span { color: var(--ember-2); }
.more-filters > summary:focus-visible { outline: 2px solid var(--ember); border-radius: 6px; }
.more-filters[open] { padding-bottom: 8px; display: grid; gap: 6px; }
.more-filters select { padding: 4px 6px; font-size: 11.5px; min-width: 0; }
.more-filters .chk { font-size: 11.5px; color: var(--fg-2); }
.list-head { padding: 4px 12px; font-size: 11px; border-top: 0; }
.fire-list { padding: 0 4px 6px; }
.fire-list li button { padding: 6px 7px; gap: 8px; grid-template-columns: 3px minmax(0, 1fr) auto; }
.fire-list li + li { border-top: 1px solid rgba(255, 255, 255, 0.05); }
.fire-list .t { font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fire-list .m { font-size: 10.5px; gap: 1px 6px; }
.fire-list .r { font-size: 10px; } .fire-list .r b { font-size: 11.5px; }
.src { flex: none; border-top: 1px solid var(--line); }
.src > summary { cursor: pointer; list-style: none; padding: 5px 12px; font-size: 10.5px; color: var(--muted); }
.src > summary::-webkit-details-marker { display: none; }
.src > summary::after { content: " +"; } .src[open] > summary::after { content: " –"; }
.src > summary:focus-visible { outline: 2px solid var(--ember); }
.sources { border-top: 0; padding: 0 12px 8px; font-size: 10.5px; line-height: 1.4; }

/* right: layers, incident, weather */
.tabs { padding: 6px 6px 6px 8px; gap: 2px; border-bottom: 0; }
.tabs button[role="tab"] { padding: 5px 10px; font-size: 12px; border-bottom: 0; border-radius: 8px; }
.tabs button[role="tab"][aria-selected="true"] { background: rgba(255, 255, 255, 0.1); color: var(--fg); }
.tabs .x { margin-bottom: 0; }
.pane { padding: 4px 10px 12px; gap: 8px; }
.legend h4, .pane h4 { font-size: 10.5px; margin: 0 0 4px; color: var(--muted); }
.layers { gap: 0; }
.layers li { grid-template-columns: 15px 18px minmax(0, 1fr) 52px; gap: 7px; padding: 3px 4px; }
.layers input[type="checkbox"] { width: 13px; height: 13px; }
.layers .thumb { width: 18px; height: 14px; border-radius: 3px; }
.layers label { font-size: 12px; } .layers label small { display: none; }
.layers input[type="range"] { width: 52px; height: 12px; }
.legend { gap: 8px; padding-top: 8px; }
.ramp-l { font-size: 9.5px; } .keys { font-size: 11px; gap: 2px 10px; }
.inc-h h3 { font-size: 18px; line-height: 1.15; }
.inc-h .sub { font-size: 11.5px; }
.box { border: 0; background: var(--card); border-radius: 10px; padding: 8px 10px; gap: 6px; }
.box.pred { background: linear-gradient(180deg, rgba(255, 106, 43, 0.13), rgba(255, 106, 43, 0.04)); }
.box.houses { background: linear-gradient(180deg, rgba(255, 18, 56, 0.12), rgba(255, 18, 56, 0.03)); }
.dl { grid-template-columns: 92px minmax(0, 1fr); gap: 3px 8px; font-size: 11.5px; line-height: 1.35; }
.est, .pane .note { font-size: 10.5px; line-height: 1.4; }
.ptab { font-size: 11.5px; } .ptab td { padding: 3px 0; font-size: 11px; } .ptab td b { font-size: 13.5px; } .ptab th { font-size: 10.5px; }
.events li button, .prio button, .windev button { font-size: 11.5px; padding: 4px 5px; }
.prio em, .windev em { font-size: 10.5px; }
.hgrid { gap: 4px; } .hk { padding: 4px 6px; border: 0; border-top: 2px solid var(--c); border-radius: 7px; background: rgba(0, 0, 0, 0.25); } .hk b { font-size: 16px; } .hk span { font-size: 9.5px; }
.danger b { font-size: 16px; } .danger span { font-size: 10.5px; }
.compass { grid-template-columns: 64px minmax(0, 1fr); gap: 10px; } .compass svg { width: 64px; height: 64px; }
.wx-grid { gap: 4px; background: none; border: 0; overflow: visible; }
.wx { background: var(--card); border-radius: 8px; padding: 6px 7px; gap: 0; }
.wx span { font-size: 10px; } .wx b { font-size: 16px; } .wx small { font-size: 9.5px; line-height: 1.25; }
.links a { font-size: 11.5px; }

/* clickable headline numbers */
button.kpi { all: unset; box-sizing: border-box; cursor: pointer; background: var(--card); border-radius: 9px; padding: 5px 7px; display: grid; gap: 0; min-width: 0; border: 1px solid transparent; transition: border-color 0.15s, background 0.15s; }
button.kpi:hover { border-color: rgba(255, 255, 255, 0.25); }
button.kpi.on { border-color: var(--ember); background: color-mix(in srgb, var(--ember) 18%, transparent); }
button.kpi:focus-visible { outline: 2px solid var(--ember); outline-offset: 1px; }
button.kpi.wide { display: flex; align-items: baseline; gap: 8px; padding: 6px 9px; grid-column: 1 / -1; background: linear-gradient(90deg, rgba(255, 106, 43, 0.2), rgba(255, 106, 43, 0.04)); }
button.kpi.wide.on { background: linear-gradient(90deg, rgba(255, 106, 43, 0.38), rgba(255, 106, 43, 0.12)); }

/* filter fields: label on the left, full-width custom dropdown on the right */
.fld { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.more-filters select, .fld select {
  appearance: none; -webkit-appearance: none; width: 100%; min-width: 0; cursor: pointer; font-size: 11.5px; color: var(--fg);
  padding: 5px 24px 5px 8px; border-radius: 7px; border: 1px solid var(--line-2); background-color: #171b22;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23b4bcc6' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 9px 6px; text-overflow: ellipsis;
}
.fld select:hover { border-color: var(--ember); }
.fld select:focus-visible { outline: 2px solid var(--ember); outline-offset: 1px; }
.fld select option { background: #171b22; color: var(--fg); }

/* sliders: a filled track, so "full" is easy to see */
.layers input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; --fill: 100%; }
.layers input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--ember) var(--fill), rgba(255, 255, 255, 0.16) var(--fill)); }
.layers input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 11px; margin-top: -3.5px; border-radius: 50%; background: #fff; border: 2px solid var(--ember); }
.layers input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.16); }
.layers input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--ember); }
.layers input[type="range"]::-moz-range-thumb { width: 8px; height: 8px; border-radius: 50%; background: #fff; border: 2px solid var(--ember); }
.layers input[type="range"]:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; border-radius: 4px; }

/* ============================== tiny chrome: banner, toolbar, legend, timeline ============================== */
:root { --banner-h: 20px; --bar-h: 32px; --tl-h: 52px; --top: calc(var(--banner-h) + var(--bar-h) + 12px); }
body.charts-open { --bottom-h: 212px; }
.banner { font-size: 10.5px; gap: 6px; }
.banner a { padding: 0 7px 0 4px; font-size: 10.5px; } .banner .li { width: 11px; height: 11px; }
.top { top: calc(var(--banner-h) + 6px); gap: 5px; }
.drawer-btn, .burn-toggle { padding: 0 9px; gap: 6px; font-size: 11.5px; border-radius: 9px; }
.drawer-btn svg { width: 14px; height: 14px; } .drawer-btn.icon-only { width: var(--bar-h); padding: 0; }
.brand { padding: 0 9px; gap: 6px; border-radius: 9px; } .brand .logo { width: 16px; height: 16px; }
.brand h1 { font-size: 14px; } .brand p { font-size: 9px; margin-top: 1px; max-width: 150px; }
.search { padding: 0 9px; gap: 6px; border-radius: 9px; flex-basis: 120px; max-width: 380px; }
.search > svg { width: 13px; height: 13px; } .search input { font-size: 12px; }
.burn-toggle input { width: 13px; height: 13px; } .burn-toggle svg { width: 13px; height: 13px; } .burn-toggle b { font-size: 10.5px; padding: 1px 6px; }
.modes { padding: 3px; border-radius: 9px; } .modes button { padding: 0 9px; font-size: 11.5px; border-radius: 6px; gap: 6px; }
#back-row .btn { padding: 4px 10px; font-size: 11.5px; }
.mapstyle { gap: 5px; } .mapstyle .seg { padding: 2px; border-radius: 8px; } .mapstyle .seg button { padding: 3px 8px; font-size: 11px; border-radius: 5px; }

/* timeline */
#bottom { grid-template-rows: 40px minmax(0, 1fr); padding: 5px 10px; gap: 6px; border-radius: 12px; }
.tl { height: 40px; gap: 10px; } .tl-ctl { gap: 5px; }
.tl-track { grid-template-rows: 13px 27px; height: 40px; }
#tl-svg { height: 27px; } #tl-svg text { font-size: 9px; }
.tl-label { font-size: 10.5px; gap: 8px; } .tl-label b { font-size: 10.5px; } #tl-time { font-size: 10.5px; } #tl-range { font-size: 9.5px; }
.btn.icon { width: 26px; height: 26px; font-size: 10px; border-radius: 7px; }
.tl-ctl select { padding: 2px 5px; font-size: 11px; } .tl-ctl .btn.small { padding: 2px 7px; font-size: 11px; } .tl-ctl .chk { font-size: 11px; }
.sheet-handle { height: 20px; top: -12px; padding: 0 10px 0 7px; font-size: 10.5px; } .sheet-handle svg { width: 12px; height: 12px; }

/* legend: one short line per item; the sentence shows when you hover or tap the (i) */
.legend-box { width: 190px; padding: 6px 8px; bottom: calc(var(--bottom-h) + 44px); max-height: calc(100vh - var(--top) - var(--bottom-h) - 96px); }
.lg-head b { font-size: 10.5px; letter-spacing: 0.08em; } .lg-head .link { font-size: 10.5px; margin-left: 4px; }
.lg-hint { display: none; }
.lg-body h5 { margin: 6px 0 1px; font-size: 9.5px; }
.lg-row { grid-template-columns: 20px minmax(0, 1fr) 14px; gap: 6px; min-height: 0; padding: 1.5px 0; align-items: center; }
.lg-sw { width: 20px; height: 14px; border-radius: 4px; overflow: hidden; } .lg-sw svg { max-width: 18px; max-height: 12px; }
.lg-name { padding: 0 2px; } .lg-name b { font-size: 11px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-name span { display: none; }
.lg-row.spot .lg-name span { display: block; font-size: 10px; }
.lg-i { width: 14px; height: 14px; font-size: 9px; }
.lg-all { padding: 4px 6px; font-size: 10.5px; }

/* ============================== theme switch ============================== */
#theme .i-sun { display: none; }
:root[data-theme="light"] #theme .i-sun { display: block; } :root[data-theme="light"] #theme .i-moon { display: none; }

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #e9edf1; --glass: rgba(255, 255, 255, 0.9); --solid: #ffffff; --line: rgba(15, 25, 40, 0.12); --line-2: rgba(15, 25, 40, 0.24);
  --fg: #12161b; --fg-2: #3d4651; --muted: #66707c; --ember: #e2500f; --ember-2: #b45309; --wind: #0b74b3; --hover: rgba(15, 25, 40, 0.06);
  --card: rgba(15, 25, 40, 0.05); --lv-advice: #c99a00;
}
:root[data-theme="light"] .panel { background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 248, 250, 0.92)); border-color: rgba(15, 25, 40, 0.12); box-shadow: 0 14px 40px rgba(15, 25, 40, 0.22), inset 0 1px 0 #fff; }
:root[data-theme="light"] .banner { background: rgba(255, 255, 255, 0.94); }
:root[data-theme="light"] .banner a { background: rgba(15, 25, 40, 0.04); }
:root[data-theme="light"] .brand, :root[data-theme="light"] .search, :root[data-theme="light"] .modes, :root[data-theme="light"] .drawer-btn, :root[data-theme="light"] .burn-toggle,
:root[data-theme="light"] .mapstyle .seg, :root[data-theme="light"] #back-row .btn { box-shadow: 0 4px 14px rgba(15, 25, 40, 0.18); }
:root[data-theme="light"] .seg { background: rgba(15, 25, 40, 0.06); }
:root[data-theme="light"] .seg button[aria-pressed="true"] { background: #12161b; color: #fff; }
:root[data-theme="light"] .btn:hover { color: var(--fg); }
:root[data-theme="light"] .modes button[aria-selected="true"], :root[data-theme="light"] .btn.icon, :root[data-theme="light"] .btn.primary, :root[data-theme="light"] .lg-all,
:root[data-theme="light"] .burn-toggle:has(input:checked) b { color: #fff; }
:root[data-theme="light"] .modes button[aria-selected="true"] .live-dot { background: #fff; }
:root[data-theme="light"] .burn-toggle b { background: rgba(15, 25, 40, 0.08); }
:root[data-theme="light"] .tabs button[role="tab"][aria-selected="true"] { background: rgba(15, 25, 40, 0.09); }
:root[data-theme="light"] .more-filters > summary::before { background: rgba(15, 25, 40, 0.08); }
:root[data-theme="light"] .more-filters select, :root[data-theme="light"] .fld select, :root[data-theme="light"] .fld select option, :root[data-theme="light"] select { background-color: #fff; color: var(--fg); }
:root[data-theme="light"] .more-filters select, :root[data-theme="light"] .fld select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%233d4651' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); }
:root[data-theme="light"] button.kpi:hover { border-color: rgba(15, 25, 40, 0.3); }
:root[data-theme="light"] .fire-list li + li { border-top-color: rgba(15, 25, 40, 0.07); }
:root[data-theme="light"] .hk { background: rgba(15, 25, 40, 0.06); }
:root[data-theme="light"] #left ::-webkit-scrollbar-thumb, :root[data-theme="light"] #right ::-webkit-scrollbar-thumb, :root[data-theme="light"] .legend-box::-webkit-scrollbar-thumb { background: rgba(15, 25, 40, 0.22); }
:root[data-theme="light"] .layers input[type="range"]::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--ember) var(--fill), rgba(15, 25, 40, 0.16) var(--fill)); }
:root[data-theme="light"] #tl-svg > rect:first-of-type { fill: rgba(15, 25, 40, 0.12); }
:root[data-theme="light"] .lg-sw { background: #1b1f26; }
:root[data-theme="light"] #loading { background: #e9edf1; color: var(--fg); }
:root[data-theme="light"] .mapstyle .seg { background: var(--glass); }
:root[data-theme="light"] .maplibregl-ctrl-group { background: #fff; }
.legend-box { width: 204px; }
.lg-head b { letter-spacing: 0.04em; white-space: nowrap; }
:root[data-theme="light"] .maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: none; }

/* rain colour scale */
.rain-scale { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2px 0; font-size: 9.5px; color: var(--fg-2); margin: 1px 0 3px; }
.rain-scale i { grid-column: 1 / -1; height: 7px; border-radius: 2px; border: 1px solid var(--line-2); }
.rain-scale span:nth-of-type(2) { text-align: center; } .rain-scale span:nth-of-type(3) { text-align: right; }
.rain-scale em { grid-column: 1 / -1; font-style: normal; font-size: 9.5px; color: var(--muted); line-height: 1.3; }

/* ============================== glass (default for dark and light) ============================== */
:root { --glass: rgba(16, 19, 25, 0.52); --blur: blur(22px) saturate(170%); --edge: rgba(255, 255, 255, 0.16); --card: rgba(255, 255, 255, 0.06); }
:root[data-theme="light"] { --glass: rgba(255, 255, 255, 0.52); --edge: rgba(255, 255, 255, 0.75); --card: rgba(255, 255, 255, 0.42); }
.panel, .brand, .search, .modes, .drawer-btn, .burn-toggle, .mapstyle .seg, #back-row .btn, .sheet-handle, .maplibregl-ctrl-group {
  background: var(--glass); border: 1px solid var(--edge); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.panel { background: linear-gradient(160deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0) 42%), var(--glass); box-shadow: 0 16px 44px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.14); }
.banner { background: rgba(10, 12, 16, 0.5); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.drawer-btn[aria-expanded="true"], .burn-toggle:has(input:checked) { background: color-mix(in srgb, var(--ember) 24%, var(--glass)); border-color: var(--ember); }
:root[data-theme="light"] .panel { background: linear-gradient(160deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.08) 46%), var(--glass); border-color: var(--edge); box-shadow: 0 16px 40px rgba(15, 25, 40, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.9); }
:root[data-theme="light"] .banner { background: rgba(255, 255, 255, 0.55); }
:root[data-theme="light"] .maplibregl-ctrl-group, :root[data-theme="light"] .mapstyle .seg { background: var(--glass); }
:root[data-theme="light"] .seg { background: rgba(255, 255, 255, 0.35); }
:root[data-theme="light"] .more-filters select, :root[data-theme="light"] .fld select { background-color: rgba(255, 255, 255, 0.7); }
.more-filters select, .fld select { background-color: rgba(10, 12, 16, 0.45); }
.kpi, button.kpi, .box, .wx, .more-filters { border: 1px solid color-mix(in srgb, var(--edge) 45%, transparent); }
button.kpi.on { border-color: var(--ember); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { :root { --glass: rgba(16, 19, 25, 0.9); } :root[data-theme="light"] { --glass: rgba(255, 255, 255, 0.92); } }

/* ============================== settings, profile, legend button, history ============================== */
:root { --ga: 0.52; --glass: rgba(16, 19, 25, var(--ga)); }
:root[data-theme="light"] { --glass: rgba(255, 255, 255, var(--ga)); }
#settings-btn .gear { animation: gear-spin 7s linear infinite; transform-origin: 50% 50%; }
#settings-btn:hover .gear, #settings-btn[aria-expanded="true"] .gear { animation-duration: 1.6s; }
@keyframes gear-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #settings-btn .gear { animation: none; } }
.pop { top: var(--top); right: max(10px, env(safe-area-inset-right, 0px)); width: 300px; max-height: calc(100vh - var(--top) - 16px); z-index: 12; display: flex; flex-direction: column; overflow: hidden; }
#profile.pop { width: 250px; }
.pop-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 6px 4px 12px; flex: none; }
.pop-head b { font: 700 13px var(--font-display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-2); }
.pop-body { overflow-y: auto; padding: 2px 12px 10px; display: grid; gap: 5px; scrollbar-width: thin; }
.pop-body h4 { margin: 8px 0 2px; font: 600 10.5px var(--font-display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ember-2); }
.pop-foot { flex: none; display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line); }
.pop-foot #st-state { margin-right: auto; font-size: 10.5px; color: var(--muted); }
.st-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) 34px; gap: 8px; align-items: center; font-size: 11.5px; }
.st-row output { font: 10.5px var(--font-mono); color: var(--muted); text-align: right; }
.st-row input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; width: 100%; height: 14px; --fill: 100%; }
.st-row input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--ember) var(--fill), rgba(128, 128, 128, 0.35) var(--fill)); }
.st-row input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4px; border-radius: 50%; background: #fff; border: 2px solid var(--ember); }
.st-row input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(128, 128, 128, 0.35); }
.st-row input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--ember); }
.st-colors { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; }
.st-col { display: flex; align-items: center; gap: 6px; font-size: 11px; cursor: pointer; padding: 2px 3px; border-radius: 6px; min-width: 0; }
.st-col span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-col.hl { background: color-mix(in srgb, var(--ember) 22%, transparent); box-shadow: inset 0 0 0 1px var(--ember); }
.st-col input[type="color"] { width: 22px; height: 18px; padding: 0; border: 1px solid var(--line-2); border-radius: 4px; background: none; cursor: pointer; flex: none; }
.pf { display: flex; gap: 10px; align-items: center; } .pf > div { display: grid; } .pf b { font-size: 13.5px; } .pf span { font-size: 11px; color: var(--muted); }
.pf-av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--ember), var(--ember-2)); color: #160a04 !important; font: 700 14px var(--font-display) !important; }
.pf-link { text-decoration: none; text-align: center; }
.btn.small { padding: 3px 9px; font-size: 11.5px; }

.pill-btn { all: unset; box-sizing: border-box; cursor: pointer; padding: 0 10px; border-radius: 8px; font: 600 11px var(--font-display); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-2);
  background: var(--glass); border: 1px solid var(--edge); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); display: inline-flex; align-items: center; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); }
.pill-btn:hover { color: var(--fg); } .pill-btn[aria-pressed="true"] { color: var(--fg); border-color: var(--ember); background: color-mix(in srgb, var(--ember) 22%, var(--glass)); }
.pill-btn:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
.dh-btns { display: inline-flex; gap: 2px; }
body.left-wide { --left-w: min(480px, 46vw); }
body.left-wide.left-open .legend-box { display: none; }

.layers li { grid-template-columns: 15px 18px minmax(0, 1fr); }
.hist-ctl { display: inline-flex; gap: 4px; align-items: center; }
.hist-ctl input[type="date"], .hist-ctl select { padding: 2px 5px; font-size: 11px; border-radius: 7px; border: 1px solid var(--line-2); background: color-mix(in srgb, var(--solid) 60%, transparent); color: var(--fg); height: 24px; }
.hist-ctl input[type="date"] { width: 118px; }
body.hist .hist-ctl input[type="date"] { border-color: var(--ember); }
body.hist #tl-title { color: var(--ember-2); }

.step-scale { display: grid; gap: 2px; margin: 1px 0 3px; }
.step-scale i { height: 7px; border-radius: 2px; border: 1px solid var(--line-2); }
.step-scale .ticks { display: grid; font: 9px var(--font-mono); color: var(--fg-2); }
.step-scale em { font-style: normal; font-size: 9.5px; color: var(--muted); line-height: 1.3; }
.qk-pop { display: grid; gap: 2px; font: 12px/1.35 var(--font-body); color: #14181d; } .qk-pop b { font-size: 14px; } .qk-pop a { color: #0b62c4; }
@media (max-width: 900px) { .hist-ctl, #profile-btn, #left-wide { display: none; } .pop { left: 10px; width: auto; } }

/* a fire with no new satellite heat for 6 hours: the head glow turns cool blue and pulses slowly */
.flare.head.cool i { background: radial-gradient(circle, rgba(226, 246, 255, 0.95) 0%, rgba(98, 180, 226, 0.75) 14%, rgba(58, 134, 189, 0.4) 32%, transparent 66%); animation-duration: 3.2s; }
.flare.head.cool b { background: #e2f6ff; box-shadow: 0 0 18px 7px rgba(98, 180, 226, 0.9); }
.lg-name b { white-space: normal; line-height: 1.2; }
.today { margin-left: 4px; padding: 2px 7px; border-radius: 999px; font: 600 10.5px var(--font-mono); white-space: nowrap; color: var(--fg); background: color-mix(in srgb, var(--ember) 20%, transparent); border: 1px solid color-mix(in srgb, var(--ember) 55%, transparent); }
/* invisible, selectable stand-ins for things drawn on the map */
.pick { all: unset; box-sizing: border-box; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; background: transparent; }
.pick:hover { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85); } .pick:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
.flare b { pointer-events: auto; cursor: help; }

/* buildings near fires (toolbar) and clickable building tiles (incident) */
.risk-toggle select { all: unset; cursor: pointer; font: 600 10.5px var(--font-mono); padding: 1px 4px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--fg); text-transform: none; letter-spacing: 0; }
.risk-toggle select option { color: #14181d; background: #fff; }
.risk-toggle svg { width: 13px; height: 13px; }
.risk-chip { color: #ff5a6e; font-weight: 600; flex-basis: 100%; }
:root[data-theme="light"] .risk-chip { color: #c2132c; }
button.hk { all: unset; box-sizing: border-box; cursor: pointer; display: grid; padding: 4px 6px; border-top: 2px solid var(--c); border-radius: 7px; background: rgba(0, 0, 0, 0.25); min-width: 0; }
button.hk:hover { background: color-mix(in srgb, var(--c) 22%, transparent); }
button.hk.on { background: color-mix(in srgb, var(--c) 32%, transparent); box-shadow: inset 0 0 0 1.5px var(--c); }
button.hk:focus-visible { outline: 2px solid var(--ember); outline-offset: 1px; }
:root[data-theme="light"] button.hk { background: rgba(15, 25, 40, 0.06); }
@media (max-width: 1250px) { .risk-toggle > span { display: none; } }

/* prediction methods */
.tabs button[role="tab"] { padding: 5px 7px; font-size: 11.5px; letter-spacing: 0.05em; }
.mlist { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.mlist li { border-left: 3px solid var(--c); padding: 3px 0 3px 8px; display: grid; gap: 2px; }
.mlist .chk { display: flex; gap: 6px; align-items: flex-start; font-size: 11.5px; line-height: 1.25; cursor: pointer; }
.mlist .chk i, .mlist.compact li > i { flex: none; width: 14px; height: 4px; margin-top: 6px; border-radius: 2px; background: var(--c); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5); }
.mlist .m-res { margin: 0; font-size: 11px; color: var(--fg-2); line-height: 1.35; }
.mlist .m-sc { margin: 0; font-size: 10.5px; color: var(--muted); line-height: 1.35; }
.mlist details { font-size: 10.5px; color: var(--fg-2); }
.mlist summary { cursor: pointer; color: var(--muted); padding: 1px 0; }
.mlist summary:focus-visible { outline: 2px solid var(--ember); border-radius: 4px; }
.mlist details p { margin: 3px 0; line-height: 1.4; }
.mlist.compact li { grid-template-columns: 14px minmax(0, 1fr); gap: 7px; border-left: 0; padding: 1px 0; font-size: 11px; line-height: 1.35; }
.mlist.compact em { font-style: normal; font-size: 10.5px; color: var(--muted); }
.m-all { font-size: 11.5px; margin-top: 2px; }
.p-bar { display: flex; gap: 8px; align-items: center; justify-content: space-between; font-size: 10.5px; color: var(--muted); line-height: 1.3; }
.p-bar .btn { flex: none; }
.mtab { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.mtab th { text-align: right; font-weight: 500; color: var(--muted); padding: 2px 0; } .mtab th:first-child, .mtab td:first-child { text-align: left; }
.mtab td { text-align: right; padding: 2px 0; font-family: var(--font-mono); } .mtab td:first-child { font-family: var(--font-body); }
.mtab td i { display: inline-block; width: 10px; height: 4px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
