:root {
  --bg: #0b0e13;
  --panel: #131821;
  --line: #222a37;
  --ink: #e6e9f0;
  --muted: #98a1b3;
  --accent: #6aa8ff;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
header { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; padding: 14px 16px 6px; flex-wrap: wrap; }
h1 { margin: 0; font-size: 20px; font-weight: 650; }
.about { margin: 4px 0 0; color: var(--muted); max-width: 980px; }
.loading { color: var(--muted); font-size: 13px; }
.loading.ready { color: #b6f1c6; }
.loading.failed { color: #ffb4ae; }
main { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; padding: 8px 16px 20px; }
@media (max-width: 1100px) { main { grid-template-columns: 1fr; } }
section { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; min-width: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.group { display: inline-flex; flex-wrap: wrap; gap: 6px; padding-right: 10px; border-right: 1px solid var(--line); }
.group:last-child { border-right: none; }
button { background: #1d2430; color: var(--ink); border: 1px solid #2f3a4b; border-radius: 6px; padding: 4px 9px; font: inherit; cursor: pointer; }
button:hover { border-color: var(--accent); }
button.add::before { content: "+ "; color: var(--accent); }
button.add.unseen { border-style: dashed; }
button.on { border-color: var(--accent); color: #fff; }
.surface-wrap { position: relative; width: 100%; aspect-ratio: 16 / 10; }
#surface { width: 100%; height: 100%; display: block; border-radius: 8px; cursor: grab; touch-action: none; outline: none; background: #000; }
#surface.drag { cursor: grabbing; }
.status { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 10px; }
.k { color: var(--muted); }
.pill { padding: 3px 10px; border-radius: 999px; background: #262d3a; font-weight: 600; }
.pill.still { background: #1f3326; color: #b6f1c6; }
.pill.repair { background: #3a2b18; color: #ffd296; }
#strip { width: 100%; height: 70px; margin-top: 8px; border-radius: 6px; background: #080a0e; display: block; }
.controls { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 10px; }
.controls input[type=range] { vertical-align: middle; width: 110px; }
.hint, .legend { color: var(--muted); margin: 10px 0 0; font-size: 13px; }
.right { display: flex; flex-direction: column; }
.viewbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; color: var(--muted); flex-wrap: wrap; }
.stage { position: relative; width: 100%; height: min(58vh, 600px); min-height: 360px; }
#scan { width: 100%; height: 100%; display: block; border-radius: 8px; background: #070d13; }
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
#inspector { position: absolute; left: 10px; bottom: 8px; font: 12px ui-monospace, monospace; color: #c9d6e2; background: rgba(7, 13, 19, 0.75); padding: 4px 8px; border-radius: 6px; }
#montage { width: 100%; height: 130px; display: block; margin-top: 8px; border-radius: 8px; background: #0a1119; }
.eyeviews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.eyeviews figure { margin: 0; text-align: center; font-size: 12px; color: var(--muted); cursor: pointer; }
.eyeviews canvas { width: 78px; height: 78px; image-rendering: pixelated; border-radius: 6px; border: 2px solid transparent; display: block; }
.eyeviews figure.sel canvas { outline: 2px solid #fff; outline-offset: 1px; }
