/* print.css — only the document / calculator being printed, clean on A4. */
@page { size: A4; margin: 14mm 14mm 16mm; }
html, body { height: auto !important; overflow: visible !important; background: #fff !important; color: #000 !important; display: block !important; }
.app-head, #v-measure, .no-print, .cards, dialog { display: none !important; }
.view { display: block !important; }
.view[hidden] { display: none !important; }
.page { overflow: visible !important; padding: 0 !important; }
.page .inner { max-width: none !important; }
.doc { font: 11pt/1.4 "Noto Sans", "Nirmala UI", "Mangal", system-ui, sans-serif; color: #000; }
.doc input, .doc textarea, .doc select { border: 0 !important; border-bottom: 1px solid #555 !important; border-radius: 0 !important; background: transparent !important; color: #000 !important; }
.doc textarea { border: 1px solid #777 !important; min-height: 0 !important; resize: none; }
.doc .ph { border: 1px dashed #000 !important; background: #fff !important; }
.doc h2, .doc h3 { break-after: avoid; }
.doc section, .doc .field, .doc tr { break-inside: avoid; }
.calc .ref { color: #333 !important; }
.doc { box-shadow: none !important; margin: 0 !important; padding: 0 !important; max-width: none !important; }
.doc .area.ph { border: 1.5px dashed #000 !important; background: #fff !important; }
.doc .area.ph:empty::before { color: #000 !important; }
.doc .area.ph.phfilled { border: 0 !important; padding-left: 0 !important; padding-right: 0 !important; }   /* v60: filled text prints plain */
.doc select { -webkit-appearance: none; appearance: none; }
.doctools, .grp { display: none !important; }

/* case decision summary (printed from the Summary dialog) */
body.printing-summary .view, body.printing-summary .app-head { display: none !important; }
body.printing-summary dialog { display: none !important; }
body.printing-summary #sumPrintArea { display: block !important; white-space: pre-wrap; font: 10.5pt/1.4 system-ui, "Noto Sans", sans-serif; color: #000; }

/* documents: blank implant rows are not printed; sticker photos print */
.doc table.imp tr.blank { display: none !important; }
.doc .sticker img { max-width: 60mm !important; max-height: 40mm !important; border: 1px solid #555 !important; }

/* only what is filled in prints (documents.js marks the rest .blank before printing) */
.doc .blank { display: none !important; }
.doc .ghost { display: none !important; }
/* patient advice sheet: printed alone */
body.printing-sheet #docBody, body.printing-sheet .doctools, body.printing-sheet #ghostBar { display: none !important; }
body.printing-sheet #sheetHost { display: block !important; }
body.printing-csheet #v-cond > .inner > :not(#csheet) { display: none !important; }
body.printing-csheet #csheet { display: block !important; }
/* prescription: the A4 page alone */
.rxprint{display:block !important;font:12pt/1.5 "Noto Sans","Nirmala UI","Mangal",system-ui,sans-serif}
.rxprint .rxlh{border-bottom:1.5px solid #000;padding-bottom:4mm;margin-bottom:4mm}
.rxprint .rxlines li{margin:2mm 0}
.rxprint .rxt{width:100%;border-collapse:collapse;margin:3mm 0;font-size:10.5pt}
.rxprint .rxt th,.rxprint .rxt td{border:1px solid #666;padding:1.5mm 2mm;vertical-align:top;text-align:left}
.rxprint .rxt th{background:#eee !important;font-size:9pt}
.rxprint .rxt .c{text-align:center;white-space:nowrap}.rxprint .rxt .pat{font-size:12pt;font-weight:700;letter-spacing:.05em}
.rxprint .rxstrip{border:1px solid #999;padding:1mm 2mm;font-size:10pt}
.rxprint .rxwarnbox{border:1.5px solid #000;padding:2mm 3mm;margin:3mm 0}.rxprint .rxwarnbox ul{margin:1mm 0 0;padding-left:5mm}
.rxprint .rxreview{font-size:12pt}
.rxprint.paper-A5{font-size:10pt}.rxprint.paper-A5 .rxt{font-size:9pt}
.dcprint .dct{border-collapse:collapse;width:100%;margin:2mm 0;font-size:10.5pt}
.dcprint .dct th{text-align:left;width:35mm;padding:.8mm 2mm;border-bottom:1px solid #ccc}.dcprint .dct td{padding:.8mm 2mm;border-bottom:1px solid #ccc}
.dcprint h3{margin:3mm 0 1mm;font-size:11.5pt;border-bottom:1px solid #000}
/* print on the hospital's own paper: the free area only (pages.js sets @page per hospital and paper) */
body.printing-test > :not(#testHost){display:none !important}
body.printing-test #testHost{display:block !important}
.testpage .tp-box{border:1px solid #000;min-height:240mm;padding:3mm;box-sizing:border-box;position:relative;font:10pt system-ui,sans-serif}
.testpage .tp-mark{border-top:1px dashed #888;height:10mm;font-size:8pt;color:#555}
body.printing-round .rxedit{display:none !important}
body.printing-round .roundprint{display:block !important;font:11pt/1.45 "Noto Sans",system-ui,sans-serif}
body.printing-opd .rxedit{display:none !important}
body.printing-opd .opdprint{display:block !important}
.rxprint .tl{font-size:9.5pt}
/* OPD visit: compact, one A4 page where possible (only filled sections are printed) */
.opdprint{font-size:10.5pt !important;line-height:1.35 !important}
.opdprint p{margin:1.2mm 0}.opdprint .rxlh{padding-bottom:2mm;margin-bottom:2mm}
.opdprint .rxt{margin:2mm 0;font-size:9.5pt}.opdprint .rxt td,.opdprint .rxt th{padding:1mm 1.5mm}.opdprint .rxt small{font-size:8pt}
.opdprint .invbox{border:1px solid #666;padding:1.2mm 2mm;margin:2mm 0}
.opdprint .dct{border-collapse:collapse;width:100%;margin:2mm 0}.opdprint .dct th{text-align:left;width:38mm;vertical-align:top;padding:1mm 2mm;border-bottom:1px solid #ccc}.opdprint .dct td{padding:1mm 2mm;border-bottom:1px solid #ccc}
/* printed codes: UHID barcode top right; condition QR beside the diagnosis; website QR at the foot (printcodes.js) */
.rxprint .ubc{float:right;text-align:center;font-size:7.5pt;line-height:1.1;margin:0 0 1mm 3mm}.rxprint .ubc svg{display:block}
.rxprint .pqr{float:right;width:30mm;text-align:center;font-size:7.5pt;line-height:1.2;margin:0 0 1mm 3mm}.rxprint .pqr svg{display:block;margin:0 auto}
.rxprint .fqr{display:flex;align-items:center;gap:2mm;font-size:8pt;margin-top:3mm;float:right}
.rxprint .rxadv{margin:0 0 2mm;padding-left:5mm}.rxprint .rxadv small{color:#444}
.rxprint .sigs{clear:both}
.rxprint .rxt{clear:both}   /* the condition QR floats beside the diagnosis lines only, never squeezing the Rx table (B12) */
.doc .pv-hide{display:none !important}
.doc .printval{display:block;white-space:pre-wrap;word-break:break-word;border-bottom:1px solid #555;padding:1px 0;min-height:1.2em}
/* the whole ward round of one hospital (v27): one box per patient, never split across pages */
body.printing-rsheet #main > .inner, body.printing-rsheet #main > div > .inner{display:none !important}
body.printing-rsheet .roundsheet{display:block !important;font:10.5pt/1.4 "Noto Sans",system-ui,sans-serif}
.roundsheet p{margin:1mm 0}.roundsheet .rsp{border:1px solid #888;border-radius:2mm;padding:1.5mm 2.5mm;margin:2mm 0;break-inside:avoid}
.roundsheet .rsp .dx{font-style:italic}.roundsheet .rsnot{margin-top:3mm}
/* v28: the second copy starts on a new sheet and says whose it is */
.copy2{break-before:page;page-break-before:always;position:relative}
/* v52 (end-to-end test: the label printed alone on a blank sheet — 5 sheets instead of 4): the label takes no line of its
   own, and the copy's first page does not ask for a second break. */
/* v58: the label has its own small line at the top of the second copy — it never sits over a letterhead, header or title
   (each overlay fix met another first line: title, letterhead box, prescription header). */
.copylabel{position:static;display:block;margin:0 0 1mm;text-align:right;font-weight:700;font-size:8pt;line-height:1.1}
.copy2 > :not(.copylabel):first-of-type, .copy2 > :not(.copylabel):first-of-type > :first-child{break-before:auto !important;page-break-before:auto !important;margin-top:0}
/* v29: condition advice sheet printed from the Conditions screen */
body.printing-csheet #main > .inner > :not(#csheet) { display: none !important; }
body.printing-csheet #csheet { display: block !important; }

/* v53 (end-to-end test): the ledger screens hold names, UHIDs and amounts — never printed from the browser either. */
.inner.ledger { display: none !important; }
/* v55: the "Surgeon's copy" label keeps its own corner — the first block and title stop short of it. */
/* v56–v57 padded .copytitle here; with the label on its own line (v58) nothing needs padding. */

/* v100: typed notes (founder 6 Nov 2026) — one sheet in the note type's order */
body.printing-note #main > .inner, body.printing-note #main > div > .inner > :not(#ntHost){display:none !important}
body.printing-note #ntHost{display:block !important}
.ntprint{display:none}
.notesheet{font:10.5pt/1.4 "Noto Sans",system-ui,sans-serif}
.notesheet .nttitle{text-align:center;margin:0 0 2mm;letter-spacing:.04em}
.notesheet .ntprov{text-align:center;border:1.5px solid #000;padding:1mm;margin:0 0 2mm;letter-spacing:.1em}
.notesheet .nthead{display:flex;flex-wrap:wrap;gap:1mm 6mm;border-bottom:1px solid #555;padding-bottom:1.5mm;margin-bottom:2mm}
.notesheet .ntsec{margin:1.5mm 0;break-inside:avoid}.notesheet .nth{margin:0}.notesheet .ntl{margin:0 0 0 5mm;white-space:pre-wrap}
.notesheet .ntnr{font-style:italic}
.notesheet .nttab{border-collapse:collapse;margin:1mm 0 1mm 5mm;font-size:9.5pt;width:calc(100% - 5mm);table-layout:auto;word-break:break-word}.notesheet .nttab th,.notesheet .nttab td{border:1px solid #666;padding:.6mm 1.5mm;text-align:left;vertical-align:top}
.notesheet .nttab th:first-child,.notesheet .nttab td:first-child{white-space:nowrap;word-break:normal;width:1%}

.notesheet .ntprose{margin:1mm 0}.notesheet .ntin{margin-left:8mm;font-weight:600}

.notesheet .sigs{display:flex;justify-content:space-between;align-items:flex-end;gap:8mm}.notesheet .ntsealbox{width:30mm;height:22mm;border:1px dashed #777;border-radius:2mm}
