:root {
  color-scheme: dark;
  --bg: #07111c;
  --panel: #0d1b29;
  --panel-2: #102233;
  --line: rgba(156, 190, 207, 0.13);
  --muted: #7e9aaa;
  --text: #e7f1f5;
  --cyan: #6ad8ed;
  --cyan-bright: #8df0fa;
  --ice: #b9f3ff;
  --amber: #e9bd78;
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; background: radial-gradient(ellipse at 44% -20%, #153246 0%, #091724 44%, #07111c 78%); color: var(--text); min-height: 100vh; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { max-width: 1780px; margin: 0 auto; padding: 0 30px 18px; }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 34px; height: 34px; border: 1px solid rgba(109, 216, 237, .5); border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 3px; transform: rotate(0deg); background: rgba(52, 157, 185, .08); }
.brand-mark span { width: 3px; border-radius: 5px; background: var(--cyan); display: block; transform: skew(-20deg); }
.brand-mark span:nth-child(1) { height: 11px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 20px; }
.brand-mark span:nth-child(3) { height: 14px; opacity: .72; }
.brand-name { font-size: 12px; font-weight: 800; letter-spacing: .15em; }
.brand-name span { color: #85a5b5; font-weight: 500; }
.brand-subtitle { color: #718e9e; font-size: 8px; letter-spacing: .19em; margin-top: 4px; }
.topbar-meta { display: flex; align-items: center; gap: 24px; }
.field-chip { display: flex; align-items: center; gap: 8px; color: #a6dce7; font-size: 9px; letter-spacing: .12em; border: 1px solid rgba(106, 216, 237, .23); border-radius: 30px; padding: 8px 12px; background: rgba(57, 162, 188, .08); }
.field-chip i, .live-dot, .stamp-dot { width: 6px; height: 6px; border-radius: 50%; background: #69e6c1; box-shadow: 0 0 10px rgba(105,230,193,.65); }
.edition { font-size: 8px; color: #6e8999; letter-spacing: .13em; }
.edition b { color: #bdd2dc; margin-left: 5px; }
.intro-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 24px 0 20px; }
.eyebrow { color: #77b4c5; font-size: 9px; font-weight: 700; letter-spacing: .16em; }
h1 { margin: 8px 0 7px; font-size: clamp(23px, 2.2vw, 34px); letter-spacing: -.045em; line-height: 1.1; font-weight: 650; }
h1 span { color: #73d6e9; font-weight: 400; }
.intro-copy { margin: 0; color: #90a8b5; font-size: 12px; line-height: 1.5; max-width: 760px; }
.model-stamp { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; color: #7f9aaa; font-size: 8px; line-height: 1.45; letter-spacing: .11em; flex: 0 0 auto; }
.stamp-dot { background: var(--amber); box-shadow: 0 0 8px rgba(233,189,120,.6); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 16px; align-items: start; }
.scene-column { min-width: 0; }
.scene-frame { position: relative; height: clamp(500px, 58vw, 690px); min-height: 500px; overflow: hidden; border: 1px solid rgba(126, 174, 193, .19); border-radius: 14px; background: #07121e; box-shadow: 0 24px 65px rgba(0,0,0,.28), inset 0 0 0 1px rgba(255,255,255,.018); }
#scene-canvas { display: block; width: 100%; height: 100%; outline: none; }
.scene-vignette { pointer-events: none; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5,14,23,.5), transparent 18%, transparent 75%, rgba(5,14,23,.62)); }
.scene-headline { position: absolute; top: 16px; left: 17px; right: 17px; display: flex; justify-content: space-between; align-items: center; color: #b7d0da; font-size: 9px; font-weight: 700; letter-spacing: .13em; pointer-events: none; }
.scene-headline > div:first-child { display: flex; align-items: center; gap: 8px; }
.live-dot { width: 6px; height: 6px; }
.scene-headline-right { display: flex; align-items: center; gap: 12px; color: #7e9cab; }
.webgl-pill { border: 1px solid rgba(106,216,237,.28); border-radius: 20px; padding: 6px 9px; color: #8cdeec; background: rgba(6,20,31,.6); }
.annotation-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.scene-tag { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); white-space: nowrap; border: 1px solid rgba(116, 221, 239, .3); border-radius: 4px; background: rgba(5, 19, 29, .78); color: #bcecf3; font-size: 8px; font-weight: 700; letter-spacing: .1em; padding: 5px 7px; box-shadow: 0 4px 12px rgba(0,0,0,.18); transition: opacity .15s ease; }
.scene-tag-lens { border-color: rgba(192, 242, 255, .36); color: #d7f7ff; }
.scene-tag-flow { border-color: rgba(69, 206, 241, .3); color: #78def0; }
.scene-axis { position: absolute; left: 17px; bottom: 49px; display: flex; flex-direction: column; gap: 6px; color: #7b9aaa; font-size: 7px; letter-spacing: .14em; pointer-events: none; }
.scene-axis i { display: block; height: 24px; width: 1px; margin-left: 4px; background: linear-gradient(var(--cyan), transparent); }
.scene-legend { position: absolute; left: 16px; bottom: 16px; display: flex; flex-wrap: wrap; gap: 12px; color: #9ab1bd; font-size: 7px; font-weight: 650; letter-spacing: .08em; pointer-events: none; }
.scene-legend span { display: flex; align-items: center; gap: 5px; }
.legend-swatch { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }
.legend-swatch.frozen { background: #3a99b6; }
.legend-swatch.front { background: #72eff8; box-shadow: 0 0 7px #72eff8; }
.legend-swatch.warm { background: #b78959; }
.legend-swatch.ice { background: #b6f3ff; }
.scene-bottom-right { position: absolute; right: 17px; bottom: 17px; color: #688594; font-size: 7px; letter-spacing: .13em; pointer-events: none; }
.scene-bottom-right b { color: #6ed6e9; padding: 0 4px; }
.scene-status { position: absolute; top: 54px; right: 16px; color: #91aebc; font-size: 8px; letter-spacing: .03em; background: rgba(5,16,25,.68); padding: 6px 8px; border-radius: 4px; opacity: 0; transition: opacity .2s ease; pointer-events: none; }
.scene-status.visible { opacity: 1; }
.playback-bar { min-height: 58px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--line); border-top: 0; background: rgba(11, 27, 41, .82); border-radius: 0 0 12px 12px; padding: 9px 12px; }
.playback-actions, .playback-tools { display: flex; align-items: center; gap: 8px; min-width: 0; }
.primary-button, .icon-button, .small-tool { border: 1px solid rgba(131, 173, 190, .2); border-radius: 7px; background: #142b3b; min-height: 34px; padding: 0 11px; color: #c9dce4; font-size: 10px; font-weight: 650; cursor: pointer; transition: background .15s, border-color .15s, transform .15s; }
.primary-button { display: flex; align-items: center; gap: 7px; color: #06212b; background: #80e0ee; border-color: #80e0ee; min-width: 82px; justify-content: center; }
.primary-button:hover { background: #a2eff8; }
.primary-button:active, .icon-button:active, .small-tool:active { transform: translateY(1px); }
.play-icon { font-size: 10px; }
.icon-button:hover, .small-tool:hover { background: #1c3b4e; border-color: rgba(119,216,235,.42); }
.playback-divider { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.elapsed-label { color: #8da6b3; font-size: 9px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.speed-control { display: flex; align-items: center; gap: 7px; color: #718e9e; font-size: 8px; letter-spacing: .1em; white-space: nowrap; }
.speed-control input { width: 82px; }
.speed-control output { color: #b4d5df; min-width: 47px; font-size: 9px; letter-spacing: 0; }
.small-tool { background: transparent; padding: 0 8px; color: #91aab7; font-size: 9px; }
.small-tool span { color: #7bd8e9; font-size: 13px; margin-right: 3px; }
.scene-footnote { display: flex; justify-content: space-between; gap: 8px; padding: 9px 3px 0; color: #587382; font-size: 7px; letter-spacing: .13em; }
.control-panel { background: linear-gradient(180deg, rgba(14,31,46,.97), rgba(10,24,37,.97)); border: 1px solid var(--line); border-radius: 13px; padding: 16px; min-width: 0; max-height: calc(100vh - 160px); overflow: auto; scrollbar-width: thin; scrollbar-color: #294758 transparent; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 4px 0 0; font-size: 19px; letter-spacing: -.035em; font-weight: 650; }
.panel-index { color: #5e7b8b; font-size: 8px; letter-spacing: .12em; padding-top: 4px; }
.section-label { display: flex; align-items: center; justify-content: space-between; color: #9ab4c0; font-size: 8px; font-weight: 750; letter-spacing: .12em; }
.micro-label { color: #628394; font-size: 7px; letter-spacing: .12em; }
.preset-section { padding: 14px 0 13px; border-bottom: 1px solid var(--line); }
.preset-grid { display: grid; grid-template-columns: 1fr; gap: 6px; margin-top: 9px; }
.preset-button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; border: 1px solid rgba(126,167,185,.12); border-radius: 7px; background: rgba(21,44,61,.46); padding: 7px 9px; cursor: pointer; transition: border-color .15s, background .15s; }
.preset-button:hover { background: rgba(28,62,81,.62); }
.preset-button.active { border-color: rgba(101,213,235,.52); background: rgba(50,132,153,.13); box-shadow: inset 2px 0 #6ad8ed; }
.preset-icon { display: grid; place-items: center; width: 26px; height: 26px; flex: 0 0 26px; border-radius: 6px; background: rgba(104,196,217,.12); color: #86ddec; font-size: 15px; }
.sand-icon { color: #d5b37c; background: rgba(213,179,124,.1); }
.loaded-icon { color: #c6a6e6; background: rgba(198,166,230,.1); }
.preset-button b { display: block; font-size: 9px; color: #d1e1e7; font-weight: 700; }
.preset-button small { display: block; margin-top: 2px; color: #7793a2; font-size: 8px; }
.controls-section { padding: 14px 0 12px; border-bottom: 1px solid var(--line); }
.control-row { margin-top: 12px; }
.control-row label { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.control-name { color: #c2d4dc; font-size: 9px; }
.control-row output { color: #7ed8e8; font-size: 9px; font-weight: 700; font-variant-numeric: tabular-nums; }
input[type="range"] { display: block; width: 100%; height: 14px; margin: 5px 0 0; background: transparent; accent-color: #67d2e5; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, #327c91, #4fb8ca 70%, #244354); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; border: 2px solid #b5f4fb; border-radius: 50%; background: #3caec4; margin-top: -4.5px; box-shadow: 0 0 0 3px rgba(82,202,225,.12); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 5px; background: #315a6d; }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border: 2px solid #b5f4fb; border-radius: 50%; background: #3caec4; }
.range-ends { display: flex; justify-content: space-between; color: #587586; font-size: 6px; letter-spacing: .1em; margin-top: -1px; }
.readouts-section { padding: 14px 0 13px; border-bottom: 1px solid var(--line); }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 9px; }
.readout-card { min-height: 67px; border: 1px solid rgba(130,171,189,.12); background: rgba(4,17,28,.36); border-radius: 7px; padding: 8px 9px; }
.readout-card span { display: block; color: #7191a0; font-size: 7px; letter-spacing: .1em; font-weight: 700; }
.readout-card strong { display: block; color: #d9f0f4; font-size: 19px; line-height: 1.25; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.readout-card strong small { font-size: 9px; color: #80b9c8; font-weight: 600; letter-spacing: 0; }
.readout-card em { display: block; color: #617e8d; font-size: 7px; font-style: normal; margin-top: 2px; }
.readout-wide { grid-column: 1 / -1; min-height: 58px; }
.readout-wide strong { display: inline-block; margin-right: 6px; }
.readout-wide em { display: inline-block; }
.validation-card { margin-top: 12px; padding: 10px; border: 1px solid rgba(108,200,174,.2); background: rgba(22,72,65,.14); border-radius: 8px; }
.validation-top { display: flex; align-items: center; gap: 8px; }
.validation-icon { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; color: #8be0c2; background: rgba(93,197,156,.14); font-size: 12px; }
.validation-top b { display: block; color: #d0e8df; font-size: 9px; }
.validation-top small { display: block; color: #719c91; font-size: 7px; margin-top: 2px; letter-spacing: .08em; }
.validation-tag { margin-left: auto; color: #87d7bd; font-size: 7px; letter-spacing: .1em; border: 1px solid rgba(135,215,189,.22); border-radius: 4px; padding: 4px 6px; }
.validation-values { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; padding: 9px 0 7px; margin-top: 8px; border-top: 1px solid rgba(135,215,189,.12); }
.validation-values small { display: block; color: #72958e; font-size: 6px; letter-spacing: .1em; }
.validation-values b { display: block; color: #c3e8dc; font-size: 10px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.validation-card p { margin: 0; color: #78958d; font-size: 7px; line-height: 1.45; }
.quality-row { display: flex; justify-content: space-between; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.quality-row .section-label { display: block; }
.quality-row small { display: block; color: #607d8c; font-size: 6px; letter-spacing: .09em; margin-top: 4px; }
.segmented-control { display: flex; gap: 2px; padding: 3px; border-radius: 7px; border: 1px solid rgba(126,167,185,.15); background: rgba(2,14,23,.45); }
.segmented-control button { border: 0; background: transparent; color: #7794a3; font-size: 8px; border-radius: 4px; padding: 5px 10px; cursor: pointer; }
.segmented-control button.selected { background: #245064; color: #c7eff4; }
.science-panel { border-bottom: 1px solid var(--line); }
.science-panel summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 13px 0 12px; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary b { display: block; color: #d2e4e9; font-size: 10px; }
.science-panel summary small { display: block; color: #698595; font-size: 7px; margin-top: 3px; }
.science-chevron { color: #80c8d8; font-size: 16px; transition: transform .2s; }
.science-panel[open] .science-chevron { transform: rotate(180deg); }
.science-content { padding: 0 0 13px; }
.science-content h3 { margin: 12px 0 5px; color: #a8dbe4; font-size: 8px; letter-spacing: .04em; }
.science-content p { margin: 5px 0 9px; color: #829ba7; font-size: 8px; line-height: 1.55; }
.equation { border: 1px solid rgba(104,193,212,.14); background: rgba(4,17,27,.5); color: #d6f2f5; padding: 8px 9px; border-radius: 5px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; line-height: 1.7; }
.science-note { border-left: 2px solid rgba(106,216,237,.45); padding: 7px 8px; margin-top: 8px; background: rgba(39,103,120,.08); color: #7896a3; font-size: 7px; line-height: 1.55; }
.science-note b { color: #b7dbe2; }
.textbook-note { margin-top: 9px; color: #8eb5c1; font-size: 7px; line-height: 1.5; }
.footer { display: flex; justify-content: space-between; gap: 12px; padding: 16px 2px 0; color: #567181; font-size: 7px; letter-spacing: .12em; }
.footer b { color: #75cde0; padding: 0 4px; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid #7be4f0; outline-offset: 3px; }
.embed .topbar, .embed .intro-row, .embed .footer { display: none; }
.embed .app-shell { padding: 0; }
.embed .workspace { grid-template-columns: minmax(0, 1fr) 350px; gap: 8px; }
.embed .scene-frame { border-radius: 8px; }
@media (min-width: 1500px) { .workspace { grid-template-columns: minmax(0, 1fr) 390px; } .control-panel { padding: 18px; } }
@media (max-width: 1100px) { .app-shell { padding: 0 18px 16px; } .workspace { grid-template-columns: minmax(0,1fr) 340px; gap: 10px; } .scene-frame { height: 570px; } .playback-bar { flex-wrap: wrap; } .playback-tools { justify-content: space-between; width: 100%; } }
@media (max-width: 820px) {
  .app-shell { padding: 0 12px 14px; }
  .topbar { height: 60px; }
  .topbar-meta .edition { display: none; }
  .intro-row { padding: 18px 0 14px; }
  .model-stamp { display: none; }
  .workspace { grid-template-columns: 1fr; }
  .scene-frame { height: min(66vw, 540px); min-height: 360px; }
  .control-panel { max-height: none; overflow: visible; }
  .preset-grid { grid-template-columns: repeat(3,1fr); }
  .preset-button { align-items: flex-start; flex-direction: column; gap: 5px; min-height: 78px; }
  .preset-button b { font-size: 8px; }
  .scene-legend { max-width: 75%; gap: 8px; }
  .scene-footnote { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .brand-name { font-size: 10px; }
  .brand-subtitle { font-size: 7px; }
  .field-chip { font-size: 7px; padding: 7px 8px; }
  h1 { font-size: 25px; line-height: 1.08; }
  .intro-copy { font-size: 10px; }
  .scene-frame { min-height: 390px; height: 112vw; max-height: 500px; }
  .scene-headline { top: 12px; left: 12px; right: 12px; font-size: 7px; }
  .scene-headline-right { gap: 6px; }
  .webgl-pill { padding: 5px 6px; }
  .scene-tag { font-size: 6px; padding: 4px 5px; }
  .scene-axis { left: 11px; bottom: 54px; font-size: 6px; }
  .scene-legend { left: 11px; bottom: 11px; max-width: 80%; font-size: 6px; gap: 7px 9px; }
  .scene-bottom-right { right: 10px; bottom: 12px; font-size: 6px; }
  .scene-status { top: 43px; right: 10px; font-size: 7px; }
  .playback-bar { padding: 8px; gap: 7px; }
  .playback-actions { width: 100%; gap: 6px; }
  .playback-tools { gap: 6px; flex-wrap: wrap; }
  .primary-button, .icon-button { min-height: 32px; padding: 0 9px; font-size: 9px; }
  .elapsed-label { font-size: 8px; }
  .speed-control { flex: 1; }
  .speed-control input { flex: 1; min-width: 55px; }
  .small-tool { min-height: 30px; }
  .scene-footnote { font-size: 6px; gap: 5px; }
  .control-panel { padding: 13px; }
  .preset-button { min-height: 75px; padding: 7px; }
  .preset-icon { width: 23px; height: 23px; flex-basis: 23px; }
  .preset-button small { font-size: 7px; line-height: 1.3; }
  .control-name { font-size: 8px; }
  .readout-card strong { font-size: 18px; }
  .footer { flex-direction: column; font-size: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ms-fix-045: single column in narrow embed frames */
@media (max-width: 900px){.embed-mode .workspace{grid-template-columns:minmax(0,1fr)}}
