/* ============================================================
   INVESTIGATION DASHBOARD — DARK MODE EDITORIAL STYLE
   Dark slate backgrounds, high-contrast serif typography
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,400;0,700;1,400;1,700&family=Inter:wght@400;500;600;700&family=Source+Code+Pro:wght@400;600&display=swap');

/* ── BANELYSSAGEN INTEGRATION — Back-link & Brand Overrides ─── */

/* Back-link to main report */
.masthead-back-link {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color 0.15s;
  white-space: nowrap;
}

.masthead-back-link:hover {
  color: var(--red);
}

.masthead-divider {
  color: var(--border-mid);
  margin: 0 4px;
  font-size: 12px;
}

/* Ensure masthead brand stays compact with back-link */
.masthead-brand {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0;
}

/* ── DESIGN TOKENS ──────────────────────────────────────────── */
:root {
  /* Palette — Slate Dark Mode */
  --bg: #020617;
  /* slate-950 */
  --bg2: #0f172a;
  /* slate-900 */
  --bg3: #1e293b;
  /* slate-800 */
  --bg4: #334155;
  /* slate-700 */

  --text: #f1f5f9;
  /* slate-100 */
  --text-dim: #cbd5e1;
  /* slate-300 */
  --text-muted: #94a3b8;
  /* slate-400 */
  --text-faint: #64748b;
  /* slate-500 */

  /* Primary Accent: Danger Red */
  --red: #dc2626;
  /* red-600 */
  --red-mid: #b91c1c;
  /* red-700 */
  --red-light: #ef4444;
  /* red-500 */
  --red-glow: rgba(220, 38, 38, 0.15);

  /* Secondary Accents */
  --navy: #e2e8f0;
  /* slate-200 (changed to light for dark mode contrast) */
  --navy-mid: #94a3b8;
  /* slate-400 */
  --navy-light: rgba(248, 250, 252, 0.05);
  /* very faint white */

  /* Neutral/Category Accents */
  --gold: #f59e0b;
  /* amber-500 */
  --gold-light: rgba(245, 158, 11, 0.15);
  --teal: #14b8a6;
  /* teal-500 */

  /* Borders */
  --border: rgba(255, 255, 255, 0.1);
  /* white/10 */
  --border-mid: rgba(255, 255, 255, 0.2);
  /* white/20 */
  --border-dark: rgba(255, 255, 255, 0.3);
  /* white/30 */
  --divider: rgba(255, 255, 255, 0.1);

  /* Typography */
  --font-serif: 'Merriweather', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, Helvetica, Arial, sans-serif;
  --font-mono: 'Source Code Pro', 'Courier New', monospace;

  /* Layout */
  --sidebar-w: 380px;
  --nav-h: 56px;
  --radius: 4px;
  --radius-lg: 6px;
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.10), 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --transition: all 0.18s ease;
}

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

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

/* ── APP SHELL ──────────────────────────────────────────────── */
#app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── MASTHEAD / NAV ─────────────────────────────────────────── */
#masthead {
  height: var(--nav-h);
  background: var(--bg2);
  border-bottom: 2px solid var(--red);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 0;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* Thin gradient top stripe */
#masthead::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--red) 0%, var(--bg3) 100%);
}

.masthead-brand {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 0.2px;
  white-space: nowrap;
  margin-right: 24px;
  padding-right: 24px;
  border-right: 1px solid var(--border);
  line-height: 1.2;
}

.masthead-brand span {
  display: block;
  font-size: 9px;
  font-family: var(--font-sans);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Nav tabs — editorial section tabs */
nav#main-nav {
  display: flex;
  align-items: stretch;
  height: 100%;
  gap: 0;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-family: var(--font-sans);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: -2px;
  /* overlap the masthead border-bottom */
  white-space: nowrap;
}

.nav-btn svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
  flex-shrink: 0;
}

.nav-btn:hover {
  color: var(--red);
  border-bottom-color: var(--red-light);
}

.nav-btn.active {
  color: var(--text);
  border-bottom-color: var(--red);
  background: rgba(255, 255, 255, 0.03);
}

/* ── FILTER BAR ─────────────────────────────────────────────── */
#filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  flex-shrink: 0;
  overflow-x: auto;
}

.filter-label {
  font-size: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  white-space: nowrap;
  margin-right: 2px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: transparent;
  border: 1px solid var(--border-mid);
  border-radius: 2px;
  color: var(--text-dim);
  font-size: 11px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.85;
}

.filter-chip:hover {
  border-color: var(--red);
  color: var(--red);
}

.filter-chip.active {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-glow);
  font-weight: 600;
}

