/* ============================================================
   Rentier.io — Raport wyceny (AVM / PPN) — print-report.css v2
   Koncepcja „editorial print" — patrz SPEC.md
   Paginacja A4: SPEC.md § 6
   ============================================================ */

/* ============================================================
   FONTY — self-hosted (SIL Open Font License 1.1)
   ------------------------------------------------------------
   Hostowane lokalnie, NIE przez CDN Google Fonts, z dwóch powodów:
   generowanie PDF nie może zależeć od zewnętrznego serwisu (offline,
   firewall korporacyjny), a osadzanie Google Fonts przez CDN wysyła IP
   użytkownika do Google — w 2022 sąd w Monachium uznał to za naruszenie
   RODO. Raport jest dokumentem dla klienta końcowego, więc to istotne.

   Potrzebne są OBA podzbiory: 'ó' leży w zakresie `latin` (U+00F3),
   a 'ą ć ę ł ń ś ź ż' w `latin-ext` (U+0100-024F). Pominięcie
   któregokolwiek psuje polski tekst.

   Grubości odpowiadają faktycznemu użyciu w tym arkuszu:
     Serif 400 (.rpt-price small), 600 (.rpt-address, .rpt-price)
     Sans  400 (proza), 500 (.rpt-statbar-note), 600 (etykiety), 700 (nagłówki)
     Mono  400 (numery sekcji, nr raportu)
   ============================================================ */

/* Source Serif 4 400 — latin */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/reports/advanced/v1/fonts/source-serif-4-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Source Serif 4 400 — latin-ext */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/reports/advanced/v1/fonts/source-serif-4-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Source Serif 4 600 — latin */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/reports/advanced/v1/fonts/source-serif-4-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Source Serif 4 600 — latin-ext */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/reports/advanced/v1/fonts/source-serif-4-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* IBM Plex Sans 400 — latin */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/reports/advanced/v1/fonts/ibm-plex-sans-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Sans 400 — latin-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/reports/advanced/v1/fonts/ibm-plex-sans-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* IBM Plex Sans 500 — latin */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/reports/advanced/v1/fonts/ibm-plex-sans-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Sans 500 — latin-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/reports/advanced/v1/fonts/ibm-plex-sans-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* IBM Plex Sans 600 — latin */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/reports/advanced/v1/fonts/ibm-plex-sans-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Sans 600 — latin-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/reports/advanced/v1/fonts/ibm-plex-sans-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* IBM Plex Sans 700 — latin */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/reports/advanced/v1/fonts/ibm-plex-sans-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Sans 700 — latin-ext */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/reports/advanced/v1/fonts/ibm-plex-sans-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* IBM Plex Mono 400 — latin */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/reports/advanced/v1/fonts/ibm-plex-mono-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* IBM Plex Mono 400 — latin-ext */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/reports/advanced/v1/fonts/ibm-plex-mono-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

.advanced-report {
  --rpt-ink: #111827;
  --rpt-body: #374151;
  --rpt-muted: #56606c;
  --rpt-faint: #5f6773;
  --rpt-hairline: #e5e7eb;
  --rpt-hairline-soft: #f3f4f6;
  --rpt-accent: #1d4ed8;      /* jedyny token do podmiany przy white-label */
  --rpt-up: #15803d;
  --rpt-down: #b91c1c;
  --rpt-map-bg: #eef1f6;
  /* Georgia is deliberately NOT the first fallback: it ships only old-style
     (text) figures, where 4 and 8 sit at different heights and 4 has a
     descender — which made a price like "4800" look visibly uneven. Cambria
     (Windows) and Times New Roman (everywhere) both use lining figures.
     Self-hosting Source Serif 4 remains the full fix. */
  --rpt-serif: 'Source Serif 4', Cambria, 'Times New Roman', Georgia, serif;
  --rpt-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --rpt-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

/* ---- Ekran: overlay podglądu ---- */
.print-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #3f4a5c;
  overflow: auto;
}

