/* ============================================================
   GeoVeil v3 — Dark Theme
   ============================================================ */
:root {
  --bg:       #0d1117;
  --bg2:      #161b22;
  --bg3:      #21262d;
  --border:   #30363d;
  --t1:       #e6edf3;
  --t2:       #8b949e;
  --t3:       #484f58;
  --accent:   #58a6ff;
  --accent2:  #1f6feb;
  --green:    #3fb950;
  --red:      #f85149;
  --orange:   #d29922;
  --purple:   #bc8cff;
  --panel-w:  600px;
  --nav-h:    52px;
  --ctrl-h:   48px;
  --radius:   8px;
  --shadow:   0 4px 24px rgba(0,0,0,.5);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--t1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  overflow: hidden;
}

/* ── Navigation ── */
#topNav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  z-index: 1100;
  gap: 8px;
}
#topNav .nav-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
#topNav .nav-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.nav-logo { height: 28px; cursor: pointer; flex-shrink: 0; }
.nav-brand {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.3px;
  cursor: pointer;
  white-space: nowrap;
  color: var(--t1);
}

.nav-tabs {
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 22px;
  padding: 2px;
}
.nav-tab {
  background: none;
  border: none;
  color: rgba(255,255,255,.55);
  padding: 5px 13px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s, color .15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.nav-tab:hover { background: rgba(255,255,255,.08); color: var(--t1); }
.nav-tab.active { background: rgba(88,166,255,.85); color: #fff; box-shadow: 0 1px 10px rgba(88,166,255,.35); }
.nav-tab.adv-only { display: none; }
body.adv-mode .nav-tab.adv-only { display: inline-flex; align-items: center; gap: 4px; }
.nav-tab .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }

/* Nav right controls */
.nav-btn {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.55);
  padding: 5px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .2px;
  transition: all .18s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.nav-btn:hover { border-color: rgba(88,166,255,.5); color: var(--accent); background: rgba(88,166,255,.08); }
.nav-btn.on {
  background: linear-gradient(135deg, rgba(252,211,77,.18), rgba(252,211,77,.08));
  border-color: rgba(252,211,77,.45);
  color: #fcd34d;
}
/* API version segment */
.api-ver-group {
  display: flex;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 22px;
  padding: 2px;
  gap: 1px;
}
.api-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.45);
  padding: 4px 13px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  transition: all .18s;
}
.api-btn.active {
  background: rgba(88,166,255,.85);
  color: #fff;
  box-shadow: 0 1px 10px rgba(88,166,255,.35);
}
.api-btn:hover:not(.active) { color: rgba(255,255,255,.8); background: rgba(255,255,255,.08); }

/* External links */
.nav-link {
  background: none;
  border: none;
  color: var(--t2);
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--radius);
  transition: color .15s;
}
.nav-link:hover { color: var(--accent); }

/* ── Map + views ── */
.view {
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  bottom: 0;
  display: none;
}
.view.active { display: block; }

#map {
  position: absolute;
  inset: 0;
  transition: right .25s ease;
}
#mapView.panel-open #map { right: var(--panel-w); }
.leaflet-container { background: #1a1f2e; }

/* ── Map controls bar (fixed, below nav) ── */
#mapControls {
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  height: var(--ctrl-h);
  z-index: 1000;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 6px;
}

/* Map view starts below both bars */
#mapView {
  top: calc(var(--nav-h) + var(--ctrl-h));
}
.mc-input {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--t1);
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: 12px;
  height: 34px;
  outline: none;
  transition: border-color .15s;
}
.mc-input:focus { border-color: var(--accent); }
.mc-input::placeholder { color: var(--t3); }
#stationSearch { width: 160px; }
.mc-date { width: 130px; }

