:root {
  color-scheme: dark;
  --bg: #080d15;
  --panel: #0d1521;
  --panel-2: #101b29;
  --line: #1d2a3a;
  --line-soft: rgba(133, 158, 185, .13);
  --text: #edf4fb;
  --muted: #93a4b8;
  --dim: #65788e;
  --accent: #66e2d0;
  --accent-soft: rgba(102, 226, 208, .12);
  --accent-mid: rgba(102, 226, 208, .32);
  --warning: #e5c28a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; min-width: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-height: 100vh; overflow-x: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell {
  width: min(100%, 1600px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 28px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background:
    radial-gradient(ellipse at 48% -18%, rgba(41, 95, 111, .15), transparent 48%),
    linear-gradient(180deg, rgba(255,255,255,.012), transparent 35%);
}
.topbar { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand-lockup { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark { width: 35px; height: 35px; border: 1px solid rgba(102,226,208,.32); border-radius: 11px; display: flex; align-items: center; justify-content: center; gap: 3px; background: linear-gradient(145deg, rgba(102,226,208,.13), rgba(102,226,208,.025)); flex: 0 0 auto; }
.brand-mark span { width: 3px; border-radius: 4px; background: var(--accent); display: block; }
.brand-mark span:nth-child(1) { height: 9px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 17px; }
.brand-mark span:nth-child(3) { height: 12px; opacity: .75; }
.brand-copy { min-width: 0; }
.eyebrow, .section-kicker, .stage-title, .canvas-corner, .readout-label, .footer-line { letter-spacing: .13em; font-size: 9px; font-weight: 750; color: var(--dim); }
.eyebrow { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.eyebrow-dot { width: 3px; height: 3px; background: var(--accent); border-radius: 50%; display: inline-block; }
h1 { font-size: clamp(18px, 2vw, 23px); line-height: 1.12; margin: 4px 0 0; font-weight: 650; letter-spacing: -.035em; }
h1 span { color: #9db0c4; font-weight: 450; font-size: .73em; letter-spacing: -.015em; margin-left: 7px; }
.top-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.state-pill { display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px; border: 1px solid rgba(102,226,208,.22); border-radius: 30px; color: #bcece5; background: rgba(102,226,208,.07); font-size: 10px; font-weight: 650; white-space: nowrap; }
.state-dot, .live-indicator { width: 6px; height: 6px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 10px rgba(102,226,208,.5); }
.icon-button, .screenshot-button { border: 1px solid var(--line); background: rgba(255,255,255,.025); border-radius: 8px; height: 30px; padding: 0 10px; color: #b7c6d5; font-size: 10px; display: flex; align-items: center; gap: 7px; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.icon-button:hover, .screenshot-button:hover, .transport-button:hover, .preset-button:hover { border-color: rgba(102,226,208,.5); background: rgba(102,226,208,.07); }
.icon-button:active, .screenshot-button:active, button:active { transform: translateY(1px); }
.quality-glyph { color: var(--accent); font-size: 15px; line-height: 0; }
.screenshot-button { color: var(--accent); border-color: rgba(102,226,208,.25); }
.screenshot-button span { font-size: 15px; }
.stage-wrap { min-height: 0; display: flex; flex-direction: column; flex: 1 1 auto; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: linear-gradient(160deg, rgba(15,26,39,.98), rgba(9,16,26,.98)); box-shadow: 0 18px 50px rgba(0,0,0,.17); }
.stage-head { height: 34px; padding: 0 15px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); }
.stage-title { color: #a5b7c9; display: flex; align-items: center; gap: 8px; }
.stage-meta { display: flex; align-items: center; gap: 9px; font-size: 9px; color: var(--dim); }
.meta-divider { width: 1px; height: 10px; background: var(--line); }
.canvas-frame { position: relative; flex: 1 1 auto; min-height: 220px; overflow: hidden; }
#viz { width: 100%; height: 100%; display: block; }
.canvas-corner { position: absolute; top: 12px; pointer-events: none; font-size: 8px; color: rgba(151,173,196,.42); }
.canvas-corner-left { left: 16px; }
.canvas-corner-right { right: 16px; }
.caption-row { min-height: 39px; padding: 7px 14px; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line-soft); background: rgba(255,255,255,.012); }
.caption-icon { color: var(--accent); font-size: 14px; }
.caption-row p { flex: 1; min-width: 0; margin: 0; font-size: 11px; color: #c1cfdb; line-height: 1.4; }
.caption-tag { color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: .15em; border: 1px solid rgba(102,226,208,.23); border-radius: 4px; padding: 4px 6px; white-space: nowrap; }
.caption-tag.drifting { color: var(--warning); border-color: rgba(229,194,138,.28); }
.state-pill:not(.locked) .state-dot { background: var(--warning); box-shadow: 0 0 10px rgba(229,194,138,.35); }
.control-deck { border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(150deg, rgba(15,24,37,.98), rgba(11,18,29,.98)); padding: 12px 15px 10px; }
.deck-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.section-kicker { font-size: 8px; color: var(--accent); }
h2 { margin: 2px 0 0; font-size: 15px; line-height: 1.1; font-weight: 620; letter-spacing: -.025em; }
.preset-group { display: flex; gap: 5px; }
.preset-button { background: rgba(255,255,255,.025); border: 1px solid var(--line); color: #8fa1b5; border-radius: 6px; padding: 6px 10px; font-size: 9px; cursor: pointer; transition: all .18s ease; }
.preset-button.active { color: var(--accent); border-color: rgba(102,226,208,.34); background: rgba(102,226,208,.085); }
.slider-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.slider-card { min-width: 0; border: 1px solid rgba(133,158,185,.1); border-radius: 8px; background: rgba(255,255,255,.018); padding: 8px 9px 6px; }
.slider-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; }
.slider-label-row label { font-size: 10px; color: #c6d3df; font-weight: 600; white-space: nowrap; }
.unit { color: var(--dim); font-size: 8px; font-weight: 450; }
.slider-label-row output { color: var(--accent); font-variant-numeric: tabular-nums; font-size: 11px; font-weight: 700; }
input[type="range"] { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 15px; background: transparent; margin: 5px 0 0; cursor: pointer; accent-color: var(--accent); }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(102,226,208,.62), rgba(102,226,208,.16)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(102,226,208,.62), rgba(102,226,208,.16)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 11px; height: 11px; border-radius: 50%; margin-top: -4px; background: var(--accent); border: 2px solid #0c1721; box-shadow: 0 0 0 2px rgba(102,226,208,.23), 0 0 12px rgba(102,226,208,.28); }
input[type="range"]::-moz-range-thumb { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 2px solid #0c1721; box-shadow: 0 0 0 2px rgba(102,226,208,.23); }
.range-ends { display: flex; justify-content: space-between; color: #53677d; font-size: 8px; font-variant-numeric: tabular-nums; }
.transport-row { display: flex; align-items: center; gap: 15px; margin-top: 9px; min-height: 29px; }
.transport-controls { display: flex; align-items: center; gap: 6px; }
.play-button, .transport-button { height: 28px; border-radius: 6px; padding: 0 10px; display: flex; align-items: center; gap: 7px; cursor: pointer; font-size: 10px; font-weight: 650; transition: all .18s ease; }
.play-button { background: var(--accent); color: #06201e; border: 1px solid var(--accent); min-width: 76px; justify-content: center; }
.play-button:hover { background: #8af0e2; }
.transport-button { color: #a7b8c8; background: rgba(255,255,255,.025); border: 1px solid var(--line); }
.speed-control { display: flex; align-items: center; gap: 9px; min-width: 145px; }
.speed-control label { font-size: 9px; color: #9badc0; white-space: nowrap; }
.speed-control output { color: var(--accent); font-variant-numeric: tabular-nums; margin-left: 3px; }
.speed-control input { width: 82px; margin: 0; }
.keyboard-hint { margin-left: auto; font-size: 8px; color: #61748a; white-space: nowrap; }
kbd { font-family: inherit; font-size: 8px; color: #a5b5c5; border: 1px solid #2a394b; border-radius: 3px; padding: 2px 4px; background: rgba(255,255,255,.025); }
.readout-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; background: rgba(13,21,33,.8); overflow: hidden; }
.readout-item { min-width: 0; padding: 8px 12px 7px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.readout-item:last-child { border-right: 0; }
.readout-label { color: #7f93a9; font-size: 8px; white-space: nowrap; }
.readout-label i { color: #c1d1df; font-size: 10px; font-style: italic; }
.readout-label small { color: #5f7489; letter-spacing: .02em; font-size: 7px; font-weight: 550; margin-left: 3px; }
.readout-item strong { font-size: 17px; line-height: 1.2; font-weight: 650; letter-spacing: -.03em; color: #edf6fa; font-variant-numeric: tabular-nums; }
.readout-item.check-item strong { color: var(--accent); }
.readout-unit { color: #71849a; font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.science-panel { border: 1px solid var(--line); border-radius: 9px; background: rgba(12,19,30,.8); }
.science-panel summary { list-style: none; display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 8px 12px; color: #c6d4e1; font-size: 10px; font-weight: 650; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-icon { width: 19px; height: 19px; display: grid; place-items: center; border-radius: 5px; background: rgba(102,226,208,.1); color: var(--accent); font-size: 13px; }
.science-summary { color: #6e8298; font-size: 9px; font-weight: 450; margin-left: 3px; }
.chevron { margin-left: auto; color: #71849a; font-size: 15px; transition: transform .2s ease; }
.science-panel[open] .chevron { transform: rotate(180deg); }
.science-content { border-top: 1px solid var(--line-soft); padding: 12px 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.science-column h3 { margin: 0 0 7px; font-size: 10px; color: #d6e2ec; font-weight: 650; }
.science-type { color: var(--accent); font-size: 7px; letter-spacing: .12em; margin-left: 5px; }
.science-column p { margin: 5px 0; color: #8fa2b7; font-size: 9px; line-height: 1.55; }
.equation { color: #e2f2f2 !important; font-family: Georgia, "Times New Roman", serif; font-size: 15px !important; letter-spacing: .01em; }
.fraction { border-bottom: 1px solid #9fb6c7; padding: 0 2px 1px; font-size: .85em; }
.fraction-den { font-size: .72em; margin-left: 1px; }
.model-note { color: #b2c4d3 !important; font-style: italic; }
.footer-line { display: flex; align-items: center; justify-content: space-between; font-size: 7px; color: #53677d; padding: 0 3px; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .app-shell { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
@media (min-width: 1200px) and (min-height: 850px) { .app-shell { padding-top: 22px; padding-bottom: 16px; gap: 14px; } .canvas-frame { min-height: 285px; } .control-deck { padding-top: 14px; padding-bottom: 12px; } }
@media (max-width: 900px) {
  .app-shell { padding: 14px 14px 10px; gap: 9px; }
  .topbar { min-height: 48px; }
  .eyebrow { font-size: 7px; }
  h1 { font-size: 18px; }
  h1 span { display: none; }
  .slider-grid { gap: 7px; }
  .slider-card { padding: 7px 7px 5px; }
  .slider-label-row label { font-size: 9px; }
  .unit { display: none; }
  .keyboard-hint { display: none; }
  .transport-row { justify-content: space-between; }
  .readout-item { padding: 7px 8px; }
  .readout-label { font-size: 7px; }
  .readout-label small { display: none; }
  .readout-item strong { font-size: 15px; }
  .readout-unit { font-size: 7px; }
}
@media (max-width: 560px) {
  .app-shell { padding: 9px 9px 8px; gap: 7px; }
  .topbar { min-height: 43px; gap: 6px; }
  .brand-lockup { gap: 8px; }
  .brand-mark { width: 29px; height: 29px; border-radius: 8px; }
  .eyebrow { font-size: 6px; letter-spacing: .09em; gap: 5px; }
  h1 { font-size: 16px; margin-top: 3px; }
  .top-actions { gap: 5px; }
  .state-pill { height: 25px; padding: 0 7px; font-size: 8px; }
  .icon-button { height: 25px; padding: 0 7px; font-size: 8px; gap: 4px; }
  .screenshot-button { height: 25px; padding: 0 7px; font-size: 8px; gap: 4px; }
  .screenshot-button span { font-size: 12px; }
  .stage-wrap { border-radius: 9px; }
  .stage-head { height: 27px; padding: 0 9px; }
  .stage-title { font-size: 7px; }
  .stage-meta { font-size: 7px; }
  .canvas-frame { min-height: 180px; }
  .canvas-corner { top: 8px; font-size: 6px; }
  .canvas-corner-left { left: 9px; }
  .canvas-corner-right { right: 9px; }
  .caption-row { min-height: 34px; padding: 5px 8px; gap: 6px; }
  .caption-row p { font-size: 9px; }
  .caption-icon { font-size: 11px; }
  .caption-tag { font-size: 6px; padding: 3px 4px; }
  .control-deck { padding: 8px 8px 7px; border-radius: 9px; }
  .deck-heading { margin-bottom: 7px; }
  .section-kicker { font-size: 7px; }
  h2 { font-size: 13px; }
  .preset-button { font-size: 8px; padding: 5px 7px; }
  .slider-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .slider-card { padding: 6px 7px 4px; }
  .slider-label-row label { font-size: 9px; }
  .slider-label-row output { font-size: 10px; }
  input[type="range"] { height: 13px; margin-top: 3px; }
  .range-ends { font-size: 7px; }
  .transport-row { gap: 6px; margin-top: 7px; min-height: 25px; }
  .transport-controls { gap: 4px; }
  .play-button, .transport-button { height: 25px; padding: 0 7px; font-size: 8px; gap: 4px; }
  .play-button { min-width: 62px; }
  .speed-control { min-width: 0; gap: 5px; }
  .speed-control label { font-size: 8px; }
  .speed-control input { width: 55px; }
  .readout-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); border-radius: 8px; }
  .readout-item { padding: 6px 5px 5px; gap: 2px; }
  .readout-label { font-size: 6px; letter-spacing: .08em; white-space: normal; min-height: 15px; }
  .readout-item strong { font-size: 12px; }
  .readout-unit { font-size: 6px; white-space: normal; line-height: 1.2; min-height: 14px; }
  .science-panel summary { padding: 6px 8px; font-size: 9px; gap: 6px; }
  .science-icon { width: 16px; height: 16px; font-size: 11px; }
  .science-summary { display: none; }
  .science-content { grid-template-columns: 1fr; gap: 8px; padding: 8px; }
  .science-column h3 { font-size: 9px; }
  .science-column p { font-size: 8px; }
  .equation { font-size: 13px !important; }
  .footer-line { font-size: 6px; gap: 5px; }
}
@media (max-width: 390px) {
  .state-pill { display: none; }
  .brand-lockup { flex: 1; }
  .top-actions { flex: 0 0 auto; }
  .footer-line span:last-child { display: none; }
  .speed-control label { display: inline; font-size: 7px; }
  .speed-control input { width: 58px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
