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

:root {
  --bg:          #010407;
  --bg1:         #040c16;
  --bg2:         #071220;
  --bg3:         #0b1a2c;
  --border:      #0d2540;
  --border2:     #183550;
  --border3:     #264a6a;

  --accent:      #00d4ff;
  --accent2:     #0099cc;
  --accent3:     #006699;
  --accent-dim:  rgba(0, 212, 255, 0.1);
  --accent-glow: rgba(0, 212, 255, 0.22);

  --red:         #ff2244;
  --red-dim:     rgba(255, 34, 68, 0.12);
  --red-glow:    rgba(255, 34, 68, 0.28);
  --amber:       #ffaa00;
  --amber-dim:   rgba(255, 170, 0, 0.11);
  --amber-glow:  rgba(255, 170, 0, 0.28);
  --purple:      #a033ff;
  --purple-dim:  rgba(160, 51, 255, 0.11);
  --purple-glow: rgba(160, 51, 255, 0.28);
  --green:       #00ff88;
  --green-dim:   rgba(0, 255, 136, 0.1);
  --green-glow:  rgba(0, 255, 136, 0.28);
  --orange:      #ff7733;
  --orange-dim:  rgba(255, 119, 51, 0.11);
  --orange-glow: rgba(255, 119, 51, 0.28);

  --text:        #b8ccd8;
  --text2:       #5a7f9a;
  --text3:       #1e3346;

  --font-mono:    'JetBrains Mono', monospace;
  --font-display: 'Syne', sans-serif;

  --radius:    3px;
  --radius-lg: 5px;
  --topbar-h:  54px;
  --panel-l:   248px;
  --panel-r:   262px;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
}

/* ── App Grid ──────────────────────────────────────────────────── */
#app {
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-columns: var(--panel-l) 1fr var(--panel-r);
  height: 100vh;
  width: 100%;
}

/* ── Top Bar ───────────────────────────────────────────────────── */
#topbar {
  grid-column: 1 / -1;
  background: linear-gradient(180deg, #06101c 0%, var(--bg1) 100%);
  border-bottom: 1px solid var(--border2);
  box-shadow:
    0 1px 0 rgba(0, 212, 255, 0.07),
    0 4px 24px rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 0;
  z-index: 10;
  position: relative;
}

/* Thin accent glow at the very bottom edge */
#topbar::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 212, 255, 0.25) 20%,
    rgba(0, 212, 255, 0.12) 50%,
    rgba(0, 212, 255, 0.25) 80%,
    transparent 100%
  );
  pointer-events: none;
}

/* ── Top Stats ─────────────────────────────────────────────────── */
.top-stat {
  display: flex;
  flex-direction: column;
  padding: 0 18px;
  border-left: 1px solid var(--border);
  gap: 3px;
  flex-shrink: 0;
}

.top-stat-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}
.top-stat-val.red   { color: var(--red);   text-shadow: 0 0 14px var(--red-glow); }
.top-stat-val.amber { color: var(--amber); text-shadow: 0 0 14px var(--amber-glow); }
.top-stat-val.green { color: var(--green); text-shadow: 0 0 14px var(--green-glow); }
.top-stat-val.accent-dim { color: var(--text2); font-size: 13px; }

.top-stat-lbl {
  font-size: 8.5px;
  color: var(--text3);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: var(--font-display);
  font-weight: 500;
}

/* ── Live Indicator ───────────────────────────────────────────── */
#live-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding-left: 18px;
  border-left: 1px solid var(--border);
  flex-shrink: 0;
}

#live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red), 0 0 18px rgba(255, 34, 68, 0.35);
  animation: pulse-dot 1.4s ease-in-out infinite;
  flex-shrink: 0;
}

#live-label {
  font-size: 10px;
  color: var(--red);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
  font-family: var(--font-display);
}

#clock {
  font-size: 11px;
  color: var(--text2);
  margin-left: 18px;
  padding-left: 18px;
  border-left: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1;   box-shadow: 0 0 8px var(--red), 0 0 18px rgba(255,34,68,0.35); }
  50%       { opacity: 0.3; box-shadow: 0 0 3px var(--red); }
}

