/* =====================================================================
   70-docs.css: printable and shared documents (views/docs.js)
   Diet chart (one / two columns), prescription, invoice, expired link.
   Everything is scoped to body.doc (docLayout, always the light theme);
   the print page rules use the named page "doc", so other printouts
   (recipe card, patient page) keep their own @page settings. Type is set in points so the screen sheet matches the A4
   print. Print rules: ink carries meaning, hairline tables, no page fills
   except the letterhead rule, brand mark and macro bar (exact colour).
   ===================================================================== */

/* ---------------- desk + sheet (screen) ---------------- */
body.doc{background:var(--bg-sunken);color:var(--text);font-size:var(--fs-base);page:doc}
body.doc .desk{display:block;padding:28px 16px 64px}
body.doc .paper{
  --d-2xs:7pt;--d-xs:7.5pt;--d-sm:8.5pt;--d-base:9.5pt;--d-md:10.5pt;--d-lg:12pt;--d-title:15pt;--d-display:16pt;--d-name:19pt;--d-hero:20pt;
  --d-hair:1px;--d-line:var(--border);--d-rule:var(--border-strong);--d-pad-y:5px;
  position:relative;display:flex;flex-direction:column;
  width:210mm;max-width:100%;min-height:297mm;margin:0 auto;padding:13mm 14mm 11mm;
  background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:var(--r-xs);box-shadow:var(--shadow-md);
  font-size:var(--d-base);line-height:1.45;font-variant-numeric:tabular-nums;
}
body.doc p{margin:0}
body.doc .paper :lang(bn){line-height:1.55}

/* ---------------- toolbar (screen only) ---------------- */
body.doc .doc-bar{position:sticky;top:0;z-index:20;background:var(--bg-sunken);border-bottom:1px solid var(--border)}
body.doc .doc-bar-in{display:flex;align-items:center;gap:10px;flex-wrap:nowrap;max-width:calc(210mm + 32px);margin:0 auto;padding:9px 16px}
body.doc .doc-bar-in>*{flex-shrink:0}
body.doc .doc-bar-title{flex:1 1 0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--fs-sm);font-weight:500;color:var(--text-2)}
body.doc .doc-bar-lay{display:flex;align-items:center;gap:10px}
body.doc .doc-bar-lbl{display:none}
body.doc .doc-back{margin-left:-8px;padding:0 10px}
body.doc .doc-back+.doc-bar-title{padding-left:10px;border-left:1px solid var(--border)}
body.doc .doc-bar-brand{display:inline-flex;align-items:center;gap:8px;padding-right:12px;border-right:1px solid var(--border);font-size:var(--fs-base);font-weight:650;letter-spacing:-.02em;color:var(--text);white-space:nowrap}
body.doc .doc-bar .seg a{height:26px;padding:0 11px}
body.doc .doc-print .i{margin-left:-2px}

/* ---------------- brand mark (L.brandMark, token fills; dm-<px> sets the size) ---------------- */
body.doc .doc-mark{display:inline-block;flex-shrink:0;vertical-align:middle;-webkit-print-color-adjust:exact;print-color-adjust:exact}
body.doc .doc-mark.dm-11{width:11px;height:11px}
body.doc .doc-mark.dm-20{width:20px;height:20px}
body.doc .doc-mark.dm-26{width:26px;height:26px}
body.doc .doc-mark.dm-34{width:34px;height:34px}

/* ---------------- letterhead ---------------- */
body.doc .lh{display:flex;justify-content:space-between;align-items:flex-start;gap:10mm;padding:0 0 9px;border-bottom:1.5pt solid var(--primary);-webkit-print-color-adjust:exact;print-color-adjust:exact}
body.doc .lh-who{display:flex;align-items:flex-start;gap:12px;min-width:0}
body.doc .lh-photo{width:15mm;height:15mm;border-radius:50%;object-fit:cover;border:1px solid var(--border);flex-shrink:0}
body.doc .lh-id{min-width:0}
body.doc .lh-name{margin:0 0 4px;font-family:var(--font-display);font-size:var(--d-name);font-weight:600;line-height:1.08;letter-spacing:-.012em;color:var(--text)}
body.doc .lh-cred{font-size:var(--d-sm);color:var(--text-2);line-height:1.4}
body.doc .lh-role{font-size:var(--d-sm);color:var(--text-2);line-height:1.4}
body.doc .lh-role .sep{color:var(--text-4)}
body.doc .lh-reach{flex:0 1 68mm;min-width:0;padding-top:2px}
body.doc .lh-reach p{display:flex;align-items:flex-start;gap:6px;margin:0 0 2px;font-size:var(--d-xs);line-height:1.45;color:var(--text-2)}
body.doc .lh-reach .i{width:1.3em;height:1.3em;margin-top:.12em;color:var(--text-4)}
body.doc .lh-reach a{color:inherit;text-decoration:none}
body.doc .lh-reach a:hover{color:var(--link);text-decoration:underline}
/* platform letterhead (invoice) */
body.doc .lh-brand .lh-who{align-items:center;gap:10px}
body.doc .lh-word{margin:0 0 2px;font-size:var(--d-title);font-weight:650;letter-spacing:-.02em;line-height:1.1;color:var(--text)}
body.doc .lh-word span{display:inline-block;margin-left:5px;padding:1px 4px;border-radius:3px;background:var(--primary-soft-2);color:var(--primary-text);font-size:.56em;font-weight:650;letter-spacing:.04em;vertical-align:.3em;-webkit-print-color-adjust:exact;print-color-adjust:exact}

/* ---------------- document title row ---------------- */
body.doc .doc-head{display:flex;justify-content:space-between;align-items:baseline;gap:8px 16px;flex-wrap:wrap;margin:13px 0 9px}
body.doc .doc-title{display:flex;align-items:baseline;flex-wrap:wrap;gap:0 7px;margin:0;font-size:var(--d-title);font-weight:600;line-height:1.25;letter-spacing:-.012em;color:var(--text)}
body.doc .doc-title-sep{color:var(--text-4);font-weight:400}
body.doc .doc-title-bn{font-size:.88em;font-weight:500;color:var(--text-2);letter-spacing:0}
body.doc .doc-ref{display:flex;gap:6px 14px;flex-wrap:wrap;font-size:var(--d-sm);color:var(--text-3)}
body.doc .doc-ref b{font-weight:600;color:var(--text)}

