:root {
  color-scheme: dark;
  --bg: #07131c;
  --panel: #0c1c27;
  --panel-2: #102430;
  --panel-3: #142d39;
  --line: rgba(172, 207, 216, .13);
  --line-strong: rgba(172, 207, 216, .22);
  --text: #e5f0ef;
  --muted: #8ba5aa;
  --faint: #5f7c84;
  --cyan: #7de0d1;
  --cyan-2: #38b8ae;
  --gold: #e9c68a;
  --red: #e28d7e;
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { 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; }
.app-shell { min-height: 100vh; background: radial-gradient(ellipse at 50% -30%, #16303c 0, #091720 42%, #07131c 100%); }
.topbar { height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(7, 19, 28, .82); }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 240px; }
.brand-mark { width: 30px; height: 30px; border: 1px solid rgba(125,224,209,.45); border-radius: 8px; display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding: 6px; transform: rotate(-2deg); }
.brand-mark span { display: block; width: 4px; border-radius: 5px; background: var(--cyan); }
.brand-mark span:nth-child(1) { height: 7px; opacity: .5; }
.brand-mark span:nth-child(2) { height: 13px; }
.brand-mark span:nth-child(3) { height: 9px; opacity: .72; }
.eyebrow, .panel-kicker, .scene-kicker { color: var(--faint); font-size: 9px; font-weight: 800; letter-spacing: .17em; }
.brand-title { margin-top: 2px; font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.topbar-center { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 9px; letter-spacing: .16em; font-weight: 700; }
.live-dot, .regime-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px rgba(125,224,209,.55); }
.topbar-right { min-width: 240px; display: flex; justify-content: flex-end; align-items: center; gap: 20px; }
.version-chip { border: 1px solid var(--line-strong); color: #a5c4c8; border-radius: 5px; padding: 6px 8px; font-size: 9px; letter-spacing: .1em; }
.keyboard-hint { color: var(--cyan); font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.keyboard-hint span { color: var(--faint); font-weight: 600; margin-left: 5px; }
.workspace { max-width: 1800px; margin: 0 auto; padding: 20px 22px 28px; display: grid; grid-template-columns: minmax(0, 1fr) 374px; gap: 18px; align-items: start; }
.visual-column { min-width: 0; }
.scene-shell { position: relative; height: clamp(500px, calc(100vh - 185px), 820px); min-height: 500px; overflow: hidden; border: 1px solid rgba(127, 190, 195, .2); border-radius: 14px; background: linear-gradient(145deg, #102d3b, #07131d 70%); box-shadow: 0 22px 70px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.035); }
#sceneCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
.scene-vignette { pointer-events: none; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5,16,24,.78) 0%, rgba(5,16,24,.16) 23%, transparent 44%, transparent 75%, rgba(5,16,24,.5) 100%), linear-gradient(90deg, rgba(5,16,24,.25), transparent 26%, transparent 78%, rgba(5,16,24,.22)); }
.scene-topline { position: absolute; top: 23px; left: 25px; right: 25px; display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; pointer-events: none; }
.scene-title-block h1 { margin: 7px 0 1px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(34px, 4vw, 52px); line-height: .98; font-weight: 500; letter-spacing: -.035em; }
.scene-title-block p { margin: 7px 0 0; color: #aac2c4; font-size: 12px; letter-spacing: .015em; }
.regime-badge { display: flex; align-items: center; gap: 8px; margin-top: 2px; padding: 9px 11px; border: 1px solid rgba(125,224,209,.26); border-radius: 7px; color: var(--cyan); background: rgba(8,30,38,.66); font-size: 9px; font-weight: 800; letter-spacing: .12em; backdrop-filter: blur(12px); }
.regime-badge.subcritical { color: var(--gold); border-color: rgba(233,198,138,.28); }
.regime-badge.near { color: #d8c4a1; border-color: rgba(216,196,161,.28); }
.scene-stats { position: absolute; left: 24px; right: 24px; top: 118px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; pointer-events: none; }
.stat-card { min-width: 0; padding: 10px 12px 9px; border: 1px solid rgba(166,207,209,.13); border-radius: 8px; background: rgba(7,23,32,.64); backdrop-filter: blur(12px); }
.stat-label { display: block; color: #89a7ad; font-size: 8px; font-weight: 800; letter-spacing: .12em; white-space: nowrap; }
.stat-card strong { display: block; margin-top: 6px; color: #eff8f4; font-size: clamp(14px, 1.5vw, 20px); font-weight: 650; letter-spacing: -.035em; white-space: nowrap; }
.stat-note { display: block; margin-top: 2px; color: #76939a; font-size: 9px; }
.scene-annotations { position: absolute; inset: 0; pointer-events: none; }
.annotation { position: absolute; display: flex; flex-direction: column; gap: 6px; color: rgba(207,235,230,.8); font-size: 8px; font-weight: 800; letter-spacing: .13em; text-shadow: 0 2px 5px rgba(0,0,0,.7); }
.annotation-line { display: block; height: 1px; width: 55px; background: rgba(125,224,209,.65); box-shadow: 0 0 8px rgba(125,224,209,.35); }
.annotation-a { left: 58%; top: 47%; }
.annotation-b { left: 23%; top: 68%; }
.annotation-b .annotation-line { width: 76px; background: rgba(233,198,138,.7); }
.flow-direction { position: absolute; left: 50%; bottom: 56px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid rgba(125,224,209,.22); border-radius: 5px; background: rgba(7,23,32,.55); color: #9bb6b9; font-size: 8px; font-weight: 800; letter-spacing: .14em; white-space: nowrap; }
.flow-arrow { color: var(--cyan); font-size: 20px; line-height: 10px; }
.scene-bottomline { position: absolute; bottom: 18px; left: 24px; right: 24px; display: flex; justify-content: space-between; align-items: center; gap: 10px; color: #87a3a8; font-size: 8px; font-weight: 700; letter-spacing: .11em; pointer-events: none; }
.scene-legend { display: flex; align-items: center; gap: 7px; }
.legend-water, .legend-bed, .legend-particle { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-left: 8px; }
.legend-water { background: #65c8c7; box-shadow: 0 0 8px rgba(101,200,199,.6); }
.legend-bed { background: #c5a879; }
.legend-particle { background: #f2d69c; }
.scene-scale strong { color: #c4dbd8; }
.webgl-message { position: absolute; z-index: 5; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 10px; padding: 28px; text-align: center; background: rgba(5,15,22,.92); color: var(--text); }
.webgl-message strong { font-family: Georgia, serif; font-size: 26px; font-weight: 500; }
.webgl-message span { max-width: 420px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.transport-bar { min-height: 60px; margin-top: 10px; padding: 9px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(12,28,39,.9); }
.transport-left, .transport-right { display: flex; align-items: center; gap: 8px; }
.primary-button, .icon-button { height: 36px; min-width: 36px; border: 1px solid var(--line-strong); border-radius: 7px; background: #122936; cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.primary-button { display: flex; align-items: center; gap: 8px; padding: 0 13px; border-color: rgba(125,224,209,.42); background: rgba(36,124,117,.24); color: #bdf5e9; font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.primary-button:hover, .icon-button:hover { border-color: rgba(125,224,209,.65); background: #1a3b48; }
.primary-button:active, .icon-button:active { transform: translateY(1px); }
.play-icon { font-size: 13px; }
.icon-button { color: #a9c3c5; font-size: 17px; }
.transport-divider { width: 1px; height: 26px; margin: 0 4px; background: var(--line-strong); }
.speed-control { display: flex; align-items: center; gap: 3px; }
.control-caption, .clock-label { margin-right: 5px; color: var(--faint); font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.speed-control button { border: 0; border-radius: 5px; background: transparent; padding: 7px 8px; color: #78949b; cursor: pointer; font-size: 10px; }
.speed-control button.selected { color: var(--cyan); background: rgba(125,224,209,.12); }
.transport-right { gap: 10px; }
.transport-right strong { min-width: 56px; color: #d6e7e4; font-variant-numeric: tabular-nums; font-size: 12px; }
.camera-button, .export-button { margin-left: 3px; }
.exhibit-caption { display: flex; align-items: center; gap: 14px; padding: 13px 3px 0; color: #8ca6aa; }
.caption-mark { color: var(--cyan); font-size: 9px; font-weight: 800; letter-spacing: .1em; white-space: nowrap; }
.exhibit-caption p { margin: 0; font-size: 10px; line-height: 1.55; }
.exhibit-caption p strong { color: #c9dcda; font-weight: 700; }
.drag-hint { margin-left: auto; color: #6f8c92; font-size: 8px; font-weight: 800; letter-spacing: .1em; white-space: nowrap; }
.orbit-icon { margin-right: 5px; color: var(--cyan); font-size: 13px; vertical-align: -1px; }
.control-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(180deg, rgba(14,33,44,.98), rgba(9,24,33,.98)); box-shadow: 0 18px 55px rgba(0,0,0,.16); }
.panel-section { padding: 17px 17px 16px; border-bottom: 1px solid var(--line); }
.panel-heading-row, .validation-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.panel-heading-row h2, .validation-heading h2 { margin: 4px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 20px; font-weight: 500; letter-spacing: -.02em; }
.section-index { color: #5b7a82; font-size: 10px; font-weight: 800; }
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 13px; }
.preset-button { min-width: 0; min-height: 63px; display: flex; align-items: center; gap: 7px; padding: 8px 7px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.015); text-align: left; cursor: pointer; transition: border-color .18s ease, background .18s ease; }
.preset-button:hover { border-color: var(--line-strong); background: rgba(255,255,255,.04); }
.preset-button.active { border-color: rgba(125,224,209,.48); background: rgba(52,142,132,.13); }
.preset-glyph { flex: 0 0 22px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 5px; background: rgba(125,224,209,.1); color: var(--cyan); font-size: 16px; }
.preset-button strong { display: block; overflow: hidden; color: #d4e3e1; font-size: 9px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.preset-button small { display: block; margin-top: 4px; color: #77939a; font-size: 8px; white-space: nowrap; }
.text-button { border: 0; padding: 5px 0; background: none; color: var(--cyan); cursor: pointer; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.parameter-list { display: grid; gap: 13px; margin-top: 15px; }
.parameter { display: block; cursor: pointer; }
.parameter-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; color: #b4c9c9; font-size: 10px; }
.parameter-top strong { color: #e1efeb; font-size: 11px; font-variant-numeric: tabular-nums; }
.parameter-top strong small { color: #829da1; font-size: 9px; font-weight: 500; }
.parameter input[type="range"] { display: block; width: 100%; height: 4px; margin: 10px 0 6px; appearance: none; border-radius: 8px; outline: none; background: linear-gradient(90deg, var(--cyan-2) 0%, var(--cyan-2) var(--range-progress, 50%), #29434d var(--range-progress, 50%), #29434d 100%); cursor: pointer; }
.parameter input[type="range"]::-webkit-slider-thumb { width: 12px; height: 12px; appearance: none; border: 2px solid #b8f5e8; border-radius: 50%; background: #1c827a; box-shadow: 0 0 0 3px rgba(125,224,209,.12); }
.parameter input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #b8f5e8; border-radius: 50%; background: #1c827a; box-shadow: 0 0 0 3px rgba(125,224,209,.12); }
.range-ends { display: flex; justify-content: space-between; color: #617e86; font-size: 8px; }
.parameter-footnote { display: flex; align-items: flex-start; gap: 7px; margin-top: 13px; color: #718d93; font-size: 8px; line-height: 1.45; }
.info-mark { flex: 0 0 13px; width: 13px; height: 13px; display: grid; place-items: center; border: 1px solid rgba(125,224,209,.35); border-radius: 50%; color: var(--cyan); font-size: 8px; }
.view-section { padding-bottom: 14px; }
.view-controls { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.quality-switch { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: rgba(0,0,0,.12); }
.quality-switch button { min-width: 48px; padding: 6px 8px; border: 0; border-radius: 4px; background: transparent; color: #718d93; cursor: pointer; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.quality-switch button.selected { color: var(--cyan); background: rgba(125,224,209,.12); }
.view-note { color: #779198; font-size: 8px; }
.science-section { border-bottom: 1px solid var(--line); }
.science-section details { padding: 0 17px; }
.science-section summary { display: flex; align-items: center; justify-content: space-between; padding: 15px 0; list-style: none; cursor: pointer; }
.science-section summary::-webkit-details-marker { display: none; }
.science-section summary strong { display: block; margin-top: 3px; font-family: Georgia, serif; font-size: 18px; font-weight: 500; }
.details-plus { color: var(--cyan); font-size: 19px; transition: transform .2s ease; }
.science-section details[open] .details-plus { transform: rotate(45deg); }
.science-content { padding: 0 0 14px; }
.science-block { padding: 10px 0; border-top: 1px solid rgba(172,207,216,.08); }
.science-block h3 { margin: 0 0 7px; color: #c8dbd8; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.science-block p, .science-block li, .science-note p { color: #819ca1; font-size: 9px; line-height: 1.55; }
.science-block p { margin: 7px 0 0; }
.science-block ul { margin: 6px 0 0; padding-left: 16px; }
.science-block li { margin: 3px 0; }
.equation { padding: 8px 9px; border: 1px solid rgba(125,224,209,.13); border-radius: 5px; background: rgba(5,18,26,.45); color: #b7eee1; font-family: Georgia, serif; font-size: 13px; letter-spacing: .02em; text-align: center; }
.small-equation { font-size: 11px; }
.science-note { margin-top: 7px; padding: 9px; border-left: 2px solid rgba(233,198,138,.55); background: rgba(233,198,138,.045); }
.science-note strong { color: #ddc18e; font-size: 9px; }
.science-note p { margin: 4px 0 0; }
.validation-section { padding: 16px 17px 14px; }
.validation-heading h2 { font-size: 19px; }
.pass-chip { padding: 4px 6px; border: 1px solid rgba(125,224,209,.28); border-radius: 4px; color: var(--cyan); font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.validation-name { margin: 12px 0 9px; color: #8ba7aa; font-size: 9px; }
.validation-row { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid rgba(172,207,216,.07); color: #78949a; font-size: 9px; }
.validation-row strong { color: #c6dbd6; font-size: 9px; font-variant-numeric: tabular-nums; }
.validation-difference strong { color: var(--cyan); }
.validation-foot { margin: 9px 0 0; color: #607e86; font-size: 8px; line-height: 1.45; }
.panel-footer { display: flex; justify-content: space-between; gap: 8px; padding: 11px 17px; background: rgba(0,0,0,.12); color: #58747c; font-size: 7px; font-weight: 800; letter-spacing: .12em; }
.toast { position: fixed; z-index: 20; right: 22px; bottom: 22px; padding: 10px 14px; border: 1px solid rgba(125,224,209,.3); border-radius: 7px; background: #102b36; color: #c7eee5; box-shadow: 0 10px 35px rgba(0,0,0,.35); font-size: 10px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
@media (max-width: 1150px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 340px; padding: 16px; gap: 12px; }
  .control-panel { max-height: none; }
  .scene-shell { height: clamp(500px, calc(100vh - 170px), 760px); }
  .scene-stats { left: 16px; right: 16px; gap: 6px; }
  .stat-card { padding: 9px 8px; }
  .stat-label { font-size: 7px; }
  .preset-button { gap: 5px; padding: 7px 5px; }
  .preset-button strong { font-size: 8px; }
}
@media (max-width: 900px) {
  .topbar { padding: 0 16px; }
  .topbar-center, .keyboard-hint { display: none; }
  .topbar-right { min-width: auto; }
  .workspace { grid-template-columns: minmax(0, 1fr); max-width: 760px; padding: 14px; }
  .scene-shell { height: min(66vh, 650px); min-height: 460px; }
  .control-panel { display: grid; grid-template-columns: 1fr 1fr; }
  .presets-section, .parameter-section { grid-column: span 1; }
  .parameter-section { grid-row: span 2; }
  .view-section, .science-section, .validation-section, .panel-footer { grid-column: span 1; }
  .scene-stats { top: 116px; }
  .scene-annotations { display: none; }
}
@media (max-width: 620px) {
  .topbar { height: 56px; padding: 0 12px; }
  .brand-lockup { min-width: 0; gap: 9px; }
  .brand-mark { width: 27px; height: 27px; }
  .brand-title { font-size: 10px; }
  .eyebrow { font-size: 8px; }
  .version-chip { font-size: 7px; padding: 5px 6px; }
  .workspace { padding: 9px; gap: 10px; }
  .scene-shell { min-height: 470px; height: 58vh; max-height: 600px; border-radius: 10px; }
  .scene-topline { top: 17px; left: 15px; right: 15px; }
  .scene-title-block h1 { font-size: 36px; }
  .scene-title-block p { max-width: 190px; font-size: 10px; }
  .scene-kicker { font-size: 8px; }
  .regime-badge { padding: 7px; font-size: 7px; gap: 6px; }
  .regime-dot { width: 6px; height: 6px; }
  .scene-stats { top: 112px; left: 12px; right: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .stat-card { padding: 7px 9px 6px; border-radius: 6px; }
  .stat-label { font-size: 7px; }
  .stat-card strong { margin-top: 4px; font-size: 15px; }
  .stat-note { font-size: 8px; }
  .scene-bottomline { left: 12px; right: 12px; bottom: 12px; font-size: 6px; }
  .scene-legend { gap: 3px; }
  .legend-water, .legend-bed, .legend-particle { width: 6px; height: 6px; margin-left: 4px; }
  .scene-scale { white-space: nowrap; }
  .transport-bar { min-height: 54px; margin-top: 7px; padding: 7px; gap: 5px; }
  .transport-left, .transport-right { gap: 5px; }
  .primary-button { height: 34px; padding: 0 9px; font-size: 8px; }
  .icon-button { height: 34px; min-width: 32px; font-size: 15px; }
  .transport-divider { margin: 0 1px; }
  .control-caption, .clock-label { display: none; }
  .speed-control button { padding: 7px 5px; font-size: 9px; }
  .transport-right strong { min-width: 49px; font-size: 10px; }
  .exhibit-caption { align-items: flex-start; gap: 8px; padding-top: 10px; }
  .exhibit-caption p { font-size: 9px; }
  .drag-hint { display: none; }
  .control-panel { display: block; border-radius: 10px; }
  .panel-section { padding: 15px 14px; }
  .preset-grid { gap: 5px; }
  .preset-button { min-height: 58px; padding: 7px 5px; }
  .preset-glyph { flex-basis: 18px; width: 18px; height: 18px; font-size: 13px; }
  .preset-button strong { font-size: 8px; }
  .preset-button small { font-size: 7px; }
  .parameter-list { grid-template-columns: 1fr 1fr; column-gap: 14px; row-gap: 14px; }
  .parameter-top { font-size: 9px; }
  .parameter-top strong { font-size: 10px; }
  .parameter-footnote { font-size: 8px; }
  .view-controls { margin-top: 10px; }
  .science-section details { padding: 0 14px; }
  .validation-section { padding: 15px 14px; }
  .panel-footer { padding: 10px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
body.embed .topbar { display: none; }
body.embed .workspace { padding: 0; grid-template-columns: minmax(0, 1fr) 340px; gap: 0; }
body.embed .scene-shell { height: 100vh; min-height: 500px; border: 0; border-radius: 0; }
body.embed .transport-bar { margin: 0; border-radius: 0; }
body.embed .exhibit-caption { display: none; }
body.embed .control-panel { border-radius: 0; border-top: 0; border-right: 0; border-bottom: 0; }
@media (max-width: 900px) { body.embed .workspace { grid-template-columns: 1fr; } body.embed .scene-shell { height: 62vh; } }

.legal-note { max-width: 1800px; margin: -14px auto 0; padding: 0 22px 14px; color: #4f6d75; font-size: 8px; letter-spacing: .03em; text-align: right; }
@media (max-width: 620px) { .legal-note { margin-top: -3px; padding: 0 12px 12px; font-size: 7px; text-align: center; } }
body.embed .legal-note { display: none; }
