.energy-sim {
  --sim-navy: #071b40;
  --sim-navy-raised: #0d2a58;
  --sim-blue: #86b9ff;
  --sim-paper: #fffaf0;
  --sim-paper-deep: #f3e8d4;
  --sim-ink: #17233d;
  --sim-muted: #657087;
  --sim-line: #d9cbb3;
  --sim-yellow: #ffc93c;
  --sim-red: #ef654f;
  --sim-green: #21b885;
  display: none;
  min-width: 0;
  height: 100%;
  color: var(--sim-ink);
}

.mission-shell.simulation-v2 .stage-panel[data-stage-panel="simulation"] > .energy-sim[data-sim-mounted="true"] {
  display: block;
}

.mission-shell.simulation-v2 .lab-legacy,
.mission-shell.reference-lab .energy-sim {
  display: none !important;
}

.app-shell[data-stage="simulation"] .aibo-companion {
  display: none;
}

.energy-sim-fallback {
  min-height: 320px;
  display: grid;
  place-content: center;
  gap: 10px;
  padding: 24px;
  border: 1px solid rgba(148, 190, 238, .3);
  border-radius: 20px;
  color: #eaf4ff;
  text-align: center;
  background: radial-gradient(circle at 50% 30%, rgba(45, 115, 202, .22), transparent 48%), #071b40;
}

.energy-sim-fallback b {
  font-size: 18px;
}

.energy-sim-fallback p {
  margin: 0;
  color: #a9bfd9;
  font-size: 12px;
}

.energy-sim-fallback button {
  min-height: 44px;
  border: 1px solid #ffe589;
  border-radius: 9px;
  color: #152448;
  background: #ffc93c;
  font-weight: 900;
}

.energy-sim *,
.energy-sim *::before,
.energy-sim *::after {
  box-sizing: border-box;
}

.energy-sim-shell {
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
}

.energy-sim-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 4px;
  color: #f3f8ff;
}

.energy-sim-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.energy-sim-number {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 235, 166, .58);
  border-radius: 13px;
  color: var(--sim-ink);
  background: linear-gradient(145deg, #fff2ad, var(--sim-yellow));
  box-shadow: 0 9px 24px rgba(255, 201, 60, .18);
  font-family: var(--font-cond, "Barlow Semi Condensed", sans-serif);
  font-size: 15px;
  font-weight: 900;
}

.energy-sim-kicker {
  display: block;
  color: #9eb9dc;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
}

.energy-sim-heading h2 {
  margin: 2px 0 0;
  color: #fff;
  font-family: var(--font-cond, "Barlow Semi Condensed", sans-serif);
  font-size: clamp(22px, 2vw, 31px);
  line-height: 1.08;
  letter-spacing: -.025em;
}

.energy-sim-status {
  flex: none;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid rgba(165, 198, 239, .25);
  border-radius: 999px;
  color: #dbe8fa;
  background: rgba(7, 27, 64, .72);
  font-size: 11px;
  font-weight: 850;
  backdrop-filter: blur(8px);
}

.energy-sim-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sim-yellow);
  box-shadow: 0 0 0 4px rgba(255, 201, 60, .12), 0 0 12px rgba(255, 201, 60, .7);
}

.energy-sim[data-phase="observed"] .energy-sim-status i {
  background: #69e4b5;
  box-shadow: 0 0 0 4px rgba(105, 228, 181, .12), 0 0 12px rgba(105, 228, 181, .7);
}

.energy-sim-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 350px);
  gap: 12px;
}

.energy-stage {
  position: relative;
  min-width: 0;
  min-height: 440px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(143, 187, 238, .28);
  border-radius: 22px;
  background:
    radial-gradient(70% 60% at 62% 30%, rgba(43, 126, 225, .2), transparent 55%),
    radial-gradient(56% 46% at 22% 72%, rgba(38, 198, 193, .12), transparent 62%),
    linear-gradient(145deg, #071938, #0b2a60 56%, #06142f);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, .08),
    0 26px 55px rgba(0, 8, 26, .25);
}

.energy-stage::after {
  content: "";
  position: absolute;
  z-index: 6;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(255,255,255,.035), transparent 9% 91%, rgba(255,255,255,.03)),
    radial-gradient(ellipse at 50% 52%, transparent 46%, rgba(0, 7, 24, .24) 100%);
  box-shadow: inset 0 0 0 1px rgba(165, 204, 250, .04);
  transition: box-shadow .35s ease, background .35s ease;
}

