:root {
  color-scheme: dark;
  --bg: #071216;
  --panel: #0d1c21;
  --panel-2: #10242a;
  --line: rgba(151, 190, 185, .14);
  --muted: #88a09f;
  --text: #e8f1ec;
  --mint: #9de3c5;
  --gold: #f4c779;
  --cyan: #a6e5ed;
  --radius: 14px;
  font-family: 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); }
body { min-width: 320px; overflow-x: hidden; }
button, input, select { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100vh; background: radial-gradient(ellipse at 52% -25%, rgba(54, 105, 94, .16), transparent 54%), var(--bg); }
.topbar { height: 66px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(6, 17, 21, .88); }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 27px; height: 27px; position: relative; display: flex; align-items: center; justify-content: center; gap: 2px; border: 1px solid rgba(157, 227, 197, .4); border-radius: 50%; }
.brand-mark span { width: 3px; border-radius: 3px; background: var(--mint); display: block; }
.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: 8px; opacity: .55; }
.eyebrow, .section-kicker { color: #82a29d; font-size: 9px; font-weight: 800; letter-spacing: .17em; }
.eyebrow span { color: var(--gold); margin: 0 4px; }
.brand-title { font-size: 13px; font-weight: 650; letter-spacing: .015em; margin-top: 3px; }
.brand-title span { color: #6f8b87; padding: 0 3px; }
.topbar-right { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 10px; letter-spacing: .08em; }
.live-indicator { display: flex; align-items: center; gap: 7px; color: #a7d7c1; font-weight: 800; }
.live-indicator i { width: 6px; height: 6px; border-radius: 50%; background: #7ee1a8; box-shadow: 0 0 9px #7ee1a8; }
.seed-label b { color: #d9e8df; font-variant-numeric: tabular-nums; margin-left: 5px; }
.workspace { max-width: 1900px; margin: 0 auto; padding: 12px 14px 8px; display: grid; grid-template-columns: 282px minmax(400px, 1fr) 244px; grid-template-rows: minmax(480px, calc(100vh - 185px)) auto; gap: 12px; }
.panel { background: linear-gradient(155deg, rgba(17, 39, 43, .98), rgba(10, 25, 30, .98)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0,0,0,.18); }
.controls-panel { padding: 18px 17px 14px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #34534f transparent; }
.panel-heading h1 { margin: 7px 0 0; font-size: 29px; line-height: 1.02; letter-spacing: -.045em; font-weight: 680; }
.panel-subtitle { color: var(--gold); margin: 5px 0 0; font-size: 13px; font-weight: 650; letter-spacing: .025em; }
.intro-copy { color: #9cb1ad; font-size: 11px; line-height: 1.55; margin: 12px 0 18px; max-width: 238px; }
.control-section, .preset-section { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 13px; }
.section-title { color: #8aa7a1; font-size: 9px; font-weight: 850; letter-spacing: .15em; margin-bottom: 12px; }
.section-title span { color: var(--gold); margin-right: 7px; }
.control-row { margin-bottom: 13px; }
.control-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 7px; }
.control-label label { font-size: 11px; color: #d8e6df; font-weight: 580; }
.control-label output { color: var(--mint); font-size: 11px; font-weight: 750; font-variant-numeric: tabular-nums; }
input[type="range"] { appearance: none; width: 100%; height: 4px; border-radius: 6px; background: linear-gradient(90deg, #83cdb0 0%, #376e65 100%); outline: none; display: block; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #d9f4e7; border: 3px solid #4d9b7f; box-shadow: 0 0 0 3px rgba(128, 212, 176, .12); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: #d9f4e7; border: 3px solid #4d9b7f; box-shadow: 0 0 0 3px rgba(128, 212, 176, .12); }
input[type="range"]:focus-visible { outline: 2px solid var(--gold); outline-offset: 7px; }
.range-ends { display: flex; justify-content: space-between; color: #607d79; font-size: 8px; margin-top: 6px; letter-spacing: .02em; }
.preset-grid { display: grid; gap: 7px; }
.preset-button { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; padding: 8px 9px; border-radius: 9px; border: 1px solid rgba(144, 185, 173, .12); background: rgba(5, 18, 21, .38); cursor: pointer; transition: background .18s, border-color .18s, transform .18s; }
.preset-button:hover { background: rgba(42, 81, 69, .35); border-color: rgba(157, 227, 197, .4); }
.preset-button.active { border-color: rgba(157, 227, 197, .52); background: rgba(65, 116, 93, .22); }
.preset-icon { width: 25px; height: 25px; display: grid; place-items: center; color: var(--gold); border-radius: 7px; background: rgba(244, 199, 121, .09); font-size: 15px; }
.preset-button b { display: block; font-size: 10px; font-weight: 700; }
.preset-button small { display: block; color: #7e9a94; font-size: 8px; margin-top: 3px; }
.disclaimer-small { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 11px; color: #607a76; font-size: 8px; line-height: 1.45; }
.scene-panel { min-width: 0; min-height: 480px; border-radius: var(--radius); overflow: hidden; border: 1px solid rgba(151,190,185,.17); background: #081619; position: relative; display: flex; flex-direction: column; box-shadow: 0 14px 50px rgba(0,0,0,.28); }
.scene-topline { height: 42px; flex: 0 0 42px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; background: rgba(9, 25, 29, .93); border-bottom: 1px solid rgba(151,190,185,.12); color: #94b0a9; font-size: 9px; font-weight: 800; letter-spacing: .13em; position: relative; z-index: 2; }
.scene-dot { display: inline-block; width: 6px; height: 6px; background: var(--mint); border-radius: 50%; margin-right: 6px; box-shadow: 0 0 8px rgba(157,227,197,.8); }
.scene-divider { color: #4b6b64; margin: 0 7px; }
.scene-tools { display: flex; gap: 6px; }
.icon-button { min-width: 27px; height: 26px; border-radius: 7px; border: 1px solid rgba(143,183,170,.18); background: rgba(18,43,45,.72); color: #a8c3b8; font-size: 12px; font-weight: 800; cursor: pointer; }
.icon-button:hover { color: #f0f5e9; border-color: rgba(157,227,197,.5); }
.scene-viewport { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; background: linear-gradient(180deg, #152e37 0%, #8a927a 54%, #263d2d 100%); }
.scene-viewport canvas { display: block; width: 100%; height: 100%; outline: none; }
.scene-overlay { position: absolute; z-index: 1; display: flex; flex-direction: column; gap: 3px; pointer-events: none; text-shadow: 0 1px 7px rgba(0,0,0,.8); }
.scene-overlay-top { top: 17px; left: 17px; }
.scene-overlay-bottom { right: 16px; bottom: 39px; text-align: right; }
.overlay-label { color: #d6e6d7; font-size: 8px; font-weight: 850; letter-spacing: .16em; }
.overlay-value { color: rgba(211,231,220,.68); font-size: 9px; }
.scene-caption { position: absolute; bottom: 11px; left: 15px; z-index: 1; font-size: 8px; letter-spacing: .1em; color: rgba(225,237,223,.68); text-shadow: 0 1px 7px rgba(0,0,0,.8); pointer-events: none; }
.scene-caption span { color: var(--gold); font-weight: 900; }
.webgl-fallback { position: absolute; z-index: 4; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: rgba(4,15,18,.94); text-align: center; padding: 24px; }
.webgl-fallback[hidden] { display: none; }
.webgl-fallback strong { color: var(--gold); font-size: 17px; }
.webgl-fallback span { color: #9bb2aa; font-size: 12px; max-width: 280px; line-height: 1.5; }
.transport-bar { min-height: 48px; flex: 0 0 48px; border-top: 1px solid rgba(151,190,185,.14); background: rgba(8, 22, 26, .96); padding: 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.transport-controls { display: flex; align-items: center; gap: 6px; }
.transport-button { border: 1px solid rgba(147,184,172,.16); background: rgba(20,42,44,.72); border-radius: 7px; color: #a8bcb3; height: 29px; padding: 0 10px; display: flex; align-items: center; gap: 6px; font-size: 9px; cursor: pointer; }
.transport-button span { font-size: 12px; }
.transport-button.primary { background: rgba(107,169,132,.2); color: #c9f0d9; border-color: rgba(157,227,197,.34); }
.transport-button:hover { border-color: rgba(157,227,197,.55); color: #eff7ee; }
.transport-right { display: flex; align-items: center; gap: 8px; color: #718f88; font-size: 8px; letter-spacing: .12em; }
.transport-right select { color: #d1e5d8; background: #142b2d; border: 1px solid rgba(147,184,172,.18); border-radius: 6px; padding: 5px 6px; font-size: 9px; }
.time-readout { min-width: 49px; text-align: right; color: #a5c2b7; font-variant-numeric: tabular-nums; font-size: 9px; letter-spacing: .04em; }
.telemetry-panel { padding: 18px 14px; overflow-y: auto; }
.telemetry-panel h2 { font-size: 17px; margin: 6px 0 15px; letter-spacing: -.025em; }
.telemetry-grid { display: grid; gap: 8px; }
.metric-card { padding: 11px 11px 10px; border-radius: 10px; border: 1px solid rgba(148,188,174,.13); background: rgba(5,17,20,.42); }
.metric-primary { background: linear-gradient(135deg, rgba(63,108,82,.24), rgba(7,23,25,.48)); border-color: rgba(157,227,197,.25); }
.metric-name { display: flex; align-items: center; justify-content: space-between; gap: 5px; color: #a9beb5; font-size: 9px; font-weight: 650; }
.metric-name span { color: #6f9587; font-size: 7px; font-weight: 850; letter-spacing: .08em; }
.metric-value { margin-top: 7px; color: #e3f2e8; font-size: 25px; line-height: 1; font-weight: 650; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.metric-primary .metric-value { color: var(--mint); }
.metric-value small { font-size: 10px; color: #91b0a3; font-weight: 600; letter-spacing: 0; }
.metric-note { margin-top: 6px; color: #68847d; font-size: 8px; }
.validation-card { border: 1px solid rgba(157,227,197,.2); background: rgba(29,67,54,.17); border-radius: 10px; padding: 11px; margin-top: 14px; }
.validation-heading { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid rgba(157,227,197,.12); }
.validation-mark { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: rgba(157,227,197,.13); color: var(--mint); font-size: 11px; }
.validation-heading b { display: block; font-size: 10px; }
.validation-heading small { display: block; color: #78968b; font-size: 8px; margin-top: 2px; }
.validation-row, .validation-footer { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 8px; font-size: 8px; color: #819c91; }
.validation-row b { color: #cfe6d7; font-size: 9px; font-variant-numeric: tabular-nums; }
.validation-footer { border-top: 1px solid rgba(157,227,197,.12); padding-top: 8px; color: #a0bcb0; }
.validation-footer b { color: var(--mint); font-size: 10px; font-variant-numeric: tabular-nums; }
.validation-note { color: #67827a; font-size: 7px; line-height: 1.4; margin-top: 7px; }
.mini-key { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 11px; display: grid; gap: 8px; }
.mini-key div { display: flex; align-items: center; gap: 8px; color: #819b93; font-size: 8px; }
.key-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.sun-key { background: #f4c779; box-shadow: 0 0 8px rgba(244,199,121,.8); }
.dew-key { background: #a6e5ed; box-shadow: 0 0 8px rgba(166,229,237,.7); }
.halo-key { background: #fff1bf; box-shadow: 0 0 8px rgba(255,241,191,.8); }
.science-panel { grid-column: 1 / -1; padding: 0 17px; }
.science-panel details > summary { min-height: 54px; display: flex; align-items: center; gap: 11px; cursor: pointer; list-style: none; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-icon { width: 27px; height: 27px; border-radius: 8px; display: grid; place-items: center; color: var(--gold); background: rgba(244,199,121,.1); font-size: 15px; }
.science-panel summary b { display: block; font-size: 11px; }
.science-panel summary small { display: block; color: #78938b; font-size: 8px; margin-top: 3px; }
.summary-chevron { margin-left: auto; color: #7e9e91; font-size: 16px; transition: transform .2s; }
.science-panel details[open] .summary-chevron { transform: rotate(180deg); }
.science-content { border-top: 1px solid var(--line); padding: 15px 0 17px; display: grid; grid-template-columns: 1.1fr 1fr 1.1fr; gap: 22px; }
.science-column h3 { color: #d8e9df; font-size: 10px; margin: 0 0 9px; letter-spacing: .03em; }
.science-column p, .science-column li { color: #91a9a0; font-size: 9px; line-height: 1.55; }
.science-column p { margin: 0 0 7px; }
.science-column b { color: #c5ddd0; }
.science-column ul { padding-left: 14px; margin: 0 0 8px; }
.science-column li { margin-bottom: 4px; }
.equation { margin: 0 0 9px; padding-left: 8px; border-left: 2px solid rgba(244,199,121,.45); }
.equation b { display: block; font-size: 8px; color: #d4e5da; }
.equation code { display: block; color: var(--gold); font-size: 12px; margin: 3px 0; }
.equation small { color: #78958b; font-size: 7px; }
.model-note { padding: 7px 8px; border-radius: 7px; background: rgba(244,199,121,.06); color: #b49b70 !important; }
.footer { display: flex; justify-content: space-between; padding: 4px 18px 9px; color: #4d6c65; font-size: 7px; font-weight: 750; letter-spacing: .13em; }
button:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
body.embed .topbar, body.embed .footer, body.embed .telemetry-panel, body.embed .science-panel, body.embed .controls-panel { display: none; }
body.embed .workspace { display: block; height: 100vh; padding: 0; }
body.embed .scene-panel { height: 100vh; min-height: 0; border-radius: 0; border: 0; }
body.embed .scene-viewport { min-height: 0; }
@media (max-width: 1120px) {
  .workspace { grid-template-columns: 260px minmax(350px, 1fr); grid-template-rows: minmax(540px, calc(100vh - 120px)) auto auto; }
  .telemetry-panel { grid-column: 1 / -1; display: grid; grid-template-columns: 170px 1fr 1fr; align-items: start; gap: 12px; }
  .telemetry-panel h2 { grid-column: 1; grid-row: 2; margin-top: -8px; }
  .telemetry-panel .section-kicker { grid-column: 1; }
  .telemetry-grid { grid-column: 2; grid-row: 1 / span 2; grid-template-columns: repeat(4, 1fr); }
  .validation-card { grid-column: 3; grid-row: 1 / span 2; margin-top: 0; }
  .mini-key { display: none; }
}
@media (max-width: 760px) {
  .topbar { height: 58px; padding: 0 13px; }
  .brand-title { font-size: 11px; }
  .eyebrow { font-size: 8px; }
  .topbar-right { gap: 8px; font-size: 8px; }
  .live-indicator { display: none; }
  .workspace { display: flex; flex-direction: column; padding: 8px; gap: 9px; height: auto; }
  .scene-panel { order: 0; min-height: 0; height: 430px; flex: none; }
  .controls-panel { order: 1; overflow: visible; padding: 16px; }
  .telemetry-panel { order: 2; display: block; padding: 15px; }
  .telemetry-panel h2 { margin: 6px 0 12px; }
  .telemetry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .validation-card { margin-top: 12px; }
  .mini-key { display: grid; grid-template-columns: repeat(3,1fr); }
  .science-panel { order: 3; padding: 0 13px; }
  .science-content { grid-template-columns: 1fr; gap: 13px; }
  .footer { padding: 4px 12px 10px; font-size: 6px; }
  .scene-topline { height: 38px; flex-basis: 38px; padding: 0 9px; font-size: 8px; }
  .scene-caption { font-size: 6px; }
  .scene-overlay-top { top: 12px; left: 11px; }
  .scene-overlay-bottom { right: 10px; bottom: 32px; }
  .transport-bar { padding: 0 8px; }
  .transport-button { padding: 0 7px; font-size: 8px; }
  .transport-right { gap: 5px; }
}
@media (max-width: 390px) {
  .seed-label { display: none; }
  .brand-mark { width: 24px; height: 24px; }
  .scene-panel { height: 390px; }
  .transport-button { gap: 4px; }
  .transport-button:not(.primary) { padding: 0 6px; }
  .transport-right label { display: none; }
  .time-readout { min-width: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
