:root {
  color-scheme: dark;
  --bg: #07131d;
  --panel: #0c1b27;
  --panel-2: #102331;
  --line: rgba(159, 202, 220, .13);
  --muted: #7894a5;
  --text: #e5f3f8;
  --cyan: #79e5ef;
  --blue: #69aee8;
  --ice: #c6f2f7;
  --amber: #e6c58a;
  --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 { min-width: 320px; background: var(--bg); }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--text); background: radial-gradient(ellipse at 36% -20%, #143348 0, transparent 48%), var(--bg); }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { max-width: 1720px; margin: 0 auto; padding: 0 28px 20px; }
.topbar { height: 68px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 220px; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(121,229,239,.45); border-radius: 10px; color: var(--cyan); font-size: 19px; font-weight: 800; letter-spacing: -2px; }
.brand-mark span { color: #e9fcff; }
.brand-copy { display: flex; flex-direction: column; gap: 3px; line-height: 1; }
.brand-copy strong { font-size: 11px; letter-spacing: 1.7px; }
.brand-copy strong span, .global-footer span span { color: var(--cyan); }
.brand-copy small { font-size: 8px; letter-spacing: 1.45px; color: var(--muted); }
.topbar-center { display: flex; align-items: center; gap: 10px; color: #9bb4c2; font-size: 9px; font-weight: 700; letter-spacing: 1.35px; }
.topbar-center i, .global-footer i { width: 3px; height: 3px; display: inline-block; border-radius: 50%; background: var(--cyan); }
.live-dot, .hud-dot { width: 6px; height: 6px; border-radius: 50%; background: #69e2c0; box-shadow: 0 0 12px rgba(105,226,192,.6); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.model-chip { padding: 7px 10px; border: 1px solid rgba(230,197,138,.24); border-radius: 4px; color: var(--amber); font-size: 8px; font-weight: 800; letter-spacing: 1.15px; }
.icon-button, .tool-button { display: grid; place-items: center; width: 34px; height: 34px; background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: 7px; color: #b7ced9; cursor: pointer; transition: .18s ease; }
.icon-button:hover, .tool-button:hover { border-color: rgba(121,229,239,.5); color: var(--cyan); background: rgba(121,229,239,.07); }
.main-layout { display: grid; grid-template-columns: minmax(0, 1fr) 368px; gap: 22px; padding-top: 22px; align-items: start; }
.scene-column { min-width: 0; }
.scene-heading { display: flex; justify-content: space-between; align-items: flex-end; padding: 0 2px 16px; }
.eyebrow { color: var(--cyan); font-size: 8px; font-weight: 800; letter-spacing: 1.75px; margin-bottom: 7px; }
h1 { margin: 0; font-size: clamp(27px, 3vw, 38px); line-height: 1.06; letter-spacing: -1.55px; font-weight: 650; }
h1 span { color: #8bb7c8; font-weight: 400; }
.subtitle { margin: 8px 0 0; color: #92aab8; font-size: 12px; line-height: 1.5; }
.scene-index { text-align: right; color: #7c99a9; padding-bottom: 2px; }
.scene-index b { color: var(--cyan); font-size: 20px; font-weight: 500; }
.scene-index span { font-size: 12px; }
.scene-index small { display: block; margin-top: 3px; font-size: 8px; letter-spacing: 1.25px; }
.scene-frame { position: relative; height: clamp(390px, 51vw, 600px); min-height: 390px; overflow: hidden; border: 1px solid rgba(126,193,215,.19); border-radius: 12px; background: radial-gradient(ellipse at 52% 44%, #163e53 0, #0b2434 40%, #07131d 82%); box-shadow: 0 24px 70px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.035); isolation: isolate; }
.scene-mount { position: absolute; inset: 0; z-index: 1; }
.scene-mount canvas { width: 100%; height: 100%; display: block; outline: none; }
.scene-vignette { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(180deg, rgba(4,15,23,.42), transparent 18%, transparent 76%, rgba(3,13,20,.5)), radial-gradient(ellipse at center, transparent 48%, rgba(2,10,17,.42)); }
.scene-hud { position: absolute; z-index: 3; top: 14px; display: flex; gap: 8px; }
.scene-hud-top { left: 14px; }
.hud-pill { display: flex; align-items: center; gap: 7px; padding: 7px 9px; border: 1px solid rgba(169,216,232,.18); border-radius: 4px; background: rgba(5,20,30,.56); backdrop-filter: blur(8px); color: #b8d3df; font-size: 8px; font-weight: 800; letter-spacing: 1.05px; }
.hud-dot { width: 5px; height: 5px; }
.hud-dot.cyan { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.hud-dot.blue { background: var(--blue); }
.annotation { position: absolute; z-index: 4; display: flex; align-items: center; gap: 6px; color: rgba(198,231,241,.8); font-size: 8px; font-weight: 800; letter-spacing: 1.1px; pointer-events: none; text-shadow: 0 1px 8px #00101a; }
.annotation b { color: var(--cyan); font-size: 9px; }
.annotation-line { display: inline-block; width: 25px; height: 1px; background: rgba(121,229,239,.72); }
.annotation-top { top: 17%; left: 14%; }
.annotation-mid { top: 43%; right: 12%; flex-direction: row-reverse; }
.annotation-plume { top: 65%; left: 12%; }
.annotation-bottom { bottom: 14%; right: 10%; flex-direction: row-reverse; }
.scene-legend { position: absolute; z-index: 3; top: 14px; right: 14px; display: flex; gap: 12px; padding: 8px 10px; background: rgba(5,20,30,.56); border: 1px solid rgba(169,216,232,.14); border-radius: 4px; color: #a6c1cf; font-size: 7px; font-weight: 800; letter-spacing: .9px; }
.scene-legend span { display: flex; align-items: center; gap: 5px; }
.scene-legend i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.legend-ice { background: #c6f2f7; box-shadow: 0 0 8px #9ee9f3; }
.legend-brine { background: #49c9d8; }
.legend-water { background: #235b83; }
.scene-footer { position: absolute; z-index: 3; left: 14px; right: 14px; bottom: 12px; display: flex; justify-content: space-between; align-items: center; color: #83a0af; font-size: 7px; font-weight: 800; letter-spacing: 1px; }
kbd { display: inline-block; padding: 3px 5px; border: 1px solid rgba(154,198,216,.22); border-radius: 3px; background: rgba(9,28,40,.78); color: #b6d0dc; font-size: 7px; font-weight: 700; margin-right: 3px; }
.scene-coordinates { color: #9cb7c5; }
.scene-coordinates i { color: var(--cyan); font-style: normal; margin: 0 4px; }
.scene-loading, .scene-error { position: absolute; z-index: 5; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px; background: rgba(5,18,28,.94); color: #a6c1cf; font-size: 9px; font-weight: 800; letter-spacing: 1.5px; }
.scene-loading[hidden], .scene-error[hidden] { display: none; }
.loader-ring { width: 27px; height: 27px; border: 2px solid rgba(121,229,239,.17); border-top-color: var(--cyan); border-radius: 50%; animation: spin .9s linear infinite; }
.scene-error { text-align: center; padding: 25px; gap: 9px; }
.scene-error strong { color: #e5f3f8; font-size: 14px; letter-spacing: 0; }
.scene-error span { max-width: 380px; color: #91aab8; font-size: 11px; line-height: 1.6; font-weight: 400; letter-spacing: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.scene-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 2px 14px; }
.transport-controls { display: flex; align-items: center; gap: 7px; }
.primary-control { height: 34px; display: flex; align-items: center; gap: 9px; padding: 0 14px; border: 1px solid rgba(121,229,239,.5); border-radius: 6px; background: linear-gradient(135deg, rgba(63,171,190,.24), rgba(35,100,131,.19)); color: #d9fbff; font-size: 9px; font-weight: 800; letter-spacing: 1px; cursor: pointer; }
.primary-control:hover { background: rgba(121,229,239,.2); }
.play-glyph { color: var(--cyan); font-size: 10px; }
.toolbar-divider { height: 20px; width: 1px; margin: 0 4px; background: var(--line); }
.quality-control { display: flex; align-items: center; gap: 4px; color: #6e8999; font-size: 8px; font-weight: 800; letter-spacing: 1px; }
.quality-control > span { margin-right: 4px; }
.quality-toggle { padding: 6px 8px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: #7894a5; font-size: 8px; font-weight: 800; cursor: pointer; }
.quality-toggle.active { color: var(--cyan); border-color: rgba(121,229,239,.2); background: rgba(121,229,239,.07); }
.readout-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.readout-card { min-width: 0; padding: 12px 12px 11px; border: 1px solid var(--line); border-radius: 7px; background: linear-gradient(140deg, rgba(17,42,57,.85), rgba(9,27,40,.84)); }
.readout-label { display: block; white-space: nowrap; color: #83a1b1; font-size: 7px; font-weight: 800; letter-spacing: 1px; }
.readout-label i { color: #5f8799; font-style: normal; font-weight: 600; }
.readout-card strong { display: block; margin-top: 7px; color: #e6f7fb; font-size: 22px; line-height: 1.1; font-weight: 600; letter-spacing: -.65px; font-variant-numeric: tabular-nums; }
.readout-card strong small { color: #8caebe; font-size: 10px; font-weight: 500; letter-spacing: 0; }
.readout-foot { display: block; margin-top: 6px; color: #6f8c9c; font-size: 8px; }
.validation-strip { display: flex; align-items: center; gap: 10px; margin-top: 9px; padding: 10px 12px; border: 1px solid rgba(121,229,239,.16); border-radius: 7px; background: rgba(13,38,51,.64); }
.validation-icon { width: 22px; height: 22px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(105,226,192,.38); border-radius: 50%; color: #70e3c0; font-size: 12px; }
.validation-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.validation-copy b { color: #c9e4ec; font-size: 8px; letter-spacing: 1px; }
.validation-copy b span { color: #70e3c0; }
.validation-copy small { color: #7895a5; font-size: 8px; }
.validation-values { margin-left: auto; display: flex; align-items: flex-end; flex-direction: column; gap: 2px; white-space: nowrap; }
.validation-values strong { color: #e3f7fb; font-size: 12px; font-variant-numeric: tabular-nums; }
.validation-values span { color: #8ba5b3; font-size: 8px; }
.validation-values em { color: #70e3c0; font-size: 8px; font-style: normal; }
.control-column { padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(160deg, rgba(15,35,49,.96), rgba(9,24,35,.97)); box-shadow: 0 18px 50px rgba(0,0,0,.13); }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.panel-header .eyebrow { margin-bottom: 5px; }
h2 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -.5px; }
.panel-number { color: #6b8999; font-size: 18px; font-weight: 400; }
.section-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; color: #a5bfcb; font-size: 8px; font-weight: 800; letter-spacing: 1.1px; }
.section-label span { color: #668597; font-size: 7px; font-weight: 600; letter-spacing: .7px; }
.preset-block { padding: 16px 0 14px; border-bottom: 1px solid var(--line); }
.preset-grid { display: grid; grid-template-columns: 1fr; gap: 6px; }
.preset-button { display: grid; grid-template-columns: 24px 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 8px; padding: 8px 9px; border: 1px solid rgba(159,202,220,.12); border-radius: 6px; background: rgba(255,255,255,.018); text-align: left; cursor: pointer; transition: .18s ease; }
.preset-button:hover { border-color: rgba(121,229,239,.3); }
.preset-button.active { border-color: rgba(121,229,239,.43); background: rgba(67,166,188,.105); }
.preset-icon { grid-row: 1 / span 2; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 5px; background: rgba(121,229,239,.1); color: var(--cyan); font-size: 13px; }
.preset-button b { color: #d8ebf1; font-size: 9px; font-weight: 700; }
.preset-button small { margin-top: 2px; color: #7693a3; font-size: 8px; }
.controls-block { padding: 15px 0 3px; }
.control-row { margin-bottom: 13px; }
.control-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 7px; }
.control-title label { color: #c1d5de; font-size: 9px; font-weight: 600; }
.control-title output { color: var(--cyan); font-size: 9px; font-weight: 700; font-variant-numeric: tabular-nums; }
input[type="range"] { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 14px; margin: 0; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, #4babbc, #28617a); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, #4babbc, #28617a); }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border: 2px solid #d6fbff; border-radius: 50%; background: #4baec0; box-shadow: 0 0 0 3px rgba(121,229,239,.12), 0 0 10px rgba(121,229,239,.35); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #d6fbff; border-radius: 50%; background: #4baec0; box-shadow: 0 0 0 3px rgba(121,229,239,.12); }
input[type="range"]:focus-visible { outline: 1px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }
.range-ends { display: flex; justify-content: space-between; color: #5f7d8e; font-size: 7px; margin-top: 2px; }
.speed-row { margin-top: 4px; padding-top: 11px; border-top: 1px solid var(--line); }
.panel-note { display: flex; align-items: flex-start; gap: 8px; padding: 9px 10px; border-radius: 6px; background: rgba(121,229,239,.055); }
.note-icon { flex: 0 0 auto; width: 15px; height: 15px; display: grid; place-items: center; border: 1px solid rgba(121,229,239,.32); border-radius: 50%; color: var(--cyan); font-size: 9px; font-weight: 700; }
.panel-note p { margin: 0; color: #89a5b4; font-size: 8px; line-height: 1.55; }
.science-panel { margin-top: 12px; border: 1px solid rgba(159,202,220,.13); border-radius: 6px; background: rgba(255,255,255,.015); }
.science-panel summary { display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; cursor: pointer; list-style: none; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary > span:first-child { display: flex; flex-direction: column; gap: 4px; }
.science-panel summary b { color: #cfe5ed; font-size: 9px; letter-spacing: 1.1px; }
.science-panel summary small { color: #6d8b9c; font-size: 7px; letter-spacing: .8px; }
.details-chevron { color: var(--cyan); font-size: 16px; transition: transform .2s ease; }
.science-panel[open] .details-chevron { transform: rotate(180deg); }
.science-content { padding: 0 12px 13px; color: #91aab7; font-size: 9px; line-height: 1.6; }
.science-content h3 { margin: 12px 0 5px; color: #c9e0e8; font-size: 9px; font-weight: 700; }
.science-content p { margin: 4px 0 7px; }
.equation { margin: 7px 0 9px; padding: 8px 9px; overflow-x: auto; border-left: 2px solid rgba(121,229,239,.55); background: rgba(121,229,239,.055); color: #b9edf2; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; white-space: nowrap; }
.science-content ul { margin: 6px 0 8px; padding-left: 16px; }
.science-content li { margin: 4px 0; }
.science-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 9px 0; }
.science-tags span { padding: 4px 6px; border: 1px solid rgba(121,229,239,.18); border-radius: 3px; color: #85cbd5; font-size: 7px; font-weight: 800; letter-spacing: .6px; }
.science-caveat { margin-top: 10px !important; padding-top: 9px; border-top: 1px solid var(--line); color: #b7cdd7; font-size: 8px; }
.panel-footer { display: flex; justify-content: space-between; margin-top: 13px; color: #567486; font-size: 7px; font-weight: 700; letter-spacing: 1px; }
.global-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 19px; padding-top: 13px; border-top: 1px solid var(--line); color: #5f7e8f; font-size: 7px; font-weight: 700; letter-spacing: 1.1px; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 20px; transform: translate(-50%, 16px); padding: 9px 13px; border: 1px solid rgba(121,229,239,.25); border-radius: 6px; background: rgba(8,27,39,.95); color: #c7edf3; font-size: 10px; opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.help-dialog { width: min(420px, calc(100% - 28px)); padding: 24px; border: 1px solid rgba(121,229,239,.25); border-radius: 10px; background: #0d2230; color: var(--text); box-shadow: 0 30px 100px rgba(0,0,0,.5); }
.help-dialog::backdrop { background: rgba(0,8,14,.7); backdrop-filter: blur(5px); }
.help-dialog h2 { margin-bottom: 17px; }
.dialog-close { float: right; border: 0; background: transparent; color: #9bb8c6; font-size: 22px; cursor: pointer; }
.shortcut-list { display: grid; gap: 11px; color: #a4bfcb; font-size: 10px; }
.shortcut-list kbd { min-width: 55px; text-align: center; margin-right: 8px; }
@media (min-width: 1500px) { .main-layout { grid-template-columns: minmax(0, 1fr) 400px; gap: 26px; } .scene-frame { height: 620px; } }
@media (max-width: 1100px) { .app-shell { padding: 0 18px 18px; } .main-layout { grid-template-columns: minmax(0, 1fr) 330px; gap: 14px; } .control-column { padding: 14px; } .scene-frame { height: 470px; } .annotation { font-size: 7px; } }
@media (max-width: 850px) { .main-layout { grid-template-columns: 1fr; } .scene-frame { height: min(62vw, 540px); min-height: 390px; } .control-column { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; } .panel-header, .panel-note, .science-panel, .panel-footer { grid-column: 1 / -1; } .preset-block { border-bottom: 0; } .preset-grid { grid-template-columns: 1fr; } .controls-block { padding-top: 16px; } }
@media (max-width: 560px) {
  .app-shell { padding: 0 12px 14px; }
  .topbar { height: 58px; }
  .brand { min-width: auto; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-copy strong { font-size: 9px; }
  .brand-copy small { font-size: 7px; }
  .topbar-center { display: none; }
  .model-chip { font-size: 7px; padding: 6px 7px; }
  .icon-button { width: 30px; height: 30px; }
  .main-layout { padding-top: 16px; }
  .scene-heading { padding-bottom: 12px; }
  h1 { font-size: 29px; }
  .subtitle { max-width: 280px; font-size: 10px; }
  .scene-index { display: none; }
  .scene-frame { min-height: 410px; height: 118vw; max-height: 550px; border-radius: 8px; }
  .scene-legend { top: auto; right: 9px; bottom: 39px; gap: 8px; padding: 6px 7px; font-size: 6px; }
  .scene-hud { top: 9px; }
  .scene-hud-top { left: 9px; }
  .hud-pill { padding: 6px 7px; font-size: 7px; }
  .annotation { font-size: 6px; letter-spacing: .7px; }
  .annotation-line { width: 15px; }
  .annotation-top { left: 8%; top: 18%; }
  .annotation-mid { right: 5%; top: 43%; }
  .annotation-plume { left: 5%; top: 66%; }
  .annotation-bottom { right: 5%; bottom: 19%; }
  .scene-footer { left: 9px; right: 9px; bottom: 9px; font-size: 6px; }
  .scene-coordinates { display: none; }
  .scene-toolbar { padding: 10px 0 12px; }
  .primary-control { height: 32px; padding: 0 11px; }
  .tool-button { width: 31px; height: 32px; }
  .quality-control { gap: 1px; }
  .quality-toggle { padding: 6px 5px; font-size: 7px; }
  .readout-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; }
  .readout-card { padding: 10px; }
  .readout-card strong { font-size: 20px; }
  .validation-strip { align-items: flex-start; gap: 8px; padding: 9px; }
  .validation-copy small { max-width: 175px; line-height: 1.4; }
  .validation-values strong { font-size: 10px; }
  .validation-values span, .validation-values em { font-size: 7px; }
  .control-column { display: block; padding: 14px; }
  .preset-grid { grid-template-columns: 1fr 1fr 1fr; gap: 5px; }
  .preset-button { grid-template-columns: 1fr; grid-template-rows: 20px auto auto; padding: 7px 6px; gap: 3px; }
  .preset-icon { grid-row: auto; width: 19px; height: 19px; }
  .preset-button b { font-size: 8px; }
  .preset-button small { font-size: 7px; line-height: 1.35; }
  .controls-block { padding-top: 15px; }
  .control-row { margin-bottom: 14px; }
  .global-footer { font-size: 6px; letter-spacing: .6px; }
  .global-footer span:nth-child(2) { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
body.embed .topbar, body.embed .global-footer { display: none; }
body.embed .app-shell { padding-top: 8px; }
body.embed .main-layout { padding-top: 0; }
body.embed .scene-heading { padding-top: 6px; }
