/* ============================================================================
   Verity · print.css — a real deliverable, not an afterthought.
   CQC evidence packs and incident reports get printed, often on an old mono
   laser. Severity must survive greyscale; the overdue hatch must survive too.
   ========================================================================== */
@media print {
  @page { size: A4 portrait; margin: 16mm 14mm 18mm; }

  :root {
    /* Force the light theme on paper regardless of the screen theme —
       dark fills are not monotonic in luminance and would print as mud. */
    --canvas: #fff; --surface: #fff; --surface-2: #fff; --surface-3: #f4f4f4;
    --ink: #000; --ink-2: #222; --ink-3: #444;
    --line: #c9c9c9; --line-strong: #999; --line-control: #666;
    --st-overdue-hatch: #b0b0b0; --st-overdue-fill: #fff;
    --e-1: none; --e-2: none; --e-3: none;
  }

  html, body { background: #fff !important; color: #000 !important; }
  body { font-size: 10.5pt; }

  /* Chrome and controls never print. */
  .topbar, .sidebar, .drawer, .scrim, .toast-wrap, .tip, .menu,
  .modal-backdrop, .palette-backdrop, .page-actions, .no-print,
  .skip-link, .seg, .tabs, .btn, .funnel, .backbar { display: none !important; }

  .shell, .main { display: block !important; }
  .page-head { position: static !important; border-bottom: 1.5pt solid #000; padding: 0 0 6pt; }
  .page-body { padding: 0 !important; }
  .card {
    border: 0.75pt solid #999 !important; box-shadow: none !important;
    break-inside: avoid; page-break-inside: avoid; margin-bottom: 8pt;
  }

  /* Print header — who generated this, from where, and when. Without it an
     evidence pack is an anonymous piece of paper. */
  .print-head { display: block !important; margin-bottom: 10pt; padding-bottom: 6pt;
    border-bottom: 0.75pt solid #999; font-size: 9pt; }
  .print-only { display: block !important; }

  /* Tables repeat their header on every page. */
  thead { display: table-header-group; }
  tr, .tl-item, .finding, .ho-card, .ev-card { break-inside: avoid; page-break-inside: avoid; }
  .table th { background: #eee !important; color: #000 !important; }
  .table td { height: auto; padding: 4pt 6pt; }

  /* Status must remain distinguishable without colour. */
  .chip { border: 0.75pt solid #000 !important; color: #000 !important;
    background: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .chip-critical { background: #000 !important; color: #fff !important; }
  .chip-overdue { background: var(--hatch-overdue) !important;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  /* Charts keep their marks. */
  .chart, svg { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  /* A printed page has no hover, so every AI claim carries its source
     reference inline instead of behind an interaction. */
  .cite { border: 0.5pt solid #000 !important; background: #fff !important; color: #000 !important; }
  .cite::after { content: ''; }
  .ev-card { border: 0.5pt solid #999 !important; }
  .prov { border-top: 0.75pt solid #999; font-size: 8.5pt; }

  a { color: #000 !important; text-decoration: none; }
  a[href^="http"]::after { content: ' (' attr(href) ')'; font-size: 8pt; color: #444; }

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

/* Hidden on screen, shown on paper. */
.print-head, .print-only { display: none; }
