/* Paper selection is scoped to the print dialog; no direct printer access. */
@media print {
 @page officeA4 {size:A4;margin:14mm}
 @page officeA5 {size:A5;margin:9mm}
 @page officeLetter {size:letter;margin:12mm}
 @page receipt80 {size:80mm 297mm;margin:3mm}
 @page receipt58 {size:58mm 297mm;margin:2mm}
 @page label50 {size:50mm 30mm;margin:1.5mm}
 @page label70 {size:70mm 40mm;margin:2mm}
 body[data-paper="a4"]{page:officeA4}
 body[data-paper="a5"]{page:officeA5}
 body[data-paper="letter"]{page:officeLetter}
 body[data-paper="thermal80"]{page:receipt80;width:74mm}
 body[data-paper="thermal58"]{page:receipt58;width:54mm}
 body[data-paper^="thermal"] .business-document{font-size:9pt;color:black;width:100%;max-width:none}
 body[data-paper^="thermal"] .document-head,body[data-paper^="thermal"] .document-meta{display:block;background:white;padding:0;border-radius:0}
 body[data-paper^="thermal"] .document-head>div:last-child{text-align:center}
 body[data-paper^="thermal"] .document-head{text-align:center;border-bottom:1px dashed black;padding-bottom:8px;margin-bottom:8px}
 body[data-paper^="thermal"] h1{font-size:14pt;margin:5px 0}
 body[data-paper^="thermal"] .doc-title,body[data-paper^="thermal"] h2{font-size:12pt;color:black}
 body[data-paper^="thermal"] .hint{font-size:8pt;color:black}
 body[data-paper^="thermal"] p{margin:5px 0}
 body[data-paper^="thermal"] .document-meta>div{max-width:100%;margin-bottom:8px}
 body[data-paper^="thermal"] .business-logo{max-width:38mm;max-height:18mm}
 body[data-paper^="thermal"] .business-document table,body[data-paper^="thermal"] .business-document tbody{display:block;width:100%}
 body[data-paper^="thermal"] .business-document thead{display:none}
 body[data-paper^="thermal"] .business-document tr{display:grid;grid-template-columns:1fr 1fr;border-bottom:1px dashed #777;padding:5px 0}
 body[data-paper^="thermal"] .business-document td{display:block;padding:2px 0;border:0;font-size:9pt;white-space:normal!important;text-align:left!important}
 body[data-paper^="thermal"] .business-document td:first-child{grid-column:1/-1;font-weight:bold}
 body[data-paper^="thermal"] .business-document td:nth-child(2)::before{content:'Qty: '}
 body[data-paper^="thermal"] .business-document td:nth-child(3)::before{content:'Each: '}
 body[data-paper^="thermal"] .business-document td:nth-child(4)::before{content:'Discount: '}
 body[data-paper^="thermal"] .business-document td:nth-child(5)::before{content:'Amount: '}
 body[data-paper^="thermal"] .total-box{width:100%;font-size:9pt}
 body[data-paper^="thermal"] .total-row{gap:4px}
 body[data-paper^="thermal"] .document-signatures{display:none}
 body[data-paper^="thermal"] .document-footer,body[data-paper^="thermal"] .document-terms{font-size:8pt;margin-top:10px;padding-top:8px}
 body[data-paper="label50"]{page:label50}
 body[data-paper="label70"]{page:label70}
 body[data-paper^="label"] .label-grid{display:block}
 body[data-paper^="label"] .product-label{border:0;padding:0;break-after:page;height:auto;overflow:hidden}
 body[data-paper^="label"] .product-label:last-child{break-after:auto}
 body[data-paper="label50"] .product-label{width:47mm;max-height:27mm}
 body[data-paper="label70"] .product-label{width:66mm;max-height:36mm}
 body[data-paper^="label"] .product-label strong{font-size:8pt;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 body[data-paper^="label"] .product-label .price{font-size:9pt;margin:1mm}
 body[data-paper^="label"] .product-label svg{height:16mm;max-width:100%}
}
.barcode-svg{max-width:100%;height:70px;display:block;margin:auto;background:white}
.label-controls{display:flex;gap:16px;align-items:end;flex-wrap:wrap;margin:18px 0}
.product-label{break-inside:avoid}

@media print{body[data-paper^="label"] .product-label>span{display:none}body[data-paper^="label"] .product-label .price{margin:0;font-size:8pt}body[data-paper^="label"] .product-label svg{height:18mm}body[data-paper^="label"] .product-label strong{line-height:1.15}}
@media screen{
 body[data-paper^="thermal"] .business-document{max-width:420px;margin:20px auto;font-size:14px}
 body[data-paper^="thermal"] .document-head,body[data-paper^="thermal"] .document-meta{display:block;text-align:left}
 body[data-paper^="thermal"] .business-document table,body[data-paper^="thermal"] .business-document tbody{display:block;width:100%}
 body[data-paper^="thermal"] .business-document thead{display:none}
 body[data-paper^="thermal"] .business-document tr{display:grid;grid-template-columns:1fr 1fr;gap:5px;border-bottom:1px dashed #8a969c;padding:10px 0}
 body[data-paper^="thermal"] .business-document td{display:block;padding:2px 0;border:0;white-space:normal;text-align:left}
 body[data-paper^="thermal"] .business-document td:first-child{grid-column:1/-1;font-weight:700}
 body[data-paper^="thermal"] .business-document td:nth-child(2)::before{content:'Qty: '}
 body[data-paper^="thermal"] .business-document td:nth-child(3)::before{content:'Each: '}
 body[data-paper^="thermal"] .business-document td:nth-child(4)::before{content:'Discount: '}
 body[data-paper^="thermal"] .business-document td:nth-child(5)::before{content:'Amount: '}
}

.product-print-photo{display:none;margin:0 0 6px;width:64px;max-width:100%}
body[data-product-photos="on"] .product-print-photo{display:block}
.product-print-photo img{display:block;width:64px;height:64px;object-fit:contain;background:white;border:1px solid #e3e8eb;border-radius:4px}
.product-print-photo img[hidden],.photo-unavailable[hidden]{display:none}
.photo-unavailable{font-size:10px;font-weight:normal;color:#555}
@media print{.product-print-photo{width:18mm;break-inside:avoid}.product-print-photo img{width:18mm;height:18mm;border:0;border-radius:0}body[data-paper^="thermal"] .product-print-photo,body[data-paper^="thermal"] .product-print-photo img{width:15mm}body[data-paper^="thermal"] .product-print-photo img{height:15mm}}