/* ---------------- label/value strip (patient, activities) ---------------- */
body.doc .pstrip{border:var(--d-hair) solid var(--border-input-hover);border-radius:var(--r-xs);overflow:hidden;margin:0 0 7px}
body.doc .pstrip dl{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));margin:0 -2px -2px 0}
body.doc .pstrip dl>div{min-width:0;padding:5px 9px 6px;border-right:var(--d-hair) solid var(--d-line);border-bottom:var(--d-hair) solid var(--d-line)}
body.doc .pstrip dl>.s2{grid-column:span 2}
body.doc .pstrip dl>.s3{grid-column:span 3}
body.doc .pstrip dl>.s4{grid-column:span 4}
body.doc .pstrip dt{margin:0 0 1px;font-size:var(--d-xs);line-height:1.3;color:var(--text-3)}
body.doc .pstrip dd{margin:0;font-size:var(--d-base);font-weight:500;line-height:1.35;color:var(--text);overflow-wrap:anywhere}
body.doc .pstrip .pv-name{font-size:var(--d-md);font-weight:600}
/* qualifier after a value (BMI category): the value's size, muted */
body.doc .pstrip .pstrip-q{margin-left:3px;font-weight:400;color:var(--text-3)}
body.doc .pstrip-act{margin:0}
body.doc .pstrip-act dt :lang(bn){margin-left:3px;color:var(--text-3)}

/* ---------------- assessment facts under the strip ---------------- */
body.doc .facts{display:flex;flex-direction:column;gap:1px;margin:0 0 3px;padding:0 1px;font-size:var(--d-sm);line-height:1.5;color:var(--text)}
body.doc .facts-g{display:flex;align-items:baseline;gap:0 8px;min-width:0}
body.doc .facts-k{flex:0 0 17mm;font-size:var(--d-xs);font-weight:500;color:var(--text-3)}
body.doc .metric-strip{display:flex;flex-wrap:wrap;gap:2px 14px}
body.doc .metric-strip b{margin-right:3px;font-weight:500;color:var(--text-3)}
body.doc .facts-d{color:var(--text-3)} /* date of a blood pressure / pulse reading from another day (views/docs.js) */
body.doc .paper>.facts:last-of-type{margin-bottom:0}

/* ---------------- sections ---------------- */
body.doc .doc-sec{margin:15px 0 0}
body.doc .paper h2.sec{display:flex;align-items:baseline;gap:6px;margin:0 0 5px;padding:0;border:0;font-size:var(--d-md);font-weight:600;line-height:1.3;letter-spacing:0;color:var(--text);break-after:avoid;page-break-after:avoid}
body.doc .sec-sep{color:var(--text-4);font-weight:400}
body.doc .sec-bn{font-size:var(--d-sm);font-weight:500;color:var(--text-3)}
body.doc .sec-count{font-size:var(--d-xs);font-weight:500;color:var(--text-3)}
body.doc .doc-empty{margin:12px 0;font-size:var(--d-base);color:var(--text-3)}
body.doc .nil{color:var(--text-4)}

/* PES as a two-column hairline list */
body.doc .pes{margin:0;border-top:.75pt solid var(--d-rule)}
body.doc .pes>div{display:grid;grid-template-columns:24mm minmax(0,1fr);gap:10px;padding:4px 0 5px;border-bottom:var(--d-hair) solid var(--d-line);break-inside:avoid}
body.doc .pes dt{font-size:var(--d-sm);color:var(--text-3);padding-top:.1em}
body.doc .pes dd{margin:0;font-size:var(--d-base);color:var(--text)}

/* ---------------- tables inside the sheet ---------------- */
body.doc .paper table{width:100%;min-width:0;border-collapse:collapse;border-spacing:0;font-size:var(--d-base);line-height:1.4;background:none}
body.doc .paper th,body.doc .paper td{height:auto;padding:var(--d-pad-y) 6px;vertical-align:top;text-align:left;background:none;border-bottom:var(--d-hair) solid var(--d-line);color:var(--text)}
body.doc .paper th{padding-top:2px;padding-bottom:4px;vertical-align:bottom;font-size:var(--d-xs);font-weight:500;letter-spacing:0;white-space:nowrap;color:var(--text-3);border-bottom:.75pt solid var(--d-rule)}
body.doc .paper th:first-child,body.doc .paper td:first-child{padding-left:0}
body.doc .paper th:last-child,body.doc .paper td:last-child{padding-right:0}
body.doc .paper th.num,body.doc .paper td.num{text-align:right;white-space:nowrap}
body.doc .paper th .u{margin-left:.25em;font-size:1em;color:var(--text-4)}
body.doc .paper tbody tr:hover>td{background:none}
body.doc .paper tbody tr:last-child>td{border-bottom:0}
body.doc .paper td small{display:block;margin-top:1px;font-size:var(--d-xs);line-height:1.35;color:var(--text-3)}
body.doc .paper td :lang(bn),body.doc .paper td:lang(bn){font-size:calc(var(--d-base) + .5pt);line-height:1.5}

/* meal tables */
body.doc .meal-block{margin:14px 0 0;break-inside:avoid;page-break-inside:avoid}
body.doc .meals>.meal-block:first-child{margin-top:9px}
body.doc .paper h3.meal{display:flex;align-items:baseline;gap:8px;margin:0 0 1px;font-size:var(--d-md);font-weight:600;line-height:1.3;letter-spacing:0;color:var(--text);break-after:avoid;page-break-after:avoid}
body.doc .meal-bn{font-size:var(--d-sm);font-weight:500;color:var(--text-3)}
body.doc .meal .kcal{margin-left:auto;font-size:var(--d-base);font-weight:600;white-space:nowrap}
body.doc .mt .c-sl{width:3%;color:var(--text-3)}
body.doc .mt .c-bn{width:22%}
body.doc .mt .c-amt{width:16%}
body.doc .mt .c-m{width:6.5%}
body.doc .mt .c-k{width:7%;font-weight:600}
body.doc .paper .mt .a-g{display:inline;margin:0 0 0 2px;white-space:nowrap}
body.doc .mt th.c-k{font-weight:500}
body.doc .mt .f-en{display:block}
body.doc .mt .f-bn{display:block;color:var(--text-2)}
body.doc .mt .f-note{font-style:normal}
body.doc .mt .a-q{display:inline}
body.doc .mt tr.is-manual td.c-food .f-en{color:var(--text)}
/* "or / অথবা" alternative divider */
body.doc .mt tr:has(+ tr.or-row)>td{border-bottom:0}
body.doc .mt tr.or-row>td{padding:0 0 1px;border-bottom:0}
body.doc .or-l{display:flex;align-items:center;gap:6px;font-size:var(--d-xs);line-height:1.2;color:var(--text-3)}
body.doc .or-l::before,body.doc .or-l::after{content:"";flex:1 1 auto;border-top:var(--d-hair) dashed var(--border-input-hover)}
body.doc .or-l::before{flex:0 0 3%}
body.doc .or-l span:lang(bn){font-size:var(--d-xs);line-height:1.2}
body.doc .mt-legend{margin:6px 0 0;font-size:var(--d-xs);color:var(--text-3)}

