.a5-only-overlay {
  align-items: flex-start !important;
  justify-content: center !important;
  overflow: auto !important;
  padding: 20px !important;
}

.a5-viewer-close {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: #fff;
  color: #173a5e;
  box-shadow: 0 5px 18px rgba(0,0,0,.2);
  font-size: 24px;
  line-height: 1;
}

.a5-detail-pages {
  width: max-content;
  margin: 0 auto;
}

.a5-detail-pages .print-page {
  background: #fff;
  width: 148mm;
  height: 200mm;
  margin: 0 auto 15px;
  padding: 3mm 8mm 5mm;
  box-sizing: border-box;
  color: #000;
  display: flex;
  flex-direction: column;
  font-family: Arial,Helvetica,sans-serif;
  overflow: hidden;
}

.a5-detail-pages .invoice-main { flex: 0 0 auto; }
.a5-detail-pages .invoice-bottom { position: relative; top: -8px; margin-top: auto; min-height: 28mm; display: flex; flex-direction: column; }
.a5-detail-pages .header-title { text-align: center; font-size: 20px; font-weight: 700; text-transform: uppercase; letter-spacing: .5mm; margin-bottom: 1.2mm; }
.a5-detail-pages .header-date { text-align: center; font-size: 12.5px; margin-bottom: .8mm; }
.a5-detail-pages .invoice-number { text-align: center; font-size: 13px; font-style: italic; margin-bottom: 4mm; }
.a5-detail-pages .customer-name-line { font-size: 13px; margin-bottom: 1.3mm; line-height: 1.3; }
.a5-detail-pages .customer-name-line span { font-size: 17px; }
.a5-detail-pages .invoice-info-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 5mm; font-size: 13px; margin-bottom: 1.5mm; line-height: 1.35; }
.a5-detail-pages .invoice-info-row > div:first-child { flex: 1; min-width: 0; }
.a5-detail-pages .total-quantity-print { min-width: 32mm; padding-right: 7mm; box-sizing: border-box; text-align: right; white-space: nowrap; }
.a5-detail-pages .invoice-table { width: 100%; min-width: 0; margin: 1mm 0 1.2mm; border-collapse: collapse; border-top: 1.2px solid #000; border-bottom: 1.2px solid #000; table-layout: fixed; }
.a5-detail-pages .invoice-table th,
.a5-detail-pages .invoice-table td { border: none !important; border-bottom: .6px solid #777 !important; padding: 7px 3px !important; height: 20px; box-sizing: border-box; color: #000; font-size: 12.5px; line-height: 1.2; }
.a5-detail-pages .invoice-table th { border-bottom: 1.2px solid #000 !important; background: transparent !important; font-weight: 700; white-space: nowrap; position: static !important; box-shadow: none !important; }
.a5-detail-pages .invoice-table th:nth-child(1) { width: 6% !important; }
.a5-detail-pages .invoice-table th:nth-child(2) { width: 45.5% !important; }
.a5-detail-pages .invoice-table th:nth-child(3) { width: 7.5% !important; }
.a5-detail-pages .invoice-table th:nth-child(4) { width: 6.5% !important; }
.a5-detail-pages .invoice-table th:nth-child(5) { width: 15.5% !important; }
.a5-detail-pages .invoice-table th:nth-child(6) { width: 19% !important; }
.a5-detail-pages .invoice-table tbody tr:last-child td { border-bottom: none !important; }
.a5-detail-pages .invoice-table th:first-child,
.a5-detail-pages .invoice-table td:first-child { padding-left: 5mm !important; }
.a5-detail-pages .invoice-table th:last-child,
.a5-detail-pages .invoice-table td:last-child { padding-right: 7mm !important; }
.a5-detail-pages .invoice-table th:nth-child(5),
.a5-detail-pages .invoice-table td:nth-child(5) { padding-right: 3mm !important; }
.a5-detail-pages .invoice-table .product-name-cell { padding-left: 14mm !important; padding-right: 1mm !important; text-align: left; }
.a5-detail-pages .invoice-table .center-cell { text-align: center; }
.a5-detail-pages .invoice-table .money-cell { text-align: right; font-variant-numeric: tabular-nums; }
.a5-detail-pages .invoice-note-line { font-size: 14.5px; padding: 0; margin: 0 0 1.8mm; white-space: pre-wrap; overflow-wrap: anywhere; }
.a5-detail-pages .invoice-final-grid { display: grid; grid-template-columns: minmax(0,1fr) 30mm 40mm; column-gap: 2mm; grid-auto-rows: auto; align-items: baseline; margin: 0; font-family: "Segoe UI",Arial,sans-serif; }
.a5-detail-pages .receiver-title { grid-column: 1; grid-row: 1; align-self: stretch; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 12px; font-weight: 700; white-space: nowrap; }
.a5-detail-pages .receiver-subtitle { grid-column: 1; grid-row: 2; align-self: baseline; text-align: center; margin-top: 1mm; font-size: 10px; font-style: italic; font-weight: 400; white-space: nowrap; }
.a5-detail-pages .summary-label,
.a5-detail-pages .summary-value { min-height: 20px; padding: 1.5px 0; box-sizing: border-box; align-self: stretch; display: flex; align-items: center; font-size: 12px; font-weight: 700; white-space: nowrap; }
.a5-detail-pages .summary-label { grid-column: 2; padding-left: 2mm; font-family: "Segoe UI",Arial,sans-serif; }
.a5-detail-pages .summary-value { grid-column: 3; justify-content: flex-end; padding-right: 7mm; text-align: right; font-variant-numeric: tabular-nums; }
.a5-detail-pages .summary-row-1 { grid-row: 1; padding-top: 0; }
.a5-detail-pages .summary-row-2 { grid-row: 2; }
.a5-detail-pages .summary-row-3 { grid-row: 3; }
.a5-detail-pages .discount-value { color: #0f766e; }
.a5-detail-pages .summary-label.has-separator,
.a5-detail-pages .summary-value.has-separator { border-top: .8px solid #000; padding-top: 3px; }
.a5-detail-pages .summary-label.grand-total { font-size: 13px; font-weight: 800; }
.a5-detail-pages .summary-value.grand-total { font-size: 18px; font-weight: 800; }
.a5-detail-pages .invoice-check-note { text-align: center; font-style: italic; margin-top: auto; font-size: 11px; }
.a5-detail-pages .next-page-note { width: 64mm; margin: 0 0 1.8mm auto; text-align: right; font-size: 12px; font-style: italic; }

@media (max-width: 640px) {
  .a5-only-overlay { justify-content: flex-start !important; padding: 10px !important; }
  .a5-viewer-close { top: 8px; right: 8px; }
}
