/* The printed documents. Session 9 (Session 1 shipped the scaffold).

   Hand-written — NOT concatenated into app.css by build_css.py, but linked
   statically from index.html next to app.css and fonts.css, and precached
   by the service worker (Architecture.md §11). A print view mounting a
   <link> asynchronously would risk an unstyled Ctrl+P if it fired before
   the stylesheet resolved, and there is no second document to link it from.

   EVERY RULE HERE stays scoped under .print-doc, or lives inside @page /
   @media print. Only a print view renders .print-doc, so a static link
   costs the other twenty screens nothing.

   THE PAPER IS ALWAYS PAPER. None of the colours below are tokens. The app
   has a dark theme and this document does not — it is ink on white whatever
   the phone is set to, and `print-color-adjust: exact` keeps the tints when
   the browser would otherwise drop backgrounds. The five values are the
   ones lifted out of the source .docx: ink #3D1E0C, terracotta #B35732,
   muted #7C6A5E, tint #FAF6F2, rule #E4D9CC.

   NO BOLD ANYWHERE. There is no bold Karla (Architecture.md §11, H13) and a
   browser-synthesised one looks smeared at 8pt. Emphasis is uppercase,
   letter-spacing, colour and the tinted fills. */

@page{
  size:A4;
  margin:14mm;          /* Architecture.md §8 */

  /* Chrome renders no @page margin boxes, so this prints nothing there, and
     is correct where it is supported (and harmless where it is not). The
     page number people will actually get in Chrome comes from the browser's
     own "Headers and footers" checkbox — the preview screen says so, and
     STATUS.md records why there is no CSS way to do better.

     THE FOOTER IS IN FLOW, NOT FIXED. A fixed footer repeats on every page
     in Chromium but only by living in an enlarged bottom margin, and the
     10mm that costs is 10mm the real Kulkarni quotation needs to stay on
     ONE page — which it does, and which is the acceptance test. So the
     stamp, the studio line and the GST sentence sit at the end of the
     document. A two-page quotation carries them once, at the end. */
  @bottom-right{
    content:"Page " counter(page) " of " counter(pages);
    font-family:"Karla","Noto Sans",system-ui,sans-serif;
    font-size:8pt;
    color:#7C6A5E;
  }
}

/* ---- the document ---------------------------------------------------- */

.print-doc{
  --pd-ink:#3D1E0C;
  --pd-terracotta:#B35732;
  --pd-muted:#7C6A5E;
  --pd-tint:#FAF6F2;
  --pd-rule:#E4D9CC;

  position:relative;
  box-sizing:border-box;
  margin:0;
  padding:0;
  background:#fff;
  color:var(--pd-ink);
  font-family:"Newsreader","Noto Sans",system-ui,serif;
  font-size:9pt;
  line-height:1.42;
  -webkit-print-color-adjust:exact;
  print-color-adjust:exact;
}
.print-doc *{ box-sizing:border-box; }
.print-doc p{ margin:0; }
.print-doc h1,.print-doc h2,.print-doc h3{ margin:0; font-weight:400; }
.print-doc ul,.print-doc ol{ margin:0; padding:0; }

/* ---- header: the D2 stacked lockup + the studio block ---------------- */

.print-doc .pd-head{
  display:flex;
  align-items:center;
  gap:6mm;
  padding:0 0 2.4mm;
  border-bottom:1.2pt solid var(--pd-terracotta);
}
.print-doc .pd-lockup{
  width:14mm;
  height:auto;
  flex:0 0 auto;
  display:block;
}
.print-doc .pd-studio{ display:flex; flex-direction:column; gap:.6mm; min-width:0; }
.print-doc .pd-studio-name{
  font-family:"Marcellus","Noto Sans",system-ui,serif;
  font-size:14pt;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--pd-ink);
  line-height:1.1;
}
.print-doc .pd-studio-by{
  font-family:"Karla","Noto Sans",system-ui,sans-serif;
  font-size:7pt;
  letter-spacing:.42em;
  color:var(--pd-terracotta);
  margin-bottom:.8mm;
}
.print-doc .pd-studio-line{
  font-family:"Karla","Noto Sans",system-ui,sans-serif;
  font-size:7.5pt;
  color:var(--pd-muted);
  letter-spacing:.01em;
}

/* ---- title ----------------------------------------------------------- */

.print-doc .pd-title{ text-align:center; padding:2.2mm 0 1.8mm; }
.print-doc .pd-title h1{
  font-family:"Marcellus","Noto Sans",system-ui,serif;
  font-size:17pt;
  letter-spacing:.02em;
  color:var(--pd-ink);
  line-height:1.15;
}
.print-doc .pd-subtitle{
  font-family:"Karla","Noto Sans",system-ui,sans-serif;
  font-size:7.2pt;
  letter-spacing:.2em;
  text-transform:uppercase;
  color:var(--pd-terracotta);
  margin-top:1.2mm;
}

/* ---- the meta grid --------------------------------------------------- */

.print-doc .pd-meta{
  width:100%;
  border-collapse:collapse;
  table-layout:fixed;
  font-family:"Karla","Noto Sans",system-ui,sans-serif;
  font-size:8pt;
}
.print-doc .pd-meta th,
.print-doc .pd-meta td{
  border:.5pt solid var(--pd-rule);
  padding:1.1mm 2.2mm;
  text-align:left;
  vertical-align:top;
  word-break:break-word;
}
.print-doc .pd-meta th{
  width:27mm;
  background:var(--pd-tint);
  font-weight:400;
  font-size:6.6pt;
  letter-spacing:.07em;
  text-transform:uppercase;
  color:var(--pd-muted);
}
.print-doc .pd-meta td{ width:64mm; color:var(--pd-ink); }
.print-doc .pd-version{ color:var(--pd-muted); }
.print-doc .pd-draft-number{
  color:var(--pd-terracotta);
  letter-spacing:.1em;
  font-size:7.5pt;
}

/* ---- intro ----------------------------------------------------------- */

.print-doc .pd-intro{
  margin:2mm 0 2mm;
  font-size:8.4pt;
  line-height:1.45;
  color:var(--pd-ink);
}

/* ---- the finishes schedule (Session 19) ------------------------------------
   Same table system as the quotation's stage table, per room. One table per
   room so a room never splits its heading from its first row (see the print
   block: `.pd-section > h2` is break-after:avoid). Fixed column widths add up
   to less than the 182mm column; the item column takes the rest. */

.print-doc .pd-room{ margin-top:3.2mm; }
.print-doc .pd-finishes .pd-col-n{ width:8mm; }
.print-doc .pd-finishes-client th:nth-child(3),
.print-doc .pd-finishes-client td:nth-child(3),
.print-doc .pd-finishes-client th:nth-child(4),
.print-doc .pd-finishes-client td:nth-child(4){ width:26mm; }
.print-doc .pd-finishes-client th:nth-child(5),
.print-doc .pd-finishes-client td:nth-child(5){ width:20mm; }
.print-doc .pd-finishes-client th:nth-child(6),
.print-doc .pd-finishes-client td:nth-child(6){ width:30mm; }
.print-doc .pd-finishes-site th:nth-child(3),
.print-doc .pd-finishes-site td:nth-child(3),
.print-doc .pd-finishes-site th:nth-child(4),
.print-doc .pd-finishes-site td:nth-child(4){ width:22mm; }
.print-doc .pd-finishes-site th:nth-child(5),
.print-doc .pd-finishes-site td:nth-child(5){ width:17mm; }
.print-doc .pd-finishes-site th:nth-child(6),
.print-doc .pd-finishes-site td:nth-child(6){ width:32mm; }
.print-doc .pd-finishes-site th:nth-child(7),
.print-doc .pd-finishes-site td:nth-child(7){ width:22mm; }