/* ---- Ekran: karta dokumentu ---- */
.print-document {
  width: 210mm;
  margin: 24px auto 60px auto;
  padding: 15mm 17mm 20mm 17mm;
  background: #fff;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
  font-family: var(--rpt-sans);
  font-size: 10pt;
  color: var(--rpt-body);
  line-height: 1.5;
  /* RP-279: an unbreakable string wraps instead of running past the page. */
  overflow-wrap: break-word;
}

/* ============ Nagłówek dokumentu (strona 1) ============ */
.rpt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 11px;
  border-bottom: 2px solid var(--rpt-ink);
  break-inside: avoid;
  page-break-inside: avoid;
}
.rpt-header-logo { height: 23px; display: block; }
.rpt-header-meta { text-align: right; }
.rpt-header-title {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--rpt-ink);
  text-transform: uppercase;
}
.rpt-header-sub { font-size: 8px; color: var(--rpt-muted); margin-top: 2px; }
.rpt-header-sub code { font-family: var(--rpt-mono); font-size: 8px; }

/* Slim-header (strony 2+) */
.rpt-slim-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--rpt-hairline);
  padding-bottom: 8px;
  font-size: 8px;
  color: var(--rpt-muted);
}
.rpt-slim-header img { height: 14px; display: block; }

/* ============ Adres ============ */
.rpt-address-block { margin-top: 18px; break-inside: avoid; page-break-inside: avoid; }
.rpt-eyebrow {
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--rpt-faint);
  text-transform: uppercase;
}
.rpt-address {
  font-family: var(--rpt-serif);
  font-size: 27px;
  font-weight: 600;
  color: var(--rpt-ink);
  letter-spacing: -0.01em;
  margin-top: 2px;
}
.rpt-address-sub { font-size: 8.5px; color: var(--rpt-muted); margin-top: 3px; }
.rpt-address-sub strong { color: var(--rpt-ink); }

/* ============ Blok ceny ============ */
.rpt-price-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 20px;
  break-inside: avoid;
  page-break-inside: avoid;
}
.rpt-price-label {
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--rpt-accent);
  text-transform: uppercase;
}
.rpt-price {
  font-family: var(--rpt-serif);
  font-size: 46px;
  font-weight: 600;
  color: var(--rpt-ink);
  line-height: 1.05;
  margin-top: 4px;
  /* Force even, same-height digits and consistent advance width. Without this a
     serif with old-style figures renders "4800" with a dropped 4 and a short 8. */
  font-variant-numeric: lining-nums tabular-nums;
  font-feature-settings: "lnum" 1, "tnum" 1;
  letter-spacing: -0.015em;
}
.rpt-price small { font-size: 20px; font-weight: 400; color: var(--rpt-muted); }
/* Cena za m2 — kupujacy porownuja wlasnie ja, ale nie moze konkurowac
   z kwota, ktora objasnia. Stad mniejszy stopien i wyciszony kolor. */
.rpt-price-per-sqm {
  font-size: 12px;
  font-weight: 500;
  color: var(--rpt-muted);
  margin-top: 2px;
  font-variant-numeric: lining-nums tabular-nums;
}
.rpt-per-sqm-inline { font-size: 8.5px; color: var(--rpt-muted); }
.rpt-price-side { text-align: right; display: flex; flex-direction: column; gap: 4px; }
.rpt-price-side-row { font-size: 9px; color: var(--rpt-muted); }
.rpt-price-side-row strong { color: var(--rpt-ink); font-size: 10px; }

