/* observatory.css - the 1 August 2026 viewer's styles, copied verbatim (line endings LF) from
 * URSY Observatory: the 1 August 2026 observatory stylesheet (Lee), unchanged.
 * Web additions are in observatory-web.css, never here. */
:root {
  --bg-0: #04060c;
  --bg-1: #0a0f1c;
  --bg-2: #121a2e;
  --panel: rgba(15, 22, 38, 0.78);
  --panel-border: rgba(120, 145, 200, 0.18);
  --ink-0: #f1f5f9;
  --ink-1: #c5cee0;
  --ink-2: #8595b3;
  --ink-3: #525f7a;
  --accent: #38bdf8;
  --highlight: #fbbf24;
  --good: #34d399;
  --warn: #f59e0b;
  --bad:  #f87171;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg-0); color: var(--ink-0); overflow: hidden; }
body {
  background:
    radial-gradient(ellipse at 50% 45%, #11192e 0%, #060912 60%, #02040a 100%);
  font-size: 13px;
  line-height: 1.45;
}

.app {
  display: grid;
  grid-template-columns: 360px 1fr 380px;
  grid-template-rows: 56px auto 1fr;
  height: 100vh;
  gap: 1px;
}

header {
  grid-column: 1 / -1;
  background: linear-gradient(180deg, rgba(10,15,28,0.95), rgba(10,15,28,0.6));
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 18px;
  backdrop-filter: blur(12px);
}
header h1 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.5px;
  color: var(--ink-0);
}
header h1 .accent { color: var(--accent); }
header .meta {
  font-size: 11px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
header .stats {
  margin-left: auto;
  display: flex;
  gap: 18px;
  font-size: 11px;
  color: var(--ink-1);
}
header .stats .stat {
  display: flex; flex-direction: column; align-items: flex-end;
}
header .stats .stat b {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-0);
  font-variant-numeric: tabular-nums;
}
header .stats .stat span {
  color: var(--ink-3);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

aside.left, aside.right {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-top: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
aside.left { border-left: none; }
aside.right { border-right: none; }

.panel-head {
  padding: 12px 14px 10px 14px;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-head h2 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-2);
  font-weight: 600;
  margin: 0;
}
.panel-head .count {
  font-size: 11px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.filters {
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--panel-border);
}
.chip {
  font-size: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--ink-1);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.chip:hover { background: rgba(255,255,255,0.08); }
.chip.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.5);
  color: var(--ink-0);
}
.chip .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.visit-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}
.visit-list::-webkit-scrollbar { width: 6px; }
.visit-list::-webkit-scrollbar-track { background: transparent; }
.visit-list::-webkit-scrollbar-thumb { background: rgba(120,140,180,0.2); border-radius: 3px; }

.visit-row {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(120, 140, 180, 0.06);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: background 0.12s;
}
.visit-row:hover { background: rgba(255,255,255,0.025); }
.visit-row.active { background: rgba(56,189,248,0.10); border-left: 3px solid var(--accent); padding-left: 11px; }

.visit-num {
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  color: var(--ink-3);
  font-weight: 600;
  min-width: 32px;
  text-align: right;
  margin-top: 4px;
}

.visit-swatch {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}

.intent-chip {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 4px;
}

.identity-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(245, 158, 11, 0.12);
  color: var(--warn);
  border: 1px solid rgba(245, 158, 11, 0.25);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 600;
}
.identity-chip.verified {
  background: rgba(52, 211, 153, 0.15);
  color: var(--good);
  border-color: rgba(52, 211, 153, 0.4);
}
.identity-chip.unknown {
  background: rgba(100, 116, 139, 0.15);
  color: var(--ink-2);
  border-color: rgba(100, 116, 139, 0.3);
}
.identity-chip .shield { font-size: 10px; line-height: 1; }

.session-chip {
  display: inline-block;
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 600;
}
.session-chip.high   { background: rgba(52, 211, 153, 0.15); color: var(--good); }
.session-chip.medium { background: rgba(245, 158, 11, 0.15); color: var(--warn); }
.session-chip.low    { background: rgba(248, 113, 113, 0.15); color: var(--bad); }

.daily-story {
  grid-column: 1 / -1;
  background: rgba(56, 189, 248, 0.04);
  border-bottom: 1px solid var(--panel-border);
  padding: 8px 18px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-1);
  display: flex;
  align-items: center;
  gap: 12px;
}
.daily-story .ds-icon {
  color: var(--accent);
  flex-shrink: 0;
  font-size: 13px;
}

.question-buttons {
  padding: 6px 12px 4px;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  background: rgba(0,0,0,0.12);
}
.question-buttons .qb {
  font-size: 10px;
  padding: 4px 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--ink-1);
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.question-buttons .qb:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--ink-0);
}
.question-buttons .qb.active {
  background: rgba(56, 189, 248, 0.20);
  border-color: rgba(56, 189, 248, 0.6);
  color: var(--ink-0);
}

.what-happened {
  background: rgba(56, 189, 248, 0.07);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 5px;
  padding: 10px 12px;
  margin: 0 0 14px 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-0);
}
.what-happened .wh-title {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 4px;
  font-weight: 700;
}

