/* print.css — the record on paper (Phase 0 D, 2026-10-27).
   Loaded by vault.html and medicines.html. Two jobs: (1) the printable record overlay (.rc-print) that
   "Download as PDF" opens, rendered by the browser's own print-to-PDF; (2) when the page prints, only
   the overlay (or the open paper) goes to the printer: the nav, the buttons and the lists stay on screen.
   One column, black on white, no shadows, a page break before each top heading when a section is long. */

.rc-print { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif; color: #111; background: #fff; line-height: 1.45; }
.rc-print h1 { font-size: 22pt; margin: 0 0 4pt; letter-spacing: -0.01em; }
.rc-print h2 { font-size: 13pt; margin: 16pt 0 6pt; padding-bottom: 3pt; border-bottom: 1px solid #999; page-break-after: avoid; break-after: avoid; }
.rc-print h3 { font-size: 11.5pt; margin: 10pt 0 4pt; page-break-after: avoid; break-after: avoid; }
.rc-print p, .rc-print li { font-size: 10.5pt; margin: 0 0 3pt; orphans: 3; widows: 3; }
.rc-print ul { margin: 0 0 6pt 16pt; padding: 0; }
.rc-print li { page-break-inside: avoid; break-inside: avoid; }
.rc-print em { color: #444; }
.rc-print table { border-collapse: collapse; width: 100%; font-size: 10pt; margin: 4pt 0 8pt; }
.rc-print th, .rc-print td { border-bottom: 1px solid #ccc; padding: 3pt 6pt; text-align: left; vertical-align: top; }
.rc-print .rc-print-note { font-size: 9.5pt; color: #444; margin: 0 0 10pt; }
.rc-print .rc-print-foot { font-size: 8.5pt; color: #666; margin-top: 18pt; border-top: 1px solid #ccc; padding-top: 6pt; }
.rc-print img.rc-paper { max-width: 100%; max-height: 90vh; display: block; margin: 0 auto; }
.rc-print .rc-qr { display: flex; gap: 18pt; align-items: center; margin: 12pt 0; page-break-inside: avoid; break-inside: avoid; }
.rc-print .rc-qr svg { width: 160px; height: 160px; }
.rc-print .rc-qr .code { font-size: 26pt; font-weight: 700; letter-spacing: 0.18em; font-variant-numeric: tabular-nums; }

/* On screen the overlay is a sheet over the page, scrollable, with its own toolbar. */
.rc-print-overlay { position: fixed; inset: 0; z-index: 2000; background: #f0f0f2; overflow: auto; -webkit-overflow-scrolling: touch; }
.rc-print-overlay .rc-toolbar { position: sticky; top: 0; z-index: 1; display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 10px 16px; background: rgba(255,255,255,0.92); border-bottom: 1px solid rgba(0,0,0,0.08); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.rc-print-overlay .rc-toolbar button { min-height: 44px; min-width: 44px; padding: 0 16px; border-radius: 980px; border: 1px solid rgba(0,0,0,0.12); background: #fff; font: inherit; font-size: 15px; font-weight: 600; color: #1d1d1f; cursor: pointer; }
.rc-print-overlay .rc-toolbar button.primary { background: #004225; border-color: #004225; color: #fff; }
.rc-print-overlay .rc-sheet { max-width: 760px; margin: 16px auto 40px; background: #fff; padding: 28px 32px; box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
@media (max-width: 480px) { .rc-print-overlay .rc-sheet { margin: 8px; padding: 18px 16px; } }

@media print {
  @page { margin: 16mm 14mm; }
  html, body { background: #fff !important; color: #000 !important; height: auto !important; overflow: visible !important; }
  body.rc-printing > :not(.rc-print-overlay) { display: none !important; }
  .rc-print-overlay { position: static !important; inset: auto !important; overflow: visible !important; background: #fff !important; }
  .rc-print-overlay .rc-toolbar { display: none !important; }
  .rc-print-overlay .rc-sheet { max-width: none !important; margin: 0 !important; padding: 0 !important; box-shadow: none !important; }
  .rc-print a { color: #000; text-decoration: none; }
  .rc-print h2 { page-break-before: auto; }
  .rc-print .rc-page-break { page-break-before: always; break-before: page; }
  nav.top-nav, .no-print { display: none !important; }
}
