/* =========================================================================
   GEO ORBIT CONTROL — Observatory / Mission Control UI
   Theme: deep-space observatory. Knowledge-first, never cartoonish.
   ========================================================================= */

:root {
  /* Core spacecraft hull */
  --void: #04060d;
  --deep: #070b18;
  --surface: #0c1223;
  --surface-2: #111930;
  --hull: rgba(20, 28, 50, 0.62);
  --hull-strong: rgba(18, 26, 48, 0.88);
  --grid-line: rgba(130, 160, 220, 0.07);
  --hull-border: rgba(130, 170, 230, 0.12);
  --hull-border-hot: rgba(150, 195, 255, 0.28);

  /* Telemetry text */
  --ink: #e6ecf7;
  --ink-muted: rgba(230, 236, 247, 0.72);
  --ink-dim: rgba(230, 236, 247, 0.46);
  --ink-faint: rgba(230, 236, 247, 0.22);

  /* Stellar accents — restrained palette, no neon candy */
  --stellar: #6ed0ff;       /* primary signal — cyan */
  --stellar-deep: #3d88c7;
  --ember: #f0b878;         /* warm amber — mission log */
  --aurora: #8bdab0;        /* success / hit */
  --magenta: #c299f0;       /* comparison brands */
  --signal-red: #ff7a7a;    /* miss / error */
  --gold: #d8b47a;

  /* Nebula glows — subtle, never saturated */
  --glow-stellar: 0 0 14px rgba(110, 208, 255, 0.45), 0 0 38px rgba(110, 208, 255, 0.16);
  --glow-ember: 0 0 12px rgba(240, 184, 120, 0.5);
  --glow-aurora: 0 0 14px rgba(139, 218, 176, 0.45);
  --glow-magenta: 0 0 14px rgba(194, 153, 240, 0.5);
  --glow-miss: 0 0 10px rgba(255, 122, 122, 0.35);

  --elev-shadow:
    0 28px 80px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 1px rgba(130, 170, 230, 0.06);

  --mono: "JetBrains Mono", "SF Mono", "Menlo", "Consolas", monospace;
  --serif: "Cormorant Garamond", "Playfair Display", "Noto Serif JP", Georgia, serif;
  --sans: "Inter", "Segoe UI", "Hiragino Sans", "Yu Gothic UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  letter-spacing: 0.005em;
  background: var(--void);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Global space backdrop — starfield + nebulae layers */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 55% at 18% 18%, rgba(88, 76, 180, 0.22), transparent 60%),
    radial-gradient(ellipse 60% 45% at 82% 76%, rgba(44, 120, 180, 0.18), transparent 60%),
    radial-gradient(ellipse 50% 30% at 60% 6%, rgba(180, 130, 220, 0.09), transparent 65%),
    radial-gradient(ellipse 90% 80% at 50% 120%, rgba(20, 40, 80, 0.6), transparent 65%),
    linear-gradient(180deg, #030511 0%, #060b1c 45%, #04070f 100%);
}

/* Thin star dust */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1px 1px at 12% 8%, rgba(255,255,255,0.9), transparent 60%),
    radial-gradient(1px 1px at 78% 14%, rgba(255,255,255,0.6), transparent 60%),
    radial-gradient(1px 1px at 22% 42%, rgba(255,255,255,0.7), transparent 60%),
    radial-gradient(1px 1px at 64% 34%, rgba(255,255,255,0.55), transparent 60%),
    radial-gradient(1.2px 1.2px at 89% 58%, rgba(255,255,255,0.85), transparent 60%),
    radial-gradient(1px 1px at 36% 72%, rgba(255,255,255,0.6), transparent 60%),
    radial-gradient(1px 1px at 56% 90%, rgba(255,255,255,0.7), transparent 60%),
    radial-gradient(1px 1px at 8% 86%, rgba(255,255,255,0.45), transparent 60%),
    radial-gradient(0.8px 0.8px at 45% 18%, rgba(200,220,255,0.9), transparent 60%),
    radial-gradient(0.8px 0.8px at 72% 64%, rgba(200,220,255,0.8), transparent 60%);
  opacity: 0.9;
  mix-blend-mode: screen;
  animation: drift 160s linear infinite;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-40px, -20px, 0); }
}

h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

/* =========================================================================
   Typography primitives
   ========================================================================= */

.callsign {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--stellar);
}

.callsign-dim {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.display-title {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 1.02;
}

.telemetry {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.telemetry b {
  color: var(--ink);
  font-weight: 600;
}

/* =========================================================================
   Mission Header — top HUD bar
   ========================================================================= */

.mission-bar {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
  padding: 20px 36px;
  border-bottom: 1px solid var(--hull-border);
  background:
    linear-gradient(180deg, rgba(8, 12, 26, 0.85), rgba(8, 12, 26, 0.4));
  backdrop-filter: blur(10px);
}

.mission-bar .left,
.mission-bar .right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.mission-bar .right { justify-content: flex-end; flex-wrap: wrap; }

.mission-emblem {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.mission-emblem .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--stellar);
  box-shadow: var(--glow-stellar);
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.82); }
}

