:root {
  color-scheme: dark;
  --bg: #0b0d12;
  --bg-2: #0e1117;
  --panel: rgba(22, 26, 34, 0.82);
  --panel-solid: #161a22;
  --panel-2: rgba(31, 37, 48, 0.7);
  --line: rgba(120, 132, 156, 0.18);
  --line-strong: rgba(120, 132, 156, 0.32);
  --text: #eef2f8;
  --muted: #9aa4b8;
  --faint: #5e6878;
  --teal: #38e1c6;
  --gold: #ffc24b;
  --coral: #ff7a66;
  --violet: #a896ff;
  --green: #7ee787;
  --danger: #ff5d5d;
  --blue: #5cc8ff;
  --shadow: rgba(0, 0, 0, 0.45);
  --glow-teal: rgba(56, 225, 198, 0.35);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

/* Ambient animated backdrop */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 18% 12%, rgba(56, 225, 198, 0.10), transparent 70%),
    radial-gradient(55% 45% at 85% 20%, rgba(168, 150, 255, 0.10), transparent 70%),
    radial-gradient(70% 60% at 50% 100%, rgba(255, 122, 102, 0.08), transparent 70%),
    var(--bg);
}

.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(120% 120% at 50% 0%, #000 35%, transparent 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

sub {
  font-size: 0.72em;
}

.sim-shell {
  position: relative;
  z-index: 1;
  width: min(1840px, 100%);
  margin: 0 auto;
  padding: 34px clamp(14px, 2.4vw, 34px) 44px;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 6px 2px 22px;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.subtitle {
  margin: 8px 0 0;
  max-width: 52ch;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3.6vw, 3rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  background: linear-gradient(120deg, #ffffff 20%, var(--teal) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h2 {
  margin: 0;
  font-size: 1.06rem;
  letter-spacing: 0.01em;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.status-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.status-caption {
  color: var(--faint);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.state-pill,
.power-badge,
.q-badge {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 6px 14px;
  background: var(--panel-2);
  font-size: 0.92rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.state-pill {
  color: #0b0d12;
  background: var(--gold);
  border-color: transparent;
  box-shadow: 0 0 18px rgba(255, 194, 75, 0.35);
  transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

.power-badge {
  color: var(--teal);
}

.q-badge {
  color: var(--gold);
}

/* ---------- Layout grids ---------- */
.sim-grid {
  display: grid;
  grid-template-columns: minmax(280px, 350px) minmax(440px, 1fr) minmax(320px, 400px);
  gap: 16px;
  align-items: stretch;
}

.analysis-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.learn-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.panel,
.reactor-stage {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: 0 22px 48px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sim-grid > .panel,
.sim-grid > .reactor-stage {
  height: calc(100vh - 150px);
  min-height: 560px;
}

.panel {
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px;
}

.panel-heading {
  margin-bottom: 16px;
}

/* ---------- Controls ---------- */
.preset-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 7px;
  margin-bottom: 18px;
}

.preset {
  min-height: 38px;
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  transition: all 0.18s ease;
}

.preset.active,
.preset:hover {
  border-color: var(--teal);
  color: var(--text);
  background: rgba(56, 225, 198, 0.16);
  box-shadow: 0 0 0 1px rgba(56, 225, 198, 0.3), 0 0 18px rgba(56, 225, 198, 0.18);
}

.control-stack {
  display: grid;
  gap: 13px;
}

.control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  transition: border-color 0.18s ease;
}

.control:focus-within {
  border-color: var(--teal);
}

.control strong {
  display: block;
  font-size: 0.92rem;
}

.control small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.control output {
  color: var(--teal);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

input[type="range"] {
  grid-column: 1 / -1;
  width: 100%;
  height: 26px;
  margin: 2px 0 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), rgba(56, 225, 198, 0.12));
}

input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), rgba(56, 225, 198, 0.12));
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--teal);
  box-shadow: 0 0 12px var(--glow-teal);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--teal);
  box-shadow: 0 0 12px var(--glow-teal);
  cursor: pointer;
}

.toggle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 18px;
}

.toggle {
  display: flex;
  align-items: center;
  min-height: 48px;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(13, 16, 22, 0.6);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.2;
  transition: all 0.18s ease;
}