/* ---------------- daily totals + macro split ---------------- */
body.doc .totals-wrap{display:grid;grid-template-columns:minmax(0,1fr) 62mm;gap:0 8mm;align-items:start}
body.doc .paper:not(.paper-2col) .totals-wrap:has(>.msplit:only-child){grid-template-columns:62mm}
body.doc .tt td:first-child{color:var(--text-2)}
body.doc .paper .tt tfoot th,body.doc .paper .tt tfoot td{padding-top:5px;border-top:.75pt solid var(--text);border-bottom:0;font-size:var(--d-base);font-weight:600;color:var(--text);vertical-align:top}
body.doc .msplit{padding:8px 10px 9px;border:var(--d-hair) solid var(--border-input-hover);border-radius:var(--r-xs);break-inside:avoid;page-break-inside:avoid}
body.doc .ms-k{font-size:var(--d-xs);color:var(--text-3)}
body.doc .ms-v{display:flex;align-items:baseline;gap:4px;margin:1px 0 0;font-size:var(--d-display);font-weight:600;line-height:1.15;letter-spacing:-.015em}
body.doc .ms-v .u{margin:0;font-size:var(--d-sm);letter-spacing:0}
body.doc .ms-sub{font-size:var(--d-sm);color:var(--text-3)}
body.doc .ms-h{margin:9px 0 0;font-size:var(--d-xs);color:var(--text-3)}
/* energy bar + swatches are the shared .macbar / .mac-dot (macro colours), set to print size here:
   a 6px bar split by 1px paper gaps (no track), 7px swatches spaced by the legend grid */
body.doc .ms-bar{gap:1px;height:6px;margin:3px 0 6px;border-radius:2px;background:none;-webkit-print-color-adjust:exact;print-color-adjust:exact}
body.doc .ms-bar>span{min-width:2px}
/* one-column chart: three columns, swatch + label over the share */
body.doc .ms-leg{display:grid;grid-template-columns:repeat(3,auto);justify-content:space-between;gap:0 8px;margin:0;padding:0;list-style:none;font-size:var(--d-sm)}
body.doc .ms-leg li{display:grid;grid-template-columns:7px auto;align-items:center;gap:0 5px;min-width:0}
body.doc .ms-leg li .ms-p{grid-column:2}
body.doc .ms-leg i{width:7px;height:7px;margin:0;-webkit-print-color-adjust:exact;print-color-adjust:exact} /* .mac-dot; the fiber row's bare <i> is a blank spacer */
body.doc .ms-l{color:var(--text-2)}
body.doc .ms-p{font-weight:600}
/* with grams (two-column chart): one row per macro, fiber in grams only */
body.doc .ms-leg-g{display:block}
body.doc .ms-leg-g li{grid-template-columns:7px minmax(0,1fr) auto 2.8em;gap:5px;padding:1px 0}
body.doc .ms-leg-g li .ms-p{grid-column:auto;text-align:right}
body.doc .ms-g{text-align:right;color:var(--text-3)}
body.doc .ms-fib{margin-top:1px}
body.doc .ms-kv{margin:8px 0 0;padding:6px 0 0;border-top:var(--d-hair) solid var(--d-line)}
body.doc .ms-kv>div{display:flex;justify-content:space-between;align-items:baseline;gap:10px;padding:1px 0}
body.doc .ms-kv dt{font-size:var(--d-sm);color:var(--text-3);white-space:nowrap}
body.doc .ms-kv dd{margin:0;text-align:right;font-weight:500}
body.doc .ms-kv small{display:block;font-size:var(--d-2xs);font-weight:400;line-height:1.3;color:var(--text-3)}
/* water + oil on their own (chart without food items) */
body.doc .ms-kv-solo{max-width:92mm;margin:0;padding:0;border-top:.75pt solid var(--d-rule)}
body.doc .ms-kv-solo>div{padding:4px 0 5px;border-bottom:var(--d-hair) solid var(--d-line)}

/* ---------------- tests, suggestions ---------------- */
body.doc .checklist{margin:0;padding:0;list-style:none;columns:2;column-gap:8mm;font-size:var(--d-base)}
body.doc .checklist li{position:relative;padding:2px 0 2px 15px;break-inside:avoid}
body.doc .checklist li::before{content:"";position:absolute;left:0;top:.52em;width:7px;height:7px;border:.75pt solid var(--text-3);border-radius:1.5px}
body.doc .sugg{font-size:var(--d-base);line-height:1.6;color:var(--text)}
body.doc .sugg h1,body.doc .sugg h2,body.doc .sugg h3,body.doc .sugg h4{margin:9px 0 2px;font-size:var(--d-base);font-weight:600;line-height:1.45;letter-spacing:0;color:var(--text-2)}
body.doc .sugg>:first-child{margin-top:3px}
body.doc .sugg p{margin:0 0 5px;orphans:3;widows:3}
body.doc .sugg ul,body.doc .sugg ol{margin:3px 0 6px;padding-left:18px}
body.doc .sugg li{margin:0 0 1px;padding-left:2px}
body.doc .sugg a{color:var(--text);text-decoration:underline}
/* mostly-Bangla advice carries lang="bn": keep the block rhythm over the generic :lang(bn) line-heights */
body.doc .paper .sugg:lang(bn){line-height:1.6}
body.doc .paper .sugg :lang(bn){line-height:inherit}
body.doc .paper .sugg :lang(bn):is(h1,h2,h3,h4){line-height:1.45}

/* ---------------- next visit (views/docs.js nextVisitHtml), just above the signature ---------------- */
body.doc .doc-next{display:flex;align-items:baseline;flex-wrap:wrap;gap:2px 10px;width:fit-content;max-width:100%;margin:15px 0 0;padding:6px 12px 6px 10px;border:.75pt solid var(--border-strong);border-radius:var(--r-sm);break-inside:avoid;page-break-inside:avoid}
body.doc .doc-next>.i{align-self:center;color:var(--text-3)}
body.doc .doc-next-k{font-size:var(--d-sm);font-weight:600;color:var(--text)}
body.doc .doc-next-k [lang="bn"]{font-weight:500;color:var(--text-2)}
body.doc .doc-next-v{font-size:var(--d-base);font-weight:600;color:var(--text)}
body.doc .doc-next-d{font-size:var(--d-sm);color:var(--text-3)}
body.doc .doc-next+.sign{margin-top:10mm}

