/* ================================================================
   GEOPOLITICAL SIGNAL MAP — Styles
   Bridgewater-inspired dark intelligence terminal aesthetic
   ================================================================ */

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

:root {
  --bg:          #080d1a;
  --bg2:         #0d1629;
  --bg3:         #111c35;
  --border:      rgba(255,255,255,0.07);
  --border2:     rgba(255,255,255,0.12);
  --text:        #e2e8f0;
  --text-muted:  #64748b;
  --text-faint:  #334155;
  --accent:      #2563eb;
  --accent2:     #3b82f6;
  --crisis:      #ef4444;
  --tension:     #f59e0b;
  --calm:        #3b82f6;
  --positive:    #22c55e;
  --header-h:    48px;
  --timeline-h:  52px;
  --sidebar-w:   240px;
  --detail-w:    300px;
  --font:        'Inter', system-ui, sans-serif;
  --font-serif:  'Libre Baskerville', Georgia, serif;
}

[data-theme="light"] {
  --bg:          #f8fafc;
  --bg2:         #f1f5f9;
  --bg3:         #e2e8f0;
  --border:      rgba(0,0,0,0.08);
  --border2:     rgba(0,0,0,0.14);
  --text:        #0f172a;
  --text-muted:  #64748b;
  --text-faint:  #94a3b8;
  --accent:      #2563eb;
  --accent2:     #3b82f6;
}

html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

/* ── Loading overlay ──────────────────────────────────────────── */
.loading-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  background: var(--bg);
}
.loading-spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 12px; color: var(--text-muted); letter-spacing: 0.06em; }