.credibility-block {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 4px;
  padding: 8px 10px;
  margin: 0 0 14px 0;
  font-size: 10.5px;
}
.credibility-block .cb-line {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
  align-items: flex-start;
}
.credibility-block .cb-line:last-child { margin-bottom: 0; }
.credibility-block .cb-label {
  font-size: 9px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  min-width: 70px;
  flex-shrink: 0;
  padding-top: 1px;
}
.credibility-block .cb-value {
  color: var(--ink-1);
  flex: 1;
}

.dq-section {
  margin-bottom: 14px;
}
.dq-section h4 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-3);
  margin: 0 0 6px 0;
  font-weight: 600;
}
.dq-section ul {
  margin: 0;
  padding: 0 0 0 16px;
  font-size: 11px;
  color: var(--ink-1);
  line-height: 1.55;
}
.dq-section ul li { margin-bottom: 2px; }
.dq-section p {
  margin: 0;
  font-size: 11px;
  color: var(--ink-1);
  line-height: 1.55;
}

body.screenshot-safe .ss-mask {
  filter: blur(6px);
  user-select: none;
  pointer-events: none;
}
body.screenshot-safe .ss-watermark {
  position: fixed;
  bottom: 8px;
  right: 12px;
  background: rgba(0,0,0,0.6);
  color: var(--ink-2);
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 3px;
  z-index: 1000;
  pointer-events: none;
  letter-spacing: 0.5px;
}
.ss-watermark { display: none; }
body.screenshot-safe .ss-watermark { display: block; }

/* ============ LIVE MODE ============ */

.mode-toggle {
  display: inline-flex;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  overflow: hidden;
}
.mode-toggle .mt {
  font-size: 10px;
  padding: 5px 12px;
  cursor: pointer;
  color: var(--ink-2);
  background: transparent;
  border: none;
  font-family: inherit;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  font-weight: 600;
  transition: all 0.15s;
}
.mode-toggle .mt.active {
  background: rgba(56, 189, 248, 0.18);
  color: var(--ink-0);
}
.mode-toggle .mt.live.active {
  background: rgba(239, 68, 68, 0.18);
  color: #ff6e6e;
  position: relative;
}
.mode-toggle .mt.live.active::before {
  content: '●';
  margin-right: 5px;
  animation: live-pulse 1.4s infinite;
}
.mode-toggle .mt.replay.active {
  background: rgba(168, 85, 247, 0.20);
  color: #c084fc;
}
.mode-toggle .mt.replay.active::before {
  content: '▶';
  margin-right: 5px;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* Hide historical/live UI in replay mode; hide replay UI in others */
body.mode-historical .live-only,
body.mode-historical .replay-only,
body.mode-live .replay-only,
body.mode-live .historical-only,
body.mode-replay .historical-only,
body.mode-replay .live-only         { display: none !important; }

/* Replay transport bar — shown below header, replaces live status strip */
.replay-transport {
  grid-column: 1 / -1;
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.06), transparent);
  border-bottom: 1px solid var(--panel-border);
  padding: 6px 18px;
  font-size: 11px;
  color: var(--ink-1);
  display: flex;
  align-items: center;
  gap: 14px;
  font-variant-numeric: tabular-nums;
}
.replay-transport .rt-btn {
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.30);
  color: var(--ink-0);
  padding: 4px 12px;
  border-radius: 3px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}
.replay-transport .rt-btn:hover { background: rgba(168, 85, 247, 0.22); }
.replay-transport .rt-btn.playing { color: #c084fc; }
.replay-transport .rt-clock {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-0);
  letter-spacing: 0.5px;
}
.replay-transport .rt-daytime {
  color: var(--ink-2);
  font-family: ui-monospace, monospace;
  font-size: 11px;
}
.replay-transport .rt-scrub {
  flex: 1;
  height: 8px;
  background: rgba(120, 140, 180, 0.12);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  margin: 0 12px;
}
.replay-transport .rt-scrub .fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.6), rgba(168, 85, 247, 0.9));
  border-radius: 4px;
  pointer-events: none;
}
.replay-transport .rt-scrub .density {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  opacity: 0.4;
}
.replay-transport .rt-stats {
  display: inline-flex; gap: 12px;
  color: var(--ink-2); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.6px;
}

/* Replay ready overlay */
.replay-ready-banner {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #c084fc;
  padding: 6px 14px;
  border-radius: 3px;
  font-size: 11px;
  letter-spacing: 0.6px;
  font-weight: 600;
  text-transform: uppercase;
  z-index: 12;
  backdrop-filter: blur(8px);
}