/* ---- the client estimate and the purchase order (Session 22) ---------------
   Six columns: number, item (takes the rest), quantity, unit, rate, amount.
   One table per room, so a room never splits its heading from its first row;
   the header row repeats when a long room runs onto a second page. The
   summary table has its own two columns and must not split. */

.print-doc .pd-estimate .pd-col-n,
.print-doc .pd-po-lines .pd-col-n{ width:10.5mm; white-space:nowrap; }
.print-doc .pd-estimate .pd-col-qty,
.print-doc .pd-po-lines .pd-col-qty{
  width:17mm;
  text-align:right;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}
.print-doc .pd-estimate .pd-col-unit,
.print-doc .pd-po-lines .pd-col-unit{ width:15mm; }
.print-doc .pd-estimate .pd-col-fee,
.print-doc .pd-po-lines .pd-col-fee{ width:25mm; }
.print-doc .pd-estimate thead th.pd-col-qty,
.print-doc .pd-estimate thead th.pd-col-fee,
.print-doc .pd-po-lines thead th.pd-col-qty,
.print-doc .pd-po-lines thead th.pd-col-fee{ text-align:right; }
.print-doc .pd-room-total td{ font-weight:700; color:var(--pd-ink); }
.print-doc .pd-estimate-summary{ margin-top:4mm; break-inside:avoid; page-break-inside:avoid; }

/* ---- the vendor snag report (Session 20) -----------------------------------
   Five columns: number, location and work (takes the rest), before photo,
   fix-by date, and a tick box the vendor fills in on the site walk. The photo
   is capped by height so a portrait phone photo cannot make one row a page. */

.print-doc .pd-snags .pd-col-n{ width:8mm; }
.print-doc .pd-snags th:nth-child(3),
.print-doc .pd-snags td:nth-child(3){ width:34mm; }
.print-doc .pd-snags th:nth-child(4),
.print-doc .pd-snags td:nth-child(4){ width:24mm; }
.print-doc .pd-snags th:nth-child(5),
.print-doc .pd-snags td:nth-child(5){ width:14mm; text-align:center; }
.print-doc .pd-snag-text{ display:block; margin-top:.6mm; color:var(--pd-ink); }
.print-doc .pd-snag-photo img{
  display:block;
  max-width:100%;
  max-height:26mm;
  object-fit:contain;
}
.print-doc .pd-snag-critical .pd-stage{ font-weight:700; }
.print-doc .pd-tick{
  display:inline-block;
  width:5mm; height:5mm;
  border:.3mm solid var(--pd-ink);
}

/* ---- the stage table -------------------------------------------------- */

.print-doc .pd-lines{
  width:100%;
  border-collapse:collapse;
  table-layout:fixed;
  font-family:"Karla","Noto Sans",system-ui,sans-serif;
  font-size:8pt;
}
.print-doc .pd-lines thead th{
  background:var(--pd-ink);
  color:#fff;
  font-weight:400;
  font-size:7pt;
  letter-spacing:.12em;
  text-align:left;
  padding:1.5mm 2.2mm;
  border:.5pt solid var(--pd-ink);
}
.print-doc .pd-lines tbody td{
  border:.5pt solid var(--pd-rule);
  padding:1.3mm 2.2mm;
  vertical-align:top;
  word-break:break-word;
}
.print-doc .pd-col-n{ width:9mm; text-align:center; }
.print-doc .pd-col-fee{
  width:26mm;
  text-align:right;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}
.print-doc .pd-lines .pd-milestone{ width:46mm; color:var(--pd-muted); }
.print-doc .pd-lines-simple .pd-col-fee{ width:34mm; }
.print-doc .pd-stage{ display:block; color:var(--pd-ink); }
.print-doc .pd-deliverables{
  display:block;
  margin-top:.7mm;
  font-size:7pt;
  line-height:1.34;
  color:var(--pd-muted);
}
.print-doc .pd-optional-tag{ color:var(--pd-terracotta); font-size:7pt; letter-spacing:.06em; }
.print-doc .pd-optional .pd-col-fee{ color:var(--pd-muted); }
.print-doc .pd-adjust td{ background:#fff; color:var(--pd-muted); }
.print-doc .pd-total td{
  background:var(--pd-tint);
  border-top:.9pt solid var(--pd-terracotta);
  letter-spacing:.09em;
  text-transform:uppercase;
  font-size:8.5pt;
  color:var(--pd-ink);
}
.print-doc .pd-total .pd-col-fee{ letter-spacing:0; font-size:10pt; }

/* ---- amount in words + the GST line ---------------------------------- */

.print-doc .pd-words{
  margin:1.8mm 0 0;
  padding:1.3mm 2.2mm;
  background:var(--pd-tint);
  border:.5pt solid var(--pd-rule);
  font-family:"Karla","Noto Sans",system-ui,sans-serif;
  font-size:7.5pt;
  color:var(--pd-ink);
}
.print-doc .pd-words-label{ color:var(--pd-muted); letter-spacing:.06em; text-transform:uppercase; font-size:7pt; }
.print-doc .pd-words-value{ margin-left:1.5mm; }
.print-doc .pd-sep{ margin:0 2.5mm; color:var(--pd-rule); }
.print-doc .pd-gst-note{ color:var(--pd-muted); }
.print-doc .pd-note{
  margin-top:2mm;
  font-family:"Karla","Noto Sans",system-ui,sans-serif;
  font-size:7pt;
  color:var(--pd-muted);
}
/* Audit Fixes AF2 (F2): on a receipt, the TDS the client deducted beside it. */
.print-doc .pd-tds{ color:var(--pd-ink); }

/* Audit Fixes AF2 (N2): an invoice's scan-to-pay block — the UPI QR beside
   the bank details. Black on white whatever the theme (lib/qr.js draws its
   own white tile and quiet zone); 30mm reads from a phone at arm's length.
   No bold (above): the line is set in capitals and terracotta instead. */
.print-doc .pd-pay{ display:flex; flex-wrap:wrap; align-items:flex-start; gap:3mm 6mm; }
.print-doc .pd-pay > h2{ flex:1 0 100%; }
.print-doc .pd-pay > .pd-meta{ flex:1 1 auto; width:auto; }
.print-doc .pd-upi{
  display:flex;
  align-items:center;
  gap:3mm;
  break-inside:avoid;
  page-break-inside:avoid;
}
.print-doc .pd-upi-qr{ display:block; width:30mm; height:30mm; flex:0 0 30mm; }
.print-doc .pd-upi-qr .k-qr{ display:block; width:100%; height:100%; }
.print-doc .pd-upi-text{
  display:flex;
  flex-direction:column;
  gap:1mm;
  max-width:42mm;
  font-family:"Karla","Noto Sans",system-ui,sans-serif;
  font-size:7.5pt;
  color:var(--pd-muted);
}
.print-doc .pd-upi-text strong{
  font-weight:inherit;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--pd-terracotta);
}

