/* ============================================================
   QR labels. On screen: a toolbar over a preview sheet.
   In print: 3 by 7 labels on A4 / Letter, nothing else.
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body.lb { background: var(--bg-secondary); color: var(--text-primary); font: 14px/1.45 var(--font-body); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.lb-bar {
  position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: auto 1fr auto; gap: 6px 24px; align-items: center;
  padding: 16px 24px; background: var(--bg-card); border-bottom: 1px solid var(--border-color);
}
.lb-bar__back { font: 700 13px/1 var(--font-body); color: var(--accent); text-decoration: none; }
.lb-bar__back::before { content: "\2190  "; }
.lb-bar__text h1 { margin: 0; font-size: 18px; }
.lb-bar__text p { margin: 2px 0 0; font-size: 13px; color: var(--text-secondary); max-width: 60ch; }
.lb-bar__controls { display: flex; align-items: flex-end; gap: 8px; }
.lb-bar__controls label { display: flex; flex-direction: column; gap: 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-tertiary); }
.lb-bar__controls select { min-width: 200px; padding: 8px 10px; border-radius: var(--radius-md); border: 1px solid var(--border-strong); background: var(--bg-primary); color: var(--text-primary); font: 500 13px var(--font-body); text-transform: none; letter-spacing: 0; }
.lb-bar__controls button { padding: 9px 16px; border: 0; border-radius: var(--radius-md); background: var(--accent); color: var(--accent-ink); font: 600 13px var(--font-body); cursor: pointer; }
.lb-bar__count { grid-column: 2 / -1; margin: 0; font: 400 12px var(--font-mono); color: var(--text-tertiary); }
.lb-loading { grid-column: 1 / -1; text-align: center; color: var(--text-tertiary); }

.lb-sheet {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  max-width: 900px; margin: 24px auto; padding: 24px; background: #fff; box-shadow: var(--shadow-pop); border-radius: 4px;
}
.lb-label {
  display: flex; align-items: center; gap: 10px; padding: 10px; min-height: 118px;
  border: 1px dashed #c8c8c4; border-radius: 6px; background: #fff; color: #111; break-inside: avoid;
}
.lb-label__qr { flex: none; width: 88px; height: 88px; }
.lb-label__qr svg { display: block; width: 100%; height: 100%; }
.lb-label__text { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.lb-label__id { font: 600 16px/1.15 var(--font-mono); letter-spacing: -0.01em; }
.lb-label__name { font-size: 11.5px; font-weight: 600; line-height: 1.25; }
.lb-label__where { font-size: 10px; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-label__cta { margin-top: 4px; font-size: 8.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #E85D2D; }

@media (max-width: 760px) {
  .lb-bar { grid-template-columns: 1fr; padding: 14px 16px; }
  .lb-bar__count { grid-column: 1; }
  .lb-bar__controls { flex-wrap: wrap; }
  .lb-bar__controls label { flex: 1; }
  .lb-bar__controls select { min-width: 0; width: 100%; }
  .lb-sheet { grid-template-columns: repeat(2, 1fr); margin: 12px 16px; padding: 12px; }
}

@page { size: auto; margin: 10mm; }
@media print {
  body.lb { background: #fff; }
  .lb-bar { display: none; }
  .lb-sheet { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3mm; max-width: none; margin: 0; padding: 0; box-shadow: none; }
  .lb-label { height: 36mm; min-height: 0; border: 0.3mm dashed #999; }
  .lb-label:nth-child(21n) { break-after: page; }
}
