/* Asterism /starmind-ai1 — Spacecraft-First Glass HUD (D60) */

:root {
  --bg: #050810;
  --glass: rgba(10, 15, 27, 0.78);
  --glass-strong: rgba(11, 17, 30, 0.90);
  --glass-hover: rgba(24, 34, 54, 0.88);
  --border: rgba(148, 163, 184, 0.20);
  --border-strong: rgba(148, 163, 184, 0.36);
  --text: #f8fafc;
  --text-muted: #b8c7dd;
  --text-dim: #94a9c6;
  --accent: #38bdf8;
  --accent-bright: #7dd3fc;
  --accent-dim: rgba(56, 189, 248, 0.18);
  --hot: #fb923c;
  --hot-dim: rgba(249, 115, 22, 0.20);
  --rad: #fb7185;
  --sun: #facc15;
  --ok: #22c55e;
  --danger: #ef4444;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --radius: 14px;
  --shadow: 0 12px 36px rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 42%, #0c1426 0%, #060a14 58%, #03050b 100%);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13.5px;
  line-height: 1.42;
  -webkit-font-smoothing: antialiased;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 4px;
  border-radius: 4px;
  color: #e2e8f0;
}

.hidden {
  display: none !important;
}

a,
a:visited {
  color: var(--accent-bright);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: #bae6fd;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Full-Viewport 3D Stage */
.stage-root {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  background: #020306;
  transition: background 0.6s ease;
}

.stage-root.in-eclipse {
  background: #010205;
}

#three-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.viewport-callouts {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 6;
}

.part-pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
}

.scale-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 9;
}

.scale-pill {
  position: absolute;
  top: 0;
  left: 0;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(6, 11, 22, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(148, 163, 184, 0.30);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  pointer-events: none;
  will-change: transform;
}

.scale-pill-court {
  border-color: rgba(52, 211, 153, 0.48);
  color: #d1fae5;
}

.scale-pill-wing {
  border-color: rgba(125, 211, 252, 0.46);
  color: #e0f2fe;
}

.scale-pill-rad {
  border-color: rgba(253, 164, 175, 0.46);
  color: #ffe4e6;
}

.part-pin {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: rgba(9, 14, 26, 0.84);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #f8fafc;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.part-pin:hover,
.part-pin.is-hovered {
  background: rgba(20, 31, 52, 0.94);
  border-color: rgba(125, 211, 252, 0.72);
  box-shadow: 0 6px 22px rgba(56, 189, 248, 0.25);
}

.part-pin.is-selected {
  background: rgba(16, 36, 62, 0.95);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.28), 0 8px 24px rgba(0, 0, 0, 0.55);
}

.part-pin-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}

