:root {
  --bg: #0a0b0d;
  --glass: rgba(18, 16, 14, 0.78);
  --glass-strong: rgba(17, 18, 21, 0.96);
  --surface: #1a1c20;
  --surface-2: #23262b;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f5f6;
  --text-2: #c9ccd1;
  --muted: #8d939c;
  --accent: #e3000f;
  --accent-soft: rgba(227, 0, 15, 0.16);
  --ok: #34c759;
  --top: 60px;
  --foot: 28px;
  --radius: 12px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

#map { position: fixed; inset: 0 0 var(--foot) 0; }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--top); z-index: 20;
  display: flex; align-items: center; gap: 10px; padding: 0 16px;
  background: var(--glass); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 19px; letter-spacing: -0.4px; margin-right: 10px; flex: none; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.nav { display: flex; gap: 2px; flex: none; }
.nav-btn {
  display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 0; border-radius: 8px;
  background: transparent; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.nav-btn:hover, .menu.open .nav-btn { background: rgba(255, 255, 255, 0.08); }
.chev { width: 12px; height: 12px; stroke-width: 1.8; transition: transform .15s; }
.menu.open .chev { transform: rotate(180deg); }
.badge { background: var(--accent); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 6px; line-height: 18px; }
.badge:empty { display: none; }

.menu { position: relative; }
.dropdown {
  display: none; position: absolute; top: calc(100% + 8px); left: 0; min-width: 290px; z-index: 30;
  background: var(--glass-strong); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 8px; max-height: calc(100vh - 110px); overflow-y: auto;
}
.dropdown {
  display: block; opacity: 0; visibility: hidden; transform: translateY(-6px) scale(0.98); transform-origin: top left;
  transition: opacity .18s ease, transform .18s cubic-bezier(.2,.8,.2,1), visibility 0s linear .18s;
}
.menu.open .dropdown { opacity: 1; visibility: visible; transform: none; transition: opacity .18s ease, transform .22s cubic-bezier(.2,.8,.2,1); }
.panel-bar .menu .dropdown { transform-origin: top right; }
.dd-head { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 6px; }
.dd-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; cursor: pointer; user-select: none; }
.dd-row:hover { background: rgba(255, 255, 255, 0.06); }
.dd-row input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.dd-row img, .dd-row .sw { width: 20px; height: 20px; flex: none; }
.dd-row .label { flex: 1; }
.dd-row .count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.dd-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.dd-foot { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px 4px; }
.link-btn { background: none; border: 0; color: #8fc1ff; cursor: pointer; padding: 0; font-size: 13px; }
.sources { font-size: 12px; color: var(--muted); padding: 4px 10px 6px; }
.sources div { display: flex; justify-content: space-between; gap: 10px; }
.sources .bad { color: #ff6b6b; }

.search {
  flex: 1; max-width: 420px; margin-left: auto; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid transparent; border-radius: 10px;
}
.search:focus-within { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.11); }
.search svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text); font: inherit; }
.search input::placeholder { color: #a5aab2; }

.live { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); flex: none; white-space: nowrap; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.live.ok .live-dot { background: var(--ok); box-shadow: 0 0 0 0 rgba(52, 199, 89, .6); animation: pulse 2.4s infinite; }
.live.bad .live-dot { background: #ff9f0a; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52,199,89,.55); } 70% { box-shadow: 0 0 0 7px rgba(52,199,89,0); } 100% { box-shadow: 0 0 0 0 rgba(52,199,89,0); } }

.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line-strong); background: transparent; border-radius: 10px; cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; }
.mobile-only { display: none; }

