/* ==========================================================================
   Printed documents. Sheets are drawn at their paper size (A4 or A5) and
   printed or turned into PDFs as they are.
   ========================================================================== */
#print-root{display:none}

/* Plain A4 report (collections) */
.print-flow{width:210mm;min-height:297mm;padding:14mm 14mm 16mm;background:#fff;color:#000;font-family:Arial,Helvetica,sans-serif;font-size:9.5pt}
.pf-head{display:flex;justify-content:space-between;align-items:flex-start;border-bottom:.4mm solid #000;padding-bottom:4mm;margin-bottom:5mm}
.pf-head strong{display:block;font-size:14pt}.pf-head span{display:block;font-size:9pt;color:#333;max-width:110mm}
.pf-title{text-align:right;font-size:14pt;font-weight:700}.pf-title small{font-size:9pt;font-weight:400}
.pf-table{width:100%;border-collapse:collapse;margin-bottom:6mm}
.pf-table th,.pf-table td{border-bottom:.2mm solid #999;padding:1.6mm 1.5mm;text-align:left;vertical-align:top}
.pf-table th{border-bottom:.4mm solid #000;font-size:8.5pt}
.pf-table .r{text-align:right}.pf-table tr{break-inside:avoid}
.pf-table small{color:#444}
.pf-summary{width:60%}
.pf-total td{font-weight:700;border-top:.4mm solid #000}
.pf-foot{font-size:8pt;color:#444}
.pf-table thead{display:table-header-group}

/* ==========================================================================
   Designed documents: black and white, plain paper.
   A4 for invoices, certificates and summaries; A5 (or A4) for receipts.
   ========================================================================== */
.doc{--pt:13mm;--px:15mm;--pb:9mm;position:relative;width:210mm;height:297mm;padding:var(--pt) var(--px) var(--pb);background:#fff;color:#111;font-family:'Plus Jakarta Sans',Arial,Helvetica,sans-serif;font-size:9.4pt;line-height:1.45;display:flex;flex-direction:column;overflow:hidden;box-sizing:border-box;-webkit-font-smoothing:antialiased}
.doc *{box-sizing:border-box}
.doc p{margin:0}
.doc .r{text-align:right;white-space:nowrap}.doc .c{text-align:center}

/* letterhead */
.doc-head{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:5mm}
.doc-logo{height:19mm;width:auto;max-width:72mm;object-fit:contain;object-position:left center;display:block}
.doc-clinic{font-family:Poppins,'Plus Jakarta Sans',Arial,sans-serif;font-weight:600;font-size:19pt;line-height:1.05;letter-spacing:.01em;text-transform:uppercase;color:#000}
.doc-tagline{margin-top:1.8mm;font-size:7.2pt;letter-spacing:.22em;text-transform:uppercase;color:#444;font-weight:600}
.doc-contact{display:grid;gap:1.1mm;justify-items:end;text-align:right;font-size:7.7pt;line-height:1.3;color:#222;max-width:64mm}
.doc-contact span{display:flex;align-items:flex-start;gap:1.6mm;justify-content:flex-end}
.doc-contact svg{width:3mm;height:3mm;flex:none;margin-top:.2mm;order:2}
.doc-rule{margin-top:4mm;height:1.3mm;border-top:1.6pt solid #000;border-bottom:.5pt solid #000}
.doc-doctors{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);border-bottom:.5pt solid #000;padding:2.4mm 0 2.2mm}
.doc-doctors>div{display:flex;flex-direction:column;gap:.2mm;padding:0 3.5mm;border-left:.5pt solid #9a9a9a;min-width:0}
.doc-doctors>div:first-child{border-left:0;padding-left:0}
.doc-doctors strong{font-family:Poppins,'Plus Jakarta Sans',Arial,sans-serif;font-weight:600;font-size:9.4pt;color:#000;line-height:1.25}
.doc-doctors span{font-size:7.5pt;color:#333}
.doc-doctors em{font-size:7.3pt;color:#555}
.doc-doctors-line{display:flex;flex-wrap:wrap;gap:.6mm 4mm;font-size:6.6pt;color:#333;padding:1.5mm 0;border-bottom:.5pt solid #000}
.doc-doctors-line strong{color:#000;font-weight:700}
.doc-body{flex:1;display:flex;flex-direction:column;min-height:0;padding-top:6mm}
.doc-foot{display:flex;justify-content:space-between;gap:6mm;border-top:.5pt solid #000;padding-top:1.8mm;margin-top:4mm;font-size:6.9pt;color:#444}
.doc-label{font-size:6.8pt;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:#555;margin-bottom:1.2mm}
.doc-title{margin:0;font-family:Poppins,'Plus Jakarta Sans',Arial,sans-serif;font-weight:600;font-size:20pt;letter-spacing:.16em;text-transform:uppercase;color:#000;line-height:1}

/* invoice */
.doc-title-row{display:flex;justify-content:space-between;align-items:flex-end;gap:8mm;margin-bottom:6mm}
.doc-meta{border-collapse:collapse;font-size:8.6pt}
.doc-meta th{text-align:left;font-weight:600;color:#555;padding:.5mm 5mm .5mm 0;font-size:7pt;text-transform:uppercase;letter-spacing:.1em}
.doc-meta td{text-align:right;font-weight:700;padding:.5mm 0;color:#000}
.doc-party{display:grid;grid-template-columns:minmax(0,1fr) 60mm;gap:8mm;margin-bottom:6mm;align-items:stretch}
.doc-party>div:first-child{display:flex;flex-direction:column;gap:.5mm;font-size:8.6pt;color:#333}
.doc-party-name{font-size:12.5pt;color:#000;font-weight:700;line-height:1.25}
.doc-status{border:1.3pt solid #000;padding:3mm 4mm;display:flex;flex-direction:column;justify-content:center}
.doc-status strong{font-size:15pt;font-weight:800;color:#000;line-height:1.1}
.doc-status span{font-size:7.5pt;color:#444;margin-top:1mm}
.doc-status.paid{border:2.6pt double #000}
.doc-table{width:100%;border-collapse:collapse;font-size:8.8pt}
.doc-table th{font-size:6.9pt;font-weight:700;letter-spacing:.1em;text-transform:uppercase;text-align:left;padding:2mm;border-top:1.3pt solid #000;border-bottom:.6pt solid #000;color:#000}
.doc-table td{padding:2.1mm 2mm;border-bottom:.4pt solid #b5b5b5;vertical-align:top}
.doc-table th:first-child,.doc-table td:first-child{padding-left:0;width:8mm}
.doc-table th:last-child,.doc-table td:last-child{padding-right:0}
.doc-table tbody tr:last-child td{border-bottom:1.3pt solid #000}
.doc-table tr{break-inside:avoid}
.doc-sum{display:grid;grid-template-columns:minmax(0,1fr) 68mm;gap:10mm;margin-top:4mm;align-items:start}
.doc-words p{margin:0 0 4mm;font-style:italic;font-size:8.6pt;color:#222}
.doc-mini{width:100%;border-collapse:collapse;font-size:7.7pt;color:#222}
.doc-mini td{padding:.9mm 1.5mm .9mm 0;border-bottom:.3pt dotted #888}
.doc-totals{width:100%;border-collapse:collapse;font-size:9pt}
.doc-totals th{text-align:left;font-weight:500;color:#333;padding:1.1mm 0}
.doc-totals td{text-align:right;padding:1.1mm 0;font-weight:600;white-space:nowrap;color:#000}
.doc-totals tr.grand th,.doc-totals tr.grand td{border-top:1pt solid #000;font-size:11pt;font-weight:800;color:#000;padding-top:2mm}
.doc-totals tr.due th,.doc-totals tr.due td{background:#000;color:#fff;font-weight:800;padding:1.8mm 2.5mm;font-size:10pt}
.doc-totals tr.clear th,.doc-totals tr.clear td{border-top:.5pt solid #000;font-weight:700;color:#000}
.doc-note{margin-top:5mm;font-size:8.6pt}
.doc-end{margin-top:auto;display:flex;justify-content:space-between;align-items:flex-end;gap:10mm;padding-top:6mm}
.doc-terms{font-size:8pt;color:#333;max-width:105mm}
.doc-terms p+p{margin-top:1mm}
.doc-fine{font-size:6.9pt;color:#666}
.doc-sign{min-width:60mm;text-align:center;display:flex;flex-direction:column;align-items:center;font-size:8pt;color:#333;line-height:1.35}
.doc-sign-space{height:15mm}
.doc-sign-line{width:100%;border-top:.6pt solid #000;margin-bottom:1.5mm}
.doc-sign strong{font-size:9.6pt;color:#000}
.doc-sign small{font-size:6.6pt;letter-spacing:.14em;text-transform:uppercase;color:#555;margin-top:1.2mm}

/* receipt */
.rc-title{text-align:center;margin-bottom:4mm}
.doc-receipt .doc-title{font-size:16pt;letter-spacing:.26em}
.rc-meta{display:flex;justify-content:space-between;font-size:8.6pt;border-bottom:.5pt solid #000;padding-bottom:2mm;margin-bottom:4mm}
.rc-meta strong{color:#000}
.rc-lines{display:grid;gap:2.6mm;margin-bottom:4.5mm}
.rc-line{display:flex;align-items:baseline;gap:3mm;font-size:9pt}
.rc-line>span{color:#555;white-space:nowrap;font-size:7.8pt}
.rc-line>strong{flex:1;border-bottom:.5pt dotted #000;padding-bottom:.5mm;font-size:10pt;color:#000;min-width:0}
.rc-line>.rc-gap{margin-left:2mm}
.rc-amount{border:1.4pt solid #000;padding:3mm 4mm;margin-bottom:4.5mm}
.rc-amount>div{display:flex;align-items:center;justify-content:space-between;gap:4mm}
.rc-amount .doc-label{margin:0}
.rc-amount strong{font-size:20pt;font-weight:800;color:#000;line-height:1.1}
.rc-amount p{margin-top:1.6mm;font-style:italic;font-size:8.4pt;border-top:.4pt solid #999;padding-top:1.6mm;color:#222}
.rc-grid{width:100%;border-collapse:collapse;font-size:8.8pt;margin-bottom:3mm}
.rc-grid th{text-align:left;font-weight:500;color:#555;width:34mm;padding:1.1mm 0;vertical-align:top;font-size:7.9pt}
.rc-grid td{padding:1.1mm 0;font-weight:600;color:#000}
.rc-summary{margin-left:auto;width:64mm;border-collapse:collapse;font-size:8.8pt}
.rc-summary th{text-align:left;font-weight:500;color:#333;padding:1mm 0}
.rc-summary td{text-align:right;font-weight:700;padding:1mm 0;color:#000}
.rc-summary tr:last-child th,.rc-summary tr:last-child td{border-top:.6pt solid #000;padding-top:1.6mm}
.rc-summary tr.due th,.rc-summary tr.due td{background:#000;color:#fff;padding:1.4mm 2mm}
.rc-note{margin-top:3mm;font-size:8pt;color:#333}

/* A5 receipt */
.doc.a5{--pt:9mm;--px:10mm;--pb:6.5mm;width:148mm;height:210mm;font-size:8.2pt}
.doc.a5 .doc-head{gap:3.5mm}
.doc.a5 .doc-logo{height:12.5mm}
.doc.a5 .doc-clinic{font-size:12.5pt}
.doc.a5 .doc-tagline{font-size:5.4pt;margin-top:1mm;letter-spacing:.1em}
.doc.a5 .doc-contact{font-size:6.1pt;max-width:48mm;gap:.6mm}
.doc.a5 .doc-contact svg{width:2.3mm;height:2.3mm}
.doc.a5 .doc-rule{margin-top:2.6mm;height:1mm;border-top-width:1.3pt}
.doc.a5 .doc-body{padding-top:4mm}
.doc.a5 .doc-title{font-size:12.5pt}
.doc.a5 .rc-title{margin-bottom:3mm}
.doc.a5 .rc-meta{font-size:7.6pt;margin-bottom:3mm}
.doc.a5 .rc-lines{gap:2mm;margin-bottom:3.5mm}
.doc.a5 .rc-line>strong{font-size:8.8pt}
.doc.a5 .rc-amount{padding:2.4mm 3.2mm;margin-bottom:3.5mm}
.doc.a5 .rc-amount strong{font-size:15pt}
.doc.a5 .rc-amount p{font-size:7.4pt}
.doc.a5 .rc-grid{font-size:7.9pt}
.doc.a5 .rc-grid th{width:27mm;font-size:7.2pt}
.doc.a5 .rc-summary{width:54mm;font-size:7.9pt}
.doc.a5 .doc-end{padding-top:3mm;gap:6mm}
.doc.a5 .doc-terms{font-size:7pt}
.doc.a5 .doc-sign{min-width:44mm;font-size:7pt}
.doc.a5 .doc-sign-space{height:10mm}
.doc.a5 .doc-sign strong{font-size:8.4pt}
.doc.a5 .doc-foot{font-size:5.8pt;flex-direction:column;gap:.3mm;margin-top:3mm;padding-top:1.4mm}

/* prescription */
.rx-band{display:flex;justify-content:space-between;align-items:flex-end;gap:6mm;border-bottom:.5pt solid #000;padding:2.4mm 0 2.2mm}
.rx-band strong{display:block;font-family:Poppins,'Plus Jakarta Sans',Arial,sans-serif;font-weight:600;font-size:12.5pt;color:#000;line-height:1.2}
.rx-band span{display:block;font-size:8pt;color:#333}
.rx-reg{font-size:8pt;color:#333;text-align:right;white-space:nowrap}
.rx-reg b{color:#000}
.rx-meta{display:flex;justify-content:space-between;font-size:9pt;color:#333;margin-bottom:4mm}
.rx-meta strong{color:#000}
.rx-meta-bc{justify-content:flex-start;align-items:flex-end;gap:9mm;margin-bottom:3mm}
.rx-meta-bc>span{padding-bottom:1mm}
.rx-meta-bc .pt-barcode{margin-left:auto}
/* Patient barcode (patient ID): black on white with a clear margin, so scanners read it */
.pt-barcode{display:flex;flex-direction:column;align-items:center;flex:none;background:#fff;line-height:1}
.pt-barcode svg{display:block}
.pt-barcode span{font-family:'Plus Jakarta Sans',Arial,sans-serif;font-size:7pt;font-weight:600;letter-spacing:.14em;color:#000;margin-top:.8mm}
.doc.a5 .pt-barcode span{font-size:6pt;margin-top:.5mm}
.cert-ref-bc{align-items:flex-end;gap:9mm;justify-content:flex-start}
.cert-ref-bc>span{padding-bottom:1mm}
.cert-ref-bc .pt-barcode{margin-left:auto}
/* patient note (rough estimate) */
.doc-note .note-print-text{white-space:pre-wrap;font-size:10.5pt;line-height:1.6;color:#111;margin:6mm 0 0}
.doc-note .note-print-ink{margin-top:5mm;border:.4pt solid #bbb;border-radius:2mm;overflow:hidden}
.doc-note .note-print-ink img{display:block;width:100%;height:auto}
.doc-note .note-print-amount{display:flex;justify-content:flex-end;align-items:baseline;gap:6mm;margin-top:6mm;padding:3mm 4mm;border:1.2pt solid #000;align-self:flex-end}
.doc-note .note-print-amount span{font-size:9pt;text-transform:uppercase;letter-spacing:.08em;color:#333}
.doc-note .note-print-amount strong{font-size:14pt;color:#000}
.doc-note .note-print-terms{font-size:7.6pt;color:#555;text-align:right;margin-top:1.5mm}
.rx-patient{margin-bottom:4mm}
.rx-allergy{border:1.2pt solid #000;padding:1.8mm 3mm;font-size:9pt;margin-bottom:4mm;letter-spacing:.01em}
.rx-allergy strong{text-transform:uppercase;letter-spacing:.04em}
.rx-clin{display:grid;grid-template-columns:50% 50%;row-gap:3mm;margin-bottom:3mm}
.rx-clin>div{min-width:0}
.rx-clin>.rx-l{grid-column:1;padding-right:5mm}
.rx-clin>.rx-r{grid-column:2;padding-left:var(--rx-padx)}
.rx-clin>.rx-wide{grid-column:1/-1;padding-right:0}
/* The medicine table's Dose column starts at the middle of the page, under Diagnosis and Treatment done. */
.doc-rx{--rx-padx:2mm}
.doc.a5.doc-rx{--rx-padx:1.5mm}
.doc.fit-2.doc-rx{--rx-padx:1.6mm}
.doc.fit-3.doc-rx{--rx-padx:1.4mm}
.doc-rx .rx-table{table-layout:fixed}
.doc-rx .rx-table th:nth-child(1){width:4.5%}
.doc-rx .rx-table th:nth-child(2){width:45.5%}
.doc-rx .rx-table th:nth-child(3){width:20%}
.doc-rx .rx-table th:nth-child(4){width:16%}
.doc-rx .rx-table th:nth-child(5){width:14%}
/* A5: a wider Dose column so "Morning, Afternoon, Night" fits on one line; Dose still starts at the middle. */
.doc.a5.doc-rx .rx-table th:nth-child(1){width:6%}
.doc.a5.doc-rx .rx-table th:nth-child(2){width:44%}
.doc.a5.doc-rx .rx-table th:nth-child(3){width:23%}
.doc.a5.doc-rx .rx-table th:nth-child(4){width:15%}
.doc.a5.doc-rx .rx-table th:nth-child(5){width:12%}
.doc.a5.doc-rx .rx-table td small{font-size:6.2pt;white-space:nowrap}
.doc.a5.doc-rx .rx-table td em{font-size:6.8pt}
.doc-rx .rx-table th:not(:first-child),.doc-rx .rx-table td:not(:first-child){padding-left:var(--rx-padx)}
.doc-rx .rx-table th:not(:last-child),.doc-rx .rx-table td:not(:last-child){padding-right:var(--rx-padx)}
.doc-rx .rx-table td{overflow-wrap:anywhere}
.rx-clin p{font-size:9.6pt;color:#111;white-space:pre-wrap}
.rx-symbol{font-family:Georgia,'Times New Roman',serif;font-style:italic;font-weight:700;font-size:26pt;line-height:1;color:#000;margin:2mm 0 2mm;position:relative;width:12mm}
.rx-symbol span{font-size:15pt;position:absolute;left:5.6mm;top:4.6mm}
.rx-table td{vertical-align:top}
.rx-table td strong{color:#000}
.rx-table td em{display:block;font-size:8pt;color:#444;margin-top:.6mm}
.rx-table td small{display:block;font-size:7.4pt;color:#555;margin-top:.4mm}
.rx-strength{font-size:8.6pt;color:#333}
.rx-dose{font-size:10pt;letter-spacing:.04em}
.rx-none{color:#777;font-style:italic;text-align:center}
.rx-legend{font-size:7.4pt;color:#555;margin-top:1.6mm}
.doc-rx .rx-advice-list{margin-top:5mm}
.doc-rx .rx-advice-list ul{margin:0;padding:0;list-style:none;font-size:9.4pt;color:#111}
.doc-rx .rx-advice-list li{position:relative;padding-left:4.5mm;margin:0 0 1.2mm;break-inside:avoid}
.doc-rx .rx-advice-list li::before{content:'';position:absolute;left:.2mm;top:.58em;width:1.2mm;height:1.2mm;border-radius:50%;background:#000}
.doc-rx .adv-halves{display:grid;grid-template-columns:50% 50%}
.doc-rx .adv-halves ul{min-width:0;padding-right:4mm}
.doc-rx .adv-halves ul.c2{padding-left:var(--rx-padx);padding-right:0}
.rx-next{display:flex;flex-direction:column;gap:.4mm;min-width:55mm}
.rx-next strong{font-size:12pt;color:#000;border:1.2pt solid #000;padding:1.6mm 3.5mm;align-self:flex-start}
.rx-next small{font-size:7.4pt;color:#555;margin-top:.8mm}
.rx-next .doc-label{margin:0}
.doc.a5.doc-rx .rx-band strong{font-size:10pt}
.doc.a5.doc-rx .rx-band span,.doc.a5.doc-rx .rx-reg{font-size:6.8pt}
.doc.a5.doc-rx .rx-meta{font-size:7.6pt;margin-bottom:3mm}
.doc.a5.doc-rx .cert-patient{font-size:7.8pt}
.doc.a5.doc-rx .cert-patient th{font-size:6pt;padding:1.4mm 2mm;width:19mm}
.doc.a5.doc-rx .cert-patient td{padding:1.3mm 2mm}
.doc.a5.doc-rx .rx-allergy{font-size:7.6pt;padding:1.2mm 2mm;margin-bottom:3mm}
.doc.a5.doc-rx .rx-clin p{font-size:8pt}
.doc.a5.doc-rx .rx-symbol{font-size:19pt;width:9mm}
.doc.a5.doc-rx .rx-symbol span{font-size:11pt;left:4mm;top:3.4mm}
.doc.a5.doc-rx .doc-table{font-size:7.8pt}
.doc.a5.doc-rx .doc-table th{font-size:6pt;padding:1.4mm 1.5mm}
.doc.a5.doc-rx .doc-table td{padding:1.4mm 1.5mm}
.doc.a5.doc-rx .rx-dose{font-size:8.4pt}
.doc.a5.doc-rx .rx-advice-list ul{font-size:7.8pt}
.doc.a5.doc-rx .rx-next{min-width:38mm}
.doc.a5.doc-rx .rx-next strong{font-size:9pt}

/* dental chart */
.doc{--tooth-fill:#fffdf7;--tooth-root:#f2eadf;--tooth-line:#9d917c;--cap:#dbe7f8;--imp:#d9efe6;--primary:#2f6fc0;--red:#d33a40;--green:#178a5b;--amber:#b77d05;--line-2:#b9b9b9;--muted:#666;--text:#111;--card:#fff;--tile:#f2f2f2;--gum:#f9e1e7}
.doc-chart .pc-odonto{margin:2mm 0 3mm;overflow:visible}
.doc-chart .cert-ref{margin-bottom:4mm}
.doc-chart .cert-title{margin-bottom:4mm}
.doc-chart .cert-patient{margin-bottom:3mm}
.doc-chart .doc-end{padding-top:4mm}
.doc-chart .doc-sign-space{height:11mm}
.doc-chart .odonto2-inner{min-width:0;padding:0}
.doc-chart .jaw::before{display:none}
.doc-chart .jaw-label{font-size:7pt;color:#555;padding:0 1mm;display:grid;grid-template-columns:1fr auto 1fr}
.doc-chart .jaw-label span:last-child{text-align:right}
.doc-chart .jaw{display:grid;grid-template-columns:1fr 1fr}
.doc-chart .quad{display:flex;justify-content:flex-end;padding-right:1.2mm;position:relative}
.doc-chart .quad+.quad{justify-content:flex-start;padding:0 0 0 1.2mm;border-left:.4mm solid #999}
.doc-chart .quad em{display:none}
.doc-chart .bite-line{border-top:.3mm dashed #999;margin:1.2mm 6%}
.doc-chart .tcol{display:grid;grid-template-rows:3.4mm 16mm 5.6mm;justify-items:center;align-items:center;gap:.3mm;width:10.6mm;padding:0;border:0;background:none;box-shadow:none}
.doc-chart .tcol.lower{grid-template-rows:5.6mm 16mm 3.4mm}
.doc-chart .tcol.lower .tcol-n{order:4}.doc-chart .tcol.lower .tcol-art{order:3}.doc-chart .tcol.lower .tcol-map{order:2}.doc-chart .tcol.lower .tcol-dots{order:1}
.doc-chart .odonto2.child .tcol{width:14mm}
.doc-chart .tcol-n{font-size:7pt;font-weight:700;color:#222}
.doc-chart .tcol-art{height:16mm;display:grid;place-items:center}
.doc-chart .tooth-art{height:16mm;width:auto}
.doc-chart .tcol-map svg{width:5.4mm;height:5.4mm}
.doc-chart .tcol-dots{display:none}
.doc-chart .pc-key{font-size:7pt;color:#555;margin:1mm 0 4mm}
.doc-chart .pc-table{font-size:8pt}
.doc-chart .pc-table td,.doc-chart .pc-table th{padding:1.4mm 1.5mm}
.doc-chart .pc-table td:first-child{white-space:nowrap}
.doc-chart .pc-table thead{display:table-header-group}
.doc-chart .pc-table tr{break-inside:avoid}
.doc.doc-chart{height:auto;min-height:295mm;overflow:visible}
.doc.doc-chart .doc-body{flex:none}

.doc.a5.doc-rx .rx-clin>.rx-l{padding-right:3mm}
.doc-rx .rx-work p{font-size:9.6pt;white-space:pre-wrap;color:#111}
.fdi-grid{border-collapse:collapse;font-size:7pt;line-height:1}
.fdi-grid+.fdi-grid{margin-top:1.5mm}
.fdi-grid td{width:5.2mm;height:4.8mm;text-align:center;color:#555;padding:0;font-weight:600;font-size:7.6pt}
.fdi-grid tr.low td{border-top:.35mm solid #000}
.fdi-grid td.mid{width:0;border-left:.35mm solid #000;padding:0}
.fdi-grid td.on{background:#000;color:#fff;font-weight:800;border-radius:1mm}
.doc.a5.doc-rx .fdi-grid td{width:3.6mm;height:3.6mm;font-size:5.6pt}
.doc.a5.doc-rx .rx-work p{font-size:8pt}

/* certificates and summaries */
.cert-ref{display:flex;justify-content:space-between;font-size:9pt;margin-bottom:8mm;color:#333}
.cert-ref strong{color:#000}
.cert-title{display:flex;align-items:center;gap:5mm;margin:0 0 7mm;font-family:Poppins,'Plus Jakarta Sans',Arial,sans-serif;font-weight:600;font-size:15pt;letter-spacing:.3em;text-transform:uppercase;color:#000;line-height:1.2}
.cert-title::before,.cert-title::after{content:'';flex:1;border-top:.6pt solid #000}
.cert-title span{text-align:center;max-width:150mm}
.cert-patient{width:100%;border-collapse:collapse;font-size:9pt;margin-bottom:8mm;border:.7pt solid #000}
.cert-patient th{text-align:left;font-size:6.8pt;letter-spacing:.1em;text-transform:uppercase;color:#555;font-weight:700;padding:2.2mm 3mm;width:27mm;border-bottom:.4pt solid #bbb;vertical-align:top;white-space:nowrap}
.cert-patient td{padding:2mm 3mm;font-weight:600;color:#000;border-bottom:.4pt solid #bbb;vertical-align:top}
.cert-patient tr:last-child th,.cert-patient tr:last-child td{border-bottom:0}
.cert-patient.summary td{font-weight:500;white-space:pre-wrap}
.cert-patient.summary tr.alert th,.cert-patient.summary tr.alert td{border-top:1pt solid #000;border-bottom:1pt solid #000}
.cert-body{white-space:pre-wrap;font-size:10.5pt;line-height:1.75;text-align:justify;color:#111}
.cert-end{margin-top:auto;display:flex;justify-content:space-between;align-items:flex-end;padding-top:8mm;gap:10mm}
.cert-place p{margin:0 0 1.5mm;font-size:9pt;color:#333}
.cert-place strong{color:#000}
.cert-seal{margin-top:4mm;width:28mm;height:28mm;border:.6pt dashed #8a8a8a;border-radius:50%;display:grid;place-items:center;font-size:6.2pt;letter-spacing:.14em;text-transform:uppercase;color:#9a9a9a}
.pf-logo{height:14mm;width:auto;max-width:50mm;object-fit:contain;margin-right:5mm}
.pf-head>div:first-of-type{flex:1}
.sheet-scale .doc{box-shadow:none}

.pf-summary-line{font-size:9pt;color:#333;margin:0 0 4mm}
.pf-group{font-size:10.5pt;margin:5mm 0 2mm;font-family:Poppins,'Plus Jakarta Sans',Arial,sans-serif;font-weight:600}
.pf-group small{font-size:8.5pt;color:#555;font-weight:500;margin-left:2mm}
.pf-day td,.pf-day th{font-size:8.6pt}
.pf-day .c{text-align:center;width:12mm}
.pf-tick{width:12mm;border-left:.2mm solid #999}
.pf-designed{font-family:'Plus Jakarta Sans',Arial,Helvetica,sans-serif}

/* Prescription pad: several advice points go under the medicines */

/* Long documents: tighter steps, then a second page (see fitSheets in print.js) */
.doc-rx .rx-advice-list li{break-inside:avoid}
.doc-rx .rx-dose.txt{font-size:8.8pt;letter-spacing:0;font-weight:700}
.doc.fit-1{font-size:8.8pt}
.doc.fit-1 .doc-body{padding-top:4mm}
.doc.fit-1 .doc-doctors{padding:1.6mm 0}
.doc.fit-1 .rx-meta,.doc.fit-1 .cert-ref{margin-bottom:2.5mm}
.doc.fit-1 .cert-patient{margin-bottom:3mm}
.doc.fit-1 .cert-patient th,.doc.fit-1 .cert-patient td{padding:1.3mm 2.5mm}
.doc.fit-1 .rx-clin{margin-bottom:2mm}
.doc.fit-1 .rx-symbol{font-size:20pt;margin:1mm 0}
.doc.fit-1 .rx-symbol span{font-size:12pt;left:4.4mm;top:3.6mm}
.doc.fit-1 .doc-table td{padding:1.3mm 2mm}
.doc.fit-1 .rx-advice-list{margin-top:3mm}
.doc.fit-1 .rx-advice-list ul{font-size:8.8pt}
.doc.fit-1 .rx-advice-list li{margin-bottom:.5mm}
.doc.fit-1 .doc-end{padding-top:3mm}
.doc.fit-1 .doc-sign-space{height:10mm}
.doc.fit-1 .cert-body{font-size:9.8pt;line-height:1.6}
.doc.fit-2{font-size:8.2pt}
.doc.fit-2 .doc-logo{height:14mm}
.doc.fit-2 .doc-clinic{font-size:15pt}
.doc.fit-2 .doc-head{gap:4mm}
.doc.fit-2 .doc-rule{margin-top:2.5mm}
.doc.fit-2 .rx-band{padding:1.6mm 0}
.doc.fit-2 .doc-table{font-size:8pt}
.doc.fit-2 .doc-table td{padding:1mm 1.6mm}
.doc.fit-2 .rx-table td small,.doc.fit-2 .rx-legend{display:none}
.doc.fit-2 .rx-advice-list ul{font-size:8.2pt}
.doc.fit-2 .doc-sign-space{height:8mm}
.doc.fit-2 .cert-body{font-size:9.2pt;line-height:1.5}
.doc.fit-2 .doc-foot{margin-top:2mm}
.doc.fit-3{font-size:7.6pt}
.doc.fit-3 .doc-table{font-size:7.6pt}
.doc.fit-3 .doc-table td{padding:.8mm 1.4mm}
.doc.fit-3 .rx-advice-list ul{font-size:7.6pt}
.doc.fit-3 .cert-body{font-size:8.6pt;line-height:1.45}
.doc.fit-3 .rx-clin p,.doc.fit-3 .rx-work p{font-size:8.4pt}
.doc.paged{height:auto;min-height:295mm;overflow:visible}
.doc.a5.paged{min-height:208mm}
.doc.paged .doc-body{flex:none}
.doc.paged .doc-table tr,.doc.paged .rx-advice-list li{break-inside:avoid}
.doc.paged .doc-table thead{display:table-header-group}
.doc.paged .doc-end{break-inside:avoid}
.doc.paged .doc-tail{break-inside:avoid}
.doc.paged .doc-tail .doc-foot{margin-top:4mm}
.doc.paged .doc-label,.doc.paged .rx-symbol{break-after:avoid}
.doc.paged .rx-advice-list ul{break-before:avoid}
.doc.paged .rx-clin,.doc.paged .rx-advice-list{break-inside:avoid}
.doc.paged .rx-legend{display:none}

/* Pay by UPI box (invoice, receipt) */
.doc-upi{margin-top:3mm;border:.6pt solid #000;border-radius:2mm;overflow:hidden;width:max-content;max-width:100%;break-inside:avoid}
.doc-upi-head{background:#000;color:#fff;font-size:7.5pt;font-weight:700;letter-spacing:.08em;text-transform:uppercase;padding:1mm 3mm;-webkit-print-color-adjust:exact;print-color-adjust:exact}
.doc-upi-body{display:flex;gap:3mm;align-items:center;padding:2mm 3.5mm 2mm 2mm}
/* The QR's own white border (4 modules) is its quiet zone: phones need it to read a printed code. */
.doc-upi-qr{width:30mm;height:30mm;flex:none;background:#fff}
.doc-upi-qr svg{width:100%;height:100%;display:block}
.doc-upi-text{display:flex;flex-direction:column;gap:.5mm;font-size:8pt;color:#333}
.doc-upi-text b{color:#000}
.doc-upi-text strong{font-size:12pt;color:#000}
.doc-upi-apps{font-size:6.8pt;color:#555;margin-top:.5mm}
.doc.a5 .doc-upi-qr{width:24mm;height:24mm}
.doc.a5 .doc-upi-text{font-size:7pt}
.doc.a5 .doc-upi-text strong{font-size:10pt}

/* Treatment estimate */
.est-patient{margin-bottom:4mm}
.est-head{display:grid;grid-template-columns:minmax(0,1fr);gap:8mm;margin-bottom:4mm;align-items:start}
.est-head.with-teeth{grid-template-columns:minmax(0,1fr) auto}
.est-title{font-size:12pt;font-weight:700;color:#000;margin:0}
.est-doc{font-size:8.6pt;color:#444;margin:.8mm 0 0}
.est-table td em.est-note{display:block;font-size:7.8pt;color:#555;margin-top:.5mm}
.est-table tr.est-visit td{font-size:6.9pt;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:#000;background:#efefef;padding:1.3mm 2mm;border-bottom:.4pt solid #b5b5b5}
.est-notes{white-space:pre-wrap;font-style:normal!important;color:#111!important}
.est-opt{break-inside:avoid;margin-top:3.5mm}
.est-opt-head{display:flex;align-items:center;gap:2.6mm;padding:1.8mm 2.4mm;border:.6pt solid #000;border-bottom:0;background:#f4f4f4}
.est-opt-head>div{flex:1;min-width:0}
.est-opt-head strong{display:block;font-size:9.6pt;color:#000}
.est-opt-head em{display:block;font-size:7.8pt;color:#444;font-style:normal;margin-top:.4mm}
.est-opt-head b{font-size:10.5pt;color:#000;white-space:nowrap}
.est-opt-key{display:inline-grid;place-items:center;width:6.4mm;height:6.4mm;border-radius:50%;background:#000;color:#fff;font-weight:700;font-size:9pt;flex:none}
.est-opt+.est-opt,.est-common+.est-table+.est-opt{margin-top:4mm}
.est-common{justify-content:space-between;font-size:7.2pt;font-weight:700;letter-spacing:.1em;text-transform:uppercase}
.est-common strong{font-size:10pt;letter-spacing:0;text-transform:none;display:inline}
.est-chosen{border-bottom:.6pt solid #000;margin-bottom:2mm}
.est-opt-totals th{font-weight:600;text-align:left}
.est-box{display:inline-block;width:3.4mm;height:3.4mm;border:.8pt solid #000;vertical-align:-.6mm;margin-right:1.2mm}
.est-terms{font-size:8pt;color:#444;margin:5mm 0 0;line-height:1.45}
.est-consent{margin-top:4mm;border:.6pt solid #000;padding:2.4mm 3mm;break-inside:avoid}
.est-consent .doc-label{margin-bottom:1mm}
.est-consent p{margin:0;font-size:8.8pt;color:#111;line-height:1.5}
.est-end .doc-sign span{font-size:7.6pt}

/* Lab work order (A5) */
.doc-lab .lab-table{margin-bottom:3mm}
.lab-teeth{margin:1mm 0 3mm}
.lab-instr{border:.6pt solid #000;min-height:24mm;padding:2mm 3mm}
.lab-instr p{margin:0;white-space:pre-wrap;font-size:8.4pt;color:#111}
.lab-return{max-width:58mm}
.lab-return p{margin:0;font-size:7.2pt;color:#333;line-height:1.45}
.doc-lab.a5 .cert-ref{font-size:7.6pt;margin-bottom:3mm}
.doc-lab.a5 .cert-title{font-size:12pt;margin:0 0 4mm}
.doc-lab.a5 .cert-patient{font-size:7.8pt;margin-bottom:3mm}
.doc-lab.a5 .cert-patient th{font-size:6pt;padding:1.4mm 2mm;width:19mm}
.doc-lab.a5 .cert-patient td{padding:1.3mm 2mm}

/* Medicine table: the first and last columns sit on the page margins at every size. */
.doc.doc-rx .rx-table th:first-child,.doc.doc-rx .rx-table td:first-child{padding-left:0}
.doc.doc-rx .rx-table th:last-child,.doc.doc-rx .rx-table td:last-child{padding-right:0}

/* On-screen exact preview */
.sheet-preview{position:relative;overflow:hidden;border-radius:12px;background:#fff;box-shadow:0 1px 2px rgba(30,39,51,.06),0 10px 30px rgba(30,39,51,.10)}
.sheet-scale{position:absolute;top:0;left:0;width:210mm;transform-origin:0 0}

@media print{
  @page{size:A4 portrait;margin:0}
  html,body{width:210mm;height:auto;background:#fff!important;margin:0!important;padding:0!important}
  body>*:not(#print-root){display:none!important}
  #print-root{display:block!important;position:static!important;width:210mm;height:auto;background:#fff}
  .doc{page-break-after:always;break-after:page;margin:0!important;box-shadow:none!important}
  .doc:last-child{page-break-after:auto;break-after:auto}
  *{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  /* Long sheets: the @page margins (set when printing) replace the sheet's own top and bottom padding. */
  .doc.paged{min-height:0;--pt:3mm;--pb:0mm}
  .doc.a5.paged{min-height:0;--pt:2mm;--pb:0mm}
}

/* 2.4.0: payment plan on invoices, day-end, payouts, expenses and stock reports */
.doc-party.with-doc{grid-template-columns:minmax(0,1fr) minmax(0,48mm) 56mm;gap:6mm}
.doc-party-doc{min-width:0;padding-top:.5mm}
.doc-party-doc strong{display:block}
.doc-party-doc span{display:block;font-size:8pt;color:#333}
.doc-inst{margin-bottom:2mm}
.doc-inst td.c{width:6mm;text-align:center}
.doc-inst tr.done td{color:#555}
.pf-cols{display:grid;grid-template-columns:1fr 1fr;gap:8mm;align-items:start;margin-bottom:2mm}
.pf-cols .pf-table{margin-bottom:4mm}
.pf-cash th{font-weight:500;border-bottom:.2mm solid #999;font-size:9pt}
.pf-cash small{font-weight:400;color:#555}
.pf-strong th,.pf-strong td{font-weight:700;font-size:10.5pt}
.pf-who{font-size:11pt;margin:0 0 4mm}
.pf-who small{font-size:9pt;color:#333}
.pf-cash th{width:62%}
.pf-note{font-size:9pt;margin:0 0 4mm}
.pf-days{font-size:9pt;line-height:1.6}
.pf-end{break-inside:avoid;page-break-inside:avoid}
.pf-signs{display:flex;gap:10mm;margin:10mm 0 4mm}
.pf-signs div{flex:1}
.pf-signs span{display:block;border-bottom:.3mm solid #000;height:10mm}
.pf-signs small{display:block;font-size:8.5pt;color:#333;margin-top:1.5mm}
.doc-words .doc-mini + .doc-label{margin-top:3.5mm}
.doc-inst td:nth-child(4){color:#333;font-size:7.6pt;padding-left:2mm}
.pf-exp td,.pf-exp th{font-size:8.6pt}
.pf-exp td:nth-child(-n+2),.pf-exp td:last-child{white-space:nowrap}

/* 2.5.0: prescriptions in Punjabi or Hindi */
.doc-rx.lang-pa .rx-advice-list li,.doc-rx.lang-hi .rx-advice-list li{line-height:1.55}
.doc-rx.lang-pa .rx-table td,.doc-rx.lang-hi .rx-table td{line-height:1.5}
.doc-label .tr{text-transform:none;letter-spacing:0;font-weight:600}

/* 2.5.0: consent forms */
.cns-title{margin:0 0 5mm;font-family:Poppins,'Plus Jakarta Sans',Arial,sans-serif;font-weight:600;font-size:11pt;letter-spacing:.24em;text-transform:uppercase;color:#000;line-height:1.25}
.cns-title span{display:block;margin-top:1.5mm;font-size:15pt;letter-spacing:.02em;text-transform:none}
.cns-patient{margin-bottom:5mm}
.cns-body{font-size:9.6pt;line-height:1.55;color:#111}
.cns-body p{margin:0 0 2.6mm}
.cns-body ul{margin:-1mm 0 2.8mm;padding-left:6mm}
.cns-body li{margin:0 0 1mm}
.cns-signs{display:flex;gap:7mm;margin-top:auto;padding-top:6mm;break-inside:avoid}
.cns-sign{flex:1;min-width:0;display:flex;flex-direction:column}
.cns-ink{height:20mm;display:flex;align-items:flex-end;justify-content:center}
.cns-ink img{max-height:20mm;max-width:100%;object-fit:contain}
.cns-sign strong{font-size:9pt;margin-top:1.2mm}
.cns-sign small{font-size:7.4pt;color:#444}
.cns-foot{font-size:7.4pt;color:#444;margin:4mm 0 0}
.cns-void{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;pointer-events:none}
.cns-void span{font-family:Poppins,Arial,sans-serif;font-size:90pt;font-weight:600;color:rgba(0,0,0,.12);transform:rotate(-28deg);letter-spacing:.1em}
.cns-void small{font-size:10pt;color:#444;transform:rotate(-28deg)}
.doc-consent .doc-body{display:flex;flex-direction:column}
/* before and after */
.cmp-pair{display:grid;grid-template-columns:1fr 1fr;gap:5mm;margin-top:3mm}
.cmp-pair figure{margin:0;display:flex;flex-direction:column;gap:2mm}
.cmp-pair img{width:100%;height:95mm;object-fit:contain;background:#f2f2f2;border:.2mm solid #bbb}
.cmp-pair figcaption{font-size:8.6pt;color:#333}
.cmp-note{font-size:9pt;margin-top:5mm}
/* booking poster */
.doc-poster .doc-body{display:flex;align-items:center;justify-content:center}
.bp-wrap{text-align:center;max-width:150mm}
.bp-kicker{font-size:11pt;letter-spacing:.2em;text-transform:uppercase;margin:0 0 3mm;color:#333}
.bp-title{font-family:Poppins,'Plus Jakarta Sans',Arial,sans-serif;font-weight:600;font-size:30pt;line-height:1.1;margin:0 0 8mm;color:#000}
.bp-qr{width:95mm;height:95mm;margin:0 auto 7mm;padding:5mm;border:.6mm solid #000;border-radius:5mm}
.bp-qr svg{width:100%;height:100%}
.bp-steps{font-size:12pt;line-height:1.5;margin:0 0 4mm}
.bp-url{font-size:10pt;color:#333;word-break:break-all;margin:0 0 4mm}
.bp-call{font-size:13pt;margin:0}
/* Profit and loss statement */
.pf-pnl .pnl-basis{font-size:8.5pt;color:#333;margin:0 0 4mm}
.pnl-table td:first-child{padding-left:6mm}
.pnl-table .pnl-sec td{padding-left:1.5mm;background:#eef2f7;font-weight:700;border-bottom:.2mm solid #999;-webkit-print-color-adjust:exact;print-color-adjust:exact}
.pnl-table .pnl-total td{font-weight:700;border-top:.35mm solid #000}
.pnl-table .pnl-total td:first-child,.pnl-table .pnl-grand td:first-child{padding-left:1.5mm}
.pnl-table .pnl-grand td{font-weight:700;font-size:11pt;border-top:.4mm solid #000;border-bottom:.9mm double #000}
.pnl-table .pnl-pct td{color:#333;font-style:italic;border-bottom:0}
.pnl-table th:not(:first-child),.pnl-table td:not(:first-child){width:26mm;white-space:nowrap}
.pnl-cols{display:grid;grid-template-columns:1fr 1fr;gap:6mm;align-items:start}
.pnl-years td,.pnl-years th{white-space:nowrap}
.pf-report .rep-series td,.pf-report .rep-series th{white-space:nowrap;font-size:8.5pt}
.pf-report .pnl-basis{font-size:8.5pt;color:#333;margin:0 0 4mm}
.pf-pnl .pf-table th,.pf-pnl .pf-table td,.pf-report .pf-table th,.pf-report .pf-table td{padding-top:.95mm;padding-bottom:.95mm;font-size:9pt;line-height:1.3}
.pf-pnl .pf-table th,.pf-report .pf-table th{font-size:8.5pt}
.pf-pnl .pnl-table .pnl-grand td{font-size:10.5pt;padding-top:1.4mm;padding-bottom:1.4mm}
.pf-pnl .pf-table,.pf-report .pf-table{margin-bottom:4mm}
.pf-pnl .pf-group,.pf-report .pf-group{margin-top:1mm}
.pf-pnl .pf-signs{margin:6mm 0 3mm}
.pf-pnl .pf-signs span{height:8mm}

/* ==========================================================================
   Letterhead designs (Settings > Printing). Classic is the black and white base
   above; the others change the header and footer and colour a few accents.
   --acc is the chosen colour and --acc-soft a light tint of it. Layout rules use
   .doc.theme-x so they win over the tightening steps; sizes use .theme-x so the
   A5 and tightening sizes still apply.
   ========================================================================== */
.doc{--acc:#000;--acc-soft:#f1f1f1}
.doc:not(.theme-classic) .doc-title,.doc:not(.theme-classic) .cert-title,.doc:not(.theme-classic) .cns-title,.doc:not(.theme-classic) .rx-symbol{color:var(--acc)}
.doc:not(.theme-classic) .cert-title::before,.doc:not(.theme-classic) .cert-title::after{border-top-color:var(--acc)}
.doc:not(.theme-classic) .doc-table th{color:var(--acc);border-top-color:var(--acc);border-bottom-color:var(--acc)}
.doc:not(.theme-classic) .doc-table tbody tr:last-child td{border-bottom-color:var(--acc)}
.doc:not(.theme-classic) .doc-totals tr.grand th,.doc:not(.theme-classic) .doc-totals tr.grand td{color:var(--acc);border-top-color:var(--acc)}
.doc:not(.theme-classic) .doc-totals tr.due th,.doc:not(.theme-classic) .doc-totals tr.due td,.doc:not(.theme-classic) .rc-summary tr.due th,.doc:not(.theme-classic) .rc-summary tr.due td{background:var(--acc)}
.doc:not(.theme-classic) .doc-status,.doc:not(.theme-classic) .rc-amount,.doc:not(.theme-classic) .doc-upi,.doc:not(.theme-classic) .cert-patient{border-color:var(--acc)}
.doc:not(.theme-classic) .doc-status strong,.doc:not(.theme-classic) .rc-amount strong{color:var(--acc)}
.doc:not(.theme-classic) .cert-patient th{color:var(--acc)}
.doc:not(.theme-classic) .rx-advice-list li::before{background:var(--acc)}
.doc:not(.theme-classic) .doc-sign-line{border-top-color:var(--acc)}

/* Modern: a coloured band across the top, doctors on a light tint, a coloured strip at the foot */
.doc.theme-modern .doc-head{margin:calc(-1 * var(--pt)) calc(-1 * var(--px)) 0;padding:8mm var(--px) 6.5mm;background:var(--acc);color:#fff}
.doc.a5.theme-modern .doc-head{padding:5.5mm var(--px) 4.5mm}
.theme-modern .doc-logo-tile{background:#fff;border-radius:2.6mm;padding:2mm 2.6mm;display:flex;align-items:center;justify-content:center;min-width:0}
.theme-modern .doc-logo{height:15mm;max-width:52mm;object-position:center}
.theme-modern .doc-clinic{color:#fff;text-transform:none;letter-spacing:0;font-size:20pt}
.theme-modern .doc-tagline{color:#fff;opacity:.85;letter-spacing:.12em}
.theme-modern .doc-contact{color:#fff}
.doc.theme-modern .doc-doctors,.doc.theme-modern .doc-doctors-line,.doc.theme-modern .rx-band{margin:0 calc(-1 * var(--px));padding-left:var(--px);padding-right:var(--px);background:var(--acc-soft);border-bottom:0}
.doc.theme-modern .doc-doctors>div{border-left:.7mm solid var(--acc);padding-left:2.6mm}
.theme-modern .doc-doctors strong,.theme-modern .rx-band strong,.theme-modern .doc-doctors-line strong{color:var(--acc)}
.doc.theme-modern .doc-table th{background:var(--acc-soft);border-top:0;border-bottom:1pt solid var(--acc)}
.doc.theme-modern .doc-table th:first-child,.doc.theme-modern .doc-table td:first-child{padding-left:1.8mm}
.doc.theme-modern .doc-table th:last-child,.doc.theme-modern .doc-table td:last-child{padding-right:1.8mm}
.doc.theme-modern .cert-patient th{background:var(--acc-soft)}
.doc.theme-modern .doc-foot{margin:4mm calc(-1 * var(--px)) calc(-1 * var(--pb));padding:2.4mm var(--px) 3.4mm;background:var(--acc);color:#fff;border-top:0}
.doc.a5.theme-modern .doc-foot{padding:1.6mm var(--px) 2.4mm}

/* Elegant: everything centred, the name in a serif type, fine double lines with a small diamond */
.doc.theme-elegant .doc-head{grid-template-columns:minmax(0,1fr);justify-items:center;text-align:center;gap:1.6mm}
.theme-elegant .doc-logo{height:16mm;object-position:center}
.theme-elegant .doc-clinic{font-family:Georgia,'Times New Roman',serif;font-weight:400;font-size:21pt;letter-spacing:.12em;color:var(--acc)}
.theme-elegant .doc-tagline{font-family:Georgia,'Times New Roman',serif;font-style:italic;text-transform:none;letter-spacing:.03em;font-size:9pt;font-weight:400;color:#444;margin-top:1.2mm}
.doc.theme-elegant .doc-contact{display:flex;flex-wrap:wrap;justify-content:center;gap:.6mm 5mm;max-width:none;text-align:center;margin-top:.6mm}
.doc.theme-elegant .doc-contact span{justify-content:center}
.doc.theme-elegant .doc-contact svg{order:0;color:var(--acc)}
.doc.theme-elegant .doc-rule{margin-top:3.2mm;height:auto;border:0;display:flex;align-items:center;gap:2.6mm}
.doc.theme-elegant .doc-rule::before,.doc.theme-elegant .doc-rule::after{content:'';flex:1;height:1.1mm;border-top:.8pt solid var(--acc);border-bottom:.3pt solid var(--acc)}
.doc.theme-elegant .doc-rule i{display:block;width:1.9mm;height:1.9mm;transform:rotate(45deg);background:var(--acc)}
.doc.theme-elegant .doc-doctors{border-bottom:.3pt solid var(--acc);text-align:center}
.doc.theme-elegant .doc-doctors>div,.doc.theme-elegant .doc-doctors>div:first-child{align-items:center;padding:0 3mm;border-left:.3pt solid #c9c9c9}
.doc.theme-elegant .doc-doctors>div:first-child{border-left:0}
.theme-elegant .doc-doctors strong,.theme-elegant .rx-band strong{font-family:Georgia,'Times New Roman',serif;font-weight:700;color:var(--acc)}
.doc.theme-elegant .doc-doctors-line{justify-content:center;border-bottom:.3pt solid var(--acc)}
.doc.theme-elegant .rx-band{flex-direction:column;align-items:center;text-align:center;gap:.4mm;border-bottom:.3pt solid var(--acc)}
.doc.theme-elegant .rx-reg{text-align:center}
.doc.theme-elegant .doc-foot{flex-direction:column;align-items:center;text-align:center;gap:.4mm;border-top:.3pt solid var(--acc)}
.theme-elegant .doc-title,.theme-elegant .cert-title,.theme-elegant .cns-title{font-family:Georgia,'Times New Roman',serif;font-weight:400}
.doc.theme-elegant .doc-table th{border-top:.8pt solid var(--acc);border-bottom:.3pt solid var(--acc)}
.doc.a5.theme-elegant .doc-logo{height:11mm}
.doc.a5.theme-elegant .doc-clinic{font-size:13pt}
.doc.a5.theme-elegant .doc-tagline{font-size:6.6pt}
.doc.a5.theme-elegant .doc-rule{margin-top:2.2mm}

/* Doctor's pad: the doctor at the top left, the clinic at the top right, contact details in a coloured strip at the foot */
.doc.theme-pad .doc-head{grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:6mm}
.doc.theme-pad .pad-docs{display:grid;gap:2mm 5mm;min-width:0}
.doc.theme-pad .pad-docs.n2,.doc.theme-pad .pad-docs.n3,.doc.theme-pad .pad-docs.n4{grid-template-columns:repeat(2,minmax(0,1fr))}
.doc.theme-pad .pad-docs>div{display:flex;flex-direction:column;gap:.2mm;min-width:0}
.theme-pad .pad-docs strong{font-family:Poppins,'Plus Jakarta Sans',Arial,sans-serif;font-weight:600;font-size:17pt;color:var(--acc);line-height:1.15}
.theme-pad .pad-docs.n2 strong,.theme-pad .pad-docs.n3 strong,.theme-pad .pad-docs.n4 strong{font-size:10.5pt}
.theme-pad .pad-docs span{font-size:8.8pt;color:#222;font-weight:600}
.theme-pad .pad-docs em{font-size:8pt;color:#444}
.theme-pad .pad-docs small{font-size:7.6pt;color:#444;margin-top:.4mm}
.theme-pad .pad-docs.n2 span,.theme-pad .pad-docs.n3 span,.theme-pad .pad-docs.n4 span{font-size:7.4pt}
.doc.theme-pad .pad-clinic{display:flex;align-items:center;justify-content:flex-end;gap:3mm;text-align:right;max-width:95mm;min-width:0}
.doc.theme-pad .pad-clinic .doc-logo{order:2;object-position:right center}
.theme-pad .pad-clinic .doc-logo{height:15mm;max-width:40mm}
.theme-pad .doc-clinic{font-size:14pt;text-transform:none;letter-spacing:0;color:#111}
.theme-pad .doc-tagline{letter-spacing:.06em;font-size:6.8pt}
.doc.theme-pad .doc-rule{margin-top:3.5mm;height:0;border-top:1mm solid var(--acc);border-bottom:0}
.doc.theme-pad .doc-foot{margin:4mm calc(-1 * var(--px)) calc(-1 * var(--pb));padding:2.6mm var(--px) 3.2mm;background:var(--acc);color:#fff;border-top:0;flex-direction:column;gap:1.2mm;justify-content:flex-start}
.doc.theme-pad .pad-contact{display:flex;flex-wrap:wrap;gap:.6mm 6mm;font-size:7.6pt;font-weight:600;line-height:1.3}
.doc.theme-pad .pad-contact span{display:inline-flex;align-items:center;gap:1.4mm}
.doc.theme-pad .pad-contact svg{width:3mm;height:3mm;flex:none}
.doc.theme-pad .pad-meta{display:flex;justify-content:space-between;gap:6mm;font-size:6.8pt;opacity:.9}
.doc.a5.theme-pad .doc-head{gap:4mm}
.doc.a5.theme-pad .pad-docs strong{font-size:11pt}
.doc.a5.theme-pad .pad-docs.n2 strong,.doc.a5.theme-pad .pad-docs.n3 strong,.doc.a5.theme-pad .pad-docs.n4 strong{font-size:7.8pt}
.doc.a5.theme-pad .pad-docs span{font-size:6.6pt}
.doc.a5.theme-pad .pad-docs em,.doc.a5.theme-pad .pad-docs small{font-size:6pt}
.doc.a5.theme-pad .pad-clinic .doc-logo{height:10mm}
.doc.a5.theme-pad .doc-clinic{font-size:10pt}
.doc.a5.theme-pad .doc-rule{margin-top:2.4mm;border-top-width:.8mm}
.doc.a5.theme-pad .doc-foot{padding:1.8mm var(--px) 2.2mm;gap:.6mm}
.doc.a5.theme-pad .pad-contact{font-size:6pt;gap:.3mm 3.5mm}
.doc.a5.theme-pad .pad-contact svg{width:2.2mm;height:2.2mm}
.doc.a5.theme-pad .pad-meta{font-size:5.6pt;flex-direction:column;gap:.2mm}

/* Minimal: a thin coloured edge, the name in colour, light grey lines */
.doc.theme-minimal::before{content:'';position:absolute;left:0;top:0;bottom:0;width:3mm;background:var(--acc)}
.doc.a5.theme-minimal::before{width:2.2mm}
.doc.theme-minimal .doc-head{grid-template-columns:minmax(0,1fr) auto;gap:6mm;align-items:center}
.doc.theme-minimal .min-brand{display:flex;align-items:center;gap:3.5mm;min-width:0}
.theme-minimal .doc-logo{height:14mm}
.theme-minimal .doc-clinic{text-transform:none;letter-spacing:-.005em;font-weight:700;font-size:19pt;color:var(--acc)}
.theme-minimal .doc-tagline{letter-spacing:.08em;color:#666;font-weight:500}
.theme-minimal .doc-contact{color:#555}
.doc.theme-minimal .doc-contact svg{color:var(--acc)}
.doc.theme-minimal .doc-rule{margin-top:4mm;height:0;border-top:.5pt solid #bdbdbd;border-bottom:0}
.doc.theme-minimal .doc-doctors,.doc.theme-minimal .doc-doctors-line,.doc.theme-minimal .rx-band{border-bottom:.5pt solid #bdbdbd}
.doc.theme-minimal .doc-doctors>div{border-left-color:#d9d9d9}
.theme-minimal .rx-band strong{color:var(--acc)}
.doc.theme-minimal .doc-foot{border-top:.5pt solid #bdbdbd;color:#666}
.doc.theme-minimal .doc-table th{border-top:0;border-bottom:1pt solid var(--acc)}
.doc.theme-minimal .doc-table tbody tr:last-child td{border-bottom:.6pt solid #bdbdbd}
.doc.theme-minimal .doc-table td{border-bottom-color:#e2e2e2}
.doc.a5.theme-minimal .doc-logo{height:10mm}
.doc.theme-pad .pad-more{display:flex;flex-wrap:wrap;align-items:baseline;gap:.5mm 5mm;padding:1.8mm 0;border-bottom:.4pt solid var(--acc);font-size:7.8pt;color:#333}
.doc.theme-pad .pad-more .doc-label{margin:0;color:var(--acc)}
.doc.theme-pad .pad-more strong{color:#000}
.doc.a5.theme-pad .pad-more{font-size:6.4pt;padding:1.2mm 0;gap:.3mm 3.5mm}
/* Elegant on A5: a shorter header so a receipt still fits on its page */
.doc.a5.theme-elegant .doc-head{gap:.8mm}
.doc.a5.theme-elegant .doc-logo{height:8.5mm}
.doc.a5.theme-elegant .doc-clinic{font-size:12pt;letter-spacing:.1em}
.doc.a5.theme-elegant .doc-tagline{font-size:6pt;margin-top:.5mm}
.doc.a5.theme-elegant .doc-contact{gap:.2mm 3mm;margin-top:0}
.doc.a5.theme-elegant .doc-rule{margin-top:1.8mm}
.doc.a5.theme-elegant .doc-rule i{width:1.4mm;height:1.4mm}
/* Patient summary: medicines the patient takes */
.sum-meds-label{margin-top:6mm}
.doc-table.sum-meds td,.doc-table.sum-meds th{font-size:8.6pt}
.doc-table.sum-meds th:first-child,.doc-table.sum-meds td:first-child{width:7mm}
.sum-updated{margin-top:3mm;font-size:7.6pt;color:#555}
.doc:not(.theme-classic) .doc-upi-head{background:var(--acc)}
.upi-slip{text-align:center;display:flex;flex-direction:column;align-items:center;gap:2mm;padding-top:4mm}
.upi-slip p{margin:0;font-size:10pt;line-height:1.5}
.upi-slip-amt{font-size:24pt;font-weight:800}
.upi-slip-qr{width:70mm;height:70mm;background:#fff}
.upi-slip-qr svg{width:100%;height:100%;display:block}
.claim-policy{margin-bottom:4mm}
.claim-dx{margin-bottom:4mm}
.claim-dx th{width:32mm;text-align:left;font-weight:600;color:#444;padding:.9mm 2mm .9mm 0;border-bottom:.3pt dotted #888;vertical-align:top}

/* Demo licence: a mark on every printed sheet */
.doc{position:relative}
.doc-demo{position:absolute;top:6mm;right:6mm;border:2px solid #b45309;color:#b45309;font:700 10pt/1 sans-serif;letter-spacing:.14em;padding:3px 8px;border-radius:4px;transform:rotate(-8deg);opacity:.85;z-index:2}
