:root {
  --bg: var(--tg-theme-bg-color, #0f1115);
  --bg2: var(--tg-theme-secondary-bg-color, #171a21);
  --text: var(--tg-theme-text-color, #e9edf3);
  --muted: var(--tg-theme-hint-color, #8b93a1);
  --accent: var(--tg-theme-button-color, #3b82f6);
  --accent-text: var(--tg-theme-button-text-color, #ffffff);
  --line: rgba(127, 127, 127, 0.18);
  --critical: #ef4444;
  --close: #f97316;
  --medium: #eab308;
  --far: #22c55e;
  --none: #64748b;
  color-scheme: light dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* Status header */
.status {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 12px;
  border-left: 5px solid var(--lvl, var(--none));
  background: linear-gradient(90deg, color-mix(in srgb, var(--lvl, var(--none)) 22%, var(--bg)) 0%, var(--bg) 85%);
  transition: background 0.4s;
}
.status-main { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.status-main > div { min-width: 0; }
.status-emoji { font-size: 22px; }
.status-title { font-weight: 700; font-size: 15px; line-height: 1.2; }
.status-sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-dist { font-weight: 800; font-size: 18px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.level-critical { --lvl: var(--critical); }
.level-close { --lvl: var(--close); }
.level-medium { --lvl: var(--medium); }
.level-far { --lvl: var(--far); }
.level-none { --lvl: var(--none); }
.level-critical .status-title { color: var(--critical); }
.status.level-critical { animation: alarm 1.6s ease-in-out infinite; }
@keyframes alarm { 50% { background-color: color-mix(in srgb, var(--critical) 18%, transparent); } }

.conn { padding: 4px 12px; font-size: 12px; background: color-mix(in srgb, var(--medium) 25%, var(--bg)); }

/* Map */
.map-wrap { position: relative; height: 42vh; min-height: 240px; flex: none; }
#map { position: absolute; inset: 0; background: var(--bg2); }
.leaflet-container { font: inherit; }
.leaflet-control-attribution.leaflet-control {
  background: color-mix(in srgb, var(--bg) 75%, transparent); color: var(--muted); font-size: 10px;
}
.leaflet-control-attribution a { color: var(--muted); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--bg2); color: var(--text); }
.leaflet-popup-content { margin: 10px 12px; font-size: 14px; }
.map-btn {
  position: absolute; right: 8px; bottom: 26px; z-index: 500;
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent); color: var(--text); font-size: 17px; padding: 0;
}
.legend {
  position: absolute; left: 8px; top: 8px; z-index: 500;
  display: flex; gap: 6px; padding: 2px 6px; border-radius: 6px;
  background: color-mix(in srgb, var(--bg) 80%, transparent); font-size: 10px; color: var(--muted); pointer-events: none;
}
.legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 3px; }
.home-dot {
  width: 14px; height: 14px; border-radius: 50%; background: var(--accent);
  border: 2.5px solid #fff; box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 30%, transparent);
}
.threat-pin {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
}
.threat-pin.unconfirmed .threat-svg { opacity: .75; }
.pin-badge {
  position: absolute; right: -5px; top: -5px; min-width: 13px; height: 13px; padding: 0 3px;
  border-radius: 7px; font: 700 9px/13px system-ui, sans-serif; text-align: center;
  background: #475569; color: #fff; box-shadow: 0 0 0 1.5px var(--bg);
}
.pin-badge.ok { background: #16a34a; }
.ver { display: inline-block; white-space: nowrap; font-size: 11px; padding: 1px 6px; border-radius: 6px; background: color-mix(in srgb, var(--muted) 20%, transparent); }
.ver.ok { background: color-mix(in srgb, var(--far) 25%, transparent); color: var(--text); }
.ch-row { display: grid; grid-template-columns: 1fr 70px 40px; gap: 2px 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.ch-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-bar { height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--muted) 20%, transparent); overflow: hidden; }
.ch-bar i { display: block; height: 100%; background: var(--muted); }
.ch-bar i.good { background: var(--far); }
.ch-bar i.mid { background: var(--medium); }
.ch-bar i.bad { background: var(--critical); }
.ch-pct { text-align: right; font-weight: 700; font-size: 13px; background: none !important; }
.ch-pct.good { color: var(--far); } .ch-pct.mid { color: var(--medium); } .ch-pct.bad { color: var(--critical); }
.ch-meta { grid-column: 1 / 4; }
.threat-svg { filter: drop-shadow(0 0 4px var(--lvl)) drop-shadow(0 1px 2px rgba(0,0,0,.6)); transition: transform .3s; }
.threat-pin.fresh { animation: ping 1.4s ease-out infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--lvl) 70%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }
.map-btn-2 { bottom: 66px; font-size: 15px; }

/* District map */
.a-town, .a-village { display: none; }
.z-towns .a-town { display: inline; }
.z-villages .a-village { display: inline; }
.area-label {
  background: transparent; border: 0; box-shadow: none; padding: 0;
  color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .02em;
  text-shadow: 0 0 3px var(--bg), 0 0 3px var(--bg), 0 0 2px var(--bg);
  display: none;
}
.area-label::before { display: none; }
.z-labels .label-raion { display: block; }
.z-villages .label-town { display: block; font-weight: 500; font-size: 10px; }
.zone-fresh { animation: zonePulse 1.8s ease-in-out infinite; }
@keyframes zonePulse { 50% { fill-opacity: 0.12; stroke-opacity: 0.5; } }
.ok-dot { display: inline-block; width: 22px; height: 22px; border-radius: 50%; background: var(--far);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--far) 25%, transparent); vertical-align: middle; }
.status-emoji { display: flex; align-items: center; justify-content: center; width: 36px; }
.item-emoji { display: flex; justify-content: center; }

/* Tabs */
.tabs { display: flex; border-bottom: 1px solid var(--line); background: var(--bg); }
.tab {
  flex: 1; padding: 8px 0; border: 0; background: none; color: var(--muted);
  font: inherit; font-weight: 600; border-bottom: 2px solid transparent;
}
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
main { flex: 1; overflow-y: auto; padding-bottom: env(safe-area-inset-bottom); }
.tab-body { padding: 8px 10px 20px; }

/* Feed */
.feed { display: flex; flex-direction: column; gap: 6px; }
.item {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 1px 8px; align-items: center;
  padding: 7px 10px; border-radius: 10px; background: var(--bg2);
  border-left: 3px solid var(--lvl, var(--none));
}
.item.old { opacity: 0.55; }
.item-emoji { font-size: 16px; line-height: 1; grid-row: 1 / 3; }
.item-title { font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-meta { grid-column: 2 / 4; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-text { grid-column: 1 / 4; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; margin-top: 4px; }
.item:not(.open) .item-text { display: none; }
.rep { padding: 4px 0; border-top: 1px solid var(--line); }
.rep b { color: var(--text); font-weight: 600; }
.chip {
  font-weight: 700; font-size: 12px; padding: 1px 7px; border-radius: 999px; white-space: nowrap; grid-row: 1;
  background: color-mix(in srgb, var(--lvl, var(--none)) 22%, transparent); color: var(--text);
}
.item.clear { --lvl: var(--far); }
.empty { text-align: center; color: var(--muted); padding: 24px 0; }

/* Settings */
.card { background: var(--bg2); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.card-title { font-weight: 700; margin-bottom: 6px; }
.row { display: flex; gap: 6px; margin: 8px 0 6px; }
.btn {
  flex: 1; min-width: 0; padding: 9px 10px; border-radius: 9px; border: 0;
  background: var(--accent); color: var(--accent-text); font: inherit; font-weight: 600;
}
.btn.secondary { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--text); }
#test { width: 100%; margin-top: 10px; }
.field { display: block; margin: 8px 0; font-size: 13px; color: var(--muted); }
.field select {
  display: block; width: 100%; margin-top: 3px; padding: 8px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit;
}
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; z-index: 1000;
  font-size: 14px; max-width: calc(100% - 32px);
}

/* Badge on a pin: how many channels reported it */
.pin-badge { right: -6px; top: -6px; }
.threat-pin.past { width: 10px; height: 10px; }
.track-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lvl); opacity: .55; border: 1px solid rgba(0,0,0,.5); }

/* Address search */
.addr { display: flex; gap: 6px; margin-top: 8px; }
.addr input {
  flex: 1; min-width: 0; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit;
}
.addr .btn { flex: none; }
.addr-results:empty { display: none; }
.addr-results { margin-top: 6px; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); }
.addr-item { display: block; width: 100%; text-align: left; padding: 7px 10px; border: 0; border-top: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit; }
.addr-item:first-child { border-top: 0; }
.addr-item small { display: block; color: var(--muted); font-size: 11.5px; }

/* Choosing the home point full-screen */
.picker-pin, .picker-top, .picker-bar { display: none; }
body.picking .map-wrap { position: fixed; inset: 0; height: auto; z-index: 900; }
body.picking .map-btn, body.picking .legend { display: none; }
body.picking .picker-pin {
  display: block; position: absolute; left: 50%; top: 50%; z-index: 600; pointer-events: none;
  transform: translate(-50%, -100%); filter: drop-shadow(0 3px 4px rgba(0,0,0,.5));
}
body.picking .picker-top {
  display: block; position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  z-index: 600; background: color-mix(in srgb, var(--bg) 88%, transparent); padding: 6px 12px; border-radius: 999px;
  font-size: 13px; white-space: nowrap; pointer-events: none;
}
body.picking .picker-bar {
  display: block; position: absolute; left: 0; right: 0; bottom: 0; z-index: 600;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--bg);
  box-shadow: 0 -4px 16px rgba(0,0,0,.25);
}
.picker-zone { font-weight: 600; text-align: center; }