.api-selector {
  display: flex;
  gap: 2px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px;
  height: 34px;
  align-items: center;
}
.api-btn {
  background: none;
  border: none;
  color: var(--t2);
  padding: 3px 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  transition: all .15s;
}
.api-btn.active { background: var(--accent2); color: #fff; }
.api-btn:hover:not(.active) { color: var(--accent); }

/* ── Station Panel ── */
#stationPanel {
  position: absolute;
  top: 0; right: 0;
  width: var(--panel-w);
  height: 100%;
  background: var(--bg2);
  border-left: 1px solid var(--border);
  z-index: 900;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s ease;
  box-shadow: var(--shadow);
}
#stationPanel.open { transform: translateX(0); }

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 16px 13px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg3);
  gap: 10px;
}
.panel-title-block { min-width: 0; flex: 1; }
.panel-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}
.panel-title { font-size: 18px; font-weight: 700; color: var(--t1); line-height: 1.2; }
.panel-code-badge {
  font-size: 10px;
  font-weight: 700;
  font-family: "SFMono-Regular", Consolas, monospace;
  color: var(--accent);
  background: rgba(88,166,255,.1);
  border: 1px solid rgba(88,166,255,.22);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: .5px;
  flex-shrink: 0;
}
.panel-subtitle { font-size: 11px; color: var(--t3); font-family: "SFMono-Regular", Consolas, monospace; }
.panel-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 2px;
}
/* Threat badge in panel header */
.panel-threat {
  font-size: 9.5px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .7px;
  white-space: nowrap;
}
.panel-threat.thr-none { color: #3fb950; background: rgba(63,185,80,.12); border: 1px solid rgba(63,185,80,.25); }
.panel-threat.thr-low  { color: #e8a020; background: rgba(232,160,32,.12); border: 1px solid rgba(232,160,32,.28); }
.panel-threat.thr-med  { color: #f85149; background: rgba(248,81,73,.12); border: 1px solid rgba(248,81,73,.28); }
.panel-threat.thr-high { color: #ff4444; background: rgba(255,34,34,.14); border: 1px solid rgba(255,34,34,.35); box-shadow: 0 0 8px rgba(255,34,34,.15); }
.panel-close {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  color: var(--t3);
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
  flex-shrink: 0;
}
.panel-close:hover { background: var(--red); border-color: var(--red); color: #fff; }

.panel-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 10px 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}
.panel-tabs::-webkit-scrollbar { display: none; }
.ptab {
  background: none;
  border: none;
  color: var(--t2);
  padding: 6px 12px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: all .15s;
}
.ptab:hover { color: var(--t1); }
.ptab.active { color: var(--accent); border-bottom-color: var(--accent); }
.ptab.adv-only { display: none; }
body.adv-mode .ptab.adv-only { display: block; }

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--bg3) transparent;
}
.panel-body::-webkit-scrollbar { width: 4px; }
.panel-body::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 2px; }

/* ── API version sub-toggle inside panel ── */
.data-ver-toggle {
  display: flex;
  gap: 2px;
  margin-bottom: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 2px;
  align-self: flex-start;
}
.dvt-btn {
  background: none;
  border: none;
  color: var(--t3);
  padding: 4px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  transition: all .18s;
}
.dvt-btn.active { background: var(--accent2); color: #fff; box-shadow: 0 1px 8px rgba(31,111,235,.4); }
.dvt-btn:hover:not(.active) { color: var(--t1); background: var(--bg3); }

/* ── Chart containers ── */
.chart-wrap {
  background: var(--bg3);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 10px;
  min-height: 320px;
  width: 100%;
  display: block;
  position: relative;
}
/* Light-mode chart container (polar/V1) */
.chart-wrap.chart-light {
  background: #f4f7fa;
  border: 1px solid #e0e6ed;
}
.chart-placeholder {
  color: var(--t3);
  font-size: 12px;
  text-align: center;
}
.chart-title {
  font-size: 11px;
  color: var(--t2);
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ── Tables ── */
.gv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.gv-table th {
  background: var(--bg3);
  color: var(--t2);
  font-weight: 600;
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.gv-table td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--bg3);
  color: var(--t1);
}
.gv-table tr:hover td { background: var(--bg3); }
.gv-table .band-l1 { color: #ff6b6b; font-weight: 600; }
.gv-table .band-l2 { color: #4ecdc4; font-weight: 600; }
.gv-table .band-l5 { color: #ffe66d; font-weight: 600; }
.gv-table .band-e1 { color: #a8d8a8; font-weight: 600; }

.table-wrap {
  background: var(--bg3);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 10px;
}
.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.table-header h4 { font-size: 12px; font-weight: 600; color: var(--t2); }
.table-header .badge {
  background: var(--bg2);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

/* ── Stat cards ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.stat-card {
  background: var(--bg3);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.stat-card .sv { font-size: 20px; font-weight: 700; color: var(--t1); }
.stat-card .sl { font-size: 10px; color: var(--t2); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }

/* ── Threat / spoofing ── */
.threat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.threat-clean    { background: rgba(63,185,80,.15); color: var(--green); }
.threat-low      { background: rgba(210,153,34,.15); color: var(--orange); }
.threat-medium   { background: rgba(248,81,73,.15); color: var(--red); }
.threat-high     { background: rgba(248,81,73,.3); color: #ff4444; border: 1px solid var(--red); }
.threat-spoofing { background: rgba(188,140,255,.2); color: var(--purple); border: 1px solid var(--purple); }

/* ── Predict gauge ── */
.gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  gap: 8px;
}
.gauge-pct {
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
}
.gauge-label { font-size: 11px; color: var(--t2); }

/* ── Correlations source badges ── */
.src-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}
.src-v1 { background: rgba(88,166,255,.15); color: var(--accent); }
.src-v2 { background: rgba(63,185,80,.15); color: var(--green); }

/* ── Views: Threats, Predictor (full page) ── */
#threatsView, #predictorView {
  padding: 16px;
  overflow-y: auto;
}
.view-header {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}

/* ── Loading / empty states ── */
.loading-spin {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.state-msg {
  text-align: center;
  padding: 32px 16px;
  color: var(--t3);
  font-size: 13px;
}
.state-msg .icon { font-size: 28px; margin-bottom: 8px; }

/* ── Radar chart for spoofing ── */
.radar-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

/* ── Toast notifications ── */
#toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 18px;
  font-size: 13px;
  color: var(--t1);
  z-index: 2000;
  opacity: 0;
  transition: all .25s;
  pointer-events: none;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── apidocs / faq standalone pages ── */
.page-body {
  max-width: 900px;
  margin: 0 auto;
  padding: 80px 20px 60px;
  overflow-y: auto;
  height: 100vh;
}
.page-body h1 { font-size: 24px; font-weight: 700; margin-bottom: 8px; color: var(--t1); }
.page-body h2 { font-size: 17px; font-weight: 700; margin: 28px 0 10px; color: var(--t1); border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.page-body h3 { font-size: 14px; font-weight: 600; margin: 18px 0 8px; color: var(--accent); }
.page-body p  { color: var(--t2); line-height: 1.7; margin-bottom: 10px; }
.page-body code {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  color: #ff7b72;
}
.page-body pre {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  overflow-x: auto;
  margin: 10px 0;
  font-size: 12px;
  font-family: "SFMono-Regular", Consolas, monospace;
  color: var(--t1);
  line-height: 1.6;
}
.endpoint-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
}
.endpoint-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  cursor: pointer;
}
.method {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(63,185,80,.15);
  color: var(--green);
}
.method.post { background: rgba(88,166,255,.15); color: var(--accent); }
.endpoint-path { font-family: monospace; font-size: 13px; color: var(--t1); }
.endpoint-body { padding: 12px 14px; }
.param-table { width: 100%; font-size: 12px; border-collapse: collapse; }
.param-table th { text-align: left; padding: 4px 8px; color: var(--t2); font-weight: 600; }
.param-table td { padding: 4px 8px; border-bottom: 1px solid var(--border); }
.param-req { color: var(--red); font-size: 10px; }
.param-opt { color: var(--t3); font-size: 10px; }

.faq-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-q {
  padding: 12px 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--t1);
  transition: background .15s;
}
.faq-q:hover { background: var(--bg2); }
.faq-q .arr { transition: transform .2s; color: var(--t3); }
.faq-item.open .faq-q .arr { transform: rotate(180deg); }
.faq-a {
  display: none;
  padding: 12px 16px;
  color: var(--t2);
  line-height: 1.7;
  border-top: 1px solid var(--border);
}
.faq-item.open .faq-a { display: block; }

/* ── Mobile ── */
@media (max-width: 768px) {
  :root { --panel-w: 100vw; }

  #topNav { padding: 0 8px; gap: 4px; }
  .nav-tab { padding: 5px 8px; font-size: 12px; }
  .nav-logo { height: 22px; }
  .nav-btn { padding: 3px 8px; font-size: 11px; }
  .nav-link { display: none; }

  #mapControls { padding: 0 8px; gap: 4px; }

  #stationPanel {
    top: auto;
    bottom: 0; left: 0; right: 0;
    width: 100%;
    height: 75vh;
    border-left: none;
    border-top: 1px solid var(--border);
    border-radius: 14px 14px 0 0;
    transform: translateY(100%);
  }
  #stationPanel.open { transform: translateY(0); }

  .panel-header::before {
    content: '';
    position: absolute;
    top: 8px; left: 50%;
    transform: translateX(-50%);
    width: 36px; height: 4px;
    background: var(--bg3);
    border-radius: 2px;
  }
  .panel-header { position: relative; padding-top: 20px; }

  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-wrap { min-height: 200px; }

  .filter-row { gap: 6px; }

  #mapLegend { display: none; }

  /* Panel close button bigger touch target */
  .panel-close { width: 32px; height: 32px; }

  /* Station count badge above bottom sheet */
  #stationCount { bottom: 16px; }

  /* Threat cards full width */
  .threats-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

  /* Predictor output full width */
  .predictor-output, .model-quality { padding: 0; }
}

@media (max-width: 480px) {
  .nav-tabs { display: none; }
  #mobileMenuBtn { display: flex !important; }
}

/* ── Map controls inline elements ── */
.ctrl-sep-label {
  font-size: 11px;
  color: var(--t3);
  font-weight: 600;
  white-space: nowrap;
}
.ctrl-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--t1);
  padding: 0 9px;
  border-radius: var(--radius);
  font-size: 12px;
  height: 30px;
  outline: none;
  transition: border-color .15s;
}
.ctrl-input:focus { border-color: var(--accent); }
.ctrl-input::placeholder { color: var(--t3); }
.ctrl-input[type="date"] { width: 126px; color-scheme: dark; }
.ctrl-search { width: 170px; }
.ctrl-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  flex-shrink: 0;
  margin: 0 2px;
}
.ctrl-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--t2);
  width: 30px; height: 30px;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
}
.ctrl-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── API version group in nav ── */
.api-ver-group {
  display: flex;
  gap: 2px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px;
}