.viewport-loading {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(5, 8, 16, 0.65);
  color: var(--text-muted);
  font-size: 13px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(148, 163, 184, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Cursor-Following Hover Tooltip (all 23 GLB nodes) */
.hover-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 38;
  max-width: 296px;
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(9, 14, 26, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(148, 163, 184, 0.36);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.56);
  pointer-events: none;
  color: var(--text);
  will-change: transform;
}

.hover-tt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hover-tt-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.hover-tt-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.hover-tt-name {
  font-size: 12.5px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.25;
}

.hover-tt-badge {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.hover-tt-badge.temp {
  background: rgba(56, 189, 248, 0.20);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #e0f2fe;
}

.hover-tt-badge.est {
  background: rgba(249, 115, 22, 0.20);
  border: 1px solid rgba(251, 146, 60, 0.42);
  color: #ffedd5;
}

.hover-tt-badge.primary {
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(74, 222, 128, 0.40);
  color: #dcfce7;
}

.hover-tt-role {
  margin-top: 4px;
  font-size: 11.5px;
  color: #cbd5e1;
  line-height: 1.35;
}

/* Instant secondary-unit hover pill (°C -> °F, m -> ft, kg -> lb, etc.) */
.u-val {
  border-radius: 3px;
  transition: color 0.12s ease;
}

.u-val:hover {
  color: #e0f2fe;
}

.unit-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 90;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(9, 14, 26, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(125, 211, 252, 0.42);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  color: #e0f2fe;
  white-space: nowrap;
  pointer-events: none;
  will-change: transform;
}

/* Top Bar */
.topbar {
  position: fixed;
  top: 12px;
  left: 16px;
  right: 16px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 12px 7px 12px;
  border-radius: 14px;
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: block;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.brand-home,
.brand-home-text {
  color: inherit;
  text-decoration: none;
}

.brand-home-text:hover {
  color: var(--accent-bright);
}

.brand-text {
  min-width: 0;
}

.brand h1 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.2;
}

.brand .slash {
  color: var(--text-dim);
  font-weight: 400;
  margin: 0 2px;
}

.disclaimer-line {
  margin: 1px 0 0;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Topbar Canonical Subsystem Tabs (Power · Compute · Cooling with live values) */
.topbar-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sub-tab {
  border: 1px solid var(--border);
  background: rgba(10, 16, 30, 0.72);
  color: var(--text);
  font-family: var(--sans);
  padding: 5px 12px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.sub-tab:hover {
  background: var(--glass-hover);
  border-color: var(--border-strong);
}

.sub-tab.active,
.sub-tab[aria-expanded='true'] {
  background: rgba(14, 34, 58, 0.88);
  border-color: rgba(56, 189, 248, 0.62);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.18);
}

.sub-tab-head {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.sub-tab.active .sub-tab-head {
  color: #e0f2fe;
}

.sub-tab-val {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
}

.sub-tab.value-flash {
  animation: kpiFlash 0.65s ease-out;
}

.seg-group {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 9px;
  background: rgba(5, 9, 18, 0.72);
  border: 1px solid var(--border);
}

.seg-btn {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.14s ease, color 0.14s ease;
}

.seg-btn:hover {
  color: var(--text);
}

.seg-btn.active {
  background: rgba(56, 189, 248, 0.22);
  color: #e0f2fe;
}

.top-pill {
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.65);
  color: var(--text);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.top-pill:hover {
  background: var(--glass-hover);
  border-color: var(--border-strong);
}

.top-pill.active,
.top-pill[aria-expanded='true'] {
  background: var(--accent-dim);
  border-color: rgba(56, 189, 248, 0.55);
  color: #e0f2fe;
}

.top-pill-ghost {
  background: transparent;
  color: var(--text-muted);
}

.top-pill-ghost:hover {
  color: var(--text);
}

/* View Popover */
.popover-anchor {
  position: relative;
}

.view-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 224px;
  padding: 10px;
  border-radius: 12px;
  background: var(--glass-strong);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.popover-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 2px 4px 3px;
}

.popover-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
}

.popover-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
}

.popover-toggle input[type='checkbox'] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  margin: 0;
}

.popover-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.popover-action {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
}

.popover-action:hover {
  background: var(--glass-hover);
}

/* Passive Heat-Flow Dot Key (integrated inside Thermal colorbar card) */
.arrows-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  font-size: 10.5px;
  color: var(--text-muted);
  pointer-events: none;
}