/* Explicit grid cells: auto-placement mixed the chip into the title cell */
.item-emoji { grid-column: 1; grid-row: 1 / 3; }
.item-title { grid-column: 2; grid-row: 1; }
.item .chip { grid-column: 3; grid-row: 1; justify-self: end; }
.item-meta { grid-row: 2; }
.item-text { grid-row: 3; }
.item-title .was { color: var(--muted); font-weight: 400; }

/* Forecast */
.status-soon { padding: 4px 12px; font-size: 12.5px; font-weight: 600;
  background: color-mix(in srgb, var(--critical) 18%, var(--bg)); }
.item-soon { grid-column: 2 / 4; font-size: 12px; font-weight: 600; color: var(--text); }
.est-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px dashed var(--lvl); opacity: .9; }
.eta-tag { font: 700 9px/12px system-ui, sans-serif; text-align: center; color: var(--text);
  background: color-mix(in srgb, var(--bg) 75%, transparent); border-radius: 4px; }

/* Attack status, feed sections */
.air-bar { padding: 3px 12px; font-size: 12px; font-weight: 600; }
.air-bar.attack { background: color-mix(in srgb, var(--critical) 14%, var(--bg)); }
.air-bar.calm { background: color-mix(in srgb, var(--far) 12%, var(--bg)); color: var(--muted); }
.feed-head { display: block; width: 100%; text-align: left; margin: 4px 2px 0; padding: 0; border: 0; background: none;
  font: 700 11px/1.6 inherit; font-family: inherit; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.feed-toggle { margin-top: 10px; cursor: pointer; }
.ring-tag { font: 700 9px/12px system-ui, sans-serif; text-align: center; opacity: .85;
  text-shadow: 0 0 3px var(--bg), 0 0 3px var(--bg); }
.ghost { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1.5px dashed rgba(255,255,255,.55); opacity: .85; }
.ghost .threat-svg { opacity: .7; }
.pin-badge.down { background: none; box-shadow: none; font-size: 11px; }
.threat-pin.downed .threat-svg { opacity: .35; filter: grayscale(1); }
.ago-tag { font: 600 10px/12px system-ui, sans-serif; text-align: center; color: var(--muted);
  text-shadow: 0 0 3px var(--bg), 0 0 3px var(--bg), 0 0 2px var(--bg); white-space: nowrap; }

/* Shot down / hit marks */
.event-pin { position: relative; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; }
.event-pin .cross { position: absolute; inset: 0; }
.event-pin .boom { font-size: 20px; line-height: 1; filter: drop-shadow(0 0 4px #f97316); animation: boom 1.2s ease-out infinite; }
@keyframes boom { 50% { transform: scale(1.18); } }
.event-tag { position: absolute; top: 25px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  font: 700 9.5px/12px system-ui, sans-serif; color: var(--text); padding: 0 4px; border-radius: 4px;
  background: color-mix(in srgb, var(--bg) 80%, transparent); }
.is-down .event-tag { color: #94a3b8; }

/* =====================================================================
   Design layer (01.10): tokens, motion, ready-made components.
   Only transform/opacity are animated (plus SVG dash flow on course lines).
   ===================================================================== */
:root {
  --brand: #25A99D;               /* "radar" teal, validated vs the dark surface */
  --brand-ink: #0b2a27;
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Unbounded", "Manrope", system-ui, sans-serif;
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --shadow-1: 0 1px 2px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.10);
  --shadow-2: 0 1px 2px rgba(0,0,0,.20), 0 8px 24px rgba(0,0,0,.18), 0 16px 48px rgba(0,0,0,.10);
  --shadow-brand: 0 1px 2px rgba(37,169,157,.18), 0 8px 24px -8px rgba(37,169,157,.55);
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px;
}
html.theme-light { --brand: #0A9A8B; --brand-ink: #e8f7f5;
  --shadow-1: 0 1px 2px rgba(15,23,42,.06), 0 2px 8px rgba(15,23,42,.06);
  --shadow-2: 0 1px 2px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.08), 0 16px 48px rgba(15,23,42,.06); }
body { font-family: var(--font-body); font-feature-settings: "tnum" 1; }
.status-title, .feed-head, .card-title, .picker-zone, .status-dist { font-family: var(--font-display); letter-spacing: -.02em; }
.status-title { font-weight: 700; font-size: 14px; }
.status-dist { font-weight: 700; font-size: 18px; }
.card-title { font-weight: 700; font-size: 13px; }

/* Skeleton while the first state loads */
.skeleton { display: inline-block; height: 12px; border-radius: 6px; vertical-align: middle; position: relative; overflow: hidden;
  background: color-mix(in srgb, var(--muted) 22%, transparent); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 18%, transparent), transparent);
  animation: skel 1.2s var(--ease-out) infinite; }
