:root {
  --bg: #0d0d0f;
  --bg-2: #14110c;
  --amber: #ffb347;
  --amber-bright: #ffd28a;
  --amber-dim: #8a5a1f;
  --amber-faint: #3a2510;
  --chrome: #1a1208;
  --text: #ffd9a8;
  --muted: #8a6a3f;
  --danger: #ff5252;
  --line: rgba(255, 179, 71, 0.22);
  --line-strong: rgba(255, 179, 71, 0.45);
  --glow:
    0 0 2px rgba(255, 213, 44, 0.95),
    0 0 8px rgba(255, 213, 44, 0.55),
    0 0 20px rgba(255, 213, 44, 0.28),
    0 0 40px rgba(255, 106, 0, 0.12);
  --glow-soft: 0 0 14px rgba(255, 179, 71, 0.18);
  --phosphor:
    0 0 2px #ffd52c,
    0 0 8px rgba(255, 213, 44, 0.6),
    0 0 20px rgba(255, 213, 44, 0.3),
    0 0 40px rgba(255, 106, 0, 0.15);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  position: relative;
  background: radial-gradient(ellipse at center, var(--bg-2) 0%, var(--bg) 75%);
  color: var(--text);
  font-family: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

/* ──────────────────────────────────────────────────────────
   Decorative layers: starfield, scanlines, vignette
   ────────────────────────────────────────────────────────── */

.starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 12% 22%, rgba(255, 220, 180, 0.85), transparent 60%),
    radial-gradient(1px 1px at 78% 14%, rgba(255, 220, 180, 0.75), transparent 60%),
    radial-gradient(1px 1px at 33% 78%, rgba(255, 220, 180, 0.7), transparent 60%),
    radial-gradient(1px 1px at 88% 65%, rgba(255, 220, 180, 0.85), transparent 60%),
    radial-gradient(1px 1px at 8% 88%, rgba(255, 220, 180, 0.6), transparent 60%),
    radial-gradient(1px 1px at 55% 33%, rgba(255, 220, 180, 0.7), transparent 60%),
    radial-gradient(1px 1px at 65% 92%, rgba(255, 220, 180, 0.55), transparent 60%),
    radial-gradient(1px 1px at 25% 50%, rgba(255, 220, 180, 0.65), transparent 60%),
    radial-gradient(1px 1px at 95% 40%, rgba(255, 220, 180, 0.7), transparent 60%),
    radial-gradient(2px 2px at 45% 12%, rgba(255, 220, 180, 0.9), transparent 60%),
    radial-gradient(1.5px 1.5px at 70% 80%, rgba(255, 220, 180, 0.8), transparent 60%);
  background-size: 100% 100%;
}

.scanlines,
.vignette {
  display: none;
}

/* ──────────────────────────────────────────────────────────
   Globe canvas
   ────────────────────────────────────────────────────────── */

#globe {
  position: fixed;
  inset: 0;
  z-index: 2;
}

#globe canvas {
  display: block;
}

/* Timeline scrubber (top, full width) */

.timeline {
  position: fixed;
  top: 12px;
  left: 360px;
  right: 360px;
  z-index: 11;
  display: flex;
  gap: 12px;
  align-items: stretch;
  height: 78px;
  padding: 8px 12px;
  background: linear-gradient(180deg, rgba(10, 6, 0, 0.88), rgba(5, 3, 0, 0.88));
  border: 1px solid var(--line);
  box-shadow: var(--glow-soft);
}

.timeline.is-hidden { display: none; }

.timeline-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.timeline-hint {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber-dim);
  font-style: italic;
}

.timeline-count {
  position: absolute;
  bottom: 2px;
  right: 6px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  color: var(--amber-dim);
  background: rgba(0, 0, 0, 0.45);
  padding: 0 6px;
  pointer-events: none;
}

.timeline-controls {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
}

