/* Living Roads · Norselabs */
@font-face { font-family: "Orbitron"; src: url("../fonts/orbitron-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Orbitron"; src: url("../fonts/orbitron-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Orbitron"; src: url("../fonts/orbitron-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #141210;
  --panel: rgba(20, 18, 16, 0.78);
  --panel-solid: #141210;
  --line: rgba(239, 232, 220, 0.09);
  --line-2: rgba(239, 232, 220, 0.16);
  --cream: #efe8dc;
  --dim: #cfc6b8;
  --muted: #9a9286;
  --steel: #7eb6d9;
  --gold: #d4a017;
  --orange: #e07a2f;
  --closure: #e5534b;
  --incident: #f08a3c;
  --work: #d4a017;
  --wx: #8fc5e8;
  --cam: #7eb6d9;
  --sign: #f2c66d;
  --air: #b39dfa;
  --speed: #4cc38a;
  --display: "Orbitron", "Audiowide", system-ui, sans-serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 14px;
  --blur: saturate(140%) blur(18px);
  --top-h: 60px;
  --panel-w: 360px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--cream); overflow: hidden; }
body { font: 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: "cv11", "ss01"; }
a { color: var(--orange); text-decoration: none; }
a:hover { color: #f0a15f; text-decoration: underline; text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--steel); outline-offset: 2px; border-radius: 6px; }
::selection { background: #3c342b; color: #f6f0e6; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--panel-solid); padding: 8px 12px; border-radius: 8px; }
.skip:focus { top: 12px; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; color: var(--muted); }

/* Map */
#map { position: fixed; inset: 0; background: var(--bg); }
.vignette { position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(130% 100% at 55% 50%, transparent 60%, rgba(8,7,6,.5) 100%); }
body.base-light .vignette { background: radial-gradient(130% 100% at 55% 50%, transparent 65%, rgba(60,50,40,.18) 100%); }
.maplibregl-ctrl-attrib { background: rgba(20,18,16,.62) !important; color: var(--muted); font: 10.5px/1.4 var(--sans); border-radius: 8px 0 0 0; backdrop-filter: var(--blur); }
.maplibregl-ctrl-attrib a { color: var(--dim); }
.maplibregl-ctrl-attrib-button { filter: invert(.85); }
.maplibregl-ctrl-bottom-right { right: 0; bottom: 0; }
.maplibregl-ctrl-bottom-left .maplibregl-ctrl-scale { background: rgba(20,18,16,.55); color: var(--dim); border-color: var(--muted); font: 10px var(--sans); }
.maplibregl-canvas:focus-visible { outline: 2px solid var(--steel); outline-offset: -2px; }

/* Loader */
#loader { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: radial-gradient(60% 60% at 50% 45%, #1d1a16 0%, #141210 70%); transition: opacity .9s var(--ease), visibility .9s; }
#loader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-inner { text-align: center; padding: 24px; }
.loader-road { width: 120px; height: 60px; margin: 0 auto; position: relative; }
.loader-road svg { width: 120px; height: 60px; overflow: visible; }
.loader-road path { fill: none; stroke-linecap: round; }
.lr-base { stroke: rgba(126,182,217,.55); stroke-width: 7; filter: drop-shadow(0 0 10px rgba(126,182,217,.35)); }
.lr-dash { stroke: var(--gold); stroke-width: 1.6; stroke-dasharray: 5 6; animation: dash 1.1s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -22; } }
.loader-title { font: 600 clamp(26px, 4vw, 40px)/1 var(--display); letter-spacing: .22em; text-transform: uppercase; margin: 20px 0 10px; color: var(--cream); padding-left: .22em; }
.loader-sub { color: var(--muted); margin: 0 0 22px; font-size: 13px; letter-spacing: .04em; }
.loader-list { list-style: none; padding: 0; margin: 0 auto; display: grid; gap: 6px; font-size: 12px; color: var(--muted); min-width: 260px; text-align: left; }
.loader-list li { display: flex; justify-content: space-between; gap: 24px; }
.loader-list li em { font-style: normal; color: var(--muted); }
.loader-list li.ok em { color: var(--steel); }
.loader-list li.fail em { color: #b9a58a; }

/* Top bar */
.topbar { position: fixed; top: 0; left: 0; right: 0; height: var(--top-h); z-index: 30; display: flex; align-items: center; gap: 14px;
  padding: 0 18px; padding-top: env(safe-area-inset-top); pointer-events: none;
  background: linear-gradient(to bottom, rgba(20,18,16,.86), rgba(20,18,16,0)); }
body.base-light .topbar { background: linear-gradient(to bottom, rgba(20,18,16,.78), rgba(20,18,16,0)); }
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.brand-title { font: 600 19px/1 var(--display); letter-spacing: .2em; text-transform: uppercase; white-space: nowrap; color: var(--cream); text-shadow: 0 0 24px rgba(126,182,217,.35); }
.brand-sub { color: var(--muted); font-size: 12.5px; letter-spacing: .04em; white-space: nowrap; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.clock { white-space: nowrap; font: 500 13px/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--cream); letter-spacing: .04em;
  padding: 8px 11px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.mode-chip { display: inline-flex; align-items: center; gap: 7px; font: 600 10.5px/1 var(--display); letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold); padding: 8px 10px 8px 9px; border-radius: 999px; background: rgba(212,160,23,.08); border: 1px solid rgba(212,160,23,.28); cursor: default; }
.mode-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 0 rgba(212,160,23,.6); animation: beat 2s infinite; }
@keyframes beat { 0% { box-shadow: 0 0 0 0 rgba(212,160,23,.55); } 70% { box-shadow: 0 0 0 7px rgba(212,160,23,0); } 100% { box-shadow: 0 0 0 0 rgba(212,160,23,0); } }

.icon-btn { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; cursor: pointer; padding: 0;
  background: var(--panel); border: 1px solid var(--line); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); transition: border-color .2s, background .2s, color .2s; }
.icon-btn:hover { border-color: var(--line-2); background: rgba(34,31,27,.9); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--cream); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn[aria-pressed="true"] { border-color: rgba(212,160,23,.55); background: rgba(212,160,23,.14); color: var(--gold); }
.icon-btn .txt { font: 600 11px/1 var(--display); letter-spacing: .08em; }

/* Search */
.search { position: relative; margin-left: 18px; flex: 0 1 380px; min-width: 200px; height: 38px; display: flex; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 11px; backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); transition: border-color .2s, box-shadow .2s; }
.search:focus-within { border-color: rgba(126,182,217,.5); box-shadow: 0 0 0 3px rgba(126,182,217,.12); }
.search > svg { width: 16px; height: 16px; margin: 0 8px 0 12px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; flex: none; }
.search input { flex: 1; min-width: 0; height: 100%; background: transparent; border: 0; outline: none; color: var(--cream); font-size: 13.5px; }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { filter: invert(.6); }
.q-key { margin-right: 10px; }
.search:focus-within .q-key { display: none; }
.q-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none; max-height: 60vh; overflow: auto;
  background: rgba(20,18,16,.96); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,.5); backdrop-filter: var(--blur); }
