/*
 * One print stylesheet for every view: result tables, lineups, the swimmer modal and anything added later
 * (entry sheet, scouting report). It prints the active view in black on white without app chrome.
 * Use `.no-print` on anything that should not print and `.print-only` on print-only content.
 */
@media print {
  @page { margin: 14mm; }

  :root { color-scheme: light; }
  html, body { background: #fff !important; color: #000 !important; min-height: 0; display: block; }
  * { color: #000 !important; background: transparent !important; box-shadow: none !important; text-shadow: none !important; animation: none !important; }
  *, *::before, *::after { border-color: #666 !important; }

  /* App chrome */
  .sidebar, .topbar, .drawer-scrim, .skip-link, .toast-region, .visually-hidden, .no-print { display: none !important; }
  .app-layout { display: block; min-height: 0; }
  .main-content { padding: 0; overflow: visible; }
  .view { max-width: none; }
  .view:not(.active) { display: none !important; }

  /* Controls make no sense on paper */
  button, select, input, textarea, form,
  .lineup-actions, .alert-filters, .lineup-selectors, .matchup-tabs, .roster-filters, .supp-upload-area,
  .out-btn, .supp-delete-btn, .supp-verify-btn, .schedule-insight-actions, .state-retry, .modal-close, .modal-back, .modal-scrim,
  .triage-actions { display: none !important; }
  .sort-button::after { content: none; }
  .swimmer-select-btn, .alert-name-btn, .sort-button { display: inline !important; }
  .result-card, .alert-card { border: 1px solid #666 !important; }

  /* Tables print in full, not inside a scroll box, with the header repeated on each page */
  .table-scroll { overflow: visible !important; max-height: none !important; }
  table { width: 100%; border-collapse: collapse; font-size: 10pt; }
  thead { display: table-header-group; }
  th, td { position: static !important; border-bottom: 1px solid #999 !important; }
  tr, .meet-group-card, .lineup-stroke-block, .relay-block, .alert-card, .chart, .data-section { break-inside: avoid; }
  h1, h2, h3, .section-heading, .lineup-stroke-label { break-after: avoid; }
  .chart-svg { max-width: 420px; }
  .chart-line, .chart-axis, .chart-dot { stroke: #000 !important; fill: none !important; }
  .chart-label { fill: #000 !important; }

  /* The swimmer modal prints alone when it is open */
  body:has(#backdrop:not(.hidden)) .app-layout { display: none !important; }
  .modal-backdrop { position: static; padding: 0; overflow: visible; display: block; }
  .modal-backdrop.hidden { display: none !important; }
  .modal { max-width: none; border-radius: 0; animation: none; }
  .modal-header { position: static; border-bottom: 1px solid #666; }

  .print-only { display: block !important; }
}

.print-only { display: none; }
