/*
 * DealWorthIt browser report skin (Phase 4B).
 *
 * Browser-only report PREVIEW pages (property_report_detailed/quick/flip/
 * wholesale). NOT the mPDF export templates (property_pdf*.html) — those are
 * a separate pipeline (see docs/design/reports-pdf-audit-4a.md) and are
 * untouched here.
 *
 * Linked from each report's {% block style %} AFTER the page's own <style>,
 * gated on data-brand=dealworthit. White-label reports keep their look.
 *
 * Primary lever (detailed report): the page declares a LOCAL :root palette
 * (--dwi-navy / --dwi-cyan / --dwi-blue / ... consumed ~83x). These are
 * DISTINCT from the global --dwi-color-* contract; re-pointing them at the
 * brand tokens flips the whole report in one move — same pattern as the
 * Finder's --ff-* and underwriting's --uwm-* levers. This file loads after
 * the page style, so these :root redefinitions win by cascade order.
 *
 * CSS only. No report math, interpolated values, chart DATA, field, or
 * download-behavior changes. The "Download PDF" button html2canvas-captures
 * .dwi-report, so these styles intentionally flow into that screenshot-PDF
 * (its target/flow are unchanged — only the captured pixels align).
 */

/* ── Detailed report: re-point the local palette at brand tokens ─ */
:root {
  --dwi-navy: var(--dwi-color-text);            /* dark headers/fills #14211D */
  --dwi-cyan: var(--dwi-color-primary);         /* accent: emerald */
  --dwi-blue: var(--dwi-color-primary);         /* accent blues -> emerald */
  --dwi-blue-2: var(--dwi-color-primary-strong);
  --dwi-text: var(--dwi-color-text);
  --dwi-muted: var(--dwi-color-muted);
  --dwi-line: var(--dwi-color-line);
  --dwi-soft: var(--dwi-color-rail);
  --dwi-bg: var(--dwi-color-page);
  --dwi-red: var(--dwi-color-negative);
  --dwi-green: var(--dwi-color-positive);
  --dwi-amber: var(--dwi-color-warning);
}

/* ── Report canvas: readable max-width + IBM Plex ─────────────────
   Width comes from the shared page-shell contract (themes/tokens.css):
   deal reports are deal-detail surfaces, so they share --dwi-page-deal
   with the underwriting workspaces (.dwi-page-shell--deal). This file
   is what caps the PUBLIC report layouts, which load tokens.css but
   not common_styles.css. */
.dwi-report,
.dwi-report-canvas {
  max-width: var(--dwi-page-deal, 1560px);
  margin-left: auto;
  margin-right: auto;
  font-family: var(--dwi-font-sans) !important;
}
/* numeric/financial cells in mono tabular for scannability */
.dwi-report .dwi-num,
.dwi-report .text-end,
.dwi-report-canvas table td.text-end,
.dwi-report-canvas .fw-bold.text-end {
  font-family: var(--dwi-font-mono);
  font-variant-numeric: tabular-nums;
}

/* ── Detailed report: Asset Profile photo placeholder (blue grad) ─ */
.dwi-report .dwi-photo-card {
  background: linear-gradient(135deg, var(--dwi-color-primary-strong), var(--dwi-color-primary)) !important;
}

/* ── Detailed report: lead-capture overlay (literal cyan/blue) ──── */
.dwi-leadcap-icon { background: var(--dwi-color-primary-soft) !important; }
.dwi-leadcap-preparing-note {
  background: var(--dwi-color-rail) !important;
  color: var(--dwi-color-text) !important;
  border-color: var(--dwi-color-line) !important;
}
.dwi-leadcap-preparing-note .spinner-border { color: var(--dwi-color-primary) !important; }