.energy-stage.is-powered::after {
  background:
    radial-gradient(circle at 53% 27%, rgba(255, 220, 104, .2), transparent 22%),
    radial-gradient(ellipse at 50% 52%, transparent 48%, rgba(0, 7, 24, .2) 100%);
  box-shadow:
    inset 0 0 0 2px rgba(255, 207, 66, .28),
    inset 0 0 68px rgba(255, 194, 44, .09);
}

.energy-stage-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: .34;
  background:
    radial-gradient(circle, rgba(165, 204, 250, .28) 0 1px, transparent 1.5px) 0 0 / 27px 27px,
    linear-gradient(rgba(131, 176, 232, .055) 1px, transparent 1px) 0 0 / 108px 108px,
    linear-gradient(90deg, rgba(131, 176, 232, .055) 1px, transparent 1px) 0 0 / 108px 108px;
  mask-image: radial-gradient(ellipse at 50% 54%, #000 28%, transparent 83%);
}

.energy-stage-aurora {
  position: absolute;
  z-index: 0;
  width: 48%;
  aspect-ratio: 1;
  right: -13%;
  top: -19%;
  border: 1px solid rgba(113, 174, 255, .12);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 40%, rgba(71, 146, 255, .19), transparent 57%),
    conic-gradient(from 210deg, transparent, rgba(75, 164, 255, .12), transparent 45%);
  filter: blur(1px);
  transform: rotate(-18deg);
}

