.scan-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; }
.link-btn { border: 0; background: none; color: var(--red); font-weight: 600; font-size: 14px; padding: 6px; }

/* Vendor landing page (SPEC.md) — the "1. แผงจริง -> 2. แผง QR" pitch. */
.pitch-steps { display: flex; flex-direction: column; gap: 16px; margin: 20px 0; }
.pitch-step { display: flex; gap: 12px; align-items: flex-start; }
.pitch-num {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; background: var(--red); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px;
}
.pitch-step b { display: block; font-size: 16px; margin-bottom: 2px; }
.pitch-step p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }

#stallSummary { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
#stallSummary .hint { margin: 0; }
#stallSummary a { color: var(--red); font-weight: 600; }

.panel { background: var(--surface); border-radius: 12px; margin: 10px 12px; padding: 14px 16px; }
.panel h2 { font-size: 15px; margin: 0 0 10px; }
/* Scoped to .field-label (not a bare `label` selector) so it can never
 * collide with .btn-main/.btn-plain's own text colour on a <label class="btn
 * ..."> capture button — that collision bit v1 (a bare ".panel label" rule
 * beat .btn-main's colour by specificity, unreadable white-on-red text). */
.field-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.field-label input:not([hidden]) { display: block; width: 100%; margin-top: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: 15px; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 2px 0; }

.stats-bar { display: flex; flex-wrap: wrap; gap: 12px 20px; font-size: 14px; }
.stats-bar .stat b { display: block; font-size: 20px; color: var(--red); font-variant-numeric: tabular-nums; }
.stats-bar .stat span { color: var(--muted); font-size: 12px; }

.capture-row { display: flex; gap: 10px; }
.capture-btn { flex: 1; text-align: center; }

.review-list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.review-list li { padding: 6px 0; border-top: 1px solid var(--line); word-break: break-all; color: var(--muted); }

.product-type-toggle { display: flex; gap: 8px; margin-bottom: 10px; }
.product-type-toggle button { flex: 1; padding: 10px 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); font-size: 13px; }
.product-type-toggle button[aria-pressed="true"] { background: var(--red); color: #fff; border-color: var(--red); }

.keypad-display {
  font-size: 34px; font-weight: 700; letter-spacing: .1em; text-align: center; font-variant-numeric: tabular-nums;
  padding: 12px; background: var(--bg); border-radius: 10px; margin-bottom: 10px; color: var(--ink);
}
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button { padding: 16px; font-size: 20px; font-weight: 700; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }

.ticket-list { display: flex; flex-direction: column; gap: 8px; }
.ticket-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.ticket-row .num { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; flex: 1; }
.ticket-row .num.mismatch { color: var(--red); }
.ticket-row .qty-controls { display: flex; align-items: center; gap: 6px; }
.ticket-row .qty-controls button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); font-weight: 700; font-size: 16px; line-height: 1; }
.ticket-row .qty-controls span { min-width: 44px; text-align: center; font-size: 13px; }
.ticket-row .sold-btn { font-size: 12px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); }
.ticket-row .sold-btn.is-sold { background: var(--sold); color: #fff; border-color: var(--sold); }
.ticket-row .badge-mismatch { font-size: 11px; color: var(--red); border: 1px solid var(--red); border-radius: 999px; padding: 1px 6px; }

.photos { display: flex; flex-direction: column; gap: 12px; }
.photo-card canvas { width: 100%; height: auto; display: block; border-radius: 8px; }
.photo-card .caption { font-size: 12px; color: var(--muted); margin: 6px 0 0; }

.export-row { display: flex; flex-direction: column; gap: 8px; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px);
  z-index: 20; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 10px; font-size: 14px;
  opacity: 0; transition: .25s; width: max-content; max-width: 90vw; text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Preview (customer view) — mockup's #numbers screen only ---------- */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 4; background: var(--bg); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px 0; }
.back { border: 0; background: none; font-size: 26px; color: var(--red); padding: 4px 10px; line-height: 1; }
.bar h1 { font-family: var(--display); font-weight: 400; font-size: 20px; margin: 0; flex: 1; }
.bar h1 small { display: block; font-family: var(--body); font-size: 13px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.finder { padding: 12px 16px; }
.finder label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.slots { display: flex; gap: 6px; align-items: center; }
.slots input {
  width: 100%; min-width: 0; height: 50px; text-align: center; font-size: 26px; font-weight: 700;
  border: 2px solid var(--line); border-radius: 8px; background: var(--surface); caret-color: var(--red);
}
.slots input:not(:placeholder-shown) { border-color: var(--red); color: var(--red); }
.slots input::placeholder { color: var(--sold); font-weight: 500; }
.clear { flex: 0 0 auto; border: 0; background: none; color: var(--red); font-weight: 600; padding: 0 4px; height: 50px; }
.opts { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.found { margin-left: auto; font-size: 14px; color: var(--muted); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 12px 24px; }
.tk { border: 0; padding: 14px 8px 10px; text-align: center; width: 100%; background: var(--surface); border-radius: 8px; }
.tk .num { font-size: clamp(24px, 7.4vw, 32px); letter-spacing: .04em; display: block; line-height: 1.2; font-weight: 700; font-variant-numeric: tabular-nums; }
.tk .qty { display: block; font-size: 13px; margin-top: 4px; color: var(--muted); }
.tk .qty.set { color: var(--red); font-weight: 700; }
.tk .badge-type { display: block; margin-top: 4px; }
.num .hit { color: var(--red); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }
.num .dim { opacity: .45; }
.empty { grid-column: 1/-1; text-align: center; padding: 40px 20px; color: var(--muted); }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