@keyframes skel { to { transform: translateX(100%); } }

/* Status header: a glow layer pulses (opacity), never the background itself */
.status { position: relative; isolation: isolate; animation: none !important; }
.status::after { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; pointer-events: none;
  background: radial-gradient(120% 140% at 0% 50%, color-mix(in srgb, var(--lvl) 38%, transparent), transparent 70%); }
.status.level-critical::after { animation: alarmGlow 1.6s ease-in-out infinite; }
.status.level-close::after { opacity: .5; }
@keyframes alarmGlow { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.status-emoji svg { animation: none; }
.status.level-critical .status-emoji svg { animation: nudge 1.6s var(--spring) infinite; }
@keyframes nudge { 50% { transform: scale(1.12); } }

/* Tabs — segment with a sliding indicator (Animated Tabs, 21st.dev 24930) */
.tabs { position: relative; margin: 8px 10px 0; padding: 3px; gap: 0; border: 0; border-radius: 12px;
  background: color-mix(in srgb, var(--muted) 14%, var(--bg2)); box-shadow: inset 0 1px 2px rgba(0,0,0,.18); }
.tab-ind { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 9px; z-index: 0;
  background: var(--bg); box-shadow: var(--shadow-1); transition: transform .32s var(--spring); }
.tabs[data-active="settings"] .tab-ind { transform: translateX(100%); }
.tab { position: relative; z-index: 1; border: 0 !important; border-radius: 9px; padding: 7px 0; font-weight: 700; font-size: 13px;
  transition: color .2s var(--ease-out), transform .15s var(--ease-out); }
.tab.active { color: var(--text); }
.tab:hover { color: var(--text); }
.tab:active { transform: scale(.97); }
.tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.tab-body.enter { animation: panelIn .28s var(--ease-out); }
@keyframes panelIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Buttons: every state */
.btn { position: relative; transition: transform .15s var(--ease-out), opacity .15s; box-shadow: var(--shadow-1); }
.btn:hover { opacity: .95; }
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn.secondary { box-shadow: none; }

/* Shimmer Button (MagicUI, 21st.dev 833; same port as ECOHELPER BotCard):
   a conic ray spins behind the button and shows only along its edge. */
.btn.shimmer { overflow: hidden; isolation: isolate; background: transparent; color: var(--accent-text);
  box-shadow: var(--shadow-brand); }
.btn.shimmer::before { content: ""; position: absolute; left: 50%; top: 50%; width: 300%; aspect-ratio: 1; z-index: -2;
  transform: translate(-50%, -50%) rotate(0deg);
  background: conic-gradient(from 225deg, transparent 0, rgba(255,255,255,.95) 90deg, transparent 90deg);
  animation: spinRay 3s linear infinite; }
.btn.shimmer::after { content: ""; position: absolute; inset: 1.5px; z-index: -1; border-radius: inherit;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 100%, white 8%), color-mix(in srgb, var(--accent) 80%, black 20%)); }
.btn.shimmer > span { position: relative; text-shadow: 0 1px 1px rgba(0,0,0,.25); }
@keyframes spinRay { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* Shine Border (MagicUI, 21st.dev 824) on the most dangerous card: light runs along the frame */
.item.shine { position: relative; isolation: isolate; overflow: hidden; border-left-color: transparent; }
.item.shine::before { content: ""; position: absolute; left: 50%; top: 50%; width: 200%; aspect-ratio: 1; z-index: -2;
  transform: translate(-50%, -50%) rotate(0deg);
  background: conic-gradient(from 0deg, transparent 0 70%, var(--lvl) 85%, transparent 100%);
  animation: spinRay 4.5s linear infinite; }
.item.shine::after { content: ""; position: absolute; inset: 1.5px; z-index: -1; border-radius: 9px; background: var(--bg2); }

/* Feed cards: depth, press state, entrance */
.item { box-shadow: var(--shadow-1); transition: transform .15s var(--ease-out); cursor: pointer; }
.item:active { transform: scale(.985); }
.item.enter { animation: itemIn .42s var(--spring) both; }
@keyframes itemIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.chip { font-variant-numeric: tabular-nums; }
.feed-toggle { transition: opacity .15s; }
.feed-toggle:hover { opacity: .8; }
.feed-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.addr-item { transition: transform .15s var(--ease-out), opacity .15s; }
.addr-item:active { transform: scale(.98); }
.addr-item:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.addr input:focus-visible, .field select:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.card { box-shadow: var(--shadow-1); }

/* Map controls: glass, layered shadow, states */
.map-btn { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--shadow-2);
  transition: transform .15s var(--ease-out), opacity .15s; }