.mission-center {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.mission-title {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.mission-sub {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.3em;
  color: var(--ink-dim);
  text-transform: uppercase;
}

.coord {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0.14em;
}

.ghost-link {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border: 1px solid var(--hull-border);
  padding: 9px 16px;
  border-radius: 2px;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.ghost-link:hover {
  color: var(--stellar);
  border-color: var(--hull-border-hot);
  background: rgba(110, 208, 255, 0.05);
}

/* =========================================================================
   Shell / layout
   ========================================================================= */

.control-shell {
  position: relative;
  z-index: 1;
  max-width: 1680px;
  margin: 0 auto;
  padding: 28px 36px 80px;
  display: grid;
  gap: 28px;
}

.flash {
  padding: 14px 18px;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-left: 2px solid var(--stellar);
  background: rgba(110, 208, 255, 0.06);
  color: var(--ink);
}
.flash-error {
  border-left-color: var(--signal-red);
  background: rgba(255, 122, 122, 0.06);
  color: #ffd0d0;
}
.flash-success {
  border-left-color: var(--aurora);
  background: rgba(139, 218, 176, 0.06);
}

/* =========================================================================
   Panel chrome — "bulkhead" style
   ========================================================================= */

.bulkhead {
  position: relative;
  background:
    linear-gradient(180deg, rgba(22, 30, 54, 0.58), rgba(12, 18, 34, 0.72));
  border: 1px solid var(--hull-border);
  border-radius: 3px;
  padding: 26px 28px;
  box-shadow: var(--elev-shadow);
}

.bulkhead::before,
.bulkhead::after {
  content: "";
  position: absolute;
  width: 10px; height: 10px;
  border: 1px solid var(--hull-border-hot);
}
.bulkhead::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.bulkhead::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.bulkhead-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hull-border);
}

.bulkhead-head .label {
  display: grid;
  gap: 6px;
}

.bulkhead-head h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: 0.01em;
}

.bulkhead-head p {
  font-size: 13px;
  color: var(--ink-dim);
  max-width: 58ch;
}

.bulkhead-head .right-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  text-align: right;
  display: grid;
  gap: 4px;
}

/* =========================================================================
   HERO / Orbit Briefing
   ========================================================================= */

.orbit-briefing {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 28px;
  align-items: stretch;
}

.briefing-copy {
  display: grid;
  align-content: start;
  gap: 22px;
}

.briefing-copy .display-title {
  font-size: clamp(34px, 3.8vw, 56px);
  max-width: 22ch;
}

.briefing-copy .lede {
  color: var(--ink-muted);
  line-height: 1.75;
  font-size: 15px;
  max-width: 56ch;
}

.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.telemetry-cell {
  position: relative;
  padding: 14px 16px;
  border: 1px solid var(--hull-border);
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(22,30,54,0.45), rgba(10,16,30,0.4));
  display: grid;
  gap: 8px;
}

.telemetry-cell .k {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.telemetry-cell .v {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.telemetry-cell.accent-stellar .v { color: var(--stellar); }
.telemetry-cell.accent-ember   .v { color: var(--ember); }
.telemetry-cell.accent-aurora  .v { color: var(--aurora); }
.telemetry-cell.accent-magenta .v { color: var(--magenta); }

/* Observatory preview in briefing */
.briefing-viz {
  position: relative;
  min-height: 320px;
  border: 1px solid var(--hull-border);
  border-radius: 2px;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 40%, rgba(110,208,255,0.14), transparent 55%),
    radial-gradient(circle at 72% 70%, rgba(194,153,240,0.12), transparent 55%),
    linear-gradient(180deg, #060a18, #080f22);
}

.briefing-viz .corner-tick {
  position: absolute;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ink-dim);
}
.briefing-viz .tl { top: 12px; left: 14px; }
.briefing-viz .tr { top: 12px; right: 14px; }
.briefing-viz .bl { bottom: 12px; left: 14px; }
.briefing-viz .br { bottom: 12px; right: 14px; }

/* =========================================================================
   SEARCH LANDSCAPE MAP — observatory canvas
   ========================================================================= */

.landscape-shell {
  position: relative;
  height: 560px;
  border: 1px solid var(--hull-border);
  border-radius: 2px;
  overflow: hidden;
  background:
    radial-gradient(circle at 28% 40%, rgba(110,208,255,0.10), transparent 55%),
    radial-gradient(circle at 75% 65%, rgba(194,153,240,0.10), transparent 55%),
    radial-gradient(circle at 50% 50%, rgba(140,170,220,0.04), transparent 70%),
    linear-gradient(180deg, #050914 0%, #070d1e 100%);
}

/* Grid overlay — celestial latitude/longitude */
.landscape-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.6;
  pointer-events: none;
}

/* Orbital rings */
.landscape-shell svg.rings {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Axis labels */
.landscape-axis {
  position: absolute;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--ink-dim);
  text-transform: uppercase;
  pointer-events: none;
}
.landscape-axis.top-left     { top: 14px; left: 18px; }
.landscape-axis.top-right    { top: 14px; right: 18px; color: var(--stellar); }
.landscape-axis.bottom-left  { bottom: 14px; left: 18px; }
.landscape-axis.bottom-right { bottom: 14px; right: 18px; }

/* Star — one query */
.star {
  position: absolute;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  margin-top: -5px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, rgba(110,208,255,0.85) 45%, rgba(110,208,255,0) 75%);
  box-shadow: 0 0 0 1px rgba(110,208,255,0.3), 0 0 18px rgba(110,208,255,0.6);
  transition: transform 200ms ease;
  cursor: default;
}