/* A note for whoever is looking at the preview, never for the client who
   receives the paper (Session 26: "Bank details are not set up yet" printed
   on the invoice itself). */
@media print{
  .print-doc .pd-screen-only{ display:none !important; }
}

/* ---- sections: scope, charges, terms, signatures --------------------- */

.print-doc .pd-section{ margin-top:2.4mm; }
.print-doc .pd-section > h2{
  font-family:"Marcellus","Noto Sans",system-ui,serif;
  font-size:10pt;
  letter-spacing:.06em;
  color:var(--pd-terracotta);
  padding-bottom:1mm;
  margin-bottom:2mm;
  border-bottom:.5pt solid var(--pd-rule);
}

/* The two-column Included / Not Included block. Rendered ONLY when the
   quotation has those blocks — the real Kulkarni document has none, and an
   empty frame with two headings over nothing is worse than no section
   (Architecture.md §0, lib/printdoc.js `has_scope`). */
.print-doc .pd-scope{ display:flex; gap:6mm; }
.print-doc .pd-scope-col{
  flex:1 1 0;
  min-width:0;
  border:.5pt solid var(--pd-rule);
  background:var(--pd-tint);
  padding:2.6mm 3mm 3mm;
}
.print-doc .pd-scope-col h3{
  font-family:"Karla","Noto Sans",system-ui,sans-serif;
  font-size:7.5pt;
  letter-spacing:.1em;
  text-transform:uppercase;
  color:var(--pd-terracotta);
  padding-bottom:1.4mm;
  margin-bottom:1.8mm;
  border-bottom:.5pt solid var(--pd-rule);
}
.print-doc .pd-scope-col ul{ list-style:none; }
.print-doc .pd-scope-col li{
  position:relative;
  padding-left:3.4mm;
  margin-bottom:1.1mm;
  font-size:7.4pt;
  line-height:1.34;
}
.print-doc .pd-scope-col li::before{
  content:"·";
  position:absolute;
  left:.8mm;
  color:var(--pd-terracotta);
}
.print-doc .pd-scope-body{ display:block; font-size:7.5pt; color:var(--pd-muted); }

/* Additional charges: three across on A4, wrapping to two or one. */
.print-doc .pd-charges{ display:flex; flex-wrap:wrap; gap:3mm; }
.print-doc .pd-charge{
  flex:1 1 52mm;
  min-width:52mm;
  border:.5pt solid var(--pd-rule);
  border-left:1.2pt solid var(--pd-terracotta);
  padding:1.8mm 2.4mm;
  background:#fff;
}
.print-doc .pd-charge-head{ display:block; font-size:7.6pt; line-height:1.32; }
.print-doc .pd-charge-amount{
  display:block;
  margin-top:.9mm;
  font-family:"Karla","Noto Sans",system-ui,sans-serif;
  font-size:8.5pt;
  color:var(--pd-terracotta);
  font-variant-numeric:tabular-nums;
}
.print-doc .pd-charge-body{ display:block; margin-top:1mm; font-size:7.5pt; color:var(--pd-muted); }

/* Terms in two columns, as the template sets them. */
.print-doc .pd-terms{
  column-count:2;
  column-gap:6mm;
  list-style:none;
  counter-reset:pd-term;
  font-size:6.6pt;
  line-height:1.26;
}
.print-doc .pd-terms > li{
  counter-increment:pd-term;
  margin-bottom:1.2mm;
  padding-left:4.6mm;
  position:relative;
}
.print-doc .pd-terms > li::before{
  content:counter(pd-term) ".";
  position:absolute;
  left:0;
  font-family:"Karla","Noto Sans",system-ui,sans-serif;
  font-size:7pt;
  color:var(--pd-terracotta);
}
.print-doc .pd-term-head{ color:var(--pd-ink); }
.print-doc .pd-term-body{ color:var(--pd-muted); }

.print-doc .pd-signatures{ display:flex; gap:6mm; }
.print-doc .pd-sign{
  flex:1 1 0;
  min-width:0;
  border:.5pt solid var(--pd-rule);
  padding:2.2mm 2.6mm 2mm;
}
.print-doc .pd-sign h3{
  font-family:"Karla","Noto Sans",system-ui,sans-serif;
  font-size:7.5pt;
  letter-spacing:.1em;
  text-transform:uppercase;
  color:var(--pd-muted);
}
.print-doc .pd-sign-note{ margin-top:1.4mm; font-size:7.5pt; color:var(--pd-muted); }
.print-doc .pd-sign-space{ height:5mm; }
.print-doc .pd-sign-line{
  border-top:.5pt solid var(--pd-rule);
  padding-top:1.4mm;
  font-family:"Karla","Noto Sans",system-ui,sans-serif;
  font-size:7.5pt;
  color:var(--pd-ink);
}

/* ---- the footer: the D6 stamp and the studio line ---------------------
   The GST-not-applicable sentence is NOT repeated here — it prints beside
   the amount in words, which is where both source documents put it, and
   twice on one page is noise. Architecture.md §8 was updated to say so. */

.print-doc .pd-foot{
  display:flex;
  align-items:center;
  gap:3mm;
  margin-top:2.6mm;
  padding-top:1.2mm;
  border-top:.5pt solid var(--pd-rule);
  font-family:"Karla","Noto Sans",system-ui,sans-serif;
  font-size:6.5pt;
  color:var(--pd-muted);
}
.print-doc .pd-stamp{ width:9mm; height:auto; flex:0 0 auto; opacity:.85; }
.print-doc .pd-foot-line{ letter-spacing:.04em; }

/* ---- the draft watermark ---------------------------------------------
   A draft has no number and is not a promise to anybody. A PDF of one must
   never be mistakable for the document a client received, so it is stamped
   across the page as well as in the Quotation No. cell. */

.print-doc .pd-watermark{
  position:absolute;
  top:42%;
  left:0;
  right:0;
  text-align:center;
  font-family:"Marcellus","Noto Sans",system-ui,serif;
  font-size:58pt;
  letter-spacing:.3em;
  color:rgba(179,87,50,.13);
  transform:rotate(-22deg);
  pointer-events:none;
  z-index:1;
  white-space:nowrap;
}

/* ---- the B2B quotation, layout 2 (Session 27) ----------------------------
   ../documents/Katha_Design_Fee_Quotation.pdf, as lib/printdoc.js
   renderQuotationV2 marks it up. Everything is under .pd-l2, so layout 1 —
   every quotation sent before Session 27, Kulkarni included — keeps exactly
   the styles above (Phase 5 rule 1).

   The running header and the footer are @page margin boxes on the named page
   `kds-quotation`. Their TEXT changes per document (the number, the studio's
   contact line), so those few rules travel inside the document's own <style>;
   the page geometry is here. Page 1 has a smaller top margin and no running
   header: the letterhead is its header. Session 27 printed it through
   Chrome's printToPDF and read "Page 1 of 2" back off the PDF
   (tools/check_flow.mjs). */