.arrows-legend span {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

/* Subtle Permanent Attribution Watermark */
.site-watermark {
  position: fixed;
  left: 16px;
  bottom: 18px;
  z-index: 19;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(226, 232, 240, 0.56);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.wm-mark {
  display: block;
  width: 12px;
  height: 12px;
  opacity: 0.85;
  flex-shrink: 0;
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 5px;
}

.dot-sun { background: #facc15; }
.dot-bus { background: #38bdf8; }
.dot-earth { background: #fb923c; }
.dot-rad { background: #f43f5e; }

.viewport-legend {
  position: fixed;
  left: 16px;
  bottom: 44px;
  z-index: 20;
  width: 256px;
  padding: 9px 11px;
  border-radius: 12px;
  background: var(--glass-strong);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

@media (max-width: 1180px) {
  .site-watermark {
    bottom: 84px;
  }

  .viewport-legend {
    bottom: 110px;
  }
}

.legend-title {
  font-size: 10.5px;
  font-weight: 700;
  color: #fed7aa;
  margin-bottom: 6px;
}

.legend-bar {
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.legend-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-muted);
}

.legend-nodata {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 10.5px;
  color: var(--text-muted);
}

.swatch-nodata {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: inline-block;
}

/* Fatal Error Banner */
.fatal-error {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  max-width: min(640px, calc(100vw - 32px));
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(69, 10, 10, 0.94);
  border: 1px solid rgba(239, 68, 68, 0.65);
  color: #fee2e2;
  font-family: var(--mono);
  font-size: 12px;
  white-space: pre-wrap;
  box-shadow: var(--shadow);
}

/* Floating Part Inspector Card (<= 330 px on desktop) */
.inspector-card {
  position: fixed;
  top: 72px;
  right: 16px;
  width: 326px;
  max-height: calc(100dvh - 166px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 26;
  border-radius: var(--radius);
  background: var(--glass-strong);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
}

.inspector-card.is-wide-chart {
  width: 388px;
}

.inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  flex-shrink: 0;
}

.inspector-body {
  padding: 10px 14px 14px;
  overflow-y: auto;
  flex: 1 1 auto;
}

.inspector-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.inspector-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.inspector-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.inspector-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mini-pill {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mini-pill[aria-pressed='true'],
.mini-pill.active {
  background: var(--hot-dim);
  border-color: rgba(251, 146, 60, 0.6);
  color: #ffedd5;
}

.icon-close {
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: 7px;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
}

.inspector-subpart {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  margin-bottom: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.34);
  font-size: 11px;
  font-weight: 600;
  color: #bae6fd;
}

.inspector-subpart .subpart-temp {
  font-family: var(--mono);
  color: #ffffff;
}

.inspector-headline {
  margin: 6px 0 10px;
  font-size: 12.5px;
  color: #e2e8f0;
  line-height: 1.4;
}

.core-bind {
  font-family: var(--mono);
  font-weight: 600;
  color: #ffffff;
}

.inspector-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 10px;
}

.stat-tile {
  padding: 7px 9px;
  border-radius: 9px;
  background: rgba(5, 9, 18, 0.64);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.stat-label {
  font-size: 10.5px;
  color: var(--text-muted);
}

.stat-val {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-top: 1px;
  white-space: nowrap;
}

.stat-sub {
  font-size: 10.5px;
  color: var(--text-dim);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inspector-delta {
  margin-bottom: 10px;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.13);
  border: 1px solid rgba(56, 189, 248, 0.34);
  font-size: 11.5px;
  color: #e0f2fe;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inspector-delta.is-bottlenecked {
  background: rgba(249, 115, 22, 0.13);
  border-color: rgba(251, 146, 60, 0.42);
}

.delta-note {
  font-size: 11px;
  color: #fed7aa;
  line-height: 1.35;
}

.delta-action-btn {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid rgba(251, 146, 60, 0.55);
  background: rgba(234, 88, 12, 0.28);
  color: #ffedd5;
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  vertical-align: baseline;
}

.delta-action-btn:hover {
  background: rgba(234, 88, 12, 0.45);
  border-color: #fb923c;
}

/* Auxiliary Component Info Card (Feeder_Dishes, Star_Trackers, etc.) */
.aux-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.aux-badge {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.aux-badge.estimate {
  background: rgba(249, 115, 22, 0.20);
  border: 1px solid rgba(251, 146, 60, 0.42);
  color: #ffedd5;
}

.aux-badge.primary {
  background: rgba(34, 197, 94, 0.18);
  border: 1px solid rgba(74, 222, 128, 0.40);
  color: #dcfce7;
}

.aux-sim-box {
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(5, 9, 18, 0.68);
  border: 1px solid rgba(148, 163, 184, 0.18);
  margin-bottom: 10px;
}

.aux-sim-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 3px;
}

.aux-sim-text {
  font-size: 12px;
  color: #e2e8f0;
  line-height: 1.4;
}

.aux-jump-btn {
  width: 100%;
  border: 1px solid rgba(56, 189, 248, 0.48);
  background: rgba(14, 165, 233, 0.18);
  color: #e0f2fe;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 11px;
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.aux-jump-btn:hover {
  background: rgba(14, 165, 233, 0.30);
  border-color: var(--accent);
}

/* Live Value Change Flash */
@keyframes valueFlash {
  0% {
    background-color: rgba(56, 189, 248, 0.32);
    border-color: rgba(125, 211, 252, 0.78);
  }
  100% {
    background-color: rgba(5, 9, 18, 0.64);
    border-color: rgba(148, 163, 184, 0.14);
  }
}

@keyframes kpiFlash {
  0% {
    background-color: rgba(251, 146, 60, 0.30);
    border-color: rgba(253, 186, 116, 0.80);
  }
  100% {
    background-color: rgba(6, 10, 20, 0.66);
    border-color: rgba(148, 163, 184, 0.20);
  }
}

.stat-tile.value-flash {
  animation: valueFlash 0.65s ease-out;
}

.kpi-chip.value-flash {
  animation: kpiFlash 0.65s ease-out;
}

.toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.toggle-card.active {
  background: rgba(234, 88, 12, 0.14);
  border-color: rgba(251, 146, 60, 0.48);
}

.toggle-card-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.toggle-card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.toggle-card.active .toggle-card-title {
  color: #ffedd5;
}

.toggle-card-sub {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.25;
}

.toggle-card.active .toggle-card-sub {
  color: #fed7aa;
}

/* Standard iOS/macOS-style On/Off pill switch */
.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  width: 38px;
  height: 22px;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}

.toggle-track {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.28);
  border: 1px solid rgba(148, 163, 184, 0.35);
  position: relative;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f8fafc;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  transition: transform 0.18s ease;
}

.toggle-switch input:checked + .toggle-track {
  background: #0ea5e9;
  border-color: #38bdf8;
}

.toggle-switch input:checked + .toggle-track-hot {
  background: #ea580c;
  border-color: #fb923c;
}

.toggle-switch input:checked + .toggle-track::after {
  transform: translateX(16px);
}

.toggle-switch input:focus-visible + .toggle-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.inspector-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ctrl-block {
  padding-top: 7px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.ctrl-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.ctrl-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.ctrl-val {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-bright);
  white-space: nowrap;
  flex-shrink: 0;
}

.ctrl-quick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.ctrl-block input[type='range'] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 2px 0;
}

.ctrl-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-dim);
  margin-top: 2px;
}

.seg-wide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  padding: 2px;
  border-radius: 9px;
  background: rgba(5, 9, 18, 0.72);
  border: 1px solid var(--border);
}

.seg-wide .seg-btn {
  justify-content: center;
  padding: 6px 6px;
  font-size: 11.5px;
}

.action-row-btn {
  width: 100%;
  border: 1px solid var(--border-strong);
  background: rgba(30, 41, 59, 0.72);
  color: var(--text);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.action-row-btn:hover:not(:disabled) {
  background: var(--glass-hover);
  border-color: var(--accent);
}

.action-row-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.switch-row input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

/* Live-Docked Scrubbable Stefan-Boltzmann (ε σ T⁴) Hero inside Radiator Inspector */
.sb-hero {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.sb-readout {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
  gap: 8px;
  padding: 6px 2px 2px;
}

.sb-metric {
  min-width: 0;
}

.sb-metric-val {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  letter-spacing: -0.02em;
}

.sb-metric-sub {
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-muted);
}

.sb-metric-ratio {
  text-align: right;
}

.sb-ratio-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  justify-content: flex-end;
}

.sb-ratio-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: #fed7aa;
  background: rgba(249, 115, 22, 0.18);
  border: 1px solid rgba(251, 146, 60, 0.48);
}

