:root {
  color-scheme: dark;
  --bg: #08131d;
  --panel: #0d1a25;
  --panel-raised: #112330;
  --line: #243746;
  --line-soft: rgba(135, 166, 184, .16);
  --text: #e8f0f4;
  --muted: #91a6b4;
  --quiet: #6f8594;
  --accent: #66d8c7;
  --accent-strong: #8ce8d9;
  --warning: #e3a46d;
  --cold: #4c9bc0;
  --hot: #e8a15f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { 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; }
button, input { font: inherit; }
button { color: inherit; }
.topbar {
  height: 62px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--line); background: #09151f; position: relative; z-index: 2;
}
.brand-lockup { display: flex; align-items: center; gap: 11px; min-width: 220px; }
.brand-mark { width: 28px; height: 28px; border: 1px solid rgba(102,216,199,.55); border-radius: 8px; display: flex; align-items: end; justify-content: center; gap: 3px; padding: 6px; transform: rotate(-3deg); }
.brand-mark span { width: 4px; border-radius: 3px; background: var(--accent); display: block; }
.brand-mark span:nth-child(1) { height: 8px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 14px; }
.brand-mark span:nth-child(3) { height: 10px; opacity: .75; }
.brand-name { font-size: 13px; font-weight: 720; letter-spacing: .02em; }
.brand-kicker, .topbar-title, .topbar-meta { font-size: 9px; letter-spacing: .16em; color: var(--muted); }
.brand-kicker { margin-top: 3px; font-size: 8px; color: var(--quiet); }
.topbar-title { font-weight: 650; color: #c4d2da; }
.topbar-title span { color: var(--accent); padding: 0 5px; }
.topbar-meta { min-width: 220px; text-align: right; }
.live-dot, .clock-indicator, .live-pill span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(102,216,199,.55); vertical-align: 1px; margin-right: 7px; }
.meta-divider { color: #496071; padding: 0 8px; }
.workspace {
  height: calc(100vh - 62px); height: calc(100dvh - 62px);
  display: grid; grid-template-columns: minmax(235px, 270px) minmax(0, 1fr) minmax(280px, 310px);
  background: var(--line); gap: 1px; overflow: hidden;
}
.stage { min-width: 0; min-height: 0; position: relative; overflow: hidden; background: #0a1823; grid-column: 2; }
#scene { display: block; width: 100%; height: 100%; }
.panel-stack { display: contents; }
.panel { min-width: 0; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #334a5b transparent; background: var(--panel); }
.controls-panel { grid-column: 1; grid-row: 1; padding: 20px 17px 16px; }
.insight-panel { grid-column: 3; grid-row: 1; padding: 20px 17px 14px; }
.panel::-webkit-scrollbar, .panel-stack::-webkit-scrollbar { width: 5px; }
.panel::-webkit-scrollbar-thumb, .panel-stack::-webkit-scrollbar-thumb { background: #334a5b; border-radius: 10px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 20px; }
.eyebrow { font-size: 9px; line-height: 1.3; font-weight: 700; letter-spacing: .17em; color: var(--accent); }
h1, h2 { font-size: 17px; letter-spacing: -.025em; line-height: 1.2; margin: 5px 0 0; font-weight: 650; }
h2 { font-size: 16px; }
.status-chip, .mini-tag { font-size: 8px; font-weight: 700; letter-spacing: .1em; color: #9eb1bd; border: 1px solid #354958; border-radius: 4px; padding: 4px 5px; white-space: nowrap; }
.preset-section { padding-bottom: 17px; border-bottom: 1px solid var(--line-soft); }
.section-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #d2dee4; font-size: 9px; font-weight: 750; letter-spacing: .14em; margin-bottom: 10px; }
.section-label span { color: var(--quiet); font-size: 8px; font-weight: 600; letter-spacing: .08em; text-align: right; }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.preset-button { min-height: 36px; border: 1px solid #2a3d4b; border-radius: 6px; padding: 7px 6px; background: #101f2b; color: #b7c6ce; font-size: 10px; line-height: 1.25; cursor: pointer; transition: border-color .18s ease, background .18s ease, color .18s ease; }
.preset-button:hover { border-color: #638a8b; color: var(--text); }
.preset-button.selected { border-color: rgba(102,216,199,.75); background: rgba(102,216,199,.09); color: #d9f5ef; box-shadow: inset 0 0 0 1px rgba(102,216,199,.08); }
.preset-button.warning-preset { border-color: #594638; }
.preset-button.warning-preset.selected { border-color: var(--warning); background: rgba(227,164,109,.09); color: #f0d6bd; }
.control-list { padding: 3px 0 4px; }
.control-row { padding: 10px 0 9px; border-bottom: 1px solid rgba(135,166,184,.11); }
.control-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 7px; }
.control-heading label { font-size: 11px; color: #d6e1e6; font-weight: 550; }
.control-heading output { font-size: 11px; color: var(--accent-strong); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { display: block; width: 100%; height: 14px; margin: 0; appearance: none; background: transparent; cursor: pointer; accent-color: var(--accent); }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; background: #344957; border-radius: 10px; }
input[type="range"]::-moz-range-track { height: 3px; background: #344957; border-radius: 10px; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; margin-top: -5px; border-radius: 50%; background: var(--accent); border: 2px solid #0b1822; box-shadow: 0 0 0 1px var(--accent); }
input[type="range"]::-moz-range-thumb { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); border: 2px solid #0b1822; box-shadow: 0 0 0 1px var(--accent); }
input[type="range"]:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; border-radius: 5px; }
.range-ends { display: flex; justify-content: space-between; gap: 4px; align-items: center; color: #738a99; font-size: 8px; font-variant-numeric: tabular-nums; }
.range-ends .mini-tag { font-size: 7px; padding: 3px 4px; }
.transport-controls { display: grid; grid-template-columns: 1.25fr .8fr .8fr; gap: 6px; padding-top: 14px; }
.transport-button { min-height: 35px; border: 1px solid #344957; border-radius: 6px; background: #122330; color: #c6d4db; font-size: 10px; font-weight: 650; cursor: pointer; transition: .16s ease; }
.transport-button:hover { border-color: #638a8b; color: white; }
.transport-button.primary { border-color: rgba(102,216,199,.65); background: rgba(102,216,199,.1); color: #dff8f3; }
.play-icon { font-size: 10px; margin-right: 5px; color: var(--accent); }
.control-footer { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-top: 13px; color: #78909e; font-size: 8px; letter-spacing: .08em; }
.control-footer strong { color: #b9cbd4; font-size: 8px; }
.control-footer em { color: var(--quiet); font-style: normal; font-size: 7px; border: 1px solid #304554; padding: 2px 3px; border-radius: 3px; margin-left: 3px; }
.clock-indicator { width: 5px; height: 5px; margin-right: 2px; }
.quality-button { border: 0; background: transparent; color: var(--accent); font-size: 8px; letter-spacing: .1em; cursor: pointer; padding: 5px 0 5px 5px; white-space: nowrap; }
.insight-heading { margin-bottom: 15px; }
.live-pill { display: inline-flex; align-items: center; gap: 3px; color: var(--accent); font-size: 8px; font-weight: 750; letter-spacing: .13em; border: 1px solid rgba(102,216,199,.28); border-radius: 20px; padding: 5px 7px; }
.live-pill span { width: 5px; height: 5px; margin: 0; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.readout-card { min-width: 0; border: 1px solid #293d4b; background: #10212d; border-radius: 7px; padding: 10px 10px 9px; }
.readout-card.featured, .readout-card.wide-readout { grid-column: 1 / -1; }
.readout-card.featured { grid-column: 1 / -1; background: linear-gradient(115deg, rgba(55,111,137,.18), rgba(16,33,45,.94)); border-color: #345367; }
.readout-top { display: flex; align-items: center; justify-content: space-between; gap: 5px; color: #9db0bb; font-size: 9px; }
.readout-top .mini-tag { font-size: 7px; padding: 3px 4px; }
.readout-value { font-size: 23px; line-height: 1.2; font-weight: 680; letter-spacing: -.04em; color: #f0f6f7; font-variant-numeric: tabular-nums; margin-top: 6px; white-space: nowrap; }
.featured .readout-value { font-size: 28px; color: #f3c18e; }
.readout-value small { font-size: 11px; font-weight: 550; color: #9cb1bc; letter-spacing: 0; }
.readout-note { color: #748b99; font-size: 8px; margin-top: 3px; }
.caption-card { display: flex; gap: 10px; margin: 11px 0 14px; padding: 11px 10px; border-left: 2px solid var(--accent); background: rgba(102,216,199,.055); border-radius: 0 6px 6px 0; }
.caption-icon { color: var(--accent); font-size: 16px; line-height: 1; padding-top: 1px; }
.caption-label { color: var(--accent); font-size: 8px; font-weight: 750; letter-spacing: .14em; }
.caption-card p { margin: 5px 0 0; color: #b6c6ce; font-size: 10px; line-height: 1.45; }
.experiment-card { border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: 13px 0 12px; }
.experiment-title { font-size: 12px; font-weight: 650; margin: 1px 0 4px; }
.experiment-card p { color: #8fa4b0; font-size: 9px; line-height: 1.45; margin: 0 0 9px; }
.experiment-button { width: 100%; min-height: 32px; display: flex; justify-content: space-between; align-items: center; padding: 0 10px; border: 1px solid rgba(102,216,199,.45); border-radius: 5px; background: rgba(102,216,199,.08); color: #d7f3ee; font-size: 9px; font-weight: 650; cursor: pointer; }
.experiment-button:hover { background: rgba(102,216,199,.15); }
.experiment-button span { font-size: 14px; color: var(--accent); }
.experiment-result { color: #9eb1bc; font-size: 9px; line-height: 1.45; margin-top: 8px; font-variant-numeric: tabular-nums; }
.experiment-result strong { color: #e4f1f2; }
.checks-section { padding: 13px 0 8px; }
.check-row { display: grid; grid-template-columns: minmax(0,1fr) auto 35px; align-items: center; gap: 7px; padding: 8px 0; border-bottom: 1px solid rgba(135,166,184,.1); }
.check-row strong { display: block; font-size: 9px; font-weight: 620; color: #cdd9df; }
.check-row small { display: block; margin-top: 3px; font-size: 8px; color: #718795; }
.check-value { text-align: right; font-variant-numeric: tabular-nums; }
.check-value span { display: block; color: #d7e4e8; font-size: 10px; }
.check-value em { display: block; color: #708795; font-style: normal; font-size: 6px; letter-spacing: .12em; margin-top: 2px; }
.check-state { text-align: center; color: var(--accent); border: 1px solid rgba(102,216,199,.28); background: rgba(102,216,199,.055); border-radius: 4px; padding: 4px 2px; font-size: 7px; font-weight: 750; letter-spacing: .08em; }
.check-state.fail { color: var(--warning); border-color: rgba(227,164,109,.35); background: rgba(227,164,109,.07); }
.science-panel { border-top: 1px solid var(--line-soft); margin-top: 6px; }
.science-panel summary { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 13px 0 10px; cursor: pointer; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary strong { display: block; font-size: 12px; margin-top: 3px; }
.summary-mark { color: var(--accent); font-size: 18px; transition: transform .2s ease; }
.science-panel[open] .summary-mark { transform: rotate(45deg); }
.science-content { padding: 0 0 12px; }
.science-content h3 { margin: 12px 0 5px; color: #d9e4e9; font-size: 10px; font-weight: 700; }
.science-content p { margin: 5px 0 8px; color: #8fa4b0; font-size: 9px; line-height: 1.55; }
.science-content b { color: #d4e3e8; }
.equation { padding: 8px 9px; margin: 7px 0; border: 1px solid #293f4e; border-radius: 5px; background: #0a1721; color: #cde8e3; font-family: Georgia, "Times New Roman", serif; font-size: 13px; text-align: center; letter-spacing: .01em; }
.not-affiliated { margin-top: 9px; padding-top: 8px; border-top: 1px solid rgba(135,166,184,.1); color: #617886; font-size: 8px; line-height: 1.4; }
.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; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .topbar { display: none; }
body.embed-mode .workspace { height: 100vh; height: 100dvh; }
@media (max-width: 900px) {
  .workspace { grid-template-columns: minmax(220px, 250px) minmax(0,1fr); grid-template-rows: minmax(0,1fr); }
  .stage { grid-column: 2; }
  .panel-stack { display: block; grid-column: 1; grid-row: 1; overflow-y: auto; min-height: 0; }
  .controls-panel, .insight-panel { overflow: visible; }
  .insight-panel { border-top: 1px solid var(--line); }
}
@media (max-width: 650px) {
  .topbar { height: 52px; padding: 0 14px; }
  .brand-lockup { min-width: 0; }
  .topbar-title { display: none; }
  .topbar-meta { min-width: 0; font-size: 8px; }
  .workspace { height: calc(100vh - 52px); height: calc(100dvh - 52px); display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(240px, 43dvh) minmax(0,1fr); gap: 1px; }
  .stage { grid-column: 1; grid-row: 1; }
  .panel-stack { grid-column: 1; grid-row: 2; display: block; overflow-y: auto; overscroll-behavior: contain; }
  .controls-panel, .insight-panel { padding: 16px 15px; }
  .controls-panel { border-bottom: 1px solid var(--line); }
  .insight-panel { border-top: 0; }
  body.embed-mode .workspace { height: 100vh; height: 100dvh; grid-template-rows: minmax(230px, 44dvh) minmax(0,1fr); }
}
@media (max-width: 390px) {
  .workspace { grid-template-rows: minmax(220px, 42dvh) minmax(0,1fr); }
  body.embed-mode .workspace { grid-template-rows: minmax(220px, 43dvh) minmax(0,1fr); }
  .readout-value { font-size: 21px; }
  .featured .readout-value { font-size: 25px; }
  .section-label { font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