/* Lane pill colors in commentary feed (replay mode) */
.commentary-feed .cf-line .trigger-pill.lane-event   { background: rgba(239, 68, 68, 0.20); color: #ff8888; }
.commentary-feed .cf-line .trigger-pill.lane-ongoing { background: rgba(245, 158, 11, 0.20); color: #fbbf24; }
.commentary-feed .cf-line .trigger-pill.lane-estate  { background: rgba(56, 189, 248, 0.15); color: #7dd3fc; }
.commentary-feed .cf-line .trigger-pill.lane-pattern { background: rgba(168, 85, 247, 0.20); color: #c084fc; }
.commentary-feed .cf-line .trigger-pill.lane-family  { background: rgba(52, 211, 153, 0.15); color: #6ee7b7; }
.commentary-feed .cf-line .trigger-pill.lane-stop    { background: rgba(96, 165, 250, 0.20); color: #93c5fd; }
.commentary-feed .cf-line .trigger-pill.lane-loot    { background: rgba(52, 211, 153, 0.18); color: #6ee7b7; }
.commentary-feed .cf-line .trigger-pill.lane-edge    { background: rgba(192, 132, 252, 0.18); color: #d8b4fe; }
.commentary-feed .cf-line .trigger-pill.lane-arrival { background: rgba(34, 211, 238, 0.18); color: #67e8f9; }

/* ============================================================ */
/* Per-visit replay player — additive sub-mode of historical    */
/* ============================================================ */

/* Visibility gates: .vra-only is shown only when body has .visit-replay-active */
.vra-only { display: none !important; }
body.visit-replay-active .vra-only { display: flex !important; }
body.visit-replay-active .vra-block { display: block !important; }
/* Dim the historical-only chrome we're temporarily co-opting */
body.visit-replay-active .daily-story,
body.visit-replay-active .question-buttons,
body.visit-replay-active .filters,
body.visit-replay-active .pagination     { opacity: 0.35; pointer-events: none; }
body.visit-replay-active .timeline-strip { display: none !important; }

/* Replay-this-visit button in the detail panel */
.visit-replay-launch {
  margin: 12px 0 4px 0;
  background: linear-gradient(180deg, rgba(192, 132, 252, 0.20), rgba(168, 85, 247, 0.10));
  border: 1px solid rgba(192, 132, 252, 0.45);
  color: #f5d0fe;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  letter-spacing: 0.4px;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.12s ease, transform 0.04s ease;
}
.visit-replay-launch:hover { background: linear-gradient(180deg, rgba(192, 132, 252, 0.30), rgba(168, 85, 247, 0.18)); }
.visit-replay-launch:active { transform: translateY(1px); }
.visit-replay-launch .vrl-hint { color: rgba(245, 208, 254, 0.65); font-weight: 400; font-size: 11px; }
.visit-replay-launch[disabled] { opacity: 0.5; cursor: not-allowed; }

/* Visit-replay transport bar (shares header geometry with .replay-transport) */
.visit-transport {
  grid-column: 1 / -1;
  background: linear-gradient(180deg, rgba(192, 132, 252, 0.10), transparent);
  border-bottom: 1px solid rgba(192, 132, 252, 0.30);
  padding: 8px 18px;
  font-size: 11px;
  color: var(--ink-1);
  align-items: center;
  gap: 14px;
  font-variant-numeric: tabular-nums;
}
.visit-transport .vt-title {
  font-weight: 700; color: #e9d5ff;
  font-size: 12px; letter-spacing: 0.6px; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 8px;
  min-width: 0;
}
.visit-transport .vt-title .vt-swatch {
  width: 10px; height: 10px; border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}
.visit-transport .vt-btn {
  background: rgba(192, 132, 252, 0.12);
  border: 1px solid rgba(192, 132, 252, 0.40);
  color: var(--ink-0);
  padding: 4px 12px;
  border-radius: 3px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}
.visit-transport .vt-btn:hover  { background: rgba(192, 132, 252, 0.24); }
.visit-transport .vt-btn.danger { color: #fda4af; border-color: rgba(244, 114, 182, 0.4); }
.visit-transport .vt-clock {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 13px; font-weight: 600; color: var(--ink-0); letter-spacing: 0.5px;
}
.visit-transport .vt-scrub {
  flex: 1; height: 8px;
  background: rgba(120, 140, 180, 0.12);
  border: 1px solid var(--panel-border);
  border-radius: 4px; cursor: pointer; position: relative;
  margin: 0 12px;
}
.visit-transport .vt-scrub .fill {
  position: absolute; top: 0; left: 0; height: 100%;
  background: linear-gradient(90deg, rgba(192, 132, 252, 0.55), rgba(192, 132, 252, 0.95));
  border-radius: 4px; pointer-events: none;
}
.visit-transport .vt-scrub .ticks {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
}
.visit-transport .vt-scrub .ticks .tick {
  position: absolute; top: -2px; bottom: -2px; width: 2px;
  background: rgba(192, 132, 252, 0.55);
  border-radius: 1px;
}
.visit-transport .vt-stats {
  display: inline-flex; gap: 12px;
  color: var(--ink-2); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.6px;
}
.visit-transport .vt-speed {
  display: inline-flex; gap: 4px; align-items: center;
}
.visit-transport .vt-speed select {
  background: rgba(20, 26, 44, 0.7); color: var(--ink-0);
  border: 1px solid var(--panel-border);
  border-radius: 3px; padding: 2px 4px; font-size: 11px;
  font-family: inherit;
}

/* Loot / ingestion HUD — bottom-right corner of canvas */
.loot-hud {
  position: absolute;
  right: 16px; bottom: 16px;
  width: 270px;
  background: rgba(8, 12, 24, 0.86);
  border: 1px solid rgba(192, 132, 252, 0.35);
  border-radius: 8px;
  padding: 12px 14px;
  z-index: 14;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  color: var(--ink-1);
  font-size: 11px;
  display: none;
}
body.visit-replay-active .loot-hud { display: block; }
.loot-hud .lh-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.loot-hud .lh-title {
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #d8b4fe;
  font-size: 10px;
  font-weight: 700;
}
.loot-hud .lh-stop {
  color: var(--ink-2);
  font-family: ui-monospace, monospace;
  font-size: 10px;
}
.loot-hud .lh-where {
  color: var(--ink-0);
  font-family: ui-monospace, monospace;
  font-size: 11px;
  word-break: break-all;
  margin-bottom: 8px;
  padding: 4px 6px;
  background: rgba(192, 132, 252, 0.06);
  border-left: 2px solid rgba(192, 132, 252, 0.5);
  border-radius: 0 3px 3px 0;
  max-height: 36px;
  overflow: hidden;
}
.loot-hud .lh-rows {
  display: grid;
  gap: 5px;
}
.loot-hud .lh-row {
  display: grid;
  grid-template-columns: 60px 1fr 40px;
  gap: 8px;
  align-items: center;
  font-size: 11px;
}
.loot-hud .lh-row .lh-label {
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 9px;
  font-weight: 700;
}
.loot-hud .lh-row .lh-bar {
  position: relative;
  height: 8px;
  background: rgba(120, 140, 180, 0.10);
  border-radius: 4px;
  overflow: hidden;
}
.loot-hud .lh-row .lh-bar .lh-fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  background: linear-gradient(90deg, rgba(192, 132, 252, 0.5), rgba(192, 132, 252, 0.9));
  border-radius: 4px;
  transition: width 0.2s ease;
}
.loot-hud .lh-row.kind-image .lh-bar .lh-fill   { background: linear-gradient(90deg, rgba(96, 165, 250, 0.55), rgba(96, 165, 250, 0.95)); }
.loot-hud .lh-row.kind-style .lh-bar .lh-fill   { background: linear-gradient(90deg, rgba(34, 197, 94, 0.55),  rgba(34, 197, 94, 0.95)); }
.loot-hud .lh-row.kind-script .lh-bar .lh-fill  { background: linear-gradient(90deg, rgba(251, 191, 36, 0.55), rgba(251, 191, 36, 0.95)); }
.loot-hud .lh-row.kind-font .lh-bar .lh-fill    { background: linear-gradient(90deg, rgba(192, 132, 252, 0.55), rgba(192, 132, 252, 0.95)); }
.loot-hud .lh-row.kind-citations .lh-bar .lh-fill { background: linear-gradient(90deg, rgba(251, 191, 36, 0.6),  rgba(245, 158, 11, 0.95)); }
.loot-hud .lh-row.kind-blocked .lh-bar .lh-fill { background: linear-gradient(90deg, rgba(248, 113, 113, 0.6),  rgba(239, 68, 68, 0.95)); }
.loot-hud .lh-row .lh-count {
  text-align: right;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-0);
}
.loot-hud .lh-empty {
  color: var(--ink-3);
  font-style: italic;
  font-size: 11px;
  text-align: center;
  padding: 12px 0;
}
.loot-hud .lh-totals {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--panel-border);
  display: flex;
  justify-content: space-between;
  color: var(--ink-2);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.loot-hud .lh-totals b { color: #e9d5ff; font-weight: 700; }

/* "In flight" badge above the current edge */
.in-flight-badge {
  position: absolute;
  pointer-events: none;
  background: rgba(192, 132, 252, 0.92);
  color: #1a0626;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px rgba(192, 132, 252, 0.6);
  z-index: 13;
  display: none;
}
body.visit-replay-active .in-flight-badge.active { display: block; }

/* Commentary feed visibility in visit-replay (reuses historical position) */
body.visit-replay-active #visit-replay-commentary-feed { display: block; }

/* ============================================================ */
/* CINEMA MODE — engaged when the user presses Play in a visit. */
/* Collapses the left list + top chrome; right panel stays.     */
/* The map gets the whole expanded canvas to breathe.           */
/* ============================================================ */
body.visit-replay-cinema header,
body.visit-replay-cinema .daily-story,
body.visit-replay-cinema aside.left {
  display: none !important;
}
body.visit-replay-cinema .app {
  /* Two-column layout instead of three: only map + right panel */
  grid-template-columns: 1fr 380px !important;
  grid-template-rows: auto 1fr !important;
}
body.visit-replay-cinema .visit-transport {
  /* Transport bar slides up to occupy the top row */
  grid-column: 1 / -1 !important;
  border-top: none !important;
  background: linear-gradient(180deg, rgba(192, 132, 252, 0.18), rgba(168, 85, 247, 0.04)) !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}
body.visit-replay-cinema .loot-hud {
  /* Loot panel moves to a discreet corner over the bigger map */
  right: 16px;
  bottom: 16px;
}
body.visit-replay-cinema #visit-replay-commentary-feed {
  /* Commentary spreads across the bottom of the wider canvas */
  max-width: 60%;
  bottom: 16px;
  left: 16px;
}
.cinema-restore-pill {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 20;
  background: rgba(20, 26, 44, 0.75);
  border: 1px solid var(--panel-border);
  color: var(--ink-1);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  display: none;
  letter-spacing: 0.5px;
  backdrop-filter: blur(6px);
}
body.visit-replay-cinema .cinema-restore-pill { display: block; }
.cinema-restore-pill:hover { background: rgba(168, 85, 247, 0.18); border-color: rgba(168, 85, 247, 0.4); }

/* Region-island labels and tiles (drawn in JS, but text style here) */
body.visit-replay-active .map-legend,
body.visit-replay-cinema  .map-legend {
  /* Legend less important in replay — push down + dim */
  opacity: 0.55;
  font-size: 9.5px;
}

/* ============================================================ */
/* CINEMA RIGHT PANEL — replaces the static detail card when    */
/* cinema mode is on, becomes the live play-by-play feed.        */
/* ============================================================ */
.visit-cinema-panel { display: none; }
body.visit-replay-cinema #right-content,
body.visit-replay-cinema .tab-row { display: none !important; }
body.visit-replay-cinema .visit-cinema-panel {
  display: flex !important;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  padding: 0;
  background: linear-gradient(180deg, rgba(192, 132, 252, 0.06), transparent 40%);
}
.visit-cinema-panel .vcp-head {
  padding: 14px 16px 10px 16px;
  border-bottom: 1px solid var(--panel-border);
}
.visit-cinema-panel .vcp-actor {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 700; color: #f5d0fe;
  letter-spacing: 0.4px;
}
.visit-cinema-panel .vcp-swatch {
  width: 11px; height: 11px; border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
  flex-shrink: 0;
}
.visit-cinema-panel .vcp-meta {
  color: var(--ink-2);
  font-size: 11px;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.visit-cinema-panel .vcp-step-card {
  padding: 12px 16px;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(192, 132, 252, 0.04);
}
.visit-cinema-panel .vcp-step-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.visit-cinema-panel .vcp-step-num {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: var(--ink-1);
  font-weight: 700;
  letter-spacing: 0.5px;
}
.visit-cinema-panel .vcp-phase-chip {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding: 3px 8px;
  border-radius: 3px;
  background: rgba(192, 132, 252, 0.2);
  color: #e9d5ff;
}
.visit-cinema-panel .vcp-phase-chip.dwell  { background: rgba(34, 211, 238, 0.18); color: #67e8f9; }
.visit-cinema-panel .vcp-phase-chip.flight { background: rgba(192, 132, 252, 0.20); color: #d8b4fe; }
.visit-cinema-panel .vcp-phase-chip.ended  { background: rgba(52, 211, 153, 0.18); color: #6ee7b7; }
.visit-cinema-panel .vcp-where {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: var(--ink-0);
  word-break: break-all;
  margin-bottom: 6px;
  line-height: 1.4;
}
.visit-cinema-panel .vcp-region {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--ink-2);
  margin-bottom: 8px;
}
.visit-cinema-panel .vcp-step-bar {
  height: 4px;
  background: rgba(120, 140, 180, 0.12);
  border-radius: 2px;
  overflow: hidden;
}
.visit-cinema-panel .vcp-step-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(192, 132, 252, 0.5), rgba(192, 132, 252, 0.9));
  border-radius: 2px;
  transition: width 0.15s ease;
}
.visit-cinema-panel .vcp-loot {
  padding: 12px 16px;
  border-bottom: 1px solid var(--panel-border);
}
.visit-cinema-panel .vcp-section-title {
  text-transform: uppercase;
  letter-spacing: 0.7px;
  font-size: 10px;
  color: #d8b4fe;
  font-weight: 700;
  margin-bottom: 8px;
}
.visit-cinema-panel #vcp-loot-rows {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.visit-cinema-panel .vcp-loot-row {
  display: grid;
  grid-template-columns: 70px 1fr 50px;
  gap: 8px;
  align-items: center;
  font-size: 11px;
}
.visit-cinema-panel .vcp-loot-row .vcp-loot-label {
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 9.5px;
  font-weight: 700;
}
.visit-cinema-panel .vcp-loot-row .vcp-loot-bar {
  position: relative;
  height: 8px;
  background: rgba(120, 140, 180, 0.10);
  border-radius: 4px;
  overflow: hidden;
}
.visit-cinema-panel .vcp-loot-row .vcp-loot-fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  border-radius: 4px;
  transition: width 0.2s ease;
}
.visit-cinema-panel .vcp-loot-row.kind-image .vcp-loot-fill     { background: linear-gradient(90deg, rgba(96, 165, 250, 0.55), rgba(96, 165, 250, 0.95)); }
.visit-cinema-panel .vcp-loot-row.kind-style .vcp-loot-fill     { background: linear-gradient(90deg, rgba(34, 197, 94, 0.55),  rgba(34, 197, 94, 0.95)); }
.visit-cinema-panel .vcp-loot-row.kind-script .vcp-loot-fill    { background: linear-gradient(90deg, rgba(251, 191, 36, 0.55), rgba(251, 191, 36, 0.95)); }
.visit-cinema-panel .vcp-loot-row.kind-font .vcp-loot-fill      { background: linear-gradient(90deg, rgba(192, 132, 252, 0.55), rgba(192, 132, 252, 0.95)); }
.visit-cinema-panel .vcp-loot-row.kind-citations .vcp-loot-fill { background: linear-gradient(90deg, rgba(251, 191, 36, 0.6),  rgba(245, 158, 11, 0.95)); }
.visit-cinema-panel .vcp-loot-row.kind-blocked .vcp-loot-fill   { background: linear-gradient(90deg, rgba(248, 113, 113, 0.6),  rgba(239, 68, 68, 0.95)); }
.visit-cinema-panel .vcp-loot-row .vcp-loot-count {
  text-align: right;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-0);
}
.visit-cinema-panel .vcp-loot-empty {
  color: var(--ink-3);
  font-style: italic;
  font-size: 11px;
  text-align: center;
  padding: 8px 0;
}
.visit-cinema-panel .vcp-totals {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--panel-border);
  display: flex;
  justify-content: space-between;
  color: var(--ink-2);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.visit-cinema-panel .vcp-totals b { color: #e9d5ff; font-weight: 700; font-family: ui-monospace, monospace; }
.visit-cinema-panel .vcp-feed-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;          /* allow flex child to scroll */
  padding: 12px 16px 16px 16px;
  overflow: hidden;
}
.visit-cinema-panel .vcp-feed {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}
.visit-cinema-panel .vcp-feed-line {
  background: rgba(20, 26, 44, 0.55);
  border: 1px solid var(--panel-border);
  border-left-width: 3px;
  border-radius: 4px;
  padding: 7px 10px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink-1);
  animation: vcpLineIn 0.32s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.visit-cinema-panel .vcp-feed-line.lane-arrival { border-left-color: #67e8f9; }
.visit-cinema-panel .vcp-feed-line.lane-loot    { border-left-color: #6ee7b7; }
.visit-cinema-panel .vcp-feed-line.lane-edge    { border-left-color: #d8b4fe; }
.visit-cinema-panel .vcp-feed-line.lane-stop    { border-left-color: #93c5fd; }
.visit-cinema-panel .vcp-feed-line .vcp-line-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 9.5px;
  margin-bottom: 4px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
}
.visit-cinema-panel .vcp-feed-line .vcp-line-meta .vcp-line-stamp {
  font-family: ui-monospace, monospace;
}
.visit-cinema-panel .vcp-feed-line .vcp-line-text { color: var(--ink-0); }
.visit-cinema-panel .vcp-feed-line .vcp-line-text .ss-mask {
  font-family: ui-monospace, monospace;
  color: #e9d5ff;
}
@keyframes vcpLineIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* In cinema we hide the floating bottom-left feed and corner loot HUD
   since the right panel hosts both, more clearly. */
body.visit-replay-cinema #visit-replay-commentary-feed,
body.visit-replay-cinema .loot-hud { display: none !important; }

/* Lane-status sparkline strip above transport */
.lane-sparkline {
  display: inline-flex;
  gap: 1px;
  align-items: center;
}
.lane-sparkline .ls-cell {
  width: 3px;
  height: 12px;
  background: rgba(120,140,180,0.15);
  border-radius: 1px;
}
.lane-sparkline .ls-cell.hot { background: rgba(239, 68, 68, 0.65); }
.lane-sparkline .ls-cell.warm { background: rgba(245, 158, 11, 0.55); }
.lane-sparkline .ls-cell.cool { background: rgba(56, 189, 248, 0.45); }

.live-status-strip {
  grid-column: 1 / -1;
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.06), transparent);
  border-bottom: 1px solid var(--panel-border);
  padding: 6px 18px;
  font-size: 11px;
  color: var(--ink-1);
  display: flex;
  align-items: center;
  gap: 14px;
  font-variant-numeric: tabular-nums;
}
.live-status-strip .lss-block {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.live-status-strip .lss-block b {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-0);
}
.live-status-strip .lss-block span.lbl {
  color: var(--ink-3);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.live-status-strip .lss-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: auto;
  font-weight: 600;
}
.live-status-strip .lss-status .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--bad);
  box-shadow: 0 0 6px currentColor;
  color: var(--bad);
  animation: live-pulse 1.4s infinite;
}
.live-status-strip .lss-status.stale .dot      { background: var(--warn); color: var(--warn); animation: none; }
.live-status-strip .lss-status.disconnect .dot { background: var(--ink-3); color: var(--ink-3); animation: none; }
.live-status-strip .speed-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--ink-2);
}
.live-status-strip .speed-control select,
.live-status-strip .speed-control button {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--ink-1);
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-family: inherit;
  cursor: pointer;
}

/* Active-now panel (replaces visit-list in live) */
.active-now-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}
.active-now-list::-webkit-scrollbar { width: 6px; }
.active-now-list::-webkit-scrollbar-thumb { background: rgba(120,140,180,0.2); border-radius: 3px; }

.an-row {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(120, 140, 180, 0.06);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: background 0.15s;
  position: relative;
}
.an-row:hover { background: rgba(255,255,255,0.025); }
.an-row.active { background: rgba(56,189,248,0.10); border-left: 3px solid var(--accent); padding-left: 11px; }
.an-row.forming::after {
  content: '';
  position: absolute;
  top: 14px;
  right: 12px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 6px currentColor;
  animation: live-pulse 1.4s infinite;
  color: var(--warn);
}
.an-row.completed { opacity: 0.55; }
.an-row .swatch {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}
.an-row .body { flex: 1; min-width: 0; }
.an-row .agent-line {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-0);
}
.an-row .agent-line .country {
  font-size: 10px;
  font-weight: 500;
  background: rgba(255,255,255,0.06);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--ink-2);
  margin-left: 4px;
}
.an-row .meta {
  font-size: 10.5px;
  color: var(--ink-2);
  margin-top: 2px;
}
.an-row .meta .conf {
  display: inline-block;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.an-row .meta .conf.forming { background: rgba(245,158,11,0.18); color: var(--warn); }
.an-row .meta .conf.low     { background: rgba(248,113,113,0.15); color: var(--bad); }
.an-row .meta .conf.medium  { background: rgba(245,158,11,0.15); color: var(--warn); }
.an-row .meta .conf.high    { background: rgba(52,211,153,0.15); color: var(--good); }
.an-row .last-region {
  font-size: 10px;
  color: var(--ink-3);
  font-family: ui-monospace, monospace;
}

/* Commentary feed */
.commentary-feed {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 14px;
  max-height: 200px;
  background: rgba(10, 15, 28, 0.86);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 6px 12px 8px;
  backdrop-filter: blur(12px);
  font-family: ui-sans-serif, system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 5;
}
.commentary-feed::-webkit-scrollbar { width: 4px; }
.commentary-feed::-webkit-scrollbar-thumb { background: rgba(120,140,180,0.15); }

.commentary-feed .cf-line {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-1);
  display: flex;
  align-items: flex-start;
  gap: 7px;
  opacity: 0;
  animation: cf-in 0.6s ease forwards;
}
.commentary-feed .cf-line.priority { color: var(--ink-0); font-weight: 500; }
.commentary-feed .cf-line.quiet { color: var(--ink-3); font-style: italic; }
.commentary-feed .cf-line .vtime {
  flex-shrink: 0;
  font-size: 9.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
  min-width: 60px;
}
.commentary-feed .cf-line .trigger-pill {
  flex-shrink: 0;
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 2px;
  background: rgba(255,255,255,0.05);
  color: var(--ink-2);
  margin-top: 1px;
}
.commentary-feed .cf-line.priority .trigger-pill {
  background: rgba(239, 68, 68, 0.20);
  color: #ff8888;
}
@keyframes cf-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Live visitor panel-specific styling */
.live-visitor .what-now {
  background: rgba(239, 68, 68, 0.07);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 5px;
  padding: 10px 12px;
  margin: 0 0 14px 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-0);
}
.live-visitor .what-now .wh-title {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #ff8e8e;
  margin-bottom: 4px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.live-visitor .what-now .wh-title::before {
  content: '●';
  animation: live-pulse 1.4s infinite;
}
.live-visitor .forming-indicator {
  display: inline-block;
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(245, 158, 11, 0.20);
  color: var(--warn);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
  margin-left: 4px;
}

/* DVR rewind bar */
.dvr-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 230px;
  height: 14px;
  background: rgba(10, 15, 28, 0.7);
  border: 1px solid var(--panel-border);
  border-radius: 3px;
  display: flex;
  align-items: center;
  padding: 0 6px;
  gap: 6px;
  font-size: 9.5px;
  color: var(--ink-3);
  z-index: 4;
  backdrop-filter: blur(8px);
}
.dvr-bar button {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--ink-1);
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 2px;
  cursor: pointer;
  font-family: inherit;
}