/* ---------------- signature + footer ---------------- */
body.doc .sign{display:flex;justify-content:space-between;align-items:flex-end;gap:10mm;margin:14mm 0 9mm;break-inside:avoid;page-break-inside:avoid}
body.doc .seal{display:grid;place-items:center;width:34mm;height:19mm;border:.75pt dashed var(--border-strong);border-radius:var(--r-sm);font-size:var(--d-xs);color:var(--text-4)}
body.doc .sign-line{min-width:60mm;padding-top:5px;border-top:.75pt solid var(--text);text-align:right}
body.doc .sign-name{font-size:var(--d-base);font-weight:600}
body.doc .sign-role,body.doc .sign-cred{font-size:var(--d-sm);color:var(--text-2)}
body.doc .doc-foot{display:flex;justify-content:space-between;align-items:center;gap:6px 16px;flex-wrap:wrap;margin-top:auto;padding-top:6px;border-top:var(--d-hair) solid var(--d-line);font-size:var(--d-xs);color:var(--text-3)}
body.doc .df-brand{display:inline-flex;align-items:center;gap:5px}
body.doc .df-meta{text-align:right}

/* ---------------- diet chart: two-column compact ---------------- */
body.doc .paper-2col{--d-xs:7pt;--d-sm:7.5pt;--d-base:8.5pt;--d-md:9.5pt;--d-pad-y:3px}
body.doc .paper-2col .mt td:lang(bn),body.doc .paper-2col .mt td :lang(bn){font-size:var(--d-base);line-height:1.4}
body.doc .meal-2col .f-bn{font-size:var(--d-sm);line-height:1.4}
body.doc .paper-2col .sugg{font-size:var(--d-base);line-height:1.55}
body.doc .paper-2col .sugg:lang(bn){line-height:1.55}
body.doc .paper-2col .sugg ul,body.doc .paper-2col .sugg ol{padding-left:14px}
body.doc .dc2{display:grid;grid-template-columns:32% minmax(0,1fr);gap:0;margin-top:12px;align-items:start}
body.doc .dc2-left{padding-right:5mm}
body.doc .dc2-right{padding-left:5mm;border-left:var(--d-hair) solid var(--d-line)}
body.doc .dc2-left>.doc-sec:first-child,body.doc .dc2-right>.doc-sec:first-child{margin-top:0}
body.doc .paper-2col .doc-sec{margin-top:12px}
body.doc .paper-2col .meal-block{margin-top:10px}
body.doc .paper-2col .meals>.meal-block:first-child{margin-top:5px}
body.doc .paper-2col .pes>div{grid-template-columns:1fr;gap:0}
body.doc .paper-2col .totals-wrap{grid-template-columns:1fr}
body.doc .paper-2col .msplit{padding:7px 8px 8px}
body.doc .paper-2col .ms-leg{grid-template-columns:1fr}
body.doc .paper-2col{--d-display:14pt}
body.doc .paper-2col .checklist{columns:1}
body.doc .paper-2col .pstrip-act dl{grid-template-columns:repeat(2,minmax(0,1fr))}
body.doc .paper-2col .sign{margin-top:10mm}
/* fixed column grid so the five meal tables line up as one */
body.doc .paper .meal-2col{table-layout:fixed}
body.doc .paper .meal-2col th,body.doc .paper .meal-2col td{padding-left:3px;padding-right:3px}
body.doc .paper .meal-2col th:first-child,body.doc .paper .meal-2col td:first-child{padding-left:0}
body.doc .paper .meal-2col th:last-child,body.doc .paper .meal-2col td:last-child{padding-right:0}
body.doc .meal-2col .c-sl{width:4%}
body.doc .meal-2col .c-amt{width:20%}
body.doc .meal-2col .c-m{width:8%}
body.doc .meal-2col .c-k{width:9%}
body.doc .meal-2col .c-food{overflow-wrap:anywhere}

/* ---------------- prescription ---------------- */
body.doc .rx-body{display:grid;grid-template-columns:31% minmax(0,1fr);margin-top:14px;align-items:stretch}
body.doc .rx-left{padding-right:6mm}
body.doc .rx-main{padding-left:6mm;border-left:var(--d-hair) solid var(--d-line)}
body.doc .rx-left>.doc-sec:first-child,body.doc .rx-main>.doc-sec:first-child{margin-top:0}
body.doc .rx-dl{margin:0}
body.doc .rx-dl>div{padding:4px 0 5px;border-bottom:var(--d-hair) solid var(--d-line);break-inside:avoid}
body.doc .rx-dl>div:first-child{border-top:.75pt solid var(--d-rule)}
body.doc .rx-dl dt{font-size:var(--d-xs);color:var(--text-3)}
body.doc .rx-dl dd{margin:0;font-size:var(--d-base)}
body.doc .rx-growth .metric-strip{display:block;border-top:.75pt solid var(--d-rule)}
body.doc .rx-growth .metric-strip span{display:block;padding:3px 0 4px;border-bottom:var(--d-hair) solid var(--d-line);font-size:var(--d-sm)}
body.doc .rx-left .checklist{columns:1}
body.doc .paper h2.rx-h{align-items:center;gap:7px;margin-bottom:6px}
body.doc .rx-sym{display:block;flex-shrink:0;width:var(--d-display);height:var(--d-display);color:var(--text)}
body.doc .rx-table .c-sl{width:4%}
body.doc .rx-table .c-dose{width:12%}
body.doc .paper .rx-table th.c-dose,body.doc .paper .rx-table td.c-dose{padding-left:3px;padding-right:3px;text-align:center;white-space:normal;overflow-wrap:break-word}
body.doc .paper .rx-table td.c-dose:last-child,body.doc .paper .rx-table th.c-dose:last-child{padding-right:0}
body.doc .rx-table .med-name{display:block;font-size:var(--d-md);font-weight:600;line-height:1.35}
body.doc .rx-table .med-dose{display:block;font-size:var(--d-sm);color:var(--text-2)}
body.doc .rx-table .med-note{display:block;margin-top:2px;font-size:var(--d-sm);color:var(--text-2)}
body.doc .rx-table tbody td{padding-top:6px;padding-bottom:7px}
body.doc .rx-main .sugg-sec{margin-top:16px}

