:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-soft: #0a1727;
  --panel: #0c1b2c;
  --panel-2: #102236;
  --line: rgba(155, 189, 221, .13);
  --line-strong: rgba(155, 189, 221, .22);
  --text: #e9f2fc;
  --muted: #8fa6bc;
  --dim: #60778d;
  --cyan: #58d6ec;
  --blue: #477ff0;
  --teal: #4be0c3;
  --amber: #e7b76c;
  --radius: 12px;
  --space: 8px;
  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; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-width: 320px; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.app-shell { width: min(1680px, 100%); min-height: 100vh; margin: 0 auto; padding: 0 28px 14px; background: radial-gradient(ellipse at 40% 0%, rgba(23, 63, 92, .19), transparent 46%), var(--bg); }
.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); gap: 16px; }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 245px; }
.brand-mark { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; gap: 3px; border: 1px solid rgba(88,214,236,.42); border-radius: 8px; transform: rotate(45deg); }
.brand-mark span { width: 3px; border-radius: 4px; background: var(--cyan); display: block; transform: rotate(-45deg); }
.brand-mark span:nth-child(1) { height: 8px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 14px; }
.brand-mark span:nth-child(3) { height: 10px; opacity: .72; }
.brand-copy { line-height: 1.2; }
.eyebrow, .kicker, .section-label, .readout-label, .topbar-meta, .panel-index, .range-ends, .panel-footer, .validation-title, .equation-label { letter-spacing: .12em; font-size: 9px; font-weight: 750; color: #91a9bf; }
.eyebrow span { color: var(--cyan); }
.brand-name { margin-top: 4px; font-size: 10px; letter-spacing: .16em; font-weight: 800; color: #e5f0fa; }
.topbar-meta { display: flex; align-items: center; gap: 10px; font-size: 9px; color: #7890a7; }
.live-dot, .chip-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px rgba(75,224,195,.75); }
.meta-divider { width: 1px; height: 12px; background: var(--line-strong); margin: 0 4px; }
.icon-button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-strong); background: transparent; color: #9cb2c6; font-family: Georgia, serif; font-size: 15px; cursor: pointer; transition: .2s ease; }
.icon-button:hover { border-color: var(--cyan); color: var(--cyan); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 348px; gap: 20px; padding-top: 20px; align-items: start; }
.stage-column { min-width: 0; }
.stage-head { min-height: 82px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 2px 4px 14px; }
.kicker { display: flex; align-items: center; gap: 10px; color: #79a3c2; font-size: 9px; }
.kicker-line { width: 32px; height: 1px; background: linear-gradient(90deg, var(--cyan), transparent); }
h1 { margin: 8px 0 3px; font-size: clamp(25px, 3vw, 36px); letter-spacing: -.045em; line-height: 1; font-weight: 730; }
h1 em { font-family: Georgia, "Times New Roman", serif; font-weight: 500; color: #78d7e7; }
.stage-subtitle { margin: 0; font-size: 12px; color: #8da5bb; letter-spacing: .005em; }
.stage-status { display: flex; align-items: center; gap: 10px; padding-top: 15px; white-space: nowrap; }
.status-pill { display: inline-flex; align-items: center; padding: 5px 8px; border: 1px solid rgba(75,224,195,.28); border-radius: 5px; color: #6ce1c8; font-size: 8px; letter-spacing: .12em; font-weight: 800; background: rgba(75,224,195,.06); }
.status-pill.paused { color: #e7b76c; border-color: rgba(231,183,108,.28); background: rgba(231,183,108,.06); }
.stage-time { font-size: 11px; color: #91a7bb; font-variant-numeric: tabular-nums; }
.scene-frame { position: relative; height: clamp(380px, 48vw, 520px); min-height: 340px; overflow: hidden; border: 1px solid rgba(118, 170, 208, .18); border-radius: 14px; background: radial-gradient(ellipse at 52% 42%, #17344c 0%, #0c1e30 43%, #081321 100%); box-shadow: 0 20px 55px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.035); isolation: isolate; }
.scene-glow { position: absolute; z-index: 0; width: 65%; height: 65%; top: 18%; left: 18%; border-radius: 50%; background: radial-gradient(ellipse, rgba(26, 109, 148, .14), transparent 68%); pointer-events: none; }
.scene-mount { position: absolute; inset: 0; z-index: 1; touch-action: none; }
.scene-mount canvas { width: 100%; height: 100%; display: block; outline: none; }
.scene-overlay { position: absolute; z-index: 2; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.scene-overlay-top { top: 15px; }
.scene-overlay-bottom { bottom: 14px; }
.scene-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border-radius: 5px; background: rgba(5, 17, 29, .56); border: 1px solid rgba(160, 196, 223, .12); color: #a6bdd1; font-size: 8px; letter-spacing: .1em; font-weight: 750; backdrop-filter: blur(8px); }
.chip-dot.cyan { background: var(--cyan); box-shadow: 0 0 9px rgba(88,214,236,.7); }
.chip-dot.blue { background: #527ef3; box-shadow: 0 0 9px rgba(82,126,243,.65); }
.scale-legend { display: flex; align-items: center; gap: 7px; color: #8098af; font-size: 8px; letter-spacing: .06em; }
.scale-legend i { display: block; width: 65px; height: 1px; background: linear-gradient(90deg, #64d7e8, rgba(100,215,232,.12)); }
.scene-hint { font-size: 8px; color: #8199af; letter-spacing: .11em; font-weight: 700; }
.scene-hint b { color: #49657f; padding: 0 4px; }
.mouse-icon { color: var(--cyan); font-size: 12px; margin-right: 5px; }
.scene-annotation { position: absolute; z-index: 2; right: 18px; top: 39%; color: rgba(161,201,223,.78); font-size: 8px; letter-spacing: .13em; font-weight: 800; pointer-events: none; display: flex; align-items: center; gap: 7px; text-shadow: 0 2px 10px #06111c; }
.annotation-front { top: 27%; }
.annotation-bands { top: 65%; }
.annotation-leader { display: block; width: 28px; height: 1px; background: linear-gradient(90deg, transparent, rgba(88,214,236,.7)); }
.webgl-fallback, .context-loss { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 10px; padding: 25px; text-align: center; background: rgba(4,13,23,.94); color: #b7cadb; }
.webgl-fallback[hidden], .context-loss[hidden] { display: none; }
.fallback-icon { font-size: 36px; color: var(--cyan); }
.webgl-fallback strong { font-size: 15px; }
.webgl-fallback span { max-width: 360px; font-size: 11px; line-height: 1.6; color: var(--muted); }
.context-loss { z-index: 6; background: rgba(4,13,23,.78); font-size: 12px; }
.transport-bar { min-height: 58px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding: 8px 2px; }
.transport-left, .transport-right { display: flex; align-items: center; gap: 7px; }
.primary-control, .control-button, .quality-button { height: 34px; display: inline-flex; justify-content: center; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 7px; background: rgba(15,35,54,.65); color: #b5c8d9; font-size: 10px; font-weight: 700; cursor: pointer; transition: background .18s ease, border-color .18s ease, color .18s ease; }
.primary-control { min-width: 82px; background: linear-gradient(135deg, #14516b, #123d5b); border-color: rgba(88,214,236,.45); color: #e1faff; }
.primary-control:hover { background: linear-gradient(135deg, #1b6680, #164e70); }
.control-button:hover, .quality-button:hover { color: #e9f7ff; border-color: rgba(88,214,236,.5); background: rgba(24,55,78,.8); }
.play-icon { color: var(--cyan); font-size: 12px; width: 10px; }
.step-icon { font-size: 12px; color: var(--cyan); }
.speed-control { display: flex; align-items: center; gap: 8px; padding: 0 7px; color: #7e96ac; font-size: 8px; letter-spacing: .1em; font-weight: 800; }
.speed-control output { width: 54px; color: #b7cce0; font-size: 10px; letter-spacing: 0; text-align: right; }
input[type="range"] { width: 100%; height: 3px; appearance: none; background: linear-gradient(90deg, #318aa7, #274766); border-radius: 10px; cursor: pointer; accent-color: var(--cyan); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #d6f8ff; border: 2px solid #45bfd8; box-shadow: 0 0 0 3px rgba(69,191,216,.12); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: #d6f8ff; border: 2px solid #45bfd8; box-shadow: 0 0 0 3px rgba(69,191,216,.12); }
.speed-control input { width: 78px; }
.quality-button { min-width: 43px; padding: 0 8px; font-size: 8px; letter-spacing: .08em; color: var(--teal); border-color: rgba(75,224,195,.28); }
.quality-button[aria-pressed="false"] { color: #e7b76c; border-color: rgba(231,183,108,.28); }
.readout-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding-top: 12px; }
.readout-card { min-height: 80px; padding: 11px 12px 9px; border: 1px solid var(--line); border-radius: 9px; background: linear-gradient(135deg, rgba(14,33,51,.76), rgba(9,24,39,.82)); }
.readout-label { display: flex; justify-content: space-between; gap: 4px; color: #829bb2; font-size: 8px; letter-spacing: .1em; white-space: nowrap; }
.readout-label span { color: #54748c; font-size: 7px; }
.readout-value { margin-top: 8px; color: #e4f3fc; font-size: 22px; font-weight: 700; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.readout-value small { color: #82a2b8; font-size: 10px; font-weight: 600; letter-spacing: 0; }
.readout-foot { margin-top: 5px; color: #617b91; font-size: 8px; }
.control-panel { min-width: 0; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(165deg, rgba(14,31,48,.98), rgba(9,23,37,.98)); box-shadow: 0 16px 45px rgba(0,0,0,.12); padding: 16px 16px 12px; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 5px 0 0; font-size: 18px; letter-spacing: -.03em; font-weight: 690; }
.panel-index { padding-top: 5px; color: #58748c; font-size: 8px; }
.preset-block { padding: 14px 0 13px; border-bottom: 1px solid var(--line); }
.section-label { display: flex; justify-content: space-between; align-items: center; color: #a4b9ca; font-size: 8px; letter-spacing: .12em; margin-bottom: 10px; }
.section-label span { color: #5e7b92; font-size: 7px; }
.preset-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px; }
.preset-button { min-width: 0; height: 50px; display: flex; align-items: center; gap: 7px; padding: 6px; border: 1px solid var(--line); border-radius: 7px; background: rgba(7,20,33,.45); text-align: left; cursor: pointer; transition: .18s ease; }
.preset-button:hover { border-color: rgba(88,214,236,.35); }
.preset-button.active { border-color: rgba(88,214,236,.48); background: rgba(25,77,96,.25); box-shadow: inset 0 0 0 1px rgba(88,214,236,.08); }
.preset-swatch { width: 18px; height: 27px; flex: 0 0 18px; border-radius: 4px; border: 1px solid rgba(130,180,213,.2); background-color: #12344f; background-image: repeating-linear-gradient(180deg, #205c94 0 2px, transparent 2px 5px); }
.tight-swatch { background-image: repeating-linear-gradient(180deg, #2d80c2 0 1px, transparent 1px 3px); }
.sparse-swatch { background-image: repeating-linear-gradient(180deg, #27588c 0 3px, transparent 3px 10px); }
.preset-button b { display: block; color: #cbdce9; font-size: 9px; line-height: 1.2; }
.preset-button small { display: block; margin-top: 3px; color: #708aa0; font-size: 7px; white-space: nowrap; }
.control-section { padding: 13px 0 12px; border-bottom: 1px solid var(--line); }
.control-section .section-label { margin-bottom: 12px; }
.slider-row + .slider-row { margin-top: 13px; }
.slider-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; gap: 10px; }
.slider-label label { color: #c2d3e0; font-size: 10px; font-weight: 600; }
.slider-label output { color: var(--cyan); font-size: 9px; font-weight: 700; font-variant-numeric: tabular-nums; }
.slider-row input { display: block; }
.range-ends { display: flex; justify-content: space-between; margin-top: 6px; color: #4f6b83; font-size: 6px; letter-spacing: .13em; }
.panel-note { display: flex; align-items: flex-start; gap: 8px; padding: 12px 2px; color: #8198ac; font-size: 9px; line-height: 1.5; }
.note-icon { color: var(--amber); font-size: 13px; line-height: 1; }
.science-panel { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.science-panel summary { display: flex; align-items: center; justify-content: space-between; padding: 13px 2px; color: #d7e6f1; font-size: 11px; font-weight: 700; cursor: pointer; list-style: none; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-icon { color: var(--cyan); margin-right: 7px; font-size: 14px; }
.summary-chevron { color: #7891a7; font-size: 14px; transition: transform .2s ease; }
.science-panel[open] .summary-chevron { transform: rotate(180deg); }
.science-content { padding: 0 1px 14px; }
.science-intro { margin: 0 0 11px; color: #8fa6bb; font-size: 9px; line-height: 1.6; }
.equation-card { padding: 9px 10px; margin-top: 7px; border: 1px solid rgba(130,171,204,.13); border-radius: 7px; background: rgba(5,17,29,.45); }
.equation-label { color: #6e8da5; font-size: 7px; }
.equation { margin: 7px 0 5px; color: #d6f4fb; font-family: Georgia, "Times New Roman", serif; font-size: 15px; letter-spacing: .01em; }
.equation-card small { color: #7892a8; font-size: 8px; line-height: 1.4; display: block; }
.science-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.science-two-col > div { padding: 8px; border-radius: 6px; background: rgba(16,39,58,.55); }
.science-two-col b { display: block; color: var(--cyan); font-size: 10px; }
.science-two-col small { display: block; margin-top: 3px; color: #7d94a8; font-size: 7px; line-height: 1.35; }
.validation-card { margin-top: 10px; padding: 10px; border: 1px solid rgba(75,224,195,.18); border-radius: 7px; background: rgba(9,38,43,.3); }
.validation-title { display: flex; justify-content: space-between; gap: 6px; color: #90b8bc; font-size: 7px; }
.validation-title span { color: var(--teal); }
.validation-card p { margin: 7px 0 0; color: #8098a8; font-size: 8px; line-height: 1.45; }
.small-equation { font-size: 13px; margin: 6px 0; }
.validation-values { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; padding-top: 7px; border-top: 1px solid rgba(75,224,195,.12); }
.validation-values small { display: block; color: #62828a; font-size: 6px; letter-spacing: .1em; }
.validation-values b { display: block; margin-top: 4px; color: #d0e7e8; font-size: 9px; font-variant-numeric: tabular-nums; }
.audit-foot { margin-top: 7px; color: #607f86; font-size: 7px; }
.limitations { margin: 10px 1px 0; color: #74899c; font-size: 8px; line-height: 1.6; }
.limitations b { color: #9bb0c1; }
.panel-footer { display: flex; justify-content: space-between; gap: 8px; padding: 12px 1px 0; color: #536d83; font-size: 7px; }
.bottomline { display: flex; justify-content: space-between; gap: 12px; padding: 13px 3px 0; color: #5e778d; font-size: 8px; letter-spacing: .04em; }
.info-modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(2,8,15,.76); backdrop-filter: blur(10px); }
.info-modal[hidden] { display: none; }
.modal-card { position: relative; width: min(440px, 100%); padding: 26px; border: 1px solid var(--line-strong); border-radius: 14px; background: #0c1d2e; box-shadow: 0 25px 90px rgba(0,0,0,.4); }
.modal-card h2 { margin: 10px 0; font-size: 24px; letter-spacing: -.04em; }
.modal-card p { color: #9bb0c2; font-size: 11px; line-height: 1.7; }
.modal-close { position: absolute; top: 12px; right: 12px; border: 0; background: transparent; color: #9bb0c2; font-size: 22px; cursor: pointer; }
.modal-action { margin-top: 8px; padding: 10px 14px; border: 1px solid rgba(88,214,236,.35); border-radius: 7px; background: #12445a; color: #dffaff; font-size: 10px; font-weight: 700; cursor: pointer; }

@media (min-width: 1500px) {
  .workspace { grid-template-columns: minmax(0,1fr) 370px; gap: 24px; }
  .scene-frame { height: 560px; }
}
@media (max-width: 1120px) {
  .app-shell { padding-left: 18px; padding-right: 18px; }
  .workspace { grid-template-columns: minmax(0,1fr) 320px; gap: 14px; }
  .control-panel { padding: 14px 12px 11px; }
  .scene-frame { height: 430px; }
  .transport-bar { flex-wrap: wrap; }
  .transport-right { margin-left: auto; }
}
@media (max-width: 850px) {
  .workspace { grid-template-columns: 1fr; }
  .control-panel { display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; }
  .panel-heading, .science-panel, .panel-note, .panel-footer { grid-column: 1 / -1; }
  .preset-block, .control-section { align-self: start; }
  .control-section:nth-of-type(3) { border-bottom: 0; }
  .scene-frame { height: min(62vw, 470px); min-height: 350px; }
  .readout-grid { margin-bottom: 2px; }
}
@media (max-width: 560px) {
  .app-shell { padding: 0 12px 12px; }
  .topbar { height: 56px; }
  .brand-lockup { min-width: 0; }
  .brand-name { font-size: 8px; }
  .eyebrow { font-size: 8px; }
  .topbar-meta { display: none; }
  .workspace { padding-top: 13px; gap: 14px; }
  .stage-head { min-height: 78px; padding-left: 1px; padding-right: 1px; }
  h1 { font-size: 28px; }
  .stage-subtitle { max-width: 250px; font-size: 10px; }
  .stage-status { padding-top: 14px; gap: 6px; }
  .status-pill { font-size: 7px; padding: 4px 6px; }
  .stage-time { font-size: 9px; }
  .scene-frame { height: 390px; min-height: 390px; border-radius: 10px; }
  .scene-overlay { left: 9px; right: 9px; }
  .scene-overlay-top { top: 9px; gap: 5px; flex-wrap: wrap; }
  .scene-chip { padding: 5px 6px; font-size: 6px; }
  .scene-overlay-bottom { bottom: 9px; }
  .scene-hint { font-size: 6px; }
  .scale-legend { font-size: 7px; }
  .scale-legend i { width: 34px; }
  .scene-annotation { display: none; }
  .transport-bar { align-items: flex-start; padding: 8px 0; gap: 8px; }
  .transport-left, .transport-right { gap: 5px; }
  .transport-left { width: 100%; }
  .transport-right { width: 100%; justify-content: space-between; margin-left: 0; }
  .primary-control, .control-button, .quality-button { height: 32px; padding: 0 8px; font-size: 9px; }
  .speed-control { padding-left: 2px; gap: 5px; font-size: 7px; }
  .speed-control input { width: 62px; }
  .readout-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; padding-top: 8px; }
  .readout-card { min-height: 74px; padding: 9px; }
  .readout-label { font-size: 7px; }
  .readout-value { font-size: 20px; }
  .control-panel { display: block; padding: 14px 12px 11px; }
  .preset-grid { gap: 5px; }
  .preset-button { height: 48px; gap: 5px; padding: 5px; }
  .preset-button b { font-size: 8px; }
  .preset-button small { font-size: 6px; }
  .bottomline { flex-direction: column; gap: 5px; font-size: 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; }
}
/* Embed mode removes the editorial chrome while preserving controls and the experiment. */
body.embed-mode .app-shell { padding-top: 8px; }
body.embed-mode .topbar, body.embed-mode .bottomline { display: none; }
body.embed-mode .workspace { padding-top: 0; }
body.embed-mode .stage-head { min-height: 70px; }
.profile-card { padding: 11px 1px 12px; border-bottom: 1px solid var(--line); }
.profile-card svg { display: block; width: 100%; height: 82px; overflow: visible; }
.chart-legend { display: flex; align-items: center; gap: 14px; color: #7891a7; font-size: 7px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { display: inline-block; width: 11px; height: 2px; border-radius: 3px; }
.legend-a { background: #55d9ec; }
.legend-b { background: #e5b66d; }
.legend-p { background: #668ef4; }
@media (max-width: 850px) { .profile-card { grid-column: 1 / -1; } }
@media (min-width: 851px) and (max-height: 760px) {
  .topbar { height: 56px; }
  .workspace { padding-top: 12px; }
  .stage-head { min-height: 66px; padding-bottom: 10px; }
  .scene-frame { height: min(52vh, 390px); min-height: 320px; }
  .transport-bar { min-height: 48px; padding-top: 6px; padding-bottom: 6px; }
  .readout-grid { padding-top: 8px; }
  .readout-card { min-height: 70px; padding: 9px 10px 8px; }
  .bottomline { padding-top: 8px; }
  .control-panel { max-height: calc(100vh - 82px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #27465f transparent; }
}
