/* Documents use the printer's paper length. An 80mm roll has a 72mm content area. */
.business-document{box-sizing:border-box;background:#fff;color:#111;font-family:Arial,Helvetica,sans-serif;font-size:11pt;line-height:1.35;padding:4mm;margin:0 auto;text-align:left;overflow-wrap:anywhere;font-weight:400;}
.business-document.paper-58mm{width:58mm;max-width:100%;}
.business-document.paper-80mm{width:80mm;max-width:100%;}
.business-document.paper-a4{width:186mm;max-width:100%;padding:6mm;}
.business-document.paper-custom{width:var(--paper-width,80mm);min-height:var(--paper-height,200mm);max-width:100%;}
.business-document *{box-sizing:border-box;}
.document-header{text-align:center;display:block;margin:0 0 3mm;padding:0;border:0;}
.document-logo{display:block;object-fit:contain;width:auto;height:auto;max-width:45mm;max-height:22mm;filter:grayscale(1);margin:0 auto 2mm;}
.document-business{font-size:14pt;line-height:1.2;margin:0 0 1.5mm;font-weight:800;}
.document-address{font-size:9pt;line-height:1.35;white-space:pre-line;margin:0 0 3mm;}
.document-title{font-size:12pt;letter-spacing:.03em;margin:3mm 0 1mm;border-top:1px solid #111;padding-top:3mm;}
.document-number{display:block;font-size:16pt;letter-spacing:.03em;}
.document-date{font-size:9pt;margin:1mm 0;}
.document-details{font-size:10pt;margin:0 0 3mm;}
.document-details>div{display:flex;align-items:baseline;justify-content:space-between;gap:3mm;margin:1mm 0;}
.document-details dt{font-weight:400;flex:0 0 auto;}
.document-details dd{margin:0;text-align:right;font-weight:600;}
.document-lines{border-collapse:collapse;width:100%;table-layout:fixed;font-size:11pt;}
.document-lines th{text-align:left;color:#111;font-size:9pt;font-weight:bold;border-top:1px solid #111;border-bottom:1px solid #111;padding:1.5mm 0;white-space:normal;}
.document-lines th:last-child,.document-lines .line-amount{text-align:right;width:27mm;}
.document-lines td{vertical-align:top;white-space:normal;padding:2mm 0;border-bottom:1px dashed #aaa;}
.document-lines td:first-child{padding-right:2mm;}
.document-lines small{display:block;font-size:9pt;margin-top:.5mm;}
.document-lines .line-amount{font-variant-numeric:tabular-nums;}
/* Only a statement amount cell holds lines ("Charge", "Applied", "Balance"); on A4 its column needs room for the longest. */
.business-document.paper-a4 .document-lines:has(.line-amount>*) th:last-child,.business-document.paper-a4 .document-lines .line-amount:has(>*){width:48mm;}
/* On a roll the label may wrap above its number; a number never splits. 80 mm gives the column room for the number (36 mm); 58 mm sizes it to the number and lets the transaction column wrap. */
.document-lines td.line-amount:has(>*){white-space:normal;}
.business-document.paper-80mm .document-lines:has(.line-amount>*) th:last-child,.business-document.paper-80mm .document-lines .line-amount:has(>*){width:36mm;}
.document-lines:has(.line-amount>*) td:first-child,.business-document.paper-80mm .document-lines:has(.line-amount>*) th{overflow-wrap:break-word;}
/* 58 mm: a total or balance label keeps its words whole; when the label and the amount do not fit side by side, the amount moves to its own line. */
.business-document.paper-58mm .document-total,.business-document.paper-58mm .document-balance{flex-wrap:wrap;}
.business-document.paper-58mm .document-total>*:first-child,.business-document.paper-58mm .document-balance>*:first-child{overflow-wrap:break-word;}
.business-document.paper-58mm .document-total>*:last-child,.business-document.paper-58mm .document-balance>*:last-child{margin-left:auto;}
.kitchen-document .document-lines th:first-child{width:13mm;}
.kitchen-document .document-lines th:last-child{text-align:left;width:auto;}
.kitchen-document .document-lines td{font-size:13pt;}
.kitchen-document .kitchen-qty{font-size:18pt;font-weight:800;width:13mm;}
/* The narrow quantity column belongs to the two-column (unpriced) delivery note; a priced A4 note has five columns. */
.delivery-document .document-lines:not(.priced-lines) th:first-child{width:13mm;}.delivery-document .document-lines:not(.priced-lines) th:last-child{text-align:left;width:auto;}.delivery-document .delivery-qty{font-weight:700;font-size:13pt;width:13mm;}
/* Off A4 a priced delivery note uses the invoice's two columns (Item, Amount); the narrow quantity column above is only
   for the unpriced note, so here the item takes the width and the amount column is sized as on an invoice. */
.business-document.delivery-document:not(.paper-a4) .document-lines:not(:has(.delivery-qty)) th:first-child{width:auto;}
.business-document.delivery-document:not(.paper-a4) .document-lines:not(:has(.delivery-qty)) th:last-child{text-align:right;width:27mm;}
/* 58 mm priced lines (invoice, quote, order, credit note, priced delivery note): the item name takes its own full-width
   row, with the quantity x price and the amount on the row below. A number never splits; a long one moves to its own line. */
.business-document.paper-58mm .document-lines:has(td:first-child>strong+small):not(:has(.line-amount>*,.delivery-qty,.kitchen-qty)),.business-document.paper-58mm .document-lines:has(td:first-child>strong+small):not(:has(.line-amount>*,.delivery-qty,.kitchen-qty)) :is(thead,tbody){display:block;}
.business-document.paper-58mm .document-lines:has(td:first-child>strong+small):not(:has(.line-amount>*,.delivery-qty,.kitchen-qty)) tr{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:2mm;}
.business-document.paper-58mm .document-lines:has(td:first-child>strong+small):not(:has(.line-amount>*,.delivery-qty,.kitchen-qty)) tr:has(th){column-gap:0;}
.business-document.paper-58mm .document-lines:has(td:first-child>strong+small):not(:has(.line-amount>*,.delivery-qty,.kitchen-qty)) th{flex:1 1 auto;width:auto;}
.business-document.paper-58mm .document-lines:has(td:first-child>strong+small):not(:has(.line-amount>*,.delivery-qty,.kitchen-qty)) td{border-bottom:0;padding-bottom:0;}
.business-document.paper-58mm .document-lines:has(td:first-child>strong+small):not(:has(.line-amount>*,.delivery-qty,.kitchen-qty)) td:first-child{display:contents;}
.business-document.paper-58mm .document-lines:has(td:first-child>strong+small):not(:has(.line-amount>*,.delivery-qty,.kitchen-qty)) td:first-child>strong{flex:0 0 100%;padding-top:2mm;overflow-wrap:break-word;}
.business-document.paper-58mm .document-lines:has(td:first-child>strong+small):not(:has(.line-amount>*,.delivery-qty,.kitchen-qty)) td:first-child>small{flex:1 1 0;margin:0;overflow-wrap:normal;}
.business-document.paper-58mm .document-lines:has(td:first-child>strong+small):not(:has(.line-amount>*,.delivery-qty,.kitchen-qty)) td.line-amount{flex:0 0 auto;width:auto;margin-left:auto;padding:0;}
.business-document.paper-58mm .document-lines:has(td:first-child>strong+small):not(:has(.line-amount>*,.delivery-qty,.kitchen-qty)) tbody tr{padding-bottom:2mm;border-bottom:1px dashed #aaa;}
/* Off A4 the unpriced delivery note's quantity never splits ("1,300"); on 80 mm its column is a little wider. */
.business-document.delivery-document:not(.paper-a4) .delivery-qty{white-space:nowrap;}
.business-document.delivery-document:not(.paper-a4):not(.paper-58mm) .document-lines:has(.delivery-qty) th:first-child{width:17mm;}
.delivery-document .document-details dd{white-space:pre-line;}.document-signatures{margin:5mm 0 2mm;break-inside:avoid;page-break-inside:avoid;font-size:9pt;}.document-signatures>div{display:flex;align-items:flex-end;gap:3mm;min-height:9mm;}.document-signatures .signature-blank{flex:1;min-width:20mm;min-height:6mm;border-bottom:1px solid #555;}
.document-notes{margin-top:3mm;font-size:11pt;white-space:pre-line;}
.document-notes p{margin:1mm 0;}
.document-total,.document-balance{display:flex;justify-content:space-between;gap:2mm;margin-top:3mm;align-items:baseline;font-size:12pt;}
.document-balance{font-size:10pt;}
/* Money never breaks inside a number on a narrow roll: the label wraps, the amount stays whole. */
.document-total>*:first-child,.document-balance>*:first-child{flex:1 1 auto;min-width:0;}
.document-total>*:last-child,.document-balance>*:last-child,.document-lines .line-amount{white-space:nowrap;overflow-wrap:normal;flex:0 0 auto;font-variant-numeric:tabular-nums;}
/* 58 mm rolls have a 50 mm content area: tighter type, amount column sized to its number. */
.business-document.paper-58mm{font-size:10pt;}
.business-document.paper-58mm .document-business{font-size:12pt;}
.business-document.paper-58mm .document-number{font-size:13pt;}
.business-document.paper-58mm .document-title{font-size:11pt;}
.business-document.paper-58mm .document-lines{font-size:10pt;table-layout:auto;}
.business-document.paper-58mm .document-lines th:last-child,.business-document.paper-58mm .document-lines .line-amount{width:auto;padding-left:2mm;}
.business-document.paper-58mm .document-total{font-size:11pt;}
.business-document.paper-58mm .document-details{font-size:9pt;}
.document-footer{display:block;text-align:center;margin:4mm 0 0;padding:3mm 0 0;border-top:1px dashed #555;font-size:9pt;line-height:1.35;white-space:pre-line;}
.document-footer p{margin:0 0 1mm;}.document-footer small{font-size:8pt;}
.print-sample{text-align:center;font-weight:800;border:2px solid #111;padding:2mm;font-size:10pt;margin:0 0 3mm;}
.print-settings-layout{display:grid;grid-template-columns:minmax(280px,1fr) minmax(300px,1fr);gap:28px;align-items:start;}
.print-settings-layout label{margin-bottom:14px;}.print-settings-layout textarea{min-height:90px;resize:vertical;}
.print-preview-area{background:#e9edf1;padding:20px;max-height:720px;overflow:auto;border-radius:12px;}
.print-preview-area .business-document{box-shadow:0 3px 18px #1828391a;}
.print-settings-toggles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
.print-logo-preview{display:flex;align-items:center;justify-content:center;min-height:70px;border:1px dashed #c8d0d8;border-radius:8px;padding:10px;margin:10px 0;}
.print-logo-preview img{max-width:200px;max-height:90px;object-fit:contain;}
#ticketDialog{width:min(570px,96vw);}#ticketContent{background:#e9edf1;padding:14px;border-radius:10px;max-height:65vh;overflow:auto;}
#ticketDialog:has(.paper-a4),#ticketDialog:has(.paper-custom){width:min(860px,96vw);}
@media(max-width:850px){.print-settings-layout{grid-template-columns:minmax(0,1fr)}.print-settings-layout>*,.print-settings-layout input,.print-settings-layout select,.print-settings-layout textarea{min-width:0;max-width:100%}.print-preview-area{max-height:550px;}.print-settings-toggles{grid-template-columns:1fr}}
@media print{
 @page{size:auto;margin:0;}
 html,body{margin:0!important;padding:0!important;background:#fff!important;min-width:0!important;}
 body>main,body>dialog{display:none!important;}
 #printTicket{display:block!important;width:80mm!important;max-width:100%!important;margin:0!important;padding:0!important;}
 body.printing-58mm #printTicket{width:58mm!important;}
 body.printing-a4 #printTicket{width:100%!important;}
 body.printing-custom #printTicket{width:var(--paper-width,80mm)!important;min-height:var(--paper-height,200mm)!important;}
 #printTicket .business-document{margin:0!important;box-shadow:none!important;}
 #printTicket .paper-a4{width:100%!important;padding:0!important;}
 #printTicket .paper-custom{width:100%!important;padding:0!important;}
 #printTicket .document-header{break-inside:avoid;}
 #printTicket .document-lines tr,#printTicket .document-total,#printTicket .document-balance,#printTicket .document-footer{break-inside:avoid;page-break-inside:avoid;}
 /* Notes stay in one piece in the Standard look on a roll; designs (and Standard on A4) decide for themselves, so a long
    note may continue on the next page instead of leaving a large gap (H, M). */
 #printTicket .document-notes:not(:where(.business-document[class*=" design-"] .document-notes)){break-inside:avoid;page-break-inside:avoid;}
 /* Roll and standard documents only: a document design (.design-*) sets its own table and heading sizes. :where()
    keeps these rules' weight unchanged for everything they applied to before. */
 #printTicket table:not(:where(.business-document[class*=" design-"] table)){font-size:11pt;}#printTicket td:not(:where(.business-document[class*=" design-"] td,.business-document.paper-a4 .document-lines td)){padding:2mm 0;}#printTicket td:first-child:not(:where(.business-document[class*=" design-"] td,.business-document.paper-a4 .document-lines td)){padding-right:2mm;}
 body.printing-58mm #printTicket table{font-size:10pt;}
 #printTicket h2:not(:where(.business-document[class*=" design-"] h2)){font-size:12pt;}
}
.sales-document-preview{background:#f5f7f9;border:1px solid #dfe5ea;border-radius:12px;padding:14px;}
.sales-document-preview-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin:0 0 12px;}
.sales-document-preview-heading h3{margin:0 0 3px;font-size:1.05rem;}
.sales-document-preview-heading p{margin:0;}
.sales-document-preview-status{display:inline-flex;max-width:45%;padding:5px 8px;border-radius:999px;background:#e7f4ee;color:#176b4a;font-size:.78rem;font-weight:700;text-align:right;}
.sales-document-preview-meta{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px 14px;margin:0 0 14px;padding:10px 12px;background:#fff;border:1px solid #e5e9ed;border-radius:8px;font-size:.85rem;}
.sales-document-preview-meta-row{min-width:0;display:flex;flex-direction:column;gap:2px;}
.sales-document-preview-meta-row dt{color:#6a7885;font-size:.75rem;}
.sales-document-preview-meta-row dd{margin:0;font-weight:600;overflow-wrap:anywhere;}
.sales-document-preview-paper{box-shadow:0 3px 18px #1828391a;}
@media(max-width:700px){.sales-document-preview-header{display:block}.sales-document-preview-status{max-width:100%;margin-top:8px}.sales-document-preview-meta{grid-template-columns:repeat(2,minmax(0,1fr));}}
.business-document.paper-a4 .document-lines th,.business-document.paper-a4 .document-lines td{padding-left:2mm;padding-right:2mm;}
.business-document.paper-a4 .document-lines th:first-child,.business-document.paper-a4 .document-lines td:first-child{padding-left:0;}
.business-document.paper-a4 .document-lines th:last-child,.business-document.paper-a4 .document-lines td:last-child{padding-right:0;}
.refund-document.paper-a4 .document-title{font-size:16pt;letter-spacing:.08em;margin-top:4mm;}
.refund-document.paper-a4 .document-number{font-size:10pt;letter-spacing:0;font-weight:600;margin:2mm 0;}
.refund-document.paper-a4 .document-details{margin:5mm 0;}
.refund-document.paper-a4 .document-lines th:first-child{width:38%;}
.refund-document.paper-a4 .document-lines th:nth-child(2){width:10%;}
.refund-document.paper-a4 .document-lines th:nth-child(3),.refund-document.paper-a4 .document-lines th:nth-child(4){width:17%;}
.refund-document.paper-a4 .document-lines th:last-child{width:18%;}
.refund-document.paper-a4 .document-total{border-top:2px solid #111;border-bottom:1px solid #111;padding:3mm 0;margin:5mm 0 0;font-size:15pt;}
.workspace-report-print{background:#fff;color:#111;font:9pt/1.35 Arial,Helvetica,sans-serif;overflow-wrap:anywhere;}
.workspace-report-print h1{font-size:18pt;margin:0 0 4mm;}.workspace-report-print h2{font-size:11pt;margin:5mm 0 2mm;}
.report-print-metadata{display:grid;grid-template-columns:1fr 1fr;gap:1mm 8mm;margin:0 0 4mm;}
.report-print-metadata>div{display:grid;grid-template-columns:38mm 1fr;gap:2mm;}.report-print-metadata dt{font-weight:bold;}.report-print-metadata dd{margin:0;}
.report-print-notes ul{padding-left:5mm;margin:0 0 4mm;}.report-print-notes li{margin:0 0 1mm;}
.workspace-report-print table{width:100%;table-layout:fixed;border-collapse:collapse;margin-bottom:5mm;}
.workspace-report-print th,.workspace-report-print td{text-align:left;vertical-align:top;white-space:normal;overflow-wrap:anywhere;border:1px solid #aaa;padding:2mm;font-weight:normal;}
.workspace-report-print th{font-weight:bold;background:#f0f0f0;}.workspace-report-print .report-print-item-column{width:34mm;}.workspace-report-print .report-print-code-column{width:20mm;}.workspace-report-print .report-print-unit-column{width:17mm;}
.workspace-report-print .report-print-identity th{background:#fff;font-weight:normal;line-height:1.4;}.report-print-identity-title{display:block;font-size:11pt;margin-bottom:1mm;}
.workspace-report-print .report-number{text-align:right;font-variant-numeric:tabular-nums;}.report-print-totals td{font-weight:bold;border-top:2px solid #333;}
/* Optional report print styling (report-output.js renderPrint, stock balances): column bands, emphasised totals, block
   starts and a bold grand-total row. Reports that set none of these print as before. */
.workspace-report-print .report-print-bands th{background:#fff;font-size:8pt;letter-spacing:.06em;text-transform:uppercase;color:#333;border-bottom:1px solid #333;}
.workspace-report-print .report-print-bands th:not(.report-print-band){border-top-color:#fff;border-left-color:#fff;}
.workspace-report-print .report-print-emphasis{font-weight:bold;background:#eef2f5;-webkit-print-color-adjust:exact;print-color-adjust:exact;}
.workspace-report-print th.report-print-emphasis{background:#e3e9ee;}
.workspace-report-print .report-print-group-start{border-left:2px solid #333;}
.workspace-report-print .report-print-extra th,.workspace-report-print .report-print-extra td{font-weight:bold;border-top:2px solid #333;background:#eef2f5;-webkit-print-color-adjust:exact;print-color-adjust:exact;}
@media print{
 @page workspace-report{size:A4 landscape;margin:10mm;}
 body.printing-report #printTicket{page:workspace-report;}
 /* Workspace themes set table colours directly; print text must not inherit them. */
 body.printing-report #printTicket .workspace-report-print,body.printing-report #printTicket .workspace-report-print *{color:#000!important;-webkit-text-fill-color:#000!important;opacity:1!important;text-shadow:none!important;box-shadow:none!important;}
 body.printing-report #printTicket .workspace-report-print{width:100%;margin:0;padding:0;font-size:9pt;}
 body.printing-report #printTicket .workspace-report-print h2{font-size:11pt;break-after:avoid;}
 body.printing-report #printTicket .workspace-report-print table{font-size:8pt;background:#fff!important;}
 body.printing-report #printTicket .workspace-report-print th,body.printing-report #printTicket .workspace-report-print td{padding:2mm;font-size:inherit;border-color:#444;background:#fff!important;}
 body.printing-report #printTicket .workspace-report-print th{font-weight:bold;letter-spacing:normal;}
 body.printing-report #printTicket .workspace-report-print .report-print-identity th{font-weight:normal;}
 body.printing-report #printTicket .workspace-report-print thead{display:table-header-group;}
 body.printing-report #printTicket .workspace-report-print tr{break-inside:avoid;page-break-inside:avoid;}
 body.printing-report #printTicket .report-print-section+.report-print-section{break-before:page;page-break-before:always;}
 /* Stock balances (owner, 1 Nov): the emphasised Total columns and the bold foot rows keep their light shade on paper;
    only cells that carry these classes, so every other report cell stays white. */
 body.printing-report #printTicket .workspace-report-print .report-print-emphasis,body.printing-report #printTicket .workspace-report-print .report-print-extra th,body.printing-report #printTicket .workspace-report-print .report-print-extra td{background:#eef2f5!important;}
 body.printing-report #printTicket .workspace-report-print th.report-print-emphasis{background:#e3e9ee!important;}
}
/* Payment details and tagline (Print settings). Designs restyle them under .design-*. */
.document-tagline{font-size:9pt;font-style:italic;line-height:1.3;margin:0 0 2mm;}
.document-payment{margin:4mm 0 2mm;font-size:9pt;break-inside:avoid;page-break-inside:avoid;}
.document-payment-title{font-size:10pt;margin:0 0 1.5mm;}
.document-payment-methods{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(55mm,100%),1fr));gap:2mm 5mm;}
.payment-method{display:flex;flex-direction:column;gap:.3mm;border-top:1px solid #888;padding-top:1.2mm;break-inside:avoid;page-break-inside:avoid;min-width:0;}
.payment-method .payment-type{font-size:7.5pt;text-transform:uppercase;letter-spacing:.05em;}
.payment-method .payment-number{font-weight:700;font-variant-numeric:tabular-nums;}
/* Company stamp and signatures (W2 G). Images upload up to 1000 × 600 px; here they are capped so they never leave
   the paper, in the standard look and under any design. Transparent PNGs stay transparent (no background). */
.document-authorisation{display:flex;flex-wrap:wrap;align-items:flex-end;gap:3mm 6mm;margin:4mm 0 0;max-width:100%;break-inside:avoid;page-break-inside:avoid;}
.document-stamp{display:block;width:auto;height:auto;max-width:min(28mm,100%);max-height:28mm;object-fit:contain;}
.document-signature{display:flex;flex-direction:column;justify-content:flex-end;flex:1 1 40mm;min-width:0;max-width:100%;}
.signature-image{display:block;width:auto;height:auto;max-width:min(40mm,100%);max-height:15mm;object-fit:contain;}
.signature-line{display:block;border-top:1px solid #333;margin:1mm 0;}
.signature-name,.signature-title{display:block;overflow-wrap:anywhere;}
.signature-title{font-size:9pt;}
/* Whatever a design sets: a signature image is at most 45 mm wide, so a very wide scan stays a signature. */
.business-document .document-authorisation .signature-image{max-width:min(45mm,100%)!important;}
/* On a roll, whatever a design sets: the block stacks, and the images stay small and inside the paper. */
.business-document.paper-80mm .document-authorisation,.business-document.paper-58mm .document-authorisation{gap:2mm;}
.business-document.paper-80mm .document-stamp,.business-document.paper-58mm .document-stamp{width:auto!important;height:auto!important;max-width:min(22mm,100%)!important;max-height:22mm!important;}
.business-document.paper-80mm .document-signature,.business-document.paper-58mm .document-signature{flex:1 1 100%!important;max-width:100%!important;min-width:0!important;}
.business-document.paper-80mm .signature-image,.business-document.paper-58mm .signature-image{width:auto!important;height:auto!important;max-width:min(40mm,100%)!important;max-height:12mm!important;align-self:flex-start;}
/* Totals stay together (L's print review): the tax summary, the balances and the total never split across pages, and
   the footer never sits alone on a page. Notes print after the totals (public/print.js). */
.document-tax-summary,.document-total{break-inside:avoid;page-break-inside:avoid;}
:is(.document-tax-summary,.document-balance,.document-total)+:is(.document-balance,.document-total){break-before:avoid;page-break-before:avoid;}
.document-tax-summary{break-after:avoid;page-break-after:avoid;}
.document-footer{break-before:avoid;page-break-before:avoid;}
/* Standard look, A4 priced table: a wider Item column; Qty, Unit price and VAT sized to their content. */
.business-document.paper-a4:not([class*=" design-"]) .priced-lines th:nth-child(2){width:14mm;}
.business-document.paper-a4:not([class*=" design-"]) .priced-lines th:nth-child(3){width:28mm;}
.business-document.paper-a4:not([class*=" design-"]) .priced-lines th:nth-child(4){width:26mm;}
.business-document.paper-a4:not([class*=" design-"]) .priced-lines :is(th,td):nth-child(n+2){text-align:right;}
/* Standard look on A4, compact sign-off (lead, round 2): with a stamp and three signatures a short document stays on
   one page, as in the designs. Long notes may continue on the next page instead of leaving a large gap. */
.business-document.paper-a4:not([class*=" design-"]) .document-lines td{padding-top:1.5mm;padding-bottom:1.5mm;}
.business-document.paper-a4:not([class*=" design-"]) .document-authorisation{margin-top:2mm;gap:2mm 5mm;}
.business-document.paper-a4:not([class*=" design-"]) .document-stamp{max-width:min(20mm,100%);max-height:20mm;}
.business-document.paper-a4:not([class*=" design-"]) .signature-image{max-height:10mm;}
#printTicket .business-document.paper-a4:not([class*=" design-"]) .document-notes{break-inside:auto;page-break-inside:auto;orphans:3;widows:3;}
/* A4, every look: the Notes heading never stays alone at the foot of a page; it goes over with the note text. */
#printTicket .business-document.paper-a4 .document-notes>strong{display:block;break-after:avoid;page-break-after:avoid;}
.business-document.paper-a4:not([class*=" design-"]) .document-logo{max-height:14mm;margin-bottom:1.5mm;}
.business-document.paper-a4:not([class*=" design-"]) .document-details{display:grid;grid-template-columns:1fr 1fr;column-gap:10mm;}
.business-document.paper-a4:not([class*=" design-"]) :is(.document-balance,.document-total){margin-top:2mm;}
.business-document.paper-a4:not([class*=" design-"]) .document-payment{margin:2.5mm 0 1mm;}
.business-document.paper-a4:not([class*=" design-"]) .document-footer{margin-top:3mm;padding-top:2mm;}
.business-document.paper-a4:not([class*=" design-"]) .document-address{margin-bottom:2mm;}
.business-document.paper-a4:not([class*=" design-"]) .document-title{margin-top:2mm;padding-top:2mm;}
.business-document.paper-a4:not([class*=" design-"]) .document-notes{margin-top:2mm;}
/* Delivery receipt lines (Received by, Signature, Date) in one row on A4, as in Corporate. */
.business-document.paper-a4:not([class*=" design-"]) .document-signatures{display:grid;grid-template-columns:2fr 1.6fr 1fr;gap:0 6mm;margin:4mm 0 1mm;}
/* Formatting controls (Print settings: text size, font, bold headings and totals). public/print.js adds a fmt-* class
   only for a choice other than "Design default", never on kitchen tickets, and the size on A4 only. These rules
   outrank the design files for font-family, size and font-weight only; nothing else changes. System fonts only. */
.business-document.fmt-size-small>*{zoom:.9;}
.business-document.fmt-size-normal>*{zoom:1;}
.business-document.fmt-size-large>*{zoom:1.12;}
.business-document.fmt-font-modern,.business-document.fmt-font-modern *{font-family:Arial,Helvetica,"Liberation Sans",sans-serif!important;}
.business-document.fmt-font-classic,.business-document.fmt-font-classic *{font-family:"Times New Roman",Times,"Liberation Serif",serif!important;}
.business-document.fmt-font-elegant,.business-document.fmt-font-elegant *{font-family:Georgia,"DejaVu Serif","Liberation Serif",serif!important;}
.business-document.fmt-font-plain,.business-document.fmt-font-plain *{font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Liberation Sans",sans-serif!important;}
.business-document.fmt-bold-on :is(.document-business,.document-title,.document-number,.document-lines th,.document-tax-summary strong,.document-balance>strong,.document-total,.document-total *,.document-notes>strong,.document-payment-title,.signature-name){font-weight:700!important;}
.business-document.fmt-bold-off :is(.document-business,.document-title,.document-number,.document-lines th,.document-tax-summary strong,.document-balance>strong,.document-total,.document-total *,.document-notes>strong,.document-payment-title,.signature-name){font-weight:400!important;}
/* Georgia's figures are wide: on a 58 mm roll the amounts in the Elegant font print a little smaller so a large statement
   balance stays on the paper (H). */
.business-document.paper-58mm.fmt-font-elegant :is(.line-amount,.document-balance>strong,.document-total>strong:last-child){font-size:.88em!important;letter-spacing:0!important;}

/* Account statement print (W2 K): the strip as four boxes, shaded opening and closing rows, the header on every page,
   a page per section with brought / carried forward, rows never split. Meaning is in signs and columns, so black and
   white is safe. */
.money-statement-print .money-statement-strip{display:grid;grid-template-columns:repeat(4,1fr);gap:0;border:1px solid #333;margin:0 0 4mm;break-inside:avoid}
.money-statement-print .money-statement-tile{padding:2mm 3mm;border-left:1px solid #333;display:grid;gap:.5mm}.money-statement-print .money-statement-tile:first-child{border-left:0}
.money-statement-print .money-statement-tile-label{font-size:7pt;letter-spacing:.06em;text-transform:uppercase}
.money-statement-print .money-statement-tile-value{font-size:11pt;font-weight:bold;font-variant-numeric:tabular-nums}
.money-statement-print .money-statement-tile-note{font-size:7pt}
.money-statement-print .money-statement-page+.money-statement-page{break-before:page;page-break-before:always}
.money-statement-print table thead{display:table-header-group}
.money-statement-print tr{break-inside:avoid;page-break-inside:avoid}
.money-statement-print .numeric{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
.money-statement-print .money-statement-detail{display:block;font-size:7.5pt}
.money-statement-print .money-statement-row.is-opening td,.money-statement-print .money-statement-row.is-closing td,.money-statement-print .money-statement-row.is-totals td,.money-statement-print .money-statement-row.is-forward td{font-weight:bold;background:#eef2f5;-webkit-print-color-adjust:exact;print-color-adjust:exact}
.money-statement-print .money-statement-row.is-closing td{border-top:2px solid #333}
.money-statement-print .money-statement-row.is-closing{break-before:avoid;page-break-before:avoid}
.money-statement-print .money-statement-pill{border:0;padding:0;font-style:italic}
.money-statement-print .money-statement-pending{break-inside:avoid}
.money-statement-print table{table-layout:fixed;width:100%}
.money-statement-print th{white-space:normal;overflow-wrap:normal;font-size:7.5pt}
.money-statement-print .money-statement-col-when{width:17mm}.money-statement-print .money-statement-col-reference{width:30mm}
.money-statement-print .money-statement-col-staff{width:15mm}.money-statement-print .money-statement-col-branch{width:22mm}
.money-statement-print .money-statement-col-shift{width:18mm}.money-statement-print .money-statement-col-status{width:15mm}
.money-statement-print .money-statement-col-amount,.money-statement-print .money-statement-col-in,.money-statement-print .money-statement-col-out,.money-statement-print .money-statement-col-balance{width:24mm}
.money-statement-print td.numeric{font-size:8pt}
.money-statement-print th,.money-statement-print td{padding:1.2mm 1.5mm}
.money-statement-print .money-statement-strip.is-branch-view{grid-template-columns:repeat(2,1fr)}
/* The statement prints A4 portrait, as a bank statement does; other reports stay landscape. */
@media print{
 @page money-statement{size:A4 portrait;margin:12mm;}
 body.printing-report #printTicket:has(.money-statement-print){page:money-statement;}
}
.money-statement-print .money-statement-reference{font-size:7pt;overflow-wrap:anywhere}
/* Livestock reports (farm overview, batch cost sheet, …) printed from their own page: A4, plain tables. */
.livestock-print{font:12pt/1.4 Arial,Helvetica,sans-serif;margin:0;color:#000;background:#fff}
.livestock-print h1{font-size:18pt;margin:0 0 6px}
.livestock-print h2{font-size:13pt;margin:18px 0 6px}
.livestock-print p{margin:2px 0;font-size:10pt}
.livestock-print table{border-collapse:collapse;width:100%;margin-top:4px}
.livestock-print th,.livestock-print td{border:1px solid #888;padding:4px 6px;text-align:left;font-size:10pt;vertical-align:top}
.livestock-print th{background:#eee}
.livestock-print tr{page-break-inside:avoid}
@media print{.livestock-print{margin:0}}
/* DS-68 (Phase 2 Wave 4): a PAID / BALANCE DUE mark on invoices, and long workspace references printed short with the full one in small print. */
.business-document{position:relative;}
.business-document .document-pay-mark{position:absolute;top:24mm;right:10mm;z-index:2;padding:1.5mm 4mm;border:2.5px solid currentColor;border-radius:2mm;font-size:15pt;font-weight:800;letter-spacing:.12em;line-height:1.1;transform:rotate(-10deg);opacity:.82;pointer-events:none;background:transparent;-webkit-print-color-adjust:exact;print-color-adjust:exact;}
.business-document .document-pay-mark.is-paid{color:#137a3a;}
.business-document .document-pay-mark.is-due{color:#b42318;}
.business-document.paper-80mm .document-pay-mark,.business-document.paper-58mm .document-pay-mark{position:static;display:inline-block;margin:2mm 0;font-size:11pt;transform:none;}
.business-document .document-ref-full{display:block;font-size:7.5pt;line-height:1.2;color:#555;font-weight:400;overflow-wrap:anywhere;}
