:root {
  color-scheme: dark;
  --bg: #071522;
  --bg-deep: #05101a;
  --panel: #0c1d2b;
  --panel-2: #102536;
  --panel-3: #142d40;
  --line: rgba(157, 193, 215, 0.13);
  --line-strong: rgba(157, 193, 215, 0.23);
  --text: #e9f3f8;
  --muted: #8ca4b5;
  --subtle: #5f788a;
  --cyan: #7bd6f2;
  --cyan-strong: #45bfe6;
  --gold: #f1c98d;
  --green: #8ee0c1;
  --danger: #ffb0a4;
  --radius: 12px;
  --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, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-width: 320px; overflow-x: hidden; }
button, input, select { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(ellipse at 50% -20%, #173247 0%, var(--bg) 46%); }
.topbar { height: 72px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(5, 16, 26, .86); flex: 0 0 auto; }
.brand-lockup { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark { width: 32px; height: 32px; border: 1px solid rgba(123,214,242,.4); border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 2px; transform: rotate(30deg); background: rgba(67,174,208,.08); }
.brand-mark span { display: block; width: 3px; border-radius: 3px; background: var(--cyan); }
.brand-mark span:nth-child(1) { height: 10px; opacity: .5; }
.brand-mark span:nth-child(2) { height: 17px; }
.brand-mark span:nth-child(3) { height: 12px; opacity: .7; }
.eyebrow, .card-eyebrow, .scene-overline { color: #7694a9; font-size: 9px; line-height: 1.4; font-weight: 750; letter-spacing: .16em; }
.brand-lockup h1 { font-size: 16px; font-weight: 650; letter-spacing: -.02em; margin: 3px 0 0; white-space: nowrap; }
.brand-lockup h1 span { color: #91aabd; font-weight: 450; }
.topbar-right { display: flex; align-items: center; gap: 20px; }
.live-pill { display: flex; align-items: center; gap: 8px; font-size: 9px; letter-spacing: .12em; color: #9dc4d2; font-weight: 750; }
.live-dot, .hud-dot, .tiny-dot { width: 6px; height: 6px; border-radius: 50%; background: #75e0b8; box-shadow: 0 0 12px rgba(117,224,184,.7); }
.seed-tag { color: var(--subtle); font-size: 9px; letter-spacing: .1em; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; }
.seed-tag strong { color: #b8d1df; margin-left: 4px; font-variant-numeric: tabular-nums; }
.workspace { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 288px minmax(420px, 1fr) 292px; gap: 1px; background: var(--line); }
.control-rail, .insight-rail { background: #091a28; min-width: 0; }
.control-rail { padding: 20px 18px 14px; overflow-y: auto; max-height: calc(100vh - 108px); scrollbar-width: thin; scrollbar-color: #294356 transparent; }
.panel-heading { margin-bottom: 18px; }
.panel-title-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 5px; }
.panel-title-row h2 { margin: 0; font-size: 15px; letter-spacing: -.025em; font-weight: 650; }
.panel-index { color: #557286; font-size: 9px; letter-spacing: .08em; }
.control-section { border-top: 1px solid var(--line); padding: 16px 0 14px; }
.preset-section { border-top: 0; padding-top: 0; }
.field-label { display: block; color: #7f9aac; font-size: 9px; font-weight: 750; letter-spacing: .13em; margin-bottom: 8px; }
.select-control { width: 100%; height: 36px; border: 1px solid var(--line-strong); border-radius: 7px; background: #102537; color: #e1edf4; padding: 0 10px; font-size: 11px; outline: none; }
.select-control:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.microcopy { color: #678397; font-size: 9px; margin: 7px 0 0; }
.section-kicker { color: #7190a4; font-size: 9px; letter-spacing: .13em; font-weight: 750; margin-bottom: 13px; }
.section-kicker span { display: inline-flex; width: 18px; height: 18px; align-items: center; justify-content: center; margin-right: 6px; border-radius: 5px; background: #163349; color: var(--cyan); font-size: 8px; }
.range-control { margin-bottom: 14px; }
.range-control:last-child { margin-bottom: 0; }
.range-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.range-head label { color: #d0e0e9; font-size: 11px; font-weight: 550; }
.range-head output { color: var(--cyan); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { width: 100%; height: 14px; margin: 0; appearance: none; background: transparent; cursor: pointer; accent-color: var(--cyan); }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, #3284a5, #274458); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, #3284a5, #274458); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; border: 2px solid #d7f5ff; border-radius: 50%; background: #4ebddd; margin-top: -4.5px; box-shadow: 0 0 0 3px rgba(78,189,221,.12); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #d7f5ff; border-radius: 50%; background: #4ebddd; box-shadow: 0 0 0 3px rgba(78,189,221,.12); }
.range-scale { display: flex; justify-content: space-between; color: #587285; font-size: 8px; margin-top: 3px; }
.transport-row { display: grid; grid-template-columns: 1fr 40px 40px; gap: 7px; margin-bottom: 14px; }
.primary-button, .icon-button, .tool-button { border: 1px solid var(--line-strong); border-radius: 7px; cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.primary-button { height: 36px; background: #17405a; color: #d9f4ff; display: flex; align-items: center; justify-content: center; gap: 9px; font-size: 11px; font-weight: 700; border-color: rgba(89,193,225,.35); }
.primary-button:hover { background: #1c526e; }
.primary-button span:first-child { font-size: 12px; }
.icon-button { height: 36px; background: #102537; color: #a9c2d1; font-size: 15px; }
.icon-button:hover, .tool-button:hover { background: #17354a; border-color: rgba(123,214,242,.45); }
.speed-control { margin-bottom: 12px; }
.quality-row { display: flex; justify-content: space-between; align-items: center; }
.quality-row .field-label { margin: 0; }
.segmented-control { display: inline-flex; padding: 3px; gap: 2px; border-radius: 7px; background: #06131e; border: 1px solid var(--line); }
.segmented-control button { border: 0; background: transparent; color: #7791a3; padding: 5px 11px; border-radius: 5px; font-size: 9px; cursor: pointer; }
.segmented-control button[aria-pressed="true"] { color: #d9f5ff; background: #1a4961; }
.rail-footnote { border-top: 1px solid var(--line); padding-top: 13px; display: flex; gap: 8px; align-items: center; color: #5e788b; font-size: 8px; letter-spacing: .04em; }
.tiny-dot { width: 5px; height: 5px; box-shadow: none; }
.visual-column { min-width: 0; background: #071522; display: flex; flex-direction: column; }
.scene-toolbar { min-height: 64px; padding: 11px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: rgba(8,24,36,.94); }
.scene-heading h2 { margin: 3px 0 0; font-size: 14px; font-weight: 650; letter-spacing: -.02em; }
.scene-overline { font-size: 8px; }
.scene-tools { display: flex; gap: 7px; }
.tool-button { height: 31px; padding: 0 10px; display: flex; align-items: center; gap: 6px; background: #0e2333; color: #a7c1d1; font-size: 9px; }
.tool-button span { color: var(--cyan); font-size: 13px; }
.export-button { color: #d9f1f8; border-color: rgba(123,214,242,.28); }
.scene-host { position: relative; flex: 1 1 auto; min-height: 390px; overflow: hidden; background: linear-gradient(180deg, #122b42, #88aabd 62%, #294357); }
#scene-canvas { display: block; width: 100%; height: 100%; outline: none; }
.scene-vignette { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(4,14,23,.22), transparent 22%, transparent 72%, rgba(4,14,23,.3)), radial-gradient(ellipse at 50% 42%, transparent 38%, rgba(4,14,23,.18) 100%); }
.scene-hud { position: absolute; top: 14px; z-index: 2; color: rgba(227,242,249,.8); font-size: 8px; letter-spacing: .13em; font-weight: 750; text-shadow: 0 1px 8px rgba(0,0,0,.5); pointer-events: none; }
.hud-top-left { left: 15px; display: flex; align-items: center; gap: 7px; }
.hud-dot { width: 5px; height: 5px; }
.hud-separator { color: rgba(226,242,248,.36); }
.hud-top-right { right: 15px; color: rgba(221,238,246,.55); }
.hud-top-right strong { color: #e3f4fa; font-weight: 650; margin-left: 5px; }
.scene-label { position: absolute; z-index: 3; pointer-events: none; display: none; align-items: center; gap: 6px; color: #e6f4fa; font-size: 8px; letter-spacing: .12em; font-weight: 800; text-shadow: 0 1px 7px #0a1b27; white-space: nowrap; }
.label-pin { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 9px rgba(241,201,141,.9); }
.label-crystal .label-pin { background: var(--cyan); box-shadow: 0 0 9px rgba(123,214,242,.9); }
.label-subsun .label-pin { background: #fff2d4; box-shadow: 0 0 12px rgba(255,242,212,.9); }
.scene-legend { position: absolute; left: 15px; bottom: 38px; z-index: 2; padding: 9px 11px; display: grid; gap: 7px; background: rgba(5,18,29,.62); border: 1px solid rgba(213,235,245,.14); border-radius: 8px; backdrop-filter: blur(9px); color: rgba(222,238,245,.78); font-size: 8px; pointer-events: none; }
.scene-legend div { display: flex; align-items: center; gap: 8px; }
.legend-line { width: 18px; height: 2px; display: inline-block; }
.legend-in { background: #ffc879; }
.legend-out { background: #76d9ff; }
.legend-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: #fff1d5; box-shadow: 0 0 8px #fff1d5; }
.scene-bottom-note { position: absolute; bottom: 14px; right: 15px; z-index: 2; color: rgba(226,240,246,.55); font-size: 8px; letter-spacing: .12em; pointer-events: none; }
.scene-bottom-note span { color: var(--cyan); margin: 0 4px; }
.context-overlay { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(3,12,20,.75); backdrop-filter: blur(8px); }
.context-overlay[hidden] { display: none; }
.context-card { display: grid; gap: 8px; padding: 20px; max-width: 290px; border: 1px solid var(--line-strong); border-radius: 12px; background: #102638; text-align: center; }
.context-card strong { font-size: 13px; }
.context-card span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.readout-strip { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); background: #091b29; min-height: 82px; }
.readout-card { min-width: 0; padding: 13px 12px 11px; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.readout-card:last-child { border-right: 0; }
.readout-label { color: #6e8b9f; font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.readout-card strong { color: #e6f4fa; font-size: 17px; line-height: 1.1; font-weight: 650; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.readout-sub { color: #668296; font-size: 8px; }
.insight-rail { padding: 18px 15px 14px; overflow-y: auto; max-height: calc(100vh - 108px); scrollbar-width: thin; scrollbar-color: #294356 transparent; display: flex; flex-direction: column; gap: 12px; }
.insight-card, .validation-card, .science-card { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(150deg, rgba(17,42,60,.88), rgba(10,27,41,.95)); }
.mechanism-card { padding: 15px 14px 13px; }
.mechanism-card h2 { font-size: 16px; letter-spacing: -.03em; margin: 5px 0 7px; }
.mechanism-card > p { color: #91a9b9; font-size: 10px; line-height: 1.55; margin: 0 0 13px; }
.mechanism-steps { display: grid; gap: 12px; }
.mechanism-step { display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: start; }
.step-number { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; background: rgba(75,165,199,.12); color: var(--cyan); font-size: 8px; font-weight: 800; }
.mechanism-step strong { display: block; color: #d9e8ef; font-size: 10px; margin: 1px 0 3px; }
.mechanism-step small { display: block; color: #7792a4; font-size: 9px; line-height: 1.45; }
.intensity-block { margin-top: 15px; padding-top: 12px; border-top: 1px solid var(--line); }
.intensity-head, .intensity-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.intensity-head span { color: #7894a6; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.intensity-head strong { color: var(--cyan); font-size: 10px; font-variant-numeric: tabular-nums; }
.intensity-track { height: 5px; background: #071722; border-radius: 5px; overflow: hidden; margin: 8px 0 6px; }
.intensity-track span { display: block; height: 100%; width: 35%; border-radius: inherit; background: linear-gradient(90deg, #5d9cb8, #e6c994); box-shadow: 0 0 9px rgba(123,214,242,.35); transition: width .25s ease; }
.intensity-foot { color: #5f7b8e; font-size: 8px; }
.validation-card { padding: 13px 14px 12px; }
.validation-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.validation-head h3 { margin: 4px 0 0; font-size: 13px; }
.validation-badge { border: 1px solid rgba(142,224,193,.3); color: var(--green); border-radius: 5px; padding: 4px 6px; font-size: 8px; letter-spacing: .1em; font-weight: 800; }
.validation-badge:not(.pass) { border-color: rgba(255,176,164,.4); color: var(--danger); }
.validation-equation { color: #c3e0ed; padding: 9px 10px; margin: 11px 0 9px; border-radius: 6px; background: rgba(4,17,27,.62); text-align: center; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.validation-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; color: #7e9aab; font-size: 9px; }
.validation-row strong { color: #d9eaf1; font-size: 9px; font-variant-numeric: tabular-nums; }
.validation-difference { border-top: 1px solid var(--line); margin-top: 3px; padding-top: 8px; }
.validation-note { color: #5e7a8c; font-size: 8px; line-height: 1.5; margin: 8px 0 0; }
.science-card { overflow: hidden; }
.science-card summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 13px 14px; }
.science-card summary::-webkit-details-marker { display: none; }
.science-card summary strong { display: block; margin-top: 3px; font-size: 13px; }
.details-icon { width: 23px; height: 23px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--cyan); font-size: 16px; }
.science-content { padding: 0 14px 14px; border-top: 1px solid var(--line); }
.science-content h4 { margin: 13px 0 6px; color: #cde1eb; font-size: 10px; }
.science-content p, .science-content li { color: #829bac; font-size: 9px; line-height: 1.55; }
.science-content p { margin: 6px 0 9px; }
.science-content ul { padding-left: 16px; margin: 6px 0 12px; }
.science-content li { margin: 4px 0; }
.equation-block { padding: 8px; margin: 5px 0; border-radius: 6px; background: rgba(3,15,24,.7); color: #c1e0ec; text-align: center; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; }
.model-labels { display: flex; flex-wrap: wrap; gap: 5px; }
.model-labels span { padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; color: #80a0b3; font-size: 7px; letter-spacing: .04em; }
.science-content .disclaimer { margin: 12px 0 0; color: #a4bdc9; font-size: 8px; font-style: italic; }
.qa-foot { color: #658397; font-size: 8px; letter-spacing: .12em; font-weight: 800; text-align: right; margin-top: auto; padding-top: 4px; }
.qa-foot.pass { color: var(--green); }
.footerbar { height: 36px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-top: 1px solid var(--line); background: #06131e; color: #4f6b7e; font-size: 8px; letter-spacing: .12em; }
.footerbar i { color: #2c5268; font-style: normal; margin: 0 5px; }
.embed-mode .topbar, .embed-mode .footerbar { display: none; }
.embed-mode .workspace { grid-template-columns: 250px minmax(0,1fr) 260px; min-height: 100vh; }
.embed-mode .control-rail, .embed-mode .insight-rail { max-height: 100vh; }
.embed-mode .scene-host { min-height: 500px; }
@media (max-width: 1180px) {
  .workspace { grid-template-columns: 260px minmax(360px,1fr); }
  .insight-rail { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: start; max-height: none; }
  .qa-foot { grid-column: 1 / -1; }
  .control-rail { max-height: none; }
  .scene-host { min-height: 430px; }
  .embed-mode .workspace { grid-template-columns: 250px minmax(0,1fr); }
  .embed-mode .insight-rail { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .topbar { height: 62px; padding: 0 14px; }
  .brand-mark { width: 28px; height: 28px; }
  .brand-lockup h1 { font-size: 14px; }
  .brand-lockup h1 span { display: none; }
  .topbar-right { gap: 8px; }
  .live-pill { font-size: 7px; letter-spacing: .07em; }
  .seed-tag { padding: 6px 7px; font-size: 8px; }
  .workspace { display: flex; flex-direction: column; gap: 1px; }
  .visual-column { order: 0; }
  .scene-toolbar { min-height: 58px; padding: 9px 12px; }
  .scene-heading h2 { font-size: 12px; }
  .scene-tools { gap: 5px; }
  .tool-button { height: 29px; padding: 0 8px; font-size: 8px; }
  .scene-host { min-height: 0; height: min(56vh, 470px); }
  .scene-hud { top: 10px; font-size: 7px; }
  .hud-top-left { left: 9px; }
  .hud-top-right { right: 9px; }
  .scene-legend { left: 9px; bottom: 31px; padding: 7px 8px; font-size: 7px; }
  .scene-bottom-note { right: 9px; bottom: 11px; font-size: 7px; }
  .readout-strip { grid-template-columns: repeat(2,1fr); }
  .readout-card { min-height: 68px; padding: 10px; border-bottom: 1px solid var(--line); }
  .readout-card:nth-child(2) { border-right: 0; }
  .readout-card:nth-child(3), .readout-card:nth-child(4) { border-bottom: 0; }
  .readout-card strong { font-size: 15px; }
  .control-rail { order: 1; max-height: none; padding: 17px 15px 14px; }
  .control-rail .panel-heading { margin-bottom: 13px; }
  .control-section { padding: 14px 0 12px; }
  .insight-rail { order: 2; display: flex; max-height: none; padding: 14px; }
  .footerbar { height: 32px; padding: 0 12px; font-size: 7px; }
  .scene-label { font-size: 7px; }
  .embed-mode .workspace { display: flex; }
  .embed-mode .scene-host { height: 60vh; }
}
@media (max-width: 390px) {
  .scene-heading h2 { font-size: 11px; }
  .scene-tools .tool-button { padding: 0 6px; }
  .hud-top-right { display: none; }
  .readout-card strong { font-size: 14px; }
  .control-rail { padding-left: 12px; padding-right: 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; }
}
