/* Shared PDF edition. Screen layout is unchanged. */
@media print {
  @page { size: A4; margin: 14mm 13mm 16mm; }
  body { font-size: 10pt; line-height: 1.45; }
  .wrap { max-width: none; padding-inline: 0; }
  section, section[id] { break-before: auto !important; padding-block: 0 5mm; }
  section.cover { padding-top: 5mm; padding-bottom: 6mm; }
  h1 { max-width: 27ch; }
  h2 { font-size: 21pt; max-width: 34ch; }
  h3 { font-size: 14pt; }
  p, li { orphans: 3; widows: 3; }
  h2, h3, .label { break-after: avoid; }
  .stack > * + * { margin-top: 3mm; }
  figure { padding: 3mm; gap: 2mm; break-inside: avoid; }
  .grid2 { gap: 3mm; }
  .ct { font-size: 12pt; }
  .cs, figcaption { font-size: 9pt; }
  .kpi { padding: 3mm; }
  .kpi .k, .kpi .d { font-size: 9pt; }
  .findings { display: block; }
  .findings li { padding-block: 2.2mm; }
  .scroll { overflow: visible; }
  table { font-size: 8.5pt; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; }
  footer { break-inside: avoid; padding-block: 3mm 0; font-size: 8pt; }
  footer .wrap { display: block; }
  footer .wrap > * + * { margin-top: 1.5mm; }
}
@media print {
  body > div:first-child:has(a[href="/sample.html"]) { display: none !important; }
  #summary { break-before: page !important; }
  .chart svg { max-height: 70mm; }
  figure:has(table) { display: block; break-inside: auto; }
  figure:has(table) > * + * { margin-top: 2mm; }
  .callout { break-inside: avoid; }
  .signoff { break-after: avoid; }
  #method { padding-bottom: 0; }
  #method .grid2 figure { padding: 2.5mm; }
  #method table { font-size: 8pt; }
  #method td, #method th { padding-block: 1mm; }
  #method .limits { font-size: 8.5pt; }
}
@media print {
  .ct, .cs { break-after: avoid; }
  .flow, .grid2 > figure { break-inside: avoid; }
  .callout { display: block !important; border: 0; padding: 2mm 3mm; background: #f5f3ee; }
}
@media print {
  .verdict { break-inside: avoid; }
}

@media print {
  #second .grid2 { display: block !important; }
  #second .grid2 > figure + figure { margin-top: 3mm; }
}

@media print {
  #method .grid2 { display: block !important; }
  #method .grid2 > figure + figure { margin-top: 3mm; }
  #risk figure:has(table) { break-inside: avoid; }
}