@page kds-quotation{
  size:A4;
  margin:19mm 14mm 17mm;
}
@page kds-quotation:first{
  margin-top:12mm;
}

.print-doc.pd-l2{ font-size:9pt; }

/* the letterhead: the D2 lockup left, the studio block right */
.print-doc .pd-l2-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6mm;
  padding:0 0 3mm;
  border-bottom:1.4pt solid var(--pd-terracotta);
}
.print-doc .pd-l2-lockup{ width:19mm; }
.print-doc .pd-l2-studio{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  text-align:right;
  gap:.5mm;
  min-width:0;
}
.print-doc .pd-l2-name{
  font-family:"Marcellus","Noto Sans",system-ui,serif;
  font-size:14.5pt;
  letter-spacing:.2em;
  text-transform:uppercase;
  color:var(--pd-ink);
  line-height:1.1;
}
.print-doc .pd-l2-by{
  font-family:"Newsreader","Noto Sans",system-ui,serif;
  font-style:italic;
  font-size:10pt;
  color:var(--pd-terracotta);
  margin-bottom:1.2mm;
}
.print-doc .pd-l2-tagline{
  font-family:"Karla","Noto Sans",system-ui,sans-serif;
  font-size:7.4pt;
  letter-spacing:.04em;
  color:var(--pd-muted);
  margin-bottom:.6mm;
}
.print-doc .pd-l2-line{
  font-family:"Karla","Noto Sans",system-ui,sans-serif;
  font-size:8pt;
  color:var(--pd-ink);
}
.print-doc .pd-l2-place{ color:var(--pd-muted); }
.print-doc .pd-l2-dot{ color:var(--pd-terracotta); margin:0 2mm; }

/* title */
.print-doc .pd-l2-title{ padding:4.5mm 0 3.6mm; }
.print-doc .pd-l2-title h1{ font-size:19pt; }
.print-doc .pd-l2-title .pd-subtitle{ color:var(--pd-muted); letter-spacing:.18em; }

/* the 2 x 5 details grid */
.print-doc .pd-l2-meta th{ width:29mm; }
.print-doc .pd-l2-meta td{ font-size:8.4pt; }
.print-doc .pd-l2-aside{ color:var(--pd-muted); font-size:7pt; margin-left:1mm; }

.print-doc .pd-l2-intro{ margin:3.6mm 0 3.4mm; font-size:8.8pt; line-height:1.5; }

/* the fee table: a terracotta header, hairlines between stages, every
   other stage tinted, the total on an ink band */
.print-doc .pd-l2-fees thead th{
  background:var(--pd-terracotta);
  border-color:var(--pd-terracotta);
  padding:1.8mm 2.4mm;
}
.print-doc .pd-l2-fees thead th.pd-col-fee{ text-align:right; }
.print-doc .pd-l2-fees tbody td{
  border:0;
  border-bottom:.5pt solid var(--pd-rule);
  padding:2mm 2.4mm;
}
/* (the total row is ink, never tinted — it is the 6th row, and the tint rule
   used to win on specificity: white on cream) */
.print-doc .pd-l2-fees tbody tr:nth-child(even):not(.pd-l2-total):not(.pd-adjust) td{ background:var(--pd-tint); }
/* The ink is for the column's CELLS only (H81): on the header it outranked
   the band's white and printed "PAYMENT MILESTONE" in ink on terracotta. */
.print-doc .pd-l2-fees .pd-l2-col-when{ width:52mm; font-size:8.2pt; }
.print-doc .pd-l2-fees tbody .pd-l2-col-when{ color:var(--pd-ink); }
.print-doc .pd-l2-fees .pd-col-n{ width:10mm; }
.print-doc .pd-l2-fees .pd-l2-n{
  font-family:"Marcellus","Noto Sans",system-ui,serif;
  font-size:11pt;
  color:var(--pd-terracotta);
  vertical-align:middle;
}
.print-doc .pd-l2-fees .pd-stage{ font-size:9pt; }
.print-doc .pd-l2-fees .pd-deliverables{ font-size:7.8pt; }
.print-doc .pd-l2-fees tbody .pd-col-fee{ font-size:9pt; vertical-align:middle; }
.print-doc .pd-l2-fees tbody tr.pd-l2-total td{
  background:var(--pd-ink);
  color:#fff;
  border-bottom:0;
  padding:2.2mm 2.4mm;
  text-align:right;
  font-size:8pt;
  letter-spacing:.14em;
  text-transform:uppercase;
}
.print-doc .pd-l2-fees .pd-l2-total .pd-col-fee{
  font-family:"Marcellus","Noto Sans",system-ui,serif;
  font-size:12pt;
  letter-spacing:.02em;
  text-transform:none;
}

.print-doc .pd-l2-words{
  margin:2.4mm 0 .8mm;
  font-family:"Karla","Noto Sans",system-ui,sans-serif;
  font-size:8.4pt;
}
.print-doc .pd-l2-words-value{ margin-left:1.5mm; color:var(--pd-ink); }
.print-doc .pd-l2-gst{
  font-style:italic;
  font-size:8pt;
  color:var(--pd-muted);
}

/* section headings: uppercase, terracotta, a terracotta rule under them */
.print-doc .pd-l2-section{ margin-top:4.6mm; }
.print-doc .pd-l2-section > h2{
  font-size:10pt;
  letter-spacing:.16em;
  text-transform:uppercase;
  border-bottom:.8pt solid var(--pd-terracotta);
  margin-bottom:2.6mm;
}

/* the additional charges, as one strip (four since the 22 Oct 2026 document) */
.print-doc .pd-l2-charges{ display:flex; }
.print-doc .pd-l2-charge{
  flex:1 1 0;
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  gap:1mm;
  padding:2.6mm 3mm;
  background:var(--pd-tint);
  border:.5pt solid var(--pd-rule);
}
.print-doc .pd-l2-charge + .pd-l2-charge{ border-left:0; }
.print-doc .pd-l2-charge-head{
  font-family:"Karla","Noto Sans",system-ui,sans-serif;
  font-size:7.6pt;
  color:var(--pd-muted);
  line-height:1.3;
}
.print-doc .pd-l2-charge-amount{
  font-family:"Karla","Noto Sans",system-ui,sans-serif;
  font-size:9.4pt;
  color:var(--pd-ink);
}

/* page 2: scope in two columns */
.print-doc .pd-l2-scope{ display:flex; gap:8mm; }
.print-doc .pd-l2-scope-col{ flex:1 1 0; min-width:0; }
.print-doc .pd-l2-scope-col h3{
  font-family:"Marcellus","Noto Sans",system-ui,serif;
  font-size:10pt;
  color:var(--pd-ink);
  margin-bottom:1.6mm;
}
.print-doc .pd-l2-out h3{ color:var(--pd-muted); }
.print-doc .pd-l2-scope-col ul{ list-style:none; }
.print-doc .pd-l2-scope-col li{
  position:relative;
  padding-left:4mm;
  margin-bottom:1.1mm;
  font-size:8.6pt;
  line-height:1.38;
}
.print-doc .pd-l2-scope-col li::before{
  content:"•";
  position:absolute;
  left:.6mm;
  color:var(--pd-terracotta);
}
.print-doc .pd-l2-out li::before{ color:var(--pd-muted); }