.timeline-controls .btn-icon {
  width: 24px;
  height: 22px;
  font-size: 0.85rem;
  transform: none;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.timeline-controls .btn-icon:hover { transform: none; }

.timeline-controls .btn-ghost {
  height: 22px;
  padding: 0 6px;
  font-size: 0.62rem;
}

.timeline-track {
  position: relative;
  flex: 1;
  min-width: 0;
  background: rgba(255, 179, 71, 0.04);
  border: 1px solid var(--line);
  cursor: pointer;
  user-select: none;
}

.timeline-histogram {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.timeline-scrubber {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber), 0 0 18px var(--amber);
  pointer-events: none;
}

.timeline-date {
  position: absolute;
  top: 2px;
  right: 6px;
  font-family: "VT323", monospace;
  font-size: 0.9rem;
  color: var(--amber);
  text-shadow: var(--glow);
  pointer-events: none;
  background: rgba(0, 0, 0, 0.45);
  padding: 0 6px;
}

@media (max-width: 1100px) {
  .timeline {
    left: 12px;
    right: 12px;
    top: 96px;
  }
}

/* Corner brackets framing the globe */

.globe-brackets {
  position: fixed;
  inset: 12px;
  z-index: 5;
  pointer-events: none;
}

.bracket {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: var(--amber);
  border-style: solid;
  border-width: 0;
  filter: drop-shadow(0 0 4px rgba(255, 213, 44, 0.55));
}

.bracket.tl { top: 0; left: 0; border-top-width: 2px; border-left-width: 2px; }
.bracket.tr { top: 0; right: 0; border-top-width: 2px; border-right-width: 2px; }
.bracket.bl { bottom: 0; left: 0; border-bottom-width: 2px; border-left-width: 2px; }
.bracket.br { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; }

/* Telemetry ribbon (bottom, above ticker) */

.telemetry-ribbon {
  position: fixed;
  left: 50%;
  bottom: 90px;
  z-index: 10;
  display: inline-flex;
  gap: 16px;
  padding: 5px 28px 5px 12px;
  background: linear-gradient(180deg, rgba(10, 6, 0, 0.85), rgba(5, 3, 0, 0.85));
  border: 1px solid var(--line);
  box-shadow: var(--glow-soft);
  font-family: "IBM Plex Mono", monospace;
  pointer-events: none;
  transform: translateX(-50%);
  white-space: nowrap;
}
.telemetry-ribbon.is-hidden { display: none; }

.telemetry-close {
  position: absolute;
  top: 2px;
  right: 4px;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
}
.telemetry-close:hover {
  color: var(--amber-bright);
  border-color: var(--amber-bright);
}

.telemetry-cell {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}

.telemetry-label {
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}

.telemetry-value {
  font-family: "VT323", monospace;
  font-size: 0.95rem;
  color: var(--amber);
  text-shadow: var(--glow);
  line-height: 1;
}

/* ──────────────────────────────────────────────────────────
   HUD panels
   ────────────────────────────────────────────────────────── */

.hud {
  position: fixed;
  z-index: 10;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(10, 6, 0, 0.92) 0%, rgba(5, 3, 0, 0.92) 100%);
  border: 1px solid var(--line);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.6),
    0 0 24px rgba(255, 179, 71, 0.08);
  backdrop-filter: blur(2px);
}

.hud::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--amber), transparent);
  opacity: 0.4;
}

.hud-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}

.hud-heading .btn-ghost {
  flex: 0 0 auto;
}

.hud-heading.sub {
  margin-top: 14px;
}

.hud-heading h2 {
  flex: 1 1 auto;
  width: auto;
  margin-bottom: 0;
  font-family: "VT323", monospace;
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--amber);
  text-shadow: var(--glow);
}

.hud-heading .btn-icon,
.hud-heading .btn-ghost {
  margin-left: auto;
}

.caret {
  color: var(--amber);
  text-shadow: var(--glow);
  font-weight: 700;
}

/* Brand (top-left) */

.hud-brand {
  top: 18px;
  left: 18px;
  min-width: 240px;
  max-width: 320px;
}

.hud-brand.is-hidden { display: none; }

.brand-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--amber-dim);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  cursor: pointer;
  line-height: 1;
}

.brand-close:hover,
.brand-close:focus-visible {
  color: var(--amber);
  outline: none;
}

/* Planetary Pulse (inside filters panel) */

.pulse-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  margin: 6px 0 12px;
  border: 1px solid var(--pulse-color, var(--amber));
  background: rgba(255, 179, 71, 0.06);
  box-shadow: 0 0 12px rgba(255, 179, 71, 0.15);
}

