:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #6b6b6b;
  --line: #e5e5e5;
  --accent: #1a73e8;
  --done: #1e8e3e;
  --warn: #d93025;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

/* ── header ───────────────────────────────────────────────────────────── */

header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.back {
  width: 40px; height: 40px;
  font-size: 26px; line-height: 1;
  border: none; background: none; color: var(--ink);
  cursor: pointer; border-radius: 10px;
}
.back:active { background: #f0f0f0; }

.order-label {
  flex: 1 1 auto;
  font-size: 14px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.progress { font-size: 13px; font-weight: 800; color: var(--muted); white-space: nowrap; }

.dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.dot-pending { background: #f9ab00; }
.dot-ok      { background: var(--done); }
.dot-err     { background: var(--warn); }

/* ── stage (no scroll, single thing) ───────────────────────────────────── */

.stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 18px;
  overflow: hidden;
}

.loc {
  font-size: 30px; font-weight: 900;
  color: var(--accent);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.thumb {
  width: 88px; height: 88px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #f5f5f5;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb.noimg span { font-size: 16px; font-weight: 800; color: #bbb; }

.sku   { font-size: 12px; font-family: ui-monospace, Menlo, monospace; color: var(--muted); }
.name  { font-size: 15px; font-weight: 800; text-align: center; line-height: 1.2; max-width: 90vw; }

/* reference line: what the sheet thinks is on hand + its status */
.shelf { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.02em; }

.kicker { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* the "what am I doing" line — an instruction, not a label */
.task {
  font-size: 13px; font-weight: 800;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
  max-width: 92vw;
}

.big { font-size: 40px; font-weight: 900; font-variant-numeric: tabular-nums; }

.scan-target {
  width: 148px; height: 148px;
  border: 3px dashed var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 46px;
  flex: 0 0 auto;
}
.scan-target.done { border-color: var(--done); border-style: solid; }

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stepper button {
  width: 52px; height: 52px;
  font-size: 22px; font-weight: 800;
  border: 1px solid var(--line);
  border-radius: 12px; background: #fafafa; cursor: pointer;
}
.stepper button:active { background: #eaeaea; }
.stepper .val {
  min-width: 64px; text-align: center;
  font-size: 40px; font-weight: 900; font-variant-numeric: tabular-nums;
}
.stepper.unset .val { color: #ccc; }

.sub { font-size: 12px; color: var(--muted); }

/* ── exception chips ──────────────────────────────────────────────────── */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  max-width: 92vw;
}
.chip {
  border: 1px solid var(--line);
  background: #fafafa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
}
.chip:active { background: #eee; }
.chip.on { background: #b45309; border-color: #b45309; color: #fff; }

/* ── footer (single action) ───────────────────────────────────────────── */

.footer {
  flex: 0 0 auto;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

.action {
  width: 100%;
  padding: 16px;
  font-size: 18px; font-weight: 800;
  border: none; border-radius: 14px;
  background: var(--accent); color: #fff;
  cursor: pointer;
}
.action:active { opacity: 0.85; }
.action.done { background: var(--done); }
.action:disabled { background: #c4c4c4; cursor: not-allowed; }

/* ── scan feedback ────────────────────────────────────────────────────── */

.stage.flash-ok  { box-shadow: inset 0 0 0 5px var(--done); }
.stage.flash-bad { box-shadow: inset 0 0 0 5px var(--warn); }

/* ── zoom overlay ─────────────────────────────────────────────────────── */

.zoom {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.86);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
}
.zoom img { max-width: 94vw; max-height: 94vh; object-fit: contain; }
.zoom-close {
  position: absolute; top: 16px; right: 16px;
  width: 44px; height: 44px;
  font-size: 22px; border: none; border-radius: 50%;
  background: rgba(255,255,255,0.2); color: #fff; cursor: pointer;
}

.empty { text-align: center; padding: 40px 24px; font-size: 15px; flex: 1 1 auto; }
.muted { color: var(--muted); font-size: 13px; }
.hidden { display: none !important; }