.map-btn:hover { opacity: .9; }
.map-btn:active { transform: scale(.92); }
.map-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.legend { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--shadow-1); }

/* Radar over your point (Radar Effect, Aceternity, 21st.dev 10759) */
.radar { position: relative; width: 132px; height: 132px; pointer-events: none; color: var(--brand); }
.radar .ring { position: absolute; left: 50%; top: 50%; border-radius: 50%; transform: translate(-50%, -50%);
  border: 1px solid color-mix(in srgb, currentColor 40%, transparent); }
.radar .ring:nth-child(1) { width: 44px; height: 44px; }
.radar .ring:nth-child(2) { width: 88px; height: 88px; opacity: .7; }
.radar .ring:nth-child(3) { width: 130px; height: 130px; opacity: .45; }
.radar .sweep { position: absolute; inset: 1px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 75%, color-mix(in srgb, currentColor 10%, transparent) 88%, color-mix(in srgb, currentColor 55%, transparent) 100%);
  animation: radarSpin 4s linear infinite; }
.radar .sweep::after { content: ""; position: absolute; left: 50%; top: 0; width: 1.5px; height: 50%; transform: translateX(-50%);
  background: linear-gradient(to top, currentColor, transparent); }
.radar .dot { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: currentColor; border: 2.5px solid #fff; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 30%, transparent), var(--shadow-1); }
.radar.danger { color: var(--critical); }
.radar.danger .sweep { animation-duration: 1.6s; }
@keyframes radarSpin { from { transform: rotate(20deg); } to { transform: rotate(380deg); } }

/* Threat pins: the ping is a ring that scales (not an animated shadow) */
.threat-pin.fresh { animation: none; }
.threat-pin.fresh::before { content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--lvl); animation: ping 1.4s var(--ease-out) infinite; }
@keyframes ping { from { transform: scale(.8); opacity: .9; } to { transform: scale(2.1); opacity: 0; } }
.threat-pin .threat-svg { transition: transform .4s var(--spring); }
/* Ghost drones glide between the per-second updates */
.ghost-marker { transition: transform 1s linear; }
.leaflet-zoom-anim .ghost-marker { transition: none; }
/* Course lines flow in the direction of flight */
.flow { animation: flow 1.1s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -12; } }

