:root {
  color-scheme: dark;
  --bg: #071316;
  --panel: #0b1d21;
  --panel-2: #0e2428;
  --panel-3: #112b30;
  --line: rgba(171, 211, 204, 0.12);
  --line-strong: rgba(171, 211, 204, 0.2);
  --text: #e8f2ef;
  --muted: #91aaa5;
  --dim: #617c77;
  --accent: #72e3c5;
  --accent-soft: rgba(114, 227, 197, 0.12);
  --accent-glow: rgba(114, 227, 197, 0.28);
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-width: 320px; min-height: 100%; background: var(--bg); color: var(--text); }
body { overflow-x: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100dvh; background: radial-gradient(ellipse at 26% 10%, rgba(37, 91, 83, 0.12), transparent 42%), var(--bg); }
.topbar {
  height: 64px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; border-bottom: 1px solid var(--line); background: rgba(7, 19, 22, 0.94);
}
.brand-lockup { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { width: 35px; height: 35px; display: grid; place-items: center; color: var(--accent); border: 1px solid rgba(114,227,197,.25); border-radius: 11px; background: rgba(114,227,197,.07); }
.brand-mark svg { width: 27px; height: 27px; }
.brand-eyebrow, .section-kicker, .caption-kicker, .metric-label, .topbar-meta, .canvas-topline, .canvas-legend, .quality-row > span, .check-heading, .check-values span, .rail-footer {
  font-size: 9px; line-height: 1.3; letter-spacing: .15em; font-weight: 750;
}
.brand-eyebrow { color: var(--dim); margin-bottom: 2px; }
.brand-name { font-size: 13px; letter-spacing: .01em; font-weight: 680; color: #dceae5; }
.topbar-meta { display: flex; align-items: center; gap: 10px; color: var(--dim); white-space: nowrap; }
.offline-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
.meta-divider { height: 13px; width: 1px; background: var(--line-strong); margin: 0 3px; }
.main-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-template-rows: minmax(0, 1fr); height: calc(100dvh - 64px); min-height: 0; }
.stage-panel { min-width: 0; min-height: 0; padding: 24px 26px 22px; display: flex; flex-direction: column; gap: 16px; }
.stage-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 58px; }
.section-kicker { color: var(--dim); }
.section-kicker span { color: var(--accent); padding: 0 4px; }
h1 { margin: 5px 0 3px; font-size: clamp(22px, 2.2vw, 30px); line-height: 1.08; letter-spacing: -.045em; font-weight: 680; }
.stage-subtitle { margin: 0; color: var(--muted); font-size: 12px; }
.heading-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.regime-pill { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid rgba(114,227,197,.22); border-radius: 999px; background: rgba(114,227,197,.06); color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.screenshot-button { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 9px; background: rgba(17,43,48,.5); color: #a8c0b7; font-size: 8px; font-weight: 800; letter-spacing: .1em; cursor: pointer; transition: border-color .18s ease, color .18s ease, background .18s ease; }
.screenshot-button svg { width: 16px; height: 16px; }
.screenshot-button:hover { color: var(--accent); border-color: rgba(114,227,197,.4); background: rgba(114,227,197,.07); }
.regime-pill.sliding { color: #c1d0cb; border-color: var(--line-strong); background: rgba(145,170,165,.06); }
.regime-pill.quiet { color: #82938e; border-color: var(--line); background: rgba(145,170,165,.04); }
.regime-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 9px currentColor; }
.canvas-frame { position: relative; flex: 1 1 auto; min-height: 270px; overflow: hidden; border: 1px solid rgba(153,198,188,.15); border-radius: 18px; background: #08191c; box-shadow: inset 0 0 60px rgba(0,0,0,.24), 0 18px 45px rgba(0,0,0,.12); }
#scene { display: block; width: 100%; height: 100%; }
.canvas-topline { position: absolute; top: 15px; left: 17px; right: 17px; display: flex; justify-content: space-between; color: rgba(172,198,191,.56); pointer-events: none; font-size: 8px; }
.canvas-legend { position: absolute; bottom: 14px; left: 17px; display: flex; flex-wrap: wrap; gap: 13px; color: rgba(172,198,191,.66); pointer-events: none; font-size: 8px; }
.canvas-legend span { display: inline-flex; align-items: center; gap: 6px; }
.canvas-legend i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.legend-contact { background: var(--accent); box-shadow: 0 0 7px var(--accent-glow); }
.legend-lift { background: rgba(114,227,197,.26); border: 1px solid rgba(114,227,197,.7); }
.legend-wave { width: 14px !important; height: 1px !important; border-radius: 0 !important; background: var(--accent); position: relative; }
.legend-wave::after { content: ""; position: absolute; right: -1px; top: -3px; border-left: 4px solid var(--accent); border-top: 3px solid transparent; border-bottom: 3px solid transparent; }
.readouts { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.metric-card { padding: 12px 15px 11px; min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: rgba(13,32,36,.78); }
.metric-label { color: var(--dim); font-size: 8px; }
.metric-value { margin-top: 4px; font-size: clamp(20px, 2.2vw, 27px); line-height: 1.05; letter-spacing: -.04em; font-weight: 650; font-variant-numeric: tabular-nums; }
.metric-unit { margin-top: 4px; color: var(--muted); font-size: 10px; }
.metric-unit span { color: var(--dim); }
.caption-strip { display: flex; gap: 12px; align-items: flex-start; padding: 12px 15px; border: 1px solid rgba(114,227,197,.13); border-radius: 12px; background: linear-gradient(100deg, rgba(114,227,197,.07), rgba(13,32,36,.6) 65%); }
.caption-mark { width: 29px; height: 29px; flex: 0 0 29px; display: grid; place-items: center; border-radius: 9px; color: var(--accent); background: rgba(114,227,197,.1); }
.caption-mark svg { width: 20px; height: 20px; }
.caption-kicker { color: var(--accent); font-size: 8px; }
.caption-copy p { margin: 4px 0 0; color: #b8cbc5; font-size: 11px; line-height: 1.45; }
.control-rail { min-width: 0; min-height: 0; border-left: 1px solid var(--line); background: rgba(9,25,28,.8); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(114,227,197,.2) transparent; }
.rail-section { padding: 20px 20px 18px; border-bottom: 1px solid var(--line); }
.rail-heading-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
h2 { margin: 4px 0 0; font-size: 18px; letter-spacing: -.035em; font-weight: 660; }
.scaled-tag { color: var(--accent); border: 1px solid rgba(114,227,197,.2); background: rgba(114,227,197,.07); padding: 5px 7px; border-radius: 6px; font-size: 8px; letter-spacing: .12em; font-weight: 800; white-space: nowrap; }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0 17px; }
.preset-button { min-width: 0; padding: 10px 11px; display: flex; justify-content: space-between; align-items: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: 9px; background: rgba(17,43,48,.55); color: #a9beb7; cursor: pointer; font-size: 10px; font-weight: 650; transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease; }
.preset-button b { color: var(--dim); font-size: 13px; }
.preset-button:hover { border-color: rgba(114,227,197,.38); color: var(--text); }
.preset-button.selected { color: var(--accent); border-color: rgba(114,227,197,.42); background: rgba(114,227,197,.09); }
.preset-button.selected b { color: var(--accent); }
.preset-button:active { transform: translateY(1px); }
.control-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 17px 15px; }
.control-item { min-width: 0; }
.control-item label { display: flex; align-items: baseline; justify-content: space-between; gap: 5px; margin-bottom: 8px; color: #c4d4ce; font-size: 10px; font-weight: 650; }
.control-item output { color: var(--accent); font-size: 10px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { width: 100%; height: 16px; margin: 0; padding: 0; appearance: none; background: transparent; cursor: pointer; touch-action: pan-y; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: linear-gradient(90deg, rgba(114,227,197,.75), rgba(114,227,197,.18)); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 999px; background: linear-gradient(90deg, rgba(114,227,197,.75), rgba(114,227,197,.18)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; margin-top: -4.5px; border: 2px solid #071316; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px rgba(114,227,197,.3), 0 0 10px rgba(114,227,197,.28); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border: 2px solid #071316; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px rgba(114,227,197,.3); }
input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 8px; }
.range-ends { display: flex; justify-content: space-between; color: #607a74; font-size: 8px; font-variant-numeric: tabular-nums; margin-top: 3px; }
.threshold-note { display: flex; gap: 9px; margin-top: 17px; padding: 10px 11px; border-radius: 9px; background: rgba(114,227,197,.055); border: 1px solid rgba(114,227,197,.12); }
.threshold-symbol { color: var(--accent); font-size: 16px; line-height: 1.2; }
.threshold-note p { margin: 0; color: #8fa9a2; font-size: 9px; line-height: 1.45; }
.threshold-note strong { color: #cce1d9; font-weight: 700; }
.threshold-note b { color: var(--accent); font-weight: 750; }
.transport-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 7px; margin-top: 16px; }
.transport-primary, .transport-button { min-height: 36px; border-radius: 8px; cursor: pointer; font-size: 9px; font-weight: 800; letter-spacing: .1em; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.transport-primary { display: flex; justify-content: center; align-items: center; gap: 8px; border: 1px solid var(--accent); background: var(--accent); color: #06201c; }
.transport-primary:hover { background: #8af0d4; }
.play-icon { font-size: 12px; }
.transport-button { border: 1px solid var(--line-strong); background: rgba(17,43,48,.65); color: #b2c6bf; }
.transport-button:hover { border-color: rgba(114,227,197,.35); color: var(--accent); }
.transport-primary:active, .transport-button:active { transform: translateY(1px); }
.quality-row { display: flex; align-items: center; justify-content: space-between; margin-top: 13px; }
.quality-row > span { color: var(--dim); font-size: 8px; }
.quality-switch { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: rgba(4,14,16,.5); }
.quality-switch button { border: 0; border-radius: 5px; padding: 5px 8px; background: transparent; color: var(--dim); font-size: 8px; font-weight: 800; letter-spacing: .08em; cursor: pointer; }
.quality-switch button.active { color: var(--accent); background: rgba(114,227,197,.12); }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.check-section { padding-top: 17px; padding-bottom: 16px; }
.check-heading { display: flex; align-items: center; justify-content: space-between; }
.check-mark { color: var(--accent); font-size: 8px; letter-spacing: .12em; }
h3 { margin: 7px 0 5px; font-size: 13px; font-weight: 680; letter-spacing: -.02em; }
.check-description { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.check-values { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 11px; }
.check-values > div { padding: 8px 9px; border-radius: 8px; background: rgba(17,43,48,.55); border: 1px solid var(--line); }
.check-values span { display: block; color: var(--dim); font-size: 7px; }
.check-values strong { display: block; margin-top: 4px; color: #dcebe5; font-size: 14px; font-variant-numeric: tabular-nums; }
.check-difference { margin-top: 8px; color: var(--accent); font-size: 9px; font-weight: 700; font-variant-numeric: tabular-nums; }
.check-footnote { margin-top: 6px; color: #627b75; font-size: 8px; line-height: 1.4; }
.science-section { padding: 0 20px; }
.science-section details { padding: 16px 0 17px; }
.science-section summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
.science-section summary::-webkit-details-marker { display: none; }
.science-section summary strong { display: block; margin-top: 3px; font-size: 14px; font-weight: 680; }
.details-plus { color: var(--accent); font-size: 18px; transition: transform .2s ease; }
.science-section details[open] .details-plus { transform: rotate(45deg); }
.science-content { padding-top: 14px; color: #9ab0a9; font-size: 9px; line-height: 1.55; }
.science-content h4 { margin: 12px 0 5px; color: #d0e0d9; font-size: 10px; letter-spacing: .02em; }
.science-content p { margin: 5px 0; }
.science-content code { color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9px; }
.science-caveat { margin-top: 12px !important; padding-top: 10px; border-top: 1px solid var(--line); color: #c0d2cb; font-style: italic; }
.science-units { color: #6f8982; font-size: 8px; }
.rail-footer { padding: 13px 20px 17px; color: #526c66; font-size: 7px; }
.rail-footer span { color: var(--accent); padding: 0 4px; }

@media (min-width: 1500px) {
  .main-layout { grid-template-columns: minmax(0, 1fr) 390px; }
  .stage-panel { padding: 30px 34px 26px; }
  .canvas-frame { min-height: 360px; }
}
@media (max-width: 900px) {
  .main-layout { grid-template-columns: minmax(0,1fr) 330px; }
  .stage-panel { padding: 20px 18px 18px; gap: 13px; }
  .control-rail .rail-section { padding-left: 16px; padding-right: 16px; }
  .science-section { padding-left: 16px !important; padding-right: 16px !important; }
}
@media (max-width: 720px) {
  .topbar { height: 58px; padding: 0 15px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-eyebrow { font-size: 8px; }
  .brand-name { font-size: 12px; }
  .topbar-meta { font-size: 7px; gap: 6px; }
  .topbar-meta .meta-divider, .topbar-meta span:last-child { display: none; }
  .main-layout { display: flex; flex-direction: column; height: auto; min-height: calc(100dvh - 58px); }
  .stage-panel { flex: 0 0 44dvh; height: 44dvh; min-height: 300px; max-height: 390px; padding: 14px 13px 12px; gap: 9px; }
  .stage-heading { min-height: 48px; }
  h1 { font-size: 21px; margin-top: 3px; }
  .stage-subtitle { font-size: 10px; }
  .section-kicker { font-size: 8px; }
  .regime-pill { padding: 7px 9px; font-size: 7px; gap: 6px; }
  .screenshot-button { min-height: 29px; padding: 0 7px; gap: 4px; }
  .screenshot-button svg { width: 14px; height: 14px; }
  .screenshot-button span { display: none; }
  .canvas-frame { min-height: 145px; border-radius: 13px; }
  .canvas-topline { top: 10px; left: 11px; right: 11px; font-size: 7px; }
  .canvas-legend { left: 11px; bottom: 9px; gap: 8px; font-size: 7px; }
  .readouts { gap: 6px; }
  .metric-card { padding: 8px 9px 7px; border-radius: 9px; }
  .metric-label { font-size: 6px; letter-spacing: .11em; }
  .metric-value { font-size: 19px; margin-top: 3px; }
  .metric-unit { font-size: 8px; margin-top: 2px; }
  .caption-strip { gap: 8px; padding: 8px 10px; border-radius: 9px; }
  .caption-mark { width: 24px; height: 24px; flex-basis: 24px; border-radius: 7px; }
  .caption-mark svg { width: 17px; height: 17px; }
  .caption-kicker { font-size: 7px; }
  .caption-copy p { font-size: 9px; line-height: 1.32; margin-top: 2px; }
  .control-rail { flex: 1 1 auto; min-height: 0; overflow: visible; border-left: 0; border-top: 1px solid var(--line); }
  .rail-section { padding: 17px 15px 15px; }
  .control-grid { gap: 15px 18px; }
  .control-item label { font-size: 10px; }
  .range-ends { font-size: 7px; }
  .check-section { padding-top: 15px; }
  .science-section { padding-left: 15px !important; padding-right: 15px !important; }
  .rail-footer { padding-left: 15px; }
  body.embed-mode .main-layout { height: calc(100dvh - 58px); min-height: 0; }
  body.embed-mode .stage-panel { flex: 0 0 44%; height: 44%; min-height: 0; max-height: none; }
  body.embed-mode .control-rail { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
}
@media (max-width: 390px) {
  .topbar { padding: 0 11px; }
  .topbar-meta { font-size: 6px; }
  .stage-panel { padding-left: 10px; padding-right: 10px; }
  .stage-heading { gap: 7px; }
  h1 { font-size: 19px; }
  .regime-pill { padding: 6px 7px; font-size: 6px; }
  .heading-actions { gap: 5px; }
  .screenshot-button { min-width: 29px; justify-content: center; }
  .canvas-legend { gap: 6px; }
  .canvas-legend span { gap: 4px; }
  .metric-card { padding-left: 7px; padding-right: 7px; }
  .metric-value { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .app-shell { height: 100%; min-height: 0; }
body.embed-mode .main-layout { height: calc(100% - 64px); min-height: 0; }
