:root {
  color-scheme: dark;
  --bg: #080d16;
  --panel: #101927;
  --panel-2: #0c1420;
  --line: rgba(174, 198, 220, .12);
  --line-strong: rgba(174, 198, 220, .2);
  --text: #edf4fb;
  --muted: #91a2b6;
  --dim: #65758a;
  --accent: #66e2d0;
  --accent-soft: rgba(102, 226, 208, .12);
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { overflow-x: hidden; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .app { height: 100vh; height: 100dvh; min-height: 0; }
button, input { font: inherit; }
button { color: inherit; }
.app { width: min(1600px, 100%); min-height: 100vh; margin: 0 auto; padding: 0 28px 10px; display: flex; flex-direction: column; background: radial-gradient(ellipse at 22% 0%, rgba(35, 76, 91, .13), transparent 42%), var(--bg); }
.topbar { height: 64px; flex: 0 0 64px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(102,226,208,.35); border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.brand-mark svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.25; }
.brand-copy { display: flex; flex-direction: column; gap: 2px; letter-spacing: .12em; }
.brand-copy span { font-size: 9px; color: var(--dim); font-weight: 700; }
.brand-copy strong { font-size: 11px; letter-spacing: .16em; }
.live-indicator { margin-left: auto; display: flex; align-items: center; gap: 8px; color: #a8bacb; font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.live-indicator span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(102,226,208,.8); }
.layout { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; padding-top: 18px; padding-bottom: 12px; }
.stage-column { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.hero { padding: 0 2px 2px; }
.eyebrow, .section-kicker { color: var(--accent); font-size: 9px; line-height: 1.4; letter-spacing: .16em; font-weight: 800; }
.eyebrow span { color: var(--dim); padding: 0 5px; }
h1 { margin: 6px 0 4px; font-size: clamp(25px, 2.3vw, 34px); line-height: 1.08; letter-spacing: -.045em; font-weight: 650; }
h1 em { color: var(--accent); font-style: normal; }
.hero p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.scene-card { min-height: 300px; height: clamp(300px, 43vh, 430px); flex: 0 0 auto; position: relative; overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--line-strong); border-radius: var(--radius); background: linear-gradient(145deg, rgba(18,31,46,.92), rgba(8,15,25,.98)); box-shadow: 0 20px 60px rgba(0,0,0,.2), inset 0 1px rgba(255,255,255,.025); }
.scene-card::before { content: ""; position: absolute; inset: 34px 0 28px; pointer-events: none; background: radial-gradient(ellipse at 52% 48%, rgba(37,105,111,.09), transparent 58%); }
.scene-toolbar, .scene-foot { z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; color: #8da0b4; font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.scene-toolbar { border-bottom: 1px solid rgba(174,198,220,.08); }
.scene-toolbar i { color: var(--dim); font-style: normal; padding: 0 4px; }
.scene-status { color: var(--accent); }
#sceneCanvas { width: 100%; height: 100%; min-height: 0; flex: 1 1 auto; display: block; outline: none; }
.scene-foot { padding-top: 7px; padding-bottom: 8px; border-top: 1px solid rgba(174,198,220,.07); font-size: 7px; letter-spacing: .1em; }
.legend { display: flex; gap: 14px; align-items: center; color: #a3b2c2; font-size: 8px; font-weight: 600; letter-spacing: .02em; }
.legend span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgba(102,226,208,.5); }
.legend-dot.field { background: #c5d0dc; box-shadow: none; }
.legend-dot.torquer { background: transparent; border: 1px solid #8393a7; box-shadow: none; }
.canvas-note { color: #66778b; white-space: nowrap; }
.canvas-note b { color: var(--accent); padding: 0 3px; }
.readout-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.readout { min-width: 0; padding: 10px 12px 9px; border: 1px solid var(--line); border-radius: 11px; background: linear-gradient(145deg, rgba(17,28,42,.92), rgba(11,19,30,.9)); }
.readout-label { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; color: #91a3b7; font-size: 8px; font-weight: 800; letter-spacing: .11em; }
.readout-label small, .control-head label small, .orbit-stats small, .check-row small { color: #63778c; font-size: 7px; letter-spacing: .1em; font-weight: 800; }
.readout strong { display: block; margin-top: 7px; color: var(--text); font-size: clamp(18px, 1.9vw, 24px); line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout strong span { color: #8fa1b4; font-size: 10px; font-weight: 550; letter-spacing: 0; }
.readout-sub { margin-top: 6px; color: #718399; font-size: 8px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readout-sub.field-check { margin-top: 4px; color: #657b90; font-size: 7px; line-height: 1.25; white-space: normal; overflow: visible; text-overflow: clip; }
.mini-meter { height: 3px; margin-top: 8px; border-radius: 5px; background: rgba(255,255,255,.07); overflow: hidden; }
.mini-meter span { display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--accent); box-shadow: 0 0 8px rgba(102,226,208,.4); transition: width .25s ease; }
.caption-card { display: flex; align-items: flex-start; gap: 12px; padding: 10px 13px; border-left: 2px solid var(--accent); border-radius: 0 9px 9px 0; background: rgba(102,226,208,.055); min-height: 50px; }
.caption-mark { flex: 0 0 auto; padding-top: 2px; color: var(--accent); font-size: 8px; font-weight: 850; letter-spacing: .13em; }
.caption-card p { margin: 0; color: #b6c4d1; font-size: 10px; line-height: 1.5; }
.control-panel { min-width: 0; align-self: stretch; max-height: calc(100dvh - 90px); overflow-y: auto; overscroll-behavior: contain; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(160deg, rgba(17,27,41,.97), rgba(10,17,28,.98)); scrollbar-width: thin; scrollbar-color: #344557 transparent; }
.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.panel-header h2 { margin: 4px 0 0; font-size: 17px; letter-spacing: -.025em; font-weight: 630; }
.panel-tag { padding: 5px 7px; border: 1px solid rgba(102,226,208,.22); border-radius: 5px; color: var(--accent); font-size: 7px; letter-spacing: .12em; font-weight: 800; }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: rgba(0,0,0,.16); }
.preset { min-height: 32px; padding: 5px 7px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #8293a6; font-size: 9px; font-weight: 700; cursor: pointer; transition: background .18s ease, color .18s ease, border-color .18s ease; }
.preset.active { color: var(--accent); border-color: rgba(102,226,208,.22); background: rgba(102,226,208,.09); }
.controls { display: flex; flex-direction: column; gap: 13px; padding: 17px 2px 13px; }
.control-group { display: flex; flex-direction: column; gap: 7px; }
.control-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.control-head label { color: #c4cfda; font-size: 10px; font-weight: 620; }
.control-head label small { margin-left: 4px; }
.control-value { color: var(--accent); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { width: 100%; height: 14px; margin: 0; background: transparent; appearance: none; -webkit-appearance: none; cursor: pointer; accent-color: var(--accent); }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, rgba(102,226,208,.65), rgba(102,226,208,.16)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, rgba(102,226,208,.65), rgba(102,226,208,.16)); }
input[type="range"]::-webkit-slider-thumb { width: 12px; height: 12px; margin-top: -4.5px; border: 2px solid #0c1721; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px rgba(102,226,208,.22), 0 0 10px rgba(102,226,208,.25); appearance: none; -webkit-appearance: none; }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #0c1721; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px rgba(102,226,208,.22); }
input:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 2px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.switch-label { display: inline-flex; align-items: center; gap: 9px; color: #c2ced9; font-size: 10px; font-weight: 650; cursor: pointer; }
.switch-label input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { width: 28px; height: 16px; border: 1px solid #4a5b6e; border-radius: 20px; background: #182536; position: relative; transition: .18s ease; }
.switch-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: #8b9bae; transition: .18s ease; }
.switch-label input:checked + .switch-ui { border-color: rgba(102,226,208,.55); background: rgba(102,226,208,.18); }
.switch-label input:checked + .switch-ui::after { left: 14px; background: var(--accent); }
.switch-label input:focus-visible + .switch-ui { outline: 2px solid var(--accent); outline-offset: 3px; }
.small-tag { color: #65788c; font-size: 7px; letter-spacing: .1em; font-weight: 800; }
.actions { display: grid; grid-template-columns: 1.25fr .9fr .75fr; gap: 6px; margin-top: 12px; }
.actions button { min-height: 34px; border: 1px solid var(--line-strong); border-radius: 7px; background: rgba(255,255,255,.035); color: #b6c4d2; font-size: 9px; font-weight: 700; cursor: pointer; transition: transform .15s ease, border-color .15s ease, background .15s ease; }
.actions button:hover { border-color: rgba(102,226,208,.42); background: rgba(102,226,208,.07); }
.actions button:active { transform: translateY(1px); }
.actions button.primary { border-color: rgba(102,226,208,.48); background: var(--accent); color: #06201e; }
.actions button.primary:hover { background: #84efdf; }
.button-icon { margin-right: 5px; font-size: 10px; }
.secondary-actions { grid-template-columns: 1fr 1fr; margin-top: 6px; }
.actions button.quiet { color: #8496a9; background: transparent; }
.orbit-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 0; margin-top: 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.orbit-stats div { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.orbit-stats span { color: #73869b; font-size: 7px; letter-spacing: .1em; font-weight: 800; }
.orbit-stats strong { color: #dbe6ef; font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.real-scaled { padding: 13px 0 10px; }
.real-scaled p { margin: 6px 0 0; color: #8b9caf; font-size: 9px; line-height: 1.55; }


.science-panel { border-top: 1px solid var(--line); padding-top: 10px; }
.science-panel summary { display: flex; align-items: center; justify-content: space-between; color: #d6e0e9; font-size: 11px; font-weight: 700; cursor: pointer; list-style: none; }
.science-panel summary::-webkit-details-marker { display: none; }
.chevron { color: var(--accent); font-size: 15px; transition: transform .2s ease; }
.science-panel[open] .chevron { transform: rotate(45deg); }
.science-content { padding-top: 12px; color: #92a3b5; font-size: 9px; line-height: 1.55; }
.science-content h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 12px 0 6px; color: #d5e0e9; font-size: 10px; }
.science-content h3:first-child { margin-top: 0; }
.science-content h3 small { color: #687b90; font-size: 7px; letter-spacing: .1em; }
.science-content p { margin: 6px 0; }
.science-content b { color: #c4d0dc; }
.science-content code { display: inline-block; max-width: 100%; color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; white-space: normal; }
.check-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.025); color: #a8b7c6; font-size: 9px; }
.check-row strong { color: var(--accent); font-size: 11px; white-space: nowrap; }
.check-row small { display: block; margin-top: 2px; }
.check-note { color: #6f8297; font-size: 8px; }
.disclaimer { margin-top: 10px !important; padding-top: 9px; border-top: 1px solid var(--line); color: #77899d; font-style: italic; }
.footer { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; min-height: 20px; color: #5f7185; font-size: 7px; font-weight: 800; letter-spacing: .12em; }
.footer span { color: var(--accent); }
.keyboard-hint { margin-left: auto; color: #4d6074; }
@media (max-width: 1050px) and (min-width: 701px) {
  .app { padding-left: 18px; padding-right: 18px; }
  .layout { grid-template-columns: minmax(0,1fr) 310px; gap: 14px; }
  .control-panel { padding: 12px; }
  .readout-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .readout { padding: 9px 11px; }
  .readout strong { font-size: 21px; }
}
@media (max-width: 700px) {
  body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
  body.embed-mode .app { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
  .app { padding: 0 12px 6px; }
  .topbar { height: 54px; flex-basis: 54px; gap: 9px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-copy span { font-size: 8px; }
  .brand-copy strong { font-size: 10px; }
  .live-indicator { font-size: 8px; }
  .layout { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; padding-bottom: 4px; overflow: hidden; }
  .stage-column { flex: 0 0 auto; gap: 8px; }
  .hero { padding-bottom: 1px; }
  .eyebrow { font-size: 8px; }
  h1 { margin: 4px 0 3px; font-size: 24px; }
  .hero p { font-size: 10px; }
  .scene-card { height: clamp(218px, 30vh, 275px); min-height: 218px; border-radius: 11px; }
  .scene-toolbar { padding: 8px 10px; font-size: 7px; }
  .scene-foot { padding: 6px 9px; }
  .legend { gap: 8px; font-size: 7px; }
  .legend span { gap: 4px; }
  .canvas-note { font-size: 6px; }
  .readout-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
  .readout { padding: 8px 9px 7px; border-radius: 8px; }
  .readout-label { font-size: 7px; gap: 4px; }
  .readout-label small { font-size: 6px; }
  .readout strong { margin-top: 5px; font-size: 18px; }
  .readout strong span { font-size: 9px; }
  .readout-sub { margin-top: 4px; font-size: 7px; }
  .mini-meter { margin-top: 6px; }
  .caption-card { padding: 7px 9px; gap: 8px; min-height: 42px; }
  .caption-mark { font-size: 7px; }
  .caption-card p { font-size: 8px; line-height: 1.4; }
  .control-panel { flex: 1 1 auto; min-height: 0; max-height: none; width: 100%; overflow-y: auto; padding: 12px; border-radius: 11px; }
  .panel-header { margin-bottom: 10px; }
  .panel-header h2 { font-size: 15px; }
  .controls { gap: 12px; padding: 13px 2px 11px; }
  .control-head label { font-size: 10px; }
  .control-value { font-size: 10px; }
  .footer { min-height: 16px; font-size: 6px; gap: 5px; }
  .keyboard-hint { display: none; }
}
@media (max-width: 380px) {
  .app { padding-left: 9px; padding-right: 9px; }
  .scene-card { height: 215px; min-height: 215px; }
  .canvas-note { display: none; }
  .legend { gap: 7px; }
  .readout strong { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
