.qr-receipt-template-picker {
  margin: 0;
  padding: 14px;
  border: 1px solid #cbdaf0;
  border-radius: 14px;
  background: #f8fbff;
}

.qr-receipt-template-picker legend {
  padding: 0 7px;
  color: #173a69;
  font-size: 13px;
  font-weight: 800;
}

.qr-receipt-template-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.qr-receipt-template-options label {
  position: relative;
  margin: 0;
  cursor: pointer;
}

.qr-receipt-template-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.qr-receipt-template-options span {
  display: grid;
  gap: 3px;
  min-height: 62px;
  padding: 12px 14px;
  border: 2px solid #dbe5f2;
  border-radius: 12px;
  background: #fff;
  color: #173a69;
}

.qr-receipt-template-options small {
  color: #667a91;
  font-size: 12px;
}

.qr-receipt-template-options input:checked + span {
  border-color: #1970e8;
  background: #edf5ff;
  box-shadow: 0 0 0 3px rgba(25, 112, 232, .12);
}

.qr-receipt-preview-button {
  min-height: 48px;
  border: 1px solid #1970e8 !important;
  border-radius: 12px !important;
  color: #145fca !important;
  background: #fff !important;
  font-weight: 800 !important;
}

.receipt-compare-panel {
  padding: 16px;
  border: 1px solid #cbdaf0;
  border-radius: 16px;
  background: #f4f8fd;
}

.receipt-compare-panel[hidden] { display: none !important; }

.receipt-compare-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.receipt-compare-head h2,
.receipt-compare-head p { margin: 0; }
.receipt-compare-head h2 { color: #173a69; font-size: 16px; }
.receipt-compare-head p { margin-top: 4px; color: #667a91; font-size: 12px; }
.receipt-compare-head button { min-height: 38px; padding: 0 14px; border: 1px solid #cbdaf0; border-radius: 10px; background: #fff; }

.receipt-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.receipt-compare-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: #fff;
}

.receipt-compare-card.is-selected {
  border-color: #1970e8;
  box-shadow: 0 0 0 3px rgba(25, 112, 232, .12);
}

.receipt-compare-card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.receipt-compare-card header b { color: #173a69; }
.receipt-compare-card header span { color: #65798f; font-size: 11px; }
.receipt-compare-card iframe { width: 100%; height: 520px; border: 1px solid #dce5ef; border-radius: 10px; background: #fff; }
.receipt-compare-card > button { min-height: 42px; border: 0; border-radius: 10px; color: #fff; background: #1970e8; font-weight: 800; }

.receipt-two-stage {
  position: relative;
  width: min(100vw, 440px);
  min-height: 919px;
  height: 919px;
}

.receipt-one-stage {
  position: relative;
  width: 440px;
  max-width: 100vw;
}

.receipt-two-dialog {
  position: relative;
  width: 100%;
  min-height: 919px;
  height: 919px;
  max-height: none;
  overflow: hidden;
  border-radius: 0;
  background: transparent;
  box-shadow: 0 24px 70px rgba(15, 35, 64, .28);
}

body[data-page="user"] .qr-import-modal:has(> .receipt-two-stage) {
  place-items: start center;
  padding: 0;
  overflow: auto;
}

body[data-page="user"] .qr-import-modal:has(> .receipt-one-stage) {
  place-items: start center;
  padding: 0;
  overflow: auto;
}

.receipt-two-download {
  position: absolute;
  top: 16px;
  left: calc(100% + 14px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 144px;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid #0d6fe8;
  border-radius: 13px;
  color: #fff;
  background: #0d6fe8;
  box-shadow: 0 10px 28px rgba(13, 73, 148, .28);
  font: 700 15px/1 Arial, Helvetica, sans-serif;
  cursor: pointer;
  z-index: 4;
}

.receipt-two-download svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.receipt-two-download:disabled { cursor: wait; opacity: .86; }
.receipt-two-download[data-state="success"] { border-color: #07845b; background: #07845b; }
.receipt-two-download[data-state="error"] { border-color: #c33c39; background: #c33c39; }

.qr-import-receipt-template-picker {
  margin: 0 20px 16px;
}


.receipt-two-dialog__bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; color: #173a69; background: #f4f8fd; }
.receipt-two-dialog__bar button { min-height: 36px; padding: 0 13px; border: 1px solid #cbdaf0; border-radius: 9px; background: #fff; }
.receipt-two-dialog iframe { display: block; width: 100%; min-height: 919px; height: 919px; border: 0; background: transparent; }

.receipt-two-dialog--direct { min-height: 919px; height: 919px; max-height: none; }

@media (max-width: 720px) {
  .receipt-compare-grid { grid-template-columns: 1fr; }
  .receipt-compare-card iframe { height: 600px; }
  .receipt-two-download {
    position: fixed;
    top: auto;
    right: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
    left: auto;
    min-width: 132px;
    min-height: 46px;
    padding-inline: 15px;
  }
}

@media (max-width: 439px) {
  .receipt-one-stage { width: 100vw; }
}
