/* ============================================================================
   FP&A report v3 — the document stylesheet (docs/plans/fpa-report-v3/SPEC.md §2)
   ----------------------------------------------------------------------------
   ONE file for every medium. The in-app preview and the public link LINK it;
   the WeasyPrint PDF INLINES it (report_pdf_v3.html, via
   report_v3_layout.document_css) and adds @page.

   THE DOCUMENT FLOWS — it is never cut into sheets.
     screen  one continuous column of chapter cards beside a sticky table of
             contents (`@media screen` below);
     print   the same chapters one after another over A4-landscape pages; the
             renderer paginates them with the break rules in this file (the
             "PAGINATION" section), the running header / footer live in the
             @page margin boxes of report_pdf_v3.html.

   Sizes are written ONCE, in print units (pt / mm). A screen does not restate
   them: it scales the whole reading column with `zoom` (see `.r3-main`), so
   the two media cannot drift apart.

   Geometry contract — the grid tracks are RATIOS of the content width, and
   src/ataski/fpa_analyst/report_v3_layout.py (COLUMN_MM) holds the same
   ratios for a 275 mm printed content box, so a chart can be drawn at the
   pixel width of its printed column. tests/test_fpa_report_v3_render.py binds
   the two files.

     content 275 mm (A4 landscape, 11 mm side margins)
     g2      1 : 1            gap 4 mm  → 135.5 + 135.5
     g21     160 : 110        gap 5 mm  → 160 + 110
     g3      1 : 1 : 1        gap 4 mm  → 89 × 3
     g4      1 : 1 : 1 : 1    gap 4 mm  → 65.75 × 4
     box     1px border + 3.5 mm side padding

   WeasyPrint-safe: block / grid / table only, no JS, no web fonts (the PDF
   image has DejaVu Sans; the screen gets General Sans from the app shell).
   Nothing in the printed flow hides its overflow.

   Palette = cv5 tokens (static/css/fpa-cockpit.css): ink #17233D,
   ink2 #46536E, ink3 #6D7890, line #E3E7F0, navy #16314E, blue #0B5CAD,
   emerald #118761, rose #C74255, amber #AC711C.
   ============================================================================ */

/* THE DIGIT-GROUP SPACE. ru and fr group digits with U+202F, the narrow
   no-break space («1 454,4» — ataski.i18n.numbers). General Sans has no
   such glyph, and the browser's own fallback drew it about 0.1 em wide: on
   a screen a Russian figure read «1454,4». This face supplies that ONE
   character (unicode-range) from a font already on the reader's system —
   local() only, nothing is downloaded — in which it is a proper thin space
   (≈ 0.2 em: Arial, Helvetica, Liberation Sans, DejaVu Sans). Every other
   character still comes from the stack after it. The PDF (DejaVu Sans)
   resolves it the same way. */
@font-face {
  font-family: "R3 Group Space";
  src: local("Arial"), local("ArialMT"), local("Helvetica"), local("Liberation Sans"),
    local("LiberationSans"), local("DejaVu Sans"), local("DejaVuSans");
  unicode-range: U+202F;
  font-weight: 100 900;
  font-style: normal;
}

.r3doc {
  font-family: "R3 Group Space", "General Sans", "DejaVu Sans", "Liberation Sans", Arial, sans-serif;
  color: #17233D;
  font-size: 8.4pt;
  line-height: 1.38;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  text-align: left;
}
.r3doc *, .r3doc *::before, .r3doc *::after { box-sizing: border-box; }
.r3doc h2, .r3doc h3, .r3doc p, .r3doc li, .r3doc dd, .r3doc td { overflow-wrap: break-word; }
.r3doc figure { margin: 0; }

/* ── A chapter ────────────────────────────────────────────────────────── */
.r3-ch { margin: 0; }
.r3-ch + .r3-ch { margin-top: 6mm; }
.r3-ch-head { margin: 0 0 2.5mm; }
.r3-eyebrow {
  margin: 0 0 1mm; font-size: 6.8pt; line-height: 1.3; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; color: #0B5CAD;
}
.r3doc h2.r3-hl {
  margin: 0; max-width: 255mm; font-size: 15pt; line-height: 1.18;
  font-weight: 700; letter-spacing: -.01em; color: #17233D;
}
.r3-lede { margin: 1.2mm 0 0; max-width: 245mm; color: #46536E; font-size: 8.8pt; }
/* A conclusion beside the headline (Chapter.subhead) — highlighted, one line. */
.r3-subhead {
  display: inline-block; margin: 1.6mm 0 0; padding: .8mm 2.4mm; max-width: 255mm;
  border-left: 2px solid #0B5CAD; background: #EEF4FB; color: #0B5CAD;
  font-size: 10pt; line-height: 1.3; font-weight: 700;
}

.r3doc .r3-bd > * + * { margin-top: 3mm; }

/* ── Grids (ratio tracks — see the geometry contract above) ──────────── */
.r3-g1, .r3-g2, .r3-g21, .r3-g3, .r3-g4 { display: grid; align-items: start; }
.r3-g1 { grid-template-columns: minmax(0, 1fr); gap: 4mm; }
.r3-g2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4mm; }
.r3-g21 { grid-template-columns: minmax(0, 160fr) minmax(0, 110fr); gap: 5mm; }
.r3-g3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 4mm; }
.r3-g4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 4mm; }
.r3doc .r3-col { min-width: 0; }
.r3doc .r3-col > * + * { margin-top: 2.5mm; }

