/* ============================================================
   OSINT Dashboard — USA/Israel vs Iran
   Art Direction: Military/Intelligence — dark, data-dense, sharp
   Palette: Dark slate + amber warnings + red criticals + teal data
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --font-body: 'Inter', 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;

  /* Dark mode — primary (intelligence theme) */
  --bg: #0a0c10;
  --surface: #0f1117;
  --surface-2: #141720;
  --surface-3: #1a1e2a;
  --border: #1e2230;
  --border-hover: #2a3045;
  --divider: #181c28;

  --text: #c8cdd8;
  --text-muted: #6b7280;
  --text-faint: #3d4555;
  --text-inverse: #0a0c10;

  /* Status colors */
  --critical: #ef4444;
  --critical-bg: rgba(239,68,68,0.08);
  --critical-border: rgba(239,68,68,0.2);
  --high: #f59e0b;
  --high-bg: rgba(245,158,11,0.08);
  --high-border: rgba(245,158,11,0.2);
  --medium: #3b82f6;
  --medium-bg: rgba(59,130,246,0.08);
  --medium-border: rgba(59,130,246,0.2);
  --success: #10b981;
  --success-bg: rgba(16,185,129,0.08);
  --accent: #06b6d4;
  --accent-bg: rgba(6,182,212,0.06);

  /* Spacing */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;

  /* Radius */
  --radius: 0.5rem;
  --radius-sm: 0.375rem;
  --radius-lg: 0.75rem;

  /* Transitions */
  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Sidebar width */
  --sidebar-width: 220px;
}

html, body {
  height: 100%;
  overflow: hidden;
  margin: 0;
}

body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- News Ticker --- */
.news-ticker {
  display: flex;
  align-items: center;
  height: 34px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  position: relative;
  z-index: 30;
  flex-shrink: 0;
}

.news-ticker.breaking {
  background: linear-gradient(90deg, rgba(220,38,38,0.25) 0%, rgba(185,28,28,0.12) 100%);
  border-bottom-color: var(--critical-border);
}

.ticker-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  background: var(--surface-2);
  height: 100%;
  border-right: 1px solid var(--border);
  white-space: nowrap;
  flex-shrink: 0;
}

.ticker-label::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: ticker-pulse 2s ease-in-out infinite;
}

.news-ticker.breaking .ticker-label {
  color: var(--critical);
  background: rgba(220,38,38,0.15);
}

.news-ticker.breaking .ticker-label::before {
  background: var(--critical);
  animation: ticker-pulse-fast 0.8s ease-in-out infinite;
}

@keyframes ticker-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@keyframes ticker-pulse-fast {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

.ticker-track {
  flex: 1;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent 0%, black 3%, black 97%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 3%, black 97%, transparent 100%);
}

.ticker-content {
  display: flex;
  gap: 0;
  white-space: nowrap;
  animation: ticker-scroll var(--ticker-duration, 60s) linear infinite;
  width: max-content;
}

.ticker-content:hover {
  animation-play-state: paused;
}

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
  font-size: 12px;
  color: var(--text);
  cursor: default;
}

.ticker-item::after {
  content: '\2022';
  color: var(--text-faint);
  margin-left: 16px;
}

.ticker-severity {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 1px 5px;
  border-radius: 3px;
}

.ticker-severity.critical {
  color: var(--critical);
  background: var(--critical-bg);
}

.ticker-severity.high {
  color: var(--high);
  background: var(--high-bg);
}

.ticker-severity.medium {
  color: var(--medium);
  background: var(--medium-bg);
}

.ticker-severity.low {
  color: var(--success);
  background: var(--success-bg);
}

.ticker-source {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.ticker-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
}

/* --- Dashboard Layout --- */
.dashboard {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: auto 1fr;
  height: calc(100dvh - 58px); /* 34px ticker + 24px merged status bar */
}

/* --- Sidebar --- */
.sidebar {
  grid-row: 1 / -1;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 20;
}

.sidebar-header {
  padding: var(--sp-5) var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  border-bottom: 1px solid var(--border);
}

.logo { color: var(--accent); flex-shrink: 0; }
.logo-text {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.05em;
  color: var(--text);
}
.logo-accent { color: var(--accent); }

.sidebar-nav {
  padding: var(--sp-3) var(--sp-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-3);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
  width: 100%;
}

.nav-item:hover { color: var(--text); background: var(--surface-2); }
.nav-item.active {
  color: var(--accent);
  background: var(--accent-bg);
}
.nav-item.active svg { stroke: var(--accent); }

