:root {
  color-scheme: light;
  --bg-canvas: #f8f9fc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --border-subtle: rgba(15, 23, 42, 0.11);
  --border-strong: rgba(15, 23, 42, 0.22);
  --ink-primary: #0f172a;
  --ink-secondary: #475569;
  --ink-muted: #64748b;
  --iris: #4f46e5;
  --iris-light: #6366f1;
  --iris-soft: rgba(79, 70, 229, 0.11);
  --rose: #e11d48;
  --rose-soft: rgba(225, 29, 72, 0.10);
  --amber: #b45309;
  --amber-soft: rgba(217, 119, 6, 0.11);
  --violet: #6d28d9;
  --violet-soft: rgba(109, 40, 217, 0.10);
  --emerald: #059669;
  --emerald-soft: rgba(5, 150, 105, 0.10);
  --font-display: 'Space Grotesk', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(900px circle at 40% 44%, rgba(99, 102, 241, 0.09), transparent 62%),
    radial-gradient(640px circle at 84% 12%, rgba(236, 72, 153, 0.06), transparent 55%),
    radial-gradient(640px circle at 16% 80%, rgba(14, 165, 233, 0.06), transparent 55%),
    var(--bg-canvas);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
.muted { color: var(--ink-muted); }
.small { font-size: 12px; }
.mono-kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 700;
}

.glass-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  background: rgba(248, 249, 252, 0.88);
  border-bottom: 1px solid var(--border-subtle);
}
.bar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.brand-lock { display: flex; align-items: center; gap: 10px; }
.core-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--iris);
  box-shadow: 0 0 10px rgba(79, 70, 229, 0.45);
}
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--ink-primary); }
.brand-sub { font-size: 11.5px; color: var(--ink-secondary); }

.nav-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-pill {
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-secondary);
  text-decoration: none;
  border: 1px solid transparent;
  transition: 0.18s ease;
}
.nav-pill:hover { color: var(--ink-primary); background: var(--bg-surface); border-color: var(--border-subtle); }
.nav-pill.active {
  color: var(--iris);
  background: var(--iris-soft);
  border-color: rgba(79, 70, 229, 0.25);
  font-weight: 700;
}

.bar-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-input {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 6px 13px;
  color: var(--ink-primary);
  font-size: 12.5px;
  width: 176px;
  outline: none;
}
.search-input:focus { border-color: var(--iris); }
.view-toggle {
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding: 2px;
}
.toggle-btn {
  border: 0;
  background: transparent;
  color: var(--ink-secondary);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.toggle-btn.active { background: var(--iris); color: #ffffff; }
.viewer-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--emerald);
}
.btn-ghost-light {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--ink-secondary);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.btn-ghost-light:hover { border-color: var(--border-strong); color: var(--ink-primary); }

.universe-main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 18px 20px 26px;
}
.wrap-narrow { max-width: 720px; margin: 0 auto 14px; }

.orbit-layout {
  display: grid;
  grid-template-columns: 1fr 356px;
  gap: 20px;
  align-items: center;
}
@media (max-width: 1060px) {
  .orbit-layout { grid-template-columns: 1fr; }
}

.orbit-canvas {
  position: relative;
  width: 100%;
  height: 550px;
  border-radius: 26px;
  border: 1px solid var(--border-subtle);
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.98) 0%, rgba(241, 245, 251, 0.85) 100%);
  box-shadow: 0 20px 55px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}
@media (max-width: 680px) {
  .orbit-canvas { height: 420px; }
}

.ring {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}
.ring-inner {
  width: 46%;
  height: 50%;
  border: 1.5px solid rgba(225, 29, 72, 0.25);
  box-shadow: inset 0 0 24px rgba(225, 29, 72, 0.04);
}
.ring-mid {
  width: 68%;
  height: 70%;
  border: 1.4px solid rgba(79, 70, 229, 0.22);
}
.ring-outer {
  width: 84%;
  height: 84%;
  border: 1.5px dashed rgba(100, 116, 139, 0.25);
}

.orbit-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
.spoke-line {
  stroke: rgba(79, 70, 229, 0.16);
  stroke-width: 1.4;
  stroke-dasharray: 4 5;
  transition: stroke 0.2s ease, stroke-width 0.2s ease;
}
.spoke-line.spoke-urgent {
  stroke: rgba(225, 29, 72, 0.28);
}
.spoke-line.spoke-active {
  stroke: var(--iris);
  stroke-width: 2.3;
  stroke-dasharray: none;
}