/* Toast: springs up from the bottom */
.toast { display: flex; gap: 8px; align-items: center; box-shadow: var(--shadow-2); border-radius: var(--r-md);
  font-weight: 600; transform: translate(-50%, 0); opacity: 1;
  transition: transform .38s var(--spring), opacity .25s var(--ease-out); }
.toast.hidden { display: flex !important; opacity: 0; pointer-events: none; transform: translate(-50%, 24px) scale(.96); }

/* Activity chart: reports per 10 minutes over 3 hours (one series) */
.activity { margin: 2px 2px 8px; }
.activity-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.activity-title { font: 700 11px/1.4 var(--font-display); letter-spacing: .02em; text-transform: uppercase; color: var(--muted); }
.activity-now { font-size: 11px; color: var(--muted); }
.activity-bars { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 38px;
  border-bottom: 1px solid var(--line); }
.activity-bars button { flex: 1; height: 100%; display: flex; align-items: flex-end; padding: 0; border: 0;
  background: none; cursor: pointer; }
.activity-bars i { display: block; width: 100%; border-radius: 4px 4px 0 0; background: var(--brand); opacity: .55;
  transform-origin: bottom; animation: grow .5s var(--spring) both; }
.activity-bars button:last-child i, .activity-bars button.on i { opacity: 1; }
.activity-bars button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.activity-axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: 2px; }
.activity-tip { position: absolute; bottom: calc(100% + 4px); transform: translateX(-50%); white-space: nowrap; pointer-events: none;
  font-size: 11px; font-weight: 600; padding: 3px 7px; border-radius: 6px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-1); }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; }
}

