:root {
  color-scheme: dark;
  --bg: #081217;
  --panel: #101d23;
  --panel-2: #13232a;
  --line: #263840;
  --line-soft: #1c2b32;
  --text: #e7f0f1;
  --muted: #91a5aa;
  --faint: #62777d;
  --accent: #58d9c9;
  --accent-dim: rgba(88,217,201,.13);
  --accent-line: rgba(88,217,201,.36);
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; background: var(--bg); color: var(--text); }
body { overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { height: 100%; min-height: 0; display: flex; flex-direction: column; background: radial-gradient(ellipse at 14% 0%, rgba(33,74,78,.18), transparent 40%), var(--bg); }
.topbar { height: 56px; flex: 0 0 56px; display: flex; align-items: center; gap: 12px; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(8,18,23,.96); }
.brand-mark { width: 25px; height: 25px; display: flex; align-items: center; justify-content: center; gap: 3px; border: 1px solid var(--accent-line); border-radius: 7px; background: var(--accent-dim); }
.brand-mark span { width: 3px; border-radius: 2px; 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-copy { display: flex; flex-direction: column; gap: 2px; }
.eyebrow, .section-kicker { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .16em; line-height: 1.2; }
.eyebrow i { display: inline-block; width: 3px; height: 3px; margin: 0 5px 2px; border-radius: 50%; background: var(--faint); }
.brand-title { font-size: 14px; font-weight: 650; letter-spacing: -.02em; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .11em; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px rgba(88,217,201,.7); }
.top-divider { width: 1px; height: 13px; background: var(--line); margin: 0 5px; }
.top-seed { color: var(--faint); }
.workspace { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 374px; gap: 0; }
.visual-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 16px; gap: 8px; }
.stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; border: 1px solid #263a42; border-radius: 14px; background: #0a171d; box-shadow: inset 0 0 0 1px rgba(255,255,255,.015), 0 18px 45px rgba(0,0,0,.2); }
#scene { display: block; width: 100%; height: 100%; }
.canvas-fallback { display: none; position: absolute; inset: 0; place-items: center; color: var(--muted); font-size: 13px; }
.state-caption { flex: 0 0 28px; display: flex; align-items: center; gap: 8px; padding: 0 10px; color: var(--muted); font-size: 9px; line-height: 1.3; border: 1px solid var(--line-soft); border-radius: 7px; background: rgba(16,29,35,.52); }
.caption-pip { width: 5px; height: 5px; flex: 0 0 5px; border-radius: 50%; background: var(--accent); }
.readout-strip { flex: 0 0 80px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border: 1px solid var(--line); border-radius: 12px; background: rgba(16,29,35,.8); overflow: hidden; }
.readout { min-width: 0; padding: 8px 16px; border-right: 1px solid var(--line-soft); }
.readout:last-child { border-right: 0; }
.readout-label { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .09em; white-space: nowrap; }
.provenance { color: var(--faint); font-size: 8px; margin-left: 4px; letter-spacing: .08em; }
.readout-value { margin-top: 4px; color: var(--text); font-size: 21px; line-height: 1.1; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.04em; white-space: nowrap; }
.readout-value small { color: var(--muted); font-size: 10px; font-weight: 550; letter-spacing: 0; }
.readout-foot { margin-top: 4px; color: var(--faint); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inspector { min-height: 0; overflow-y: auto; overscroll-behavior: contain; border-left: 1px solid var(--line); background: rgba(11,22,28,.93); padding: 16px; scrollbar-width: thin; scrollbar-color: #31464e transparent; }
.panel-section { padding: 0 0 16px; margin: 0 0 16px; border-bottom: 1px solid var(--line-soft); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.section-heading h1, .section-heading h2 { margin: 4px 0 0; font-size: 18px; font-weight: 650; letter-spacing: -.035em; }
.section-heading h2 { font-size: 15px; }
.section-heading.compact { align-items: center; margin-bottom: 10px; }
.tag { display: inline-flex; align-items: center; flex: 0 0 auto; padding: 4px 6px; border-radius: 5px; font-size: 8px; font-weight: 800; letter-spacing: .09em; white-space: nowrap; }
.tag-muted { color: var(--muted); background: #1a2a31; border: 1px solid #2a3b42; }
.tag-accent { color: var(--accent); background: var(--accent-dim); border: 1px solid var(--accent-line); }
.control-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; row-gap: 16px; }
.control { display: block; min-width: 0; }
.control-top { display: flex; align-items: baseline; justify-content: space-between; gap: 5px; color: #c5d1d3; font-size: 10px; font-weight: 600; }
.control output { color: var(--accent); font-size: 10px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.control input[type=range] { display: block; width: 100%; height: 13px; margin: 5px 0 0; accent-color: var(--accent); cursor: pointer; }
.control-hint { display: block; margin-top: -1px; color: var(--faint); font-size: 8px; letter-spacing: .02em; }
.preset-heading { display: flex; justify-content: space-between; align-items: center; margin: 15px 0 8px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.preset { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px; text-align: left; border: 1px solid var(--line); border-radius: 8px; background: #122128; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.preset:hover, .preset.active { border-color: var(--accent-line); background: var(--accent-dim); }
.preset:active { transform: translateY(1px); }
.preset-glyph { width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center; color: var(--accent); font-size: 17px; border: 1px solid #35534f; border-radius: 6px; }
.preset b { display: block; color: var(--text); font-size: 9px; font-weight: 700; }
.preset small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; }
.preset-break .preset-glyph { border-color: var(--accent-line); }
.transport-row { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.transport-button, .quality-button { min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; background: #14242b; color: #c5d2d4; font-size: 9px; font-weight: 700; cursor: pointer; }
.transport-button:hover, .quality-button:hover { border-color: var(--accent-line); }
.transport-button.primary { display: flex; align-items: center; gap: 7px; border-color: var(--accent-line); background: var(--accent-dim); color: var(--accent); }
.play-icon { font-size: 11px; }
.quality-button { margin-left: auto; color: var(--accent); letter-spacing: .08em; }
.experiment-section { padding-bottom: 15px; }
.section-copy { margin: 0 0 10px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.experiment-button { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; border: 1px solid var(--accent-line); border-radius: 8px; background: var(--accent-dim); color: var(--accent); font-size: 10px; font-weight: 750; cursor: pointer; }
.experiment-button:hover { background: rgba(88,217,201,.2); }
.experiment-result { margin-top: 8px; padding: 8px 9px; border-radius: 7px; background: #0d1a20; border: 1px solid var(--line-soft); color: var(--muted); font-size: 9px; line-height: 1.45; }
.checks-section { padding-bottom: 13px; }
.check-list { display: flex; flex-direction: column; gap: 9px; }
.check-row { display: grid; grid-template-columns: 17px minmax(0,1fr) auto; gap: 7px; align-items: center; }
.check-mark { width: 15px; height: 15px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-dim); color: var(--accent); font-size: 9px; }
.check-name { color: #c7d3d5; font-size: 9px; font-weight: 650; }
.check-name small { display: block; margin-top: 2px; color: var(--faint); font-size: 8px; font-weight: 450; }
.check-row strong { color: var(--accent); font-size: 10px; font-variant-numeric: tabular-nums; }
.science-panel { margin: 0 0 15px; border: 1px solid var(--line); border-radius: 9px; background: #0e1b21; }
.science-panel summary { display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; list-style: none; cursor: pointer; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary b { display: block; margin-top: 3px; font-size: 13px; font-weight: 650; }
.summary-plus { color: var(--accent); font-size: 18px; transition: transform .2s; }
.science-panel[open] .summary-plus { transform: rotate(45deg); }
.science-content { padding: 0 12px 12px; }
.science-content h3 { margin: 12px 0 5px; color: #dce8e9; font-size: 10px; font-weight: 750; }
.science-content p { margin: 0 0 8px; color: var(--muted); font-size: 9px; line-height: 1.55; }
.equation { padding: 8px; margin: 6px 0 8px; border-left: 2px solid var(--accent); background: #14242a; color: #d7e9e8; font-size: 10px; line-height: 1.5; }
.not-affiliated { padding-top: 7px; border-top: 1px solid var(--line-soft); color: var(--faint) !important; }
.panel-footer { display: flex; justify-content: space-between; color: #50646b; font-size: 8px; font-weight: 750; letter-spacing: .1em; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 800px) {
  body { overflow: hidden; }
  .topbar { height: 48px; flex-basis: 48px; padding: 0 16px; }
  .brand-mark { width: 23px; height: 23px; }
  .brand-title { font-size: 12px; }
  .topbar-right { font-size: 8px; gap: 6px; }
  .top-seed, .top-divider { display: none; }
  .workspace { display: flex; flex-direction: column; min-height: 0; }
  .visual-column { flex: 0 0 auto; padding: 8px 8px 0; gap: 8px; }
  .stage { height: clamp(220px, 34dvh, 320px); flex: 0 0 auto; border-radius: 10px; }
  .state-caption { flex-basis: 26px; font-size: 8px; }
  .readout-strip { flex: 0 0 72px; grid-template-columns: repeat(4,minmax(0,1fr)); border-radius: 9px; }
  .readout { padding: 8px; }
  .readout-label { font-size: 7px; letter-spacing: .04em; white-space: normal; line-height: 1.25; min-height: 18px; }
  .provenance { display: block; margin: 2px 0 0; font-size: 6px; }
  .readout-value { margin-top: 2px; font-size: 16px; }
  .readout-value small { font-size: 8px; }
  .readout-foot { font-size: 7px; margin-top: 2px; }
  .inspector { flex: 1 1 auto; min-height: 0; border-left: 0; border-top: 1px solid var(--line); padding: 16px; }
  .section-heading h1 { font-size: 16px; }
  .control-grid { column-gap: 16px; row-gap: 16px; }
  .control-top { font-size: 9px; }
  .control output { font-size: 9px; }
  .control input[type=range] { margin-top: 3px; }
  .control-hint { font-size: 7px; }
  .preset { padding: 7px; }
  .preset b { font-size: 8px; }
  .preset small { font-size: 7px; }
  .panel-section { margin-bottom: 12px; padding-bottom: 12px; }
}
@media (max-width: 420px) {
  .stage { height: clamp(220px, 33dvh, 285px); }
  .state-caption { flex-basis: 24px; font-size: 7px; }
  .readout-strip { flex-basis: 68px; }
  .readout-value { font-size: 14px; }
  .readout-foot { display: none; }
  .inspector { padding: 16px 8px; }
  .tag { font-size: 7px; padding: 3px 5px; }
  .section-heading { margin-bottom: 10px; }
}
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .app-shell { height: 100vh; height: 100dvh; }
body.embed-mode .topbar { display: none; }
body.embed-mode .workspace { flex: 1 1 auto; min-height: 0; }
body.embed-mode .visual-column { padding-top: 10px; }
@media (max-width: 800px) {
  body.embed-mode .visual-column { padding-top: 8px; }
  body.embed-mode .stage { height: 38dvh; max-height: 340px; }
}