.r3doc h3.r3-h { margin: 0 0 1.5mm; font-size: 9pt; line-height: 1.3; font-weight: 700; color: #17233D; }
.r3doc h3.r3-h small { margin-left: 1.5mm; font-size: 7.4pt; font-weight: 500; color: #6D7890; }

.r3-box {
  min-width: 0; padding: 3mm 3.5mm;
  border: 1px solid #E3E7F0; border-radius: 3mm; background: #FFFFFF;
}
.r3-box.soft { background: #F5F7FB; border-color: #F5F7FB; }
.r3-box.warn { background: #FFFAF0; border-color: #EDD9AB; }
/* A chart fills the column it stands in: in print that IS the width it was
   drawn at; on a screen the drawing scales with the card. */
.r3-cv svg {
  display: block; width: 100%; height: auto;
  /* the charts' figures get the same digit-group space as the text */
  font-family: "R3 Group Space", "General Sans", "DejaVu Sans", "Liberation Sans", Arial, sans-serif;
}
/* A ROW of charts (report_v3_layout.ChartRow): a heading takes two lines
   at most — a long counterparty name is clamped, the whole of it stays in
   the heading's tooltip. When a heading of the row cannot hold its title
   and its units on one line, every subtitle (the units) of the row takes a
   line of its own, never clamped away (`tu`); when a TITLE needs two
   lines, every title of the row is given two (`tl2`). So the charts under
   them start on one line. The screen aligns them exactly (subgrid, below). */
.r3-charts h3.r3-h, .r3-charts.tu h3.r3-h .r3-ht, .r3-charts.tl2 h3.r3-h .r3-ht {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  overflow: hidden;
}
.r3-charts.tu h3.r3-h, .r3-charts.tl2 h3.r3-h {
  display: block; -webkit-line-clamp: none; line-clamp: none; overflow: visible;
}
.r3-charts.tl2 h3.r3-h .r3-ht { min-height: 2.6em; }
.r3doc .r3-charts.tu h3.r3-h small, .r3doc .r3-charts.tl2 h3.r3-h small {
  display: block; margin: .4mm 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── KPI tiles — as many columns as tiles (a dropped tile widens the rest) */
.r3-tiles { display: grid; gap: 3mm; }
.r3-tiles.n1 { grid-template-columns: minmax(0, 1fr); }
.r3-tiles.n2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.r3-tiles.n3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
.r3-tiles.n4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
.r3-tiles.n5 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
.r3-tiles.n6 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
.r3-tile {
  min-width: 0; padding: 2.2mm 2.8mm; background: #F7F9FC;
  border: 1px solid #E3E7F0; border-top: 2.5px solid #16314E; border-radius: 2.5mm;
}
.r3-tile:nth-child(2) { border-top-color: #0D7C54; }
.r3-tile:nth-child(3) { border-top-color: #0F8B8D; }
.r3-tile:nth-child(4) { border-top-color: #8D4B9D; }
.r3-tile:nth-child(5) { border-top-color: #0B5CAD; }
.r3-tile:nth-child(6) { border-top-color: #6D7890; }
.r3-tile .tl { margin: 0; font-size: 7pt; font-weight: 600; color: #46536E; }
.r3-tile .tv { margin: 1mm 0 .5mm; font-size: 15pt; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.r3-tile .tv small { margin-left: 1mm; font-size: 8pt; font-weight: 500; letter-spacing: 0; color: #6D7890; }
.r3-tile .td { margin: 0; min-height: 3.5mm; font-size: 7pt; font-weight: 600; }
/* The baseline rung's delta: a second, quieter comparison line. */
.r3-tile .td.tr { min-height: 0; margin-top: .3mm; }
/* One comparison never breaks inside («+38 %» left at a line's end, «г/г»
   alone on the next): it moves to the next line whole, and wraps inside
   itself only when it is wider than the tile. */
.r3-tile .td > span { display: inline-block; }
.r3-tile .ts { margin: .8mm 0 0; font-size: 6.8pt; color: #6D7890; }
.r3-tile .ts.flag { color: #AC711C; font-weight: 600; }
.r3-tile .sp { margin-top: 1.2mm; height: 5.5mm; }
.r3-tile .sp svg { display: block; width: 100%; height: 5.5mm; }

/* ── Numbered points ─────────────────────────────────────────────────── */
.r3-pts { margin: 0; padding-left: 4.5mm; }
.r3-pts li { margin: 0 0 1.3mm; }
.r3-pts li:last-child { margin-bottom: 0; }
.r3-pts li.p-risk::marker, .r3-pts li.p-warn::marker { color: #AC711C; }
.r3-pts li.p-good::marker { color: #118761; }
/* Markers stated, not inherited: inside the app shell a reset stylesheet
   sets `ol, ul { list-style: none }` and «Главное» lost its numbers. */
.r3doc ol.r3-pts { list-style: decimal; }
.r3doc ul.r3-pts { list-style: disc; }
.r3doc a.r3-ref { white-space: nowrap; font-size: 7.2pt; color: #0B5CAD; text-decoration: none; }
/* «Not in this report» — how to get each missing part (`.r3-omit-act`): in
   the report's accent, like a chapter reference, never the browser's
   default blue underline; a link where the preview has a page to open,
   quieter plain text where it has none (the public link, the PDF). */
.r3doc .r3-omit-act { color: #46536E; }
.r3doc a.r3-omit-act { color: #0B5CAD; font-weight: 500; text-decoration: none; }
.r3doc a.r3-omit-act:hover { text-decoration: underline; text-underline-offset: 2px; }
.r3doc a.r3-omit-act:focus-visible { outline: 2px solid #0B5CAD; outline-offset: 1px; border-radius: 2px; }
.r3-basebox {
  margin: 2.5mm 0 0; padding: 2.5mm 3mm; border-radius: 2mm;
  background: #EAF3FB; color: #46536E; font-size: 7.6pt;
}
.r3-basebox b { color: #17233D; }
.r3-ref3 { color: #6D7890; }
.r3doc .r3-col > .r3-basebox:first-child { margin-top: 0; }

/* ── Tables ──────────────────────────────────────────────────────────── */
.r3-tblock { min-width: 0; }
/* A NARROW table (one or two columns of figures — ReportV3View.compact,
   `r3-cmp`) never stretches across the page with its figures a page-width
   from their labels. Beside a partner it stands in a half (`r3-pair`, the
   template's job); alone at full width it takes a g2 half (135.5 of
   275 mm). On a screen it is narrower still: see the SCREEN section. */
.r3doc .r3-bd > .r3-tblock.r3-cmp, .r3doc .r3-tblock.r3-narrow { width: 49.3%; }
/* Rows of charts standing in a half column (beside a narrow table): two to
   a row, in quarters, a row-gap apart. */
.r3doc .r3-col > .r3-nest + * { margin-top: 4mm; }
.r3-t { width: 100%; border-collapse: collapse; font-size: 7.8pt; }
.r3-t.sm { font-size: 7.3pt; }
.r3-t thead { display: table-header-group; }
.r3-t th {
  padding: 1.2mm 1.6mm; border-bottom: 1px solid #D3D9E6;
  text-align: left; vertical-align: bottom;
  font-size: 6.6pt; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #6D7890;
}
.r3-t td { padding: 1mm 1.6mm; border-bottom: 1px solid #E3E7F0; vertical-align: top; }
.r3-t.sm td { padding: .9mm 1.3mm; }
.r3-t .r { text-align: right; white-space: nowrap; }
.r3-t th.r { white-space: normal; }
.r3-t th:first-child { white-space: normal; }
.r3-t td.f { font-weight: 700; background: #F3F7FB; }
.r3-t .sep { border-left: 1px solid #E3E7F0; }
.r3-t tr.k-total td { font-weight: 700; background: #F7F9FC; border-bottom-color: #D3D9E6; }
.r3-t tr.k-total td.f { background: #EAF1F9; }
.r3-t tr.k-flag td { background: #FFF7E5; }
.r3-t tr.k-highlight td { background: #EAF3FB; }
.r3-t tr.k-sub td.lb { padding-left: 5mm; color: #46536E; }
.r3-t tr.k-muted td { color: #6D7890; }
.r3-t td.t-pos { color: #118761; }
.r3-t td.t-neg { color: #C74255; }
.r3-t td.t-flag { color: #AC711C; font-weight: 700; }
.r3-t td.t-muted { color: #6D7890; }
.r3-t td.sp { padding-top: .6mm; padding-bottom: .4mm; }
.r3-t td.sp svg { display: inline-block; width: 64px; height: 14px; vertical-align: middle; }
/* The scenario mark: an INLINE box around a no-break space, so it cannot be
   left alone on a line above its label (an inline-block could be). */
.r3-sw {
  display: inline; margin-right: 1mm; padding: 0 .72mm; border-radius: .5mm;
  font-size: 5.6pt; line-height: 1; font-style: normal; vertical-align: .22mm;
  border: 1px solid transparent;
}
.r3-sw.f { background: #16314E; border-color: #16314E; }
.r3-sw.b { background: #FFFFFF; border: 1px dashed #16314E; }
.r3-sw.y { background: #CDD6E4; border-color: #CDD6E4; }
.r3-bar {
  display: inline-block; width: 14mm; height: 1.6mm; margin-left: 1.5mm;
  border-radius: 1mm; background: #E6EBF3; vertical-align: .2mm;
}
.r3-bar i { display: block; height: 1.6mm; border-radius: 1mm; background: #1E4A7A; }
/* Four tables abreast (65 mm each): a shorter share bar and tighter cells,
   so a long counterparty header cannot push the table past its column. */
.r3-g4 .r3-bar { width: 8mm; margin-left: 1mm; }
.r3-g4 .r3-t th, .r3-g4 .r3-t td { padding-left: 1mm; padding-right: 1mm; }
.r3-g4 .r3-t th { letter-spacing: 0; font-size: 6.2pt; }
/* A one-word header longer than its column («GESCHÄFTSPARTNER») breaks —
   hyphenated where the language allows — instead of widening the table. */
.r3-g4 .r3-t th:first-child, .r3-g4 .r3-t td.lb { hyphens: auto; overflow-wrap: anywhere; }
.r3-tag {
  margin-left: 1mm; padding: .2mm 1.2mm; border-radius: 1mm;
  background: #FFF7E5; color: #AC711C; font-size: 6.4pt; font-weight: 700; white-space: nowrap;
}
/* The variance table: what · why · so what. */
.r3-t.r3-ex td { padding: .8mm 1.8mm; line-height: 1.26; }
.r3-t.r3-ex td.k { width: 22%; font-weight: 700; }
.r3-t.r3-ex td.so { width: 34%; color: #46536E; font-style: italic; }
.r3-t.r3-ex .pos { color: #118761; }
.r3-t.r3-ex .neg { color: #C74255; }

.r3doc .pos { color: #118761; }
.r3doc .neg { color: #C74255; }
/* An opening chapter with little on it (the investor brief: tiles and
   points, no charts) reads at a larger size. */
.r3-month.roomy .r3-tile .tv { font-size: 19pt; }
.r3-month.roomy .r3-tile .tl, .r3-month.roomy .r3-tile .td { font-size: 8pt; }
.r3-month.roomy .r3-tile .ts { font-size: 7.6pt; }
.r3-month.roomy .r3-pts { font-size: 10pt; line-height: 1.45; }
.r3-month.roomy .r3-pts li { margin-bottom: 3mm; }
.r3-month.roomy h3.r3-h { font-size: 11pt; margin-bottom: 2.5mm; }
.r3-month.roomy .r3-basebox { font-size: 8.4pt; }
/* `.r3doc` so a lone chart (a <figure>, whose `.r3doc figure` margin reset
   is stronger than a bare `.r3-month` rule) keeps its gap under the band
   of «Главное» / «Риски» instead of touching it. */
.r3doc .r3-month > * + * { margin-top: 3mm; }
.r3-src { margin: 1.5mm 0 0; font-size: 7pt; line-height: 1.4; color: #6D7890; }
.r3-notes > .r3-src:first-child { margin-top: 0; }
.r3-alert {
  padding: 2.2mm 3mm; border: 1px solid #EDD9AB; border-radius: 2.5mm;
  background: #FFF7E5; font-size: 7.8pt;
}
.r3-rule { padding: 1.8mm 3mm; border-radius: 2mm; background: #EAF3FB; color: #46536E; font-size: 7.4pt; }

/* ── Small stats ─────────────────────────────────────────────────────── */
.r3-stats { display: grid; gap: 2.5mm; }
.r3-stats.c1 { grid-template-columns: minmax(0, 1fr); }
.r3-stats.c2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.r3-stats.c3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
.r3-stats.c4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
.r3-st { min-width: 0; padding: 2.2mm 3mm; border-radius: 2.5mm; background: #F5F7FB; }
.r3-st p { margin: 0; font-size: 7.2pt; font-weight: 600; color: #6D7890; }
.r3-st b { display: block; margin: .4mm 0; font-size: 14pt; line-height: 1.2; font-weight: 700; }
.r3-st span { display: block; font-size: 7pt; color: #46536E; }
.r3-st.w { background: #FFF7E5; }
.r3-st.g { background: #E9F8F2; }

/* ── Methodology ─────────────────────────────────────────────────────── */
.r3-ladder { margin: 0; padding-left: 5mm; font-size: 7.6pt; }
.r3doc ol.r3-ladder { list-style: decimal; }
.r3-ladder li { margin-bottom: 1mm; color: #6D7890; }
.r3-ladder li.used { color: #17233D; }
.r3-ladder li.absent { text-decoration: line-through; }
.r3-gl { margin: 0; font-size: 7.4pt; }
.r3-gl > div + div { margin-top: 1.4mm; }
.r3-gl dt { font-weight: 700; }
.r3-gl dd { margin: .2mm 0 0; color: #46536E; }
.r3-box h3.r3-h + * { margin-top: 0; }
.r3-box * + h3.r3-h { margin-top: 3mm; }
/* PRINT: the methodology is ONE flow in reading order (L_method_print).
   (The screen's balanced columns, printed, were a band that broke across
   pages column by column: the glossary began in the third column of one
   page and went on in the second of the next — founder, the СЛК PDF,
   2026-10-12.)
   * Its boxes — source, baseline ladder, data quality, what was left out,
     the notes — run in newspaper columns: down the first, then the second;
     a box never splits, and on a page break the columns of one page are
     all read before the next page's.
   * The glossary follows across the full width, three terms to a line,
     left to right: the lines are table rows, so a page breaks between two
     lines of terms, never inside a term; the box's border is drawn on both
     pages. */
.r3doc.r3-print div.r3-method { break-inside: auto; }
.r3doc.r3-print div.r3-method .r3-box {
  break-inside: auto; box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.r3doc.r3-print .r3-mcols { columns: 2; column-gap: 4mm; }
.r3doc.r3-print div.r3-mflow .r3-mcols > * { margin: 0 0 2mm; break-inside: avoid; }
.r3doc.r3-print div.r3-mflow .r3-mcols > .r3-notes { break-before: auto; }
.r3doc.r3-print .r3-mflow > * + * { margin-top: 0.5mm; }
.r3doc.r3-print .r3-gl-rows { display: table; width: 100%; table-layout: fixed; }
.r3doc.r3-print .r3-gl-row { display: table-row; break-inside: avoid; }
.r3doc.r3-print .r3-gl-row > div {
  display: table-cell; width: 33.3%; padding: 0 4mm .8mm 0; vertical-align: top;
}
/* SCREEN: the glossary's last terms hold together (`r3-gl-tail`) in the
   third column of the balanced band. */
.r3-gl + .r3-gl-tail { margin-top: 1.4mm; }
.r3-gl-tail { break-inside: avoid; }
.r3-ladder li { break-inside: avoid; }
/* «Главное» | «Риски» of the opening chapter may break too: they are
   sentences, not figures, and in a long language they outgrow the page —
   the boxes then break between their points instead of leaving the first
   page to the tiles alone. */
.r3doc.r3-print .r3-month > .r3-g2,
.r3doc.r3-print .r3-month > .r3-g2 > .r3-box:not(.r3-chart) { break-inside: auto; }

/* ── In-app actions — the preview only (the public link and the PDF carry
      neither: ataski.web.fpa_report_v3_actions). ──────────────────────────
   «Докажи цифру»: the figure keeps its own face — an unstyled button that
   inherits the cell's or the tile's type, tabular numerals included — and
   gains only a dotted underline and a pointer.
   «Утвердить предложенный бюджет»: one quiet block under the proposal.
   The selectors carry `.r3doc` on purpose: the app shell resets every button
   (`.cv5 button { background: none; color: inherit; border: none }`), and a
   bare class would lose to it. */
.r3doc .r3-drill {
  appearance: none; margin: 0; padding: 0; border: 0; background: none;
  font: inherit; font-variant-numeric: inherit; letter-spacing: inherit; color: inherit;
  text-align: inherit; cursor: pointer;
  text-decoration: underline dotted #9AA3B5; text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.r3doc .r3-drill:hover, .r3doc .r3-drill:focus-visible { color: #0B5CAD; text-decoration-color: #0B5CAD; }
.r3doc .r3-drill:focus-visible { outline: 2px solid #0B5CAD; outline-offset: 2px; border-radius: 2px; }
.r3-act {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2mm 3mm;
  margin-top: 2.5mm; padding: 2.4mm 3mm; border: 1px solid #C9D8EA; border-radius: 2.5mm;
  background: #F3F7FB;
}
.r3-act form { margin: 0; }
.r3doc .r3-btn {
  appearance: none; padding: 1.6mm 3.2mm; border: 1px solid #0B5CAD; border-radius: 2mm;
  background: #0B5CAD; color: #fff; font: inherit; font-size: 8pt; font-weight: 700;
  cursor: pointer; white-space: nowrap;
}
.r3doc .r3-btn:hover { background: #16314E; border-color: #16314E; }
.r3doc .r3-btn:focus-visible { outline: 2px solid #16314E; outline-offset: 2px; }
.r3-act-note { flex: 1 1 60mm; margin: 0; font-size: 7.4pt; line-height: 1.4; color: #46536E; }
.r3-act-note b { color: #16314E; }
.r3-act-note a { color: #0B5CAD; font-weight: 600; white-space: nowrap; }

/* ── The disclaimer — once at the end on a screen, in the bottom margin box
      of every page in print (report_pdf_v3.html lifts it there). ───────── */
.r3-foot { font-size: 7.2pt; line-height: 1.35; color: #6D7890; }
.r3-stale { display: block; margin-top: .6mm; color: #AC711C; font-weight: 700; }

/* ══ PAGINATION — how the flow breaks over printed pages ═════════════════
   No block is planned onto a page; these rules only say what must not be
   torn apart. Harmless on a screen (nothing fragments there).

   * a heading never ends a page: the chapter head and every block heading
     stay with what follows;
   * tiles, stats, boxes, charts, alerts and SHORT tables (fewer than
     report_v3_layout.BREAKABLE_ROWS rows) never break inside;
   * any other table may break — its header repeats on every page, a row
     never splits, and its first and last row groups (KEEP_ROWS rows each,
     report_v3_layout.row_groups) hold together, so a page never gets fewer
     than that, nor a lone total row;
   * a source note stays with the table or chart above it;
   * a band of columns is kept whole — see "BANDS AS TABLE ROWS" below;
   * the note that says why a chapter is in the document, and an alert that
     opens a chapter, stay with the block they introduce. */
.r3-ch-head { break-inside: avoid; break-after: avoid; }
.r3-eyebrow, .r3doc h2.r3-hl, .r3doc h3.r3-h { break-after: avoid; }
.r3-lede { break-before: avoid; }
.r3-tiles, .r3-tile, .r3-stats, .r3-st, .r3-box, .r3-alert, .r3-rule, .r3-basebox,
.r3-tblock.keep, .r3-pts li, .r3-gl > div { break-inside: avoid; }
/* Boxes side by side on a screen share a height; the methodology's are
   stacks of different lengths and keep their own. */
.r3doc div.r3-method { align-items: start; }
/* A band whose table is too long for a grid: its columns simply stack. */
.r3doc .r3-stack > * + * { margin-top: 3mm; }
.r3-t tr { break-inside: avoid; }
.r3-t thead { break-after: avoid; }
.r3-t tbody.keep { break-inside: avoid; }
.r3-tw + .r3-src, .r3-cv + .r3-src { break-before: avoid; }
/* In an industry block, the row of charts that follows its stats belongs
   to them (the block IS its figures and their months): a page never ends
   on the stats with the charts alone on the next page — the real
   sample's People block did, a page a third full. */
.r3-ch[data-layout="industry"] .r3-stats + .r3-charts,
.r3-ch[data-layout="industry"] .r3-stats + .r3-chart { break-before: avoid; }
.r3-notes { break-before: avoid; break-inside: avoid; }
.r3-rule, .r3-bd > .r3-alert:first-child { break-after: avoid; }

/* ══ PRINT ONLY — the flowing PDF (report_pdf_v3.html sets .r3-print) ═════ */
/* Named strings for the running header: the document line and the chapter
   being read at the top of each page. */
.r3doc.r3-print { string-set: r3doc attr(data-run); }
.r3doc.r3-print .r3-ch { string-set: r3chapter attr(data-run); }
/* The opening chapter keeps the first page to itself — when it is built to
   fill one (tiles, points AND charts: `data-solo`). An opening chapter
   without charts (a short investor brief) would leave a third of the page
   blank behind a forced break, so the next chapter follows it instead. */
.r3doc.r3-print .r3-ch[data-solo] { break-after: page; }
.r3doc.r3-print .r3-ch[data-solo] + .r3-ch { margin-top: 0; }
/* The disclaimer leaves the flow for the bottom margin box of every page. */
.r3doc.r3-print > .r3-foot { position: running(r3foot); font-size: 6.6pt; }
/* «→ с. » + the real page of the chapter it points at. */
.r3doc.r3-print a.r3-ref::after { content: "\00a0" target-counter(attr(href), page); }

/* BANDS AS TABLE ROWS. In print a band of columns is a one-row table, not
   a grid. A band is kept whole (`break-inside: avoid`): torn between its
   columns it prints a table at the foot of one page and its chart alone at
   the head of the next, each beside an empty half. But a band taller than
   what is left of a page must still be able to break as a last resort, and
   there WeasyPrint 68 mislays a fragmented GRID — an item it pushed to the
   next page is laid out over that page's top margin (seen 2026-09-30: a
   balance table printed across the running header) — while it fragments a
   TABLE ROW correctly, each cell continuing at the top of the next page in
   its own column. Cells of a row are also equally tall, which is what lets
   the PDF's second pass grow a chart to the foot of the table beside it
   (report_v3_pdf). The tracks are the grid's own (content box 275 mm): the
   spacing is the gap, and the negative side margins take back the spacing a
   table adds outside its first and last cell.
     g2   283 = 4 + 135.5 + 4 + 135.5 + 4
     g3   283 = 4 + 89 × 3 + 4 × 3
     g4   283 = 4 + 65.75 × 4 + 4 × 4
     g21  285 = 5 + 160 + 5 + 110 + 5
   A row never has fewer blocks than tracks: a row of charts is sized to
   its real count (report_v3_layout.ReportV3View.chart_rows — two in a g2,
   a lone one at full width), so no track is left blank. */
.r3doc.r3-print .r3-g2, .r3doc.r3-print .r3-g3, .r3doc.r3-print .r3-g4, .r3doc.r3-print .r3-g21 {
  display: table; table-layout: fixed; border-collapse: separate; break-inside: avoid;
}
.r3doc.r3-print .r3-g2, .r3doc.r3-print .r3-g3, .r3doc.r3-print .r3-g4 {
  width: 283mm; margin-left: -4mm; margin-right: -4mm; border-spacing: 4mm 0;
}
.r3doc.r3-print .r3-g21 { width: 285mm; margin-left: -5mm; margin-right: -5mm; border-spacing: 5mm 0; }
.r3doc.r3-print .r3-g2 > *, .r3doc.r3-print .r3-g3 > *,
.r3doc.r3-print .r3-g4 > *, .r3doc.r3-print .r3-g21 > * { display: table-cell; vertical-align: top; }
.r3doc.r3-print .r3-g21 > *:first-child { width: 160mm; }
/* A row of charts INSIDE a half cell (`r3-nest`): 143.5 = 4 + 65.75 + 4 +
   65.75 + 4 — two quarters, flush with the half's edges. */
.r3doc.r3-print .r3-g2.r3-nest { width: 143.5mm; margin-left: -4mm; margin-right: -4mm; }

/* ══ THE SCREEN MARKUP, ANY MEDIUM ════════════════════════════════════════
   The masthead is screen markup (report_pdf_v3.html carries the running
   header instead) — but the screen markup is also PRINTED: the sample's
   «Download PDF» is the browser's print of the page (static/js/fpa-desk.js),
   as is Ctrl+P on any preview. That print gets the PDF's page box (A4
   landscape and the SAME margins as report_pdf_v3.html's @page, so the
   PDF itself is unchanged), the masthead as a line, no contents (paper
   follows no link) and no in-app action. */
.r3-mast {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 2px 16px; margin: 0 0 12px; padding: 0 2px;
  font-size: 12.5px; line-height: 1.4; color: #6D7890;
}
.r3-mast p { margin: 0; }
.r3-mast .l b { color: #16314E; font-weight: 700; }
.r3-mast .r { white-space: nowrap; }
.r3-mast .r3-stale { flex-basis: 100%; margin-top: 2px; font-size: 12.5px; }
@media print {
  @page { size: A4 landscape; margin: 13mm 11mm 15mm; }
  .r3doc .r3-toc, .r3doc .r3-act { display: none; }
  .r3doc .r3-drill { text-decoration: none; }
  .r3-mast { font-size: 8pt; margin-bottom: 4mm; padding-bottom: 1.6mm; border-bottom: 1.5px solid #16314E; }
}

/* ══ SCREEN ONLY — the preview and the public link ═══════════════════════
   One continuous document: a sticky table of contents on the left, chapter
   cards in a single column that takes the width the page gives it. The
   reading column is scaled with `zoom` instead of restating every size.
   Below 1180 px of document width the contents become a strip that sticks
   to the top; below 760 px every grid is one column, tiles go two abreast
   and a wide table scrolls inside its own card — the page itself never
   scrolls sideways. */
@media screen {
  /* A page that hosts the document (the public link's reading column)
     widens to take the contents + a full-width chapter card. */
  .fd-rd-page.r3-host { max-width: 1400px; }

  .r3doc { display: block; container-type: inline-size; container-name: r3doc; }

  .r3-layout { display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: 18px; align-items: start; }
  .r3-main { min-width: 0; zoom: 1.15; }

  /* ── The table of contents ─────────────────────────────────────────── */
  .r3-toc {
    position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto;
    padding: 12px 8px; background: #FFFFFF; border: 1px solid #E3E7F0; border-radius: 14px;
    box-shadow: 0 1px 2px rgba(22, 49, 78, .05);
  }
  .r3-toc-t {
    margin: 0 8px 6px; font-size: 10px; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: #6D7890;
  }
  .r3doc .r3-toc ol { margin: 0; padding: 0; list-style: none; }
  .r3doc .r3-toc li { margin: 0; }
  .r3doc .r3-toc a {
    display: flex; gap: 8px; align-items: baseline; padding: 6px 8px; border-radius: 8px;
    font-size: 12.5px; line-height: 1.3; color: #46536E; text-decoration: none;
  }
  .r3-toc a .n { flex: none; width: 16px; font-size: 10.5px; color: #8E98AD; }
  .r3-toc a .t { min-width: 0; }
  .r3-toc a:hover { background: #F5F7FB; color: #17233D; }
  .r3-toc a:focus-visible { outline: 2px solid #0B5CAD; outline-offset: 1px; }
  .r3doc .r3-toc a[aria-current="true"] { background: #EAF3FB; color: #0B4A8C; font-weight: 650; }
  .r3-toc a[aria-current="true"] .n { color: #0B5CAD; }
  .r3-toc .fl {
    flex: none; align-self: center; width: 7px; height: 7px; margin-left: auto;
    border-radius: 50%; background: #AC711C;
  }
  .r3-toc-lg {
    display: flex; gap: 7px; align-items: center; margin: 8px 8px 0; padding-top: 9px;
    border-top: 1px solid #E3E7F0; font-size: 11px; line-height: 1.35; color: #6D7890;
  }
  .r3-toc-lg .fl { margin-left: 0; }

  /* ── Chapters are cards ────────────────────────────────────────────── */
  .r3doc .r3-ch {
    margin: 0 0 12px; padding: 5mm 5.5mm 5.5mm;
    background: #FFFFFF; border: 1px solid #E3E7F0; border-radius: 3.6mm;
    box-shadow: 0 1px 2px rgba(22, 49, 78, .05);
    /* A jump from the contents lands the card under the sticky strip. */
    scroll-margin-top: 10px;
  }
  .r3-ch + .r3-ch { margin-top: 0; }
  .r3-ch-head { padding-bottom: 3mm; margin-bottom: 3.5mm; border-bottom: 1px solid #E3E7F0; }
  .r3doc h2.r3-hl { max-width: none; font-size: 13.6pt; }
  .r3-lede { max-width: 230mm; }
  /* Boxes side by side share a height: no ragged row of cards. */
  .r3-g2, .r3-g3, .r3-g4 { align-items: stretch; }
  /* «Риски» (or the risk checks) stretched beside a longer «Главное» keeps
     «С чем сравниваем» at its foot, level with its neighbour's — not an
     empty band under it. `.r3-based` = a points box that ends with it. */
  .r3-g2 > .r3-box.r3-based { display: flex; flex-direction: column; }
  .r3-g2 > .r3-box.r3-based > .r3-pts { margin-bottom: 2.5mm; }
  .r3-g2 > .r3-box.r3-based > .r3-basebox { margin-top: auto; }
  /* A row of charts: every chart's title, drawing and note share the row's
     tracks (subgrid) — the drawings start on one line whatever this screen
     wraps. */
  .r3-charts > .r3-chart { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; }
  .r3-charts > .r3-chart > .r3-cv { grid-row: 2; }
  .r3-charts > .r3-chart > .r3-src { grid-row: 3; }
  /* A table FITS its column, as in print: a label wraps, a figure never
     does (`td.r` / `td.sp` stay on one line — «1,454.4» never drops under
     its share bar), and a header breaks between its words. A table with
     more figures than its column holds is not left to scroll: the layout
     stands it at full width (ReportV3View.band / table_fits), so on a
     desktop every figure is in view. The card's own scroll is the phone's
     last resort only. */
  .r3-t { width: 100%; }
  .r3-t td.r, .r3-t td.sp { white-space: nowrap; font-variant-numeric: tabular-nums; }
  /* A NARROW table is as wide as its labels need — at least 38 % of the
     card, at most 60 % — not a half column's stretch on a 1,920-px screen.
     Beside a partner (`r3-pair`: a chart, the ratios, «Главное») its column
     (`r3-fit`) takes that width and the partner the rest. */
  .r3doc .r3-bd > .r3-tblock.r3-cmp, .r3doc .r3-tblock.r3-narrow {
    width: fit-content; min-width: 38%; max-width: 60%;
  }
  .r3doc .r3-pair { display: flex; gap: 4mm; align-items: stretch; }
  .r3doc .r3-pair > * { flex: 1 1 0; min-width: 0; }
  .r3doc .r3-pair > .r3-fit { flex: 0 1 auto; min-width: 38%; max-width: 60%; }
  .r3-tw { overflow-x: auto; }
  .r3doc a.r3-ref:hover { text-decoration: underline; }
  .r3-t tbody tr:hover td { background-color: #F3F6FB; }
  .r3-foot { margin: 0 1mm; padding: 1mm 0 2mm; }

  /* ── Narrower than contents + a comfortable card: contents on top ──── */
  @container r3doc (max-width: 1179px) {
    .r3-layout { display: block; }
    .r3-main { zoom: 1.1; }
    .r3-toc {
      top: 0; z-index: 5; max-height: none; margin: 0 0 10px; padding: 6px;
      border-radius: 12px; overflow-x: auto; overflow-y: hidden;
      box-shadow: 0 4px 14px rgba(22, 49, 78, .10);
    }
    .r3-toc-t, .r3-toc-lg { display: none; }
    .r3doc .r3-toc ol { display: flex; gap: 4px; }
    .r3doc .r3-toc li { flex: none; }
    .r3doc .r3-toc a { padding: 5px 9px; white-space: nowrap; }
    .r3-toc a .n { width: auto; }
    .r3-toc .fl { margin-left: 0; }
    .r3doc .r3-ch { scroll-margin-top: 52px; }
  }

  /* ── Tablet: the wide + narrow band stacks, four abreast become two ── */
  @container r3doc (max-width: 980px) {
    .r3-g21, .r3-g3 { grid-template-columns: minmax(0, 1fr); }
    /* …and a narrow table of a stacked wide column stays narrow */
    .r3doc .r3-g21 > .r3-col > .r3-tblock.r3-cmp { width: fit-content; min-width: 38%; max-width: 60%; }
    .r3-g4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .r3-tiles.n4, .r3-tiles.n5, .r3-tiles.n6 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
  }

  /* ── Phone: one column, native reading size ────────────────────────── */
  @container r3doc (max-width: 759px) {
    .r3-main { zoom: 1.12; }
    .r3doc .r3-ch { padding: 4mm 3.4mm 4.4mm; border-radius: 3mm; }
    .r3doc h2.r3-hl { font-size: 12.6pt; }
    .r3-g2, .r3-g21, .r3-g3, .r3-g4 { grid-template-columns: minmax(0, 1fr); gap: 3mm; }
    /* Small charts stay two abreast; TABLES four abreast become a column. */
    .r3-g4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .r3-g4.r3-tables, .r3-g3.r3-tables, .r3-g2.r3-tables { grid-template-columns: minmax(0, 1fr); }
    .r3-tiles.n2, .r3-tiles.n3, .r3-tiles.n4, .r3-tiles.n5, .r3-tiles.n6 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .r3-tile .tv { font-size: 14pt; white-space: normal; }
    .r3-stats.c3, .r3-stats.c4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .r3-box { padding: 2.6mm 2.8mm; }
    .r3doc .r3-bd > .r3-tblock.r3-cmp, .r3doc .r3-tblock.r3-narrow,
    .r3doc .r3-g21 > .r3-col > .r3-tblock.r3-cmp {
      width: auto; min-width: 0; max-width: none;
    }
    .r3doc .r3-pair { display: block; }
    .r3doc .r3-pair > * + * { margin-top: 3mm; }
    .r3doc .r3-pair > .r3-fit { min-width: 0; max-width: none; }
    /* A wide table keeps its columns and swipes inside its own card. */
    .r3-t { width: auto; min-width: 100%; }
    .r3-t td.lb, .r3-t th:first-child { min-width: 34mm; }
    .r3-t.r3-ex, .r3-t.r3-ex tbody, .r3-t.r3-ex tr, .r3-t.r3-ex td { display: block; width: auto; min-width: 0; }
    .r3-t.r3-ex td { border-bottom: none; padding: .6mm 0; }
    .r3-t.r3-ex td.k, .r3-t.r3-ex td.so { width: auto; }
    .r3-t.r3-ex tr { border-bottom: 1px solid #E3E7F0; padding: 1.5mm 0; }
    /* A chart is never squeezed below a legible size: a wide one swipes
       inside its own box, like the wide tables. */
    .r3-cv { overflow-x: auto; }
    .r3-cv svg { width: max(100%, calc(var(--r3-w, 0px) * .74)); }
    /* The small multiples carry a shape and one figure: they simply scale. */
    .r3-g4 .r3-cv svg { width: 100%; }
    .r3-mast { font-size: 12px; }
  }
}