/* the terms: numbered, the lead words in Karla ink — no synthetic bold
   (Architecture.md §11); the face and colour change carries it */
.print-doc .pd-l2-terms{
  list-style:none;
  counter-reset:pd-l2-term;
  font-size:8.2pt;
  line-height:1.42;
}
.print-doc .pd-l2-terms > li{
  counter-increment:pd-l2-term;
  position:relative;
  padding-left:5.4mm;
  margin-bottom:1.5mm;
  color:var(--pd-ink);
}
.print-doc .pd-l2-terms > li::before{
  content:counter(pd-l2-term) ".";
  position:absolute;
  left:0;
  font-family:"Karla","Noto Sans",system-ui,sans-serif;
  font-size:8pt;
  color:var(--pd-terracotta);
}
.print-doc .pd-l2-lead{
  font-family:"Karla","Noto Sans",system-ui,sans-serif;
  font-weight:400;
  font-size:8pt;
  letter-spacing:.02em;
  color:var(--pd-ink);
}

/* acceptance: two boxes, the client's tinted, with ruled fields */
.print-doc .pd-l2-sign-row{ display:flex; gap:0; }
.print-doc .pd-l2-sign{
  flex:1 1 0;
  min-width:0;
  border:.5pt solid var(--pd-rule);
  padding:3.4mm 4mm;
}
.print-doc .pd-l2-sign + .pd-l2-sign{ border-left:0; }
.print-doc .pd-l2-sign-client{ background:var(--pd-tint); }
.print-doc .pd-l2-sign h3{
  font-family:"Marcellus","Noto Sans",system-ui,serif;
  font-size:10.5pt;
  color:var(--pd-ink);
}
.print-doc .pd-l2-sign-space{ height:16mm; border-bottom:.5pt solid var(--pd-muted); }
.print-doc .pd-l2-signer{
  margin-top:1.6mm;
  font-family:"Karla","Noto Sans",system-ui,sans-serif;
  font-size:9pt;
  color:var(--pd-ink);
}
.print-doc .pd-l2-signer-role{
  font-family:"Karla","Noto Sans",system-ui,sans-serif;
  font-size:7.8pt;
  color:var(--pd-muted);
}
.print-doc .pd-l2-sign-note{
  margin:1mm 0 1.4mm;
  font-style:italic;
  font-size:8pt;
  color:var(--pd-muted);
}
.print-doc .pd-l2-field{ display:flex; align-items:flex-end; gap:2mm; height:8.4mm; }
.print-doc .pd-l2-field-label{
  flex:0 0 22mm;
  font-family:"Karla","Noto Sans",system-ui,sans-serif;
  font-size:6.8pt;
  letter-spacing:.1em;
  text-transform:uppercase;
  color:var(--pd-muted);
  padding-bottom:.6mm;
}
.print-doc .pd-l2-field-rule{ flex:1 1 auto; border-bottom:.5pt solid var(--pd-muted); height:5mm; }

.print-doc .pd-l2-close{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:3mm;
  margin-top:3.4mm;
}
.print-doc .pd-l2-stamp{ width:8mm; }
/* Fix plan Q (22 Oct 2026 document): ten terms fill page 2 to the foot, as
   the PDF does. Two quotation-only trims keep the closing line clear of the
   footer (a reader of the PDF took "Page 2 of 2" for part of it), and leave
   room before a third sheet. */
.print-doc.print-quotation .pd-l2-sign-space{ height:14mm; }
.print-doc.print-quotation .pd-l2-close{ margin-top:1.4mm; }
.print-doc .pd-l2-closing{
  font-style:italic;
  font-size:7.8pt;
  color:var(--pd-muted);
}

/* Where page 2 begins. On paper, a page break (the PDF breaks there too);
   on the screen preview, which is one long sheet, a dashed line so the
   person checking it can see what lands on which page. */
@media screen{
  .print-doc .pd-l2-page2{
    margin-top:9mm;
    padding-top:7mm;
    border-top:1px dashed #C9B8A6;
  }
}
@media print{
  /* The named page goes on the ROOT, not only the article: an element after
     it (the empty overlay root, the hidden toast host) on an unnamed page is
     a change of page name, and a change of page name is a forced break — a
     blank third sheet with nothing but "Page 3 of 3" on it. */
  html:has(.print-doc.pd-l2){ page:kds-quotation; }
  .print-doc.pd-l2{ page:kds-quotation; }
  .print-doc .pd-l2-page2{ break-before:page; page-break-before:always; }
  .print-doc .pd-l2-charges,
  .print-doc .pd-l2-sign-row,
  .print-doc .pd-l2-terms > li,
  .print-doc .pd-l2-scope{ break-inside:avoid; page-break-inside:avoid; }
  .print-doc .pd-l2-section > h2{ break-after:avoid; page-break-after:avoid; }
}

/* ---- the client estimate, layout 2 (Session 30) ---------------------------
   ../documents/BOQ/Katha_BOQ_Sample.pdf, as lib/printdoc.js renderEstimateV2
   marks it up. Everything is under .pd-e2, so layout 1 — every estimate sent
   before Session 30 — keeps exactly the styles above (Phase 5 rule 1).

   Same page system as the B2B quotation: the named page `kds-estimate`, its
   running header ("KATHA DESIGN STUDIO by Sapna" · "Project Estimate"), the
   footer and Page X of Y as margin boxes whose text travels in the
   document's own <style>; page 1 (the cover) has no running header. Each
   part of the Sample starts a new page: .pd-e2-break.

   No bold (the rule at the top of this file): the Sample's bold figures and
   headings are Marcellus here, its bold item names Karla in ink. */

@page kds-estimate{
  size:A4;
  margin:19mm 14mm 17mm;
}
@page kds-estimate:first{
  margin-top:12mm;
}