.pulse-inline-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pulse-label {
  font-family: "VT323", monospace;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.pulse-value {
  font-family: "VT323", monospace;
  font-size: 2.2rem;
  line-height: 1;
  letter-spacing: 0.05em;
  color: var(--pulse-color, var(--amber));
  text-shadow: 0 0 10px var(--pulse-color, var(--amber));
}

.pulse-delta {
  font-size: 0.76rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.pulse-delta.up { color: #ff7f3f; }
.pulse-delta.down { color: #7fd4ff; }

/* Daily digest banner (top, full-width-ish) */

.digest-banner-wrap {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  max-width: min(72vw, 760px);
}

.digest-banner-wrap.is-hidden { display: none; }

.digest-banner {
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--amber);
  border-right: none;
  background: rgba(8, 6, 4, 0.78);
  color: var(--amber);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 0 18px rgba(255, 179, 71, 0.25);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.digest-banner:hover { background: rgba(20, 14, 6, 0.92); }

.digest-close {
  background: rgba(8, 6, 4, 0.78);
  border: 1px solid var(--amber);
  color: var(--amber);
  padding: 0 10px;
  cursor: pointer;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  box-shadow: 0 0 18px rgba(255, 179, 71, 0.25);
}

.digest-close:hover { background: rgba(20, 14, 6, 0.92); }

.digest-icon { color: var(--amber); }

body.ui-hidden .digest-banner-wrap { display: none; }

/* Story tour overlay */

.tour-overlay {
  position: fixed;
  bottom: 200px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--amber);
  background: rgba(8, 6, 4, 0.85);
  color: var(--amber);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  box-shadow: 0 0 18px rgba(255, 179, 71, 0.3);
  max-width: 86vw;
}

.tour-overlay.is-hidden { display: none; }

.tour-label { font-family: "VT323", monospace; font-size: 1rem; letter-spacing: 0.12em; }
.tour-progress { color: var(--muted); }
.tour-title { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tour-overlay .btn-ghost { padding: 2px 8px; }

body.ui-hidden .tour-overlay { display: none; }

/* Historical comparison card */

.history-card {
  position: fixed;
  left: 88px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 25;
  width: 280px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 12px 14px;
  border: 1px solid var(--amber);
  background: rgba(8, 6, 4, 0.85);
  color: var(--amber);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  box-shadow: 0 0 18px rgba(255, 179, 71, 0.25);
}

.history-card.is-hidden { display: none; }

.history-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.history-head h2 { font-size: 0.9rem; letter-spacing: 0.1em; margin: 0; flex: 1; }
.history-meta { color: var(--muted); font-size: 0.7rem; margin-bottom: 8px; }

.history-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 179, 71, 0.15);
}
.history-row:last-child { border-bottom: none; }

.history-label { display: flex; justify-content: space-between; }
.history-label .delta.up { color: #ff7f3f; }
.history-label .delta.down { color: #7fd4ff; }

.history-bars { display: flex; gap: 4px; align-items: center; height: 10px; }
.history-bar { height: 6px; background: var(--amber); opacity: 0.85; min-width: 1px; }
.history-bar.last { background: var(--muted); opacity: 0.55; }

body.ui-hidden .history-card { display: none; }

@media (max-width: 900px) {
  .digest-banner { max-width: 60vw; font-size: 0.72rem; }
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.brand-title {
  font-family: "VT323", monospace;
  font-size: 1.7rem;
  letter-spacing: 0.08em;
  color: var(--amber);
  text-shadow: var(--glow);
}

.rec-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber), 0 0 20px var(--amber);
  animation: blink 1.4s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

.brand-meta {
  display: flex;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.brand-meta.dim {
  color: var(--muted);
  font-size: 0.72rem;
}

.sep {
  color: var(--amber-dim);
}

/* Filters (top-right) */

.hud-filters {
  top: 18px;
  right: 18px;
  width: 300px;
  max-height: calc(100vh - 18px - 64px - 36px);
  overflow-y: auto;
  transition: transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.2s ease;
}

.hud-filters.is-hidden {
  transform: translateX(calc(100% + 36px));
  opacity: 0;
  pointer-events: none;
}

.filters-reopen {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: rgba(10, 5, 0, 0.85);
  border: 1px solid var(--amber-dim);
  color: var(--amber);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  z-index: 30;
  text-shadow: var(--glow);
  transition: background 0.12s ease, border-color 0.12s ease;
}

.filters-reopen:hover,
.filters-reopen:focus-visible {
  background: rgba(255, 179, 71, 0.12);
  border-color: var(--amber);
  outline: none;
}

.filters-reopen[hidden] {
  display: none;
}

.hud-filters::-webkit-scrollbar { width: 6px; }
.hud-filters::-webkit-scrollbar-thumb { background: var(--amber-dim); border-radius: 0; }
.hud-filters::-webkit-scrollbar-track { background: transparent; }

.field {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.field span {
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  background: var(--chrome);
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--amber-bright);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.field input:focus,
.field select:focus {
  border-color: var(--amber);
  box-shadow: var(--glow-soft);
}

.field input::placeholder {
  color: var(--amber-dim);
}

.field-hint {
  margin-top: 2px;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--amber-dim);
  font-style: italic;
  font-weight: 400;
}

.btn-ghost {
  height: 24px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--amber);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  cursor: pointer;
  text-shadow: var(--glow);
  transition: background 0.12s ease, border-color 0.12s ease;
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: rgba(255, 179, 71, 0.1);
  border-color: var(--amber);
  outline: none;
}

.btn-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--amber);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  text-shadow: var(--glow);
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.4s ease;
}

.btn-icon:hover,
.btn-icon:focus-visible {
  background: rgba(255, 179, 71, 0.1);
  border-color: var(--amber);
  transform: rotate(180deg);
  outline: none;
}

/* Left icon rail: collapsed strip that expands on hover */

.layer-rail {
  position: fixed;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 44px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  scrollbar-width: none;
  padding: 6px 0;
  background: linear-gradient(180deg, rgba(10, 6, 0, 0.92), rgba(5, 3, 0, 0.92));
  border: 1px solid var(--line);
  border-left: 0;
  box-shadow: 0 0 24px rgba(255, 179, 71, 0.1);
  overflow: hidden;
  transition: width 0.22s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.layer-rail:hover,
.layer-rail:focus-within,
.layer-rail.is-expanded {
  width: 220px;
}

.rail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 28px;
  padding: 0 12px;
  border-bottom: 1px dashed var(--line);
  color: var(--amber);
  font-family: "VT323", monospace;
  font-size: 1rem;
  letter-spacing: 0.14em;
  text-shadow: var(--glow);
  white-space: nowrap;
}

.rail-items,
.rail-footer {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
}

.rail-footer {
  margin-top: auto;
  border-top: 1px dashed var(--line);
}

.rail-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 36px;
  padding: 0 12px;
  background: transparent;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0;
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  text-align: left;
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.rail-item:hover:not(.is-locked) {
  background: rgba(255, 179, 71, 0.08);
}

.rail-item.is-on {
  background: rgba(255, 179, 71, 0.1);
  border-left-color: var(--amber);
  color: var(--amber-bright);
}

.rail-item.is-on .rail-glyph {
  color: var(--amber);
  text-shadow: var(--glow);
}

.rail-item.is-locked {
  opacity: 0.55;
  cursor: default;
}

.rail-glyph {
  flex: 0 0 20px;
  display: grid;
  place-items: center;
  width: 20px;
  font-family: "VT323", monospace;
  font-size: 1.25rem;
  color: var(--amber-dim);
  line-height: 1;
}

.rail-text,
.rail-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.18s ease, transform 0.22s ease;
}

.layer-rail:hover .rail-text,
.layer-rail:hover .rail-label,
.layer-rail:focus-within .rail-text,
.layer-rail:focus-within .rail-label,
.layer-rail.is-expanded .rail-text,
.layer-rail.is-expanded .rail-label {
  opacity: 1;
  transform: translateX(0);
}

/* Aurora layer status line: tiny amber readout above the chrome toggle. */

.aurora-status {
  position: fixed;
  right: 18px;
  bottom: 128px;
  z-index: 11;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px;
  background: rgba(5, 3, 0, 0.82);
  border: 1px solid var(--line);
  border-left: 2px solid #39ff6a;
  color: var(--amber);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
  text-shadow: 0 0 6px rgba(57, 255, 106, 0.35);
}

.aurora-status.is-hidden {
  display: none;
}

.aurora-status-close {
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--amber-dim);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.62rem;
  cursor: pointer;
  line-height: 1;
}

