:root{--p:#1F3A68;--pd:#14264A;--a:#E3902A;--a2:#F2B45C;--tint:#EEF2F8;--tint2:#C9D4E6;--ink:#18222C;--warn:#c62828}
/* Prescription sheet: drawn at 794 x 1123 px = A4 at 96 dpi (from theme/Prescription_Palettes.html, Navy & Saffron) */
.rx-preview{background:#d9dee5;padding:16px;flex:none}
.rx-preview .frame{width:min(100%,794px);margin:0 auto;aspect-ratio:210/297;position:relative;overflow:hidden;box-shadow:0 2px 14px rgba(0,0,0,.25);background:#fff}
@media print{.sheet{position:relative!important;width:210mm!important;height:297mm!important;overflow:hidden;-webkit-print-color-adjust:exact;print-color-adjust:exact}}
.sheet .lh .logo{height:100px;object-fit:contain}
/* ---------- A4 sheet, drawn at 794 x 1123 px and scaled ---------- */
.sheet{position:absolute;left:0;top:0;width:794px;height:1123px;transform-origin:0 0;background:#fff;color:var(--ink);font-family:var(--body);font-size:14px;line-height:1.35;display:flex;flex-direction:column}
.sheet .topbar{height:10px;display:flex}.sheet .topbar i:first-child{flex:7;background:var(--p)}.sheet .topbar i:last-child{flex:3;background:var(--a)}
.sheet .lh{display:flex;gap:18px;padding:26px 38px 12px;align-items:flex-start}
.sheet .lh .logo{width:84px;flex:none}
.sheet .lh .who{flex:1;min-width:0}
.sheet .name{font-family:var(--display);font-weight:800;font-size:40px;line-height:1;color:var(--p);letter-spacing:-.5px}
.sheet .name em{font-style:normal;color:var(--a)}
.sheet .tagline{font-family:var(--display);font-size:12.5px;letter-spacing:2px;color:var(--a);margin:6px 0 8px;text-transform:uppercase;font-weight:500}
.sheet .spec{font-family:var(--display);font-size:12px;white-space:nowrap;color:var(--p);font-weight:500}
.sheet .quals{font-size:12.5px;color:#4a5560;margin-top:4px}
.sheet .quals b{color:var(--ink);font-weight:600}
.sheet .lh .side{width:200px;flex:none;border-left:2px solid var(--tint2);padding-left:14px;font-size:12.5px;display:flex;flex-direction:column;gap:3px}
.sheet .side .cl{font-family:var(--display);font-weight:700;font-size:11.5px;letter-spacing:1px;color:var(--a);text-transform:uppercase}
.sheet .side .ph{font-family:var(--display);font-weight:700;font-size:15px;color:var(--ink);line-height:1.2}
.sheet .side .rg{color:#4a5560;margin-top:4px}.side .rg b{color:var(--ink)}
.sheet .ecg{margin:0 38px;height:22px}
.sheet .band{margin:8px 38px 0;background:var(--tint);display:flex;align-items:stretch;gap:14px;padding:12px 16px}
.sheet .band .pt{flex:1;min-width:0}
.sheet .pt .pn{font-family:var(--display);font-size:20px;font-weight:600}
.sheet .pt .pd{color:#4a5560;font-size:13.5px}
.sheet .pt .demo{color:var(--warn);font-size:11px;font-weight:600;letter-spacing:.5px;margin-top:2px}
.sheet .band .dt{text-align:right;display:flex;flex-direction:column;justify-content:center}
.sheet .dt .d{font-family:var(--display);font-weight:600;font-size:15px}
.sheet .dt .dl{font-size:11px;color:#4a5560;letter-spacing:.5px}
.sheet .bc{background:#fff;padding:4px 6px 2px;display:flex;flex-direction:column;align-items:center;justify-content:center;width:150px;flex:none}
.sheet .bc svg{width:138px;height:34px;display:block}
.sheet .bc span{font-size:9.5px;letter-spacing:1px;color:#333;font-family:var(--display)}
.sheet .cols{display:flex;gap:30px;padding:16px 38px 0}
.sheet .cols>div{flex:1;min-width:0}
.sheet .lbl{font-family:var(--display);font-size:11.5px;font-weight:600;letter-spacing:1px;color:var(--p);text-transform:uppercase;margin-bottom:3px}
.sheet .lbl span{text-transform:none;letter-spacing:0;font-family:var(--body)}
.sheet .big{font-size:16px;font-weight:500}.sheet .sm{color:#4a5560;font-size:13px;margin-top:2px}
.sheet .gap{height:12px}
.sheet .res{display:flex;flex-direction:column;gap:4px}
.sheet .res div{display:flex;align-items:center;gap:8px;font-size:14px}
.sheet .res div b{margin-left:auto;font-weight:600;font-variant-numeric:tabular-nums}
.sheet .dot{width:10px;height:10px;border-radius:50%;flex:none}
.sheet .ok{background:#2e9b55}.sheet .wa{background:#d99a11}.sheet .hi{background:#d23b3b}
.sheet .key{font-size:10.5px;color:#5b6773;margin-top:4px;display:flex;gap:10px;align-items:center}
.sheet .key .dot{width:7px;height:7px;display:inline-block;margin-right:3px}
.sheet .rx{font-family:Georgia,serif;font-size:36px;font-weight:700;color:var(--a);padding:12px 38px 0;line-height:1}
.sheet table{margin:6px 38px 0;width:calc(100% - 76px);border-collapse:collapse;font-size:14px}
.sheet th{background:var(--p);color:#fff;font-family:var(--display);font-weight:500;font-size:12px;text-align:center;padding:6px 6px;line-height:1.2}
.sheet th:first-child{text-align:left;padding-left:12px}
.sheet th span{display:block;font-family:var(--body);font-weight:400;opacity:.9}
.sheet td{padding:9px 6px;text-align:center;border-bottom:1px solid var(--tint2)}
.sheet td:first-child{text-align:left;padding-left:12px;font-weight:600;font-size:14.5px}
.sheet tr:nth-child(even) td{background:var(--tint)}
.sheet .n1{display:inline-grid;place-items:center;width:26px;height:26px;border-radius:50%;background:var(--p);color:#fff;font-weight:600;font-size:13px}
.sheet .dash{color:#b9c1c8}
.sheet .wh{font-size:12.5px;line-height:1.2}.sheet .wh span{display:block;color:#5b6773}
.sheet .days{font-family:var(--display);font-weight:600;font-size:15px}
.sheet .adv{padding:12px 38px 0}
.sheet .adv ul{margin:2px 0 0;padding-left:18px;font-size:13.5px}
.sheet .adv li::marker{color:var(--a)}
.sheet .alert{margin:12px 38px 0;background:#fdecec;border-left:4px solid #c62828;padding:9px 14px;color:#a11d1d}
.sheet .alert b{font-family:var(--display);font-weight:600;font-size:14.5px}
.sheet .alert div{font-size:13px}
.sheet .next{margin:10px 38px 0;background:var(--tint);border-left:4px solid var(--p);padding:9px 14px;display:flex;align-items:baseline;gap:18px}
.sheet .next .v{font-family:var(--display);font-weight:700;font-size:22px;color:var(--ink)}
.sheet .sig{margin-top:auto;padding:0 38px 10px;display:flex;justify-content:space-between;align-items:flex-end;gap:20px}
.sheet .sig .em{color:#b22424;font-size:12.5px;line-height:1.35}.sheet .sig .em b{font-weight:600}
.sheet .sig .s{text-align:right;border-top:1.5px solid var(--ink);padding-top:5px;width:200px;font-size:12px;color:#4a5560}
.sheet .sig .s b{display:block;color:var(--ink);font-family:var(--display);font-size:14px}
.sheet .svc{margin:0 38px;border-top:1px solid var(--tint2);padding:6px 0;font-size:10.5px;color:#4a5560;text-align:center}
.sheet .svc i{color:var(--a);font-style:normal;padding:0 4px}
.sheet .foot{background:var(--pd);color:#fff;padding:12px 38px 8px;display:flex;gap:20px;border-top:4px solid var(--a)}
.sheet .foot .ad{flex:1;font-size:12px;line-height:1.45}
.sheet .foot .ad b{font-family:var(--display);font-size:14.5px;display:block}
.sheet .foot .op{font-size:12px;display:grid;grid-template-columns:auto auto;column-gap:14px;row-gap:1px;align-content:start}
.sheet .foot .op .t{grid-column:1/-1;font-family:var(--display);font-size:10.5px;letter-spacing:1.5px;color:var(--a2);font-weight:600}
.sheet .foot .op b{font-weight:600}.foot .op .c{color:var(--a2)}
.sheet .fine{background:var(--pd);color:rgba(255,255,255,.65);font-size:9.5px;text-align:center;padding:0 0 6px}
.sheet table.rt{width:100%;border-collapse:collapse;margin:0;font-size:13.5px}
.sheet table.rt th{background:none;color:#5b6773;font-size:10px;font-weight:500;text-align:right;padding:0 6px 2px;border:0}
.sheet table.rt td{padding:3px 6px;border:0;background:none;vertical-align:top}
.sheet table.rt tr:nth-child(odd) td{background:#f4f6fa}
.sheet table.rt td small{display:block;font-size:9.5px;color:#5b6773;font-weight:400}
.sheet table.rt td:first-child small{margin-left:15px}
.sheet table.rt td.ea,.sheet table.rt td.la{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.sheet table.rt .dot{width:8px;height:8px;display:inline-block;margin-right:6px;border-radius:50%;background:#c9d4e6}
.sheet .tx{font-size:12.5px;margin-top:3px}
.sheet .tests{font-size:14px}
.sheet table.rt .dot.ok{background:#2e9b55}.sheet table.rt .dot.wa{background:#d99a11}.sheet table.rt .dot.hi{background:#d23b3b}
.rx-preview .frame + .frame{margin-top:16px}
.sheet.c1 td{padding:6px 6px}.sheet.c1 .cols{padding-top:10px}.sheet.c1 .adv{padding-top:8px}.sheet.c1 .adv ul{font-size:12.5px}.sheet.c1 .rx{padding-top:6px;font-size:30px}.sheet.c1 .next{margin-top:8px;padding:6px 14px}
.sheet .cont{margin:10px 38px 0;font-size:12px;color:#5b6773;font-style:italic}.sheet .cont.r{text-align:right;margin-top:auto;margin-bottom:6px}
.sheet .cont.r + .sig{margin-top:0}
@media print{.sheet + .sheet{break-before:page;page-break-before:always}}

.sheet .dgms{display:flex;gap:12px;margin-top:4px}.sheet .dgms img{width:62mm;height:62mm;object-fit:contain;border:1px solid #dde3ea;border-radius:6px}
.sheet.c1 .dgms img{width:52mm;height:52mm}

/* OT note sheet */
.sheet.ot .blankhead{height:170px;flex:none}.sheet.ot .blankfoot{height:120px;flex:none}
.sheet.ot .band .dl{font-family:var(--display);font-size:11px;letter-spacing:1.5px;color:var(--a);font-weight:700}
.sheet.ot .dt .mk{font-size:9px;color:#a7b0b9;margin-top:2px}
.sheet.ot .otb{flex:1;min-height:0;overflow:hidden;padding:10px 38px 0}
.sheet.ot .otkv{width:100%;border-collapse:collapse;font-size:13.5px}
.sheet.ot .otkv th{width:150px;text-align:left;color:#56636f;font-weight:600;padding:3px 0;vertical-align:top;background:none}
.sheet.ot .otkv td{padding:3px 0}.sheet.ot .otkv td.st{font-weight:700;font-size:15px}
.sheet.ot .otsec{margin-top:10px}.sheet.ot .otsec .lbl{border-bottom:1.5px solid var(--tint2);padding-bottom:2px;margin-bottom:4px}
.sheet.ot .otsec p{margin:0 0 4px;white-space:pre-wrap;font-size:13.5px}
.sheet.ot .otsec ul,.sheet.ot .otsec ol{margin:0;padding-left:20px;font-size:13.5px}
.sheet.ot .otsec li.warn{color:#a61b1b;font-weight:700}
.sheet.ot .otims{display:flex;flex-wrap:wrap;gap:10px}.sheet.ot .otims img{height:200px;max-width:100%;object-fit:contain;border:1px solid #cfd8de}
.sheet.ot .otsig{display:flex;justify-content:flex-end;margin-top:26px}.sheet.ot .otsig div{border-top:1.5px solid var(--ink);padding-top:4px;width:220px;text-align:right;font-size:12px;color:#56636f}.sheet.ot .otsig b{display:block;color:var(--ink);font-size:14px}
.sheet.ot .pgno{text-align:right;font-size:10px;color:#56636f;padding:2px 38px}
.sheet.ot .otkv{margin:0}.sheet.ot .otkv tr,.sheet.ot .otkv tr:nth-child(even) td,.sheet.ot .otkv td{background:none!important;text-align:left;border:0;color:var(--ink)}
.sheet.ot .otkv th{border:0;font-family:var(--body);text-transform:none;letter-spacing:0;font-size:13px}

/* bill: A5 landscape (210 x 148 mm) */
.rx-preview .frame.a5 { aspect-ratio: 210/148; }
.sheet.bill { height: 560px; font-size: 12.5px; padding: 0 30px 14px; box-sizing: border-box; }
.sheet.bill .topbar { margin: 0 -30px; }
.sheet.bill .blh { display: flex; align-items: center; gap: 12px; padding: 12px 0 8px; border-bottom: 2px solid var(--p, #1F3A68); min-height: 74px; box-sizing: border-box; }
.sheet.bill .blh.blank { border-bottom: 0; min-height: 96px; }
.sheet.bill .blh .logo { height: 56px; }
.sheet.bill .blh .w { flex: 1; }
.sheet.bill .blh .nm { font-family: var(--display); font-weight: 700; font-size: 21px; color: #1F3A68; line-height: 1.1; }
.sheet.bill .blh .nm em { font-style: normal; color: #E3902A; }
.sheet.bill .blh .s { font-size: 10.5px; color: #56636f; }
.sheet.bill .blh .r { text-align: right; }
.sheet.bill .blh .cl { font-family: var(--display); font-weight: 700; color: #E3902A; font-size: 12px; letter-spacing: .5px; }
.sheet.bill .blh .ph { font-weight: 700; font-size: 13px; }
.sheet.bill .bband { background: #EEF2F8; padding: 6px 10px; margin-top: 8px; }
.sheet.bill .bband .row1, .sheet.bill .bband .row2 { display: flex; gap: 8px; align-items: baseline; }
.sheet.bill .bband .row1 { justify-content: space-between; }
.sheet.bill .bband .t { font-family: var(--display); color: #1F3A68; font-size: 14px; letter-spacing: .5px; }
.sheet.bill .bband .pn { font-size: 16px; }
.sheet.bill .bband .row2 span { color: #56636f; font-size: 11.5px; }
.sheet.bill .bband .demo { margin-left: auto; color: #C62828 !important; font-weight: 700; font-size: 10px !important; }
.sheet.bill table.bt { width: 100%; border-collapse: collapse; margin: 8px 0 0; font-size: 12.5px; }
.sheet.bill table.bt th { background: #1F3A68; color: #fff; font-weight: 700; padding: 4px 8px; text-align: center; font-size: 11.5px; }
.sheet.bill table.bt td { padding: 4px 8px; text-align: center; border: 0; font-weight: 400; font-size: 12.5px; }
.sheet.bill table.bt tr:nth-child(even) td { background: #EEF2F8; }
.sheet.bill table.bt .l { text-align: left; } .sheet.bill table.bt .r { text-align: right; }
.sheet.bill table.bt .dc { color: #1E6B34; font-size: 11px; }
.sheet.bill.tight table.bt td { padding: 2px 8px; font-size: 11.5px; }
.sheet.bill .bfoot { display: flex; gap: 20px; border-top: 2px solid #9aa5b0; margin-top: 6px; padding-top: 8px; }
.sheet.bill .bfoot .lft { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.sheet.bill .words { color: #56636f; font-size: 11px; }
.sheet.bill .payh { font-weight: 700; color: #1F3A68; font-size: 10.5px; margin-top: 4px; }
.sheet.bill .pr { display: flex; justify-content: space-between; max-width: 280px; }
.sheet.bill .bal { margin-top: 6px; padding: 6px 10px; font-weight: 700; font-size: 14px; }
.sheet.bill .bal.due { background: #FDE9E9; color: #A61B1B; } .sheet.bill .bal.ok { background: #E7F4EA; color: #1E6B34; }
.sheet.bill .tot { width: 300px; display: flex; flex-direction: column; gap: 3px; }
.sheet.bill .tot div { display: flex; justify-content: space-between; gap: 10px; }
.sheet.bill .tot .big { font-size: 16px; font-weight: 700; border-top: 1px solid #cfd8de; padding-top: 4px; }
.sheet.bill .bsig { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; }
.sheet.bill .bsig div { text-align: center; border-top: 1px solid #56636f; padding-top: 3px; min-width: 190px; font-size: 10.5px; color: #56636f; }
.sheet.bill .bsig b { display: block; color: #16232f; font-size: 11.5px; }
@page billa5 { size: 210mm 148mm; margin: 0; }
@media print { .sheet.bill { page: billa5; width: 210mm !important; height: 148mm !important; } }