/* ---------- Side panel ---------- */
.panel {
  position: fixed; top: calc(var(--top) + 12px); left: 12px; bottom: calc(var(--foot) + 12px); width: 370px; z-index: 10;
  display: flex; flex-direction: column; background: var(--glass-strong); border: 1px solid var(--line-strong);
  border-radius: 14px; box-shadow: var(--shadow); overflow: hidden;
}
.panel-bar { display: flex; align-items: center; gap: 8px; padding: 10px; border-bottom: 1px solid var(--line); min-height: 56px; }
.panel-title { font-weight: 700; font-size: 15px; flex: 1; padding-left: 4px; }
.panel-title small { color: var(--muted); font-weight: 500; margin-left: 4px; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 9px;
  border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13px; white-space: nowrap;
}
.pill-btn:hover { background: var(--surface-2); }
.pill-btn svg { width: 15px; height: 15px; }
.panel-bar .menu .dropdown { left: auto; right: 0; min-width: 230px; }
.panel-bar .spacer { flex: 1; }
.panel-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.panel-body::-webkit-scrollbar { width: 8px; }
.panel-body::-webkit-scrollbar-thumb { background: #3a3d43; border-radius: 8px; }

select.sort { height: 34px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); padding: 0 8px; font: inherit; font-size: 13px; }