.aurora-status-close:hover,
.aurora-status-close:focus-visible {
  color: var(--amber);
  outline: none;
}

/* Minimal-chrome mode: hide HUD chrome but keep left rail, right drawer, bottom ticker. */

body.ui-hidden .aurora-status,
body.ui-hidden .hud-brand,
body.ui-hidden .hud-filters,
body.ui-hidden .filters-reopen,
body.ui-hidden .hud-ticker,
body.ui-hidden .telemetry-ribbon,
body.ui-hidden .timeline,
body.ui-hidden .globe-brackets,
body.ui-hidden .status-banner,
body.ui-hidden .layer-rail,
body.ui-hidden .hud-detail,
body.ui-hidden .scanlines,
body.ui-hidden .vignette {
  display: none !important;
}

body.ui-hidden .chrome-toggle,
body:has(.hud-ticker.is-hidden) .chrome-toggle {
  bottom: 18px;
}

.chrome-toggle {
  position: fixed;
  right: 18px;
  bottom: 92px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  background: rgba(5, 3, 0, 0.85);
  border: 1px solid var(--amber-dim);
  color: var(--amber);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.62rem;
  font-weight: 700;
  opacity: 0.75;
  letter-spacing: 0.14em;
  text-shadow: var(--glow);
  cursor: pointer;
  text-transform: uppercase;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.chrome-toggle:hover,
.chrome-toggle:focus-visible {
  background: rgba(255, 179, 71, 0.12);
  border-color: var(--amber);
  opacity: 1;
  outline: none;
}

.restore-pill:hover {
  opacity: 1;
  background: rgba(255, 179, 71, 0.12);
}

/* Earthquake hover tooltip */

.quake-tooltip {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  padding: 6px 10px;
  background: rgba(5, 3, 0, 0.95);
  border: 1px solid var(--line-strong);
  box-shadow: var(--glow-soft);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--text);
  white-space: nowrap;
  max-width: 320px;
}

.qt-title {
  font-family: "VT323", monospace;
  font-size: 1rem;
  letter-spacing: 0.06em;
  color: var(--amber);
  text-shadow: var(--glow);
}

.qt-meta {
  margin-top: 2px;
  color: var(--text);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.qt-meta.dim {
  color: var(--muted);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Shepherd tour theme override */
.shepherd-element {
  background: linear-gradient(180deg, rgba(10, 6, 0, 0.96), rgba(5, 3, 0, 0.96)) !important;
  border: 1px solid var(--line-strong) !important;
  color: var(--text) !important;
  font-family: "IBM Plex Mono", monospace !important;
  box-shadow: 0 0 24px rgba(255, 179, 71, 0.18) !important;
  border-radius: 0 !important;
}

.shepherd-text {
  font-size: 0.85rem !important;
  letter-spacing: 0.04em !important;
  line-height: 1.5 !important;
  color: var(--text) !important;
  padding: 14px 16px !important;
}

.shepherd-header {
  background: transparent !important;
  border-bottom: 1px dashed var(--line) !important;
  padding: 10px 16px !important;
}

.shepherd-title {
  font-family: "VT323", monospace !important;
  font-size: 1.3rem !important;
  letter-spacing: 0.1em !important;
  color: var(--amber) !important;
  text-shadow: var(--glow) !important;
}

.shepherd-footer {
  padding: 10px 14px !important;
  border-top: 1px dashed var(--line) !important;
  gap: 8px !important;
}

.shepherd-button {
  background: transparent !important;
  border: 1px solid var(--line) !important;
  color: var(--amber) !important;
  font-family: "IBM Plex Mono", monospace !important;
  font-size: 0.74rem !important;
  letter-spacing: 0.12em !important;
  text-shadow: var(--glow) !important;
  border-radius: 0 !important;
  padding: 6px 14px !important;
  text-transform: uppercase;
}

.shepherd-button:hover {
  background: rgba(255, 179, 71, 0.12) !important;
  border-color: var(--amber) !important;
}

.shepherd-button-secondary {
  color: var(--muted) !important;
}

.shepherd-arrow:before {
  background: rgba(10, 6, 0, 0.96) !important;
  border: 1px solid var(--line-strong) !important;
}

.shepherd-cancel-icon {
  color: var(--amber-dim) !important;
}
.shepherd-cancel-icon:hover {
  color: var(--amber) !important;
}

.shepherd-modal-overlay-container {
  fill: rgba(0, 0, 0, 0.55) !important;
}

/* Categories */

.category-list {
  display: grid;
  gap: 4px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.category-list::-webkit-scrollbar { width: 4px; }
.category-list::-webkit-scrollbar-thumb { background: var(--amber-dim); }
.category-list::-webkit-scrollbar-track { background: transparent; }

.category-item {
  display: grid;
  grid-template-columns: 18px 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  height: 24px;
  padding: 0 4px;
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--text);
  transition: background 0.1s ease;
}

.category-item:hover {
  background: rgba(255, 179, 71, 0.06);
}

.category-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.category-check {
  display: inline-block;
  font-family: "VT323", monospace;
  font-size: 1.1rem;
  color: var(--amber);
  text-shadow: var(--glow);
  line-height: 1;
}

.category-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--amber);
  box-shadow: 0 0 6px currentColor;
}

