/* Bullpen: four-color-process palette, comic-panel borders, big touch targets. */
:root {
  --paper: #ffffff;
  --gutter: #e9edf1;
  --key: #151515;
  --cyan: #0091cf;
  --magenta: #d4006d;
  --yellow: #ffd21f;
  --green: #17944a;
  --muted: #5c6670;
  --rule: 3px solid var(--key);
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: inherit; }
html { height: 100%; }
body {
  margin: 0; min-height: 100%; background: var(--gutter); color: var(--key);
  font: 17px/1.45 var(--font); -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

/* ---------- masthead ---------- */
.masthead {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  background: var(--key); color: var(--paper);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding: 10px 20px;
}
.brand { display: flex; align-items: baseline; gap: 12px; background: none; border: 0; color: inherit; padding: 0; cursor: pointer; }
.brand-name {
  font-weight: 900; font-stretch: 125%; font-size: 1.7rem; letter-spacing: -0.01em;
  background: var(--yellow); color: var(--key); padding: 0 10px; transform: skew(-8deg);
  display: inline-block;
}
.brand-shop { font-stretch: 75%; font-size: 0.95rem; opacity: 0.8; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tab {
  background: transparent; border: 2px solid transparent; color: var(--paper);
  padding: 8px 12px; border-radius: 6px; font-weight: 700; cursor: pointer; font-stretch: 87%;
}
.tab:hover { border-color: #fff4; }
.tab[aria-current="page"] { background: var(--paper); color: var(--key); }

main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 80px; }

/* ---------- panels & type ---------- */
.panel { background: var(--paper); border: var(--rule); border-radius: 4px; padding: 20px; }
.panel + .panel { margin-top: 18px; }
h1, h2, h3 { font-stretch: 112%; line-height: 1.15; margin: 0 0 12px; }
h1 { font-size: 1.9rem; font-weight: 900; }
h2 { font-size: 1.35rem; font-weight: 800; }
h3 { font-size: 1.1rem; font-weight: 800; }
p { margin: 0 0 10px; max-width: 70ch; }
.hint { color: var(--muted); font-size: 0.95rem; }
.error { color: var(--magenta); font-weight: 700; min-height: 1.2em; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.row > * { flex: 1 1 160px; }
.row > .shrink { flex: 0 0 auto; }
.stack > * + * { margin-top: 12px; }
label { display: block; font-weight: 700; font-size: 0.9rem; margin-bottom: 4px; }

input[type=text], input[type=search], input[type=tel], input[type=email], input[type=number],
input[type=password], input[type=date], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; background: var(--paper);
  border: 2px solid var(--key); border-radius: 4px;
}
input.huge {
  font-size: 1.6rem; font-weight: 700; min-height: 68px; padding: 12px 18px; border-width: 3px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px; border: 2px solid var(--key); border-radius: 4px;
  background: var(--paper); font-weight: 800; cursor: pointer; text-decoration: none; color: var(--key);
}
.btn:hover { background: var(--gutter); }
.btn.primary { background: var(--magenta); border-color: var(--magenta); color: #fff; }
.btn.primary:hover { background: #b4005c; }
.btn.go { background: var(--green); border-color: var(--green); color: #fff; }
.btn.big { min-height: 60px; font-size: 1.15rem; padding: 12px 26px; }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: 0.9rem; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.seg { display: inline-flex; border: 2px solid var(--key); border-radius: 4px; overflow: hidden; }
.seg button { border: 0; background: var(--paper); padding: 10px 16px; min-height: 46px; font-weight: 700; cursor: pointer; }
.seg button + button { border-left: 2px solid var(--key); }
.seg button[aria-pressed="true"] { background: var(--key); color: var(--paper); }

/* ---------- status chips ---------- */
.chip {
  display: inline-block; padding: 4px 10px; border-radius: 999px; font-weight: 800; font-size: 0.9rem;
  border: 2px solid var(--key); white-space: nowrap;
}
.chip.paper { background: var(--paper); }
.chip.cyan { background: var(--cyan); border-color: var(--cyan); color: #fff; }
.chip.yellow { background: var(--yellow); border-color: var(--yellow); }
.chip.green { background: var(--green); border-color: var(--green); color: #fff; }
.chip.magenta { background: var(--magenta); border-color: var(--magenta); color: #fff; }
.chip.done { background: var(--gutter); border-color: var(--gutter); color: var(--muted); }

/* ---------- lookup ---------- */
.search-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.customer { margin-top: 18px; }
.customer-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: baseline;
  border-bottom: var(--rule); padding-bottom: 10px; margin-bottom: 6px; }
.customer-name { font-size: 1.6rem; font-weight: 900; font-stretch: 112%; }
.book { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--gutter); }
.book:last-child { border-bottom: 0; }
.book.dim { opacity: 0.55; }
.thumb { width: 64px; height: 88px; object-fit: cover; border: 2px solid var(--key); background: var(--gutter); }
.thumb.empty { display: grid; place-items: center; font-size: 0.7rem; color: var(--muted); text-align: center; }
.book-title { font-weight: 800; font-size: 1.1rem; }
.book-meta { color: var(--muted); font-size: 0.92rem; }
.book-status { text-align: right; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.empty-state { text-align: center; padding: 36px 16px; color: var(--muted); }

/* ---------- intake ---------- */
.book-card { border: 2px solid var(--key); border-radius: 4px; padding: 16px; margin-top: 14px; position: relative; }
.book-card .remove { position: absolute; top: 10px; right: 10px; }
.book-num { font-weight: 900; font-stretch: 112%; margin-bottom: 10px; }
.quote { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center;
  margin-top: 12px; padding: 10px 12px; background: var(--gutter); border-radius: 4px; }
.quote-price { font-size: 1.5rem; font-weight: 900; }
.addon-list { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.addon-list label { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: 1rem; margin: 0; }
.addon-list input[type=number] { width: 70px; min-height: 38px; }
.checkbox { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.checkbox input { width: 22px; height: 22px; }
.total-bar { position: sticky; bottom: 0; margin-top: 18px; background: var(--key); color: var(--paper);
  padding: 14px 18px; border-radius: 4px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  justify-content: space-between; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
.total-bar strong { font-size: 1.6rem; }
.suggest { border: 2px solid var(--key); border-top: 0; max-height: 280px; overflow: auto; background: var(--paper); }
.suggest button { display: block; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--gutter);
  background: var(--paper); padding: 10px 12px; cursor: pointer; }
.suggest button:hover, .suggest button:focus { background: var(--gutter); }
.picked { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px; border: 2px solid var(--green); border-radius: 4px; }
.photo-prev { width: 70px; height: 96px; object-fit: cover; border: 2px solid var(--key); }

/* ---------- product cards (restock / releases) ---------- */
.products { display: grid; gap: 12px; margin-top: 16px; }
.product { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: center;
  background: var(--paper); border: 2px solid var(--key); border-radius: 4px; padding: 10px 12px; }
.product img, .product .thumb { width: 72px; height: 100px; object-fit: cover; border: 1px solid var(--gutter); }
.product-title { font-weight: 800; }
.stock { font-size: 0.95rem; color: var(--muted); }
.stock strong { color: var(--key); font-size: 1.1rem; }
.stepper { display: inline-flex; align-items: center; border: 2px solid var(--key); border-radius: 4px; }
.stepper button { width: 44px; height: 44px; border: 0; background: var(--paper); font-size: 1.4rem; font-weight: 800; cursor: pointer; }
.stepper input { width: 56px; height: 44px; border: 0; border-left: 2px solid var(--key); border-right: 2px solid var(--key);
  text-align: center; font-weight: 800; min-height: 0; border-radius: 0; }
.product-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.date-chips { display: flex; flex-wrap: wrap; gap: 8px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--gutter); vertical-align: middle; }
th { font-size: 0.85rem; color: var(--muted); }
td input { min-height: 40px; }
.table-wrap { overflow-x: auto; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.pos { color: var(--green); font-weight: 800; }
.neg { color: var(--magenta); font-weight: 800; }

/* ---------- pin, toast ---------- */
#pin-gate { position: fixed; inset: 0; background: var(--gutter); display: grid; place-items: center; padding: 16px; z-index: 20; }
#pin-gate[hidden] { display: none; }
.pin-panel { width: min(380px, 100%); }
#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px);
  background: var(--key); color: var(--paper); padding: 14px 20px; border-radius: 4px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: 92vw; z-index: 30; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.bad { background: var(--magenta); }
#toast.has-action { pointer-events: auto; }
.toast-action { margin-left: 12px; background: var(--yellow); color: var(--key); border: 0; border-radius: 4px;
  padding: 6px 12px; font-weight: 800; cursor: pointer; }
.product.flash { border-color: var(--green); box-shadow: 0 0 0 3px var(--green) inset; }
.btn.done { opacity: 0.55; }

@media (max-width: 640px) {
  .book, .product { grid-template-columns: 56px 1fr; }
  .book-status, .product-actions { grid-column: 1 / -1; align-items: stretch; text-align: left; }
  .thumb, .product img { width: 56px; height: 78px; }
}
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }

/* ---------- labels: Rollo, 2" x 1" ---------- */
#print-root { display: none; }
@media print {
  @page { size: 2in 1in; margin: 0; }
  html, body { background: #fff; margin: 0; padding: 0; }
  #app, #toast, #pin-gate { display: none !important; }
  #print-root { display: block; }
  .label {
    width: 2in; height: 0.84in; padding: 0.04in 0.07in; overflow: hidden;
    page-break-after: auto; break-after: auto; page-break-inside: avoid; break-inside: avoid;
    display: flex; flex-direction: column;
    font-family: Arial, Helvetica, sans-serif; color: #000;
  }
  /* Break BEFORE each label after the first. Breaking after each one makes
     iPad/Safari add a blank page between labels. */
  .label + .label { page-break-before: always; break-before: page; }
  :root { padding: 0 !important; }
  html, body { height: auto !important; }
  .label-top { display: flex; justify-content: space-between; gap: 4px; font-size: 7pt; line-height: 1.1; }
  .label-title { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-weight: 700; }
  .label-price { font-weight: 700; font-size: 9pt; white-space: nowrap; }
  .label-bar { flex: 1; display: flex; align-items: flex-end; justify-content: center; min-height: 0; }
  .label-bar svg { max-width: 100%; height: auto; max-height: 100%; }
  .label.tag .label-name { font-size: 11pt; font-weight: 700; line-height: 1.05; white-space: nowrap; overflow: hidden; }
  .label.tag .label-sub { font-size: 7pt; line-height: 1.1; white-space: nowrap; overflow: hidden; }
}

/* ---------- v4: CGC flow ---------- */
.note { color: var(--magenta); font-weight: 700; font-size: 0.92rem; }
.btn.warn { border-color: var(--magenta); color: var(--magenta); }
.lock { margin-top: 10px; padding: 10px 12px; border: 2px solid var(--magenta); border-radius: 4px; background: #fff; }
.lock.open { border-color: var(--green); }
.ship-row, .receive-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center;
  padding: 10px 0; border-top: 1px solid var(--gutter); }
.receive-row { display: grid; grid-template-columns: 64px 1fr minmax(260px, 380px); }
.receive-row.done { opacity: 0.7; }
.receive-controls { display: grid; gap: 8px; }
.receive-controls .row { gap: 8px; }
.box-pick { display: flex; gap: 16px; align-items: baseline; flex-wrap: wrap; width: 100%; text-align: left; margin-top: 10px;
  padding: 14px 16px; border: 2px solid var(--key); border-radius: 4px; background: var(--paper); cursor: pointer; }
.box-pick:hover { background: var(--gutter); }
.sign-screen { max-width: 820px; margin: 0 auto; }
.sign-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--gutter); }
.sign-line.total { font-size: 1.3rem; border-bottom: 0; }
.agreement { background: var(--gutter); padding: 14px; border-radius: 4px; max-width: none; }
.sign-pad { width: 100%; height: auto; aspect-ratio: 900 / 260; border: 3px dashed var(--key); border-radius: 4px; background: #fff; touch-action: none; }
.modal-back { position: fixed; inset: 0; background: #0009; display: grid; place-items: center; padding: 16px; z-index: 40; }
.modal { width: min(900px, 100%); max-height: 90vh; overflow: auto; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 14px; }
.photo-grid figure { margin: 0; }
.photo-grid img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border: 2px solid var(--key); }
.photo-grid figcaption { font-size: 0.8rem; color: var(--muted); margin: 4px 0; }
textarea { width: 100%; padding: 10px 12px; border: 2px solid var(--key); border-radius: 4px; font: inherit; }
@media (max-width: 640px) { .receive-row { grid-template-columns: 56px 1fr; } .receive-controls { grid-column: 1 / -1; } }

/* ---------- printed documents (Epson, letter) ---------- */
@media print {
  .doc { font-family: Arial, Helvetica, sans-serif; color: #000; font-size: 11pt; }
  .doc-head { display: flex; justify-content: space-between; border-bottom: 2pt solid #000; padding-bottom: 8pt; margin-bottom: 12pt; }
  .doc-shop { font-size: 16pt; font-weight: 700; }
  .doc-title { text-align: right; font-size: 14pt; font-weight: 700; }
  .doc-sub { font-size: 11pt; font-weight: 400; }
  .doc-table { width: 100%; border-collapse: collapse; margin: 8pt 0 12pt; }
  .doc-table th, .doc-table td { border-bottom: 0.5pt solid #999; padding: 5pt 6pt; text-align: left; vertical-align: top; }
  .doc-table .num { text-align: right; }
  .doc-total td { font-weight: 700; border-bottom: 0; }
  .doc-small { font-size: 9pt; color: #333; }
  .doc-sign img { width: 3.5in; border-bottom: 1pt solid #000; }
  .doc-balance { font-size: 14pt; font-weight: 700; }
  .doc-barcode { width: 3in; height: auto; margin-top: 6pt; }
  .doc .label, .doc p { page-break-inside: avoid; }
}

/* count check on New releases */
.product.diff { border-color: var(--yellow); box-shadow: 0 0 0 3px var(--yellow) inset; }
.count-bar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center;
  padding: 12px 14px; border: 2px solid var(--yellow); border-radius: 4px; background: #fffbe6; }
.count-bar[hidden] { display: none; }

/* ---------- home tiles ---------- */
.masthead { justify-content: space-between; }
.screen-title { flex: 1; font-weight: 800; font-stretch: 112%; font-size: 1.2rem; }
.home-btn { background: var(--paper); color: var(--key); border: 0; border-radius: 6px; padding: 10px 18px;
  font-weight: 800; font-size: 1.05rem; cursor: pointer; min-height: 44px; }
.home-btn[hidden] { display: none; }
main.home { max-width: 1100px; }
.tile-group + .tile-group { margin-top: 28px; }
.tile-group h2 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 10px; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  min-height: 150px; padding: 18px; background: var(--paper); border: var(--rule); border-radius: 6px; cursor: pointer;
  border-top-width: 10px; transition: transform .08s, box-shadow .08s; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 4px 0 var(--key); }
.tile:active { transform: translateY(0); box-shadow: none; }
.tile.cyan { border-top-color: var(--cyan); }
.tile.magenta { border-top-color: var(--magenta); }
.tile.key { border-top-color: var(--key); }
.tile.soon { opacity: 0.5; cursor: default; }
.tile.soon:hover { transform: none; box-shadow: none; }
.tile-icon svg { width: 40px; height: 40px; fill: none; stroke: var(--key); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tile-title { font-size: 1.3rem; font-weight: 900; font-stretch: 112%; line-height: 1.15; }
.tile-desc { color: var(--muted); font-size: 0.95rem; }
.tile-badge { position: absolute; top: 12px; right: 12px; background: var(--yellow); color: var(--key); font-weight: 800;
  font-size: 0.85rem; padding: 3px 10px; border-radius: 999px; }
.tile-badge[hidden] { display: none; }
@media (max-width: 640px) { .tile-grid { grid-template-columns: 1fr 1fr; } .tile { min-height: 130px; padding: 14px; } .tile-title { font-size: 1.1rem; } .tile-desc { display: none; } }
@media (prefers-reduced-motion: reduce) { .tile { transition: none; } }

/* ---------- count inventory ---------- */
.type-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-toggle { border: 2px solid var(--key); background: var(--paper); border-radius: 999px; padding: 8px 14px; font-weight: 700; cursor: pointer; min-height: 44px; }
.chip-toggle[aria-pressed="true"] { background: var(--key); color: var(--paper); }
.resume { border-color: var(--magenta); }
.count-head .huge { margin-top: 14px; }
.count-totals { font-size: 1.05rem; margin-top: 4px; }
.last-scan { display: grid; grid-template-columns: 90px 1fr; gap: 16px; align-items: center; margin-top: 14px; padding: 14px;
  border: 3px solid var(--green); border-radius: 6px; background: #eefaf2; min-height: 130px; }
.last-scan.empty { display: block; border: 2px dashed var(--muted); background: transparent; color: var(--muted); min-height: 0; }
.last-scan.bad { display: block; border-color: var(--magenta); background: #fdeef5; }
.last-scan img, .last-scan .thumb { width: 90px; height: 124px; object-fit: cover; border: 2px solid var(--key); }
.last-scan.flash { box-shadow: 0 0 0 6px var(--yellow); }
.last-title { font-size: 1.3rem; font-weight: 900; line-height: 1.2; }
.last-nums { display: flex; gap: 22px; margin-top: 8px; font-size: 1.15rem; }
.last-nums strong { font-size: 1.8rem; }
.recent-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--gutter); }
.product.pick { width: 100%; text-align: left; cursor: pointer; grid-template-columns: 72px 1fr; }
.product.review-short { border-color: var(--magenta); }
.product.review-over { border-color: var(--cyan); }
.product.review-missing { border-style: dashed; }

@media (max-width: 640px) {
  .brand-shop { display: none; }
  .masthead { flex-wrap: nowrap; padding: 10px 12px; }
  .screen-title { font-size: 1rem; }
  .product-actions .stepper { width: max-content; }
}

/* ---------- Deliveries ---------- */
.ship-card { flex-direction: column; align-items: stretch; gap: 8px; }
.ship-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ship-card-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.progress { height: 10px; border: 2px solid var(--key); border-radius: 4px; background: var(--paper); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--green); transition: width .2s; }
.progress.big { height: 16px; margin-top: 12px; }
.recv-list { margin-top: 12px; }
.recv-row { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center;
  padding: 10px 12px; border: 2px solid var(--key); border-radius: 4px; margin-top: 8px; background: var(--paper); }
.recv-row.done { opacity: .65; }
.recv-row.over { border-color: var(--yellow); box-shadow: 0 0 0 2px var(--yellow) inset; }
.recv-row.aside { border-style: dashed; }
.recv-row.current { box-shadow: 0 0 0 4px var(--cyan); }
.recv-count { font-size: 1.3rem; font-weight: 900; min-width: 70px; text-align: right; font-variant-numeric: tabular-nums; }
.recv-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.recv-big { font-size: 2.2rem; font-weight: 900; text-align: center; font-variant-numeric: tabular-nums; }
.recv-pick { grid-template-columns: 1fr; }
.recv-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; margin-top: 16px; }
.recv-stat { font-size: 2rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.recv-thumb { width: 44px; height: 60px; object-fit: cover; border: 2px solid var(--key); }
details summary { cursor: pointer; padding: 6px 0; }
@media (max-width: 640px) {
  .recv-row { grid-template-columns: 1fr auto; }
  .recv-actions { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; }
}
.recv-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Count sections: tagging */
.tag-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; padding: 10px 12px;
  border: 2px dashed var(--magenta); border-radius: 10px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip-toggle.small { min-height: 36px; padding: 4px 12px; font-size: 0.9rem; border-style: dashed; }
.chip-toggle.small[aria-pressed="true"] { border-style: solid; background: var(--magenta); border-color: var(--magenta); color: #fff; }

/* Designed tiles: 1280x800 art, locked to 16:10 so it looks the same on every screen */
.tile.art { padding: 0; min-height: 0; aspect-ratio: 16 / 10; overflow: hidden; gap: 0; background: var(--key); }
.tile.art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tile.art .tile-badge { box-shadow: 0 0 0 2px var(--key); }
@media (max-width: 640px) { .tile.art { min-height: 0; padding: 0; } }

/* Back + Home in the header */
.back-btn { margin-right: 8px; }
@media (max-width: 640px) { .home-btn { padding: 8px 12px; font-size: 0.95rem; } .back-btn { margin-right: 6px; } }
.home-btn { white-space: nowrap; flex-shrink: 0; }
@media (max-width: 480px) { .screen-title { display: none; } .masthead { gap: 8px; } }
.back-btn { margin-left: auto; }

/* ---------- Saved counts ---------- */
.count-open { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--gutter); }
.count-open:first-of-type { border-top: 0; }
.product.review-looking { border-color: var(--yellow); box-shadow: 0 0 0 2px var(--yellow) inset; }
.product.review-confirmed, .product.review-zeroed, .product.review-carried { opacity: 0.7; }
.product .stock .chip { margin-right: 4px; }
.product-actions .btn.small { white-space: nowrap; }

/* Label print buttons: wrap onto as many lines as the screen needs (handheld scanner). */
.print-batches { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 100%; min-width: 0; }
.print-batches .btn { flex: 1 1 140px; min-width: 0; }
.print-batches .btn.done { opacity: 1; background: var(--paper); color: var(--green); border-color: var(--green); }
