/* =========================================================================
   Print / Save-as-PDF. Only the evidence pack itself reaches paper.
   ========================================================================= */

@page {
  size: A4;
  margin: 18mm 16mm 20mm;
}

html, body { background: #fff !important; }

/* Hide every piece of application chrome. */
.topbar,
.pack-toolbar,
.sample-banner,
.toast,
#landing,
.q-side,
.q-nav,
.field-tools,
.export,
.review,
.setup { display: none !important; }

.app-wrap, .pack-scroll { padding: 0 !important; background: #fff !important; }

.doc-sheet {
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-size: 10.5pt !important;
  line-height: 1.5 !important;
  color: #000 !important;
}

/* Cover fills the first page; contents and each section start fresh. */
.doc-cover { page-break-after: always; }
.doc-toc { page-break-before: always; page-break-after: always; margin-top: 0 !important; border-top: 0 !important; padding-top: 0 !important; }
.doc-section { page-break-before: always; margin-top: 0 !important; }
.doc-section > h2 { page-break-after: avoid; font-size: 15pt !important; }
.doc-section h3 { page-break-after: avoid; font-size: 10.5pt !important; }
.doc-cover h1 { font-size: 26pt !important; }

/* Never split an atomic block across a page. */
.kv, .notice-card, .doc-disclaimer, .doc-end { page-break-inside: avoid; }
table.doc-table { page-break-inside: auto; }
table.doc-table thead { display: table-header-group; }
table.doc-table tr { page-break-inside: avoid; page-break-after: auto; }
p, li { orphans: 3; widows: 3; }

/* Keep status colour meaningful in greyscale by preserving fills. */
.st, .gap-inline, table.doc-table th, table.doc-table tbody tr:nth-child(even),
.kv div:nth-child(even), .notice-card, .doc-disclaimer {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.doc-end { margin-top: 24pt !important; }
a { color: #000 !important; text-decoration: none !important; }

/* Table containers scroll on screen; on paper they must lay out in full. */
.table-wrap { overflow: visible !important; max-width: none !important; }
table.doc-table { min-width: 0 !important; font-size: 8.4pt !important; }
table.doc-table th, table.doc-table td { padding: .34rem .5rem !important; }

/* The print page box is narrow enough to trigger the small-screen rules in
   styles.css. Restore the two-column document layouts for paper. */
.cover-meta { grid-template-columns: 1fr !important; }
.cover-meta div { flex-direction: row !important; gap: 1rem !important; padding: .5rem 0 !important; }
.cover-meta dt { min-width: 11rem !important; }
.kv div { grid-template-columns: 165px 1fr !important; }
.kv dt { border-right: 1px solid #eef1f6 !important; padding: .4rem .7rem !important; }
.kv dd { padding: .4rem .7rem !important; }
.doc-section h3 { margin: 1.1rem 0 .35rem !important; }
.notice-card { padding: 12px 16px !important; }

/* The customer summary is a one-pager: it must not break after its cover. */
.doc-summary .doc-cover { page-break-after: auto; border-bottom-width: 1px; padding-bottom: 18px; }
.doc-summary .doc-section { page-break-before: auto; }
.doc-summary .doc-section > h2 { font-size: 12.5pt !important; margin-top: 14pt; }
.doc-summary { font-size: 9.6pt !important; }
.doc-summary .cover-eyebrow { margin-bottom: .9rem !important; }
.doc-summary .summary-cover h1 { font-size: 20pt !important; }
.doc-summary .cover-sub { margin-bottom: 0 !important; font-size: 10pt !important; }
/* Let the table flow across a page break if it must, but never split a row. */
.doc-summary .kv { page-break-inside: auto !important; }
.doc-summary .kv div { page-break-inside: avoid; }
.doc-summary .kv dt, .doc-summary .kv dd { padding: .3rem .6rem !important; }
.doc-summary .doc-disclaimer { padding: 11px 15px !important; font-size: 7.8pt !important; margin-top: 14pt !important; }
.doc-summary .doc-end { margin-top: 12pt !important; padding-top: 10pt !important; font-size: 7.5pt !important; }
.doc-summary .doc-section { margin-top: 16pt !important; }
.doc-summary .kv dt, .doc-summary .kv dd { padding: .26rem .55rem !important; line-height: 1.42 !important; }
.doc-summary .doc-section > h2 { font-size: 11.5pt !important; margin-top: 11pt !important; }
.doc-summary { font-size: 9.2pt !important; }
.doc-summary .doc-section p { margin-bottom: .45rem !important; }
.doc-summary .summary-cover { padding-bottom: 14px !important; }
.doc-summary .doc-disclaimer { margin-top: 11pt !important; }

/* On a one-page summary the running footer only repeats the header, and it is
   the single element that pushes the page count to two. The disclaimer above
   already carries the "not legal advice" line. */
.doc-summary .doc-end { display: none !important; }