.category-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.category-count {
  min-width: 2.2ch;
  padding: 1px 6px;
  background: var(--chrome);
  border: 1px solid var(--line);
  color: var(--amber);
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0;
}

.category-item.is-off .category-name,
.category-item.is-off .category-count {
  color: var(--amber-dim);
}

.category-item.is-off .category-dot {
  opacity: 0.25;
  box-shadow: none;
}

/* Detail drawer (right, slide-in) */

.hud-detail {
  top: 18px;
  right: 18px;
  width: 340px;
  /* leave room for ticker (~64px + 18px gap) */
  max-height: calc(100vh - 18px - 64px - 36px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateX(calc(100% + 24px));
  transition: transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
  z-index: 70;
}

.hud-detail .hud-heading {
  flex: 0 0 auto;
  position: relative;
  padding-right: 36px;
}

.hud-detail .hud-heading #closeDetailButton {
  position: absolute;
  top: 0;
  right: 0;
  width: 28px;
  height: 24px;
  padding: 0;
  display: grid;
  place-items: center;
}

.hud-detail .details-panel {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
  min-height: 0;
}

.hud-detail.is-open {
  transform: translateX(0);
}

/* ──────────────────────────────────────────────────────────
   Live feed panel (left, below brand, clear of the layer rail)
   ────────────────────────────────────────────────────────── */

.hud-live {
  top: 130px;
  left: 56px;
  width: 300px;
  max-height: calc(100vh - 130px - 170px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hud-live .hud-heading {
  margin-bottom: 8px;
}

.hud-live .btn-icon:hover,
.hud-live .btn-icon:focus-visible {
  transform: none;
}

.live-bell {
  font-size: 1rem;
}

.live-bell.is-on {
  background: rgba(255, 179, 71, 0.18);
  border-color: var(--amber);
  box-shadow: 0 0 10px rgba(255, 179, 71, 0.35);
}

.live-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.live-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger), 0 0 16px rgba(255, 82, 82, 0.55);
  animation: blink 1.4s ease-in-out infinite;
}

.live-dot.is-paused {
  background: var(--amber-dim);
  box-shadow: none;
  animation: none;
}

.live-state {
  color: var(--danger);
  font-weight: 700;
  text-shadow: 0 0 8px rgba(255, 82, 82, 0.55);
}

.hud-live.is-paused .live-state {
  color: var(--muted);
  text-shadow: none;
}

.live-meta {
  margin-left: auto;
  color: var(--amber-dim);
  letter-spacing: 0.08em;
  text-transform: none;
}

.live-feed {
  flex: 1 1 auto;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.live-feed::-webkit-scrollbar { width: 6px; }
.live-feed::-webkit-scrollbar-thumb { background: var(--amber-dim); border-radius: 0; }
.live-feed::-webkit-scrollbar-track { background: transparent; }

.live-feed .empty {
  color: var(--muted);
  font-size: 0.72rem;
  font-style: italic;
}

.live-entry {
  display: grid;
  grid-template-columns: 40px 16px 1fr;
  gap: 6px;
  align-items: baseline;
  width: 100%;
  padding: 4px 6px;
  background: transparent;
  border: 1px solid transparent;
  border-left: 2px solid var(--line);
  border-radius: 0;
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.live-entry:hover,
.live-entry:focus-visible {
  background: rgba(255, 179, 71, 0.08);
  border-color: var(--line);
  border-left-color: var(--amber);
  outline: none;
}

.live-entry:first-child {
  animation: liveEntryIn 0.9s ease;
}

@keyframes liveEntryIn {
  0% { background: rgba(255, 179, 71, 0.35); }
  100% { background: transparent; }
}

.live-time {
  color: var(--amber-dim);
  letter-spacing: 0.06em;
}

.live-glyph {
  text-align: center;
  text-shadow: 0 0 6px currentColor;
}

.live-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-entry.is-quake .live-title {
  color: var(--muted);
}

body.ui-hidden .hud-live { display: none !important; }

.hud-live.is-hidden { display: none; }

@media (max-width: 900px) {
  .hud-live { display: none; }
}

.hud-detail::-webkit-scrollbar { width: 6px; }
.hud-detail::-webkit-scrollbar-thumb { background: var(--amber-dim); }
.hud-detail::-webkit-scrollbar-track { background: transparent; }

.details-panel {
  display: grid;
  gap: 12px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text);
}

.details-panel .empty {
  color: var(--muted);
  font-style: italic;
}

.details-panel h3 {
  font-family: "VT323", monospace;
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--amber);
  text-shadow: var(--glow);
  line-height: 1.1;
}

