@media print {
  .site-header, .messages, button { display: none !important; }

  /* Characters: print view */
  .no-print, .wm-site-footer { display: none !important; }
  .wm-item-card { break-inside: avoid; page-break-inside: avoid; box-shadow: none; }
  @page cards { size: portrait; margin: 0; }
  .wm-card-print { padding: 0 !important; max-width: none; }
  body:has(.wm-card-print) { margin: 0; padding: 0; }
  .wm-card-page, .wm-card-sheet { page: cards; margin: 0 auto; padding: 0.2in 0.35in; box-sizing: content-box; }
  .wm-card-page { break-after: page; }
  .wm-card-page:last-child { break-after: auto; }
  .wm-card-sheet { break-after: page; }
  .wm-card-sheet:last-child { break-after: auto; }

  /* Character slips */
  @page slips { size: portrait; margin: 0; }
  .wm-slip-print { padding: 0 !important; max-width: none; }
  body:has(.wm-slip-print) { margin: 0; padding: 0; }
  .wm-slip-sheet { page: slips; margin: 0 auto; padding: 0.25in 0.125in; box-sizing: content-box; break-after: page; }
  .wm-slip-sheet:last-child { break-after: auto; }
  .wm-slip { break-inside: avoid; }
  .wm-slip, .wm-slip * { color: black; border-color: black; }
}

/* Phone preview: scale the A4 sheets down so the screen view has no sideways scroll. Print output is unchanged. */
@media screen and (max-width: 51rem) { .wm-card-sheet, .wm-card-page, .wm-slip-sheet { zoom: 0.8; } }
@media screen and (max-width: 40rem) { .wm-card-sheet, .wm-card-page, .wm-slip-sheet { zoom: 0.6; } }
@media screen and (max-width: 30rem) { .wm-card-sheet, .wm-card-page, .wm-slip-sheet { zoom: 0.46; } }
@media screen and (max-width: 22.5rem) { .wm-card-sheet, .wm-card-page, .wm-slip-sheet { zoom: 0.4; } }

.wm-print-btn { display: inline-flex; align-items: center; gap: var(--wm-space-1); }
.wm-print-hint { font-size: var(--wm-text-sm); }

/* U87: nothing interactive prints, on any printed page. Plain links still print as text. */
@media print {
  .tooltip, [role="tooltip"], .popover, button, .btn, input, select, textarea,
  .form-check, .form-switch, .dropdown-menu, .dropdown-toggle, .modal, .modal-backdrop,
  .offcanvas, .offcanvas-backdrop, .toast, .wm-toolbar, .wm-row-actions, .wm-skip-link,
  [data-bs-toggle], [role="toolbar"], [role="switch"] { display: none !important; }
}
