/* ============================================================
   receipt.css — print-only receipt styles.
   Content is rendered into the hidden #receipt element; on print,
   everything else is hidden and the receipt is the whole page.
   80mm paper prints ~30 characters per line, 58mm ~24 — fonts and
   line lengths are tuned per width so nothing wraps awkwardly.
   ============================================================ */

#receipt { display: none; }

@media print {
  html, body {
    background: #fff !important;
    width: auto;
    height: auto;
    overflow: visible;
  }
  #stage { display: none !important; }
  #receipt { display: block; }
}

/* ---------- receipt typography ---------- */
#receipt .rcpt {
  font-family: "Courier New", monospace;
  font-size: 12pt;
  color: #000;
  background: #fff;
  line-height: 1.35;
  margin: 0 auto;      /* centred on the paper */
  padding: 0 1mm;      /* guard against the printer's dead margin */
}

#receipt .r80 { width: 72mm; }  /* 80mm paper, 8mm total margins */
#receipt .r58 { width: 48mm; }  /* 58mm paper, 10mm total margins */

/* 58mm paper is much narrower — shrink the type so lines still fit */
#receipt .r58 { font-size: 9.5pt; }
#receipt .r58 .r-shop { font-size: 12pt; }
#receipt .r58 .r-total { font-size: 12pt; }
#receipt .r58 .r-small { font-size: 8pt; }

#receipt .r-shop {
  font-size: 16pt;
  font-weight: bold;
  text-align: center;
  margin-top: 2mm;
}

#receipt .r-center { text-align: center; overflow-wrap: anywhere; }
#receipt .r-bold { font-weight: bold; }
#receipt .r-small { font-size: 10pt; }

#receipt .r-row {
  display: flex;
  justify-content: space-between;
  gap: 3mm;
}
#receipt .r-row > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;  /* long labels wrap cleanly, never overflow */
}
#receipt .r-row > span:last-child {
  flex: none;
  text-align: right;
}

#receipt .r-total {
  font-size: 16pt;
  font-weight: bold;
}

#receipt .r-dash {
  white-space: nowrap;
  overflow: hidden;
  margin: 1.5mm 0;
}

#receipt .r-blank { height: 5mm; }
