:root {
  color-scheme: dark;
  --bg: #080d18;
  --panel: rgba(14, 22, 38, .96);
  --panel-2: rgba(18, 29, 48, .92);
  --line: rgba(157, 183, 220, .13);
  --line-strong: rgba(157, 183, 220, .24);
  --text: #e9f1ff;
  --muted: #8fa2bd;
  --faint: #60728e;
  --cyan: #74d8ed;
  --ice: #b6e9ff;
  --violet: #b9a4ff;
  --gold: #f0c88d;
  --green: #7ce4bd;
  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; width: 100%; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); }
body { background-image: radial-gradient(ellipse at 42% 45%, rgba(34, 69, 105, .14), transparent 50%), linear-gradient(145deg, #080d18, #0b1322 58%, #080d18); }
button, input, select { font: inherit; }
button { color: inherit; }
.app-shell { height: 100svh; min-height: 620px; display: grid; grid-template-rows: 70px minmax(0, 1fr) 104px; gap: 0; padding: 0 18px 14px; max-width: 1920px; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 0 4px; min-width: 0; }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 31px; height: 31px; position: relative; border: 1px solid rgba(116,216,237,.38); border-radius: 10px; display: grid; place-items: center; transform: rotate(45deg); background: rgba(116,216,237,.05); }
.brand-mark span { position: absolute; width: 18px; height: 1px; background: var(--cyan); transform: rotate(45deg); opacity: .85; }
.brand-mark span:nth-child(2) { transform: rotate(90deg); width: 14px; }
.brand-mark span:nth-child(3) { transform: rotate(135deg); width: 18px; }
.eyebrow { color: #8297b6; font-size: 9px; letter-spacing: .18em; font-weight: 750; }
.eyebrow span { color: #3f5876; padding: 0 4px; }
.brand-title { font-size: 15px; font-weight: 680; letter-spacing: -.02em; margin-top: 3px; }
.top-meta { display: flex; align-items: center; gap: 20px; }
.live-indicator { display: flex; align-items: center; gap: 8px; font-size: 9px; letter-spacing: .12em; color: #9db4ca; font-weight: 700; }
.live-indicator i { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(124,228,189,.8); }
.live-indicator.paused i { background: var(--gold); box-shadow: none; }
.seed-tag { border: 1px solid var(--line); border-radius: 5px; padding: 7px 9px; color: var(--faint); font-size: 9px; letter-spacing: .12em; }
.seed-tag b { color: #b7c8dc; margin-left: 5px; font-variant-numeric: tabular-nums; }
.workspace { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 344px; gap: 14px; padding: 14px 0 12px; }
.scene-card, .control-card { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: rgba(12, 19, 33, .75); min-width: 0; min-height: 0; box-shadow: 0 18px 60px rgba(0,0,0,.18); }
.scene-card { display: grid; grid-template-rows: minmax(0,1fr) 35px; position: relative; }
.scene-host { position: relative; min-height: 0; overflow: hidden; background: radial-gradient(ellipse at 48% 50%, #1a3450 0%, #101c30 43%, #080e1a 82%); }
.scene-host canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; outline: none; }
.scene-vignette { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at 50% 49%, transparent 40%, rgba(4,8,17,.42) 100%), linear-gradient(180deg, rgba(6,12,22,.14), transparent 25%, transparent 75%, rgba(6,12,22,.28)); }
.scene-caption { position: absolute; z-index: 2; left: 20px; bottom: 18px; display: flex; flex-direction: column; gap: 4px; pointer-events: none; text-shadow: 0 2px 12px #02060e; }
.caption-kicker { color: #8ca9c7; font-size: 8px; letter-spacing: .2em; font-weight: 800; }
.scene-caption strong { font-size: 13px; font-weight: 650; letter-spacing: -.01em; }
.scene-caption > span:last-child { color: #8da2bd; font-size: 10px; }
.scene-label { position: absolute; z-index: 2; display: flex; align-items: center; gap: 7px; pointer-events: none; color: #b8c9dc; font-size: 8px; letter-spacing: .16em; font-weight: 800; text-shadow: 0 1px 8px #030712; }
.scene-label i { width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px currentColor; }
.label-vortex { top: 18%; left: 12%; }
.label-psc { top: 29%; right: 15%; }
.label-psc i { background: var(--violet); }
.label-ozone { top: 12%; right: 12%; }
.label-ozone i { background: #66b8ec; }
.scene-tools { position: absolute; z-index: 3; top: 14px; right: 14px; display: flex; gap: 6px; }
.icon-button { width: 32px; height: 32px; border: 1px solid rgba(173,198,226,.19); background: rgba(8,15,28,.62); backdrop-filter: blur(12px); border-radius: 8px; color: #bfd0e5; font-size: 15px; cursor: pointer; transition: background .2s, border-color .2s, transform .2s; }
.icon-button:hover { background: rgba(50,82,114,.5); border-color: rgba(116,216,237,.45); transform: translateY(-1px); }
#qualityButton { font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.scene-legend { display: flex; align-items: center; gap: 17px; padding: 0 15px; border-top: 1px solid var(--line); background: rgba(10,17,30,.94); color: #8fa2bd; font-size: 9px; white-space: nowrap; overflow: hidden; }
.scene-legend span { display: inline-flex; align-items: center; gap: 6px; }
.scene-legend i { width: 7px; height: 7px; display: inline-block; border-radius: 50%; }
.legend-cloud { background: #c0b2ff; box-shadow: 0 0 8px #a89aff; }
.legend-vortex { background: #75d9e9; }
.legend-ozone { background: #6aa8e9; }
.legend-note { margin-left: auto; color: #647995; letter-spacing: .1em; font-size: 8px; }
.control-card { background: linear-gradient(160deg, rgba(16,25,42,.98), rgba(11,18,31,.98)); padding: 15px 15px 12px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #2a405e transparent; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.panel-heading h1 { font-size: 16px; margin: 5px 0 0; letter-spacing: -.025em; font-weight: 660; }
.panel-number { color: #425a79; font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.section-label { color: #8297b5; font-size: 8px; letter-spacing: .16em; font-weight: 800; margin-bottom: 8px; }
.section-label > span { float: right; color: #5fa9b7; font-size: 7px; }
.preset-block { padding: 13px 0 12px; border-bottom: 1px solid var(--line); }
.preset-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.preset-button { min-width: 0; border: 1px solid var(--line); background: rgba(21,33,52,.58); border-radius: 7px; padding: 8px 6px 7px; text-align: left; cursor: pointer; transition: .18s ease; }
.preset-button:hover { border-color: rgba(116,216,237,.35); background: rgba(31,50,74,.8); }
.preset-button.active { border-color: rgba(116,216,237,.58); background: rgba(42,82,103,.23); box-shadow: inset 0 0 0 1px rgba(116,216,237,.08); }
.preset-button b { display: block; font-size: 9px; font-weight: 700; margin-top: 5px; white-space: nowrap; }
.preset-button small { display: block; color: #788da9; font-size: 7px; margin-top: 3px; white-space: nowrap; }
.preset-dot { display: block; width: 6px; height: 6px; border-radius: 50%; box-shadow: 0 0 7px currentColor; }
.preset-dot.cold { background: #8fdcf1; color: #8fdcf1; }
.preset-dot.spring { background: #d3b4ff; color: #d3b4ff; }
.preset-dot.warm { background: #e4b77d; color: #e4b77d; }
.control-list { padding: 12px 0 6px; }
.control-row { display: block; margin: 0 0 11px; }
.control-name { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 10px; color: #b8c8dc; }
.control-name b { color: #e5f0ff; font-size: 10px; font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
input[type="range"] { display: block; width: 100%; height: 13px; margin: 5px 0 0; appearance: none; background: transparent; cursor: pointer; accent-color: var(--cyan); }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; background: linear-gradient(90deg, #4d8da8, #344761); border-radius: 4px; }
input[type="range"]::-moz-range-track { height: 3px; background: linear-gradient(90deg, #4d8da8, #344761); border-radius: 4px; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 11px; height: 11px; margin-top: -4px; border-radius: 50%; background: #d7f5ff; border: 2px solid #5ca9c1; box-shadow: 0 0 0 3px rgba(116,216,237,.12); }
input[type="range"]::-moz-range-thumb { width: 8px; height: 8px; border-radius: 50%; background: #d7f5ff; border: 2px solid #5ca9c1; box-shadow: 0 0 0 3px rgba(116,216,237,.12); }
input[type="range"]:focus-visible { outline: 1px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }
.range-ends { display: flex; justify-content: space-between; color: #657a96; font-size: 7px; margin-top: 1px; }
.transport-controls { padding: 10px 0 8px; border-top: 1px solid var(--line); }
.transport-buttons { display: flex; align-items: center; gap: 6px; }
.transport-primary, .transport-secondary { border: 1px solid var(--line-strong); background: rgba(25,39,61,.8); border-radius: 6px; height: 30px; cursor: pointer; transition: .2s; }
.transport-primary { min-width: 80px; display: flex; align-items: center; justify-content: center; gap: 7px; color: #c8eff7; font-size: 12px; }
.transport-primary span { font-size: 9px; font-weight: 700; }
.transport-secondary { width: 31px; color: #a9bdd4; font-size: 13px; }
.transport-primary:hover, .transport-secondary:hover { border-color: rgba(116,216,237,.55); background: rgba(45,79,105,.6); }
.speed-control { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.speed-control label { color: #7186a2; font-size: 7px; letter-spacing: .1em; font-weight: 800; }
.speed-control select { color: #c4d5e9; background: #142139; border: 1px solid var(--line-strong); border-radius: 5px; padding: 5px 7px; font-size: 9px; }
.day-track { display: flex; align-items: center; gap: 6px; margin-top: 9px; color: #7186a2; font-size: 8px; letter-spacing: .1em; }
.day-track b { margin-left: auto; color: #d5e7f8; font-size: 10px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.day-track-end { color: #91a5bf; }
.science-panel { border-top: 1px solid var(--line); margin-top: 3px; padding-top: 10px; }
.science-panel summary { display: flex; align-items: center; justify-content: space-between; list-style: none; cursor: pointer; color: #cbd8e8; font-size: 10px; font-weight: 700; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary > span:first-child { display: flex; align-items: center; gap: 8px; }
.science-panel summary i { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: rgba(116,216,237,.1); color: var(--cyan); font-style: normal; }
.summary-hint { color: #687d99; font-size: 7px; letter-spacing: .12em; }
.science-content { padding: 10px 1px 4px; }
.science-content h3 { font-size: 9px; color: #a8c7dc; margin: 10px 0 4px; }
.science-content p { color: #8ea2bb; font-size: 9px; line-height: 1.55; margin: 0 0 6px; }
.equation { color: #d2d7f6; background: rgba(89,90,143,.12); border: 1px solid rgba(153,145,226,.13); border-radius: 5px; padding: 7px 8px; font-size: 9px; line-height: 1.45; overflow-wrap: anywhere; }
.science-note { border-left: 2px solid rgba(116,216,237,.4); padding: 6px 8px; margin-top: 8px; color: #8196b0; background: rgba(116,216,237,.035); font-size: 8px; line-height: 1.5; }
.science-note b { color: #b5cde1; }
.bottom-bar { border: 1px solid var(--line); border-radius: 11px; background: linear-gradient(100deg, rgba(16,26,43,.97), rgba(12,20,34,.97)); display: grid; grid-template-columns: 1.12fr 1.3fr 1.15fr 1fr 1.3fr; align-items: center; min-height: 0; overflow: hidden; }
.readout, .validation-readout { padding: 13px 16px; min-width: 0; border-right: 1px solid var(--line); }
.validation-readout { border-right: 0; }
.readout-label { display: block; color: #7f94af; font-size: 8px; letter-spacing: .12em; font-weight: 800; white-space: nowrap; }
.readout-label em { color: #60758e; font-style: normal; font-size: 7px; margin-left: 3px; }
.readout strong, .validation-readout strong { display: block; color: #e2efff; font-size: 17px; font-weight: 650; letter-spacing: -.03em; margin-top: 7px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout strong small { color: #9cb1ca; font-size: 9px; font-weight: 500; letter-spacing: 0; }
.readout > small, .validation-readout > small { display: block; color: #7287a1; font-size: 8px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#pscRegime { font-size: 12px; letter-spacing: .01em; }
.validation-readout strong { color: var(--green); font-size: 16px; }
.toast { position: fixed; z-index: 10; left: 50%; bottom: 20px; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(12,22,38,.96); color: #d8e8f8; padding: 9px 13px; font-size: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.3); transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%,0); }
.context-notice { position: absolute; z-index: 5; left: 50%; top: 50%; transform: translate(-50%,-50%); width: min(80%, 420px); padding: 16px; border: 1px solid rgba(240,200,141,.35); border-radius: 9px; background: rgba(28,22,18,.92); color: #f2d9b4; text-align: center; font-size: 11px; line-height: 1.5; }
.embed .topbar, .embed .bottom-bar { display: none; }
.embed.app-shell { grid-template-rows: minmax(0,1fr); padding: 0; min-height: 0; }
.embed .workspace { padding: 0; grid-template-columns: minmax(0,1fr) 320px; }
.embed .scene-card, .embed .control-card { border-radius: 0; }
@media (max-width: 900px) {
  .app-shell { grid-template-rows: 62px minmax(0,1fr) 94px; padding: 0 10px 10px; }
  .workspace { grid-template-columns: minmax(0,1fr) 310px; gap: 9px; padding: 9px 0; }
  .control-card { padding: 12px; }
  .scene-legend { gap: 10px; }
  .legend-note { display: none !important; }
  .readout, .validation-readout { padding: 10px 9px; }
}
@media (max-width: 650px) {
  html, body { overflow: auto; }
  .app-shell { height: 100svh; min-height: 700px; grid-template-rows: 56px minmax(0,1fr) 88px; padding: 0 8px 8px; }
  .topbar { padding: 0 2px; }
  .brand-mark { width: 26px; height: 26px; }
  .brand-title { font-size: 13px; }
  .eyebrow { font-size: 8px; }
  .top-meta { gap: 9px; }
  .live-indicator { font-size: 7px; gap: 5px; }
  .seed-tag { padding: 6px; font-size: 7px; }
  .workspace { display: flex; flex-direction: column; gap: 8px; padding: 8px 0; overflow: hidden; }
  .scene-card { flex: 0 0 42%; min-height: 220px; grid-template-rows: minmax(0,1fr) 28px; }
  .control-card { flex: 1 1 auto; min-height: 0; padding: 10px 12px; }
  .panel-heading { padding-bottom: 8px; }
  .panel-heading h1 { font-size: 14px; }
  .preset-block { padding: 8px 0; }
  .preset-button { padding: 6px 5px; }
  .preset-button b { font-size: 8px; }
  .preset-button small { font-size: 6px; }
  .control-list { padding-top: 8px; }
  .control-row { margin-bottom: 8px; }
  .control-name { font-size: 9px; }
  .control-name b { font-size: 9px; }
  .range-ends { font-size: 6px; }
  .transport-controls { padding-top: 8px; }
  .science-panel { margin-top: 1px; padding-top: 8px; }
  .scene-label { font-size: 6px; }
  .label-vortex { left: 7%; }
  .label-psc { right: 6%; }
  .label-ozone { right: 7%; }
  .scene-caption { left: 11px; bottom: 10px; }
  .scene-caption strong { font-size: 10px; }
  .scene-caption > span:last-child { font-size: 8px; }
  .scene-tools { top: 8px; right: 8px; }
  .icon-button { width: 27px; height: 27px; }
  .scene-legend { padding: 0 8px; font-size: 7px; gap: 8px; }
  .scene-legend span { gap: 4px; }
  .scene-legend i { width: 5px; height: 5px; }
  .bottom-bar { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
  .readout, .validation-readout { padding: 6px 8px; }
  .readout:nth-child(3) { border-right: 0; }
  .readout:nth-child(4) { border-top: 1px solid var(--line); }
  .validation-readout { border-top: 1px solid var(--line); grid-column: span 2; }
  .readout-label { font-size: 6px; letter-spacing: .08em; }
  .readout-label em { font-size: 5px; }
  .readout strong, .validation-readout strong { font-size: 12px; margin-top: 3px; }
  #pscRegime { font-size: 8px; }
  .readout strong small { font-size: 7px; }
  .readout > small, .validation-readout > small { font-size: 6px; margin-top: 1px; }
  .validation-readout strong { font-size: 12px; }
  .embed .workspace { display: flex; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
