/* Print / "Save as PDF" stylesheet. Loaded with media="print".
   The visible report sections are controlled by body[data-print-mode]:
     (none)/exec  -> executive summary only
     technical    -> exec summary + top-finding cards + full findings table
     poam         -> exec summary + POA&M worksheet
   Each variant yields a clean, paginated, selectable-text PDF. */

@page { margin: 1in; }

@media print {
  body { background: #fff !important; color: #000; }
  /* Preserve intentional colors (score chips, severity, KEV, bar segments). */
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  /* Always hide app chrome + interactive controls. */
  .no-print,
  .app-header,
  .app-footer,
  .freshness,
  .tool__intro,
  .panel-grid,
  .tool__run,
  #errorMsg,
  .results__toolbar { display: none !important; }

  .app-main { max-width: none; margin: 0; padding: 0; }
  #results { display: block !important; }

  /* Executive summary block — always part of every PDF (acts as the cover). */
  .exec { border: none !important; box-shadow: none !important; padding: 0 !important; }
  .exec__brand { border-color: #ccc; }
  .exec__stat { border: 1px solid #ccc; background: #fff; }
  .exec__stats { display: grid !important; }
  .exec__profile, .exec__prov { background: #fff; border-color: #ccc; }
  .exec__top li { page-break-inside: avoid; }

  a[href]::after { content: ""; }

  /* Which detail blocks appear is controlled by printReport() in exporters.js,
     which sets inline display:none on the blocks to hide (deterministic, immune
     to cached-CSS / specificity issues). This stylesheet only styles whatever
     remains visible. A direct Ctrl+P (no mode set) shows everything — use the
     in-app PDF buttons for the curated Executive / Technical / POA&M variants. */
  .top-cards { display: block !important; } /* stack cards for pagination */
  .vuln-card { page-break-inside: avoid; border: 1px solid #ccc !important; box-shadow: none !important; margin-bottom: 12px; }

  /* Table behavior in print. */
  .table-wrap { overflow: visible !important; border: none !important; box-shadow: none !important; }
  .data-table { font-size: 11px; }
  .data-table thead { display: table-header-group; } /* repeat header on each page */
  .data-table th { background: #f0f0f0 !important; }
  .data-table tr { page-break-inside: avoid; }
  .section-label { page-break-after: avoid; }
}