/* ── Shortcuts Button ─────────────────────────────────────────── */
#btn-shortcuts {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 14px;
  flex-shrink: 0;
  transition: all 0.15s;
  line-height: 1;
}
#btn-shortcuts:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 10px var(--accent-glow);
}

/* ── Panel Shared ──────────────────────────────────────────────── */
.panel-header {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  position: relative;
  background: linear-gradient(90deg, rgba(0,212,255,0.035) 0%, transparent 50%);
}

.panel-header::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 12px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  opacity: 0.6;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  color: var(--text2);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.panel-header-split { justify-content: space-between; }
.panel-title-sub {
  font-size: 9px;
  color: var(--text3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

/* Badge used on Attack Vectors / Targeted Industries headers */
.av-layer-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--accent2);
  background: var(--accent-dim);
  border: 1px solid rgba(0, 212, 255, 0.18);
  padding: 1px 7px;
  border-radius: 20px;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

/* ── Left Panel ────────────────────────────────────────────────── */
#left {
  background: var(--bg1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}


/* ── Feed List ─────────────────────────────────────────────────── */
#feed-list {
  flex: 1;
  overflow-y: scroll;
  padding: 0;
  scrollbar-width: none;
}
#feed-list::-webkit-scrollbar { display: none; }

/* ── Feed Items ────────────────────────────────────────────────── */
.feed-item {
  padding: 7px 12px 7px 13px;
  border-bottom: 1px solid rgba(13, 37, 64, 0.5);
  cursor: pointer;
  transition: background 0.12s;
  border-left: 3px solid transparent;
}
.feed-item:hover { background: rgba(0, 212, 255, 0.03); }

/* Type-coded left borders */
.feed-item.t-malware-row  { border-left-color: rgba(255, 34, 68, 0.35); }
.feed-item.t-ddos-row     { border-left-color: rgba(255, 170, 0, 0.3); }
.feed-item.t-phishing-row { border-left-color: rgba(160, 51, 255, 0.3); }
.feed-item.t-recon-row    { border-left-color: rgba(0, 212, 255, 0.25); }
.feed-item.t-c2-row       { border-left-color: rgba(0, 255, 136, 0.3); }
.feed-item.t-exploit-row  { border-left-color: rgba(255, 119, 51, 0.3); }

/* Type-coded hover glow */
.feed-item.t-malware-row:hover  { border-left-color: var(--red);    background: rgba(255,34,68,0.04); }
.feed-item.t-ddos-row:hover     { border-left-color: var(--amber);  background: rgba(255,170,0,0.04); }
.feed-item.t-phishing-row:hover { border-left-color: var(--purple); background: rgba(160,51,255,0.04); }
.feed-item.t-recon-row:hover    { border-left-color: var(--accent); background: rgba(0,212,255,0.04); }
.feed-item.t-c2-row:hover       { border-left-color: var(--green);  background: rgba(0,255,136,0.04); }
.feed-item.t-exploit-row:hover  { border-left-color: var(--orange); background: rgba(255,119,51,0.04); }


.fi-top {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
}

.fi-type {
  font-size: 8px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex-shrink: 0;
  border: 1px solid transparent;
}

