/* Barcode app: a big, touch-friendly scanner screen. Colours come from tokens.css (light and dark).
   The label sheet is a preview of paper, so it keeps black ink on white in both themes. */
.bc-shell {
  --bc-touch: 48px;
  max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--space-3);
}
.bc-labels-layout {
  --bc-paper: #ffffff;
  --bc-ink: #000000;
  --bc-label-edge: #bbbbbb;
  --bc-label-edge-print: #dddddd;
}
.bc-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.bc-title { font-size: var(--text-xl); font-weight: var(--weight-semibold); text-align: center; flex: 1; min-width: 0; overflow-wrap: anywhere; margin: 0; }
.bc-back { width: var(--bc-touch); height: var(--bc-touch); border-radius: var(--radius-lg); font-size: var(--text-2xl); padding: 0;
  display: inline-flex; align-items: center; justify-content: center; flex: none; }
/* the camera button: icon plus the word, so it is clear without guessing */
.bc-cam { min-height: var(--bc-touch); border-radius: var(--radius-lg); padding: 0 var(--space-4); display: inline-flex; align-items: center; gap: var(--space-2); flex: none; }
.bc-cam-ic { display: inline-flex; line-height: 0; }
.bc-cam svg { width: 20px; height: 20px; }
.bc-flash { border-radius: var(--radius-lg); padding: 0 var(--space-4); font-weight: var(--weight-semibold); transition: max-height var(--motion-fast) var(--ease), padding var(--motion-fast) var(--ease);
  overflow: hidden; max-height: 0; }
.bc-flash.ok, .bc-flash.err { max-height: 120px; padding: var(--space-3) var(--space-4); }
.bc-flash.ok { background: var(--color-success-subtle); color: var(--color-success-strong); }
.bc-flash.err { background: var(--color-danger-subtle); color: var(--color-danger-strong); }
.bc-home { display: flex; flex-direction: column; gap: var(--space-4); }
.bc-scan-hint { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-5) var(--space-4);
  border: 2px dashed var(--color-border-strong); border-radius: var(--radius-lg); text-align: center; }
.bc-scan-icon { width: 72px; height: 72px; color: var(--color-primary); }
.bc-scan-icon svg { width: 100%; height: 100%; }
.bc-scan-text { font-size: var(--text-lg); margin: 0; }
.bc-manual-row { display: flex; justify-content: center; width: 100%; }
.bc-manual-row .field, .bc-loc .field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; width: 100%; max-width: 420px; text-align: start; margin: 0; }
.bc-manual-row .field .field-hint { margin-top: 2px; }
.bc-loc .field { max-width: none; }
.bc-manual-row .field > label, .bc-loc .field > label { font-weight: var(--weight-semibold); }
.bc-manual { width: 100%; font-size: var(--text-lg); min-height: var(--bc-touch); padding: var(--space-2) var(--space-3); text-align: center; }
.bc-menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: var(--space-3); }
.bc-tile { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); padding: var(--space-4); border-radius: var(--radius-lg); text-align: start; height: auto; min-height: var(--bc-touch); }
.bc-list { display: flex; flex-direction: column; gap: var(--space-2); }
.bc-row { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-lg);
  text-align: start; height: auto; min-height: var(--bc-touch); width: 100%; }
.bc-count { min-width: 34px; height: 34px; border-radius: var(--radius-pill); background: var(--color-primary); color: var(--color-text-on-primary);
  display: flex; align-items: center; justify-content: center; font-weight: var(--weight-semibold); padding: 0 var(--space-3); }
.bc-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.bc-actions > button { min-height: var(--bc-touch); }
.bc-wide { flex: 1; font-size: var(--text-lg); }
.bc-wide.pulse { box-shadow: var(--focus-ring); }
.bc-pick-head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
.bc-pick-name { font-size: var(--text-lg); font-weight: var(--weight-semibold); }
.bc-lines { display: flex; flex-direction: column; gap: var(--space-2); }
.bc-line { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg);
  border: 1px solid var(--color-border); border-inline-start: 5px solid var(--color-border); background: var(--color-surface); color: var(--color-text); }
.bc-line.full, .bc-line.counted { border-inline-start-color: var(--color-success); }
.bc-line.over { border-inline-start-color: var(--color-warning); }
.bc-line.hit { box-shadow: 0 0 0 2px var(--color-primary); }
.bc-line-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.bc-qty { font-size: var(--text-lg); text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bc-steps { display: flex; gap: var(--space-2); }
.bc-steps button { width: var(--bc-touch); height: var(--bc-touch); font-size: var(--text-2xl); padding: 0; border-radius: var(--radius-lg); }
.bc-loc .field { margin: 0; }
.bc-product-head { display: flex; gap: var(--space-4); align-items: center; }
.bc-product-head img { width: 84px; height: 84px; object-fit: cover; border-radius: var(--radius-lg); }
.bc-big { font-size: 32px; font-weight: 700; margin: var(--space-3) 0; font-variant-numeric: tabular-nums; }
#bc-camera {
  --bc-camera-bg: #000000;
  --bc-aim: rgba(255, 255, 255, .85);
  position: relative; display: flex; flex-direction: column; gap: var(--space-2); }
#bc-camera video { width: 100%; max-height: 60vh; background: var(--bc-camera-bg); border-radius: var(--radius-lg); object-fit: cover; }
.bc-aim { position: absolute; left: 12%; right: 12%; top: 38%; height: 18%; border: 2px solid var(--bc-aim); border-radius: var(--radius-md); pointer-events: none; }
.bc-cam-status { color: var(--color-text-muted); font-size: var(--text-sm); }
.bc-cam-status.err { color: var(--color-danger-strong); }
/* labels */
.bc-labels-layout { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: var(--space-4); align-items: start; }
.bc-labels-tools { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.bc-sheet-wrap { background: var(--bc-paper); color: var(--bc-ink); padding: var(--space-3); border-radius: var(--radius-md); border: 1px solid var(--color-border); overflow: auto; }
.bc-sheet { display: grid; gap: var(--space-2); }
.bc-sheet.small { grid-template-columns: repeat(4, 1fr); }
.bc-sheet.medium { grid-template-columns: repeat(3, 1fr); }
.bc-sheet.large { grid-template-columns: repeat(2, 1fr); }
.bc-label { border: 1px dashed var(--bc-label-edge); padding: var(--space-2); text-align: center; break-inside: avoid; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.bc-label-name { font-size: 11px; font-weight: var(--weight-semibold); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-svg { width: 100%; }
.bc-bars { width: 100%; height: 42px; display: block; }
.bc-sheet.large .bc-bars { height: 60px; }
.bc-sheet.small .bc-bars { height: 32px; }
.bc-label-code { font: 11px/1.2 var(--font-mono); letter-spacing: 1px; }
.bc-label-price { font-size: var(--text-xs); font-weight: 700; }
.bc-sheet .bc-warn { color: var(--bc-ink); font-size: var(--text-xs); font-weight: var(--weight-semibold); }
@media (max-width: 800px) {
  .bc-labels-layout { grid-template-columns: 1fr; }
  .bc-qty { font-size: var(--text-md); }
  .bc-sheet.small { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .bc-line { flex-wrap: wrap; }
  .bc-line-main { flex-basis: 100%; }
  .bc-qty { flex: 1; text-align: start; }
  .bc-sheet.small, .bc-sheet.medium { grid-template-columns: repeat(2, 1fr); }
}
@media print {
  .bc-labels-layout { display: block; }
  .bc-sheet-wrap { border: none; padding: 0; }
  .bc-label { border-color: var(--bc-label-edge-print); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