/* ── Detailed report: public CTA block (navy/cyan -> emerald/ink) ─ */
.dwi-pub-cta {
  background: linear-gradient(135deg, #103D31 0%, #0A2A20 100%) !important;   /* dark emerald panel */
}
.dwi-pub-cta .dwi-pub-cta-sub { color: rgba(255, 255, 255, .72) !important; }
.dwi-pub-cta .btn-primary,
.dwi-pub-cta .dwi-pub-cta-btn {
  background: var(--dwi-color-primary) !important;
  border-color: var(--dwi-color-primary) !important;
  color: #fff !important;
}
.dwi-pub-cta .btn-primary:hover,
.dwi-pub-cta .dwi-pub-cta-btn:hover {
  background: var(--dwi-color-primary-strong) !important;
  border-color: var(--dwi-color-primary-strong) !important;
}

/* ── Card / section chrome shared by all four reports ───────────── */
.dwi-report .dwi-card,
.dwi-report-canvas .card {
  border: 1px solid var(--dwi-color-line);
  border-radius: 14px;
  box-shadow: none;
}
.dwi-report-canvas .card { background: var(--dwi-color-surface); }

/* tables: line-soft separators, rail uppercase headers */
.dwi-report-canvas .table > thead.bg-light,
.dwi-report-canvas .table > thead th.bg-light {
  background-color: var(--dwi-color-rail) !important;
}
.dwi-report-canvas .table > thead th,
.dwi-report-canvas .table > thead td {
  color: var(--dwi-color-muted-soft) !important;
  font-size: 11px !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.dwi-report-canvas .table.table-row-bordered > tbody > tr,
.dwi-report-canvas .table.table-row-dashed > tbody > tr {
  border-bottom-color: var(--dwi-color-line-soft);
}

/* badges on the Metronic-vocabulary reports (quick/flip/wholesale) ->
   semantic tokens (the global 1E flip already handles btn-primary etc.) */
.dwi-report-canvas .badge.badge-light-primary { background-color: var(--dwi-color-primary-soft); color: var(--dwi-color-primary); }
.dwi-report-canvas .badge.badge-light-success { background-color: var(--dwi-status-portfolio-soft); color: var(--dwi-color-positive); }
.dwi-report-canvas .badge.badge-light-danger  { background-color: var(--dwi-color-negative-soft); color: var(--dwi-color-negative); }
.dwi-report-canvas .badge.badge-light-warning { background-color: var(--dwi-color-warning-soft); color: var(--dwi-color-warning); }

/* ════════════════════════════════════════════════════════════════════════
 * Detailed-report redesign (deal-report-redesign.html) — CSS-only re-skin of
 * the EXISTING .dwi-* report classes toward the reference. No markup changes,
 * no new class names. Avoids color-mix() so the html2canvas PDF matches.
 * ════════════════════════════════════════════════════════════════════════ */

/* Hero: tighter title + soft pill badges */
.dwi-report .dwi-hero-title { font-size: 26px !important; font-weight: 600; letter-spacing: -.5px; }
.dwi-report .dwi-hero-sub { font-size: 14px; max-width: 680px; }
.dwi-report .dwi-badge { background: var(--dwi-color-rail); border: 1px solid var(--dwi-color-line); color: var(--dwi-color-muted); border-radius: 100px; padding: 4px 11px; font-weight: 500; }
.dwi-report .dwi-badge-blue { background: var(--dwi-color-rail); color: var(--dwi-color-muted); }
.dwi-report .dwi-badge-blue .dwi-bullet { background: var(--dwi-color-primary); }
.dwi-report .dwi-badge-amber { background: var(--dwi-color-warning-soft); border-color: var(--dwi-color-warning-soft); color: var(--dwi-color-warning); }

/* KPI strip: monospace values, uppercase micro-labels */
.dwi-report .dwi-kpi-value { font-family: var(--dwi-font-mono); font-size: 23px; font-weight: 500; letter-spacing: -.5px; }
.dwi-report .dwi-kpi-label { text-transform: uppercase; letter-spacing: .05em; font-size: 11px; font-weight: 600; color: var(--dwi-color-muted-soft); }
.dwi-report .dwi-kpi-hint { font-size: 11.5px; color: var(--dwi-color-muted-soft); }

/* Numbered section header: emerald chip + tighter title */
.dwi-report .dwi-section-head h2 { font-size: 17px; font-weight: 600; }
.dwi-report .dwi-section-num { font-family: var(--dwi-font-mono); color: var(--dwi-color-primary); background: var(--dwi-color-primary-soft); border: 1px solid #CADFD7; width: 26px; height: 26px; border-radius: 7px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; }

/* ── Asset Profile (01): unify into one section card ────────────────
   The view wraps the header + map/attrs row in a reused .dwi-card. Pin
   the header flush to the card top with a full-width hairline divider. */
.dwi-report .dwi-card > .dwi-section-head {
  margin: -22px -22px 22px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--dwi-color-line);
}

/* Right attribute panel: flush inside the section card (drop nested
   border/background/padding) with monospace tabular values. */
.dwi-report .dwi-attrs-card {
  border: 0 !important;
  background: transparent !important;
  padding: 4px 6px !important;
}
.dwi-report .dwi-attrs-card .dwi-attr-row b {
  font-family: var(--dwi-font-mono);
  font-variant-numeric: tabular-nums;
}

/* Property photo card (MF/SS "Asset Profile"): show the REAL street-view photo.
   This used to re-skin the card into an emerald "map placeholder" (faint grid +
   centred pin) that darkened the property image into a tinted texture, so the
   photo effectively never showed. Now the image reads as a real photo; the
   emerald gradient is only a fallback when $underwrite['img'] is missing, and a
   bottom scrim keeps the overlaid address / chips legible. position:relative
   anchors the overlays. The SF report uses its own .dwi-sfr-photo (unaffected). */
.dwi-report .dwi-photo-card {
  position: relative;
  background: linear-gradient(150deg, var(--dwi-color-primary-strong), var(--dwi-color-primary)) !important;
  min-height: 340px;
}
/* Undo the placeholder's darkening/blend so the photo shows in real colour. */
.dwi-report .dwi-photo-img {
  color: transparent; font-size: 0;
  opacity: 1 !important;
  mix-blend-mode: normal !important;
  filter: none !important;
  z-index: 0;
}
/* Bottom scrim for caption legibility over a bright photo (was the faint grid). */
.dwi-report .dwi-photo-card::before {
  content: '' !important;
  position: absolute !important; inset: 0 !important; z-index: 1 !important;
  opacity: 1 !important;
  background: linear-gradient(to top, rgba(0,0,0,.60) 0%, rgba(0,0,0,.12) 40%, transparent 66%) !important;
  background-size: auto !important;
  pointer-events: none;
}
/* No map pin over a real photo. Kept absolutely positioned + inset:0 (contained
   by position:relative above) and click-through so it never escapes into a
   page-spanning overlay that swallows clicks — including Download PDF. */
.dwi-report .dwi-photo-card::after {
  content: '';
  position: absolute; inset: 0; z-index: 1;
  background: none !important;
  pointer-events: none;
}

/* Translucent dark badges on the map (instead of solid white pills). */
.dwi-report .dwi-photo-chips .dwi-chip {
  background: rgba(0, 0, 0, .22);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .28);
}

/* ── Asset Profile (01): Key Operating Ratios + Operating vs Lender
   Basis now live INSIDE the same section card. Re-space the sub-heads
   and flatten the nested blocks so they read as one card. ───────────── */
.dwi-report .dwi-card:has(> .dwi-section-head) > .dwi-sub-head { margin-top: 26px; }

/* Ratios grid: keep a light bordered box, monospace values. */
.dwi-report .dwi-ratios-card { margin-bottom: 22px !important; }
.dwi-report .dwi-ratio-value {
  font-family: var(--dwi-font-mono);
  font-weight: 500;
  letter-spacing: -.3px;
}

/* Operating vs Lender Basis: flush table inside the card (no nested box). */
.dwi-report .dwi-lender-basis-card {
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  margin-bottom: 0 !important;
}
.dwi-report .dwi-lender-basis-card .dwi-card-title { margin: 26px 0 6px; }
.dwi-report .dwi-lender-basis thead th { border-bottom-color: var(--dwi-color-line); }
.dwi-report .dwi-lender-basis tbody td { border-bottom-color: var(--dwi-color-line-soft); }
.dwi-report .dwi-lender-basis-note { margin-top: 14px; }

/* ════════════════════════════════════════════════════════════════════════
 * Underwriting Snapshot (02): unify into one section card. The two panes
 * (Operating Statement / Capital Stack) go flush; the three rate metrics
 * become one divided strip. CSS-only, reusing existing classes.
 * ════════════════════════════════════════════════════════════════════════ */

/* Sub-total breakdowns (externalized from inline styles): flush list — no
   box/background, body-size rows, muted labels + monospace amounts. */
.dwi-report .dwi-opex-split,
.dwi-report .dwi-capex-split {
  margin-top: 18px;
  padding: 0;
  background: transparent;
  border: 0;
  font-size: 14px;
  color: var(--dwi-color-muted);
}
.dwi-report .dwi-opex-split > div,
.dwi-report .dwi-capex-split > div {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
}
.dwi-report .dwi-opex-split > div > span:last-child,
.dwi-report .dwi-capex-split > div > span:last-child {
  color: var(--dwi-color-text);
  font-family: var(--dwi-font-mono);
  font-variant-numeric: tabular-nums;
}
.dwi-report .dwi-opex-split > div:last-child,
.dwi-report .dwi-capex-split > div:last-child {
  display: block;
  margin-top: 12px;
  padding: 0;
  color: var(--dwi-color-muted-soft);
  font-size: 13px;
  line-height: 1.5;
}

/* Highlight rows -> brand-neutral (were literal lavender / navy). */
.dwi-report .dwi-row-soft td { background: var(--dwi-color-line-soft); }
.dwi-report .dwi-row-dark td { background: var(--dwi-color-text); }
/* Pos/neg values sit on the dark-row fill, where the light-mode emerald/rust
   (#0E6E59 / #BC4A3D) are unreadable. Use the dark-palette variants; !important
   is needed to outrank the reports' inline .dwi-pos/.dwi-neg rules. */
.dwi-report .dwi-row-dark td .dwi-pos { color: #2FB695 !important; }
.dwi-report .dwi-row-dark td .dwi-neg { color: #D96A5C !important; }
/* Net Profit / (Loss): value cells drop the dark fill for a light tint by
   sign (emerald for profit, rust for loss); the label cell keeps the dark
   bar. Text returns to the standard theme pos/neg colors, which are
   readable on the light tints in both light and dark palettes. */
.dwi-report .dwi-row-dark td.dwi-cell-pos { background: var(--dwi-color-primary-soft); }
.dwi-report .dwi-row-dark td.dwi-cell-neg { background: var(--dwi-color-negative-soft); }
.dwi-report .dwi-row-dark td.dwi-cell-pos .dwi-pos { color: var(--dwi-color-positive) !important; }
.dwi-report .dwi-row-dark td.dwi-cell-neg .dwi-neg { color: var(--dwi-color-negative) !important; }
.dwi-report .dwi-chip-sm.dwi-chip-blue { background: var(--dwi-color-primary-soft); color: var(--dwi-color-primary); }

/* Rate metrics: an inset, rounded, bordered sub-box inside the section
   card, three cells split by vertical hairlines. */
.dwi-report .dwi-card:has(> .dwi-section-head) > .row.g-0 {
  margin-top: 28px;
  border: 1px solid var(--dwi-color-line);
  border-radius: 12px;
  overflow: hidden;
}
.dwi-report .dwi-card:has(> .dwi-section-head) > .row.g-0 .dwi-mini-card {
  border-right: 1px solid var(--dwi-color-line);
  height: 100%;
}
.dwi-report .dwi-card:has(> .dwi-section-head) > .row.g-0 .col-md-4:last-child .dwi-mini-card {
  border-right: 0;
}

/* Statement / Capital Stack tables: airier rows, and rounded "floating"
   highlight (soft) + dark (NOI / Total Uses) bars instead of square ones. */
.dwi-report .dwi-card:has(> .dwi-section-head) > .row.g-4 .dwi-table {
  border-collapse: separate;
  border-spacing: 0;
}
.dwi-report .dwi-card:has(> .dwi-section-head) > .row.g-4 .dwi-table tbody td {
  padding: 15px 14px;
  font-size: 14.5px;
}
.dwi-report .dwi-card:has(> .dwi-section-head) > .row.g-4 .dwi-table thead th {
  padding: 12px 14px;
  font-size: 12px;
}
.dwi-report .dwi-card:has(> .dwi-section-head) > .row.g-4 .dwi-row-soft td,
.dwi-report .dwi-card:has(> .dwi-section-head) > .row.g-4 .dwi-row-dark td {
  border-bottom: 0;
  padding-top: 18px;
  padding-bottom: 18px;
}
.dwi-report .dwi-card:has(> .dwi-section-head) > .row.g-4 .dwi-row-soft td:first-child,
.dwi-report .dwi-card:has(> .dwi-section-head) > .row.g-4 .dwi-row-dark td:first-child {
  border-top-left-radius: 9px;
  border-bottom-left-radius: 9px;
}
.dwi-report .dwi-card:has(> .dwi-section-head) > .row.g-4 .dwi-row-soft td:last-child,
.dwi-report .dwi-card:has(> .dwi-section-head) > .row.g-4 .dwi-row-dark td:last-child {
  border-top-right-radius: 9px;
  border-bottom-right-radius: 9px;
}

/* ════════════════════════════════════════════════════════════════════════
 * Pro Forma Projection (03): compact monospace KPI strip, de-blued exit
 * column, and rounded highlight/dark bars in the wide tight table.
 * ════════════════════════════════════════════════════════════════════════ */

/* KPI strip: clean 3-up grid (six metrics over two rows) with both
   dividers, monospace values — sits as a nested card in the section card. */
.dwi-report .dwi-projection-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dwi-report .dwi-projection-kpis .dwi-pkpi {
  padding: 18px 20px;
  border-right: 1px solid var(--dwi-color-line);
  border-bottom: 1px solid var(--dwi-color-line);
}
.dwi-report .dwi-projection-kpis .dwi-pkpi:nth-child(3n) { border-right: 0; }
.dwi-report .dwi-projection-kpis .dwi-pkpi:nth-child(n+4) { border-bottom: 0; }
.dwi-report .dwi-pkpi-value {
  font-family: var(--dwi-font-mono);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.5px;
}
.dwi-report .dwi-pkpi-label,
.dwi-report .dwi-pkpi-hint { font-size: 11.5px; }

/* Exit column + last-column tint -> brand-neutral (were literal lavender). */
.dwi-report .dwi-col-exit { background: var(--dwi-color-primary-soft) !important; }
.dwi-report .dwi-table-tight tr td:last-child { background: var(--dwi-color-rail); }
.dwi-report .dwi-table-tight tr.dwi-row-dark td:last-child { background: var(--dwi-color-text); }

/* Wide tight tables: separate model so highlight/dark bars can round
   (works whether the table sits in a card or flush in the section card). */
.dwi-report .table-responsive > .dwi-table {
  border-collapse: separate;
  border-spacing: 0;
}
/* Fit every hold-year column within the page so the PDF raster never clips
   the right-hand (Exit) columns: fixed layout + a wider label column. */
.dwi-report .table-responsive > .dwi-table { width: 100%; table-layout: fixed; }
.dwi-report .table-responsive > .dwi-table th,
.dwi-report .table-responsive > .dwi-table td { padding-left: 6px; padding-right: 6px; }
.dwi-report .table-responsive > .dwi-table tbody td { font-size: 11px; }
.dwi-report .table-responsive > .dwi-table tbody td.text-end { white-space: nowrap; }
.dwi-report .table-responsive > .dwi-table th:first-child,
.dwi-report .table-responsive > .dwi-table td:first-child { width: 14%; }
.dwi-report .table-responsive > .dwi-table .dwi-row-soft td,
.dwi-report .table-responsive > .dwi-table .dwi-row-dark td { border-bottom: 0; }
.dwi-report .table-responsive > .dwi-table .dwi-row-soft td:first-child,
.dwi-report .table-responsive > .dwi-table .dwi-row-dark td:first-child {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}
.dwi-report .table-responsive > .dwi-table .dwi-row-soft td:last-child,
.dwi-report .table-responsive > .dwi-table .dwi-row-dark td:last-child {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}

/* Capex note: plain muted line (externalized from inline styles). */
.dwi-report .dwi-capex-note {
  margin-top: 12px;
  color: var(--dwi-color-muted-soft);
  font-size: 12px;
}

/* ════════════════════════════════════════════════════════════════════════
 * Syndication (04) / Deal Score (05) / Market Context (06): unify each into
 * one section card (markup wraps them); de-blue the score card + waterfall
 * chips; round highlight/dark bars in any report table that has them.
 * ════════════════════════════════════════════════════════════════════════ */

/* Deal Score hero card: emerald wash (was literal blue gradient). Size to
   content and center vertically so it doesn't stretch into a tall empty
   panel; the dimension grid sits centered alongside it. */
.dwi-report .dwi-score-card {
  background: linear-gradient(135deg, var(--dwi-color-primary-strong), var(--dwi-color-primary)) !important;
  min-height: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.dwi-report .dwi-score-grid { align-content: center; }

/* Score card on-emerald elements: white status + white slider/thumb,
   uppercase label. Dimension values read as ink; bars keep their colour. */
.dwi-report .dwi-score-label { text-transform: uppercase; letter-spacing: .08em; }
.dwi-report .dwi-score-status { color: #fff; }
.dwi-report .dwi-score-bar {
  background: rgba(255, 255, 255, .28);
  overflow: visible;
  position: relative;
}
.dwi-report .dwi-score-bar-fill { background: #fff; position: relative; }
.dwi-report .dwi-score-bar-fill::after {
  content: '';
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.dwi-report .dwi-score-row-head b { color: var(--dwi-color-text); }

/* Waterfall step badges: emerald-soft (were lavender/blue). */
.dwi-report .dwi-wf-num {
  background: var(--dwi-color-primary-soft);
  color: var(--dwi-color-primary);
}

/* Waterfall distribution bar segments: de-blued to the chart palette
   (LP emerald, GP light emerald, Fees muted) to match the legend. */
.dwi-report .dwi-wf-bar-lp   { background: var(--dwi-color-primary); }
.dwi-report .dwi-wf-bar-gp   { background: #8FC5B3; }
.dwi-report .dwi-wf-bar-fees { background: var(--dwi-color-muted); }

/* ── Footer: Methodology + Report Metadata two-up, disclaimer full-width ── */
.dwi-report .dwi-footer-cols { grid-template-columns: 1.7fr 1fr; }
.dwi-report .dwi-footer-title {
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 12px;
  color: var(--dwi-color-muted);
}
.dwi-report .dwi-meta-list > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--dwi-color-line-soft);
  font-size: 13px;
}
.dwi-report .dwi-meta-list > div:last-child { border-bottom: 0; }
.dwi-report .dwi-meta-list > div > span:first-child { color: var(--dwi-color-muted); }
.dwi-report .dwi-meta-list > div > span:last-child {
  color: var(--dwi-color-text);
  font-family: var(--dwi-font-mono);
  font-variant-numeric: tabular-nums;
}
.dwi-report .dwi-footer-disclaimer {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--dwi-color-line);
}
.dwi-report .dwi-footer-disclaimer p {
  font-size: 12px;
  color: var(--dwi-color-muted-soft);
  line-height: 1.7;
  margin: 0;
}

/* ── Sticky CTA bar (lives outside .dwi-report): navy/cyan -> emerald.
   Brand-only — this file loads solely for DealWorthIt. ──────────────── */
.dwi-sticky-cta {
  background: linear-gradient(135deg, #103D31 0%, #0A2A20 100%);
}
.dwi-sticky-cta-icon {
  background: rgba(255, 255, 255, .08);
  color: #6FC2AC;
}
.dwi-sticky-cta-title { color: rgba(255, 255, 255, .92); }
.dwi-sticky-btn-ghost {
  color: rgba(255, 255, 255, .85);
  border-color: rgba(255, 255, 255, .25);
}
.dwi-sticky-btn-ghost:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.dwi-sticky-btn-primary {
  background: var(--dwi-color-primary);
  color: #fff;
  border-color: var(--dwi-color-primary);
}
.dwi-sticky-btn-primary:hover {
  background: var(--dwi-color-primary-strong);
  color: #fff;
  border-color: var(--dwi-color-primary-strong);
}
.dwi-sticky-cta-close { color: rgba(255, 255, 255, .6); }
.dwi-sticky-cta-close:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* Highlight (soft) + dark bars round wherever they appear in report tables. */
.dwi-report .dwi-table:has(.dwi-row-soft),
.dwi-report .dwi-table:has(.dwi-row-dark) {
  border-collapse: separate;
  border-spacing: 0;
}
.dwi-report .dwi-table .dwi-row-soft td,
.dwi-report .dwi-table .dwi-row-dark td { border-bottom: 0; }
.dwi-report .dwi-table .dwi-row-soft td:first-child,
.dwi-report .dwi-table .dwi-row-dark td:first-child {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}
.dwi-report .dwi-table .dwi-row-soft td:last-child,
.dwi-report .dwi-table .dwi-row-dark td:last-child {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}
/* ── Mobile / narrow screens ─────────────────────────────────────────
   This file loads AFTER each report's own <style>, and its selectors are
   more specific (`.dwi-report .x` vs `.x`), so the desktop rules above
   silently outrank the pages' own ≤992px overrides. Restate the mobile
   layout here at matching-or-higher specificity. */

/* Wide hold-year tables always scroll inside their wrapper rather than
   pushing the page wider (defensive: Bootstrap already sets this). */
.dwi-report .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 991.98px) {
  /* Projection KPI strip: 2-up; minmax(0,1fr) lets tracks shrink below the
     mono values' min-content so the strip can never overflow the viewport. */
  .dwi-report .dwi-projection-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dwi-report .dwi-projection-kpis .dwi-pkpi:nth-child(n) {
    border-right: 0;
    border-bottom: 1px solid var(--dwi-color-line);
  }
  /* Column divider between the two cells of each row. !important is needed
     because the pages' own mobile rule zeroes border-right with !important. */
  .dwi-report .dwi-projection-kpis .dwi-pkpi:nth-child(odd) {
    border-right: 1px solid var(--dwi-color-line) !important;
  }
  .dwi-report .dwi-projection-kpis .dwi-pkpi:nth-last-child(-n+2) { border-bottom: 0; }
  .dwi-report .dwi-pkpi-value { font-size: 18px; overflow-wrap: anywhere; }

  /* Hold-year projection tables: the fixed layout above exists so the
     desktop-width PDF raster never clips the Exit columns, but on narrow
     screens it crushes 12 columns until the nowrap numerics overpaint each
     other. Fall back to natural column widths and horizontal scrolling
     inside .table-responsive. */
  .dwi-report .table-responsive > .dwi-table { table-layout: auto; }
  .dwi-report .table-responsive > .dwi-table th:first-child,
  .dwi-report .table-responsive > .dwi-table td:first-child {
    width: auto;
    min-width: 150px;
  }
  .dwi-report .table-responsive > .dwi-table th,
  .dwi-report .table-responsive > .dwi-table td { padding-left: 8px; padding-right: 8px; }

  /* Footer columns: same cascade issue as the KPI strip — stack them. */
  .dwi-report .dwi-footer-cols { grid-template-columns: 1fr; }
}

/* Metric values monospace (match the report's numeric voice). */
.dwi-report .dwi-mini-value {
  font-family: var(--dwi-font-mono);
  font-weight: 500;
  letter-spacing: -.5px;
}
/* "Fixed" tenure badge -> brand pill in mono. */
.dwi-report .dwi-mini-head .dwi-pill {
  font-family: var(--dwi-font-mono);
  background: var(--dwi-color-primary-soft);
  color: var(--dwi-color-primary);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .02em;
  padding: 3px 9px;
}

/* ── Park Income & Business Plan (mobile home park, Section 01) ──────
   Lives here, not in the report's inline {% block style %}: the
   self-storage report pins that block byte-identical to the multifamily
   one, and every dwi-* report already loads this sheet. The block reuses
   the report's own components (.dwi-ratios-grid, .dwi-table,
   .dwi-attr-row, .dwi-card-title); these rules only shape the park
   layout around them. */
.dwi-report .dwi-park-stats .dwi-ratios-grid { grid-template-columns: repeat(4, 1fr); }
.dwi-report .dwi-park-row { margin-bottom: 22px; }
.dwi-report .dwi-park-card { padding: 18px 22px; height: 100%; }
.dwi-report .dwi-park-card .dwi-card-title { margin: 0 0 10px; }
.dwi-report .dwi-park-table tbody td { padding: 9px 8px; font-size: 12.5px; }
.dwi-report .dwi-park-table thead th { padding: 8px; font-size: 10px; }
.dwi-report .dwi-park-table td:first-child, .dwi-report .dwi-park-table th:first-child { padding-left: 0; }
.dwi-report .dwi-park-table td:last-child, .dwi-report .dwi-park-table th:last-child { padding-right: 0; }
.dwi-report .dwi-park-table td.text-end { white-space: nowrap; font-family: var(--dwi-font-mono); font-variant-numeric: tabular-nums; }
.dwi-report .dwi-park-income { margin-top: 12px; border-top: 1px solid var(--dwi-color-line); }
.dwi-report .dwi-park-income tbody td:first-child { color: var(--dwi-color-muted); }
.dwi-report .dwi-park-income tr.dwi-row-soft td:first-child { color: var(--dwi-color-text); }
.dwi-report .dwi-park-dim { color: var(--dwi-color-muted-soft); font-weight: 400; font-size: 11px; font-family: var(--dwi-font-body, inherit); }
.dwi-report .dwi-park-foot { margin-top: 10px; }
.dwi-report .dwi-park-plan .dwi-attr-row { padding: 9px 0; font-size: 13px; gap: 12px; border-bottom: 1px solid var(--dwi-color-line-soft); }
.dwi-report .dwi-park-plan .dwi-attr-row span { color: var(--dwi-color-muted); }
.dwi-report .dwi-park-plan .dwi-attr-row b { text-align: right; white-space: nowrap; font-family: var(--dwi-font-mono); font-variant-numeric: tabular-nums; }
.dwi-report .dwi-park-plan .dwi-attr-row b small { font-size: 11px; font-weight: 400; color: var(--dwi-color-muted-soft); }
.dwi-report .dwi-park-plan .dwi-park-total b { font-weight: 700; }
.dwi-report .dwi-park-plan-label,
.dwi-report .dwi-park-note-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--dwi-color-muted-soft);
}
.dwi-report .dwi-park-plan-label { margin: 14px 0 2px; }
.dwi-report .dwi-park-plan-label:first-child { margin-top: 0; }
.dwi-report .dwi-park-note-label { margin-bottom: 4px; }
.dwi-report .dwi-park-plan-mix { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0 8px; border-bottom: 1px solid var(--dwi-color-line-soft); }
.dwi-report .dwi-park-plan-mix .dwi-pill,
.dwi-report .dwi-park-evidence .dwi-pill { background: var(--dwi-color-primary-soft); color: var(--dwi-color-primary); font-weight: 600; }
/* Due diligence: one tile per topic (documented or not) so the grid reads
   as a coverage checklist; emerald icon chip, status pill, note body. */
.dwi-report .dwi-park-dd-head { margin-top: 26px; }
.dwi-report .dwi-park-dd-count { font-family: var(--dwi-font-mono); background: var(--dwi-color-primary-soft); color: var(--dwi-color-primary); font-weight: 600; }
.dwi-report .dwi-park-dd-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.dwi-report .dwi-park-dd-tile { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.dwi-report .dwi-park-dd-tile.is-empty { background: var(--dwi-color-rail); border-style: dashed; }
.dwi-report .dwi-park-dd-top { display: flex; align-items: flex-start; gap: 10px; }
.dwi-report .dwi-park-dd-icon {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 8px; display: inline-grid; place-items: center;
  background: var(--dwi-color-primary-soft); color: var(--dwi-color-primary); border: 1px solid #CADFD7; font-size: 15px;
}
.dwi-report .dwi-park-dd-tile.is-empty .dwi-park-dd-icon { background: transparent; color: var(--dwi-color-muted-soft); border-color: var(--dwi-color-line); }
.dwi-report .dwi-park-dd-titles { flex: 1 1 auto; min-width: 0; }
.dwi-report .dwi-park-dd-title { font-size: 13px; font-weight: 600; color: var(--dwi-color-text); line-height: 1.25; }
.dwi-report .dwi-park-dd-sub { font-size: 11px; color: var(--dwi-color-muted-soft); margin-top: 2px; }
.dwi-report .dwi-park-dd-status {
  flex: 0 0 auto; font-size: 10px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; background: var(--dwi-color-rail); color: var(--dwi-color-muted-soft); white-space: nowrap;
}
.dwi-report .dwi-park-dd-status.is-done { background: var(--dwi-color-primary-soft); color: var(--dwi-color-primary); }
.dwi-report .dwi-park-dd-status .bi { font-size: 10px; }
.dwi-report .dwi-park-dd-text { font-size: 12.5px; line-height: 1.55; margin: 0; color: var(--dwi-color-text); }
.dwi-report .dwi-park-dd-empty { color: var(--dwi-color-muted-soft); font-style: italic; }
/* Market evidence: stat tiles + source, same voice as Key Operating Ratios. */
.dwi-report .dwi-park-evidence-card { margin-bottom: 22px; }
.dwi-report .dwi-park-evidence-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.dwi-report .dwi-park-evidence-head .dwi-card-title { margin: 0; }
.dwi-report .dwi-park-evidence-head .dwi-pill { background: var(--dwi-color-warning-soft); color: var(--dwi-color-warning); font-weight: 600; }
.dwi-report .dwi-park-evidence-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--dwi-color-line); border-radius: 10px; overflow: hidden; }
.dwi-report .dwi-park-evidence-stat { padding: 16px 18px; border-right: 1px solid var(--dwi-color-line); }
.dwi-report .dwi-park-evidence-stat:last-child { border-right: 0; }
.dwi-report .dwi-park-evidence-stat .dwi-ratio-value { font-size: 20px; }
.dwi-report .dwi-park-evidence-stat .dwi-ratio-value small { font-size: 11px; font-weight: 400; color: var(--dwi-color-muted-soft); margin-left: 2px; }
.dwi-report .dwi-park-evidence-source { background: var(--dwi-color-rail); }
.dwi-report .dwi-park-evidence-src { font-size: 12.5px; font-weight: 600; color: var(--dwi-color-text); line-height: 1.35; margin-top: 4px; }
@media (max-width: 767px) {
  .dwi-report .dwi-park-stats .dwi-ratios-grid { grid-template-columns: repeat(2, 1fr); }
  .dwi-report .dwi-park-stats .dwi-ratio:nth-child(2n) { border-right: 0; }
  .dwi-report .dwi-park-stats .dwi-ratio:nth-child(-n+2) { border-bottom: 1px solid var(--dwi-color-line); }
  .dwi-report .dwi-park-dd-grid { grid-template-columns: 1fr; }
  .dwi-report .dwi-park-evidence-grid { grid-template-columns: 1fr 1fr; }
  .dwi-report .dwi-park-evidence-stat:nth-child(2n) { border-right: 0; }
  .dwi-report .dwi-park-evidence-stat:nth-child(-n+2) { border-bottom: 1px solid var(--dwi-color-line); }
}
@media (min-width: 768px) and (max-width: 1199px) {
  .dwi-report .dwi-park-dd-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Report cover: compact property identity, address register, and financial summary. */
.dwi-report .dwi-hero--summary { padding: 26px 28px; }
.dwi-report .dwi-hero--summary .dwi-hero-eyebrow { flex-wrap: wrap; row-gap: 4px; margin-bottom: 12px; font-size: 11px; }
.dwi-report .dwi-hero--summary .dwi-hero-row { margin-bottom: 20px; gap: 10px; }
.dwi-report .dwi-hero--summary .reports-inline-actions { flex-wrap: wrap; }
.dwi-report .dwi-hero-overview { display: flex; flex-direction: column; gap: 20px; margin-bottom: 22px; }
.dwi-report .dwi-hero-intro { min-width: 0; width: 100%; }
.dwi-report .dwi-hero--summary .dwi-hero-title { margin: 0 0 8px; line-height: 1.25; font-size: 28px !important; color: var(--dwi-text); overflow-wrap: anywhere; }
.dwi-report .dwi-hero--summary .dwi-hero-sub { line-height: 1.6; max-width: 960px; margin-bottom: 12px; font-size: 13px; }
.dwi-report .dwi-hero--summary .dwi-hero-context { margin-bottom: 0; gap: 8px; font-size: 12px; }
.dwi-report .dwi-hero--summary .dwi-hero-context-item { white-space: normal; overflow-wrap: anywhere; }
.dwi-report .dwi-address-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 12px 0 18px; }
.dwi-report .dwi-address-count { font-size: 11px; color: var(--dwi-muted); margin-right: 5px; }
.dwi-report .dwi-address-chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--dwi-line); background: var(--dwi-soft); padding: 6px 10px; border-radius: 6px; font-size: 12px; line-height: 1.4; color: var(--dwi-text); overflow-wrap: anywhere; max-width: 100%; }
.dwi-report .dwi-address-chip--primary { border-color: var(--dwi-color-primary-soft); background: var(--dwi-color-primary-soft); color: var(--dwi-color-primary); }
.dwi-report .dwi-hero--summary .dwi-hero-facts { display: inline-flex; flex-wrap: wrap; gap: 14px; margin: 0 18px 0 0; color: var(--dwi-muted); font-size: 12px; }
.dwi-report .dwi-hero-facts span + span { border-left: 1px solid var(--dwi-line); padding-left: 14px; }
.dwi-report .dwi-hero--summary .dwi-hero-context { display: inline-flex; }
.dwi-report .dwi-hero--summary .capital_stack_underfunded_notice { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 16px !important; margin-bottom: 20px !important; background: var(--dwi-color-warning-soft) !important; border: 1px solid var(--dwi-color-warning-soft) !important; color: var(--dwi-text) !important; border-radius: 8px !important; }
.dwi-report .dwi-funding-title { flex-shrink: 0; font-weight: 600; font-size: 12px; }
.dwi-report .dwi-funding-title span { padding: 0 5px; color: var(--dwi-muted); }
.dwi-report .dwi-funding-detail { font-size: 12px; line-height: 1.5; color: var(--dwi-muted); }
.dwi-report .dwi-hero--summary .dwi-kpi-strip { gap: 12px; padding-top: 0; border-top: 0; }
.dwi-report .dwi-hero--summary .dwi-kpi { padding: 16px; border: 1px solid var(--dwi-line); border-radius: 9px; background: var(--dwi-soft); min-width: 0; }
.dwi-report .dwi-hero--summary .dwi-kpi-label { color: var(--dwi-muted); font-size: 10px; min-height: 15px; margin-bottom: 8px; }
.dwi-report .dwi-hero--summary .dwi-kpi-value { font-size: 23px; line-height: 1.2; }
.dwi-report .dwi-hero--summary .dwi-kpi-hint { margin-top: 7px; color: var(--dwi-muted); font-size: 11px; line-height: 1.45; }
@media (max-width: 1100px) {
  .dwi-report .dwi-hero--summary .capital_stack_underfunded_notice { align-items: flex-start; flex-direction: column; gap: 4px; }
}
@media (max-width: 600px) {
  .dwi-report .dwi-hero--summary { padding: 20px 18px; }
  .dwi-report .dwi-hero--summary .reports-inline-actions { width: 100%; justify-content: flex-start; }
  .dwi-report .dwi-hero--summary .reports-inline-actions > span { flex-basis: 100%; }
  .dwi-report .dwi-hero--summary .dwi-hero-title { font-size: 23px !important; }
  .dwi-report .dwi-hero--summary .dwi-kpi-strip { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .dwi-report .dwi-hero--summary .dwi-kpi { padding: 12px; }
  .dwi-report .dwi-hero--summary .dwi-kpi-value { font-size: 20px; }
}
