:root {
  color-scheme: dark;
  --bg: #080d13;
  --panel: #0e151e;
  --panel-2: #111b26;
  --panel-3: #15212d;
  --line: rgba(166, 190, 210, .13);
  --line-strong: rgba(166, 190, 210, .22);
  --text: #edf5f8;
  --muted: #93a5b4;
  --quiet: #637482;
  --accent: #53e0cb;
  --accent-soft: rgba(83, 224, 203, .12);
  --accent-glow: rgba(83, 224, 203, .25);
  --radius: 14px;
  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%; height: 100%; min-height: 0; overflow: hidden; background: var(--bg); color: var(--text); }
body { overflow: hidden; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { height: 100vh; height: 100dvh; min-height: 0; display: grid; grid-template-rows: 72px minmax(0, 1fr); background: radial-gradient(ellipse at 20% 0%, rgba(40, 82, 94, .11), transparent 34%), var(--bg); }
.topbar { min-width: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 22px 0 24px; border-bottom: 1px solid var(--line); background: rgba(8, 13, 19, .94); }
.brand-lockup { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; position: relative; border: 1px solid rgba(83,224,203,.36); border-radius: 11px; transform: rotate(-8deg); display: grid; place-items: center; background: linear-gradient(145deg, rgba(83,224,203,.12), rgba(83,224,203,.025)); box-shadow: 0 0 22px rgba(83,224,203,.08); }
.brand-mark span { position: absolute; width: 16px; height: 16px; border: 1.5px solid var(--accent); border-radius: 50%; opacity: .9; }
.brand-mark span:nth-child(2) { transform: translate(4px,-3px) scale(.78); opacity: .6; }
.brand-mark span:nth-child(3) { transform: translate(-4px,3px) scale(.55); opacity: .38; }
.brand-copy { min-width: 0; }
.eyebrow { color: var(--accent); font-size: 9px; font-weight: 750; letter-spacing: .17em; line-height: 1.2; }
h1 { margin: 3px 0 0; font-size: 19px; letter-spacing: -.035em; line-height: 1.05; font-weight: 680; }
.brand-copy p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.topic-chip { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong); padding: 7px 10px; border-radius: 999px; color: #b7c8d2; font-size: 9px; font-weight: 750; letter-spacing: .1em; white-space: nowrap; }
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
.icon-button { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 9px; background: #111a24; padding: 8px 11px; color: #d7e4e9; cursor: pointer; font-size: 11px; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.icon-button svg { width: 16px; height: 16px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-button:hover { border-color: rgba(83,224,203,.55); background: #15232d; }
.icon-button:active { transform: translateY(1px); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 360px; min-height: 0; }
.stage-panel { min-width: 0; min-height: 0; display: grid; grid-template-rows: 42px minmax(0, 1fr) 70px; border-right: 1px solid var(--line); background: radial-gradient(ellipse at 50% 42%, rgba(22, 51, 59, .16), transparent 54%), #091018; }
.stage-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid rgba(166,190,210,.08); }
.stage-title { display: flex; align-items: center; gap: 8px; color: #a9bbc6; font-size: 9px; font-weight: 750; letter-spacing: .15em; }
.live-pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(83,224,203,.09), 0 0 12px var(--accent-glow); }
.stage-status { border: 1px solid rgba(83,224,203,.23); border-radius: 999px; padding: 5px 9px; color: var(--accent); background: rgba(83,224,203,.055); font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.canvas-wrap { position: relative; min-height: 0; overflow: hidden; }
#viz { display: block; width: 100%; height: 100%; outline: none; }
.stage-footer { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 10px 20px; border-top: 1px solid rgba(166,190,210,.08); background: rgba(10,17,25,.72); }
.caption-mark { flex: 0 0 24px; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 16px; }
.stage-footer p { min-width: 0; flex: 1; margin: 0; color: #b5c4cd; font-size: 10px; line-height: 1.45; }
.number-key { display: flex; flex-direction: column; gap: 4px; flex: 0 0 auto; color: var(--quiet); font-size: 7px; font-weight: 750; letter-spacing: .09em; white-space: nowrap; }
.number-key span { display: flex; align-items: center; gap: 5px; }
.key-dot { width: 5px; height: 5px; border-radius: 50%; display: inline-block; }
.key-dot.textbook { background: var(--accent); }
.key-dot.illustrative { background: #9aaebb; }
.key-dot.scaled { background: #536675; }
.control-panel { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 16px 20px; background: linear-gradient(180deg, #0e151e, #0b121a); scrollbar-width: thin; scrollbar-color: #31424e transparent; }
.control-panel::-webkit-scrollbar { width: 6px; }
.control-panel::-webkit-scrollbar-thumb { background: #31424e; border-radius: 99px; }
.transport-row { display: grid; grid-template-columns: 1.2fr 1fr 38px; gap: 7px; }
.primary-button, .secondary-button { min-height: 36px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; border: 1px solid var(--line-strong); font-size: 11px; font-weight: 700; transition: .18s ease; }
.primary-button { border-color: rgba(83,224,203,.55); color: #06211f; background: var(--accent); box-shadow: 0 5px 18px rgba(83,224,203,.1); }
.primary-button:hover { background: #7cebdc; box-shadow: 0 5px 22px rgba(83,224,203,.18); }
.play-icon { font-size: 13px; line-height: 1; }
.secondary-button { color: #d3e0e6; background: #15202b; }
.secondary-button span { color: var(--muted); font-size: 9px; font-weight: 550; }
.secondary-button:hover { border-color: rgba(83,224,203,.4); background: #192936; }
.reset-button svg { width: 17px; height: 17px; fill: none; stroke: #b6c5ce; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin: 17px 0 8px; color: #94a7b5; font-size: 8px; font-weight: 800; letter-spacing: .15em; }
.tiny-tag { color: #627583; font-size: 7px; font-weight: 750; letter-spacing: .1em; }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.preset-button { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 9px 8px; text-align: left; border-radius: 9px; border: 1px solid var(--line); background: #111b25; cursor: pointer; transition: .18s ease; }
.preset-button:hover { border-color: rgba(83,224,203,.35); }
.preset-button.selected { border-color: rgba(83,224,203,.5); background: linear-gradient(135deg, rgba(83,224,203,.105), rgba(83,224,203,.025)); }
.preset-symbol { flex: 0 0 24px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: #1b2a34; color: var(--accent); font-size: 17px; }
.preset-button b { display: block; color: #e0e9ed; font-size: 9px; line-height: 1.2; }
.preset-button small { display: block; margin-top: 3px; color: #8295a3; font-size: 8px; white-space: nowrap; }
.metrics-heading { margin-top: 16px; }
.metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.metric-card { min-width: 0; padding: 9px 10px 8px; border: 1px solid rgba(166,190,210,.1); border-radius: 9px; background: rgba(19,30,41,.72); }
.metric-label { color: #7f929f; font-size: 7px; font-weight: 800; letter-spacing: .12em; }
.metric-value { margin-top: 4px; color: #e9f3f5; font-size: 20px; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.metric-unit { margin-top: 4px; color: #708391; font-size: 8px; }
.controls-heading { margin-top: 17px; }
.parameter-list { display: grid; gap: 11px; }
.parameter-control { display: block; min-width: 0; }
.parameter-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.parameter-name { color: #cbd7dd; font-size: 10px; font-weight: 650; }
.parameter-name i { color: var(--accent); font-style: normal; }
.parameter-top output { color: var(--accent); font-size: 10px; font-weight: 750; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; display: block; margin: 8px 0 3px; appearance: none; height: 4px; border-radius: 99px; background: linear-gradient(90deg, rgba(83,224,203,.72), rgba(83,224,203,.19)); outline: none; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; border: 2px solid #0b151d; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 12px rgba(83,224,203,.24); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border: 2px solid #0b151d; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(83,224,203,.2), 0 0 0 1px var(--accent); }
.range-ends { display: flex; justify-content: space-between; color: #657785; font-size: 7px; }
.parameter-help { display: block; margin-top: 4px; color: #748896; font-size: 8px; line-height: 1.35; }
.compact-control { padding-top: 1px; }
.display-row { display: flex; gap: 18px; margin-top: 13px; padding: 9px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.switch-control { display: inline-flex; align-items: center; gap: 7px; color: #aebdc6; font-size: 9px; cursor: pointer; }
.switch-control input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { width: 25px; height: 14px; border-radius: 99px; position: relative; background: #263541; border: 1px solid #40515d; transition: .18s ease; }
.switch-ui::after { content: ""; position: absolute; width: 8px; height: 8px; top: 2px; left: 2px; border-radius: 50%; background: #9baab4; transition: .18s ease; }
.switch-control input:checked + .switch-ui { background: rgba(83,224,203,.2); border-color: rgba(83,224,203,.55); }
.switch-control input:checked + .switch-ui::after { transform: translateX(11px); background: var(--accent); }
.switch-control input:focus-visible + .switch-ui { outline: 2px solid var(--accent); outline-offset: 3px; }
.quality-row { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; color: #8295a2; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.segmented { display: flex; padding: 2px; gap: 2px; border: 1px solid var(--line); border-radius: 7px; background: #0b131b; }
.segmented button { min-width: 43px; padding: 4px 7px; border: 0; border-radius: 5px; background: transparent; color: #7e909c; font-size: 8px; cursor: pointer; }
.segmented button.active { color: #09201f; background: var(--accent); font-weight: 800; }
.check-card { margin-top: 13px; padding: 10px 11px; border: 1px solid rgba(83,224,203,.19); border-radius: 10px; background: linear-gradient(130deg, rgba(83,224,203,.07), rgba(83,224,203,.015)); }
.check-head { display: flex; align-items: center; gap: 7px; color: #a8bac4; font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.check-icon { width: 15px; height: 15px; display: grid; place-items: center; border-radius: 50%; color: #09201f; background: var(--accent); font-size: 10px; font-weight: 900; }
.check-head .tiny-tag { margin-left: auto; }
.check-values { display: flex; align-items: end; gap: 9px; margin-top: 9px; }
.check-values > div:first-child, .check-values > div:nth-child(3) { display: flex; flex-direction: column; gap: 3px; }
.check-values small { color: #8195a1; font-size: 8px; }
.check-values b { color: #e5f1f3; font-size: 17px; font-variant-numeric: tabular-nums; }
.check-equals { padding-bottom: 2px; color: var(--accent); font-size: 15px; }
.check-diff { margin-left: auto; padding-bottom: 2px; color: var(--accent); font-size: 8px; font-weight: 750; white-space: nowrap; }
.check-card p { margin: 8px 0 0; color: #8296a3; font-size: 8px; line-height: 1.45; }
.science-panel { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(15,24,34,.75); }
.science-panel summary { display: flex; align-items: center; gap: 8px; padding: 11px; list-style: none; cursor: pointer; color: #d1dfe4; font-size: 10px; font-weight: 700; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-glyph { color: var(--accent); font-size: 15px; }
.summary-hint { margin-left: auto; color: #6e8290; font-size: 8px; font-weight: 500; }
.science-content { padding: 0 11px 12px; color: #a8b8c2; font-size: 9px; line-height: 1.55; }
.science-content p { margin: 8px 0; }
.science-intro { color: #c5d2d9; }
.equation-block { display: grid; gap: 3px; margin: 9px 0; padding: 8px 9px; border-left: 2px solid rgba(83,224,203,.5); background: rgba(83,224,203,.045); }
.equation-label { color: #7d9a9d; font-size: 7px; font-weight: 800; letter-spacing: .12em; }
.equation-block code { color: #d9eeec; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; white-space: normal; }
.number-note { color: #8fa5af; }
.affiliation-note { color: #9aabb4; font-style: italic; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 760px) {
  body { overflow: hidden; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
  .app-shell { grid-template-rows: 58px minmax(0,1fr); }
  .topbar { padding: 0 12px; }
  .brand-lockup { gap: 9px; }
  .brand-mark { width: 29px; height: 29px; border-radius: 9px; }
  .brand-mark span { width: 13px; height: 13px; }
  .eyebrow { font-size: 7px; }
  h1 { font-size: 16px; }
  .brand-copy p { font-size: 9px; margin-top: 2px; }
  .top-actions { gap: 7px; }
  .topic-chip { padding: 6px 7px; font-size: 7px; }
  .icon-button { padding: 7px; gap: 0; }
  .icon-button span { display: none; }
  .icon-button svg { width: 17px; height: 17px; }
  .workspace { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(275px, 42dvh) minmax(0,1fr); }
  .stage-panel { grid-template-rows: 32px minmax(0,1fr) 56px; border-right: 0; border-bottom: 1px solid var(--line); }
  .stage-toolbar { padding: 0 12px; }
  .stage-title { font-size: 8px; }
  .stage-status { font-size: 7px; padding: 4px 7px; }
  .stage-footer { padding: 7px 11px; gap: 8px; }
  .caption-mark { width: 20px; height: 20px; flex-basis: 20px; font-size: 13px; }
  .stage-footer p { font-size: 8px; line-height: 1.35; }
  .number-key { font-size: 6px; gap: 3px; }
  .control-panel { padding: 12px 12px 18px; }
  .transport-row { grid-template-columns: 1.2fr 1fr 38px; }
  .section-heading { margin-top: 13px; }
  .metrics-grid { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 5px; }
  .metric-card { padding: 7px 6px 6px; }
  .metric-label { font-size: 6px; letter-spacing: .07em; }
  .metric-value { font-size: 16px; }
  .metric-unit { font-size: 6px; line-height: 1.2; }
  .parameter-list { grid-template-columns: 1fr 1fr; column-gap: 14px; row-gap: 12px; }
  .parameter-name { font-size: 9px; }
  .parameter-help { font-size: 7px; }
  .range-ends { font-size: 6px; }
  .display-row { margin-top: 11px; }
}
@media (max-width: 390px) {
  .topic-chip { display: none; }
  .stage-footer p { font-size: 7.5px; }
  .number-key { font-size: 5.5px; }
  .parameter-list { column-gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