.star.hit       { background: radial-gradient(circle, #ffffff, rgba(139,218,176,0.85) 45%, rgba(139,218,176,0) 75%); box-shadow: 0 0 0 1px rgba(139,218,176,0.3), 0 0 20px rgba(139,218,176,0.7); }
.star.miss      { background: radial-gradient(circle, rgba(230,236,247,0.95), rgba(120,140,180,0.4) 45%, transparent 75%); box-shadow: 0 0 0 1px rgba(120,140,180,0.25), 0 0 8px rgba(120,140,180,0.35); }
.star.hot       { box-shadow: 0 0 0 1px rgba(240,184,120,0.4), 0 0 26px rgba(240,184,120,0.8); background: radial-gradient(circle, #ffffff, rgba(240,184,120,0.95) 45%, rgba(240,184,120,0) 75%); }

.star-label {
  position: absolute;
  margin-left: 12px;
  margin-top: -9px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  opacity: 0.78;
}

.star-label small {
  display: block;
  color: var(--ink-dim);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 2px;
}

.star:hover          { transform: scale(1.4); }
.star:hover + .star-label { opacity: 1; color: var(--stellar); }

/* Constellation grouping badge */
.constellation-badge {
  position: absolute;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: rgba(230,236,247,0.5);
  pointer-events: none;
  letter-spacing: 0.04em;
}

/* Satellite / comparison brand orbiting marker */
.satellite {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--magenta);
  background: rgba(20, 14, 40, 0.7);
  border: 1px solid rgba(194, 153, 240, 0.4);
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.satellite::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--magenta);
  box-shadow: var(--glow-magenta);
}

/* Legend along bottom */
.landscape-legend {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 44px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(6,10,22,0.2), rgba(6,10,22,0.75));
  border-top: 1px solid var(--hull-border);
}

.legend-chip {
  display: inline-flex; align-items: center; gap: 8px;
}
.legend-chip::before {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
}
.legend-chip.cyan::before    { background: var(--stellar);  box-shadow: var(--glow-stellar); }
.legend-chip.aurora::before  { background: var(--aurora);   box-shadow: var(--glow-aurora); }
.legend-chip.ember::before   { background: var(--ember);    box-shadow: var(--glow-ember); }
.legend-chip.magenta::before { background: var(--magenta);  box-shadow: var(--glow-magenta); }
.legend-chip.dim::before     { background: rgba(180,200,230,0.4); }

/* Scan line sweep — subtle life */
.landscape-shell .sweep {
  position: absolute;
  top: -10%;
  left: -20%;
  width: 55%;
  height: 120%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(110, 208, 255, 0.035) 45%,
    rgba(110, 208, 255, 0.10) 50%,
    rgba(110, 208, 255, 0.035) 55%,
    transparent 100%);
  filter: blur(2px);
  pointer-events: none;
  animation: sweep 12s linear infinite;
  mix-blend-mode: screen;
}

@keyframes sweep {
  from { transform: translateX(-30%); }
  to   { transform: translateX(220%); }
}

/* Empty state for landscape when no result yet */
.landscape-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 10px;
  padding: 40px;
}

.landscape-empty .signal-ring {
  width: 140px; height: 140px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 1px solid rgba(110,208,255,0.25);
  position: relative;
}
.landscape-empty .signal-ring::before,
.landscape-empty .signal-ring::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  border: 1px solid rgba(110,208,255,0.15);
}
.landscape-empty .signal-ring::after {
  inset: 40px;
  border-color: rgba(110,208,255,0.4);
  animation: pulse 3s ease-in-out infinite;
}

.landscape-empty h4 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 22px;
}

.landscape-empty p {
  color: var(--ink-dim);
  font-size: 13px;
  max-width: 40ch;
  margin: 0 auto;
  line-height: 1.7;
}

/* =========================================================================
   GALAXY MAP — per-target observatory (run_detail)
   A realistic spiral galaxy: core bulge, dust lanes, procedural arm stars,
   query-stars at rank-driven radii, pan + wheel zoom with progressive labels.
   ========================================================================= */

.galaxy-frame {
  position: relative;
  border: 1px solid var(--hull-border);
  border-radius: 2px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 85% 70% at 50% 55%, rgba(40, 22, 60, 0.45), transparent 55%),
    radial-gradient(ellipse 55% 40% at 72% 32%, rgba(90, 32, 64, 0.22), transparent 60%),
    radial-gradient(ellipse 45% 35% at 24% 70%, rgba(22, 42, 88, 0.32), transparent 60%),
    linear-gradient(180deg, #020308 0%, #040715 50%, #020308 100%);
}

.galaxy-viewport {
  position: relative;
  height: 680px;
  width: 100%;
  overflow: hidden;
  cursor: grab;
  user-select: none;
}
.galaxy-viewport:active { cursor: grabbing; }

.galaxy {
  position: absolute;
  inset: 0;
  transform-origin: center center;
  transition: transform 80ms linear;
  will-change: transform;
}

/* Galactic plane — flatten into disk */
.galactic-plane {
  position: absolute;
  inset: 0;
  transform: scaleY(0.56);
}

/* Nebula colored clouds */
.galaxy-nebula {
  position: absolute;
  inset: -10%;
  pointer-events: none;
  background:
    radial-gradient(ellipse 28% 24% at 34% 44%, rgba(180, 80, 120, 0.28), transparent 65%),
    radial-gradient(ellipse 22% 18% at 66% 56%, rgba(90, 60, 180, 0.22), transparent 65%),
    radial-gradient(ellipse 16% 12% at 52% 40%, rgba(255, 180, 130, 0.12), transparent 70%),
    radial-gradient(ellipse 14% 12% at 48% 62%, rgba(80, 130, 210, 0.18), transparent 70%);
  filter: blur(16px);
  mix-blend-mode: screen;
  opacity: 0.85;
}

/* Dust lanes — dark curving bands */
.galaxy-dust {
  position: absolute;
  left: 50%; top: 50%;
  width: 1100px; height: 1100px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  background:
    radial-gradient(ellipse 48% 6% at 50% 50%, rgba(0,0,0,0.85), transparent 75%);
  filter: blur(4px);
  opacity: 0.55;
}
.galaxy-dust.lane-2 {
  transform: translate(-50%, -50%) rotate(18deg);
  background: radial-gradient(ellipse 42% 4% at 50% 50%, rgba(10,5,20,0.65), transparent 78%);
  opacity: 0.4;
}
.galaxy-dust.lane-3 {
  transform: translate(-50%, -50%) rotate(-22deg);
  background: radial-gradient(ellipse 38% 3.5% at 50% 50%, rgba(10,5,20,0.5), transparent 80%);
  opacity: 0.3;
}

