/* V1.13.34 — isolate the actual A4 record sheets from the customer portal.
   This file is deliberately loaded LAST, after modern.css / home-fit.css. */

/* The print preview is always a white document, even if the app is in dark mode. */
#printSheet .print-sheet {
  background: #fff !important;
  color: #111827 !important;
  color-scheme: light !important;
}
:root[data-theme="dark"] #printSheet .print-sheet :is(
  .government-title, .print-registration-title, .print-registration-subtitle,
  .print-success-title, .print-success-note, .print-main-title,
  .print-row strong, .print-row span, .print-footer, .print-footer-tag
), body[data-theme="dark"] #printSheet .print-sheet :is(
  .government-title, .print-registration-title, .print-registration-subtitle,
  .print-success-title, .print-success-note, .print-main-title,
  .print-row strong, .print-row span, .print-footer, .print-footer-tag
) {
  color: #111827 !important;
}
:root[data-theme="dark"] #printSheet .print-sheet .print-success-icon,
body[data-theme="dark"] #printSheet .print-sheet .print-success-icon {
  color: #fff !important;
}
:root[data-theme="dark"] #printSheet .print-sheet :is(.print-table,.print-row,.print-main-title,.print-row strong),
body[data-theme="dark"] #printSheet .print-sheet :is(.print-table,.print-row,.print-main-title,.print-row strong) {
  border-color: #222 !important;
}

/* Dark-mode print manager: no pale text on pale chips, or pale chips on dark cards. */
:root[data-theme="dark"] #view .print-manager-card .print-selection-count,
body[data-theme="dark"] #view .print-manager-card .print-selection-count {
  background: #24466f !important;
  color: #ecf5ff !important;
  border-color: #5275a4 !important;
}
:root[data-theme="dark"] #view .print-manager-card .print-subtitle-strong,
body[data-theme="dark"] #view .print-manager-card .print-subtitle-strong {
  color: #a9d0ff !important;
}
:root[data-theme="dark"] #view :is(.print-day-group,.print-record-list,.print-record-option),
body[data-theme="dark"] #view :is(.print-day-group,.print-record-list,.print-record-option) {
  background: #17283e !important;
  color: #eaf2ff !important;
  border-color: #405772 !important;
}
:root[data-theme="dark"] #view .print-day-head,
body[data-theme="dark"] #view .print-day-head {
  background: #213953 !important;
  border-color: #435e7c !important;
  color: #eaf2ff !important;
}
:root[data-theme="dark"] #view .print-record-option:has(input:checked),
body[data-theme="dark"] #view .print-record-option:has(input:checked) {
  background: #234b79 !important;
}
:root[data-theme="dark"] #view .print-record-option:hover,
body[data-theme="dark"] #view .print-record-option:hover {
  background: #294869 !important;
}
:root[data-theme="dark"] #view .print-record-info span,
body[data-theme="dark"] #view .print-record-info span {
  color: #bfd3eb !important;
}
:root[data-theme="dark"] #view .print-record-info b,
body[data-theme="dark"] #view .print-record-info b {
  color: #f2f7ff !important;
}

/* Readable feedback and badges across the portal in dark theme. */
:root[data-theme="dark"] #view .alert:not(.err):not(.ok),
body[data-theme="dark"] #view .alert:not(.err):not(.ok) {
  background: #233d5b !important;
  color: #e8f2ff !important;
  border-color: #405f83 !important;
}
:root[data-theme="dark"] #view .alert.ok,
body[data-theme="dark"] #view .alert.ok {
  background: #1a3d53 !important;
  color: #d6f3ff !important;
  border-color: #356e8b !important;
}
:root[data-theme="dark"] #view .alert.err,
body[data-theme="dark"] #view .alert.err {
  background: #4a2635 !important;
  color: #ffe1e7 !important;
  border-color: #885068 !important;
}

@media print {
  @page { size: A4 portrait; margin: 0; }
  html, body {
    width: 210mm !important;
    min-width: 210mm !important;
    max-width: 210mm !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #fff !important;
    color: #111827 !important;
    color-scheme: light !important;
  }
  /* High-specificity theme rules otherwise repaint the paper's bottom strip dark. */
  html[data-theme="dark"],
  :root[data-theme="dark"] body,
  html[data-theme="dark"] body,
  body[data-theme="dark"] {
    background: #fff !important;
    color: #111827 !important;
    color-scheme: light !important;
  }
  /* In modern.css the sticky header is forced to display:grid!important;
     .top.no-print alone cannot beat that rule. Hide the entire app shell. */
  #app > :not(#view) { display: none !important; }
  #app > .top, .top, .more-menu, .more-menu-overlay, #imageResizerModal {
    display: none !important;
  }
  /* Only the selected documents may appear on physical paper or Save as PDF. */
  #view > :not(#printSheet), #view .print-manager-card, .no-print {
    display: none !important;
  }
  #app, #view, #printSheet {
    display: block !important;
    position: static !important;
    float: none !important;
    width: 210mm !important;
    max-width: 210mm !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
    color: #111827 !important;
    transform: none !important;
    overflow: visible !important;
  }
  #printSheet .print-sheet {
    background: #fff !important;
    color: #111827 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  #printSheet .print-sheet :is(
    .government-title,.print-registration-title,.print-registration-subtitle,
    .print-success-title,.print-success-note,.print-main-title,
    .print-row strong,.print-row span,.print-footer,.print-footer-tag
  ) {
    color: #111827 !important;
  }
  #printSheet .print-success-icon { color: #fff !important; }
}
