/* Printed documents: plain A4, built from each shop's settings. Content flows across pages; table headers repeat. */
#print-root{display:none}
.document-preview{background:#e9e9ec;padding:24px;border-radius:14px;overflow:auto;display:grid;justify-content:center;gap:24px}
.paper.doc{--doc-accent:#000;position:relative;box-sizing:border-box;width:210mm;min-height:297mm;padding:14mm 14mm 12mm;background:#fff;color:#111;font:400 10pt/1.45 Relos,-apple-system,'Segoe UI',sans-serif;box-shadow:0 1px 2px rgba(0,0,0,.06),0 12px 40px rgba(0,0,0,.08);display:flex;flex-direction:column;gap:7mm}
.doc *{box-sizing:border-box}.doc h1,.doc h2{font-family:'Relos Display',Relos,sans-serif}.doc h1,.doc h2,.doc p,.doc ol,.doc dl,.doc dd{margin:0}
.doc b{font-weight:700}
.doc-head{display:flex;justify-content:space-between;gap:10mm;padding-bottom:6mm;border-bottom:2px solid var(--doc-accent)}
.doc-shop{display:flex;gap:5mm;align-items:flex-start;min-width:0}
.doc-logo{max-width:34mm;max-height:22mm;object-fit:contain}
.doc-shop h1{font-size:17pt;line-height:1.15;font-weight:800;letter-spacing:-.01em;margin-bottom:1.5mm}
.doc-shop p{font-size:8.6pt;color:#444}.doc-shop p i{font-style:normal;margin:0 1.6mm;color:#aaa}
.doc-tagline{color:#666!important;margin-bottom:1mm!important}
.doc-title{text-align:right;flex:0 0 auto}
.doc-title h2{font-size:20pt;line-height:1;font-weight:800;letter-spacing:.02em;text-transform:uppercase;color:var(--doc-accent);margin-bottom:4mm}
.doc-meta{display:grid;grid-template-columns:auto auto;gap:1mm 5mm;justify-content:end;font-size:9pt}
.doc-meta dt{color:#666}.doc-meta dd{text-align:right;font-weight:500}
.doc-label{display:block;font-size:7.4pt;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#777;margin-bottom:1.5mm}
.doc-parties{display:flex;gap:10mm}.doc-party{flex:1}
.doc-party-name{display:block;font-size:12pt;margin-bottom:.8mm}.doc-party p{color:#444}
.doc-items{width:100%;border-collapse:collapse;font-size:9.4pt}
.doc-items thead{display:table-header-group}
.doc-items th{background:var(--doc-accent);color:#fff;font-size:8pt;font-weight:700;letter-spacing:.04em;text-transform:uppercase;padding:2.4mm 2.5mm;text-align:right}
.doc-items th:nth-child(-n+2),.doc-items td:nth-child(-n+2){text-align:left}
.doc-items td{padding:2.4mm 2.5mm;border-bottom:1px solid #e4e4e7;text-align:right;vertical-align:top;font-variant-numeric:tabular-nums}
.doc-items td:first-child{width:9mm;color:#777}.doc-items td:last-child{font-weight:600}
.doc-desc{white-space:pre-wrap;word-break:break-word}
.doc-items tr{break-inside:avoid}
.doc-summary{display:flex;gap:10mm;align-items:flex-start;break-inside:avoid}
.doc-summary-notes{flex:1 1 0;min-width:0;display:grid;gap:4mm;align-content:start}.doc-summary-notes b{font-size:9.6pt}
.doc-totals{border-collapse:collapse;width:84mm;flex:0 0 84mm;font-variant-numeric:tabular-nums;break-inside:avoid}
.doc-totals th{text-align:left;font-weight:500;color:#444;padding:1.6mm 0}.doc-totals td{text-align:right;padding:1.6mm 0 1.6mm 8mm;font-weight:600}
.doc-totals tr.grand th,.doc-totals tr.grand td{font-size:12pt;font-weight:800;color:#000;border-top:1.5px solid #000;padding-top:2.6mm}
.doc-totals tr.due th,.doc-totals tr.due td{font-size:11.5pt;font-weight:800;color:#000;background:#f2f2f4;padding:2.6mm 3mm}
.doc-estimate{margin-left:auto;flex:none;width:84mm}
.doc-block .doc-fields{display:grid;grid-template-columns:repeat(4,1fr);gap:3mm}.doc-fields dt{font-size:8pt;color:#777}.doc-fields dd{font-size:10pt}
.doc-checks{display:flex;flex-wrap:wrap;gap:2mm 6mm}.doc-checks span{display:inline-flex;align-items:center;gap:2mm;color:#777}.doc-checks span.on{color:#000;font-weight:600}
.doc-checks i{display:inline-grid;place-items:center;width:4mm;height:4mm;border:1px solid #999;border-radius:1mm;font-style:normal;font-size:8pt;line-height:1}.doc-checks .on i{background:#000;border-color:#000;color:#fff}
.doc-problem p{font-size:11pt}.doc-pre{white-space:pre-wrap;word-break:break-word}
.doc-callout{background:#f2f2f4;border-radius:2mm;padding:3mm 4mm;font-size:9.6pt}
.doc-terms ol{padding-left:4.5mm;font-size:8.4pt;color:#444;display:grid;gap:.8mm}
.doc-signatures{display:flex;justify-content:space-between;gap:20mm;margin-top:auto;padding-top:14mm;break-inside:avoid}
.doc-signatures div{flex:0 0 58mm;text-align:center;font-size:8.6pt;color:#555}.doc-signatures span{display:block;border-top:1px solid #333;margin-bottom:1.5mm}
.doc-foot{text-align:center;border-top:1px solid #e4e4e7;padding-top:3mm;font-size:8.6pt;color:#444}.doc-foot small{display:block;color:#aaa;font-size:7pt;margin-top:1mm}
.doc-sample{position:absolute;top:5mm;left:50%;transform:translateX(-50%);font-size:7.5pt;font-weight:700;letter-spacing:.1em;color:#b42318;background:#fff1f0;padding:1mm 3mm;border-radius:99px}
.doc-stamp{position:absolute;top:52mm;right:16mm;transform:rotate(-10deg);border:2.5px solid currentColor;border-radius:2mm;padding:1.5mm 5mm;font-size:18pt;font-weight:800;letter-spacing:.12em;opacity:.22}
.doc-stamp.paid{color:#05944f}.doc-stamp.void{color:#b42318}
@media print{
 @page{size:A4 portrait;margin:0}
 body.printing{background:#fff!important;margin:0!important}body.printing>*{display:none!important}body.printing #print-root{display:block!important}
 .paper.doc{box-shadow:none;margin:0;min-height:297mm;break-after:page;print-color-adjust:exact;-webkit-print-color-adjust:exact}
 .paper.doc:last-child{break-after:auto}
}
/* ── Bold template: dark banner with angled accent shapes, ribbon title, accent table and totals (inspired by the Rivox artwork) ── */
.doc.tpl-bold,.doc.tpl-letterhead{padding:0 0 0;gap:5.5mm}
.tpl-bold>*:not(.bold-head):not(.bold-foot):not(.doc-ribbon):not(.doc-stamp):not(.doc-sample),.tpl-letterhead>*:not(.lh-head):not(.lh-foot):not(.doc-ribbon):not(.doc-stamp):not(.doc-sample){margin-left:12mm;margin-right:12mm}
.bold-head{position:relative;overflow:hidden;background:var(--doc-dark,#0b0b0c);color:#fff;min-height:40mm;padding:9mm 12mm 13mm;display:flex;align-items:center;justify-content:space-between;gap:8mm;print-color-adjust:exact;-webkit-print-color-adjust:exact}
.bold-shape{position:absolute;display:block;background:var(--doc-accent);pointer-events:none}
.bold-shape.a{left:-14mm;top:-10mm;width:34mm;height:70mm;transform:rotate(38deg);opacity:.95}
.bold-shape.b{left:6mm;top:-18mm;width:5mm;height:70mm;transform:rotate(38deg);opacity:.55}
.bold-shape.c{right:-16mm;bottom:-24mm;width:30mm;height:60mm;transform:rotate(38deg);opacity:.9}
.bold-brand{position:relative;display:flex;align-items:center;gap:5mm;padding-left:16mm;min-width:0}
.bold-brand .doc-logo{max-height:22mm;max-width:38mm;background:transparent}
.bold-brand h1{font-size:22pt;font-weight:900;letter-spacing:-.01em;line-height:1.05;color:#fff;text-transform:uppercase}
.bold-tagline{margin-top:2mm!important;font-size:7.6pt;letter-spacing:.32em;text-transform:uppercase;color:#d9d9d9}
.bold-contact{position:relative;list-style:none;margin:0;padding:0 0 0 6mm;border-left:1.5px solid var(--doc-accent);display:grid;gap:2.2mm;font-size:9pt;color:#f2f2f2;margin-right:10mm}
.bold-contact li{display:flex;align-items:center;gap:2.6mm;white-space:nowrap}
.bold-contact b{display:inline-grid;place-items:center;width:6.4mm;height:6.4mm;border-radius:50%;background:var(--doc-accent);flex:0 0 auto}
.bold-contact svg,.bold-address svg{width:3.6mm;height:3.6mm;fill:none;stroke:#fff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.doc-ribbon{position:relative;text-align:center;margin-top:-8mm;z-index:1}
.doc-ribbon::before{content:"";position:absolute;left:12mm;right:12mm;top:50%;border-top:1.5px solid var(--doc-accent)}
.doc-ribbon span{position:relative;display:inline-block;background:var(--doc-dark,#141416);color:#fff;font-size:15pt;font-weight:900;letter-spacing:.02em;text-transform:uppercase;padding:2.4mm 13mm;clip-path:polygon(5mm 0,calc(100% - 5mm) 0,100% 50%,calc(100% - 5mm) 100%,5mm 100%,0 50%);box-shadow:none;print-color-adjust:exact;-webkit-print-color-adjust:exact}
.doc-ribbon span::after{content:"";position:absolute;inset:0;border-left:3mm solid var(--doc-accent);border-right:3mm solid var(--doc-accent);clip-path:inherit}
.doc-strip{display:flex;flex-wrap:wrap;gap:3mm 9mm;align-items:center;padding:0 0 3mm;border-bottom:1px solid #e6e6e6}
.doc-strip div{display:flex;align-items:baseline;gap:2.5mm;font-size:9.4pt}.doc-strip span{color:#666}.doc-strip b{font-weight:700}
.doc-strip .doc-number{border:1.5px solid #222;border-radius:2mm;padding:1mm 4mm;font-size:11pt}
.tpl-bold .doc-items th,.tpl-letterhead .doc-items th{background:var(--doc-accent);font-size:8.6pt;padding:2.8mm 2.5mm;border-right:1px solid rgba(255,255,255,.35)}
.tpl-bold .doc-items td,.tpl-letterhead .doc-items td{border:1px solid #cfcfcf}
.tpl-bold .doc-items,.tpl-letterhead .doc-items{border:1px solid #cfcfcf;width:auto}
.tpl-bold .doc-totals,.tpl-letterhead .doc-totals{border:1px solid #cfcfcf}
.tpl-bold .doc-totals th,.tpl-bold .doc-totals td,.tpl-letterhead .doc-totals th,.tpl-letterhead .doc-totals td{padding:2.2mm 3.5mm;border-bottom:1px solid #e3e3e3}
.tpl-bold .doc-totals tr.grand th,.tpl-bold .doc-totals tr.grand td,.tpl-letterhead .doc-totals tr.grand th,.tpl-letterhead .doc-totals tr.grand td{background:var(--doc-accent);color:#fff;border-top:0;print-color-adjust:exact;-webkit-print-color-adjust:exact}
.tpl-bold .doc-totals tr.due th,.tpl-bold .doc-totals tr.due td,.tpl-letterhead .doc-totals tr.due th,.tpl-letterhead .doc-totals tr.due td{background:var(--doc-dark,#111);color:#fff;print-color-adjust:exact;-webkit-print-color-adjust:exact}
.tpl-bold .doc-label,.tpl-letterhead .doc-label{color:var(--doc-accent)}
.tpl-bold .doc-callout,.tpl-letterhead .doc-callout{background:color-mix(in srgb,var(--doc-accent) 10%,#fff);border-left:3mm solid var(--doc-accent)}
.tpl-bold .doc-callout b,.tpl-letterhead .doc-callout b{color:var(--doc-accent)}
.tpl-bold .doc-terms,.tpl-letterhead .doc-terms{background:#f4f4f5;border-radius:2mm;padding:3mm 4mm}
.tpl-bold .doc-checks .on i,.tpl-letterhead .doc-checks .on i{background:var(--doc-accent);border-color:var(--doc-accent)}
.tpl-bold .doc-signatures,.tpl-letterhead .doc-signatures{padding-top:10mm}
.bold-foot{position:relative;overflow:hidden;background:var(--doc-dark,#0b0b0c);color:#fff;padding:5mm 18mm 5.5mm;text-align:center;border-top:2mm solid var(--doc-accent);display:grid;gap:1.6mm;print-color-adjust:exact;-webkit-print-color-adjust:exact}
.bold-shape.d{left:-10mm;bottom:-18mm;width:16mm;height:50mm;transform:rotate(-38deg)}.bold-shape.e{right:-10mm;bottom:-18mm;width:16mm;height:50mm;transform:rotate(38deg)}
.bold-highlights{position:relative;font-size:10.5pt;font-weight:700;letter-spacing:.14em;text-transform:uppercase;display:flex;justify-content:center;align-items:center;gap:6mm}
.bold-highlights i{display:inline-block;width:1.5px;height:5mm;background:var(--doc-accent)}
.bold-address{position:relative;font-size:8pt;color:#cfcfcf;display:flex;justify-content:center;align-items:center;gap:2mm;flex-wrap:wrap}.bold-address span{margin-left:4mm}.bold-address b{color:#fff}
.bold-note{position:relative;font-size:8pt;color:#a6a6a6}
.tpl-bold .doc-stamp,.tpl-letterhead .doc-stamp{top:70mm}
.tpl-bold .doc-sample,.tpl-letterhead .doc-sample{top:2mm;z-index:2}
/* ── Letterhead template: the shop's own artwork, edge to edge ── */
.lh-head img,.lh-foot img{display:block;width:100%;height:auto}
.lh-head+.doc-ribbon{margin-top:-3mm}
.lh-foot{margin-top:0}
.lh-missing{padding:14mm;text-align:center;color:#888;background:#f4f4f5;font-size:10pt}
.tpl-bold .doc-signatures,.tpl-letterhead .doc-signatures{margin-bottom:0}
.tpl-bold .doc-estimate,.tpl-letterhead .doc-estimate{align-self:flex-end;margin-left:auto}