/* ---------------- invoice ---------------- */
body.doc .inv-head{align-items:flex-start;margin:18px 0 14px}
body.doc .inv-head .doc-title{font-size:var(--d-hero)}
body.doc .inv-no{margin-top:3px;font-size:var(--d-lg);font-weight:500;color:var(--text-2);letter-spacing:.01em}
body.doc .paid-label{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap;margin:4px 0 0;padding:6px 11px;border:1pt solid var(--primary);border-radius:var(--r-sm);font-size:var(--d-sm);color:var(--primary-text);-webkit-print-color-adjust:exact;print-color-adjust:exact}
body.doc .paid-label b{font-weight:600}
body.doc .paid-label .pl-trx{padding-left:8px;border-left:var(--d-hair) solid var(--primary-soft-border);color:var(--text-2)}
body.doc .paid-label .pl-trx .mono{color:var(--text);font-weight:500}
body.doc .inv-meta{display:grid;grid-template-columns:minmax(0,1fr) 72mm;gap:0 12mm;padding:10px 0 12px;margin:0 0 14px;border-top:.75pt solid var(--d-rule);border-bottom:var(--d-hair) solid var(--d-line)}
body.doc .inv-meta p{font-size:var(--d-sm);color:var(--text-2);line-height:1.5;overflow-wrap:anywhere}
body.doc .inv-meta .im-k{margin:0 0 4px;font-size:var(--d-xs);color:var(--text-3)}
body.doc .inv-meta .im-name{font-size:var(--d-md);font-weight:600;color:var(--text)}
body.doc .im-dl{margin:0}
body.doc .im-dl>div{display:flex;justify-content:space-between;gap:8px;padding:1px 0;font-size:var(--d-sm)}
body.doc .im-dl dt{color:var(--text-3)}
body.doc .im-dl dd{margin:0;text-align:right;color:var(--text);font-weight:500}
body.doc .inv-lines .c-q{width:30%;color:var(--text-2)}
body.doc .inv-lines td.num{width:24%}
body.doc .inv-lines tbody td{padding-top:7px;padding-bottom:7px}
body.doc .inv-lines tbody tr:last-child>td{border-bottom:var(--d-hair) solid var(--d-line)}
body.doc .inv-total{display:flex;justify-content:flex-end;margin:0}
body.doc .inv-total dl{width:52%;margin:0}
body.doc .it-row{display:flex;justify-content:space-between;align-items:baseline;gap:12px;padding:9px 0 8px;border-bottom:1.5pt solid var(--text)}
body.doc .it-row dt{font-size:var(--d-md);font-weight:600}
body.doc .it-row dd{margin:0;font-size:var(--d-display);font-weight:600;letter-spacing:-.015em}
body.doc .it-cur{margin-right:5px;font-weight:500;color:var(--text-2)}
body.doc .inv-note{margin:22px 0 10mm;font-size:var(--d-sm);color:var(--text-3)}

/* ---------------- expired link (screen card) ---------------- */
body.doc .desk-center{display:grid;place-items:center;min-height:100vh;padding:24px 16px}
body.doc .paper-note{display:block;width:132mm;min-height:0;padding:30px 32px 28px;border-radius:var(--r-lg);font-size:var(--fs-base)}
body.doc .note-brand{display:flex;align-items:center;gap:9px;margin:0 0 28px;font-size:var(--fs-base);font-weight:650;letter-spacing:-.02em}
body.doc .note-title{margin:0 0 10px;font-family:var(--font-display);font-size:var(--fs-3xl);font-weight:600;line-height:1.15;letter-spacing:-.015em}
body.doc .note-text{margin:0 0 10px;font-size:var(--fs-md);line-height:1.6;color:var(--text-2)}
body.doc .note-bn{font-size:var(--fs-md);line-height:1.75}
body.doc .note-help{margin-top:22px;padding-top:18px;border-top:1px solid var(--border)}
body.doc .note-k{margin:0 0 8px;font-size:var(--fs-sm);font-weight:500;color:var(--text)}
body.doc .note-contact{display:flex;flex-wrap:wrap;gap:8px}
body.doc .note-contact a{display:inline-flex;align-items:center;gap:8px;min-height:36px;padding:0 12px;border:1px solid var(--border-input);border-radius:var(--r-sm);background:var(--surface);font-size:var(--fs-sm);font-weight:500;color:var(--text);text-decoration:none}
body.doc .note-contact a:hover{background:var(--surface-2);border-color:var(--border-input-hover)}
body.doc .note-contact .i{color:var(--text-3)}
body.doc .note-hours{margin:8px 0 0;font-size:var(--fs-sm);color:var(--text-3)}

