:root {
  color-scheme: dark;
  --bg: #07121c;
  --panel: #0b1722;
  --panel-2: #0e1d29;
  --line: rgba(135, 178, 194, .15);
  --line-strong: rgba(135, 178, 194, .25);
  --text: #e5edf0;
  --muted: #8ea4ae;
  --subtle: #5d7682;
  --cyan: #58c4cb;
  --cyan-bright: #80e0df;
  --amber: #d68a52;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); }
body { overflow: hidden; font-size: 13px; letter-spacing: .01em; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { width: 100%; height: 100dvh; min-height: 620px; display: flex; flex-direction: column; overflow: hidden; background: radial-gradient(ellipse at 35% 25%, #102534 0%, #07121c 58%); }
.topbar { height: 64px; flex: 0 0 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid var(--line); background: rgba(6, 16, 25, .86); z-index: 5; }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 250px; }
.brand-mark { width: 29px; height: 29px; position: relative; border: 1px solid rgba(92, 199, 205, .55); border-radius: 50%; display: grid; place-items: center; }
.brand-mark::before, .brand-mark::after, .brand-mark span { content: ""; display: block; position: absolute; border: 1px solid rgba(92, 199, 205, .72); border-radius: 50%; transform: rotate(-24deg); }
.brand-mark::before { width: 20px; height: 11px; }
.brand-mark::after { width: 11px; height: 20px; }
.brand-mark span:nth-child(1) { width: 5px; height: 5px; background: var(--cyan); border: 0; }
.brand-mark span:nth-child(2), .brand-mark span:nth-child(3) { display: none; }
.brand-name { font-size: 10px; font-weight: 760; letter-spacing: .18em; color: #dce8ec; }
.brand-name span { color: var(--cyan); padding: 0 4px; }
.brand-subtitle { margin-top: 4px; font-size: 8px; letter-spacing: .17em; color: #6f8994; }
.brand-subtitle i { display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--cyan); margin: 0 5px 2px; }
.topbar-center { color: #91aab4; font-size: 9px; letter-spacing: .16em; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.live-dot, .runtime-dot { width: 6px; height: 6px; border-radius: 50%; background: #65d3c7; box-shadow: 0 0 9px rgba(101, 211, 199, .55); }
.topbar-right { display: flex; align-items: center; gap: 8px; min-width: 250px; justify-content: flex-end; }
.seed-chip, .runtime-chip { border: 1px solid var(--line); border-radius: 4px; padding: 7px 9px; color: #718a95; font-size: 8px; letter-spacing: .13em; white-space: nowrap; }
.seed-chip b { color: #c7d8de; font-weight: 650; margin-left: 5px; }
.runtime-chip { display: flex; align-items: center; gap: 7px; }
.runtime-dot { width: 5px; height: 5px; }
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 380px; }
.stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: radial-gradient(ellipse at 52% 47%, #102a38 0%, #0a1924 48%, #07121c 100%); border-right: 1px solid var(--line); }
.scene-host { position: absolute; inset: 0 0 28px; overflow: hidden; }
#simulation-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
.scene-vignette { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at 52% 44%, transparent 40%, rgba(3, 10, 16, .22) 82%, rgba(3, 10, 16, .52) 100%); }
.stage-kicker { position: absolute; top: 20px; left: 22px; z-index: 2; font-size: 8px; letter-spacing: .16em; color: #7894a0; font-weight: 700; pointer-events: none; }
.eyebrow-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px #58c4cb; margin: 0 7px 1px 0; }
.stage-divider { color: #3d6878; margin: 0 7px; }
.stage-bottom-left, .stage-bottom-right { position: absolute; bottom: 19px; z-index: 2; pointer-events: none; }
.stage-bottom-left { left: 22px; }
.scene-caption { font-size: 8px; letter-spacing: .12em; color: #78919b; }
.scene-caption span { color: var(--cyan); padding: 0 4px; }
.scale-line { margin-top: 11px; display: flex; align-items: center; gap: 7px; color: #88a4ad; font-size: 8px; letter-spacing: .1em; }
.scale-line span { display: block; width: 52px; height: 1px; background: linear-gradient(90deg, var(--cyan), rgba(88,196,203,.1)); position: relative; }
.scale-line span::before, .scale-line span::after { content: ""; position: absolute; width: 1px; height: 5px; top: -2px; background: var(--cyan); }
.scale-line span::before { left: 0; } .scale-line span::after { right: 0; }
.stage-bottom-right { right: 20px; text-align: right; }
.view-hint { font-size: 8px; letter-spacing: .12em; color: #8299a2; }
.view-hint span { color: #456c79; padding: 0 3px; }
.mouse-icon { font-size: 13px; vertical-align: -1px; }
.scene-coordinates { margin-top: 9px; color: #58727e; font-size: 8px; letter-spacing: .1em; }
.scene-coordinates span { color: var(--cyan); padding: 0 4px; }
.annotation { position: absolute; z-index: 3; pointer-events: none; white-space: nowrap; color: #d2e0e3; font-size: 8px; letter-spacing: .12em; text-shadow: 0 1px 6px #061019; }
.annotation b { display: block; font-size: 8px; font-weight: 760; }
.annotation small { display: block; margin-top: 3px; color: #86a1aa; font-size: 8px; letter-spacing: .04em; text-transform: none; }
.annotation-line { display: block; width: 25px; height: 1px; background: var(--cyan); margin-bottom: 6px; box-shadow: 0 0 7px rgba(88,196,203,.6); }
.annotation-source { margin: -24px 0 0 8px; }
.annotation-bands { margin: 6px 0 0 10px; }
.annotation-front { margin: 2px 0 0 10px; }
.context-warning { display: none; position: absolute; top: 55px; left: 50%; transform: translateX(-50%); z-index: 8; padding: 9px 13px; border: 1px solid rgba(230, 170, 100, .35); border-radius: 5px; background: rgba(44, 26, 15, .92); color: #f0c18d; font-size: 10px; }
.context-warning.visible { display: block; }
.loading-cover { position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(5, 15, 23, .96); text-align: center; padding: 24px; transition: opacity .35s ease, visibility .35s ease; }
.loading-cover.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loading-spinner { width: 28px; height: 28px; border: 1px solid rgba(88,196,203,.22); border-top-color: var(--cyan); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 16px; }
.loading-title { font-size: 13px; font-weight: 650; letter-spacing: .04em; }
.loading-copy { max-width: 300px; margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.6; }
@keyframes spin { to { transform: rotate(360deg); } }
.stage-footer { position: absolute; bottom: 0; left: 0; right: 0; height: 28px; display: flex; align-items: center; gap: 13px; padding: 0 18px; background: rgba(5, 14, 22, .9); border-top: 1px solid var(--line); z-index: 4; }
.stage-footer-left, .stage-footer-right { display: flex; align-items: center; gap: 7px; white-space: nowrap; color: #8aa2ac; font-size: 8px; letter-spacing: .1em; }
.stage-footer-left { min-width: 178px; }
.stage-footer-right { min-width: 66px; justify-content: flex-end; font-variant-numeric: tabular-nums; }
.status-led { width: 5px; height: 5px; border-radius: 50%; background: #d3a56d; }
#run-status[data-state="running"] ~ .footer-separator { color: var(--cyan); }
#run-status[data-state="running"] { color: var(--cyan-bright); }
#run-status[data-state="complete"] { color: #e6b278; }
.footer-separator { color: #45606d; }
.progress-track { height: 2px; background: rgba(118, 153, 165, .15); flex: 1; overflow: hidden; border-radius: 4px; }
.progress-fill { height: 100%; width: 50%; background: linear-gradient(90deg, #399da9, #d58c52); box-shadow: 0 0 7px rgba(88,196,203,.38); transition: width .12s linear; }
.control-panel { min-width: 0; min-height: 0; background: linear-gradient(180deg, #0c1924 0%, #0a1620 100%); }
.panel-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #28414e transparent; padding: 20px 19px 18px; }
.panel-scroll::-webkit-scrollbar { width: 5px; } .panel-scroll::-webkit-scrollbar-thumb { background: #28414e; border-radius: 8px; }
.panel-heading { padding: 0 0 17px; border-bottom: 1px solid var(--line); }
.category-label { color: #78a2ad; font-size: 8px; font-weight: 740; letter-spacing: .17em; }
.category-label span { color: var(--cyan); padding: 0 4px; }
h1 { margin: 9px 0 0; color: #e7f0f1; font-size: 31px; font-weight: 640; line-height: 1.08; letter-spacing: -.045em; }
h1 em { color: #e0a06b; font-style: normal; }
.panel-deck { margin: 5px 0 0; color: #a2b6bc; font-size: 11px; letter-spacing: .015em; }
.panel-meta { margin-top: 13px; display: flex; align-items: center; gap: 8px; color: #6e8994; font-size: 7px; letter-spacing: .14em; font-weight: 650; }
.meta-sep { color: var(--cyan); }
.transport-section, .presets-section, .parameters-section, .readouts-section { padding: 16px 0 15px; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 11px; color: #8da7b0; font-size: 8px; font-weight: 760; letter-spacing: .16em; }
.section-number { color: #496a77; font-variant-numeric: tabular-nums; }
.transport-buttons { display: grid; grid-template-columns: 1fr 1fr 38px; gap: 7px; }
.button { min-height: 34px; border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 11px; background: rgba(18, 39, 52, .72); color: #cbdadd; font-size: 10px; font-weight: 650; letter-spacing: .015em; cursor: pointer; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.button:hover { background: rgba(33, 65, 79, .78); border-color: rgba(103, 191, 198, .42); }
.button:active { transform: translateY(1px); }
.button:focus-visible, .preset:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.button-primary { background: linear-gradient(135deg, #246a76, #194854); border-color: rgba(96, 198, 203, .48); color: #e8f5f3; }
.button-primary:hover { background: linear-gradient(135deg, #2b7d88, #1d5965); }
.button-quiet { background: rgba(15, 32, 44, .7); }
.button-icon { font-size: 17px; padding: 0; color: #9ab5bc; }
.speed-row { display: grid; grid-template-columns: 66px 1fr 43px; align-items: center; gap: 9px; margin-top: 12px; }
.speed-row label { font-size: 7px; color: #718b96; letter-spacing: .14em; font-weight: 700; }
.speed-row output { color: #b6d5d7; text-align: right; font-size: 9px; font-variant-numeric: tabular-nums; }
input[type="range"] { appearance: none; -webkit-appearance: none; width: 100%; height: 3px; border-radius: 5px; background: linear-gradient(90deg, #368f9b, #254452); cursor: pointer; accent-color: var(--cyan); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 11px; height: 11px; border: 2px solid #b7eeea; border-radius: 50%; background: #318c96; box-shadow: 0 0 0 3px rgba(68, 171, 180, .13); }
input[type="range"]::-moz-range-thumb { width: 8px; height: 8px; border: 2px solid #b7eeea; border-radius: 50%; background: #318c96; box-shadow: 0 0 0 3px rgba(68, 171, 180, .13); }
.preset-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 7px; }
.preset { position: relative; min-width: 0; text-align: left; padding: 9px 8px 8px; border: 1px solid var(--line); border-radius: 4px; background: rgba(14, 31, 42, .65); cursor: pointer; display: flex; flex-direction: column; gap: 4px; transition: .16s ease; }
.preset:hover { border-color: rgba(88,196,203,.4); background: rgba(20, 44, 56, .8); }
.preset.selected { border-color: rgba(88,196,203,.58); background: rgba(25, 59, 69, .56); box-shadow: inset 0 0 0 1px rgba(88,196,203,.08); }
.preset b { color: #cbdadd; font-size: 9px; font-weight: 670; white-space: nowrap; }
.preset small { color: #6e8791; font-size: 7px; white-space: nowrap; }
.preset-swatch { display: block; width: 24px; height: 10px; margin-bottom: 3px; border-radius: 2px; background: repeating-radial-gradient(circle at 50% 50%, #d28a56 0 1px, transparent 2px 4px); }
.swatch-wide { background: repeating-radial-gradient(circle at 50% 50%, #d28a56 0 1px, transparent 2px 7px); }
.swatch-fast { background: repeating-radial-gradient(circle at 50% 50%, #d28a56 0 2px, transparent 3px 5px); }
.parameter-list { display: flex; flex-direction: column; gap: 12px; }
.parameter-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.parameter-top label { color: #bdcdd1; font-size: 9px; }
.parameter-top output { color: #7bd0d0; font-size: 9px; font-variant-numeric: tabular-nums; }
.parameter input { display: block; }
.range-ends { display: flex; justify-content: space-between; margin-top: 5px; color: #5f7883; font-size: 7px; font-variant-numeric: tabular-nums; }
.button-apply { width: 100%; margin-top: 14px; display: flex; justify-content: space-between; align-items: center; min-height: 34px; background: rgba(33, 75, 83, .56); border-color: rgba(88,196,203,.35); color: #cde6e4; }
.button-apply span { color: var(--cyan); font-size: 14px; }
.apply-note { margin: 6px 0 0; color: #647e88; font-size: 7px; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.readout-card { min-height: 66px; border: 1px solid var(--line); border-radius: 4px; padding: 9px 9px 8px; background: linear-gradient(135deg, rgba(17, 38, 51, .74), rgba(10, 25, 36, .58)); }
.readout-card span { display: block; color: #76929d; font-size: 7px; font-weight: 700; letter-spacing: .12em; }
.readout-card b { display: block; margin-top: 6px; color: #e2edef; font-size: 17px; font-weight: 590; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.readout-card small { display: block; margin-top: 2px; color: #637d87; font-size: 7px; }
.diffusivity-line { display: flex; justify-content: space-between; margin-top: 10px; color: #6e8791; font-size: 7px; letter-spacing: .11em; }
.diffusivity-line b { color: #a8c9cc; font-size: 8px; letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.validation-section { margin-top: 14px; padding: 11px 11px 9px; border: 1px solid rgba(88,196,203,.22); border-radius: 4px; background: linear-gradient(120deg, rgba(16, 47, 55, .64), rgba(13, 31, 42, .55)); }
.validation-top { display: flex; align-items: center; gap: 8px; }
.validation-icon { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; color: #a1e5d6; background: rgba(74, 175, 157, .15); font-size: 11px; }
.validation-top div { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.validation-top b { color: #b8d2d4; font-size: 8px; letter-spacing: .12em; }
.validation-top small { color: #6e939b; font-size: 7px; }
.validation-top strong { color: #8ee0d3; font-size: 14px; font-weight: 620; font-variant-numeric: tabular-nums; }
.validation-values { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 7px 26px; }
.validation-values div { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 5px; border-bottom: 1px solid rgba(120,171,177,.13); }
.validation-values span { color: #69858e; font-size: 7px; letter-spacing: .1em; }
.validation-values b { color: #d0e0df; font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
.validation-foot { margin: 0 0 0 26px; color: #6c858e; font-size: 7px; line-height: 1.5; }
.science-panel { margin-top: 15px; border: 1px solid var(--line); border-radius: 4px; background: rgba(11, 27, 38, .58); }
.science-panel summary { min-height: 39px; display: flex; align-items: center; gap: 10px; padding: 0 11px; cursor: pointer; list-style: none; color: #b5cbd0; font-size: 8px; font-weight: 750; letter-spacing: .14em; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-summary-note { margin-left: auto; color: #637d87; font-size: 7px; font-weight: 450; letter-spacing: .02em; }
.chevron { color: var(--cyan); font-size: 14px; transition: transform .18s ease; }
.science-panel[open] .chevron { transform: rotate(180deg); }
.science-content { padding: 0 11px 12px; border-top: 1px solid var(--line); }
.science-content h3 { margin: 13px 0 5px; color: #9fc2c7; font-size: 8px; letter-spacing: .1em; }
.science-content p { margin: 0 0 7px; color: #8199a2; font-size: 8px; line-height: 1.6; }
.equation { margin: 6px 0; padding: 8px 9px; border-left: 2px solid rgba(88,196,203,.48); background: rgba(22, 48, 58, .55); color: #d5e8e7; font-family: Georgia, "Times New Roman", serif; font-size: 11px; letter-spacing: .01em; }
.science-note { margin-top: 10px; padding: 9px; background: rgba(14, 36, 47, .65); border: 1px solid rgba(88,196,203,.12); border-radius: 3px; }
.science-note b { color: #8fb8bd; font-size: 7px; letter-spacing: .12em; }
.science-note p { margin: 5px 0 0; }
.science-note.limitation { border-color: rgba(214,138,82,.18); }
.science-note.limitation b { color: #d5a077; }
.panel-actions { display: grid; grid-template-columns: 1fr 74px 1.15fr; gap: 6px; margin-top: 14px; }
.panel-actions .button { padding: 0 7px; min-height: 31px; font-size: 8px; }
.disclaimer { margin: 11px 0 1px; color: #586f79; font-size: 7px; line-height: 1.55; }
.app-footer { flex: 0 0 27px; height: 27px; border-top: 1px solid var(--line); background: rgba(5, 14, 22, .94); display: flex; align-items: center; justify-content: space-between; padding: 0 19px; color: #5e7782; font-size: 7px; letter-spacing: .12em; }
.app-footer b { color: #9bb2ba; font-weight: 650; }
.app-footer i { color: var(--cyan); font-style: normal; padding: 0 4px; }
.toast { position: fixed; z-index: 30; bottom: 42px; left: 50%; transform: translate(-50%, 10px); opacity: 0; pointer-events: none; padding: 9px 13px; border: 1px solid rgba(88,196,203,.3); border-radius: 4px; background: rgba(7, 23, 32, .96); color: #c5e0df; font-size: 9px; box-shadow: 0 10px 35px rgba(0,0,0,.3); transition: opacity .18s ease, transform .18s ease; white-space: nowrap; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
.embed .topbar { height: 44px; flex-basis: 44px; padding: 0 13px; }
.embed .brand-subtitle, .embed .topbar-center, .embed .topbar-right, .embed .app-footer { display: none; }
.embed .brand-name { font-size: 9px; }
.embed .workspace { grid-template-columns: minmax(0, 1fr) 340px; }
.embed .panel-scroll { padding-top: 14px; }

@media (max-width: 1100px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 340px; }
  .panel-scroll { padding-left: 15px; padding-right: 15px; }
  .topbar-center { display: none; }
  .brand-lockup, .topbar-right { min-width: 0; }
}
@media (max-width: 760px) {
  body { overflow: auto; }
  .app-shell { height: auto; min-height: 100dvh; overflow: visible; }
  .topbar { height: 50px; flex-basis: 50px; padding: 0 13px; }
  .brand-mark { width: 25px; height: 25px; }
  .brand-name { font-size: 9px; }
  .brand-subtitle { font-size: 7px; }
  .topbar-right { gap: 5px; }
  .seed-chip { padding: 6px 7px; font-size: 7px; }
  .runtime-chip { display: none; }
  .workspace { display: flex; flex-direction: column; min-height: 0; }
  .stage { height: min(54dvh, 470px); min-height: 340px; flex: 0 0 auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .scene-host { inset: 0 0 28px; }
  .stage-kicker { top: 13px; left: 13px; font-size: 7px; }
  .stage-bottom-left { left: 13px; bottom: 12px; }
  .stage-bottom-right { right: 12px; bottom: 12px; }
  .scene-caption { font-size: 6px; letter-spacing: .06em; }
  .view-hint { font-size: 6px; }
  .scene-coordinates { font-size: 6px; }
  .annotation { font-size: 7px; }
  .annotation b, .annotation small { font-size: 7px; }
  .stage-footer { padding: 0 11px; gap: 8px; }
  .stage-footer-left { min-width: 150px; font-size: 7px; }
  .stage-footer-right { min-width: 54px; font-size: 7px; }
  .control-panel { min-height: 0; }
  .panel-scroll { height: auto; overflow: visible; padding: 18px 16px 25px; }
  .panel-heading { padding-bottom: 14px; }
  h1 { font-size: 29px; }
  .transport-section, .presets-section, .parameters-section, .readouts-section { padding: 14px 0; }
  .parameter-list { gap: 13px; }
  .readout-card { min-height: 72px; }
  .app-footer { display: none; }
  .toast { bottom: 14px; max-width: calc(100vw - 24px); white-space: normal; text-align: center; }
  .embed .workspace { display: flex; }
  .embed .stage { height: 52dvh; }
}
@media (max-width: 390px) {
  .topbar { padding: 0 10px; }
  .brand-lockup { gap: 8px; }
  .brand-name { font-size: 8px; letter-spacing: .13em; }
  .seed-chip { padding: 5px 6px; }
  .panel-scroll { padding-left: 13px; padding-right: 13px; }
  .preset { padding: 8px 6px; }
  .preset b { font-size: 8px; }
  .preset small { font-size: 6px; }
  .panel-actions { grid-template-columns: 1fr 64px 1.1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