/* RP-289: retain the production single-price row; only the equal mode adds a row. */
.rpt-price-summary .rpt-price-row { gap: 12px; }
.rpt-price-summary .rpt-price-side { min-width: 0; }
.rpt-price-summary .rpt-price-row > [data-price-kind] { flex-shrink: 0; }
.rpt-price-summary .rpt-price-dual { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.rpt-price-summary .rpt-price-dual .rpt-price { font-size: 42px; }
.rpt-price-summary .rpt-price-dual .rpt-price small { font-size: 19px; }
.rpt-price-details { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-top: 14px; }
.rpt-price-summary { break-inside: avoid; page-break-inside: avoid; }

/* Pewność szacunku (mini-pasek) */
.rpt-confidence-row {
  font-size: 9px;
  color: var(--rpt-muted);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.rpt-confidence-track {
  display: inline-block;
  width: 44px;
  height: 4px;
  background: var(--rpt-hairline);
  border-radius: 2px;
  position: relative;
}
.rpt-confidence-fill {
  position: absolute;
  left: 0; top: 0;
  height: 4px;
  background: var(--rpt-accent);
  border-radius: 2px;
}

/* Linia przedziału cenowego */
.rpt-range { margin-top: 14px; break-inside: avoid; page-break-inside: avoid; }
.rpt-range-track {
  position: relative;
  height: 2px;
  background: linear-gradient(90deg, var(--rpt-hairline), #93c5fd, var(--rpt-hairline));
}
.rpt-range-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 9px;
  height: 9px;
  background: var(--rpt-accent);
  border-radius: 50%;
  box-shadow: 0 0 0 2.5px #fff, 0 0 0 3.5px var(--rpt-accent);
}
.rpt-range-tick {
  position: absolute;
  top: -4px;
  width: 1.5px;
  height: 10px;
  background: var(--rpt-ink);
}
.rpt-range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  font-size: 7.5px;
  color: var(--rpt-faint);
}
.rpt-range-labels .is-key { color: var(--rpt-body); }

/* Rozbicie czynszu (tylko najem) */
.rpt-breakdown {
  display: flex;
  border-top: 1px solid var(--rpt-hairline);
  border-bottom: 1px solid var(--rpt-hairline);
  margin-top: 16px;
  break-inside: avoid;
  page-break-inside: avoid;
}
.rpt-breakdown-cell { flex: 1; padding: 8px 0; }
.rpt-breakdown-sep { width: 1px; background: var(--rpt-hairline); margin: 6px 18px; }
.rpt-breakdown-label {
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rpt-faint);
}
.rpt-breakdown-value { font-size: 13px; font-weight: 700; color: var(--rpt-ink); margin-top: 2px; }
.rpt-breakdown-value.is-total { color: var(--rpt-accent); }

/* ============ Nagłówek sekcji (numerowany) ============ */
.rpt-section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  border-bottom: 1px solid var(--rpt-ink);
  padding-bottom: 5px;
  margin-top: 20px;
  break-after: avoid;
  page-break-after: avoid;
}
.rpt-section-title .num { font-family: var(--rpt-mono); font-size: 8px; color: var(--rpt-accent); }
.rpt-section-title h2 {
  margin: 0;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rpt-ink);
}

/* ============ Parametry ============ */
.rpt-params { display: grid; grid-template-columns: repeat(4, 1fr); column-gap: 18px; }
.rpt-param {
  padding: 8px 0;
  border-bottom: 1px solid var(--rpt-hairline-soft);
  break-inside: avoid;
  page-break-inside: avoid;
}
.rpt-param-label {
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rpt-faint);
}
.rpt-param-value { font-size: 11px; font-weight: 600; color: var(--rpt-ink); margin-top: 1px; }

/* Udogodnienia — zwykły wiersz tekstu, bez pigułek */
.rpt-amenities { font-size: 8.5px; color: var(--rpt-muted); margin-top: 8px; }
.rpt-amenities strong { color: var(--rpt-ink); }

/* ============ Mapa (elastyczny bufor — SPEC § 5.1) ============ */
.rpt-map {
  flex: 1;
  min-height: 30mm;
  max-height: 80mm;
  border: 1px solid var(--rpt-hairline);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  margin-top: 10px;
  background: var(--rpt-map-bg);
}
.rpt-map img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rpt-map-caption {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 3px;
  padding: 3px 9px;
  font-size: 7.5px;
  color: var(--rpt-muted);
}

