/* Etykiety: podgląd na ekranie i wydruk. Rozmiary w mm (z JS), kody kreskowe zawsze czarne na białym. */
.label-preview { background: #eef1f6; border-radius: 12px; padding: 14px; overflow: auto; max-height: 52vh; }
.label-preview .label-page { transform-origin: top left; }
.label-page { display: grid; background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .15); margin-bottom: 12px; }
.label-page.sheet { width: 210mm; min-height: 297mm; align-content: start; }
.label-page.roll { display: block; }
.label-page .label { box-sizing: border-box; padding: 1.5mm 2mm; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; overflow: hidden; background: #fff; color: #000; break-inside: avoid; }
.label-title { font: 700 9pt/1.15 var(--font); max-height: 2.4em; overflow: hidden; width: 100%; }
.label-sub { font: 400 7pt/1.2 var(--font); color: #000; }
.label-bars { width: 100%; display: flex; justify-content: center; }
.label-bars svg { max-width: 100%; height: auto; }
.label-print-root { display: none; }

/* Rozmiary papieru jako nazwane strony (CSP nie pozwala wstrzykiwać <style> w locie). Klucze muszą zgadzać się z FORMATS w labels.js
   (pilnuje tego test-labels.mjs). Obsługa: Chrome/Edge 85+, Firefox 110+, Safari 17.4+. */
@page a4 { size: A4; margin: 0; }
@page roll-50x30 { size: 50mm 30mm; margin: 0; }
@page roll-100x50 { size: 100mm 50mm; margin: 0; }
@page roll-100x150 { size: 100mm 150mm; margin: 0; }
.f-a4-3x8, .f-a4-4x11, .f-a4-2x4 { page: a4; }
.f-roll-50x30 { page: roll-50x30; }
.f-roll-100x50 { page: roll-100x50; }
.f-roll-100x150 { page: roll-100x150; }

@media print {
  body > *:not(.label-print-root) { display: none !important; }
  body.printing-labels > *:not(.label-print-root) { display: none !important; }
  .label-print-root { display: block !important; position: static; }
  .label-print-root .label-page { box-shadow: none; margin: 0; break-after: page; page-break-after: always; }
  .label-print-root .label-page:last-child { break-after: auto; page-break-after: auto; }
  .label-print-root .label-page.sheet { width: 210mm; height: 297mm; min-height: 0; overflow: hidden; }
  dialog { display: none !important; }
}