.filter-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  flex-shrink: 0;
}

.severity-chip {
  font-weight: 600;
}

.sev-critical {
  color: #ef4444;
  /* red-500 */
  border-color: #7f1d1d;
  /* red-900 */
}

.sev-serious {
  color: #f59e0b;
  /* amber-500 */
  border-color: #78350f;
  /* amber-900 */
}

.sev-warning {
  color: #eab308;
  /* yellow-500 */
  border-color: #713f12;
  /* yellow-900 */
}

.sev-info {
  color: #38bdf8;
  /* sky-400 */
  border-color: #0c4a6e;
  /* sky-900 */
}

.actor-select {
  background: var(--bg3);
  border: 1px solid var(--border-mid);
  color: var(--text);
  border-radius: var(--radius);
  padding: 4px 10px;
  font-size: 11px;
  font-family: var(--font-sans);
  cursor: pointer;
  outline: none;
}

.actor-select:focus {
  border-color: var(--navy-mid);
}

.filter-clear {
  padding: 3px 10px;
  background: transparent;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  margin-left: auto;
  transition: var(--transition);
  font-family: var(--font-sans);
}

.filter-clear:hover {
  border-color: var(--red);
  color: var(--red);
}

/* ── MAIN CONTENT AREA ──────────────────────────────────────── */
#content {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
}

/* ── VIEWS ──────────────────────────────────────────────────── */
.view {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: row;
}

.view.active {
  display: flex;
}

/* ── TIMELINE VIEW ──────────────────────────────────────────── */
#view-timeline {
  flex-direction: column;
  background: var(--bg);
}

#timeline-container {
  flex: 1;
  overflow: hidden;
  position: relative;
}

#timeline-svg {
  display: block;
}

/* D3 SVG timeline styles */
.event-node {
  cursor: pointer;
}

.event-circle {
  stroke-width: 1.5px;
  transition: r 0.15s ease, filter 0.15s ease;
}

.event-node:hover .event-circle {
  filter: brightness(0.75);
  stroke-width: 2.5px;
}

.event-node.selected .event-circle {
  stroke-width: 3px;
  filter: drop-shadow(0 0 4px currentColor);
}

.event-label {
  font-size: 10px;
  font-family: var(--font-sans);
  fill: var(--text-dim);
  pointer-events: none;
}

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

@keyframes pulse {
  0% {
    opacity: 0.35;
    r: 14;
  }

  50% {
    opacity: 0.06;
    r: 20;
  }

  100% {
    opacity: 0.35;
    r: 14;
  }
}

.cluster-circle {
  transition: var(--transition);
}

.cluster-text {
  text-anchor: middle;
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  fill: var(--text);
  pointer-events: none;
}

.cluster-label {
  text-anchor: middle;
  font-family: var(--font-sans);
  font-size: 9px;
  fill: var(--text-muted);
  pointer-events: none;
}

/* Zoom controls */
#zoom-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 4px;
  align-items: center;
  z-index: 10;
}

.zoom-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  background: var(--bg2);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.zoom-btn:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-glow);
}

#zoom-label {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  min-width: 38px;
  text-align: center;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px 6px;
}

/* ── EVENT DETAIL DRAWER ────────────────────────────────────── */
#event-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg2);
  border-left: 1px solid var(--border-mid);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.08);
}

#event-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg3);
}

.drawer-header-row1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.drawer-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: var(--bg4);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.drawer-category-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

#drawer-close {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  background: var(--bg2);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

#drawer-close:hover {
  border-color: var(--red);
  color: var(--red);
}

.drawer-severity {
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 7px;
  border-radius: 2px;
  border: 1px solid;
  display: inline-block;
}

/* Severity badges — editorial style */
.sev-badge-critical {
  background: rgba(220, 38, 38, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.sev-badge-serious {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
}

.sev-badge-warning {
  background: rgba(234, 179, 8, 0.15);
  color: #fcd34d;
  border-color: rgba(252, 211, 77, 0.3);
}

.sev-badge-info {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  border-color: rgba(125, 211, 252, 0.3);
}

.drawer-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-top: 6px;
}

.drawer-date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--red);
  margin-top: 4px;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.drawer-section-label {
  font-size: 9px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 5px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 3px;
}

.drawer-description {
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--text);
  line-height: 1.65;
}

/* Quote callout — Politiken editorial pull-quote style */
.quote-callout {
  border-left: 3px solid var(--red);
  padding: 10px 14px;
  background: var(--bg3);
  position: relative;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.quote-callout::before {
  content: '\201C';
  position: absolute;
  top: 2px;
  left: 10px;
  font-size: 32px;
  color: var(--red-light);
  font-family: var(--font-serif);
  line-height: 1;
  opacity: 0.7;
}

.quote-text {
  font-size: 12px;
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--red);
  line-height: 1.6;
  padding-top: 10px;
}

