:root {
  --ink: #1e1e1e;
  --muted: #5a5a5a;
  --line: #d0d4da;
  --before: #c62828;
  --after: #2e7d32;
  --bg: #ffffff;
}
body { margin: 0; padding: 16px; font: 14px/1.45 system-ui, -apple-system, Segoe UI, Arial, sans-serif; color: var(--ink); background: var(--bg); }
header h1 { margin: 6px 0; font-size: 20px; }
header p { margin: 0 0 12px; color: var(--muted); max-width: 980px; }
/* The controls row is as wide as the two panels: up to 640px each side by side, stacked below 1000px */
#panels, .controls { max-width: 1296px; }
#panels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
#panels.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1000px) {
  #panels, .controls { max-width: 640px; }
  #panels, #panels.three { grid-template-columns: 1fr; }
}
.panel { margin: 0; min-width: 0; }
.panel figcaption { font-weight: 600; margin-bottom: 4px; }
/* Narrow captions may wrap: keep the three views level */
#panels.three .panel figcaption { min-height: 2.9em; }
.panel figcaption.before { color: var(--before); }
.panel figcaption.after { color: var(--after); }
.panel iframe { width: 100%; aspect-ratio: 4 / 3; border: 1px solid var(--line); display: block; }
/* A view rendered at a fixed size (live iframe or recorded frames), scaled to the panel width */
.stage { position: relative; box-sizing: border-box; aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid var(--line); background: #f8fafd; }
.stage iframe { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; }
.stage img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* The crosshair of view.html: 32 of 640 by 480 pixels */
.stage .crosshair { position: absolute; left: 47.5%; top: 46.667%; width: 5%; height: 6.667%; pointer-events: none; }
.stage .crosshair::before, .stage .crosshair::after { content: ''; position: absolute; background: #000; }
.stage .crosshair::before { left: 0; right: 0; top: 50%; height: 1px; }
.stage .crosshair::after { top: 0; bottom: 0; left: 50%; width: 1px; }
.readout { font-variant-numeric: tabular-nums; color: var(--muted); min-height: 1.4em; margin-top: 4px; }
.side-title { margin-top: 10px; font-size: 13px; font-weight: 600; }
.side { display: block; box-sizing: border-box; width: 100%; aspect-ratio: 16 / 7; margin-top: 4px; border: 1px solid var(--line); background: #f7fbff; }
.side text { font: 11px system-ui, -apple-system, Segoe UI, Arial, sans-serif; fill: var(--muted); }
.side .sea { fill: #e9e4d8; }
.side .ground { fill: #ddd0b6; stroke: #9e8a6a; stroke-width: 1; }
.side .grid { stroke: #dfe5ec; stroke-width: 1; }
.side .center { stroke: #8a8a8a; stroke-width: 1; stroke-dasharray: 4 4; }
.side .reference { fill: none; stroke: #222; stroke-width: 1.5; }
.side .trace { fill: none; stroke: #b9cbe8; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.side .tick { fill: #1f4e9c; }
.side .jump { stroke: #c62828; stroke-width: 2.5; stroke-dasharray: 5 4; }
.side .jump-end { fill: #fff; stroke: #c62828; stroke-width: 1.5; }
.side .jump-label { fill: #c62828; font-weight: 600; }
.side .sight { stroke: #1f4e9c; stroke-width: 1.5; }
.side .surface { fill: none; stroke: #e65100; stroke-width: 2; }
.side .surface-point { fill: #e65100; }
.side .surface-label { fill: #e65100; font-weight: 600; }
.side .camera { fill: #1f4e9c; stroke: #fff; stroke-width: 1.5; }
.side .target { fill: #c2185b; stroke: #fff; stroke-width: 1.5; }
.side-readout { font-variant-numeric: tabular-nums; color: var(--muted); min-height: 1.4em; margin-top: 4px; font-size: 13px; }
/* Stays at the bottom of the window while the panels are taller than it */
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0 6px; padding: 8px 0;
  position: sticky; bottom: 0; background: var(--bg); z-index: 1; }
.controls input[type=range] { flex: 1 1 280px; }
.controls output { font-variant-numeric: tabular-nums; min-width: 6.5em; }
.jumps button { margin-right: 4px; }
.measure-name { color: var(--before); font-weight: 600; }
.note { color: var(--muted); font-size: 13px; max-width: 980px; }
.list ul { padding-left: 18px; }
.list li { margin: 6px 0; }
code { font-size: 12.5px; }
