:root {
  color-scheme: dark;
  --bg: #080d14;
  --panel: #0d141e;
  --panel-2: #101a26;
  --line: rgba(155, 183, 205, .14);
  --line-strong: rgba(155, 183, 205, .24);
  --text: #e7eef4;
  --muted: #8b9aa8;
  --dim: #62717f;
  --accent: #78e1d2;
  --accent-soft: rgba(120, 225, 210, .13);
  --accent-glow: rgba(120, 225, 210, .25);
  --warning: #f0b56b;
  --radius: 14px;
  font-family: 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; background: var(--bg); color: var(--text); }
body { overflow: hidden; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { height: 100%; min-height: 0; display: grid; grid-template-rows: 72px minmax(0, 1fr); background: radial-gradient(ellipse at 13% 0%, rgba(43, 81, 97, .14), transparent 32%), var(--bg); }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(8, 13, 20, .94); min-width: 0; }
.brand-lockup { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; position: relative; border: 1px solid rgba(120,225,210,.4); border-radius: 50%; display: flex; align-items: center; justify-content: center; transform: rotate(-22deg); }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; border: 1px solid rgba(120,225,210,.65); border-radius: 50%; width: 42px; height: 13px; }
.brand-mark::after { transform: rotate(60deg); opacity: .6; }
.brand-mark span { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: var(--accent); }
.brand-mark span:nth-child(1) { transform: translate(12px,-6px); }
.brand-mark span:nth-child(2) { transform: translate(-10px,7px); opacity: .65; }
.brand-mark span:nth-child(3) { width: 7px; height: 7px; box-shadow: 0 0 12px var(--accent-glow); }
.eyebrow { color: #8294a3; font-size: 9px; font-weight: 750; letter-spacing: .16em; line-height: 1.3; }
.eyebrow-divider { color: var(--accent); padding: 0 4px; }
.brand-copy h1 { font-size: 16px; line-height: 1.1; letter-spacing: .11em; margin: 3px 0 0; font-weight: 800; }
.brand-copy h1 span { color: var(--accent); font-weight: 600; }
.topbar-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.model-status { display: flex; align-items: center; gap: 8px; font-size: 9px; font-weight: 800; letter-spacing: .15em; color: var(--accent); }
.status-dot, .panel-live span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
.topbar-note { color: var(--dim); font-size: 10px; letter-spacing: .02em; }
.workspace { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 344px; gap: 14px; padding: 14px; overflow: hidden; }
.stage { animation: stage-enter .72s cubic-bezier(.2,.75,.25,1) both; min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(160px, 1fr) auto auto; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(150deg, rgba(18, 29, 42, .88), rgba(10, 17, 26, .94)); box-shadow: 0 16px 48px rgba(0,0,0,.16); }
.stage-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.stage-heading h2 { margin: 4px 0 0; font-size: 15px; font-weight: 650; letter-spacing: -.015em; }
.micro-tag { margin-left: 7px; padding: 3px 6px; border: 1px solid rgba(120,225,210,.2); border-radius: 4px; color: var(--accent); font-size: 8px; letter-spacing: .08em; }
.stage-tools { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.tool-button { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.025); color: #9aabb8; font-size: 10px; cursor: pointer; transition: border-color .2s, color .2s, background .2s; }
.tool-button:hover, .tool-button:focus-visible { border-color: rgba(120,225,210,.55); color: var(--text); outline: none; }
.tool-button.active { color: var(--accent); border-color: rgba(120,225,210,.35); background: var(--accent-soft); }
.tool-icon { display: inline-flex; width: 12px; height: 12px; align-items: center; justify-content: center; }
.orbit-icon { border: 1px solid currentColor; border-radius: 50%; transform: scaleX(1.25) rotate(-28deg); position: relative; }
.orbit-icon::after { content: ""; width: 3px; height: 3px; border-radius: 50%; background: currentColor; position: absolute; right: -2px; top: 0; }
.scale-icon { font-size: 15px; line-height: 1; }
.camera-icon { border: 1px solid currentColor; border-radius: 3px; height: 9px; position: relative; }
.camera-icon::before { content: ""; position: absolute; width: 5px; height: 3px; top: -4px; left: 2px; border: 1px solid currentColor; border-bottom: 0; border-radius: 2px 2px 0 0; }
.camera-icon::after { content: ""; position: absolute; width: 3px; height: 3px; border: 1px solid currentColor; border-radius: 50%; left: 3px; top: 2px; }
.canvas-frame { min-height: 0; position: relative; overflow: hidden; border: 1px solid rgba(140,170,190,.12); border-radius: 11px; background: #070d16; }
#spaceCanvas { width: 100%; height: 100%; display: block; }
.canvas-corner-label { position: absolute; left: 13px; bottom: 11px; display: flex; align-items: center; gap: 7px; color: #6f8291; font-size: 8px; font-weight: 800; letter-spacing: .14em; pointer-events: none; }
.corner-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.corner-sep { color: var(--accent); }
.scale-guide { position: absolute; right: 12px; top: 12px; width: min(290px, calc(100% - 24px)); padding: 13px 14px; border: 1px solid rgba(120,225,210,.3); border-radius: 9px; background: rgba(8,15,23,.94); box-shadow: 0 12px 32px rgba(0,0,0,.3); z-index: 2; animation: guide-in .18s ease-out; }
.scale-guide[hidden] { display: none; }
.scale-guide-title { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .14em; margin-bottom: 8px; }
.scale-guide p { margin: 6px 0 0; color: #9eacb8; font-size: 10px; line-height: 1.45; }
.scale-guide strong { color: #e3edf2; font-weight: 650; }
@keyframes guide-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes stage-enter { from { opacity: 0; transform: translateY(8px) scale(.992); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes panel-enter { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: translateX(0); } }
.readout-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.readout-card { min-width: 0; padding: 10px 11px 9px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.018); }
.readout-label { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; color: #8494a1; font-size: 8px; font-weight: 800; letter-spacing: .11em; white-space: nowrap; }
.readout-label span { color: #627d83; font-size: 7px; letter-spacing: .08em; }
.readout-value { margin-top: 5px; color: #e6eef3; font-size: clamp(16px, 1.65vw, 21px); line-height: 1; font-weight: 650; letter-spacing: -.04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout-value small { color: var(--muted); font-size: 10px; font-weight: 550; letter-spacing: 0; }
.readout-foot { margin-top: 5px; color: #667785; font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.state-caption { display: flex; align-items: flex-start; gap: 9px; padding: 9px 11px; border-left: 2px solid rgba(120,225,210,.7); border-radius: 0 7px 7px 0; background: rgba(120,225,210,.045); min-height: 36px; }
.caption-mark { flex: 0 0 auto; margin-top: 3px; width: 7px; height: 7px; border: 1px solid var(--accent); border-radius: 2px; transform: rotate(45deg); }
.state-caption p { margin: 0; color: #9aabb6; font-size: 10px; line-height: 1.42; }
.control-panel { animation: panel-enter .78s cubic-bezier(.2,.75,.25,1) both; min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #263b49 transparent; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(160deg, rgba(16,26,38,.98), rgba(10,17,26,.98)); }
.control-panel::-webkit-scrollbar { width: 5px; }
.control-panel::-webkit-scrollbar-thumb { background: #263b49; border-radius: 10px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.panel-heading h2 { margin: 3px 0 0; font-size: 17px; letter-spacing: -.025em; }
.panel-live { display: flex; align-items: center; gap: 6px; color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.panel-live span { width: 5px; height: 5px; }
.preset-section { padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.section-kicker { color: #7e909f; font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.section-kicker span { margin-left: 5px; color: #5e7c80; font-size: 7px; }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 8px; }
.preset-button { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 7px; text-align: left; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.02); cursor: pointer; transition: .18s ease; }
.preset-button:hover, .preset-button:focus-visible { border-color: rgba(120,225,210,.48); outline: none; }
.preset-button.selected { border-color: rgba(120,225,210,.45); background: var(--accent-soft); }
.preset-button strong { display: block; color: #d7e1e8; font-size: 9px; font-weight: 700; white-space: nowrap; }
.preset-button small { display: block; margin-top: 3px; color: #7c8e9b; font-size: 8px; white-space: nowrap; }
.preset-symbol { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; position: relative; display: block; }
.rubble-symbol { background: radial-gradient(circle at 34% 29%, #a9b5b8 0 10%, #52616d 11% 54%, #263542 55% 100%); box-shadow: inset -4px -4px 5px rgba(0,0,0,.5); }
.rubble-symbol::after { content: ""; position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #18232d; top: 4px; right: 3px; }
.brake-symbol { border: 1px solid rgba(240,181,107,.65); }
.brake-symbol::before { content: "↘"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--warning); font-size: 14px; }
.controls-section { padding: 13px 0 12px; border-bottom: 1px solid var(--line); }
.control-row { margin-top: 11px; }
.control-row label, .time-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; color: #c9d4dc; font-size: 10px; font-weight: 600; }
.control-row label em, .time-head em, .quality-row em { color: #6c828b; font-size: 7px; font-style: normal; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.control-row output, .time-head output { color: var(--accent); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { display: block; width: 100%; height: 14px; margin: 5px 0 0; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; accent-color: var(--accent); }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, rgba(120,225,210,.65), rgba(120,225,210,.18)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 5px; background: linear-gradient(90deg, rgba(120,225,210,.65), rgba(120,225,210,.18)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 11px; height: 11px; margin-top: -4px; border-radius: 50%; background: #c5fff4; border: 2px solid #1a4447; box-shadow: 0 0 0 3px rgba(120,225,210,.12); }
input[type="range"]::-moz-range-thumb { width: 8px; height: 8px; border-radius: 50%; background: #c5fff4; border: 2px solid #1a4447; box-shadow: 0 0 0 3px rgba(120,225,210,.12); }
input[type="range"]:focus-visible { outline: 1px solid var(--accent); outline-offset: 5px; border-radius: 4px; }
.range-ends { display: flex; justify-content: space-between; color: #61717e; font-size: 7px; letter-spacing: .02em; }
.time-section { padding: 13px 0 12px; border-bottom: 1px solid var(--line); }
.time-head { font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.transport-row { display: grid; grid-template-columns: 1.15fr .9fr .7fr; gap: 6px; padding: 12px 0 10px; }
.transport-row button { min-height: 34px; border-radius: 7px; font-size: 9px; font-weight: 700; cursor: pointer; transition: background .18s, border-color .18s, opacity .18s; }
.transport-primary { display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid rgba(120,225,210,.48); background: rgba(120,225,210,.15); color: var(--accent); }
.transport-primary:hover, .transport-primary:focus-visible { background: rgba(120,225,210,.23); outline: none; }
.transport-button { border: 1px solid var(--line-strong); background: rgba(255,255,255,.025); color: #b2c0c9; }
.transport-button:hover, .transport-button:focus-visible { border-color: rgba(120,225,210,.45); color: #fff; outline: none; }
.transport-row button:disabled { opacity: .4; cursor: not-allowed; }
.play-glyph { font-size: 11px; }
.quality-row { display: flex; align-items: center; justify-content: space-between; padding: 0 0 12px; color: #80919d; font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.quality-toggle { display: inline-flex; align-items: center; gap: 7px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,.025); color: #aab8c2; font-size: 8px; font-weight: 800; letter-spacing: .1em; cursor: pointer; }
.quality-toggle:hover, .quality-toggle:focus-visible { border-color: rgba(120,225,210,.45); outline: none; }
.quality-indicator { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 7px var(--accent-glow); }
.quality-toggle[aria-pressed="false"] .quality-indicator { background: #778793; box-shadow: none; }
.audit-card { padding: 11px 11px 9px; border: 1px solid rgba(120,225,210,.2); border-radius: 8px; background: linear-gradient(120deg, rgba(120,225,210,.055), rgba(255,255,255,.015)); }
.audit-top { display: flex; align-items: center; gap: 8px; }
.audit-icon { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(120,225,210,.12); color: var(--accent); font-size: 11px; }
.audit-top small { display: block; margin-top: 3px; color: #6f828e; font-size: 8px; }
.audit-equation { margin: 9px 0 7px; color: #b8c9d0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; }
.audit-values { display: flex; justify-content: space-between; gap: 8px; color: #d4e1e6; font-size: 9px; font-variant-numeric: tabular-nums; }
.audit-values span:last-child { color: #90b8b4; }
.audit-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--line); color: #6e818d; font-size: 7px; }
.audit-foot strong { color: var(--accent); font-size: 8px; font-weight: 700; }
.science-panel { margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.015); }
.science-panel summary { display: flex; align-items: center; gap: 8px; padding: 10px; color: #d3dfe6; font-size: 10px; font-weight: 700; list-style: none; cursor: pointer; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-summary-icon { display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid rgba(120,225,210,.25); border-radius: 5px; color: var(--accent); font-size: 12px; }
.summary-chevron { margin-left: auto; color: #81939e; transition: transform .2s; }
.science-panel[open] .summary-chevron { transform: rotate(180deg); }
.science-content { padding: 0 10px 11px; border-top: 1px solid var(--line); }
.science-content h3 { margin: 11px 0 5px; font-size: 11px; }
.science-content p { color: #92a2ad; font-size: 9px; line-height: 1.5; }
.equation-block { display: grid; gap: 4px; margin: 8px 0; padding: 8px; border-radius: 6px; background: rgba(0,0,0,.2); }
.equation-block span { color: #718692; font-size: 7px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.equation-block code { color: #c5e9e3; font-size: 9px; white-space: normal; overflow-wrap: anywhere; }
.science-note { margin: 8px 0; }
.disclaimer { padding-top: 7px; border-top: 1px solid var(--line); color: #71868d !important; font-style: italic; }
.panel-footnote { margin: 10px 0 2px; color: #647783; font-size: 8px; }
kbd { padding: 2px 4px; border: 1px solid var(--line-strong); border-radius: 3px; color: #a8b6c0; font: inherit; }
button:focus-visible, summary:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }
@media (max-width: 900px) and (min-width: 621px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 310px; gap: 10px; padding: 10px; }
  .stage { padding: 12px; }
  .control-panel { padding: 12px; }
  .tool-button { padding: 0 7px; }
  .tool-button span:last-child { display: none; }
  .readout-label { font-size: 7px; }
}
@media (max-width: 620px) {
  .app-shell { grid-template-rows: 56px minmax(0, 1fr); }
  .topbar { padding: 0 13px; }
  .brand-mark { width: 28px; height: 28px; }
  .brand-mark::before { width: 35px; }
  .brand-mark::after { width: 35px; }
  .brand-lockup { gap: 10px; }
  .eyebrow { font-size: 7px; letter-spacing: .13em; }
  .brand-copy h1 { font-size: 13px; }
  .topbar-note { display: none; }
  .model-status { font-size: 8px; }
  .workspace { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(310px, 47%) minmax(0,1fr); gap: 8px; padding: 8px; }
  .stage { padding: 10px; gap: 7px; grid-template-rows: auto minmax(100px,1fr) auto auto; border-radius: 11px; }
  .stage-heading { align-items: flex-start; }
  .stage-heading h2 { font-size: 11px; margin-top: 3px; }
  .micro-tag { font-size: 6px; padding: 2px 4px; }
  .stage-tools { gap: 4px; }
  .tool-button { min-height: 26px; padding: 0 6px; gap: 4px; font-size: 8px; }
  .tool-icon { width: 10px; height: 10px; }
  .screenshot-button span:last-child { display: none; }
  .readout-grid { grid-template-columns: repeat(4, minmax(0,1fr)); gap: 5px; }
  .readout-card { padding: 7px 6px 6px; border-radius: 6px; }
  .readout-label { display: block; font-size: 6px; letter-spacing: .08em; white-space: normal; line-height: 1.25; }
  .readout-label span { display: block; margin-top: 2px; font-size: 5px; }
  .readout-value { margin-top: 4px; font-size: 14px; }
  .readout-value small { font-size: 8px; }
  .readout-foot { font-size: 6px; margin-top: 3px; }
  .state-caption { padding: 6px 8px; min-height: 31px; gap: 7px; }
  .state-caption p { font-size: 8px; line-height: 1.35; }
  .caption-mark { width: 6px; height: 6px; }
  .canvas-corner-label { display: none; }
  .scale-guide { padding: 9px 10px; top: 7px; right: 7px; }
  .scale-guide-title { font-size: 8px; }
  .scale-guide p { font-size: 8px; }
  .control-panel { padding: 12px; border-radius: 11px; }
  .panel-heading { margin-bottom: 10px; }
  .panel-heading h2 { font-size: 15px; }
  .preset-button { padding: 7px 6px; gap: 6px; }
  .preset-button strong { font-size: 8px; }
  .preset-button small { font-size: 7px; }
  .control-row { margin-top: 9px; }
  .control-row label { font-size: 9px; }
  .control-row output { font-size: 9px; }
  .range-ends { font-size: 6px; }
  .time-section { padding: 11px 0; }
  .transport-row { padding: 10px 0 8px; }
  .transport-row button { min-height: 32px; font-size: 8px; }
  .audit-card { padding: 9px; }
  .science-content p { font-size: 8px; }
}
@media (max-width: 380px) {
  .workspace { grid-template-rows: minmax(285px, 43%) minmax(0,1fr); }
  .stage { padding: 8px; }
  .stage-tools .tool-button:nth-child(2) span:last-child { display: none; }
  .readout-value { font-size: 12px; }
  .readout-label { font-size: 5px; }
  .stage-heading h2 { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
