/* ═══════════════════════════════════════════════════════
   HyveHeim Web — Dark Theme
   ═══════════════════════════════════════════════════════ */

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

:root {
  --bg:           #0A0E1A;
  --surface:      rgba(14, 18, 28, 0.92);
  --surface-s:    #0e121c;       /* solid version */
  --surface-2:    rgba(24, 30, 46, 0.85);
  --surface-2s:   #181e2e;
  --primary:      #4FC3F7;
  --primary-d:    rgba(79, 195, 247, 0.15);
  --error:        #EF5350;
  --error-d:      rgba(239, 83, 80, 0.15);
  --warning:      #FFA726;
  --warning-d:    rgba(255, 167, 38, 0.15);
  --success:      #66BB6A;
  --crime:        #AB47BC;
  --crime-d:      rgba(171, 71, 188, 0.15);
  --cbrn:         #FF7043;
  --cbrn-d:       rgba(255, 112, 67, 0.15);
  --health:       #26A69A;
  --health-d:     rgba(38, 166, 154, 0.15);
  --minor:        #FFEE58;
  --minor-d:      rgba(255, 238, 88, 0.15);
  --text:         #E8EDF5;
  --text-muted:   #8B93A7;
  --border:       rgba(37, 45, 64, 0.9);
  --border-s:     #252D40;
  --topbar:       56px;
  --sidebar:      360px;
  --r:            10px;
  --r-sm:         6px;
  --r-full:       9999px;
  --font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-family: var(--font);
  color-scheme: dark;
}
[data-theme="light"] { color-scheme: light; }

html, body { height: 100%; background: var(--bg); color: var(--text); overflow: hidden; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* ── Map ──────────────────────────────────────────────── */
#map { position: fixed; inset: 0; z-index: 0; }

/* ── Top bar ──────────────────────────────────────────── */
#topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--topbar); z-index: 100;
  display: flex; align-items: center; gap: 10px; padding: 0 16px;
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

#brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700; letter-spacing: 0.3px;
  color: var(--primary); white-space: nowrap; text-decoration: none;
  flex-shrink: 0;
}
#brand .logo { width: 26px; height: 26px; }

#filter-bar {
  flex: 1; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  display: flex; align-items: center; gap: 6px; padding: 0 4px;
}
#filter-bar::-webkit-scrollbar { display: none; }

.fdiv { width: 1px; height: 18px; background: var(--border); flex-shrink: 0; margin: 0 2px; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
  border: 1px solid transparent; transition: all 0.14s ease;
  background: var(--surface-2); color: var(--text-muted); user-select: none;
}
.chip:hover { color: var(--text); border-color: var(--border); }
.chip.on { background: var(--primary-d); border-color: rgba(79,195,247,0.4); color: var(--primary); }
.chip.on.err  { background: var(--error-d);   border-color: rgba(239,83,80,0.4);   color: var(--error); }
.chip.on.warn { background: var(--warning-d); border-color: rgba(255,167,38,0.4);  color: var(--warning); }
.chip.on.crim { background: var(--crime-d);   border-color: rgba(171,71,188,0.4);  color: var(--crime); }
.chip.on.cbr  { background: var(--cbrn-d);    border-color: rgba(255,112,67,0.4);  color: var(--cbrn); }
.chip.on.hlth { background: var(--health-d);  border-color: rgba(38,166,154,0.4);  color: var(--health); }

/* ── Topbar timeline graph ────────────────────────────── */
.timeline-wrap {
  flex: 1; min-width: 80px; max-width: 320px;
  display: flex; align-items: center; gap: 6px;
  padding: 0 4px;
}
.timeline-wrap canvas {
  flex: 1; height: 28px; cursor: crosshair;
  border-radius: var(--r-sm);
}
.timeline-label {
  font-size: 9px; font-weight: 600; color: var(--text-muted);
  letter-spacing: .04em; text-transform: uppercase;
  white-space: nowrap; max-width: 90px; overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 768px) {
  .timeline-wrap { display: none; }
}

#topbar-indicators {
  display: flex; align-items: center; gap: 10px; margin-left: 8px;
}
.tb-indicator {
  display: flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--r-full);
  background: var(--surface-2); border: 1px solid var(--border);
  cursor: default; white-space: nowrap;
  transition: border-color .2s;
}
a.tb-indicator { text-decoration: none; }
.tb-indicator:hover { border-color: rgba(79,195,247,.3); }
.tb-indicator .ms { color: var(--text-muted); }
.tb-ind-label { font-size: 10px; font-weight: 600; color: var(--text-muted); letter-spacing: .03em; text-transform: uppercase; }
.tb-ind-value { font-size: 11px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
#ind-doomsday .ms { color: var(--error); }
#ind-doomsday .tb-ind-value { color: var(--error); }
#ind-ww3 .ms { color: var(--warning); }
#ind-ww3 .tb-ind-value { color: var(--warning); }
#ind-ai .ms { color: var(--primary); }
#ind-ai .tb-ind-value { color: var(--primary); }
#ind-stability .ms { color: var(--success); }
#ind-stability .tb-ind-value { color: var(--warning); }
@media (max-width: 1100px) {
  .tb-ind-label { display: none; }
}
@media (max-width: 700px) {
  #topbar-indicators { display: none; }
}

/* ── Navigation menu ─────────────────────────────────── */
.nav-menu {
  display: none; position: fixed;
  top: var(--topbar); left: 0; z-index: 120;
  width: 220px; padding: 8px;
  background: rgba(10,14,26,.97); backdrop-filter: blur(20px);
  border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--r) 0;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  animation: menuSlide .15s ease;
}
.nav-menu.open { display: block; }
@keyframes menuSlide { from { opacity:0; transform: translateY(-6px); } to { opacity:1; transform: translateY(0); } }
.nav-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-radius: var(--r-sm);
  font-size: 13px; color: var(--text-muted); text-decoration: none;
  transition: background .12s, color .12s;
}
.nav-menu-item:hover { background: rgba(255,255,255,.06); color: var(--text); }
.nav-menu-item.active { color: var(--primary); background: var(--primary-d); }
.nav-menu-item .ms { font-size: 18px !important; width: 22px; text-align: center; }
[data-theme="light"] .nav-menu { background: rgba(245,246,250,.97); }

