:root {
  color-scheme: dark;
  --bg: #080b0f;
  --panel: #10151b;
  --panel-2: #151c24;
  --panel-3: #1b2530;
  --line: #27323e;
  --line-hot: #3f5264;
  --text: #e9f0f5;
  --muted: #8493a1;
  --red: #ff4a55;
  --cyan: #36d1c4;
  --blue: #5fa8ff;
  --yellow: #f1c75b;
  --green: #57d68d;
  --purple: #b693ff;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 13px/1.45 Inter, "Segoe UI", system-ui, sans-serif; overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, select, input, textarea { color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; }
button { padding: 6px 10px; cursor: pointer; }
button:hover:not(:disabled), button.active { border-color: var(--cyan); background: #18302f; }
button:disabled { opacity: .4; cursor: default; }
button.primary { background: var(--red); border-color: #ff7880; color: #fff; font-weight: 700; }
input, select, textarea { padding: 7px 8px; }
.topbar { height: 64px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); background: #0d1218; padding: 8px 12px; }
.lab-mark { width: 44px; height: 44px; display: grid; place-items: center; background: var(--red); color: #fff; text-decoration: none; font: 800 13px var(--mono); letter-spacing: .08em; clip-path: polygon(12% 0,100% 0,88% 100%,0 100%); }
.title-block { min-width: 246px; }
.title-block h1 { margin: 0; font-size: 15px; letter-spacing: .02em; }
.title-block p { margin: 2px 0 0; color: var(--muted); font: 10px var(--mono); }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.status-dot.loading { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }
.mode-tabs { flex: 1; display: flex; justify-content: center; gap: 2px; }
.mode-tabs button { background: transparent; border-color: transparent; color: var(--muted); font-size: 12px; }
.mode-tabs button.active { color: #fff; background: var(--panel-2); border-color: var(--line-hot); }
.top-actions { display: flex; align-items: center; gap: 6px; }
.save-state { min-width: 76px; text-align: right; color: var(--muted); font: 10px var(--mono); }
.save-state.dirty { color: var(--yellow); }
.save-state.saved { color: var(--green); }
.workspace { height: calc(100% - 64px); min-height: 0; overflow: hidden; display: grid; grid-template-columns: 280px minmax(0, 1fr); grid-template-rows: minmax(0,1fr); }
.browser-panel { min-width: 0; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.browser-head { padding: 12px; border-bottom: 1px solid var(--line); }
.search-field span { display: block; margin-bottom: 5px; color: var(--muted); font: 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.search-field input { width: 100%; }
.filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 7px; }
.filter-row select { min-width: 0; width: 100%; font-size: 11px; }
.small-muted { margin-top: 8px; color: var(--muted); font: 10px var(--mono); }
.definition-list { flex: 1; overflow: auto; padding: 5px; }
.definition-group { padding: 8px 8px 4px; color: var(--muted); font: 10px var(--mono); text-transform: uppercase; letter-spacing: .08em; position: sticky; top: 0; background: var(--panel); z-index: 1; }
.definition-item { display: block; width: 100%; padding: 8px; text-align: left; border: 1px solid transparent; background: transparent; }
.definition-item strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 11px var(--mono); }
.definition-item small { color: var(--muted); }
.definition-item.selected { background: #152b2b; border-color: #2e6b66; }
.workbench { min-width: 0; height: 100%; min-height: 0; position: relative; display: grid; grid-template-rows: 54px minmax(0, 1fr) 215px; overflow: hidden; }
.selection-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg,#111820,#0d1218); }
.selection-bar h2 { margin: 1px 0 0; font: 600 14px var(--mono); }
.eyebrow { color: var(--cyan); font: 9px var(--mono); letter-spacing: .13em; }
.chip-row { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.chip { border: 1px solid var(--line-hot); border-radius: 20px; padding: 2px 7px; color: var(--muted); font: 9px var(--mono); }
.four-pane { min-height: 0; height: 100%; overflow: hidden; display: grid; grid-template-columns: minmax(220px,.78fr) minmax(330px,1.32fr); grid-template-rows: minmax(0,1fr) minmax(0,1fr); gap: 1px; background: var(--line); }
.pane { min-height: 0; overflow: hidden; background: var(--panel); display: flex; flex-direction: column; }
.pane > header, .timeline-panel > header, .analysis-drawer > header { min-height: 37px; padding: 6px 9px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pane > header > div:first-child, .timeline-panel > header > div:first-child { display: flex; align-items: center; gap: 7px; }
h3 { margin: 0; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.pane-index { width: 20px; color: var(--cyan); font: 9px var(--mono); }
.pane-status { color: var(--muted); font: 9px var(--mono); }
.pane-scroll { min-height: 0; flex: 1; overflow: auto; padding: 10px; }
.empty-state { display: grid; place-items: center; text-align: center; color: #62717e; font-size: 11px; padding: 24px; }
.evidence-pane { grid-column: 1; grid-row: 1; }
.art-pane { grid-column: 2; grid-row: 1; }
.metadata-pane { grid-column: 1; grid-row: 2; }
.scenario-pane { grid-column: 2; grid-row: 2; }
.mini-controls { color: var(--muted); font-size: 10px; display: flex; gap: 8px; }
.mini-controls label { white-space: nowrap; }
.viewport-wrap { min-height: 0; flex: 1; position: relative; background: radial-gradient(circle at 50% 70%,#17212a,#080c10 70%); }
#frameViewport { width: 100%; height: 100%; display: block; }
.pose-badge { position: absolute; left: 9px; top: 8px; padding: 4px 6px; background: #080b0fcf; border: 1px solid var(--line); color: var(--muted); font: 9px var(--mono); }
.collision-legend { position: absolute; right: 8px; bottom: 7px; display: flex; gap: 7px; background: #080b0fdd; padding: 4px 6px; font: 8px var(--mono); }
.collision-legend span::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 3px; background: currentColor; }
.collision-legend .hurt { color: var(--blue); }.collision-legend .hit { color: var(--red); }.collision-legend .push { color: var(--green); }.collision-legend .throw-hurt { color: var(--cyan); }.collision-legend .throw { color: var(--yellow); }.collision-legend .proximity, .collision-legend .invuln { color: var(--purple); }
.view-switch { display: flex; gap: 2px; }.view-switch button { padding: 3px 6px; font-size: 9px; }
.scenario-controls { padding: 7px; display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); }
.scenario-controls select { flex: 1; min-width: 0; }.scenario-controls label { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 10px; }
.short-input { width: 62px; }
.timeline-panel { min-height: 0; background: var(--panel); border-top: 1px solid var(--line); display: flex; flex-direction: column; }
.transport { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 10px; }.transport button { padding: 3px 8px; }.mono { font-family: var(--mono); }
.timeline-scroll { flex: 1; min-height: 0; overflow: auto; }
.timeline { min-width: 720px; display: grid; grid-template-columns: 104px repeat(var(--ticks), minmax(18px,1fr)); font: 8px var(--mono); }
.track-label { position: sticky; left: 0; z-index: 2; padding: 4px 6px; background: #111820; color: var(--muted); border-right: 1px solid var(--line); border-bottom: 1px solid #1c2630; }
.tick-cell { min-height: 22px; border-right: 1px solid #1b2630; border-bottom: 1px solid #1b2630; background: #0d1319; position: relative; cursor: pointer; }
.tick-cell:hover, .tick-cell.current { box-shadow: inset 0 0 0 1px var(--cyan); z-index: 1; }.tick-cell.current::after { content: ""; position: absolute; inset: 0 auto 0 50%; border-left: 1px solid var(--cyan); }
.tick-cell.active { background: #24303b; }.tick-cell.startup { background: #2d2936; }.tick-cell.recovery { background: #202a31; }.tick-cell.hit { background: #5a2028; }.tick-cell.hurt { background: #17324e; }.tick-cell.push { background: #18352b; }.tick-cell.motion { background: #473b19; }.tick-cell.event { background: #3c2452; }
.tick-number { color: #5f7180; display: grid; place-items: center; }
.schema-node { margin-left: 10px; border-left: 1px solid #26323d; padding-left: 7px; }
.schema-node > summary { color: var(--cyan); cursor: pointer; font: 10px var(--mono); padding: 3px 0; }
.json-field { display: grid; grid-template-columns: minmax(86px,.8fr) minmax(100px,1.2fr); gap: 6px; align-items: center; padding: 3px 0; }
.json-field label { color: var(--muted); font: 9px var(--mono); overflow-wrap: anywhere; }.json-field input,.json-field select,.json-field textarea { width: 100%; min-width: 0; padding: 4px 5px; font: 10px var(--mono); }.json-field textarea { min-height: 50px; resize: vertical; }
.json-field small { grid-column: 2; color: #60717e; font-size: 8px; }.field-provenance { color: var(--purple)!important; }
.inline-errors { padding: 6px 9px; color: #ff9aa0; background: #38191d; font: 9px var(--mono); }
.kv-grid { display: grid; grid-template-columns: minmax(90px,.6fr) 1.4fr; gap: 3px 8px; font: 9px var(--mono); }.kv-grid dt { color: var(--muted); }.kv-grid dd { margin: 0; overflow-wrap: anywhere; }
.section-title { margin: 12px 0 5px; color: var(--cyan); font: 9px var(--mono); text-transform: uppercase; letter-spacing: .1em; }
.code-block { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; color: #b7c5cf; font: 9px/1.45 var(--mono); }
.scenario-summary { display: grid; grid-template-columns: repeat(4,1fr); gap: 5px; }.metric { padding: 6px; border: 1px solid var(--line); background: #0c1116; }.metric b { display: block; color: var(--cyan); font: 13px var(--mono); }.metric span { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.analysis-drawer { position: absolute; inset: 54px 0 0 0; z-index: 10; background: #0b1016f7; backdrop-filter: blur(5px); display: flex; flex-direction: column; }
.analysis-content { min-height: 0; flex: 1; overflow: auto; padding: 14px; }.progress-line { height: 2px; background: #18222c; }.progress-line i { display: block; height: 100%; width: 0; background: var(--cyan); transition: width .15s; }
.command-palette { width: min(680px,90vw); max-height: 70vh; border: 1px solid var(--line-hot); border-radius: 8px; padding: 0; background: #111820; color: var(--text); box-shadow: 0 20px 80px #000; }.command-palette::backdrop { background: #000a; }.command-palette form { display: flex; padding: 10px; gap: 6px; border-bottom: 1px solid var(--line); }.command-palette input { flex: 1; }.command-palette #commandList { padding: 6px; max-height: 55vh; overflow: auto; }.command-entry { width: 100%; display: flex; justify-content: space-between; text-align: left; margin: 2px 0; }.command-entry small { color: var(--muted); }
@media (max-width: 1100px) { .title-block { display: none; }.workspace { grid-template-columns: 230px minmax(0,1fr); }.top-actions .save-state { display: none; } }
