/* MCR Move Keys - staff PWA. Plain, big-tap-target mobile style.
   Matches checkout_pwa idiom (dark-on-light, system font, >=48px targets).
   No inline styles anywhere so a strict same-origin CSP (style-src 'self') holds. */
:root {
  --bg: #f4f5f7; --card: #ffffff; --ink: #1a1f36; --muted: #6b7280;
  --brand: #1a1f36; --accent: #2563eb; --ok: #16a34a; --warn: #d97706;
  --err: #dc2626; --line: #e5e7eb; --pill: #eef2ff;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; }
body { padding-bottom: env(safe-area-inset-bottom); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.spacer { height: 8px; }

header { background: var(--brand); color: #fff; display: flex; align-items: center;
  gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  position: sticky; top: 0; z-index: 20; }
header .hgrow { flex: 1; min-width: 0; }
header h1 { font-size: 17px; margin: 0; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
header .sub { font-size: 12px; opacity: .8; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#netdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok); margin-right: 6px; vertical-align: 1px; }
#netdot.off { background: var(--err); }
#hdSub { margin-left: 8px; }
.back { background: none; border: 0; color: #fff; font-size: 15px; padding: 8px 4px 8px 0;
  cursor: pointer; opacity: .9; min-height: 40px; }
.pbadge { background: var(--warn); color: #fff; border: 0; border-radius: 99px;
  min-width: 40px; height: 40px; padding: 0 12px; font-size: 14px; font-weight: 700;
  cursor: pointer; }

#banners:empty { display: none; }
.banner { padding: 10px 14px; font-size: 13px; line-height: 1.45; }
.banner.warn { background: #fef3c7; color: #92400e; }
.banner.err  { background: #fee2e2; color: #991b1b; }
.banner.info { background: #dbeafe; color: #1e40af; }
.banner.ok   { background: #dcfce7; color: #166534; }

main { padding: 12px; max-width: 640px; margin: 0 auto; }

.card { background: var(--card); border-radius: 12px; border: 1px solid var(--line);
  margin-bottom: 10px; overflow: hidden; }
.pad { padding: 14px; }
.card h2 { font-size: 14px; margin: 0 0 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }

/* buttons */
.bigbtn { display: block; width: 100%; min-height: 52px; padding: 15px 16px;
  border-radius: 12px; border: 0; font-size: 16px; font-weight: 700;
  cursor: pointer; margin-top: 10px; text-align: center; color: var(--ink);
  background: #fff; border: 1px solid var(--line); }
.bigbtn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.bigbtn.primary:disabled { background: #93c5fd; border-color: #93c5fd; }
.bigbtn.danger { background: var(--err); color: #fff; border-color: var(--err); }
.bigbtn.ghost { background: #fff; color: var(--ink); }
.bigrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.bigrow .bigbtn { margin-top: 0; min-height: 96px; font-size: 22px; }
.sec { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.sec .bigbtn { margin-top: 0; min-height: 60px; font-size: 15px; }
.link { background: none; border: 0; color: var(--accent); font-size: 14px;
  font-weight: 600; cursor: pointer; padding: 10px 4px; min-height: 44px; }

/* forms */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.inp { width: 100%; min-height: 48px; padding: 12px 14px; font-size: 16px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
select.inp { -webkit-appearance: menulist; }
.row2 { display: flex; gap: 8px; }
.row2 .inp { flex: 1; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.chip { min-height: 44px; padding: 10px 14px; font-size: 15px; font-weight: 600;
  color: var(--ink); background: #fff; border: 1px solid var(--line);
  border-radius: 99px; cursor: pointer; }
.chip.on { color: #fff; background: var(--accent); border-color: var(--accent); }
.chip.enrol { background: #fef3c7; color: #92400e; border-color: #fde68a; }

/* lists */
.list { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.lrow { display: flex; align-items: center; gap: 10px; padding: 13px 14px;
  border-top: 1px solid var(--line); cursor: pointer; min-height: 56px; }
.lrow:first-child { border-top: 0; }
.lrow .ltitle { font-weight: 600; font-size: 15px; }
.lrow .lmeta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ltag { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px;
  white-space: nowrap; background: var(--pill); color: var(--accent); }
.ltag.out { background: #fef3c7; color: #92400e; }
.ltag.in { background: #dcfce7; color: #166534; }
.ltag.missing { background: #fee2e2; color: #991b1b; }
.ltag.retired { background: #e5e7eb; color: #374151; }
.xbtn { background: #fee2e2; color: #991b1b; border: 0; border-radius: 8px;
  width: 44px; height: 44px; font-size: 18px; cursor: pointer; }
.empty { text-align: center; color: var(--muted); font-size: 14px; padding: 30px 16px; line-height: 1.6; }

/* scanner */
.scanwrap { position: relative; background: #000; border-radius: 12px; overflow: hidden;
  aspect-ratio: 3 / 4; margin-bottom: 10px; }
.scanwrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanframe { position: absolute; inset: 18% 14%; border: 3px solid rgba(255,255,255,.9);
  border-radius: 14px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); pointer-events: none; }
.scanframe.hit { border-color: var(--ok); }
.scanflash { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 12px;
  font-size: 14px; font-weight: 600; color: #fff; background: rgba(22,163,74,.9); text-align: center; }
.scanflash.dup { background: rgba(217,119,6,.92); }
.torch { position: absolute; top: 10px; right: 10px; min-width: 48px; height: 48px;
  border-radius: 99px; border: 0; background: rgba(0,0,0,.55); color: #fff;
  font-size: 20px; cursor: pointer; }
.torch.on { background: #fff; color: #1a1f36; }
.count-big { font-size: 40px; font-weight: 800; text-align: center; margin: 4px 0; }
.count-lbl { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.manual { display: flex; gap: 8px; margin-bottom: 10px; }
.manual .inp { flex: 1; text-transform: uppercase; }
.manual button { min-width: 72px; }

/* scan running list */
#scanlist .slrow, .slrow { display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-top: 1px solid var(--line); }
.slrow:first-child { border-top: 0; }
.slrow .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700; font-size: 15px; }
.slrow .sdet { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* result rows */
.res { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px;
  border-top: 1px solid var(--line); }
.res:first-child { border-top: 0; }
.res .rt { flex: 1; }
.res .rmark { width: 24px; height: 24px; border-radius: 50%; flex: 0 0 24px;
  color: #fff; font-size: 15px; line-height: 24px; text-align: center; font-weight: 700; }
.res.ok .rmark { background: var(--ok); }
.res.warn .rmark { background: var(--warn); }
.res.err .rmark { background: var(--err); }
.res .rmain { font-weight: 600; font-size: 14px; }
.res .rsub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.res.warn .rsub { color: #92400e; }
.res.err .rsub { color: #991b1b; }

/* stepper / composition */
.comp-row { display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-top: 1px solid var(--line); }
.comp-row:first-child { border-top: 0; }
.comp-row .clabel { flex: 1; font-size: 15px; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stbtn { width: 48px; height: 48px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; font-size: 22px; font-weight: 700; cursor: pointer; color: var(--ink); }
.stqty { min-width: 28px; text-align: center; font-size: 17px; font-weight: 700; }
.otherlbl { margin-top: 8px; }

/* autocomplete dropdown */
.ac { position: relative; }
.ac-list { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px;
  background: #fff; max-height: 240px; overflow-y: auto; }
.ac-item { padding: 12px 14px; border-top: 1px solid var(--line); cursor: pointer; min-height: 48px; }
.ac-item:first-child { border-top: 0; }
.ac-item .acmeta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ac-item.taken { opacity: .6; }

/* collapsible (sweep) */
details.coll { background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
details.coll > summary { padding: 14px; font-weight: 700; font-size: 15px; cursor: pointer;
  list-style: none; display: flex; align-items: center; gap: 8px; }
details.coll > summary::-webkit-details-marker { display: none; }
details.coll > summary .cnum { margin-left: auto; font-size: 14px; color: var(--muted); }
details.coll.alarm { border-color: var(--err); }
details.coll.alarm > summary { background: #fee2e2; color: #991b1b; }
details.coll .coll-body { border-top: 1px solid var(--line); }

/* misc */
.holderbar { display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: var(--pill); border-radius: 10px; margin-bottom: 10px; }
.holderbar .hname { font-weight: 700; }
.statusline { font-size: 13px; color: var(--muted); text-align: center; margin: 12px 0; line-height: 1.5; }
.big-sign { text-align: center; padding: 40px 16px; }
.big-sign h2 { font-size: 20px; margin: 0 0 6px; text-transform: none; letter-spacing: 0; color: var(--ink); }
