:root {
  color-scheme: dark;
  --bg: #080d17;
  --panel: #101827;
  --panel-2: #0d1522;
  --line: rgba(154, 179, 212, .14);
  --line-strong: rgba(154, 179, 212, .24);
  --text: #edf3fb;
  --muted: #91a2b8;
  --dim: #61748d;
  --accent: #67e2d1;
  --accent-2: #a7f3e8;
  --gold: #f1c779;
  --io: #f1a36e;
  --europa: #8dc9f5;
  --ganymede: #b7a5f6;
  --radius: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 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; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.app-shell {
  width: 100%; min-height: 720px; height: 100vh; height: 100dvh;
  padding: 14px 18px 12px; display: grid;
  grid-template-rows: 58px minmax(0, 1fr) 154px 40px;
  gap: 10px; overflow: hidden;
  background:
    radial-gradient(ellipse at 18% -12%, rgba(48, 95, 130, .16), transparent 42%),
    radial-gradient(ellipse at 90% 110%, rgba(67, 56, 122, .12), transparent 40%),
    var(--bg);
}
.topbar { display: flex; align-items: center; justify-content: space-between; min-width: 0; padding: 0 4px; }
.brand-lockup { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark { width: 38px; height: 38px; position: relative; border: 1px solid rgba(103,226,209,.4); border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; box-shadow: 0 0 22px rgba(103,226,209,.08), inset 0 0 16px rgba(103,226,209,.05); }
.brand-mark:before { content: ""; position: absolute; width: 27px; height: 12px; border: 1px solid rgba(103,226,209,.75); border-radius: 50%; transform: rotate(-32deg); }
.brand-mark span { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(103,226,209,.8); }
.brand-mark i, .brand-mark b { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }
.brand-mark i { top: 4px; right: 7px; }
.brand-mark b { bottom: 5px; left: 6px; background: var(--europa); }
.brand-copy { min-width: 0; }
.kicker, .section-label, .metric-label, .control-heading, .slider-head label, .chart-heading, .view-label, .stage-corner { font-size: 9px; font-weight: 750; letter-spacing: .14em; color: var(--muted); }
.kicker { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.kicker-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
h1 { font-size: clamp(17px, 1.7vw, 21px); line-height: 1.1; margin: 0; font-weight: 660; letter-spacing: -.035em; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.chain-chip { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid rgba(103,226,209,.22); border-radius: 999px; background: rgba(103,226,209,.055); color: var(--accent-2); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.chain-chip small { font-size: 8px; color: var(--muted); letter-spacing: .12em; }
.pulse-dot, .live-dot, .status-orb { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(103,226,209,.8); }
.topbar-caption { color: var(--muted); font-size: 11px; }
.main-grid { display: grid; grid-template-columns: minmax(0, 1fr) 344px; gap: 10px; min-height: 0; }
.stage-card, .insight-panel, .control-dock, .science-panel { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(18,29,45,.96), rgba(10,17,29,.98)); box-shadow: 0 12px 38px rgba(0,0,0,.15); }
.stage-card { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: radial-gradient(ellipse at 50% 46%, rgba(29,53,78,.45), rgba(10,17,29,.96) 65%); }
.stage-card:after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; background: linear-gradient(180deg, rgba(5,10,18,.26), transparent 20%, transparent 75%, rgba(5,10,18,.42)); }
#scene { display: block; width: 100%; height: 100%; }
.stage-topline, .stage-bottomline, .stage-corner { position: absolute; z-index: 2; pointer-events: none; }
.stage-topline { top: 15px; left: 17px; right: 17px; display: flex; justify-content: space-between; align-items: flex-start; }
.view-label { display: flex; align-items: center; gap: 8px; color: #b8c8d9; }
.view-icon { width: 13px; height: 13px; display: inline-block; border: 1px solid var(--accent); border-radius: 50%; position: relative; }
.view-icon:after { content: ""; position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); left: 3px; top: 3px; }
.stage-time { display: flex; align-items: center; gap: 7px; color: #dce8f6; font-size: 12px; font-variant-numeric: tabular-nums; }
.stage-time small { font-size: 8px; color: var(--muted); letter-spacing: .1em; margin-left: 3px; }
.stage-time .live-dot { width: 5px; height: 5px; }
.stage-bottomline { bottom: 13px; left: 17px; right: 17px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.orbit-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: #aab9cb; font-size: 10px; }
.orbit-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.legend-swatch.jupiter { background: var(--gold); box-shadow: 0 0 7px rgba(241,199,121,.5); }
.legend-swatch.io { background: var(--io); }
.legend-swatch.europa { background: var(--europa); }
.legend-swatch.ganymede { background: var(--ganymede); }
.scale-note { color: #8193a9; font-size: 9px; white-space: nowrap; }
.scale-tag { display: inline-block; color: var(--accent-2); font-size: 8px; font-weight: 800; letter-spacing: .11em; border: 1px solid rgba(103,226,209,.22); background: rgba(103,226,209,.06); border-radius: 4px; padding: 3px 5px; margin-right: 5px; }
.stage-corner { right: 17px; top: 47px; color: #61758e; font-size: 8px; letter-spacing: .12em; }
.stage-corner span { color: var(--accent); padding: 0 4px; }
.insight-panel { padding: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; overflow: hidden; }
.resonance-card { border: 1px solid rgba(103,226,209,.16); border-radius: 11px; background: linear-gradient(115deg, rgba(35,79,82,.17), rgba(16,28,43,.6)); padding: 10px 11px 8px; }
.resonance-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.section-label { font-size: 8px; }
.data-tag { display: inline-block; color: #7d93a8; font-size: 7px; font-weight: 800; letter-spacing: .1em; margin-left: 4px; border: 1px solid rgba(145,162,184,.17); border-radius: 3px; padding: 2px 4px; vertical-align: 1px; }
.angle-equation { color: #8fa5ba; font-size: 10px; margin-top: 5px; letter-spacing: .01em; }
.angle-equation sub { font-size: 7px; }
.angle-readout { display: flex; align-items: baseline; color: var(--accent-2); text-shadow: 0 0 18px rgba(103,226,209,.22); }
.angle-readout strong { font-size: 27px; line-height: 1; letter-spacing: -.05em; font-weight: 650; font-variant-numeric: tabular-nums; }
.angle-readout span { font-size: 13px; margin-left: 3px; color: var(--accent); }
.resonance-status { display: flex; align-items: center; gap: 7px; margin-top: 8px; font-size: 8px; letter-spacing: .1em; color: var(--accent-2); }
.resonance-status strong { font-size: 8px; }
.resonance-status #status-detail { color: var(--muted); font-size: 8px; letter-spacing: .02em; margin-left: auto; text-transform: none; }
.status-orb { width: 5px; height: 5px; }
.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; }
.metric-card { min-width: 0; padding: 8px 9px; border: 1px solid var(--line); border-radius: 9px; background: rgba(8,15,26,.48); }
.metric-label { font-size: 7px; letter-spacing: .11em; white-space: nowrap; }
.metric-value { display: flex; align-items: baseline; gap: 5px; margin-top: 5px; }
.metric-value strong { font-size: 17px; line-height: 1; font-weight: 650; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.metric-value span { font-size: 9px; color: var(--muted); }
.metric-sub { margin-top: 4px; font-size: 8px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-sub b { color: var(--accent-2); font-weight: 650; }
.check-values { display: flex; align-items: baseline; gap: 5px; margin-top: 5px; white-space: nowrap; }
.check-values strong { font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.check-values span { font-size: 8px; color: var(--dim); }
.chart-card { min-height: 0; padding: 8px 9px 6px; border: 1px solid var(--line); border-radius: 9px; background: rgba(8,15,26,.44); }
.chart-heading { display: flex; justify-content: space-between; font-size: 7px; letter-spacing: .12em; }
.chart-range { color: var(--dim); font-size: 7px; }
#angle-chart { display: block; width: 100%; height: 65px; margin-top: 4px; }
.chart-legend { display: flex; justify-content: space-between; color: var(--dim); font-size: 7px; }
.chart-legend span:first-child { display: flex; align-items: center; gap: 5px; }
.chart-legend i { width: 10px; height: 2px; background: var(--accent); display: inline-block; border-radius: 2px; }
.chart-centre { color: #8497ad; }
.state-caption { margin: 0; color: #9caec2; font-size: 9px; line-height: 1.45; }
.scale-explainer { display: flex; align-items: flex-start; gap: 5px; padding-top: 7px; border-top: 1px solid var(--line); color: #778aa1; font-size: 8px; line-height: 1.4; }
.scale-explainer .scale-tag { flex: 0 0 auto; margin: 0; }
.control-dock { display: grid; grid-template-columns: 1.08fr repeat(4, minmax(0,1fr)) 1.6fr; align-items: stretch; gap: 10px; padding: 12px; min-width: 0; }
.preset-group, .slider-control, .action-group { min-width: 0; }
.control-heading { margin-bottom: 9px; font-size: 8px; }
.preset-buttons { display: flex; flex-direction: column; gap: 5px; }
.preset-button { cursor: pointer; text-align: left; border: 1px solid var(--line-strong); border-radius: 7px; background: rgba(8,15,26,.48); color: #9fb0c4; padding: 6px 8px; font-size: 9px; transition: border-color .18s ease, background .18s ease, color .18s ease; }
.preset-button:hover { border-color: rgba(103,226,209,.4); color: var(--text); }
.preset-button.active { border-color: rgba(103,226,209,.42); background: rgba(103,226,209,.09); color: var(--accent-2); }
.preset-hint { margin-top: 6px; color: var(--dim); font-size: 7px; line-height: 1.3; }
.slider-control { padding: 1px 2px; }
.slider-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-bottom: 15px; }
.slider-head label { color: #a4b4c7; font-size: 8px; white-space: nowrap; }
.slider-head output { color: var(--accent-2); font-size: 10px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { width: 100%; height: 16px; margin: 0; appearance: none; background: transparent; cursor: pointer; touch-action: pan-y; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, rgba(103,226,209,.7), rgba(103,226,209,.18)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, rgba(103,226,209,.7), rgba(103,226,209,.18)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border: 2px solid #d7fff8; border-radius: 50%; background: #3bb7a8; box-shadow: 0 0 0 3px rgba(103,226,209,.12), 0 0 10px rgba(103,226,209,.3); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #d7fff8; border-radius: 50%; background: #3bb7a8; box-shadow: 0 0 0 3px rgba(103,226,209,.12); }
.slider-foot { display: flex; justify-content: space-between; color: #62758c; font-size: 7px; margin-top: 5px; }
.action-group { display: flex; flex-direction: column; justify-content: space-between; gap: 9px; }
.action-row { display: flex; gap: 6px; }
.action-button { height: 34px; cursor: pointer; border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(8,15,26,.58); color: #b5c5d8; transition: .18s ease; }
.action-button:hover, .mini-toggle:hover { border-color: rgba(103,226,209,.45); color: var(--text); }
.action-button.primary { display: flex; align-items: center; justify-content: center; gap: 7px; flex: 1; border-color: rgba(103,226,209,.4); background: rgba(103,226,209,.12); color: var(--accent-2); font-size: 10px; font-weight: 650; }
.pause-glyph { font-size: 12px; }
.icon-button { width: 36px; flex: 0 0 auto; font-size: 17px; }
.view-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.mini-toggle { cursor: pointer; border: 1px solid var(--line); border-radius: 6px; background: rgba(8,15,26,.48); color: #879bb2; padding: 5px 7px; font-size: 8px; transition: .18s ease; }
.mini-toggle.active { color: var(--accent-2); border-color: rgba(103,226,209,.3); background: rgba(103,226,209,.07); }
.screenshot-button { margin-left: auto; }
.science-panel { min-height: 0; overflow: hidden; background: rgba(12,20,33,.96); }
.science-panel summary { height: 100%; display: flex; align-items: center; gap: 9px; list-style: none; cursor: pointer; padding: 0 13px; color: #b8c8da; font-size: 9px; font-weight: 750; letter-spacing: .14em; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-icon { display: grid; place-items: center; width: 21px; height: 21px; border: 1px solid rgba(103,226,209,.25); border-radius: 6px; color: var(--accent); font-size: 12px; }
.science-summary { color: var(--dim); font-size: 8px; font-weight: 450; letter-spacing: .02em; }
.chevron { margin-left: auto; color: var(--accent); font-size: 15px; transition: transform .2s ease; }
.science-panel[open] { position: fixed; z-index: 50; inset: 24px; overflow: auto; border-color: rgba(103,226,209,.26); box-shadow: 0 24px 100px rgba(0,0,0,.7); background: #0d1625; }
.science-panel[open] summary { position: sticky; top: 0; height: 52px; z-index: 2; background: #0d1625; border-bottom: 1px solid var(--line); }
.science-panel[open] .chevron { transform: rotate(180deg); }
.science-content { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 20px; padding: 20px; }
.science-column h2 { margin: 0 0 8px; color: #dce8f5; font-size: 13px; font-weight: 650; }
.science-column p { margin: 0 0 10px; color: #98abc1; font-size: 11px; line-height: 1.6; }
.equation { padding: 11px 12px; margin: 8px 0 11px; border: 1px solid rgba(103,226,209,.16); border-radius: 8px; background: rgba(103,226,209,.045); color: var(--accent-2); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.science-column .disclaimer { color: #7f94aa; font-style: italic; border-top: 1px solid var(--line); padding-top: 9px; }

@media (max-width: 980px) and (min-width: 761px) {
  .app-shell { padding-left: 12px; padding-right: 12px; grid-template-rows: 56px minmax(0,1fr) 162px 38px; }
  .main-grid { grid-template-columns: minmax(0,1fr) 310px; }
  .control-dock { grid-template-columns: 1.05fr 1fr 1fr 1.35fr; grid-template-rows: 1fr 1fr; gap: 7px; }
  .preset-group { grid-column: 1; grid-row: 1 / span 2; }
  .slider-control:nth-child(2) { grid-column: 2; grid-row: 1; }
  .slider-control:nth-child(3) { grid-column: 2; grid-row: 2; }
  .slider-control:nth-child(4) { grid-column: 3; grid-row: 1; }
  .slider-control:nth-child(5) { grid-column: 3; grid-row: 2; }
  .action-group { grid-column: 4; grid-row: 1 / span 2; }
  .topbar-caption { display: none; }
}
@media (max-width: 760px) {
  .app-shell { min-height: 0; padding: 9px 9px 8px; gap: 8px; grid-template-columns: minmax(0,1fr); grid-template-rows: 48px minmax(220px, 29vh) minmax(165px, 22vh) minmax(230px,1fr) 36px; }
  .topbar { padding: 0 2px; }
  .brand-lockup { gap: 9px; }
  .brand-mark { width: 31px; height: 31px; }
  .brand-mark:before { width: 22px; height: 10px; }
  .kicker { font-size: 7px; gap: 5px; }
  h1 { font-size: 16px; }
  .topbar-right { gap: 0; }
  .topbar-caption { display: none; }
  .chain-chip { padding: 6px 8px; font-size: 10px; gap: 6px; }
  .chain-chip small { font-size: 7px; }
  .main-grid { display: contents; }
  .stage-card { grid-row: 2; min-height: 0; border-radius: 13px; }
  .stage-topline { top: 10px; left: 11px; right: 11px; }
  .view-label { font-size: 7px; }
  .stage-time { font-size: 10px; }
  .stage-time small { font-size: 6px; }
  .stage-corner { display: none; }
  .stage-bottomline { left: 11px; right: 11px; bottom: 9px; align-items: flex-end; }
  .orbit-legend { gap: 8px; font-size: 8px; }
  .scale-note { font-size: 7px; white-space: normal; text-align: right; max-width: 105px; line-height: 1.35; }
  .scale-tag { font-size: 6px; padding: 2px 3px; }
  .insight-panel { grid-row: 3; min-height: 0; overflow-y: auto; padding: 8px; gap: 6px; border-radius: 13px; }
  .resonance-card { padding: 7px 8px 6px; }
  .section-label { font-size: 7px; }
  .angle-equation { font-size: 8px; margin-top: 3px; }
  .angle-readout strong { font-size: 22px; }
  .resonance-status { margin-top: 5px; }
  .metric-grid { gap: 5px; }
  .metric-card { padding: 6px 7px; }
  .metric-label { font-size: 6px; }
  .metric-value { margin-top: 3px; }
  .metric-value strong { font-size: 14px; }
  .metric-sub { font-size: 7px; margin-top: 2px; }
  .check-values { margin-top: 3px; }
  .check-values strong { font-size: 10px; }
  .chart-card { padding: 6px 7px 5px; }
  #angle-chart { height: 48px; }
  .state-caption { font-size: 8px; }
  .scale-explainer { font-size: 7px; }
  .control-dock { grid-row: 4; grid-template-columns: repeat(2,minmax(0,1fr)); grid-auto-rows: min-content; align-content: start; overflow-y: auto; padding: 10px; gap: 9px; border-radius: 13px; }
  .preset-group { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1.8fr; align-items: center; gap: 8px; }
  .control-heading { margin: 0; font-size: 7px; }
  .preset-buttons { flex-direction: row; }
  .preset-button { flex: 1; text-align: center; padding: 6px 4px; font-size: 8px; }
  .preset-hint { display: none; }
  .slider-head { margin-bottom: 8px; }
  .slider-head label { font-size: 7px; }
  .slider-head output { font-size: 9px; }
  .slider-foot { font-size: 6px; }
  .action-group { grid-column: 1 / -1; gap: 6px; }
  .action-row { gap: 6px; }
  .action-button { height: 31px; }
  .action-button.primary { font-size: 9px; }
  .icon-button { height: 31px; width: 38px; }
  .view-actions { gap: 4px; }
  .mini-toggle { padding: 5px 7px; font-size: 7px; }
  .science-panel { grid-row: 5; border-radius: 10px; }
  .science-panel summary { padding: 0 10px; font-size: 8px; }
  .science-summary { font-size: 7px; }
  .science-panel[open] { inset: 8px; }
  .science-content { grid-template-columns: 1fr; gap: 12px; padding: 13px; }
  .science-column h2 { font-size: 12px; }
  .science-column p { font-size: 10px; }
}
@media (max-width: 380px) {
  .app-shell { grid-template-rows: 46px minmax(210px, 28vh) minmax(160px, 22vh) minmax(225px,1fr) 34px; padding-left: 7px; padding-right: 7px; }
  .topbar-right { display: none; }
  .orbit-legend { gap: 6px; }
  .orbit-legend span { gap: 4px; }
  .scale-note { max-width: 86px; }
  .metric-label { letter-spacing: .06em; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