/* ── Mobile menu ── */
.mobile-only { display: none; }
.mobile-menu {
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  z-index: 1050;
  display: none;
  flex-direction: column;
  padding: 6px 0;
  box-shadow: var(--shadow);
}
.mobile-menu.open { display: flex; }
.mob-tab {
  background: none;
  border: none;
  color: var(--t2);
  text-align: left;
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: block;
  transition: background .15s, color .15s;
}
.mob-tab:hover, .mob-tab.active { background: var(--bg3); color: var(--t1); }
.mob-tab.adv-only { display: none; }
body.adv-mode .mob-tab.adv-only { display: block; }

/* ── Map station count badge ── */
.map-badge {
  position: absolute;
  bottom: 32px; right: 10px;
  z-index: 800;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 12px;
  font-size: 12px;
  color: var(--t2);
}
.map-badge span:first-child { color: var(--green); font-weight: 700; }

/* ── Station markers ── */
.sm {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform .15s;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.35));
}
.sm:hover { transform: scale(1.3); z-index: 9999 !important; }

.sm-ico {
  width: 42px;
  height: 48px;
  display: block;
}

/* Halo ring — absolutely positioned at antenna base */
.sm-halo {
  position: absolute;
  bottom: 15px;      /* sits at the mount of the antenna SVG, above label */
  left: 50%;
  margin-left: -12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  pointer-events: none;
  transform-origin: center;
}
.sm-halo::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid transparent;
  pointer-events: none;
  transform-origin: center;
}

/* Station code label */
.sm-code {
  font-size: 9.5px;
  font-weight: 700;
  font-family: "SFMono-Regular", "Cascadia Code", Consolas, monospace;
  color: #1a1f2e;
  background: rgba(255,255,255,.88);
  padding: 1px 4px;
  border-radius: 3px;
  margin-top: 2px;
  white-space: nowrap;
  letter-spacing: .2px;
  border: 1px solid rgba(0,0,0,.1);
  line-height: 1.3;
  position: relative;
  z-index: 1;
}

