:root {
  color-scheme: dark;
  --bg: #071119;
  --panel: #0c1a24;
  --panel-2: #10212c;
  --panel-3: #132733;
  --line: rgba(169, 199, 207, .13);
  --line-strong: rgba(169, 199, 207, .22);
  --text: #e5eef0;
  --muted: #8ea4ab;
  --dim: #607780;
  --accent: #79e0d1;
  --accent-soft: rgba(121, 224, 209, .13);
  --accent-line: rgba(121, 224, 209, .32);
  --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%; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-height: 100vh; overflow-x: 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: min(1600px, 100%); min-height: 100vh; margin: 0 auto; padding: 0 22px 10px; display: flex; flex-direction: column; }
.topbar { height: 76px; flex: 0 0 76px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); }
.brand-mark { width: 38px; height: 38px; border: 1px solid var(--accent-line); border-radius: 11px; display: flex; align-items: center; justify-content: center; gap: 3px; transform: rotate(-22deg); background: var(--accent-soft); }
.brand-mark span { display: block; width: 4px; height: 19px; border-radius: 4px; background: var(--accent); opacity: .9; }
.brand-mark span:nth-child(2) { height: 25px; opacity: .65; }
.brand-mark span:nth-child(3) { height: 13px; opacity: .4; }
.brand-copy { display: flex; flex-direction: column; gap: 2px; }
.eyebrow { color: var(--muted); font-size: 9px; letter-spacing: .19em; font-weight: 750; }
.eyebrow span { color: var(--accent); padding: 0 4px; }
h1 { margin: 0; font-size: 23px; line-height: 1.15; font-weight: 650; letter-spacing: -.035em; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.regime-pill, .live-state { height: 28px; display: inline-flex; align-items: center; gap: 7px; font-size: 9px; font-weight: 750; letter-spacing: .12em; }
.regime-pill { color: var(--accent); border: 1px solid var(--accent-line); border-radius: 30px; padding: 0 11px; background: var(--accent-soft); }
.regime-dot, .live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(121,224,209,.65); }
.live-state { color: var(--muted); }
.live-dot { width: 5px; height: 5px; }
.workspace { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 356px; gap: 16px; padding: 16px 0 10px; }
.visual-column { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(300px, 1fr) auto; gap: 12px; }
.scene-card { min-height: 0; overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: #091720; box-shadow: 0 16px 44px rgba(0,0,0,.16); }
.scene-topline { height: 39px; flex: 0 0 39px; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; border-bottom: 1px solid var(--line); background: rgba(16,33,44,.62); }
.scene-label, .scene-meta { display: flex; align-items: center; gap: 8px; color: #a9bec4; font-size: 9px; font-weight: 750; letter-spacing: .14em; }
.tiny-cross { width: 8px; height: 8px; display: inline-block; position: relative; }
.tiny-cross::before, .tiny-cross::after { content: ""; position: absolute; background: var(--accent); border-radius: 2px; }
.tiny-cross::before { width: 8px; height: 1px; top: 3px; left: 0; }
.tiny-cross::after { width: 1px; height: 8px; left: 3px; top: 0; }
.scene-meta { color: var(--muted); font-weight: 600; letter-spacing: .08em; }
.meta-separator { color: #455e67; }
.canvas-wrap { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
#simulationCanvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.canvas-overlay { position: absolute; z-index: 1; pointer-events: none; display: flex; align-items: center; gap: 7px; color: rgba(185,210,213,.68); font-size: 8px; font-weight: 750; letter-spacing: .15em; }
.overlay-north { top: 16px; left: 18px; }
.north-arrow { color: var(--accent); font-size: 16px; line-height: 1; font-weight: 500; }
.overlay-scale { bottom: 16px; right: 18px; color: #a6b9bf; letter-spacing: .04em; font-size: 9px; }
.overlay-scale i { color: #647c84; font-style: normal; }
.scale-line { width: 36px; height: 2px; background: var(--accent); box-shadow: 0 0 8px rgba(121,224,209,.35); }
.canvas-caption { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); max-width: min(68%, 520px); padding: 8px 12px; border: 1px solid rgba(121,224,209,.18); border-radius: 30px; background: rgba(6,17,24,.76); color: #c4d5d8; text-align: center; font-size: 10px; line-height: 1.35; backdrop-filter: blur(8px); pointer-events: none; transition: opacity .25s ease, border-color .25s ease; }
.scene-footer { height: 36px; flex: 0 0 36px; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; border-top: 1px solid var(--line); background: rgba(16,33,44,.45); }
.legend { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; }
.legend-cell { width: 13px; height: 7px; border-radius: 8px; background: #c4d5d9; display: inline-block; margin-left: 2px; }
.legend-chain { width: 14px; height: 4px; display: inline-block; border-radius: 5px; background: var(--accent); margin-left: 7px; }
.legend-field { width: 14px; height: 1px; display: inline-block; background: rgba(121,224,209,.6); margin-left: 7px; }
.scene-footer-note { color: #6f858d; font-size: 8px; font-weight: 700; letter-spacing: .14em; }
.scene-footer-note span { color: var(--accent); padding: 0 4px; }
.readouts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.readout-card { min-width: 0; border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px 9px; background: linear-gradient(145deg, rgba(16,33,44,.96), rgba(10,24,33,.96)); }
.readout-label { display: flex; align-items: center; gap: 6px; min-height: 14px; color: #93aab1; font-size: 8px; font-weight: 750; letter-spacing: .12em; white-space: nowrap; }
.info-dot { width: 12px; height: 12px; flex: 0 0 12px; border: 1px solid #47616a; border-radius: 50%; color: #8aa2a9; font-size: 8px; line-height: 10px; text-align: center; font-style: normal; cursor: help; }
.readout-value { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; white-space: nowrap; }
.readout-value span { color: var(--text); font-size: clamp(20px, 2.1vw, 27px); line-height: 1; font-weight: 560; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.readout-value small { color: #80969e; font-size: 9px; }
.readout-foot { margin-top: 7px; color: var(--accent); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.control-panel { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #2a4650 transparent; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(165deg, #0e1e28, #0a1720 72%); padding: 15px 15px 12px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.panel-heading h2 { margin: 4px 0 0; font-size: 17px; line-height: 1.15; font-weight: 620; letter-spacing: -.025em; }
.icon-button { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 9px; background: #122630; cursor: pointer; transition: border-color .2s ease, background .2s ease; }
.icon-button:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.icon-button svg, .step-button svg, .play-button svg, .utility-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-button svg { width: 17px; height: 17px; color: #9eb5bc; }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 17px; }
.preset-button { min-width: 0; display: flex; align-items: center; gap: 9px; padding: 9px 10px; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: rgba(16,34,44,.7); cursor: pointer; transition: border-color .2s ease, background .2s ease, transform .2s ease; }
.preset-button:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.preset-button.active { border-color: var(--accent-line); background: var(--accent-soft); }
.preset-icon { width: 25px; height: 25px; flex: 0 0 25px; display: grid; place-items: center; border-radius: 8px; color: var(--accent); background: rgba(121,224,209,.1); font-size: 16px; }
.preset-button b, .preset-button small { display: block; }
.preset-button b { font-size: 10px; font-weight: 680; }
.preset-button small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.control-list { display: flex; flex-direction: column; gap: 13px; }
.control-item { min-width: 0; }
.control-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.control-head label { color: #c6d4d8; font-size: 10px; font-weight: 580; display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.number-tag { display: inline-block; color: #77939a; font-size: 6px; line-height: 1; letter-spacing: .1em; font-weight: 750; padding: 3px 4px; border: 1px solid rgba(145,174,181,.18); border-radius: 4px; vertical-align: middle; }
.number-tag.textbook { color: #9db5bc; }
.number-tag.illustrative { color: var(--accent); border-color: rgba(121,224,209,.2); }
.control-head output { color: var(--accent); font-size: 10px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { display: block; width: 100%; height: 14px; margin: 0; background: transparent; appearance: none; -webkit-appearance: none; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, rgba(121,224,209,.62), rgba(121,224,209,.2)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, rgba(121,224,209,.62), rgba(121,224,209,.2)); }
input[type="range"]::-webkit-slider-thumb { width: 12px; height: 12px; margin-top: -4.5px; border: 2px solid #0b1a22; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent-line), 0 0 10px rgba(121,224,209,.22); appearance: none; -webkit-appearance: none; }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #0b1a22; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent-line); }
.range-ends { display: flex; justify-content: space-between; gap: 8px; margin-top: 2px; color: #607982; font-size: 8px; }
.range-ends em { color: #718991; font-style: normal; }
.motion-controls { display: grid; grid-template-columns: 1.2fr .8fr .8fr; gap: 7px; margin-top: 18px; }
.play-button, .step-button { height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 9px; font-size: 10px; font-weight: 680; cursor: pointer; transition: transform .2s ease, background .2s ease, border-color .2s ease; }
.play-button { border: 1px solid var(--accent-line); background: var(--accent); color: #06201f; }
.play-button svg { fill: currentColor; stroke: none; }
.step-button { border: 1px solid var(--line-strong); background: #132832; color: #b6c8cc; }
.step-button:hover, .play-button:hover { transform: translateY(-1px); }
.step-button:hover { border-color: var(--accent-line); }
.step-button svg { width: 15px; height: 15px; }
.quality-glyph { color: var(--accent); font-size: 15px; }
.utility-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 1px 10px; }
.utility-button { display: inline-flex; align-items: center; gap: 7px; border: 0; padding: 4px 0; background: transparent; color: #9db1b7; font-size: 9px; cursor: pointer; }
.utility-button:hover { color: var(--accent); }
.utility-button svg { width: 14px; height: 14px; }
.seed-note { color: #637a82; font-size: 8px; letter-spacing: .13em; }
.seed-note b { color: #93aab1; font-weight: 650; }
.science-panel { border-top: 1px solid var(--line); padding-top: 2px; }
.science-panel summary { min-height: 37px; display: flex; align-items: center; gap: 8px; list-style: none; color: #c6d5d8; font-size: 10px; font-weight: 680; cursor: pointer; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-symbol { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; color: var(--accent); background: var(--accent-soft); font-size: 14px; }
.summary-hint { margin-left: auto; color: #667e86; font-size: 8px; font-weight: 500; }
.science-panel[open] .summary-hint { display: none; }
.science-content { padding: 3px 0 5px; color: #9db1b7; font-size: 9px; line-height: 1.55; }
.science-content h3 { margin: 12px 0 5px; color: #d4e1e3; font-size: 10px; font-weight: 680; }
.science-content p { margin: 5px 0 8px; }
.equation { margin: 5px 0; padding: 7px 8px; border: 1px solid rgba(121,224,209,.12); border-radius: 7px; background: rgba(121,224,209,.045); color: #d3e4e5; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; overflow-wrap: anywhere; }
.equation-note { color: #819ba2; }
.check-card { margin: 10px 0; padding: 9px; border: 1px solid var(--line-strong); border-radius: 9px; background: rgba(4,14,20,.45); }
.check-title { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: #90a8af; font-size: 8px; font-weight: 750; letter-spacing: .12em; }
.check-title span { color: var(--accent); font-size: 7px; }
.check-main { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.check-main small, .check-main b { display: block; }
.check-main small { color: #6f8790; font-size: 8px; }
.check-main b { margin-top: 2px; color: #e1ebed; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.check-foot { margin-top: 7px; color: var(--accent); font-size: 8px; }
.check-card p { margin: 7px 0 0; color: #7e969e; font-size: 8px; }
.science-content ul { padding-left: 15px; margin: 5px 0 9px; }
.science-content li { margin: 3px 0; }
.number-key { color: #7f969d; }
.number-key b { color: #a9c0c4; }
.disclaimer { padding-top: 7px; border-top: 1px solid var(--line); color: #789099; font-size: 8px; }
.bottomline { flex: 0 0 18px; display: flex; align-items: center; justify-content: space-between; color: #536a73; font-size: 8px; font-weight: 700; letter-spacing: .14em; }
.bottomline b { color: var(--accent); font-weight: 500; padding: 0 3px; }
@media (min-width: 1450px) { .workspace { grid-template-columns: minmax(0,1fr) 380px; } .control-panel { padding: 18px; } .control-list { gap: 15px; } }
@media (max-width: 1050px) and (min-width: 701px) { .workspace { grid-template-columns: minmax(0,1fr) 320px; gap: 12px; } .app-shell { padding-left: 14px; padding-right: 14px; } .readout-card { padding: 9px 8px; } .readout-label { font-size: 7px; letter-spacing: .08em; } .readout-value span { font-size: 21px; } .readout-value small { font-size: 8px; } }
@media (max-width: 700px) {
  .app-shell { height: 100vh; height: 100dvh; min-height: 0; padding: 0 10px 5px; overflow: hidden; }
  body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
  .topbar { height: 58px; flex: 0 0 58px; gap: 9px; }
  .brand-mark { width: 31px; height: 31px; border-radius: 9px; }
  .brand-mark span { height: 15px; width: 3px; }
  .brand-mark span:nth-child(2) { height: 20px; }
  .brand-mark span:nth-child(3) { height: 11px; }
  .eyebrow { font-size: 7px; letter-spacing: .14em; }
  h1 { font-size: 18px; }
  .topbar-right { gap: 8px; }
  .regime-pill { height: 24px; padding: 0 8px; font-size: 7px; letter-spacing: .08em; gap: 5px; }
  .live-state { font-size: 7px; gap: 5px; }
  .workspace { display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(230px, 42dvh) minmax(0,1fr); gap: 8px; padding: 8px 0 5px; }
  .visual-column { grid-template-rows: minmax(0,1fr) auto; gap: 7px; }
  .scene-card { border-radius: 11px; }
  .scene-topline { height: 30px; flex-basis: 30px; padding: 0 10px; }
  .scene-label, .scene-meta { font-size: 7px; gap: 6px; letter-spacing: .1em; }
  .canvas-overlay { font-size: 7px; }
  .overlay-north { top: 10px; left: 11px; }
  .overlay-scale { bottom: 10px; right: 10px; font-size: 7px; }
  .canvas-caption { bottom: 31px; max-width: 70%; padding: 6px 9px; font-size: 8px; }
  .scene-footer { height: 27px; flex-basis: 27px; padding: 0 10px; }
  .legend { gap: 5px; font-size: 7px; }
  .legend-cell { width: 10px; height: 6px; }
  .legend-chain, .legend-field { width: 10px; margin-left: 3px; }
  .scene-footer-note { font-size: 6px; letter-spacing: .08em; }
  .readouts { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 5px; }
  .readout-card { padding: 7px 6px 6px; border-radius: 8px; }
  .readout-label { min-height: 19px; white-space: normal; font-size: 6px; line-height: 1.15; letter-spacing: .06em; }
  .info-dot { display: none; }
  .readout-value { flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 4px; }
  .readout-value span { font-size: 17px; }
  .readout-value small { font-size: 7px; }
  .readout-foot { margin-top: 4px; font-size: 6px; }
  .control-panel { padding: 11px 12px 12px; border-radius: 11px; }
  .panel-heading { margin-bottom: 9px; }
  .panel-heading h2 { font-size: 15px; }
  .icon-button { width: 29px; height: 29px; }
  .preset-row { margin-bottom: 12px; }
  .preset-button { padding: 7px 8px; gap: 7px; }
  .preset-icon { width: 22px; height: 22px; flex-basis: 22px; }
  .preset-button b { font-size: 9px; }
  .preset-button small { font-size: 7px; }
  .control-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; row-gap: 10px; }
  .control-head { gap: 4px; margin-bottom: 3px; align-items: flex-start; flex-direction: column; }
  .control-head label { font-size: 8px; }
  .number-tag { font-size: 5px; padding: 2px 3px; }
  .control-head output { font-size: 9px; }
  .range-ends { font-size: 6px; }
  .range-ends em { display: none; }
  input[type="range"] { height: 12px; }
  .motion-controls { margin-top: 12px; gap: 6px; }
  .play-button, .step-button { height: 32px; font-size: 9px; }
  .utility-row { padding: 7px 1px 6px; }
  .science-panel summary { min-height: 32px; font-size: 9px; }
  .bottomline { flex: 0 0 13px; font-size: 6px; letter-spacing: .08em; }
}
@media (max-width: 380px) {
  .regime-pill { max-width: 104px; overflow: hidden; white-space: nowrap; }
  .readout-value span { font-size: 15px; }
  .scene-footer-note { display: none; }
  .control-list { column-gap: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* Embed mode keeps the entire exhibit inside the host iframe; inner panels own their scroll. */
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .app-shell { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
@keyframes exhibit-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.scene-card { animation: exhibit-enter .85s cubic-bezier(.2,.75,.25,1) both; }
.readouts { animation: exhibit-enter .72s .12s cubic-bezier(.2,.75,.25,1) both; }
.control-panel { animation: exhibit-enter .78s .08s cubic-bezier(.2,.75,.25,1) both; }
@media (prefers-reduced-motion: reduce) {
  .scene-card, .readouts, .control-panel { animation: none !important; }
}