.sidebar-footer {
  padding: var(--sp-4);
  border-top: 1px solid var(--border);
}
.classification {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  text-transform: uppercase;
  margin-bottom: var(--sp-1);
}
.update-time {
  font-size: 11px;
  color: var(--text-faint);
}

/* --- Header --- */
.header {
  grid-column: 2;
  padding: var(--sp-4) var(--sp-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-left { display: flex; align-items: center; gap: var(--sp-3); }
.header-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.header-right { display: flex; align-items: center; gap: var(--sp-4); }

/* --- System Health Indicator (replaces LED Matrix) --- */
.health-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--surface-3);
  transition: all 0.4s ease;
}
.health-dot.active { background: #22c55e; box-shadow: 0 0 4px rgba(34,197,94,0.5); }
.health-dot.warn { background: var(--high); box-shadow: 0 0 4px rgba(245,158,11,0.4); }
.health-dot.error { background: var(--critical); box-shadow: 0 0 4px rgba(239,68,68,0.5); animation: pulse 2s infinite; }
.health-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  text-transform: uppercase;
}

.mobile-toggle {
  display: none;
  color: var(--text-muted);
}

.threat-badge {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  position: relative;
  cursor: help;
}
.threat-badge::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-width: 90vw;
  background: #141720;
  border: 1px solid #2a3045;
  border-radius: 6px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.7;
  color: #c8cdd8;
  letter-spacing: 0;
  white-space: pre-line;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.threat-badge:hover::after {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.threat-badge.critical {
  background: var(--critical-bg);
  border: 1px solid var(--critical-border);
  color: var(--critical);
}
.threat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--critical);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.war-day {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

/* --- Main Content --- */
.main {
  grid-column: 2;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--sp-6);
}

.section { display: none; }
.section.active { display: block; }

/* --- KPI Cards --- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.kpi-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
}
.kpi-card.kpi-subdued {
  border-color: #3d4555;
  opacity: 0.85;
}
.kpi-card.kpi-critical {
  border-color: var(--critical-border);
  background: var(--critical-bg);
}
.kpi-label {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-1);
}
.kpi-value {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  font-variant-numeric: tabular-nums lining-nums;
}
.kpi-unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}
.kpi-detail {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: var(--sp-1);
}
.kpi-detail-warn { color: var(--critical); }
.kpi-delta {
  font-family: var(--font-mono);
  font-size: 12px;
  margin-top: var(--sp-1);
}
.kpi-delta.up { color: var(--critical); }
.kpi-delta.up::before { content: '▲ '; }
.kpi-delta.down { color: var(--critical); }
.kpi-delta.down::before { content: '▼ '; }

/* --- Card Grid --- */
.card-grid {
  display: grid;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}
.card-grid.two-col {
  grid-template-columns: repeat(2, 1fr);
}

.card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: var(--sp-4);
}
.card-grid .card { margin-bottom: 0; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
}
.card-header h2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.card-body {
  padding: var(--sp-4);
}

/* Badges */
.badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}
.badge-critical { background: var(--critical-bg); color: var(--critical); border: 1px solid var(--critical-border); }
.badge-warn { background: var(--high-bg); color: var(--high); border: 1px solid var(--high-border); }
.badge-error { background: var(--critical-bg); color: var(--critical); border: 1px solid var(--critical-border); }

/* --- Situation Text --- */
.situation-text p {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: var(--sp-3);
  max-width: none;
}
.situation-text ul {
  list-style: none;
  padding: 0;
  margin-top: var(--sp-2);
}
.situation-text li {
  font-size: 13px;
  color: var(--text);
  padding: var(--sp-1) 0;
  padding-left: var(--sp-4);
  position: relative;
  max-width: none;
}
.situation-text li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* --- Risk List --- */
.risk-list {
  list-style: none;
  padding: 0;
}
.risk-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: var(--sp-2) 0;
  font-size: 13px;
  border-bottom: 1px solid var(--divider);
  max-width: none;
}
.risk-list li:last-child { border-bottom: none; }
.risk-icon { flex-shrink: 0; font-size: 12px; }
.risk-critical { color: var(--critical); }
.risk-high { color: var(--high); }
.risk-medium { color: var(--medium); }

