.receipt-settings-card {
  margin-bottom: 16px;
}

.receipt-settings-card .list-line strong {
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
}

.receipt-logo-fields { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--line-strong); border-radius: 12px; }
.receipt-logo-fields legend { padding-inline: 6px; font-weight: 800; }
.receipt-logo-fields .row-actions { margin-block: 8px; }
.receipt-logo-thumb,.receipt-logo { display: block; object-fit: contain; background: #fff; }
.receipt-logo-thumb { width: 54px; height: 54px; border: 1px solid var(--line); border-radius: 9px; }
.receipt-logo-thumb[hidden] { display: none; }
.checkout-primary-actions { display: flex; align-items: stretch; gap: 6px; }
.table-order-summary .checkout-primary-actions > .btn { flex: 1 1 auto; min-width: 0; }

.receipt-paper {
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.receipt-header {
  display: grid;
  gap: 2px;
  text-align: center;
}
.receipt-logo { width: 76px; height: 76px; margin: 0 auto 4px; border-radius: 8px; }

.receipt-header h2 {
  font-size: 20px;
}

.receipt-caption {
  margin-top: 6px;
  font-weight: 800;
}
.receipt-meta { display: grid; gap: 3px; border-block: 1px dashed var(--line-strong); padding-block: 7px; }
.receipt-meta > div { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.receipt-meta strong { min-width: 0; text-align: right; }
.receipt-items-heading { color: var(--secondary); font-size: 12px; font-weight: 800; }

.receipt-items {
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.receipt-row > :first-child {
  min-width: 0;
}

.receipt-row > strong:last-child {
  text-align: right;
}

.receipt-items .receipt-row > strong:last-child,
.receipt-total > strong {
  white-space: nowrap;
}

.receipt-row[hidden] {
  display: none;
}

.receipt-total {
  font-weight: 800;
  color: var(--primary-text);
}

.receipt-total strong {
  font-size: 18px;
}

.receipt-footer {
  white-space: pre-line;
  text-align: center;
}

@media print {
  @page {
    margin: 3mm;
  }

  #dialog:has(.receipt-paper) {
    overflow: visible;
    max-width: none;
  }

  #dialog .dialog-body:has(> .receipt-paper, > form[data-form="settle"] > .receipt-paper) {
    padding: 0;
  }

  #dialog form[data-form="settle"] { display: block; }
  #dialog form[data-form="settle"] > :not(.receipt-paper) { display: none !important; }

  .receipt-paper {
    width: 74mm;
    max-width: 100%;
    padding: 0;
    margin: 0 auto;
    gap: 1.3mm;
    background: #fff;
    border: 0;
    color: black;
    font: 10pt/1.35 Manrope, system-ui, sans-serif;
  }

  .receipt-paper[data-paper-width="58"] {
    width: 52mm;
  }

  .receipt-paper .subtext {
    color: inherit;
  }

  .receipt-paper .receipt-header h2,
  .receipt-paper .receipt-total strong {
    font-size: 12pt;
  }

  .receipt-paper .receipt-row {
    break-inside: avoid;
    border-color: #777;
    padding-block: 0.8mm;
  }

  .receipt-paper .receipt-total {
    color: inherit;
  }

  .receipt-paper .receipt-logo { width: 16mm; height: 16mm; margin-bottom: 0; }
  .receipt-paper .receipt-meta { gap: 0.5mm; padding-block: 1mm; border-color: #777; }
  .receipt-paper .receipt-meta > div,.receipt-paper .receipt-items-heading { font-size: 8pt; color: inherit; }
  .receipt-paper .checkout-transfer { break-inside: avoid; margin-top: 2mm; padding-top: 2mm; border-color: #777; }
  .receipt-paper .checkout-transfer:has([role="status"]),.receipt-paper .transfer-detail button { display: none; }
  .receipt-paper .checkout-transfer h3 { font-size: 10pt; text-align: center; }
  .receipt-paper .transfer-layout { grid-template-columns: minmax(0,1fr); gap: 2mm; }
  .receipt-paper .transfer-qr { width: min(100%,30mm); justify-self: center; }
  .receipt-paper .transfer-details { gap: 1mm; }
  .receipt-paper .transfer-detail > div { display: flex; justify-content: space-between; gap: 2mm; width: 100%; font-size: 8pt; }
  .receipt-paper .transfer-detail strong { min-width: 0; text-align: right; }
}