/* ── Intensity 0: clean / quiet ── */
/* no halo */

/* ── Intensity 1: spoofing_candidate (low confidence) ── */
.sm.intensity-1 .sm-halo {
  border-color: rgba(232,160,32,.85);
  animation: halo-pulse 2.8s ease-out infinite;
}
.sm.intensity-1 .sm-code {
  color: #7a4400;
  background: rgba(255,224,140,.92);
  border-color: rgba(232,160,32,.35);
}

/* ── Intensity 2: matched_spectrum / meaconing (medium) ── */
.sm.intensity-2 .sm-halo {
  border-color: rgba(248,81,73,.9);
  animation: halo-pulse 2s ease-out infinite;
}
.sm.intensity-2 .sm-halo::after {
  border-color: rgba(248,81,73,.5);
  animation: halo-pulse 2s ease-out infinite .7s;
}
.sm.intensity-2 .sm-code {
  color: #fff;
  background: rgba(200,40,30,.88);
  border-color: rgba(248,81,73,.5);
}

/* ── Intensity 3: confirmed spoofing / high threat ── */
.sm.intensity-3 .sm-halo {
  border-color: rgba(255,34,34,.95);
  box-shadow: 0 0 10px 3px rgba(255,34,34,.35);
  animation: halo-pulse 1.2s ease-out infinite;
}
.sm.intensity-3 .sm-halo::after {
  border-color: rgba(255,34,34,.55);
  animation: halo-pulse 1.2s ease-out infinite .4s;
}
.sm.intensity-3 .sm-code {
  color: #fff;
  background: rgba(210,0,0,.92);
  border-color: #ff2222;
  font-weight: 900;
}

@keyframes halo-pulse {
  0%   { transform: scale(1);   opacity: 1; }
  100% { transform: scale(5.5); opacity: 0; }
}

/* ── Interference-type halo shapes ─────────────────────────── */

/* Narrowband — tight fast ring, stays close to antenna base */
.sm.itype-narrow .sm-halo       { animation-name: halo-narrow; animation-duration: 1.5s; }
.sm.itype-narrow .sm-halo::after { animation-name: halo-narrow; animation-duration: 1.5s; animation-delay: .5s; }
@keyframes halo-narrow {
  0%   { transform: scale(1);   opacity: .95; }
  100% { transform: scale(3.2); opacity: 0; }
}

/* Wideband — broad slow expanding ring */
.sm.itype-wide .sm-halo        { animation-name: halo-wide; animation-duration: 3.8s; border-width: 1.5px; }
.sm.itype-wide .sm-halo::after { display: none; }   /* single wide ring only */
@keyframes halo-wide {
  0%   { transform: scale(1);   opacity: .7; }
  100% { transform: scale(9);   opacity: 0; }
}

/* Chirp/Sweep — rapid successive rings simulating frequency sweep */
.sm.itype-chirp .sm-halo        { animation-name: halo-chirp; animation-duration: 1.8s; }
.sm.itype-chirp .sm-halo::after { animation-name: halo-chirp; animation-duration: 1.8s; animation-delay: .28s; }
@keyframes halo-chirp {
  0%   { transform: scale(1) skewX(0deg);    opacity: 1; }
  40%  { transform: scale(2.5) skewX(5deg);  opacity: .6; }
  100% { transform: scale(5.5) skewX(-3deg); opacity: 0; }
}

/* Mixed — standard double ring (fallback) */
.sm.itype-mixed .sm-halo        { animation-name: halo-pulse; animation-duration: 2.2s; }
.sm.itype-mixed .sm-halo::after { animation-name: halo-pulse; animation-duration: 2.2s; animation-delay: .8s; }

