.clinic-letterhead{display:flex;align-items:center;gap:4mm;line-height:1.4;border-bottom:1px solid #cbd5e1;padding-bottom:3mm;margin-bottom:3mm;overflow-wrap:anywhere}
.clinic-logo{width:48mm;max-height:20mm;object-fit:contain;flex-shrink:0}
.printed-receipt{box-sizing:border-box;width:128mm;max-width:100%;padding:6mm;background:white;color:#111;margin:1rem auto;font-size:11pt;line-height:1.6;overflow-wrap:anywhere}
.printed-receipt h2{text-align:center;font-size:17pt}.printed-receipt table{width:100%;border-collapse:collapse}
.printed-receipt th,.printed-receipt td{padding:1.5mm 1mm;border-bottom:1px solid #ccc;text-align:left}.printed-receipt td:last-child,.printed-receipt th:last-child{text-align:right}
.printed-receipt .receipt-void{color:#b42318;border:3px solid #b42318;font-weight:800;font-size:14pt;text-align:center;padding:2mm;transform:rotate(-2deg)}.printed-receipt .receipt-words{text-align:right;font-weight:600}
.receipt-date{display:block}.receipt-signature{margin-top:15mm}.legacy-document{font-size:9pt}
.medication-label{box-sizing:border-box;width:80mm;height:50mm;padding:3mm;background:white;color:#111;display:flex;flex-direction:column;font-size:9pt;line-height:1.25;overflow-wrap:anywhere;margin:4mm auto;border:1px solid #aaa}
.label-header{font-size:8pt}.label-brand{display:flex;gap:2mm;align-items:center}.label-brand .clinic-logo{width:24mm;height:7mm}.label-patient{font-weight:700;margin:1mm 0}
.label-brand .clinic-letterhead{margin:0;padding:0;border:0;gap:0}.label-brand .clinic-letterhead>div:empty{display:none}
.label-header{display:flow-root}.label-header>.label-qr{float:right;margin:0 0 1mm 1.5mm}.label-header>.label-qr~.label-brand{display:block}.label-qr{width:16mm;text-align:center;line-height:1.15}.label-qr a{display:block;padding:0!important;min-height:0!important;min-width:0!important}.label-qr img{display:block;width:16mm;height:16mm;max-width:none}.label-qr span{display:block;font-size:5.5pt;margin-top:.3mm}
.medication-label p{font-size:9pt;line-height:1.25;margin:1mm 0}
.label-product{font-size:9pt;font-weight:700}.label-form{font-size:7.5pt;font-weight:400}.label-body{flex:1 0 auto}.label-directions{white-space:pre-wrap;margin:.5mm 0;font-size:11pt!important;font-weight:800;line-height:1.2!important}.label-indication,.label-warning{white-space:pre-wrap;margin:.3mm 0!important;font-size:7.5pt!important;line-height:1.2!important}.label-warning{font-weight:700}.label-flow:empty{display:none}.label-footer{font-size:7pt}
.label-template{height:auto;min-height:50mm}.label-template[hidden]{display:none}
.medication-label,.printed-receipt{font-family:"Noto Sans Thai Looped",sans-serif}
.medication-label{padding:calc(3mm + var(--print-offset-y,0mm)) calc(3mm - var(--print-offset-x,0mm)) calc(3mm - var(--print-offset-y,0mm)) calc(3mm + var(--print-offset-x,0mm))}
.medication-label.print-large .label-directions{font-size:14pt!important}.medication-label.print-large .label-indication,.medication-label.print-large .label-warning,.medication-label.print-large .label-timing{font-size:9pt!important}
.label-address{font-size:7pt}.label-timing,.label-safety{font-size:7.5pt!important;line-height:1.3!important}
.printed-receipt[data-receipt-paper="A4"]{width:190mm}.printed-receipt.print-large{font-size:14pt}
@page clinicReceipt{size:A5 portrait;margin:10mm}
@page medicationLabel{size:80mm 50mm;margin:0}
@media print{
body:has(.medical-certificate){page:medicalCertificate}
html:has(.medical-certificate),body:has(.medical-certificate),body:has(.medical-certificate) :is(.clinic-shell,.app-shell__frame,.app-shell__main,.app-shell__content,.workspace){margin:0!important;padding:0!important;min-height:0!important;height:auto!important;display:block!important;background:white!important}
html:has(.printed-receipt),html:has(.medication-label),body:has(.printed-receipt),body:has(.medication-label),body:has(.printed-receipt) :is(.clinic-shell,.app-shell__frame,.app-shell__main,.app-shell__content,.workspace),body:has(.medication-label) :is(.clinic-shell,.app-shell__frame,.app-shell__main,.app-shell__content,.workspace){margin:0!important;padding:0!important;min-height:0!important;height:auto!important;display:block!important;background:white!important}
body:has(.printed-receipt){page:clinicReceipt}
body:has(.medication-label){page:medicationLabel}
body:has(.printed-receipt) .app-shell__frame,body:has(.medication-label) .app-shell__frame{height:auto!important;min-height:0!important;padding:0!important}
.printed-receipt{page:clinicReceipt;width:128mm;max-width:none;padding:0;margin:0;font-size:11pt}
.printed-receipt{position:relative;left:var(--print-offset-x,0mm);top:var(--print-offset-y,0mm)}
.printed-receipt thead{display:table-header-group}.printed-receipt tr,.clinic-letterhead{break-inside:avoid}
.medication-label{page:medicationLabel;width:80mm;height:50mm;margin:0;border:0;break-after:page;break-inside:avoid}
.medication-label:last-child{break-after:auto}
.label-template{display:none!important}
body:has(.printed-receipt) .no-print,body:has(.medication-label) .no-print{display:none!important}
body:has(.printed-receipt) .workspace,body:has(.medication-label) .workspace{padding:0!important;margin:0!important}
}
@media print {
  body:has(.appointment-card) { page:clinical-appointment; }
  body:has(.handout-paper) { page:clinical-handout; }
  html:has(.appointment-card),html:has(.handout-paper),body:has(.appointment-card),body:has(.handout-paper),body:has(.appointment-card) :is(.clinic-shell,.app-shell__frame,.app-shell__main,.app-shell__content,.workspace),body:has(.handout-paper) :is(.clinic-shell,.app-shell__frame,.app-shell__main,.app-shell__content,.workspace) { margin:0!important;padding:0!important;min-height:0!important;height:auto!important;display:block!important;background:white!important; }
}