.detail-row {
  display: grid;
  gap: 2px;
  padding-bottom: 6px;
  border-bottom: 1px dotted var(--line);
}

.detail-row:last-child {
  border-bottom: 0;
}

.event-imagery {
  margin: 0;
  border: 1px dashed var(--line);
  background: #1a0e02;
  position: relative;
}

.event-imagery img {
  display: block;
  width: 100%;
  height: auto;
  filter: contrast(1.05);
}

.event-imagery.imagery-fail img {
  display: none;
}

.event-imagery.imagery-fail::before {
  content: "imagery unavailable for this date";
  display: block;
  padding: 24px 12px;
  text-align: center;
  color: var(--amber-dim);
  font-style: italic;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.event-imagery figcaption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-top: 1px dashed var(--line);
  background: rgba(0, 0, 0, 0.55);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber-dim);
}

.event-imagery .imagery-link {
  color: var(--amber);
  text-decoration: none;
  text-shadow: var(--glow);
  letter-spacing: 0.14em;
  font-weight: 700;
}

.event-imagery .imagery-link:hover {
  text-decoration: underline;
}

.event-news {
  border-top: 1px dashed var(--line);
  padding-top: 10px;
  margin-top: 4px;
}

.event-news-status {
  color: var(--amber-dim);
  font-style: italic;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  line-height: 1.4;
}

.event-news-status.dim {
  color: var(--muted);
  font-size: 0.66rem;
  margin-top: 4px;
}

.event-news-status code {
  font-family: "IBM Plex Mono", monospace;
  color: var(--amber);
  background: rgba(255, 179, 71, 0.08);
  padding: 0 4px;
}

.event-news-tabs {
  display: flex;
  gap: 14px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.event-news-tab {
  background: transparent;
  border: 0;
  padding: 4px 2px;
  color: var(--amber-dim);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.event-news-tab.is-active {
  color: var(--amber);
  border-bottom-color: var(--amber);
  text-shadow: var(--glow);
}

.event-news-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.event-news-item {
  border-bottom: 1px dotted var(--line);
  padding-bottom: 6px;
  font-size: 0.76rem;
  line-height: 1.4;
}

.event-news-item:last-child {
  border-bottom: 0;
}

.event-news-item a {
  color: var(--amber-bright);
  text-decoration: none;
}

.event-news-item a:hover {
  text-decoration: underline;
}

.event-news-meta {
  display: flex;
  gap: 8px;
  margin-top: 2px;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.detail-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber-dim);
}

.details-panel a {
  color: var(--amber-bright);
  text-decoration: underline;
  text-decoration-color: var(--amber-dim);
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.details-panel a:hover {
  text-shadow: var(--glow);
}

/* Cluster / top-list rows in drawer */

.cluster-list {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.cluster-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.cluster-item:hover,
.cluster-item:focus-visible {
  background: rgba(255, 179, 71, 0.08);
  border-color: var(--amber);
  outline: none;
}

.cluster-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  box-shadow: 0 0 6px currentColor;
}

.cluster-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cluster-cat {
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}

/* Wikipedia block */

.wiki-block {
  margin-top: 12px;
  padding: 10px;
  border: 1px dashed var(--line);
  background: rgba(255, 179, 71, 0.03);
}

.wiki-header {
  font-family: "VT323", monospace;
  font-size: 1rem;
  letter-spacing: 0.1em;
  color: var(--amber);
  text-shadow: var(--glow);
  margin-bottom: 6px;
}

.wiki-loading,
.wiki-empty {
  color: var(--muted);
  font-style: italic;
  font-size: 0.78rem;
}

.wiki-extract {
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text);
  margin: 0 0 6px;
}

.wiki-link {
  font-size: 0.74rem;
  color: var(--amber-bright);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Audio button on state */

.btn-ghost.is-on {
  background: rgba(255, 179, 71, 0.15);
  border-color: var(--amber);
  color: var(--amber-bright);
}

/* Ticker (bottom) */

.hud-ticker {
  left: 18px;
  right: 18px;
  bottom: 18px;
  height: 64px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  padding: 10px 40px 10px 18px;
}
.hud-ticker.is-hidden { display: none; }

.ticker-close {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.7rem;
  cursor: pointer;
  line-height: 1;
}
.ticker-close:hover {
  color: var(--amber-bright);
  border-color: var(--amber-bright);
}

.ticker-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "VT323", monospace;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  color: var(--amber);
  text-shadow: var(--glow);
  white-space: nowrap;
}

.ticker-label {
  color: var(--muted);
  font-size: 1rem;
}

.ticker-track {
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  mask-image: linear-gradient(90deg, transparent 0%, #000 6%, #000 94%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 6%, #000 94%, transparent 100%);
}

.ticker-inner {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 300s linear infinite;
}

.ticker-inner:hover {
  animation-play-state: paused;
}

.ticker-item {
  display: inline-block;
  margin-right: 48px;
  font-size: 0.88rem;
  color: var(--text);
  letter-spacing: 0.04em;
}

.ticker-item.dim {
  color: var(--muted);
}

.ticker-item .cat-tag {
  display: inline-block;
  margin-right: 8px;
  padding: 0 6px;
  background: var(--chrome);
  border: 1px solid var(--line);
  color: var(--amber);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

@keyframes marquee {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-100%, 0, 0); }
}

/* Status banner (top center) */

.status-banner {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--chrome);
  border: 1px solid var(--line-strong);
  color: var(--amber);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-shadow: var(--glow);
  box-shadow: var(--glow-soft);
  animation: bannerIn 0.24s ease;
}