/* ---------------- phones (screen only; print keeps the A4 layout) ---------------- */
@media screen and (max-width:760px){
  body.doc .desk{padding:0 0 40px}
  body.doc .paper{width:100%;min-height:0;padding:22px 16px 18px;border-width:0 0 1px;border-radius:0;box-shadow:none}
  /* toolbar scrolls away with the page; row 1 back/brand + print, row 2 the print-layout switch */
  body.doc .doc-bar{position:static}
  body.doc .doc-bar-in{flex-wrap:wrap;padding:8px 12px;gap:8px}
  body.doc .doc-bar-title{display:none}
  body.doc .doc-print{margin-left:auto}
  body.doc .paper .mt td{min-width:0;overflow-wrap:anywhere}
  body.doc .doc-bar-lay{order:3;width:100%}
  body.doc .doc-bar-lbl{display:block;font-size:var(--fs-xs);color:var(--text-3);white-space:nowrap}
  body.doc .doc-bar .seg{flex:1 1 auto;display:flex;min-width:0}
  body.doc .doc-bar .seg a{flex:1;justify-content:center}
  body.doc .lh{flex-direction:column;gap:8px}
  body.doc .lh-reach{flex:none;width:100%}
  /* contact rows at least 24px tall, so the phone and email links are comfortable tap targets
     (the negative block margin keeps the text where it sat against the name and the letterhead rule) */
  body.doc .lh-reach{margin:-5px 0}
  body.doc .lh-reach p{margin:0}
  body.doc .lh-reach p>:is(a,span){min-height:24px;padding:5px 0}
  body.doc .lh-reach .i{margin-top:calc(.12em + 5px)}
  body.doc .pstrip dl{grid-template-columns:repeat(2,minmax(0,1fr))}
  body.doc .pstrip dl>.s2,body.doc .pstrip dl>.s3,body.doc .pstrip dl>.s4{grid-column:auto}
  body.doc .pstrip dl>.ms2{grid-column:span 2}
  body.doc .facts-g{flex-wrap:wrap}
  body.doc .facts-k{flex-basis:100%}
  body.doc .totals-wrap,body.doc .dc2,body.doc .rx-body{grid-template-columns:1fr}
  body.doc .dc2{margin-top:15px}
  body.doc .paper:not(.paper-2col) .totals-wrap:has(>.msplit:only-child){grid-template-columns:1fr}
  body.doc .msplit{margin-top:12px}
  body.doc .dc2-left{padding-right:0}
  body.doc .dc2-right{order:-1;padding-left:0;border-left:0}
  body.doc .dc2-left{margin-top:4px}
  body.doc .dc2-left>.doc-sec:first-child{margin-top:15px}
  body.doc .rx-main{order:-1;padding:0;border-left:0}
  body.doc .rx-left{margin-top:16px;padding:14px 0 0;border-top:var(--d-hair) solid var(--d-line)}
  body.doc .checklist{columns:1}
  body.doc .pes>div{grid-template-columns:1fr;gap:0}
  body.doc .inv-meta{grid-template-columns:1fr;gap:12px}
  body.doc .inv-total dl{width:100%}
  body.doc .sign{gap:12px;margin-top:10mm}
  body.doc .seal{display:none}
  body.doc .sign-line{min-width:0;flex:1}
  body.doc .doc-foot{flex-direction:column;align-items:flex-start}
  body.doc .df-meta{text-align:left}
  body.doc .paper-note{padding:24px 20px;border-width:1px;border-radius:var(--r-lg)}
  body.doc .desk-center{padding:16px}
  body.doc .note-title{font-size:var(--fs-2xl)}

  /* meal tables reflow into stacked rows: name + kcal, Bangla, amount, macro line */
  body.doc .paper .mt thead{display:none}
  body.doc .paper .mt,body.doc .paper .mt tbody{display:block;width:100%}
  body.doc .paper .mt tr{display:grid;grid-template-columns:18px auto auto auto minmax(0,1fr) auto;column-gap:12px;padding:8px 0;border-bottom:var(--d-hair) solid var(--d-line)}
  body.doc .paper .mt tbody tr:last-child{border-bottom:0}
  body.doc .paper .mt td{display:block;width:auto;padding:0;border:0;text-align:left}
  body.doc .paper .mt .c-sl{grid-column:1;grid-row:1 / span 4}
  body.doc .paper .mt .c-food{grid-column:2 / 6;grid-row:1;font-weight:500}
  body.doc .paper .mt td.c-k{grid-column:6;grid-row:1;text-align:right}
  body.doc .paper .mt td.c-k::after{content:" kcal";font-weight:400;color:var(--text-3)}
  body.doc .paper .mt .c-bn{grid-column:2 / 7;grid-row:2;color:var(--text-2)}
  body.doc .paper .mt .c-bn:empty{display:none}
  body.doc .paper .mt .c-amt{grid-column:2 / 7;grid-row:3;margin-top:2px;color:var(--text-2)}
  body.doc .paper .mt .c-amt .a-q,body.doc .paper .mt .c-amt small{display:inline;margin:0 0 0 0}
  body.doc .paper .mt .c-amt small{margin-left:6px}
  body.doc .paper .mt td.c-m{grid-row:4;margin-top:3px;font-size:var(--d-sm);white-space:nowrap}
  body.doc .paper .mt td.c-m::before{content:attr(data-l) " ";color:var(--text-3)}
  body.doc .paper .mt tr.is-manual td.c-m{display:none}
  body.doc .paper .mt tr.is-manual td.c-k::after{content:none}
  body.doc .paper .mt.meal-2col .c-sl{grid-row:1 / span 3}
  body.doc .paper .mt.meal-2col .c-amt{grid-row:2}
  body.doc .paper .mt.meal-2col td.c-m{grid-row:3}
  body.doc .paper .mt.meal-2col .f-bn{font-weight:400}
  body.doc .paper .mt tr.or-row{display:block;padding:2px 0;border-bottom:0}
  body.doc .paper .mt tr.or-row td{display:block}
  /* an item, its "or" and the alternative are one choice (one serial number): no rule line inside the group, as on paper */
  body.doc .paper .mt tr:has(+ tr.or-row){border-bottom:0}
  body.doc .or-l::before{flex:0 0 18px}
  body.doc .mt-legend{display:none}
  /* daily totals reflow the same way: meal + kcal, then a wrapping macro line */
  body.doc .paper .tt thead{display:none}
  body.doc .paper .tt,body.doc .paper .tt tbody,body.doc .paper .tt tfoot{display:block;width:100%}
  body.doc .paper .tt tr{display:flex;flex-wrap:wrap;align-items:baseline;gap:1px 12px;padding:7px 0;border-bottom:var(--d-hair) solid var(--d-line)}
  body.doc .paper .tt tr::after{content:"";order:1;flex:0 0 100%;height:0}
  body.doc .paper .tt tbody tr:last-child{border-bottom:0}
  body.doc .paper .tt tbody>tr>*,body.doc .paper .tt tfoot>tr>*{display:block;padding:0;border:0;text-align:left;font-size:var(--d-base)}
  body.doc .paper .tt .c-l{flex:1 1 auto;min-width:0;font-weight:500;color:var(--text)}
  body.doc .paper .tt td.c-k{margin-left:auto;text-align:right;font-weight:600}
  body.doc .paper .tt td.c-k::after{content:" kcal";font-weight:400;color:var(--text-3)}
  body.doc .paper .tt td.c-m{order:2;font-size:var(--d-sm);color:var(--text-2)}
  body.doc .paper .tt td.c-m::before{content:attr(data-l) " ";color:var(--text-3)}
  body.doc .paper .tt tfoot tr{padding-top:8px;border-top:.75pt solid var(--text);border-bottom:0}
  body.doc .paper .tt tfoot .c-l,body.doc .paper .tt tfoot td.c-k{font-weight:600}
  body.doc .paper .tt tfoot td.c-m{font-weight:500}
  /* prescription rows: medicine, then the five dose slots with labels */
  body.doc .paper .rx-table tr{grid-template-columns:18px repeat(5,minmax(0,1fr))}
  body.doc .paper .rx-table .c-med{grid-column:2 / 7;grid-row:1;font-weight:400}
  body.doc .paper .rx-table .c-sl{grid-row:1 / span 2}
  body.doc .paper .rx-table td.c-dose{grid-row:2;margin-top:6px;text-align:left;font-size:var(--d-sm)}
  body.doc .paper .rx-table td.c-dose::before{content:attr(data-l);display:block;font-size:var(--d-xs);color:var(--text-3)}
  body.doc .paper .inv-lines .c-q{width:34%}
}
@media screen and (max-width:379px){
  body.doc .doc-print .dp-x{display:none}
}

