:root {
  color-scheme: dark;
  --bg: #07111b;
  --panel: #0c1925;
  --panel-2: #102130;
  --line: rgba(167, 194, 210, .13);
  --muted: #8296a6;
  --soft: #b7c6d0;
  --text: #edf5f8;
  --accent: #68e0d6;
  --accent-dim: rgba(104, 224, 214, .14);
  --grid: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-width: 0; width: 100%; min-height: 100%; background: var(--bg); color: var(--text); }
body { overflow-x: hidden; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100vh; height: 100vh; display: grid; grid-template-rows: 76px minmax(0, 1fr) 28px; background: radial-gradient(ellipse at 43% 42%, rgba(24, 51, 67, .25), transparent 52%), var(--bg); overflow: hidden; }
.topbar { display: grid; grid-template-columns: 210px minmax(0, 1fr) 150px; align-items: center; gap: 24px; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(7, 17, 27, .92); }
.studio-mark { display: flex; align-items: center; gap: 11px; color: #b5c7d1; }
.studio-name { font-size: 10px; font-weight: 750; letter-spacing: .18em; white-space: nowrap; }
.mark-orbit { position: relative; width: 26px; height: 26px; border: 1px solid rgba(104,224,214,.75); border-radius: 50%; transform: rotate(-28deg); }
.mark-orbit::after { content: ""; position: absolute; inset: 6px -4px; border: 1px solid rgba(104,224,214,.45); border-radius: 50%; }
.mark-orbit i { position: absolute; width: 5px; height: 5px; top: 2px; right: 1px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.heading-block { min-width: 0; }
.eyebrow, .panel-kicker, .section-label, .readout-name, .stage-chip, .stage-coordinate, .stage-scale, .bottomline, .validation-head, .summary-hint { font-size: 9px; letter-spacing: .16em; font-weight: 750; color: var(--muted); }
.eyebrow span { color: var(--accent); padding: 0 4px; }
h1 { margin: 5px 0 0; font-size: 19px; line-height: 1.15; font-weight: 620; letter-spacing: -.035em; }
.live-state { justify-self: end; display: flex; align-items: center; gap: 8px; color: #a5b8c5; font-size: 9px; font-weight: 750; letter-spacing: .14em; white-space: nowrap; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(104,224,214,.7); }
.workspace { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 356px; }
.stage-panel { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; border-right: 1px solid var(--line); }
.stage-wrap { position: relative; min-height: 0; overflow: hidden; background: radial-gradient(ellipse at 50% 48%, #0b1c29 0%, #081521 54%, #07111b 100%); }
#spaceCanvas { display: block; width: 100%; height: 100%; outline: none; }
.stage-topline { position: absolute; top: 20px; left: 22px; right: 22px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.stage-chip { border: 1px solid rgba(104,224,214,.27); background: rgba(7,17,27,.55); color: #9bd7d2; padding: 7px 10px; border-radius: 3px; letter-spacing: .13em; }
.stage-coordinate { color: #8299a8; letter-spacing: .12em; }
.stage-coordinate b { color: #d7e3e8; font-weight: 700; }
.stage-legend { position: absolute; left: 22px; bottom: 18px; display: flex; flex-wrap: wrap; gap: 15px; padding: 8px 10px; border: 1px solid rgba(167,194,210,.12); background: rgba(7,17,27,.65); border-radius: 4px; color: #a3b5c0; font-size: 9px; letter-spacing: .02em; pointer-events: none; }
.stage-legend span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.legend-line { display: inline-block; width: 17px; height: 2px; border-radius: 3px; }
.legend-prior { background: #7c91a0; }
.legend-return { background: var(--accent); }
.legend-dot { width: 5px; height: 5px; border-radius: 50%; background: #eaf8f6; box-shadow: 0 0 7px var(--accent); }
.stage-scale { position: absolute; right: 22px; bottom: 22px; color: #607887; font-size: 8px; pointer-events: none; }
.caption-strip { min-height: 58px; display: flex; align-items: center; gap: 12px; padding: 10px 22px; border-top: 1px solid var(--line); background: #0a1722; }
.caption-icon { color: var(--accent); font-size: 16px; }
.caption-strip p { margin: 0; max-width: 780px; color: #b6c6cf; font-size: 11px; line-height: 1.5; }
.control-panel { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 12px; background: linear-gradient(180deg, rgba(13,27,39,.98), rgba(9,21,32,.98)); scrollbar-width: thin; scrollbar-color: #28414e transparent; }
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 11px; }
.panel-kicker { color: var(--accent); font-size: 8px; }
h2 { margin: 5px 0 0; font-size: 17px; letter-spacing: -.025em; font-weight: 620; }
.model-index { color: #627988; font-size: 9px; letter-spacing: .12em; padding-bottom: 2px; }
.section-label { margin-bottom: 9px; font-size: 8px; }
.section-label span { color: #5c7180; }
.preset-section { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.preset-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.preset-button { min-height: 34px; padding: 7px 10px; border: 1px solid rgba(167,194,210,.16); border-radius: 4px; background: rgba(18,37,52,.62); color: #a8bac5; font-size: 10px; font-weight: 650; cursor: pointer; transition: border-color .18s ease, background .18s ease, color .18s ease; }
.preset-button:hover, .preset-button:focus-visible { border-color: rgba(104,224,214,.55); outline: none; }
.preset-button.active { border-color: rgba(104,224,214,.55); color: #c8f5f0; background: rgba(104,224,214,.1); }
.sliders-section { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; row-gap: 9px; padding: 10px 0 11px; border-bottom: 1px solid var(--line); }
.input-label { grid-column: 1 / -1; margin-bottom: -2px; }
.range-control { min-width: 0; }
.range-title { display: flex; justify-content: space-between; align-items: flex-start; flex-direction: column; gap: 3px; margin-bottom: 4px; }
.range-title label { color: #d7e2e8; font-size: 10px; font-weight: 600; }
.range-title output { color: var(--accent); font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.range-title output sub { font-size: 7px; }
input[type="range"] { appearance: none; width: 100%; height: 14px; margin: 0; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, rgba(104,224,214,.7), rgba(104,224,214,.22)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, rgba(104,224,214,.7), rgba(104,224,214,.22)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border: 2px solid #07111b; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px rgba(104,224,214,.7), 0 0 10px rgba(104,224,214,.25); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #07111b; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px rgba(104,224,214,.7); }
input[type="range"]:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.range-ends { display: flex; justify-content: space-between; margin-top: 3px; color: #647b89; font-size: 8px; font-variant-numeric: tabular-nums; }
.view-options { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.toggle-row, .quality-row { display: flex; align-items: center; justify-content: space-between; min-height: 28px; position: relative; }
.toggle-row > span:first-child, .quality-row > span:first-child { display: grid; gap: 2px; }
.toggle-row b, .quality-row b { color: #d5e0e6; font-size: 10px; font-weight: 600; }
.toggle-row small, .quality-row small { color: #708694; font-size: 8px; }
.toggle-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-ui { width: 31px; height: 17px; border-radius: 12px; border: 1px solid #3a5260; background: #182b38; position: relative; transition: background .18s ease, border-color .18s ease; cursor: pointer; }
.toggle-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 9px; height: 9px; border-radius: 50%; background: #91a3ae; transition: transform .18s ease, background .18s ease; }
.toggle-row input:checked + .toggle-ui { border-color: rgba(104,224,214,.7); background: rgba(104,224,214,.18); }
.toggle-row input:checked + .toggle-ui::after { transform: translateX(14px); background: var(--accent); }
.toggle-row input:focus-visible + .toggle-ui { outline: 2px solid var(--accent); outline-offset: 3px; }
.quality-switch { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid rgba(167,194,210,.15); border-radius: 4px; background: #0a1722; }
.quality-switch button { border: 0; border-radius: 3px; padding: 5px 9px; color: #758b99; background: transparent; font-size: 8px; cursor: pointer; }
.quality-switch button.selected { color: #c9f4ef; background: rgba(104,224,214,.13); }
.quality-switch button:focus-visible { outline: 1px solid var(--accent); }
.readouts-section { padding: 10px 0 9px; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.readout-card { min-width: 0; padding: 8px 9px 7px; border: 1px solid rgba(167,194,210,.12); border-radius: 4px; background: rgba(15,34,48,.68); }
.readout-card.featured { border-color: rgba(104,224,214,.32); background: linear-gradient(145deg, rgba(104,224,214,.09), rgba(15,34,48,.78)); }
.readout-name { display: block; color: #7e94a2; font-size: 7px; letter-spacing: .12em; }
.readout-card strong { display: block; margin-top: 4px; color: #edf5f8; font-size: 21px; line-height: 1.1; font-weight: 620; letter-spacing: -.04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout-card.featured strong { color: var(--accent); }
.readout-card strong sub { font-size: 10px; }
.readout-card small { display: block; margin-top: 3px; color: #718795; font-size: 8px; line-height: 1.25; }
.tidal-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; padding: 9px 1px 0; color: #8196a3; font-size: 9px; }
.tidal-line b { color: #d7e5e9; font-variant-numeric: tabular-nums; }
.tidal-note { color: #718795; font-size: 8px; }
.validation-card { padding: 8px 10px; border: 1px solid rgba(167,194,210,.14); border-radius: 4px; background: rgba(7,17,27,.44); }
.validation-head { display: flex; align-items: center; gap: 7px; font-size: 7px; letter-spacing: .12em; }
.validation-head b { color: #9eb4c0; font-weight: 700; }
.check-mark { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; color: #08151e; background: var(--accent); font-size: 9px; font-weight: 900; }
.validation-values { display: flex; align-items: baseline; gap: 7px; margin-top: 7px; font-variant-numeric: tabular-nums; }
.validation-values strong { color: #dce9ed; font-size: 13px; font-weight: 650; }
.validation-values span { color: #607785; font-size: 9px; }
.validation-values em { margin-left: auto; color: var(--accent); font-size: 9px; font-style: normal; white-space: nowrap; }
.validation-card p { margin: 6px 0 0; color: #788e9c; font-size: 8px; line-height: 1.45; }
.transport-controls { display: grid; grid-template-columns: 1.15fr .7fr .7fr 1fr; gap: 6px; padding: 10px 0 9px; }
.transport-controls button { min-width: 0; min-height: 33px; border-radius: 4px; font-size: 9px; font-weight: 650; cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.transport-controls button:active { transform: translateY(1px); }
.transport-controls button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.play-button { display: flex; justify-content: center; align-items: center; gap: 7px; border: 1px solid rgba(104,224,214,.7); background: var(--accent); color: #06202a; }
.play-button:hover { background: #8bece4; }
.play-glyph { font-size: 10px; font-weight: 900; }
.utility-button, .shot-button { border: 1px solid rgba(167,194,210,.16); background: rgba(18,37,52,.68); color: #b4c5ce; }
.utility-button:hover, .shot-button:hover { border-color: rgba(104,224,214,.48); color: #e4f4f4; }
.shot-button { color: #bfe8e4; }
.science-panel { border-top: 1px solid var(--line); padding-top: 10px; }
.science-panel summary { display: flex; align-items: center; justify-content: space-between; list-style: none; cursor: pointer; color: #c9d8de; font-size: 9px; font-weight: 750; letter-spacing: .14em; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary::after { content: "+"; color: var(--accent); font-size: 16px; font-weight: 400; margin-left: 8px; }
.science-panel[open] summary::after { content: "−"; }
.summary-hint { margin-left: auto; color: #627988; font-size: 7px; }
.science-content { padding: 11px 0 2px; }
.science-content h3 { margin: 10px 0 5px; color: #c9d9df; font-size: 10px; font-weight: 650; }
.science-content h3:first-child { margin-top: 0; }
.science-content p { margin: 5px 0; color: #8fa4b0; font-size: 9px; line-height: 1.55; }
.science-content b { color: #d1e1e6; }
.equation { margin: 7px 0; padding: 8px 9px; border-left: 2px solid var(--accent); background: rgba(104,224,214,.06); color: #d4e8e7; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; line-height: 1.4; }
.science-disclaimer { padding-top: 8px; border-top: 1px solid var(--line); color: #6f8593 !important; font-style: italic; }
.bottomline { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-top: 1px solid var(--line); color: #5f7684; font-size: 7px; letter-spacing: .13em; }
.bottomline i { color: var(--accent); font-style: normal; padding: 0 4px; }
@media (max-width: 1050px) and (min-width: 761px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 330px; }
  .topbar { grid-template-columns: 165px minmax(0, 1fr) 120px; padding: 0 18px; gap: 15px; }
  .studio-name { font-size: 9px; }
  .control-panel { padding: 15px 14px; }
}
@media (max-width: 760px) {
  .app-shell { height: 100vh; height: 100dvh; min-height: 0; grid-template-rows: 56px minmax(0, 1fr); }
  .topbar { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 0 14px; }
  .studio-mark { gap: 8px; }
  .mark-orbit { width: 21px; height: 21px; }
  .studio-name { font-size: 8px; letter-spacing: .13em; }
  .heading-block { display: none; }
  .live-state { font-size: 8px; }
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(240px, 39dvh) minmax(0, 1fr); overflow: hidden; }
  .stage-panel { grid-template-rows: minmax(0, 1fr) auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .stage-topline { top: 10px; left: 12px; right: 12px; }
  .stage-chip { padding: 5px 7px; font-size: 7px; }
  .stage-coordinate { font-size: 7px; }
  .stage-legend { left: 10px; bottom: 9px; gap: 9px; padding: 6px 7px; font-size: 7px; }
  .stage-legend span { gap: 5px; }
  .legend-line { width: 12px; }
  .stage-scale { right: 10px; bottom: 12px; font-size: 7px; }
  .caption-strip { min-height: 43px; padding: 7px 12px; gap: 8px; }
  .caption-icon { font-size: 13px; }
  .caption-strip p { font-size: 9px; line-height: 1.35; }
  .control-panel { padding: 12px 14px 18px; }
  .panel-head { margin-bottom: 10px; }
  h2 { font-size: 15px; }
  .preset-section { padding-bottom: 10px; }
  .sliders-section { grid-template-columns: 1fr 1fr; column-gap: 16px; row-gap: 10px; padding: 11px 0; }
  .range-title { align-items: flex-start; flex-direction: column; gap: 3px; margin-bottom: 4px; }
  .range-title label { font-size: 9px; }
  .range-title output { font-size: 9px; }
  .range-ends { font-size: 7px; }
  .view-options { grid-template-columns: 1fr 1fr; align-items: center; gap: 8px; padding: 9px 0; }
  .quality-row { gap: 4px; }
  .readouts-section { padding: 10px 0 9px; }
  .readout-card { padding: 8px; }
  .readout-card strong { font-size: 18px; }
  .readout-card small { font-size: 7px; }
  .validation-card { padding: 8px 9px; }
  .validation-values strong { font-size: 12px; }
  .transport-controls { padding: 10px 0; }
  .bottomline { display: none; }
}
@media (max-width: 390px) {
  .workspace { grid-template-rows: minmax(225px, 36dvh) minmax(0, 1fr); }
  .control-panel { padding-left: 11px; padding-right: 11px; }
  .readout-card strong { font-size: 17px; }
  .transport-controls button { font-size: 8px; }
  .stage-legend { gap: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