/* --- Force Grid (Infographic) --- */
.force-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.force-column {
  background: #141720;
  border-radius: 8px;
  padding: 16px;
  border-top: 3px solid var(--force-color);
}
.force-column.usa {
  --force-color: #3b82f6;
  background: linear-gradient(180deg, rgba(59,130,246,0.08) 0%, transparent 40%);
}
.force-column.israel {
  --force-color: #e2e8f0;
  background: linear-gradient(180deg, rgba(226,232,240,0.05) 0%, transparent 40%);
}
.force-column.iran {
  --force-color: #ef4444;
  background: linear-gradient(180deg, rgba(239,68,68,0.08) 0%, transparent 40%);
}
.force-column-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.force-column-flag { font-size: 20px; }
.force-column-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--force-color);
}
.force-hero-metric {
  font-size: 2rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--force-color);
  margin-bottom: 12px;
  line-height: 1.2;
}
.force-hero-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.force-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #1e2536;
  font-size: 12px;
  color: var(--text-muted);
}
.force-item:last-child { border-bottom: none; }
.force-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.force-metric {
  font-weight: 600;
  color: #e2e8f0;
  font-family: var(--font-mono);
}
/* Legacy force-title / force-list kept for non-situation usage */
.force-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: var(--sp-3);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding-bottom: var(--sp-2);
  border-bottom: 2px solid;
}
.force-title.usa { border-color: var(--medium); color: var(--medium); }
.force-title.israel { border-color: var(--accent); color: var(--accent); }
.force-title.iran { border-color: var(--critical); color: var(--critical); }
.flag { font-size: 16px; }
.force-list {
  list-style: none;
  padding: 0;
}
.force-list li {
  font-size: 12px;
  padding: var(--sp-1) 0;
  color: var(--text-muted);
  max-width: none;
}
.metric {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* --- Chart --- */
.chart-container {
  height: 260px;
  position: relative;
}
.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* --- Data Table --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.data-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}
.data-table th {
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface-3);
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: var(--sp-3);
  border-bottom: 1px solid var(--divider);
  color: var(--text);
  vertical-align: top;
  line-height: 1.5;
}

/* Status badges in table */
.status-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.03em;
}
.status-badge.destroyed {
  background: var(--critical-bg);
  color: var(--critical);
  border: 1px solid var(--critical-border);
}
.status-badge.partial {
  background: var(--high-bg);
  color: var(--high);
  border: 1px solid var(--high-border);
}

/* --- Nuclear Assessment --- */
.nuclear-assessment {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.assessment-item {
  padding: var(--sp-3);
  border-radius: var(--radius-sm);
  border-left: 3px solid;
}
.assessment-item.critical {
  background: var(--critical-bg);
  border-left-color: var(--critical);
}
.assessment-item.high {
  background: var(--high-bg);
  border-left-color: var(--high);
}
.assessment-item.medium {
  background: var(--medium-bg);
  border-left-color: var(--medium);
}
.assessment-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
  margin-bottom: var(--sp-1);
}
.assessment-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* --- Sanctions Timeline --- */
.sanctions-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.sanction-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--divider);
  font-size: 12px;
}
.sanction-item:last-child { border-bottom: none; }
.sanction-date {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}
.sanction-text { color: var(--text); line-height: 1.5; }

/* --- Evasion Grid --- */
.evasion-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}
.evasion-item {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-3);
}
.evasion-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.evasion-stat {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--high);
  margin: var(--sp-1) 0;
}
.evasion-detail {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.4;
}

/* --- Diplomacy Grid --- */
.diplo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}
.diplo-card {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-3);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
}

/* --- Proxy Cards --- */
.proxy-cards {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.proxy-card {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-3);
}
.proxy-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-2);
}
.proxy-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}
.proxy-status {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.03em;
}
.proxy-status.active { background: var(--critical-bg); color: var(--critical); border: 1px solid var(--critical-border); }
.proxy-status.degraded { background: var(--high-bg); color: var(--high); border: 1px solid var(--high-border); }
.proxy-status.paused { background: var(--medium-bg); color: var(--medium); border: 1px solid var(--medium-border); }
.proxy-status.nonbelligerent { background: var(--success-bg); color: var(--success); }
.proxy-stats {
  display: flex;
  gap: var(--sp-3);
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
  flex-wrap: wrap;
}
.proxy-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: none;
}

/* --- Cyber List --- */
.subsection-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-bottom: var(--sp-2);
}
.cyber-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: var(--sp-3);
}
.cyber-item {
  display: grid;
  grid-template-columns: 60px 1fr 80px 1fr;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-2);
  font-size: 11px;
  background: var(--surface-3);
  border-left: 3px solid var(--critical);
}
.cyber-item.friendly {
  border-left-color: var(--accent);
}
.cyber-date {
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-size: 10px;
}
.cyber-target { color: var(--text); font-weight: 500; }
.cyber-actor {
  font-family: var(--font-mono);
  color: var(--text-faint);
  font-size: 10px;
}
.cyber-impact { color: var(--text-muted); }