/* ---------------- print: A4 (named page "doc", so only these documents use it) ---------------- */
@page doc{
  size:A4;margin:12mm 14mm 15mm 14mm;
  @bottom-left{font-family:"Onest","Hind Siliguri","Segoe UI",sans-serif;font-size:7pt;color:var(--text-3);white-space:nowrap;vertical-align:top;padding-top:4mm}
  @bottom-right{content:"Page " counter(page) " of " counter(pages);font-family:"Onest","Hind Siliguri","Segoe UI",sans-serif;font-size:7pt;color:var(--text-3);white-space:nowrap;text-align:right;vertical-align:top;padding-top:4mm}
}
@media print{
  html:has(body.doc),body.doc{background:none}
  body.doc .desk,body.doc .desk-center{display:block;min-height:0;padding:0}
  body.doc .paper{--d-hair:.5pt;--d-line:var(--border-input);display:block;width:auto;max-width:none;min-height:0;margin:0;padding:0;border:0;border-radius:0;box-shadow:none}
  body.doc .paper-note{width:auto}
  body.doc .paper table{overflow:visible}
  body.doc .paper thead{display:table-header-group}
  body.doc .paper tfoot{display:table-row-group}
  body.doc .paper tr,body.doc .pstrip,body.doc .facts,body.doc .inv-meta,body.doc .inv-total,body.doc .lh{break-inside:avoid;page-break-inside:avoid}
  /* a meal longer than a page: never break inside an item / "or" / alternative group, so an alternative (no number of its own) never starts a page alone */
  body.doc .paper .mt tr:has(+ tr.or-row),body.doc .paper .mt tr.or-row{break-after:avoid;page-break-after:avoid}
  body.doc .paper h2,body.doc .paper h3{break-after:avoid;page-break-after:avoid}
  body.doc .paper p,body.doc .paper li{orphans:3;widows:3}
  body.doc .tests-sec,body.doc .act-sec,body.doc .pes-sec{break-inside:avoid;page-break-inside:avoid}
  body.doc .sign{margin:10mm 0 0}
  body.doc .doc-foot{display:none}
  body.doc .paper a{color:var(--text);text-decoration:none}
}

/* ---- parity round ---- */
/* the patient's copy (/p/…, /r/…): how to keep a PDF on a phone, the in-app browser notice, Save a copy (screen only) */
.doc-help{max-width:1080px;margin:0 auto;padding:6px 20px 10px;display:flex;flex-wrap:wrap;align-items:center;gap:6px 16px;font-size:13px;color:var(--text-2)}
.doc-help p{display:flex;align-items:flex-start;gap:6px;margin:0;line-height:1.6}
.doc-help-pdf{display:none}
@media (max-width:760px){.doc-help-pdf{display:flex}}
.doc-inapp{display:flex;flex-direction:column;gap:6px;width:100%;padding:10px 12px;border:1px solid var(--warn-bd);border-radius:var(--r-md);background:var(--warn-bg);color:var(--warn-tx)}
.doc-inapp[hidden]{display:none}
.doc-save{margin-left:auto}
.doc-linkoff{margin:0 6px 0 auto}
@media print{.doc-help,.doc-inapp,.doc-save,.doc-linkoff{display:none!important}}
/* "Latest lab results" on a printed chart or prescription */
.labs-sec .labs-meta{margin:0 0 6px;font-size:12px;color:var(--text-2)}
.labs-tt .lab-ref{color:var(--text-3)}
/* invoice: Bangla beside the English labels */
.inv-bn{font-weight:400;color:var(--text-3)}
/* the target split next to "Target … kcal" (views/docs.js targetLine): it wraps between the parts, never inside one */
body.doc .ms-mac-i{white-space:nowrap}
/* ---- patient copy (lib/patientcopy.js, views/docs.js): Print options, Own pad, Hide numbers, Bangla only ---- */
/* Print options in the toolbar of the nutritionist's print page (screen only) */
body.doc .doc-opts{position:relative}
/* a closed menu takes no room at all (its links would otherwise still be laid out past the toolbar on phones) */
body.doc .doc-opts:not([open])>.menu{display:none}
body.doc .doc-opts[open]>summary{background:var(--pressed)}
body.doc .doc-opts-menu{width:300px;max-width:calc(100vw - 24px);padding:6px 12px 12px;text-align:left}
body.doc .doc-opts-menu .menu-label{padding:4px 0 2px}
body.doc .doc-opt{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:5px 0}
body.doc .doc-opt-k{font-size:var(--fs-sm);color:var(--text-2)}
body.doc .doc-opts-menu .seg a{display:inline-flex;width:auto;height:26px;padding:0 10px;border-radius:6px;font-size:var(--fs-sm);color:var(--text-3)}
body.doc .doc-opts-menu .seg a.on{background:var(--surface);color:var(--text);box-shadow:var(--shadow-sm)}
body.doc .doc-opts-menu .seg a:not(.on):hover{background:transparent;color:var(--text)}
body.doc .doc-opt-note{margin:6px 0 0;font-size:var(--fs-xs);line-height:1.5;color:var(--text-3);white-space:normal}
body.doc .doc-opt-note a{display:inline;width:auto;height:auto;padding:0;border-radius:0;background:none;color:var(--link);font-size:inherit;white-space:normal;text-decoration:underline}
/* phones: the menu spans the toolbar, whatever the place of its button in the wrapped row */
@media screen and (max-width:760px){body.doc .doc-bar-in{position:relative}body.doc .doc-opts{position:static}body.doc .doc-opts-menu{left:12px;right:12px;width:auto;max-width:none}}
/* Own pad: the sheet keeps the pad's blank margins on screen too (print: the @page margins of views/docs.js padPage) */
@media screen{body.doc .paper.paper-pad{padding-top:var(--pad-top);padding-bottom:var(--pad-bottom)}}
body.doc .pad-guide{position:absolute;top:0;left:0;right:0;height:var(--pad-top);display:flex;align-items:flex-end;justify-content:center;padding:0 14mm 6px;border-bottom:1px dashed var(--border-input-hover);font-size:var(--fs-xs);color:var(--text-4);pointer-events:none}
/* Hide numbers: the two-column meal tables keep the food and the amount only */
body.doc .meal-2col.mt-nonum .c-amt{width:34%}
@media screen and (max-width:760px){
  /* Bangla only: the unit the reflowed rows add after the energy */
  body.doc .paper-bn .mt td.c-k::after,body.doc .paper-bn .tt td.c-k::after{content:" কিলোক্যালরি"}
}
/* ---- food exchange list handout (views/exchange.js handoutBody, lib/exchange.js): a sheet of its own after the diet chart
   (diet_charts.show_exchange) or on its own (/app/exchange/handout); Bangla, about two A4 pages, the foods in three columns ---- */
