
:root {
  color-scheme: dark;
  --bg: #101418;
  --panel: #1a2128;
  --ink: #e8eef4;
  --muted: #9aa8b5;
  --accent: #3dbe9a;
  --warn: #e3b341;
  --bad: #e36a5a;
  --ok: #3dbe9a;
  --empty: #2a333c;
  font-family: "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { max-width: 720px; margin: 0 auto; padding: 12px 12px 32px; }
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
h1 { font-size: 1.25rem; margin: 0 0 4px; }
.tag, .fine { color: var(--muted); font-size: 0.82rem; line-height: 1.4; }
.pill { background: #1e3b32; color: var(--accent); border-radius: 999px; padding: 4px 10px; font-size: 0.78rem; }
.stage { position: relative; background: #000; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; margin: 12px 0; }
#preview, #overlay { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#overlay { pointer-events: none; }
.guide { position: absolute; left: 12px; right: 12px; bottom: 12px; background: rgba(0,0,0,0.55); border-radius: 8px; padding: 8px 10px; }
.guide p { margin: 0; }
#guide-sub { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
.panel { background: var(--panel); border-radius: 12px; padding: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
button { background: #2b3640; color: var(--ink); border: 0; border-radius: 8px; padding: 10px 12px; font-size: 0.95rem; }
button:disabled { opacity: 0.45; }
button:not(:disabled):active { transform: scale(0.98); }
#btn-stitch, #btn-export, #btn-capture { background: #245246; }
.toggle { color: var(--muted); font-size: 0.9rem; }
.stats { color: var(--muted); font-variant-numeric: tabular-nums; justify-content: space-between; }
#coverage { width: 100%; height: auto; border-radius: 8px; background: #0b0e11; display: block; }
.tiles { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin: 10px 0; }
.tile { background: var(--empty); border: 2px solid transparent; border-radius: 6px; min-height: 42px; padding: 4px 2px; font-size: 0.62rem; text-align: center; color: var(--muted); cursor: pointer; }
.tile.ok { background: #1c3d32; color: var(--ok); }
.tile.blur { background: #3d3420; color: var(--warn); }
.tile.selected { border-color: #7ec8ff; }
.alert { background: #3d2a20; color: var(--warn); padding: 8px 10px; border-radius: 8px; }
.hidden { display: none; }
.viewer { margin-top: 12px; background: #000; border-radius: 12px; overflow: hidden; }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; background: var(--panel); gap: 8px; }
#view { width: 100%; height: min(55vh, 420px); display: block; touch-action: none; }
footer { margin-top: 16px; color: var(--muted); font-size: 0.88rem; }
footer li { margin: 6px 0; }

.tile.off { background: #3d2f1c; color: #e3b341; }
.tile.plain { outline: 1px dashed #7ec8ff; }
.primer {
  background: #1a2128;
  border-radius: 12px;
  padding: 16px;
  margin: 12px 0;
}
.primer.hidden { display: none; }
.primer ol { padding-left: 1.2rem; color: var(--muted); }
.primer li { margin: 8px 0; }
#btn-primer { background: #245246; width: 100%; }

#gps-readout { margin: 4px 0 8px; }

.ver { color: var(--muted); font-size: 0.75rem; margin: 4px 0 0; }
#btn-stitch[hidden] { display: none; }
code { font-size: 0.85em; }
.pill.device { background: #1e3b32; color: var(--accent); }