/* --- Timeline --- */
.timeline {
  position: relative;
  padding-left: var(--sp-6);
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  padding: var(--sp-3) 0 var(--sp-4) var(--sp-4);
  border-bottom: 1px solid var(--divider);
}
.timeline-item:last-child { border-bottom: none; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--sp-6) - 1px);
  top: var(--sp-4);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 2px solid var(--text-faint);
}
.timeline-item.critical::before { border-color: var(--critical); background: var(--critical-bg); }
.timeline-item.high::before { border-color: var(--high); background: var(--high-bg); }
.timeline-item.medium::before { border-color: var(--medium); background: var(--medium-bg); }
.timeline-date {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--sp-1);
}
.timeline-content {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
}
.timeline-content strong { color: var(--text); }
.timeline-item.critical .timeline-content strong { color: var(--critical); }
.timeline-item.high .timeline-content strong { color: var(--high); }


/* --- Responsive --- */
@media (max-width: 1024px) {
  .card-grid.two-col {
    grid-template-columns: 1fr;
  }
  .force-grid {
    grid-template-columns: 1fr;
  }
  .force-hero-metric {
    font-size: 1.5rem;
  }
  .diplo-grid {
    grid-template-columns: 1fr;
  }
  .evasion-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    z-index: 30;
  }
  .sidebar.open { display: flex; }
  .mobile-toggle { display: block; }
  .header { grid-column: 1; }
  .main {
    grid-column: 1;
    padding: var(--sp-4);
  }
  .kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .cyber-item {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .kpi-row {
    grid-template-columns: 1fr;
  }
  .header-right { flex-wrap: wrap; }
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* --- Event Cards (Latest Events Feed) --- */
.events-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.event-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: var(--sp-3) var(--sp-4);
  transition: border-color 0.15s ease;
}
a.event-card {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.event-card:hover {
  border-color: var(--border-hover);
}
a.event-card:hover .event-source {
  opacity: 1;
  text-decoration: underline;
}

.event-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}

.event-date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.event-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: var(--sp-1);
  line-height: 1.35;
}

.event-detail {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.event-source {
  display: inline-block;
  margin-top: var(--sp-2);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent);
  text-decoration: none;
  opacity: 0.8;
  pointer-events: none;
}
a .event-source:hover,
a:hover .event-source {
  opacity: 1;
  text-decoration: underline;
}
.timeline-content--link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.timeline-content--link:hover .event-source {
  opacity: 1;
  text-decoration: underline;
}

/* Badge variants */
.badge-info {
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid rgba(6,182,212,0.2);
}

/* --- Alert Strip --- */
.alert-strip {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: linear-gradient(90deg, rgba(239,68,68,0.12) 0%, rgba(239,68,68,0.04) 100%);
  border: 1px solid var(--critical-border);
  border-radius: var(--radius);
  margin-bottom: var(--sp-4);
}
.alert-strip .alert-icon {
  font-size: 18px;
  flex-shrink: 0;
}
.alert-strip .alert-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
}
.alert-strip .alert-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}
.alert-strip .alert-severity {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--critical-bg);
  color: var(--critical);
  border: 1px solid var(--critical-border);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

/* --- KPI Hierarchy: Hero / Primary / Secondary --- */
.kpi-card.kpi-hero {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(239,68,68,0.15) 0%, rgba(245,158,11,0.08) 100%);
  border-color: var(--critical-border);
  position: relative;
}
.kpi-card.kpi-hero .kpi-value {
  font-size: 1.6rem;
}
.kpi-card.kpi-hero .kpi-pulse {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--critical);
  animation: pulse 2s infinite;
}
.kpi-card.kpi-primary {
  border-left: 3px solid var(--accent);
}
.kpi-card.kpi-primary .kpi-value {
  font-size: 1.4rem;
}
.kpi-card.kpi-secondary .kpi-value {
  font-size: 18px;
  color: var(--text-muted);
}
.kpi-card.kpi-secondary .kpi-label {
  color: var(--text-faint);
}

/* --- Sparkline in KPI --- */
.kpi-sparkline {
  height: 30px;
  margin-top: var(--sp-2);
}
.kpi-sparkline canvas {
  width: 100% !important;
  height: 100% !important;
}