.fi-src  { font-size: 11px; color: #cce0f0; font-weight: 500; letter-spacing: 0.01em; }
.fi-arr  { font-size: 10px; color: var(--text2); }
.fi-tgt  { font-size: 11px; color: var(--text2); }
.fi-time { font-size: 9px; color: var(--text3); margin-left: auto; flex-shrink: 0; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }

.fi-bot  { display: flex; align-items: center; gap: 6px; }
.fi-ip   { font-size: 10px; color: var(--text3); }

/* Threat type badge colors */
.t-malware  { background: rgba(255,34,68,0.15);  color: #ff6680; border-color: rgba(255,34,68,0.22); }
.t-ddos     { background: rgba(255,170,0,0.15);  color: #ffcc44; border-color: rgba(255,170,0,0.22); }
.t-phishing { background: rgba(160,51,255,0.15); color: #cc77ff; border-color: rgba(160,51,255,0.22); }
.t-recon    { background: rgba(0,212,255,0.12);  color: #55ddff; border-color: rgba(0,212,255,0.18); }
.t-c2       { background: rgba(0,255,136,0.12);  color: #44ffaa; border-color: rgba(0,255,136,0.18); }
.t-exploit  { background: rgba(255,119,51,0.15); color: #ff9944; border-color: rgba(255,119,51,0.22); }

/* Feed item enrichments */
.fi-ip-link {
  font-size: 10px;
  color: var(--text3);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.12s;
}
.fi-ip-link:hover { color: var(--accent); text-decoration: underline; }
.fi-ip-agg { color: var(--text3); font-style: italic; cursor: default; }

.fi-family {
  font-size: 10px;
  color: var(--text3);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: italic;
}

.fi-asn {
  font-size: 9px;
  color: var(--text3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 88px;
  flex-shrink: 1;
  font-style: italic;
}

.d-event-actor {
  font-size: 9px;
  color: var(--amber);
  flex-shrink: 0;
  white-space: nowrap;
}

.fi-src[data-country], .fi-tgt[data-country] { cursor: pointer; }
.fi-src[data-country]:hover { color: var(--accent); }
.fi-tgt[data-country]:hover { color: var(--accent); }

/* ── Map Container ─────────────────────────────────────────────── */
#map-container {
  background: var(--bg);
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
}

#map-svg-wrap {
  position: absolute;
  inset: 0;
}

#map-svg-wrap svg {
  width: 100%;
  height: 100%;
}

#map-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: none;
}

#map-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#map-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 48%, rgba(1, 4, 7, 0.68) 100%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.018) 2px,
      rgba(0, 0, 0, 0.018) 4px
    );
}

/* SVG map styles */
.land {
  fill: #091c2e;
  stroke: #142e46;
  stroke-width: 0.4;
  transition: fill 0.2s;
}
.land:hover { fill: #0d2438; cursor: crosshair; }

.graticule {
  fill: none;
  stroke: #060f1a;
  stroke-width: 0.3;
}

.city-dot {
  fill: rgba(0,212,255,0.2);
  stroke: rgba(0,212,255,0.45);
  stroke-width: 0.5;
  pointer-events: none;
}
.city-dot.hot {
  fill: rgba(255,34,68,0.4);
  stroke: rgba(255,34,68,0.75);
}

/* ── Tooltip ───────────────────────────────────────────────────── */
#tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(3, 9, 16, 0.95);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 10px 13px;
  font-size: 10px;
  color: var(--text);
  display: none;
  z-index: 20;
  min-width: 168px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,212,255,0.06);
}

.tt-country {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: #e4f2ff;
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}
.tt-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--text2);
  margin-bottom: 3px;
  font-size: 10px;
}
.tt-val { color: var(--accent); font-weight: 600; }

/* ── Map Controls ──────────────────────────────────────────────── */
#map-controls {
  position: absolute;
  bottom: 14px;
  left: 14px;
  display: flex;
  gap: 3px;
  background: rgba(3, 9, 16, 0.88);
  padding: 5px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 14px rgba(0,0,0,0.45);
}

#map-controls-right {
  position: absolute;
  bottom: 14px;
  right: 14px;
  display: flex;
  gap: 3px;
  background: rgba(3, 9, 16, 0.88);
  padding: 5px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 14px rgba(0,0,0,0.45);
}

.map-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 5px 11px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text2);
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: all 0.15s;
  text-transform: uppercase;
}
.map-btn:hover  { background: rgba(0,212,255,0.07); border-color: var(--border2); color: var(--text); }
.map-btn.active { background: var(--accent-dim); border-color: rgba(0,212,255,0.28); color: var(--accent); }

/* ── Heatmap legend ────────────────────────────────────────────── */
#heat-legend {
  position: absolute;
  bottom: 58px;
  left: 14px;
  display: flex;
  gap: 14px;
  padding: 5px 11px;
  background: rgba(3, 9, 16, 0.88);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text2);
  letter-spacing: 0.06em;
  backdrop-filter: blur(10px);
}
.hl-item { display: flex; align-items: center; gap: 6px; }
.hl-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.hl-red  { background: radial-gradient(circle, rgba(255,34,68,0.9) 0%, rgba(255,34,68,0.2) 70%);
           box-shadow: 0 0 5px rgba(255,34,68,0.55); }
.hl-cyan { background: radial-gradient(circle, rgba(0,180,255,0.9) 0%, rgba(0,180,255,0.2) 70%);
           box-shadow: 0 0 5px rgba(0,180,255,0.55); }