.print-doc.pd-e2{ font-size:8.6pt; }
.print-doc .pd-e2-num{ text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
.print-doc .pd-e2-n{ width:8mm; color:var(--pd-muted); text-align:center; }

/* the cover */
.print-doc .pd-e2-cover{ text-align:left; }
.print-doc .pd-e2-lockup{ width:30mm; margin:2mm auto 0; }
.print-doc .pd-e2-title{ text-align:center; padding:6mm 0 5mm; }
.print-doc .pd-e2-title h1{
  font-family:"Marcellus","Noto Sans",system-ui,serif;
  font-size:24pt;
  color:var(--pd-ink);
  line-height:1.1;
}
.print-doc .pd-e2-subtitle{
  display:inline-block;
  margin-top:2mm;
  padding-bottom:2.6mm;
  border-bottom:1pt solid var(--pd-terracotta);
  font-family:"Karla","Noto Sans",system-ui,sans-serif;
  font-size:7pt;
  letter-spacing:.14em;
  color:var(--pd-muted);
}
.print-doc .pd-e2-meta th{ width:27mm; }
.print-doc .pd-e2-meta td{ font-size:8.4pt; padding-top:1.6mm; padding-bottom:1.6mm; }

.print-doc .pd-e2-tiles{ display:flex; margin-top:6mm; }
.print-doc .pd-e2-tile{
  flex:1 1 0;
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  gap:1mm;
  padding:3.4mm 2mm 3mm;
}
.print-doc .pd-e2-tile-ink{ background:var(--pd-ink); color:#fff; }
.print-doc .pd-e2-tile-terra{ background:var(--pd-terracotta); color:#fff; }
.print-doc .pd-e2-tile-tint{ background:var(--pd-tint); color:var(--pd-ink); border:.5pt solid var(--pd-rule); }
.print-doc .pd-e2-tile-label{
  font-family:"Karla","Noto Sans",system-ui,sans-serif;
  font-size:6.4pt;
  letter-spacing:.12em;
  text-transform:uppercase;
}
.print-doc .pd-e2-tile-value{
  font-family:"Marcellus","Noto Sans",system-ui,serif;
  font-size:17pt;
  line-height:1.15;
  white-space:nowrap;
}
.print-doc .pd-e2-tile-line{ font-style:italic; font-size:7.2pt; }
.print-doc .pd-e2-tile-tint .pd-e2-tile-label,
.print-doc .pd-e2-tile-tint .pd-e2-tile-line{ color:var(--pd-muted); }
.print-doc .pd-e2-persqft{ margin-top:1.6mm; text-align:center; font-style:italic; font-size:7.8pt; color:var(--pd-muted); }

.print-doc .pd-e2-note{ margin-top:8mm; }
.print-doc .pd-e2-note h2{
  font-family:"Newsreader","Noto Sans",system-ui,serif;
  font-style:italic;
  font-size:13pt;
  color:var(--pd-terracotta);
  margin-bottom:2.4mm;
}
.print-doc .pd-e2-note p{ font-size:8.8pt; line-height:1.5; margin-bottom:2mm; }
.print-doc .pd-e2-note .pd-e2-note-sign{
  margin:5mm 0 0;
  font-family:"Newsreader","Noto Sans",system-ui,serif;
  font-style:italic;
  font-size:12pt;
  color:var(--pd-ink);
}
.print-doc .pd-e2-note .pd-e2-note-role{ font-family:"Karla","Noto Sans",system-ui,sans-serif; font-size:7.4pt; color:var(--pd-muted); }

.print-doc .pd-e2-contents{ margin-top:6mm; }
.print-doc .pd-e2-contents h3{
  font-family:"Karla","Noto Sans",system-ui,sans-serif;
  font-size:6.6pt;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--pd-muted);
  padding-bottom:1.2mm;
  border-bottom:.5pt solid var(--pd-rule);
  margin-bottom:2mm;
}
.print-doc .pd-e2-contents ol{
  list-style:none;
  counter-reset:pd-e2-c;
  display:grid;
  grid-template-columns:1fr 1fr;
  grid-auto-flow:column;
  grid-template-rows:auto auto;
  gap:1.6mm 6mm;
  font-family:"Karla","Noto Sans",system-ui,sans-serif;
  font-size:8pt;
}
.print-doc .pd-e2-contents li{ counter-increment:pd-e2-c; display:flex; align-items:baseline; gap:2.4mm; }
.print-doc .pd-e2-contents li::before{
  content:counter(pd-e2-c);
  font-family:"Marcellus","Noto Sans",system-ui,serif;
  font-size:12pt;
  color:var(--pd-terracotta);
}

/* a page's own heading: "Estimate Summary", "Detailed Estimate" … */
.print-doc .pd-e2-head{ margin-bottom:4mm; }
.print-doc .pd-e2-head h1{
  font-family:"Marcellus","Noto Sans",system-ui,serif;
  font-size:19pt;
  color:var(--pd-ink);
  line-height:1.15;
  margin-bottom:1mm;
}
.print-doc .pd-e2-head p{ font-family:"Karla","Noto Sans",system-ui,sans-serif; font-size:7.8pt; color:var(--pd-ink); }
.print-doc .pd-e2-head p + p{ color:var(--pd-muted); font-size:7.2pt; }
.print-doc .pd-e2-head-rule{ padding-bottom:3mm; border-bottom:1pt solid var(--pd-terracotta); }

.print-doc .pd-e2-block{ margin-top:5mm; }
.print-doc .pd-e2-block > p{ font-size:8.4pt; line-height:1.45; }
.print-doc .pd-e2-h2{
  font-family:"Marcellus","Noto Sans",system-ui,serif;
  font-size:9.6pt;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--pd-terracotta);
  padding-bottom:1mm;
  border-bottom:.8pt solid var(--pd-terracotta);
  margin-bottom:1.6mm;
}
.print-doc .pd-e2-lede{ font-style:italic; font-size:7.8pt; color:var(--pd-muted); margin-bottom:2.4mm; }
.print-doc .pd-e2-aside{ margin-top:2mm; font-style:italic; font-size:7.6pt; color:var(--pd-muted); }

/* your investment */
.print-doc .pd-e2-invest{ width:100%; border-collapse:collapse; font-family:"Karla","Noto Sans",system-ui,sans-serif; font-size:8.2pt; }
.print-doc .pd-e2-invest td{ padding:1.5mm 2.4mm 1.5mm 8mm; border-bottom:.5pt solid var(--pd-rule); color:var(--pd-ink); }
.print-doc .pd-e2-invest td.pd-e2-num{ padding-right:0; }
.print-doc .pd-e2-band{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:4mm;
  margin-top:3.4mm;
  padding:2.4mm 0 2.4mm 6mm;
  font-family:"Marcellus","Noto Sans",system-ui,serif;
  font-size:10pt;
  letter-spacing:.04em;
}
.print-doc .pd-e2-band-value{ font-size:14pt; white-space:nowrap; padding-right:0; }
.print-doc .pd-e2-band-ink{ background:var(--pd-ink); color:#fff; text-transform:uppercase; padding-right:0; }
.print-doc .pd-e2-band-ink .pd-e2-band-value{ text-transform:none; }
.print-doc .pd-e2-band-tint{
  background:var(--pd-tint);
  color:var(--pd-terracotta);
  border-top:.8pt solid var(--pd-terracotta);
  border-bottom:.8pt solid var(--pd-terracotta);
}
.print-doc .pd-e2-band-terra{ background:var(--pd-terracotta); color:#fff; margin-top:5mm; padding-left:4mm; padding-right:3mm; }
.print-doc .pd-e2-band-ink,
.print-doc .pd-e2-band-tint{ padding-right:2.4mm; }
.print-doc .pd-e2-words{ margin-top:1.4mm; font-family:"Karla","Noto Sans",system-ui,sans-serif; font-size:7.8pt; color:var(--pd-ink); }
.print-doc .pd-e2-optional-line{
  display:flex;
  justify-content:space-between;
  gap:4mm;
  margin-top:1.4mm;
  padding:0 2.4mm 0 8mm;
  font-style:italic;
  font-size:7.8pt;
  color:var(--pd-muted);
}

/* where the budget goes / by type of work: a table with a bar */
.print-doc .pd-e2-share,
.print-doc .pd-e2-journey,
.print-doc .pd-e2-lines,
.print-doc .pd-e2-terms{
  width:100%;
  border-collapse:collapse;
  font-family:"Karla","Noto Sans",system-ui,sans-serif;
  font-size:8pt;
}
.print-doc .pd-e2-share thead th,
.print-doc .pd-e2-journey thead th{
  font-weight:400;
  font-size:6.6pt;
  color:var(--pd-muted);
  text-align:left;
  padding:1mm 2mm;
  border-bottom:.8pt solid var(--pd-ink);
}
.print-doc .pd-e2-share thead th.pd-e2-num,
.print-doc .pd-e2-journey thead th.pd-e2-num{ text-align:right; }
.print-doc .pd-e2-share td{ padding:1.05mm 2mm; border-bottom:.5pt solid var(--pd-rule); color:var(--pd-ink); }
.print-doc .pd-e2-share .pd-e2-bar-col{ width:42mm; padding-left:0; padding-right:4mm; }
.print-doc .pd-e2-bar{
  display:block;
  height:3.4mm;
  min-width:.6mm;
  background:var(--pd-terracotta);
}
.print-doc .pd-e2-share td:nth-child(4),
.print-doc .pd-e2-share td:nth-child(5){ color:var(--pd-muted); width:14mm; }
.print-doc .pd-e2-share td:last-child{ width:26mm; }
.print-doc .pd-e2-total-row td{
  background:var(--pd-tint);
  border-top:.8pt solid var(--pd-ink);
  border-bottom:.8pt solid var(--pd-ink);
  color:var(--pd-ink) !important;
  padding-top:1.4mm;
  padding-bottom:1.4mm;
}

/* the journey */
.print-doc .pd-e2-journey td{ padding:2mm 2mm; border-bottom:.5pt solid var(--pd-rule); vertical-align:middle; color:var(--pd-ink); }
.print-doc .pd-e2-stage-n{
  font-family:"Marcellus","Noto Sans",system-ui,serif;
  font-size:15pt;
  color:var(--pd-terracotta) !important;
}
.print-doc .pd-e2-stage{ display:block; font-size:8.6pt; color:var(--pd-ink); }
.print-doc .pd-e2-due{ display:block; font-style:italic; font-size:7.2pt; color:var(--pd-terracotta); }
.print-doc .pd-e2-what{ width:52mm; font-size:7.4pt; color:var(--pd-muted) !important; line-height:1.35; }
.print-doc .pd-e2-when{ width:20mm; text-align:center; font-size:7.6pt; color:var(--pd-muted); white-space:nowrap; }
.print-doc .pd-e2-strong{ font-size:8.4pt; color:var(--pd-ink); }

/* the detailed estimate and the materials table */
.print-doc .pd-e2-lines thead th{
  background:var(--pd-terracotta);
  color:#fff;
  font-weight:400;
  font-size:7pt;
  text-align:left;
  padding:1.8mm 1.6mm;
}
.print-doc .pd-e2-lines thead th.pd-e2-num{ text-align:right; }
.print-doc .pd-e2-lines td{
  padding:1.15mm 1.6mm;
  border-bottom:.5pt solid var(--pd-rule);
  vertical-align:top;
  color:var(--pd-ink);
}
.print-doc .pd-e2-lines .pd-e2-item{ width:40mm; font-size:7.9pt; line-height:1.3; }
.print-doc .pd-e2-lines .pd-e2-spec{ font-size:7pt; color:var(--pd-muted); line-height:1.3; }
.print-doc .pd-e2-lines td:nth-child(4){ width:12mm; }
.print-doc .pd-e2-lines td:nth-child(5){ width:11mm; }
.print-doc .pd-e2-lines td:nth-child(6){ width:16mm; }
.print-doc .pd-e2-lines td:nth-child(7){ width:19mm; }
.print-doc .pd-e2-room-head td{
  background:var(--pd-tint);
  font-family:"Marcellus","Noto Sans",system-ui,serif;
  font-size:9.4pt;
  color:var(--pd-terracotta);
  padding-top:1.4mm;
  padding-bottom:1.4mm;
}
.print-doc .pd-e2-room-total td{ font-size:7.8pt; border-bottom:.8pt solid var(--pd-terracotta); padding-top:1.4mm; padding-bottom:1.4mm; }
.print-doc .pd-e2-room-total td.pd-e2-num{ font-size:8.6pt; }
.print-doc .pd-e2-grand .pd-e2-total-row td{ font-size:8.4pt; }
.print-doc .pd-e2-grand .pd-e2-total-row td.pd-e2-num{ font-size:9pt; }
.print-doc .pd-e2-note-row td{ font-style:italic; font-size:7.6pt; color:var(--pd-muted); }
.print-doc .pd-e2-option td{ color:var(--pd-muted); }
.print-doc .pd-e2-tag{
  display:inline-block;
  margin-left:1mm;
  font-size:6.2pt;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--pd-terracotta);
}
.print-doc .pd-e2-specs .pd-e2-work{ width:24mm; color:var(--pd-terracotta); }
.print-doc .pd-e2-specs .pd-e2-item{ width:38mm; }
.print-doc .pd-e2-specs td:nth-child(4){ width:auto; }
.print-doc .pd-e2-specs td:nth-child(5){ width:36mm; }
.print-doc .pd-e2-specs tr.pd-e2-group td{ border-top:.8pt solid var(--pd-terracotta); }

/* terms & acceptance */
.print-doc .pd-e2-scope{ display:flex; gap:8mm; }
.print-doc .pd-e2-scope-col{ flex:1 1 0; min-width:0; }
.print-doc .pd-e2-h3{
  font-family:"Marcellus","Noto Sans",system-ui,serif;
  font-size:10pt;
  color:var(--pd-terracotta);
  padding-bottom:.8mm;
  border-bottom:.8pt solid var(--pd-terracotta);
  margin-bottom:1.4mm;
}
.print-doc .pd-e2-out .pd-e2-h3{ color:var(--pd-muted); border-bottom-color:var(--pd-rule); }
.print-doc .pd-e2-scope-col ul{ list-style:none; }
.print-doc .pd-e2-scope-col li{
  position:relative;
  padding:.3mm 0 .3mm 5mm;
  font-family:"Karla","Noto Sans",system-ui,sans-serif;
  font-size:7.8pt;
  color:var(--pd-ink);
}
.print-doc .pd-e2-in li::before{ content:"✓"; position:absolute; left:.4mm; color:var(--pd-terracotta); }
.print-doc .pd-e2-out li{ color:var(--pd-muted); }
.print-doc .pd-e2-out li::before{ content:"–"; position:absolute; left:.6mm; color:var(--pd-muted); }
.print-doc .pd-e2-terms td{
  padding:1.1mm 1.6mm;
  border-bottom:.5pt solid var(--pd-rule);
  vertical-align:top;
  font-size:7.6pt;
  line-height:1.4;
  color:var(--pd-ink);
}
.print-doc .pd-e2-term-n{
  font-family:"Marcellus","Noto Sans",system-ui,serif;
  font-size:9pt !important;
  color:var(--pd-terracotta) !important;
}
.print-doc .pd-e2-term-head{ width:34mm; font-size:7.6pt; }
.print-doc .pd-e2-acceptance .pd-l2-sign-row{ margin-top:1mm; }
.print-doc .pd-e2-acceptance .pd-l2-sign{ position:relative; padding:2.6mm 4mm; }
.print-doc .pd-e2-acceptance .pd-l2-sign-space{ height:11mm; }
.print-doc .pd-e2-acceptance .pd-l2-field{ height:7mm; }
.print-doc .pd-e2-stamp{ position:absolute; top:2.4mm; right:3mm; width:8mm; }

@media screen{
  .print-doc .pd-e2-break{
    margin-top:9mm;
    padding-top:7mm;
    border-top:1px dashed #C9B8A6;
  }
}
@media print{
  /* the named page on the ROOT too — see the quotation's note above */
  html:has(.print-doc.pd-e2){ page:kds-estimate; }
  .print-doc.pd-e2{ page:kds-estimate; }
  .print-doc .pd-e2-break{ break-before:page; page-break-before:always; }
  .print-doc .pd-e2-tiles,
  .print-doc .pd-e2-band,
  .print-doc .pd-e2-scope,
  .print-doc .pd-e2-acceptance,
  .print-doc .pd-e2-note{ break-inside:avoid; page-break-inside:avoid; }
  .print-doc .pd-e2-h2,
  .print-doc .pd-e2-room-head{ break-after:avoid; page-break-after:avoid; }
}

/* ---- on screen: the preview sheet ------------------------------------ */
/* The preview is a real A4 sheet: 210mm wide with the same 14mm margins
   @page sets, so its content column is the 182mm the printer will use and
   what fits on screen is what fits on paper. It is how a session (and Leo)
   checks the document without opening a print dialog, and it is why the
   rules above are not wrapped in @media print. */

@media screen{
  .print-doc{
    width:210mm;
    min-height:297mm;
    padding:14mm;
    margin:0 auto;
    box-shadow:0 2px 18px rgba(0,0,0,.22);
    border-radius:2px;
  }
}

/* A 210mm sheet is ~794px and will not fit a phone, or a laptop once the
   desktop sidebar has taken its 224px. It scales as a WHOLE page rather
   than reflowing — a phone preview must show the real page, not a
   responsive approximation of a different document.

   `zoom` rather than `transform` because zoom affects layout, so the sheet
   still takes the right amount of room and the page never scrolls sideways
   past it. The factor comes from views/print.js, which measures the column
   it actually has; a breakpoint table cannot, because the width available
   jumps by 224px when the sidebar appears at 768px and a table that got
   that wrong would clip the sheet on exactly one class of screen. The `1`
   fallback covers the first paint, before the measurement lands. */
@media screen{
  .print-doc{ zoom:var(--pd-zoom,1); }
}

/* ---- printing --------------------------------------------------------- */

@media print{
  /* H77: tokens.css sets `color-scheme: dark` on the root in dark theme (the
     app's Dark setting, or Auto on a phone set to dark), and Chrome paints the
     page canvas round the sheet in that scheme — the 14 mm margins and the
     paper below a short document printed near-black. Paper is always light. */
  :root, html{ color-scheme: light !important; }
  html,body{
    background:#fff !important;
    height:auto !important;
    margin:0 !important;
    padding:0 !important;
  }
  /* The app is a hash-routed single document, so printing means collapsing
     the shell rather than opening a second page. Everything that is chrome
     goes; everything between <body> and the document becomes a plain block
     with no padding, no scroll container and no max width. */
  #app-shell,#app-body,#app-main,.view-print,.view-print > *{
    display:block !important;
    overflow:visible !important;
    height:auto !important;
    min-height:0 !important;
    max-height:none !important;
    max-width:none !important;
    width:auto !important;
    margin:0 !important;
    padding:0 !important;
    background:#fff !important;
    border:0 !important;
    box-shadow:none !important;
  }
  /* AFTER the reset above, not before: both are !important, so the later
     rule wins, and putting the hide first meant the reset turned the
     preview toolbar back on and printed it onto the client's PDF. */
  /* Session 27: the toasts live in #ui-toast-root and the screen-reader
     announcements in #ui-live-region (both appended to <body>), so the
     `.ui-toast-host` this list named matched nothing — a toast still on
     screen when Print was pressed ("Sent — KDS/2026/002") printed onto the
     client's PDF, on a page of its own. check_flow.mjs found it. */
  #app-header,#app-nav-bottom,#app-nav-side,
  .fab,.ui-toast-host,#ui-toast-root,#ui-live-region,.ui-overlay,[data-print-chrome]{
    display:none !important;
  }
  .print-doc{
    width:auto !important;
    max-width:none !important;
    min-height:0 !important;
    margin:0 !important;
    padding:0 !important;
    transform:none !important;
    box-shadow:none !important;
    border-radius:0 !important;
    font-size:9pt;
  }
  /* A stage row never splits across a page (Architecture.md §8), the table
     header repeats, and no section is orphaned from its heading. */
  .print-doc tr,
  .print-doc .pd-charge,
  .print-doc .pd-sign,
  .print-doc .pd-terms > li,
  .print-doc .pd-scope-col li{
    break-inside:avoid;
    page-break-inside:avoid;
  }
  .print-doc thead{ display:table-header-group; }
  .print-doc .pd-section > h2,
  .print-doc .pd-scope-col h3{
    break-after:avoid;
    page-break-after:avoid;
  }
  .print-doc .pd-signatures,
  .print-doc .pd-scope{ break-inside:avoid; page-break-inside:avoid; }
  .print-doc .pd-foot{ break-inside:avoid; page-break-inside:avoid; }
  .print-doc .pd-watermark{ position:fixed; top:40%; }
  .print-doc a{ text-decoration:none; color:inherit; }
}