/* --- Escalation Gauge --- */
.escalation-gauge {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  margin-bottom: var(--sp-6);
}
.escalation-step {
  flex: 1;
  text-align: center;
}
.escalation-bar {
  height: 8px;
  border-radius: 4px;
  background: #1e2536;
  transition: background 300ms;
}
.escalation-step.active .escalation-bar { /* colored by level class below */ }
.escalation-step.level-1 .escalation-bar { background: #22c55e; }
.escalation-step.level-2 .escalation-bar { background: #84cc16; }
.escalation-step.level-3 .escalation-bar { background: #eab308; }
.escalation-step.level-4 .escalation-bar { background: #f97316; }
.escalation-step.level-5 .escalation-bar { background: #ef4444; }
.escalation-step:not(.active) .escalation-bar { background: #1e2536; }
.escalation-step.current .escalation-bar {
  box-shadow: 0 0 8px currentColor;
  animation: pulse-bar 2s ease-in-out infinite;
}
.escalation-label {
  font-size: 0.6rem;
  color: #64748b;
  margin-top: 4px;
}
.escalation-step.active .escalation-label { color: #e2e8f0; }
@keyframes pulse-bar {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.escalation-gauge .gauge-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--sp-2);
}
.gauge-bar {
  display: flex;
  height: 32px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.gauge-segment {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-faint);
  transition: all 0.3s ease;
  border-right: 1px solid rgba(0,0,0,0.2);
}
.gauge-segment:last-child { border-right: none; }
.gauge-segment.level-1 { background: rgba(16,185,129,0.15); }
.gauge-segment.level-2 { background: rgba(59,130,246,0.15); }
.gauge-segment.level-3 { background: rgba(245,158,11,0.15); }
.gauge-segment.level-4 { background: rgba(239,68,68,0.2); }
.gauge-segment.level-5 { background: rgba(220,38,38,0.25); }
.gauge-segment.active {
  color: var(--text);
  font-weight: 700;
  font-size: 10px;
}
.gauge-segment.level-1.active { background: rgba(16,185,129,0.35); color: var(--success); }
.gauge-segment.level-2.active { background: rgba(59,130,246,0.35); color: var(--medium); }
.gauge-segment.level-3.active { background: rgba(245,158,11,0.35); color: var(--high); }
.gauge-segment.level-4.active { background: rgba(239,68,68,0.4); color: var(--critical); }
.gauge-segment.level-5.active { background: rgba(220,38,38,0.5); color: #fca5a5; }
.gauge-pointer {
  font-size: 12px;
  text-align: center;
  margin-top: var(--sp-1);
  color: var(--text-muted);
}

/* --- Delta Panel (compact events) --- */
.delta-panel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: var(--sp-4);
}
.delta-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.delta-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  white-space: nowrap;
  min-width: 70px;
}
.delta-text {
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.delta-severity {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* --- Sub-tabs --- */
.sub-tabs {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.sub-tab {
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
  white-space: nowrap;
}
.sub-tab:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border-hover);
}
.sub-tab.active {
  color: var(--accent);
  background: var(--accent-bg);
  border-color: rgba(6,182,212,0.3);
}
.sub-content {
  display: none;
}
.sub-content.active {
  display: block;
}

/* --- Filter Bar --- */
.filter-bar {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
  align-items: center;
}
.filter-group {
  display: flex;
  gap: var(--sp-1);
  flex-wrap: wrap;
}
.filter-group::before {
  content: attr(data-label);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  padding-right: var(--sp-2);
}
.filter-pill {
  padding: var(--sp-1) var(--sp-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
}
.filter-pill:hover {
  color: var(--text);
  border-color: var(--border-hover);
}
.filter-pill.active {
  color: var(--accent);
  background: var(--accent-bg);
  border-color: rgba(6,182,212,0.3);
}
.filter-pill .pill-count {
  font-family: var(--font-mono);
  font-size: 9px;
  margin-left: 4px;
  opacity: 0.7;
}

/* --- Scenario Cards --- */
.scenario-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}
.scenario-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
}
.scenario-card.best { border-top: 3px solid var(--success); }
.scenario-card.base { border-top: 3px solid var(--high); }
.scenario-card.worst { border-top: 3px solid var(--critical); }
.scenario-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--sp-1);
}
.scenario-prob {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: var(--sp-2);
}
.scenario-card.best .scenario-prob { color: var(--success); }
.scenario-card.base .scenario-prob { color: var(--high); }
.scenario-card.worst .scenario-prob { color: var(--critical); }
.scenario-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* --- Casualties Dashboard --- */
.casualties-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
}
.casualty-card {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-3);
  text-align: center;
}
.casualty-flag { font-size: 24px; margin-bottom: var(--sp-1); }
.casualty-country {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--sp-1);
}
.casualty-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--critical);
}
.casualty-detail {
  font-size: 10px;
  color: var(--text-faint);
  margin-top: var(--sp-1);
}