/* ── Demo banner ─────────────────────────────────────────────── */
.demo-banner {
  position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  background: rgba(245,158,11,0.12); border-bottom: 1px solid rgba(245,158,11,0.3);
  padding: 6px 16px; font-size: 11px; color: #fbbf24; gap: 8px;
}
.demo-banner a { color: #fbbf24; text-decoration: underline; }

/* ── Header ──────────────────────────────────────────────────── */
.gsm-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 400;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  background: rgba(8,13,26,0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.gsm-header__brand { display: flex; align-items: center; gap: 14px; }
.gsm-back {
  font-size: 11px; color: var(--text-muted); text-decoration: none;
  transition: color 0.15s;
}
.gsm-back:hover { color: var(--text); }
.gsm-title {
  font-family: var(--font-serif); font-size: 13px; font-weight: 700;
  letter-spacing: 0.12em; color: var(--text);
}
.gsm-subtitle {
  font-size: 10px; color: var(--text-muted); letter-spacing: 0.05em;
}
.gsm-header__controls {
  display: flex; align-items: center; gap: 10px;
}

/* Mode / period button groups */
.mode-group, .period-group {
  display: flex; align-items: center;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 6px; overflow: hidden;
}
.mode-btn, .period-btn {
  padding: 5px 10px; font-size: 11px; font-weight: 500;
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.mode-btn.active, .period-btn.active {
  background: var(--accent); color: #fff;
}
.mode-btn:hover:not(.active), .period-btn:hover:not(.active) {
  color: var(--text); background: var(--bg3);
}

/* Particle toggle */
.particle-toggle {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
}
.particle-toggle input { display: none; }
.particle-toggle__track {
  width: 30px; height: 16px; border-radius: 8px;
  background: var(--bg3); border: 1px solid var(--border2);
  position: relative; transition: background 0.2s;
}
.particle-toggle__track::after {
  content: ''; position: absolute;
  top: 2px; left: 2px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--text-muted);
  transition: transform 0.2s, background 0.2s;
}
.particle-toggle input:checked + .particle-toggle__track {
  background: var(--accent);
}
.particle-toggle input:checked + .particle-toggle__track::after {
  transform: translateX(14px); background: #fff;
}
.particle-toggle__label { font-size: 11px; color: var(--text-muted); }

/* Header buttons */
.header-btn {
  padding: 5px 12px; font-size: 11px; font-weight: 500;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-muted); cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.header-btn:hover { color: var(--text); border-color: var(--border2); background: var(--bg3); }
.header-btn--accent {
  background: rgba(37,99,235,0.12); border-color: rgba(37,99,235,0.4);
  color: var(--accent2);
}
.header-btn--accent:hover { background: rgba(37,99,235,0.2); }

/* ── Map ─────────────────────────────────────────────────────── */
.map-container {
  position: fixed;
  top: var(--header-h);
  bottom: var(--timeline-h);
  left: 0; right: 0;
  background: var(--bg);
}
.mapboxgl-ctrl-group {
  background: var(--bg2) !important;
  border: 1px solid var(--border) !important;
}
.mapboxgl-ctrl-group button {
  background: none !important;
  filter: invert(0.7);
}

/* ── Left Sidebar ────────────────────────────────────────────── */
.sidebar {
  position: fixed; top: var(--header-h); bottom: var(--timeline-h);
  z-index: 200; width: var(--sidebar-w);
  background: rgba(8,13,26,0.88);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(12px);
  overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; gap: 0;
}
.sidebar--left { left: 0; }
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.sidebar-section {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
}
.sidebar-section--compact { padding: 8px 14px; }
.sidebar-section--legend  { margin-top: auto; }

.section-label {
  font-size: 9px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 8px;
}

/* Global Tension Index */
.gti-display {
  display: flex; align-items: baseline; gap: 4px; margin-bottom: 6px;
}
.gti-value {
  font-size: 48px; font-weight: 700; line-height: 1;
  color: var(--text); font-variant-numeric: tabular-nums;
  transition: color 0.5s;
}
.gti-unit { font-size: 14px; color: var(--text-muted); }
.gti-regime { margin-top: 4px; }

/* Regime badges */
.regime-badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 10px; font-size: 9px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.regime-badge--calm     { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }
.regime-badge--elevated { background: rgba(99,179,237,0.12); color: #93c5fd; border: 1px solid rgba(99,179,237,0.25); }
.regime-badge--tension  { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.35); }
.regime-badge--crisis   { background: rgba(239,68,68,0.15);  color: #f87171; border: 1px solid rgba(239,68,68,0.35); }
.regime-badge--easing   { background: rgba(34,197,94,0.12);  color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.regime-badge--unknown  { background: rgba(100,116,139,0.1); color: #64748b; border: 1px solid rgba(100,116,139,0.2); }

/* Current date */
.current-date {
  font-size: 14px; font-weight: 600; color: var(--text);
  letter-spacing: 0.02em;
}

/* Region cards */
.region-cards { display: flex; flex-direction: column; gap: 6px; }
.region-card {
  padding: 8px 10px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.region-card:hover { border-color: var(--border2); background: rgba(17,28,53,0.9); }
.region-card__header { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.region-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.region-card__name { font-size: 11px; font-weight: 500; color: var(--text); flex: 1; }
.ew-pip { font-size: 10px; color: #fbbf24; }
.region-card__metrics { display: flex; gap: 10px; margin-bottom: 5px; }
.region-metric { display: flex; flex-direction: column; gap: 1px; }
.region-metric__label { font-size: 9px; color: var(--text-muted); letter-spacing: 0.04em; }
.region-metric__value { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stress-bar {
  height: 2px; background: var(--bg); border-radius: 1px; overflow: hidden;
}
.stress-bar__fill {
  height: 100%; border-radius: 1px;
  transition: width 0.4s ease, background 0.4s;
}

/* Early warnings */
.ew-list { display: flex; flex-direction: column; gap: 4px; }
.ew-none { font-size: 11px; color: var(--text-muted); padding: 4px 0; }
.ew-item {
  padding: 6px 8px; background: rgba(245,158,11,0.05);
  border: 1px solid rgba(245,158,11,0.2); border-radius: 5px;
  cursor: pointer; transition: background 0.15s;
}
.ew-item:hover { background: rgba(245,158,11,0.1); }
.ew-item__header { display: flex; align-items: center; justify-content: space-between; }
.ew-item__name { font-size: 11px; font-weight: 500; color: var(--text); }
.ew-item__score { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ew-item__sub { font-size: 9px; color: var(--text-muted); margin-top: 2px; }

/* Legend */
.legend { display: flex; flex-direction: column; gap: 4px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── Detail panel ────────────────────────────────────────────── */
.detail-panel {
  position: fixed; top: var(--header-h); right: 0;
  width: var(--detail-w); bottom: var(--timeline-h);
  background: rgba(8,13,26,0.92); border-left: 1px solid var(--border);
  backdrop-filter: blur(12px); z-index: 300;
  overflow-y: auto; transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
  padding: 16px;
}
.detail-panel--open { transform: translateX(0); }
.detail-panel::-webkit-scrollbar { width: 4px; }
.detail-panel::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.detail-header { margin-bottom: 16px; position: relative; }
.detail-close {
  position: absolute; top: 0; right: 0;
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 13px; padding: 2px 4px;
  transition: color 0.15s;
}
.detail-close:hover { color: var(--text); }
.detail-name { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.detail-country { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.ep-tag {
  padding: 1px 7px; border-radius: 10px; font-size: 9px;
  font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
}
.ep-tag--financial  { background: rgba(37,99,235,0.15);  color: #60a5fa; }
.ep-tag--political  { background: rgba(139,92,246,0.15); color: #a78bfa; }
.ep-tag--military   { background: rgba(239,68,68,0.12);  color: #f87171; }
.ep-tag--energy     { background: rgba(245,158,11,0.12); color: #fbbf24; }

.detail-metrics {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px;
}
.detail-metric {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; padding: 8px 10px;
}
.detail-metric__label { font-size: 9px; color: var(--text-muted); letter-spacing: 0.05em; margin-bottom: 3px; display: block; }
.detail-metric__value { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }

.detail-sparkline-wrap {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px; margin-bottom: 14px;
}
.detail-sparkline-wrap canvas { display: block; }

/* Narrative */
.detail-narrative { margin-top: 4px; }
.narrative-gen-btn {
  width: 100%; padding: 10px; background: rgba(37,99,235,0.1);
  border: 1px solid rgba(37,99,235,0.3); border-radius: 8px;
  color: var(--accent2); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: background 0.15s;
}
.narrative-gen-btn:hover { background: rgba(37,99,235,0.18); }
.narrative-loading { font-size: 11px; color: var(--text-muted); padding: 12px 0; }
.narrative-hint { font-size: 11px; color: var(--text-muted); line-height: 1.5; padding: 8px 0; }
.narrative-card { display: flex; flex-direction: column; gap: 10px; }
.narrative-headline {
  font-family: var(--font-serif); font-size: 16px; font-weight: 700;
  line-height: 1.3; color: var(--text);
}
.narrative-lede {
  font-size: 12px; color: #94a3b8; line-height: 1.5;
  font-style: italic;
}
.narrative-body {
  font-size: 12px; color: var(--text); line-height: 1.65;
}
.narrative-coda {
  font-size: 11px; color: #fbbf24; font-weight: 500;
  padding: 8px 10px; background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.2); border-radius: 5px;
  line-height: 1.4;
}

/* ── Article list in detail panel ───────────────────────────── */
.detail-articles-wrap {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--border);
}
.detail-articles-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px; font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600;
}
.ga-analyze-btn {
  padding: 5px 12px; font-size: 11px; font-weight: 600;
  background: rgba(99,102,241,0.85); color: #fff; border: none;
  border-radius: 5px; cursor: pointer;
  text-transform: none; letter-spacing: 0;
  transition: background 0.15s;
}
.ga-analyze-btn:hover:not(:disabled) { background: rgba(99,102,241,1); }
.ga-analyze-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.detail-articles-list {
  display: flex; flex-direction: column;
  max-height: 400px; overflow-y: auto;
}
.detail-articles-loading,
.detail-articles-empty {
  padding: 16px 8px; text-align: center;
  font-size: 11px; color: var(--text-muted); font-style: italic;
}
.detail-article {
  display: flex; gap: 8px; padding: 9px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.detail-article:last-child { border-bottom: none; }
.detail-article__chk {
  flex-shrink: 0; margin-top: 4px;
  accent-color: rgba(99,102,241,0.85); cursor: pointer;
  width: 14px; height: 14px;
}
.detail-article__chk:disabled { opacity: 0.3; cursor: not-allowed; }
.detail-article__body { flex: 1; min-width: 0; }
.detail-article__row {
  display: flex; gap: 7px; align-items: center; flex-wrap: wrap;
  margin-bottom: 4px; font-size: 10px;
  color: var(--text-muted); font-family: var(--font-mono, monospace);
}
.detail-article__title {
  display: block; font-size: 12px; line-height: 1.35;
  color: var(--text); text-decoration: none;
}
.detail-article__title:hover { color: rgba(99,102,241,1); text-decoration: underline; }
.detail-article__badge {
  padding: 1px 6px; border-radius: 3px;
  font-weight: 600; font-size: 9px; text-transform: uppercase;
}

/* ── Narratives panel ────────────────────────────────────────── */
.narratives-panel {
  position: fixed; top: var(--header-h); right: 0;
  width: 360px; max-width: 95vw; bottom: var(--timeline-h);
  background: rgba(8,13,26,0.95); border-left: 1px solid var(--border);
  backdrop-filter: blur(16px); z-index: 350;
  overflow-y: auto; padding: 16px;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
}
.narratives-panel--open { transform: translateX(0); }
.narratives-panel::-webkit-scrollbar { width: 4px; }
.narratives-panel::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.np-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; font-size: 13px; font-weight: 600;
}
.np-header button {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 13px;
}
.np-loading, .np-empty {
  font-size: 11px; color: var(--text-muted); padding: 20px 0;
}
.np-card {
  padding: 14px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 10px;
}
.np-card__period { font-size: 9px; color: var(--text-muted); letter-spacing: 0.05em; margin-bottom: 6px; }
.np-card__headline {
  font-family: var(--font-serif); font-size: 15px; font-weight: 700;
  line-height: 1.3; margin-bottom: 6px;
}
.np-card__lede { font-size: 11px; color: #94a3b8; line-height: 1.5; margin-bottom: 8px; }

/* ── Timeline ────────────────────────────────────────────────── */
.timeline-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
  height: var(--timeline-h);
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: rgba(8,13,26,0.94); border-top: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.timeline-controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.tl-btn {
  width: 32px; height: 32px; border-radius: 6px;
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text); font-size: 13px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.tl-btn:hover { background: var(--bg3); border-color: var(--border2); }
.tl-btn--small { width: 36px; font-size: 11px; font-weight: 600; }

.timeline-slider-wrap {
  flex: 1; display: flex; align-items: center; gap: 8px;
}
.timeline-edge { font-size: 10px; color: var(--text-muted); flex-shrink: 0; }
.timeline-slider {
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 4px;
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--val, 100%), var(--bg3) var(--val, 100%));
  border-radius: 2px; outline: none; cursor: pointer;
}
.timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--text); border: 2px solid var(--accent);
  cursor: pointer;
}
.timeline-slider::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--text); border: 2px solid var(--accent);
  cursor: pointer; border: none;
}

.timeline-date-pill {
  flex-shrink: 0; padding: 4px 10px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; font-size: 11px; font-weight: 500;
  color: var(--text); white-space: nowrap; min-width: 110px;
  text-align: center;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --sidebar-w: 200px;
    --detail-w:  280px;
  }
  .gsm-subtitle { display: none; }
  .period-group { display: none; }
  .gsm-header__controls { gap: 6px; }
}
@media (max-width: 600px) {
  .sidebar { display: none; }
}

/* ── JS tooltip ──────────────────────────────────────────────── */
.gsm-tooltip {
  display: none;
  position: fixed; z-index: 9000;
  max-width: 240px; padding: 8px 12px;
  background: #1e293b; border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px; font-size: 11px; color: #e2e8f0;
  line-height: 1.5; pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
[data-theme="light"] .gsm-tooltip {
  background: #fff; border-color: rgba(0,0,0,0.12);
  color: #0f172a; box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* ── Forecast date pill ──────────────────────────────────────── */
.timeline-date-pill--forecast {
  border-color: rgba(245,158,11,0.5) !important;
  color: #fbbf24 !important;
}

/* ── Narrative sources ───────────────────────────────────────── */
.narrative-sources {
  margin-top: 12px; display: flex; flex-direction: column; gap: 6px;
}
.narrative-sources__label {
  font-size: 9px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 2px;
}
.narrative-source-link {
  display: flex; flex-direction: column; gap: 2px;
  padding: 7px 10px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.narrative-source-link:hover {
  border-color: var(--border2); background: rgba(37,99,235,0.06);
}
.narrative-source-domain {
  font-size: 9px; color: var(--accent2); font-weight: 600;
  letter-spacing: 0.04em; text-transform: lowercase;
}
.narrative-source-title {
  font-size: 11px; color: var(--text-muted); line-height: 1.4;
}

/* ── Investment disclaimer ───────────────────────────────────── */
.narrative-disclaimer {
  margin-top: 10px; padding: 8px 10px;
  background: rgba(100,116,139,0.06);
  border: 1px solid rgba(100,116,139,0.15);
  border-radius: 6px; font-size: 10px; color: var(--text-muted);
  line-height: 1.5;
}

/* ── Full chart button ───────────────────────────────────────── */
.chart-full-btn {
  width: 100%; margin-top: 10px; padding: 8px 12px;
  background: rgba(34,197,94,0.07); border: 1px solid rgba(34,197,94,0.25);
  border-radius: 8px; color: #4ade80; font-size: 11px; font-weight: 500;
  cursor: pointer; transition: background 0.15s;
  text-align: left;
}
.chart-full-btn:hover { background: rgba(34,197,94,0.13); }

/* ── Historical Scenarios panel ─────────────────────────────── */
.scenarios-panel {
  position: fixed; top: var(--header-h); right: 0;
  width: 420px; max-width: 95vw; bottom: var(--timeline-h);
  background: rgba(8,13,26,0.96); border-left: 1px solid var(--border);
  backdrop-filter: blur(16px); z-index: 355;
  overflow-y: auto; padding: 16px;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
}
.scenarios-panel--open { transform: translateX(0); }
.scenarios-panel::-webkit-scrollbar { width: 4px; }
.scenarios-panel::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.sc-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; font-size: 13px; font-weight: 600;
}
.sc-header button {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 13px; padding: 2px 4px;
  transition: color 0.15s;
}
.sc-header button:hover { color: var(--text); }

.sc-search-wrap {
  position: relative; display: flex; align-items: center;
  margin-bottom: 12px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 7px; overflow: hidden;
  transition: border-color 0.15s;
}
.sc-search-wrap:focus-within { border-color: var(--accent); }
.sc-search-icon {
  padding: 0 8px 0 10px; font-size: 14px; color: var(--text-muted);
  pointer-events: none; flex-shrink: 0; line-height: 1;
}
.sc-search {
  flex: 1; padding: 8px 6px; background: none; border: none;
  color: var(--text); font-size: 12px; font-family: var(--font);
  outline: none;
}
.sc-search::placeholder { color: var(--text-faint); }
.sc-search::-webkit-search-cancel-button { cursor: pointer; }
.sc-search-count {
  padding-right: 10px; font-size: 10px; color: var(--text-muted);
  white-space: nowrap; flex-shrink: 0;
}
.sc-no-results {
  font-size: 11px; color: var(--text-muted);
  text-align: center; padding: 24px 0;
}

.sc-intro {
  font-size: 11px; color: var(--text-muted); line-height: 1.5;
  margin-bottom: 14px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.sc-list { display: flex; flex-direction: column; gap: 10px; }

.sc-card {
  padding: 14px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; transition: border-color 0.2s, background 0.2s;
}
.sc-card:hover { border-color: var(--border2); background: rgba(17,28,53,0.9); }
.sc-card--historical { opacity: 0.7; }
.sc-card--historical:hover { opacity: 0.85; }

.sc-card__header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 7px;
}
.sc-cat-icon { font-size: 13px; flex-shrink: 0; }
.sc-card__dates {
  font-size: 9px; color: var(--text-muted); letter-spacing: 0.05em;
  text-transform: uppercase; flex: 1;
}
.sc-card__title {
  font-family: var(--font-serif); font-size: 14px; font-weight: 700;
  line-height: 1.3; margin-bottom: 8px; color: var(--text);
}
.sc-card__narrative {
  font-size: 11px; color: #94a3b8; line-height: 1.55;
  margin-bottom: 10px;
}
.sc-card__footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; flex-wrap: wrap;
}
.sc-ep-chips {
  display: flex; flex-wrap: wrap; gap: 4px; flex: 1;
}
.sc-ep-chip {
  font-size: 9px; padding: 2px 6px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border2);
  border-radius: 10px; color: var(--text-muted); letter-spacing: 0.03em;
  white-space: nowrap;
}
.sc-jump-btn {
  flex-shrink: 0; padding: 6px 12px; font-size: 11px; font-weight: 600;
  background: rgba(37,99,235,0.12); border: 1px solid rgba(37,99,235,0.35);
  border-radius: 6px; color: var(--accent2); cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.sc-jump-btn:hover { background: rgba(37,99,235,0.22); border-color: rgba(37,99,235,0.55); }
.sc-no-data {
  font-size: 10px; color: var(--text-faint); font-style: italic;
  flex-shrink: 0;
}

/* ── Active scenario banner (left sidebar) ───────────────────── */
.active-scenario-banner {
  padding: 10px 14px; margin: 0;
  background: rgba(37,99,235,0.08);
  border-bottom: 1px solid rgba(37,99,235,0.2);
  border-left: 3px solid var(--accent);
}
.asb-header {
  display: flex; align-items: center; gap: 6px; margin-bottom: 3px;
}
.asb-icon { font-size: 12px; }
.asb-label {
  font-size: 11px; font-weight: 600; color: var(--accent2); flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.asb-close {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 11px; padding: 1px 3px;
  flex-shrink: 0; transition: color 0.15s;
}
.asb-close:hover { color: var(--text); }
.asb-dates { font-size: 9px; color: var(--text-muted); letter-spacing: 0.04em; }