/* ── Indicator detail panels ─────────────────────────── */
.ind-panel {
  display: none; position: fixed;
  top: var(--topbar); left: 50%; transform: translateX(-50%);
  width: 520px; max-width: calc(100vw - 32px); max-height: calc(100vh - 80px);
  overflow-y: auto; z-index: 120;
  background: rgba(10,14,26,.97); backdrop-filter: blur(20px);
  border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--r) var(--r);
  padding: 20px; box-shadow: 0 16px 48px rgba(0,0,0,.6);
  animation: indSlide .2s ease;
}
.ind-panel.open { display: block; }
@keyframes indSlide { from { opacity:0; transform: translateX(-50%) translateY(-8px); } to { opacity:1; transform: translateX(-50%) translateY(0); } }
.ind-panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.ind-panel-title { font-size: 15px; font-weight: 700; color: var(--text); }
.ind-panel-sub { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }
.ind-panel-val-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 18px; }
.ind-panel-big { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ind-panel-ctx { font-size: 12px; color: var(--text-muted); font-style: italic; }
.ind-panel-bars { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.ind-bar-item { display: flex; flex-direction: column; gap: 3px; }
.ind-bar-label { font-size: 11px; color: var(--text-muted); display: flex; justify-content: space-between; }
.ind-bar-w { font-size: 10px; opacity: .6; }
.ind-bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.ind-bar-fill { height: 100%; border-radius: 3px; transition: width .4s ease; }
.ind-panel-note { font-size: 11.5px; line-height: 1.6; color: var(--text); margin-bottom: 12px; padding: 12px; background: var(--surface-2); border-radius: var(--r-sm); border-left: 3px solid var(--primary); }
.ind-panel-sources { font-size: 10px; color: var(--text-muted); line-height: 1.5; }
[data-theme="light"] .ind-panel { background: rgba(245,246,250,.97); }
#topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }

/* ── Intel stats strip (topbar) ──────────────────────── */
.intel-stats {
  display: flex; align-items: center; gap: 12px;
}
.istat {
  display: flex; align-items: center; gap: 3px;
  font-size: 11px; color: var(--text-muted); white-space: nowrap;
}
.istat span:nth-child(2) {
  font-weight: 700; color: var(--text); font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.istat-lbl { font-size: 9.5px; color: var(--text-muted); letter-spacing: .03em; }
.istat-warn span:nth-child(2) { color: var(--warning); }
.istat-live span:nth-child(2) { color: var(--primary); }
.istat .ms { color: var(--text-muted); }
.istat-warn .ms { color: var(--warning); }
.istat-live .ms { color: var(--primary); }
@media (max-width: 1100px) {
  .intel-stats { display: none; }
}

/* ── Sidebar filter bar ──────────────────────────────── */
.sb-filters {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sf-chip {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 9px; border-radius: var(--r-full);
  font-size: 10.5px; font-weight: 500; cursor: pointer;
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid transparent; transition: all .14s ease;
  user-select: none;
}
.sf-chip:hover { color: var(--text); border-color: var(--border); }
.sf-chip.on {
  background: var(--primary-d); border-color: rgba(79,195,247,.4);
  color: var(--primary);
}
.sf-chip.sf-disinfo.on {
  background: var(--warning-d); border-color: rgba(255,167,38,.4);
  color: var(--warning);
}
.sf-chip .ms { font-size: 11px !important; vertical-align: -1px; }

.btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 14px; border-radius: var(--r-full); font-size: 13px;
  font-weight: 500; cursor: pointer; border: none; transition: all 0.14s ease;
}
.btn-ghost  { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); }
.btn-primary { background: var(--primary); color: #0A0E1A; font-weight: 600; }
.btn-primary:hover { opacity: 0.88; }
.btn-icon { padding: 6px; border-radius: 50%; width: 34px; height: 34px; justify-content: center; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--primary-d);
  border: 2px solid rgba(79,195,247,0.4); display: flex; align-items: center;
  justify-content: center; font-size: 13px; font-weight: 700; color: var(--primary);
  cursor: pointer;
}

.live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--error);
  animation: blink 1.4s ease-in-out infinite; flex-shrink: 0;
}
@keyframes blink { 0%,100%{opacity:.3;transform:scale(.8)} 50%{opacity:1;transform:scale(1)} }

/* ── Right Sidebar ────────────────────────────────────── */
#sidebar {
  position: fixed; top: var(--topbar); right: 0; bottom: 0;
  width: var(--sidebar); z-index: 90;
  display: flex; flex-direction: column;
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-left: 1px solid var(--border);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
}
#sidebar.closed { transform: translateX(100%); }

#sb-head {
  padding: 12px 16px 10px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
#sb-title { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
/* sb-count is now inside .istat in the footer — inherits istat styling */
#sb-stale {
  display: none; padding: 2px 7px; border-radius: var(--r-full);
  font-size: 10px; font-weight: 600;
  background: var(--warning-d); color: var(--warning);
}

#events-list {
  flex: 1; overflow-y: auto; padding: 8px;
  scrollbar-width: thin; scrollbar-color: var(--border-s) transparent;
}
#events-list::-webkit-scrollbar { width: 4px; }
#events-list::-webkit-scrollbar-thumb { background: var(--border-s); border-radius: 2px; }

/* Event card */
.ecard {
  padding: 12px 14px; border-radius: var(--r); margin-bottom: 6px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  cursor: pointer; transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.ecard:hover { background: rgba(24,30,46,0.97); transform: translateX(-2px); }
.ecard.sel { box-shadow: 0 0 0 1px rgba(79,195,247,0.25); }
.ecard.sev-critical { border-left-color: var(--error); }
.ecard.sev-major    { border-left-color: var(--warning); }
.ecard.sev-minor    { border-left-color: var(--minor); }
.ecard.sev-monitor  { border-left-color: var(--primary); }
.ecard.sev-threat   { border-left-color: var(--error); }
.ecard.sev-warning  { border-left-color: var(--warning); }
.ecard-top  { display: flex; align-items: center; gap: 5px; margin-bottom: 5px; }
.ecard-time { margin-left: auto; font-size: 10px; color: var(--text-muted); }
.ecard-title {
  font-size: 12.5px; font-weight: 600; line-height: 1.35; margin-bottom: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ecard-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-muted); }
.src-chips  { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 5px; }
.src-chip {
  padding: 1px 6px; border-radius: var(--r-full); font-size: 10px;
  background: var(--primary-d); color: var(--primary); cursor: pointer;
}
.src-chip:hover { opacity: 0.78; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; padding: 2px 6px;
  border-radius: var(--r-full); font-size: 10px; font-weight: 600; letter-spacing: 0.3px;
}
.b-critical { background: var(--error-d);   color: var(--error); }
.b-major    { background: var(--warning-d); color: var(--warning); }
.b-minor    { background: var(--minor-d);   color: var(--minor); }
.b-monitor  { background: var(--primary-d); color: var(--primary); }
.b-threat   { background: var(--error-d);   color: var(--error); }
.b-warning  { background: var(--warning-d); color: var(--warning); }
.b-info     { background: var(--primary-d); color: var(--primary); }
.b-type     { background: rgba(139,147,167,0.12); color: var(--text-muted); }
.b-conflict { background: var(--error-d);  color: var(--error); }
.b-civil    { background: var(--crime-d);  color: var(--crime); }
.b-crime    { background: var(--crime-d);  color: var(--crime); }
.b-cyber    { background: var(--primary-d); color: var(--primary); }
.b-cbrn     { background: var(--cbrn-d);   color: var(--cbrn); }
.b-health   { background: var(--health-d); color: var(--health); }
.b-disaster { background: var(--warning-d); color: var(--warning); }
.b-infrastructure { background: rgba(139,147,167,0.12); color: var(--text-muted); }
.b-economic { background: rgba(139,147,167,0.12); color: var(--text-muted); }

/* ── Event detail panel ───────────────────────────────── */
#detail {
  position: fixed; top: var(--topbar); right: 0; bottom: 0;
  width: var(--sidebar); z-index: 95;
  display: flex; flex-direction: column;
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
}
#detail.open { transform: translateX(0); }

#det-head {
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
#det-body {
  flex: 1; overflow-y: auto; padding: 16px;
  scrollbar-width: thin; scrollbar-color: var(--border-s) transparent;
}
#det-body::-webkit-scrollbar { width: 4px; }
#det-body::-webkit-scrollbar-thumb { background: var(--border-s); border-radius: 2px; }

.det-title { font-size: 16px; font-weight: 700; line-height: 1.45; margin: 10px 0 12px; letter-spacing: -0.01em; }
.det-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 10px; background: var(--surface-2); border-radius: var(--r-sm);
  font-size: 11px; color: var(--text-muted); margin-bottom: 14px;
}
.det-meta .ms { font-size: 13px; }

/* AI card */
.ai-card {
  padding: 14px; background: var(--surface-2); border-radius: var(--r);
  border: 1px solid var(--border); margin-bottom: 16px;
}
.ai-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ai-card-head h3 { font-size: 13px; font-weight: 600; flex: 1; }
.ai-text { font-size: 13px; line-height: 1.65; color: var(--text-muted); }
.ai-placeholder { font-size: 13px; color: var(--text-muted); opacity: 0.6; }

