/* The paper formats of the printed fiscal receipt beside the 80 mm roll: a 58 mm roll (57 mm paper,
   48 mm printable) (docs/superpowers/specs/2026-09-27-receipt-paper-58-a4-design.md §4.3). A4 was removed in 2.67.0.
   PRINT ONLY, and only while js/receipt-paper.js has marked #fiscal-modal with data-paper for the print
   job ("58" from the Admin setting receipt_paper). Without the
   attribute nothing here applies and the frozen print block of index.html decides the paper alone, exactly as
   accredited. data-paper="80" (2.66.9) only moves the frozen 80 mm receipt to the top of its own page.

   The receipt is the same receipt: the 40-column PFR journal, the QR data and the order of the parts
   do not change, only their printed size. Two-id selectors with !important outrank the frozen one-class
   and one-id rules and css/receipt-ad.css (the pattern of css/receipt-ad.css and css/receipt-preview.css).
   Loaded in <head> after css/receipt-preview.css; css/kasir.css stays the last element there.
   Listed in docs/superpowers/specs/receipt-changes-v2.md. */
@media print {
  /* The receipt at the top of the page. The frozen overlay rules centre it vertically (display:flex,
     align-items:center, top:0, bottom:0): on a 1000 mm roll page that is some 40 cm down the paper. */
  #fiscal-modal[data-paper="58"] { align-items: flex-start !important; bottom: auto !important; }

  /* 80 mm (2.66.9, owner sign-off 2026-10-22 "izin ubah cetak 80 mm"): the frozen receipt at the top of a page as long as
     itself (js/receipt-paper.js measures it). Position only: no size, font, width or QR of the frozen 80 mm block changes.
     max-height: the frozen screen rule caps the modal at 85vh also in print, and 85 % of a page this long would cut it. */
  #fiscal-modal[data-paper="80"] { align-items: flex-start !important; bottom: auto !important; }
  #fiscal-modal[data-paper="80"] .receipt-modal { max-height: none !important; }

  /* 58 mm roll: the head prints 48 mm. 40 characters of 7.5px Courier New = 47.6 mm, no side padding. */
  #fiscal-modal[data-paper="58"] .receipt-modal { max-width: 48mm !important; max-height: none !important; padding: 3mm 0 !important; }
  #fiscal-modal[data-paper="58"] #receipt-text-content,
  #fiscal-modal[data-paper="58"] #receipt-text-closing { font-size: 7.5px !important; }
  /* Pravilnik čl. 10 st. 2: a square of 40-50 mm; 45 mm fits the 48 mm the head prints. */
  #fiscal-modal[data-paper="58"] #receipt-qr-img { width: 45mm !important; height: 45mm !important; }
  /* "ОВО НИЈЕ ФИСКАЛНИ РАЧУН" keeps 2em - twice the receipt font (TAP bab 117) - but one line of it
     is 55 mm: two balanced lines ("ОВО НИЈЕ" / "ФИСКАЛНИ РАЧУН") inside the column instead. */
  #fiscal-modal[data-paper="58"] #receipt-text-content .r-nonfiscal { white-space: normal !important; width: auto !important; max-width: 100% !important; left: 0 !important; transform: none !important; text-wrap: balance; }
  /* Pravilnik čl. 12 st. 2: smaller than the receipt font and not the receipt font (css/receipt-ad.css). */
  #fiscal-modal[data-paper="58"] #receipt-ad-text { font-size: 6.5px !important; }
}
