/* Locally hosted variable fonts: no third-party request in the Mini App. */
@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/static/fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/static/fonts/manrope-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Manrope;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/static/fonts/manrope-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

:root {
  --bg: #0a1012;
  --bg-soft: #0f171a;
  --panel: rgba(17, 26, 29, .94);
  --panel-solid: #111a1d;
  --card: #172226;
  --card-2: #1c2b2f;
  --line: rgba(184, 213, 206, .11);
  --line-strong: rgba(184, 213, 206, .23);
  --text: #edf5f1;
  --muted: #a2b5b0;
  --faint: #7c9690;
  --accent: #b8f3d5;
  --accent-soft: rgba(184, 243, 213, .09);
  --accent-2: #8cd7dc;
  --accent-2-soft: rgba(140, 215, 220, .09);
  --gold: #efd29a;
  --danger: #ff8d86;
  --danger-soft: rgba(255, 141, 134, .1);
  --ok: #a5ebc7;
  --shadow: 0 24px 70px rgba(0, 0, 0, .24);
  --radius: 24px;
  --radius-sm: 14px;
  --header-h: calc(84px + env(safe-area-inset-top, 0px));
  --nav-h: 82px;
  --dock-w: 370px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  --font: Manrope, 'Segoe UI Variable', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 500 14px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #dcffe9; }
button:disabled { cursor: not-allowed; }
::selection { background: rgba(184, 243, 213, .22); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

.icon {
  width: 20px;
  height: 20px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
  pointer-events: none;
}
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 28px; height: 28px; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
#app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; min-height: 0; }

/* Navigation ------------------------------------------------------------- */
.app-header {
  flex: 0 0 var(--header-h);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 22px;
  padding: env(safe-area-inset-top, 0px) 30px 0;
  position: relative;
  z-index: 1200;
  background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark {
  position: relative;
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid rgba(184, 243, 213, .28);
  border-radius: 16px;
  color: var(--accent);
  background: linear-gradient(145deg, #263e35, #15271f);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
  transition: transform .5s var(--spring), box-shadow .3s;
}
.brand:hover .brand-mark { transform: rotate(-8deg); box-shadow: 0 0 24px var(--accent-soft); }
.brand-mark .icon { width: 27px; height: 27px; }
.brand-copy { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: -.8px; line-height: 1.2; white-space: nowrap; }
.brand-sub { margin-top: 4px; font-size: 10px; color: var(--faint); letter-spacing: .035em; white-space: nowrap; }
.top-nav {
  position: relative;
  display: flex;
  gap: 4px;
  margin: 0 auto;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #10181b;
  isolation: isolate;
}
.top-nav::before, .bottom-nav::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: 5px;
  bottom: 5px;
  left: 0;
  width: var(--nav-width, 96px);
  transform: translateX(var(--nav-x, 5px));
  background: #22332d;
  border: 1px solid rgba(184, 243, 213, .1);
  border-radius: 13px;
  transition: transform .5s var(--ease), width .5s var(--ease);
}
.nav-link, .bottom-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 13px;
  padding: 10px 16px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  transition: color .25s, transform .3s var(--ease);
}
.nav-link:hover { color: var(--text); }
.nav-link.is-active, .bottom-link.is-active { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-right: 6px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  transition: color .3s, background .3s;
}
.live-dot, .signal-dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--gold); }
.live-pill[data-state='online'] { color: var(--accent); background: var(--accent-soft); }
.live-pill[data-state='online'] .live-dot { background: var(--ok); animation: signal 3s ease-out infinite; }
.live-pill[data-state='offline'] { color: var(--danger); background: var(--danger-soft); }
.live-pill[data-state='offline'] .live-dot { background: var(--danger); }
@keyframes signal { 0% { box-shadow: 0 0 0 0 rgba(165, 235, 199, .3); } 65%, 100% { box-shadow: 0 0 0 6px rgba(165, 235, 199, 0); } }
.icon-button, .tool-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #121c1f;
  color: var(--muted);
  transition: color .25s, border-color .25s, background .25s, transform .3s var(--ease);
}
.icon-button:hover, .tool-button:hover { color: var(--accent); background: #1c2a28; border-color: var(--line-strong); transform: translateY(-2px); }
.icon-button.is-off { color: var(--faint); }
.icon-button .icon, .tool-button .icon { width: 18px; height: 18px; }
.icon-button:active, .tool-button:active, .button:active { transform: scale(.94); }
.bottom-nav { display: none; }

/* Map workspace ---------------------------------------------------------- */
.shell-main { position: relative; flex: 1 1 auto; min-height: 0; }
.view { position: absolute; inset: 0; display: none; }
.view.is-active { display: block; }
.view-map { overflow: hidden; background: var(--bg); }
.map-canvas {
  position: absolute;
  inset: 0 calc(var(--dock-w) + 36px) 18px 18px;
  z-index: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #182222;
  transition: right .45s var(--ease);
}
.map-canvas::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 450;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 18, 18, .86), rgba(8, 18, 18, .1) 240px, transparent 45%, rgba(8, 18, 18, .4));
  border-radius: inherit;
}
.view-map.is-dock-collapsed .map-canvas { right: 18px; }
.leaflet-container { background: #182222; font-family: var(--font); }
.leaflet-tile-pane { filter: brightness(.72) contrast(1.12) sepia(.12); }
.leaflet-control-attribution { background: rgba(10, 16, 18, .8) !important; color: var(--faint) !important; font-size: 9px !important; padding: 2px 8px !important; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-bottom.leaflet-right { bottom: 12px; right: 12px; }
.leaflet-control-zoom { border: 1px solid var(--line) !important; border-radius: 14px !important; overflow: hidden; box-shadow: var(--shadow) !important; }
.leaflet-bar a { width: 36px !important; height: 36px !important; line-height: 36px !important; background: #142123 !important; color: var(--muted) !important; border-color: var(--line) !important; font-weight: 400 !important; }
.leaflet-bar a:hover { background: #243734 !important; color: var(--accent) !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel-solid); color: var(--text); }
.leaflet-popup-content-wrapper { border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: var(--shadow); }
.leaflet-popup-content { font-size: 12px; line-height: 1.8; }
.leaflet-popup-content b { color: var(--accent); }
.map-top {
  position: absolute;
  z-index: 700;
  top: 30px;
  left: 48px;
  right: calc(var(--dock-w) + 66px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
  pointer-events: none;
}
.map-overview { display: flex; align-items: center; gap: 36px; width: 100%; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 10px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.map-heading .eyebrow { display: flex; align-items: center; gap: 8px; color: #c0d6cb; font-size: 9px; }
.signal-dot { background: var(--accent); }
.map-heading h1 { margin: 0; font-size: clamp(25px, 2.65vw, 42px); font-weight: 800; letter-spacing: -.055em; line-height: 1.16; }
.map-heading h1 span { color: var(--accent); }
.map-description { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.map-readout { display: flex; align-items: center; gap: 12px; padding-left: 26px; border-left: 1px solid var(--line-strong); margin-left: auto; }
.map-readout strong { color: var(--accent); font-size: 44px; font-weight: 600; line-height: 1; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.map-readout.has-threats strong { color: var(--danger); }
body[data-connection='offline'] .signal-dot { background: var(--danger); }
body[data-connection='offline'] .map-readout strong { color: var(--faint); }
.readout-label { color: var(--muted); font-size: 10px; line-height: 1.6; }
.filter-bar {
  position: relative;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  padding: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  border: 1px solid var(--line-strong);
  border-radius: 17px;
  background: rgba(14, 24, 25, .9);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .16);
  backdrop-filter: blur(18px);
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-chip { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 13px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); white-space: nowrap; font-size: 11px; font-weight: 750; transition: color .25s, background .25s, transform .3s var(--ease); }
.filter-chip:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.filter-chip.is-active { color: #13261f; background: var(--accent); }
.chip-count { min-width: 20px; height: 20px; display: inline-grid; place-items: center; padding: 0 5px; border-radius: 7px; background: rgba(255, 255, 255, .06); color: var(--faint); font-size: 10px; font-weight: 800; font-variant-numeric: tabular-nums; }
.filter-chip.is-active .chip-count { color: #234536; background: rgba(15, 47, 30, .09); }
.map-tools { position: absolute; z-index: 700; left: 38px; bottom: 38px; display: flex; gap: 8px; }
.tool-button { background: rgba(17, 29, 30, .9); backdrop-filter: blur(12px); }
.tool-button.is-loading { pointer-events: none; color: var(--accent); }
.tool-button.is-loading .icon { animation: spin 1s linear infinite; }
.map-caption { position: absolute; z-index: 690; left: 48px; bottom: 97px; display: flex; align-items: center; gap: 9px; color: #bdcec6; font-size: 10px; pointer-events: none; }
.map-caption .icon { width: 14px; height: 14px; color: var(--accent); }
.caption-sep { color: var(--faint); }
.map-legend { position: absolute; z-index: 690; left: 152px; right: calc(var(--dock-w) + 108px); bottom: 39px; display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 9px; pointer-events: none; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.legend-item i { width: 5px; height: 5px; border-radius: 50%; display: inline-block; }

/* Live feed -------------------------------------------------------------- */
.event-dock {
  position: absolute;
  z-index: 710;
  top: 0;
  right: 18px;
  bottom: 18px;
  width: var(--dock-w);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(160deg, #162124, #101a1c 60%);
  transform-origin: bottom right;
  transition: opacity .25s, transform .45s var(--ease), visibility .45s;
}
.event-dock.is-collapsed { opacity: 0; transform: translateX(30px) scale(.97); visibility: hidden; pointer-events: none; }
.dock-handle { display: none; }
.dock-head { display: flex; align-items: center; gap: 12px; padding: 26px 23px 20px; border-bottom: 1px solid var(--line); }
.dock-head > div { flex: 1; }
.dock-head .eyebrow { color: var(--faint); margin-bottom: 6px; font-size: 9px; letter-spacing: .12em; }
.dock-head h2 { margin: 0; font-size: 21px; font-weight: 750; letter-spacing: -.045em; }
.count-pill { min-width: 28px; height: 28px; display: inline-grid; place-items: center; padding: 0 8px; border: 1px solid rgba(184, 243, 213, .17); border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 750; font-variant-numeric: tabular-nums; }
.dock-collapse { width: 30px; height: 30px; border-radius: 10px; background: transparent; border-color: transparent; }
.dock-collapse .icon { width: 15px; height: 15px; }
.event-list { flex: 1; display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; padding: 14px; overscroll-behavior: contain; }
.dock-foot { display: flex; align-items: flex-start; gap: 9px; padding: 16px 22px 20px; border-top: 1px solid var(--line); background: rgba(0, 0, 0, .08); }
.dock-foot .icon { width: 15px; height: 15px; color: var(--faint); margin-top: 2px; }
.dock-foot p { margin: 0; color: var(--faint); font-size: 10px; line-height: 1.7; }
.dock-fab { position: absolute; z-index: 720; right: 38px; bottom: 38px; display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 15px; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--panel); color: var(--accent); box-shadow: var(--shadow); backdrop-filter: blur(18px); font-size: 12px; font-weight: 750; }
.dock-fab .count-pill { min-width: 24px; height: 24px; border-radius: 8px; }
.event-card {
  --threat: var(--faint);
  position: relative;
  flex: none;
  overflow: hidden;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .008));
  color: var(--text);
  text-align: left;
  transition: border-color .25s, background .25s, transform .35s var(--ease), box-shadow .25s;
}
.event-card::before { content: ''; position: absolute; top: 19px; bottom: 19px; left: 0; width: 2px; background: var(--threat); border-radius: 0 3px 3px 0; }
.event-card[data-id] { cursor: pointer; }
.event-card[data-id]:hover { border-color: color-mix(in srgb, var(--threat) 40%, transparent); background: rgba(255, 255, 255, .055); transform: translateY(-2px); }
.event-card.is-selected { border-color: color-mix(in srgb, var(--threat) 55%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--threat) 9%, transparent); }
.event-card.is-fresh { animation: cardPulse 2.8s ease-out; }
@keyframes cardPulse { 0%, 100% { box-shadow: none; } 25% { box-shadow: 0 0 28px color-mix(in srgb, var(--threat) 22%, transparent); border-color: var(--threat); } }
.event-card.is-stale { opacity: .7; }
.event-body { min-width: 0; padding: 15px 16px; }
.event-top { display: flex; align-items: center; gap: 10px; }
.threat-badge { display: inline-flex; align-items: center; gap: 10px; min-width: 0; font-size: 13px; font-weight: 800; }
.threat-badge img { width: 29px; height: 29px; object-fit: contain; flex: none; filter: drop-shadow(0 3px 7px rgba(0, 0, 0, .4)); }
.threat-badge span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.confidence-pill { margin-left: auto; flex: none; padding: 3px 7px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, .03); color: var(--muted); font-size: 10px; font-weight: 750; font-variant-numeric: tabular-nums; }
.event-zone { display: flex; align-items: center; gap: 6px; margin-top: 9px; color: #c0d1ca; font-size: 11px; }
.event-zone .icon { width: 13px; height: 13px; color: var(--faint); }
.event-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; margin-top: 7px; color: var(--faint); font-size: 10px; }
.eta-text { color: var(--gold); font-weight: 750; }
.eta-text.is-back { color: var(--muted); }
.event-reason { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; overflow-wrap: anywhere; }
.eta-track { height: 3px; overflow: hidden; margin-top: 12px; border-radius: 99px; background: rgba(255, 255, 255, .06); }
.eta-track i { display: block; height: 100%; border-radius: inherit; background: var(--threat); opacity: .8; transition: width 1s linear; }

/* Empty-state radar. Decorative only, never a substitute for live data. */
.empty-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 240px; padding: 28px 22px; text-align: center; }
.empty-state strong { display: block; margin-top: 26px; font-size: 17px; font-weight: 750; letter-spacing: -.035em; }
.empty-state p { max-width: 260px; margin: 9px 0 0; color: var(--faint); font-size: 11px; line-height: 1.9; }
.empty-icon { position: relative; display: grid; place-items: center; width: 136px; height: 136px; flex: none; border: 1px solid rgba(184, 243, 213, .14); border-radius: 50%; background: repeating-radial-gradient(circle at center, transparent 0 21px, rgba(184, 243, 213, .07) 22px 23px, transparent 24px 44px); color: var(--accent); isolation: isolate; }
.empty-icon::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0 270deg, rgba(184, 243, 213, .015) 290deg, rgba(184, 243, 213, .16) 359deg, transparent 360deg); animation: spin 9s linear infinite; }
.empty-icon::after { content: ''; position: absolute; inset: -12px; border: 1px dashed rgba(184, 243, 213, .06); border-radius: 50%; }
.empty-icon .icon { width: 27px; height: 27px; padding: 0; filter: drop-shadow(0 0 12px rgba(184, 243, 213, .25)); }
.empty-state.is-loading .empty-icon { animation: breathe 2.5s ease-in-out infinite; }
.empty-state.is-error .empty-icon { color: var(--danger); border-color: rgba(255, 141, 134, .2); }
.empty-state.is-error .empty-icon::before { animation-play-state: paused; opacity: .4; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { opacity: .55; transform: scale(.96); } }

/* Map markers ------------------------------------------------------------ */
.threat-marker { position: relative; width: 58px; height: 58px; display: grid; place-items: center; filter: drop-shadow(0 9px 14px rgba(0, 0, 0, .58)) drop-shadow(0 0 12px color-mix(in srgb, var(--threat-color) 30%, transparent)); }
.threat-marker .threat-halo { position: absolute; inset: 5px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--threat-color) 54%, transparent); background: color-mix(in srgb, var(--threat-color) 10%, transparent); animation: halo 3.4s ease-out infinite; }
@keyframes halo { 0% { transform: scale(.7); opacity: .9; } 80%, 100% { transform: scale(1.4); opacity: 0; } }
.threat-marker img { position: relative; z-index: 2; width: 46px; height: 46px; object-fit: contain; transform-origin: center; }
.threat-marker.is-returning { opacity: .55; }
.eta-badge { position: absolute; z-index: 3; top: -17px; left: 50%; transform: translateX(-50%); padding: 3px 7px; border: 1px solid color-mix(in srgb, var(--threat-color) 38%, transparent); border-radius: 7px; background: rgba(10, 16, 18, .92); color: var(--gold); font-size: 9px; font-weight: 750; white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }
.eta-badge.is-back { color: var(--muted); border-color: var(--line); }
.zone-marker { position: relative; width: 11px; height: 11px; transform: translate(-50%, -50%); border: 2px solid rgba(184, 243, 213, .3); border-radius: 50%; background: #769b8c; box-shadow: 0 0 0 4px rgba(184, 243, 213, .04); cursor: pointer; }
.zone-marker::after { content: attr(data-name); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%) translateY(4px); opacity: 0; padding: 5px 9px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel-solid); color: var(--text); font-size: 10px; font-weight: 650; white-space: nowrap; pointer-events: none; transition: opacity .2s, transform .3s var(--ease); }
.zone-marker:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.zone-marker.is-pulsing { background: var(--danger); border-color: var(--danger); animation: zonePulse 1.4s ease-out 2; }
@keyframes zonePulse { 0% { box-shadow: 0 0 0 0 rgba(255, 141, 134, .45); } 100% { box-shadow: 0 0 0 18px rgba(255, 141, 134, 0); } }
.threat-route { animation: routeFlow 30s linear infinite; }
@keyframes routeFlow { to { stroke-dashoffset: -260; } }

/* Personal pages --------------------------------------------------------- */
.page-view { overflow-y: auto; overscroll-behavior: contain; padding: 38px 30px calc(50px + env(safe-area-inset-bottom, 0px)); background: radial-gradient(ellipse at 80% 0%, rgba(184, 243, 213, .045), transparent 55%); }
.page-shell { width: min(100%, 960px); margin: 0 auto; }
.page-heading { position: relative; padding: 0 0 28px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.page-heading .eyebrow { margin-bottom: 12px; }
.page-heading h1 { margin: 0; font-size: clamp(32px, 4vw, 46px); line-height: 1.18; letter-spacing: -.055em; font-weight: 800; }
.page-heading > p:last-child { margin: 12px 0 0; max-width: 550px; color: var(--muted); font-size: 13px; line-height: 1.9; }
.page-heading::after { content: ''; position: absolute; right: 16px; top: 14px; width: 66px; height: 66px; border: 1px solid rgba(184, 243, 213, .12); border-radius: 50%; box-shadow: 0 0 0 14px rgba(184, 243, 213, .025), 0 0 0 28px rgba(184, 243, 213, .015); pointer-events: none; }
.auth-gate { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 13px; overflow: hidden; padding: clamp(34px, 6vw, 60px) 24px; border: 1px solid var(--line); border-radius: var(--radius); background: radial-gradient(ellipse at 50% 0%, rgba(184, 243, 213, .055), transparent 65%), #10191c; }
.gate-icon { display: grid; place-items: center; width: 62px; height: 62px; margin-bottom: 8px; border: 1px solid rgba(184, 243, 213, .2); border-radius: 21px; background: linear-gradient(145deg, #263c32, #172920); color: var(--accent); transform: rotate(-6deg); }
.gate-icon .icon { width: 26px; height: 26px; transform: rotate(6deg); }
.auth-gate h2 { margin: 0; font-size: 23px; font-weight: 750; letter-spacing: -.04em; }
.auth-gate p { margin: 0; max-width: 410px; color: var(--muted); font-size: 12px; line-height: 1.9; }
.gate-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 9px; }
.settings-layout, .premium-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 16px; }
.settings-layout > .profile-card, .settings-layout > .panel-zones, .settings-layout > .panel:last-child, .premium-layout > .premium-hero, .premium-layout > .premium-tool:last-child { grid-column: 1 / -1; }
.settings-layout > .panel, .premium-layout > .panel { margin-top: 0; }
.profile-card { position: relative; display: flex; align-items: center; gap: 17px; overflow: hidden; padding: 23px; border: 1px solid rgba(184, 243, 213, .16); border-radius: var(--radius); background: radial-gradient(ellipse at 100% 0%, rgba(184, 243, 213, .09), transparent 60%), #15211f; }
.profile-avatar { width: 58px; height: 58px; flex: none; display: grid; place-items: center; border: 1px solid rgba(184, 243, 213, .25); border-radius: 19px; background: var(--accent-soft); color: var(--accent); font-size: 19px; font-weight: 800; }
.profile-info { min-width: 0; flex: 1; }
.profile-info h2 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 20px; letter-spacing: -.03em; }
.profile-info p { margin: 5px 0 0; color: var(--faint); font-size: 11px; }
.profile-status, .status-pill { flex: none; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: rgba(255, 255, 255, .03); color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.profile-status.is-premium, .status-pill.is-active { color: var(--gold); border-color: rgba(239, 210, 154, .25); background: rgba(239, 210, 154, .08); }
.panel { margin-top: 16px; padding: 23px; border: 1px solid var(--line); border-radius: var(--radius); background: #111b1e; }
.panel-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.panel-head-icon { display: grid; place-items: center; width: 39px; height: 39px; flex: none; border: 1px solid var(--line); border-radius: 13px; background: rgba(184, 243, 213, .035); color: var(--accent); }
.panel-head-icon .icon { width: 19px; height: 19px; }
.panel-head-copy { min-width: 0; flex: 1; }
.panel-head h2 { margin: 0; font-size: 16px; letter-spacing: -.025em; font-weight: 750; }
.panel-head p { margin: 4px 0 0; color: var(--faint); font-size: 11px; line-height: 1.7; }
.panel-head .panel-badge { flex: none; align-self: center; padding: 4px 8px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 10px; }
.panel-note { margin: 0 0 13px; color: var(--faint); font-size: 11px; }
.panel-divider { height: 1px; margin: 18px 0; background: var(--line); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 0; border-top: 1px solid var(--line); }
.panel-head + .setting-row { border-top: 0; padding-top: 0; }
.setting-row:last-child { padding-bottom: 0; }
.setting-copy { min-width: 0; }
.setting-copy strong { display: block; font-size: 12px; font-weight: 700; }
.setting-copy span { display: block; margin-top: 4px; color: var(--faint); font-size: 10px; line-height: 1.7; }
.setting-value { color: var(--accent); font-size: 11px; font-weight: 700; white-space: nowrap; }
.switch { position: relative; width: 46px; height: 28px; flex: none; padding: 0; border: 1px solid var(--line-strong); border-radius: 999px; background: #24312f; transition: background .3s, border-color .3s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #8ca49b; box-shadow: 0 2px 5px rgba(0, 0, 0, .2); transition: transform .4s var(--spring), background .3s; }
.switch[aria-checked='true'] { border-color: var(--accent); background: var(--accent); }
.switch[aria-checked='true']::after { transform: translateX(18px); background: #1d3b2d; }
.switch:active::after { width: 23px; }
.switch:disabled { opacity: .4; }
.segmented { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: #0d1517; }
.segmented button { position: relative; flex: 1; min-width: 0; padding: 9px 4px; border: 0; border-radius: 9px; background: transparent; color: var(--faint); font-size: 11px; font-weight: 750; white-space: nowrap; transition: color .25s, background .25s; }
.segmented button:hover { color: var(--text); }
.segmented button.is-active { color: var(--accent); background: #25392f; }
.zone-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.zone-chip { display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .015); color: var(--muted); text-align: left; font-size: 11px; line-height: 1.5; transition: border-color .25s, background .25s, color .25s; }
.zone-chip:hover { border-color: var(--line-strong); color: var(--text); }
.zone-check { width: 17px; height: 17px; flex: none; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 6px; color: transparent; transition: background .3s, transform .4s var(--spring); }
.zone-check .icon { width: 12px; height: 12px; stroke-width: 2.5; }
.zone-chip.is-selected { border-color: rgba(184, 243, 213, .3); background: var(--accent-soft); color: var(--text); }
.zone-chip.is-selected .zone-check { border-color: var(--accent); background: var(--accent); color: #173c29; }
.zone-name { overflow: hidden; text-overflow: ellipsis; }
.time-grid { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.time-field { display: flex; flex-direction: column; gap: 7px; min-width: 110px; flex: 1; }
.time-field > span { color: var(--faint); font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.time-field input, .inline-form input, .support-form textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 12px; background: #0c1517; color: var(--text); padding: 12px; font-size: 12px; transition: border-color .25s, box-shadow .25s; }
.time-field input:focus, .inline-form input:focus, .support-form textarea:focus { border-color: rgba(184, 243, 213, .5); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--faint); opacity: .8; }
.time-field input:disabled { opacity: .4; }
.button-row { display: flex; gap: 7px; }
.button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 13px; background: rgba(255, 255, 255, .03); color: var(--text); font-size: 11px; font-weight: 750; white-space: nowrap; transition: border-color .25s, background .25s, transform .3s var(--ease), box-shadow .25s; }
.button:hover { color: var(--text); border-color: rgba(184, 243, 213, .3); background: rgba(255, 255, 255, .06); transform: translateY(-2px); }
.button .icon { width: 16px; height: 16px; }
.button.is-primary { border-color: transparent; background: var(--accent); color: #163323; box-shadow: 0 6px 20px rgba(184, 243, 213, .06), inset 0 1px 0 rgba(255, 255, 255, .3); }
.button.is-primary:hover { background: #d3ffe5; box-shadow: 0 8px 24px rgba(184, 243, 213, .14); }
.button.is-ghost { background: transparent; }
.button.is-danger { color: var(--danger); border-color: rgba(255, 141, 134, .25); background: var(--danger-soft); }
.button:disabled { opacity: .4; transform: none; }
.button.is-loading { pointer-events: none; opacity: .65; }

/* Premium ---------------------------------------------------------------- */
.premium-preview, .premium-hero { position: relative; overflow: hidden; padding: 36px; border: 1px solid rgba(239, 210, 154, .22); border-radius: 28px; background: radial-gradient(ellipse at 100% 0%, rgba(239, 210, 154, .1), transparent 65%), linear-gradient(120deg, #1c2421, #16221e); }
.premium-preview { margin-bottom: 16px; }
.premium-preview > .eyebrow { color: var(--gold); }
.premium-preview h2, .premium-hero h2 { position: relative; z-index: 1; margin: 22px 0 0; font-size: clamp(27px, 3.4vw, 42px); line-height: 1.22; letter-spacing: -.055em; font-weight: 800; }
.premium-preview h2 span, .premium-hero h2 span { color: var(--gold); }
.premium-preview > p:not(.eyebrow) { position: relative; z-index: 1; max-width: 390px; margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.9; }
.preview-orbit { position: absolute; right: 64px; top: 72px; width: 155px; height: 155px; display: grid; place-items: center; border: 1px solid rgba(239, 210, 154, .2); border-radius: 50%; box-shadow: 0 0 0 32px rgba(239, 210, 154, .025), 0 0 0 64px rgba(239, 210, 154, .02); }
.preview-orbit::before { content: ''; position: absolute; inset: -1px; border: 1px solid transparent; border-top-color: var(--gold); border-radius: 50%; animation: spin 16s linear infinite; }
.preview-orbit > span { display: grid; place-items: center; width: 74px; height: 74px; border: 1px solid rgba(239, 210, 154, .3); border-radius: 26px; background: linear-gradient(145deg, #52482e, #2d3427); color: var(--gold); transform: rotate(-12deg); box-shadow: 0 10px 40px rgba(0, 0, 0, .2); }
.preview-orbit .icon { width: 36px; height: 36px; transform: rotate(12deg); }
.preview-features { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 25px; }
.preview-features > span { display: flex; align-items: center; gap: 7px; padding: 9px 12px; border: 1px solid rgba(239, 210, 154, .13); border-radius: 10px; background: rgba(10, 16, 18, .3); color: #dfd8c8; font-size: 10px; }
.preview-features .icon { width: 14px; height: 14px; color: var(--gold); }
.premium-hero::after { content: ''; position: absolute; right: -60px; top: 66px; width: 240px; height: 240px; border: 1px solid rgba(239, 210, 154, .15); border-radius: 50%; box-shadow: 0 0 0 32px rgba(239, 210, 154, .025), 0 0 0 64px rgba(239, 210, 154, .02); pointer-events: none; }
.premium-hero-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.premium-icon { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid rgba(239, 210, 154, .25); border-radius: 16px; background: rgba(239, 210, 154, .08); color: var(--gold); }
.premium-icon .icon { width: 24px; height: 24px; }
.premium-kicker { position: relative; z-index: 1; margin: 27px 0 -12px; color: var(--faint); font-size: 10px; }
.premium-sub { position: relative; z-index: 1; margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.price-row { position: relative; z-index: 1; display: flex; align-items: baseline; gap: 9px; margin-top: 24px; }
.price-row strong { color: var(--gold); font-size: 34px; font-weight: 700; letter-spacing: -.055em; }
.price-row span { color: var(--muted); font-size: 11px; }
.hero-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.hero-actions .button.is-primary { background: var(--gold); color: #352c1b; }
.pending-note { position: relative; z-index: 1; display: flex; align-items: center; gap: 7px; margin: 14px 0 0; color: var(--gold); font-size: 11px; }
.feature-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 12px; margin: 0; padding: 0; list-style: none; }
.feature-item { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.feature-mark { width: 20px; height: 20px; flex: none; display: grid; place-items: center; border-radius: 7px; background: var(--accent-soft); color: var(--accent); }
.feature-mark .icon { width: 12px; height: 12px; stroke-width: 2; }
.feature-no { display: none; color: var(--faint); background: rgba(255, 255, 255, .045); }
.feature-item.is-locked .feature-yes { display: none; }
.feature-item.is-locked .feature-no { display: grid; }
.usage-list { display: flex; flex-direction: column; gap: 17px; }
.usage-row { display: grid; grid-template-columns: 55px 1fr auto; align-items: center; gap: 12px; font-size: 11px; }
.usage-row > span { color: var(--muted); }
.usage-row strong { font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.meter { height: 5px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, .06); }
.meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #598b72, var(--accent)); transition: width .7s var(--ease); }
.premium-tool.is-locked { opacity: .6; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { min-width: 0; flex: 1; }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.tag { display: inline-flex; align-items: center; gap: 5px; min-height: 33px; max-width: 100%; overflow-wrap: anywhere; padding: 0 5px 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--accent-soft); color: var(--muted); font-size: 11px; }
.tag button { width: 24px; height: 24px; flex: none; display: grid; place-items: center; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--faint); }
.tag button:hover { color: var(--danger); background: var(--danger-soft); }
.tag button .icon { width: 12px; height: 12px; }
.empty-inline { margin: 5px 0 0; color: var(--faint); font-size: 11px; }
.group-list { display: flex; flex-direction: column; gap: 8px; margin-top: 13px; }
.group-item { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255, 255, 255, .02); }
.group-copy { min-width: 0; flex: 1; }
.group-copy strong, .group-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.group-copy span { margin-top: 4px; color: var(--faint); font-size: 10px; }
.group-actions { display: flex; gap: 4px; flex: none; }
.group-actions button { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--muted); }
.group-actions button:hover { color: var(--accent); background: var(--accent-soft); }
.group-actions button[data-group-action='delete']:hover { color: var(--danger); background: var(--danger-soft); }
.group-actions .icon { width: 14px; height: 14px; }

/* Support ---------------------------------------------------------------- */
.support-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.contact-card { display: flex; align-items: center; gap: 15px; padding: 23px; border: 1px solid var(--line); border-radius: 20px; background: #14211f; color: var(--text); transition: border-color .3s, background .3s, transform .4s var(--ease); }
.contact-card:hover { color: var(--text); border-color: rgba(184, 243, 213, .3); background: #1b2e26; transform: translateY(-3px); }
.contact-icon { width: 43px; height: 43px; flex: none; display: grid; place-items: center; border-radius: 14px; background: var(--accent-soft); color: var(--accent); }
.contact-icon .icon { width: 21px; height: 21px; }
.contact-copy { min-width: 0; flex: 1; }
.contact-copy strong { display: block; font-size: 14px; }
.contact-copy > span { display: block; margin-top: 5px; color: var(--faint); font-size: 11px; }
.contact-card > .icon { width: 16px; height: 16px; color: var(--faint); transition: transform .3s var(--ease); }
.contact-card:hover > .icon { transform: translate(2px, -2px); color: var(--accent); }
.faq-list { display: flex; flex-direction: column; gap: 7px; }
.faq-item { border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .012); overflow: hidden; transition: border-color .3s, background .3s; }
.faq-item[open] { border-color: rgba(184, 243, 213, .24); background: var(--accent-soft); }
.faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px; cursor: pointer; color: var(--text); font-size: 12px; font-weight: 700; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .icon { width: 15px; height: 15px; color: var(--faint); transition: transform .4s var(--ease); }
.faq-item[open] summary .icon { transform: rotate(180deg); color: var(--accent); }
.faq-item p { margin: 0; padding: 0 16px 18px; color: var(--muted); font-size: 11px; line-height: 1.9; }
.support-form { margin-top: 16px; }
.support-form label { display: block; margin-bottom: 9px; color: var(--muted); font-size: 11px; font-weight: 700; }
.support-form textarea { min-height: 145px; resize: vertical; line-height: 1.8; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.form-counter { color: var(--faint); font-size: 10px; font-variant-numeric: tabular-nums; }
.support-auth-note { display: flex; align-items: center; gap: 10px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #0d1718; color: var(--faint); font-size: 11px; }
.support-auth-note > .icon { width: 17px; height: 17px; color: var(--accent); }
.support-auth-note > span { flex: 1; }

/* Archive & notifications ------------------------------------------------ */
.modal { position: fixed; inset: 0; z-index: 1600; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(4, 10, 11, .76); backdrop-filter: blur(12px); animation: fadeIn .3s ease; }
.modal-card { position: relative; display: flex; flex-direction: column; width: min(520px, 100%); max-height: min(84dvh, 800px); min-height: 360px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 28px; background: var(--panel-solid); box-shadow: 0 30px 120px rgba(0, 0, 0, .5); animation: modalIn .5s var(--ease); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(24px) scale(.97); } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 25px 25px 20px; border-bottom: 1px solid var(--line); }
.modal-head > div { flex: 1; min-width: 0; }
.modal-head h2 { margin: 0; font-size: 24px; letter-spacing: -.045em; }
.modal-head .eyebrow { color: var(--faint); font-size: 9px; margin-bottom: 5px; }
.archive-filters { display: flex; gap: 5px; padding: 16px 22px; overflow-x: auto; }
.archive-list { flex: 1; display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; padding: 0 22px 22px; overscroll-behavior: contain; }
.archive-list .event-card { cursor: default; }
.archive-cleared { display: flex; align-items: center; gap: 5px; margin-top: 9px; color: var(--ok); font-size: 10px; }
.archive-cleared .icon { width: 13px; height: 13px; }
.toast-stack { position: fixed; z-index: 2200; top: calc(var(--header-h) + 14px); right: 34px; display: flex; flex-direction: column; gap: 9px; width: min(350px, calc(100vw - 28px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 11px; padding: 15px 17px; border: 1px solid var(--line-strong); border-radius: 16px; background: rgba(25, 40, 36, .97); color: var(--text); box-shadow: var(--shadow); backdrop-filter: blur(16px); font-size: 11px; line-height: 1.8; animation: toastIn .4s var(--ease); pointer-events: auto; }
.toast .icon { width: 17px; height: 17px; margin-top: 2px; color: var(--accent); }
.toast.is-success .icon { color: var(--ok); }
.toast.is-danger { border-color: rgba(255, 141, 134, .3); background: rgba(46, 31, 29, .97); }
.toast.is-danger .icon { color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(.97); } }
.tap-ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .12; pointer-events: none; transform: scale(0); }
.button, .nav-link, .bottom-link, .filter-chip, .icon-button, .tool-button, .segmented button { overflow: hidden; }

/* Compact desktop -------------------------------------------------------- */
@media (min-width: 881px) and (max-width: 1180px) {
  :root { --dock-w: 330px; }
  .app-header { padding-left: 22px; padding-right: 22px; gap: 15px; }
  .brand-sub { display: none; }
  .nav-link { padding: 10px 11px; gap: 6px; font-size: 11px; }
  .live-pill { padding: 7px; margin-right: 0; }
  .map-top { left: 42px; right: calc(var(--dock-w) + 58px); }
  .map-overview { gap: 20px; }
  .map-readout { padding-left: 17px; }
  .map-readout strong { font-size: 36px; }
  .map-heading h1 span { display: block; }
  .map-description { font-size: 10px; }
  .filter-chip { padding: 0 10px; }
  .dock-head { padding: 23px 18px 18px; gap: 8px; }
  .dock-head h2 { font-size: 19px; }
}

/* Mobile: floating navigation and a springy bottom sheet ------------------ */
@media (max-width: 880px) {
  :root { --header-h: calc(70px + env(safe-area-inset-top, 0px)); --nav-h: 82px; }
  .top-nav { display: none; }
  .app-header { gap: 10px; padding-left: 18px; padding-right: 18px; }
  .brand { gap: 9px; }
  .brand-mark { width: 37px; height: 37px; border-radius: 13px; }
  .brand-mark .icon { width: 24px; height: 24px; }
  .brand-name { font-size: 18px; letter-spacing: -.7px; }
  .brand-sub { display: none; }
  .header-actions { gap: 6px; margin-left: auto; }
  .live-pill { padding: 6px 8px; margin-right: 0; font-size: 9px; gap: 6px; }
  .icon-button { width: 35px; height: 35px; border-radius: 12px; }
  .icon-button .icon { width: 16px; height: 16px; }
  .bottom-nav {
    position: fixed;
    z-index: 1400;
    left: max(12px, env(safe-area-inset-left, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 6px;
    border: 1px solid var(--line-strong);
    border-radius: 23px;
    background: rgba(16, 27, 28, .96);
    box-shadow: 0 10px 35px rgba(0, 0, 0, .35);
    backdrop-filter: blur(22px);
    isolation: isolate;
  }
  .bottom-nav::before { top: 6px; bottom: 6px; border-radius: 17px; background: #263e32; }
  .bottom-link { min-width: 0; min-height: 52px; display: flex; flex-direction: column; gap: 4px; padding: 5px 0; border-radius: 17px; font-size: 9px; font-weight: 750; }
  .bottom-link .icon { width: 19px; height: 19px; transition: transform .45s var(--spring); }
  .bottom-link.is-active .icon { transform: translateY(-2px); }
  .map-canvas { inset: 0 8px calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)) 8px; border-radius: 25px; }
  .view-map.is-dock-collapsed .map-canvas { right: 8px; }
  .map-canvas::after { background: linear-gradient(180deg, rgba(8, 18, 18, .92), rgba(8, 18, 18, .14) 195px, transparent 55%); }
  .map-top { top: 22px; left: 27px; right: 27px; gap: 18px; }
  .map-overview { gap: 12px; align-items: center; }
  .map-heading h1 { font-size: clamp(25px, 4.5vw, 34px); }
  .map-heading h1 span { display: block; }
  .map-heading .eyebrow { font-size: 8px; letter-spacing: .09em; margin-bottom: 8px; }
  .map-description { display: none; }
  .map-readout { gap: 9px; padding-left: 16px; }
  .map-readout strong { font-size: 40px; }
  .readout-label { font-size: 9px; }
  .filter-bar { width: 100%; border-radius: 15px; padding: 4px; gap: 2px; }
  .filter-chip { flex: 1; gap: 5px; height: 34px; padding: 0 7px; font-size: 10px; border-radius: 10px; }
  .chip-count { min-width: 17px; height: 18px; padding: 0 4px; font-size: 9px; border-radius: 6px; }
  .map-legend, .map-caption { display: none; }
  .map-tools { top: 192px; right: 22px; bottom: auto; left: auto; flex-direction: column; gap: 7px; }
  .tool-button { width: 38px; height: 38px; border-radius: 12px; }
  .leaflet-control-zoom { display: none; }
  .leaflet-bottom.leaflet-right { bottom: 4px; right: 7px; }
  .leaflet-control-attribution { font-size: 7px !important; }
  .event-dock { top: auto; left: 16px; right: 16px; bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom, 0px)); width: auto; height: clamp(230px, 36dvh, 380px); border-radius: 24px; background: rgba(18, 29, 31, .97); box-shadow: 0 -8px 50px rgba(0, 0, 0, .2); backdrop-filter: blur(24px); transition: height .5s var(--ease), opacity .25s, transform .45s var(--ease), visibility .45s; }
  .event-dock.is-expanded { height: min(68dvh, 640px); }
  .event-dock.is-collapsed { transform: translateY(40px) scale(.97); }
  .dock-handle { display: flex; align-items: center; justify-content: center; flex: none; width: 100%; height: 23px; padding: 0; border: 0; background: transparent; touch-action: none; cursor: ns-resize; }
  .dock-handle span { width: 32px; height: 3px; border-radius: 99px; background: #486058; transition: width .3s; }
  .dock-handle:hover span { width: 45px; background: var(--accent); }
  .dock-head { padding: 0 18px 13px; gap: 10px; }
  .dock-head h2 { font-size: 18px; }
  .dock-head .eyebrow { font-size: 8px; margin-bottom: 3px; }
  .dock-collapse { width: 28px; height: 28px; }
  .count-pill { min-width: 25px; height: 25px; border-radius: 8px; font-size: 10px; }
  .event-list { padding: 10px; gap: 8px; }
  .event-body { padding: 12px 14px; }
  .event-reason { -webkit-line-clamp: 1; margin-top: 6px; }
  .dock-foot { padding: 9px 16px 11px; gap: 8px; }
  .dock-foot p { font-size: 9px; line-height: 1.6; }
  .dock-foot .icon { width: 12px; height: 12px; }
  .dock-fab { right: 22px; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom, 0px)); min-height: 45px; border-radius: 15px; }
  .event-list > .empty-state { flex-direction: row; flex-wrap: wrap; align-content: center; column-gap: 16px; min-height: 100px; padding: 16px; }
  .event-list .empty-icon { width: 50px; height: 50px; background: var(--accent-soft); border-radius: 17px; }
  .event-list .empty-icon::before { background: none; }
  .event-list .empty-icon::after { inset: -5px; border-radius: 21px; }
  .event-list .empty-icon .icon { width: 24px; height: 24px; }
  .event-list .empty-state strong { margin: 0; font-size: 14px; }
  .event-list .empty-state p { flex-basis: 100%; max-width: 300px; font-size: 10px; margin-top: 14px; line-height: 1.8; }
  .event-dock.is-expanded .empty-state { flex-direction: column; flex-wrap: nowrap; }
  .event-dock.is-expanded .empty-icon { width: 120px; height: 120px; border-radius: 50%; background: repeating-radial-gradient(circle, transparent 0 21px, rgba(184, 243, 213, .07) 22px 23px, transparent 24px 44px); }
  .event-dock.is-expanded .empty-icon::before { background: conic-gradient(transparent 0 270deg, rgba(184, 243, 213, .16) 359deg, transparent 360deg); }
  .event-dock.is-expanded .empty-icon::after { inset: -12px; border-radius: 50%; }
  .event-dock.is-expanded .empty-state strong { margin-top: 25px; }
  .event-dock.is-expanded .empty-state p { flex-basis: auto; }
  .page-view { padding: 24px 18px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom, 0px)); }
  .page-heading { padding-bottom: 24px; margin-bottom: 22px; }
  .page-heading h1 { font-size: 34px; }
  .page-heading > p:last-child { max-width: 90%; font-size: 12px; }
  .page-heading::after { right: 0; top: 12px; width: 38px; height: 38px; box-shadow: 0 0 0 10px rgba(184, 243, 213, .025); opacity: .6; }
  .settings-layout, .premium-layout { grid-template-columns: 1fr; gap: 13px; }
  .panel { padding: 20px; margin-top: 13px; border-radius: 21px; }
  .panel-head { margin-bottom: 17px; }
  .panel-head p { font-size: 10px; }
  .profile-card { padding: 18px; gap: 12px; border-radius: 21px; }
  .profile-avatar { width: 48px; height: 48px; border-radius: 16px; font-size: 16px; }
  .profile-info h2 { font-size: 17px; }
  .profile-info p { font-size: 9px; }
  .profile-status { padding: 5px 7px; font-size: 8px; }
  .zone-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .zone-chip { font-size: 10px; padding: 10px; gap: 7px; }
  .auth-gate { padding: 36px 20px; border-radius: 23px; }
  .auth-gate h2 { font-size: 21px; }
  .auth-gate p { font-size: 11px; }
  .gate-actions { width: 100%; }
  .gate-actions .button.is-primary { width: 100%; }
  .premium-preview, .premium-hero { padding: 25px; border-radius: 23px; }
  .premium-preview h2, .premium-hero h2 { font-size: 30px; }
  .preview-orbit { width: 105px; height: 105px; right: -28px; top: 35px; opacity: .45; }
  .preview-orbit > span { width: 52px; height: 52px; border-radius: 18px; }
  .preview-orbit .icon { width: 25px; height: 25px; }
  .premium-preview > p:not(.eyebrow) { max-width: 85%; font-size: 11px; }
  .preview-features { gap: 6px; margin-top: 22px; }
  .preview-features > span { font-size: 9px; padding: 8px 10px; }
  .premium-hero::after { right: -155px; opacity: .5; }
  .hero-actions .button { flex: 1 1 auto; }
  .support-grid { gap: 10px; }
  .contact-card { padding: 17px 14px; gap: 9px; border-radius: 17px; }
  .contact-icon { width: 34px; height: 34px; border-radius: 11px; }
  .contact-icon .icon { width: 18px; height: 18px; }
  .contact-copy strong { font-size: 12px; }
  .contact-copy > span { font-size: 8px; }
  .contact-card > .icon { display: none; }
  .faq-item summary { padding: 15px 13px; font-size: 11px; }
  .faq-item p { padding: 0 13px 15px; font-size: 10px; }
  .support-auth-note { flex-wrap: wrap; padding: 13px; font-size: 10px; }
  .support-auth-note > span { min-width: 180px; }
  .time-field input, .inline-form input, .support-form textarea { font-size: 16px; }
  .modal { align-items: flex-end; padding: 0; }
  .modal-card { width: 100%; max-height: 88dvh; min-height: 350px; border-radius: 28px 28px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .modal-head { padding: 24px 22px 18px; }
  .modal-head h2 { font-size: 22px; }
  .archive-filters .filter-chip { flex: 0 0 auto; padding: 0 15px; }
  .archive-list .empty-icon { width: 110px; height: 110px; }
  .toast-stack { top: auto; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom, 0px)); right: 18px; left: 18px; width: auto; }
}

@media (max-width: 380px) {
  .app-header { padding-left: 14px; padding-right: 14px; }
  .brand-name { font-size: 16px; }
  .live-pill span:last-child { display: none; }
  .live-pill { padding: 8px; }
  .map-top { left: 23px; right: 23px; }
  .map-heading h1 { font-size: 25px; }
  .map-readout { padding-left: 12px; gap: 7px; }
  .map-readout strong { font-size: 35px; }
  .filter-chip { font-size: 9px; padding: 0 5px; }
  .event-list .empty-state strong { font-size: 12px; }
  .page-view { padding-left: 14px; padding-right: 14px; }
  .panel { padding: 17px; }
  .zone-grid, .feature-list { grid-template-columns: 1fr; }
  .inline-form { flex-wrap: wrap; }
  .inline-form input { flex-basis: 100%; }
  .support-grid { grid-template-columns: 1fr; }
  .contact-copy > span { font-size: 10px; }
  .contact-card > .icon { display: block; }
}

@media (max-height: 650px) and (max-width: 880px) {
  .map-top { top: 16px; gap: 12px; }
  .map-heading h1 span { display: inline; }
  .map-heading h1 { font-size: 22px; }
  .map-heading .eyebrow { display: none; }
  .map-readout strong { font-size: 29px; }
  .map-tools { top: 125px; }
  .event-dock { height: 200px; }
  .event-dock.is-expanded { height: 66dvh; }
  .dock-foot { display: none; }
}

@media (max-height: 480px) and (max-width: 880px) and (orientation: landscape) {
  .map-canvas { right: calc(min(40vw, 330px) + 28px); }
  .map-top { right: calc(min(40vw, 330px) + 46px); }
  .view-map.is-dock-collapsed .map-top { right: 23px; }
  .map-readout { display: none; }
  .map-heading h1 { font-size: 21px; }
  .event-dock { top: 0; left: auto; right: 16px; width: min(40vw, 330px); height: auto; }
  .event-dock.is-expanded { height: auto; }
  .dock-handle { display: none; }
  .dock-head { padding: 14px; }
  .dock-head h2 { font-size: 16px; }
  .dock-head .eyebrow { display: none; }
  .map-tools { top: auto; left: 23px; right: auto; bottom: calc(var(--nav-h) + 15px); flex-direction: row; }
  .event-list .empty-state { padding: 10px; }
  .event-list .empty-state p { display: none; }
  .event-list .empty-icon { width: 34px; height: 34px; border-radius: 11px; }
  .event-list .empty-state strong { font-size: 11px; }
}

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

body.is-background .live-dot,
body.is-background .empty-icon,
body.is-background .empty-icon::before,
body.is-background .threat-halo,
body.is-background .threat-route,
body.is-background .preview-orbit::before { animation-play-state: paused; }