.sec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.sec-head h3 { font-size: 13px; font-weight: 600; flex: 1; }
.sec-link { font-size: 11px; color: var(--primary); cursor: pointer; display: flex; align-items: center; gap: 3px; }

.src-tile {
  padding: 10px 12px; background: var(--surface-2); border-radius: var(--r-sm);
  border: 1px solid var(--border); margin-bottom: 6px;
  display: flex; align-items: flex-start; gap: 10px;
  cursor: pointer; text-decoration: none; color: var(--text); transition: border-color 0.14s;
}
.src-tile:hover { border-color: rgba(79,195,247,0.3); }
.src-name { padding: 2px 7px; background: var(--primary-d); border-radius: var(--r-full); font-size: 10px; font-weight: 600; color: var(--primary); white-space: nowrap; flex-shrink: 0; }
.src-info  { flex: 1; min-width: 0; }
.src-ttl   { font-size: 12px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 2px; }
.src-date  { font-size: 10px; color: var(--text-muted); }

/* ── Map markers ──────────────────────────────────────── */
/* MapLibre marker anchor fix — ensure wrapper doesn't inherit unwanted sizing */
/* Hex outline + center circle design */
.mk-wrap {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  overflow: visible; cursor: pointer;
  /* position: absolute is inherited from .maplibregl-marker — do NOT override */
  transition: filter 0.18s ease;
}
.mk-hex {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  transition: transform 0.18s ease;
  transform-origin: center center;
}
.mk-hex path { stroke-width: 0.6; stroke-linejoin: round; }
.mk-circle {
  position: relative; z-index: 1;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.mk-circle .ms { font-size: 13px; color: white; font-variation-settings: 'FILL' 1,'wght' 500; }
/* Severity colours — aperture blades + center circle */
.mk-wrap.t .mk-hex path { fill: rgba(255,152,0,0.5); stroke: rgba(255,152,0,0.7); }
.mk-wrap.t .mk-circle { background: rgba(229,57,53,0.92); }
.mk-wrap.w .mk-hex path { fill: rgba(255,235,59,0.45); stroke: rgba(255,235,59,0.65); }
.mk-wrap.w .mk-circle { background: rgba(255,152,0,0.92); }
.mk-wrap.n .mk-hex path { fill: rgba(255,179,0,0.45); stroke: rgba(255,179,0,0.65); }
.mk-wrap.n .mk-circle { background: rgba(255,238,88,0.92); }
.mk-wrap.i .mk-hex path { fill: rgba(149,117,205,0.4); stroke: rgba(149,117,205,0.6); }
.mk-wrap.i .mk-circle { background: rgba(30,136,229,0.9); }
/* Institutional markers — UN (blue globe) and Government (gold building) */
.mk-wrap.inst-un .mk-hex path { fill: rgba(0,150,220,0.45); stroke: rgba(0,150,220,0.7); }
.mk-wrap.inst-un .mk-circle { background: rgba(0,120,190,0.95); }
.mk-wrap.inst-gov .mk-hex path { fill: rgba(180,160,100,0.4); stroke: rgba(180,160,100,0.65); }
.mk-wrap.inst-gov .mk-circle { background: rgba(120,100,60,0.92); }
/* Overlay silhouette markers — aircraft & vessels */
.mk-wrap.inst-adsb, .mk-wrap.inst-ais { width: 32px; height: 32px; background: none; border: none; box-shadow: none; }
.ov-silhouette {
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s, filter 0.15s;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}
.ov-aircraft { width: 28px; height: 28px; }
.ov-vessel { width: 24px; height: 24px; }
.ov-silhouette svg { width: 100%; height: 100%; }
/* Hover/selection — scale up with glow */
.mk-wrap.inst-adsb:hover .ov-silhouette,
.mk-wrap.inst-ais:hover .ov-silhouette { filter: drop-shadow(0 0 6px rgba(255,255,255,0.6)) drop-shadow(0 1px 4px rgba(0,0,0,0.5)); }
.mk-wrap.inst-adsb.sel .ov-silhouette,
.mk-wrap.inst-ais.sel .ov-silhouette { filter: drop-shadow(0 0 8px rgba(255,255,255,0.8)) drop-shadow(0 1px 4px rgba(0,0,0,0.6)); }
/* Critical severity pulse animation */
.mk-wrap.inst-adsb.t .ov-silhouette,
.mk-wrap.inst-ais.t .ov-silhouette { animation: ov-pulse 1.5s ease-in-out infinite; }
@keyframes ov-pulse {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(255,23,68,0.6)); }
  50% { filter: drop-shadow(0 0 12px rgba(255,23,68,0.9)); }
}
/* Layer toggle button highlights */
#btn-aviation.on { color: #00b4ff; background: rgba(0,180,255,0.15); }
#btn-maritime.on { color: #009688; background: rgba(0,150,136,0.15); }
/* Overlay dropdown groups */
.overlay-group { position: relative; }
.overlay-panel {
  display: none; position: absolute; top: 100%; left: 0; z-index: 20;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 10px; min-width: 130px; margin-top: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
.overlay-panel.open { display: flex; flex-direction: column; gap: 4px; }
.overlay-panel label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text); cursor: pointer; white-space: nowrap;
  padding: 2px 0;
}
.overlay-panel input[type="checkbox"] { accent-color: var(--accent); width: 14px; height: 14px; }
.ov-off {
  margin-top: 4px; padding: 3px 8px; border: none; border-radius: 4px;
  background: rgba(255,60,60,.15); color: #ff6b6b; font-size: 10px;
  cursor: pointer; display: flex; align-items: center; gap: 4px;
}
.ov-off:hover { background: rgba(255,60,60,.25); }
/* Hover + selected */
.mk-wrap:hover .mk-hex { transform: scale(1.18); }
.mk-wrap:hover .mk-circle { transform: scale(1.12); }
.mk-wrap.sel .mk-hex { transform: scale(1.25); }
.mk-wrap.sel .mk-circle { transform: scale(1.15); box-shadow: 0 0 10px rgba(255,255,255,.45); }
.mk-wrap.sel { filter: brightness(1.2) drop-shadow(0 0 6px rgba(255,255,255,.35)); }
/* Click spin — blades rotate around center */
.mk-hex.spin { animation: bladeSpin .5s ease-out; will-change: transform; }
.rg-hex.spin { animation: bladeSpin .5s ease-out; will-change: transform; }
.cl-hex.spin { animation: bladeSpin .5s ease-out; will-change: transform; }
@keyframes bladeSpin { 0% { transform: rotate(0deg) scale(1.2); } 100% { transform: rotate(60deg) scale(1); } }
.mk-badge {
  position: absolute; top: -7px; right: -8px;
  background: var(--surface-s); border-radius: 8px;
  min-width: 20px; height: 16px; padding: 0 3px 0 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; font-weight: 700; line-height: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
/* Tiny bee icon on the badge */
.mk-badge::before {
  content: '';
  position: absolute; left: 1px; top: 50%; transform: translateY(-50%);
  width: 12px; height: 12px;
  background: url("/img/bee-sm.png") no-repeat center / contain;
}
.mk-badge.sev-t { color: var(--error);   border: 1.2px solid var(--error); }
.mk-badge.sev-w { color: var(--warning); border: 1.2px solid var(--warning); }
.mk-badge.sev-n { color: var(--minor);   border: 1.2px solid var(--minor); }
.mk-badge.sev-i { color: var(--primary); border: 1.2px solid var(--primary); }
.mk-verified {
  position: absolute; bottom: -4px; right: -4px;
  background: #1b8a2d; border-radius: 50%;
  width: 14px; height: 14px;
  display: flex; align-items: center; justify-content: center;
  color: white; border: 1.2px solid rgba(255,255,255,.3);
}
.badge.b-verified {
  background: rgba(27,138,45,.18); color: #4caf50; border: 1px solid rgba(76,175,80,.3);
  font-size: 9px; gap: 2px;
}
/* Propaganda / state-media / disinformation badges */
.badge.b-state-media {
  background: rgba(255,152,0,.15); color: #ffb74d; border: 1px solid rgba(255,152,0,.3);
  font-size: 9px; gap: 3px;
}
.badge.b-disinfo {
  background: rgba(244,67,54,.15); color: #ef5350; border: 1px solid rgba(244,67,54,.3);
  font-size: 9px; gap: 3px; font-weight: 700;
}
.badge.b-state-media .flag, .badge.b-disinfo .flag {
  font-size: 11px; line-height: 1;
}
/* Marker propaganda indicator — amber triangle at top-left */
.mk-disinfo {
  position: absolute; top: -4px; left: -4px;
  background: #e65100; border-radius: 50%;
  width: 14px; height: 14px;
  display: flex; align-items: center; justify-content: center;
  color: white; border: 1.2px solid rgba(255,255,255,.3);
  font-size: 10px;
}
/* Disinfo detail panel section */
.disinfo-box {
  background: rgba(244,67,54,.08); border: 1px solid rgba(244,67,54,.2);
  border-radius: 6px; padding: 8px 10px; margin: 8px 0;
  font-size: 11px; color: #ef9a9a;
}
.disinfo-box .disinfo-title {
  font-weight: 700; color: #ef5350; margin-bottom: 4px;
  display: flex; align-items: center; gap: 4px;
}
.disinfo-box .disinfo-flags {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px;
}
.disinfo-box .disinfo-flag {
  background: rgba(255,255,255,.06); padding: 1px 5px; border-radius: 3px;
  font-size: 9px; color: #ef9a9a;
}

/* ── Region cluster markers (world view) ─────────────── */
.rg-wrap {
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; cursor: pointer;
  transition: transform .15s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
  border: 2px solid rgba(255,255,255,.15);
}
.rg-wrap:hover { transform: scale(1.1); }
.rg-wrap.t { background: #DC143C; border-color: #8B0000; }
.rg-wrap.w { background: #FF6D00; border-color: #BF360C; }
.rg-wrap.n { background: #C6A700; border-color: #8D7600; }
.rg-wrap.i { background: #4FC3F7; border-color: #0277BD; }
.rg-circle {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.rg-count { font-size: 13px; font-weight: 800; color: white; line-height: 1; text-shadow: 0 1px 3px rgba(0,0,0,.3); }
.rg-label {
  font-size: 7px; font-weight: 700; color: rgba(255,255,255,.9);
  text-transform: uppercase; letter-spacing: .04em;
  white-space: nowrap; max-width: 42px; overflow: hidden; text-overflow: ellipsis;
  line-height: 1; margin-top: 2px;
}

/* ── Country / grid cluster markers ──────────────────── */
.cl-wrap {
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; cursor: pointer;
  width: 34px; height: 34px;
  transition: transform .15s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
  border: 2px solid rgba(255,255,255,.15);
}
.cl-wrap:hover { transform: scale(1.1); }
.cl-wrap.t { background: #DC143C; border-color: #8B0000; }
.cl-wrap.w { background: #FF6D00; border-color: #BF360C; }
.cl-wrap.n { background: #C6A700; border-color: #8D7600; }
.cl-wrap.i { background: #4FC3F7; border-color: #0277BD; }
.cl-circle {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.cl-count { font-size: 13px; font-weight: 800; color: white; line-height: 1; text-shadow: 0 1px 3px rgba(0,0,0,.3); }
.cl-label {
  font-size: 7px; font-weight: 600; color: rgba(255,255,255,.9);
  text-transform: uppercase; letter-spacing: .04em;
  white-space: nowrap; max-width: 36px; overflow: hidden; text-overflow: ellipsis;
  line-height: 1; margin-top: 2px;
}

/* ── Marker hover tooltip ─────────────────────────────── */
.mk-tip {
  position: absolute; bottom: calc(100% + 10px); left: 50%;
  transform: translateX(-50%);
  min-width: 320px; max-width: 500px; width: max-content;
  padding: 0; border-radius: 10px;
  background: #0d1019; backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255,255,255,.15);
  box-shadow: 0 8px 32px rgba(0,0,0,.85);
  pointer-events: none; z-index: 200;
  animation: mkTipIn .15s ease;
  white-space: normal; text-align: left;
  word-break: break-word;
  overflow: hidden;
}
.mk-tip::after {
  content: ''; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(255,255,255,.15);
}
.sev-tip-critical { border-color: rgba(239,83,80,.5); }
.sev-tip-critical::after { border-top-color: rgba(239,83,80,.5); }
.sev-tip-major { border-color: rgba(255,167,38,.45); }
.sev-tip-major::after { border-top-color: rgba(255,167,38,.45); }
.sev-tip-minor { border-color: rgba(255,238,88,.45); }
.sev-tip-minor::after { border-top-color: rgba(255,238,88,.45); }
.sev-tip-threat { border-color: rgba(239,83,80,.5); }
.sev-tip-threat::after { border-top-color: rgba(239,83,80,.5); }
.sev-tip-warning { border-color: rgba(255,167,38,.45); }
.sev-tip-warning::after { border-top-color: rgba(255,167,38,.45); }

/* Inner box wrapping entire tooltip content */
.mk-tip-box {
  padding: 14px 16px 10px;
  background: rgba(255,255,255,.03);
}
.mk-tip-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.mk-tip-type { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.mk-tip-time { font-size: 10px; color: var(--text-muted); margin-left: auto; }
.mk-tip-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.45; margin-bottom: 7px; }
.mk-tip-loc { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
.mk-tip-summary { font-size: 12px; color: var(--text-muted); line-height: 1.55; margin-bottom: 7px; }
.mk-tip-sources { font-size: 10px; color: var(--text-muted); margin-bottom: 4px; }
.mk-tip-hint {
  font-size: 10px; color: var(--primary); opacity: .7; font-style: italic;
  padding: 6px 16px 10px;
  border-top: 1px solid rgba(255,255,255,.06);
}
@keyframes mkTipIn { from { opacity:0; transform:translateX(-50%) translateY(4px); } to { opacity:1; transform:translateX(-50%) translateY(0); } }

/* ── Symbol layer tooltip (MapLibre popup) ──────────── */
.symbol-tip .maplibregl-popup-content {
  background: var(--surface-2, #1c2128);
  border: 1px solid var(--border, #30363d);
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
  overflow: hidden;
}
.symbol-tip .maplibregl-popup-tip {
  border-top-color: var(--surface-2, #1c2128);
}
.st-box { padding: 10px 12px; font-size: 12px; }
.st-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.st-type { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.st-time { font-size: 10px; color: var(--text-muted); margin-left: auto; }
.st-title { font-weight: 600; font-size: 12px; line-height: 1.45; margin-bottom: 5px; color: var(--text); }
.st-loc { font-size: 10px; color: var(--text-muted); margin-bottom: 4px; }
.st-summary { font-size: 11px; color: var(--text-muted); line-height: 1.45; }

/* ── Cluster tooltip ─────────────────────────────────── */
.cl-tip { min-width: 300px; max-width: 420px; }
.cl-tip-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.cl-tip-name { font-size: 14px; font-weight: 700; color: var(--text); }
.cl-tip-total { font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.cl-tip-section { padding: 10px 16px 8px; }
.cl-tip-subtitle { font-size: 11px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.cl-tip-stats { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 6px; }
.cl-tip-types { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
.cl-tip-events { display: flex; flex-direction: column; gap: 4px; }
.cl-tip-event {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text); line-height: 1.3;
}
.cl-tip-event-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-tip-event-time { font-size: 9px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.cl-tip-empty { font-size: 11px; color: var(--text-muted); font-style: italic; }

/* ── Sidebar sources view ─────────────────────────────── */
.src-sb-back {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 10px 14px;
  background: none; border: none; border-bottom: 1px solid rgba(255,255,255,.07);
  color: var(--primary); font-size: 12px; cursor: pointer;
  transition: background .15s; text-align: left;
}
.src-sb-back:hover { background: rgba(79,195,247,.08); }
.src-sb-item {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,.05);
  text-decoration: none; transition: background .15s; position: relative;
}
.src-sb-item:hover { background: rgba(255,255,255,.04); }
.src-sb-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.src-sb-name { font-size: 10px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .06em; }
.src-sb-date { font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.src-sb-ttl { font-size: 12.5px; color: var(--text); line-height: 1.4; padding-right: 20px; }
.src-sb-ext { position: absolute; bottom: 10px; right: 14px; font-size: 13px; color: var(--text-muted); }
.sb-ev-title { font-size: 12px; font-weight: 600; line-height: 1.3; }

/* ── Modals ───────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; background: rgba(8,11,22,0.78);
  backdrop-filter: blur(5px); z-index: 200;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--surface-s); border: 1px solid var(--border-s);
  border-radius: 16px; padding: 26px; width: 400px;
  max-width: calc(100vw - 32px);
  transform: translateY(14px); transition: transform 0.22s cubic-bezier(0.4,0,0.2,1);
}
.overlay.open .modal { transform: translateY(0); }
.modal h2 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.modal .sub { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }

/* Story popup modal */
.story-modal {
  width: 620px; max-width: calc(100vw - 32px); max-height: 80vh;
  display: flex; flex-direction: column; position: relative;
  padding: 0;
}
.story-close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--surface-2s); border: 1px solid var(--border-s);
}
.story-close:hover { background: var(--error); color: #fff; }
.story-body { padding: 24px; overflow-y: auto; flex: 1; scrollbar-width: thin; scrollbar-color: var(--border-s) transparent; }
.story-title { font-size: 18px; font-weight: 700; line-height: 1.35; margin-bottom: 10px; }
.story-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 11px; color: var(--text-muted); margin-bottom: 14px; }
.story-meta .ms { font-size: 13px; vertical-align: -2px; }
.story-summary { font-size: 13.5px; line-height: 1.7; color: var(--text); margin-bottom: 18px; }
.story-sources { border-top: 1px solid var(--border-s); padding-top: 14px; }
.story-sources-label { font-size: 11px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
@media (max-width: 768px) {
  .story-modal { width: 100vw; max-height: 85vh; border-radius: 16px 16px 0 0; }
}

/* Report modal (wider) */
.report-modal {
  background: var(--surface-s); border: 1px solid var(--border-s);
  border-radius: 16px; width: 580px; max-width: calc(100vw - 32px);
  max-height: 80vh; display: flex; flex-direction: column;
  transform: translateY(14px); transition: transform 0.22s cubic-bezier(0.4,0,0.2,1);
}
.overlay.open .report-modal { transform: translateY(0); }
.rm-head { padding: 18px 20px 14px; border-bottom: 1px solid var(--border-s); display: flex; align-items: flex-start; gap: 12px; }
.rm-body { padding: 18px 20px; overflow-y: auto; flex: 1; font-size: 13.5px; line-height: 1.75; color: var(--text-muted); scrollbar-width: thin; scrollbar-color: var(--border-s) transparent; }
.rm-body h3 { font-size: 14px; font-weight: 600; color: var(--text); margin: 14px 0 6px; }
.rm-body h3:first-child { margin-top: 0; }

/* Forms */
.fg { margin-bottom: 14px; }
.fg label { display: block; font-size: 11.5px; font-weight: 600; margin-bottom: 5px; color: var(--text-muted); letter-spacing: 0.3px; }
.fg input, .fg select {
  width: 100%; padding: 10px 13px;
  background: var(--surface-2s); border: 1px solid var(--border-s);
  border-radius: var(--r); color: var(--text); font-size: 14px;
  outline: none; transition: border-color 0.14s;
}
.fg input:focus, .fg select:focus { border-color: var(--primary); }
.fg input::placeholder { color: var(--text-muted); }
.fg select option { background: var(--surface-2s); }
.row { display: flex; gap: 10px; }
.row .fg { flex: 1; }
.form-err { font-size: 12px; color: var(--error); margin-top: 8px; min-height: 16px; }
.btn-full { width: 100%; justify-content: center; padding: 11px; font-size: 14px; border-radius: var(--r); }

/* 2FA waiting */
.wait-screen { text-align: center; padding: 10px 0; }
.wait-icon { font-size: 52px; margin-bottom: 14px; color: var(--primary); }
.wait-screen h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.wait-screen p  { font-size: 13px; color: var(--text-muted); line-height: 1.55; }
.spinner { width: 22px; height: 22px; border: 2px solid var(--border-s); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.75s linear infinite; margin: 14px auto 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Full-screen sources modal ────────────────────────── */
.sources-full {
  background: var(--surface-s); border: 1px solid var(--border-s);
  border-radius: 16px; width: 560px; max-width: calc(100vw - 32px);
  max-height: 85vh; display: flex; flex-direction: column;
  transform: translateY(14px); transition: transform 0.22s cubic-bezier(0.4,0,0.2,1);
}
.overlay.open .sources-full { transform: translateY(0); }
.sf-head { padding: 16px 20px 12px; border-bottom: 1px solid var(--border-s); display: flex; align-items: center; gap: 10px; }
.sf-list { padding: 12px 16px; overflow-y: auto; flex: 1; scrollbar-width: thin; scrollbar-color: var(--border-s) transparent; }

/* ── Account dropdown ─────────────────────────────────── */
.acct-menu {
  position: fixed; top: calc(var(--topbar) + 6px); right: 16px; z-index: 150;
  background: var(--surface-2s); border: 1px solid var(--border-s);
  border-radius: var(--r); min-width: 180px; padding: 6px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  opacity: 0; pointer-events: none; transform: translateY(-6px);
  transition: opacity 0.15s, transform 0.15s;
}
.acct-menu.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.acct-item {
  padding: 9px 12px; border-radius: var(--r-sm); font-size: 13px;
  cursor: pointer; display: flex; align-items: center; gap: 8px;
  color: var(--text-muted); transition: background 0.12s;
}
.acct-item:hover { background: var(--surface-2); color: var(--text); }
.acct-item.danger { color: var(--error); }
.acct-divider { height: 1px; background: var(--border-s); margin: 4px 0; }

/* ── Toggle sidebar FAB ───────────────────────────────── */
#fab-toggle {
  position: fixed; top: calc(var(--topbar) + 12px); right: 12px; z-index: 91;
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  background: var(--surface-2s); border: 1px solid var(--border-s);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: right 0.28s cubic-bezier(0.4,0,0.2,1), color 0.14s;
}
#fab-toggle:hover { color: var(--text); }
#fab-toggle.shifted { right: calc(var(--sidebar) + 12px); }

/* ── Admin layout ─────────────────────────────────────── */
body.admin { overflow: auto; }
.admin-wrap { display: flex; min-height: 100vh; }
.admin-nav {
  width: 220px; flex-shrink: 0; background: var(--surface-2s);
  border-right: 1px solid var(--border-s); padding: 16px 10px;
  display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh;
}
.admin-nav-title { font-size: 11px; font-weight: 700; color: var(--text-muted); letter-spacing: 0.6px; padding: 8px 10px 4px; }
.anav-item {
  padding: 9px 12px; border-radius: var(--r-sm); font-size: 13px;
  cursor: pointer; display: flex; align-items: center; gap: 10px;
  color: var(--text-muted); text-decoration: none; transition: all 0.13s;
}
.anav-item:hover { background: var(--surface-2); color: var(--text); }
.anav-item.active { background: var(--primary-d); color: var(--primary); }
.admin-main {
  flex: 1; padding: 32px; min-width: 0;
  overflow-y: auto; background: var(--bg);
}
.admin-head { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.admin-head h1 { font-size: 20px; font-weight: 700; }
.admin-section { background: var(--surface-2s); border: 1px solid var(--border-s); border-radius: var(--r); padding: 20px; margin-bottom: 20px; }
.admin-section h2 { font-size: 15px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.atab-bar { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--border-s); padding-bottom: 10px; }
.atab { padding: 6px 14px; border-radius: var(--r-full); font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid transparent; color: var(--text-muted); }
.atab.active { background: var(--primary-d); border-color: rgba(79,195,247,0.4); color: var(--primary); }
.atab-panel { display: none; }
.atab-panel.active { display: block; }

/* Admin tables */
.atable { width: 100%; border-collapse: collapse; font-size: 13px; }
.atable th { padding: 8px 10px; text-align: left; font-size: 11px; font-weight: 600; color: var(--text-muted); letter-spacing: 0.4px; border-bottom: 1px solid var(--border-s); }
.atable td { padding: 9px 10px; border-bottom: 1px solid rgba(37,45,64,0.5); vertical-align: middle; }
.atable tr:last-child td { border-bottom: none; }
.atable tr:hover td { background: rgba(24,30,46,0.6); }
.tag { display: inline-flex; padding: 2px 8px; border-radius: var(--r-full); font-size: 11px; font-weight: 500; background: var(--primary-d); color: var(--primary); }
.tag.conflict { background: var(--error-d); color: var(--error); }
.tag.crime    { background: var(--crime-d); color: var(--crime); }
.tag.cbrn     { background: var(--cbrn-d);  color: var(--cbrn); }
.tag.health   { background: var(--health-d);color: var(--health); }
.tag.disaster { background: var(--warning-d); color: var(--warning); }
.add-form { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.add-form input, .add-form select { flex: 1; min-width: 120px; padding: 8px 11px; background: var(--surface-2s); border: 1px solid var(--border-s); border-radius: var(--r-sm); color: var(--text); font-size: 13px; outline: none; }
.add-form input:focus, .add-form select:focus { border-color: var(--primary); }
.toggle { width: 34px; height: 20px; border-radius: 10px; background: var(--border-s); cursor: pointer; position: relative; transition: background 0.2s; flex-shrink: 0; }
.toggle.on { background: var(--success); }
.toggle::after { content:''; position: absolute; width: 14px; height: 14px; border-radius: 50%; background: white; top: 3px; left: 3px; transition: transform 0.2s; }
.toggle.on::after { transform: translateX(14px); }
.del-btn { padding: 4px 10px; border-radius: var(--r-full); font-size: 11px; cursor: pointer; background: var(--error-d); color: var(--error); border: 1px solid rgba(239,83,80,0.3); }
.del-btn:hover { background: rgba(239,83,80,0.25); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.stat-card { padding: 16px; background: var(--surface-2s); border: 1px solid var(--border-s); border-radius: var(--r); }
.stat-card .num { font-size: 28px; font-weight: 700; color: var(--primary); line-height: 1; margin-bottom: 4px; }
.stat-card .lbl { font-size: 11px; color: var(--text-muted); }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar: 100vw; }
  #sidebar, #detail { top: auto; bottom: 0; height: 60vh; width: 100%; border-left: none; border-top: 1px solid var(--border); border-radius: 20px 20px 0 0; }
  #sidebar.closed { transform: translateY(100%); }
  #detail { transform: translateY(100%); }
  #detail.open { transform: translateY(0); }
  #fab-toggle { right: 12px !important; top: auto; bottom: 16px; }
  .admin-wrap { flex-direction: column; }
  .admin-nav { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; padding: 10px; }
}

/* ── Utility ──────────────────────────────────────────── */
.hidden { display: none !important; }
.ms { font-family: 'Material Symbols Rounded'; font-size: 18px; line-height: 1; letter-spacing: normal; font-variation-settings: 'FILL' 1,'wght' 400,'GRAD' 0,'opsz' 24; }

/* ── Bee brand element ───────────────────────────────── */
.bee-ico {
  display: inline-block; width: 14px; height: 14px; vertical-align: -2px;
  background: url("/img/bee-sm.png") no-repeat center / contain;
}
.bee-ico-lg { width: 20px; height: 20px; vertical-align: -4px; }

/* Bee loading spinner */
.bee-loader {
  display: inline-block; width: 32px; height: 32px;
  background: url("/img/bee.png") no-repeat center / contain;
  animation: beeFloat 1.6s ease-in-out infinite;
}
@keyframes beeFloat {
  0%,100% { transform: translateY(0) rotate(-5deg); }
  25%     { transform: translateY(-6px) rotate(5deg); }
  50%     { transform: translateY(-2px) rotate(-3deg); }
  75%     { transform: translateY(-8px) rotate(4deg); }
}

/* Bee empty state */
.bee-empty {
  text-align: center; padding: 32px 16px; color: var(--text-muted); font-size: 13px; line-height: 1.6;
}
.bee-empty .bee-loader { margin-bottom: 12px; }

/* ── Map page mini footer ─────────────────────────────── */
/* ── Floating OSINT search bar ────────────────────────── */
#osint-search-float {
  position: fixed; bottom: 38px; left: 50%; transform: translateX(-50%);
  z-index: 99; pointer-events: all;
  width: 380px; max-width: calc(100vw - 32px);
  padding: 0;
}
#osint-search-form {
  display: flex; align-items: center; gap: 0;
  background: rgba(18, 22, 36, .45);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 28px;
  padding: 0 6px 0 14px;
  transition: background .2s, border-color .2s, box-shadow .2s;
  box-shadow: 0 4px 24px rgba(0,0,0,.25);
}
#osint-search-form:focus-within {
  background: rgba(18, 22, 36, .65);
  border-color: rgba(79,195,247,.3);
  box-shadow: 0 4px 32px rgba(79,195,247,.1);
}
.osint-search-icon {
  font-size: 18px !important; color: rgba(255,255,255,.3);
  flex-shrink: 0; pointer-events: none;
  transition: color .2s;
}
#osint-search-form:focus-within .osint-search-icon { color: rgba(79,195,247,.6); }
#osint-search-input {
  flex: 1; background: none; border: none; outline: none;
  color: rgba(255,255,255,.7); font-size: 13px; padding: 10px 12px;
  font-family: var(--font);
}
#osint-search-input::placeholder { color: rgba(255,255,255,.25); }
#osint-search-input:focus { color: var(--text); }
#osint-search-input:focus::placeholder { color: rgba(255,255,255,.35); }
[data-theme="light"] #osint-search-form {
  background: rgba(245,246,250,.5);
  border-color: rgba(0,0,0,.08);
}
[data-theme="light"] #osint-search-form:focus-within {
  background: rgba(245,246,250,.7);
  border-color: rgba(79,195,247,.4);
}
[data-theme="light"] .osint-search-icon { color: rgba(0,0,0,.25); }
[data-theme="light"] #osint-search-form:focus-within .osint-search-icon { color: rgba(79,195,247,.7); }
[data-theme="light"] #osint-search-input { color: rgba(0,0,0,.7); }
[data-theme="light"] #osint-search-input::placeholder { color: rgba(0,0,0,.3); }
[data-theme="light"] #osint-search-input:focus { color: #1a1d2e; }

#map-footer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center;
  padding: 7px 16px;
  background: rgba(10,14,26,.75); backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255,255,255,.05);
  font-size: 11px;
  pointer-events: none;
}
.footer-stats-center {
  display: flex; align-items: center; gap: 12px;
  position: absolute; left: 50%; transform: translateX(-50%);
  pointer-events: all;
}
#map-footer a, #map-footer .footer-claude, #map-footer .footer-claude-wrap,
#map-footer .map-footer-sep, #map-footer .istat {
  pointer-events: all;
}
/* Map footer Claude tooltip — must be hidden by default before layout.js injects its CSS */
#map-footer .footer-claude-tooltip {
  display: none;
  position: absolute; bottom: calc(100% + 8px); right: 0;
  width: 300px; padding: 12px 14px;
  background: rgba(15,17,26,.97); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px; font-size: 12px; line-height: 1.6;
  color: var(--text); font-style: italic;
  box-shadow: 0 8px 32px rgba(0,0,0,.7);
  animation: fadeIn .2s ease; z-index: 200; pointer-events: none;
  white-space: normal;
}
#map-footer .footer-claude-tooltip.show { display: block; }
#map-footer .footer-claude-wrap { position: relative; }
#map-footer a {
  color: var(--text-muted); text-decoration: none; transition: color .15s;
}
#map-footer a:hover { color: var(--text); }
.map-footer-sep { color: var(--border-s); }
@keyframes fadeIn { from { opacity:0;transform:translateY(4px); } to { opacity:1;transform:translateY(0); } }
/* ── Map overlay controls (below zoom) ────────────────── */
/* Map layer toggle buttons (Events / Aircraft / Ships) */
#map-layer-ctrls {
  position: fixed;
  top: calc(var(--topbar) + 90px);
  left: 10px; z-index: 95;
  display: flex; flex-direction: column; gap: 4px;
}
.map-layer-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--r-sm);
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(10,10,18,.6); backdrop-filter: blur(10px);
  color: var(--text-muted); cursor: pointer;
  transition: all .15s ease;
}
.map-layer-btn .ms { font-size: 18px; }
.map-layer-btn:hover { background: rgba(255,255,255,.1); color: var(--text); }
.map-layer-btn.on { background: rgba(79,195,247,.15); border-color: rgba(79,195,247,.35); color: var(--primary); }
[data-theme="light"] .map-layer-btn { background: rgba(245,246,250,.7); border-color: rgba(0,0,0,.1); }
[data-theme="light"] .map-layer-btn.on { background: rgba(25,118,210,.12); border-color: rgba(25,118,210,.3); color: var(--primary); }

/* Map utility controls (heatmap, theme) */
#map-overlay-ctrls {
  position: fixed;
  top: calc(var(--topbar) + 90px + 3 * 38px + 12px);
  left: 10px; z-index: 95;
  display: flex; flex-direction: column; gap: 4px;
}
#map-overlay-ctrls .btn { backdrop-filter: blur(10px); }

/* Push MapLibre attribution above the map footer bar */
.maplibregl-ctrl-bottom-left { bottom: 32px !important; }
/* Push MapLibre zoom controls below the topbar */
.maplibregl-ctrl-top-left { top: calc(var(--topbar-h, 48px) + 8px) !important; }

/* ── Content page shared ──────────────────────────────── */
body.content-page {
  background: var(--bg); color: var(--text);
  font-family: var(--font, system-ui, sans-serif);
  overflow: auto; min-height: 100vh;
}
body.content-page h1,h2,h3,h4 { color: var(--text); }
body.content-page a { color: var(--primary); }

/* ── Filter drawer ────────────────────────────────────── */
.filter-drawer {
  position: fixed; top: var(--topbar-h, 48px); left: 0; right: 0; z-index: 110;
  background: rgba(10,10,18,.97); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.09);
  padding: 0 20px;
  max-height: 0; overflow: hidden;
  transition: max-height .25s ease, padding .25s ease;
}
.filter-drawer.open {
  max-height: 560px;
  padding: 14px 20px 16px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-s) transparent;
}
.fd-section { display: flex; align-items: flex-start; gap: 12px; }
.fd-label {
  font-size: 10.5px; font-weight: 600; letter-spacing: .07em;
  color: var(--text-muted); text-transform: uppercase;
  padding-top: 5px; white-space: nowrap; min-width: 72px;
}
.fd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fd-divider { height: 1px; background: rgba(255,255,255,.07); margin: 10px 0; }

/* Filter drawer — layer toggles */
.fd-layers { display: flex; gap: 8px; }
.fd-layer-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--r-full);
  font-size: 12px; font-weight: 600; cursor: pointer;
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid transparent; transition: all .14s ease; user-select: none;
}
.fd-layer-toggle:hover { color: var(--text); border-color: var(--border); }
.fd-layer-toggle.on { background: rgba(79,195,247,.12); border-color: rgba(79,195,247,.35); color: var(--primary); }

