:root {
  color-scheme: dark;
  --bg: #0b1119;
  --panel: #111b26;
  --panel-2: #152230;
  --line: #263746;
  --text: #edf3f6;
  --muted: #9baab6;
  --dim: #6d7d8b;
  --accent: #6de0d1;
  --accent-soft: rgba(109,224,209,.12);
  --danger: #b8a6a1;
  --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-height: 100%; background: var(--bg); color: var(--text); }
body { overflow-x: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { height: 100vh; min-height: 0; display: flex; flex-direction: column; }
.masthead { height: 54px; flex: 0 0 54px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid #1d2a36; background: #0d151f; }
.brand-lockup { display: flex; align-items: center; gap: 10px; font-size: 10px; letter-spacing: .16em; font-weight: 800; color: #dce6eb; }
.brand-lockup i { font-style: normal; color: var(--muted); font-weight: 500; }
.brand-mark { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid #49616c; color: var(--accent); border-radius: 7px; font-size: 12px; letter-spacing: 0; }
.masthead-note { color: #6f8290; font-size: 9px; letter-spacing: .16em; }
.workspace { width: 100%; max-width: 1680px; margin: 0 auto; padding: 16px; flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(350px, .9fr); gap: 16px; }
.visual-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.visual-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 4px 4px 0; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 9px; letter-spacing: .17em; font-weight: 800; }
h1 { margin: 0; font-size: clamp(22px, 2.4vw, 32px); line-height: 1.08; letter-spacing: -.035em; font-weight: 680; }
.subheading { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.model-chip { margin-top: 4px; display: flex; align-items: center; gap: 7px; border: 1px solid #304454; border-radius: 999px; padding: 7px 10px; color: #d3e0e5; white-space: nowrap; font-size: 9px; letter-spacing: .1em; }
.model-chip small { color: var(--dim); font-size: 8px; }
.pulse-dot, .caption-pin { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(109,224,209,.45); }
.stage-wrap { position: relative; min-height: 300px; flex: 1 1 auto; overflow: hidden; border: 1px solid #243544; border-radius: 16px; background: #0c141e; box-shadow: 0 14px 36px rgba(0,0,0,.16); }
#scene { display: block; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
#scene.dragging { cursor: grabbing; }
.stage-corner { position: absolute; top: 12px; z-index: 2; color: #8799a5; font-size: 8px; letter-spacing: .14em; pointer-events: none; }
.stage-corner-left { left: 14px; }
.stage-corner-left span { color: #5d7380; }
.stage-corner-right { right: 14px; }
.caption-row { display: flex; align-items: flex-start; gap: 10px; padding: 1px 5px; min-height: 36px; }
.caption-pin { margin-top: 5px; flex: 0 0 7px; }
.caption-row p { margin: 0; color: #b5c2ca; font-size: 11px; line-height: 1.5; }
.readout-strip { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; }
.readout { padding: 10px 12px; border: 1px solid #243544; border-radius: 11px; background: #101a25; min-width: 0; }
.readout span { display: block; color: #8fa1ad; font-size: 8px; letter-spacing: .13em; font-weight: 800; }
.readout strong { display: block; margin: 3px 0 1px; color: var(--accent); font-size: 20px; line-height: 1.05; font-weight: 650; font-variant-numeric: tabular-nums; }
.readout small { color: #70818d; font-size: 8px; }
.controls-column { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; padding-right: 2px; scrollbar-width: thin; scrollbar-color: #344653 transparent; }
.panel { border: 1px solid #263746; border-radius: var(--radius); background: var(--panel); padding: 14px; }
.panel-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.panel-title-row .eyebrow { margin-bottom: 3px; }
h2 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.micro-tag { color: #7f909d; font-size: 8px; letter-spacing: .12em; border: 1px solid #314452; border-radius: 5px; padding: 4px 6px; white-space: nowrap; }
.preset-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; }
.preset { min-width: 0; min-height: 58px; text-align: left; border: 1px solid #30404d; border-radius: 9px; background: #14212d; padding: 8px 9px; cursor: pointer; transition: border-color .16s, background .16s, transform .16s; }
.preset:hover { border-color: #718a95; transform: translateY(-1px); }
.preset.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(109,224,209,.12); }
.preset b { display: block; font-size: 17px; line-height: 1.1; font-weight: 700; color: #edf4f6; }
.preset span { display: block; margin-top: 6px; font-size: 7px; letter-spacing: .08em; color: #91a2ad; white-space: nowrap; }
.preset-fail b { font-size: 11px; letter-spacing: .04em; padding-top: 3px; }
.preset-fail.active { border-color: #a99d98; background: rgba(169,157,152,.1); }
.slider-control { padding: 9px 0 7px; border-top: 1px solid #202f3c; }
.slider-label { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.slider-label label { color: #dce5e9; font-size: 11px; font-weight: 600; }
.slider-label output { color: var(--accent); font-size: 10px; font-variant-numeric: tabular-nums; }
input[type="range"] { appearance: none; display: block; width: 100%; height: 17px; margin: 5px 0 1px; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 5px; background: linear-gradient(90deg, var(--accent) 0%, #35505a 0%); }
input[type="range"]::-moz-range-track { height: 4px; border-radius: 5px; background: #35505a; }
input[type="range"]::-moz-range-progress { height: 4px; background: var(--accent); border-radius: 5px; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; border: 2px solid #0f1b25; border-radius: 50%; background: var(--accent); margin-top: -4.5px; box-shadow: 0 0 0 1px var(--accent); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border: 2px solid #0f1b25; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
input[type="range"]:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.range-ends { display: flex; justify-content: space-between; color: #687c89; font-size: 7px; letter-spacing: .08em; }
.transport-row { display: grid; grid-template-columns: 1.15fr 1fr .8fr; gap: 7px; margin-top: 11px; }
.transport { min-height: 35px; border: 1px solid #344653; border-radius: 8px; background: #172633; color: #c7d3d9; font-size: 10px; cursor: pointer; }
.transport:hover { border-color: #718a95; }
.transport.primary { background: var(--accent); color: #08201f; border-color: var(--accent); font-weight: 800; }
.transport span { font-size: 8px; opacity: .7; }
.pause-icon { font-size: 12px !important; margin-right: 4px; }
.quality-row { margin-top: 11px; padding-top: 10px; border-top: 1px solid #202f3c; display: flex; justify-content: space-between; align-items: center; color: #a9b7bf; font-size: 8px; letter-spacing: .1em; }
.quality-row small { display: inline; color: #71838f; letter-spacing: .04em; margin-left: 5px; }
.quality-toggle { position: relative; border: 1px solid #405563; border-radius: 999px; background: #1a2a37; color: var(--accent); font-size: 8px; letter-spacing: .08em; padding: 5px 21px 5px 8px; cursor: pointer; }
.toggle-knob { position: absolute; right: 5px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); transition: transform .16s; }
.quality-toggle.low .toggle-knob { transform: translateX(-9px); }
.panel-copy { margin: -2px 0 10px; color: #9eafb9; font-size: 10px; line-height: 1.5; }
.experiment-button { width: 100%; display: flex; align-items: center; justify-content: space-between; border: 1px solid #52756f; border-radius: 8px; padding: 9px 11px; background: var(--accent-soft); color: #d9f7f2; font-size: 10px; font-weight: 700; cursor: pointer; }
.experiment-button:hover { background: rgba(109,224,209,.19); }
.experiment-result { margin-top: 9px; min-height: 30px; color: #8fa2ad; font-size: 9px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.pass-state { color: var(--accent); font-size: 8px; letter-spacing: .1em; }
.check-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid #202f3c; }
.check-row b { display: block; color: #d6e0e5; font-size: 10px; font-weight: 600; }
.check-row small { display: block; margin-top: 3px; color: #778b97; font-size: 8px; }
.check-row strong { color: var(--accent); font-size: 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.check-note { margin: 7px 0 0; color: #71838e; font-size: 8px; line-height: 1.45; }
.science-panel { padding: 0; overflow: hidden; }
.science-panel summary { list-style: none; display: flex; align-items: center; justify-content: space-between; cursor: pointer; padding: 13px 14px; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary small { display: block; margin-bottom: 3px; color: var(--accent); font-size: 8px; letter-spacing: .14em; }
.science-panel summary b { font-size: 13px; font-weight: 650; }
.chevron { color: var(--accent); font-size: 17px; transition: transform .18s; }
.science-panel[open] .chevron { transform: rotate(45deg); }
.science-content { border-top: 1px solid #263746; padding: 13px 14px 15px; }
.science-content h3 { margin: 11px 0 5px; color: #e2ebef; font-size: 10px; }
.science-content h3:first-child { margin-top: 0; }
.science-content p { margin: 0 0 8px; color: #a2b1ba; font-size: 9px; line-height: 1.6; }
.equation { margin: 7px 0; padding: 8px 10px; border-left: 2px solid var(--accent); border-radius: 0 6px 6px 0; background: #0d1721; color: #d9f2ef; font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
.not-affiliated { color: #7f929e !important; font-style: italic; }
.panel-footer { padding: 3px 4px 8px; color: #607482; font-size: 8px; letter-spacing: .1em; text-align: center; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .app-shell { height: 100%; min-height: 0; }
body.embed-mode .masthead { display: none; }
body.embed-mode .workspace { height: 100%; min-height: 0; padding: 12px; }
@media (max-width: 900px) {
  .workspace { grid-template-columns: minmax(0,1.2fr) minmax(320px,.9fr); padding: 12px; gap: 12px; }
  .panel { padding: 12px; }
  .preset-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .preset { min-height: 48px; }
}
@media (max-width: 700px) {
  .app-shell { height: auto; min-height: 100vh; }
  .masthead { height: 46px; flex-basis: 46px; padding: 0 14px; }
  .masthead-note { display: none; }
  .workspace { display: flex; flex-direction: column; padding: 10px; gap: 12px; }
  .visual-column { flex: 0 0 auto; }
  .visual-heading { padding: 2px 2px 0; }
  h1 { font-size: 23px; }
  .subheading { font-size: 11px; }
  .model-chip { padding: 6px 7px; font-size: 8px; }
  .model-chip small { display: none; }
  .stage-wrap { height: 330px; min-height: 280px; flex: 0 0 auto; }
  .readout { padding: 8px 9px; }
  .readout strong { font-size: 17px; }
  .controls-column { overflow: visible; }
  body.embed-mode .workspace { display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(280px, 48dvh) minmax(0,1fr); gap: 9px; padding: 9px; }
  body.embed-mode .visual-column { min-height: 0; gap: 7px; }
  body.embed-mode .visual-heading { display: none; }
  body.embed-mode .stage-wrap { min-height: 0; height: auto; flex: 1 1 auto; }
  body.embed-mode .caption-row { min-height: 31px; }
  body.embed-mode .caption-row p { font-size: 9px; line-height: 1.3; }
  body.embed-mode .readout-strip { gap: 5px; }
  body.embed-mode .readout { padding: 6px 7px; }
  body.embed-mode .readout span { font-size: 7px; }
  body.embed-mode .readout strong { font-size: 15px; }
  body.embed-mode .readout small { font-size: 7px; }
  body.embed-mode .controls-column { min-height: 0; overflow-y: auto; padding-right: 1px; }
  body.embed-mode .panel { padding: 10px; }
  body.embed-mode .panel-title-row { margin-bottom: 8px; }
  body.embed-mode .slider-control { padding: 6px 0 4px; }
  body.embed-mode .slider-label label { font-size: 10px; }
  body.embed-mode .range-ends { font-size: 6px; }
  body.embed-mode .preset { min-height: 43px; }
  body.embed-mode .preset b { font-size: 14px; }
  body.embed-mode .preset span { font-size: 6px; margin-top: 4px; }
}
@media (max-width: 390px) {
  .workspace { padding: 8px; }
  .stage-wrap { height: 310px; }
  .readout-strip { gap: 5px; }
  .readout { padding: 7px 6px; }
  .readout span { font-size: 7px; letter-spacing: .08em; }
  .readout strong { font-size: 15px; }
  .readout small { font-size: 7px; }
  body.embed-mode .workspace { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(270px, 47dvh) minmax(0,1fr); }
}
