/* Receiving page (receive.html). Builds on style.css; same handheld-first rules. */

/* Several elements here set `display` (flex rows, the check labels), and a CSS
   display beats the [hidden] attribute — which left a received box still
   showing its Receive button. Make hidden mean hidden. */
[hidden] { display: none !important; }

.small { font-size: 14px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.warn-text { color: var(--warn); }
.ok-text { color: var(--ok); }

.po-form { display: flex; gap: 8px; align-items: stretch; }
.po-form input { flex: 1; }
.po-form .secondary-button { width: auto; margin: 0; padding: 0 20px; }

.po-match {
  display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center;
  width: 100%; min-height: var(--tap); margin: 6px 0; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  color: var(--fg); font: inherit; text-align: left; cursor: pointer;
}
.po-match:disabled { opacity: 0.5; cursor: default; }

.po-card { margin-top: 0; }
.po-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.po-code { font-size: 20px; font-weight: 700; }
.po-head .link-button { width: auto; min-height: 0; margin: 0; padding: 4px 0; }
.po-progress { height: 8px; margin: 12px 0 6px; border-radius: 4px; background: var(--line); overflow: hidden; }
.po-bar { height: 100%; background: var(--ok); }
.po-bar.over { background: var(--warn); }
.po-card details { margin-top: 8px; }
.po-card summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.po-lines { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 6px; }
.po-lines td { padding: 3px 0; border-bottom: 1px solid var(--line); }
.po-lines tr.over td { color: var(--warn); }

.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.settings label { font-size: 14px; color: var(--muted); }
@media (max-width: 380px) { .settings { grid-template-columns: 1fr; } }

.capture-row .add-photos { display: flex; align-items: center; justify-content: center; cursor: pointer; }

.batch-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  margin: 16px 0 8px; position: sticky; top: 57px; z-index: 4;
  padding: 8px 0; background: var(--bg);
}
.primary-small {
  min-height: 48px; padding: 0 18px; border: 0; border-radius: 10px;
  background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
.primary-small:disabled { background: var(--line); color: var(--muted); cursor: default; }

.chip {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  background: var(--line); color: var(--fg);
}
.chip-ok { background: #065f46; color: #d1fae5; }
.chip-ready { background: #1e40af; color: #dbeafe; }
.chip-warn { background: #78350f; color: #fef3c7; }
.chip-bad { background: #7f1d1d; color: #fee2e2; }
.chip-muted { background: var(--line); color: var(--muted); }

.box-card {
  margin: 10px 0; padding: 12px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--card);
}
.box-top { display: flex; gap: 12px; align-items: flex-start; }
.thumb {
  width: 84px; height: 84px; object-fit: cover; border-radius: 8px;
  background: var(--line); flex: none; cursor: zoom-in;
}
.thumb.zoom {
  position: fixed; inset: 0; z-index: 50; width: 100vw; height: 100vh;
  object-fit: contain; background: #000d; border-radius: 0; cursor: zoom-out;
}
.box-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.issues { margin: 8px 0 0; padding-left: 18px; color: var(--warn); font-size: 14px; }
.issues li.muted { color: var(--muted); }
.issues:empty { display: none; }

.lp-label { display: block; margin-top: 10px; font-size: 14px; color: var(--muted); }
.lp { font-size: 18px; font-weight: 600; letter-spacing: 0.04em; }
.lp-note { margin-top: 2px; }

.lines { width: 100%; border-collapse: collapse; margin-top: 10px; table-layout: fixed; }
.lines td { padding: 6px 0; vertical-align: top; border-top: 1px solid var(--line); }
.lines .sku-cell { padding-right: 8px; overflow-wrap: anywhere; }
.lines td:nth-child(2) { width: 96px; }
.lines td:nth-child(3) { width: 36px; }
.lines .qty-cell { padding-right: 6px; }
.lines .qty-cell input { width: 100%; text-align: right; padding: 10px 8px; font-size: 18px; }
.lines .rm { width: auto; min-height: 44px; margin: 0; padding: 0 6px; color: var(--muted); }
.lines td.num { width: 64px; }
.lines select { font-size: 15px; }

.check { display: flex; gap: 8px; align-items: flex-start; margin-top: 6px; color: var(--warn); font-size: 14px; }
.check.inline { display: inline-flex; margin: 0 0 0 6px; }
.check input { width: 20px; height: 20px; flex: none; }

.add-line { width: auto; margin: 4px 0; }
.box-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: 10px; }
.box-actions .link-button { width: auto; min-height: 44px; margin: 0; }
.box-result { margin-top: 8px; }
.box-detail { margin-top: 8px; }
.box-detail summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.box-detail pre { white-space: pre-wrap; word-break: break-word; max-height: 240px; overflow: auto; color: var(--muted); }

/* Mode toggle + multi-PO (2026-09-25) */
.mode-tabs { display: flex; gap: 0; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.mode-tab {
  flex: 1; min-height: var(--tap); border: 0; background: transparent; color: var(--muted);
  font: inherit; font-weight: 600; cursor: pointer;
}
.mode-tab.active { background: var(--accent); color: #fff; }
.po-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.po-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 4px 6px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-size: 14px;
}
.chip-x { border: 0; background: transparent; color: var(--muted); font: inherit; min-width: 32px; min-height: 32px; cursor: pointer; }
.start-multi { width: 100%; margin-top: 6px; }
.po-block + .po-block { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.po-block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 8px; }
.po-block-head .link-button { width: auto; min-height: 0; margin: 0; padding: 2px 0; font-size: 14px; }
.po-block .po-progress { margin-top: 8px; }
.add-po-form { margin-top: 14px; }
.po-choose-label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.po-choose { flex: 1; min-width: 0; font-size: 15px; padding: 8px; }
.po-choose.unset { border-color: var(--warn); }
.po-why { margin-top: 2px; }

/* Start with a photo (2026-10-12) */
.photo-start { margin-bottom: 14px; }
.photo-start .capture-row { margin: 10px 0; }
.photo-group { margin: 10px 0; padding-top: 8px; border-top: 1px solid var(--line); }
.photo-po { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.photo-po input { margin-top: 3px; width: 20px; height: 20px; flex: none; }
.photo-po .chip { margin-left: 4px; }
.or-type { margin: 6px 0; }
