/* The printable technician week or day (js/views/printSheet.js). Never shown on screen; in print it's all the technician
   week prints (no app bar, menus, buttons, decision bar or day panel), in light colours whatever the theme. Other pages
   print without the app bar and menus. */
.print-sheet { display: none; }

@media print {
  /* Light colours, whatever Display › Theme or Windows says (the same values as tokens.css's light theme). */
  :root, :root[data-theme], :root:not([data-theme="light"]) {
    color-scheme: light;
    --bg: #ffffff; --surface: #ffffff; --surface-2: #f8f7f4; --surface-3: #ecebe6; --line: #dedbd4; --line-strong: #b9b4aa;
    --ink: #1c1e20; --ink-2: #474a4f; --muted: #5f6266;
    --accent: #0b5f73; --accent-hover: #084b5b; --accent-tint: #e2eff1; --accent-ink: #ffffff;
    --review: #a3301c; --review-tint: #f8e8e3; --warn: #7f4f00; --warn-tint: #faefd9; --ok: #2d6a38; --ok-tint: #e5efe5;
    --info: #0b5f73; --info-tint: #e2eff1; --neutral-tint: #efeee9;
    --seg-gps: #e2eff1; --seg-gps-line: #0b5f73; --seg-gps-text: #084b5b; --seg-entry: #0b5f73;
    --chart-ok: #4a9a86; --chart-warn: #f2b84b; --chart-bad: #a3201c;
  }
  @page { margin: 12mm; }
  html, body { background: #fff !important; }
  .appbar, .menu, .modal, .modal-backdrop, .toast, .popover { display: none !important; }
  .page { height: auto !important; overflow: visible !important; padding: 0 !important; }
  /* The technician week: only its sheet. */
  .page:has(> .print-sheet) > :not(.print-sheet) { display: none !important; }
  .print-sheet { display: block; font-size: 11px; line-height: 1.35; color: var(--ink); print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  /* The week (every day, the selected one explained), or that day alone: html[data-print-mode], set by the ⋯ menu's
     Print items until the print dialog closes; the browser's own Print prints the week. */
  html[data-print-mode="day"] .print-sheet .ps-week-only, html:not([data-print-mode="day"]) .print-sheet .ps-day-only { display: none !important; }

  .ps-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding-bottom: 6px; margin-bottom: 8px; border-bottom: 2px solid var(--ink); }
  .ps-head h1 { font-size: 18px; }
  .ps-head p { color: var(--ink-2); }
  .ps-stamp { text-align: right; font-size: 10px; }
  .ps-totals { margin-bottom: 6px; }
  .ps-grid { width: 100%; border-collapse: collapse; }
  .ps-grid thead { display: table-header-group; }
  .ps-grid th { text-align: left; font-size: 10px; font-weight: 600; color: var(--ink-2); padding: 3px 5px; border-bottom: 1px solid var(--line-strong); }
  .ps-grid td { padding: 3px 5px; border-bottom: 1px solid var(--line); vertical-align: top; }
  .ps-grid .r { text-align: right; }
  .ps-grid .num { font-family: var(--mono); white-space: nowrap; }
  .ps-grid .sub { display: block; font-size: 9.5px; color: var(--ink-2); white-space: normal; }
  .ps-grid td.flag { color: var(--review); font-weight: 600; }
  .ps-grid tr.sel td { background: var(--accent-tint); }
  .print-sheet h2 { font-size: 14px; margin: 10px 0 4px; }
  .print-sheet h3 { font-size: 11.5px; margin: 8px 0 3px; }
  .print-sheet h2, .print-sheet h3 { break-after: avoid; }
  .print-sheet ul { margin: 0; padding-left: 16px; }
  .print-sheet .muted { color: var(--muted); }
  .print-sheet .small { font-size: 10px; }
  .ps-verdict { margin: 4px 0; padding: 6px 8px; border: 1px solid var(--line-strong); background: var(--surface-2); }
  .ps-verdict .lead { font-size: 12px; font-weight: 500; }
  .ps-verdict .fine { margin-top: 2px; font-size: 10px; color: var(--ink-2); }
  .ps-figures { margin: 3px 0; }
  .print-sheet .tl .seg { font-size: 9px; }
  /* No page break inside a day's row, a line, the verdict or the timeline. */
  .ps-grid tr, .print-sheet li, .ps-verdict, .print-sheet .tl { break-inside: avoid; }
}
