:root {
  color-scheme: dark;
  --bg: #101a20;
  --panel: #152229;
  --panel-soft: #1a2a31;
  --line: rgba(193, 211, 207, 0.13);
  --line-strong: rgba(193, 211, 207, 0.23);
  --text: #e8ece7;
  --muted: #91a29f;
  --dim: #617572;
  --accent: #c4a477;
  --accent-bright: #e2c394;
  --teal: #79b5ad;
  --danger: #d99b79;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: 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); font-family: var(--sans); }
body { min-height: 100vh; overflow-x: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100vh; background: radial-gradient(ellipse at 28% -18%, rgba(64, 93, 91, .22), transparent 43%), var(--bg); }
.topbar { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 26px; border-bottom: 1px solid var(--line); background: rgba(13, 23, 28, .92); gap: 18px; }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 240px; }
.brand-mark { width: 27px; height: 27px; position: relative; display: flex; align-items: center; justify-content: center; gap: 3px; border: 1px solid rgba(205, 177, 134, .48); border-radius: 50%; transform: rotate(-18deg); }
.brand-mark span { display: block; width: 3px; background: var(--accent); border-radius: 4px; }
.brand-mark span:nth-child(1) { height: 8px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 15px; }
.brand-mark span:nth-child(3) { height: 10px; opacity: .7; }
.brand-kicker, .eyebrow, .meta-label, .topbar-status, .topbar-center, .scene-chip, .scene-coordinates, .scene-legend, .drag-hint, .stage-footnote, .transport-bar, .readout-label, .readout-status, .validation-label, .validation-case, .validation-values small, .validation-equation, .panel-disclaimer, .range-ends, .unit-note { font-family: var(--mono); letter-spacing: .095em; }
.brand-kicker { font-size: 8px; color: var(--muted); margin-bottom: 3px; }
.brand-title { font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.brand-title span { color: var(--accent); font-weight: 500; }
.topbar-center { display: flex; align-items: center; gap: 12px; color: #9eafaa; font-size: 9px; }
.topbar-index { color: var(--accent-bright); font-size: 14px; }
.topbar-rule { width: 34px; height: 1px; background: var(--accent); opacity: .6; }
.topbar-status { display: flex; align-items: center; gap: 9px; color: #a8b7b2; font-size: 8px; white-space: nowrap; }
.status-dot, .live-pill i, .live-readout-dot { width: 6px; height: 6px; border-radius: 50%; background: #7eb7a9; box-shadow: 0 0 9px rgba(126, 183, 169, .7); }
.status-divider { height: 12px; width: 1px; background: var(--line-strong); margin: 0 4px; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 358px; min-height: calc(100vh - 64px); }
.stage-panel { min-width: 0; padding: 22px 24px 12px; display: flex; flex-direction: column; }
.stage-head { display: flex; align-items: flex-end; justify-content: space-between; padding: 0 2px 17px; gap: 18px; }
.eyebrow { display: flex; align-items: center; gap: 8px; color: #9eafa9; font-size: 8px; font-weight: 600; }
.eyebrow-line { display: inline-block; width: 17px; height: 1px; background: var(--accent); }
h1 { margin: 7px 0 4px; font-size: clamp(22px, 2.25vw, 31px); line-height: 1.12; letter-spacing: -.045em; font-weight: 650; }
h1 em { color: #c7b394; font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
.title-colon { color: var(--accent); }
.stage-subtitle { margin: 0; color: #879994; font-size: 11px; letter-spacing: .01em; }
.stage-head-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; padding-bottom: 3px; flex-shrink: 0; }
.meta-label { color: #6f827e; font-size: 7px; }
.live-pill { display: inline-flex; align-items: center; gap: 7px; color: #b8d5ca; font: 9px var(--mono); letter-spacing: .08em; }
.live-pill i { width: 5px; height: 5px; }
.model-tag { color: #9b8769; }
.scene-frame { position: relative; min-height: 420px; height: clamp(420px, calc(100vh - 250px), 620px); flex: 1 1 auto; overflow: hidden; border: 1px solid rgba(183, 203, 194, .17); border-radius: 5px; background: radial-gradient(ellipse at 52% 46%, #314349 0%, #17262d 60%, #111c22 100%); box-shadow: 0 20px 60px rgba(0,0,0,.22), inset 0 0 0 1px rgba(255,255,255,.015); }
.scene-host { position: absolute; inset: 0; z-index: 1; }
.scene-canvas { display: block; width: 100%; height: 100%; outline: none; touch-action: pan-y; }
.scene-vignette { pointer-events: none; position: absolute; z-index: 2; inset: 0; background: linear-gradient(180deg, rgba(8,16,20,.42), transparent 23%, transparent 68%, rgba(8,16,20,.48)), linear-gradient(90deg, rgba(8,16,20,.18), transparent 20%, transparent 82%, rgba(8,16,20,.18)); }
.scene-topline, .scene-bottomline { z-index: 3; position: absolute; left: 17px; right: 17px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.scene-topline { top: 15px; }
.scene-chip { font-size: 8px; color: #d7ddd4; padding: 8px 10px; border: 1px solid rgba(210, 222, 215, .2); border-radius: 2px; background: rgba(13, 25, 30, .52); backdrop-filter: blur(8px); }
.chip-icon { color: var(--accent-bright); margin-right: 7px; font-size: 11px; }
.scene-coordinates { font-size: 8px; color: #b3c1ba; text-align: right; }
.scene-coordinates span { display: block; color: #728681; font-size: 7px; margin-top: 4px; }
.scene-bottomline { bottom: 14px; }
.scene-legend { display: flex; align-items: center; gap: 15px; color: #c0cbc3; font-size: 7px; }
.scene-legend span { display: inline-flex; align-items: center; gap: 6px; }
.scene-legend i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.legend-salt { background: #c9e5e6; box-shadow: 0 0 7px #a5d8df; }
.legend-wet { background: #64a9aa; }
.legend-rock { background: #c59a6c; }
.drag-hint { color: #82948f; font-size: 7px; }
.drag-hint span { margin: 0 4px; color: var(--accent); }
.mouse-icon { font-size: 13px; }
.annotation { position: absolute; z-index: 3; display: flex; align-items: center; gap: 7px; color: rgba(231, 237, 225, .82); font: 7px var(--mono); letter-spacing: .1em; pointer-events: none; text-shadow: 0 1px 5px rgba(0,0,0,.7); }
.annotation-number { color: var(--accent-bright); font-size: 8px; }
.annotation i { display: block; width: 26px; height: 1px; background: rgba(216, 190, 147, .72); }
.annotation-one { top: 31%; right: 8%; }
.annotation-two { top: 59%; left: 7%; flex-direction: row-reverse; }
.annotation-three { bottom: 28%; right: 8%; }
.context-loss { position: absolute; z-index: 8; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: rgba(9, 18, 22, .92); color: #e7ece6; text-align: center; }
.context-loss[hidden] { display: none; }
.context-loss-icon { font-size: 36px; color: var(--accent); }
.context-loss strong { font: 11px var(--mono); letter-spacing: .15em; }
.context-loss span { color: var(--muted); font-size: 11px; }
.transport-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 9px; border-bottom: 1px solid var(--line); font-size: 8px; }
.transport-main, .transport-tools { display: flex; align-items: center; gap: 7px; }
.control-button, .icon-button, .tool-button { border: 1px solid var(--line-strong); border-radius: 3px; background: rgba(25, 41, 47, .76); height: 32px; cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.control-button:hover, .icon-button:hover, .tool-button:hover { background: #253a40; border-color: rgba(202, 222, 211, .42); }
.control-button:active, .icon-button:active, .tool-button:active { transform: translateY(1px); }
.control-button.primary { display: inline-flex; align-items: center; gap: 8px; padding: 0 13px; background: #b9986e; border-color: #b9986e; color: #182328; font-weight: 800; letter-spacing: .09em; }
.control-button.primary:hover { background: #d1b184; }
.play-icon { font-size: 13px; line-height: 1; }
.icon-button { width: 33px; color: #c4d1ca; font-size: 13px; }
.transport-divider { width: 1px; height: 22px; background: var(--line-strong); margin: 0 7px; }
.speed-control { display: grid; grid-template-columns: auto auto; align-items: center; gap: 4px 9px; color: #859791; font-size: 7px; }
.speed-control b { color: #d9c49f; font-size: 8px; font-weight: 600; }
.speed-control input { grid-column: 1 / 3; width: 118px; }
.tool-button { padding: 0 10px; color: #a8b8b2; font: 7px var(--mono); letter-spacing: .08em; white-space: nowrap; }
.tool-button span { color: var(--accent-bright); font-size: 12px; margin-right: 4px; }
.tool-button b { color: #d6dfd8; font-weight: 600; }
.stage-footnote { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #5e716e; font-size: 7px; padding: 9px 1px 0; }
input[type="range"] { appearance: none; -webkit-appearance: none; width: 100%; height: 3px; border-radius: 5px; background: linear-gradient(90deg, #b99a70, #607f7c); outline: none; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 11px; height: 11px; border-radius: 50%; background: #d8c19b; border: 2px solid #25373a; box-shadow: 0 0 0 1px rgba(216,193,155,.7); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: #d8c19b; border: 2px solid #25373a; box-shadow: 0 0 0 1px rgba(216,193,155,.7); }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid #d8c19b; outline-offset: 3px; }
.side-panel { min-width: 0; border-left: 1px solid var(--line); background: linear-gradient(180deg, rgba(25, 40, 46, .92), rgba(18, 31, 37, .98)); padding: 0 19px 14px; overflow-y: auto; max-height: calc(100vh - 64px); scrollbar-width: thin; scrollbar-color: #3a5558 transparent; }
.panel-section { padding: 17px 0 16px; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; position: relative; }
.section-index { display: flex; align-items: center; justify-content: center; flex: 0 0 23px; height: 23px; border: 1px solid rgba(193, 166, 126, .42); border-radius: 50%; color: var(--accent-bright); font: 9px var(--mono); }
.section-heading .eyebrow { font-size: 7px; margin-bottom: 3px; }
h2 { margin: 0; font-size: 13px; font-weight: 620; letter-spacing: -.02em; }
.unit-note { margin-left: auto; color: #687e79; font-size: 7px; }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.preset-button { display: flex; align-items: center; gap: 6px; text-align: left; padding: 8px 6px; min-width: 0; border: 1px solid var(--line); border-radius: 3px; background: rgba(9, 20, 25, .22); cursor: pointer; transition: .18s ease; }
.preset-button:hover { border-color: var(--line-strong); background: rgba(61, 86, 85, .2); }
.preset-button.active { border-color: rgba(203, 171, 125, .66); background: rgba(177, 145, 103, .12); box-shadow: inset 0 0 0 1px rgba(203,171,125,.08); }
.preset-icon { color: var(--accent-bright); font-size: 16px; flex: 0 0 auto; }
.preset-button b { display: block; color: #dce2da; font-size: 8px; font-weight: 650; white-space: nowrap; }
.preset-button small { display: block; margin-top: 3px; color: #80928d; font-size: 7px; white-space: nowrap; }
.preset-description { color: #80938d; font-size: 9px; line-height: 1.45; margin: 9px 0 0 1px; min-height: 13px; }
.parameter-section { padding-top: 16px; }
.parameter-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; row-gap: 12px; }
.parameter-row { min-width: 0; }
.parameter-label { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; margin-bottom: 7px; }
.parameter-label label { color: #b7c4bd; font-size: 9px; }
.parameter-label output { color: #e0c49a; font: 10px var(--mono); white-space: nowrap; }
.parameter-label output small { color: #8d9e98; font-size: 7px; }
.parameter-row input { display: block; }
.range-ends { display: flex; justify-content: space-between; margin-top: 5px; color: #627672; font-size: 6px; }
.compact-parameter .parameter-label { margin-bottom: 7px; }
.readout-section { padding-top: 16px; }
.live-readout-dot { margin-left: auto; width: 5px; height: 5px; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.readout-card { min-height: 68px; padding: 9px 9px 8px; border: 1px solid rgba(188, 207, 196, .12); border-radius: 3px; background: rgba(6, 17, 21, .25); }
.readout-label { display: block; color: #7f928c; font-size: 6px; line-height: 1.3; min-height: 16px; }
.readout-card strong { display: block; margin: 4px 0 3px; color: #e4d4b8; font: 17px var(--mono); letter-spacing: -.06em; }
.readout-card strong small { color: #92a39c; font-size: 8px; letter-spacing: 0; }
.readout-status { display: block; color: #70847d; font-size: 6px; }
.progress-line { margin-top: 12px; }
.progress-line > div:first-child { display: flex; align-items: center; justify-content: space-between; color: #81928c; font: 7px var(--mono); letter-spacing: .08em; }
.progress-line b { color: #d4c09d; font-weight: 500; }
.progress-track { height: 3px; margin-top: 7px; border-radius: 5px; background: #293a3d; overflow: hidden; }
.progress-track span { display: block; width: 14%; height: 100%; background: linear-gradient(90deg, #789c91, #d1b184); transition: width .25s ease; }
.readout-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; color: #71837e; font: 7px var(--mono); letter-spacing: .04em; }
.readout-foot b { display: block; color: #c8d1c9; font-weight: 500; margin-top: 4px; }
.validation-section { padding-top: 15px; }
.validation-section .section-heading { margin-bottom: 10px; }
.validation-label { color: #d1b184; font-size: 7px; }
.validation-case { color: #7f918b; font-size: 7px; margin-top: 5px; }
.validation-values { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px; margin-top: 10px; }
.validation-values > div { padding: 7px 7px 6px; border: 1px solid var(--line); border-radius: 2px; background: rgba(5, 16, 20, .2); }
.validation-values small { display: block; color: #71837d; font-size: 6px; }
.validation-values b { display: block; margin-top: 5px; color: #dce5dc; font: 11px var(--mono); white-space: nowrap; }
.validation-values i { color: #879a92; font-size: 7px; font-style: normal; }
.validation-diff b { color: #8fc1ad; }
.validation-equation { color: #b7c8bd; font-size: 9px; margin-top: 8px; text-align: center; }
.science-section { padding: 0; }
.science-section details { padding: 14px 0 13px; }
.science-section summary { display: flex; align-items: center; gap: 10px; list-style: none; cursor: pointer; }
.science-section summary::-webkit-details-marker { display: none; }
.science-section summary > span:nth-child(2) { display: flex; flex-direction: column; gap: 3px; }
.science-section summary .eyebrow { font-size: 7px; }
.science-section summary b { font-size: 12px; font-weight: 620; }
.details-chevron { margin-left: auto; color: var(--accent); font-size: 17px; transition: transform .2s ease; }
.science-section details[open] .details-chevron { transform: rotate(180deg); }
.science-content { padding: 13px 0 0 33px; }
.science-step { margin-bottom: 10px; }
.science-step > span { color: var(--accent-bright); font: 7px var(--mono); letter-spacing: .1em; }
.science-step p, .science-note p { margin: 4px 0 0; color: #9aaba4; font-size: 9px; line-height: 1.48; }
.equation-block { margin: 9px 0; padding: 9px; border-left: 2px solid rgba(193, 166, 126, .6); background: rgba(6, 17, 21, .28); }
.equation-block b { display: block; color: #d0d8d0; font-size: 8px; font-weight: 600; margin-bottom: 5px; }
.equation-block code { display: block; color: #e4c99f; font: 11px var(--mono); }
.equation-block small { display: block; color: #82958d; font-size: 8px; line-height: 1.4; margin-top: 5px; }
.science-note { padding-top: 5px; }
.science-note > b { color: #c9a77b; font: 7px var(--mono); letter-spacing: .09em; }
.panel-disclaimer { color: #5f736e; font-size: 6px; line-height: 1.45; padding: 11px 0 3px; }

@media (min-width: 1500px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 390px; }
  .stage-panel { padding: 27px 30px 15px; }
  .side-panel { padding-left: 22px; padding-right: 22px; }
}
@media (max-width: 1050px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 330px; }
  .stage-panel { padding-left: 16px; padding-right: 16px; }
  .topbar { padding: 0 17px; }
  .topbar-center { display: none; }
  .transport-bar { flex-wrap: wrap; }
  .transport-tools { margin-left: auto; }
}
@media (max-width: 760px) {
  .topbar { height: 56px; padding: 0 14px; }
  .brand-lockup { min-width: 0; }
  .brand-mark { width: 24px; height: 24px; }
  .brand-kicker { font-size: 7px; }
  .brand-title { font-size: 10px; }
  .topbar-status { font-size: 7px; gap: 6px; }
  .topbar-status .status-divider, .topbar-status span:last-child { display: none; }
  .workspace { display: block; min-height: auto; }
  .stage-panel { padding: 17px 12px 10px; }
  .stage-head { padding: 0 2px 13px; }
  h1 { font-size: clamp(22px, 6vw, 29px); }
  .stage-subtitle { font-size: 10px; }
  .stage-head-meta { display: none; }
  .scene-frame { height: 54vh; min-height: 350px; max-height: 520px; }
  .scene-topline, .scene-bottomline { left: 10px; right: 10px; }
  .scene-chip { font-size: 7px; padding: 7px; }
  .scene-coordinates { font-size: 7px; }
  .scene-legend { gap: 8px; font-size: 6px; }
  .drag-hint { display: none; }
  .annotation { font-size: 6px; }
  .annotation-one { right: 3%; }
  .annotation-two { left: 3%; }
  .annotation-three { right: 3%; }
  .transport-bar { align-items: flex-start; gap: 9px; padding: 10px 0; }
  .transport-main { flex-wrap: wrap; }
  .transport-tools { flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
  .tool-button { height: 29px; padding: 0 7px; font-size: 6px; }
  .speed-control input { width: 88px; }
  .stage-footnote { font-size: 6px; flex-wrap: wrap; }
  .stage-footnote span:nth-child(2) { display: none; }
  .side-panel { max-height: none; overflow: visible; border-left: 0; border-top: 1px solid var(--line); padding: 0 15px 22px; }
  .panel-section { padding-top: 16px; padding-bottom: 15px; }
  .parameter-list { column-gap: 18px; row-gap: 15px; }
  .parameter-label label { font-size: 10px; }
  .parameter-label output { font-size: 11px; }
  .readout-card { min-height: 74px; padding: 10px; }
  .readout-label { font-size: 7px; }
  .readout-card strong { font-size: 19px; }
  .readout-status { font-size: 7px; }
  .validation-values b { font-size: 12px; }
}
@media (max-width: 390px) {
  .scene-frame { min-height: 330px; }
  .scene-coordinates { display: none; }
  .transport-tools { width: 100%; justify-content: flex-start; }
  .parameter-list { column-gap: 12px; }
  .preset-button { gap: 4px; padding: 7px 4px; }
  .preset-icon { font-size: 14px; }
  .preset-button b { font-size: 7px; }
  .preset-button small { 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; }
}
body.embed .topbar { display: none; }
body.embed .workspace { display: block; min-height: 100vh; }
body.embed .stage-panel { min-height: 100vh; padding: 12px; }
body.embed .stage-head, body.embed .stage-footnote, body.embed .side-panel { display: none; }
body.embed .scene-frame { height: calc(100vh - 75px); min-height: 260px; }
body.embed .transport-bar { border-bottom: 0; }