/* ── Map legend ── */
#mapLegend {
  position: absolute;
  bottom: 32px; left: 10px;
  z-index: 800;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 11px;
  color: var(--t2);
  min-width: 160px;
  box-shadow: var(--shadow);
  user-select: none;
}
#mapLegend .legend-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--t3);
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#mapLegend .legend-toggle {
  background: none;
  border: none;
  color: var(--t3);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  transition: color .15s;
}
#mapLegend .legend-toggle:hover { color: var(--t2); }
#mapLegend .legend-rows { display: flex; flex-direction: column; gap: 5px; }
#mapLegend.collapsed .legend-rows { display: none; }
.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--t2);
  font-size: 11px;
}
.legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,.4);
  position: relative;
}
.legend-dot.ld-0 { background: #3fb950; }
.legend-dot.ld-1 { background: #e8a020; }
.legend-dot.ld-2 { background: #f85149; }
.legend-dot.ld-3 { background: #ff2222; box-shadow: 0 0 4px 1px rgba(255,34,34,.5); }
.legend-section-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--t3);
  margin-top: 4px;
}
/* Animation-type indicators in legend */
.legend-anim {
  display: inline-block;
  width: 32px;
  height: 10px;
  flex-shrink: 0;
  position: relative;
}
.legend-anim::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  border-radius: 50%;
  border: 1.5px solid;
}
.la-narrow::before { width: 10px; height: 10px; border-color: #58a6ff; }
.la-wide::before   { width: 22px; height: 22px; border-color: #58a6ff; opacity: .5; }
.la-chirp::before  { width: 10px; height: 10px; border-color: #58a6ff; }
.la-chirp::after   { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid rgba(88,166,255,.5); }

/* ── Panel footer (simple mode hint) ── */
.panel-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: rgba(88,166,255,.05);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--t2);
  flex-shrink: 0;
}
.panel-footer.simple-only { display: flex; }
body.adv-mode .panel-footer.simple-only { display: none; }
.hint-icon { font-size: 14px; flex-shrink: 0; }
.hint-btn {
  margin-left: auto;
  background: var(--accent2);
  border: none;
  color: #fff;
  width: 20px; height: 20px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── View header (threats / predictor pages) ── */
.view-header {
  padding: 16px 0 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.view-header h2 { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.view-subtitle { font-size: 12px; color: var(--t2); }
.content-area { max-width: 1100px; }

/* ── Threats + predictor views (scrollable) ── */
#threatsView, #predictorView {
  overflow-y: auto;
  padding: 16px 24px;
}

/* ── Predictor form ── */
.predictor-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  padding: 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  max-width: 640px;
}
.pf-group { display: flex; flex-direction: column; gap: 4px; }
.pf-label { font-size: 11px; color: var(--t2); font-weight: 600; }
.pf-btn {
  background: var(--accent2);
  border: none;
  color: #fff;
  padding: 7px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  height: 32px;
  align-self: flex-end;
  transition: background .15s;
}
.pf-btn:hover { background: #388bfd; }
.predictor-output {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 200px;
  max-width: 640px;
}

/* ── Empty state icon ── */
.empty-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

/* ── Mobile adjustments for new elements ── */
@media (max-width: 768px) {
  .api-ver-group { display: none; }
  .mobile-only { display: flex; }
  .ctrl-input[type="date"] { width: 108px; }
  .ctrl-search { width: 130px; }
  .ctrl-sep-label { display: none; }
  #threatsView, #predictorView { padding: 12px 16px; }
  .predictor-form { padding: 12px; gap: 8px; }
}
@media (max-width: 480px) {
  .api-ver-group { display: none; }
  .nav-brand { display: none; }
  .predictor-form { flex-direction: column; }
  .pf-btn { width: 100%; }
  #predictorStation { width: 100% !important; }
  .pf-group { width: 100%; }
  .pf-group .ctrl-input { width: 100% !important; }
  /* Threat modal: hide subtitle to save header space */
  .tmo-subtitle { display: none; }
  .tmo-stat { padding: 6px 8px; }
  .tmo-sv { font-size: 14px; }
  .tmo-sl { font-size: 8px; }
  /* Model quality sub text */
  .mq-sub { display: none; }
  /* Threats grid single column on phones */
  .threats-grid { grid-template-columns: 1fr; }
  /* VADASE cards */
  .vd-events-grid { grid-template-columns: 1fr !important; }
}

/* ── Very small phones (≤ 400px) ── */
@media (max-width: 400px) {
  /* Map controls: shrink date pickers, let search flex-fill */
  .ctrl-input[type="date"] { width: 82px; font-size: 11px; }
  .ctrl-search { width: auto !important; flex: 1; min-width: 60px; }
  .ctrl-divider { display: none; }

  /* Modal: tighter padding, smaller charts */
  .threat-modal-overlay { padding: 6px; }
  .threat-modal { max-height: 97vh; border-radius: 10px; }
  .tmo-psd-wrap { height: 170px; }
  .tmo-wf-wrap  { height: 150px; }
  .tmo-header { padding: 10px 12px 10px; gap: 6px; }
  .tmo-name { display: none; }

  /* Model quality: force 2-col card grid on tiny screens */
  .mq-cards { grid-template-columns: repeat(2, 1fr); }

  /* Predictor band table: let it scroll, nothing extra needed */
  .pv-section-label { font-size: 11px; }

  /* View headers compact */
  .view-header h2 { font-size: 17px; }
  .view-subtitle { font-size: 11px; }

  /* Threats summary pills wrap tidily */
  .threats-summary { gap: 5px; }
  .ts-total { margin-left: 0; width: 100%; }
}

/* ── Mobile menu ── */
#mobileMenuBtn {
  display: none;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--t1);
  width: 32px; height: 32px;
  border-radius: var(--radius);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
}
#mobileMenu {
  display: none;
  position: fixed;
  top: var(--nav-h); left: 0; right: 0;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 8px;
  z-index: 1050;
  flex-direction: column;
  gap: 4px;
}
#mobileMenu.open { display: flex; }
#mobileMenu .nav-tab { width: 100%; text-align: left; }

/* ── Scrollbar ── */
* { scrollbar-width: thin; scrollbar-color: var(--bg3) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 3px; }

/* ── Leaflet dark overrides ── */
.leaflet-popup-content-wrapper {
  background: var(--bg2);
  color: var(--t1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.leaflet-popup-tip { background: var(--bg2); }
.leaflet-control-zoom a {
  background: var(--bg2) !important;
  color: var(--t1) !important;
  border-color: var(--border) !important;
}
.leaflet-control-zoom a:hover { background: var(--bg3) !important; }
.leaflet-bar { border: 1px solid var(--border) !important; }

/* ── Station marker pulse ── */
.marker-pin {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.3);
  cursor: pointer;
  transition: transform .15s;
}
.marker-pin:hover { transform: scale(1.3); }
.marker-active   { background: var(--red); box-shadow: 0 0 0 4px rgba(248,81,73,.3); }
.marker-moderate { background: var(--orange); }
.marker-low      { background: var(--green); }
.marker-idle     { background: var(--t3); }

/* ── VADASE stats strip ── */
.vadase-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.vs-card {
  background: var(--bg3);
  border-radius: var(--radius);
  padding: 8px;
  text-align: center;
}
.vs-card .v  { font-size: 16px; font-weight: 700; color: var(--accent); }
.vs-card .l  { font-size: 10px; color: var(--t2); margin-top: 2px; }

/* ── VADASE displacement alerts ── */
.vadase-alert-section { margin-top: 14px; }
.vadase-alert-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: rgba(245,158,11,.1);
  border: 1px solid rgba(245,158,11,.3);
  border-radius: var(--radius);
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #fbbf24;
}
.vadase-alert-icon { font-size: 14px; }
.vd-events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 8px;
}
.vd-event {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
}
.vd-event-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.vd-time { font-size: 11px; color: var(--t2); font-family: monospace; }
.vd-mag  { font-size: 11px; font-weight: 700; color: #fbbf24; background: rgba(245,158,11,.15); border-radius: 3px; padding: 1px 6px; }
.vd-visuals { display: flex; gap: 8px; align-items: center; }
.vd-plane-wrap, .vd-vert-wrap { display: flex; flex-direction: column; align-items: center; gap: 3px; flex-shrink: 0; }
.vd-axis-label { font-size: 9px; color: var(--t3); text-transform: uppercase; letter-spacing: .05em; }
.vd-plane-svg { width: 78px; height: 78px; background: var(--bg2); border-radius: 50%; border: 1px solid var(--border); }
.vd-vert-svg  { width: 26px; height: 78px; background: var(--bg2); border-radius: 4px; border: 1px solid var(--border); }
.vd-bars { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.vd-bar-row { display: flex; align-items: center; gap: 5px; }
.vd-bar-lbl { font-size: 10px; font-weight: 700; width: 10px; flex-shrink: 0; }
.vd-bar-track { flex: 1; height: 5px; background: var(--bg2); border-radius: 3px; overflow: hidden; }
.vd-bar-fill  { height: 100%; border-radius: 3px; width: 0%; transition: none; }
.vd-bar-val   { font-size: 10px; font-family: monospace; white-space: nowrap; min-width: 52px; text-align: right; }

/* ── Separator ── */
.section-sep {
  border: none;
  border-top: 1px solid var(--border);
  margin: 12px 0;
}

/* ── Quick message / tooltip ── */
[data-tip] { position: relative; cursor: help; }
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  color: var(--t1);
  white-space: nowrap;
  z-index: 9999;
  pointer-events: none;
}

/* ── Model quality section ── */
.model-quality {
  margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px;
}
.mq-header {
  display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.mq-title { font-size: 14px; font-weight: 700; color: var(--t1); }
.mq-sub   { font-size: 11px; color: var(--t3); }

.mq-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px,1fr)); gap: 8px; margin-bottom: 16px;
}
.mq-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 7px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 3px;
}
.mq-cv { font-size: 16px; font-weight: 700; color: var(--t1); font-variant-numeric: tabular-nums; }
.mq-cl { font-size: 9px; color: var(--t3); text-transform: uppercase; letter-spacing: .05em; }
.mq-green { color: #3fb950; }
.mq-blue  { color: #58a6ff; }

.mq-charts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
@media (max-width: 700px) { .mq-charts { grid-template-columns: 1fr; } }

.mq-chart-box {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 12px 10px;
}
.mq-chart-lbl {
  font-size: 11px; font-weight: 600; color: var(--t2); margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.mq-chart-lbl::before { content:''; width:7px; height:7px; border-radius:50%; background:#58a6ff; flex-shrink:0; }

.mq-info-rows { display: flex; flex-direction: column; gap: 0; margin-top: 8px; }
.mq-info-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 0;
  border-top: 1px solid var(--border); flex-wrap: wrap;
}
.mq-info-lbl  { font-size: 10px; font-weight: 700; color: var(--t3); text-transform: uppercase; letter-spacing:.04em; min-width: 68px; }
.mq-info-detail { font-size: 10px; color: var(--t3); margin-left: auto; }

/* ── Predictor view extras ── */
.pv-section-label {
  font-size: 12px; font-weight: 700; color: #8b949e;
  margin: 20px 0 8px; display: flex; align-items: center; gap: 7px;
}
.pv-section-label::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #f85149; flex-shrink: 0; }
.pv-band-table td, .pv-band-table th { padding: 5px 10px; }
.pv-prob-cell { display: flex; align-items: center; gap: 7px; min-width: 110px; }
.pv-prob-bar-wrap { flex: 1; height: 4px; background: var(--bg); border-radius: 2px; overflow: hidden; }
.pv-prob-bar { height: 100%; border-radius: 2px; transition: width .4s ease; }
.pv-prob-pct { font-size: 11px; font-weight: 600; color: var(--t1); white-space: nowrap; min-width: 38px; text-align: right; }

/* ══════════════════════════════════════════════
   THREAT MODAL
══════════════════════════════════════════════ */
.threat-modal-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,.72); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  padding: 16px;
}
.threat-modal-overlay.open { display: flex; }

.threat-modal {
  background: #0d1117; border: 1px solid #30363d; border-radius: 12px;
  width: 100%; max-width: 1100px; max-height: 92vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.7);
}

