:root{
  --navy-950:#071C33;
  --navy-900:#0B2C4F;
  --navy-800:#0F3B68;
  --navy-700:#134A82;
  --blue-600:#114F9F;
  --blue-500:#1B63C4;
  --orange-600:#D8481F;
  --orange-500:#F15730;
  --amber-600:#E8901A;
  --amber-500:#FAA536;
  --paper:#F2F4F7;
  --sheet:#FFFFFF;
  --ink:#182430;
  --ink-soft:#5B6672;
  --ink-faint:#8993A0;
  --line:#DCE1E7;
  --line-soft:#EAEDF1;
  --good:#1F7A4D;
  --danger:#C0392B;
  --client-tag:#D8481F;
  --dexler-tag:#114F9F;
  --font-display:"Georgia","Iowan Old Style",serif;
  --font-body:"Segoe UI","Source Sans Pro",-apple-system,sans-serif;
  --font-mono:"Consolas","IBM Plex Mono",monospace;
}
*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{background:var(--paper); color:var(--ink); font-family:var(--font-body); font-size:14px; line-height:1.5;}
h1,h2,h3,h4{font-family:var(--font-display); font-weight:700; margin:0 0 4px; color:var(--navy-900);}
button{font-family:inherit;}
img{max-width:100%;display:block;}

