/* Detailed report — a formatted webpage engineered to print cleanly to A4 */

.view-report { background: var(--surface); min-height: 100%; }

.report-bar { position: sticky; top: 0; z-index: 30; background: var(--paper); border-bottom: 1px solid var(--line); }
.report-bar-in { max-width: 900px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.report-bar-label { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.report-doc {
  max-width: 900px; margin: 32px auto 80px; padding: 64px 72px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r);
  font-size: 15px; line-height: 1.62; color: var(--ink-2);
}

/* Cover */
.rep-cover { border-bottom: 2px solid var(--brand); padding-bottom: 32px; margin-bottom: 8px; }
.rep-brand { display: flex; align-items: baseline; gap: 12px; margin-bottom: 40px; }
.rep-logo { display: block; width: 104px; height: auto; }
.rep-brand span.doc { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-4); }
.rep-cover .kicker { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--brand-mid); }
.rep-cover h1 { margin-top: 14px; font-size: 34px; letter-spacing: -0.03em; line-height: 1.15; color: var(--ink); max-width: 24ch; }
.rep-quote { margin-top: 26px; padding: 18px 22px; background: var(--surface); border-left: 3px solid var(--brand); font-size: 16px; color: var(--ink); }
.rep-cover-fig { margin: 26px 0 0; }
.rep-cover-fig img {
  display: block; width: 100%; height: 220px; object-fit: cover;
  border-radius: var(--r-sm); background: var(--surface-2);
}
.rep-cover-fig figcaption { margin-top: 8px; font-size: 11.5px; color: var(--ink-4); }

.rep-figs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 12px 0 18px; }
.rep-figs figure { margin: 0; break-inside: avoid; }
.rep-figs img {
  display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2);
}
.rep-figs figcaption { margin-top: 7px; font-size: 12px; line-height: 1.45; color: var(--ink-3); }

.rep-facts { margin-top: 28px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 24px; }
.rep-facts dt { font-size: 10px; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-4); font-weight: 600; }
.rep-facts dd { margin: 4px 0 0; font-size: 14px; color: var(--ink); line-height: 1.4; }

/* Table of contents */
.rep-toc { margin: 36px 0 0; padding: 22px 24px; background: var(--surface); border-radius: var(--r); }
.rep-toc h2 { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-4); margin-bottom: 12px; }
.rep-toc ol { list-style: none; counter-reset: t; columns: 2; column-gap: 32px; }
.rep-toc li { counter-increment: t; font-size: 14px; padding: 3px 0; break-inside: avoid; }
.rep-toc li::before { content: counter(t) ". "; color: var(--ink-4); }

/* Sections */
.rep-sec { margin-top: 44px; }
.rep-sec > h2 {
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--brand);
  padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 20px;
}
.rep-sec h3 { font-size: 19px; letter-spacing: -0.015em; color: var(--ink); margin-bottom: 10px; }
.rep-sec h4 { font-size: 15px; color: var(--ink); margin: 22px 0 8px; }
.rep-sec p { margin-bottom: 12px; max-width: 68ch; }
.rep-sec p:last-child { margin-bottom: 0; }
.rep-lead { font-size: 16px; color: var(--ink); }

.rep-list { list-style: none; display: grid; gap: 9px; margin: 6px 0 14px; }
.rep-list li { display: flex; gap: 11px; }
.rep-list li::before { content: ""; flex: 0 0 auto; width: 6px; height: 6px; margin-top: 9px; background: var(--brand-mid); border-radius: 1px; }
.rep-list.num { counter-reset: rn; }
.rep-list.num li { counter-increment: rn; }
.rep-list.num li::before { content: counter(rn); width: 20px; height: auto; margin-top: 0; background: none; color: var(--brand); font-weight: 600; font-size: 13px; }