/* Galactic core — bright bulge */
.galaxy-core {
  position: absolute;
  left: 50%; top: 50%;
  width: 340px; height: 220px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(ellipse 50% 50% at 50% 50%,
      rgba(255, 248, 220, 0.95) 0%,
      rgba(255, 220, 170, 0.7) 12%,
      rgba(230, 170, 120, 0.45) 28%,
      rgba(180, 110, 80, 0.2) 55%,
      transparent 100%);
  filter: blur(2px);
  z-index: 3;
}

.galaxy-core::after {
  content: "";
  position: absolute;
  inset: 40% 42%;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, rgba(255,240,200,0.9) 40%, transparent 80%);
  filter: blur(1px);
}

/* Procedural star layer (JS-populated) */
.galaxy-stars {
  position: absolute;
  left: 50%; top: 50%;
  width: 0; height: 0;
  pointer-events: none;
  z-index: 2;
}

.bg-star {
  position: absolute;
  left: 0; top: 0;
  border-radius: 50%;
  pointer-events: none;
}

/* Query star — one per query, rank & hit-rate driven */
.query-star {
  position: absolute;
  left: 50%; top: 50%;
  width: 0; height: 0;
  transform: rotate(var(--angle)) translate(var(--radius)) rotate(calc(-1 * var(--angle)));
  z-index: 5;
}

.query-star .glyph {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: auto;
  cursor: crosshair;
  transition: transform 160ms ease;
}

.query-star[data-rank="1"] .glyph {
  background: radial-gradient(circle, #ffffff 0%, rgba(255, 230, 180, 0.9) 35%, rgba(255, 210, 140, 0) 70%);
  box-shadow: 0 0 0 1px rgba(255, 220, 170, 0.4), 0 0 22px rgba(255, 210, 140, 0.85), 0 0 55px rgba(255, 160, 90, 0.45);
}
.query-star[data-rank="2"] .glyph {
  background: radial-gradient(circle, #ffffff 0%, rgba(180, 220, 255, 0.9) 40%, rgba(140, 190, 255, 0) 70%);
  box-shadow: 0 0 0 1px rgba(160, 210, 255, 0.35), 0 0 14px rgba(140, 200, 255, 0.7);
}
.query-star[data-rank="3"] .glyph {
  background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(200, 220, 255, 0.7) 45%, transparent 75%);
  box-shadow: 0 0 0 1px rgba(180, 210, 255, 0.25), 0 0 8px rgba(160, 200, 255, 0.5);
}
.query-star[data-rank="4"] .glyph {
  background: radial-gradient(circle, rgba(255,255,255,0.85) 0%, rgba(190, 205, 230, 0.5) 50%, transparent 80%);
  box-shadow: 0 0 4px rgba(160, 190, 230, 0.4);
}
.query-star.miss .glyph {
  background: radial-gradient(circle, rgba(200,210,230,0.7) 0%, rgba(120,140,170,0.35) 50%, transparent 85%);
  box-shadow: 0 0 4px rgba(100,120,160,0.3);
  opacity: 0.6;
}

.query-star .glyph:hover {
  transform: translate(-50%, -50%) scale(1.35);
  z-index: 10;
}

.query-star .label {
  position: absolute;
  left: 14px;
  top: -8px;
  display: grid;
  gap: 2px;
  padding: 4px 10px 5px;
  background: linear-gradient(180deg, rgba(6, 10, 22, 0.92), rgba(6, 10, 22, 0.78));
  border: 1px solid rgba(150, 195, 255, 0.18);
  border-left: 2px solid var(--stellar);
  border-radius: 2px;
  white-space: nowrap;
  max-width: 320px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
  transform-origin: left center;
}

.query-star[data-rank="1"] .label { border-left-color: #ffd89a; }
.query-star[data-rank="2"] .label { border-left-color: var(--stellar); }
.query-star[data-rank="3"] .label { border-left-color: rgba(194, 153, 240, 0.6); }
.query-star[data-rank="4"] .label { border-left-color: rgba(200, 210, 230, 0.3); }

.query-star .label .txt {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.query-star .label .stat {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.query-star .label .stat b {
  color: var(--ember);
  font-weight: 500;
}

/* Zoom-level based label visibility — Google Maps style */
.galaxy[data-level="1"] .query-star[data-rank="1"] .label { opacity: 1; }
.galaxy[data-level="2"] .query-star[data-rank="1"] .label,
.galaxy[data-level="2"] .query-star[data-rank="2"] .label { opacity: 1; }
.galaxy[data-level="3"] .query-star[data-rank="1"] .label,
.galaxy[data-level="3"] .query-star[data-rank="2"] .label,
.galaxy[data-level="3"] .query-star[data-rank="3"] .label { opacity: 1; }
.galaxy[data-level="4"] .query-star .label { opacity: 1; }

/* Also dim the faint stars themselves at far zoom so they read as backdrop */
.galaxy[data-level="1"] .query-star[data-rank="3"] .glyph,
.galaxy[data-level="1"] .query-star[data-rank="4"] .glyph {
  opacity: 0.6;
}

/* Target brand core label */
.galaxy-target-label {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, calc(110px + -50%));
  text-align: center;
  pointer-events: none;
  z-index: 4;
}
.galaxy-target-label .callsign-dim {
  color: rgba(255, 240, 200, 0.75);
}
.galaxy-target-label .name {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink);
  letter-spacing: 0.06em;
  margin-top: 4px;
}

/* Comparison brand satellites — wide orbits outside galactic disc */
.sat-orbit {
  position: absolute;
  left: 50%; top: 50%;
  pointer-events: none;
  border: 1px dashed rgba(194, 153, 240, 0.22);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.sat-marker {
  position: absolute;
  left: 50%; top: 50%;
  transform: rotate(var(--angle)) translate(var(--radius)) rotate(calc(-1 * var(--angle)));
  z-index: 6;
}

.sat-marker .sat-glyph {
  position: absolute;
  width: 8px; height: 8px;
  margin-left: -4px; margin-top: -4px;
  border-radius: 50%;
  background: var(--magenta);
  box-shadow: var(--glow-magenta);
}

.sat-marker .sat-tag {
  position: absolute;
  left: 12px; top: -8px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--magenta);
  background: rgba(18, 10, 30, 0.85);
  border: 1px solid rgba(194, 153, 240, 0.4);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

/* HUD overlays */
.galaxy-hud-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  pointer-events: none;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-dim);
  z-index: 20;
}

.galaxy-hud-top .tick b {
  color: var(--stellar);
  font-weight: 500;
}

.galaxy-crosshair {
  position: absolute;
  left: 50%; top: 50%;
  width: 140px; height: 140px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 4;
  opacity: 0.4;
}
.galaxy-crosshair::before,
.galaxy-crosshair::after {
  content: "";
  position: absolute;
  background: rgba(110, 208, 255, 0.3);
}
.galaxy-crosshair::before { top: 50%; left: 0; right: 0; height: 1px; }
.galaxy-crosshair::after  { left: 50%; top: 0; bottom: 0; width: 1px; }

/* Zoom controls */
.galaxy-controls {
  position: absolute;
  right: 18px;
  bottom: 64px;
  display: grid;
  gap: 6px;
  z-index: 22;
}

.galaxy-controls button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--hull-border);
  background: rgba(10, 16, 30, 0.85);
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 14px;
  cursor: pointer;
  border-radius: 2px;
  transition: all 180ms ease;
  backdrop-filter: blur(6px);
}

