:root {
  color-scheme: dark;
  --bg: #10191d;
  --panel: rgba(15, 25, 29, 0.91);
  --panel-strong: rgba(17, 29, 33, 0.97);
  --line: rgba(194, 220, 213, 0.13);
  --line-strong: rgba(194, 220, 213, 0.24);
  --text: #edf4ef;
  --muted: #91a7a3;
  --dim: #627873;
  --aqua: #80d5c4;
  --aqua-bright: #a5f1df;
  --sand: #d5c7a7;
  --gold: #d6b77b;
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button { color: inherit; }
#app { position: relative; width: 100%; height: 100%; min-height: 540px; overflow: hidden; background: radial-gradient(ellipse at 48% 48%, #263b3d 0%, #17262b 50%, #10191d 100%); }
#scene-root { position: absolute; inset: 0; z-index: 0; }
#scene-root canvas { display: block; width: 100%; height: 100%; outline: none; }
.topbar { position: absolute; z-index: 3; top: 24px; left: 30px; right: 390px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.brand-lockup { display: flex; align-items: flex-start; gap: 14px; }
.brand-mark { width: 34px; height: 34px; display: flex; align-items: flex-end; gap: 3px; padding: 6px; border: 1px solid rgba(128,213,196,.38); border-radius: 10px; background: rgba(16,34,35,.72); box-shadow: 0 5px 24px rgba(0,0,0,.16); }
.brand-mark span { display: block; width: 5px; border-radius: 5px 5px 2px 2px; background: var(--aqua); }
.brand-mark span:nth-child(1) { height: 9px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 17px; opacity: .8; }
.brand-mark span:nth-child(3) { height: 12px; }
.eyebrow, .section-label { color: var(--aqua); font-size: 9px; font-weight: 800; letter-spacing: .17em; line-height: 1.4; }
.slash { color: #56736c; padding: 0 4px; }
h1 { margin: 5px 0 1px; font-size: clamp(22px, 2.2vw, 30px); line-height: 1.12; font-weight: 620; letter-spacing: -.045em; }
.subtitle { margin: 4px 0 0; color: #a9bdb5; font-size: 12px; letter-spacing: .01em; }
.top-status { display: flex; align-items: center; gap: 9px; padding: 9px 12px; margin-top: 2px; border: 1px solid rgba(180,220,205,.17); border-radius: 999px; background: rgba(12,24,27,.58); color: #b5c8c1; font-size: 9px; font-weight: 800; letter-spacing: .11em; backdrop-filter: blur(12px); }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #78d9b3; box-shadow: 0 0 0 4px rgba(120,217,179,.12), 0 0 12px rgba(120,217,179,.8); }
.status-divider { width: 1px; height: 12px; background: var(--line-strong); }
#elapsed { font-variant-numeric: tabular-nums; color: #e2ede7; }
.control-panel { position: absolute; z-index: 4; top: 20px; right: 20px; bottom: 20px; width: 342px; padding: 18px 18px 12px; border: 1px solid rgba(200,225,217,.16); border-radius: 18px; background: var(--panel); box-shadow: 0 18px 60px rgba(0,0,0,.28); backdrop-filter: blur(22px) saturate(125%); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #47625c transparent; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.panel-heading h2 { margin: 5px 0 0; font-size: 17px; font-weight: 620; letter-spacing: -.025em; }
.panel-index { color: #68847b; font-size: 10px; letter-spacing: .12em; font-weight: 800; padding-top: 5px; }
.transport-row { display: grid; grid-template-columns: 1fr 48px 42px 72px; gap: 7px; margin-bottom: 18px; }
.primary-btn, .icon-btn, .secondary-btn, .preset-btn, .quality-toggle button { border: 1px solid var(--line-strong); border-radius: 9px; background: rgba(255,255,255,.035); cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.primary-btn:hover, .icon-btn:hover, .secondary-btn:hover, .preset-btn:hover, .quality-toggle button:hover { background: rgba(128,213,196,.1); border-color: rgba(128,213,196,.45); }
.primary-btn:active, .icon-btn:active, .secondary-btn:active, .preset-btn:active { transform: translateY(1px); }
.primary-btn { display: flex; justify-content: center; align-items: center; gap: 9px; min-height: 38px; border-color: rgba(128,213,196,.42); background: rgba(65,135,120,.22); color: var(--aqua-bright); font-size: 11px; font-weight: 750; }
.play-icon { font-size: 13px; line-height: 1; }
.icon-btn { min-height: 38px; color: #c3d3cc; font-size: 12px; font-weight: 700; }
.speed-select select { width: 100%; height: 38px; border: 1px solid var(--line-strong); border-radius: 9px; background: #1b2b2f; color: #dce9e3; padding: 0 7px; font-size: 11px; outline: none; }
.preset-block { margin-bottom: 18px; }
.section-label { margin-bottom: 8px; color: #8baea4; }
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.preset-btn { display: flex; align-items: center; gap: 7px; padding: 8px 6px; min-width: 0; text-align: left; }
.preset-btn.active { background: rgba(128,213,196,.12); border-color: rgba(128,213,196,.48); }
.preset-btn b { display: block; overflow: hidden; color: #e6f0eb; font-size: 9px; font-weight: 750; white-space: nowrap; text-overflow: ellipsis; }
.preset-btn small { display: block; margin-top: 3px; color: #8da29b; font-size: 8px; white-space: nowrap; }
.preset-swatch { flex: 0 0 8px; width: 8px; height: 25px; border-radius: 5px; background: linear-gradient(180deg,#a7e9d7,#317f78); }
.swatch-cascade { background: linear-gradient(180deg,#d2e5c6,#4aa39b); }
.swatch-quiet { background: linear-gradient(180deg,#d8c6a3,#8a8166); }
.controls-block { padding-top: 13px; border-top: 1px solid var(--line); }
.control { margin: 0 0 12px; }
.control-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.control-top label { color: #d8e3dd; font-size: 10px; font-weight: 620; }
.control-top output { color: var(--aqua-bright); font-size: 10px; font-weight: 750; font-variant-numeric: tabular-nums; }
input[type="range"] { display: block; width: 100%; height: 14px; margin: 0; appearance: none; background: transparent; cursor: pointer; accent-color: var(--aqua); }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(128,213,196,.85), rgba(128,213,196,.2)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(128,213,196,.85), rgba(128,213,196,.2)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 11px; height: 11px; margin-top: -4px; border: 2px solid #d9fff2; border-radius: 50%; background: #58bba7; box-shadow: 0 0 0 3px rgba(88,187,167,.15); }
input[type="range"]::-moz-range-thumb { width: 8px; height: 8px; border: 2px solid #d9fff2; border-radius: 50%; background: #58bba7; box-shadow: 0 0 0 3px rgba(88,187,167,.15); }
input:focus-visible, button:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--aqua-bright); outline-offset: 3px; }
.range-hints { display: flex; justify-content: space-between; margin-top: 1px; color: #607771; font-size: 8px; }
.panel-actions { display: flex; align-items: center; gap: 7px; margin: 13px 0; padding-top: 12px; border-top: 1px solid var(--line); }
.secondary-btn { min-height: 32px; padding: 0 9px; color: #c3d2cc; font-size: 9px; font-weight: 700; white-space: nowrap; }
.secondary-btn span { color: var(--aqua); margin-right: 4px; }
.quality-toggle { display: flex; align-items: center; gap: 5px; margin-left: auto; }
.quality-toggle span { color: #6e8981; font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.quality-toggle button { min-width: 38px; height: 28px; color: var(--aqua-bright); font-size: 8px; font-weight: 800; }
.science-panel { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.science-panel summary { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; cursor: pointer; color: #dce9e3; font-size: 11px; font-weight: 700; list-style: none; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-symbol { color: var(--aqua); font-size: 15px; margin-right: 8px; }
.chevron { color: #83a49a; font-size: 16px; transition: transform .2s ease; }
.science-panel[open] .chevron { transform: rotate(180deg); }
.science-content { padding: 0 0 12px; color: #a9bbb4; font-size: 9px; line-height: 1.6; }
.science-content p { margin: 6px 0 9px; }
.science-content h3 { margin: 13px 0 5px; color: #d8e6df; font-size: 10px; letter-spacing: .02em; }
.science-lead { color: #d1e0d9; font-size: 10px; }
.equation { margin: 6px 0; padding: 7px 9px; border-left: 2px solid rgba(128,213,196,.55); border-radius: 0 6px 6px 0; background: rgba(128,213,196,.055); color: #bce4d8; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.science-content ul { padding-left: 15px; margin: 5px 0 10px; }
.science-content li { margin: 4px 0; }
.validation-card { margin-top: 12px; padding: 10px; border: 1px solid rgba(128,213,196,.18); border-radius: 9px; background: rgba(128,213,196,.045); }
.validation-card .section-label { font-size: 8px; }
.validation-card b { color: #dceae3; font-size: 9px; }
.validation-card p { margin: 5px 0 7px; }
.validation-values { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px; color: var(--aqua-bright); font-size: 9px; font-variant-numeric: tabular-nums; }
.validation-values span { color: #7e9b91; }
.disclaimer { padding-top: 8px; border-top: 1px solid var(--line); color: #81948d; font-style: italic; }
.panel-foot { display: flex; justify-content: space-between; margin-top: 11px; color: #5f7770; font-size: 7px; font-weight: 800; letter-spacing: .12em; }
.readout-strip { position: absolute; z-index: 3; left: 30px; bottom: 24px; display: grid; grid-template-columns: repeat(5, minmax(90px,1fr)); gap: 1px; width: min(680px, calc(100% - 400px)); border: 1px solid rgba(191,224,211,.17); border-radius: 12px; overflow: hidden; background: rgba(15,29,31,.77); box-shadow: 0 10px 32px rgba(0,0,0,.2); backdrop-filter: blur(14px); }
.readout { min-width: 0; padding: 11px 12px 10px; border-right: 1px solid rgba(191,224,211,.1); }
.readout:last-child { border-right: 0; }
.readout-label { display: block; margin-bottom: 6px; color: #82a59a; font-size: 8px; font-weight: 800; letter-spacing: .12em; white-space: nowrap; }
.readout strong { display: block; color: #eef8f1; font-size: 20px; font-weight: 560; letter-spacing: -.045em; font-variant-numeric: tabular-nums; line-height: 1; }
.readout small { display: block; margin-top: 5px; color: #6e8981; font-size: 8px; white-space: nowrap; }
.scene-annotations { position: absolute; z-index: 2; inset: 0; pointer-events: none; }
.annotation { position: absolute; display: flex; align-items: center; gap: 7px; color: rgba(220,238,229,.78); font-size: 8px; font-weight: 800; letter-spacing: .14em; text-shadow: 0 2px 9px rgba(0,0,0,.75); }
.annotation-line { display: block; width: 24px; height: 1px; background: rgba(154,225,203,.78); box-shadow: 0 0 8px rgba(128,213,196,.6); }
.annotation-source { left: 30%; top: 29%; }
.annotation-degas { left: 46%; top: 48%; }
.annotation-rim { left: 31%; top: 67%; }
.toast { position: absolute; z-index: 8; left: 50%; bottom: 22px; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; padding: 9px 14px; border: 1px solid rgba(128,213,196,.3); border-radius: 999px; background: rgba(12,25,28,.95); color: #dff7ed; font-size: 10px; transition: opacity .2s ease, transform .2s ease; }
.toast.visible { opacity: 1; transform: translate(-50%,0); }
.webgl-warning { position: absolute; z-index: 10; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: #10191d; color: #dceae3; text-align: center; }
.webgl-warning[hidden] { display: none; }
.webgl-warning span { color: #91a7a3; font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.embed .topbar { display: none; }
.embed .scene-annotations { display: none; }
.embed .control-panel { top: 12px; right: 12px; bottom: 12px; }
.embed .readout-strip { left: 12px; bottom: 12px; }
@media (max-width: 900px) {
  .topbar { right: 365px; left: 20px; }
  .top-status { display: none; }
  .readout-strip { left: 20px; width: calc(100% - 385px); }
  .readout { padding: 10px 8px; }
  .readout strong { font-size: 17px; }
}
@media (max-width: 680px) {
  html, body { overflow: hidden; }
  #app { min-height: 620px; }
  .topbar { top: 14px; left: 14px; right: 14px; }
  .brand-mark { width: 30px; height: 30px; }
  h1 { font-size: 22px; }
  .subtitle { font-size: 10px; }
  .control-panel { left: 10px; right: 10px; top: auto; bottom: 10px; width: auto; max-height: 45.5vh; padding: 13px 14px 10px; border-radius: 15px; }
  .panel-heading { margin-bottom: 10px; }
  .panel-heading h2 { font-size: 15px; }
  .transport-row { margin-bottom: 12px; }
  .preset-block { margin-bottom: 12px; }
  .preset-btn { padding: 7px 5px; gap: 5px; }
  .controls-block { padding-top: 10px; }
  .control { margin-bottom: 9px; }
  .control-top label, .control-top output { font-size: 9px; }
  .range-hints { font-size: 7px; }
  .panel-actions { flex-wrap: wrap; margin: 10px 0; padding-top: 9px; }
  .secondary-btn { min-height: 29px; }
  .readout-strip { left: 10px; right: 10px; bottom: calc(45.5vh + 17px); width: auto; grid-template-columns: repeat(5, minmax(76px,1fr)); overflow-x: auto; }
  .readout { padding: 8px 8px 7px; }
  .readout-label { font-size: 7px; margin-bottom: 5px; }
  .readout strong { font-size: 16px; }
  .readout small { font-size: 7px; }
  .scene-annotations { display: none; }
  .toast { bottom: calc(45.5vh + 82px); }
  .embed .control-panel { top: auto; bottom: 8px; left: 8px; right: 8px; max-height: 46vh; }
  .embed .readout-strip { bottom: calc(46vh + 14px); left: 8px; right: 8px; }
}
@media (max-width: 390px) {
  .control-panel { max-height: 46vh; }
  .readout-strip { bottom: calc(46vh + 15px); }
  .preset-btn b { font-size: 8px; }
  .preset-btn small { font-size: 7px; }
  .secondary-btn { padding: 0 7px; font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