.toolbar {
  display: flex;
  gap: 4px;
  margin-left: auto;
  align-items: center;
}
.toolbar .tb {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--ink-1);
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
}
.toolbar .tb.active {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--warn);
}

.pagination {
  border-top: 1px solid var(--panel-border);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 10px;
  color: var(--ink-2);
  background: rgba(0,0,0,0.18);
}
.pagination button {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--ink-1);
  border-radius: 3px;
  padding: 4px 8px;
  font-size: 10px;
  cursor: pointer;
  font-family: inherit;
}
.pagination button:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
}
.pagination button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.pagination .page-info {
  font-variant-numeric: tabular-nums;
}
.pagination input.page-jump {
  width: 36px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--ink-0);
  border-radius: 3px;
  padding: 3px 4px;
  font-size: 10px;
  text-align: center;
  font-family: inherit;
}

.timeline-strip {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 30px;
  height: 38px;
  background: rgba(10, 15, 28, 0.78);
  border: 1px solid var(--panel-border);
  border-radius: 5px;
  padding: 4px 8px;
  display: none;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(10px);
  font-size: 10px;
}
.timeline-strip.active { display: flex; }
.timeline-strip .label {
  font-size: 9px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  min-width: 50px;
}
.timeline-strip .strip {
  flex: 1;
  height: 22px;
  display: flex;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(255,255,255,0.04);
}
.timeline-strip .strip .seg {
  height: 100%;
  position: relative;
  cursor: pointer;
  transition: filter 0.15s;
}
.timeline-strip .strip .seg:hover { filter: brightness(1.4); }
.timeline-strip .strip .seg.blocked {
  background-image: repeating-linear-gradient(45deg, transparent 0 3px, rgba(0,0,0,0.45) 3px 6px);
}
.timeline-strip .duration {
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}