.galaxy-controls button:hover {
  border-color: var(--stellar);
  color: var(--stellar);
  box-shadow: 0 0 14px rgba(110, 208, 255, 0.25);
}

/* Galaxy legend — bottom bar */
.galaxy-legend {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 14px;
  padding: 10px 16px;
  border: 1px solid var(--hull-border);
  background: linear-gradient(180deg, rgba(6, 10, 22, 0.6), rgba(6, 10, 22, 0.88));
  backdrop-filter: blur(6px);
  border-radius: 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  z-index: 20;
}

.galaxy-legend .spacer { flex: 1; }

.galaxy-legend .tier {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.galaxy-legend .tier::before {
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
}

.galaxy-legend .tier.anchor::before {
  background: #ffe3a8;
  box-shadow: 0 0 10px rgba(255, 210, 140, 0.85);
}
.galaxy-legend .tier.solid::before {
  background: #b0d0ff;
  box-shadow: 0 0 8px rgba(160, 200, 255, 0.6);
}
.galaxy-legend .tier.weak::before {
  background: rgba(200, 210, 230, 0.6);
}
.galaxy-legend .tier.miss::before {
  background: rgba(140, 150, 170, 0.5);
}
.galaxy-legend .tier.sat::before {
  background: var(--magenta);
  box-shadow: var(--glow-magenta);
}

.galaxy-legend .zoom-indicator {
  font-family: var(--mono);
  letter-spacing: 0.2em;
  color: var(--ink-muted);
}
.galaxy-legend .zoom-indicator b {
  color: var(--stellar);
  font-weight: 500;
}

/* Empty state for galaxy */
.galaxy-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 40px;
  z-index: 30;
}

.galaxy-empty h4 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  margin-top: 18px;
}

.galaxy-empty p {
  color: var(--ink-dim);
  font-size: 13px;
  max-width: 44ch;
  line-height: 1.7;
  margin: 10px auto 0;
}

/* =========================================================================
   COMMAND CENTER — input form
   ========================================================================= */

.command-center {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
}

.mission-form {
  display: grid;
  gap: 22px;
}

.form-cluster-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--stellar);
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}

.form-cluster-label::before {
  content: "▸";
  color: var(--stellar);
  opacity: 0.65;
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field-full { grid-column: 1 / -1; }

.field > span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.field input,
.field textarea {
  background: rgba(6, 10, 22, 0.65);
  border: 1px solid var(--hull-border);
  border-bottom: 1px solid rgba(150, 195, 255, 0.28);
  border-radius: 2px;
  color: var(--ink);
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
  outline: none;
}

.field input::placeholder {
  color: var(--ink-faint);
  font-family: var(--mono);
}

.field input:focus,
.field textarea:focus {
  border-color: var(--stellar);
  background: rgba(8, 14, 30, 0.9);
  box-shadow: 0 0 0 1px rgba(110,208,255,0.35), 0 0 20px rgba(110,208,255,0.15);
}

.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 10px 14px;
  border: 1px solid var(--hull-border);
  border-radius: 2px;
  cursor: pointer;
  user-select: none;
}

.toggle input {
  appearance: none;
  width: 14px; height: 14px;
  border: 1px solid var(--ink-dim);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
}

.toggle input:checked {
  border-color: var(--stellar);
  background: var(--stellar);
  box-shadow: var(--glow-stellar);
}

/* Provider chips — orbital layers */
.provider-orbits {
  display: grid;
  gap: 12px;
}

.provider-orbit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.provider-chip {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--hull-border);
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(18, 26, 48, 0.6), rgba(10, 16, 30, 0.6));
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease;
}

.provider-chip input {
  position: absolute; opacity: 0; pointer-events: none;
}

.provider-chip span {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}

.provider-chip span::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ink-faint);
  box-shadow: none;
  transition: all 180ms ease;
}