.toggle input {
  inline-size: 18px;
  block-size: 18px;
  accent-color: var(--gold);
}

.toggle:has(input:checked) {
  color: var(--text);
  border-color: rgba(255, 194, 75, 0.6);
  background: rgba(255, 194, 75, 0.12);
}

.disclaimer {
  margin: 18px 0 0;
  color: var(--faint);
  font-size: 0.72rem;
  line-height: 1.4;
}

/* ---------- Reactor stage ---------- */
.reactor-stage {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 44%, rgba(56, 225, 198, 0.12), transparent 38%),
    radial-gradient(circle at 50% 80%, rgba(168, 150, 255, 0.08), transparent 50%),
    #0a0c11;
}

#reactorCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.stage-overlay {
  pointer-events: none;
  position: absolute;
  inset: 0;
}

.hotspot {
  pointer-events: auto;
  position: absolute;
  min-width: 88px;
  min-height: 32px;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(11, 13, 18, 0.66);
  backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  transition: all 0.18s ease;
}

.hotspot::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal);
  vertical-align: middle;
}

.hotspot.active,
.hotspot:hover {
  border-color: var(--teal);
  background: rgba(56, 225, 198, 0.2);
  box-shadow: 0 0 0 1px rgba(56, 225, 198, 0.4), 0 0 20px rgba(56, 225, 198, 0.25);
}

.hotspot-core { left: 50%; top: 45%; transform: translate(-50%, -50%); }
.hotspot-solenoid { left: 50%; top: 30%; transform: translate(-50%, -50%); }
.hotspot-magnets { left: 6%; top: 14%; }
.hotspot-blanket { right: 7%; top: 20%; }
.hotspot-divertor { left: 50%; bottom: 22%; transform: translateX(-50%); }
.hotspot-turbine { right: 6%; bottom: 9%; }

.stage-readout {
  position: absolute;
  left: 18px;
  bottom: 16px;
  display: flex;
  gap: 16px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(11, 13, 18, 0.6);
  backdrop-filter: blur(6px);
  color: var(--muted);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
}

.stage-readout em {
  font-style: normal;
  font-weight: 800;
  color: var(--text);
}

/* ---------- Telemetry ---------- */
.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.metric {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-2);
}

.metric-triple,
.metric-q {
  grid-column: span 1;
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.metric strong {
  display: block;
  margin: 8px 0 9px;
  font-size: 1.5rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.metric-unit {
  display: block;
  margin: -4px 0 8px;
  color: var(--faint);
  font-size: 0.66rem;
}

meter {
  width: 100%;
  block-size: 8px;
  -webkit-appearance: none;
  appearance: none;
}

meter::-webkit-meter-bar {
  border: 0;
  border-radius: 999px;
  background: rgba(8, 10, 14, 0.9);
}

meter::-webkit-meter-optimum-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--gold));
}

meter::-moz-meter-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--gold));
}

.mini-systems {
  display: grid;
  gap: 11px;
  margin: 16px 0;
}

.system-row {
  display: grid;
  grid-template-columns: 96px minmax(70px, 1fr) 78px;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.78rem;
}

.system-row strong {
  color: var(--text);
  text-align: right;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(8, 10, 14, 0.9);
}

.bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
  transition: width 200ms ease, background-color 200ms ease;
}

.coach {
  margin-top: 16px;
  padding: 15px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(255, 194, 75, 0.08), rgba(255, 194, 75, 0.02));
}

.coach-kicker {
  margin: 0 0 7px;
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.coach p#coachText {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ---------- Analysis panels ---------- */
.viz-panel {
  display: flex;
  flex-direction: column;
}

.viz-caption {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

#lawsonCanvas {
  display: block;
  width: 100%;
  height: 300px;
  flex: none;
}

#historyCanvas {
  display: block;
  width: 100%;
  height: 280px;
  flex: none;
  border-radius: 10px;
}

.legend,
.balance-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 14px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.74rem;
}

.swatch {
  width: 16px;
  height: 4px;
  border-radius: 999px;
  display: inline-block;
}