/* Fire danger summary card */
.fdr-card { margin: 12px; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.fdr-card h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); display: flex; justify-content: space-between; }
.fdr-card h4 button { text-transform: none; letter-spacing: 0; }
.fdr-rows { display: grid; gap: 6px; }
.fdr-row { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 3px 4px; border-radius: 6px; }
.fdr-row:hover { background: rgba(255,255,255,.05); }
.fdr-row .name { flex: 1; font-size: 13px; }
.fdr-row .st { font-size: 11px; color: var(--muted); width: 30px; }
.tfb { font-size: 11px; font-weight: 700; color: #fff; background: #b00020; padding: 1px 6px; border-radius: 4px; }
.fdr-empty { color: var(--muted); font-size: 13px; }

.rating { display: inline-block; font-size: 11.5px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; padding: 2px 8px; border-radius: 5px; color: #000; white-space: nowrap; }
.rating.none { background: #3a3d43; color: #c9ccd1; }

/* Incident list */
.group-head { position: sticky; top: 0; z-index: 1; padding: 8px 14px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: #141518; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }
.item { display: flex; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.item:hover { background: rgba(255,255,255,.04); }
.item.sel { background: var(--accent-soft); }
.item img, .item .burnt-swatch { width: 28px; height: 28px; flex: none; margin-top: 1px; }
.burnt-swatch { background: #1a1a1a; border: 2px solid #5d5d5d; border-radius: 6px; }
.item-text { min-width: 0; flex: 1; }
.item-title { font-weight: 650; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-sub { color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-meta { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 12px; margin-top: 2px; }
.state { font-size: 10.5px; font-weight: 700; padding: 0 5px; border-radius: 4px; background: #2c2f35; color: #d7dade; line-height: 17px; }
.empty { padding: 30px 20px; text-align: center; color: var(--muted); }

/* Detail view */
.detail { padding: 16px; }
.d-head { display: flex; gap: 12px; align-items: flex-start; }
.d-head img, .d-head .burnt-swatch { width: 40px; height: 40px; flex: none; }
.d-head h2 { margin: 0; font-size: 17px; line-height: 1.3; font-weight: 700; }
.d-type { display: flex; align-items: center; gap: 8px; margin: 10px 0 14px; color: var(--text-2); font-size: 14px; flex-wrap: wrap; }
.level-chip { font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; padding: 3px 9px; border-radius: 5px; color: #000; }
.times { display: grid; gap: 8px; margin-bottom: 14px; }
.time { display: flex; gap: 10px; align-items: flex-start; }
.time svg { width: 18px; height: 18px; margin-top: 2px; color: var(--text-2); flex: none; }
.time b { font-weight: 700; }
.time small { display: block; color: var(--muted); font-size: 12.5px; }
.kv { display: grid; grid-template-columns: 112px 1fr; gap: 7px 12px; font-size: 13.5px; padding: 14px 0; border-top: 1px solid var(--line); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 42px; border: 0; border-radius: 10px;
  background: var(--accent); color: #fff; font-weight: 700; cursor: pointer; margin: 4px 0 6px;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary svg { width: 18px; height: 18px; }
.btn-secondary {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 40px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-weight: 600; text-decoration: none; margin-bottom: 6px;
}
.btn-secondary:hover { background: var(--surface-2); }
.btn-secondary svg { width: 16px; height: 16px; }
.section { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 10px; }
.section h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.richtext { font-size: 14px; color: var(--text-2); line-height: 1.55; }
.richtext b, .richtext strong { color: var(--text); }
.richtext ul, .richtext ol { padding-left: 20px; margin: 6px 0 10px; }
.richtext li { margin: 3px 0; }
.richtext p, .richtext div { margin: 0 0 8px; }
.richtext a { color: #8fc1ff; }
details.raw { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
details.raw summary { cursor: pointer; padding: 10px 12px; font-weight: 600; font-size: 13px; background: var(--surface); }
details.raw table { width: 100%; border-collapse: collapse; font-size: 12px; }
details.raw td { padding: 6px 12px; border-top: 1px solid var(--line); vertical-align: top; word-break: break-word; }
details.raw td:first-child { color: var(--muted); width: 38%; font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; }
.fdr-days { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.fdr-days td { padding: 8px 0; border-top: 1px solid var(--line); }
.fdr-days td:last-child { text-align: right; }
.note { color: var(--muted); font-size: 12px; margin-top: 10px; }

/* Legend */
.legend {
  position: fixed; right: 56px; bottom: calc(var(--foot) + 12px); z-index: 10; padding: 10px 12px;
  background: var(--glass-strong); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow); font-size: 12px;
}
.legend h5 { margin: 0 0 6px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.legend .lg { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.legend .sw { width: 14px; height: 14px; border-radius: 3px; }

.disclaimer {
  position: fixed; inset: auto 0 0 0; height: var(--foot); z-index: 20;
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 12px;
  background: #050506; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.disclaimer b { color: #fff; }

/* Hideable notice bar + sidebar */
.disclaimer-x { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; padding: 0; }
.disclaimer-x:hover { background: rgba(255,255,255,.1); color: #fff; }
.disclaimer-x svg { width: 14px; height: 14px; }
.disclaimer { transition: transform .3s ease, opacity .3s ease; }
body.no-disclaimer { --foot: 0px; }
body.no-disclaimer .disclaimer { transform: translateY(100%); opacity: 0; pointer-events: none; }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 9px; background: var(--surface); flex: none; }
.icon-btn.sm:hover { background: var(--surface-2); }
.icon-btn.sm svg { width: 16px; height: 16px; }
.panel-show {
  display: none; position: fixed; top: calc(var(--top) + 12px); left: 12px; z-index: 10; height: 40px; padding: 0 14px;
  align-items: center; gap: 8px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--glass-strong);
  box-shadow: var(--shadow); font-weight: 650; cursor: pointer;
}
.panel-show svg { width: 17px; height: 17px; }
.panel { transition: transform .38s cubic-bezier(.2,.8,.2,1), opacity .25s ease; }
body.panel-collapsed .panel { transform: translateX(calc(-100% - 24px)); opacity: 0; pointer-events: none; }
.panel-show { display: flex; opacity: 0; transform: translateX(-12px); pointer-events: none; transition: opacity .25s ease .1s, transform .3s cubic-bezier(.2,.8,.2,1) .1s; }
body.panel-collapsed .panel-show { opacity: 1; transform: none; pointer-events: auto; }

.toast { position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%); z-index: 40; background: #fff; color: #000; font-weight: 600; padding: 8px 14px; border-radius: 10px; box-shadow: var(--shadow); }

/* Map controls */
.maplibregl-ctrl-group { background: var(--glass-strong) !important; border: 1px solid var(--line-strong); }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line) !important; }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); }
.maplibregl-ctrl-bottom-right { bottom: 0; }
.maplibregl-ctrl-attrib { font-size: 10px; background: rgba(0,0,0,.5) !important; color: #aaa; }
.maplibregl-ctrl-attrib a { color: #ccc; }
.maplibregl-ctrl-attrib-button { filter: invert(1); }

@media (max-width: 900px) {
  .live #liveText { display: none; }
  .brand span { display: none; }
}
@media (max-width: 720px) {
  :root { --top: 56px; }
  .topbar { padding: 0 10px; gap: 6px; }
  .nav-btn { padding: 0 8px; font-size: 13px; }
  .search { max-width: none; }
  .search input::placeholder { color: transparent; }
  .mobile-only { display: grid; }
  .live { display: none; }
  .panel-show, body.panel-collapsed .panel-show { display: none; }
  .panel { display: none; left: 8px; right: 8px; width: auto; top: calc(var(--top) + 8px); bottom: calc(var(--foot) + 8px); }
  body.panel-open .panel { display: flex; }
  .dropdown { position: fixed; left: 8px; right: 8px; top: calc(var(--top) + 6px); min-width: 0; }
  .legend { right: 8px; left: auto; bottom: calc(var(--foot) + 110px); }
  .disclaimer { font-size: 10px; }
}

/* ---------- Motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { opacity: 0; transform: scale(.92); } 100% { opacity: 1; transform: none; } }
.detail.anim { animation: slide-in .32s cubic-bezier(.2,.8,.2,1); }
.list-anim .item, .list-anim .fdr-card { animation: rise .35s cubic-bezier(.2,.8,.2,1) both; }
.item { transition: background .15s ease, transform .15s ease; }
.item:hover { transform: translateX(2px); }
.legend:not([hidden]) { animation: pop .3s cubic-bezier(.2,.8,.2,1); }
.toast:not([hidden]) { animation: rise .25s ease; }
.btn-primary, .btn-secondary, .pill-btn, .chip, .nav-btn { transition: background .15s ease, filter .15s ease, transform .1s ease; }
.btn-primary:active, .btn-secondary:active, .pill-btn:active { transform: scale(.98); }
.maplibregl-popup .maplibregl-popup-content { animation: pop .2s cubic-bezier(.2,.8,.2,1); }
/* Popups sit above the wind animation and edge vignette. */
.maplibregl-popup { z-index: 5; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Fire weather ---------- */
.sw.dot-hot { width: 12px; height: 12px; margin: 0 4px; border-radius: 50%; background: #ff2a00; box-shadow: 0 0 0 4px rgba(255,42,0,.25); }
.sw.spread-sw { width: 20px; height: 14px; border-radius: 50%; background: rgba(255,59,48,.3); border: 1.5px dashed #ff6b5e; }
.wx-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.wx-grid > div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wx-grid span { font-size: 11px; color: var(--muted); }
.wx-grid b { font-size: 16px; font-weight: 700; white-space: nowrap; }
.wx-grid small { font-size: 11px; font-weight: 500; color: var(--muted); }
.wx-grid em { font-style: normal; font-size: 11px; color: var(--text-2); }
.spread-box { display: flex; gap: 12px; align-items: center; margin-top: 10px; padding: 12px; border-radius: 12px; background: rgba(255,59,48,.1); border: 1px solid rgba(255,107,94,.35); }
.heading-arrow { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #ff3b30; color: #fff; transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.heading-arrow svg { width: 20px; height: 20px; stroke-width: 2.6; }
.spread-main { font-weight: 700; }
.spread-sub { font-size: 12.5px; color: var(--text-2); }

/* Small map popups (stations, hotspots) */
.maplibregl-popup.mini .maplibregl-popup-content { background: var(--glass-strong); color: var(--text); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; box-shadow: var(--shadow); }
.maplibregl-popup.mini .maplibregl-popup-tip { border-top-color: var(--glass-strong) !important; border-bottom-color: var(--glass-strong) !important; }
.maplibregl-popup.mini .maplibregl-popup-close-button { color: var(--muted); }
.mini-title { font-weight: 700; padding-right: 14px; }
.mini-sub { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.mini-grid { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 13px; }
.mini-grid span { color: var(--muted); }
.mini-note { font-size: 11.5px; color: var(--muted); margin-top: 6px; }

@media (max-width: 720px) {
  .wx-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Soft vignette over the map edges */
#map::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse at 60% 50%, transparent 55%, rgba(5, 7, 11, 0.55) 100%);
}
.sw.dot-hot { background: radial-gradient(circle, #fff1e0 0 25%, #ff6a2a 45%, rgba(255,90,20,0) 72%); box-shadow: none; width: 18px; height: 18px; margin: 0 1px; }

/* Fire danger card: other states summary */
.fdr-others { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.fdr-row.other .name small { color: var(--muted); font-size: 11px; margin-left: 2px; }

/* Icons inside dropdown rows (e.g. the Actions menu) */
.dd-row > svg { width: 18px; height: 18px; flex: none; color: var(--text-2); }

/* Recentre button next to zoom + compass */
.recenter-btn { display: grid !important; place-items: center; color: #fff; }
.recenter-btn svg { width: 17px; height: 17px; stroke-width: 1.8; }

/* "View all areas on the map" link in the fire danger card */
.fdr-more { width: 100%; margin-top: 8px; padding: 7px 10px; border-radius: 8px; border: 1px dashed var(--line-strong); background: transparent; color: #8fc1ff; font-size: 12.5px; cursor: pointer; }
.fdr-more:hover { background: rgba(143, 193, 255, 0.08); }

/* Animated wind canvas sits over the map imagery but never blocks clicks */
.windfx { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.sw.flow-sw { width: 20px; height: 14px; background: repeating-linear-gradient(160deg, transparent 0 4px, rgba(255,240,180,.9) 4px 5.5px, transparent 5.5px 9px); border-radius: 3px; }

/* White outline icons in the Layers menu */
.menu-ico { width: 20px; height: 20px; flex: none; fill: #fff; stroke: none; opacity: 0.92; }

/* Base map picker */
.basemaps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 2px 8px 6px; }
.basemap { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px; border-radius: 10px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 12px; color: var(--text-2); }
.basemap:hover { background: rgba(255,255,255,.05); }
.basemap.on { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.bm-thumb { width: 100%; height: 44px; border-radius: 7px; border: 1px solid rgba(255,255,255,.12); }
.bm-satellite { background: radial-gradient(circle at 30% 40%, #5b6b3a 0 18%, transparent 40%), radial-gradient(circle at 70% 70%, #6b4e2e 0 20%, transparent 45%), linear-gradient(135deg, #2c3a22, #3c3324 60%, #1d2a3a); }
.bm-topo { background: repeating-radial-gradient(circle at 40% 55%, transparent 0 6px, rgba(150,120,80,.45) 6px 7px), linear-gradient(135deg, #efe9da, #dfe8d2); }

/* ---------- Accounts ---------- */
.account-slot { flex: none; }
.signin-btn { height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-weight: 650; cursor: pointer; }
.signin-btn:hover { background: var(--surface-2); }
.avatar-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: linear-gradient(135deg, #e3000f, #ff7a45); color: #fff; font-weight: 800; cursor: pointer; }
.account-slot .dropdown { left: auto; right: 0; transform-origin: top right; min-width: 240px; }
.account-dd .dd-head { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
a.dd-row { color: inherit; text-decoration: none; }

.account-dialog { width: min(560px, calc(100vw - 24px)); max-height: min(720px, calc(100vh - 40px)); padding: 0; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--glass-strong); color: var(--text); box-shadow: var(--shadow); }
.account-dialog::backdrop { background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(3px); }
.account-dialog[open] { animation: pop .22s cubic-bezier(.2,.8,.2,1); }
.dlg { display: flex; flex-direction: column; max-height: inherit; }
.dlg-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 0 14px; border-bottom: 1px solid var(--line); }
.dlg-tabs { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.dlg-tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 12px; color: var(--muted); font-weight: 650; cursor: pointer; white-space: nowrap; }
.dlg-tab.on { color: var(--text); border-bottom-color: var(--accent); }
.dlg-body { padding: 16px 18px 20px; overflow-y: auto; }
.dlg-body h2 { margin: 0 0 6px; font-size: 18px; }
.dlg-body h3 { margin: 20px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.muted { color: var(--text-2); }
.small { font-size: 12.5px; }
.warn { color: #ffb020; }
.danger-text { color: #ff6b6b !important; }

.signin-form { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.signin-form input, .ze-name, .ze-rules select, .admin input[type=search] {
  flex: 1; min-width: 200px; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: #0f1115; color: var(--text); font: inherit;
}
.signin-form .btn-primary { width: auto; padding: 0 16px; margin: 0; }
.form-msg { margin-top: 10px; font-size: 13px; color: #ff8080; min-height: 1em; }
.form-msg.ok { color: #7ee2a0; }
.form-msg a { color: #8fc1ff; }

.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btn-primary.sm { width: auto; height: 36px; padding: 0 14px; margin: 0; }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.pill-btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.pill-btn.danger { color: #ff8080; border-color: rgba(255, 107, 107, .35); }
.empty-box { padding: 16px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--muted); text-align: center; margin: 10px 0; }

/* Toggle switch */
.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #3a3d43; transition: background .18s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .18s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }

/* Segmented unit picker */
.unit-group { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.unit-label { font-weight: 600; }
.seg { display: inline-flex; background: #0f1115; border: 1px solid var(--line-strong); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; color: var(--text-2); padding: 6px 12px; border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 13px; }
.seg button.on { background: var(--surface-2); color: var(--text); }

.zone-list { margin: 12px 0; display: grid; gap: 8px; }
.zone-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.zone-row.off { opacity: .6; }
.zone-main { flex: 1; min-width: 0; }
.zone-name { font-weight: 700; }
.alert-list { display: grid; gap: 6px; }
.alert-row { display: flex; flex-direction: column; padding: 8px 10px; background: var(--surface); border-radius: 8px; }

/* Floating zone editor */
.zone-editor {
  position: fixed; left: 50%; bottom: calc(var(--foot) + 18px); transform: translateX(-50%); z-index: 25; width: min(460px, calc(100vw - 24px));
  background: var(--glass-strong); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow); padding: 14px; display: grid; gap: 10px;
  animation: rise .25s cubic-bezier(.2,.8,.2,1);
}
.ze-head { display: flex; flex-direction: column; gap: 2px; }
.ze-radius { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.ze-radius input { flex: 1; accent-color: var(--accent); }
.ze-radius b { min-width: 64px; text-align: right; }
.ze-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 13px; }
.ze-rules select { grid-column: 1 / -1; height: 36px; }
.ze-rules label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.ze-rules input { accent-color: var(--accent); }
.zone-editor .btn-row { justify-content: flex-end; margin-top: 0; }
body.editing-zone #map .maplibregl-canvas { cursor: crosshair; }

/* Brand: "Aus" white, "Incidents" red; logo mark has a transparent background */
.brand-red { color: #ff1f2d; font-style: normal; }
.brand img { border-radius: 0; }

/* Auth forms */
.auth-form { display: grid; gap: 8px; margin-top: 14px; }
.auth-form input { height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: #0f1115; color: var(--text); font: inherit; }
.auth-form .btn-primary { margin: 4px 0 0; }
.auth-form .btn-primary.sm { justify-self: start; }
.auth-links { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 12px; }