.provider-chip small {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.provider-chip:has(input:checked) {
  border-color: var(--hull-border-hot);
  background: linear-gradient(180deg, rgba(30, 48, 84, 0.6), rgba(12, 20, 38, 0.7));
}

.provider-chip:has(input:checked) span::before {
  background: var(--stellar);
  box-shadow: var(--glow-stellar);
}

.provider-chip-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Primary ignition button */
.ignite-button {
  position: relative;
  border: 1px solid var(--stellar);
  background: linear-gradient(180deg, rgba(110,208,255,0.18), rgba(110,208,255,0.06));
  color: var(--ink);
  padding: 16px 32px;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
  box-shadow: 0 0 0 1px rgba(110,208,255,0.18), 0 0 30px rgba(110,208,255,0.12);
  transition: all 200ms ease;
  justify-self: start;
}

.ignite-button::before {
  content: "◉";
  color: var(--stellar);
  font-size: 10px;
}

.ignite-button:hover {
  background: linear-gradient(180deg, rgba(110,208,255,0.28), rgba(110,208,255,0.08));
  box-shadow: 0 0 0 1px rgba(110,208,255,0.4), 0 0 40px rgba(110,208,255,0.25);
}

/* Danger button */
.abort-button {
  background: transparent;
  border: 1px solid rgba(255,122,122,0.35);
  color: var(--signal-red);
  padding: 8px 14px;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 180ms ease;
}
.abort-button:hover {
  background: rgba(255,122,122,0.08);
  box-shadow: var(--glow-miss);
}

/* Command summary panel (right side of command center) */
.command-summary {
  display: grid;
  gap: 14px;
  align-content: start;
}

.summary-card {
  border: 1px solid var(--hull-border);
  border-radius: 2px;
  padding: 18px 20px;
  background: linear-gradient(180deg, rgba(16, 24, 44, 0.55), rgba(10, 16, 30, 0.55));
}

.summary-card h4 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 12px;
}

.summary-card ul {
  list-style: none;
  padding: 0; margin: 0;
  display: grid; gap: 10px;
}

.summary-card li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-left: 1px solid var(--hull-border);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.summary-card li b {
  color: var(--stellar);
  font-weight: 600;
}

/* =========================================================================
   MISSION LOG / PROMPT LAB — attempts
   ========================================================================= */

.mission-log {
  display: grid;
  gap: 14px;
}

.log-entry {
  position: relative;
  padding: 22px 26px;
  border: 1px solid var(--hull-border);
  border-left: 2px solid var(--ember);
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(16, 24, 44, 0.5), rgba(8, 14, 28, 0.6));
  display: grid;
  gap: 18px;
}

.log-entry.ok    { border-left-color: var(--aurora); }
.log-entry.miss  { border-left-color: var(--signal-red); }

.log-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: start;
}

.log-head .main .query {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 10px;
}

.log-head .main .meta {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-dim);
  display: flex; flex-wrap: wrap; gap: 14px;
}

.log-head .main .meta .sep { color: var(--ink-faint); }

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  padding: 7px 12px;
  border-radius: 2px;
  border: 1px solid;
  white-space: nowrap;
}

.status-tag.hit {
  color: var(--aurora);
  border-color: rgba(139,218,176,0.45);
  background: rgba(139,218,176,0.06);
}
.status-tag.hit::before {
  content: "◉"; color: var(--aurora);
}

.status-tag.miss {
  color: var(--signal-red);
  border-color: rgba(255,122,122,0.4);
  background: rgba(255,122,122,0.06);
}
.status-tag.miss::before {
  content: "◌"; color: var(--signal-red);
}

.log-telemetry {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding: 10px 0;
  border-top: 1px dashed var(--hull-border);
  border-bottom: 1px dashed var(--hull-border);
}

.log-telemetry b {
  color: var(--ember);
  font-weight: 600;
  margin-left: 8px;
}

.log-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.log-block {
  padding: 16px 18px;
  border: 1px solid var(--hull-border);
  border-radius: 2px;
  background: rgba(6, 10, 22, 0.55);
}

.log-block h5 {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0 0 12px;
  display: flex; align-items: center; gap: 10px;
}

.log-block h5::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--stellar);
  box-shadow: var(--glow-stellar);
  border-radius: 50%;
}

.log-block.response h5::before { background: var(--ember); box-shadow: var(--glow-ember); }

.log-block pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink-muted);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 360px;
  overflow-y: auto;
}

.log-block pre::-webkit-scrollbar       { width: 6px; }
.log-block pre::-webkit-scrollbar-track { background: transparent; }
.log-block pre::-webkit-scrollbar-thumb { background: rgba(110,208,255,0.2); border-radius: 2px; }

.error-copy {
  color: var(--signal-red);
  font-family: var(--mono);
  font-size: 12px;
}

.log-foot {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

/* =========================================================================
   BRAND FLEET — saved brands
   ========================================================================= */

.fleet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.fleet-card {
  position: relative;
  border: 1px solid var(--hull-border);
  border-radius: 2px;
  padding: 22px;
  background: linear-gradient(180deg, rgba(18, 26, 48, 0.55), rgba(10, 16, 30, 0.55));
  overflow: hidden;
}

.fleet-card::before {
  content: "";
  position: absolute;
  top: -40px; right: -40px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(110,208,255,0.2), transparent 65%);
  pointer-events: none;
}

.fleet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.fleet-head h4 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.2;
}

.fleet-rate {
  font-family: var(--mono);
  font-size: 22px;
  color: var(--stellar);
  letter-spacing: 0.02em;
}

.fleet-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.fleet-metrics div {
  border: 1px solid var(--hull-border);
  border-radius: 2px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
  display: flex; justify-content: space-between;
}

.fleet-metrics b { color: var(--ink); font-weight: 600; }

.fleet-queries {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-muted);
  line-height: 1.8;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px dashed var(--hull-border);
  padding-top: 12px;
  display: grid;
  gap: 4px;
}

.fleet-queries li::before {
  content: "↳ ";
  color: var(--stellar);
  margin-right: 4px;
  opacity: 0.7;
}

