:root {
  color-scheme: dark;
  --bg: #0a0f13;
  --panel: #11191f;
  --panel-2: #151f26;
  --line: rgba(177, 205, 211, .12);
  --line-strong: rgba(177, 205, 211, .22);
  --text: #e7eeec;
  --muted: #87969a;
  --muted-2: #617177;
  --teal: #8ad3c5;
  --teal-bright: #b0eee0;
  --sand: #d9ad78;
  --amber: #e2b87f;
  --danger: #d18c74;
  --radius: 12px;
  --space: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: radial-gradient(ellipse at 48% -20%, #18252a 0, var(--bg) 48%); min-height: 100vh; }
button, select, input { font: inherit; }
button { color: inherit; }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--teal-bright); outline-offset: 3px; }
.app-shell { width: min(1680px, 100%); margin: 0 auto; padding: 0 24px 18px; }
.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); gap: 16px; }
.brand-lockup { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark { width: 30px; height: 30px; position: relative; border: 1px solid rgba(138,211,197,.48); border-radius: 9px; transform: rotate(-8deg); display: grid; place-items: center; }
.brand-mark span { position: absolute; width: 15px; height: 1px; background: var(--teal); transform: rotate(-30deg); }
.brand-mark span:nth-child(2) { transform: rotate(30deg); width: 18px; }
.brand-mark span:nth-child(3) { transform: rotate(90deg); width: 12px; }
.eyebrow { color: var(--teal); font-size: 9px; font-weight: 800; letter-spacing: .19em; line-height: 1.4; }
h1 { margin: 4px 0 0; font-size: 14px; line-height: 1.1; letter-spacing: .11em; font-weight: 750; }
h1 span { color: var(--sand); padding: 0 3px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.live-indicator { display: flex; align-items: center; gap: 8px; color: #a9b8b8; font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.live-indicator i, .state-pulse, .chip-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 12px rgba(138,211,197,.7); }
.icon-button { width: 29px; height: 29px; border: 1px solid var(--line-strong); background: transparent; border-radius: 50%; color: var(--teal); font-family: Georgia, serif; font-size: 15px; cursor: pointer; transition: background .2s, border-color .2s; }
.icon-button:hover { background: rgba(138,211,197,.1); border-color: var(--teal); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 328px; gap: 18px; padding-top: 18px; align-items: start; }
.visual-column { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.scene-shell { position: relative; width: 100%; height: clamp(350px, 52vh, 560px); min-height: 340px; overflow: hidden; border: 1px solid rgba(171,197,193,.16); border-radius: 14px; background: radial-gradient(ellipse at 48% 60%, #28343a 0, #131d23 46%, #0d151a 100%); isolation: isolate; }
.scene-mount { position: absolute; inset: 0; z-index: 1; }
.scene-mount canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.scene-vignette { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(180deg, rgba(6,11,14,.34), transparent 22%, transparent 76%, rgba(6,11,14,.46)), radial-gradient(ellipse at center, transparent 42%, rgba(4,8,10,.3) 100%); }
.scene-topline, .scene-bottomline { position: absolute; z-index: 4; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.scene-topline { top: 15px; }
.scene-bottomline { bottom: 14px; }
.scene-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 5px; border: 1px solid rgba(194,219,215,.17); background: rgba(8,14,17,.68); backdrop-filter: blur(10px); color: #d3e0dd; font-size: 8px; letter-spacing: .14em; font-weight: 800; }
.scene-chip-muted { color: #85969a; border-color: rgba(194,219,215,.1); }
.chip-dot { width: 5px; height: 5px; }
.annotation { position: absolute; z-index: 4; display: flex; flex-direction: column; gap: 3px; padding: 7px 9px; border-left: 1px solid var(--teal); background: rgba(7,13,16,.66); backdrop-filter: blur(8px); pointer-events: none; transition: opacity .25s; }
.annotation b { color: var(--teal-bright); font-size: 8px; letter-spacing: .14em; }
.annotation span { color: #aab9b6; font-size: 9px; }
.annotation-wind { left: 12%; top: 44%; }
.annotation-lee { right: 9%; top: 62%; border-left-color: var(--sand); }
.annotation-lee b { color: var(--sand); }
.orientation-readout { display: flex; align-items: center; gap: 8px; color: #b5c3c0; font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.north-mark { display: inline-grid; place-items: center; width: 17px; height: 17px; border: 1px solid rgba(138,211,197,.6); border-radius: 50%; color: var(--teal); font-size: 8px; }
.scene-hint { color: #819094; font-size: 8px; letter-spacing: .12em; }
.scene-hint span { color: var(--sand); padding: 0 4px; }
.scene-loader { position: absolute; z-index: 6; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #a9b9b5; font-size: 9px; font-weight: 800; letter-spacing: .18em; background: rgba(8,14,17,.84); transition: opacity .5s; }
.scene-loader.hidden { opacity: 0; pointer-events: none; }
.loader-ring { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(138,211,197,.16); border-top-color: var(--teal); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.webgl-warning[hidden] { display: none; }
.webgl-warning { position: absolute; inset: 20%; z-index: 8; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(8,14,17,.9); color: var(--text); padding: 18px; }
.webgl-warning span { color: var(--muted); font-size: 12px; }
.transport-bar { min-height: 47px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 10px; background: rgba(16,24,29,.88); }
.transport-main, .transport-secondary { display: flex; align-items: center; gap: 6px; min-width: 0; }
.transport-button { height: 32px; padding: 0 11px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #a9b8b8; font-size: 8px; font-weight: 850; letter-spacing: .12em; cursor: pointer; transition: .18s ease; }
.transport-button:hover, .text-button:hover { color: var(--teal-bright); background: rgba(138,211,197,.08); }
.transport-button.primary { background: rgba(138,211,197,.13); border-color: rgba(138,211,197,.25); color: var(--teal-bright); min-width: 92px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.play-icon { font-size: 12px; }
.transport-button span:last-child { color: var(--teal); }
.transport-divider { height: 20px; width: 1px; background: var(--line-strong); margin: 0 5px; }
.speed-control { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 8px; letter-spacing: .12em; font-weight: 800; }
.speed-control select { color: var(--text); background: #1b272e; border: 1px solid var(--line-strong); border-radius: 5px; padding: 5px 6px; font-size: 10px; }
.text-button { height: 30px; padding: 0 8px; border: 0; border-radius: 5px; background: transparent; color: #a9b8b8; font-size: 8px; letter-spacing: .12em; font-weight: 850; cursor: pointer; white-space: nowrap; }
.text-button span { color: var(--teal); font-size: 13px; padding-right: 4px; }
.quality-toggle { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 5px; background: transparent; padding: 6px 8px; color: #a9b8b8; font-size: 8px; font-weight: 850; letter-spacing: .1em; cursor: pointer; white-space: nowrap; }
.quality-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--teal); }
.quality-toggle[aria-pressed="false"] .quality-dot { background: var(--sand); }
.readout-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.readout-card { min-width: 0; padding: 10px 10px 9px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(135deg, rgba(20,30,36,.96), rgba(13,20,25,.96)); }
.readout-label { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; color: #94a6a7; font-size: 7px; line-height: 1.5; letter-spacing: .11em; font-weight: 850; }
.readout-label > span { color: var(--teal); font-size: 9px; letter-spacing: 0; }
.readout-label em { color: #75878a; font-size: 6px; font-style: normal; letter-spacing: .1em; }
.readout-value { margin-top: 6px; color: #e6efeb; font-size: clamp(15px, 1.5vw, 20px); font-variant-numeric: tabular-nums; font-weight: 650; letter-spacing: -.035em; white-space: nowrap; }
.readout-value small { color: #9aa9a8; font-size: 9px; font-weight: 550; letter-spacing: 0; }
.readout-foot { margin-top: 4px; color: #65777c; font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.validation-strip { display: flex; align-items: center; gap: 10px; min-height: 43px; padding: 7px 12px; border: 1px solid rgba(138,211,197,.16); border-radius: 8px; background: rgba(16,29,30,.58); }
.validation-icon { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: rgba(138,211,197,.14); color: var(--teal); font-size: 11px; }
.validation-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.validation-copy b { color: #a9d9cf; font-size: 7px; letter-spacing: .14em; }
.validation-copy span { color: #8b9c9c; font-size: 9px; font-variant-numeric: tabular-nums; }
.validation-diff { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; }
.validation-diff strong { color: var(--teal-bright); font-size: 11px; font-variant-numeric: tabular-nums; }
.validation-diff span { color: #6f8183; font-size: 7px; }
.control-panel { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(145deg, rgba(20,30,36,.98), rgba(14,21,26,.98)); padding: 16px 15px 12px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 17px; }
.panel-heading h2 { margin: 5px 0 0; font-size: 16px; font-weight: 650; letter-spacing: -.02em; }
.panel-index { color: #5d7075; font-size: 8px; letter-spacing: .1em; font-weight: 800; padding-top: 4px; }
.preset-section, .control-section { padding-bottom: 15px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.section-label { display: flex; justify-content: space-between; align-items: center; color: #8ca0a1; font-size: 8px; letter-spacing: .13em; font-weight: 850; margin-bottom: 10px; }
.section-label span { color: #586a70; font-size: 7px; }
.preset-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px; }
.preset-button { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 68px; padding: 8px 7px; border: 1px solid var(--line); border-radius: 7px; background: rgba(8,14,17,.35); text-align: left; cursor: pointer; transition: .18s ease; }
.preset-button:hover { border-color: rgba(138,211,197,.38); background: rgba(138,211,197,.05); }
.preset-button.active { border-color: rgba(138,211,197,.58); background: linear-gradient(145deg, rgba(138,211,197,.13), rgba(138,211,197,.035)); box-shadow: inset 0 0 0 1px rgba(138,211,197,.05); }
.preset-glyph { color: var(--teal); font-size: 15px; line-height: 1; }
.preset-button b { color: #d4dfdc; font-size: 7px; letter-spacing: .09em; }
.preset-button small { color: #75868a; font-size: 7px; white-space: nowrap; }
.control-row { margin-top: 12px; }
.control-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.control-meta label { color: #c5d0ce; font-size: 10px; font-weight: 550; }
.control-meta output { color: var(--teal-bright); font-size: 10px; font-weight: 750; font-variant-numeric: tabular-nums; }
input[type="range"] { display: block; width: 100%; height: 15px; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, rgba(138,211,197,.72), rgba(138,211,197,.22)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, rgba(138,211,197,.72), rgba(138,211,197,.22)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border: 2px solid #d6f4eb; border-radius: 50%; background: #4f9e91; box-shadow: 0 0 0 3px rgba(138,211,197,.12); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #d6f4eb; border-radius: 50%; background: #4f9e91; box-shadow: 0 0 0 3px rgba(138,211,197,.12); }
.range-hint { display: flex; justify-content: space-between; color: #5f7075; font-size: 6px; letter-spacing: .12em; margin-top: 3px; }
.panel-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 1px; }
.model-state { display: flex; align-items: center; gap: 7px; color: #91aaa5; font-size: 7px; letter-spacing: .12em; font-weight: 850; }
.state-pulse { width: 5px; height: 5px; }
.model-state.inactive .state-pulse { background: var(--sand); box-shadow: 0 0 9px rgba(226,184,127,.5); }
.science-link { border: 0; background: transparent; color: var(--teal); font-size: 8px; letter-spacing: .13em; font-weight: 850; cursor: pointer; padding: 7px 0 7px 7px; }
.science-link span { padding-left: 4px; font-size: 11px; }
.science-panel { margin: 18px 0 0; border: 1px solid var(--line-strong); border-radius: 12px; background: linear-gradient(140deg, #131e23, #0f171c); padding: 20px; animation: reveal .25s ease-out; }
@keyframes reveal { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.science-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.science-head h2 { margin: 5px 0 0; font-size: 19px; font-weight: 650; }
.close-science { border: 1px solid var(--line-strong); background: transparent; color: var(--muted); border-radius: 50%; width: 27px; height: 27px; font-size: 18px; cursor: pointer; }
.science-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.science-grid article { padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: rgba(6,12,15,.28); }
.science-grid h3 { color: var(--teal); font-size: 8px; letter-spacing: .14em; margin: 0 0 10px; }
.science-grid p { color: #9cacab; font-size: 10px; line-height: 1.6; margin: 0 0 9px; }
.equation { color: #e2c69f; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; line-height: 1.55; padding: 7px 8px; border-left: 2px solid rgba(226,184,127,.55); background: rgba(226,184,127,.055); margin: 8px 0; overflow-wrap: anywhere; }
.small-note { color: #728488 !important; font-size: 8px !important; }
.reference-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-top: 15px; margin-top: 15px; border-top: 1px solid var(--line); }
.reference-row span { color: #65777c; font-size: 7px; font-weight: 850; letter-spacing: .13em; }
.reference-row a { color: #9abbb4; font-size: 8px; text-decoration: none; }
.reference-row a:hover { color: var(--teal-bright); text-decoration: underline; }
.footer { display: flex; justify-content: space-between; gap: 10px; color: #53646a; font-size: 7px; letter-spacing: .1em; padding: 16px 2px 0; }
.footer b { color: var(--sand); padding: 0 3px; }
.embed-mode .app-shell { padding-top: 0; }
.embed-mode .topbar, .embed-mode .footer { display: none; }
.embed-mode .workspace { padding-top: 0; }
.embed-mode .scene-shell { border-radius: 0 0 12px 12px; }
@media (max-width: 1120px) {
  .app-shell { padding-left: 16px; padding-right: 16px; }
  .workspace { grid-template-columns: minmax(0,1fr) 300px; gap: 12px; }
  .readout-grid { gap: 5px; }
  .readout-card { padding: 8px 7px; }
  .readout-value { font-size: 16px; }
  .transport-bar { flex-wrap: wrap; }
  .science-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .workspace { grid-template-columns: minmax(0,1fr); }
  .scene-shell { height: min(54vh, 500px); min-height: 340px; }
  .control-panel { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 18px; }
  .panel-heading, .panel-footer { grid-column: 1 / -1; }
  .preset-section { grid-column: 1 / -1; }
  .control-section { margin-bottom: 0; }
  .control-section:last-of-type { border-bottom: 0; }
  .footer { flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .app-shell { padding: 0 10px 14px; }
  .topbar { min-height: 62px; }
  .brand-mark { width: 26px; height: 26px; }
  h1 { font-size: 11px; letter-spacing: .08em; }
  .eyebrow { font-size: 8px; }
  .live-indicator { font-size: 7px; letter-spacing: .08em; gap: 5px; }
  .topbar-right { gap: 8px; }
  .workspace { padding-top: 10px; gap: 10px; }
  .scene-shell { height: 43vh; min-height: 315px; max-height: 410px; border-radius: 10px; }
  .scene-topline, .scene-bottomline { left: 9px; right: 9px; }
  .scene-topline { top: 9px; }
  .scene-bottomline { bottom: 9px; }
  .scene-chip { padding: 6px 7px; font-size: 6px; letter-spacing: .1em; }
  .scene-chip-muted { display: none; }
  .annotation { padding: 5px 6px; }
  .annotation b { font-size: 6px; }
  .annotation span { font-size: 7px; }
  .annotation-wind { left: 5%; top: 42%; }
  .annotation-lee { right: 4%; top: 65%; }
  .scene-hint { font-size: 6px; }
  .transport-bar { padding: 5px; gap: 2px; }
  .transport-main, .transport-secondary { gap: 2px; }
  .transport-button { padding: 0 7px; font-size: 7px; }
  .transport-button.primary { min-width: 73px; }
  .transport-divider { margin: 0 2px; }
  .speed-control { gap: 4px; font-size: 7px; }
  .speed-control select { font-size: 9px; padding: 4px; }
  .text-button { padding: 0 5px; font-size: 7px; }
  .quality-toggle { padding: 5px 6px; font-size: 7px; }
  .readout-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
  .readout-card { padding: 9px 9px 8px; }
  .readout-label { font-size: 7px; }
  .readout-value { font-size: 19px; }
  .validation-strip { gap: 7px; padding: 7px 8px; }
  .validation-copy span { font-size: 8px; }
  .control-panel { display: block; padding: 13px 12px 10px; }
  .panel-heading { margin-bottom: 14px; }
  .panel-heading h2 { font-size: 15px; }
  .preset-section { padding-bottom: 13px; margin-bottom: 12px; }
  .preset-button { min-height: 63px; }
  .control-section { padding-bottom: 13px; margin-bottom: 12px; }
  .control-section:last-of-type { border-bottom: 1px solid var(--line); }
  .control-row { margin-top: 11px; }
  .science-panel { padding: 14px; }
  .science-grid { grid-template-columns: minmax(0,1fr); gap: 8px; }
  .science-head h2 { font-size: 17px; }
  .footer { gap: 7px; font-size: 6px; }
  .footer span:nth-child(2) { order: 3; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .loader-ring { animation: none; border-right-color: var(--teal); }
}
