:root {
  --bg: #10151b; --panel: #1a222c; --panel2: #232d39; --line: #33404f;
  --text: #eef2f6; --muted: #98a6b5; --accent: #f5c518; --accent-ink: #1b1600;
  --ok: #4cd08a; --warn: #ffb454; --bad: #ff7b7b;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { padding: calc(10px + var(--safe-top)) 14px calc(24px + var(--safe-bottom)); min-height: 100vh; }
[hidden] { display: none !important; }
h1 { margin: 0 0 4px; font-size: 26px; } h2 { margin: 0 0 8px; font-size: 21px; }
.muted { color: var(--muted); } .small { font-size: 14px; } .err { color: var(--bad); min-height: 1.2em; margin: 6px 0; }
.view { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.card, .panel, .sheet { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.panel { display: flex; flex-direction: column; gap: 10px; border-color: var(--accent); }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.bar .right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.loc { font-size: 26px; letter-spacing: .5px; }
.row { display: flex; } .row.gap { gap: 10px; } .row.center { align-items: center; } .row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; } .col.gap { gap: 10px; } .grow { flex: 1; min-width: 0; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); margin: 8px 0; }
input, select { font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; width: 100%; min-height: 48px; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
#e-qty { font-size: 30px; font-weight: 700; text-align: center; }
.btn { font: inherit; font-weight: 600; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-height: 48px; cursor: pointer; text-align: center; display: inline-flex; align-items: center; justify-content: center; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { background: #3a1d22; border-color: #7a3039; color: #ffd0d0; }
.btn.big { min-height: 56px; font-size: 19px; } .btn.sm { min-height: 40px; padding: 8px 12px; font-size: 15px; }
.btn[disabled] { opacity: .5; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; font: inherit; font-size: 14px; padding: 6px; }
.pill { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: #17361f; color: var(--ok); white-space: nowrap; }
.pill.wait { background: #3a2f12; color: var(--warn); } .pill.bad { background: #3a1d22; color: var(--bad); }
.banner { position: sticky; top: 0; z-index: 5; text-align: center; font-weight: 700; padding: 6px; border-radius: 8px; margin-bottom: 8px; background: var(--warn); color: #231a00; }
.banner.alert { background: var(--bad); color: #2b0000; }
.cam { position: relative; background: #000; border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 3; max-height: 46vh; width: 100%; }
.cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.reticle { position: absolute; inset: 24% 10%; border: 2px solid rgba(245,197,24,.9); border-radius: 12px; pointer-events: none; box-shadow: 0 0 0 9999px rgba(0,0,0,.25); }
.camhint { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: 14px; text-shadow: 0 1px 3px #000; pointer-events: none; }
.torch { position: absolute; top: 8px; right: 8px; }
.thumb { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; background: #000; flex: none; }
.thumb.wide { width: 100%; height: auto; max-height: 200px; }
.read { font-size: 22px; font-weight: 700; word-break: break-all; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.list li { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; }
.list li.busy { opacity: .55; } .list li .code { font-weight: 700; font-size: 19px; word-break: break-all; }
.list li .qty { font-size: 22px; font-weight: 700; } .list li.void { opacity: .45; text-decoration: line-through; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
.chip button { background: none; border: 0; color: var(--bad); font-size: 18px; padding: 0 6px; }
.task { border: 2px solid var(--accent); background: #2a2410; border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.search { margin-top: 2px; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.72); z-index: 20; display: flex; align-items: flex-end; justify-content: center; padding: 12px; overflow: auto; }
.sheet { width: 100%; max-width: 520px; max-height: 94vh; overflow: auto; }
@media (min-width: 700px) { .modal { align-items: center; } }
.cam.sticky { position: sticky; top: 0; z-index: 4; max-height: 24vh; }
.srow { display: flex; gap: 8px; align-items: center; }
.srow > span { width: 2em; text-align: right; color: var(--muted); flex: none; }
.srow.on input { outline: 2px solid var(--accent); }