table.rep {
  width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 14px 0 18px; line-height: 1.5;
}
table.rep th {
  text-align: left; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-4);
  font-weight: 600; padding: 0 14px 8px 0; border-bottom: 1px solid var(--ink-4);
}
table.rep td { padding: 11px 14px 11px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.rep td:last-child, table.rep th:last-child { padding-right: 0; }
table.rep .k { color: var(--ink); font-weight: 600; }
table.rep .fix { color: var(--ok); }

.rep-callout {
  padding: 18px 22px; background: var(--brand-tint); border-radius: var(--r); margin: 18px 0;
  font-size: 14.5px; color: var(--ink);
}
.rep-callout strong { color: var(--brand-dark); }
.rep-warn { padding: 16px 20px; background: var(--signal-tint); border-left: 3px solid var(--signal); font-size: 13.5px; margin: 18px 0; }

.rep-prod { padding: 18px 0; border-bottom: 1px solid var(--line-soft); }
.rep-prod.has-img { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 20px; align-items: start; }
.rep-prod-img { background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--r-sm); }
.rep-prod-img img { display: block; width: 100%; height: 92px; object-fit: contain; }
.rep-prod:last-child { border-bottom: none; }
.rep-prod .head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.rep-prod .head h4 { margin: 0; font-size: 17px; }
.rep-prod .role { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-4); font-weight: 600; }
.rep-prod .why { color: var(--brand-dark); }

.rep-sources { font-size: 13px; }
.rep-sources li { padding: 5px 0; word-break: break-word; }
.rep-sources a { border-bottom: none; color: var(--brand); }

.rep-foot { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-4); }

.rep-chain { display: flex; gap: 4px; margin: 16px 0 20px; }
.rep-chain > div { flex: 1; padding: 12px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); text-align: center; }
.rep-chain > div.on { background: var(--brand-tint); border-color: var(--brand-mid); }
.rep-chain .n { font-size: 10px; color: var(--ink-4); }
.rep-chain .l { margin-top: 3px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.rep-chain > div.on .l { color: var(--brand-dark); }

@media screen and (max-width: 820px) {
  .report-doc { padding: 32px 22px; margin: 0; border: none; border-radius: 0; }
  .rep-facts, .rep-toc ol, .rep-figs { grid-template-columns: 1fr; columns: 1; }
  .rep-prod.has-img { grid-template-columns: 1fr; }
  .rep-chain { flex-wrap: wrap; }
  .rep-chain > div { flex: 1 1 30%; }
}

/* ───────────────────────── PRINT ───────────────────────── */
@page { size: A4; margin: 16mm 15mm 18mm; }

@media print {
  html, body { background: #fff; height: auto; }
  body { font-size: 10.5pt; }
  .no-print, .topbar, .view-intake, .view-deck, .sitefoot { display: none !important; }

  .view-report { background: #fff; }
  .report-doc {
    max-width: none; margin: 0; padding: 0; border: none; border-radius: 0;
    font-size: 10.5pt; line-height: 1.5; color: #1a2026;
  }

  a { color: #00567f; border: none; }

  .rep-cover { page-break-after: always; break-after: page; padding-bottom: 20pt; }
  .rep-cover h1 { font-size: 24pt; }

  .rep-sec { margin-top: 22pt; page-break-inside: auto; }
  .rep-sec > h2 { page-break-after: avoid; break-after: avoid; }
  h3, h4 { page-break-after: avoid; break-after: avoid; }
  p, li { orphans: 3; widows: 3; }
  table.rep { page-break-inside: auto; }
  table.rep tr { page-break-inside: avoid; break-inside: avoid; }
  table.rep thead { display: table-header-group; }
  .rep-prod, .rep-callout, .rep-warn { page-break-inside: avoid; break-inside: avoid; }
  .rep-figs figure, .rep-cover-fig { page-break-inside: avoid; break-inside: avoid; }
  .rep-cover-fig img { height: 52mm; }
  .rep-figs { grid-template-columns: repeat(2, 1fr); gap: 5mm; }
  .rep-figs img { aspect-ratio: auto; height: 42mm; }
  .rep-figs figcaption { font-size: 8.5pt; }
  .rep-prod.has-img { display: grid; grid-template-columns: 32mm minmax(0, 1fr); gap: 6mm; }
  .rep-prod-img img { height: 20mm; }
  img { max-width: 100%; }
  .rep-chain { break-inside: avoid; flex-wrap: nowrap; }
  .rep-chain > div { padding: 8pt 4pt; }
  .rep-chain .l { font-size: 8.5pt; }

  .rep-break { page-break-before: always; break-before: page; }
}