/* =====================================================================
   Full-screen map layout (02.10): the map is the app.
   ===================================================================== */
:root { --sheet-peek: 118px; --sheet-h: 72vh; --glass: color-mix(in srgb, var(--bg) 80%, transparent); }
html, body { height: 100%; overflow: hidden; }
.map-wrap { position: fixed; inset: 0; height: auto; min-height: 0; }
.leaflet-bottom { bottom: var(--sheet-peek); }
.glass, .status, .map-btn, .legend, .sheet, .status-soon, .air-bar, .conn {
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); }

/* Top HUD */
.hud { position: absolute; z-index: 600; top: calc(8px + env(safe-area-inset-top)); left: 8px; right: 54px;
  display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.hud > * { pointer-events: auto; }
.status { border-radius: 14px; border-left: 4px solid var(--lvl, var(--none)); padding: 7px 10px; gap: 8px;
  background: var(--glass); box-shadow: var(--shadow-2); }
.status::after { border-radius: 14px; }
.status-soon, .air-bar, .conn { align-self: flex-start; border-radius: 999px; padding: 3px 10px; font-size: 11.5px;
  font-weight: 700; box-shadow: var(--shadow-1); background: var(--glass); }
.status-soon { background: color-mix(in srgb, var(--critical) 30%, var(--glass)); }
.air-bar.attack { background: color-mix(in srgb, var(--critical) 22%, var(--glass)); }
.air-bar.calm { background: var(--glass); }

/* Right-side tools */
.map-tools { position: absolute; z-index: 600; right: 8px; top: calc(8px + env(safe-area-inset-top));
  display: flex; flex-direction: column; gap: 8px; }
.map-tools .map-btn, .panel-close { position: static; width: 38px; height: 38px; font-size: 17px; background: var(--glass); }
.legend { top: auto; bottom: calc(var(--sheet-peek) + 26px); left: 8px; }

/* Bottom sheet: peeks with the drones in the air, pulls up for all */
.sheet { position: fixed; z-index: 700; left: 0; right: 0; bottom: 0; height: var(--sheet-h);
  border-radius: 18px 18px 0 0; background: color-mix(in srgb, var(--bg) 88%, transparent);
  box-shadow: 0 -1px 0 var(--line), 0 -8px 32px rgba(0,0,0,.28);
  transform: translateY(calc(var(--sheet-h) - var(--sheet-peek)));
  transition: transform .42s var(--spring); display: flex; flex-direction: column; }
.sheet.open { transform: translateY(0); }
.sheet.dragging { transition: none; }
.sheet-handle { flex: none; height: 22px; border: 0; background: none; display: flex; align-items: center;
  justify-content: center; cursor: grab; touch-action: none; }
.sheet-handle i { width: 38px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--muted) 60%, transparent);
  transition: transform .2s var(--ease-out); }