/* --- Breakout Clock --- */
.breakout-clock {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-4);
}
.clock-ring {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid var(--border);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-3);
}
.clock-ring::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 4px solid transparent;
  border-top-color: var(--critical);
  border-right-color: var(--critical);
  border-bottom-color: var(--high);
}
.clock-value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--critical);
  text-align: center;
}
.clock-label {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* --- Humanitarian Section --- */
.humanitarian-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
}

/* --- Responsive adjustments for new components --- */
@media (max-width: 1024px) {
  .scenario-cards { grid-template-columns: 1fr; }
  .casualties-grid { grid-template-columns: repeat(2, 1fr); }
  .sub-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
}

@media (max-width: 768px) {
  .kpi-card.kpi-hero { grid-column: span 1; }
  .casualties-grid { grid-template-columns: 1fr 1fr; }
  .filter-bar { flex-direction: column; align-items: flex-start; }
  .humanitarian-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .casualties-grid { grid-template-columns: 1fr; }
  .scenario-cards { grid-template-columns: 1fr; }
}

/* --- Humanitarian Items --- */
.humanitarian-item {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-3);
  text-align: center;
}
.humanitarian-icon { font-size: 24px; margin-bottom: var(--sp-1); }
.humanitarian-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: var(--sp-1);
}
.humanitarian-value {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--critical);
}
.humanitarian-value--small {
  font-size: 13px;
  font-weight: 500;
}

/* --- Escalation Timeline (Assessment section) --- */
.esc-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.esc-step {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--text-faint);
}
.esc-step.active {
  border-left-color: var(--critical);
  background: var(--critical-bg);
}
.esc-step-day {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 70px;
}
.esc-step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 3px;
  background: var(--surface-3);
  border: 2px solid var(--text-faint);
}
.esc-step-dot.level-1 { border-color: var(--success); }
.esc-step-dot.level-2 { border-color: var(--medium); }
.esc-step-dot.level-3 { border-color: var(--high); }
.esc-step-dot.level-4 { border-color: var(--critical); }
.esc-step-dot.level-5 { border-color: #dc2626; }
.esc-step.active .esc-step-dot {
  background: var(--critical);
  border-color: var(--critical);
}
.esc-step-text {
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
}

/* --- Casualty Source --- */
.casualty-source {
  font-size: 9px;
  color: var(--text-faint);
  margin-top: var(--sp-1);
}

/* --- Merged Status Bar (Agent LEDs + SYS) --- */
.led-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 24px;
  background: #0d1117;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 29;
}
.led-agents {
  display: flex;
  align-items: center;
  gap: 16px;
}
.led-sys {
  display: flex;
  align-items: center;
  gap: 6px;
}
.led-separator {
  width: 1px;
  height: 12px;
  background: var(--border-hover);
  margin: 0 4px;
}
.led-sys-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  text-transform: uppercase;
}
.led-item {
  display: flex;
  align-items: center;
  gap: 5px;
}
.led-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--surface-3);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}
.led-dot.green {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34,197,94,0.6);
  animation: led-pulse 2s ease-in-out infinite;
}
.led-dot.yellow {
  background: #eab308;
  box-shadow: 0 0 4px rgba(234,179,8,0.4);
}
.led-dot.red {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239,68,68,0.6);
}
.led-label {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  text-transform: uppercase;
}
.sys-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--surface-3);
  transition: all 0.4s ease;
}
.sys-dot.active { background: #22c55e; box-shadow: 0 0 4px rgba(34,197,94,0.5); }
.sys-dot.warn { background: var(--high); box-shadow: 0 0 4px rgba(245,158,11,0.4); }
.sys-dot.error { background: var(--critical); box-shadow: 0 0 4px rgba(239,68,68,0.5); animation: pulse 2s infinite; }
@keyframes led-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(34,197,94,0.6); }
  50% { opacity: 0.5; box-shadow: 0 0 2px rgba(34,197,94,0.2); }
}

