/* Receipts print in normal document flow, never inside the modal top layer. */
.stockwise-print-root { display: none; }
@media print {
  /* Let long tables start on the current sheet and paginate row by row. */
  .panel:has(table) { break-inside: auto !important; }
  th, td { padding: 6px 8px !important; }
  th.num, td.num, td.mono { white-space: nowrap !important; }
  .product-icon { display: none !important; }

  html:has(body.stockwise-receipt-print),
  body.stockwise-receipt-print {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
    background: white !important;
  }
  body.stockwise-receipt-print > :not(#stockwise-print-root),
  body.stockwise-receipt-print dialog,
  body.stockwise-receipt-print dialog::backdrop {
    display: none !important;
  }
  body.stockwise-receipt-print #stockwise-print-root,
  body.stockwise-receipt-print #stockwise-print-root * {
    visibility: visible !important;
  }
  body.stockwise-receipt-print #stockwise-print-root {
    display: block !important;
    position: static !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }
  #stockwise-print-root .receipt {
    width: 100%;
    max-width: 100mm;
    box-sizing: border-box;
    height: auto;
    max-height: none;
    overflow: visible;
    margin: 0 auto;
    break-inside: auto;
  }
  #stockwise-print-root .receipt-line,
  #stockwise-print-root .summary-line {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  #stockwise-print-root .receipt-line > span {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}