/* =========================================================================
   RUN ARCHIVE (library)
   ========================================================================= */

.archive-list {
  display: grid; gap: 16px;
}

.archive-card {
  border: 1px solid var(--hull-border);
  border-radius: 2px;
  padding: 24px 26px;
  background: linear-gradient(180deg, rgba(16, 24, 44, 0.5), rgba(8, 14, 28, 0.6));
  display: grid; gap: 18px;
}

.archive-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.archive-head h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
  margin-bottom: 6px;
}

.archive-head .started {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.archive-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.archive-actions form { margin: 0; }

.archive-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.archive-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding-top: 12px;
  border-top: 1px dashed var(--hull-border);
}

/* =========================================================================
   RUN HISTORY — mini rows
   ========================================================================= */

.run-timeline {
  display: grid; gap: 8px;
}

.run-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 14px 18px;
  border: 1px solid var(--hull-border);
  border-radius: 2px;
  background: rgba(12, 18, 34, 0.5);
  transition: border-color 180ms ease, background 180ms ease;
}

.run-row:hover {
  border-color: var(--hull-border-hot);
  background: rgba(18, 28, 52, 0.65);
}

.run-row .orbit {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--stellar);
  position: relative;
  flex: none;
}
.run-row .orbit::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--stellar);
  box-shadow: var(--glow-stellar);
}

.run-row .info strong {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 18px;
  color: var(--ink);
}

.run-row .info strong a { color: inherit; }

.run-row .info p {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.run-row .meta {
  text-align: right;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: grid;
  gap: 4px;
}

/* =========================================================================
   Query rows / Mini tables (run detail)
   ========================================================================= */

.query-table {
  display: grid; gap: 8px;
}

.query-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  border: 1px solid var(--hull-border);
  border-radius: 2px;
  background: rgba(12, 18, 34, 0.48);
}

.query-row .q {
  font-family: var(--serif);
  font-size: 17px;
}
.query-row .q small {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.query-row .nums {
  display: flex;
  gap: 18px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
}
.query-row .nums b { color: var(--stellar); }

/* Compare mini-row */
.compare-list { display: grid; gap: 8px; }

.compare-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 18px;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid var(--hull-border);
  border-radius: 2px;
  background: rgba(12, 18, 34, 0.5);
}

.compare-row strong {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 400;
}

.compare-row .rate {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--stellar);
  letter-spacing: 0.04em;
}

.compare-row .m {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

/* =========================================================================
   Empty state
   ========================================================================= */

.empty-state {
  padding: 34px;
  border: 1px dashed var(--hull-border);
  border-radius: 2px;
  text-align: center;
  background: rgba(8, 14, 28, 0.4);
}

.empty-state h4 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--ink-dim);
  font-size: 13.5px;
  line-height: 1.7;
  max-width: 50ch;
  margin: 0 auto;
}

/* =========================================================================
   LOGIN / PRE-LAUNCH
   ========================================================================= */

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 560px) 1fr;
  position: relative;
  z-index: 1;
}

.login-pane {
  padding: 64px 56px;
  display: grid;
  align-content: center;
  gap: 28px;
  border-right: 1px solid var(--hull-border);
  background: linear-gradient(180deg, rgba(6, 10, 22, 0.7), rgba(6, 10, 22, 0.3));
  backdrop-filter: blur(6px);
}

.login-pane .mission-emblem { margin-bottom: 24px; }

.login-pane h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 4.2vw, 56px);
  line-height: 1.04;
  letter-spacing: 0.005em;
}

.login-pane .lead {
  color: var(--ink-muted);
  line-height: 1.8;
  font-size: 15px;
  max-width: 48ch;
}

.login-form {
  display: grid;
  gap: 14px;
  max-width: 420px;
}

.login-form label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.login-form input {
  background: rgba(6, 10, 22, 0.7);
  border: 1px solid var(--hull-border);
  border-bottom-color: var(--stellar);
  color: var(--ink);
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.06em;
  border-radius: 2px;
  outline: none;
  transition: all 200ms ease;
}
.login-form input:focus {
  border-color: var(--stellar);
  box-shadow: 0 0 0 1px rgba(110,208,255,0.25);
}

.credits {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 28px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.credits span { display: inline-flex; align-items: center; gap: 8px; }
.credits span::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--stellar); box-shadow: var(--glow-stellar);
}

/* Right visual — observatory preview */
.login-viz {
  position: relative;
  overflow: hidden;
  min-height: 540px;
  background:
    radial-gradient(circle at 30% 40%, rgba(110,208,255,0.16), transparent 55%),
    radial-gradient(circle at 72% 70%, rgba(194,153,240,0.14), transparent 55%);
}

.login-viz svg.rings {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.login-viz .viz-copy {
  position: absolute;
  bottom: 44px;
  left: 44px;
  right: 44px;
  display: grid;
  gap: 12px;
}

.login-viz .viz-copy h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1.2;
  max-width: 26ch;
  color: var(--ink);
}

.login-viz .viz-ticks {
  position: absolute;
  top: 24px; right: 24px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  text-align: right;
  display: grid; gap: 4px;
}

/* =========================================================================
   LAUNCH MODAL / PROGRESS — ignition sequence while scan runs in background
   ========================================================================= */

.launch-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.launch-modal.is-open { display: flex; }

.launch-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 50%, rgba(20, 30, 60, 0.4), transparent 70%),
    rgba(2, 4, 10, 0.78);
  backdrop-filter: blur(10px);
}

.launch-dialog {
  position: relative;
  width: min(560px, 100%);
  padding: 40px 44px 36px;
  border: 1px solid var(--hull-border-hot);
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(24, 34, 62, 0.72), rgba(10, 14, 28, 0.85));
  box-shadow:
    0 40px 120px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(110, 208, 255, 0.12),
    inset 0 0 60px rgba(110, 208, 255, 0.05);
  text-align: center;
  animation: launch-in 260ms ease-out;
}

