:root {
  color-scheme: dark;
  --bg: #06131e;
  --panel: #0b1d2a;
  --panel-2: #0e2432;
  --line: rgba(147, 197, 215, .13);
  --line-strong: rgba(147, 197, 215, .24);
  --text: #e5f3f7;
  --muted: #86a6b5;
  --faint: #587684;
  --cyan: #62d7f4;
  --ice: #a6e7f7;
  --blue: #238eb5;
  --amber: #e2c78c;
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-width: 320px; background: radial-gradient(ellipse at 48% 18%, #0c2939 0, #071a27 42%, #04111a 100%); }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { max-width: 1800px; margin: 0 auto; padding: 0 28px 16px; }
.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: 13px; }
.brand-mark { width: 28px; height: 28px; position: relative; display: flex; align-items: center; justify-content: center; gap: 3px; transform: rotate(45deg); }
.brand-mark span { width: 5px; border-radius: 6px; background: #83dff2; box-shadow: 0 0 12px #40b9da66; }
.brand-mark span:nth-child(1) { height: 13px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 23px; }
.brand-mark span:nth-child(3) { height: 17px; opacity: .75; }
.eyebrow { color: #6d99aa; font-size: 9px; line-height: 1.3; letter-spacing: .18em; font-weight: 800; }
.brand-title { margin-top: 4px; font-size: 11px; letter-spacing: .13em; font-weight: 750; color: #c9e1e9; }
.brand-title span { color: var(--cyan); padding: 0 4px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.model-chip, .seed-chip { font-size: 9px; letter-spacing: .1em; font-weight: 800; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; color: #9ab9c5; }
.model-chip { display: flex; align-items: center; gap: 7px; }
.model-chip i, .status-pill i, .live-indicator span { width: 6px; height: 6px; border-radius: 50%; display: inline-block; background: #59d7c4; box-shadow: 0 0 10px #59d7c4aa; }
.seed-chip { color: #668896; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 355px; gap: 18px; padding-top: 20px; align-items: start; }
.stage-column { min-width: 0; }
.stage-toolbar { min-height: 86px; display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; padding: 0 2px 12px; }
.stage-heading h1 { font-size: clamp(25px, 2.7vw, 36px); line-height: 1.04; margin: 7px 0 6px; font-weight: 690; letter-spacing: -.045em; }
.stage-heading h1 span { color: #8ccfdf; font-weight: 420; }
.stage-heading p { color: #8ba9b5; margin: 0; font-size: 12px; line-height: 1.45; }
.stage-tools { display: flex; gap: 7px; padding-top: 10px; }
.icon-button { border: 1px solid var(--line-strong); background: #0c2432; height: 34px; padding: 0 10px; min-width: 36px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: #a4c4d0; font-size: 9px; font-weight: 800; letter-spacing: .08em; cursor: pointer; transition: border-color .18s, background .18s, transform .18s; }
.icon-button:hover { background: #143547; border-color: #4a9ab1; transform: translateY(-1px); }
.icon-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.scene-frame { height: clamp(430px, 54vw, 630px); min-height: 410px; border: 1px solid rgba(120, 184, 205, .22); border-radius: 13px; position: relative; overflow: hidden; background: radial-gradient(ellipse at 50% 34%, #14445a 0, #092b3d 36%, #061a28 78%); box-shadow: 0 22px 60px #0005, inset 0 0 70px #06101b66; isolation: isolate; }
.scene-canvas-wrap { position: absolute; inset: 0; z-index: 1; }
.scene-canvas { width: 100%; height: 100%; display: block; outline: none; }
.scene-vignette { position: absolute; inset: 0; pointer-events: none; z-index: 2; background: radial-gradient(ellipse at 48% 48%, transparent 40%, rgba(2, 12, 19, .42) 100%); }
.scene-topline, .scene-bottomline { position: absolute; z-index: 4; left: 17px; right: 17px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.scene-topline { top: 15px; }
.scene-bottomline { bottom: 14px; color: #7fa2b1; font-size: 8px; letter-spacing: .14em; font-weight: 800; }
.scene-bottomline b, .scene-scale span { color: #4d8ba2; padding: 0 5px; }
.live-indicator { display: flex; align-items: center; gap: 7px; font-size: 8px; letter-spacing: .13em; color: #b2d7e1; background: #061923b8; border: 1px solid #9ed9e51c; border-radius: 5px; padding: 7px 9px; backdrop-filter: blur(8px); }
.live-indicator span { width: 5px; height: 5px; }
.scene-scale { color: #86a8b5; font-size: 8px; letter-spacing: .1em; background: #061923a8; border: 1px solid #9ed9e51c; border-radius: 5px; padding: 7px 9px; backdrop-filter: blur(8px); }
.scene-scale b { color: #d4eff6; margin-left: 4px; }
.label-layer { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.scene-label { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; padding: 5px 7px; border-radius: 3px; background: #071d2bc9; border: 1px solid #5bb5cf50; color: #bde9f4; font-size: 8px; letter-spacing: .13em; font-weight: 850; text-shadow: 0 1px 4px #00131d; box-shadow: 0 3px 14px #00131d77; }
.label-flow { color: #83ddfa; border-color: #4ec8ef66; }
.label-front { color: #e4f9ff; border-color: #c2f1ff77; }
.context-overlay { position: absolute; inset: 0; z-index: 9; display: grid; place-items: center; background: #03111ad9; backdrop-filter: blur(7px); }
.context-overlay[hidden] { display: none; }
.context-card { text-align: center; max-width: 260px; padding: 22px; border: 1px solid var(--line-strong); border-radius: 12px; background: #0b2634; }
.context-icon { color: var(--cyan); font-size: 24px; margin-bottom: 10px; }
.context-card strong { font-size: 13px; }
.context-card p { font-size: 11px; color: var(--muted); line-height: 1.55; }
.toast { position: absolute; z-index: 10; left: 50%; bottom: 43px; transform: translate(-50%, 8px); background: #0c2a39ee; border: 1px solid #4bb4ce55; color: #d8f6ff; padding: 8px 12px; font-size: 10px; border-radius: 6px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.transport-bar { display: grid; grid-template-columns: auto minmax(120px, 1fr) 115px; align-items: center; gap: 18px; padding: 13px 3px 14px; border-bottom: 1px solid var(--line); }
.transport-actions { display: flex; align-items: center; gap: 6px; }
.play-button { border: 1px solid #3c9bb4; background: linear-gradient(135deg, #16485d, #0c3448); border-radius: 7px; height: 34px; min-width: 95px; display: flex; justify-content: center; align-items: center; gap: 9px; padding: 0 11px; color: #e1f9ff; font-size: 9px; letter-spacing: .1em; font-weight: 850; cursor: pointer; box-shadow: 0 0 18px #1e9dc522; }
.play-button:hover { background: #1b5368; }
.play-symbol { font-size: 13px; line-height: 1; }
.transport-button { height: 34px; border: 1px solid var(--line-strong); background: #0b1e2a; border-radius: 7px; padding: 0 10px; color: #9ab8c4; font-size: 8px; letter-spacing: .1em; font-weight: 800; cursor: pointer; }
.transport-button:hover { border-color: #4c9bb2; color: #d7f4fc; }
.transport-button span { color: #5d9db0; padding-left: 4px; }
.timeline-block { min-width: 0; }
.timeline-meta { display: flex; align-items: center; justify-content: space-between; color: #6d91a0; font-size: 8px; letter-spacing: .12em; margin-bottom: 8px; }
.timeline-meta b { color: #c1e0e8; font-size: 10px; letter-spacing: .04em; }
.timeline-track { height: 3px; background: #183847; position: relative; border-radius: 3px; }
.timeline-fill { width: 28%; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #2388aa, #7bdcf0); box-shadow: 0 0 9px #42c4e455; }
.timeline-dot { position: absolute; left: 28%; top: 50%; width: 7px; height: 7px; border-radius: 50%; background: #c8f4ff; box-shadow: 0 0 8px #6bd8ef; transform: translate(-50%, -50%); }
.speed-block { display: grid; grid-template-columns: 1fr auto; gap: 4px 6px; align-items: center; }
.speed-block label { color: #7095a4; font-size: 8px; letter-spacing: .12em; font-weight: 800; }
.speed-value { text-align: right; color: #5f96aa; font-size: 8px; }
.speed-value strong { color: #c4eaf2; font-size: 11px; }
.speed-block input { grid-column: 1 / -1; width: 100%; }
.readout-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; padding-top: 12px; }
.readout-card { min-width: 0; padding: 11px 12px 10px; background: linear-gradient(145deg, #0b202d, #091a26); border: 1px solid var(--line); border-radius: 8px; }
.readout-label { font-size: 8px; letter-spacing: .1em; color: #7b9eac; font-weight: 850; display: flex; align-items: center; justify-content: space-between; gap: 4px; white-space: nowrap; }
.readout-label span { font-size: 7px; color: #4f8294; font-weight: 700; }
.readout-value { font-size: clamp(19px, 2vw, 25px); color: #d9f4fa; font-weight: 570; letter-spacing: -.04em; margin-top: 8px; white-space: nowrap; }
.readout-value small { font-size: 10px; color: #7faebe; font-weight: 600; letter-spacing: 0; }
.readout-foot { color: #587b89; font-size: 8px; margin-top: 5px; }
.accent-readout { border-color: #4cabc65c; background: linear-gradient(145deg, #103144, #0a2230); }
.accent-readout .readout-value { color: #a7eaff; }
.control-column { min-width: 0; display: flex; flex-direction: column; gap: 11px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(150deg, rgba(13, 34, 48, .97), rgba(8, 25, 37, .98)); box-shadow: 0 12px 28px #0002; }
.panel-controls { padding: 16px 16px 14px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-heading h2 { margin: 5px 0 0; font-size: 16px; font-weight: 650; letter-spacing: -.025em; }
.status-pill { display: flex; align-items: center; gap: 6px; color: #6bb9ae; border: 1px solid #4db59d33; background: #14382f66; border-radius: 4px; padding: 5px 7px; font-size: 7px; font-weight: 850; letter-spacing: .12em; }
.status-pill i { width: 5px; height: 5px; }
.preset-section { margin-top: 17px; }
.section-label { display: flex; justify-content: space-between; color: #7195a4; font-size: 8px; font-weight: 850; letter-spacing: .13em; margin-bottom: 8px; }
.section-label span { color: #4f7585; font-size: 7px; }
.preset-list { display: grid; gap: 5px; }
.preset-button { width: 100%; display: grid; grid-template-columns: 26px 1fr 12px; gap: 8px; align-items: center; text-align: left; background: #0a1b27; border: 1px solid #8fb7c11a; border-radius: 7px; padding: 8px 9px; cursor: pointer; transition: .16s ease; }
.preset-button:hover { border-color: #5aa6bc55; background: #102b3b; }
.preset-button.active { background: linear-gradient(100deg, #123c50, #0c2b3b); border-color: #3b91aa8c; box-shadow: inset 2px 0 #67d2eb; }
.preset-index { font-size: 9px; color: #5e8fa1; font-weight: 850; }
.preset-copy { display: flex; flex-direction: column; gap: 3px; }
.preset-copy b { font-size: 10px; font-weight: 700; color: #c7e2e9; }
.preset-copy small { font-size: 8px; color: #6d919f; }
.preset-arrow { font-size: 12px; color: #5f9eb2; }
.control-section { border-top: 1px solid var(--line); margin-top: 15px; padding-top: 13px; }
.control-section-last { margin-top: 12px; }
.control-row { margin-top: 11px; }
.control-name { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 7px; }
.control-name label { color: #bdd3da; font-size: 10px; font-weight: 560; }
.control-name output { color: #8ed7e9; font-size: 9px; font-variant-numeric: tabular-nums; font-weight: 750; }
input[type="range"] { appearance: none; width: 100%; height: 3px; border-radius: 3px; background: linear-gradient(90deg, #2a8cac, #24576d); outline: none; cursor: pointer; display: block; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 11px; height: 11px; border-radius: 50%; background: #b4edfa; border: 2px solid #1e6178; box-shadow: 0 0 0 3px #54c5e31c; }
input[type="range"]::-moz-range-thumb { width: 8px; height: 8px; border-radius: 50%; background: #b4edfa; border: 2px solid #1e6178; box-shadow: 0 0 0 3px #54c5e31c; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px #63d4f566; }
.range-ends { display: flex; justify-content: space-between; color: #4f7382; font-size: 7px; margin-top: 6px; }
.validation-panel { padding: 14px 15px 12px; }
.compact-heading h2 { font-size: 14px; }
.textbook-tag { font-size: 7px; font-weight: 850; letter-spacing: .12em; color: #d6bd84; border: 1px solid #d6bd8438; background: #3c33221f; border-radius: 4px; padding: 5px 6px; }
.validation-intro { color: #7898a5; font-size: 9px; line-height: 1.45; margin: 10px 0 11px; }
.validation-intro b { color: #b7dce7; }
.validation-values { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.validation-values div { background: #071a26; border: 1px solid var(--line); border-radius: 6px; padding: 8px; min-width: 0; }
.validation-values span, .validation-result span { display: block; font-size: 7px; color: #5f8796; letter-spacing: .1em; font-weight: 800; white-space: nowrap; }
.validation-values b { display: block; font-size: 13px; margin-top: 5px; color: #d4eef4; font-weight: 650; }
.validation-values small { color: #80aebc; font-size: 8px; font-weight: 500; }
.validation-result { display: flex; justify-content: space-between; align-items: center; padding: 9px 1px 0; }
.validation-result b { color: #81d6e9; font-size: 11px; }
.validation-note { margin-top: 8px; color: #5e8190; font-size: 8px; line-height: 1.45; border-top: 1px solid var(--line); padding-top: 8px; }
.science-panel { padding: 0 15px; }
.science-panel summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 13px 0; }
.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 { font-size: 13px; font-weight: 650; }
.details-plus { color: #7fcde0; font-size: 18px; transition: transform .2s; }
.science-panel[open] .details-plus { transform: rotate(45deg); }
.science-content { border-top: 1px solid var(--line); padding: 10px 0 14px; }
.science-step { margin: 5px 0 12px; }
.science-step span { color: #66b9d0; font-size: 7px; font-weight: 850; letter-spacing: .12em; }
.science-step p, .variable-list p, .limitations p { color: #91acb7; font-size: 9px; line-height: 1.55; margin: 5px 0 0; }
.equation-block { background: #061823; border: 1px solid var(--line); border-radius: 6px; padding: 10px; margin: 11px 0; }
.equation-title { color: #6b9aaa; font-size: 7px; font-weight: 850; letter-spacing: .11em; margin: 4px 0 5px; }
.equation-title small { color: #4e7484; font-size: 6px; margin-left: 4px; }
.equation-block code { color: #d0edf5; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; line-height: 1.6; white-space: normal; }
.variable-list, .limitations { margin-top: 10px; }
.variable-list > b, .limitations > b { color: #b8d5de; font-size: 9px; }
.legend-panel { padding: 11px 14px; }
.legend-title { color: #638b9a; font-size: 7px; letter-spacing: .13em; font-weight: 850; margin-bottom: 9px; }
.legend-items { display: flex; flex-wrap: wrap; gap: 11px; color: #83a4b0; font-size: 8px; }
.legend-items span { display: inline-flex; align-items: center; gap: 5px; }
.legend-items i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }
.legend-ice { background: #b5e8f4; }.legend-brine { background: #2db9ec; box-shadow: 0 0 7px #2db9ec88; }.legend-front { background: #e8fbff; }
.footer { border-top: 1px solid var(--line); margin-top: 16px; padding: 12px 1px 0; display: flex; justify-content: space-between; gap: 15px; color: #4f7381; font-size: 7px; line-height: 1.5; letter-spacing: .1em; font-weight: 750; }
.footer b { color: #3f879e; padding: 0 4px; }
.embed .topbar, .embed .footer { display: none; }
.embed .workspace { padding-top: 0; grid-template-columns: minmax(0, 1fr) 330px; }
.embed .app-shell { padding: 0 12px 12px; }
@media (min-width: 1500px) { .workspace { grid-template-columns: minmax(0, 1fr) 390px; gap: 22px; } .scene-frame { height: min(58vw, 720px); } }
@media (max-width: 1050px) { .app-shell { padding: 0 18px 14px; } .workspace { grid-template-columns: minmax(0, 1fr) 320px; gap: 12px; } .readout-grid { gap: 6px; } .readout-card { padding: 10px 9px; } .readout-label { font-size: 7px; } .readout-label span { display: none; } .transport-bar { gap: 10px; grid-template-columns: auto minmax(100px, 1fr) 96px; } }
@media (max-width: 820px) { .workspace { grid-template-columns: 1fr; } .scene-frame { height: min(64vw, 560px); min-height: 390px; } .control-column { display: grid; grid-template-columns: 1fr 1fr; align-items: start; } .panel-controls { grid-row: span 3; } .science-panel, .legend-panel { grid-column: 2; } .footer { flex-direction: column; gap: 4px; } }
@media (max-width: 560px) {
  .app-shell { padding: 0 10px 12px; }
  .topbar { height: 58px; }
  .brand-mark { width: 23px; height: 23px; }
  .brand-title { font-size: 9px; }
  .model-chip { display: none; }
  .seed-chip { font-size: 8px; padding: 7px 8px; }
  .workspace { padding-top: 12px; gap: 12px; }
  .stage-toolbar { min-height: 78px; padding-bottom: 9px; }
  .stage-heading h1 { font-size: 27px; }
  .stage-heading p { max-width: 250px; font-size: 10px; }
  .stage-tools { gap: 4px; padding-top: 7px; }
  .icon-button { height: 31px; min-width: 32px; padding: 0 7px; }
  .export-button span { display: none; }
  .scene-frame { height: 57vh; min-height: 370px; max-height: 510px; border-radius: 10px; }
  .scene-topline { top: 10px; left: 10px; right: 10px; }
  .scene-bottomline { bottom: 10px; left: 10px; right: 10px; font-size: 7px; }
  .scene-scale { font-size: 6px; padding: 6px; }
  .live-indicator { font-size: 7px; padding: 6px 7px; }
  .scene-label { font-size: 6px; padding: 4px 5px; }
  .transport-bar { grid-template-columns: 1fr auto; gap: 9px; padding: 10px 1px 12px; }
  .transport-actions { gap: 4px; }
  .play-button { min-width: 82px; height: 32px; padding: 0 8px; font-size: 8px; }
  .transport-button { height: 32px; padding: 0 8px; font-size: 7px; }
  .timeline-block { grid-column: 1 / -1; grid-row: 2; }
  .speed-block { grid-column: 2; grid-row: 1; width: 100px; }
  .readout-grid { grid-template-columns: repeat(2, 1fr); gap: 7px; padding-top: 9px; }
  .readout-card { padding: 10px 11px; }
  .readout-label { font-size: 7px; }
  .readout-value { font-size: 23px; margin-top: 6px; }
  .control-column { display: flex; }
  .panel-controls { padding: 14px; }
  .preset-button { padding: 9px; }
  .control-row { margin-top: 13px; }
  .control-name label { font-size: 11px; }
  .control-name output { font-size: 10px; }
  .validation-panel { padding: 13px; }
  .footer { font-size: 6px; margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

button:focus-visible, summary:focus-visible, input:focus-visible, .scene-canvas:focus-visible { outline: 2px solid #73d9f0; outline-offset: 3px; }

@media (max-width: 900px) { .embed .workspace { grid-template-columns: minmax(0, 1fr); } }
