/* ==========================================================================
   Printed documents (receipt voucher, tax invoice, payment voucher…).
   Paper is narrower than a laptop screen, so the phone-width rules would
   otherwise apply when printing. These rules keep the A4 layout on paper,
   and the documents clip their rotated watermarks so nothing spills past
   the page (a spill makes the browser shrink the page and, in Arabic,
   push it off the left edge).
   ========================================================================== */
.voucher, .td { overflow: hidden; }

@media print {
  @page { size: A4; margin: 10mm; }
  html, body { width: auto !important; min-width: 0 !important; overflow: visible !important; background: #fff !important; }
  body { margin: 0 !important; padding: 0 !important; }
  .a4, .a4.a4-doc { width: auto !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important; box-shadow: none !important; border: 0 !important; }
  .voucher { border: 0 !important; border-radius: 0 !important; padding: 0 !important; font-size: 12px; }
  .td { min-height: calc(297mm - 20mm - 2px); }
  .v-meta { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .v-sign, .v-sign.sg-sign, .ps-sign { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 16px !important; }
  .td-parties { grid-template-columns: 1fr 1fr !important; }
  .td-sum { grid-template-columns: minmax(0, 1fr) 72mm !important; }
  .td-proj { grid-template-columns: 2fr 1fr 1fr !important; }
  .ps-stamp { inset-block-start: -62px !important; }
  .sg-page { page-break-after: always; break-after: page; }
  .sg-page:last-child { page-break-after: auto; break-after: auto; }
  .sg-page, .voucher, .td { break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.voucher .ps-stamp { inset-block-start: -30px !important; width: 24mm; height: 24mm; }
