/* The SizeRef scan lab page. System fonts only: the page loads nothing but its own files. */
:root {
  --bg: #f7f6f3;
  --card: #ffffff;
  --ink: #1d1d1b;
  --muted: #5f5e5a;
  --line: #d9d7d0;
  --accent: #1f5f4a;
  --accent-ink: #ffffff;
  --ready: #1f8a4c;
  --fix: #c0562b;
  --wait: #8a8780;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615;
    --card: #20201e;
    --ink: #eeede8;
    --muted: #a9a79f;
    --line: #3a3936;
    --accent: #6cc3a0;
    --accent-ink: #10231c;
    --ready: #4cc27e;
    --fix: #e58a5e;
    --wait: #77756e;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
[hidden] { display: none !important; }
.lab { max-width: 560px; margin: 0 auto; padding: 16px; }
.lab-head h1 { font-size: 1.4rem; margin: 0 0 4px; }
.lab-sub, .lab-meta, .lab-note, .lab-hint { color: var(--muted); margin: 4px 0; font-size: 0.92rem; }
.lab-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 16px 0; }
.lab-field { border: 0; padding: 0; margin: 14px 0; }
.lab-field legend { font-weight: 600; margin-bottom: 6px; }
.lab-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lab-inputs { display: inline-flex; align-items: center; gap: 6px; }
.lab-unit { color: var(--muted); }
.lab-choices { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.lab-check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; }
.lab-check input { margin-top: 4px; width: 20px; height: 20px; flex: none; }
input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}
input[inputmode] { width: 5.5em; }
textarea { width: 100%; font: 0.8rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; margin: 12px 0; }
.lab-btn {
  font: inherit; font-weight: 600;
  min-height: 44px; padding: 10px 20px;
  border: 0; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink);
  cursor: pointer;
}
.lab-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.lab-btn-alt { background: transparent; color: var(--ink); border: 1px solid var(--line); }
#start { width: 100%; margin-top: 8px; }

.lab-live { margin: 16px 0; }
.lab-stage {
  position: relative;
  border: 6px solid var(--wait);
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 9 / 16;
  max-height: 70vh;
  margin: 0 auto;
}
.lab-stage[data-state="ready"] { border-color: var(--ready); }
.lab-stage[data-state="fix"] { border-color: var(--fix); }
.lab-stage video { width: 100%; height: 100%; object-fit: contain; transform: scaleX(-1); display: block; }
.lab-big {
  position: absolute; left: 0; right: 0; top: 8px; margin: 0;
  text-align: center; font-size: clamp(1.8rem, 9vw, 3rem); font-weight: 800;
  color: #fff; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}
.lab-shots {
  position: absolute; left: 0; right: 0; bottom: 8px; margin: 0;
  text-align: center; color: #fff; font-weight: 600; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}
.lab-fix { font-size: 1.1rem; font-weight: 600; text-align: center; margin: 12px 0; }
.lab-offer { text-align: center; margin: 8px 0; }
#stop { display: block; margin: 8px auto; }

.lab-table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.lab-table th, .lab-table td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.lab-table td:first-child { text-transform: capitalize; }
.lab-foot { color: var(--muted); font-size: 0.85rem; text-align: center; margin: 24px 0 8px; }
