:root {
  --bg: #101511;
  --panel: #171f1a;
  --panel-2: #1c2620;
  --line: #2c3830;
  --line-soft: rgba(205, 220, 203, .10);
  --text: #e9eee5;
  --muted: #9ba99a;
  --dim: #69786a;
  --accent: #e5b45c;
  --accent-soft: rgba(229, 180, 92, .12);
  --danger: #c77d6c;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { min-height: 100vh; overflow-x: hidden; letter-spacing: .01em; }
button, input { font: inherit; }
button { color: inherit; }
.site-header { height: 64px; padding: 0 26px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: #111813; }
.brand-lockup { display: flex; align-items: center; gap: 13px; }
.brand-mark { width: 30px; height: 30px; border: 1px solid rgba(229,180,92,.5); border-radius: 9px; display: flex; align-items: center; justify-content: center; gap: 3px; transform: rotate(-8deg); }
.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: 16px; }
.brand-mark span:nth-child(3) { height: 12px; opacity: .75; }
.eyebrow { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .19em; line-height: 1.2; }
.eyebrow i { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); margin: 0 3px 2px; }
.brand-name { font-size: 14px; font-weight: 650; margin-top: 3px; letter-spacing: .01em; }
.header-meta { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 9px; letter-spacing: .13em; font-weight: 700; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(229,180,92,.10); }
.meta-divider { height: 14px; width: 1px; background: var(--line); margin: 0 5px; }
.meta-tag { color: var(--accent); }
.workspace { width: 100%; min-height: calc(100vh - 90px); display: grid; grid-template-columns: minmax(0, 1fr) 388px; gap: 0; }
.stage-column { min-width: 0; padding: 18px 20px 18px 24px; display: flex; flex-direction: column; gap: 12px; border-right: 1px solid var(--line); }
.stage-topline { display: flex; justify-content: space-between; align-items: center; min-height: 22px; }
.stage-label, .stage-actions { display: flex; align-items: center; gap: 10px; }
.stage-label { color: #b9c4b6; font-size: 10px; font-weight: 750; letter-spacing: .16em; }
.stage-index { color: var(--accent); font-variant-numeric: tabular-nums; }
.stage-chip { color: var(--dim); font-size: 8px; letter-spacing: .13em; font-weight: 700; }
.icon-button { width: 26px; height: 26px; border: 1px solid var(--line); background: #19211b; border-radius: 7px; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; }
.icon-button:hover { color: var(--accent); border-color: rgba(229,180,92,.5); }
.canvas-wrap { width: 100%; height: min(62vh, 610px); min-height: 340px; position: relative; overflow: hidden; border: 1px solid #344136; border-radius: 14px; background: #b99d6b; box-shadow: 0 18px 46px rgba(0,0,0,.22), inset 0 0 0 1px rgba(255,255,255,.05); touch-action: none; }
#scene { display: block; width: 100%; height: 100%; cursor: grab; }
#scene.dragging { cursor: grabbing; }
.canvas-hud { position: absolute; top: 13px; z-index: 2; pointer-events: none; color: rgba(27,34,26,.82); font-size: 8px; letter-spacing: .15em; font-weight: 800; background: rgba(241,225,188,.72); border: 1px solid rgba(57,61,42,.14); border-radius: 5px; padding: 7px 9px; backdrop-filter: blur(6px); }
.hud-left { left: 13px; display: flex; align-items: center; gap: 7px; }
.hud-dot { width: 5px; height: 5px; border-radius: 50%; background: #63754a; }
.hud-right { right: 13px; }
.hud-right b { color: #596c43; font-size: 12px; }
.canvas-hint { position: absolute; bottom: 12px; left: 14px; pointer-events: none; color: rgba(40,47,34,.68); font-size: 8px; letter-spacing: .13em; font-weight: 750; }
.canvas-hint span { padding: 0 5px; color: #8b6b38; }
.stage-footer { display: flex; align-items: center; gap: 19px; min-height: 17px; padding: 0 2px; }
.footer-measure { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 8px; letter-spacing: .11em; font-weight: 700; }
.measure-mark { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(229,180,92,.12); }
.measure-mark.lifted { background: #f0d8a4; box-shadow: 0 0 0 3px rgba(240,216,164,.10); }
.footer-note { margin-left: auto; color: var(--dim); font-size: 8px; letter-spacing: .04em; }
.observation-card { border: 1px solid var(--line); background: linear-gradient(120deg, rgba(229,180,92,.07), rgba(23,31,26,.7) 46%); border-radius: 10px; padding: 13px 15px 14px; }
.observation-heading { color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: .16em; display: flex; gap: 8px; align-items: center; }
.observation-icon { font-size: 13px; }
.observation-card p { margin: 7px 0 0; max-width: 850px; color: #c3cdc0; font-size: 11px; line-height: 1.55; }
.instrument-panel { min-width: 0; background: #141c17; padding: 20px 19px 14px; display: flex; flex-direction: column; gap: 17px; overflow: visible; }
.panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.panel-heading h1 { margin: 5px 0 0; font-size: 19px; letter-spacing: -.035em; font-weight: 650; }
.model-stamp { border: 1px solid rgba(229,180,92,.28); color: var(--accent); padding: 5px 7px; border-radius: 5px; font-size: 8px; letter-spacing: .12em; font-weight: 800; white-space: nowrap; }
.section-kicker { display: flex; align-items: center; justify-content: space-between; color: #a9b6a7; font-size: 8px; letter-spacing: .15em; font-weight: 800; margin-bottom: 9px; }
.section-kicker span { color: var(--dim); font-size: 7px; letter-spacing: .11em; font-weight: 700; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.readout-card { min-width: 0; border: 1px solid var(--line); background: #1a241d; border-radius: 8px; padding: 9px 10px 8px; }
.primary-readout { border-color: rgba(229,180,92,.36); background: linear-gradient(140deg, rgba(229,180,92,.11), #1a241d 65%); }
.readout-label { color: var(--muted); font-size: 7px; font-weight: 800; letter-spacing: .13em; }
.readout-value { color: #edf0e8; font-size: 20px; line-height: 1.3; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.04em; white-space: nowrap; }
.primary-readout .readout-value { color: var(--accent); }
.readout-value small { font-size: 9px; letter-spacing: 0; font-weight: 600; color: #aab5a7; }
.readout-foot { color: var(--dim); font-size: 7px; letter-spacing: .025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.preset-button { display: flex; align-items: center; gap: 8px; text-align: left; min-width: 0; background: #1a241d; border: 1px solid var(--line); border-radius: 7px; padding: 8px 9px; cursor: pointer; transition: border-color .15s, background .15s; }
.preset-button:hover { border-color: rgba(229,180,92,.5); }
.preset-button.active { border-color: var(--accent); background: rgba(229,180,92,.09); }
.preset-symbol { width: 20px; height: 20px; flex: 0 0 20px; border-radius: 5px; display: grid; place-items: center; color: var(--accent); background: rgba(229,180,92,.11); font-size: 15px; }
.preset-button b { display: block; font-size: 9px; font-weight: 700; }
.preset-button small { display: block; color: var(--dim); font-size: 7px; margin-top: 2px; white-space: nowrap; }
.failure-preset .preset-symbol { color: var(--danger); background: rgba(199,125,108,.10); }
.control-section { padding-top: 1px; }
.control-row { margin-bottom: 11px; }
.control-label { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.control-label label { color: #d1d9ce; font-size: 9px; font-weight: 600; }
.control-label span { color: var(--dim); font-size: 10px; cursor: help; }
.control-label output { margin-left: auto; color: var(--accent); font-size: 9px; font-weight: 700; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; height: 14px; margin: 0; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; display: block; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) 0%, var(--accent) var(--progress, 50%), #354238 var(--progress, 50%), #354238 100%); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 3px; background: #354238; }
input[type="range"]::-moz-range-progress { height: 3px; background: var(--accent); }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 11px; height: 11px; margin-top: -4px; border-radius: 50%; border: 2px solid #111812; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
input[type="range"]::-moz-range-thumb { width: 8px; height: 8px; border-radius: 50%; border: 2px solid #111812; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.range-ends { display: flex; justify-content: space-between; color: #657467; font-size: 7px; margin-top: 1px; font-variant-numeric: tabular-nums; }
.last-control { margin-bottom: 0; }
.playback-section { padding-top: 12px; border-top: 1px solid var(--line); }
.playback-row { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 6px; }
.play-button, .transport-button { height: 31px; border-radius: 6px; border: 1px solid var(--line); cursor: pointer; font-size: 8px; font-weight: 800; letter-spacing: .11em; }
.play-button { display: flex; align-items: center; justify-content: center; gap: 7px; background: var(--accent); color: #24241b; border-color: var(--accent); }
.play-button span:first-child { font-size: 11px; }
.transport-button { background: #1b261f; color: #c4cec1; }
.transport-button:hover { border-color: rgba(229,180,92,.45); }
.transport-button b { color: var(--accent); font-size: 11px; margin-left: 3px; }
.time-row { margin-top: 8px; display: flex; align-items: center; gap: 6px; color: var(--dim); font-size: 7px; letter-spacing: .10em; }
.time-row strong { color: #cbd4c8; font-size: 9px; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.time-separator { flex: 1; }
.experiment-section { padding: 12px; border: 1px solid rgba(229,180,92,.25); background: rgba(229,180,92,.045); border-radius: 8px; }
.experiment-section .section-kicker { margin-bottom: 6px; }
.experiment-section p { color: #9eab9c; font-size: 8px; line-height: 1.5; margin: 0 0 9px; }
.experiment-button { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 9px 10px; background: #253126; border: 1px solid rgba(229,180,92,.45); border-radius: 6px; color: var(--accent); font-size: 8px; letter-spacing: .13em; font-weight: 850; cursor: pointer; }
.experiment-button:hover { background: #2b392c; }
.experiment-button b { font-size: 13px; }
.experiment-result { margin-top: 8px; color: #9eab9c; font-size: 8px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.checks-section { padding-top: 1px; }
.check-row { display: grid; grid-template-columns: minmax(0,1fr) auto 58px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid rgba(205,220,203,.07); color: #aeb9ab; font-size: 8px; }
.check-row strong { color: #dce4d8; font-size: 9px; font-variant-numeric: tabular-nums; }
.check-row em { text-align: right; color: var(--dim); font-size: 7px; font-style: normal; }
.science-panel { border: 1px solid var(--line); border-radius: 8px; background: #18211b; }
.science-panel summary { display: flex; align-items: center; gap: 8px; padding: 11px 12px; cursor: pointer; list-style: none; color: #d7dfd3; font-size: 8px; letter-spacing: .14em; font-weight: 800; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-summary-note { margin-left: auto; color: var(--dim); font-size: 7px; font-weight: 700; }
.science-panel summary b { color: var(--accent); font-size: 13px; font-weight: 500; transition: transform .2s; }
.science-panel[open] summary b { transform: rotate(45deg); }
.science-content { padding: 0 13px 13px; color: #aeb9ab; font-size: 9px; line-height: 1.55; }
.science-content h2 { color: #e2e9dd; font-size: 12px; margin: 3px 0 7px; }
.science-content h3 { color: #d6dfd2; font-size: 10px; margin: 12px 0 5px; }
.science-content p { margin: 6px 0; }
.science-content ul { padding-left: 15px; margin: 5px 0 9px; }
.science-content li { margin: 4px 0; }
.equation { margin: 6px 0; padding: 7px 9px; border-left: 2px solid var(--accent); background: rgba(229,180,92,.06); color: #f0d5a2; font-family: Georgia, serif; font-size: 11px; letter-spacing: .01em; }
.science-caution { color: #d0b98e; }
.panel-bottom { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: #68786a; font-size: 7px; letter-spacing: .13em; font-weight: 800; }
.panel-bottom button { background: transparent; border: 1px solid var(--line); border-radius: 5px; padding: 5px 7px; color: var(--muted); font-size: 7px; letter-spacing: .1em; font-weight: 800; cursor: pointer; }
.panel-bottom button:hover { border-color: rgba(229,180,92,.45); color: var(--accent); }
.site-footer { height: 26px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 25px; color: #637164; font-size: 7px; letter-spacing: .13em; font-weight: 700; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .site-header, body.embed-mode .site-footer { display: none; }
body.embed-mode .workspace { height: 100vh; height: 100dvh; min-height: 0; }
body.embed-mode .stage-column { padding-top: 12px; padding-bottom: 10px; }
body.embed-mode .canvas-wrap { height: auto; min-height: 0; flex: 1 1 auto; }
body.embed-mode .instrument-panel { overflow-y: auto; overscroll-behavior: contain; }
@media (min-width: 1500px) {
  .workspace { grid-template-columns: minmax(0,1fr) 410px; }
  .stage-column { padding-left: 30px; padding-right: 26px; }
  .canvas-wrap { height: min(66vh, 720px); }
}
@media (max-width: 980px) {
  .workspace { grid-template-columns: minmax(0,1fr) 350px; }
  .instrument-panel { padding-left: 14px; padding-right: 14px; }
  .stage-column { padding-left: 15px; padding-right: 15px; }
  .canvas-wrap { height: min(57vh, 550px); }
}
@media (max-width: 720px) {
  .site-header { height: 55px; padding: 0 14px; }
  .header-meta { font-size: 7px; gap: 6px; }
  .brand-name { font-size: 12px; }
  .workspace { display: flex; flex-direction: column; min-height: calc(100vh - 80px); }
  .stage-column { padding: 12px 12px 13px; border-right: 0; border-bottom: 1px solid var(--line); gap: 9px; }
  .canvas-wrap { height: 43vh; min-height: 290px; max-height: 440px; }
  .stage-footer { gap: 11px; }
  .footer-measure { font-size: 7px; }
  .footer-note { font-size: 7px; }
  .observation-card { padding: 10px 12px; }
  .observation-card p { font-size: 10px; }
  .instrument-panel { padding: 16px 13px 14px; gap: 15px; }
  .panel-heading h1 { font-size: 18px; }
  .readout-value { font-size: 19px; }
  .site-footer { padding: 0 12px; }
  body.embed-mode .workspace { display: flex; flex-direction: column; }
  body.embed-mode .stage-column { flex: 0 0 48dvh; min-height: 0; padding: 9px 10px 8px; gap: 7px; }
  body.embed-mode .stage-topline { min-height: 18px; }
  body.embed-mode .canvas-wrap { flex: 1 1 auto; height: auto; min-height: 0; }
  body.embed-mode .stage-footer, body.embed-mode .observation-card { display: none; }
  body.embed-mode .instrument-panel { flex: 1 1 auto; min-height: 0; padding: 12px 12px 16px; gap: 12px; }
  body.embed-mode .panel-bottom { margin-top: 5px; }
}
@media (max-width: 420px) {
  .header-meta { display: none; }
  .canvas-wrap { height: 41vh; min-height: 275px; }
  .stage-chip { font-size: 7px; }
  .stage-column { padding-left: 9px; padding-right: 9px; }
  .stage-footer { gap: 8px; }
  .footer-note { max-width: 118px; text-align: right; line-height: 1.2; }
  .readout-card { padding: 8px; }
  .readout-value { font-size: 18px; }
  .preset-button { padding: 7px; gap: 6px; }
  .preset-button small { font-size: 6.5px; }
  .control-row { margin-bottom: 10px; }
  body.embed-mode .stage-column { flex-basis: 46dvh; }
}