.sheet-handle:active i { transform: scaleX(1.25); }
.sheet-handle:focus-visible { outline: 2px solid var(--brand); outline-offset: -4px; border-radius: 8px; }
.sheet-body { flex: 1; overflow-y: auto; padding: 0 10px calc(14px + env(safe-area-inset-bottom)); overscroll-behavior: contain; }
.sheet:not(.open) .sheet-body { overflow: hidden; }
.sheet .feed-head:first-child { margin-top: 0; }
body.picking .sheet { transform: translateY(110%); }

/* Settings panel */
.panel { position: fixed; inset: 0; z-index: 900; background: var(--bg); display: flex; flex-direction: column;
  animation: panelIn .28s var(--ease-out); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 12px 6px; }
.panel-body { flex: 1; overflow-y: auto; padding: 4px 10px calc(16px + env(safe-area-inset-bottom)); }

/* Labels right on the map: where, how far, how long ago */
.threat-pin { overflow: visible; }
.pin-tag, .dest-tag { position: absolute; top: calc(100% + 3px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  font: 700 10px/13px var(--font-body); padding: 0 5px; border-radius: 5px; color: var(--text);
  background: color-mix(in srgb, var(--bg) 82%, transparent); box-shadow: var(--shadow-1); pointer-events: none; }
.pin-tag b { color: var(--lvl); font-weight: 800; }
.dest-pin { position: relative; width: 12px; height: 12px; }
.dest-tag { top: calc(100% + 1px); font-weight: 600; color: var(--muted); }

/* Compact cards: name + distance, one short line under */
.item { padding: 6px 10px; }
.item-meta { font-size: 11px; }

/* 02.10: touch targets ≥ 38 px, compact sheet list */
.btn { min-height: 40px; }
.sheet-handle { height: 38px; }
:root { --sheet-peek: 132px; }
.item { min-height: 44px; }
.item:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.item:hover { opacity: .95; }
.feed-head { margin: 0 2px 6px; }
.field select { min-height: 40px; }
.addr input { min-height: 40px; }
.note { padding: 4px 4px 0; }
.hit { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; }
