:root {
  color-scheme: dark;
  --bg: #10100f;
  --panel: #171716;
  --panel-2: #1d1c1a;
  --line: rgba(224, 196, 158, 0.13);
  --line-strong: rgba(224, 196, 158, 0.24);
  --text: #f0e8dc;
  --muted: #9c9388;
  --dim: #6f6962;
  --sand: #d9ad75;
  --sand-bright: #f0c995;
  --amber: #d9a15e;
  --green: #8bc1a0;
  --red: #e4a06e;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--sans); }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { height: 100dvh; min-height: 560px; display: flex; flex-direction: column; background: radial-gradient(ellipse at 48% -10%, #24201a 0%, #10100f 54%); }
.topbar { height: 76px; flex: 0 0 76px; display: grid; grid-template-columns: 250px minmax(260px, 1fr) 250px; align-items: center; padding: 0 22px; border-bottom: 1px solid var(--line); background: rgba(16,16,15,.94); z-index: 5; }
.brand-lockup { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { width: 27px; height: 27px; position: relative; display: flex; align-items: end; gap: 3px; padding: 3px; border: 1px solid rgba(217,161,94,.55); border-radius: 7px; transform: skewY(-8deg); }
.brand-mark span { display: block; width: 5px; border-radius: 3px 3px 1px 1px; background: var(--sand); }
.brand-mark span:nth-child(1) { height: 8px; opacity: .6; }
.brand-mark span:nth-child(2) { height: 15px; }
.brand-mark span:nth-child(3) { height: 11px; opacity: .8; }
.eyebrow { color: #8e8173; font: 600 9px/1.2 var(--mono); letter-spacing: .16em; }
.brand-name { margin-top: 5px; color: #e9ddcc; font-size: 11px; font-weight: 750; letter-spacing: .14em; white-space: nowrap; }
.brand-name span { color: #aa8a66; font-weight: 500; }
.topbar-title { justify-self: center; text-align: center; min-width: 0; }
.topbar-title h1 { margin: 5px 0 0; font-size: 17px; line-height: 1; letter-spacing: -.025em; font-weight: 630; color: #f2e9dc; }
.topbar-actions { justify-self: end; display: flex; align-items: center; gap: 13px; }
.live-indicator { display: flex; align-items: center; gap: 7px; color: #b8a58e; font: 600 9px var(--mono); letter-spacing: .1em; }
.live-indicator i, .tag-dot, .telemetry-pulse { width: 6px; height: 6px; border-radius: 50%; background: #86b99a; box-shadow: 0 0 9px rgba(134,185,154,.55); }
.icon-button { width: 29px; height: 29px; border: 1px solid var(--line-strong); border-radius: 50%; background: transparent; color: #d8c7b0; font: 600 13px Georgia, serif; cursor: pointer; transition: background .2s, border-color .2s; }
.icon-button:hover { background: rgba(217,161,94,.12); border-color: rgba(217,161,94,.6); }
.workspace { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 355px; gap: 0; }
.stage-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.stage-wrap { flex: 1 1 auto; min-height: 0; position: relative; overflow: hidden; background: linear-gradient(180deg, #28241e, #171512); }
.scene-mount { position: absolute; inset: 0; z-index: 1; }
.scene-mount canvas { display: block; width: 100%; height: 100%; outline: none; }
.stage-vignette { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(180deg, rgba(14,13,12,.36), transparent 22%, transparent 70%, rgba(14,13,12,.38)); }
.stage-topline { position: absolute; top: 16px; left: 18px; right: 18px; z-index: 4; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.scene-tag { display: flex; align-items: center; gap: 8px; color: rgba(255,239,215,.85); font: 600 9px var(--mono); letter-spacing: .12em; text-shadow: 0 1px 6px rgba(0,0,0,.35); }
.view-tools { display: flex; gap: 6px; pointer-events: auto; }
.view-button { height: 28px; padding: 0 10px; display: flex; align-items: center; gap: 7px; border: 1px solid rgba(255,235,205,.24); border-radius: 5px; background: rgba(19,17,15,.45); backdrop-filter: blur(8px); color: #f0dfc6; font: 600 8px var(--mono); letter-spacing: .1em; cursor: pointer; transition: .2s; }
.view-button:hover, .view-button.quality-low { background: rgba(217,161,94,.2); border-color: rgba(240,201,149,.5); }
.tool-glyph { font-size: 14px; color: var(--sand-bright); }
.scene-annotations { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.annotation { position: absolute; left: 0; top: 0; padding: 5px 8px; border: 1px solid rgba(255,236,210,.28); border-radius: 3px; background: rgba(22,19,16,.58); backdrop-filter: blur(5px); color: #f4dfc0; white-space: nowrap; font: 600 8px var(--mono); letter-spacing: .09em; transition: opacity .2s; transform-origin: left top; }
.annotation span { margin-right: 6px; color: #e2ad6e; }
.scene-bottom-left { position: absolute; left: 20px; bottom: 18px; z-index: 4; display: flex; align-items: end; gap: 18px; color: rgba(255,239,215,.7); font: 9px var(--mono); }
.north-marker { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.north-marker span { font-size: 8px; color: #f1d5ac; }
.north-marker i { width: 1px; height: 18px; background: linear-gradient(#f1d5ac, transparent); position: relative; }
.north-marker i:before { content: ''; position: absolute; top: -1px; left: -3px; border-left: 3px solid transparent; border-right: 3px solid transparent; border-bottom: 5px solid #f1d5ac; }
.scale-marker { display: flex; align-items: center; gap: 6px; }
.scale-marker i { width: 45px; height: 5px; border-left: 1px solid rgba(255,239,215,.75); border-right: 1px solid rgba(255,239,215,.75); border-bottom: 1px solid rgba(255,239,215,.75); }
.scene-bottom-right { position: absolute; right: 19px; bottom: 20px; z-index: 4; color: rgba(255,239,215,.6); font: 8px var(--mono); letter-spacing: .08em; }
.drag-hint b { color: rgba(255,239,215,.9); font-weight: 700; }
.drag-hint i { color: #e4b87f; font-style: normal; padding: 0 5px; }
.scene-loading { position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 13px; background: #171512; color: #b69a77; font: 600 9px var(--mono); letter-spacing: .14em; transition: opacity .55s, visibility .55s; }
.scene-loading.loaded { opacity: 0; visibility: hidden; }
.loader-ring { width: 26px; height: 26px; border: 1px solid rgba(217,161,94,.2); border-top-color: #d9a15e; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.webgl-warning { position: absolute; left: 18px; right: 18px; top: 58px; z-index: 9; padding: 12px; border: 1px solid rgba(226,160,110,.4); border-radius: 5px; background: rgba(46,29,20,.9); color: #f0c49a; font-size: 11px; line-height: 1.45; }
.telemetry-strip { min-height: 83px; flex: 0 0 83px; display: grid; grid-template-columns: 132px repeat(4, minmax(0, 1fr)); align-items: center; gap: 0; background: #151514; border-top: 1px solid var(--line); padding: 0 18px; }
.telemetry-heading { display: flex; align-items: center; gap: 8px; color: #a99b8a; font: 600 8px var(--mono); letter-spacing: .12em; }
.telemetry-pulse { width: 5px; height: 5px; }
.telemetry-cell { min-width: 0; padding: 0 12px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 7px; }
.telemetry-label { color: #7e776f; font: 600 8px var(--mono); letter-spacing: .1em; white-space: nowrap; }
.telemetry-cell strong { color: #f0dfc6; font: 500 18px/1 var(--mono); letter-spacing: -.05em; white-space: nowrap; }
.telemetry-cell strong small { color: #a99a86; font-size: 9px; letter-spacing: 0; }
.state-cell strong { color: var(--green); font-size: 12px; letter-spacing: .02em; }
.state-cell strong.state-active { color: #e9b779; }
.control-panel { min-width: 0; min-height: 0; background: linear-gradient(180deg, #191918, #151514); overflow: hidden; }
.panel-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 22px 20px 18px; scrollbar-width: thin; scrollbar-color: #4d4337 transparent; }
.panel-scroll::-webkit-scrollbar { width: 5px; }
.panel-scroll::-webkit-scrollbar-thumb { background: #4d4337; border-radius: 5px; }
.panel-section { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; gap: 11px; align-items: center; margin-bottom: 16px; }
.section-index { width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center; border: 1px solid rgba(217,161,94,.32); border-radius: 5px; color: #d5a36c; font: 600 9px var(--mono); }
.section-heading h2 { margin: 4px 0 0; font-size: 15px; font-weight: 600; letter-spacing: -.025em; }
.preset-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 18px; }
.preset-button { min-height: 42px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 1px solid var(--line); border-radius: 5px; background: #1c1b19; color: #9d9386; font: 600 8px var(--mono); letter-spacing: .06em; cursor: pointer; transition: .2s; }
.preset-button:hover { border-color: rgba(217,161,94,.45); color: #e8d4b9; }
.preset-button.active { border-color: rgba(217,161,94,.62); background: rgba(217,161,94,.105); color: #f0d5b0; box-shadow: inset 0 0 0 1px rgba(217,161,94,.08); }
.preset-icon { font-size: 14px; line-height: 1; color: #d9a15e; }
.control-group { margin-bottom: 14px; }
.control-group.last-control { margin-bottom: 0; }
.control-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.control-label label { color: #d7cbbc; font-size: 11px; font-weight: 520; }
.control-label output { color: #e7bb83; font: 600 10px var(--mono); white-space: nowrap; }
input[type="range"] { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 4px; margin: 0; border-radius: 4px; outline: none; background: linear-gradient(to right, #d9a15e 0 var(--range-progress, 50%), #46413a var(--range-progress, 50%) 100%); cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; border: 2px solid #f3d5ad; border-radius: 50%; background: #b98248; box-shadow: 0 0 0 3px rgba(217,161,94,.13); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #f3d5ad; border-radius: 50%; background: #b98248; box-shadow: 0 0 0 3px rgba(217,161,94,.13); }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px rgba(217,161,94,.22); }
.range-ends { display: flex; justify-content: space-between; margin-top: 6px; color: #6f6962; font: 8px var(--mono); letter-spacing: .08em; }
.playback-section { padding: 17px 0 18px; }
.section-heading.compact { margin-bottom: 13px; }
.section-heading.compact h2 { font-size: 14px; }
.transport-row { display: grid; grid-template-columns: 1fr 54px 54px 54px; gap: 6px; margin-bottom: 15px; }
.transport-main { height: 38px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid #d3a16c; border-radius: 5px; background: linear-gradient(135deg, #b67e48, #8f603a); color: #fff0dc; font: 700 9px var(--mono); letter-spacing: .12em; cursor: pointer; box-shadow: inset 0 1px rgba(255,255,255,.12); transition: filter .2s, transform .2s; }
.transport-main:hover { filter: brightness(1.12); }
.transport-main:active { transform: translateY(1px); }
.transport-main span:first-child { font-size: 14px; }
.transport-button { height: 38px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border: 1px solid var(--line-strong); border-radius: 5px; background: #211f1c; color: #d6c3aa; cursor: pointer; transition: .2s; }
.transport-button:hover { background: #2c2822; border-color: rgba(217,161,94,.5); }
.transport-button span { font-size: 14px; line-height: 1; }
.transport-button small { color: #887c6e; font: 600 7px var(--mono); letter-spacing: .1em; }
.speed-label { margin-bottom: 8px; }
.validation-card { margin-top: 16px; padding: 13px 13px 11px; border: 1px solid rgba(217,161,94,.23); border-radius: 6px; background: linear-gradient(135deg, rgba(217,161,94,.075), rgba(217,161,94,.018)); }
.validation-head { display: flex; align-items: center; gap: 9px; }
.validation-icon { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; background: rgba(139,193,160,.12); color: #9dc9aa; font-size: 12px; }
.validation-head h3 { margin: 3px 0 0; font-size: 11px; font-weight: 600; color: #e8dac8; }
.validation-equation { margin: 12px 0 10px; padding: 8px 7px; border-radius: 4px; background: rgba(8,8,8,.25); color: #e6c69d; text-align: center; font: 12px Georgia, serif; }
.validation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.validation-grid > div { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.validation-grid span { color: #81776b; font: 600 7px var(--mono); letter-spacing: .08em; }
.validation-grid strong { color: #e9d5b8; font: 600 11px var(--mono); }
.validation-grid .validation-diff { grid-column: 1 / -1; padding-top: 8px; border-top: 1px solid var(--line); flex-direction: row; align-items: center; justify-content: space-between; }
.validation-grid .validation-diff strong { color: #9dc9aa; }
.validation-note { margin: 9px 0 0; color: #857c70; font-size: 9px; line-height: 1.45; }
.science-panel { margin-top: 14px; border: 1px solid var(--line); border-radius: 5px; background: rgba(255,255,255,.012); }
.science-panel summary { min-height: 49px; display: flex; align-items: center; gap: 10px; padding: 8px 11px; cursor: pointer; list-style: none; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary > span:nth-child(2) { display: flex; flex-direction: column; gap: 3px; }
.science-panel summary b { color: #d9c9b4; font: 700 9px var(--mono); letter-spacing: .11em; }
.science-panel summary small { color: #7d7469; font-size: 9px; }
.science-panel .chevron { margin-left: auto; color: #bd9567; font-size: 15px; transition: transform .2s; }
.science-panel[open] .chevron { transform: rotate(180deg); }
.science-content { padding: 0 12px 13px; color: #a99e90; font-size: 10px; line-height: 1.55; }
.science-content h4 { margin: 12px 0 5px; color: #e0c9a9; font-size: 10px; font-weight: 650; }
.science-content p { margin: 5px 0 9px; }
.science-content ul { margin: 5px 0 9px; padding-left: 16px; }
.science-content li { margin: 4px 0; }
.science-content b { color: #d8c1a0; }
.equation-block { margin: 7px 0; padding: 8px; border-left: 2px solid #bd8d59; background: rgba(0,0,0,.16); display: flex; flex-direction: column; gap: 4px; }
.equation-block span { color: #847a6e; font: 600 7px var(--mono); letter-spacing: .1em; }
.equation-block code { color: #e4c69d; font: 10px var(--mono); white-space: normal; }
.model-warning { margin-top: 10px; padding: 8px; border: 1px solid rgba(217,161,94,.22); border-radius: 3px; color: #d9b483; font: 600 8px/1.45 var(--mono); letter-spacing: .05em; }
.panel-footnote { padding: 12px 1px 0; color: #69635b; font-size: 8px; line-height: 1.5; }
.footerbar { height: 28px; flex: 0 0 28px; display: flex; justify-content: space-between; align-items: center; padding: 0 17px; border-top: 1px solid var(--line); background: #111110; color: #71695f; font: 8px var(--mono); letter-spacing: .07em; }
.footerbar i { color: #bd8d59; font-style: normal; padding: 0 4px; }
.footerbar b { color: #bd9a70; font-weight: 600; }
.footer-mark { color: #a17c52 !important; }
.embed-mode .topbar, .embed-mode .footerbar { display: none; }
.embed-mode .workspace { grid-template-columns: minmax(0, 1fr) 335px; }
button:focus-visible, summary:focus-visible { outline: 2px solid #d9a15e; outline-offset: 3px; }
@media (max-width: 1100px) and (min-width: 701px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 320px; }
  .topbar { grid-template-columns: 210px minmax(240px, 1fr) 160px; padding: 0 16px; }
  .panel-scroll { padding: 18px 16px; }
  .telemetry-strip { grid-template-columns: 110px repeat(4, minmax(0,1fr)); padding: 0 12px; }
  .telemetry-cell { padding: 0 8px; }
}
@media (max-width: 700px) {
  html, body { overflow: hidden; }
  .app-shell { min-height: 0; height: 100dvh; }
  .topbar { height: 62px; flex-basis: 62px; grid-template-columns: 1fr auto; padding: 0 13px; }
  .brand-mark { width: 24px; height: 24px; }
  .brand-name { font-size: 9px; }
  .topbar-title { display: none; }
  .topbar-actions { gap: 8px; }
  .live-indicator { font-size: 8px; }
  .workspace { display: flex; flex-direction: column; min-height: 0; }
  .stage-column { flex: 0 0 46%; min-height: 240px; border-right: 0; border-bottom: 1px solid var(--line); }
  .stage-wrap { min-height: 0; }
  .stage-topline { top: 10px; left: 10px; right: 10px; }
  .scene-tag { font-size: 8px; }
  .view-button { height: 26px; padding: 0 7px; font-size: 7px; }
  .scene-bottom-left { left: 11px; bottom: 10px; gap: 12px; }
  .scene-bottom-right { right: 10px; bottom: 13px; font-size: 7px; }
  .annotation { font-size: 7px; padding: 4px 6px; }
  .telemetry-strip { flex: 0 0 58px; min-height: 58px; grid-template-columns: repeat(4, 1fr); padding: 0 7px; }
  .telemetry-heading { display: none; }
  .telemetry-cell { padding: 0 7px; gap: 5px; }
  .telemetry-label { font-size: 6px; letter-spacing: .04em; white-space: normal; line-height: 1.25; }
  .telemetry-cell strong { font-size: 13px; }
  .telemetry-cell strong small { font-size: 7px; }
  .state-cell strong { font-size: 9px; }
  .control-panel { flex: 1 1 auto; min-height: 0; overflow: hidden; }
  .panel-scroll { padding: 14px 14px 18px; }
  .section-heading { margin-bottom: 12px; }
  .section-heading h2 { font-size: 14px; }
  .preset-row { margin-bottom: 15px; }
  .preset-button { min-height: 38px; }
  .control-group { margin-bottom: 13px; }
  .control-label label { font-size: 10px; }
  .transport-row { grid-template-columns: 1fr 50px 50px 50px; }
  .footerbar { display: none; }
  .validation-card { margin-top: 14px; }
}
@media (max-width: 390px) {
  .stage-column { flex-basis: 44%; }
  .telemetry-cell { padding: 0 5px; }
  .telemetry-label { font-size: 5.8px; }
  .telemetry-cell strong { font-size: 12px; }
  .view-button { gap: 4px; }
  .panel-scroll { padding-left: 12px; padding-right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