.energy-stage[data-renderer="3d"] {
  background:
    radial-gradient(66% 58% at 50% 43%, #fffaf0, transparent 78%),
    linear-gradient(155deg, #f7eedf, #eaddc5);
}

.energy-stage[data-renderer="3d"]::after {
  background:
    radial-gradient(ellipse at 50% 46%, transparent 50%, rgba(81, 56, 20, .07) 100%),
    linear-gradient(90deg, rgba(255,255,255,.12), transparent 14% 86%, rgba(255,255,255,.1));
  box-shadow: inset 0 0 0 1px rgba(111, 82, 41, .1);
}

.energy-stage[data-renderer="3d"] .energy-stage-grid,
.energy-stage[data-renderer="3d"] .energy-stage-aurora,
.energy-stage[data-renderer="3d"] .energy-schematic,
.energy-stage[data-renderer="3d"] .sim-hotspot,
.energy-stage[data-renderer="3d"] .sim-switch-hotspot {
  display: none;
}

.sim-reference-view {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: none;
  background: #f6eddd;
}

.energy-stage[data-renderer="reference"] {
  background: #f6eddd;
}

.energy-stage[data-renderer="reference"]::after {
  background:
    radial-gradient(ellipse at 50% 46%, transparent 58%, rgba(81, 56, 20, .045) 100%),
    linear-gradient(90deg, rgba(255,255,255,.08), transparent 12% 88%, rgba(255,255,255,.08));
  box-shadow: inset 0 0 0 1px rgba(111, 82, 41, .08);
}

.energy-stage[data-renderer="reference"] .energy-stage-grid,
.energy-stage[data-renderer="reference"] .energy-stage-aurora,
.energy-stage[data-renderer="reference"] .energy-schematic,
.energy-stage[data-renderer="reference"] .sim-hotspot,
.energy-stage[data-renderer="reference"] .sim-switch-hotspot,
.energy-stage[data-renderer="reference"] .sim-3d-view {
  display: none;
}

.energy-stage[data-renderer="reference"] .sim-reference-view {
  display: block;
}

.energy-stage[data-renderer="reference"]:not(.is-ready) .sim-reference-view {
  pointer-events: none;
}

.energy-stage[data-renderer="reference"] .sim-stage-toast {
  bottom: 62px;
}

.sim-reference-switch {
  display: none;
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 50%;
  width: clamp(72px, 11%, 122px);
  height: clamp(54px, 9%, 82px);
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 18px;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.sim-reference-switch:not([data-aligned="true"]) {
  visibility: hidden;
}

.energy-stage[data-renderer="reference"] .sim-reference-switch:not([hidden]) {
  display: block;
}

.sim-reference-switch span {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  pointer-events: none;
}

.sim-reference-switch:focus-visible {
  outline: 3px solid #fff2a8;
  outline-offset: 3px;
}

.sim-reference-switch[hidden] {
  display: none;
}

.sim-3d-view {
  position: absolute;
  z-index: 3;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(68% 62% at 52% 44%, #fffaf0 0%, #f7eddb 45%, #ecdec6 78%),
    linear-gradient(160deg, #f7efdf, #eaddc4);
}

.sim-3d-view[hidden] {
  display: none;
}

#sim3dCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
  outline: none;
}

#sim3dCanvas:focus-visible {
  outline: 3px solid var(--sim-yellow);
  outline-offset: -5px;
}

.sim-3d-labels {
  position: absolute;
  z-index: 4;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.sim-3d-label {
  position: absolute;
  transform: translate(-50%, -100%);
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid #d8c5a9;
  border-radius: 9px;
  color: #26334d;
  background: rgba(255, 253, 246, .94);
  box-shadow: 0 8px 17px rgba(48, 34, 16, .14);
  pointer-events: auto;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 850;
}

.sim-3d-label::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 7px;
  height: 7px;
  border-right: 1px solid #d8c5a9;
  border-bottom: 1px solid #d8c5a9;
  background: #fffdf6;
  transform: translateX(-50%) rotate(45deg);
}

.sim-3d-label.is-action {
  color: #4d3505;
  border-color: #e8bc38;
  background: #ffdf77;
}

.sim-3d-label.is-action::after {
  border-color: #e8bc38;
  background: #ffdf77;
}

.sim-3d-label.is-wire {
  color: #843025;
  border-color: rgba(239, 101, 79, .5);
  background: #fff1eb;
}

.sim-3d-label.is-wire.is-done {
  color: #12694d;
  border-color: #9ad8bf;
  background: #eafaf4;
}

.sim-3d-label.is-hovered {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.sim-3d-label[hidden] {
  display: none;
}

.sim-3d-loading {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 50%;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  transform: translate(-50%, -50%);
  border: 1px solid #decaaa;
  border-radius: 11px;
  color: #2a3852;
  background: rgba(255, 252, 242, .94);
  box-shadow: 0 12px 24px rgba(59, 39, 13, .13);
  font-size: 10px;
  font-weight: 800;
}

.sim-3d-loading[hidden] {
  display: none;
}

.sim-3d-loading i {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(230, 181, 42, .24);
  border-top-color: #dda515;
  border-radius: 50%;
  animation: sim-loading-spin .8s linear infinite;
}

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

.energy-stage-caption {
  position: absolute;
  z-index: 7;
  top: 15px;
  left: 16px;
  max-width: min(330px, calc(100% - 32px));
  padding: 10px 13px 11px;
  border: 1px solid rgba(156, 199, 249, .25);
  border-radius: 13px;
  color: #eef6ff;
  background: rgba(4, 22, 52, .72);
  box-shadow: 0 12px 25px rgba(0, 8, 27, .2);
  backdrop-filter: blur(8px);
}

.energy-stage-label {
  display: block;
  color: #8fb2dd;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .13em;
}

.energy-stage-caption b {
  display: block;
  margin-top: 3px;
  color: #fff;
  font-size: 14px;
  line-height: 1.25;
}

.energy-stage-caption small {
  display: block;
  margin-top: 2px;
  color: #bbcbe0;
  font-size: 9px;
  line-height: 1.4;
}

.energy-schematic {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.sim-orbit-line {
  fill: none;
  stroke: rgba(102, 160, 228, .105);
  stroke-width: 1.2;
  stroke-dasharray: 3 13;
}

.sim-orbit-line.is-short {
  stroke: rgba(255, 215, 99, .075);
  stroke-width: 1;
}

.sim-wire {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sim-wire-under {
  stroke-width: 10;
  filter: drop-shadow(0 5px 7px rgba(0, 5, 17, .35));
}

.sim-wire-under.sim-wire-red {
  stroke: #d94e48;
}

.sim-wire-under.sim-wire-black {
  stroke: #111c30;
}

.sim-wire-live {
  opacity: 0;
  stroke: rgba(255, 238, 141, .97);
  stroke-width: 3.2;
  stroke-dasharray: 3 19;
  filter: drop-shadow(0 0 7px rgba(255, 221, 83, .9));
  transition: opacity .22s ease;
}

.energy-stage.is-powered .sim-wire-live {
  opacity: .9;
  animation: sim-current-flow 1.8s linear infinite;
}

.sim-wire-gap {
  fill: none;
  stroke: #ff8a74;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 8 12;
  opacity: .88;
  filter: drop-shadow(0 0 7px rgba(255, 118, 89, .58));
  animation: sim-gap-pulse 1.35s ease-in-out infinite;
}

.energy-stage.is-connected .sim-wire-gap {
  stroke: #ffc93c;
  opacity: 1;
  filter: drop-shadow(0 0 8px rgba(255, 213, 88, .62));
}

.sim-current-route {
  fill: none;
  stroke: none;
  pointer-events: none;
}

.sim-flow-particles {
  pointer-events: none;
}

.sim-current-particle {
  fill: #ffd75e;
  filter: drop-shadow(0 0 5px rgba(255, 218, 83, .95));
}

.sim-junction circle {
  fill: #164d8d;
  stroke: #b9d9fb;
  stroke-width: 3;
  transition: fill .25s ease, stroke .25s ease, filter .25s ease;
}

.energy-stage.is-connected .sim-junction circle {
  fill: #2ac18c;
  stroke: #ddfff2;
}

.energy-stage.is-powered .sim-junction circle {
  filter: drop-shadow(0 0 5px rgba(255, 226, 112, .9));
}

.sim-junction.is-flashing circle {
  animation: sim-junction-flash .55s ease-out both;
}

.sim-led-glass {
  stroke: #e0a724;
  stroke-width: 3;
  filter: saturate(.58) brightness(.82);
  transition: filter .35s ease;
}

.sim-led-halo {
  fill: none;
  stroke: rgba(255, 210, 74, .24);
  stroke-width: 3;
}

.sim-led-bloom {
  opacity: 0;
  transition: opacity .5s ease;
}

.sim-led-filament,
.sim-led-base,
.sim-led-thread,
.sim-led-lead {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sim-led-filament {
  stroke: #8e6a17;
  stroke-width: 3.4;
}

.sim-led-base {
  fill: #aeb7c2;
  stroke: #657180;
  stroke-width: 3;
}

.sim-led-thread {
  stroke: #687382;
  stroke-width: 2;
}

.sim-led-lead {
  stroke: #778391;
  stroke-width: 8;
}

.energy-stage.is-powered .sim-led-glass {
  filter: saturate(1) brightness(1.16);
}

.energy-stage.is-powered .sim-led-bloom {
  opacity: .92;
  animation: sim-led-breathe 1.8s ease-in-out infinite alternate;
}

.energy-stage.is-powered .sim-led-halo {
  stroke: rgba(255, 231, 120, .8);
  filter: url(#energySoftGlow);
}

.energy-stage.is-powered .sim-led-filament {
  stroke: #fff7c8;
  filter: drop-shadow(0 0 5px #ffe573);
}

.sim-resistor-art rect {
  fill: #d5b789;
  stroke: #5f4329;
  stroke-width: 3;
}

.sim-resistor-art path {
  stroke: #805234;
  stroke-width: 3;
}

.sim-switch-art > circle:first-child {
  fill: rgba(19, 55, 98, .8);
  stroke: #86b5e0;
  stroke-width: 3;
  filter: drop-shadow(0 8px 13px rgba(0, 5, 19, .3));
}

.sim-switch-lever {
  fill: none;
  stroke: #ffc93c;
  stroke-width: 8;
  stroke-linecap: round;
  transform-box: fill-box;
  transform-origin: left center;
  transform: rotate(-36deg);
  transition: transform .42s cubic-bezier(.2,.9,.2,1.2), stroke .25s ease;
  filter: drop-shadow(0 0 7px rgba(255, 201, 60, .48));
}

.energy-stage[data-switch="closed"] .sim-switch-lever {
  stroke: #6ee3b5;
  transform: rotate(0deg);
}

.sim-switch-contact {
  fill: #dbeafb;
}

.sim-battery-body {
  stroke: #020711;
  stroke-width: 3;
}

.sim-battery-cap {
  fill: #dfac6b;
  stroke: #8f5a2f;
  stroke-width: 3;
}

.sim-battery-cap.is-negative {
  fill: #bd7e43;
}

.sim-battery-sign {
  fill: #fff;
  font-family: var(--font-cond, "Barlow Semi Condensed", sans-serif);
  font-size: 34px;
  font-weight: 900;
}

.sim-battery-small {
  fill: #dbe8f7;
  font-family: var(--font-cond, "Barlow Semi Condensed", sans-serif);
  font-size: 13px;
  font-weight: 800;
}

.sim-part-label {
  fill: #d8e8ff;
  font-family: var(--font-cond, "Barlow Semi Condensed", sans-serif);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .04em;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .45));
}

.sim-part-label.is-small {
  fill: #b7cde8;
  font-size: 13px;
}

.sim-hotspot,
.sim-switch-hotspot {
  position: absolute;
  z-index: 5;
  border: 0;
  color: #052044;
  cursor: pointer;
  touch-action: manipulation;
}

.sim-hotspot {
  width: 44px;
  height: 44px;
  left: 34.375%;
  top: 76.61%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  border: 3px solid #fff1aa;
  border-radius: 50%;
  background: linear-gradient(145deg, #fff3ad, var(--sim-yellow));
  box-shadow: 0 0 0 5px rgba(255, 201, 60, .13), 0 0 19px rgba(255, 201, 60, .5);
  font-size: 20px;
  font-weight: 950;
  animation: sim-connect-pulse 1.6s ease-out infinite;
}

.sim-hotspot-wire {
  left: 26.04%;
  border-color: rgba(255, 231, 152, .9);
  color: transparent;
  background: rgba(7, 27, 64, .82);
}

.sim-hotspot-wire::after {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--sim-yellow);
  box-shadow: 0 0 8px rgba(255, 216, 75, .62);
}

.sim-hotspot.is-selected {
  outline: 4px solid #fff;
  outline-offset: 3px;
  animation: sim-selected-pulse .8s ease-in-out infinite alternate;
}

.sim-hotspot.is-connected {
  opacity: 0;
  pointer-events: none;
}

.energy-stage:not(.is-ready) .sim-hotspot,
.energy-stage:not(.is-ready) .sim-switch-hotspot {
  cursor: not-allowed;
  filter: grayscale(.55);
  opacity: .54;
}

.sim-switch-hotspot {
  width: clamp(62px, 8vw, 88px);
  aspect-ratio: 1;
  left: 17.7%;
  top: 56.45%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: transparent;
}

.sim-switch-hotspot span {
  position: absolute;
  inset: -7px;
  border: 1px solid rgba(143, 188, 239, .28);
  border-radius: 50%;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.sim-switch-hotspot.is-action span {
  border-color: rgba(255, 201, 60, .8);
  animation: sim-switch-pulse 1.7s ease-out infinite;
}

.sim-switch-hotspot:focus-visible,
.sim-hotspot:focus-visible,
.energy-console button:focus-visible {
  outline: 3px solid #fff3b4;
  outline-offset: 3px;
}

.sim-readout {
  position: absolute;
  z-index: 7;
  left: 14px;
  bottom: 14px;
  display: flex;
  gap: 5px;
  padding: 7px;
  border: 1px solid rgba(151, 193, 241, .22);
  border-radius: 12px;
  background: rgba(4, 20, 48, .8);
  box-shadow: 0 12px 22px rgba(0, 6, 20, .22);
  backdrop-filter: blur(8px);
}

.sim-readout > span {
  min-width: 63px;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .045);
}

.sim-readout small,
.sim-readout b {
  display: block;
  white-space: nowrap;
}

.sim-readout small {
  color: #94aecf;
  font-size: 7px;
  font-weight: 800;
}

.sim-readout b {
  margin-top: 2px;
  color: #f4f8ff;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 10px;
  font-weight: 700;
}

.energy-stage.is-powered .sim-readout > span:last-child {
  background: rgba(255, 201, 60, .13);
}

.energy-stage.is-powered .sim-readout > span:last-child b {
  color: #ffe47f;
}

.sim-stage-toast {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 19px;
  max-width: min(380px, calc(100% - 36px));
  transform: translate(-50%, 10px);
  opacity: 0;
  pointer-events: none;
  padding: 8px 12px;
  border: 1px solid rgba(255, 231, 157, .36);
  border-radius: 9px;
  color: #fff4ca;
  background: rgba(6, 25, 57, .9);
  box-shadow: 0 12px 25px rgba(0, 6, 22, .25);
  font-size: 10px;
  font-weight: 750;
  text-align: center;
  transition: opacity .2s ease, transform .2s ease;
}

.sim-stage-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.energy-console {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--sim-line);
  border-radius: 20px;
  color: var(--sim-ink);
  background:
    radial-gradient(circle at 100% 0, rgba(255, 201, 60, .13), transparent 28%),
    linear-gradient(180deg, #fffdf7, #f6ecda);
  box-shadow: 0 22px 48px rgba(0, 7, 22, .2);
  scrollbar-width: thin;
}

.sim-recap {
  margin: 0 0 9px;
  padding: 7px 9px;
  border-left: 3px solid #e1ad20;
  border-radius: 6px;
  color: #566178;
  background: rgba(255, 243, 193, .55);
  font-size: 8px;
  line-height: 1.45;
}

.sim-recap span {
  margin-right: 5px;
  color: #88620a;
  font-weight: 900;
}

.sim-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

.sim-steps li {
  min-width: 0;
  min-height: 53px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid #e2d6c3;
  border-radius: 10px;
  color: var(--sim-muted);
  background: rgba(255, 255, 255, .48);
  transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease;
}

.sim-steps li i {
  width: 20px;
  height: 20px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: #29476e;
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
}

.sim-steps li b,
.sim-steps li small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sim-steps li b {
  font-size: 9px;
}

.sim-steps li small {
  margin-top: 1px;
  color: #8b91a0;
  font-size: 7px;
}

.sim-steps li.is-current {
  color: var(--sim-ink);
  border-color: #e4b72c;
  background: #fff5c9;
  transform: translateY(-1px);
}

.sim-steps li.is-current i {
  color: var(--sim-ink);
  background: var(--sim-yellow);
}

.sim-steps li.is-done {
  color: #1a7053;
  border-color: #b8dfce;
  background: #f0fbf6;
}

.sim-steps li.is-done i {
  background: var(--sim-green);
}

.sim-prediction-panel,
.sim-instruction-panel,
.sim-result-card {
  border: 1px solid #e0d3bf;
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
  box-shadow: inset 0 1px rgba(255, 255, 255, .7);
}

.sim-prediction-panel {
  padding: 12px;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.energy-sim[data-phase="predict"] .sim-prediction-panel {
  border-color: #e6bb3d;
  box-shadow: 0 0 0 3px rgba(255, 201, 60, .09);
}

.sim-section-label {
  display: block;
  color: #947012;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.sim-prediction-panel h3 {
  margin: 5px 0 3px;
  font-family: var(--font-cond, "Barlow Semi Condensed", sans-serif);
  font-size: 18px;
  line-height: 1.18;
  letter-spacing: -.02em;
}

.sim-prediction-panel p,
.sim-instruction-panel p,
.sim-result-card p,
.sim-model-note {
  margin: 0;
  color: var(--sim-muted);
  font-size: 9px;
  line-height: 1.48;
}

.sim-prediction-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 10px;
}

.sim-prediction-choices button {
  min-height: 49px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid #d8d0c3;
  border-radius: 10px;
  color: var(--sim-ink);
  background: #fffefa;
  text-align: left;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.sim-prediction-choices button:hover {
  transform: translateY(-1px);
  border-color: #bba77f;
}

.sim-prediction-choices button[aria-pressed="true"] {
  border-color: #d7a31a;
  background: #fff4bf;
  box-shadow: 0 0 0 3px rgba(255, 201, 60, .12);
}

.sim-prediction-choices b,
.sim-prediction-choices small {
  display: block;
}

.sim-prediction-choices b {
  font-size: 11px;
}

.sim-prediction-choices small {
  margin-top: 1px;
  color: var(--sim-muted);
  font-size: 7px;
}

.sim-prediction-orb {
  position: relative;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: #d9d9d4;
  border: 3px solid #b8b8b2;
}

.sim-prediction-orb::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #9a9a94;
}

.sim-prediction-orb.is-on {
  background: #fff8d5;
  border-color: #e6b92f;
}

.sim-prediction-orb.is-on::after {
  background: #ffc93c;
  box-shadow: 0 0 10px rgba(255, 201, 60, .65);
}

.sim-prediction-orb.is-off::before {
  content: "";
  position: absolute;
  z-index: 2;
  width: 19px;
  height: 2px;
  left: 2px;
  top: 11px;
  background: #667085;
  transform: rotate(-42deg);
}

.sim-instruction-panel {
  margin-top: 9px;
  padding: 11px 12px 12px;
}

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

.sim-model-chip {
  padding: 3px 6px;
  border-radius: 6px;
  color: #72510f;
  background: #fff0af;
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 7px;
  font-weight: 700;
}

.sim-instruction-panel > b {
  display: block;
  margin-top: 6px;
  font-family: var(--font-cond, "Barlow Semi Condensed", sans-serif);
  font-size: 17px;
  line-height: 1.2;
}

.sim-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 7px;
  margin-top: 10px;
}

.sim-button {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .01em;
}

.sim-button.is-quiet {
  color: var(--sim-ink);
  border-color: #d9cebd;
  background: #fffdf8;
}

.sim-button.is-primary {
  color: #fff;
  border-color: #162b54;
  background: linear-gradient(145deg, #294f83, #142f5b);
  box-shadow: 0 8px 18px rgba(20, 47, 91, .18);
}

.energy-sim:not([data-phase="ready"]) .sim-button.is-primary {
  color: #67738a;
  border-color: #d8d0c3;
  background: #efede8;
  box-shadow: none;
}

.energy-sim[data-phase="ready"] .sim-button.is-primary {
  background: linear-gradient(145deg, #ffd96c, var(--sim-yellow));
  color: var(--sim-ink);
  border-color: #ffe99e;
  box-shadow: 0 0 0 3px rgba(255, 201, 60, .13), 0 10px 20px rgba(167, 112, 7, .16);
}

.sim-result-card {
  margin-top: 9px;
  padding: 11px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.sim-result-card[hidden] {
  display: none;
}

.sim-result-card[data-tone="success"] {
  border-color: #a9dcc8;
  background: #f0fbf6;
}

.sim-result-card[data-tone="retry"] {
  border-color: #efc5b9;
  background: #fff5f1;
}

.sim-result-icon {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #fff0b2;
}

.sim-result-icon::before {
  content: "!";
  color: #86600c;
  font-size: 15px;
  font-weight: 950;
}

.sim-result-card[data-tone="success"] .sim-result-icon {
  background: #ccefe0;
}

.sim-result-card[data-tone="success"] .sim-result-icon::before {
  content: "✓";
  color: #11704f;
}

.sim-result-card b {
  display: block;
  font-size: 11px;
}

.sim-result-card p {
  margin-top: 3px;
}

.sim-button.is-next {
  width: 100%;
  margin-top: 9px;
  color: #fff;
  background: linear-gradient(145deg, #1d9b70, #137a54);
  box-shadow: 0 9px 18px rgba(19, 122, 84, .18);
}

.sim-button.is-next[hidden] {
  display: none;
}

.sim-model-note {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px dashed #d8ccb8;
  font-size: 8px;
}

.sim-observation-strip {
  min-width: 0;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 6px 12px;
  border: 1px solid rgba(150, 190, 237, .2);
  border-radius: 12px;
  color: #d5e4f7;
  background: rgba(5, 24, 57, .68);
}

.sim-observation-strip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  white-space: nowrap;
}

.sim-observation-strip span i {
  color: var(--sim-yellow);
  font-family: var(--font-mono, "JetBrains Mono", monospace);
  font-size: 7px;
  font-style: normal;
}

.sim-observation-strip span b {
  font-weight: 750;
}

.sim-observation-strip small {
  margin-left: auto;
  color: #91a9c8;
  font-size: 8px;
  white-space: nowrap;
}

.energy-stage.is-celebrating {
  animation: sim-success-pop .85s cubic-bezier(.2,.9,.2,1);
}

.energy-stage.is-fault {
  animation: sim-fault-shake .5s ease-in-out;
}

@keyframes sim-current-flow {
  to { stroke-dashoffset: -66; }
}

@keyframes sim-gap-pulse {
  50% { opacity: .38; }
}

@keyframes sim-connect-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 201, 60, .5), 0 0 17px rgba(255, 201, 60, .45); }
  70% { box-shadow: 0 0 0 13px rgba(255, 201, 60, 0), 0 0 17px rgba(255, 201, 60, .45); }
  100% { box-shadow: 0 0 0 0 rgba(255, 201, 60, 0), 0 0 17px rgba(255, 201, 60, .45); }
}

@keyframes sim-selected-pulse {
  to { transform: translate(-50%, -50%) scale(1.15); }
}

@keyframes sim-switch-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 201, 60, .36); }
  75% { box-shadow: 0 0 0 15px rgba(255, 201, 60, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 201, 60, 0); }
}

@keyframes sim-junction-flash {
  0% { filter: drop-shadow(0 0 0 rgba(255, 230, 129, 0)); }
  45% { fill: #fff0a3; stroke: #fff; filter: drop-shadow(0 0 12px rgba(255, 230, 129, 1)); }
  100% { filter: drop-shadow(0 0 0 rgba(255, 230, 129, 0)); }
}

@keyframes sim-led-breathe {
  from { opacity: .72; transform: scale(.97); transform-origin: 510px 166px; }
  to { opacity: 1; transform: scale(1.035); transform-origin: 510px 166px; }
}

@keyframes sim-success-pop {
  0% { transform: scale(1); }
  34% { transform: scale(1.006); box-shadow: inset 0 0 0 2px rgba(255, 220, 100, .4), 0 26px 55px rgba(0, 8, 26, .25); }
  100% { transform: scale(1); }
}

@keyframes sim-fault-shake {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(-5px); }
  38% { transform: translateX(5px); }
  58% { transform: translateX(-3px); }
  78% { transform: translateX(2px); }
}

@media (max-width: 1120px) {
  .energy-sim-main {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .energy-console {
    padding: 11px;
  }

  .sim-steps li {
    min-height: 48px;
    padding: 5px;
  }

  .sim-steps li small {
    display: none;
  }

  .sim-prediction-panel h3 {
    font-size: 16px;
  }
}

@media (max-width: 920px) {
  .energy-sim {
    height: auto;
  }

  .energy-sim-shell {
    height: auto;
  }

  .energy-sim-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .energy-stage {
    min-height: clamp(390px, 58vw, 540px);
  }

  .energy-console {
    overflow: visible;
  }

  .sim-observation-strip small {
    display: none;
  }
}

@media (max-width: 760px) {
  .energy-sim-shell {
    gap: 7px;
  }

  .energy-sim-head {
    min-height: 50px;
    padding-inline: 2px;
  }

  .energy-sim-number {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    font-size: 13px;
  }

  .energy-sim-heading {
    gap: 9px;
  }

  .energy-sim-kicker {
    font-size: 8px;
  }

  .energy-sim-heading h2 {
    font-size: 20px;
  }

  .energy-sim-status {
    min-height: 32px;
    padding: 0 9px;
    font-size: 9px;
  }

  .energy-stage {
    min-height: clamp(330px, 53dvh, 430px);
    border-radius: 17px;
  }

  .energy-stage-caption {
    top: 9px;
    left: 9px;
    max-width: calc(100% - 18px);
    padding: 7px 9px;
    border-radius: 10px;
  }

  .energy-stage-caption b {
    font-size: 12px;
  }

  .energy-stage-caption small {
    font-size: 8px;
  }

  .sim-readout {
    left: 8px;
    bottom: 8px;
    gap: 3px;
    padding: 4px;
  }

  .sim-readout > span {
    min-width: 52px;
    padding: 4px 5px;
  }

  .sim-readout b {
    font-size: 8px;
  }

  .sim-stage-toast {
    bottom: 52px;
    font-size: 9px;
  }

  .sim-battery-caption {
    display: none;
  }

  .sim-hotspot {
    width: 44px;
    height: 44px;
  }

  .sim-switch-hotspot {
    width: 62px;
  }

  .energy-console {
    padding: 10px;
    border-radius: 15px;
  }

  .sim-steps {
    margin-bottom: 9px;
  }

  .sim-steps li {
    min-height: 42px;
  }

  .sim-prediction-panel,
  .sim-instruction-panel {
    padding: 10px;
  }

  .sim-prediction-panel h3 {
    margin-top: 4px;
    font-size: 16px;
  }

  .sim-prediction-panel p {
    display: none;
  }

  .sim-prediction-choices {
    margin-top: 7px;
  }

  .sim-prediction-choices button {
    min-height: 45px;
  }

  .sim-actions {
    margin-top: 8px;
  }

  .sim-button {
    min-height: 44px;
  }

  .sim-observation-strip {
    gap: 12px;
    padding: 6px 9px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .sim-observation-strip::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 430px) {
  .energy-sim-status span {
    display: none;
  }

  .energy-sim-status {
    width: 32px;
    padding: 0;
    justify-content: center;
  }

  .energy-stage {
    min-height: 320px;
  }

  .energy-stage-caption small {
    display: none;
  }

  .sim-steps li {
    justify-content: center;
  }

  .sim-steps li span {
    display: none;
  }

  .sim-prediction-choices button {
    padding: 6px;
  }

  .sim-prediction-orb {
    width: 24px;
    height: 24px;
  }

  .sim-prediction-orb.is-off::before {
    top: 9px;
    width: 17px;
  }

  .sim-observation-strip span:nth-child(2) {
    display: none;
  }
}

@media (max-height: 720px) and (min-width: 921px) {
  .energy-sim-head {
    min-height: 48px;
  }

  .energy-stage {
    min-height: 370px;
  }

  .energy-console {
    padding: 10px;
  }

  .sim-prediction-panel h3 {
    font-size: 16px;
  }

  .sim-steps li {
    min-height: 45px;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .mission-shell[data-stage="simulation"] .stage-panel[data-stage-panel="simulation"] {
    height: calc(100dvh - 92px) !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .energy-sim,
  .energy-sim-shell {
    height: 100%;
  }

  .energy-sim-shell {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .energy-sim-head {
    min-height: 42px;
  }

  .energy-sim-heading h2 {
    font-size: 20px;
  }

  .energy-sim-main {
    grid-template-columns: minmax(0, 1.5fr) minmax(250px, 1fr);
    min-height: 0;
  }

  .energy-stage {
    min-height: 0;
  }

  .energy-console {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
  }

  .sim-observation-strip {
    display: none;
  }

  .sim-readout,
  .sim-battery-caption {
    display: none;
  }

  .sim-steps li {
    min-height: 40px;
    justify-content: center;
  }

  .sim-steps li span {
    display: none;
  }

  .sim-recap {
    display: none;
  }
}