.core-wrap {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
}
.core-halo {
  position: absolute;
  width: 176px;
  height: 176px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.22) 0%, rgba(168, 85, 247, 0.07) 55%, transparent 72%);
  pointer-events: none;
}
.intel-core {
  position: relative;
  z-index: 2;
  min-width: 124px;
  min-height: 104px;
  padding: 12px 16px;
  border-radius: 26px;
  border: 2px solid rgba(79, 70, 229, 0.34);
  background: linear-gradient(145deg, #ffffff 0%, #eef2ff 58%, #f5f3ff 100%);
  box-shadow:
    0 16px 36px rgba(79, 70, 229, 0.16),
    inset 0 2px 6px rgba(255, 255, 255, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.core-kicker {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--iris);
}
.core-metric {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.08;
  color: var(--ink-primary);
  margin: 2px 0;
}
.core-label { font-size: 11px; font-weight: 600; color: var(--ink-secondary); }
.core-sync { font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-muted); margin-top: 3px; }

.planets-layer { position: absolute; inset: 0; z-index: 5; }

/* COMPACT CIRCULAR PLANETS (NO WIDE OVERLAPPING OVALS) */
.planet {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  cursor: pointer;
  z-index: 6;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.planet:hover, .planet.active {
  transform: translate(-50%, -50%) scale(1.08);
  z-index: 14;
}
.planet.dimmed { opacity: 0.2; }

.planet-orb {
  position: relative;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.planet.level-URGENT .planet-orb {
  width: 52px;
  height: 52px;
  font-size: 13px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--rose), #be123c);
  border: 2px solid #ffffff;
  box-shadow: 0 8px 20px rgba(225, 29, 72, 0.34), 0 0 0 4px rgba(225, 29, 72, 0.14);
}
.planet.level-WATCH .planet-orb {
  width: 44px;
  height: 44px;
  font-size: 12px;
  color: var(--iris);
  background: linear-gradient(145deg, #ffffff, #eef2ff);
  border: 2px solid rgba(79, 70, 229, 0.55);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.18);
}
.planet.level-QUIET .planet-orb {
  width: 38px;
  height: 38px;
  font-size: 11px;
  color: var(--ink-secondary);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}
.planet.active .planet-orb,
.planet:hover .planet-orb {
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.22), 0 10px 24px rgba(15, 23, 42, 0.16);
}

.planet-delta {
  position: absolute;
  top: -5px;
  right: -7px;
  background: #f59e0b;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 999px;
  border: 1.5px solid #ffffff;
  line-height: 1.25;
}

.planet-label {
  max-width: 118px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border-subtle);
  color: var(--ink-primary);
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}
.planet.level-URGENT .planet-label {
  border-color: rgba(225, 29, 72, 0.35);
  color: #9f1239;
}

.telemetry-panel {
  border-radius: 22px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.06);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.telemetry-head { display: flex; justify-content: space-between; align-items: center; }
.telemetry-panel h2 { font-family: var(--font-display); font-size: 22px; margin: 0; color: var(--ink-primary); }
.tel-score-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
}
.tel-score { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--ink-primary); }
.tel-state { font-size: 13px; font-weight: 600; margin-top: 4px; color: var(--ink-secondary); }
.tel-section { display: flex; flex-direction: column; gap: 6px; }
.tel-reasons { margin: 0; padding-left: 18px; color: var(--ink-secondary); font-size: 13px; line-height: 1.55; }
.warm-chip {
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--emerald-soft);
  border: 1px solid rgba(5, 150, 105, 0.25);
  color: var(--emerald);
  font-size: 12.5px;
  font-weight: 600;
}
.tel-actions { padding-top: 4px; }

.status-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
}
.status-URGENT { background: var(--rose-soft); color: var(--rose); border-color: rgba(225, 29, 72, 0.3); }
.status-WATCH { background: var(--iris-soft); color: var(--iris); border-color: rgba(79, 70, 229, 0.3); }
.status-QUIET { background: var(--bg-subtle); color: var(--ink-secondary); }

.btn-glow {
  display: inline-block;
  width: 100%;
  text-align: center;
  padding: 11px 16px;
  border-radius: 999px;
  border: 0;
  background: var(--iris);
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13.5px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.24);
  transition: background-color 0.18s ease;
}
.btn-glow:hover { background: #4338ca; }

.grid-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  gap: 10px;
  flex-wrap: wrap;
}
.grid-head h2 { margin: 0; font-family: var(--font-display); }
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}
.grid-card {
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}
.grid-card.level-URGENT { border-color: rgba(225, 29, 72, 0.35); }
.grid-card.level-WATCH { border-color: rgba(79, 70, 229, 0.32); }
.grid-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.grid-card h3 { margin: 0; font-family: var(--font-display); font-size: 16px; }
.grid-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}
.card-link {
  color: var(--iris);
  text-decoration: none;
  font-weight: 700;
  font-size: 12.5px;
}
.card-link:hover { text-decoration: underline; }

.universe-foot {
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px 20px 26px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-muted);
}
.universe-foot a { color: var(--iris); text-decoration: none; font-weight: 600; }
.dot-urgent { color: var(--rose); }
.dot-watch { color: var(--iris); }
.dot-quiet { color: var(--ink-muted); }

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-overlay[hidden] { display: none; }
.auth-card {
  width: 100%;
  max-width: 400px;
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-kicker { font-family: var(--font-mono); font-size: 11px; color: var(--iris); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; }
.auth-card h2 { margin: 0; font-family: var(--font-display); }
.field-label { font-size: 12px; font-weight: 600; color: var(--ink-secondary); }
.auth-card input {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--ink-primary);
  font: inherit;
}
.err-box {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--rose-soft);
  border: 1px solid rgba(225, 29, 72, 0.3);
  color: var(--rose);
  font-size: 12.5px;
}
