/* Print: A4, light palette, shell hidden. Loaded with media="print" by ui/head and plainly by ui/layout-print. */
@page { size: A4; margin: 14mm 12mm; }

/* Screen preview of the print layout */
.print-page { background: var(--surface); color: var(--ink); max-width: 210mm; margin: 0 auto; padding: var(--space-4); font-size: 11pt; }
.print-head { display: flex; align-items: center; gap: var(--space-3); border-bottom: 1px solid var(--border-strong); padding-bottom: var(--space-3); margin-bottom: var(--space-3); }
.print-logo { width: 4rem; height: 4rem; object-fit: contain; }
.print-title { font-size: 16pt; margin: 0 0 var(--space-3); }
.print-foot { margin-top: var(--space-5); border-top: 1px solid var(--border); padding-top: var(--space-2); }

@media print {
  :root, :root[data-theme="dark"] {
    color-scheme: light;
    --bg: var(--print-paper); --surface: var(--print-paper); --surface-2: var(--print-paper);
    --ink: var(--print-ink); --body: var(--print-ink); --ink-muted: var(--print-ink-muted);
    --border: var(--print-border); --border-strong: var(--print-border-strong); --accent: var(--print-ink);
    --tc-bg: var(--print-tc-bg); --tc-outline: var(--print-tc-outline); --tc-caries: var(--print-tc-caries);
    --tc-composite: var(--print-tc-composite); --tc-amalgam: var(--print-tc-amalgam);
  }
  html, body { background: var(--print-paper) !important; color: var(--print-ink); }
  .sidebar, .topbar, .scrim, .banner, #toasts, .toasts, dialog, .skip-link,
  .page-actions, .filterbar, .search, .pager, .tabs, .btn, .icon-btn, .htmx-indicator,
  .sprite, [data-noprint] { display: none !important; }
  .shell-main { margin: 0 !important; }
  #main { max-width: none; padding: 0; margin: 0; }
  a[href]::after { content: none !important; }
  a { color: inherit; text-decoration: none; }

  .card { border: 0; box-shadow: none; break-inside: avoid; }
  .table { font-size: 11pt; width: 100%; }
  .table thead { display: table-header-group; position: static; clip: auto; width: auto; height: auto; }
  .table thead th { position: static; background: var(--print-paper); border-bottom: 1px solid var(--print-ink); }
  .table tr { break-inside: avoid; }
  .table tbody tr:hover { background: none; }
  .table .right, .num { text-align: right; font-variant-numeric: tabular-nums; }
  .table-scroll { overflow: visible; }

  .print-page { max-width: none; padding: 0; }
  /* Tooth chart and colour keys print with their fills */
  .dentalchart, .tooth-chart, .legend { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* R6 (SRR-05): the print shell's body and clinic block. */
.print-body { display: block; }
.print-clinic { line-height: 1.4; }
