body[data-osck-theme] {
  --viewer-ground: var(--osck-map-ground);
  --viewer-road: var(--osck-map-asphalt);
  --viewer-ego: var(--osck-actor-1);
  --viewer-cherry: var(--osck-actor-2);
  --viewer-grid: #c6bfd1;
  --viewer-deck: #635b70;
  --viewer-edge: #81788e;
  font: 14px/1.45 var(--sans);
  background: var(--paper);
  color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  body[data-osck-theme] {
    --viewer-grid: #433b50;
  }
}
#crossing-root {
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-top: 3px solid;
  border-image: linear-gradient(90deg,#9083f6,#d693d9,#fab295) 1;
}
.deck-tools, .actor-tools, .camera-controls, .motion-toggles {
  display: flex; align-items: center; gap: 6px;
}
.deck-tools { justify-content: space-between; padding: 8px 12px; }
.view-switch { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 24px; }
.deck-tools button, .camera-controls button, .actor-tools button, .deck-jump {
  min-height: 28px; border: 1px solid var(--line); border-radius: 20px;
  padding: 3px 10px; background: var(--paper); color: var(--ink); font: 550 12px/1.4 var(--sans);
}
.deck-tools button { border: 0; }
.deck-tools button[aria-pressed=true] { background: var(--ink); color: var(--paper); }
.deck-jump { max-width: 55%; min-width: 0; }
.camera-controls button:hover, .actor-tools button:hover, .view-switch button:not([aria-pressed=true]):hover { background: var(--chrome); }
.camera-controls button[aria-pressed=true], .actor-tools button[aria-pressed=true] {
  color: var(--accent); background: var(--wash); border-color: var(--accent);
}
.deck-stage {
  flex: 1 1 0; min-height: 170px; position: relative;
  border-block: 1px solid var(--line); background: var(--viewer-ground);
}
.deck-stage .osck-map { position: absolute; inset: 0; min-height: 0; }
.deck-stage:has(.deck-diagram) { display: flex; flex-direction: column; }
.deck-diagram { display: block; width: 100%; height: 0; flex: 1; min-height: 0; cursor: grab; touch-action: none; }
.deck-diagram:active { cursor: grabbing; }
.deck-diagram:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.camera-controls { justify-content: center; padding: 5px; background: var(--paper); border-top: 1px solid var(--line); }
.camera-controls button { min-width: 28px; padding-inline: 7px; }
.actor-tools { justify-content: space-between; padding: 8px 12px 0; color: var(--sub); font-size: 12px; }
.motion-readings { margin: 6px 12px; border-collapse: collapse; font: 12px/1.4 var(--mono); font-variant-numeric: tabular-nums; }
.motion-readings th, .motion-readings td { text-align: right; padding: 3px; border-bottom: 1px solid var(--line); }
.motion-readings th:first-child { text-align: left; }
.motion-readings thead th { color: var(--sub); font: 550 12px/1.4 var(--sans); }
.motion-readings tbody tr { cursor: pointer; }
.motion-readings tr[data-selected=true] { background: var(--wash); }
.actor-choice { border: 0; background: transparent; color: var(--ink); padding: 3px 2px; font: 600 12px var(--sans); }
.actor-choice i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; box-shadow: inset 0 0 0 1px #30233436; }
.signal-readout { color: var(--accent); white-space: nowrap; margin-left: 5px; }
.wheel-reading { display: inline-flex; gap: 3px; align-items: center; justify-content: flex-end; min-width: 54px; }
.wheel-reading svg { width: 22px; height: 22px; }
.motion-toggles { flex-wrap: wrap; gap: 4px 12px; padding: 4px 12px 9px; font-size: 12px; }
.motion-toggles label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.motion-toggles input { margin: 0; accent-color: var(--accent); }
.motion-toggles label:has(input:checked)::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--motion-color); }
.motion-toggles label:not([style])::after { display: none; }
.motion-toggles i { font: 15px var(--mono); }
@media(max-width:430px) {
  .deck-tools, .actor-tools, .motion-toggles { padding-inline: 8px; }
  .motion-readings { margin-inline: 6px; font-size: 11px; }
  .motion-readings thead th { font-size: 11px; }
  .motion-readings th, .motion-readings td { padding-inline: 2px; }
  .wheel-reading { min-width: 43px; }
  .wheel-reading svg { width: 18px; height: 18px; }
}
