/* Same colours as the POS app (app/lib/ui/theme.dart). Phone first: short
   cards, coloured status chips, a label on every number, buttons ≥ 56 px
   (upskill-library ข้อ 3, owner OK 6 Nov 2026). */
:root {
  --bg: #ECE4D4; --card: #FAF5EC; --ink: #3B2A1E; --muted: #5E4A3B; --line: #8C7461;
  --green: #3E7B2E; --green-soft: #DDEBCB; --green-ink: #285A1E;
  --amber: #F2DFAE; --amber-ink: #4A3208; --red: #9C3B22; --red-soft: #F4DCD2;
  --blue-soft: #DCE3E3; --blue-ink: #2F4858;
  --gap: 12px; --radius: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1E1813; --card: #2B231C; --ink: #F3EBDD; --muted: #CDBEAA; --line: #7A6552;
    --green-soft: #24361D; --green-ink: #B9DDA4; --amber: #4A3A14; --amber-ink: #F2DFAE;
    --red-soft: #45221A; --red: #E39A84; --blue-soft: #22303A; --blue-ink: #C8D9E3;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 18px/1.45 "Sarabun", "Thonburi", system-ui, sans-serif;
  padding: env(safe-area-inset-top) 16px calc(env(safe-area-inset-bottom) + 16px);
  max-width: 640px; margin: 0 auto;
}
.bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; }
.bar strong { font-size: 22px; }
h1 { font-size: 24px; margin: 0 0 8px; }
h2.order { font-size: 22px; margin: 8px 0; text-align: center; }
.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 18px;
  font: inherit; font-weight: 700; color: var(--ink); background: var(--card);
  border: 2px solid var(--ink); border-radius: 14px; cursor: pointer; touch-action: manipulation;
}
.btn.primary { background: var(--green); color: #FAF5EC; border-color: var(--green-ink); }
.btn.warn { background: var(--amber); color: var(--amber-ink); border-color: var(--amber-ink); }
.btn.big { min-height: 72px; font-size: 22px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.grow { flex: 1; }
.link { background: none; border: 0; color: var(--blue-ink); font: inherit; text-decoration: underline; padding: 8px; min-height: 44px; }
.row { display: flex; gap: var(--gap); margin-top: var(--gap); }
.sticky { position: sticky; bottom: 0; background: var(--bg); padding: 8px 0; }
.list { display: grid; gap: 8px; margin: 8px 0; }
.list .btn { justify-content: flex-start; text-align: left; flex-direction: column; align-items: flex-start; padding: 10px 14px; }
.list .btn small { font-weight: 400; color: var(--muted); }
.chip { font-size: 15px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-ink); }
.chip.ok { background: var(--green-soft); color: var(--green-ink); }
.chip.wait { background: var(--amber); color: var(--amber-ink); }
.chip.bad { background: var(--red-soft); color: var(--red); }
.cam { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; margin-top: 8px; }
.cam video { display: block; width: 100%; max-height: 62vh; object-fit: cover; }
.cam.live { aspect-ratio: 3 / 4; }
.cam.live video { height: 100%; max-height: none; }
/* guide frame = the part of the photo that is read (SPX label is ~3:4) */
.guide { position: absolute; inset: 6% 8%; border: 3px dashed #FAF5EC; border-radius: 12px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.hint { margin: 0; text-align: center; font-weight: 700; }
.msg { min-height: 1.4em; font-weight: 700; }
.msg.bad { color: var(--red); }
.foot { text-align: center; color: var(--muted); font-size: 16px; }
.box { margin: 8px 0; }
.box .note { border: 2px solid; border-radius: 14px; padding: 10px 14px; font-weight: 700; text-align: center; }
.note.bad { background: var(--red-soft); color: var(--red); }
.note.warn { background: var(--amber); color: var(--amber-ink); }
.note.ok { background: var(--green-soft); color: var(--green-ink); }
/* one short card per label line */
.line { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center;
  background: var(--card); border: 2px solid var(--line); border-left-width: 8px; border-radius: 14px; padding: 10px 12px; margin: 8px 0; }
.line.ready { border-left-color: var(--green); }
/* HANDOFF 6 Nov (upskill ข้อ 3): orange = Shopee name not known yet */
.line.need { border-left-color: #C77A1E; }
.line .shopee { grid-column: 1 / -1; color: var(--muted); font-size: 15px; }
.line .stock { font-weight: 700; font-size: 20px; }
.line .qty { font-size: 15px; color: var(--muted); }
.line .qty b { color: var(--ink); font-size: 20px; }
.pin-dots { font-size: 32px; letter-spacing: 10px; text-align: center; min-height: 48px; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pad .btn { min-height: 64px; font-size: 26px; }
textarea { width: 100%; font: inherit; border-radius: 10px; border: 2px solid var(--line); background: var(--card); color: var(--ink); }
dialog { border: 2px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); width: min(92vw, 560px); max-height: 80vh; }
dialog::backdrop { background: rgba(0,0,0,.45); }
.toast { position: fixed; left: 16px; right: 16px; top: calc(env(safe-area-inset-top) + 12px); margin: 0 auto; max-width: 600px;
  background: var(--ink); color: var(--bg); border-radius: 14px; padding: 14px; text-align: center; font-weight: 700; z-index: 10; }
