#print-receipt { display: none; }

@media print {
  /* Kill body sizing so nothing spills onto page 2 */
  html, body {
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    overflow: hidden !important;
  }

  /* Hide everything except the receipt */
  body > *:not(#print-receipt) {
    display: none !important;
  }

  #print-receipt {
    display: block !important;
    position: static;
    width: 58mm;
    max-width: 58mm;
    padding: 4mm 2mm;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.35;
    color: #000;
    background: #fff;
    page-break-after: avoid;
    break-after: avoid;
  }

  @page {
    size: 58mm auto;
    margin: 0;
  }

  #print-receipt .rcpt-center { text-align: center; }
  #print-receipt .rcpt-bold { font-weight: bold; }
  #print-receipt .rcpt-line {
    border-top: 1px dashed #000;
    margin: 4px 0;
  }
  #print-receipt .rcpt-row {
    display: flex;
    justify-content: space-between;
    gap: 4px;
  }
  #print-receipt .rcpt-total {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-size: 14px;
  }
}