/* Actors list */
.actors-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.actor-tag {
  padding: 3px 9px;
  background: var(--bg3);
  border: 1px solid var(--border-mid);
  border-radius: 2px;
  font-size: 11px;
  font-family: var(--font-sans);
  color: var(--text-dim);
  cursor: pointer;
  transition: var(--transition);
}

.actor-tag:hover {
  border-color: var(--navy-mid);
  color: var(--navy);
  background: var(--navy-light);
}

/* Documents in drawer */
.doc-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.doc-item:hover {
  border-color: var(--navy-mid);
  background: var(--navy-light);
}

.doc-icon {
  width: 26px;
  height: 26px;
  background: var(--bg4);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.doc-title {
  font-size: 11px;
  color: var(--text);
  line-height: 1.4;
  font-family: var(--font-sans);
}

/* Consequence / Legal */
.consequence-box {
  background: rgba(139, 26, 26, 0.05);
  border: 1px solid rgba(139, 26, 26, 0.18);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 12px;
  color: #6b2020;
  line-height: 1.5;
}

.legal-box {
  background: rgba(30, 40, 116, 0.05);
  border: 1px solid rgba(30, 40, 116, 0.18);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 12px;
  color: #1e3070;
  line-height: 1.5;
}

/* ── ACTOR RELATIONSHIP VIEW ────────────────────────────────── */
#view-actors {
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

#actor-controls {
  padding: 10px 16px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.actor-control-label {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.toggle-btn {
  padding: 5px 12px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-dim);
  font-size: 11px;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  gap: 6px;
}

.toggle-btn.active {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-glow);
}

#actor-graph-container {
  flex: 1;
  overflow: hidden;
  position: relative;
  background: var(--bg);
}

#actor-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.actor-node {
  cursor: pointer;
}

.actor-circle {
  stroke-width: 1.5px;
  transition: var(--transition);
}

.actor-node:hover .actor-circle {
  stroke-width: 2.5px;
  filter: brightness(0.85);
}

.actor-node.highlighted .actor-circle {
  stroke: var(--red) !important;
  stroke-width: 2.5px;
}

.actor-name-text {
  font-size: 10px;
  font-family: var(--font-sans);
  fill: var(--text);
  text-anchor: middle;
  pointer-events: none;
}

.graph-edge {
  opacity: 0.5;
  transition: opacity 0.2s;
}

.graph-edge:hover {
  opacity: 1;
}

.edge-label {
  font-size: 9px;
  font-family: var(--font-mono);
  fill: var(--text-muted);
  text-anchor: middle;
}

/* Power overlay */
.power-edge {
  stroke-dasharray: 5, 3;
  animation: dash 1.8s linear infinite;
  stroke-width: 2px;
}

@keyframes dash {
  to {
    stroke-dashoffset: -16;
  }
}

/* Actor legend */
#actor-legend {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.96);
  /* slate-900 */
  backdrop-filter: blur(4px);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-shadow: var(--shadow-sm);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-dim);
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Actor info panel */
#actor-info {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 260px;
  background: var(--bg2);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: none;
  box-shadow: var(--shadow);
}

#actor-info.visible {
  display: block;
}

.actor-info-name {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.actor-info-role {
  font-size: 11px;
  color: var(--red);
  margin-bottom: 6px;
}

.actor-info-detail {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 4px;
}

.actor-info-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 6px;
}

.actor-action-btn {
  flex: 1;
  padding: 5px 8px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-dim);
  font-size: 10px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  font-family: var(--font-sans);
}

.actor-action-btn:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-glow);
}

/* ── DOCUMENT VIEWER ────────────────────────────────────────── */
#view-documents {
  overflow-y: auto;
  padding: 24px;
  gap: 18px;
  flex-wrap: wrap;
  align-content: flex-start;
  background: var(--bg);
}

.doc-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  width: 360px;
  transition: var(--transition);
  cursor: default;
}

.doc-card:hover {
  border-color: var(--border-mid);
  box-shadow: var(--shadow);
}

.doc-card-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg3);
}

.doc-card-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.doc-classified {
  background: rgba(220, 38, 38, 0.15);
  /* red-600 */
}

.doc-partial {
  background: rgba(245, 158, 11, 0.15);
  /* amber-500 */
}

.doc-open {
  background: rgba(56, 189, 248, 0.15);
  /* sky-400 */
}