/* ============ Pasek wskaźników pod mapą ============ */
.rpt-statbar {
  display: flex;
  border-bottom: 1px solid var(--rpt-hairline);
  margin-top: 12px;
  break-inside: avoid;
  page-break-inside: avoid;
}
.rpt-statbar-cell { flex: 1; padding: 7px 0; }
.rpt-statbar-cell.is-wide { flex: 1.4; }
.rpt-statbar-sep { width: 1px; background: var(--rpt-hairline); margin: 6px 18px; }
.rpt-statbar-label {
  font-size: 7.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rpt-faint);
}
.rpt-statbar-value { font-size: 12.5px; font-weight: 700; color: var(--rpt-ink); margin-top: 3px; }
.rpt-statbar-value small { font-size: 8px; font-weight: 500; color: var(--rpt-faint); }
.rpt-statbar-note { font-size: 9px; font-weight: 500; color: var(--rpt-body); margin-top: 4px; line-height: 1.4; }
.rpt-statbar-meter { display: flex; align-items: center; gap: 7px; margin-top: 3px; }
.rpt-score-track {
  display: inline-block;
  width: 34px;
  height: 3px;
  background: var(--rpt-hairline);
  border-radius: 2px;
  position: relative;
}
.rpt-score-fill {
  position: absolute;
  left: 0; top: 0;
  height: 3px;
  background: var(--rpt-accent);
  border-radius: 2px;
}
.rpt-score-fill.is-green { background: var(--rpt-up); }

/* ============ Tekst ciągły (pojedynczy blok, pełna szerokość) ============
   Wcześniej 2 łamy (column-count). Zrezygnowano: przy podziale na kolumny
   czytelnik musi wracać wzrokiem na górę strony, a fragmentacja multicol na
   granicy strony jest w druku nieprzewidywalna. Jeden blok na pełną szerokość
   A4 czyta się liniowo i jest stabilny przy przelewie na kolejną stronę.
   Nieco większa interlinia rekompensuje dłuższy wiersz. */
.rpt-prose {
  margin: 9px 0 0 0;
  font-size: 9.5px;
  line-height: 1.75;
  color: var(--rpt-body);
  text-wrap: pretty;
  text-align: justify;
  hyphens: auto;
  orphans: 3;
  widows: 3;
}

/* ============ Czynniki wartości ============ */
.rpt-factor {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--rpt-hairline-soft);
  break-inside: avoid;
  page-break-inside: avoid;
}
.rpt-factor-arrow {
  width: 16px;
  flex-shrink: 0;
  text-align: center;
  font-size: 10px;
  line-height: 1.5;
  font-weight: 700;
  color: var(--rpt-faint);
}
.rpt-factor-arrow.is-up { color: var(--rpt-up); }
.rpt-factor-arrow.is-down { color: var(--rpt-down); }
.rpt-factor-name {
  width: 140px;
  flex-shrink: 0;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--rpt-ink);
  line-height: 1.45;
}
.rpt-factor-desc { flex: 1; font-size: 9.5px; color: #4b5563; line-height: 1.6; }

/* ============ Oferty porównawcze ============ */
.rpt-offers-intro { margin: 8px 0 0 0; font-size: 8.5px; color: var(--rpt-muted); }
.rpt-offers-intro strong { color: var(--rpt-ink); }
.rpt-offers { width: 100%; border-collapse: collapse; margin-top: 12px; }
.rpt-offers thead { display: table-header-group; }
.rpt-offers th {
  padding: 6px 6px 6px 0;
  text-align: right;
  border-bottom: 1.5px solid var(--rpt-ink);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rpt-muted);
  white-space: nowrap;
}
.rpt-offers th:first-child, .rpt-offers th.is-left { text-align: left; }
.rpt-offers td {
  padding: 13px 6px 13px 0;
  text-align: right;
  border-bottom: 1px solid var(--rpt-hairline-soft);
  font-size: 9px;
  color: #4b5563;
  vertical-align: middle;
}
.rpt-offers td:first-child, .rpt-offers td.is-left { text-align: left; }
.rpt-offers tr { break-inside: avoid; page-break-inside: avoid; }
.rpt-offer-title { display: block; font-size: 9.5px; font-weight: 600; color: var(--rpt-ink); }
.rpt-offer-address { display: block; font-size: 8px; color: var(--rpt-faint); margin-top: 2px; }
.rpt-offer-price { font-weight: 700; color: var(--rpt-ink); white-space: nowrap; }
/* Secondary transaction facts stay grey but remain legible on paper. */
.rpt-transactions .rpt-offer-address { color: #5f6773; }
/* RP-279: descriptions wrap between words; a source token longer than the
   column (e.g. raw RCN codes) breaks inside only as the last resort, so it can
   never widen the table or the A4 page. No hyphenation. */
.rpt-offers td.is-left { overflow-wrap: anywhere; }
.rpt-transactions td.is-left { overflow-wrap: anywhere; word-break: normal; hyphens: none; }
/* Auto table layout takes the date's extra space from the flexible description. */
.rpt-transactions .rpt-deed-date { min-width: 10ch; white-space: nowrap; }

/* Status — tylko kolor tekstu, bez pigułek */
.rpt-status { font-size: 8px; font-weight: 600; color: var(--rpt-up); white-space: nowrap; }
.rpt-status.is-inactive { color: var(--rpt-faint); }
.rpt-table-note { margin: 8px 0 0 0; font-size: 7.5px; color: var(--rpt-faint); }

/* ============ Zastrzeżenie / O raporcie ============ */
.rpt-disclaimer {
  border-top: 1px solid var(--rpt-hairline);
  padding-top: 10px;
  margin-top: auto;
  break-inside: avoid;
  page-break-inside: avoid;
}
.rpt-disclaimer-title {
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rpt-faint);
}
.rpt-disclaimer p {
  margin: 4px 0 0 0;
  font-size: 7.5px;
  line-height: 1.6;
  color: var(--rpt-faint);
  text-wrap: pretty;
}