.summary-banner {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.06), transparent);
  border-left: 3px solid var(--accent);
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-1);
  border-radius: 0 4px 4px 0;
}

.score-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin: 8px 0 14px;
}
.score-row .sc {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 6px 6px;
  border-radius: 3px;
  text-align: center;
}
.score-row .sc .lbl {
  font-size: 8.5px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.score-row .sc .val {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.score-row .sc.high .val { color: var(--bad); }
.score-row .sc.mid  .val { color: var(--warn); }
.score-row .sc.low  .val { color: var(--good); }

.path-step .step-anomaly {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
  margin-left: 4px;
  border: 1.5px solid transparent;
}
.path-step .step-anomaly.blocked  { background: rgba(239,68,68,0.25); border-color: #ef4444; }
.path-step .step-anomaly.citation { background: rgba(251,191,36,0.25); border-color: #fbbf24; }
.path-step .step-anomaly.api      { background: rgba(96,165,250,0.25); border-color: #60a5fa; }
.path-step .step-anomaly.machine  { background: rgba(167,139,250,0.25); border-color: #a78bfa; }
.path-step .step-anomaly.entry    { background: rgba(255,255,255,0.35); border-color: #ffffff; }
.visit-body {
  flex: 1;
  min-width: 0;
}
.visit-actor {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-0);
  margin-bottom: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.visit-actor .country {
  font-size: 10px;
  font-weight: 500;
  background: rgba(255,255,255,0.06);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--ink-2);
}
.visit-meta {
  font-size: 10.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.visit-summary {
  margin-top: 4px;
  font-size: 10.5px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.visit-summary .pill {
  display: inline-block;
  font-size: 9.5px;
  padding: 0 5px;
  border-radius: 3px;
  margin-right: 3px;
  background: rgba(255,255,255,0.05);
  color: var(--ink-1);
}

main.canvas-wrap {
  position: relative;
  background:
    radial-gradient(ellipse at 50% 50%, #0e1a30 0%, #060a16 65%, #02040a 100%);
  overflow: hidden;
}
canvas#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
}
canvas#map:active { cursor: grabbing; }
canvas#overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.map-hud {
  position: absolute;
  left: 12px;
  bottom: 12px;
  color: var(--ink-3);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  pointer-events: none;
}
.map-legend {
  position: absolute;
  right: 12px;
  top: 12px;
  background: rgba(10, 15, 28, 0.65);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 10px;
  color: var(--ink-1);
  backdrop-filter: blur(8px);
  max-width: 220px;
}
.map-legend h3 {
  font-size: 9px;
  margin: 0 0 6px 0;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.map-legend .lrow {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 1px 0;
}
.map-legend .lrow .ldot {
  width: 8px; height: 8px;
  border-radius: 50%;
}

.tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(10, 15, 28, 0.92);
  border: 1px solid rgba(120, 140, 180, 0.3);
  border-radius: 5px;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--ink-0);
  white-space: nowrap;
  z-index: 100;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  transform: translate(-50%, calc(-100% - 12px));
}
.tooltip .t-region {
  font-size: 9px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.7px;
}
.tooltip .t-title {
  font-weight: 600;
  margin: 2px 0;
}
.tooltip .t-stats { color: var(--ink-2); font-size: 10px; }

.detail-empty {
  padding: 20px;
  color: var(--ink-3);
  font-size: 12px;
  text-align: center;
}

.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}
.detail-body::-webkit-scrollbar { width: 6px; }
.detail-body::-webkit-scrollbar-thumb { background: rgba(120,140,180,0.2); border-radius: 3px; }

.detail-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.detail-header .swatch {
  width: 14px; height: 14px;
  border-radius: 50%;
  box-shadow: 0 0 10px currentColor;
}
.detail-header .title {
  font-size: 16px;
  font-weight: 600;
}
.detail-header .family {
  font-size: 11px;
  color: var(--ink-2);
}
.detail-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 10px 0 14px;
}
.detail-stats .ds {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 8px 10px;
  border-radius: 4px;
}
.detail-stats .ds .k {
  font-size: 9px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.7px;
}
.detail-stats .ds .v {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-0);
}
.detail-section-title {
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 14px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--panel-border);
}
.path-step {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  font-size: 11px;
  border-bottom: 1px solid rgba(120, 140, 180, 0.06);
}
.path-step .step-idx {
  width: 18px;
  flex-shrink: 0;
  font-size: 10px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.path-step .step-url {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10.5px;
  color: var(--ink-1);
  word-break: break-all;
  flex: 1;
  min-width: 0;
}
.path-step .step-region {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255,255,255,0.05);
  color: var(--ink-2);
  flex-shrink: 0;
  margin-top: 1px;
}
.path-step .step-ts {
  font-size: 9px;
  color: var(--ink-3);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tab-row {
  display: flex;
  border-bottom: 1px solid var(--panel-border);
  padding: 0 14px;
}
.tab {
  padding: 10px 12px;
  font-size: 11px;
  color: var(--ink-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
}
.tab:hover { color: var(--ink-0); }
.tab.active {
  color: var(--ink-0);
  border-bottom-color: var(--accent);
}

.chat-thread {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(120, 140, 180, 0.08);
}
.chat-thread .ts {
  font-size: 10px;
  color: var(--ink-3);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.chat-turn {
  font-size: 11px;
  padding: 3px 0;
}
.chat-turn.user { color: var(--accent); }
.chat-turn.assistant { color: var(--ink-1); }
.chat-turn .role {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--ink-3);
  margin-right: 5px;
}
.chat-thread.is-test {
  opacity: 0.55;
}
.chat-thread .test-pill {
  font-size: 8px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--warn);
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 5px;
}