body.doc .paper-xh{--d-base:8.5pt;--d-sm:7.5pt;--d-xs:7pt;--d-md:9.5pt;margin-top:24px}
body.doc .paper-xh-solo{margin-top:0}
body.doc .paper-xh .xh-head{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 12px;margin:0 0 5px;padding:0 0 5px;border-bottom:.75pt solid var(--text)}
body.doc .paper-xh .xh-title{margin:0;font-size:var(--d-title);font-weight:600;line-height:1.3;letter-spacing:0;color:var(--text)}
body.doc .paper-xh .xh-who{font-size:var(--d-sm);line-height:1.4;color:var(--text-2)}
body.doc .paper-xh .xh-src{margin-left:auto;font-size:var(--d-xs);line-height:1.4;color:var(--text-3)}
body.doc .paper-xh .xh-lead,body.doc .paper-xh .xh-meas{margin:0 0 3px;font-size:var(--d-sm);line-height:1.45;color:var(--text-2)}
body.doc .paper-xh .xh-cols{columns:3;column-gap:5mm;column-rule:var(--d-hair) solid var(--d-line);margin:6px 0 0}
body.doc .paper-xh .xh-g{margin:0 0 5px}
body.doc .paper-xh .xh-gh{margin:0;padding:2px 0 0;font-size:var(--d-md);font-weight:600;line-height:1.3;letter-spacing:0;color:var(--text);break-after:avoid;page-break-after:avoid}
body.doc .paper-xh .xh-pe{margin:0 0 1px;font-size:var(--d-xs);line-height:1.35;color:var(--text-3);break-after:avoid;page-break-after:avoid}
body.doc .paper-xh .xh-items{margin:0;padding:0;list-style:none}
body.doc .paper-xh .xh-items li{margin:0;padding:1px 0;border-bottom:var(--d-hair) solid var(--d-line);font-size:var(--d-base);line-height:1.3;break-inside:avoid;page-break-inside:avoid}
body.doc .paper-xh .xh-items li:last-child{border-bottom:0}
body.doc .paper-xh .xh-n{font-weight:500}
body.doc .paper-xh .xh-h,body.doc .paper-xh .xh-x{font-size:var(--d-xs);line-height:1.3;color:var(--text-3)}
body.doc .paper-xh .xh-h::before,body.doc .paper-xh .xh-x::before{content:" · "}
body.doc .paper-xh .xh-m{display:inline-block;margin:0 0 0 4px;padding:0 4px;border:var(--d-hair) solid var(--text-3);border-radius:3px;font-size:var(--d-xs);line-height:1.3;color:var(--text-2);white-space:nowrap}
body.doc .paper-xh .xh-legend{margin:5px 0 0;padding:4px 0 0;list-style:none;border-top:var(--d-hair) solid var(--d-line);font-size:var(--d-xs);line-height:1.4;color:var(--text-2)}
body.doc .paper-xh .xh-legend .xh-m{margin:0 4px 0 0}
body.doc .paper-xh .xh-attr{margin:4px 0 0;font-size:var(--d-xs);line-height:1.4;color:var(--text-3)}
@media print{body.doc .paper-xh{break-before:page;page-break-before:always;margin-top:0}body.doc .paper-xh-solo{break-before:auto;page-break-before:auto}}
/* Own pad: the pad's blank top and bottom (45 / 15 mm by default) on every sheet leave less room, so the printed handout is set a
   little tighter there and still takes two A4 pages */
@media print{body.doc .paper-xh.paper-pad{--d-base:8pt}body.doc .paper-xh.paper-pad .xh-items li{padding:0;line-height:1.22}body.doc .paper-xh.paper-pad .xh-g{margin:0 0 3px}body.doc .paper-xh.paper-pad .xh-lead,body.doc .paper-xh.paper-pad .xh-meas{line-height:1.35}}
/* the list's three more foods (version 2026-10-05e): the foods a touch smaller, so every pad margin that gave the handout two
   pages still does (at 8 pt it took a third from a top and bottom of 63 mm together, 70 mm with Hide numbers; before, 66 / 74) */
@media print{body.doc .paper-xh.paper-pad{--d-base:7.8pt}}
@media screen and (max-width:760px){body.doc .paper-xh{--d-base:9.5pt;--d-sm:9pt;--d-xs:8.5pt;--d-md:11pt;margin-top:12px}body.doc .paper-xh .xh-cols{columns:1}body.doc .paper-xh .xh-src{margin-left:0}body.doc .paper-xh .xh-items li{padding:3px 0}}
/* ---- meal times (views/docs.js dietChartDoc): beside the meal's name, in the quiet ink of its Bangla name ---- */
body.doc .meal-time{display:inline-flex;align-items:baseline;gap:8px;font-size:var(--d-sm);font-weight:500;color:var(--text-3);white-space:nowrap;font-variant-numeric:tabular-nums}
/* phones (screen only): the time stays right after the meal's name and the energy comes last; what does not fit wraps whole
   (the energy, or the time with it) onto the next line, so the energy never comes between a meal and its time */
@media screen and (max-width:760px){body.doc .paper h3.meal:has(.meal-time){flex-wrap:wrap;row-gap:0}body.doc .meal-time-sep{display:none}}
/* ---- letterhead contact block (owner, 2026-10-06): the address, phone, email and opening hours sit against the right
   edge of the sheet, the block only as wide as its longest line (at most its 68 mm room above, wrapping there as
   before); the lines stay left-aligned with each other and the icons where they were. The room itself keeps its size,
   so the name side never moves; phones (the max-width:760px rule above: full width) and Own pad (no letterhead) as before ---- */
@media not screen and (max-width:760px){body.doc .lh-reach{display:grid;grid-template-columns:minmax(0,max-content);justify-content:end}}
/* ---- what to eat and avoid (views/docs.js guidanceHtml; lib/guidance.js): কী খাবেন on the left, কী খাবেন না on the right,
   পরামর্শ under them, bullets in the rhythm of the Suggestions; one list under the other in the two-column layout's narrow
   left side and on phones ---- */
body.doc .gd-cols{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 8mm}
body.doc .gd-cols>.gd-avoid{grid-column:2}
body.doc .gd-sec>.gd-advice{margin-top:4px}
body.doc .paper h3.gd-h{margin:2px 0 1px;font-size:var(--d-base);font-weight:600;line-height:1.45;letter-spacing:0;color:var(--text-2);break-after:avoid;page-break-after:avoid}
body.doc .gd-list{margin:0 0 4px;padding-left:18px;font-size:var(--d-base);line-height:1.55;color:var(--text)}
body.doc .gd-list li{margin:0 0 1px;padding-left:2px;line-height:inherit;break-inside:avoid;page-break-inside:avoid}
body.doc .paper-2col .gd-cols{grid-template-columns:minmax(0,1fr)}
body.doc .paper-2col .gd-cols>.gd-avoid{grid-column:auto}
body.doc .paper-2col .gd-list{padding-left:14px}
@media screen and (max-width:760px){body.doc .gd-cols{grid-template-columns:minmax(0,1fr)}body.doc .gd-cols>.gd-avoid{grid-column:auto}}