.doc-card-title {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.classification-stamp {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 7px;
  border-radius: 2px;
  font-size: 9px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
  border: 1px solid;
}

.stamp-classified {
  color: #ef4444;
  /* red-500 */
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(220, 38, 38, 0.1);
}

.stamp-partial {
  color: #fbbf24;
  /* amber-400 */
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(245, 158, 11, 0.1);
}

.stamp-open {
  color: #7dd3fc;
  /* sky-300 */
  border-color: rgba(125, 211, 252, 0.3);
  background: rgba(56, 189, 248, 0.1);
}

.doc-card-body {
  padding: 12px 16px;
}

.doc-significance {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 8px;
  font-family: var(--font-sans);
}

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

.doc-linked-events {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
}

.linked-event-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 10px;
  color: var(--text-dim);
  margin: 2px;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}

.linked-event-chip:hover {
  border-color: var(--navy-mid);
  color: var(--navy);
}

/* ── ACTOR TIMELINE VIEW ────────────────────────────────────── */
#view-actor-timeline {
  overflow: hidden;
  flex-direction: column;
  background: var(--bg);
}

#actor-timeline-controls {
  padding: 12px 20px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.actor-timeline-title {
  font-family: var(--font-serif);
  font-size: 15px;
  color: var(--text);
}

.at-select {
  background: var(--bg3);
  border: 1px solid var(--border-mid);
  color: var(--text);
  border-radius: var(--radius);
  padding: 5px 10px;
  font-size: 12px;
  font-family: var(--font-sans);
  cursor: pointer;
  outline: none;
}

.at-select:focus {
  border-color: var(--navy-mid);
}

#actor-timeline-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
}

.at-actor-header {
  margin-bottom: 24px;
  padding: 16px 20px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  border-left: 4px solid var(--red);
}

.at-actor-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-family: var(--font-serif);
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.at-actor-name {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.at-actor-role {
  font-size: 11px;
  color: var(--red);
  margin-top: 2px;
}

.at-actor-bio {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 5px;
  line-height: 1.5;
}

.at-timeline {
  position: relative;
  padding-left: 28px;
}

.at-timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-mid);
}

.at-event {
  position: relative;
  margin-bottom: 16px;
  cursor: pointer;
}

.at-event::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 12px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-mid);
  border: 2px solid var(--bg);
  transition: var(--transition);
}

.at-event:hover::before {
  background: var(--red);
  transform: scale(1.3);
}

.at-event-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  transition: var(--transition);
}

.at-event:hover .at-event-card {
  border-color: var(--border-mid);
  box-shadow: var(--shadow-sm);
}

.at-event-date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--red);
  margin-bottom: 3px;
}

.at-event-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
  font-family: var(--font-sans);
}

.at-event-desc {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
}

.at-knowledge-note {
  margin-top: 7px;
  padding: 5px 9px;
  background: rgba(139, 105, 20, 0.06);
  border-left: 2px solid var(--gold);
  border-radius: 0 3px 3px 0;
  font-size: 10px;
  color: var(--gold);
  font-style: italic;
}

/* ── CROSS-SECTOR ANALYSIS VIEW ─────────────────────────────── */
#view-cross-sector {
  overflow-y: auto;
  flex-direction: column;
  background: var(--bg);
}

#cross-sector-content {
  padding: 24px;
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cs-header {
  padding: 24px 28px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  border-top: 4px solid var(--red);
}

.cs-label {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--red);
  margin-bottom: 10px;
}

.cs-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin: 0 0 6px;
}

.cs-subtitle {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.6;
  font-family: var(--font-sans);
}

.cs-conclusion {
  background: rgba(20, 184, 166, 0.1);
  /* teal bg */
  border: 1px solid rgba(20, 184, 166, 0.2);
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 11px 14px;
  font-size: 13px;
  color: #ccfbf1;
  /* teal-100 */
  line-height: 1.6;
  font-family: var(--font-sans);
}

.cs-minister-quote {
  border-left-color: var(--red) !important;
}

.cs-quote-attr {
  margin-top: 7px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.cs-section-title {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  margin-top: 4px;
}

/* 5-Step Pattern Grid */
.cs-pattern-grid,
.cs-parallel-grid {
  display: grid;
  grid-template-columns: 200px 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 12px;
  font-family: var(--font-sans);
}

.cs-step-header,
.cs-para-header {
  background: var(--bg3);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
}

.cs-step-num {
  background: var(--bg2);
  padding: 10px 12px;
  color: var(--text-dim);
  font-size: 10px;
  font-family: var(--font-mono);
  line-height: 1.5;
}

.cs-step-num strong {
  display: block;
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--red);
  margin-top: 2px;
}

