:root {
  color-scheme: dark;
  --bg: #0b1117;
  --panel: #101922;
  --panel-2: #141f29;
  --line: #263541;
  --line-soft: #1d2a35;
  --text: #e8f0f3;
  --muted: #9aabb5;
  --quiet: #71838e;
  --accent: #61dfc4;
  --accent-dim: rgba(97,223,196,.14);
  --accent-line: rgba(97,223,196,.38);
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { overflow-x: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.site-header {
  height: 54px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line-soft); background: #0c141b;
}
.brand-mark { display: flex; align-items: center; gap: 10px; font-size: 10px; letter-spacing: .16em; font-weight: 800; color: #d6e1e5; }
.brand-mark b { color: var(--accent); font-weight: 800; }
.brand-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px rgba(97,223,196,.55); }
.header-note { font-size: 9px; color: var(--quiet); letter-spacing: .18em; font-weight: 700; }
.app-shell { height: calc(100vh - 54px); min-height: 620px; display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 0; }
.stage-column { min-width: 0; min-height: 0; padding: 22px 24px 18px; display: flex; flex-direction: column; border-right: 1px solid var(--line-soft); }
.stage-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 0 2px 16px; }
.eyebrow { margin: 0 0 7px; color: var(--accent); font-size: 9px; letter-spacing: .19em; font-weight: 800; }
h1 { margin: 0; max-width: 680px; font-size: clamp(21px, 2.3vw, 31px); line-height: 1.12; letter-spacing: -.035em; font-weight: 720; }
.model-stamp { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 99px; color: #b7c5cc; font-size: 8px; letter-spacing: .12em; font-weight: 800; white-space: nowrap; }
.stamp-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.visual-stage { position: relative; flex: 1 1 auto; min-height: 310px; overflow: hidden; border: 1px solid #293943; border-radius: 15px; background: radial-gradient(ellipse at 50% 48%, #172630 0%, #101a23 57%, #0d151c 100%); }
#scene { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.stage-corner { position: absolute; top: 14px; display: flex; flex-direction: column; gap: 3px; pointer-events: none; }
.stage-corner-left { left: 16px; }
.stage-corner-right { right: 16px; text-align: right; }
.corner-kicker { color: #81939d; font-size: 8px; letter-spacing: .17em; font-weight: 800; }
.stage-corner strong { color: #c6d2d8; font-size: 9px; letter-spacing: .08em; font-weight: 700; }
.probe-readout { position: absolute; bottom: 13px; left: 15px; display: flex; flex-direction: column; gap: 3px; padding: 7px 10px; border: 1px solid rgba(97,223,196,.22); border-radius: 8px; background: rgba(8,17,23,.78); pointer-events: none; }
.probe-readout span { color: var(--muted); font-size: 7px; letter-spacing: .16em; font-weight: 800; }
.probe-readout strong { color: var(--accent); font-size: 13px; font-variant-numeric: tabular-nums; }
.caption-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px 2px 10px; min-height: 54px; }
.caption-mark { width: 3px; min-width: 3px; height: 29px; margin-top: 2px; border-radius: 2px; background: var(--accent); }
.caption-row p { margin: 0; max-width: 780px; color: #b4c2c9; font-size: 12px; line-height: 1.55; }
.transport-bar { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.transport-actions { display: flex; gap: 7px; }
.icon-button { display: inline-flex; align-items: center; gap: 7px; min-height: 33px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; background: #111b24; color: #c6d2d8; font-size: 10px; font-weight: 700; cursor: pointer; }
.icon-button:hover, .preset:hover, .measure-button:hover { border-color: var(--accent-line); }
.icon-button.primary { color: var(--accent); border-color: var(--accent-line); background: var(--accent-dim); }
#pauseIcon { font-size: 12px; line-height: 1; }
.quality-control { display: flex; align-items: center; gap: 8px; color: var(--quiet); font-size: 8px; letter-spacing: .13em; font-weight: 800; }
.quality-control button { min-width: 49px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--accent); font-size: 9px; letter-spacing: .08em; font-weight: 800; cursor: pointer; }
.control-panel { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 17px 24px; background: #0e171f; scrollbar-width: thin; scrollbar-color: #334652 transparent; }
.panel-section { padding: 0 0 17px; margin: 0 0 16px; border-bottom: 1px solid var(--line-soft); }
.section-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; min-width: 0; }
.section-index { color: var(--accent); font-size: 9px; letter-spacing: .08em; font-weight: 800; font-variant-numeric: tabular-nums; }
.section-heading h2 { margin: 0; color: #e1eaed; font-size: 13px; letter-spacing: -.01em; font-weight: 700; }
.section-tag { margin-left: auto; color: var(--quiet); font-size: 7px; letter-spacing: .12em; font-weight: 800; white-space: nowrap; }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.preset { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 53px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: #111c25; text-align: left; cursor: pointer; }
.preset strong { font-size: 10px; font-weight: 750; }
.preset span { color: var(--muted); font-size: 8px; }
.preset.active { border-color: var(--accent-line); background: var(--accent-dim); }
.preset.active strong { color: var(--accent); }
.control-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; row-gap: 12px; }
.control { min-width: 0; display: block; }
.control-top { display: flex; align-items: baseline; justify-content: space-between; gap: 5px; margin-bottom: 6px; color: #c1cdd3; font-size: 9px; }
.control-top output { color: var(--accent); font-size: 10px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.control input[type="range"] { display: block; width: 100%; height: 14px; margin: 0; accent-color: var(--accent); cursor: pointer; background: transparent; }
.range-ends { display: flex; justify-content: space-between; gap: 3px; color: #748691; font-size: 7px; font-variant-numeric: tabular-nums; }
.probe-control { grid-column: 1 / -1; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.metric { min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 10px 10px 9px; border: 1px solid var(--line-soft); border-radius: 9px; background: #111c25; }
.metric-wide { grid-column: 1 / -1; padding: 11px 12px; }
.metric-label { color: #9cabb4; font-size: 8px; letter-spacing: .04em; }
.metric strong { color: #e7f0f2; font-size: 20px; font-weight: 720; line-height: 1.05; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.metric-wide strong { color: var(--accent); font-size: 25px; }
.metric strong small { color: #9fb0b9; font-size: 10px; font-weight: 650; letter-spacing: 0; }
.metric-note { color: #71838e; font-size: 7px; }
.state-line { display: flex; align-items: center; gap: 7px; margin: 10px 1px 0; color: #aebdc4; font-size: 9px; line-height: 1.4; }
.state-dot { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--accent); }
.state-line.failed .state-dot { background: #8d9ba3; }
.check-list { display: flex; flex-direction: column; gap: 8px; }
.check-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.check-row div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.check-row strong { color: #cbd6db; font-size: 9px; font-weight: 700; }
.check-row span { color: #778994; font-size: 7px; }
.check-row output { color: var(--accent); font-size: 10px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.check-footnote { margin: 9px 0 0; color: #73848e; font-size: 8px; line-height: 1.5; }
.experiment-copy { margin: -2px 0 10px; color: #a0afb7; font-size: 9px; line-height: 1.5; }
.measure-button { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 36px; padding: 0 12px; border: 1px solid var(--accent-line); border-radius: 8px; background: var(--accent-dim); color: var(--accent); font-size: 10px; font-weight: 750; cursor: pointer; }
.measure-button span { font-size: 14px; }
.experiment-result { margin-top: 8px; min-height: 40px; padding: 9px 10px; border: 1px solid var(--line-soft); border-radius: 8px; background: #101a22; color: #8799a3; font-size: 8px; line-height: 1.5; }
.experiment-result strong { color: #e0ebee; font-weight: 750; }
.experiment-result .result-accent { color: var(--accent); }
.science-panel { margin: 0 0 15px; border: 1px solid var(--line); border-radius: 10px; background: #111b24; }
.science-panel summary { display: flex; align-items: center; gap: 9px; padding: 12px 12px; list-style: none; color: #d8e2e6; font-size: 11px; font-weight: 700; cursor: pointer; }
.science-panel summary::-webkit-details-marker { display: none; }
.summary-plus { margin-left: auto; color: var(--accent); font-size: 15px; transition: transform .2s ease; }
.science-panel[open] .summary-plus { transform: rotate(45deg); }
.science-content { padding: 0 12px 13px; }
.science-content h3 { margin: 13px 0 5px; color: #dbe5e8; font-size: 9px; letter-spacing: .04em; }
.science-content p, .science-content li { color: #9aabb4; font-size: 8px; line-height: 1.6; }
.science-content p { margin: 5px 0 8px; }
.science-content ul { margin: 6px 0 10px; padding-left: 16px; }
.science-content .equation { padding: 8px 9px; border-left: 2px solid var(--accent); background: rgba(97,223,196,.06); color: #d5e3e6; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.not-affiliated { padding-top: 8px; border-top: 1px solid var(--line-soft); color: #7f909a !important; }
.panel-tail { color: #657782; font-size: 7px; letter-spacing: .14em; text-align: center; }
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 .site-header { display: none; }
body.embed-mode .app-shell { height: 100%; min-height: 0; }

@media (min-width: 1100px) {
  .stage-column { padding: 24px 28px 18px; }
  .visual-stage { min-height: 380px; }
  .control-panel { padding: 20px 18px 24px; }
}
@media (max-width: 850px) {
  .app-shell { grid-template-columns: minmax(0, 1fr) 350px; }
  .stage-column { padding: 18px 16px 14px; }
  .control-panel { padding: 16px 13px 20px; }
  .model-stamp { display: none; }
}
@media (max-width: 700px) {
  .site-header { height: 42px; padding: 0 14px; }
  .header-note { font-size: 8px; }
  .app-shell { display: flex; flex-direction: column; height: auto; min-height: calc(100vh - 42px); }
  .stage-column { flex: 0 0 auto; padding: 14px 12px 12px; border-right: 0; }
  .stage-heading { padding: 0 2px 10px; }
  .eyebrow { margin-bottom: 5px; font-size: 8px; }
  h1 { font-size: 20px; }
  .visual-stage { flex: none; height: min(43vh, 370px); min-height: 270px; border-radius: 12px; }
  .caption-row { min-height: 0; padding: 9px 2px 8px; }
  .caption-row p { font-size: 10px; }
  .transport-bar { padding-top: 9px; }
  .icon-button { min-height: 31px; padding: 0 9px; font-size: 9px; }
  .control-panel { overflow: visible; padding: 15px 13px 22px; }
  .panel-section { padding-bottom: 14px; margin-bottom: 13px; }
  .control-list { column-gap: 16px; }
  body.embed-mode .app-shell { height: 100%; min-height: 0; }
  body.embed-mode .stage-column { flex: 0 0 45dvh; min-height: 280px; max-height: 380px; }
  body.embed-mode .visual-stage { height: auto; min-height: 0; flex: 1 1 auto; }
  body.embed-mode .control-panel { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
}
@media (max-width: 380px) {
  .stage-column { padding-left: 9px; padding-right: 9px; }
  .control-panel { padding-left: 10px; padding-right: 10px; }
  .control-list { column-gap: 10px; }
  .control-top { font-size: 8px; }
  .metric strong { font-size: 18px; }
  .metric-wide strong { font-size: 23px; }
}
