@page {
  size: Letter portrait;
  margin: 0.36in 0.40in 0.60in 0.40in;
}

* { box-sizing: border-box; }

body {
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-size: 11px;
  line-height: 1.35;
  color: #172033;
  background: white;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* Constrain report to Letter width in browser preview */
#report {
  max-width: 816px; /* 8.5in at 96dpi */
  margin: 0 auto;
  background: white;
}

/* ── PDF TYPOGRAPHY / NUMBER READABILITY ── */
.money,
.rate,
.payment,
.table-number,
.mini-stat-value,
.payment-hero-value,
.glance-table td.text-right,
.comparison-table td.text-right,
.detail-row span:last-child,
.footer-right {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.payment-hero-value,
.glance-table td.text-right,
.comparison-table td.text-right,
.detail-row.bold span:last-child,
.mini-stat-value {
  font-weight: 700;
}

.mini-stat-label,
.detail-row span:first-child,
.company-meta,
.lo-nmls,
.report-center-subtitle,
.footer-contact-line {
  font-weight: 600;
}

/* ── PAGE ── */
.page {
  position: relative;
  padding: 0 20px 0;
  background: white;
}
.page-last {
  padding: 0 20px 92px;
}

/* ── HEADER ── */
.report-header {
  margin: 0 -22px 12px;
  background: linear-gradient(135deg, #0f2f57 0%, #173f70 100%);
  padding: 15px 22px 14px;
  color: white;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(210px, 0.8fr) minmax(0, 1.05fr);
  gap: 18px;
  align-items: center;
}
.header-left {
  display: flex;
  gap: 13px;
  align-items: center;
  min-width: 0;
}
.lo-avatar {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.28);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.lo-avatar img { width: 100%; height: 100%; object-fit: cover; }
.lo-initials { font-size: 20px; font-weight: 700; }
.lo-info { min-width: 0; }
.lo-name { font-size: 18.5px; font-weight: 700; line-height: 1.15; }
.lo-company { font-size: 12.5px; color: #bfdbfe; font-weight: 700; margin-top: 2px; }
.lo-nmls { font-size: 10.8px; color: #dbeafe; margin-top: 4px; line-height: 1.38; }
.lo-links { font-size: 10.8px; color: #dbeafe; line-height: 1.38; }
.header-link { color: #dbeafe; text-decoration: underline; font-weight: 700; }
.header-center {
  text-align: center;
  min-width: 0;
  align-self: center;
}
.header-center .report-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.08;
  color: white;
}
.header-center .report-subtitle {
  font-size: 12.5px;
  color: #bfdbfe;
  font-weight: 750;
  margin-top: 5px;
}
.report-meta-links { margin-top: 5px; }
.report-meta-link { color: #dbeafe; text-decoration: underline; font-weight: 700; font-size: 11px; }
.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  text-align: right;
  min-width: 0;
}
.company-copy { min-width: 0; }
.company-name { font-size: 16px; font-weight: 700; line-height: 1.12; }
.company-meta { font-size: 10.8px; color: #dbeafe; line-height: 1.35; margin-top: 4px; }
.company-address { font-size: 10px; color: #bfdbfe; line-height: 1.3; margin-top: 4px; }
.company-links { font-size: 10.8px; color: #dbeafe; line-height: 1.35; margin-top: 3px; }
.company-logo {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.company-logo img { width: 100%; height: 100%; object-fit: contain; }
.company-logo-initials {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.34);
  background: rgba(255,255,255,.12);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .04em;
}
.report-title { font-size: 19px; font-weight: 700; line-height: 1.1; }
.report-subtitle { font-size: 12.8px; color: #bfdbfe; font-weight: 700; margin-top: 6px; }

/* ── EQUAL HOUSING ── */
.equal-housing-mark {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 8.5px;
  font-weight: 700;
  color: white;
  letter-spacing: .04em;
  line-height: 1.05;
  white-space: nowrap;
}

/* ── OVERVIEW GRID ── */
.overview-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 12px;
  margin-top: 8px;
}
.prepared-for-box,
.exec-summary-box {
  border: 1px solid #d9e2ec;
  border-radius: 14px;
  padding: 12px 14px;
  background: white;
  break-inside: avoid;
  page-break-inside: avoid;
}
.prepared-for-box { background: #f8fafc; }
.box-eyebrow {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #0f2f57;
  margin-bottom: 6px;
}
.borrower-line {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.borrower-name { font-size: 16.8px; font-weight: 700; color: #172033; }
.property-address { font-size: 11.5px; color: #475569; font-weight: 650; }
.summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.summary-chips span {
  border: 1px solid #d9e2ec;
  border-radius: 999px;
  padding: 4px 8px;
  background: #f8fafc;
  color: #172033;
  font-size: 10.5px;
  font-weight: 700;
}
.exec-summary-text { font-size: 11.5px; line-height: 1.55; color: #64748b; }

/* ── MINI STATS ── */
.mini-stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.mini-stat {
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  padding: 8px 9px;
  background: white;
}
.mini-stat-label {
  font-size: 8.5px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
}
.mini-stat-value {
  font-size: 12.8px;
  font-weight: 700;
  color: #172033;
  margin-top: 2px;
}

/* ── AT-A-GLANCE ── */
.at-a-glance { margin-top: 16px; }
.glance-section-header {
  font-size: 14.6px;
  font-weight: 700;
  color: #0f2f57;
  margin-bottom: 8px;
}
.glance-table {
  width: 100%;
  line-height: 1.28;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 10.8px;
  border: 1px solid #d9e2ec;
  border-radius: 12px;
  overflow: hidden;
}
.glance-table thead tr { background: #0f2f57; color: white; }
.glance-table th {
  padding: 8px 7px;
  font-size: 9.4px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.glance-table td { padding: 8px 7px; border-bottom: 1px solid #d9e2ec; }
.glance-table tbody tr:last-child td { border-bottom: none; }
.row-alt { background: #f8fafc; }

/* ── FOOTER ── */
.page-footer {
  position: relative;
  margin: 24px 20px 0;
  border-top: 1px solid #d9e2ec;
  padding-top: 7px;
  color: #64748b;
  font-size: 7.9px;
  line-height: 1.32;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.footer-left { max-width: 90%; }
.footer-contact-line { font-weight: 650; color: #475569; }
.footer-disclaimer-line { margin-top: 2px; color: #64748b; }
.footer-right { white-space: nowrap; font-weight: 700; color: #0f2f57; align-self: flex-start; }
.page-footer a { color: #0f2f57; text-decoration: underline; font-weight: 700; }

/* ── PAGE SECTION HEADER ── */
.page-section-header {
  break-before: page;
  page-break-before: always;
  padding: 20px 20px 9px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 2px solid #0f2f57;
  margin-bottom: 12px;
}
/* Pages 2+ direct content margin since they no longer use .page wrapper */
.cards-grid,
.comparison-table,
.break-even-section,
.footer-disclosure-box {
  margin-left: 20px;
  margin-right: 20px;
}
.page-section-title { font-size: 17px; font-weight: 700; color: #0f2f57; }
.page-section-sub { font-size: 10px; color: #64748b; font-weight: 700; }

/* ── OPTION CARDS ── */
.cards-grid {
  display: grid;
  gap: 10px;
}
.cards-2col { grid-template-columns: 1fr 1fr; }
.cards-3col { grid-template-columns: 1fr 1fr 1fr; }
.cards-4col { grid-template-columns: 1fr 1fr; }

.option-card {
  border: 1px solid #d9e2ec;
  border-top: 5px solid #2563eb;
  border-radius: 14px;
  overflow: hidden;
  background: white;
  break-inside: avoid;
  page-break-inside: avoid;
}
.option-card.best-payment { border-top-color: #0f8a5f; }

.card-header {
  padding: 12px 13px 9px;
  background: #f8fafc;
  border-bottom: 1px solid #d9e2ec;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}
.card-title { font-size: 14.6px; font-weight: 700; color: #0f2f57; }
.card-subtitle { font-size: 11px; color: #64748b; margin-top: 2px; }
.card-badges { text-align: right; }
.card-body { padding: 11px; }

.payment-hero {
  border: 1px solid #c7d9ee;
  border-radius: 12px;
  padding: 9px 10px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef5fb 100%);
  margin-bottom: 8px;
}
.payment-hero-label {
  font-size: 8.5px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 700;
}
.payment-hero-value {
  font-size: 18px;
  color: #0f2f57;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 2px;
  white-space: nowrap;
}
.card-mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 10px;
}
.card-mini-stats .mini-stat { padding: 7px 8px; }
.card-mini-stats .mini-stat-value { font-size: 11px; white-space: nowrap; }

/* ── SECTION TITLE BAR ── */
.section-title-bar {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #0f2f57;
  background: #eef5fb;
  border-top: 1px solid #d9e2ec;
  border-bottom: 1px solid #d9e2ec;
  padding: 6px 8px;
  margin-top: 6px;
}

/* ── DETAIL ROW ── */
.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}
.detail-row.bold { color: #172033; font-weight: 700; }
.detail-row span:first-child { min-width: 0; }
.detail-row span:last-child { color: #172033; text-align: right; white-space: nowrap; }
.detail-row.bold span:last-child { color: #172033; }

/* ── HIGHLIGHT BADGE ── */
.highlight-badge {
  display: inline-block;
  background: #e7f8ef;
  color: #0f8a5f;
  border: 1px solid #bce8cf;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
  margin: 1px 2px 1px 0;
}

/* ── COMPARISON TABLE ── */
.comparison-table {
  width: 100%;
  line-height: 1.28;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 10.3px;
  border: 1px solid #d9e2ec;
  border-radius: 12px;
  overflow: hidden;
}
.comparison-table thead tr { background: #0f2f57; color: white; }
.comparison-table th { padding: 8px; font-weight: 600; }
.comparison-table td { padding: 6px 8px; border-top: 1px solid #eef2f7; }
.comparison-table tbody tr:first-child td { border-top: none; }

.group-header-row td {
  background: #eef5fb;
  color: #0f2f57;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 7px 8px;
  border-top: 1px solid #d9e2ec;
}
.best-cell { background: #f0fdf4 !important; color: #0f8a5f; font-weight: 700; }
.cell-muted { color: #64748b; font-weight: 600; }
.cell-bold { font-weight: 700; color: #172033; }

/* ── BREAK-EVEN ── */
.break-even-section { margin-top: 16px; }
.break-even-section-header {
  font-size: 13px;
  font-weight: 700;
  color: #0f2f57;
  margin-bottom: 8px;
}
.break-even-box {
  border: 1px solid #d9e2ec;
  border-left: 4px solid #2563eb;
  border-radius: 9px;
  padding: 8px 10px;
  margin-bottom: 7px;
  font-size: 11px;
  line-height: 1.55;
  background: #f8fafc;
  break-inside: avoid;
  page-break-inside: avoid;
}

/* ── DISCLOSURE ── */
.footer-disclosure-box {
  margin-top: 14px;
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  padding: 10px 12px;
  background: white;
  break-inside: avoid;
  page-break-inside: avoid;
}
.disclosure-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 16px;
  align-items: start;
}
.disclosure-main {
  min-width: 0;
  padding-right: 4px;
}
.disclosure-logo-wrap {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}
.disclosure-ehl {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  width: 118px;
  flex-shrink: 0;
}
.disclosure-ehl img {
  display: block;
  width: 84px;
  height: auto;
  max-width: 100%;
}
.disclosure-title {
  font-size: 10px;
  font-weight: 700;
  color: #0f2f57;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.disclosure-text {
  font-size: 7.7px;
  line-height: 1.35;
  color: #64748b;
}

/* ── UTILITIES ── */
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-green { color: #0f8a5f !important; font-weight: 700; }
.option-name-cell { font-weight: 700; color: #0f2f57; padding: 8px 7px; }

@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  body { margin: 0 !important; padding: 0 !important; background: white !important; }
}


/* PDF safety: keep major report blocks together when possible */