.launch-dialog::before,
.launch-dialog::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border: 1px solid var(--stellar);
}
.launch-dialog::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.launch-dialog::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

@keyframes launch-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.launch-dialog h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.2;
  margin-top: 10px;
}

.launch-dialog .callsign {
  color: var(--stellar);
}

.launch-sub {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-top: 8px;
}

.launch-hint {
  margin-top: 18px;
  font-size: 13px;
  color: var(--ink-dim);
  line-height: 1.7;
  max-width: 44ch;
  margin-left: auto;
  margin-right: auto;
}

.launch-error {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 122, 122, 0.35);
  border-left: 2px solid var(--signal-red);
  background: rgba(255, 122, 122, 0.06);
  color: #ffd0d0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-align: left;
  border-radius: 2px;
}

/* Ignition ring — triple concentric pulses */
.launch-ring {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 20px;
}
.launch-ring span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--stellar);
  opacity: 0;
  animation: ring-pulse 2.4s ease-out infinite;
}
.launch-ring span:nth-child(2) { animation-delay: 0.8s; }
.launch-ring span:nth-child(3) { animation-delay: 1.6s; }
.launch-ring::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  background: radial-gradient(circle, #ffffff 0%, var(--stellar) 60%, rgba(110,208,255,0) 100%);
  border-radius: 50%;
  box-shadow: var(--glow-stellar);
}
@keyframes ring-pulse {
  0%   { transform: scale(0.3); opacity: 0.9; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* Progress bar */
.launch-bar {
  position: relative;
  margin: 26px auto 0;
  width: 100%;
  height: 6px;
  border: 1px solid var(--hull-border);
  border-radius: 999px;
  background: rgba(6, 10, 22, 0.8);
  overflow: hidden;
}

.launch-bar-fill {
  position: relative;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(110,208,255,0.8), rgba(140, 210, 255, 1));
  box-shadow: 0 0 14px rgba(110, 208, 255, 0.7);
  transition: width 400ms ease;
  border-radius: 999px;
}

.launch-bar-fill::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  right: 0; bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.45) 50%,
    transparent 100%);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  animation: bar-sheen 1.4s linear infinite;
}

@keyframes bar-sheen {
  0%   { background-position: -40% 0; }
  100% { background-position: 140% 0; }
}

/* Indeterminate mode — used while Brand Intelligence is still "understanding"
   the product and there is no completed/total yet. */
.launch-bar.is-indeterminate .launch-bar-fill {
  width: 40% !important;
  background: linear-gradient(
    90deg,
    rgba(110, 208, 255, 0) 0%,
    rgba(194, 153, 240, 0.85) 50%,
    rgba(110, 208, 255, 0) 100%);
  box-shadow: 0 0 16px rgba(194, 153, 240, 0.55);
  animation: bar-indeterminate 1.8s ease-in-out infinite;
  transition: none;
}
.launch-bar.is-indeterminate .launch-bar-fill::after { display: none; }

@keyframes bar-indeterminate {
  0%   { transform: translateX(-110%); }
  100% { transform: translateX(260%); }
}

/* Phase stepper (Brand Intelligence → Scanning → Locked) */
.launch-phase-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 14px auto 0;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.launch-phase-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(6, 10, 22, 0.55);
  transition: color 250ms ease, border-color 250ms ease, background 250ms ease;
}

.launch-phase-step .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: none;
  transition: background 250ms ease, box-shadow 250ms ease;
}

.launch-phase-step.is-active {
  color: var(--ink);
  border-color: rgba(194, 153, 240, 0.55);
  background: rgba(194, 153, 240, 0.08);
}

.launch-phase-step.is-active .dot {
  background: var(--aurora);
  box-shadow: 0 0 10px rgba(194, 153, 240, 0.9);
  animation: phase-pulse 1.4s ease-in-out infinite;
}

.launch-phase-step.is-done {
  color: var(--ink-dim);
  border-color: rgba(110, 208, 255, 0.35);
}

.launch-phase-step.is-done .dot {
  background: var(--stellar);
  box-shadow: 0 0 8px rgba(110, 208, 255, 0.65);
}

.launch-phase-sep {
  color: var(--ink-faint);
  font-size: 11px;
}

@keyframes phase-pulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(1.4); opacity: 0.55; }
}

/* Telemetry stat grid inside modal */
.launch-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 20px;
}

.launch-stats > div {
  border: 1px solid var(--hull-border);
  border-radius: 2px;
  padding: 10px 8px;
  background: rgba(6, 10, 22, 0.55);
  display: grid;
  gap: 4px;
}

.launch-stats .k {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.launch-stats .v {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
  letter-spacing: 0.04em;
}

@media (max-width: 560px) {
  .launch-dialog { padding: 28px 22px; }
  .launch-dialog h3 { font-size: 24px; }
  .launch-stats { grid-template-columns: 1fr 1fr; }
}

/* No-JS fallback: full-page launch panel */
.launch-panel {
  min-height: 60vh;
  display: grid;
  place-items: center;
}

.launch-panel .launch-core {
  text-align: center;
  max-width: 560px;
}

/* =========================================================================
   Responsive
   ========================================================================= */

@media (max-width: 1120px) {
  .orbit-briefing,
  .command-center {
    grid-template-columns: 1fr;
  }
  .log-pair { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .mission-bar {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 18px 20px;
    text-align: left;
  }
  .mission-bar .right { justify-content: flex-start; }
  .mission-center { justify-items: start; }

  .control-shell { padding: 20px; }
  .bulkhead { padding: 22px; }

  .landscape-shell { height: 440px; }

  .input-grid { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: 1fr; }
  .login-pane  { padding: 40px 24px; }
  .login-viz   { min-height: 280px; }
}