@keyframes bannerIn {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.status-banner.is-hidden {
  display: none;
}

.status-banner.error {
  border-color: var(--danger);
  color: var(--danger);
  text-shadow: 0 0 8px rgba(255, 82, 82, 0.6);
}

/* Past-event badge in detail title */
.past-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 6px;
  background: rgba(255, 179, 71, 0.12);
  border: 1px solid var(--line-strong);
  color: var(--amber-bright);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* Earth-pulse info dot + popover */
.info-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--amber-dim);
  border-radius: 50%;
  color: var(--amber);
  font-size: 0.62rem;
  cursor: pointer;
  line-height: 1;
  vertical-align: middle;
}
.info-dot:hover { border-color: var(--amber-bright); color: var(--amber-bright); }

.info-popover {
  padding: 8px 10px;
  margin: 6px 0 10px;
  background: rgba(255, 179, 71, 0.06);
  border: 1px solid var(--line);
  font-size: 0.74rem;
  color: var(--text);
  line-height: 1.45;
}
.info-popover.is-hidden { display: none; }
.info-popover strong { color: var(--amber-bright); display: block; margin-bottom: 4px; }
.info-popover p { margin: 4px 0; }
.info-popover ul { margin: 4px 0 4px 14px; padding: 0; }
.info-popover li { margin: 2px 0; }
.info-popover .dim { color: var(--muted); font-size: 0.68rem; }

/* Radio row for STATUS */
.field-radio {
  border: none;
  padding: 0;
  margin: 0 0 10px;
}
.field-radio legend {
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  color: var(--amber);
  margin-bottom: 4px;
}
.radio-row {
  display: flex;
  gap: 4px;
  border: 1px solid var(--line);
  background: rgba(255, 179, 71, 0.04);
}
.radio-row label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  user-select: none;
}
.radio-row label input { display: none; }
.radio-row label:has(input:checked) {
  background: rgba(255, 179, 71, 0.18);
  color: var(--amber-bright);
  text-shadow: var(--glow-soft);
}
.radio-row label + label { border-left: 1px solid var(--line); }