.sb-ratio-pill.is-scrubbed {
  color: #fff7ed;
  background: rgba(249, 115, 22, 0.34);
  border-color: rgba(251, 146, 60, 0.85);
}

.sb-ratio-pill.is-solar {
  color: #fef08a;
  background: rgba(250, 204, 21, 0.16);
  border-color: rgba(250, 204, 21, 0.48);
}

.sb-chart-svg.sb-chart-static {
  cursor: default;
}

.sb-live-reset {
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.14);
  color: #bae6fd;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  cursor: pointer;
}

.sb-live-reset:hover {
  background: rgba(56, 189, 248, 0.28);
}

.sb-chart {
  border-radius: 10px;
  background: rgba(5, 9, 18, 0.78);
  border: 1px solid var(--border);
  overflow: hidden;
}

.sb-chart-svg {
  width: 100%;
  height: auto;
  display: block;
  cursor: ew-resize;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.sb-chart-svg:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.sb-chip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.sb-chip-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.chip-btn {
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text-muted);
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.chip-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.chip-btn.active {
  background: var(--accent-dim);
  border-color: rgba(56, 189, 248, 0.55);
  color: #e0f2fe;
}

.sb-takeaway {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text-muted);
}

.sb-takeaway strong {
  color: var(--text);
  font-weight: 600;
}

