:root {
  --bg: #10171c;
  --panel: #172128;
  --panel-2: #1b2830;
  --panel-3: #202f38;
  --line: rgba(218, 231, 225, 0.11);
  --line-strong: rgba(218, 231, 225, 0.18);
  --text: #e6eee9;
  --muted: #91a19c;
  --dim: #64736f;
  --accent: #80e0b4;
  --accent-soft: rgba(128, 224, 180, 0.13);
  --accent-mid: rgba(128, 224, 180, 0.35);
  --radius: 14px;
  --space: 8px;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 13px; letter-spacing: 0.005em; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.app-shell { min-height: 100vh; display: grid; grid-template-rows: 68px minmax(0, 1fr); }
.topbar { display: grid; grid-template-columns: 220px minmax(0, 1fr) auto; align-items: center; gap: 24px; padding: 0 22px; border-bottom: 1px solid var(--line); background: #121b21; }
.brand-lockup { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { width: 28px; height: 28px; border: 1px solid var(--accent-mid); border-radius: 9px; display: flex; align-items: center; justify-content: center; gap: 3px; transform: rotate(-12deg); }
.brand-mark span { width: 3px; border-radius: 3px; background: var(--accent); display: block; }
.brand-mark span:nth-child(1) { height: 9px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 17px; }
.brand-mark span:nth-child(3) { height: 12px; opacity: .72; }
.eyebrow, .section-label, .section-index, .stage-label, .stat-label, .caption-kicker, .group-title, .quality-row > span, .panel-footer, .canvas-hud, .top-meta, .time-readout > span, .threshold-track, .check-box span { font-size: 9px; font-weight: 750; letter-spacing: .13em; }
.eyebrow { color: var(--muted); font-size: 8px; margin-bottom: 3px; }
.brand-name { font-size: 13px; font-weight: 800; letter-spacing: .11em; }
.brand-name span { color: var(--accent); }
.top-title h1 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.025em; }
.top-title p { margin: 2px 0 0; font-size: 11px; color: var(--muted); }
.top-meta { display: flex; align-items: center; gap: 8px; color: var(--accent); }
.meta-chip { padding: 7px 9px; border: 1px solid var(--accent-mid); border-radius: 6px; white-space: nowrap; }
.meta-chip.muted { color: var(--muted); border-color: var(--line-strong); }
.layout { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 16px; padding: 16px; }
.stage-column { min-width: 0; min-height: 0; display: grid; grid-template-rows: minmax(300px, 1fr) auto auto; gap: 12px; }
.stage-card { min-height: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #141f25; display: grid; grid-template-rows: 43px minmax(0, 1fr) 39px; box-shadow: 0 12px 34px rgba(0,0,0,.12); }
.stage-head, .stage-foot { display: flex; align-items: center; justify-content: space-between; padding: 0 16px; }
.stage-head { border-bottom: 1px solid var(--line); }
.stage-foot { border-top: 1px solid var(--line); background: rgba(255,255,255,.012); }
.stage-label { display: flex; gap: 10px; align-items: center; color: #c5d1ca; }
.section-index { color: var(--accent); }
.stage-actions { display: flex; align-items: center; gap: 16px; }
.live-indicator { display: flex; align-items: center; gap: 7px; color: var(--accent); font-size: 9px; font-weight: 750; letter-spacing: .11em; }
.live-indicator i, .hud-dot, .caption-pulse { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(128,224,180,.6); }
.quiet-button { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 7px 0 7px 8px; font-size: 11px; }
.quiet-button:hover { color: var(--accent); }
.canvas-wrap { min-height: 0; position: relative; overflow: hidden; }
#scene { width: 100%; height: 100%; display: block; }
.canvas-hud { position: absolute; top: 14px; pointer-events: none; color: rgba(222,236,228,.55); font-size: 8px; }
.hud-left { left: 16px; display: flex; align-items: center; gap: 7px; }
.hud-right { right: 16px; }
.hud-right b { color: var(--accent); font-size: 14px; padding-left: 5px; }
.legend { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 10px; }
.legend span { display: flex; align-items: center; gap: 7px; }
.legend i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.legend-contact { background: var(--accent); box-shadow: 0 0 8px var(--accent-mid); }
.legend-lifted { background: #82928d; }
.time-readout { display: flex; align-items: center; gap: 9px; }
.time-readout > span { color: var(--dim); font-size: 8px; }
.time-readout b { color: #dbe7e0; font-size: 11px; font-variant-numeric: tabular-nums; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.stat-card { min-width: 0; padding: 12px 14px 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); }
.primary-stat { border-color: var(--accent-mid); background: linear-gradient(135deg, rgba(128,224,180,.09), rgba(128,224,180,.02)); }
.stat-label { color: var(--muted); font-size: 8px; letter-spacing: .105em; white-space: nowrap; }
.stat-value { margin-top: 8px; font-size: clamp(17px, 2vw, 23px); font-weight: 680; letter-spacing: -.04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-value small { color: var(--muted); font-size: 10px; font-weight: 550; letter-spacing: 0; }
.primary-stat .stat-value { color: var(--accent); }
.stat-note { margin-top: 4px; color: var(--dim); font-size: 9px; }
.caption-card { border: 1px solid var(--line); border-radius: 11px; background: rgba(27,40,48,.76); padding: 10px 14px 11px; min-height: 62px; }
.caption-kicker { display: flex; align-items: center; gap: 7px; color: var(--accent); font-size: 8px; }
.caption-pulse { width: 5px; height: 5px; }
.caption-card p { margin: 5px 0 0 12px; color: #c3d0c9; font-size: 11px; line-height: 1.45; }
.control-panel { min-height: 0; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 16px; scrollbar-width: thin; scrollbar-color: #40524d transparent; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 13px; }
.section-label { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 8px; }
.panel-heading h2 { margin: 8px 0 0; font-size: 16px; font-weight: 650; letter-spacing: -.025em; }
.illustrative-tag { padding: 5px 7px; color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(128,224,180,.2); border-radius: 5px; font-size: 8px; font-weight: 750; letter-spacing: .09em; white-space: nowrap; }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 17px; }
.preset-button { min-width: 0; display: flex; align-items: center; gap: 9px; text-align: left; padding: 10px 9px; background: #1d2a31; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.preset-button:hover { border-color: var(--accent-mid); transform: translateY(-1px); }
.preset-button.active { background: var(--accent-soft); border-color: var(--accent-mid); }
.preset-icon { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 7px; display: grid; place-items: center; color: var(--accent); background: rgba(128,224,180,.11); font-size: 14px; }
.preset-icon.neutral { color: #b6c3bc; background: rgba(182,195,188,.09); }
.preset-button b, .preset-button small { display: block; white-space: nowrap; }
.preset-button b { font-size: 10px; font-weight: 650; }
.preset-button small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.controls-group { padding-top: 13px; margin-top: 12px; border-top: 1px solid var(--line); }
.group-title { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 8px; }
.group-line { flex: 1; height: 1px; background: var(--line); }
.control-row { margin-top: 13px; }
.control-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 7px; }
.control-heading label { color: #d6e0da; font-size: 11px; font-weight: 550; }
.control-heading output { color: var(--accent); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
input[type="range"] { appearance: none; width: 100%; height: 4px; display: block; border-radius: 99px; background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--range-progress,50%), #40504d var(--range-progress,50%), #40504d 100%); cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; border-radius: 50%; border: 2px solid #13221e; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #13221e; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.range-ends { display: flex; justify-content: space-between; margin-top: 6px; color: var(--dim); font-size: 8px; font-variant-numeric: tabular-nums; }
.threshold-track { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 9px; padding: 7px 8px; border-radius: 6px; background: rgba(128,224,180,.07); color: var(--muted); font-size: 7px; letter-spacing: .09em; }
.threshold-track b { color: var(--accent); font-size: 8px; letter-spacing: .04em; }
.transport-row { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 7px; margin-top: 18px; }
.transport-button { border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 8px; background: #202e35; color: #cbd7d0; font-size: 10px; font-weight: 600; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.transport-button:hover { border-color: var(--accent-mid); color: var(--text); }
.main-transport { color: #102018; background: var(--accent); border-color: var(--accent); }
.main-transport:hover { color: #102018; background: #9aebc7; }
.main-transport span { padding-left: 3px; }
.quality-row { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.quality-row > span { color: var(--dim); font-size: 8px; }
.quality-switch { display: flex; gap: 3px; padding: 3px; background: #111b20; border: 1px solid var(--line); border-radius: 7px; }
.quality-switch button { border: 0; border-radius: 5px; background: transparent; padding: 5px 10px; color: var(--muted); font-size: 9px; cursor: pointer; }
.quality-switch button.selected { background: #2c3b41; color: var(--accent); }
.science-panel { margin-top: 12px; border: 1px solid var(--line); border-radius: 9px; background: rgba(10,18,22,.18); }
.science-panel summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 11px; cursor: pointer; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-symbol { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-size: 15px; }
.science-panel summary b, .science-panel summary small { display: block; }
.science-panel summary b { font-size: 11px; font-weight: 650; }
.science-panel summary small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.summary-chevron { margin-left: auto; color: var(--muted); font-size: 17px; transition: transform .2s ease; }
.science-panel[open] .summary-chevron { transform: rotate(180deg); }
.science-content { padding: 0 11px 12px; border-top: 1px solid var(--line); }
.science-content h3 { margin: 13px 0 7px; color: #dbe6df; font-size: 10px; font-weight: 700; }
.science-content p { margin: 7px 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.equation { overflow-wrap: anywhere; padding: 8px; border: 1px solid rgba(128,224,180,.12); border-radius: 6px; background: rgba(128,224,180,.045); color: #c4f1d9; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; line-height: 1.45; }
.equation.compact { font-size: 9px; }
.check-box { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 9px; border: 1px solid var(--line); border-radius: 7px; background: #152128; }
.check-box div { min-width: 0; }
.check-box span { display: block; color: var(--dim); font-size: 7px; letter-spacing: .08em; }
.check-box b { display: block; margin-top: 5px; color: #dce8e0; font-size: 11px; font-variant-numeric: tabular-nums; }
.check-box .check-difference { grid-column: 1 / -1; padding-top: 7px; border-top: 1px solid var(--line); }
.check-box .check-difference b { color: var(--accent); }
.science-content .science-note { margin-top: 9px; }
.science-content .disclaimer { padding-top: 8px; border-top: 1px solid var(--line); color: #b6c4bd; font-style: italic; }
.panel-footer { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; color: var(--dim); font-size: 7px; letter-spacing: .09em; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .app-shell { height: 100vh; height: 100dvh; min-height: 0; }
@media (min-width: 1500px) {
  .layout { grid-template-columns: minmax(0,1fr) 370px; gap: 18px; padding: 18px; }
  .topbar { padding: 0 26px; }
  .control-panel { padding: 18px; }
}
@media (max-width: 1000px) and (min-width: 761px) {
  .layout { grid-template-columns: minmax(0,1fr) 320px; gap: 10px; padding: 10px; }
  .topbar { grid-template-columns: 190px minmax(0,1fr) auto; gap: 12px; padding: 0 14px; }
  .stats-grid { gap: 6px; }
  .stat-card { padding: 10px; }
  .stat-label { font-size: 7px; }
  .control-panel { padding: 13px; }
}
@media (max-width: 760px) {
  .app-shell { grid-template-rows: 58px minmax(0,1fr); }
  .topbar { grid-template-columns: auto minmax(0,1fr) auto; gap: 10px; padding: 0 12px; }
  .brand-lockup { gap: 7px; }
  .brand-mark { width: 24px; height: 24px; }
  .eyebrow { display: none; }
  .brand-name { font-size: 10px; }
  .top-title h1 { font-size: 13px; }
  .top-title p { font-size: 9px; }
  .top-meta { gap: 4px; }
  .meta-chip { padding: 5px 6px; font-size: 7px; letter-spacing: .07em; }
  .meta-chip.muted { display: none; }
  .layout { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(320px, 44vh) minmax(0,1fr); gap: 9px; padding: 9px; overflow: hidden; }
  .stage-column { grid-template-rows: minmax(0,1fr) auto auto; gap: 7px; }
  .stage-card { grid-template-rows: 34px minmax(0,1fr) 31px; border-radius: 11px; }
  .stage-head, .stage-foot { padding: 0 10px; }
  .stage-label { font-size: 8px; gap: 7px; }
  .stage-actions { gap: 9px; }
  .live-indicator { font-size: 7px; }
  .quiet-button { font-size: 9px; }
  .canvas-hud { top: 9px; font-size: 7px; }
  .hud-left { left: 10px; }
  .hud-right { right: 10px; }
  .legend { gap: 10px; font-size: 8px; }
  .legend span { gap: 5px; }
  .time-readout { gap: 5px; }
  .time-readout > span { font-size: 7px; }
  .time-readout b { font-size: 9px; }
  .stats-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; }
  .stat-card { padding: 8px 7px; border-radius: 8px; }
  .stat-label { font-size: 6px; letter-spacing: .06em; white-space: normal; line-height: 1.2; min-height: 15px; }
  .stat-value { margin-top: 5px; font-size: 15px; }
  .stat-value small { font-size: 8px; }
  .stat-note { display: none; }
  .caption-card { min-height: 48px; padding: 7px 9px; border-radius: 8px; }
  .caption-kicker { font-size: 7px; }
  .caption-card p { margin-top: 3px; margin-left: 10px; font-size: 9px; line-height: 1.3; }
  .control-panel { padding: 12px; border-radius: 11px; }
  .panel-heading { margin-bottom: 10px; }
  .panel-heading h2 { margin-top: 5px; font-size: 14px; }
  .preset-row { margin-bottom: 12px; }
  .preset-button { padding: 8px 7px; gap: 7px; }
  .preset-button b { font-size: 9px; }
  .preset-button small { font-size: 8px; }
  .preset-icon { width: 21px; height: 21px; flex-basis: 21px; }
  .controls-group { padding-top: 10px; margin-top: 9px; }
  .control-row { margin-top: 10px; }
  .control-heading { margin-bottom: 6px; }
  .control-heading label { font-size: 10px; }
  .control-heading output { font-size: 9px; }
  .range-ends { margin-top: 4px; }
  .threshold-track { margin-top: 7px; }
  .transport-row { margin-top: 13px; }
  .transport-button { padding: 8px 6px; font-size: 9px; }
  .quality-row { margin-top: 10px; padding-bottom: 10px; }
  .science-panel { margin-top: 9px; }
  .panel-footer { margin: 10px 0 3px; }
}
@media (max-width: 390px) {
  .topbar { gap: 7px; padding: 0 8px; }
  .brand-name { font-size: 9px; }
  .top-title h1 { font-size: 12px; }
  .top-title p { font-size: 8px; }
  .meta-chip { font-size: 6px; padding: 4px 5px; }
  .layout { padding: 7px; gap: 7px; grid-template-rows: minmax(310px, 43vh) minmax(0,1fr); }
  .legend { font-size: 7px; gap: 7px; }
  .time-readout > span { display: none; }
  .stat-value { font-size: 13px; }
  .stat-value small { font-size: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
