:root {
  color-scheme: dark;
  --bg: #07111a;
  --panel: rgba(13, 26, 38, .94);
  --panel-2: #101f2d;
  --line: rgba(152, 190, 211, .13);
  --line-strong: rgba(152, 190, 211, .23);
  --text: #e8f2f7;
  --muted: #8196a6;
  --faint: #536b7b;
  --cyan: #70d9ed;
  --ice: #b9f1ff;
  --blue: #4b9fc0;
  --amber: #e9bd7d;
  --green: #91d5b5;
  --radius: 12px;
  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%; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-height: 100vh; overflow: hidden; background: radial-gradient(ellipse at 54% 44%, #122333 0%, #091722 46%, #061019 100%); }
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.app-shell { min-height: 100vh; height: 100vh; display: flex; flex-direction: column; padding: 0 20px 10px; max-width: 1920px; margin: 0 auto; }
.topbar { height: 72px; flex: 0 0 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: 14px; min-width: 0; }
.brand-mark { width: 30px; height: 34px; display: flex; align-items: end; justify-content: center; gap: 3px; padding: 2px; transform: skewY(-8deg); }
.brand-mark span { display: block; width: 5px; border-radius: 7px 7px 2px 2px; background: linear-gradient(180deg, #d9f8ff, #5fb4d3 65%, #2c6f8d); box-shadow: 0 0 12px rgba(112,217,237,.28); }
.brand-mark span:nth-child(1) { height: 18px; }
.brand-mark span:nth-child(2) { height: 29px; }
.brand-mark span:nth-child(3) { height: 23px; }
.eyebrow, .section-label, .scene-kicker { font-size: 9px; letter-spacing: .17em; color: #7893a5; font-weight: 800; }
.brand-lockup h1 { margin: 3px 0 0; font-size: 17px; line-height: 1.2; letter-spacing: -.035em; font-weight: 750; white-space: nowrap; }
.brand-lockup h1 span { color: #9cb1bf; font-weight: 450; }
.topbar-meta { display: flex; align-items: center; gap: 18px; flex: 0 0 auto; }
.seed-tag { border: 1px solid var(--line-strong); border-radius: 5px; padding: 6px 9px; font-size: 9px; color: #93aab9; letter-spacing: .12em; font-weight: 700; }
.live-indicator { display: flex; align-items: center; gap: 7px; font-size: 9px; letter-spacing: .14em; color: #a6bdc9; }
.live-indicator i { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: #6f9aaa; box-shadow: 0 0 0 3px rgba(111,154,170,.13); }
.live-indicator.running i { background: #78d6b2; box-shadow: 0 0 0 3px rgba(120,214,178,.14), 0 0 12px rgba(120,214,178,.7); }
.workspace { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 258px minmax(420px, 1fr) 276px; gap: 12px; padding: 12px 0 9px; }
.panel { background: linear-gradient(160deg, rgba(16,31,45,.97), rgba(10,22,33,.96)); border: 1px solid var(--line); border-radius: var(--radius); min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: #294253 transparent; }
.control-rail { padding: 17px 15px 14px; }
.data-rail { padding: 17px 15px 14px; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.panel-heading h2 { margin: 4px 0 0; font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.panel-index { color: #536b7c; font-size: 10px; font-weight: 700; letter-spacing: .12em; padding-top: 4px; }
.preset-block { margin-bottom: 20px; }
.section-label { margin-bottom: 9px; }
.preset-grid { display: grid; gap: 6px; }
.preset-button { display: flex; gap: 9px; align-items: center; width: 100%; text-align: left; border: 1px solid rgba(144,180,199,.12); background: rgba(6,17,26,.38); border-radius: 8px; padding: 8px 9px; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.preset-button:hover { border-color: rgba(112,217,237,.35); background: rgba(20,47,62,.55); }
.preset-button.active { border-color: rgba(112,217,237,.45); background: linear-gradient(100deg, rgba(48,115,139,.18), rgba(11,28,40,.55)); box-shadow: inset 2px 0 0 rgba(112,217,237,.7); }
.preset-button b { display: block; font-size: 10px; font-weight: 700; color: #d9e8ef; }
.preset-button small { display: block; margin-top: 3px; font-size: 9px; color: #7790a0; }
.preset-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; box-shadow: 0 0 9px currentColor; }
.preset-dot.dry { background: #c59c70; color: #c59c70; }
.preset-dot.silt { background: #72cde0; color: #72cde0; }
.preset-dot.wet { background: #8dc9c0; color: #8dc9c0; }
.control-group { padding: 11px 0 9px; border-top: 1px solid rgba(152,190,211,.08); }
.control-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.control-head label { color: #b4c5ce; font-size: 10px; font-weight: 600; }
.control-head output { color: var(--cyan); font-size: 10px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; height: 15px; display: block; margin: 8px 0 2px; appearance: none; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, #4a91aa, #29485b); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, #4a91aa, #29485b); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border-radius: 50%; background: #c9f5ff; border: 2px solid #4e9db8; box-shadow: 0 0 0 3px rgba(112,217,237,.12); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: #c9f5ff; border: 2px solid #4e9db8; box-shadow: 0 0 0 3px rgba(112,217,237,.12); }
.range-ends { display: flex; justify-content: space-between; color: #627b8c; font-size: 8px; letter-spacing: .02em; }
.rail-note { margin-top: 14px; padding: 10px 9px; display: flex; gap: 8px; align-items: flex-start; border-radius: 7px; background: rgba(88,143,162,.08); border: 1px solid rgba(112,217,237,.1); color: #8097a5; font-size: 9px; line-height: 1.45; }
.note-icon { display: inline-grid; place-items: center; width: 14px; height: 14px; flex: 0 0 14px; border-radius: 50%; border: 1px solid rgba(112,217,237,.55); color: var(--cyan); font-size: 9px; font-weight: 800; }
.scene-panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; border: 1px solid rgba(152,190,211,.14); border-radius: var(--radius); overflow: hidden; background: #07121c; box-shadow: 0 18px 50px rgba(0,0,0,.2); }
.scene-toolbar { height: 54px; flex: 0 0 54px; display: flex; justify-content: space-between; align-items: center; padding: 0 14px 0 17px; border-bottom: 1px solid rgba(152,190,211,.12); background: rgba(11,25,37,.9); }
.scene-title { display: flex; flex-direction: column; gap: 3px; }
.scene-kicker { font-size: 8px; }
.scene-title strong { font-size: 12px; font-weight: 700; color: #d9e8ef; }
.scene-actions { display: flex; gap: 6px; align-items: center; }
.icon-button, .quality-toggle { height: 29px; min-width: 30px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid rgba(150,188,207,.17); border-radius: 6px; background: rgba(21,41,55,.65); color: #a6bbc7; cursor: pointer; transition: .18s ease; }
.icon-button:hover, .quality-toggle:hover { color: #e9fbff; border-color: rgba(112,217,237,.45); background: rgba(44,88,106,.45); }
.camera-glyph, .export-glyph { font-size: 16px; line-height: 1; }
.quality-toggle { padding: 0 8px; font-size: 8px; font-weight: 800; letter-spacing: .09em; color: var(--cyan); }
.quality-toggle span { color: #8297a5; font-weight: 600; }
.scene-viewport { position: relative; flex: 1 1 auto; min-height: 260px; overflow: hidden; background: radial-gradient(ellipse at 52% 48%, #1a3447 0%, #0b1b29 48%, #07131e 100%); }
.webgl-host { position: absolute; inset: 0; z-index: 1; }
.webgl-host canvas { display: block; width: 100%; height: 100%; outline: none; }
.scene-vignette { position: absolute; z-index: 2; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 46%, transparent 42%, rgba(3,10,17,.18) 100%), linear-gradient(180deg, rgba(4,12,19,.08), transparent 24%, transparent 78%, rgba(4,11,17,.35)); }
.scene-overlay-top { position: absolute; z-index: 4; top: 13px; left: 14px; right: 14px; display: flex; justify-content: space-between; pointer-events: none; }
.overlay-chip { display: flex; align-items: center; gap: 7px; padding: 6px 8px; border: 1px solid rgba(132,193,212,.2); border-radius: 5px; background: rgba(6,18,28,.64); backdrop-filter: blur(8px); color: #b9d4df; font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.overlay-chip.muted { color: #849ba9; font-variant-numeric: tabular-nums; }
.chip-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.chip-dot.cyan { background: #70d9ed; box-shadow: 0 0 9px #70d9ed; }
.chip-divider { color: #506c7c; }
.annotation-label { position: absolute; z-index: 5; display: flex; align-items: center; gap: 6px; pointer-events: none; color: #a8dce8; font-size: 8px; font-weight: 800; letter-spacing: .13em; text-shadow: 0 1px 5px #07131e, 0 0 8px #07131e; opacity: .9; white-space: nowrap; }
.annotation-label i { display: inline-block; width: 16px; height: 1px; background: linear-gradient(90deg, transparent, #7edff0); box-shadow: 0 0 5px rgba(126,223,240,.5); }
.label-needles { top: 24%; left: 61%; }
.label-front { top: 59%; left: 11%; }
.label-feed { top: 70%; left: 57%; }
.label-water { top: 82%; left: 17%; }
.scene-caption { position: absolute; z-index: 4; bottom: 13px; left: 15px; display: flex; align-items: center; gap: 8px; color: #7891a1; font-size: 8px; letter-spacing: .07em; pointer-events: none; }
.caption-line { width: 19px; height: 1px; background: #6b9cad; }
.scene-help { position: absolute; z-index: 4; right: 14px; bottom: 13px; color: #647d8d; font-size: 8px; letter-spacing: .1em; pointer-events: none; }
.scene-help span { color: #a0c4d0; padding: 0 4px; }
.context-loss { position: absolute; z-index: 10; inset: 0; display: none; align-items: center; justify-content: center; flex-direction: column; gap: 8px; background: rgba(4,13,21,.9); text-align: center; color: #d9edf4; }
.context-loss.visible { display: flex; }
.context-loss b { font-size: 14px; }
.context-loss span { font-size: 11px; color: #8299a8; }
.timeline-bar { height: 64px; flex: 0 0 64px; display: flex; align-items: center; gap: 16px; padding: 0 15px; border-top: 1px solid rgba(152,190,211,.12); background: rgba(9,21,31,.96); }
.transport-controls { display: flex; gap: 5px; flex: 0 0 auto; }
.transport-button { width: 30px; height: 30px; border-radius: 6px; border: 1px solid rgba(145,184,202,.18); background: rgba(26,48,62,.75); color: #a6bdc9; font-size: 13px; cursor: pointer; transition: .16s ease; }
.transport-button:hover { border-color: rgba(112,217,237,.55); color: white; }
.transport-button.primary { background: linear-gradient(145deg, #6dc4dc, #377f9c); border-color: rgba(146,227,245,.7); color: #061722; box-shadow: 0 3px 12px rgba(67,165,196,.2); }
.timeline-track-wrap { flex: 1 1 auto; min-width: 0; }
.timeline-labels { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; font-size: 8px; color: #718999; letter-spacing: .12em; }
.timeline-labels strong { color: #d4e6ee; font-size: 10px; font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.timeline-end { margin-left: auto; color: #617889; }
.timeline-track { position: relative; height: 3px; border-radius: 4px; background: #223a4a; }
.timeline-progress { width: 16.66%; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #4c9eb8, #a8e9f6); box-shadow: 0 0 9px rgba(112,217,237,.45); }
.timeline-thumb { position: absolute; top: 50%; left: 16.66%; width: 9px; height: 9px; border: 2px solid #bff3ff; background: #4e9bb5; border-radius: 50%; transform: translate(-50%,-50%); box-shadow: 0 0 0 3px rgba(112,217,237,.13); }
.speed-control { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
.speed-control label { color: #718999; font-size: 8px; letter-spacing: .12em; font-weight: 800; }
.speed-control select { border: 1px solid rgba(145,184,202,.18); border-radius: 5px; background: #142a39; color: #bde9f3; font-size: 10px; padding: 6px 6px; cursor: pointer; }
.metric-primary { padding: 12px 12px 10px; border: 1px solid rgba(112,217,237,.18); border-radius: 9px; background: linear-gradient(135deg, rgba(36,81,101,.23), rgba(13,31,44,.72)); margin-bottom: 11px; }
.metric-label { display: flex; justify-content: space-between; align-items: center; color: #9bb1be; font-size: 8px; letter-spacing: .13em; font-weight: 800; }
.status-pill { padding: 3px 5px; border-radius: 3px; background: rgba(112,217,237,.1); color: var(--cyan); font-size: 7px; }
.metric-value { display: flex; align-items: baseline; gap: 5px; margin-top: 8px; }
.metric-value strong { color: #e6f7fb; font-size: 35px; line-height: 1; font-weight: 650; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.metric-value span { color: #7db8c9; font-size: 13px; }
.metric-subline { display: flex; justify-content: space-between; margin-top: 8px; color: #748d9d; font-size: 9px; }
.metric-subline b { color: #b4cbd5; font-variant-numeric: tabular-nums; }
.mini-bars { display: flex; align-items: end; gap: 3px; height: 20px; margin-top: 8px; opacity: .75; }
.mini-bars span { display: block; flex: 1; min-width: 2px; border-radius: 2px 2px 0 0; background: linear-gradient(180deg, #9be9f5, #397c99); }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 10px; }
.metric-card { min-height: 70px; padding: 9px 9px 8px; border-radius: 7px; border: 1px solid rgba(145,184,202,.11); background: rgba(5,17,27,.34); }
.metric-card span { display: block; color: #7891a0; font-size: 7px; letter-spacing: .12em; font-weight: 800; }
.metric-card strong { display: block; margin-top: 7px; color: #d8edf3; font-size: 17px; line-height: 1; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.metric-card strong small { color: #7da9b9; font-size: 9px; font-weight: 500; }
.metric-card em { display: block; margin-top: 5px; color: #637e8f; font-size: 8px; font-style: normal; }
.metric-card em.scaled-note { color: #c39c6f; letter-spacing: .06em; font-size: 7px; }
.limiter-card { padding: 10px 11px; margin-bottom: 10px; border: 1px solid rgba(145,184,202,.12); border-radius: 7px; background: rgba(5,17,27,.38); }
.limiter-head { display: flex; justify-content: space-between; align-items: center; color: #77909f; font-size: 7px; font-weight: 800; letter-spacing: .13em; }
.limiter-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px currentColor; }
.limiter-card strong { display: block; margin-top: 7px; color: #e5c99f; font-size: 10px; letter-spacing: .07em; }
.limiter-card p { margin: 5px 0 8px; color: #7e94a2; font-size: 8px; line-height: 1.4; }
.limiter-bar { height: 3px; border-radius: 4px; background: #233846; overflow: hidden; }
.limiter-bar span { display: block; width: 54%; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #8e9c9e, #e7be82); }
.validation-card { padding: 10px 11px 9px; border-radius: 7px; border: 1px solid rgba(128,207,175,.2); background: linear-gradient(135deg, rgba(33,78,69,.17), rgba(7,25,29,.38)); margin-bottom: 10px; }
.validation-heading { display: flex; justify-content: space-between; align-items: center; color: #8ebaa9; font-size: 7px; font-weight: 800; letter-spacing: .13em; }
.check-mark { color: #92d8b7; font-size: 12px; }
.validation-card > strong { display: block; margin: 7px 0 8px; color: #d6e9e3; font-size: 10px; }
.validation-row { display: flex; justify-content: space-between; gap: 6px; margin-top: 5px; color: #7e9b92; font-size: 8px; }
.validation-row b { color: #c5e3d7; font-size: 8px; font-variant-numeric: tabular-nums; }
.validation-difference { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; padding-top: 7px; border-top: 1px solid rgba(128,207,175,.12); color: #8eaea2; font-size: 8px; }
.validation-difference strong { color: #9fe0bd; font-size: 12px; }
.validation-card > small { display: block; margin-top: 6px; color: #64877c; font-size: 7px; letter-spacing: .04em; }
.science-details { border: 1px solid rgba(145,184,202,.12); border-radius: 7px; background: rgba(5,17,27,.3); }
.science-details summary { display: flex; justify-content: space-between; align-items: center; padding: 10px 11px; cursor: pointer; list-style: none; color: #9ab2be; font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.science-details summary::-webkit-details-marker { display: none; }
.summary-plus { color: var(--cyan); font-size: 13px; transition: transform .2s ease; }
.science-details[open] .summary-plus { transform: rotate(45deg); }
.science-content { padding: 0 11px 12px; color: #8ba0ac; font-size: 9px; line-height: 1.5; }
.science-content h3 { margin: 12px 0 5px; color: #c5d8e0; font-size: 9px; }
.science-content p { margin: 5px 0 8px; }
.equation { padding: 8px 7px; border-radius: 5px; background: rgba(56,105,124,.14); color: #a9e1ed; font-family: Georgia, serif; font-size: 12px; text-align: center; overflow-wrap: anywhere; }
.science-divider { height: 1px; background: var(--line); margin: 12px 0; }
.science-content ul { padding-left: 15px; margin: 6px 0 10px; }
.science-content li { margin: 3px 0; }
.science-warning { color: #d2ad7e; }
.affiliation { color: #617d8d; font-size: 8px; }
.footerbar { height: 23px; flex: 0 0 23px; display: flex; align-items: center; justify-content: space-between; color: #4f697a; font-size: 7px; font-weight: 800; letter-spacing: .13em; }
body.embed .app-shell { padding: 0; }
body.embed .topbar, body.embed .footerbar { display: none; }
body.embed .workspace { padding: 0; gap: 8px; }
body.embed .scene-panel { border-radius: 0; }
body.embed .panel { border-radius: 0; }
@media (max-width: 1120px) {
  .app-shell { padding-left: 12px; padding-right: 12px; }
  .workspace { grid-template-columns: 230px minmax(360px, 1fr) 248px; gap: 8px; }
  .control-rail, .data-rail { padding-left: 12px; padding-right: 12px; }
  .brand-lockup h1 { font-size: 15px; }
}
@media (max-width: 900px) {
  body { overflow: auto; }
  .app-shell { height: auto; min-height: 100vh; padding: 0 10px 10px; }
  .topbar { height: 64px; flex-basis: 64px; }
  .brand-lockup h1 { font-size: 14px; white-space: normal; }
  .brand-lockup h1 span { display: none; }
  .workspace { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); grid-template-rows: minmax(440px, 58vh) auto; min-height: 0; }
  .scene-panel { grid-column: 1 / -1; grid-row: 1; min-height: 440px; }
  .control-rail { grid-column: 1; grid-row: 2; }
  .data-rail { grid-column: 2; grid-row: 2; }
  .footerbar { display: none; }
  .annotation-label { font-size: 7px; }
}
@media (max-width: 560px) {
  .app-shell { padding: 0 0 10px; }
  .topbar { padding: 0 13px; height: 58px; flex-basis: 58px; }
  .brand-lockup { gap: 9px; }
  .brand-mark { width: 23px; transform: scale(.9) skewY(-8deg); }
  .brand-lockup h1 { font-size: 13px; }
  .topbar-meta { gap: 8px; }
  .seed-tag { font-size: 7px; padding: 5px 6px; }
  .live-indicator { font-size: 7px; }
  .workspace { display: flex; flex-direction: column; gap: 8px; padding: 8px 8px 0; }
  .scene-panel { order: 0; height: 440px; min-height: 440px; flex: 0 0 440px; }
  .control-rail { order: 1; max-height: none; overflow: visible; }
  .data-rail { order: 2; overflow: visible; }
  .panel { border-radius: 9px; }
  .scene-toolbar { height: 47px; flex-basis: 47px; padding: 0 9px 0 12px; }
  .scene-viewport { min-height: 0; }
  .timeline-bar { height: 59px; flex-basis: 59px; padding: 0 8px; gap: 8px; }
  .transport-button { width: 27px; height: 29px; }
  .speed-control { gap: 4px; }
  .speed-control label { display: none; }
  .speed-control select { font-size: 9px; padding: 6px 3px; }
  .timeline-labels { gap: 5px; font-size: 7px; }
  .timeline-labels strong { font-size: 9px; }
  .scene-help { display: none; }
  .label-needles { top: 25%; left: 58%; }
  .label-front { top: 58%; left: 5%; }
  .label-feed { top: 70%; left: 57%; }
  .label-water { top: 82%; left: 8%; }
  .metric-grid { gap: 8px; }
  .metric-card { min-height: 76px; }
  .footerbar { display: none; }
  body.embed .workspace { padding: 0; }
  body.embed .scene-panel { height: 100vh; min-height: 100vh; flex-basis: 100vh; }
  body.embed .control-rail, body.embed .data-rail { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