/* ============ Stopka ============ */
.rpt-fixed-footer {
  display: none;
  justify-content: space-between;
  font-size: 7.5px;
  color: var(--rpt-faint);
  border-top: 1px solid var(--rpt-hairline);
  padding-top: 6px;
}
.rpt-screen-footer {
  display: flex;
  justify-content: space-between;
  font-size: 7.5px;
  color: var(--rpt-faint);
  border-top: 1px solid var(--rpt-hairline);
  padding-top: 6px;
  margin-top: 18px;
}

/* ============================================================
   PAGINACJA — SPEC.md § 6
   Rama tabelaryczna: thead/tfoot powtarzają margines górny/dolny
   na każdej stronie; position:fixed drukuje stopkę na każdej.
   ============================================================ */
/* RP-279: fixed layout keeps the page frame at the A4 content width; nested
   content can no longer push the header, prices and map past the page edge. */
.rpt-frame { width: 100%; border-collapse: collapse; table-layout: fixed; }
.rpt-frame > thead > tr > td, .rpt-frame > tbody > tr > td, .rpt-frame > tfoot > tr > td { padding: 0; }
.rpt-frame-top-spacer { height: 0; }
.rpt-frame-bottom-spacer { height: 0; }

/* RP-279: flex/grid children may shrink below their longest word, so an
   unknown unbreakable value wraps (overflow-wrap on .print-document) instead of
   pushing past the page. Ordinary content fits its share and keeps its layout. */
