:root {
  color-scheme: dark;
  --bg: #081116;
  --panel: rgba(12, 24, 30, .86);
  --panel-strong: rgba(10, 20, 26, .96);
  --line: rgba(176, 206, 210, .13);
  --line-strong: rgba(176, 206, 210, .23);
  --text: #e6eeee;
  --muted: #8ca0a4;
  --dim: #5e7378;
  --teal: #62d4c6;
  --teal-bright: #8bf1df;
  --amber: #d79b58;
  --rust: #a95c38;
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--text); }
body { font-size: 12px; letter-spacing: .01em; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--teal-bright); outline-offset: 3px; }
.skip-link { position: absolute; z-index: 100; left: 12px; top: -50px; padding: 9px 12px; background: #12272d; color: white; border-radius: 8px; }
.skip-link:focus { top: 10px; }
.app { width: 100%; height: 100%; display: grid; grid-template-rows: 64px minmax(0, 1fr) 26px; background: radial-gradient(ellipse at 48% 42%, #172a30 0%, #0a171d 52%, #071015 100%); }
.topbar { position: relative; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 24px; border-bottom: 1px solid rgba(181, 215, 218, .09); background: rgba(7, 16, 21, .76); backdrop-filter: blur(16px); }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 280px; }
.brand-mark { width: 27px; height: 27px; position: relative; display: grid; place-items: center; border: 1px solid rgba(100, 217, 199, .42); border-radius: 50%; }
.brand-mark span { position: absolute; border: 1px solid rgba(112, 226, 205, .7); border-radius: 50%; transform: rotate(-28deg); }
.brand-mark span:nth-child(1) { width: 18px; height: 8px; }
.brand-mark span:nth-child(2) { width: 8px; height: 18px; }
.brand-mark span:nth-child(3) { width: 14px; height: 14px; border-color: rgba(221, 168, 104, .8); }
.eyebrow { color: #7e999d; font-size: 8px; line-height: 1.4; font-weight: 750; letter-spacing: .16em; }
.topbar h1 { margin: 1px 0 0; font-size: 17px; line-height: 1.15; letter-spacing: -.035em; font-weight: 620; }
.topbar-center { display: flex; align-items: center; gap: 9px; color: #a7babc; font-size: 9px; letter-spacing: .12em; font-weight: 650; }
.live-dot, .status-dot, .telemetry-pulse { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: var(--teal); box-shadow: 0 0 11px rgba(98, 212, 198, .75); }
.topbar-divider { color: #42585e; }
.muted { color: #6d8388; }
.topbar-actions { display: flex; gap: 8px; min-width: 280px; justify-content: flex-end; }
.icon-button, .small-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 34px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(21, 39, 45, .65); color: #d2e1e1; cursor: pointer; transition: background .2s ease, border-color .2s ease, transform .2s ease; }
.icon-button:hover, .small-button:hover { background: rgba(40, 72, 77, .68); border-color: rgba(98, 212, 198, .5); }
.icon-button:active, .small-button:active { transform: translateY(1px); }
.button-glyph { color: var(--teal); font-size: 16px; line-height: 1; }
.button-text { font-size: 10px; font-weight: 650; }
.stage { position: relative; min-height: 0; overflow: hidden; isolation: isolate; }
.scene-host { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(ellipse at 50% 44%, rgba(37, 64, 65, .22), transparent 55%); }
.scene-host canvas { display: block; width: 100%; height: 100%; outline: none; }
.scene-vignette { position: absolute; z-index: 1; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(5, 12, 16, .18), transparent 23%, transparent 76%, rgba(5, 12, 16, .2)), linear-gradient(0deg, rgba(5, 12, 16, .4), transparent 25%, transparent 78%, rgba(5, 12, 16, .2)); }
.scene-caption { position: absolute; z-index: 2; pointer-events: none; display: flex; flex-direction: column; gap: 5px; }
.scene-caption-top { left: 50%; top: 24px; transform: translateX(-50%); align-items: center; text-align: center; white-space: nowrap; }
.caption-kicker { color: rgba(183, 213, 210, .72); font-size: 8px; font-weight: 750; letter-spacing: .2em; }
.caption-sub { color: rgba(151, 177, 178, .55); font-size: 10px; letter-spacing: .04em; }
.scene-annotation { position: absolute; z-index: 4; display: flex; align-items: center; gap: 7px; color: #9edbd0; font-size: 8px; font-weight: 800; letter-spacing: .13em; text-shadow: 0 1px 8px #071015; pointer-events: none; white-space: nowrap; opacity: 0; transition: opacity .2s ease; }
.scene-annotation.visible { opacity: 1; }
.scene-annotation i { width: 6px; height: 6px; display: block; border-radius: 50%; background: var(--teal-bright); box-shadow: 0 0 12px var(--teal); }
.scene-annotation-band { color: #e3b47b; }
.scene-annotation-band i { background: #e5a65f; box-shadow: 0 0 12px #d58c49; }
.scene-annotation-well { color: #c7d5d2; }
.scene-annotation-well i { background: #d2d9d5; box-shadow: 0 0 10px #cbd5d2; }
.scene-hint { position: absolute; z-index: 2; bottom: 96px; left: 50%; transform: translateX(-50%); color: rgba(160, 184, 184, .6); font-size: 8px; font-weight: 700; letter-spacing: .14em; white-space: nowrap; pointer-events: none; }
.scene-hint b { color: #526b70; margin: 0 5px; }
.mouse-icon { color: var(--teal); font-size: 13px; margin-right: 5px; }
.glass-panel { position: absolute; z-index: 8; border: 1px solid rgba(177, 209, 210, .15); border-radius: var(--radius); background: var(--panel); backdrop-filter: blur(18px) saturate(1.15); box-shadow: 0 16px 48px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255,255,255,.035); }
.controls-panel { top: 18px; left: 20px; bottom: 82px; width: 270px; display: flex; flex-direction: column; overflow: hidden; }
.controls-panel.collapsed { bottom: auto; height: 48px; }
.controls-panel.collapsed .panel-body { display: none; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 16px 12px; border-bottom: 1px solid rgba(176, 206, 210, .09); }
.panel-heading h2 { margin: 3px 0 0; font-size: 14px; font-weight: 620; letter-spacing: -.02em; }
.collapse-button, .close-button { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.025); color: #b7c8c8; font-size: 16px; cursor: pointer; }
.panel-body { overflow-y: auto; padding: 12px 16px 14px; scrollbar-width: thin; scrollbar-color: #31474b transparent; }
.preset-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-bottom: 14px; }
.preset-button { min-width: 0; height: 27px; border: 1px solid rgba(165, 197, 196, .14); border-radius: 6px; background: rgba(255,255,255,.025); color: #8ea4a6; font-size: 9px; font-weight: 650; cursor: pointer; transition: all .18s ease; }
.preset-button:hover { border-color: rgba(98, 212, 198, .35); color: #d2e3e1; }
.preset-button.active { background: rgba(65, 139, 131, .2); border-color: rgba(98, 212, 198, .45); color: #a6e7dc; }
.control-group { margin: 0 0 13px; }
.control-group label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: #b9c9c9; font-size: 10px; font-weight: 600; }
.control-group output { color: #e1b57d; font-size: 9px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
input[type="range"] { display: block; width: 100%; height: 15px; margin: 6px 0 1px; background: transparent; accent-color: var(--teal); cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 10px; background: linear-gradient(90deg, rgba(89, 194, 177, .58), rgba(89, 194, 177, .18)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 10px; background: rgba(89, 194, 177, .28); }
input[type="range"]::-webkit-slider-thumb { width: 11px; height: 11px; margin-top: -4px; border: 2px solid #a2f0df; border-radius: 50%; background: #235e5b; box-shadow: 0 0 9px rgba(98, 212, 198, .35); -webkit-appearance: none; }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #a2f0df; border-radius: 50%; background: #235e5b; box-shadow: 0 0 9px rgba(98, 212, 198, .35); }
.range-ends { display: flex; justify-content: space-between; color: #5e7478; font-size: 8px; letter-spacing: .04em; }
.last-control { margin-bottom: 14px; }
.cause-chain { display: flex; align-items: center; justify-content: space-between; padding: 10px 9px; border: 1px solid rgba(98, 212, 198, .12); border-radius: 8px; background: rgba(48, 105, 100, .08); }
.chain-step { display: flex; flex-direction: column; gap: 3px; }
.chain-step b { color: var(--teal); font-size: 8px; letter-spacing: .1em; }
.chain-step span { color: #a7b9b8; font-size: 8px; }
.cause-chain > i { color: #5d817f; font-style: normal; font-size: 13px; }
.telemetry-panel { top: 18px; right: 20px; width: 235px; padding-bottom: 11px; }
.telemetry-heading { padding-bottom: 11px; }
.telemetry-pulse { width: 7px; height: 7px; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; padding: 7px 12px 8px; }
.readout { min-width: 0; padding: 9px 7px 8px; border-bottom: 1px solid rgba(176, 206, 210, .07); }
.readout-wide { grid-column: 1 / -1; }
.readout-label { display: block; color: #7e979a; font-size: 7px; font-weight: 800; letter-spacing: .14em; }
.readout strong { display: block; margin-top: 5px; color: #e3eeee; font-size: 19px; line-height: 1.1; font-weight: 560; letter-spacing: -.045em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout strong small { color: #89a3a4; font-size: 9px; font-weight: 550; letter-spacing: 0; }
.readout-wide strong { font-size: 22px; }
.readout-label-row { display: flex; align-items: center; justify-content: space-between; }
.tiny-tag { color: #c3a276; font-size: 7px; font-weight: 800; letter-spacing: .12em; }
.concentration-track { height: 3px; margin-top: 8px; border-radius: 5px; background: rgba(165, 190, 185, .12); overflow: hidden; }
.concentration-track span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #3b9c90, #e3a05c); box-shadow: 0 0 9px rgba(99, 211, 192, .35); transition: width .2s ease; }
.validation-block { margin: 3px 12px 0; padding: 10px 10px 9px; border: 1px solid rgba(98, 212, 198, .17); border-radius: 8px; background: rgba(48, 105, 100, .09); }
.validation-head { display: flex; align-items: center; justify-content: space-between; color: #7eaaa4; font-size: 7px; font-weight: 800; letter-spacing: .12em; }
.textbook-tag { color: #d4aa73; }
.validation-title { margin: 6px 0 8px; color: #c3d2d0; font-size: 9px; }
.validation-values { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.validation-values div { display: flex; flex-direction: column; gap: 4px; }
.validation-values small { color: #6e8588; font-size: 7px; letter-spacing: .12em; }
.validation-values b { color: #dce8e6; font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; }
.validation-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; padding-top: 7px; border-top: 1px solid rgba(176, 206, 210, .08); color: #7e9999; font-size: 8px; }
.validation-foot b { color: var(--teal-bright); font-size: 10px; }
.panel-footnote { padding: 8px 14px 0; color: #657c7f; font-size: 8px; }
.bottom-dock { position: absolute; z-index: 9; bottom: 17px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 7px; }
.transport-controls { display: flex; align-items: center; gap: 7px; padding: 7px 9px; border: 1px solid rgba(177, 209, 210, .17); border-radius: 12px; background: rgba(10, 22, 27, .91); backdrop-filter: blur(18px); box-shadow: 0 12px 38px rgba(0,0,0,.3); }
.play-button, .transport-button, .quality-button { display: grid; place-items: center; border: 1px solid rgba(169, 199, 199, .15); background: rgba(255,255,255,.035); color: #c8d8d6; cursor: pointer; transition: all .18s ease; }
.play-button { width: 34px; height: 34px; border-radius: 9px; background: #286e68; border-color: rgba(117, 224, 205, .48); color: #eafff9; font-size: 12px; box-shadow: 0 0 18px rgba(61, 160, 146, .17); }
.play-button:hover { background: #33887e; }
.transport-button { width: 31px; height: 31px; border-radius: 8px; font-size: 16px; }
.transport-button:hover, .quality-button:hover { border-color: rgba(98, 212, 198, .5); color: var(--teal-bright); }
.text-button { display: flex; gap: 5px; width: auto; padding: 0 9px; font-size: 11px; }
.text-button span { font-size: 9px; }
.transport-divider { width: 1px; height: 25px; margin: 0 2px; background: rgba(176, 206, 210, .13); }
.speed-control { width: 118px; padding: 0 3px; }
.speed-control label { display: flex; align-items: center; justify-content: space-between; color: #7d9698; font-size: 7px; font-weight: 800; letter-spacing: .13em; }
.speed-control label b { color: #d4e3df; font-size: 9px; letter-spacing: 0; }
.speed-control input { margin: 4px 0 0; height: 11px; }
.quality-button { height: 28px; padding: 0 9px; border-radius: 7px; color: #9dd9d0; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.dock-caption { display: flex; align-items: center; gap: 7px; color: rgba(143, 169, 168, .66); font-size: 7px; font-weight: 800; letter-spacing: .15em; text-shadow: 0 1px 5px #071015; }
.dock-caption .status-dot { width: 5px; height: 5px; }
.science-panel { position: absolute; z-index: 15; top: 18px; right: 20px; bottom: 82px; width: min(410px, calc(100% - 40px)); display: flex; flex-direction: column; border: 1px solid rgba(177, 209, 210, .17); border-radius: var(--radius); background: var(--panel-strong); backdrop-filter: blur(22px); box-shadow: 0 18px 60px rgba(0,0,0,.38); transform: translateX(calc(100% + 35px)); opacity: 0; visibility: hidden; transition: transform .28s cubic-bezier(.2,.75,.2,1), opacity .2s ease, visibility .2s; }
.science-panel.open { transform: translateX(0); opacity: 1; visibility: visible; }
.science-header { display: flex; align-items: center; justify-content: space-between; padding: 17px 18px 14px; border-bottom: 1px solid var(--line); }
.science-header h2 { margin: 4px 0 0; font-size: 17px; font-weight: 620; }
.close-button { font-size: 21px; }
.science-content { overflow: auto; padding: 15px 18px 20px; scrollbar-width: thin; scrollbar-color: #31474b transparent; }
.science-lead { margin: 0 0 14px; color: #b7c9c7; font-size: 11px; line-height: 1.65; }
.science-steps { display: grid; gap: 9px; margin-bottom: 15px; }
.science-steps > div { display: grid; grid-template-columns: 25px 1fr; gap: 8px; color: #91a8a8; font-size: 9px; line-height: 1.55; }
.science-steps b { color: var(--teal); font-size: 9px; }
.science-steps strong { color: #d8e4e1; }
.equation-card { margin: 10px 0; padding: 11px 12px; border: 1px solid rgba(175, 205, 205, .11); border-radius: 8px; background: rgba(255,255,255,.025); }
.equation-label { color: #8eaaa7; font-size: 7px; font-weight: 800; letter-spacing: .15em; }
.equation { margin: 9px 0 7px; color: #e5bd8b; font-family: Georgia, "Times New Roman", serif; font-size: 15px; line-height: 1.5; text-align: center; }
.equation sub, .equation sup { font-size: 9px; }
.equation-card p { margin: 0; color: #81999a; font-size: 8px; line-height: 1.55; }
.equation-card p b { color: #b8c9c5; }
.science-note { margin-top: 14px; padding: 12px; border-left: 2px solid rgba(215, 155, 88, .65); background: rgba(215, 155, 88, .055); }
.science-note strong { color: #e2bd8d; font-size: 10px; }
.science-note ul { margin: 8px 0 0; padding-left: 16px; color: #8fa5a4; font-size: 9px; line-height: 1.6; }
.science-note li { margin: 4px 0; }
.science-constants { display: grid; gap: 6px; margin-top: 14px; color: #90a7a5; font-size: 8px; }
.science-constants em { margin-left: 5px; color: #c9a16f; font-size: 7px; font-style: normal; font-weight: 800; letter-spacing: .08em; }
.disclaimer { margin: 16px 0 0; color: #627a7c; font-size: 8px; line-height: 1.5; }
.footer-bar { display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-top: 1px solid rgba(181, 215, 218, .08); background: rgba(7, 16, 21, .82); color: #61787b; font-size: 7px; font-weight: 750; letter-spacing: .16em; }
.webgl-error { position: absolute; z-index: 30; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; background: rgba(6, 15, 19, .94); }
.webgl-error[hidden] { display: none; }
.error-symbol { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(215, 155, 88, .5); border-radius: 50%; color: #e2b27c; font-size: 21px; }
.webgl-error strong { margin-top: 14px; font-size: 15px; }
.webgl-error p { max-width: 390px; color: #8da3a4; font-size: 10px; line-height: 1.6; }
.small-button { min-height: 30px; margin-top: 8px; font-size: 9px; }
.embed .app { grid-template-rows: 0 minmax(0, 1fr) 0; }
.embed .topbar, .embed .footer-bar { visibility: hidden; }
.embed .controls-panel { top: 12px; left: 12px; bottom: 72px; }
.embed .telemetry-panel { top: 12px; right: 12px; }
.embed .bottom-dock { bottom: 12px; }

@media (max-width: 1050px) {
  .controls-panel { width: 250px; }
  .telemetry-panel { width: 215px; }
  .topbar-center { display: none; }
  .brand-lockup, .topbar-actions { min-width: 0; }
}
@media (max-width: 760px) {
  html, body { overflow: auto; }
  .app { min-height: 100%; height: auto; grid-template-rows: 56px minmax(720px, 1fr) 24px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .brand-lockup { gap: 8px; }
  .brand-mark { width: 23px; height: 23px; }
  .brand-mark span:nth-child(1) { width: 15px; }
  .brand-mark span:nth-child(2) { height: 15px; }
  .topbar h1 { font-size: 14px; }
  .topbar .eyebrow { font-size: 7px; }
  .topbar-actions { gap: 5px; }
  .icon-button { min-height: 31px; padding: 0 8px; }
  .button-text { display: none; }
  .stage { min-height: 720px; }
  .scene-caption-top { top: 14px; }
  .caption-kicker { font-size: 7px; }
  .caption-sub { font-size: 9px; }
  .controls-panel { top: auto; left: 10px; right: 10px; bottom: 12px; width: auto; max-height: 255px; border-radius: 12px; }
  .controls-panel.collapsed { bottom: 12px; height: 49px; max-height: 49px; }
  .panel-heading { padding: 10px 13px 9px; }
  .panel-heading h2 { font-size: 12px; }
  .controls-panel .panel-heading .eyebrow { font-size: 7px; }
  .panel-body { padding: 9px 13px 11px; }
  .controls-panel.collapsed .panel-body { display: none; }
  .preset-row { margin-bottom: 10px; }
  .control-group { margin-bottom: 9px; }
  .control-group label { font-size: 9px; }
  .control-group output { font-size: 8px; }
  .control-group input { margin: 4px 0 0; }
  .range-ends { font-size: 7px; }
  .cause-chain { padding: 7px 8px; }
  .telemetry-panel { top: 53px; left: 10px; right: 10px; width: auto; padding-bottom: 5px; }
  .telemetry-heading { display: none; }
  .readout-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; padding: 4px 5px; }
  .readout { padding: 6px 5px; border-bottom: 0; border-right: 1px solid rgba(176, 206, 210, .07); }
  .readout:last-child { border-right: 0; }
  .readout-label { font-size: 6px; letter-spacing: .08em; }
  .readout strong, .readout-wide strong { margin-top: 4px; font-size: 13px; }
  .readout strong small { display: block; margin-top: 2px; font-size: 7px; }
  .readout-wide { grid-column: auto; }
  .concentration-readout { display: none; }
  .validation-block, .panel-footnote { display: none; }
  .bottom-dock { bottom: 280px; left: 50%; }
  .transport-controls { gap: 5px; padding: 6px; }
  .play-button { width: 30px; height: 30px; }
  .transport-button { width: 27px; height: 27px; }
  .speed-control { width: 85px; }
  .speed-control label { font-size: 6px; }
  .transport-divider { height: 21px; }
  .transport-divider-wide { display: none; }
  .text-button span { display: none; }
  .quality-button { height: 25px; padding: 0 7px; }
  .dock-caption { display: none; }
  .scene-hint { bottom: 270px; font-size: 7px; }
  .science-panel { top: 10px; left: 10px; right: 10px; bottom: 280px; width: auto; }
  .science-content { padding: 12px 14px 16px; }
  .scene-annotation { font-size: 7px; }
  .footer-bar { padding: 0 10px; font-size: 6px; }
  .embed .app { grid-template-rows: 0 minmax(720px, 1fr) 0; }
  .embed .stage { min-height: 720px; }
}
@media (max-width: 390px) {
  .topbar { padding: 0 9px; }
  .topbar h1 { font-size: 13px; }
  .brand-mark { display: none; }
  .bottom-dock { bottom: 278px; }
  .transport-controls { gap: 4px; }
  .speed-control { width: 72px; }
  .quality-button { font-size: 7px; padding: 0 5px; }
  .scene-hint { bottom: 267px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