/* Filter drawer — help tooltips */
.fd-help {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%;
  font-size: 9px; font-weight: 700; cursor: help;
  background: rgba(255,255,255,.08); color: var(--text-muted);
  border: 1px solid rgba(255,255,255,.12); vertical-align: middle;
  margin-left: 4px; position: relative;
}
.fd-help:hover { background: rgba(79,195,247,.15); color: var(--primary); border-color: rgba(79,195,247,.3); }

/* Overlay detail sidebar (aircraft/ship click) */
.ov-detail { padding: 12px; }
.ov-detail-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ov-detail-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 6px; line-height: 1.3; }
.ov-detail-meta { display: flex; gap: 12px; font-size: 11px; color: var(--text-muted); margin-bottom: 14px; flex-wrap: wrap; }
.ov-detail-meta .ms { color: var(--text-muted); }
.ov-detail-tracking {
  display: flex; flex-direction: column; gap: 1px;
  background: var(--surface-2); border-radius: 8px; overflow: hidden; margin-bottom: 14px;
}
.ov-track-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 12px; font-size: 12px; background: var(--surface);
}
.ov-track-key { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.ov-sanction-box {
  background: rgba(211,47,47,.06); border: 1px solid rgba(211,47,47,.2);
  border-radius: 8px; padding: 10px 12px; margin-bottom: 14px;
}
.ov-sanction-head { font-size: 12px; font-weight: 700; color: var(--error); display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.ov-sanction-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 4px 0; font-size: 12px; border-bottom: 1px solid rgba(211,47,47,.08);
}
.ov-sanction-row:last-child { border-bottom: none; }
.ov-sanction-key { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; flex-shrink: 0; margin-right: 12px; }

/* Overlay enrichment card (aircraft/ship detail) */
.enrich-card {
  margin: 12px 0; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border); background: var(--surface-2);
}
.enrich-photo { display: block; position: relative; }
.enrich-photo img { width: 100%; max-height: 200px; object-fit: cover; display: block; }
.enrich-credit {
  position: absolute; bottom: 4px; right: 6px;
  font-size: 9px; color: rgba(255,255,255,.7); text-shadow: 0 1px 3px rgba(0,0,0,.8);
}
.enrich-details { padding: 10px 12px; }
.enrich-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 3px 0; font-size: 12px; border-bottom: 1px solid rgba(255,255,255,.04);
}
.enrich-row:last-child { border-bottom: none; }
.enrich-key { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.enrich-val { color: var(--text); font-weight: 500; }
.enrich-alert { color: var(--error); font-size: 11px; gap: 4px; justify-content: flex-start; padding: 6px 0 2px; border-bottom: none; }

/* Filter drawer — severity row */
.fd-sev-row { display: flex; align-items: center; gap: 12px; }
.fd-sev-toggles { display: flex; gap: 6px; flex-wrap: wrap; }
.fd-sev {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 500; cursor: pointer;
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid transparent; transition: all .14s ease; user-select: none;
}
.fd-sev:hover { color: var(--text); border-color: var(--border); }
.fd-sev.on { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: var(--text); }
.fd-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.dot-crit { background: var(--error); }
.dot-maj  { background: var(--warning); }
.dot-min  { background: var(--minor); }
.dot-mon  { background: var(--primary); }

/* Filter drawer — vertical columns */
.fd-columns { display: flex; gap: 24px; }
.fd-col { flex: 1; min-width: 0; }
.fd-vlist { display: flex; flex-direction: column; gap: 2px; }
.fd-vitem {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: var(--r-sm);
  font-size: 12px; font-weight: 500; cursor: pointer;
  color: var(--text-muted); transition: all .14s ease; user-select: none;
}
.fd-vitem:hover { background: rgba(255,255,255,.06); color: var(--text); }
.fd-vitem.on { color: var(--text); background: rgba(79,195,247,.08); }
.fd-vitem.on .fd-vi-ico { color: var(--primary); }
.fd-vi-ico { font-size: 15px !important; color: var(--text-muted); transition: color .14s; }
.fd-vitem .fd-dot { margin-right: 0; }
.fd-item-count { margin-left: auto; font-size: 10px; opacity: .5; }
.fd-back { color: var(--primary); font-weight: 600; }
.fd-back:hover { background: rgba(79,195,247,.1); }

/* ── Heatmap toggle active state ─────────────────────── */
#btn-heatmap.on { background: var(--primary-d); color: var(--primary); border-color: rgba(79,195,247,0.4); }

/* ── Light theme ─────────────────────────────────────── */
[data-theme="light"] {
  --bg:           #F5F6FA;
  --surface:      rgba(255, 255, 255, 0.92);
  --surface-s:    #FFFFFF;
  --surface-2:    rgba(240, 242, 248, 0.85);
  --surface-2s:   #F0F2F8;
  --primary:      #1976D2;
  --primary-d:    rgba(25, 118, 210, 0.12);
  --error:        #D32F2F;
  --error-d:      rgba(211, 47, 47, 0.12);
  --warning:      #F57C00;
  --warning-d:    rgba(245, 124, 0, 0.12);
  --success:      #388E3C;
  --crime:        #7B1FA2;
  --crime-d:      rgba(123, 31, 162, 0.12);
  --cbrn:         #E64A19;
  --cbrn-d:       rgba(230, 74, 25, 0.12);
  --health:       #00796B;
  --health-d:     rgba(0, 121, 107, 0.12);
  --minor:        #F9A825;
  --minor-d:      rgba(249, 168, 37, 0.12);
  --text:         #1A1A2E;
  --text-muted:   #5C6378;
  --border:       rgba(200, 208, 220, 0.9);
  --border-s:     #C8D0DC;
}
[data-theme="light"] #map-footer { background: rgba(245,246,250,.85); }
[data-theme="light"] .filter-drawer { background: rgba(245,246,250,.97); }
[data-theme="light"] .mk-tip { background: #fff; border-color: rgba(0,0,0,.12); box-shadow: 0 8px 32px rgba(0,0,0,.15); }
[data-theme="light"] .mk-tip::after { border-top-color: rgba(0,0,0,.12); }
[data-theme="light"] .mk-tip-box { background: transparent; }
[data-theme="light"] .mk-tip-hint { border-top-color: rgba(0,0,0,.06); color: var(--primary); }
[data-theme="light"] .ecard:hover { background: rgba(240,242,248,.97); }
[data-theme="light"] .mk-circle .ms { color: white; }
[data-theme="light"] .cl-tip-header { border-bottom-color: rgba(0,0,0,.08); }
[data-theme="light"] .rg-count,
[data-theme="light"] .cl-count { text-shadow: 0 1px 2px rgba(0,0,0,.2); }
[data-theme="light"] #topbar { border-bottom-color: rgba(200,208,220,.6); }
[data-theme="light"] #sidebar { border-left-color: rgba(200,208,220,.6); }
[data-theme="light"] #detail { border-left-color: rgba(200,208,220,.6); }
[data-theme="light"] .ecard { border-color: rgba(200,208,220,.5); background: rgba(255,255,255,.7); }
[data-theme="light"] .acct-menu { background: #fff; border-color: rgba(200,208,220,.5); box-shadow: 0 8px 24px rgba(0,0,0,.12); }

/* ── Report Event modal ─────────────────────────────────────── */
#modal-report-event .report-modal { max-width: 560px; }
#modal-report-event .fg input,
#modal-report-event .fg textarea { width: 100%; outline: none; transition: border-color .15s; }
#modal-report-event .fg input:focus,
#modal-report-event .fg textarea:focus { border-color: var(--primary); }

.re-auth-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; padding: 4px 10px;
  border-radius: 6px; letter-spacing: .3px;
}
.re-auth-badge.authenticated { background: rgba(76,175,80,.12); color: #66BB6A; border: 1px solid rgba(76,175,80,.2); }
.re-auth-badge.anonymous { background: rgba(255,167,38,.08); color: #FFA726; border: 1px solid rgba(255,167,38,.15); }

.re-media-thumb {
  width: 64px; height: 64px; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--border);
  position: relative; cursor: default;
}
.re-media-item {
  position: relative; display: inline-block;
}
.re-media-item .re-media-rm {
  position: absolute; top: -4px; right: -4px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--error); color: #fff; border: none;
  font-size: 12px; line-height: 18px; text-align: center;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.re-story-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--primary); cursor: pointer;
  padding: 3px 8px; border-radius: 4px; border: none;
  background: rgba(79,195,247,.08);
  transition: background .15s;
}
.re-story-link:hover { background: rgba(79,195,247,.15); }

/* ── Content pages layout ────────────────────────────── */
.page-wrap {
  max-width: 820px; margin: 0 auto; padding: 32px 24px 48px;
}
.page-hero {
  margin-bottom: 32px;
}
.page-hero h1 {
  font-size: 26px; font-weight: 700; color: var(--text); margin: 0 0 10px; line-height: 1.3;
}
.page-hero p {
  font-size: 14px; color: var(--text-muted); line-height: 1.7; margin: 0;
}
.page-section {
  margin-bottom: 28px;
}
.page-section h2 {
  font-size: 18px; font-weight: 700; color: var(--text); margin: 0 0 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.page-section p {
  font-size: 13px; color: var(--text-muted); line-height: 1.8; margin: 0 0 10px;
}
.page-section p:last-child { margin-bottom: 0; }
.page-section ul { font-size: 13px; color: var(--text-muted); line-height: 1.8; padding-left: 24px; margin: 0 0 10px; }
.page-section li { margin-bottom: 4px; }
.page-section a { color: var(--primary); text-decoration: none; }
.page-section a:hover { text-decoration: underline; }
.highlight-box {
  padding: 18px 22px; border-radius: 10px;
  background: rgba(79,195,247,.04); border: 1px solid rgba(79,195,247,.15);
  margin-bottom: 18px;
}
.highlight-box p { font-size: 13px; color: var(--text-muted); line-height: 1.8; }
.btn-support {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); text-decoration: none;
  transition: all .15s ease; cursor: pointer;
}
.btn-support:hover { background: rgba(79,195,247,.08); border-color: rgba(79,195,247,.3); }