.rpt-params { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rpt-header-meta, .rpt-price-side, .rpt-statbar-cell, .rpt-statbar-meter > .rpt-statbar-value,
.rpt-breakdown-cell, .rpt-factor-desc, .rpt-screen-footer > span, .rpt-fixed-footer > span { min-width: 0; }
.rpt-map-caption { max-width: calc(100% - 16px); box-sizing: border-box; }

@media print {
  .advanced-report, .advanced-report * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* margin:0 usuwa domyślne nagłówki/stopki Chrome (URL, data) */
  @page advanced-valuation { size: A4 portrait; margin: 0; }
  html:has(.advanced-report), body:has(.advanced-report) { page: advanced-valuation; }

  html:has(.advanced-report), body:has(.advanced-report) {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    -webkit-font-smoothing: antialiased;
  }

  /* Ukryj aplikację; widoczny tylko klon raportu */
  .advanced-report .report-toolbar { display: none !important; }

  .advanced-report .print-document {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    /* Marginesy poziome; pionowe realizują spacery thead/tfoot */
    padding: 0 17mm !important;
    box-sizing: border-box !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  /* Marginesy pionowe powtarzane na każdej stronie */
  .advanced-report .print-document .rpt-frame-top-spacer { height: 15mm; }
  .advanced-report .print-document .rpt-frame-bottom-spacer { height: 20mm; }
  .advanced-report .print-document .rpt-frame > thead { display: table-header-group; }
  .advanced-report .print-document .rpt-frame > tfoot { display: table-footer-group; }

  /* Stopka na każdej stronie */
  .advanced-report .print-document .rpt-fixed-footer {
    display: flex !important;
    position: fixed;
    left: 17mm;
    right: 17mm;
    bottom: 10mm;
    background: #fff;
  }
  .advanced-report .print-document .rpt-screen-footer { display: none !important; }

  /* Mapa przy druku nie rośnie ponad limit (SPEC § 5.1) */
  .advanced-report .print-document .rpt-map { max-height: 80mm; }

  /* Sieroty i wdowy */
  .advanced-report :is(h1, h2, h3, .rpt-section-title) { break-after: avoid; page-break-after: avoid; }
  .advanced-report p { orphans: 3; widows: 3; }
  .advanced-report tr { break-inside: avoid; page-break-inside: avoid; }
  .advanced-report thead { display: table-header-group; }
}

@media screen {
  .advanced-report .print-only { display: none !important; }
}

/* Application wrapper only; document geometry above is the source template. */
.advanced-report { min-height: 100vh; background: #3f4a5c; overflow: auto; }
.advanced-report .report-toolbar { padding: 12px 24px; background: #111827; color: white; display: flex; gap: 16px; align-items: center; justify-content: space-between; font: 14px var(--rpt-sans); }
.advanced-report .report-toolbar button { background: #2563eb; border-radius: 6px; padding: 8px 16px; color: white; }
.advanced-report .report-toolbar button:disabled { opacity: .5; }
.advanced-report .rpt-map-unavailable { height: 100%; display: grid; place-items: center; font: 12px var(--rpt-sans); color: #6b7280; background: #eef1f6; }
@media print {
  .advanced-report { min-height: 0; background: white; overflow: visible; }
}

/* Physical margins reserve footer space even when Chromium fragments nested
   tables. Source table spacers alone let a real offer row overlap the footer. */
@media print {
  @page advanced-valuation {
    size: A4 portrait; margin: 15mm 17mm 20mm;
    /* Own all margin boxes so browser date/title/URL are not added. */
    @top-left { content: ""; }
    @top-center { content: ""; }
    @top-right { content: ""; }
    @bottom-center { content: ""; }
    @bottom-left {
      font: 7.5px 'IBM Plex Sans'; color: #5f6773; width: 50%;
      border-top: 1px solid #dce1e8; margin: 5mm 0 10mm; padding-top: 6px; text-align: left;
    }
    @bottom-right {
      overflow-wrap: anywhere; word-break: break-all;
      font: 7.5px 'IBM Plex Sans'; color: #5f6773; width: 50%;
      border-top: 1px solid #dce1e8; margin: 5mm 0 10mm; padding-top: 6px; text-align: right;
    }
  }
  .advanced-report .print-document { padding: 0 !important; }
  .advanced-report .print-document .rpt-frame-top-spacer,
  .advanced-report .print-document .rpt-frame-bottom-spacer { height: 0; }
  .advanced-report .print-document .rpt-fixed-footer { display: none !important; }
}

/* Gecko does not implement @page margin boxes. Reserve the same A4 insets
   inside the document and repeat the existing footer instead. This also works
   with Firefox's "Margins: None" printer setting. Keep Chromium's pagination
   above unchanged: its nested table fragments need physical page margins. */
@media print {
  @supports (-moz-appearance: none) {
    @page advanced-valuation { margin: 0; }
    .advanced-report .print-document { padding: 0 17mm !important; }
    .advanced-report .print-document .rpt-frame-top-spacer { height: 15mm; }
    .advanced-report .print-document .rpt-frame-bottom-spacer { height: 20mm; }
    .advanced-report .rpt-frame > tbody > tr { break-inside: auto; page-break-inside: auto; }
    .advanced-report .print-document .rpt-fixed-footer {
      display: flex !important;
      bottom: 5mm; height: 10mm; box-sizing: border-box; line-height: 1.25;
    }
    .advanced-report .rpt-fixed-footer > span { max-width: 50%; overflow-wrap: anywhere; }
    .advanced-report .rpt-fixed-footer > span:last-child { text-align: right; word-break: break-all; }
  }
}

/* Optional partner header. Default markup and geometry stay unchanged.
   RP-235: the brand takes all width left by the report title column, so long
   names wrap less; names over 45/60 characters step down to 11/10 px and
   balance their lines. Breaking inside a word stays the last-resort fallback. */
.rpt-header:has(.rpt-partner-brand) { column-gap: 24px; }
.rpt-partner-brand { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0; }
.rpt-partner-brand .rpt-header-logo { max-width: 120px; object-fit: contain; flex-shrink: 0; }
.rpt-partner-brand + .rpt-header-meta { flex-shrink: 0; }
.rpt-partner-name { min-width: 0; font-size: 12px; font-weight: 700; overflow-wrap: anywhere; text-wrap: balance; }
.rpt-partner-name--long { font-size: 11px; }
.rpt-partner-name--xlong { font-size: 10px; }
.rpt-partner-banner { margin-top: 4px; font-size: 8px; color: var(--rpt-muted); overflow-wrap: anywhere; white-space: pre-wrap; }
.rpt-header-meta:has(.rpt-partner-banner) { max-width: 46%; }

.rpt-header-logo--partner { max-width: 160px; object-fit: contain; }

.rpt-screen-footer > span:last-child { max-width: 50%; overflow-wrap: anywhere; text-align: right; }

/* Parcel findings synced from AI Valuation U91. */
.advanced-report .rpt-land { margin-top: 10px; break-inside: avoid; page-break-inside: avoid; }
.advanced-report .rpt-land-block { break-inside: avoid; page-break-inside: avoid; }
.advanced-report .rpt-land-block h4 {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rpt-muted);
  margin: 0 0 3px;
}
.advanced-report .rpt-land-block p,
.advanced-report .rpt-land-block li { font-size: 9px; margin: 0 0 2px; }
.advanced-report .rpt-land-block ul { margin: 0; padding-left: 14px; }
.advanced-report .rpt-land-sources { font-size: 8px; color: var(--rpt-muted); margin-top: 4mm; }

/* Shared mobile preview with AI Valuation. Never apply these rules to print. */
.rpt-table-hint { display: none; }
@media screen and (max-width: 800px) {
  .print-document {
    width: 100%; margin: 0 auto; padding: 24px 16px 32px;
    box-shadow: none; font-size: 14px; overflow-wrap: anywhere;
  }
  /* The outer table exists only to paginate paper; it must not impose its
     nested comparison tables' intrinsic width on the mobile document. */
  .rpt-frame, .rpt-frame > tbody, .rpt-frame > tbody > tr,
  .rpt-frame > tbody > tr > td { display: block; width: 100%; min-width: 0; }
  .rpt-frame > thead, .rpt-frame > tfoot { display: none; }
  .rpt-header { align-items: flex-start; gap: 16px; flex-wrap: wrap; }
  .rpt-header-meta { text-align: left; }
  .rpt-header-title { font-size: 11px; letter-spacing: .08em; }
  .rpt-header-sub, .rpt-header-sub code { font-size: 11px; }
  .rpt-partner-brand, .rpt-header-meta:has(.rpt-partner-banner) { max-width: 100%; }
  .rpt-partner-brand + .rpt-header-meta { flex-shrink: 1; }
  .rpt-partner-banner { font-size: 12px; }
  .rpt-address { font-size: 28px; line-height: 1.25; }
  .rpt-address-sub, .rpt-eyebrow, .rpt-price-label { font-size: 11px; }
  .rpt-price-row { flex-direction: column; align-items: stretch; gap: 16px; }
  .rpt-price-summary .rpt-price-dual { grid-template-columns: minmax(0, 1fr); }
  .rpt-price-summary .rpt-price-dual .rpt-price { font-size: clamp(32px, 9vw, 42px); }
  .rpt-price-details { flex-direction: column; align-items: stretch; }
  .rpt-price { font-size: clamp(32px, 9vw, 46px); }
  .rpt-price-side { text-align: left; }
  .rpt-price-side-row, .rpt-price-side-row strong { font-size: 14px; }
  .rpt-confidence-row { justify-content: flex-start; font-size: 12px; }
  .rpt-range-labels { font-size: 11px; gap: 12px; }
  .rpt-section-title { margin-top: 28px; gap: 8px; }
  .rpt-section-title h2 { font-size: 12px; letter-spacing: .07em; }
  .rpt-section-title .num { font-size: 11px; }
  .rpt-params { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
  .rpt-param-label, .rpt-statbar-label, .rpt-breakdown-label { font-size: 11px; }
  .rpt-param-value, .rpt-statbar-value { font-size: 15px; }
  .rpt-amenities, .rpt-offers-intro, .rpt-table-note { font-size: 12px; }
  .rpt-map { height: 220px !important; min-height: 0; max-height: 260px !important; }
  .rpt-map-caption { max-width: calc(100% - 16px); font-size: 10px; }
  .rpt-statbar, .rpt-breakdown { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
  .rpt-statbar-sep, .rpt-breakdown-sep { display: none; }
  .rpt-statbar-cell, .rpt-breakdown-cell { min-width: 0; }
  .rpt-statbar-note, .rpt-statbar-value small { font-size: 11px; }
  .rpt-prose { font-size: 14px; line-height: 1.7; text-align: left; }
  .rpt-factor { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 6px 10px; padding: 16px 0; }
  .rpt-factor-name { width: auto; font-size: 14px; }
  .rpt-factor-arrow { font-size: 13px; }
  .rpt-factor-desc { grid-column: 2; font-size: 14px; }
  .rpt-table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
  .rpt-table-scroll:focus-visible { outline: 2px solid var(--rpt-accent); outline-offset: 2px; }
  .rpt-table-scroll .rpt-offers { min-width: 760px; }
  .rpt-offers th { font-size: 11px; }
  .rpt-offers td, .rpt-offer-title { font-size: 13px; }
  .rpt-offer-address, .rpt-status { font-size: 12px; }
  .rpt-table-hint { display: block; font-size: 12px; color: var(--rpt-muted); margin: 10px 0 4px; }
  .rpt-disclaimer { margin-top: 24px; }
  .rpt-disclaimer-title, .rpt-disclaimer p, .rpt-screen-footer { font-size: 11px; }
  .rpt-screen-footer { gap: 16px; }
  :is(.advanced-report, .print-overlay) .rpt-land-block h4 { font-size: 12px; }
  :is(.advanced-report, .print-overlay) .rpt-land-block p,
  :is(.advanced-report, .print-overlay) .rpt-land-block li,
  :is(.advanced-report, .print-overlay) .rpt-land-sources { font-size: 12px; }
  :is(.advanced-report, .print-overlay) .report-toolbar { flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
  .report-toolbar > div { flex-wrap: wrap; min-width: 0; }
  .report-toolbar button { min-height: 44px; }
}
@media print { .rpt-table-scroll { display: contents; } }

/* RP-256: keep meaningful chart marks when the printer omits backgrounds.
   No changes to dimensions, labels, values or pagination. */
@media print {
  .rpt-confidence-track::before,
  .rpt-score-track::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 0.5px solid var(--rpt-muted);
    border-radius: inherit;
  }
  .rpt-confidence-fill { box-sizing: border-box; border-top: 4px solid var(--rpt-accent); }
  .rpt-score-fill { box-sizing: border-box; border-top: 3px solid var(--rpt-accent); }
  .rpt-score-fill.is-green { border-top-color: var(--rpt-up); }
  .rpt-range-track::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 50%;
    border-top: 1px solid var(--rpt-muted);
    transform: translateY(-50%);
  }
  .rpt-range-dot {
    box-sizing: border-box;
    border: 4.5px solid var(--rpt-accent);
    box-shadow: none;
    outline: 1px solid var(--rpt-accent);
    outline-offset: 2.5px;
  }
  .rpt-range-tick { box-sizing: border-box; border-left: 1.5px solid var(--rpt-ink); }
}