/* ---- the variation note (Session 31) -------------------------------------
   lib/printdoc.js renderVariation: one page, wearing the B2B quotation's
   layout-2 letterhead, running header, footer and Page X of Y (class pd-l2,
   the named page kds-quotation) with its own lines table, the before → after
   of the project value, and the approval block. */

.print-doc .pd-var-lines .pd-var-num{ text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
.print-doc .pd-var-lines tr.pd-var-less td.pd-col-fee{ color:#7A1F12; }
.print-doc .pd-var-why{ margin-top:4mm; }
.print-doc .pd-var-effect{ width:auto; min-width:60%; margin:4mm 0 0 auto; }
.print-doc .pd-var-effect th{ text-align:left; font-weight:400; }
.print-doc .pd-var-effect td{ text-align:right; }
.print-doc .pd-var-effect tr.pd-var-after th,
.print-doc .pd-var-effect tr.pd-var-after td{ border-top:.8pt solid var(--pd-terracotta); color:var(--pd-ink, #3D1E0C); }
.print-doc .pd-var-terms{ margin-top:4mm; }
@media print{
  .print-doc .pd-var-lines tr,
  .print-doc .pd-var-effect,
  .print-doc .pd-var-approval{ break-inside:avoid; page-break-inside:avoid; }
}