.sb-hw-stats {
  margin-top: 2px;
  margin-bottom: 0;
}

/* Minimal Floating Bottom Dock */
.bottom-dock {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 25;
  width: max-content;
  max-width: calc(100vw - 32px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 12px;
  border-radius: 16px;
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.dock-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.orbit-dial-wrap {
  width: 70px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 8px;
  background: rgba(5, 9, 18, 0.68);
  border: 1px solid rgba(148, 163, 184, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.orbit-dial-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.dock-play-btn {
  border: 0;
  background: #0ea5e9;
  color: #031524;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 13px;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.dock-play-btn:hover:not(:disabled) {
  background: #38bdf8;
}

.dock-play-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.play-icon {
  font-size: 10px;
}

.speed-pills {
  display: inline-flex;
  padding: 2px;
  border-radius: 9px;
  background: rgba(5, 9, 18, 0.72);
  border: 1px solid var(--border);
}

.speed-btn {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 7px;
  border-radius: 7px;
  cursor: pointer;
}

.speed-btn.active {
  background: rgba(56, 189, 248, 0.22);
  color: #e0f2fe;
}

.dock-eclipse-btn {
  border: 1px solid rgba(250, 204, 21, 0.34);
  background: rgba(250, 204, 21, 0.10);
  color: #fef08a;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
}

.dock-eclipse-btn:hover:not(:disabled) {
  background: rgba(250, 204, 21, 0.20);
}

.dock-eclipse-btn.is-in-shadow {
  border-color: rgba(56, 189, 248, 0.48);
  background: rgba(56, 189, 248, 0.16);
  color: #e0f2fe;
}

.dock-eclipse-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.dock-clock-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 4px;
}

.illum-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.illum-dot.sunlit {
  background: #facc15;
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.75);
}

.illum-dot.shadow {
  background: #94a3b8;
}

.dock-clock {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.dock-divider {
  width: 1px;
  height: 24px;
  background: rgba(148, 163, 184, 0.22);
  flex-shrink: 0;
}

.dock-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dock-tool-btn {
  border: 1px solid var(--border);
  background: rgba(10, 16, 30, 0.72);
  color: var(--text);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.dock-tool-btn:hover {
  background: var(--glass-hover);
  border-color: var(--border-strong);
}

.dock-tool-btn.active,
.dock-tool-btn[aria-pressed='true'],
.dock-tool-btn[aria-expanded='true'] {
  background: var(--accent-dim);
  border-color: rgba(56, 189, 248, 0.55);
  color: #e0f2fe;
}

/* Clickable KPI Chips (legacy rules kept minimal) */
.dock-right {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.kpi-chip {
  border: 1px solid rgba(148, 163, 184, 0.20);
  background: rgba(6, 10, 20, 0.66);
  color: var(--text);
  font-family: var(--sans);
  padding: 5px 11px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1px;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.kpi-chip:hover {
  background: var(--glass-hover);
  border-color: var(--border-strong);
}

.kpi-chip.active {
  border-color: var(--accent);
  background: rgba(14, 34, 58, 0.84);
}

.kpi-chip-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.kpi-chip-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.kpi-chip-val {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.kpi-chip-val.pill-thermal {
  color: #fdba74;
}

.kpi-chip-val.pill-power {
  color: #7dd3fc;
}

.kpi-chip-val.pill-none,
.kpi-chip-val.pill-demand {
  color: #86efac;
}

.kpi-chip-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* On-Demand Drawers */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(2, 5, 12, 0.56);
  backdrop-filter: blur(4px);
}

.drawer-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  z-index: 50;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: var(--glass-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

.drawer-side {
  position: fixed;
  top: 14px;
  right: 14px;
  max-height: calc(100dvh - 28px);
  width: min(500px, calc(100vw - 28px));
  z-index: 50;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: var(--glass-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.drawer-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.drawer-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.drawer-body {
  padding: 14px 16px 18px;
  overflow-y: auto;
  flex: 1 1 auto;
}

/* Sankey SVG Styles */
.sankey-container {
  width: 100%;
}

.sankey-svg {
  width: 100%;
  height: auto;
  display: block;
}

.sk-col-head {
  fill: #94a3b8;
  font-size: 10.5px;
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.sk-title {
  fill: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--sans);
}

.sk-val {
  font-size: 14px;
  font-weight: 700;
  font-family: var(--mono);
}

.sk-val-sun { fill: #fde047; }
.sk-val-elec { fill: #7dd3fc; }
.sk-val-green { fill: #4ade80; }
.sk-val-comp { fill: #d8b4fe; }
.sk-val-env { fill: #fdba74; }
.sk-val-rad { fill: #fda4af; }
.sk-val-muted { fill: #94a3b8; }

.sk-sub {
  fill: #94a3b8;
  font-size: 10.5px;
  font-family: var(--mono);
}

.sk-scale-note {
  fill: #94a3b8;
  font-size: 10.5px;
  font-family: var(--mono);
}

.sankey-mobile-flow {
  display: none;
  flex-direction: column;
  gap: 8px;
}

.smf-step {
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(5, 9, 18, 0.72);
  border: 1px solid var(--border);
}

.smf-head {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
}

.smf-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  margin: 6px 0 4px;
  overflow: hidden;
}

.smf-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.smf-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.smf-arrow {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}

/* Specs Drawer Contents */
.specs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.spec-card {
  padding: 10px 11px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.spec-card-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

.spec-card-val {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.spec-card-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.source-callout {
  padding: 11px 13px;
  border-radius: 11px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.24);
  margin-bottom: 12px;
}

.source-callout-title {
  font-size: 12px;
  font-weight: 700;
  color: #bae6fd;
  margin-bottom: 6px;
}

.source-list {
  margin: 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: #dbe7f5;
}

.specs-details {
  border-radius: 11px;
  background: rgba(5, 9, 18, 0.62);
  border: 1px solid var(--border);
  padding: 9px 12px;
}

.specs-details summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.specs-details[open] summary {
  color: var(--text);
}

.specs-details-body {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.adv-subhead {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.ladder-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ladder-row {
  display: grid;
  grid-template-columns: 100px 1fr 86px;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.ladder-name {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  color: var(--text-muted);
}

.binding-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
}

.ladder-track {
  position: relative;
  height: 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
}

.ladder-fill {
  height: 100%;
  border-radius: 999px;
}

.ladder-ceiling {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: #f8fafc;
}

.ladder-nums {
  text-align: right;
  font-family: var(--mono);
  color: var(--text);
}

.ladder-limit {
  color: var(--text-dim);
}

.mass-footer {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
}

.prov-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.prov-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.search-input {
  border: 1px solid var(--border);
  background: rgba(5, 9, 18, 0.72);
  color: var(--text);
  font-size: 12px;
  padding: 5px 9px;
  border-radius: 8px;
  min-width: 140px;
}

.prov-table-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-x: auto;
  max-height: 360px;
  overflow-y: auto;
}

.prov-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 11px;
}

.prov-table th:nth-child(1),
.prov-table td:nth-child(1) { width: 44%; }
.prov-table th:nth-child(2),
.prov-table td:nth-child(2) { width: 17%; }
.prov-table th:nth-child(3),
.prov-table td:nth-child(3) { width: 21%; }
.prov-table th:nth-child(4),
.prov-table td:nth-child(4) { width: 18%; }

.prov-table th,
.prov-table td {
  padding: 6px 7px;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  vertical-align: top;
  overflow-wrap: anywhere;
}

.prov-table th {
  position: sticky;
  top: 0;
  background: #0d1526;
  color: var(--text-muted);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.prov-table td.mono {
  font-family: var(--mono);
  font-size: 11px;
}

.pub-status {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.pub-status.official {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
}

.pub-status.derived {
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
}

.pub-status.interview {
  background: rgba(250, 204, 21, 0.18);
  color: #fde047;
}

/* Responsive Mobile Phone Layout (<= 760px) */
@media (max-width: 760px) {
  .topbar {
    top: 8px;
    left: 8px;
    right: 8px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 7px 9px;
  }

  .brand h1 {
    font-size: 13px;
  }

  .disclaimer-line {
    font-size: 10px;
    white-space: normal;
    line-height: 1.25;
  }

  .desktop-only {
    display: none !important;
  }

  .topbar-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .sub-tab {
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    padding: 5px 8px;
  }

  .sub-tab-head {
    font-size: 10.5px;
  }

  .sub-tab-val {
    font-size: 12px;
  }

  .hover-tooltip {
    display: none !important;
  }

  .arrows-legend {
    font-size: 9.5px;
    gap: 3px 8px;
    margin-top: 6px;
    padding-top: 6px;
  }

  .viewport-legend {
    top: 112px;
    bottom: auto;
    left: 8px;
    width: 212px;
    padding: 6px 8px;
  }

  .viewport-legend .legend-title {
    display: none;
  }

  .site-watermark {
    display: none;
  }

  .bottom-dock {
    left: 8px;
    right: 8px;
    bottom: 8px;
    transform: none;
    width: auto;
    max-width: none;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 7px 8px;
    border-radius: 14px;
  }

  .dock-divider {
    display: none;
  }

  .dock-tools {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .scale-pill {
    font-size: 10px;
    padding: 3px 7px;
  }

  .dock-tool-btn {
    padding: 6px 6px;
    font-size: 11.5px;
    text-align: center;
  }

  .dock-left {
    justify-content: space-between;
    gap: 5px;
  }

  .orbit-dial-wrap {
    width: 50px;
    height: 34px;
  }

  .dock-play-btn {
    padding: 6px 10px;
    font-size: 11.5px;
  }

  .speed-btn {
    padding: 4px 6px;
    font-size: 10.5px;
  }

  .dock-eclipse-btn {
    padding: 6px 8px;
    font-size: 11px;
  }

  .dock-clock-wrap {
    display: none;
  }

  .dock-right {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .kpi-chip {
    padding: 5px 7px;
  }

  .kpi-chip-val {
    font-size: 12px;
  }

  .kpi-chip-sub {
    display: none;
  }

  /* Inspector becomes compact bottom sheet on phone */
  .inspector-card {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
    max-height: 54dvh;
    z-index: 35;
    padding: 0;
    border-radius: 16px;
  }

  .inspector-card.is-wide-chart {
    width: auto;
    max-height: 58dvh;
  }

  .sb-metric-val {
    font-size: 18px;
  }

  .sb-metric-sub {
    font-size: 11px;
  }

  .sb-ratio-pill {
    font-size: 12px;
  }

  .sb-takeaway {
    font-size: 12px;
  }

  .sankey-svg {
    display: none;
  }

  .sankey-mobile-flow {
    display: flex;
  }
}

/* Full-resolution hardware captures. Keep loading and fatal errors visible. */
.clean-view > :not(.stage-root, #fatal-error),
.clean-view .stage-root > :not(canvas, #viewport-loading) {
  display: none;
}