.tmo-header {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px 12px; border-bottom: 1px solid #21262d; flex-shrink: 0;
}
.tmo-title-row { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.tmo-code { font-size: 16px; font-weight: 800; color: #e6edf3; letter-spacing: .04em; flex-shrink: 0; }
.tmo-name { font-size: 13px; color: #8b949e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmo-badge {
  font-size: 9px; font-weight: 800; letter-spacing: .06em;
  padding: 2px 8px; border-radius: 10px; white-space: nowrap; flex-shrink: 0;
}
.tmo-subtitle { font-size: 11px; color: #6e7681; white-space: nowrap; flex-shrink: 0; }
.tmo-close {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid #30363d; background: transparent; color: #8b949e;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s, border-color .15s; flex-shrink: 0;
}
.tmo-close:hover { background: rgba(248,81,73,.15); color: #f85149; border-color: rgba(248,81,73,.4); }

.tmo-stats {
  display: flex; gap: 1px; background: #21262d; border-bottom: 1px solid #21262d; flex-shrink: 0;
}
.tmo-stat {
  flex: 1; padding: 8px 16px; background: #0d1117;
  display: flex; flex-direction: column; gap: 2px;
}
.tmo-sv { font-size: 18px; font-weight: 700; color: #e6edf3; font-variant-numeric: tabular-nums; }
.tmo-sl { font-size: 9px; color: #6e7681; letter-spacing: .06em; text-transform: uppercase; }
.tmo-st-red   .tmo-sv { color: #f85149; }
.tmo-st-amber .tmo-sv { color: #e3b341; }
.tmo-st-blue  .tmo-sv { color: #58a6ff; }

.tmo-main { display: flex; flex: 1; overflow: hidden; min-height: 0; }

.tmo-charts {
  flex: 1; display: flex; flex-direction: column; padding: 12px 12px 12px 14px;
  overflow-y: auto; min-width: 0; gap: 0;
}
.tmo-chart-label {
  font-size: 11px; font-weight: 600; color: #8b949e;
  padding-bottom: 6px; display: flex; align-items: center; gap: 6px;
}
.tmo-chart-label::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #3fb950; flex-shrink: 0; }
.tmo-psd-wrap { height: 260px; flex-shrink: 0; }
.tmo-wf-wrap  { height: 220px; flex-shrink: 0; }

.tmo-side {
  width: 230px; flex-shrink: 0; border-left: 1px solid #21262d;
  padding: 14px 13px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
}
.tmo-threat-hd {
  font-size: 11px; font-weight: 700; color: #58a6ff; letter-spacing: .04em;
  display: flex; align-items: center; gap: 6px;
}
.tmo-threat-hd::before { content: '●'; color: #f85149; font-size: 8px; }
.tmo-threat-badge { border-radius: 8px; padding: 10px 12px; }
.tmo-threat-lbl { font-size: 11px; font-weight: 800; letter-spacing: .06em; line-height: 1.8; }
.tmo-threat-info { font-size: 11px; color: #e6edf3; line-height: 1.7; }
.tmo-threat-row {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 0; border-top: 1px solid #21262d;
}
.tmo-itype-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.tmo-itype  { flex: 1; font-size: 11px; color: #e6edf3; }
.tmo-icount { font-size: 12px; font-weight: 700; color: #e6edf3; min-width: 28px; text-align: right; }
.tmo-idBm   { font-size: 10px; color: #8b949e; min-width: 52px; text-align: right; font-family: monospace; }

@media (max-width: 700px) {
  .tmo-main { flex-direction: column; }
  .tmo-side { width: 100%; border-left: none; border-top: 1px solid #21262d; }
  .tmo-psd-wrap { height: 200px; }
  .tmo-wf-wrap  { height: 180px; }
  .tmo-stats { flex-wrap: wrap; }
  .tmo-stat { min-width: 80px; }
}

/* ══════════════════════════════════════════════
   THREATS VIEW — station intelligence cards
══════════════════════════════════════════════ */
.threats-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  flex-wrap: wrap;
}
.ts-total {
  font-size: 11px;
  color: var(--t3);
  margin-left: auto;
}
.ts-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: .04em;
}
.ts-pill.tc-critical { background: rgba(248,81,73,.18); color: #f85149; border: 1px solid rgba(248,81,73,.35); }
.ts-pill.tc-high     { background: rgba(227,179,65,.18); color: #e3b341; border: 1px solid rgba(227,179,65,.35); }
.ts-pill.tc-med      { background: rgba(245,158,11,.18); color: #f59e0b; border: 1px solid rgba(245,158,11,.35); }
.ts-pill.tc-low      { background: rgba(252,211,77,.18); color: #fcd34d; border: 1px solid rgba(252,211,77,.35); }
.ts-pill.tc-clean    { background: rgba(63,185,80,.18);  color: #3fb950; border: 1px solid rgba(63,185,80,.35); }

.threats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  padding: 0 16px 16px;
}

.threat-card {
  display: flex;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.threat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(0,0,0,.35);
}
.threat-card.tc-critical:hover { border-color: rgba(248,81,73,.55); }
.threat-card.tc-high:hover     { border-color: rgba(227,179,65,.55); }
.threat-card.tc-med:hover      { border-color: rgba(245,158,11,.55); }
.threat-card.tc-low:hover      { border-color: rgba(252,211,77,.45); }
.threat-card.tc-clean:hover    { border-color: rgba(63,185,80,.45); }

.tc-stripe {
  width: 4px;
  flex-shrink: 0;
}

.tc-body {
  flex: 1;
  padding: 10px 11px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.tc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}
.tc-station {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.tc-code {
  font-size: 13px;
  font-weight: 700;
  color: var(--t1);
  letter-spacing: .03em;
}
.tc-name {
  font-size: 10px;
  color: var(--t3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.tc-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.tc-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.tc-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.tc-mv {
  font-size: 13px;
  font-weight: 700;
  color: var(--t1);
  font-variant-numeric: tabular-nums;
}
.tc-ml {
  font-size: 9px;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.tc-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tc-sparkline {
  display: flex;
  align-items: center;
  gap: 5px;
}
.tc-spark-label {
  font-size: 9px;
  color: var(--t3);
  white-space: nowrap;
}
.tc-threat-label {
  font-size: 9px;
  color: var(--t3);
  text-transform: capitalize;
  text-align: right;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════
   SITE FOOTER
   ═══════════════════════════════════════════════════════════ */
.site-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 18px 32px;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-copy {
  font-size: 12px;
  color: var(--t3);
  line-height: 1.6;
}
.footer-copy a {
  color: var(--t3);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
.footer-copy a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.footer-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.footer-links a {
  font-size: 12px;
  color: var(--t3);
  text-decoration: none;
  padding: 2px 8px;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
.footer-links a:hover { color: var(--t1); background: var(--bg3); }
.footer-sep { color: var(--border); padding: 0 2px; font-size: 11px; }

/* ═══════════════════════════════════════════════════════════
   CONTACT PAGE
   ═══════════════════════════════════════════════════════════ */
.contact-layout {
  padding-top: var(--nav-h);
  min-height: calc(100vh - var(--nav-h));
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.contact-wrapper {
  flex: 1;
  max-width: 1060px;
  margin: 0 auto;
  padding: 48px 32px 64px;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 48px;
  align-items: start;
}

/* — Info column — */
.contact-info h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 10px;
}
.ci-intro {
  font-size: 14px;
  color: var(--t2);
  line-height: 1.65;
  margin-bottom: 28px;
}
.ci-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  transition: border-color .15s;
}
.ci-card:hover { border-color: var(--t3); }
.ci-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(88,166,255,.1);
  border-radius: 8px;
  color: var(--accent);
}
.ci-icon svg { width: 18px; height: 18px; }
.ci-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--t3);
  margin-bottom: 4px;
}
.ci-value {
  display: block;
  font-size: 13.5px;
  color: var(--t1);
  text-decoration: none;
  line-height: 1.5;
}
a.ci-value:hover { color: var(--accent); }
.ci-value-sub {
  font-size: 12px;
  color: var(--t2);
  line-height: 1.4;
  margin-top: 2px;
}
.ci-about {
  margin-top: 24px;
  padding: 16px;
  background: rgba(88,166,255,.04);
  border: 1px solid rgba(88,166,255,.15);
  border-radius: var(--radius);
}
.ci-about-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--accent);
  margin-bottom: 8px;
}
.ci-about p {
  font-size: 12.5px;
  color: var(--t2);
  line-height: 1.65;
  margin-bottom: 12px;
}
.ci-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.ci-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--t2);
  text-decoration: none;
  transition: color .15s, border-color .15s;
  letter-spacing: .03em;
}
a.ci-badge:hover { color: var(--accent); border-color: var(--accent); }

/* — Form column — */
.contact-form-wrap {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cf-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}
.cf-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--t1);
}
.cf-sub {
  font-size: 12px;
  color: var(--t3);
  margin-top: 3px;
}
#contactForm {
  padding: 22px 24px;
}
.cf-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.cf-group {
  margin-bottom: 16px;
}
.cf-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--t2);
  margin-bottom: 5px;
}
.cf-req { color: var(--red); }
.cf-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--t1);
  font-size: 13.5px;
  padding: 9px 12px;
  outline: none;
  transition: border-color .15s;
  box-sizing: border-box;
  font-family: inherit;
}
.cf-input:focus { border-color: var(--accent2); box-shadow: 0 0 0 3px rgba(88,166,255,.08); }
.cf-input.cf-invalid { border-color: var(--red); }
.cf-select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.cf-textarea {
  resize: vertical;
  min-height: 120px;
  max-height: 320px;
  line-height: 1.6;
}
.cf-counter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}
.cf-counter { font-size: 11px; color: var(--t3); }
.cf-err {
  font-size: 12px;
  color: var(--red);
  min-height: 16px;
  margin-top: 3px;
}
.cf-submit {
  width: 100%;
  padding: 11px 20px;
  background: var(--accent2);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity .15s, transform .1s;
  font-family: inherit;
  margin-top: 6px;
}
.cf-submit:hover:not(:disabled) { opacity: .88; }
.cf-submit:active:not(:disabled) { transform: scale(.98); }
.cf-submit:disabled { opacity: .5; cursor: not-allowed; }
@keyframes cf-spin { to { transform: rotate(360deg); } }
.cf-spin { animation: cf-spin .8s linear infinite; }
.cf-success {
  padding: 40px 24px;
  text-align: center;
}
.cf-success-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(63,185,80,.15);
  border: 2px solid var(--green);
  color: var(--green);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.cf-success-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--t1);
  margin-bottom: 8px;
}
.cf-success-sub {
  font-size: 13px;
  color: var(--t2);
  line-height: 1.6;
  max-width: 320px;
  margin: 0 auto 20px;
}
.cf-another {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--t1);
  font-size: 13px;
  padding: 8px 18px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s;
}
.cf-another:hover { border-color: var(--t3); }
.cf-global-err {
  margin: 0 24px 20px;
  padding: 12px 16px;
  background: rgba(248,81,73,.08);
  border: 1px solid rgba(248,81,73,.3);
  border-radius: 6px;
  font-size: 13px;
  color: var(--red);
}
.cf-rate-note {
  font-size: 11px;
  color: var(--t3);
  text-align: center;
  margin-top: 10px;
  padding: 0 24px;
}
.cf-cooldown {
  font-size: 12px;
  color: var(--orange);
  text-align: center;
  margin-top: 8px;
}

@media (max-width: 860px) {
  .contact-wrapper {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 32px 20px 48px;
  }
}
@media (max-width: 480px) {
  .cf-row-2 { grid-template-columns: 1fr; gap: 0; }
  .contact-wrapper { padding: 24px 16px 40px; }
  .site-footer { padding: 16px 20px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
}