/* ── Right Panel ───────────────────────────────────────────────── */
#right {
  background: var(--bg1);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* ── Stats Grid ────────────────────────────────────────────────── */
#stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.stat-cell     { padding: 12px 14px; background: var(--bg1); }
.stat-cell.alt { background: var(--bg); }

.stat-num {
  font-size: 24px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--accent);
  line-height: 1;
  transition: color 0.3s ease;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-num.red    { color: var(--red);    text-shadow: 0 0 18px var(--red-glow); }
.stat-num.amber  { color: var(--amber);  text-shadow: 0 0 18px var(--amber-glow); }
.stat-num.purple { color: var(--purple); text-shadow: 0 0 18px var(--purple-glow); }
.stat-num.green  { color: var(--green);  text-shadow: 0 0 18px var(--green-glow); }

.stat-lbl {
  font-size: 8.5px;
  color: var(--text3);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-top: 4px;
  font-family: var(--font-display);
  font-weight: 600;
}

/* ── Leaderboards ─────────────────────────────────────────────── */
#attackers, #targets {
  overflow-y: auto;
  max-height: 155px;
  padding: 3px 0;
  flex-shrink: 0;
}

.attacker-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-bottom: 1px solid rgba(13,37,64,0.35);
  transition: background 0.12s;
}
.attacker-row:hover { background: rgba(0,212,255,0.025); }

.att-rank {
  font-size: 9px;
  color: var(--text3);
  width: 14px;
  text-align: right;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.att-flag    { font-size: 13px; width: 20px; flex-shrink: 0; line-height: 1; }
.att-country {
  font-size: 11px;
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.att-bar-wrap { width: 44px; height: 4px; background: var(--bg3); border-radius: 2px; flex-shrink: 0; overflow: hidden; }
.att-bar  { height: 4px; border-radius: 2px; background: linear-gradient(90deg, #cc1133, var(--red)); transition: width 0.6s ease; }
.tgt-bar  { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--accent2), var(--accent)); transition: width 0.5s ease; }

.att-count { font-size: 10px; color: var(--red);    width: 28px; text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.tgt-count { font-size: 10px; color: var(--accent); width: 28px; text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; }

/* ── Breakdown Bars ────────────────────────────────────────────── */
.bd-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.bd-label { font-size: 10px; color: var(--text2); width: 68px; flex-shrink: 0; }
.bd-track { flex: 1; height: 4px; background: var(--bg3); border-radius: 2px; overflow: hidden; }
.bd-fill  { height: 4px; width: 0%; border-radius: 2px; transition: width 0.6s ease; }
.bd-pct   { font-size: 10px; width: 32px; text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.bd-pct.red    { color: var(--red); }
.bd-pct.amber  { color: var(--amber); }
.bd-pct.purple { color: var(--purple); }
.bd-pct.accent { color: var(--accent); }
.bd-pct.green  { color: var(--green); }
.bd-pct.orange { color: var(--orange); }

/* ── Timeline ──────────────────────────────────────────────────── */
#timeline-wrap {
  padding: 8px 14px 10px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.timeline-label {
  font-size: 8.5px;
  color: var(--text3);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-family: var(--font-display);
  font-weight: 700;
  margin-bottom: 6px;
}

#timeline-canvas {
  display: block;
  width: 100%;
  height: 54px;
  border-radius: 2px;
}

/* ── Attack Vectors & Industries ───────────────────────────────── */
#attack-vectors,
#targeted-industries {
  padding: 6px 14px 10px;
  flex-shrink: 0;
}

.av-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.av-label {
  font-size: 10px;
  color: var(--text2);
  min-width: 96px;
  max-width: 96px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.av-pct {
  font-size: 10px;
  color: var(--text2);
  min-width: 28px;
  text-align: right;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* ── Theater / Focus Mode ──────────────────────────────────────── */
#left, #right { min-width: 0; }
#app { transition: grid-template-columns 0.32s ease; }
#app.theater { grid-template-columns: 0px 1fr 0px; }

/* ── Globe Mode ────────────────────────────────────────────────── */
#map-container.globe-mode { cursor: grab; }
#map-container.globe-mode:active { cursor: grabbing; }

/* ── Fullscreen ────────────────────────────────────────────────── */
:fullscreen #app,
:-webkit-full-screen #app { height: 100vh; }
:fullscreen,
:-webkit-full-screen { background: var(--bg); }

/* ── Scrollbars ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent2); }

/* ── Country Drawer ────────────────────────────────────────────── */
#country-drawer {
  position: absolute;
  top: 0;
  right: -360px;
  width: 320px;
  height: 100%;
  background: rgba(2, 7, 12, 0.97);
  border-left: 1px solid var(--border2);
  z-index: 30;
  transition: right 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(14px);
  box-shadow: -8px 0 28px rgba(0, 0, 0, 0.55);
}
#country-drawer.open { right: 0; }

#d-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: linear-gradient(90deg, rgba(0,212,255,0.05) 0%, transparent 60%);
  position: relative;
}
#d-header::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  opacity: 0.5;
}

#d-flag { font-size: 22px; line-height: 1; }
#d-cname {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: #e8f4ff;
  flex: 1;
  letter-spacing: 0.04em;
}
#d-close {
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text2);
  font-size: 11px;
  padding: 4px 8px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  line-height: 1;
}
#d-close:hover { border-color: var(--red); color: var(--red); background: rgba(255,34,68,0.08); }