.cs-step-cell,
.cs-para-cell {
  background: var(--bg2);
  padding: 10px 12px;
  color: var(--text-dim);
  line-height: 1.5;
}

.cs-step-cell.rail,
.cs-para-cell.rail {
  border-left: 2px solid rgba(139, 105, 20, 0.4);
}

.cs-step-cell.avia,
.cs-para-cell.avia {
  border-left: 2px solid rgba(26, 87, 95, 0.4);
}

.cs-para-label {
  background: var(--bg2);
  padding: 10px 12px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-sans);
  line-height: 1.4;
}

/* Structural Causes */
.cs-causes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-cause {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-sans);
}

.cs-cause-num {
  min-width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--red-glow);
  border: 1px solid var(--red-light);
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-serif);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cs-cause-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.cs-cause-detail {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}

/* Timeline Overlap */
.cs-overlap {
  background: var(--bg2);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  overflow: hidden;
  font-family: var(--font-sans);
}

.cs-overlap-header {
  display: grid;
  grid-template-columns: 110px 1fr 1fr;
  padding: 8px 12px;
  background: var(--bg3);
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.cs-overlap-row {
  display: grid;
  grid-template-columns: 110px 1fr 1fr;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
  transition: background 0.12s;
}

.cs-overlap-row:hover {
  background: var(--bg3);
}

.cs-overlap-row:last-child {
  border-bottom: none;
}

.cs-overlap-row.cs-critical-row {
  background: rgba(139, 26, 26, 0.04);
  border-left: 3px solid var(--red);
  color: var(--text);
}

.cs-overlap-row.cs-critical-row:hover {
  background: rgba(139, 26, 26, 0.07);
}

.cs-ovr-date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--red);
  font-weight: 600;
  padding-right: 8px;
}

.cs-ovr-rail {
  color: #6b4400;
  padding-right: 8px;
}

.cs-ovr-avia {
  color: #1a3a5a;
}

.cs-ministerial-note {
  background: rgba(220, 38, 38, 0.1);
  /* red-600 */
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-left: 3px solid var(--red);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 11px 14px;
  font-size: 13px;
  color: #fee2e2;
  /* red-100 */
  line-height: 1.6;
  font-weight: 600;
  font-family: var(--font-sans);
}

.cs-jump-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 24px;
}

.cs-jump-btn {
  padding: 8px 18px;
  background: var(--bg2);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 12px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: var(--transition);
}

.cs-jump-btn:hover {
  border-color: var(--navy-mid);
  color: var(--navy);
  background: var(--navy-light);
}

/* ── TOOLTIPS ────────────────────────────────────────────────── */
#tooltip {
  position: fixed;
  background: var(--bg2);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 11px;
  color: var(--text);
  pointer-events: none;
  z-index: 9999;
  max-width: 240px;
  box-shadow: var(--shadow);
  display: none;
  line-height: 1.5;
  font-family: var(--font-sans);
}

#tooltip.visible {
  display: block;
}

.tooltip-title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
  font-family: var(--font-serif);
}

.tooltip-date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--red);
}

/* ── OPEN QUESTIONS TICKER ───────────────────────────────────── */
#questions-ticker {
  position: fixed;
  bottom: 0;
  left: 0;
  right: var(--sidebar-w);
  height: 30px;
  background: var(--navy);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  overflow: hidden;
  z-index: 200;
  transition: right 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#questions-ticker.drawer-open {
  right: var(--sidebar-w);
}

.ticker-label {
  padding: 0 12px;
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.5);
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  white-space: nowrap;
  flex-shrink: 0;
}

.ticker-track {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 100%;
}

.ticker-inner {
  display: flex;
  position: absolute;
  white-space: nowrap;
  animation: ticker 50s linear infinite;
  align-items: center;
  height: 100%;
}

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

  100% {
    transform: translateX(-100%);
  }
}

.ticker-item {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
  padding: 0 40px 0 0;
  font-family: var(--font-sans);
  font-style: italic;
}

.ticker-item::before {
  content: '· ';
  color: rgba(255, 255, 255, 0.35);
}

/* ── STATS BAR ───────────────────────────────────────────────── */
#stats-bar {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  z-index: 50;
  pointer-events: none;
}

.stat-pill {
  background: var(--bg2);
  border: 1px solid var(--border-mid);
  border-radius: 2px;
  padding: 3px 10px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}

.stat-pill span {
  color: var(--red);
  font-weight: 700;
}

/* ── TRANSITIONS ─────────────────────────────────────────────── */
.fade-enter {
  animation: fadeIn 0.2s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── MISC UTILITIES ──────────────────────────────────────────── */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}