/* ============ TOP BAR ============ */
.topbar{
  position:sticky; top:0; z-index:100;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 28px; background:var(--navy-950); border-bottom:3px solid var(--amber-500);
  box-shadow:0 2px 10px rgba(0,0,0,0.25);
}
.topbar .brand{display:flex; align-items:center; gap:14px;}
.topbar .brand img{height:34px; width:auto; background:#fff; padding:4px 8px; border-radius:6px;}
.topbar .brand-sub{
  font-size:11px; letter-spacing:2px; color:rgba(255,255,255,0.55); text-transform:uppercase;
  padding-left:14px; border-left:1px solid rgba(255,255,255,0.2);
}
.topbar .actions{display:flex; align-items:center; gap:10px;}
.tb-btn{
  background:transparent; border:1px solid rgba(255,255,255,0.25); color:rgba(255,255,255,0.9);
  padding:9px 16px; border-radius:7px; font-size:13px; font-weight:600; cursor:pointer;
}
.tb-btn:hover{border-color:rgba(255,255,255,0.5); background:rgba(255,255,255,0.06);}
.tb-btn.primary{background:var(--amber-500); border-color:var(--amber-500); color:#2A1B02;}
.tb-btn.primary:hover{background:var(--amber-600); color:#fff;}
.tb-btn.primary:disabled{opacity:0.6; cursor:progress;}

/* ============ LAYOUT ============ */
main{max-width:980px; margin:0 auto; padding:30px 22px 100px;}

.card{background:var(--sheet); border:1px solid var(--line); border-radius:12px; padding:24px 26px; margin-bottom:20px; box-shadow:0 1px 3px rgba(11,44,79,0.06);}
.card h2{font-size:18px; display:flex; align-items:center; gap:10px;}
.card h2 .eyebrow{display:block; font-family:var(--font-body); font-size:10.5px; letter-spacing:1.8px; color:var(--orange-600); font-weight:700; text-transform:uppercase; margin-bottom:3px;}
.card .sub{color:var(--ink-soft); font-size:12.5px; margin-bottom:16px; margin-top:2px;}
.card-head{display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:4px;}

.grid{display:grid; grid-template-columns:repeat(2,1fr); gap:14px 20px;}
.grid.cols-3{grid-template-columns:repeat(3,1fr);}
.grid.cols-4{grid-template-columns:repeat(4,1fr);}
.field{display:flex; flex-direction:column; gap:5px;}
.field.span-2{grid-column:span 2;}
.field.span-3{grid-column:span 3;}
label{font-size:11.5px; font-weight:700; color:var(--navy-800); letter-spacing:0.2px; text-transform:uppercase;}
label .hint{font-weight:400; color:var(--ink-faint); text-transform:none; letter-spacing:0; font-size:11px;}
input[type=text], input[type=number], input[type=date], input[type=email], input[type=tel], select, textarea{
  border:1px solid var(--line); border-radius:6px; padding:9px 10px; font-size:14px; background:#fff; color:var(--ink);
  font-family:inherit; width:100%;
}
input:focus, select:focus, textarea:focus{outline:2px solid var(--amber-500); outline-offset:0; border-color:var(--amber-500);}
input[readonly]{background:#F0F2F5; color:var(--ink-soft);}
.note{background:#FCF1E1; border-left:3px solid var(--amber-500); padding:9px 12px; font-size:12.5px; color:#6B4712; border-radius:0 6px 6px 0; margin-top:10px;}

/* ---- Land type toggle ---- */
.landtype-toggle{display:flex; gap:12px; margin-bottom:18px;}
.lt-option{
  flex:1; border:2px solid var(--line); border-radius:10px; padding:16px 18px; cursor:pointer; background:#FBFCFD;
  transition:border-color .12s, background .12s;
}
.lt-option:hover{border-color:var(--amber-500);}
.lt-option.active{border-color:var(--blue-600); background:#EEF4FC;}
.lt-option .lt-title{font-weight:700; color:var(--navy-900); font-size:14.5px; display:flex; align-items:center; gap:8px;}
.lt-option .lt-desc{font-size:12px; color:var(--ink-soft); margin-top:4px;}
.lt-option input{display:none;}
.lt-radio{width:16px;height:16px;border-radius:50%;border:2px solid var(--ink-faint); flex:none; position:relative;}
.lt-option.active .lt-radio{border-color:var(--blue-600);}
.lt-option.active .lt-radio::after{content:"";position:absolute;inset:2px;border-radius:50%;background:var(--blue-600);}

.landtype-panel{display:none;}
.landtype-panel.show{display:block;}

/* ---- survey rows ---- */
.survey-row{display:flex; gap:8px; margin-bottom:6px;}
.survey-row input{flex:1;}
.icon-btn{
  background:#fff; border:1px solid var(--line); color:var(--ink-soft);
  width:34px; height:34px; border-radius:6px; cursor:pointer; flex:none; font-size:15px; display:flex; align-items:center; justify-content:center;
}
.icon-btn:hover{border-color:var(--client-tag); color:var(--client-tag);}
.text-btn{
  margin-top:8px; background:transparent; border:1px dashed var(--ink-faint); color:var(--ink-soft);
  padding:8px 14px; border-radius:6px; font-size:12.5px; font-weight:600; cursor:pointer;
}
.text-btn:hover{border-color:var(--blue-600); color:var(--blue-600);}

/* ---- park cards ---- */
.park-grid{display:grid; grid-template-columns:repeat(2,1fr); gap:14px; margin-bottom:6px;}
.park-card{border:1px solid var(--line); border-radius:10px; padding:16px 18px; background:#FBFCFD;}
.park-card .pname{font-weight:700; color:var(--navy-900); font-size:14.5px; font-family:var(--font-display);}
.park-card .ploc{font-size:12px; color:var(--ink-soft); margin-top:2px;}
.park-card .pmeta{display:flex; gap:16px; margin-top:10px; font-size:12px;}
.park-card .pmeta div b{display:block; color:var(--navy-800); font-size:14px; font-family:var(--font-mono);}
.park-card .padd{display:flex; gap:8px; margin-top:12px; align-items:center;}
.park-card .padd input{width:90px;}
.park-card .padd button{background:var(--blue-600); color:#fff; border:none; padding:9px 14px; border-radius:6px; font-weight:700; font-size:12.5px; cursor:pointer;}
.park-card .padd button:hover{background:var(--navy-800);}
.park-card .pavail{font-size:11px; color:var(--ink-faint); margin-top:6px;}

.cart-box{margin-top:14px;}
.cart-empty{font-size:12.5px; color:var(--ink-faint); padding:14px; text-align:center; border:1px dashed var(--line); border-radius:8px;}

/* ---- tables ---- */
table{width:100%; border-collapse:collapse; font-size:13.5px;}
th,td{border:1px solid var(--line); padding:9px 10px; text-align:left; vertical-align:middle;}
th{background:var(--navy-900); color:#fff; font-size:11px; text-transform:uppercase; letter-spacing:0.4px; font-weight:700;}
tbody tr:nth-child(even){background:#FAFBFC;}
/* ---- Dexler watermark for pricing/commercial tables ---- */
.wm-wrap{position:relative;}
.wm-wrap::after{
  content:'';
  position:absolute;
  inset:10px;
  background-image:url('../assets/img/watermark.png');
  background-repeat:no-repeat;
  background-position:center;
  background-size:contain;
  opacity:0.08;
  pointer-events:none;
  z-index:5;
}
.num{text-align:right; font-variant-numeric:tabular-nums; font-family:var(--font-mono);}
th.num{font-family:inherit; font-variant-numeric:normal;}
tr.total-row td{font-weight:700; background:#EAF1F9;}
tr.grand-row td{font-weight:700; background:var(--navy-900); color:#fff;}
.rm-btn{background:none;border:none;color:var(--client-tag);cursor:pointer;font-size:15px;padding:0 4px;}

.kpi-row{display:flex; gap:14px; flex-wrap:wrap; margin:4px 0 16px;}
.kpi{flex:1; min-width:150px; background:#EEF4FC; border:1px solid var(--line); border-radius:8px; padding:12px 14px;}
.kpi .label{font-size:10.5px; color:var(--ink-soft); text-transform:uppercase; letter-spacing:0.5px; font-weight:700;}
.kpi .value{font-size:19px; font-weight:700; color:var(--navy-900); font-family:var(--font-display);}
.kpi.good{background:#EAF7F0;}
.kpi.good .value{color:var(--good);}

.owner-tag{font-size:10.5px; font-weight:700; padding:3px 8px; border-radius:10px; color:#fff; text-transform:uppercase; letter-spacing:0.3px;}
.owner-tag.client{background:var(--client-tag);}
.owner-tag.dexler{background:var(--dexler-tag);}

/* ============ CAPTIVE VS GROUP CAPTIVE ============ */
.cgc-col-head{font-family:var(--font-display); font-weight:700; font-size:13.5px; color:var(--navy-900); text-align:center; padding:4px 0;}
.cgc-col-head .sub{display:block; font-family:var(--font-body); font-weight:400; font-size:10.5px; color:var(--ink-soft); text-transform:none; letter-spacing:0; margin-top:2px;}
.cgc-flag{display:inline-block; font-size:10.5px; font-weight:700; padding:2px 9px; border-radius:10px; text-transform:uppercase; letter-spacing:.3px;}
.cgc-flag.ok{background:#EAF7F0; color:var(--good);}
.cgc-flag.warn{background:#FCEBE8; color:var(--danger);}
.cgc-reco{background:#FCF1E1; border:1px solid var(--amber-500); border-left:4px solid var(--amber-500); padding:16px 18px; border-radius:0 8px 8px 0; margin-top:6px;}
.cgc-reco h3{color:var(--navy-900); font-size:14.5px; margin:0 0 8px;}
.cgc-reco p{margin:0; font-size:12.5px; line-height:1.65; color:#3A4552;}
.cgc-toggle{display:flex; align-items:center; gap:8px; font-size:12.5px; color:var(--ink-soft); margin-top:14px;}
.cgc-toggle input{width:16px; height:16px;}
.cgc-proscons-title{font-family:var(--font-display); font-weight:700; font-size:14.5px; color:var(--navy-900); margin:22px 0 10px;}
.cgc-proscons{display:grid; grid-template-columns:1fr 1fr; gap:14px;}
.cgc-pc-box{border:1px solid var(--line); border-radius:8px; padding:12px 14px;}
.cgc-pc-box.adv{background:#F3FAF6; border-color:#CFEBDC;}
.cgc-pc-box.dis{background:#FDF4F2; border-color:#F3D4CC;}
.cgc-pc-box h4{font-size:12px; text-transform:uppercase; letter-spacing:.4px; margin:0 0 8px; font-family:var(--font-body); font-weight:700;}
.cgc-pc-box.adv h4{color:var(--good);}
.cgc-pc-box.dis h4{color:var(--danger);}
.cgc-pc-box ul{margin:0; padding-left:18px;}
.cgc-pc-box li{font-size:12px; line-height:1.6; color:#3A4552; margin-bottom:4px;}

/* ============ GENERATE BAR ============
   Deliberately NOT position:sticky — it used to pin itself to the bottom of the
   viewport and stay visible the whole time the form was being filled in, which
   read as "the bottom part is constantly there" and got in the way of the fields
   above it. It's already the very last thing in the form (right after the
   Annexure A card), so plain static flow already puts it "at the last" — it now
   simply scrolls past like any other card and only comes into view once you've
   scrolled down to it. */
.generate-bar{
  margin-top:10px; padding:18px 26px; background:var(--sheet); border:1px solid var(--line);
  border-radius:12px; display:flex; align-items:center; justify-content:space-between; gap:16px; box-shadow:0 4px 18px rgba(11,44,79,0.08);
}
.generate-bar .gtext{font-size:12.5px; color:var(--ink-soft);}
.generate-bar .gtotal{font-family:var(--font-display); font-size:22px; font-weight:700; color:var(--navy-900);}
.big-btn{
  background:var(--amber-500); color:#2A1B02; border:none; padding:15px 30px; border-radius:8px;
  font-weight:700; font-size:15px; cursor:pointer; box-shadow:0 3px 10px rgba(232,144,26,0.35);
}
.big-btn:hover{background:var(--amber-600); color:#fff;}
.big-btn:disabled{opacity:0.6; cursor:progress;}
.generate-actions{display:flex; gap:12px; align-items:center;}

.req-flag{color:var(--client-tag); font-size:11.5px; margin-top:6px; display:none;}
.req-flag.show{display:block;}

/* ============ APPROVAL WORKFLOW ============ */
.status-pill{display:inline-block; font-size:10px; font-weight:700; letter-spacing:0.4px; text-transform:uppercase; padding:4px 10px; border-radius:20px;}
.status-pill.pending{background:#FCF1E1; color:#8A5A10; border:1px solid #F0C888;}
.status-pill.approved{background:#E7F5EC; color:var(--good); border:1px solid #9FD8B4;}
.approval-empty{font-size:12.5px; color:var(--ink-faint); padding:14px; text-align:center; border:1px dashed var(--line); border-radius:8px;}
.proposal-row{display:flex; align-items:center; justify-content:space-between; gap:14px; padding:12px 14px; border:1px solid var(--line); border-radius:10px; background:#FBFCFD; margin-bottom:10px;}
.proposal-row:last-child{margin-bottom:0;}
.proposal-row .pr-main{flex:1; min-width:0;}
.proposal-row .pr-title{font-weight:700; color:var(--navy-900); font-size:14px; font-family:var(--font-display);}
.proposal-row .pr-sub{font-size:11.5px; color:var(--ink-soft); margin-top:3px;}
.proposal-row .pr-actions{display:flex; align-items:center; gap:10px; flex:none;}
.approve-btn{background:var(--good); color:#fff; border:none; padding:9px 16px; border-radius:6px; font-weight:700; font-size:12.5px; cursor:pointer;}
.approve-btn:hover{background:#175f3c;}
.download-btn{background:var(--blue-600); color:#fff; border:none; padding:9px 16px; border-radius:6px; font-weight:700; font-size:12.5px; cursor:pointer;}
.download-btn:hover{background:var(--navy-800);}
.delete-btn{background:#fff; color:var(--danger); border:1px solid var(--danger); padding:8px 15px; border-radius:6px; font-weight:700; font-size:12.5px; cursor:pointer;}
.delete-btn:hover{background:var(--danger); color:#fff;}
.preview-btn{background:#fff; color:var(--navy-800); border:1px solid var(--navy-800); padding:8px 15px; border-radius:6px; font-weight:700; font-size:12.5px; cursor:pointer;}
.preview-btn:hover{background:var(--navy-800); color:#fff;}
.send-approval-btn{background:var(--navy-900); color:#fff; border:none; padding:15px 26px; border-radius:8px; font-weight:700; font-size:14px; cursor:pointer;}
.send-approval-btn:hover{background:var(--navy-800);}
.send-approval-btn:disabled{opacity:0.5; cursor:not-allowed;}
.approved-by-note{font-size:11px; color:var(--good); font-weight:700; margin-top:3px;}

/* ============ PREVIEW + PRINT-TO-PDF ============
   PDF export uses the browser's native print-to-PDF instead of
   html2canvas/html2pdf — far more reliable for a long, text-heavy,
   multi-page document (crisp vector text, correct page breaks, no
   canvas-size/off-screen-rendering edge cases). "Generate" opens a
   real on-screen Preview; "Export as PDF" just calls window.print(). */
#previewShell{display:none;}
body.preview-mode .topbar, body.preview-mode main{display:none;}
body.preview-mode #previewShell{display:block;}
.preview-bar{position:sticky; top:0; z-index:50; display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 28px; background:var(--navy-900); color:#fff;}
.preview-bar-title{font-weight:600; letter-spacing:0.3px; font-size:14px;}
.preview-bar .actions{display:flex; gap:10px;}
.preview-content{background:#5b6472; padding:36px 0 60px; display:flex; flex-direction:column; align-items:center; gap:28px; min-height:100vh;}
.preview-content .doc-page{box-shadow:0 14px 36px rgba(0,0,0,0.38);}
/* Chrome/Edge drop background colours, gradients and images by default
   when printing ("Background graphics" is off) — this is the #1 reason
   a print-to-PDF export looks like a different, misaligned document
   compared to the on-screen Preview (navy headers, the cover gradient,
   badge pills etc. all vanish, which shifts how everything reads even
   though the underlying layout is identical). Forcing colour-adjust
   everywhere makes the PDF match the Preview 1:1. */
html, body{-webkit-print-color-adjust:exact; print-color-adjust:exact; color-adjust:exact;}
* {-webkit-print-color-adjust:exact; print-color-adjust:exact; color-adjust:exact;}

/* ============ MOBILE (phones/small tablets) ============
   Everything above this point was built desktop-first with fixed
   multi-column grids and unwrapped flex rows — fine on a laptop, but on
   an iPhone-width screen those rows (especially the sticky "Send for
   Approval" bar at the bottom, which had two full-size buttons side by
   side with no wrap) were wider than the viewport itself. That forced the
   ENTIRE page into horizontal overflow, and since the generate bar is
   position:sticky to the bottom of the viewport, it stayed pinned and
   visible while the rest of the (now sideways-scrolling) page effectively
   became unusable — matching "the below part is constant, nothing else
   is seen". This block collapses multi-column layouts to one column,
   lets wide elements (tables, the toolbar, action rows) wrap or scroll
   WITHIN their own box instead of blowing out the page width, and keeps
   the desktop layout above completely untouched. */
html, body{max-width:100%; overflow-x:hidden;}
@media (hover:none) and (pointer:coarse){
  input, select, textarea{font-size:16px !important;}
}
@media (max-width: 760px){
  main{padding:18px 12px 130px;}
  .card{padding:16px 14px; overflow-x:auto;}
  .card h2{flex-wrap:wrap; font-size:16.5px;}

  /* Fixed multi-column field grids -> single column, full-width inputs */
  .grid, .grid.cols-3, .grid.cols-4{grid-template-columns:1fr; gap:12px;}
  .field.span-2, .field.span-3{grid-column:span 1;}

  /* Lease/Purchase, Standard/Breakup, Custom/Park toggle pairs -> stacked */
  .landtype-toggle{flex-direction:column; gap:10px;}

  /* Top bar: logo row wraps instead of squeezing the two admin buttons
     off the edge of the screen */
  .topbar{flex-wrap:wrap; gap:10px; padding:12px 16px;}
  .topbar .actions{flex-wrap:wrap; gap:8px; width:100%;}
  .topbar .actions .tb-btn{flex:1; text-align:center;}

  .kpi-row{gap:10px;}
  .kpi{min-width:0; flex:1 1 45%;}

  /* Used to be a sticky bottom bar (see the base .generate-bar rule above for
     why that was removed) — on mobile it's now just the same static card,
     with the total/status text stacked above the buttons instead of forcing
     them onto one row, and both buttons made full-width so nothing gets
     clipped or pushed off-screen. */
  .generate-bar{
    flex-direction:column; align-items:stretch; gap:12px;
    padding:14px 16px;
  }
  .generate-actions{flex-direction:column; align-items:stretch; width:100%;}
  .generate-actions button{width:100%; text-align:center;}

  /* Admin approval rows (pending/approved lists) — stack instead of
     squeezing the title and 2-3 action buttons into one row */
  .proposal-row{flex-direction:column; align-items:stretch;}
  .proposal-row .pr-actions{width:100%; flex-wrap:wrap;}
  .proposal-row .pr-actions button{flex:1; min-width:90px;}

  /* Preview / print-to-PDF screen: the generated document is a fixed
     794px-wide A4 page (matches real print output) that can't usefully
     reflow to phone width without distorting the actual PDF layout, so
     instead let it scroll horizontally within its own shell rather than
     forcing the whole page to scroll sideways. */
  .preview-bar{flex-wrap:wrap; gap:10px; padding:12px 16px;}
  .preview-content{overflow-x:auto; -webkit-overflow-scrolling:touch; padding:20px 16px 60px;}
}

@media print{
  .no-print{display:none !important;}
  body.preview-mode .preview-content{background:#fff; padding:0; gap:0; min-height:0;}
  body.preview-mode .preview-content .doc-page{box-shadow:none;}
  /* Chrome/Edge's print-to-PDF pipeline does not blur box-shadow the way
     the screen renderer does — it rasterises it as a hard-edged grey
     rectangle instead of a soft shadow. Every box-shadow used for on-screen
     depth (cover stat cards, the client box, the logo chip, table/card
     hover elevation, etc.) has to be stripped for print, or the exported
     PDF shows ugly solid boxes behind those elements that were never
     visible in the on-screen Preview. */
  .doc-page, .doc-page *{box-shadow:none !important;}
  @page{size:A4; margin:0;}
  /* Keep every page locked to exactly one physical A4 sheet. Without
     this, a page whose content runs slightly long silently spills onto
     the next physical page, which pushes every following section's
     page-break-after by one page and makes the printed PDF's pagination
     drift from what Preview showed on screen. */
  .doc-page{page-break-after:always; break-after:page;}
  .doc-page:last-child{page-break-after:auto; break-after:auto;}
  /* Never let a table header, a table row, or a heading get separated
     from what follows it — this is the other common source of
     "alignment" glitches in printed HTML (a row's cells splitting
     across two pages, or a section title printing alone at the
     bottom of a page). */
  table{page-break-inside:auto;}
  thead{display:table-header-group;}
  tfoot{display:table-footer-group;}
  tr{page-break-inside:avoid; break-inside:avoid;}
  .sec-title, .sub-title{page-break-after:avoid; break-after:avoid;}
  h1,h2,h3,h4{page-break-after:avoid; break-after:avoid;}
  .footnote-box, .client-badge-grid, .client-logo-grid, .ka-map-wrap{page-break-inside:avoid; break-inside:avoid;}
}

.doc-page{width:794px; min-height:1123px; background:#fff; position:relative; page-break-after:always; overflow:visible;}
.pdf-measure{width:682px; overflow:hidden;} /* matches .page-pad's content box (794 - 56*2) width-for-width, with no padding of its own, so PDF pagination measurements aren't inflated by page-pad's own 52/90px padding */
/* IMPORTANT: the measurement box above is appended straight to <body>, NOT nested inside a real
   .doc-page — so every ".doc-page p/li/table/th/td{...}" typography rule below (which all require
   a .doc-page ancestor to match) silently failed to apply during measurement. Instead the browser
   fell back to the bigger, unscoped global table/th/td rules (near the top of this stylesheet,
   font-size:13.5px / padding:9px 10px) — meaningfully bigger than what actually renders inside a
   real .doc-page (font-size:11.3px / padding:7px 8px). That mismatch made every measured
   block/table height an OVER-estimate of the real rendered height, which is exactly what made the
   Annexure tables look like they needed 2 pages / a denser font when in fact, at their real
   rendered size, they fit on one. These .pdf-measure-scoped rules mirror the .doc-page ones
   exactly so measured heights match what actually prints, without touching the global unscoped
   table/th/td rules that other, non-PDF tables elsewhere in the builder UI still rely on. */
.pdf-measure p{font-size:12.5px; line-height:1.75; margin:0 0 12px;}
.pdf-measure ul{margin:0 0 14px; padding-left:20px;}
.pdf-measure li{font-size:12.5px; line-height:1.75; margin-bottom:4px;}
.pdf-measure table{font-size:11.3px; margin-bottom:6px;}
.pdf-measure th{font-size:9.5px; padding:7px 8px;}
.pdf-measure td{padding:7px 8px;}
.pdf-measure table.annex-table{font-size:9.8px; margin-bottom:4px;} /* keep the denser fallback class winning inside the measurement box too, regardless of stylesheet order */
.pdf-measure table.annex-table th{font-size:8.3px; padding:4px 6px;}
.pdf-measure table.annex-table td{padding:4px 6px; line-height:1.32;}
.page-pad{padding:52px 56px 90px;}
.doc-page .pfoot{
  position:absolute; left:0; right:0; bottom:0; height:46px; display:flex; align-items:center; justify-content:space-between; gap:14px;
  padding:0 56px; font-size:9.5px; color:#8993A0; border-top:1px solid var(--line-soft);
}
/* The brand, page number and confidentiality notice are short and fixed — they must never wrap or shrink.
   Only the middle section-label can vary a lot in length (pages that pack several small sections together
   produce a long combined label), so it alone is allowed to shrink and ellipsize instead of wrapping the
   whole footer onto two lines, which previously pushed content past the footer's fixed height. */
.doc-page .pfoot .pf-brand, .doc-page .pfoot .pf-pageno, .doc-page .pfoot .pf-confidential{flex:0 0 auto; white-space:nowrap;}
.doc-page .pfoot .pf-brand{font-weight:700; color:var(--navy-800); letter-spacing:0.4px;}
.doc-page .pfoot .pf-label{flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:center;}
.sec-title{font-size:19px; color:var(--navy-900); border-bottom:2.5px solid var(--orange-500); padding-bottom:8px; margin-bottom:13px;}
.sec-title .eyebrow{display:block; font-family:var(--font-body); font-size:10px; letter-spacing:2px; color:var(--orange-600); font-weight:700; text-transform:uppercase; margin-bottom:4px;}
.sub-title{font-size:14.5px; color:var(--navy-800); margin:18px 0 8px;}
.doc-page p{font-size:12.5px; line-height:1.75; color:#2B3947; margin:0 0 12px; text-align:justify;}
.doc-page ul{margin:0 0 14px; padding-left:20px;}
.doc-page li{font-size:12.5px; line-height:1.75; color:#2B3947; margin-bottom:4px; text-align:justify;}
.doc-page table{font-size:11.3px; margin-bottom:6px;}
.doc-page th{background:var(--navy-900); font-size:9.5px; padding:7px 8px;}
.doc-page td{padding:7px 8px;}
/* Denser table styling used only by the two Annexure tables (Scope Matrix / Bill of Material),
   which are long enough that the normal table density would spill them across multiple pages —
   the user wants each annexure to fit on a single clean page (Annexure A on its own page,
   Annexure B as the last page). Kept as its own class rather than changing .doc-page table
   globally so every other table in the proposal keeps its normal, more readable density.
   Deliberately written WITHOUT a ".doc-page " ancestor prefix (unlike the rules above) — the
   PDF pagination engine measures real heights in an offscreen .pdf-measure box that is NOT
   nested inside a .doc-page (see pdfMeasureTableRows), so a scoped selector would silently not
   apply during measurement, giving the packer wrong heights and letting content overflow the
   physical page again. table.annex-table/th/td below use enough specificity (type+class, and
   type+class+type for th/td) to still win over the .doc-page table/th/td rules above wherever
   they do render inside a .doc-page, so one class works consistently in both places. */
table.annex-table{font-size:9.8px; margin-bottom:4px;}
table.annex-table th{font-size:8.3px; padding:4px 6px;}
table.annex-table td{padding:4px 6px; line-height:1.32;}
.footnote-box{background:#F5F7F9; border-left:3px solid var(--blue-600); padding:10px 13px; font-size:10.8px; color:#4A5763; border-radius:0 6px 6px 0; margin-top:8px; line-height:1.6; text-align:justify;}
.client-badge-grid{display:flex; flex-wrap:wrap; gap:9px; margin:10px 0 4px;}
.client-badge{font-size:11.5px; font-weight:600; color:var(--navy-800); background:#F0F3F7; border:1px solid var(--border); border-radius:20px; padding:7px 16px;}
.client-logo-grid{display:grid; grid-template-columns:repeat(5, 1fr); gap:10px 12px; margin:12px 0 6px;}
.client-logo-tile{display:flex; align-items:center; justify-content:center; height:86px; background:#fff; border:1px solid var(--line); border-radius:8px; padding:5px;}
.client-logo-tile img{max-width:100%; max-height:100%; object-fit:contain;}
.ka-map-wrap{display:flex; justify-content:center; margin:10px 0 4px;}
.ka-map-wrap svg{width:100%; max-width:150px; display:block;}
.ka-map-legend{display:flex; gap:16px; justify-content:center; font-size:10.5px; color:var(--ink-soft); margin-top:6px;}
.ka-map-legend span{display:inline-flex; align-items:center; gap:5px;}
.ka-map-legend i{width:9px; height:9px; border-radius:50%; display:inline-block;}

/* --- cover page ---
   Light wash over the solar-park photo (rather than a dark navy overlay) —
   easier on the eyes and far lighter on ink when the proposal gets printed. */
.cover-page{width:794px; height:1123px; position:relative; overflow:hidden;
  background:
    linear-gradient(165deg, rgba(255,255,255,0.95) 0%, rgba(240,246,251,0.93) 50%, rgba(222,234,246,0.90) 100%),
    url('https://images.unsplash.com/photo-1630770147528-3c38bc9e05a6?fm=jpg&q=80&w=1600&auto=format&fit=crop') center / cover no-repeat;
}
/* Soft, non-directional glows only — no diagonal stripe pattern, keeps the
   cover calm and print-friendly instead of busy. */
.cover-page .glow{position:absolute; right:-140px; top:-140px; width:460px; height:460px; border-radius:50%;
  background:radial-gradient(circle, rgba(250,165,54,0.22) 0%, rgba(250,165,54,0) 70%);}
.cover-page .glow2{position:absolute; left:-180px; bottom:-120px; width:480px; height:480px; border-radius:50%;
  background:radial-gradient(circle, rgba(27,99,196,0.14) 0%, rgba(27,99,196,0) 70%);}
.cover-page .accent-bar{position:absolute; left:0; top:0; width:100%; height:8px;
  background:linear-gradient(90deg, var(--orange-500) 0%, var(--amber-600) 50%, var(--blue-600) 100%);}
.cover-logo{position:absolute; top:48px; right:56px; background:#fff; padding:10px 18px; border-radius:9px; box-shadow:0 4px 16px rgba(11,44,79,0.12); border:1px solid var(--line-soft);}
.cover-logo img{height:30px;}
/* Full-height flex column: the top block (tag/title/stats) and bottom block
   (client box/footer band) are pushed apart to fill the whole page instead
   of leaving a large empty gap in the middle of the sheet. */
.cover-content{position:absolute; left:64px; right:64px; top:168px; bottom:118px; z-index:2; display:flex; flex-direction:column; justify-content:space-between;}
.cover-content .ctag{display:inline-block; background:rgba(250,165,54,0.14); border:1px solid rgba(250,165,54,0.5); color:var(--orange-600); font-size:11px; font-weight:700; letter-spacing:2.5px; text-transform:uppercase; padding:7px 16px; border-radius:20px; margin-bottom:26px;}
.cover-content h1{color:var(--navy-900); font-size:42px; line-height:1.18; margin-bottom:8px; font-weight:400; max-width:600px;}
.cover-content .divider{width:70px; height:3px; background:var(--orange-500); margin:22px 0 24px; border-radius:2px;}
.cover-content .client-box{margin-bottom:22px;}
.cover-stats{display:flex; gap:16px;}
.cover-stats .cstat{flex:1; background:rgba(255,255,255,0.85); border:1px solid rgba(11,44,79,0.14); border-radius:10px; padding:16px 18px; box-shadow:0 4px 14px rgba(11,44,79,0.06);}
.cover-stats .clabel{font-size:10px; letter-spacing:1.5px; text-transform:uppercase; color:var(--navy-700); font-weight:700; margin-bottom:6px;}
.cover-stats .cvalue{font-size:21px; font-weight:700; color:var(--navy-900); font-family:var(--font-display);}
.cover-content .client-box{background:rgba(255,255,255,0.85); border-left:4px solid var(--orange-500); padding:18px 22px; border-radius:0 10px 10px 0; max-width:560px; box-shadow:0 4px 18px rgba(11,44,79,0.08);}
.cover-content .client-box .l1{color:var(--navy-900); font-size:19px; font-weight:700; font-family:var(--font-display);}
.cover-content .client-box .l2{color:var(--navy-700); font-size:13px; margin-top:4px;}
.cover-footer-band{background:var(--navy-900); color:#fff; border-radius:10px; padding:16px 22px; display:flex; justify-content:space-between; align-items:center; margin-top:18px;}
.cover-footer-band .cfb-l{font-size:13px; font-weight:700; letter-spacing:0.3px;}
.cover-footer-band .cfb-r{font-size:11px; color:rgba(255,255,255,0.75);}
.cover-meta{position:absolute; left:64px; bottom:56px; right:64px; display:flex; justify-content:space-between; color:var(--navy-700); font-size:11px; border-top:1px solid rgba(11,44,79,0.18); padding-top:16px;}
.cover-meta b{color:var(--navy-900);}

/* --- letter page --- */
.letterhead{display:flex; justify-content:space-between; align-items:flex-start; padding-bottom:18px; border-bottom:2px solid var(--line-soft); margin-bottom:26px;}
.letterhead img{height:32px;}
.letterhead .lh-meta{text-align:right; font-size:10.5px; color:var(--ink-faint); line-height:1.6;}
.letter-body p{font-size:12.8px; line-height:1.85; color:#2B3947; margin:0 0 14px; text-align:justify;}
.letter-sig{margin-top:26px;}
.letter-sig .sname{font-weight:700; color:var(--navy-900); font-size:13.5px;}
.letter-sig .stitle{color:var(--ink-soft); font-size:12px;}

/* --- commercial title / owner tags used inline --- */
.offer-title{font-size:16.5px; color:var(--navy-900); margin-bottom:2px;}
.offer-sub{font-size:12px; color:var(--ink-soft); margin-bottom:14px;}

@media print{ body{background:#fff;} }
/* PDF pagination: each packed block is its own box with trimmed outer margins, so its
   measured height is exact; blocks are spaced by a fixed gap (PDF_ITEM_GAP in studio.js). */
.pdf-item{display:flow-root;}
.pdf-item > :first-child{margin-top:0 !important;}
.pdf-item > :last-child{margin-bottom:0 !important;}
.page-pad > .pdf-item:not(:first-child){margin-top:16px;}
.page-pad > :first-child, .page-pad > .wm-wrap:first-child > :first-child{margin-top:0 !important;}