.q-results li { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.q-results li[aria-selected="true"], .q-results li:hover { background: rgba(239,232,220,.07); }
.q-results .qi { width: 28px; height: 22px; border-radius: 6px; display: grid; place-items: center; font: 600 9.5px/1 var(--display); letter-spacing: .02em; color: #141210; background: var(--steel); }
.q-results .qi.city { background: var(--dim); }
.q-results .qi.road { background: transparent; border: 1.5px solid var(--steel); color: var(--steel); }
.q-results .qi.air { background: var(--air); }
.q-results b { font-weight: 560; font-size: 13px; display: block; }
.q-results i { font-style: normal; color: var(--muted); font-size: 11px; }
.q-results .qn { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.q-results .empty { display: block; color: var(--muted); font-size: 12px; cursor: default; }
.search-btn { display: none; }

/* Panel */
.panel { position: fixed; z-index: 25; top: calc(var(--top-h) + 6px); left: 14px; bottom: 14px; width: var(--panel-w);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 24px 60px rgba(0,0,0,.45); transform: translateX(calc(-100% - 24px)); opacity: 0; visibility: hidden;
  transition: transform .5s var(--ease), opacity .4s var(--ease), visibility .5s; display: flex; flex-direction: column; overflow: hidden; }
.panel.open { transform: none; opacity: 1; visibility: visible; }
.panel-grab { display: none; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 10px 12px 0; flex: none; }
.tabs button { border: 0; background: transparent; padding: 9px 6px 10px; border-radius: 9px 9px 0 0; cursor: pointer; color: var(--muted);
  font: 600 10.5px/1 var(--display); letter-spacing: .16em; text-transform: uppercase; border-bottom: 2px solid transparent; transition: color .2s, border-color .2s; }
.tabs button:hover { color: var(--cream); }
.tabs button[aria-selected="true"] { color: var(--cream); border-bottom-color: var(--gold); }
.tabs button b { font: 600 9.5px/1 var(--display); color: var(--gold); letter-spacing: .04em; margin-left: 3px; }
.panel-scroll { overflow-y: auto; padding: 14px 16px 14px; border-top: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: #3a352f transparent; overscroll-behavior: contain; flex: 1; }
.kicker { font: 600 10px/1 var(--display); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.kicker .asof { margin-left: auto; font: 500 10.5px/1 var(--sans); letter-spacing: .02em; text-transform: none; color: var(--muted); }
.link-btn { margin-left: auto; background: none; border: 0; padding: 0; color: var(--orange); cursor: pointer; font: 500 11px/1 var(--sans); letter-spacing: 0; text-transform: none; }
.link-btn:hover { color: #f0a15f; text-decoration: underline; }
.summary { padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.stat { text-align: left; border: 0; background: transparent; padding: 5px 6px; margin: 0 -6px; border-radius: 9px; cursor: pointer; }
.stat:hover { background: rgba(239,232,220,.05); }
.stat b { display: block; font: 600 22px/1.1 var(--display); color: var(--cream); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 11.5px; }
.c-closure { color: var(--closure) !important; } .c-incident { color: var(--incident) !important; } .c-work { color: var(--work) !important; }
.c-wx { color: var(--wx) !important; } .c-air { color: var(--air) !important; }
.headline { margin: 10px 0 0; padding-left: 10px; border-left: 2px solid rgba(212,160,23,.55); color: var(--dim); font: 400 12.5px/1.5 var(--sans); }
.headline:empty { display: none; }

/* Filters */
.filters { padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.f-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.f-lbl { color: var(--muted); font-size: 11px; display: block; margin-bottom: 4px; }
.f-row .f-lbl { margin: 0; width: 52px; flex: none; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: rgba(239,232,220,.03); color: var(--muted); padding: 5px 9px; border-radius: 999px; cursor: pointer; font-size: 12px; transition: all .2s; }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); opacity: .45; }
.chip[aria-pressed="true"] { color: var(--cream); border-color: color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 14%, transparent); }
.chip[aria-pressed="true"] i { opacity: 1; box-shadow: 0 0 8px var(--c); }
.sev3 { --c: var(--closure); } .sev2 { --c: var(--incident); } .sev1 { --c: #c9b98f; }
.f-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.f-field { display: block; min-width: 0; }
.f-wide { grid-column: 1 / -1; }
select, .f-field input { width: 100%; height: 32px; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(10,9,8,.5); color: var(--cream); padding: 0 9px; font-size: 12.5px; outline: none; }
select { appearance: none; -webkit-appearance: none; padding-right: 26px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 13px) 13px, calc(100% - 9px) 13px; background-size: 4px 4px; background-repeat: no-repeat; }
select option { background: #1b1916; }
select:focus, .f-field input:focus { border-color: rgba(126,182,217,.55); }
.check { display: flex; align-items: center; gap: 9px; margin-top: 10px; font-size: 12.5px; color: var(--dim); cursor: pointer; user-select: none; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check span { width: 30px; height: 17px; border-radius: 999px; background: #2a2622; border: 1px solid var(--line-2); position: relative; flex: none; transition: background .25s; }
.check span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: var(--muted); transition: transform .25s var(--ease), background .25s; }
.check input:checked + span { background: rgba(126,182,217,.28); border-color: rgba(126,182,217,.5); }
.check input:checked + span::after { transform: translateX(13px); background: var(--steel); }
.check input:focus-visible + span { outline: 2px solid var(--steel); outline-offset: 2px; }
.check kbd { margin-left: auto; }

/* Layers */
.layer { border-bottom: 1px solid var(--line); padding: 10px 0; }
.layer:last-child { border-bottom: 0; }
.layer-head { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; }
.layer-name { display: flex; align-items: center; gap: 9px; min-width: 0; cursor: pointer; }
.layer-name .sw { width: 18px; height: 18px; flex: none; display: grid; place-items: center; }
.layer-name .sw svg { width: 18px; height: 18px; }
.layer-name strong { font-weight: 560; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.count { font: 600 12px/1 var(--display); color: var(--cream); background: rgba(239,232,220,.06); border: 1px solid var(--line); padding: 5px 7px; border-radius: 7px; font-variant-numeric: tabular-nums; min-width: 30px; text-align: center; }
.layer.off .count, .layer.off .layer-name { opacity: .45; }
.chev { width: 26px; height: 26px; border: 0; background: transparent; border-radius: 7px; cursor: pointer; display: grid; place-items: center; color: var(--muted); padding: 0; }
.chev:hover { background: rgba(239,232,220,.06); color: var(--cream); }
.chev svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .3s var(--ease); }
.layer.expanded .chev svg { transform: rotate(180deg); }
.layer-meta { margin: 5px 0 0 46px; font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.layer-meta .tag { font: 600 9px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; padding: 3px 5px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--muted); }
.layer-meta .tag.live { color: var(--gold); border-color: rgba(212,160,23,.4); }
.layer-meta .err { font-style: italic; color: #b9a58a; }
.layer-more { display: none; margin: 8px 0 2px 46px; font-size: 11.5px; color: var(--muted); }
.layer.expanded .layer-more { display: block; }
.layer-more p { margin: 0 0 6px; }
.layer-more ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 3px; }
.layer-more li { display: flex; justify-content: space-between; gap: 8px; }
.layer-more li .bad { color: #b9a58a; font-style: italic; }
.layer-more li .kept { color: #c9a86a; font-style: normal; font-size: 10.5px; }
.layer-more .subchips { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.layer-more .subchips .chip { padding: 3px 8px; font-size: 11px; }

/* Toggle switch */
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #2a2622; border: 1px solid var(--line-2); transition: background .25s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .25s var(--ease), background .25s; }
.switch input:checked + span { background: rgba(126,182,217,.28); border-color: rgba(126,182,217,.5); }
.switch input:checked + span::after { transform: translateX(16px); background: var(--steel); }
.switch input:focus-visible + span { outline: 2px solid var(--steel); outline-offset: 2px; }

.opts { padding: 14px 0 12px; border-top: 1px solid var(--line); margin-top: 2px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 7px 6px; cursor: pointer; font-size: 12px; border-right: 1px solid var(--line); transition: background .2s, color .2s; }
.seg button:last-child { border-right: 0; }
.seg button[aria-checked="true"] { background: rgba(126,182,217,.18); color: var(--cream); }
.seg-wrap { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); }
.seg-wrap button { border-bottom: 1px solid var(--line); }
.help { padding: 14px 0 4px; border-top: 1px solid var(--line); }
.help p { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 2; }
kbd { font: 500 10.5px/1 var(--mono); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 2px 5px; margin: 0 1px; color: var(--cream); background: rgba(239,232,220,.04); }
.credits { padding-top: 12px; color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); margin-top: 10px; }
.credits p { margin: 6px 0; }

/* Events list */
.ev-tools { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 12px; }
.ev-tools .check { margin: 0 0 7px; }
.ev-count { color: var(--muted); font-size: 11.5px; margin: 10px 0 6px; }
.evlist { list-style: none; margin: 0; padding: 0; }
.evlist li button { width: 100%; display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; text-align: left;
  border: 0; background: transparent; padding: 7px 6px; border-radius: 9px; cursor: pointer; }
.evlist li button:hover, .evlist li button:focus-visible, .evlist li button.sel { background: rgba(239,232,220,.06); }
.evlist .ico { width: 30px; height: 30px; display: grid; place-items: center; }
.evlist .ico svg { width: 26px; height: 26px; }
.evlist .t { min-width: 0; }
.evlist .t b { display: block; font-weight: 500; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.evlist .t i { display: block; font-style: normal; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.evlist .r { font: 600 10px/1 var(--display); color: var(--muted); letter-spacing: .04em; text-align: right; white-space: nowrap; }
.evlist li.more { font-size: 11.5px; color: var(--muted); padding: 8px 6px; }

/* States */
.choro-legend { margin: 12px 0 4px; }
.choro-legend .bar { height: 7px; border-radius: 4px; }
.choro-legend .lbl { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.stategrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 12px; }
.stategrid button { position: relative; border: 1px solid var(--line); border-radius: 8px; padding: 7px 6px 6px; text-align: left; cursor: pointer; background: color-mix(in srgb, var(--h, transparent) 100%, transparent); transition: transform .15s, border-color .2s; overflow: hidden; }
.stategrid button:hover { border-color: var(--line-2); transform: translateY(-1px); }
.stategrid button.sel { border-color: var(--gold); }
.stategrid button b { display: block; font: 600 11px/1 var(--display); letter-spacing: .06em; color: var(--cream); }
.stategrid button span { display: block; margin-top: 4px; font: 600 13px/1 var(--display); color: var(--cream); font-variant-numeric: tabular-nums; }
.stategrid button.nofeed { background: repeating-linear-gradient(135deg, rgba(239,232,220,.035) 0 4px, transparent 4px 8px); }
.stategrid button.nofeed span { color: var(--muted); font: 500 10px/1 var(--sans); margin-top: 5px; }
.note { margin-top: 12px; font-size: 11.5px; color: var(--muted); }

/* Detail card */
.card { position: fixed; z-index: 28; top: calc(var(--top-h) + 6px); right: 14px; width: 380px; max-height: calc(100% - var(--top-h) - 120px);
  overflow: auto; background: rgba(20,18,16,.88); border: 1px solid var(--line-2); border-radius: var(--r); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 30px 70px rgba(0,0,0,.5); animation: cardIn .45s var(--ease); scrollbar-width: thin; scrollbar-color: #3a352f transparent; }
.card[hidden] { display: none; }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.card-close { position: absolute; top: 10px; right: 10px; z-index: 2; width: 32px; height: 32px; border-radius: 9px; }
.card-photo { position: relative; aspect-ratio: 16 / 10; background: #0d0c0b; overflow: hidden; border-radius: var(--r) var(--r) 0 0; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; animation: fade .6s; }
.card-photo figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 14px 8px; font-size: 10.5px; color: rgba(239,232,220,.85);
  background: linear-gradient(to top, rgba(0,0,0,.7), transparent); display: flex; justify-content: space-between; gap: 10px; }
.card-photo .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
@keyframes fade { from { opacity: 0; } }
.card-inner { padding: 18px 20px 18px; }
.card .kicker { color: var(--c, var(--steel)); margin-bottom: 12px; padding-right: 36px; }
.card .kicker::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--steel)); box-shadow: 0 0 10px var(--c, var(--steel)); flex: none; }
.card h2 { font: 600 22px/1.22 var(--serif); margin: 0 0 6px; color: var(--cream); letter-spacing: .005em; padding-right: 30px; }
.card .sub { color: var(--muted); font-size: 12.5px; margin: 0 0 4px; }
.card .pill { display: inline-flex; align-items: center; gap: 6px; font: 600 10px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; padding: 5px 8px; border-radius: 999px;
  color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 10%, transparent); margin: 6px 6px 0 0; }
.card .big { display: flex; align-items: baseline; gap: 10px; margin: 8px 0 6px; }
.card .big b { font: 600 36px/1 var(--display); color: var(--c, var(--gold)); letter-spacing: .01em; }
.card .big span { color: var(--muted); font-size: 12px; }
.card dl { display: grid; grid-template-columns: 96px 1fr; gap: 7px 12px; margin: 14px 0 0; font-size: 13px; }
.card dt { color: var(--muted); }
.card dd { margin: 0; color: var(--cream); font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.card dd small { color: var(--muted); }
.card .desc { color: var(--dim); font-size: 13px; margin: 12px 0 0; white-space: pre-line; }
.card .desc.clamp { display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }
.card .more-btn { background: none; border: 0; padding: 4px 0 0; color: var(--orange); cursor: pointer; font-size: 12px; }
.card .links { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.card .links a::after { content: " →"; }
.card .note { margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.card .nearby { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.card .nearby .kicker::before { display: none; }
.card .nearby .kicker { color: var(--muted); padding: 0; margin-bottom: 6px; }
.card .nearby button { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: center; width: calc(100% + 16px); margin: 0 -8px; text-align: left; border: 0; background: transparent; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.card .nearby button:hover { background: rgba(239,232,220,.055); }
.card .nearby svg { width: 20px; height: 20px; }
.card .nearby b { display: block; font-weight: 500; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .nearby i { display: block; font-style: normal; font-size: 11px; color: var(--muted); }
/* Message sign rendering */
.vms { margin: 12px 0 2px; background: #050505; border-radius: 10px; padding: 14px 12px; border: 6px solid #22201d; box-shadow: inset 0 0 0 1px #000, 0 6px 20px rgba(0,0,0,.4);
  font: 700 17px/1.35 var(--mono); color: #ffb627; letter-spacing: .12em; text-align: center; text-transform: uppercase; text-shadow: 0 0 6px rgba(255,182,39,.55);
  background-image: radial-gradient(rgba(255,255,255,.035) 1px, transparent 1.2px); background-size: 4px 4px; white-space: pre; overflow-x: auto; }
.vms + .vms { margin-top: 6px; }
.vms-cap { font-size: 11px; color: var(--muted); margin-top: 6px; }
/* Speed gauge */
.gauge { display: flex; gap: 2px; margin: 8px 0 2px; height: 6px; }
.gauge i { flex: 1; border-radius: 2px; background: rgba(239,232,220,.1); }

/* Quick jumps */
.jumpbar { position: fixed; z-index: 24; left: 50%; bottom: 16px; transform: translateX(-50%); max-width: calc(100% - 300px);
  display: flex; align-items: center; gap: 4px; padding: 6px; overflow-x: auto; scrollbar-width: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: 0 20px 50px rgba(0,0,0,.4);
  transition: left .5s var(--ease); }
.jumpbar::-webkit-scrollbar { display: none; }
body.panel-open .jumpbar { left: calc(50% + (var(--panel-w) + 14px) / 2 - 120px); max-width: calc(100% - var(--panel-w) - 330px); }
@media (min-width: 761px) { body:not(.panel-open) .jumpbar { left: calc(50% - 110px); } }
.jumpbar button { flex: none; border: 0; background: transparent; color: var(--dim); font-size: 12.5px; padding: 8px 11px; border-radius: 11px; cursor: pointer; white-space: nowrap; transition: background .2s, color .2s; }
.jumpbar button:hover { background: rgba(239,232,220,.07); color: var(--cream); }
.jumpbar button.region { font: 600 10.5px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); padding: 10px 11px; }
.jumpbar button.on { background: rgba(212,160,23,.14); color: var(--cream); }
.jumpbar .sep { width: 1px; height: 22px; background: var(--line-2); flex: none; margin: 0 4px; }

/* Map controls */
.mapctl { position: fixed; z-index: 24; right: 14px; top: calc(var(--top-h) + 14px); display: flex; flex-direction: column; gap: 6px; transition: right .45s var(--ease); }
body.card-open .mapctl { right: 408px; }

/* Legend */
.legend { position: fixed; z-index: 22; right: 14px; bottom: 58px; width: 212px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: 0 16px 40px rgba(0,0,0,.35); overflow: hidden; }
.legend-head { width: 100%; display: flex; align-items: center; justify-content: space-between; border: 0; background: transparent; cursor: pointer; padding: 9px 12px;
  font: 600 10px/1 var(--display); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.legend-head svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .3s var(--ease); }
.legend.collapsed .legend-head svg { transform: rotate(180deg); }
.legend.collapsed .legend-body { display: none; }
body.card-open .legend { opacity: 0; pointer-events: none; transform: translateY(8px); }
.legend { transition: opacity .3s, transform .3s; }
.legend-body { padding: 0 12px 10px; display: grid; gap: 6px; font-size: 11.5px; color: var(--dim); max-height: min(38vh, 300px); overflow: auto; scrollbar-width: thin; }
.legend-body .row { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: center; }
.legend-body .row svg { width: 20px; height: 20px; }
.legend-body .ln { height: 4px; border-radius: 2px; width: 20px; }
.legend-body .ramp { height: 6px; border-radius: 3px; margin-top: 2px; }
.legend-body .ramp-lbl { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.legend-body .grp { font: 600 9px/1 var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }

/* Wordmark */
.wordmark { position: fixed; z-index: 20; right: 18px; bottom: 22px; opacity: .78; transition: opacity .2s; }
.wordmark:hover { opacity: 1; }
.wordmark img { display: block; width: 112px; height: auto; mix-blend-mode: screen; }
body.base-light .wordmark img { mix-blend-mode: normal; filter: drop-shadow(0 0 6px rgba(20,18,16,.6)); }

/* Hover tip */
.maptip { position: fixed; z-index: 40; pointer-events: none; font: 12px/1.35 var(--sans); color: var(--cream); background: rgba(20,18,16,.94); border: 1px solid var(--line-2);
  border-radius: 8px; padding: 6px 9px; box-shadow: 0 6px 24px rgba(0,0,0,.4); max-width: 300px; transform: translate(12px, 12px); }
.maptip b { font-weight: 600; display: block; }
.maptip span { color: var(--muted); }

/* Toast */
.toast { position: fixed; z-index: 50; left: 50%; top: calc(var(--top-h) + 14px); transform: translate(-50%, -8px); opacity: 0; pointer-events: none;
  background: rgba(20,18,16,.95); border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 14px; font-size: 12.5px; transition: opacity .3s, transform .3s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Keys dialog */
.keys-dlg { background: rgba(20,18,16,.97); color: var(--cream); border: 1px solid var(--line-2); border-radius: 16px; padding: 22px 24px; width: min(440px, 92vw); box-shadow: 0 40px 90px rgba(0,0,0,.6); }
.keys-dlg::backdrop { background: rgba(8,7,6,.55); backdrop-filter: blur(3px); }
.keys-dlg h2 { font: 600 13px/1 var(--display); letter-spacing: .2em; text-transform: uppercase; margin: 0 0 16px; }
.keys-dlg dl { display: grid; grid-template-columns: 110px 1fr; gap: 9px 14px; margin: 0 0 18px; font-size: 13px; }
.keys-dlg dd { margin: 0; color: var(--dim); }
.btn { border: 1px solid rgba(212,160,23,.45); background: rgba(212,160,23,.1); color: var(--gold); border-radius: 999px; padding: 8px 16px; cursor: pointer; font: 600 10.5px/1 var(--display); letter-spacing: .16em; text-transform: uppercase; }

/* Responsive */
@media (max-width: 1280px) {
  .brand-sub { display: none; }
  .jumpbar { max-width: calc(100% - var(--panel-w) - 120px); }
}
@media (max-width: 1100px) {
  .wordmark { display: none; }
  .legend { bottom: 14px; }
}
@media (max-width: 760px) {
  :root { --top-h: 54px; }
  .topbar { padding: 0 10px; gap: 8px; }
  .brand-title { font-size: 13px; letter-spacing: .12em; }
  .clock { font-size: 11.5px; padding: 7px 9px; }
  .clock .cd, .clock .cs { display: none; }
  .topbar-right { gap: 6px; }
  .mode-chip { padding: 7px 8px; }
  .mode-chip span { display: none; }
  .search { position: fixed; left: 10px; right: 10px; top: calc(var(--top-h) + 4px + env(safe-area-inset-top)); margin: 0; display: none; z-index: 35; }
  body.searching .search { display: flex; }
  .search-btn { display: grid; }
  .q-key { display: none; }
  .panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 62vh; max-height: 62vh; border-radius: 20px 20px 0 0; border-bottom: 0;
    transform: translateY(calc(100% - 118px - env(safe-area-inset-bottom))); opacity: 1; visibility: visible; padding-bottom: env(safe-area-inset-bottom); background: rgba(20,18,16,.92); transition: transform .45s var(--ease); }
  .panel.open { transform: none; }
  .panel-grab { display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 8px auto 0; flex: none; cursor: grab; }
  .panel-grab::after { content: ""; display: block; height: 22px; margin-top: -10px; }
  .tabs { padding-top: 4px; }
  .panel-scroll { padding-top: 12px; }
  .jumpbar, body.panel-open .jumpbar { left: 0; right: 0; transform: none; max-width: none; top: calc(var(--top-h) + env(safe-area-inset-top)); bottom: auto; border-radius: 0; background: transparent; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 2px 10px 6px; }
  .jumpbar button { background: var(--panel); border: 1px solid var(--line); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); padding: 7px 10px; font-size: 12px; }
  .jumpbar button.region { padding: 8px 10px; }
  .jumpbar .sep { display: none; }
  body.searching .jumpbar { visibility: hidden; }
  .mapctl { top: calc(var(--top-h) + 56px); transform: none; right: 10px; }
  .mapctl #fsBtn { display: none; }
  body.card-open .mapctl { right: 10px; }
  .legend { display: none; }
  .card { top: auto; left: 8px; right: 8px; bottom: calc(126px + env(safe-area-inset-bottom)); width: auto; max-height: 52vh; border-radius: 18px; z-index: 31; }
  .card h2 { font-size: 19px; }
  .card .big b { font-size: 30px; }
  .card-photo { aspect-ratio: 16 / 9; }
  .wordmark { display: none; }
  .stategrid { grid-template-columns: repeat(5, 1fr); }
  .maplibregl-ctrl-bottom-right { bottom: calc(118px + env(safe-area-inset-bottom)); }
  .maplibregl-ctrl-bottom-left { bottom: calc(118px + env(safe-area-inset-bottom)); }
}
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