/* Slider for LOOKBACK */
.field-slider {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.slider-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  color: var(--amber);
}
.slider-readout {
  color: var(--amber-bright);
  text-shadow: var(--glow-soft);
}
.field-slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  margin: 0;
  padding: 0;
  background: rgba(255, 179, 71, 0.18);
  border: none;
  outline: none;
  cursor: pointer;
  box-sizing: border-box;
}
.field-slider input[type="range"] { margin-bottom: 6px; }
.field-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  background: var(--amber-bright);
  border: 1px solid var(--amber);
  box-shadow: var(--glow);
  cursor: pointer;
}
.field-slider input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  background: var(--amber-bright);
  border: 1px solid var(--amber);
  box-shadow: var(--glow);
  cursor: pointer;
}
.slider-ticks {
  position: relative;
  height: 12px;
  margin: 0 5px; /* shift in by thumb-radius so 0%/100% align to thumb travel */
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.slider-ticks span {
  position: absolute;
  transform: translateX(-50%);
  top: 0;
  white-space: nowrap;
}

.news-retry {
  margin-top: 6px;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
}

.news-toast-stack {
  position: fixed;
  left: 50%;
  bottom: 120px;
  transform: translateX(-50%);
  z-index: 95;
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
  align-items: center;
  pointer-events: none;
  max-width: min(560px, 90vw);
}

.news-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 10px;
  background: var(--chrome);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  box-shadow: var(--glow-soft);
  cursor: pointer;
  max-width: 100%;
  animation: toastIn 0.22s ease;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.news-toast:hover {
  border-color: var(--amber-bright);
  box-shadow: var(--glow);
}

.news-toast.is-leaving {
  opacity: 0;
  transform: translateY(8px);
}

.news-toast .nt-glyph {
  color: var(--amber-bright);
  font-size: 0.9rem;
  text-shadow: var(--glow);
}

.news-toast .nt-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.news-toast .nt-label {
  color: var(--amber);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.news-toast .nt-title {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 380px;
}

.news-toast .nt-count {
  color: var(--muted);
  font-size: 0.7rem;
  flex-shrink: 0;
}

.news-toast .nt-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 2px;
  margin-left: 4px;
  line-height: 1;
}

.news-toast .nt-close:hover { color: var(--amber-bright); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

body.ui-hidden .news-toast-stack { display: none; }

/* Globe.gl hover label */

.globe-label {
  padding: 6px 10px;
  background: rgba(5, 3, 0, 0.94);
  border: 1px solid var(--line-strong);
  box-shadow: var(--glow-soft);
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  max-width: 320px;
}

.globe-label-title {
  font-family: "VT323", monospace;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-shadow: 0 0 6px currentColor;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.globe-label-meta {
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.globe-marker {
  position: relative;
  width: 14px;
  height: 14px;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.globe-marker::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--color, var(--amber));
  box-shadow: 0 0 8px currentColor, 0 0 14px currentColor;
  color: var(--color, var(--amber));
}

/* ──────────────────────────────────────────────────────────
   Responsive: stack HUD on narrow screens
   ────────────────────────────────────────────────────────── */

@media (max-width: 820px) {
  .hud-brand {
    top: 12px;
    left: 56px;
    right: 12px;
    max-width: none;
    padding: 8px 10px;
  }
  .hud-brand .brand-meta { display: none; }
  .hud-brand .brand-meta:first-of-type { display: flex; }

  .hud-filters {
    top: auto;
    right: 12px;
    left: 12px;
    bottom: 84px;
    width: auto;
    max-height: 38vh;
  }
  .hud-detail {
    top: auto;
    right: 12px;
    left: 12px;
    bottom: 84px;
    width: auto;
    max-height: 55vh;
    transform: translateY(calc(100% + 24px));
  }
  .hud-detail.is-open {
    transform: translateY(0);
  }
  .hud-ticker {
    left: 12px;
    right: 12px;
    bottom: 12px;
    grid-template-columns: 1fr;
    height: auto;
    gap: 6px;
    padding: 8px 12px;
  }
}

/* Phones: stack timeline, hide telemetry, compact rail */
@media (max-width: 600px) {
  .layer-rail {
    top: auto;
    bottom: 84px;
    left: 12px;
    right: 12px;
    transform: none;
    width: auto;
    max-height: 44px;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px;
    gap: 4px;
  }
  .layer-rail:hover,
  .layer-rail:focus-within,
  .layer-rail.is-expanded {
    width: auto;
    max-height: 50vh;
    flex-direction: column;
  }
  .rail-header { display: none; }
  .layer-rail.is-expanded .rail-header { display: flex; }
  .rail-items,
  .rail-footer {
    flex-direction: row;
    padding: 0;
    border: 0;
    margin: 0;
  }
  .layer-rail.is-expanded .rail-items,
  .layer-rail.is-expanded .rail-footer {
    flex-direction: column;
  }
  .rail-item {
    width: auto;
    height: 36px;
    min-width: 36px;
    padding: 0 8px;
    border-left: 0;
    border-bottom: 2px solid transparent;
  }
  .rail-item.is-on { border-left: 0; border-bottom-color: var(--amber); }
  .layer-rail.is-expanded .rail-item {
    border-bottom: 0;
    border-left: 2px solid transparent;
    width: 100%;
  }
  .layer-rail.is-expanded .rail-item.is-on {
    border-left-color: var(--amber);
  }
  .rail-text {
    display: none;
  }
  .layer-rail.is-expanded .rail-text {
    display: inline;
    opacity: 1;
    transform: none;
  }

  /* Timeline: full width, hide histogram + hint, slim controls */
  .timeline {
    top: 64px;
    left: 12px;
    right: 12px;
    height: 44px;
    padding: 4px 8px;
    gap: 6px;
  }
  .timeline-hint { display: none; }
  .timeline-controls { flex-direction: row; }
  .timeline-controls .btn-icon,
  .timeline-controls .btn-ghost { height: 28px; }
  .timeline-count { font-size: 0.58rem; bottom: 0; }

  .telemetry-ribbon { display: none; }

  .hud-brand {
    top: 12px;
    left: 12px;
    right: 12px;
  }
  .brand-title { font-size: 1.3rem; }

  .hud-filters,
  .hud-detail {
    bottom: 140px; /* leave room for rail + ticker */
    max-height: 40vh;
  }

  .hud-ticker {
    bottom: 12px;
    height: 44px;
    padding: 4px 10px;
  }
  .ticker-stats { font-size: 0.95rem; }

  .restore-pill {
    bottom: 12px;
    right: 12px;
  }

  /* Shepherd: tighter content on small screens */
  .shepherd-element {
    max-width: calc(100vw - 24px) !important;
  }
}

/* Laptops: short viewports (incl. Windows display scaling) — compact everything */
@media (max-height: 850px) {
  .hud { padding: 10px 12px; }

  .hud-brand { min-width: 200px; }
  .brand-title { font-size: 1.35rem; }
  .hud-brand .brand-meta.dim { display: none; }

  .hud-filters {
    width: 272px;
    max-height: calc(100vh - 132px);
  }

  .hud-live {
    top: 100px;
    width: 262px;
    max-height: calc(100vh - 100px - 148px);
  }

  .rail-item { height: 29px; font-size: 0.74rem; padding: 0 10px; }
  .rail-header { padding: 2px 10px; }

  .timeline { height: 62px; }

  .telemetry-ribbon { bottom: 84px; }

  .hud-ticker { height: 54px; padding: 6px 40px 6px 14px; }

  .hud-detail { max-height: calc(100vh - 18px - 54px - 30px); }

  .aurora-status { bottom: 118px; }
}

/* Narrow laptops: keep timeline clear of brand + filters */
@media (max-width: 1440px) and (min-width: 1101px) {
  .timeline { left: 348px; right: 348px; }
}
