/* ============================================================
   ESTIMATE DOCUMENT — rendered on screen and captured to PDF.
   US Letter: 8.5in × 11in = 816 × 1056 px at 96dpi.
   Keep CSS html2canvas-friendly: no flex `gap`, no sticky, no
   backdrop filters. Margins are used for spacing instead.
   ============================================================ */
.estimate{
  --ink:#1c1f23;
  --ink-soft:#4b5158;
  --muted:#7a828b;
  --rule:#d9d4cc;
  --cream:#f6f2ec;
  --cream-deep:#efe8de;
  --brick:#9b3b2a;
  --brick-deep:#7d2f21;
  width:816px;
  min-height:1048px;
  background:#fff;
  color:var(--ink);
  font-family:"Inter",Arial,Helvetica,sans-serif;
  font-size:11.5px;
  line-height:1.5;
  padding:0 0 0 0;
  position:relative;
  box-sizing:border-box;
  -webkit-font-smoothing:antialiased;
}
.estimate *{box-sizing:border-box;}

.est-accent{height:9px;background:var(--brick);}

/* ---------- header ---------- */
.est-header{
  display:flex;justify-content:space-between;align-items:center;
  background:var(--ink);color:#fff;
  padding:26px 56px 26px;
  background-image:linear-gradient(135deg,#1c1f23 0%,#2b2f35 60%,#34251f 100%);
}
.est-brand{display:flex;align-items:center;max-width:460px;}
.est-emblem{margin-right:18px;flex:none;}
.est-company{
  font-family:"Playfair Display",Georgia,serif;font-weight:700;font-size:27px;
  line-height:1.12;color:#fff;letter-spacing:-.2px;
}
.est-tagline{font-size:10px;color:#cdb9ae;margin-top:6px;letter-spacing:2.2px;text-transform:uppercase;}
.est-title{text-align:right;}
.est-title__word{
  font-family:"Playfair Display",Georgia,serif;font-weight:400;font-size:38px;
  color:#e9c5b7;letter-spacing:3px;line-height:1;text-transform:uppercase;margin-bottom:10px;
}
.est-meta{border-collapse:collapse;margin-left:auto;}
.est-meta td{padding:2px 0 2px 16px;font-size:11px;text-align:right;white-space:nowrap;}
.est-meta td:first-child{color:#a9a39b;text-transform:uppercase;letter-spacing:.8px;font-size:9.5px;font-weight:600;}
.est-meta td:last-child{font-weight:600;color:#fff;}

/* ---------- parties ---------- */
.est-parties{
  display:flex;margin:0 56px;padding:18px 0 16px;
  border-bottom:1px solid var(--rule);
}
.est-party{width:50%;padding-right:30px;}
.est-party + .est-party{border-left:1px solid var(--rule);padding-left:30px;padding-right:0;}
.est-label{
  font-size:9.5px;font-weight:700;letter-spacing:1.4px;text-transform:uppercase;
  color:var(--brick);margin-bottom:6px;
}
.est-party__name{font-family:"Playfair Display",Georgia,serif;font-size:15.5px;font-weight:600;margin-bottom:3px;}
.est-party__line{color:var(--ink-soft);font-size:11px;line-height:1.55;}
.est-party__line:empty{display:none;}

/* ---------- items ---------- */
.est-items{padding:18px 56px 4px;}
.est-table{width:100%;border-collapse:collapse;}
.est-table th{
  text-align:left;font-size:9.5px;font-weight:700;letter-spacing:1.2px;text-transform:uppercase;
  color:#fff;background:var(--ink);padding:9px 10px;
}
.est-table th.col-n{width:34px;text-align:center;padding-left:0;padding-right:0;border-radius:3px 0 0 0;}
.est-table th.col-qty{width:58px;text-align:center;}
.est-table th.col-rate{width:92px;text-align:right;}
.est-table th.col-amt{width:120px;text-align:right;border-radius:0 3px 0 0;}
.est-table td{padding:10px 10px;vertical-align:top;border-bottom:1px solid var(--rule);page-break-inside:avoid;}
.est-table tr{page-break-inside:avoid;}
.est-table tbody tr:nth-child(even) td{background:#faf8f5;}
.est-table td.col-n{text-align:center;color:var(--muted);font-weight:600;padding-left:0;padding-right:0;font-size:10.5px;}
.est-table td.col-qty{text-align:center;white-space:nowrap;}
.est-table td.col-rate,.est-table td.col-amt{text-align:right;white-space:nowrap;}
.est-table td.col-amt{font-weight:600;font-size:12.5px;}
.est-item__name{font-weight:600;font-size:12.5px;margin-bottom:3px;color:var(--ink);}
.est-item__desc{color:var(--ink-soft);font-size:10.6px;line-height:1.55;white-space:pre-line;}
.est-item__desc:empty{display:none;}
.est-table .est-empty td{text-align:center;color:var(--muted);padding:28px 10px;font-style:italic;}

/* one-total mode: no price column */
.estimate.one-total .col-amt{display:none;}
.estimate.one-total .est-table th.col-desc{border-radius:0 3px 0 0;}

/* ---------- warranty + totals ---------- */
.est-bottom{display:flex;align-items:flex-start;padding:14px 56px 0;page-break-inside:avoid;}
.est-bottom__left{width:62%;padding-right:28px;}
.est-bottom__right{width:38%;padding-top:4px;}

.est-warranty{
  display:flex;align-items:flex-start;background:var(--cream);
  border:1px solid var(--cream-deep);border-left:4px solid var(--brick);
  padding:14px 16px 14px 14px;border-radius:0 4px 4px 0;
}
.est-warranty__badge{margin-right:14px;flex:none;margin-top:-2px;}
.est-warranty__title{font-family:"Playfair Display",Georgia,serif;font-weight:700;font-size:14px;color:var(--brick-deep);margin-bottom:4px;}
.est-warranty__text{font-size:10px;color:var(--ink-soft);line-height:1.55;}

.est-notes{margin-top:16px;}
.est-notes__text{font-size:10.6px;color:var(--ink-soft);white-space:pre-line;line-height:1.55;}

.est-totals{width:100%;border-collapse:collapse;}
.est-totals td{padding:7px 10px;font-size:11.5px;}
.est-totals td:first-child{color:var(--ink-soft);}
.est-totals td:last-child{text-align:right;font-weight:600;white-space:nowrap;}
.est-totals tr{border-bottom:1px solid var(--rule);}
.est-totals tr.est-totals__grand{border-bottom:none;}
.est-totals tr.est-totals__grand td{
  background:var(--ink);color:#fff;font-size:13.5px;padding:11px 12px;
}
.est-totals tr.est-totals__grand td:first-child{font-weight:700;letter-spacing:1px;text-transform:uppercase;font-size:11px;color:#e9e4dc;}
.est-totals tr.est-totals__grand td:last-child{font-family:"Playfair Display",Georgia,serif;font-weight:700;font-size:19px;}
.est-totals tr.est-totals__grand td:first-child{border-radius:3px 0 0 3px;}
.est-totals tr.est-totals__grand td:last-child{border-radius:0 3px 3px 0;}
#pDepositRow td{color:var(--brick-deep);font-weight:600;font-size:11px;}

/* ---------- terms ---------- */
.est-terms{padding:18px 56px 0;page-break-inside:avoid;}
.est-terms__text{font-size:9.8px;color:var(--muted);line-height:1.55;white-space:pre-line;}

/* ---------- signatures ---------- */
.est-signatures{display:flex;padding:22px 56px 0;page-break-inside:avoid;}
.est-sig{width:50%;}
.est-sig + .est-sig{padding-left:40px;}
.est-sig:first-child{padding-right:40px;}
.est-sig__area{height:72px;position:relative;}
.est-sig__area svg{position:absolute;left:0;bottom:-26px;height:104px;width:auto;}
.est-sig__typed{
  position:absolute;left:4px;bottom:-6px;font-size:40px;line-height:1;color:#1b2a6b;
  transform:rotate(-3deg);transform-origin:left bottom;white-space:nowrap;
}
.est-sig__img{position:absolute;left:0;bottom:-4px;max-height:66px;max-width:100%;}
.est-sig__line{border-top:1px solid var(--ink);margin-top:6px;}
.est-sig__name{font-weight:600;font-size:11.5px;margin-top:6px;}
.est-sig__title{font-size:9.8px;color:var(--muted);}

/* ---------- footer ---------- */
.est-footer{
  margin:auto 56px 0;padding:14px 0 26px;border-top:1px solid var(--rule);
  text-align:center;
}
.est-footer__thanks{font-family:"Playfair Display",Georgia,serif;font-style:italic;font-size:12.5px;color:var(--brick-deep);margin-bottom:5px;}
.est-footer__contact{font-size:9.8px;color:var(--muted);letter-spacing:.3px;}

/* Make the estimate a column so the footer sits at the bottom on one page */
.estimate{display:flex;flex-direction:column;}
.est-footer{margin-top:auto;padding-top:14px;padding-bottom:26px;page-break-inside:avoid;}
.est-signatures{margin-bottom:6px;}

/* ---------- auto-fit: progressively tighter layouts ---------- */
.estimate.compact-1 .est-header{padding:20px 56px;}
.estimate.compact-1 .est-parties{padding:12px 0 10px;}
.estimate.compact-1 .est-items{padding:12px 56px 2px;}
.estimate.compact-1 .est-table td{padding:8px 10px;}
.estimate.compact-1 .est-item__desc{font-size:10px;line-height:1.45;}
.estimate.compact-1 .est-bottom{padding-top:10px;}
.estimate.compact-1 .est-warranty{padding:10px 14px 10px 12px;}
.estimate.compact-1 .est-warranty__text{font-size:9.6px;line-height:1.45;}
.estimate.compact-1 .est-terms{padding-top:12px;}
.estimate.compact-1 .est-terms__text{font-size:9.4px;line-height:1.45;}
.estimate.compact-1 .est-signatures{padding-top:14px;margin-bottom:2px;}
.estimate.compact-1 .est-footer{padding:10px 0 18px;}

.estimate.compact-2 .est-header{padding:16px 56px;}
.estimate.compact-2 .est-company{font-size:24px;}
.estimate.compact-2 .est-title__word{font-size:32px;margin-bottom:6px;}
.estimate.compact-2 .est-parties{padding:10px 0 8px;}
.estimate.compact-2 .est-party__name{font-size:14px;}
.estimate.compact-2 .est-items{padding:10px 56px 0;}
.estimate.compact-2 .est-table th{padding:7px 10px;}
.estimate.compact-2 .est-table td{padding:6px 10px;}
.estimate.compact-2 .est-item__name{font-size:11.5px;margin-bottom:1px;}
.estimate.compact-2 .est-item__desc{font-size:9.4px;line-height:1.4;}
.estimate.compact-2 .est-bottom{padding-top:8px;}
.estimate.compact-2 .est-warranty{padding:8px 12px 8px 10px;}
.estimate.compact-2 .est-warranty__badge svg{width:44px;height:44px;}
.estimate.compact-2 .est-warranty__title{font-size:12.5px;}
.estimate.compact-2 .est-warranty__text{font-size:9px;line-height:1.4;}
.estimate.compact-2 .est-terms{padding-top:8px;}
.estimate.compact-2 .est-terms__text{font-size:8.8px;line-height:1.4;}
.estimate.compact-2 .est-signatures{padding-top:8px;margin-bottom:0;}
.estimate.compact-2 .est-sig__area{height:58px;}
.estimate.compact-2 .est-sig__area svg{height:90px;bottom:-22px;}
.estimate.compact-2 .est-footer{padding:8px 0 14px;}
.estimate.compact-2 .est-footer__thanks{font-size:11px;margin-bottom:2px;}

.estimate.compact-3 .est-header{padding:12px 56px;}
.estimate.compact-3 .est-emblem svg{width:50px;height:50px;}
.estimate.compact-3 .est-company{font-size:21px;}
.estimate.compact-3 .est-tagline{margin-top:3px;}
.estimate.compact-3 .est-title__word{font-size:26px;margin-bottom:4px;}
.estimate.compact-3 .est-meta td{padding:1px 0 1px 14px;font-size:10px;}
.estimate.compact-3 .est-parties{padding:8px 0 6px;}
.estimate.compact-3 .est-items{padding:8px 56px 0;}
.estimate.compact-3 .est-table td{padding:5px 10px;}
.estimate.compact-3 .est-item__name{font-size:11px;}
.estimate.compact-3 .est-item__desc{font-size:8.8px;line-height:1.35;}
.estimate.compact-3 .est-warranty__text{font-size:8.6px;line-height:1.35;}
.estimate.compact-3 .est-terms__text{font-size:8.4px;line-height:1.35;}
.estimate.compact-3 .est-totals tr.est-totals__grand td{padding:8px 12px;}
.estimate.compact-3 .est-sig__area{height:50px;}
.estimate.compact-3 .est-sig__area svg{height:78px;bottom:-20px;}
.estimate.compact-3 .est-sig__name{margin-top:3px;}
.estimate.compact-3 .est-footer{padding:6px 0 10px;}
.estimate.compact-3 .est-footer__contact{font-size:9px;}

.estimate.compact-4 .est-header{padding:10px 56px;}
.estimate.compact-4 .est-parties{padding:6px 0 5px;}
.estimate.compact-4 .est-party__name{font-size:13px;margin-bottom:1px;}
.estimate.compact-4 .est-party__line{font-size:10px;line-height:1.4;}
.estimate.compact-4 .est-items{padding:6px 56px 0;}
.estimate.compact-4 .est-table th{padding:5px 10px;font-size:9px;}
.estimate.compact-4 .est-table td{padding:4px 10px;}
.estimate.compact-4 .est-item__name{font-size:10.5px;margin-bottom:0;}
.estimate.compact-4 .est-item__desc{font-size:8.2px;line-height:1.3;}
.estimate.compact-4 .est-bottom{padding-top:6px;}
.estimate.compact-4 .est-warranty{padding:6px 10px 6px 8px;}
.estimate.compact-4 .est-warranty__badge svg{width:36px;height:36px;}
.estimate.compact-4 .est-warranty__title{font-size:11.5px;margin-bottom:2px;}
.estimate.compact-4 .est-warranty__text{font-size:8px;line-height:1.3;}
.estimate.compact-4 .est-terms{padding-top:6px;}
.estimate.compact-4 .est-terms__text{font-size:7.8px;line-height:1.3;}
.estimate.compact-4 .est-signatures{padding-top:4px;}
.estimate.compact-4 .est-sig__area{height:44px;}
.estimate.compact-4 .est-sig__area svg{height:70px;bottom:-18px;}
.estimate.compact-4 .est-sig__title{font-size:9px;}
.estimate.compact-4 .est-footer{padding:5px 0 8px;}
.estimate.compact-4 .est-footer__thanks{font-size:10px;margin-bottom:1px;}
