@font-face {
  font-family: "Recibo Manrope";
  src: url("./fonts/manrope-pdf.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

.h24-receipt-modal {
  --receipt-paper: #f8fbfe;
  --receipt-ink: #0b2a33;
  --receipt-muted: #445f70;
  --receipt-line: #bbced9;
  --receipt-action: #165575;
  --receipt-soft: #edf5fa;
  --receipt-inset: 24px;
  width: min(520px, calc(100% - 32px));
  max-height: calc(100dvh - 40px);
  padding: 0;
  border: 1px solid var(--receipt-line);
  border-radius: 18px;
  color: var(--receipt-ink);
  background: var(--receipt-paper);
  box-shadow: 0 24px 72px rgb(8 32 51 / 28%);
  font-family: "Recibo Manrope", Arial, sans-serif;
}

.h24-receipt-modal::backdrop { background: rgb(8 32 51 / 64%); }
.h24-receipt-modal[open] { display: flex; flex-direction: column; }
.h24-receipt-modal [hidden] { display: none !important; }

.h24-receipt-head {
  display: flex;
  flex: none;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px var(--receipt-inset);
  border-bottom: 1px solid var(--receipt-line);
}

.h24-receipt-head h2 {
  font-size: clamp(1.28rem, 5vw, 1.55rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.035em;
  margin: 0;
}

.h24-receipt-head p {
  margin: 6px 0 0;
  color: var(--receipt-muted);
  font-size: .8rem;
  overflow-wrap: anywhere;
}

.h24-receipt-close {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: var(--receipt-soft);
  color: var(--receipt-action);
  font: inherit;
  font-size: 1.35rem;
  cursor: pointer;
}

.h24-receipt-body {
  display: grid;
  flex: 1 1 auto;
  align-content: start;
  gap: 18px;
  min-height: 0;
  padding: 18px var(--receipt-inset);
  overflow: auto;
  overscroll-behavior: contain;
}

.h24-receipt-actions { display: grid; gap: 8px; }

.h24-receipt-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid var(--receipt-line);
  border-radius: 10px;
  color: var(--receipt-action);
  background: #fff;
  font: inherit;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.h24-receipt-button:hover { background: var(--receipt-soft); }
.h24-receipt-primary { background: var(--receipt-action); border-color: var(--receipt-action); color: #fff; }
.h24-receipt-primary:hover { background: #11435e; }
.h24-receipt-modal :is(.h24-receipt-button, .h24-receipt-close):focus-visible {
  outline: 2px solid var(--receipt-action);
  outline-offset: 2px;
}

.h24-receipt-qr-section {
  display: grid;
  justify-items: center;
  gap: 7px;
  text-align: center;
}

.h24-receipt-qr {
  width: min(100%, 190px);
  padding: 12px;
  background: #fff;
  border: 1px solid var(--receipt-line);
  border-radius: 12px;
  line-height: 0;
}

.h24-receipt-qr canvas { display: block !important; width: 100%; height: auto; aspect-ratio: 1; }
.h24-receipt-qr canvas + img { display: none !important; }
.h24-receipt-qr-section h3 { margin: 2px 0 0; font-size: .875rem; line-height: 1.25; }
.h24-receipt-qr-section p { margin: 0; color: var(--receipt-muted); font-size: .775rem; }

.h24-receipt-email-status, .h24-receipt-reconciliation {
  margin: 0;
  padding: 9px 11px;
  border: 1px solid var(--receipt-line);
  border-radius: 9px;
  background: var(--receipt-soft);
  color: var(--receipt-muted);
  font-size: .775rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.h24-receipt-reconciliation { color: #694413; background: #fff4de; border-color: #dfc895; }

.h24-receipt-footer {
  display: flex;
  flex: none;
  justify-content: flex-end;
  padding: 12px var(--receipt-inset);
  border-top: 1px solid var(--receipt-line);
}

.h24-receipt-footer button { min-width: 144px; }

@media (max-width: 760px) {
  .h24-receipt-modal {
    --receipt-inset: 18px;
    inset: 0;
    width: 100%;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .h24-receipt-head { padding-top: calc(16px + env(safe-area-inset-top)); }
  .h24-receipt-footer { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .h24-receipt-footer button { width: 100%; }
}