/* --- Risk Matrix (3x3 Grid) --- */
.risk-matrix-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.risk-matrix {
  display: grid;
  grid-template-columns: 70px repeat(3, 1fr);
  grid-template-rows: repeat(3, auto) auto;
  gap: 2px;
}
.risk-matrix-cell {
  min-height: 60px;
  padding: var(--sp-2);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--border);
}
.risk-matrix-cell.zone-low { background: rgba(34,197,94,0.06); }
.risk-matrix-cell.zone-low-med { background: rgba(132,204,22,0.06); }
.risk-matrix-cell.zone-med { background: rgba(234,179,8,0.06); }
.risk-matrix-cell.zone-med-high { background: rgba(249,115,22,0.06); }
.risk-matrix-cell.zone-high { background: rgba(239,68,68,0.06); }
.risk-matrix-cell.zone-critical { background: rgba(220,38,38,0.08); }
.risk-matrix-row-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: var(--sp-2);
}
.risk-matrix-col-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: center;
  padding-top: var(--sp-2);
}
.risk-tile {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 3px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.risk-tile.sev-green { background: rgba(34,197,94,0.2); color: #22c55e; border: 1px solid rgba(34,197,94,0.3); }
.risk-tile.sev-yellow-green { background: rgba(132,204,22,0.2); color: #84cc16; border: 1px solid rgba(132,204,22,0.3); }
.risk-tile.sev-yellow { background: rgba(234,179,8,0.2); color: #eab308; border: 1px solid rgba(234,179,8,0.3); }
.risk-tile.sev-orange { background: rgba(249,115,22,0.2); color: #f97316; border: 1px solid rgba(249,115,22,0.3); }
.risk-tile.sev-red { background: rgba(239,68,68,0.2); color: #ef4444; border: 1px solid rgba(239,68,68,0.3); }
.risk-tile.sev-dark-red { background: rgba(220,38,38,0.2); color: #dc2626; border: 1px solid rgba(220,38,38,0.3); }

/* --- Diplo Timestamp --- */
.diplo-card {
  position: relative;
}
.diplo-timestamp {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-faint);
  text-align: right;
  margin-top: var(--sp-2);
}
.diplo-header-ts {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  font-weight: 400;
}

/* --- Map Container (Hybrid: image base + HTML overlay) --- */
.map-container {
  margin: 12px 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #1e2536;
  position: relative;
}
.osint-map {
  width: 100%;
  height: auto;
  display: block;
  max-height: 450px;
  object-fit: cover;
}

.map-viewport {
  position: relative;
  background: url('map-base.png') center/cover no-repeat;
  background-color: #080c14;
  aspect-ratio: 16/9;
  min-height: 300px;
  max-height: 500px;
}

.map-events-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.map-layers {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  background: rgba(10, 14, 23, 0.9);
  border-bottom: 1px solid #1e2536;
  flex-wrap: wrap;
}
.layer-btn {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 3px;
  border: 1px solid #2a3045;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: all 200ms;
}
.layer-btn:hover {
  color: #94a3b8;
  border-color: #3a4565;
}
.layer-btn.active {
  background: rgba(34, 211, 238, 0.1);
  color: #22d3ee;
  border-color: rgba(34, 211, 238, 0.3);
}
.layer-btn[data-layer="military"].active { color: #ef4444; border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.1); }
.layer-btn[data-layer="economic"].active { color: #f59e0b; border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.1); }
.layer-btn[data-layer="nuclear"].active { color: #22d3ee; border-color: rgba(34,211,238,0.3); background: rgba(34,211,238,0.1); }
.layer-btn[data-layer="cyber"].active { color: #a855f7; border-color: rgba(168,85,247,0.3); background: rgba(168,85,247,0.1); }
.layer-btn[data-layer="diplomatic"].active { color: #3b82f6; border-color: rgba(59,130,246,0.3); background: rgba(59,130,246,0.1); }
.layer-btn[data-layer="proxy"].active { color: #f97316; border-color: rgba(249,115,22,0.3); background: rgba(249,115,22,0.1); }

.map-meta {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 0.6rem;
  color: #64748b;
  background: rgba(10,14,23,0.8);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
}

/* --- Map Markers (HTML-based event overlay) --- */
.map-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  z-index: 2;
}

.marker-ring {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid;
  background: rgba(0,0,0,0.4);
  box-shadow: 0 0 8px currentColor;
}

.marker-lg .marker-ring { width: 22px; height: 22px; border-width: 3px; }
.marker-md .marker-ring { width: 18px; height: 18px; }
.marker-sm .marker-ring { width: 14px; height: 14px; }

.marker-ring.pulse {
  animation: ring-pulse 2s ease-in-out infinite;
}

@keyframes ring-pulse {
  0%, 100% { box-shadow: 0 0 8px currentColor; transform: scale(1); }
  50% { box-shadow: 0 0 20px currentColor; transform: scale(1.2); }
}

.marker-icon {
  width: 20px;
  height: 20px;
  position: absolute;
  top: -2px;
  left: -2px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
  pointer-events: none;
}

.marker-label {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  font-family: 'JetBrains Mono', monospace;
  color: #cbd5e1;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Category colors for ring */
.cat-military .marker-ring { border-color: #ef4444; color: #ef4444; }
.cat-economic .marker-ring { border-color: #f59e0b; color: #f59e0b; }
.cat-nuclear .marker-ring { border-color: #22d3ee; color: #22d3ee; }
.cat-cyber .marker-ring { border-color: #a855f7; color: #a855f7; }
.cat-diplomatic .marker-ring { border-color: #3b82f6; color: #3b82f6; }
.cat-proxy .marker-ring { border-color: #f97316; color: #f97316; }

/* Tooltip */
.marker-tooltip {
  display: none;
  position: absolute;
  left: 28px;
  top: -8px;
  background: #141720;
  border: 1px solid #2a3045;
  border-radius: 6px;
  padding: 10px 12px;
  min-width: 220px;
  max-width: 300px;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  pointer-events: none;
}

.map-marker:hover .marker-tooltip { display: block; }
.map-marker:hover { z-index: 50; }

.tt-date { font-size: 10px; color: #64748b; font-family: 'JetBrains Mono', monospace; margin-bottom: 4px; }
.tt-title { font-size: 12px; color: #e2e8f0; font-weight: 600; margin-bottom: 6px; line-height: 1.4; }
.tt-detail { font-size: 11px; color: #94a3b8; line-height: 1.4; margin-bottom: 4px; }
.tt-source { font-size: 9px; color: #64748b; font-family: 'JetBrains Mono', monospace; }

/* Strategic markers */
.strategic-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  z-index: 1;
  text-align: center;
}

.carrier-icon {
  font-size: 14px;
  color: #3b82f6;
  text-shadow: 0 0 8px rgba(59,130,246,0.6);
}
.carrier.damaged .carrier-icon {
  color: #f59e0b;
  text-shadow: 0 0 8px rgba(245,158,11,0.6);
}
.carrier-label, .nuke-label {
  font-size: 8px;
  font-family: 'JetBrains Mono', monospace;
  color: #64748b;
  white-space: nowrap;
  margin-top: 2px;
}

.nuke-icon {
  font-size: 12px;
  color: #22d3ee;
  text-shadow: 0 0 6px rgba(34,211,238,0.5);
}

/* --- Carrier image markers --- */
.carrier-img {
  width: 32px;
  height: 16px;
  filter: brightness(0) invert(1) sepia(1) saturate(3) hue-rotate(190deg);
  opacity: 0.9;
}
.carrier.damaged .carrier-img {
  filter: brightness(0) invert(1) sepia(1) saturate(3) hue-rotate(30deg);
  opacity: 0.6;
}
.carrier.damaged .carrier-label::after {
  content: ' [DMG]';
  color: #f59e0b;
  font-weight: 600;
}

/* --- IDF position markers --- */
.idf-icon {
  font-size: 14px;
  color: #e2e8f0;
  text-shadow: 0 0 6px rgba(226,232,240,0.5);
}

/* --- Hezbollah / Houthi actor markers --- */
.hez-icon, .houthi-icon {
  font-size: 12px;
  color: #f97316;
  text-shadow: 0 0 6px rgba(249,115,22,0.5);
}

/* --- Strategic labels (shared) --- */
.strategic-label {
  font-size: 8px;
  font-family: 'JetBrains Mono', monospace;
  color: #94a3b8;
  white-space: nowrap;
  margin-top: 2px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* --- Hormuz blockade line --- */
.blockade-line {
  width: 40px;
  height: 0;
  border-top: 2px dashed #f97316;
  transform: rotate(-30deg);
  opacity: 0.7;
}
.blockade-label {
  color: #f97316;
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

/* --- Chart container min-height for oil chart --- */
.chart-container-prominent {
  min-height: 300px;
  position: relative;
}
.chart-container-prominent canvas {
  width: 100% !important;
  height: 100% !important;
}