.swatch-ignite { background: var(--coral); }
.swatch-breakeven { background: var(--violet); }
.swatch-point { width: 10px; height: 10px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 8px var(--teal); }
.swatch-ext { background: var(--blue); }
.swatch-alpha { background: var(--gold); }
.swatch-neutron { background: var(--teal); }
.swatch-react { background: var(--gold); }

#reactivityCanvas,
#sankeyCanvas,
#fuelCycleCanvas {
  display: block;
  width: 100%;
  height: 240px;
  flex: none;
}

/* ---------- Power balance ---------- */
.balance {
  display: grid;
  gap: 14px;
  margin-bottom: 6px;
}

.balance-row {
  display: grid;
  grid-template-columns: 120px 1fr 78px;
  align-items: center;
  gap: 10px;
}

.balance-label {
  color: var(--muted);
  font-size: 0.78rem;
}

.balance-track {
  display: flex;
  height: 18px;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(8, 10, 14, 0.9);
}

.balance-row strong {
  text-align: right;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.seg {
  display: block;
  height: 100%;
  width: 0%;
  transition: width 240ms ease;
}

.seg-ext { background: var(--blue); }
.seg-alpha { background: var(--gold); }
.seg-neutron { background: var(--teal); }

.balance-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

.balance-foot strong {
  font-size: 1.3rem;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.chart-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.8rem;
}

.chart-title strong {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

/* ---------- Learning row ---------- */
.lesson-panel p,
.glossary dd {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

#lessonBody {
  margin: 0 0 12px;
}

.deeper {
  margin: 4px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(13, 16, 22, 0.5);
  overflow: hidden;
}

.deeper summary {
  padding: 11px 14px;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.deeper summary::-webkit-details-marker { display: none; }

.deeper summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.18s ease;
}

.deeper[open] summary::before {
  content: "▾ ";
}

.deeper p {
  margin: 0;
  padding: 0 14px 12px;
}

.formula {
  font-family: "SFMono-Regular", ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
  color: var(--teal) !important;
  font-size: 0.82rem !important;
}

.lesson-note {
  margin: 12px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--teal) !important;
  font-weight: 700;
}

.glossary {
  display: grid;
  gap: 12px;
  margin: 0;
}

.glossary div {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.glossary div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.glossary dt {
  margin-bottom: 4px;
  color: var(--text);
  font-weight: 700;
  font-size: 0.88rem;
}

.glossary dd {
  margin: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 1220px) {
  .sim-grid {
    grid-template-columns: minmax(260px, 330px) minmax(380px, 1fr);
  }
  .telemetry-panel {
    grid-column: 1 / -1;
    height: auto !important;
    min-height: 0 !important;
  }
  .analysis-grid {
    grid-template-columns: 1fr 1fr;
  }
  .analysis-grid > :last-child {
    grid-column: 1 / -1;
  }
}

/* ---------- Navigation HUD ---------- */
.nav-gizmo {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(11, 13, 18, 0.5);
  backdrop-filter: blur(8px);
}

#gizmoCanvas {
  display: block;
  width: 84px;
  height: 84px;
  cursor: pointer;
}

.gizmo-views {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  width: 100%;
}

.gizmo-btn {
  padding: 4px 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: rgba(20, 26, 34, 0.7);
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.gizmo-btn:hover {
  color: var(--text);
  border-color: var(--teal);
  background: rgba(56, 225, 198, 0.16);
}

.gizmo-btn.active {
  color: #07120f;
  background: var(--teal);
  border-color: var(--teal);
}

.nav-cluster {
  position: absolute;
  top: 50%;
  right: 14px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transform: translateY(-50%);
}

.nav-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(11, 13, 18, 0.6);
  backdrop-filter: blur(8px);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.nav-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-btn:hover {
  color: var(--text);
  border-color: var(--teal);
  background: rgba(56, 225, 198, 0.15);
  box-shadow: 0 0 16px rgba(56, 225, 198, 0.2);
}

.nav-btn:active {
  transform: translateY(1px);
}

.nav-btn[aria-pressed="true"] {
  color: #07120f;
  background: var(--teal);
  border-color: var(--teal);
}

.nav-legend {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 5;
  padding: 11px 16px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(11, 13, 18, 0.72);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px var(--shadow);
  transform: translateX(-50%);
  opacity: 1;
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.nav-legend.hide {
  opacity: 0;
  transform: translateX(-50%) translateY(-8px);
  pointer-events: none;
}

.legend-title {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.nav-legend ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 360px;
}

.nav-legend li {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.72rem;
}

.nav-legend li span {
  padding: 2px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: rgba(31, 37, 48, 0.8);
  color: var(--text);
  font-size: 0.64rem;
  font-weight: 700;
  white-space: nowrap;
}

.legend-close {
  position: absolute;
  top: 6px;
  right: 8px;
  padding: 0 4px;
  border: none;
  background: none;
  color: var(--faint);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
}

.legend-close:hover {
  color: var(--text);
}

.nav-help {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(11, 13, 18, 0.6);
  backdrop-filter: blur(8px);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  transform: translateX(-50%);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-help:hover {
  color: var(--text);
  border-color: var(--teal);
}

.nav-help[hidden] {
  display: none;
}

/* ---------- Mission Control ---------- */
.missions {
  margin-top: 16px;
}

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

.missions-progress {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.missions-progress strong {
  color: var(--teal);
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

.mission-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 10px;
}

.mission-chip {
  position: relative;
  padding: 12px 13px 13px 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.mission-check {
  position: absolute;
  left: 12px;
  top: 13px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.mission-chip.done {
  border-color: rgba(56, 225, 198, 0.5);
  background: rgba(56, 225, 198, 0.08);
  box-shadow: 0 0 0 1px rgba(56, 225, 198, 0.18), 0 0 22px rgba(56, 225, 198, 0.12);
}

.mission-chip.done .mission-check {
  background: var(--teal);
  border-color: var(--teal);
}

.mission-chip.done .mission-check::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid #07120f;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.mission-name {
  display: block;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--text);
}

.mission-goal {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--muted);
}

.mission-bar {
  display: block;
  margin-top: 8px;
  height: 4px;
  border-radius: 2px;
  background: rgba(120, 132, 156, 0.2);
  overflow: hidden;
}

.mission-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--teal);
  transition: width 0.3s ease;
}

.mission-chip.justdone {
  animation: missionPop 0.9s ease;
}

@keyframes missionPop {
  0% { transform: scale(1); }
  30% { transform: scale(1.045); }
  100% { transform: scale(1); }
}

.mission-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 20;
  padding: 11px 18px;
  border-radius: 12px;
  background: rgba(13, 24, 22, 0.92);
  border: 1px solid rgba(56, 225, 198, 0.55);
  box-shadow: 0 12px 34px var(--shadow), 0 0 26px rgba(56, 225, 198, 0.2);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.mission-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Teachable tooltips ---------- */
.tip-dot {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  margin-left: 6px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--faint);
  font-size: 9px;
  font-weight: 800;
  font-style: italic;
  line-height: 1;
  vertical-align: middle;
  cursor: help;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.tip-dot:hover,
.tip-dot:focus-visible {
  color: var(--teal);
  border-color: var(--teal);
  outline: none;
}

.tip-pop {
  position: fixed;
  z-index: 60;
  max-width: 262px;
  padding: 11px 13px;
  border-radius: 11px;
  background: rgba(13, 17, 24, 0.97);
  border: 1px solid var(--line-strong);
  box-shadow: 0 14px 36px var(--shadow);
  pointer-events: none;
}

.tip-pop[hidden] {
  display: none;
}

.tip-pop strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 0.82rem;
}

.tip-pop span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.tip-pop code {
  display: block;
  margin-top: 7px;
  color: var(--teal);
  font-size: 0.72rem;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.tip-pop em {
  display: block;
  margin-top: 6px;
  color: var(--faint);
  font-size: 0.72rem;
  font-style: normal;
}

@media (max-width: 920px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .status-strip {
    justify-content: flex-start;
  }
  .sim-grid {
    grid-template-columns: 1fr;
  }
  .sim-grid > .panel,
  .sim-grid > .reactor-stage {
    height: auto;
    min-height: 0;
  }
  .reactor-stage {
    order: -1;
    min-height: 480px;
  }
  #reactorCanvas {
    height: 480px;
  }
  .analysis-grid,
  .learn-grid {
    grid-template-columns: 1fr;
  }
  .analysis-grid > :last-child {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .preset-row,
  .metric-grid,
  .toggle-grid {
    grid-template-columns: 1fr;
  }
  .control {
    grid-template-columns: 1fr;
  }
  .control output {
    justify-self: start;
  }
  .balance-row {
    grid-template-columns: 90px 1fr 64px;
  }
  .stage-readout {
    flex-wrap: wrap;
    gap: 8px 14px;
  }
  .nav-gizmo {
    transform: scale(0.84);
    transform-origin: top right;
  }
  .nav-btn {
    width: 34px;
    height: 34px;
  }
  .nav-legend ul {
    max-width: 220px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================================================
   Phase 1 additions
   Topbar tools, themes, presentation mode, real-world units,
   scale toggle, Lawson machine legend.
   ============================================================ */

/* ---- Topbar tools ---- */
.topbar-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}
.topbar-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}
.tool-select {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--panel-2);
  color: var(--faint);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.tool-select select {
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
}
.tool-select select option {
  background: var(--panel-solid);
  color: var(--text);
}
.tool-btn {
  min-height: 32px;
  padding: 6px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.tool-btn:hover {
  color: var(--text);
  border-color: var(--teal);
  background: rgba(56, 225, 198, 0.14);
}
.tool-btn[aria-pressed="true"] {
  color: #07120f;
  background: var(--teal);
  border-color: var(--teal);
  box-shadow: 0 0 16px rgba(56, 225, 198, 0.25);
}

/* ---- Stage scale toggle ---- */
.stage-toggle {
  position: absolute;
  left: 18px;
  bottom: 58px;
  z-index: 4;
  min-height: 30px;
  padding: 6px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(11, 13, 18, 0.6);
  backdrop-filter: blur(8px);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}
.stage-toggle:hover { color: var(--text); border-color: var(--blue); }
.stage-toggle[aria-pressed="true"] {
  color: #061018;
  background: var(--blue);
  border-color: var(--blue);
}

/* ---- Real-world units panel ---- */
.realworld {
  margin-top: 16px;
  padding: 14px 15px;
  border: 1px solid rgba(92, 200, 255, 0.4);
  border-left: 3px solid var(--blue);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(92, 200, 255, 0.08), rgba(92, 200, 255, 0.02));
}
.rw-kicker {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.rw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rw-item { display: flex; flex-direction: column; gap: 3px; }
.rw-label { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; }
.rw-item strong { font-size: 1.1rem; line-height: 1.12; font-variant-numeric: tabular-nums; }
.rw-sub { color: var(--faint); font-size: 0.74rem; }
@media (max-width: 520px) { .rw-grid { grid-template-columns: 1fr; } }

/* ---- Lawson machine legend ---- */
.swatch-machine {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: #96beff;
  transform: rotate(45deg);
}
.viz-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  cursor: pointer;
}
.viz-toggle input { accent-color: var(--blue); width: 14px; height: 14px; }
.viz-foot {
  margin: 10px 0 0;
  color: var(--faint);
  font-size: 0.72rem;
  line-height: 1.4;
}

/* ---- Presentation / kiosk mode ---- */
body.kiosk .missions,
body.kiosk .analysis-grid,
body.kiosk .learn-grid,
body.kiosk .mission-toast { display: none !important; }
body.kiosk .sim-shell { padding-top: 16px; padding-bottom: 18px; }
body.kiosk .topbar { padding-bottom: 12px; }
body.kiosk .sim-grid > .panel,
body.kiosk .sim-grid > .reactor-stage { height: calc(100vh - 132px); min-height: 0; }
body.kiosk .status-strip .state-pill,
body.kiosk .status-strip .power-badge,
body.kiosk .status-strip .q-badge { font-size: 1.04rem; min-height: 40px; }

/* ---- Theme: light ---- */
html[data-theme="light"] {
  --bg: #eef1f6;
  --bg-2: #e4e9f1;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-solid: #ffffff;
  --panel-2: rgba(248, 250, 253, 0.94);
  --line: rgba(40, 52, 74, 0.14);
  --line-strong: rgba(40, 52, 74, 0.26);
  --text: #161b24;
  --muted: #4c5666;
  --faint: #828c9c;
  --teal: #0f9f8c;
  --gold: #b9790a;
  --coral: #d65b43;
  --violet: #6f59d9;
  --green: #1f9d4d;
  --blue: #1f81c2;
  --shadow: rgba(40, 52, 74, 0.16);
  --glow-teal: rgba(15, 159, 140, 0.28);
  color-scheme: light;
}
html[data-theme="light"] h1 {
  background: linear-gradient(120deg, #0c2c3f 8%, var(--teal) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html[data-theme="light"] .tool-btn[aria-pressed="true"],
html[data-theme="light"] .stage-toggle[aria-pressed="true"] { color: #ffffff; }

/* ---- Theme: high contrast ---- */
html[data-theme="contrast"] {
  --bg: #000000;
  --bg-2: #000000;
  --panel: rgba(8, 10, 14, 0.96);
  --panel-solid: #0a0c10;
  --panel-2: rgba(16, 20, 28, 0.96);
  --line: rgba(255, 255, 255, 0.42);
  --line-strong: rgba(255, 255, 255, 0.66);
  --text: #ffffff;
  --muted: #e6ebf5;
  --faint: #b9c2d4;
  --teal: #4dffe0;
  --gold: #ffd24d;
  --coral: #ff9a7d;
  --violet: #c9b6ff;
  --green: #7dffa0;
  --blue: #74ccff;
  --shadow: rgba(0, 0, 0, 0.7);
  --glow-teal: rgba(77, 255, 224, 0.4);
}
html[data-theme="contrast"] .panel,
html[data-theme="contrast"] .reactor-stage,
html[data-theme="contrast"] .hotspot,
html[data-theme="contrast"] .nav-btn,
html[data-theme="contrast"] .nav-gizmo { backdrop-filter: none; }

/* ---- Theme: colorblind-safe (Okabe-Ito based) ---- */
html[data-theme="cb"] {
  --teal: #33b7e0;
  --gold: #e69f00;
  --coral: #d55e00;
  --violet: #cc79a7;
  --green: #009e73;
  --blue: #0072b2;
  --glow-teal: rgba(51, 183, 224, 0.3);
}

/* On narrow screens let the topbar tools sit left-aligned */
@media (max-width: 920px) {
  .topbar-right { align-items: flex-start; width: 100%; }
  .topbar-tools { justify-content: flex-start; }
  .status-strip { justify-content: flex-start; }
}

/* ============================================================
   Phase 2 additions
   Story launcher, cross-section inset, materials, export,
   power-up, guided tour, story panel.
   ============================================================ */

.tool-btn.wide { width: 100%; }

/* ---- Guided story launcher (control panel) ---- */
.story-launch {
  display: flex; align-items: center; gap: 12px; width: 100%;
  margin-bottom: 16px; padding: 12px 14px; text-align: left;
  border: 1px solid rgba(168, 150, 255, 0.45); border-radius: 12px;
  background: linear-gradient(180deg, rgba(168, 150, 255, 0.14), rgba(168, 150, 255, 0.04));
  color: var(--text); transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}
.story-launch:hover { border-color: var(--violet); box-shadow: 0 0 0 1px rgba(168, 150, 255, 0.3), 0 0 20px rgba(168, 150, 255, 0.16); }
.story-launch[aria-pressed="true"] { border-color: var(--violet); background: rgba(168, 150, 255, 0.2); }
.story-launch-icon { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--violet); color: #160d33; font-size: 0.66rem; }
.story-launch strong { display: block; font-size: 0.9rem; }
.story-launch small { display: block; margin-top: 2px; color: var(--muted); font-size: 0.74rem; }

/* ---- Stage toggle cluster + cross-section inset ---- */
.stage-toggles { position: absolute; left: 18px; bottom: 58px; z-index: 4; display: flex; gap: 8px; }
.stage-toggles .stage-toggle { position: static; left: auto; bottom: auto; }
.cross-inset {
  position: absolute; right: 14px; bottom: 14px; z-index: 4;
  width: clamp(188px, 22vw, 248px); height: clamp(196px, 24vw, 248px);
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: rgba(8, 10, 14, 0.82); backdrop-filter: blur(8px);
}
.cross-inset[hidden] { display: none; }

/* ---- First wall / materials ---- */
.materials {
  margin-top: 16px; padding: 13px 15px;
  border: 1px solid var(--line); border-left: 3px solid var(--violet);
  border-radius: 11px; background: rgba(168, 150, 255, 0.05);
}
.mat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.mat-kicker { margin: 0; color: var(--violet); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; }
.mat-status { font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; padding: 3px 8px; border-radius: 6px; border: 1px solid transparent; }
.mat-status.ok { color: var(--green); border-color: rgba(126, 231, 135, 0.5); background: rgba(126, 231, 135, 0.1); }
.mat-status.warn { color: var(--gold); border-color: rgba(255, 194, 75, 0.5); background: rgba(255, 194, 75, 0.1); }
.mat-status.bad { color: var(--danger); border-color: rgba(255, 93, 93, 0.5); background: rgba(255, 93, 93, 0.12); }
.mat-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; margin: 7px 0; color: var(--muted); font-size: 0.78rem; }
.mat-row .bar { width: 116px; }
.mat-row strong { color: var(--text); font-variant-numeric: tabular-nums; }
.mat-note { margin: 10px 0 0; color: var(--faint); font-size: 0.72rem; line-height: 1.4; }
.tele-actions { margin-top: 14px; }

/* ---- Power-up intro ---- */
.powerup {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 45%, rgba(56, 225, 198, 0.12), rgba(6, 8, 12, 0.96) 70%);
  pointer-events: none;
}
.powerup[hidden] { display: none; }
.powerup span { color: var(--teal); font-size: 1.1rem; font-weight: 800; letter-spacing: 0.3em; text-transform: uppercase; opacity: 0; }
.powerup.run { animation: powerupFade 1.9s ease forwards; }
.powerup.run span { animation: powerupText 1.9s ease forwards; }
@keyframes powerupFade { 0% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
@keyframes powerupText { 0% { opacity: 0; letter-spacing: 0.6em; } 30% { opacity: 1; letter-spacing: 0.3em; } 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---- Guided tour ---- */
.tour-overlay { position: fixed; inset: 0; z-index: 55; background: rgba(6, 8, 12, 0.55); }
.tour-overlay[hidden] { display: none; }
.tour-ring { position: fixed; z-index: 56; border: 2px solid var(--teal); border-radius: 12px; box-shadow: 0 0 0 4px rgba(56, 225, 198, 0.25), 0 0 40px rgba(56, 225, 198, 0.3); pointer-events: none; transition: left 0.3s ease, top 0.3s ease, width 0.3s ease, height 0.3s ease; }
.tour-ring[hidden] { display: none; }
.tour-card {
  position: fixed; z-index: 57; width: 300px; max-width: calc(100vw - 24px);
  padding: 16px 18px; border: 1px solid var(--line-strong); border-radius: 14px;
  background: var(--panel-solid); box-shadow: 0 18px 44px var(--shadow);
}
.tour-card[hidden] { display: none; }
.tour-prog { margin: 0 0 6px; color: var(--teal); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em; }
.tour-card h3 { margin: 0 0 6px; font-size: 1.02rem; }
.tour-card p { margin: 0; color: var(--muted); font-size: 0.86rem; line-height: 1.5; }
.tour-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.tour-skip { border: 0; background: none; color: var(--faint); font-size: 0.8rem; cursor: pointer; }
.tour-skip:hover { color: var(--text); }
.tour-next { padding: 8px 18px; border: 0; border-radius: 9px; background: var(--teal); color: #07120f; font-weight: 800; font-size: 0.84rem; cursor: pointer; }

/* ---- Story panel ---- */
.story-panel {
  position: fixed; left: 50%; bottom: 22px; z-index: 45; width: min(460px, calc(100vw - 24px));
  transform: translateX(-50%); padding: 18px 20px 16px;
  border: 1px solid rgba(168, 150, 255, 0.5); border-radius: 16px;
  background: var(--panel-solid); box-shadow: 0 20px 50px var(--shadow), 0 0 30px rgba(168, 150, 255, 0.16);
}
.story-panel[hidden] { display: none; }
.story-close { position: absolute; top: 10px; right: 12px; border: 0; background: none; color: var(--faint); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.story-close:hover { color: var(--text); }
.story-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.story-prog { margin: 0; color: var(--violet); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.story-check { font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); }
.story-check.met { color: var(--green); border-color: rgba(126, 231, 135, 0.5); background: rgba(126, 231, 135, 0.12); }
.story-panel h3 { margin: 0 0 6px; font-size: 1.06rem; }
.story-panel > p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.story-hint { margin-top: 8px !important; color: var(--teal) !important; font-size: 0.82rem !important; font-weight: 600; }
.story-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.story-prev, .story-next { padding: 8px 18px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--panel-2); color: var(--text); font-weight: 700; font-size: 0.84rem; cursor: pointer; }
.story-next { border-color: var(--violet); background: var(--violet); color: #160d33; }
.story-prev:disabled { opacity: 0.4; cursor: default; }

@media (prefers-reduced-motion: reduce) {
  .powerup { display: none !important; }
  .lamp.warn.on { animation: none !important; }
}

/* ============================================================
   Batch additions
   Control icons, annunciator lamps, why-fusion, predict-then-test,
   reading-level (plain) mode.
   ============================================================ */

/* ---- B8: control icons ---- */
.ctl-ico {
  width: 15px; height: 15px;
  margin-right: 7px;
  vertical-align: -2px;
  fill: none;
  stroke: var(--teal);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.9;
}

/* ---- B5: annunciator lamps ---- */
.annunciator { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.lamp {
  flex: 1 1 auto;
  text-align: center;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(8, 10, 14, 0.5);
  color: var(--faint);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.lamp.on { color: #07120f; background: var(--teal); border-color: var(--teal); box-shadow: 0 0 12px var(--glow-teal); }
.lamp.warn.on { color: #1a0606; background: var(--danger); border-color: var(--danger); box-shadow: 0 0 14px rgba(255, 93, 93, 0.5); animation: lampBlink 0.9s steps(1, end) infinite; }
@keyframes lampBlink { 50% { opacity: 0.45; } }

/* ---- C8: why-fusion panel ---- */
.why-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.why-item strong { display: block; color: var(--text); font-size: 0.92rem; margin-bottom: 3px; }
.why-item p { margin: 0; color: var(--muted); font-size: 0.84rem; line-height: 1.45; }
@media (max-width: 560px) { .why-grid { grid-template-columns: 1fr; } }

/* ---- C6: predict-then-test ---- */
.predict-q { margin: 0 0 14px; color: var(--text); font-size: 0.96rem; line-height: 1.45; font-weight: 600; }
.predict-choices { display: grid; gap: 8px; }
.predict-choice {
  text-align: left;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 0.88rem;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.predict-choice:hover:not(:disabled) { border-color: var(--teal); background: rgba(56, 225, 198, 0.12); }
.predict-choice:disabled { cursor: default; }
.predict-choice.correct { border-color: var(--green); background: rgba(126, 231, 135, 0.16); }
.predict-choice.wrong { border-color: var(--danger); background: rgba(255, 93, 93, 0.14); }
.predict-feedback { margin: 12px 0 0; font-size: 0.86rem; line-height: 1.5; color: var(--muted); }
.predict-feedback.right { color: var(--green); }
.predict-feedback.miss { color: var(--gold); }
.predict-next { margin-top: 14px; }

/* ---- C9: plain reading level hides the technical extras ---- */
body.plain .deeper { display: none; }

/* ---- B7: sound volume slider in the topbar ---- */
input[type="range"].vol-slider { width: 78px; height: 20px; margin: 0; flex: 0 0 auto; vertical-align: middle; }
input[type="range"].vol-slider[hidden] { display: none; }

/* ---- Mobile HUD declutter: drop the decorative gizmo cube and stack the camera
   cluster directly under the view-snap buttons so the two no longer overlap ---- */
@media (max-width: 920px) {
  #gizmoCanvas { display: none; }
  .nav-gizmo { top: 10px; right: 10px; padding: 6px; }
  .nav-cluster { top: 84px; bottom: auto; right: 10px; transform: none; gap: 6px; }
  .nav-btn { width: 36px; height: 36px; }
}