#d-stats-row {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.d-stat {
  flex: 1;
  padding: 12px 14px;
  border-right: 1px solid var(--border);
  text-align: center;
}
.d-stat:last-child { border-right: none; }

.d-stat-val {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.d-stat-val.red  { color: var(--red);    text-shadow: 0 0 14px var(--red-glow); }
.d-stat-val.cyan { color: var(--accent); text-shadow: 0 0 14px var(--accent-glow); }
.d-stat-lbl {
  font-size: 8px;
  color: var(--text3);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-top: 4px;
  font-family: var(--font-display);
  font-weight: 600;
}

.d-section-title {
  font-family: var(--font-display);
  font-size: 8.5px;
  font-weight: 700;
  color: var(--text3);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 9px 14px 5px;
  flex-shrink: 0;
}

#d-breakdown { padding: 0 14px 8px; flex-shrink: 0; }

#d-targets, #d-sources { flex-shrink: 0; }

.d-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-bottom: 1px solid rgba(13,37,64,0.3);
  transition: background 0.12s;
}
.d-row:hover { background: rgba(0,212,255,0.03); }
.d-row-flag    { font-size: 12px; width: 20px; flex-shrink: 0; }
.d-row-country { font-size: 11px; color: var(--text); flex: 1; }
.d-row-count   { font-size: 10px; color: var(--text2); font-variant-numeric: tabular-nums; }

#d-events { flex: 1; overflow-y: auto; }

.d-event {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-bottom: 1px solid rgba(13,37,64,0.25);
  flex-wrap: nowrap;
  overflow: hidden;
  transition: background 0.12s;
}
.d-event:hover { background: rgba(0,212,255,0.03); }
.d-event .fi-type   { flex-shrink: 0; }
.d-event-dir        { font-size: 11px; color: var(--text3); flex-shrink: 0; }
.d-event-peer       { font-size: 11px; color: var(--text2); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-event-first      { font-size: 9px; color: var(--text3); flex-shrink: 0; }

.d-empty { font-size: 11px; color: var(--text3); padding: 10px 14px; font-style: italic; }

/* ── Keyboard Shortcuts Modal ──────────────────────────────────── */
#shortcuts-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(1, 4, 7, 0.85);
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(7px);
}
#shortcuts-modal.open { display: flex; }

#shortcuts-box {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  min-width: 320px;
  box-shadow:
    0 0 60px rgba(0, 212, 255, 0.07),
    0 20px 50px rgba(0, 0, 0, 0.65);
}

.sc-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.sc-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px 16px;
  align-items: center;
}

kbd {
  font-family: var(--font-mono);
  font-size: 9px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-bottom-width: 2px;
  border-radius: var(--radius);
  padding: 3px 8px;
  color: var(--accent);
  text-align: center;
  white-space: nowrap;
  justify-self: start;
  letter-spacing: 0.06em;
}

.sc-grid span {
  font-size: 11px;
  color: var(--text2);
}

.sc-close {
  font-size: 8.5px;
  color: var(--text3);
  margin-top: 16px;
  text-align: center;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
