:root{--receipt-paper:80mm}body[data-receipt-width="58"]{--receipt-paper:58mm}.thermal-receipt{width:var(--receipt-paper);max-width:100%;padding:3mm;background:white;color:#000;font-family:ui-monospace,"SFMono-Regular",Consolas,monospace;font-size:12px;line-height:1.35;box-sizing:border-box;overflow-wrap:anywhere}.thermal-receipt h1{font-family:Georgia,serif;font-size:25px;letter-spacing:-.03em;line-height:1.1;margin:4px 0}.thermal-receipt h2{font:800 19px ui-monospace,monospace;margin:10px 0}.thermal-receipt h3{font:700 13px ui-monospace,monospace;margin:10px 0 3px}.thermal-receipt p{margin:3px 0;white-space:pre-line}.thermal-receipt hr{border:0;border-top:1px dashed #000;margin:10px 0}.receipt-center{text-align:center}.receipt-facts{display:grid;grid-template-columns:auto 1fr;gap:3px 7px;font-size:11px;margin:10px 0}.receipt-facts dd{margin:0;text-align:right}.receipt-item{padding:9px 0;border-bottom:1px dotted #777;break-inside:avoid}.receipt-item-heading,.receipt-sum,.receipt-total{display:flex;justify-content:space-between;gap:8px}.receipt-item-heading strong:last-child{white-space:nowrap}.receipt-modifier{font-weight:700}.receipt-total{font-size:17px;font-weight:800;margin-top:9px}.receipt-address,.receipt-notes{font-weight:700}.receipt-qr{display:block;width:38mm;height:38mm;max-width:100%;margin:5px auto 8px}.receipt-sum{margin:4px 0}#receipt-preview{display:flex;justify-content:center;background:#e8ece5;border:1px solid #d3dccf;border-radius:10px;padding:15px 0;overflow:auto}#print-area{display:none}@media print {
  @page { size: auto; margin: 0; }
  html, body {
    display: block !important;
    position: static !important;
    width: var(--receipt-paper) !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    color: #000 !important;
  }
  body > :not(#print-area), body > dialog[open] { display: none !important; }
  dialog::backdrop { display: none !important; background: none !important; backdrop-filter: none !important; }
  #print-area {
    display: block !important;
    position: static !important;
    width: var(--receipt-paper);
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    margin: 0;
    padding: 0;
    break-after: auto;
  }
  .thermal-receipt {
    max-width: none;
    width: var(--receipt-paper);
    height: auto;
    min-height: 0;
    max-height: none;
    overflow: visible;
    border: 0;
    box-shadow: none;
    break-after: auto;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .thermal-receipt > :last-child { margin-bottom: 0; }
  .thermal-receipt * { animation: none !important; }
  .receipt-qr { break-inside: avoid; }
}
