/* ============================================================
   KHQR payment flow — 3 screens matching the MB Bank Cambodia flow
   Enter amount -> Confirm -> Payment successful
   ============================================================ */

#pay-flow {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: #fff;
  color: #10161d;
  font-family: Inter, "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
#pay-flow.open { opacity: 1; visibility: visible; pointer-events: auto; }
#pay-flow [hidden] { display: none !important; }

.pf-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
}

/* ---------- header ---------- */
.pf-header {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 6px;
  padding: 14px 12px 12px;
  background: #fff;
  border-bottom: 1px solid #eff2f7;
  padding-top: calc(14px + env(safe-area-inset-top));
}
.pf-header h1 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 600;
  text-align: center;
  letter-spacing: -0.2px;
}
.pf-back {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #10161d;
  cursor: pointer;
}
.pf-back:active { background: #f2f5fa; }
.pf-header-spacer { width: 40px; }

/* ---------- body ---------- */
.pf-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pf-label {
  margin: 0 0 4px;
  font-size: 12px;
  color: #7b8794;
  font-weight: 500;
}

/* merchant block */
.pf-merchant {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: #f5f8ff;
  border: 1px solid #e6edfd;
}
.pf-merchant-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #dfe9ff;
  color: #0b4fd6;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.4px;
}
.pf-merchant-name {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

/* bank row */
.pf-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #eff2f7;
}
.pf-bank-name { margin: 0; font-size: 15px; font-weight: 600; }
.pf-bank-sub { margin: 2px 0 0; font-size: 12px; color: #7b8794; }
.pf-bank-badge {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #f0f4fb;
  color: #0b4fd6;
}

/* amount */
.pf-field { display: block; }
.pf-amount {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0 10px;
  border-bottom: 1px solid #e7ebf2;
}
.pf-amount:focus-within { border-bottom-color: #0b4fd6; }
.pf-cur { font-size: 26px; font-weight: 600; color: #10161d; }
.pf-amount-input {
  width: 100%;
  border: 0;
  padding: 0;
  font-family: inherit;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.6px;
  color: #10161d;
  background: transparent;
}
.pf-amount-input:focus { outline: none; }
.pf-amount-input::placeholder { color: #c4ccd6; font-weight: 600; }

.pf-input {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid #e7ebf2;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14.5px;
  color: #10161d;
  background: #fff;
}
.pf-input:focus { outline: none; border-color: #0b4fd6; }

/* from account */
.pf-account { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.pf-account-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #eaf1ff;
  color: #0b4fd6;
  font-size: 12px;
  font-weight: 700;
}
.pf-account-name { margin: 0; font-size: 14px; font-weight: 600; }
.pf-account-sub { margin: 1px 0 0; font-size: 12px; color: #7b8794; }

/* ---------- confirm ---------- */
.pf-confirm-card {
  padding: 14px;
  border-radius: 16px;
  background: #f5f8ff;
  border: 1px solid #e6edfd;
}
.pf-confirm-merchant { display: flex; align-items: center; gap: 10px; margin: 8px 0 12px; }
.pf-confirm-bank {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  background: #fff;
  border: 1.5px solid #bcd2ff;
}
.pf-confirm-bank .pf-label { margin-bottom: 2px; }

.pf-summary {
  padding: 6px 2px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pf-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 13.5px;
}
.pf-summary span:first-child { color: #7b8794; }
.pf-summary span:last-child { font-weight: 500; text-align: right; }
.pf-summary-total {
  padding-top: 12px;
  border-top: 1px solid #eff2f7;
  font-size: 15px !important;
}
.pf-summary-total span { font-weight: 700 !important; color: #10161d; }

.pf-note-line {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f6f8fb;
  font-size: 12.5px;
  color: #5c6774;
}
.pf-note-line[hidden] { display: none; }

.pf-status {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f2f6fb;
  color: #48525d;
  font-size: 12.5px;
  line-height: 1.45;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.pf-status::before {
  content: "";
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  margin-top: 2px;
  border: 2px solid #0b4fd6;
  border-radius: 50%;
  border-right-color: transparent;
  animation: pf-spin 0.9s linear infinite;
}
.pf-status[data-tone="error"] { background: #fdf1f1; color: #a3262b; }
.pf-status[data-tone="error"]::before { border-color: #a3262b; animation: none; }
.pf-status[hidden] { display: none; }
@keyframes pf-spin { to { transform: rotate(360deg); } }

/* ---------- success ---------- */
.pf-success {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 34px 20px 10px;
  text-align: center;
}
.pf-check {
  width: 76px;
  height: 76px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e6f7ea;
  color: #16a34a;
}
.pf-success h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.pf-success-amount {
  margin: 0 0 4px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.8px;
}
.pf-success-merchant { margin: 0 0 18px; font-size: 14px; color: #5c6774; }

.pf-received {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 12px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: #f5f8ff;
  border: 1.5px solid #bcd2ff;
}
.pf-summary--success {
  text-align: left;
  padding: 14px 2px 0;
  border-top: 1px solid #eff2f7;
}

/* ---------- footer ---------- */
.pf-footer {
  flex: 0 0 auto;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid #f2f5f9;
}
.pf-footer--success { display: flex; flex-direction: column; gap: 10px; }

.pf-primary {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 12px;
  background: #0b4fd6;
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.pf-primary:active { transform: scale(0.985); }
.pf-primary[disabled] { opacity: 0.45; cursor: not-allowed; }

.pf-secondary {
  height: 48px;
  border: 1px solid #0b4fd6;
  border-radius: 12px;
  background: #fff;
  color: #0b4fd6;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

@media (max-height: 700px) {
  .pf-success { padding-top: 20px; }
  .pf-check { width: 62px; height: 62px; margin-bottom: 10px; }
  .pf-success-amount { font-size: 26px; }
}

/* ============================================================
   Redesign per MB reference: bill (KM) -> confirm (KM) -> success (VI)
   ============================================================ */

.bill-screen, .cf-screen, .su-screen { background: #f4f5f9; }
#pay-flow [hidden] { display: none !important; }

.bill-back {
  position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 10px; z-index: 3;
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; background: transparent; color: #1b2230; cursor: pointer; border-radius: 12px;
}
.bill-back:active { background: rgba(15, 30, 60, 0.06); }

/* ---------- step 1: bill ---------- */
.bill-body {
  flex: 1; overflow-y: auto;
  padding: 54px 20px 118px;
}
.bill-avatar {
  width: 104px; height: 104px; margin: 6px auto 16px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #dbeafe; color: #2f7cf6;
}
.bill-name {
  margin: 0; text-align: center;
  font-size: 21px; font-weight: 800; letter-spacing: 0.5px; color: #1e293b;
  text-transform: uppercase;
}
.bill-target-label {
  margin: 0 0 4px; color: #64748b; text-align: center;
  font-size: 12px; font-weight: 600; letter-spacing: 0.8px;
  text-transform: uppercase;
}
.bill-caption {
  margin: 18px 0 2px; text-align: center;
  font-size: 13.5px; color: #6b7280;
}
.bill-amount {
  display: flex; align-items: baseline; justify-content: center; gap: 8px;
  padding: 2px 0 6px;
}
.bill-amount-input {
  width: 4ch; max-width: 62vw;
  border: 0; background: transparent; padding: 0;
  font-family: inherit; font-size: 38px; font-weight: 800; letter-spacing: 0.3px;
  color: #1d2330; text-align: center;
  font-variant-numeric: tabular-nums;
}
.bill-amount-input:focus { outline: none; }
.bill-amount-input::placeholder { color: #b9c0cc; font-weight: 700; }
.bill-hint {
  margin: 8px 0 0; text-align: center;
  font-size: 13px; font-weight: 600; color: #e8402a;
}
.bill-hint[hidden] { display: none; }
/* 金额下方的汇率提示，文案由 scan.js 的 rateLabel() 统一生成 */
.bill-rate {
  margin: 6px 0 0; text-align: center;
  font-size: 12.5px; font-weight: 600; color: #6f7787;
  font-variant-numeric: tabular-nums;
}
.bill-cur {
  font-size: 17px; font-weight: 800; letter-spacing: 0.8px;
  color: #e8402a; text-transform: uppercase;
}
/* currency switcher: USD / KHR toggle on the bill screen */
.bill-cur-switch {
  display: inline-flex; align-items: stretch; align-self: center;
  border-radius: 9px; overflow: hidden;
  border: 1px solid #e0e7f1; background: #f3f6fb;
}
.bill-cur-btn {
  border: 0; background: transparent; cursor: pointer;
  padding: 5px 12px; min-width: 48px;
  font-family: inherit; font-size: 13px; font-weight: 800; letter-spacing: 0.6px;
  color: #6f7787; text-transform: uppercase;
  transition: background 0.15s, color 0.15s;
}
.bill-cur-btn + .bill-cur-btn { border-left: 1px solid #e0e7f1; }
.bill-cur-btn:hover { background: #e9eff8; color: #1d2330; }
.bill-cur-btn[aria-pressed="true"] {
  background: #e8402a; color: #fff;
}
.bill-cur-btn[aria-pressed="true"]:hover { background: #d6371f; color: #fff; }
.bill-hr {
  height: 1px; margin: 8px 0 16px;
  background: linear-gradient(90deg, rgba(190, 202, 220, 0) 0%, #cdd7e5 22%, #cdd7e5 78%, rgba(190, 202, 220, 0) 100%);
}
.bill-section { margin: 0 0 8px 2px; font-size: 13px; color: #5b6472; }
.bill-card {
  background: #fff; border-radius: 16px; padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}
.bill-card + .bill-card { margin-top: 14px; }
.bill-acc-name { margin: 0; font-size: 18.5px; font-weight: 700; color: #23272f; letter-spacing: 0.2px; }
.bill-acc-num { margin: 6px 0 0; font-size: 14.5px; color: #6f7787; }
.bill-acc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.bill-acc-bal { margin: 0; font-size: 21px; font-weight: 800; color: #e8402a; letter-spacing: 0.2px; }
.bill-change {
  display: inline-flex; align-items: center; gap: 2px;
  border: 0; background: transparent; padding: 0;
  font-family: inherit; font-size: 12.5px; color: #d9483c; cursor: pointer;
  white-space: nowrap;
}
.bill-change { min-height: 40px; padding: 0 4px; font-weight: 600; }
.bill-change:focus-visible { outline: 2px solid #0875e8; outline-offset: 2px; border-radius: 8px; }
.bill-card--note { margin-top: 16px; }
.bill-note-label { margin: 0; font-size: 12.5px; color: #7c8494; }
.bill-note-input {
  width: 100%; margin-top: 8px; border: 0; background: transparent; padding: 0;
  font-family: inherit; font-size: 17px; color: #23272f;
}
.bill-note-input:focus { outline: none; }
.bill-note-input::placeholder { color: #a6adba; }

.bill-foot {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(244, 245, 249, 0) 0%, #f4f5f9 30%);
}
.bill-btn {
  width: 100%; height: 54px; border: 0; border-radius: 28px;
  background: linear-gradient(180deg, #ef3b46 0%, #e11d2e 100%);
  color: #fff; font-family: inherit; font-size: 17px; font-weight: 600;
  letter-spacing: 0.2px; cursor: pointer;
  box-shadow: 0 6px 16px rgba(225, 29, 46, 0.24);
}
.bill-btn:active { transform: scale(0.985); }
.bill-btn[disabled] { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

/* ---------- step 2: confirm ---------- */
.cf-body { flex: 1; overflow-y: auto; padding: 52px 20px 118px; }
.cf-caption { margin: 0 0 2px; font-size: 14px; font-weight: 600; color: #ef4b34; }
.cf-amount { margin: 0 0 18px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px; }
.cf-amount #pf-confirm-amount { font-size: 33px; font-weight: 800; color: #1d2330; letter-spacing: 0.2px; }
.cf-cur { font-size: 20px; font-weight: 800; color: #1d2330; letter-spacing: 0.4px; }
.cf-usd { font-size: 14.5px; color: #6f7787; }
.cf-card {
  background: #fff; border-radius: 16px; padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}
.cf-card + .cf-card { margin-top: 14px; }
.cf-mini { margin: 0 0 8px; font-size: 12.5px; color: #7c8494; }
.cf-party { display: flex; align-items: center; gap: 12px; }
.cf-mark {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: #1b3fa0; color: #fff;
  font-size: 13px; font-weight: 800; letter-spacing: 0.3px;
}
.cf-mark--bank {
  border-radius: 10px;
  background: #fef3c7; color: #b45309;
  font-size: 15px; font-weight: 800;
}
.cf-party-name { margin: 0; font-size: 17px; font-weight: 700; color: #23272f; letter-spacing: 0.2px; }
.cf-party-sub { margin: 4px 0 0; font-size: 13.5px; color: #6f7787; }
.cf-divider { height: 1px; background: #e7ebf2; margin: 15px 0; }
.cf-details .cf-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 8px 0; font-size: 14px;
}
.cf-details .cf-row:first-child { padding-top: 0; }
.cf-details .cf-row:last-child { padding-bottom: 0; }
.cf-details .cf-row > span:first-child { color: #464e5c; }
.cf-details .cf-row > span:last-child { color: #1f2530; font-weight: 600; text-align: right; }

/* Confirmation screen styled to match the MB transaction reference. */
.cf-screen { background: #f4f5fa; }
.cf-header {
  flex: 0 0 auto;
  min-height: 54px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 8px;
  padding: calc(4px + env(safe-area-inset-top)) 16px 4px;
  background: #0875e8;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}
.cf-header h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(17px, 4.6vw, 22px);
  line-height: 1.15;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}
.cf-header-action {
  width: 38px;
  height: 38px;
  padding: 7px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.cf-header-action svg { width: 25px; height: 25px; }
.cf-header-action:active { background: rgba(255, 255, 255, 0.14); }
.cf-body { padding: 22px 5.3% 112px; }
.cf-caption {
  margin-bottom: 6px;
  font-size: clamp(15px, 4vw, 18px);
  font-weight: 600;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}
.cf-amount { margin-bottom: 24px; gap: 5px; }
.cf-amount #pf-confirm-amount {
  font-size: clamp(34px, 8.2vw, 48px);
  line-height: 1.18;
  font-weight: 700;
  color: #101114;
  letter-spacing: -0.7px;
  font-variant-numeric: tabular-nums;
}
.cf-cur {
  font-size: clamp(20px, 5vw, 27px);
  font-weight: 500;
  color: #101114;
}
.cf-usd { display: none; }
.cf-card {
  border-radius: 13px;
  padding: 18px 20px;
  box-shadow: none;
}
.cf-card + .cf-card { margin-top: 16px; }
.cf-mini { margin-bottom: 5px; font-size: 14px; color: #8a8b90; }
.cf-party { gap: 14px; min-height: 52px; }
.cf-mark {
  width: 48px;
  height: 48px;
  background: linear-gradient(145deg, #1386ed, #1737d4);
}
.cf-mark--bank {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #08766d;
  color: #fff;
  font-size: 12px;
}
.cf-party > div { min-width: 0; }
.cf-party-name {
  font-size: clamp(16px, 4.2vw, 20px);
  line-height: 1.25;
  font-weight: 700;
  color: #111318;
  overflow-wrap: anywhere;
}
.cf-party-sub {
  margin-top: 4px;
  font-size: clamp(13px, 3.6vw, 16px);
  color: #666970;
  overflow-wrap: anywhere;
}
.cf-divider { margin: 14px 0; background: #e5e6e9; }
.cf-details { padding: 17px 18px; }
.cf-details .cf-row {
  min-height: 44px;
  padding: 8px 0;
  font-size: clamp(14px, 3.8vw, 17px);
}
.cf-details .cf-row > span:first-child { color: #18355d; }
.cf-details .cf-row > span:last-child { color: #111318; font-weight: 500; }
.cf-details .cf-row:nth-child(2) > span:last-child { color: #0875e8; font-weight: 700; }
.cf-details .cf-row:last-child > span:last-child { max-width: 62%; overflow-wrap: anywhere; }
.cf-screen .bill-foot {
  padding: 10px 5.3% calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(244, 245, 250, 0) 0%, #f4f5fa 24%);
}
.cf-screen .bill-btn {
  height: 54px;
  border-radius: 12px;
  background: #0875e8;
  box-shadow: none;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
}
.cf-screen .bill-btn:active { background: #0666ce; }

/* ---------- step 3: success ---------- */
.su-body { flex: 1; overflow-y: auto; padding: 30px 20px 112px; }
.su-badge {
  width: 88px; height: 88px; margin: 10px auto 0;
  display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #4f9bfa 0%, #2574e6 48%, #1450b8 100%);
  box-shadow: 0 8px 20px rgba(20, 80, 184, 0.22), inset 0 0 0 6px rgba(255, 255, 255, 0.10);
}
.su-title { margin: 16px 0 0; text-align: center; font-size: 19.5px; font-weight: 700; color: #22262e; }
.su-amount { margin: 8px 0 0; text-align: center; font-size: 29px; font-weight: 800; color: #1a51c4; letter-spacing: 0.4px; }
.su-time { margin: 6px 0 0; text-align: center; font-size: 13.5px; color: #7b8393; }

.su-parties {
  margin-top: 18px; background: #fff; border-radius: 16px; padding: 18px 14px;
  display: flex; align-items: center; gap: 4px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}
.su-party { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.su-mark {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: #1b3fa0; color: #fff; font-size: 13px; font-weight: 800; letter-spacing: 0.3px;
}
.su-mark--bank { border-radius: 10px; background: #fde9c8; color: #b45309; font-size: 15px; }
.su-party-name { margin: 9px 0 0; font-size: 15px; font-weight: 700; color: #23272f; line-height: 1.25; }
.su-party-sub { margin: 5px 0 0; font-size: 12px; color: #7b8393; line-height: 1.35; word-break: break-word; }
.su-arrows { flex: 0 0 auto; font-size: 11px; letter-spacing: 1px; color: #7fb0f2; }

.su-detail {
  margin-top: 14px; border: 1.5px solid #86c8f4; border-radius: 14px;
  background: rgba(255, 255, 255, 0.72); padding: 12px 14px;
}
.su-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 0; font-size: 13.5px;
}
.su-row > span:first-child { color: #55606f; }
.su-row > span:last-child { color: #1f2530; font-weight: 600; text-align: right; }
.su-ref { display: inline-flex; align-items: center; gap: 6px; }
.su-copy { border: 0; background: transparent; padding: 0; color: #2f7cf6; cursor: pointer; display: inline-grid; place-items: center; }

.su-actions { display: flex; justify-content: space-around; align-items: center; margin: 20px 0 6px; }
.su-action {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 8px;
  border: 0; background: transparent; padding: 0; cursor: pointer; font-family: inherit;
}
.su-action-ico {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fff; color: #2f7cf6;
  box-shadow: 0 2px 8px rgba(16, 40, 90, 0.10);
}
.su-action span:last-child { font-size: 12.5px; color: #2d3748; }

.su-btn {
  width: 100%; height: 52px; border: 0; border-radius: 14px;
  background: linear-gradient(180deg, #2f7cf6 0%, #1a56d6 100%);
  color: #fff; font-family: inherit; font-size: 17px; font-weight: 600; cursor: pointer;
  box-shadow: 0 6px 16px rgba(26, 86, 214, 0.22);
}
.su-btn:active { transform: scale(0.985); }

/* recipient bank shown right under the payee name on the bill screen */
.bill-bank {
  margin: 7px 0 0; text-align: center;
  font-size: 13px; color: #6f7787; letter-spacing: 0.2px;
}
.bill-bank:empty { display: none; }

/* bank logo inside the marks (falls back to the letter when no logo is known) */
.bill-avatar.has-logo { background: #fff; border: 1px solid #e4eaf4; overflow: hidden; }
.bill-avatar.has-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cf-mark.has-logo, .su-mark.has-logo {
  background: #fff; border: 1px solid #e6ebf5; overflow: hidden; padding: 0;
}
.cf-mark.has-logo img, .su-mark.has-logo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

/* Digital OTP bottom sheet */
.otp-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.otp-overlay.open { opacity: 1; visibility: visible; pointer-events: auto; }
.otp-scrim {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(9, 13, 22, 0.52);
}
.otp-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(84dvh, 790px);
  min-height: 0;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  padding: 10px 6px calc(10px + env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0;
  background: #f6f6fa;
  color: #111318;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.12);
  transform: translateY(18px);
  transition: transform 0.24s ease;
}
.otp-overlay.open .otp-sheet { transform: translateY(0); }
.otp-handle {
  flex: 0 0 auto;
  width: 36px;
  height: 4px;
  margin: 0 0 16px;
  border-radius: 4px;
  background: #c9cbd0;
}
.otp-illustration {
  flex: 0 0 auto;
  width: clamp(116px, 35vw, 150px);
  height: clamp(116px, 35vw, 150px);
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
}
.otp-illustration svg { width: 100%; height: 100%; }
.otp-sheet h2 {
  margin: 0;
  text-align: center;
  font-size: clamp(17px, 4.8vw, 21px);
  line-height: 1.3;
  font-weight: 600;
}
.otp-dots {
  display: flex;
  justify-content: center;
  gap: clamp(16px, 5.2vw, 26px);
  margin: 34px 0 0;
}
.otp-dots span {
  width: 22px;
  height: 22px;
  border: 1.5px solid #a5a8ae;
  border-radius: 50%;
  background: transparent;
}
.otp-dots span.filled { border-color: #0875e8; background: #0875e8; }
.otp-error {
  margin: 12px 8px 0;
  color: #d93838;
  font-size: 13px;
  text-align: center;
}
.otp-forgot {
  margin: 24px 0 0;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: #0875e8;
  font: inherit;
  font-size: clamp(15px, 4.4vw, 19px);
  cursor: pointer;
}
.otp-done-row {
  flex: 1 0 40px;
  min-height: 42px;
  width: calc(100% + 12px);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  margin: auto -6px 0;
  padding: 0 20px 9px;
  border-bottom: 1px solid #b8bbc2;
}
.otp-done-row button {
  border: 0;
  background: transparent;
  color: #0875e8;
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}
.otp-keypad {
  flex: 0 0 auto;
  width: calc(100% + 12px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0 -6px;
  padding: 7px 6px 10px;
  background: #d1d4d8;
}
.otp-key {
  min-width: 0;
  height: clamp(48px, 10.5vw, 58px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid #ececf0;
  border-bottom-color: #aeb0b5;
  border-radius: 7px;
  background: #fff;
  color: #111;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.otp-key:active { background: #e9f2ff; }
.otp-key > span { font-size: 25px; line-height: 1; font-weight: 400; }
.otp-key small {
  min-height: 13px;
  margin-top: 4px;
  font-size: 9px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 2px;
}
.otp-key-spacer { min-height: 1px; }
.otp-key-delete { border: 0; background: transparent; }
.otp-key-delete svg { width: 26px; height: 26px; }
.otp-home-indicator {
  flex: 0 0 auto;
  width: 36%;
  height: 4px;
  margin: 10px auto 0;
  border-radius: 4px;
  background: #111;
}

/* Select which owned account funds the KHQR payment. */
.account-picker {
  position: absolute;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0.22s ease;
}
.account-picker.open { visibility: visible; pointer-events: auto; }
.account-picker-scrim {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(14, 24, 42, 0);
  transition: background 0.22s ease;
}
.account-picker.open .account-picker-scrim { background: rgba(14, 24, 42, 0.48); }
.account-picker-sheet {
  position: relative;
  width: 100%;
  max-height: min(78dvh, 680px);
  overflow-y: auto;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  background: #fff;
  box-shadow: 0 -12px 34px rgba(11, 35, 70, 0.15);
  transform: translateY(28px);
  transition: transform 0.24s ease;
}
.account-picker.open .account-picker-sheet { transform: translateY(0); }
.account-picker-handle {
  display: block;
  width: 38px;
  height: 4px;
  margin: 0 auto 17px;
  border-radius: 4px;
  background: #d8dee8;
}
.account-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.account-picker-header p {
  margin: 0 0 4px;
  color: #7a8799;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.1px;
}
.account-picker-header h2 {
  margin: 0;
  color: #14233b;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.35px;
}
.account-picker-hint {
  margin: 4px 0 0;
  color: #728096;
  font-size: 13px;
}
.account-picker-close {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: #f2f5f9;
  color: #59677a;
  font: inherit;
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}
.account-picker-list { display: grid; gap: 9px; }
.account-option {
  width: 100%;
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 22px;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid #e7edf5;
  border-radius: 14px;
  background: #fff;
  color: #1d2939;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}
.account-option:active { transform: scale(0.99); }
.account-option[aria-selected="true"] {
  border-color: #1680e8;
  background: #f3f8ff;
}
.account-option:focus-visible { outline: 2px solid #0875e8; outline-offset: 2px; }
.account-option-details { min-width: 0; display: grid; gap: 2px; }
.account-option-label {
  color: #0875e8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.account-option-name { overflow: hidden; font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.account-option-number { color: #728096; font-size: 12px; overflow-wrap: anywhere; }
.account-option-balance { color: #182b48; font-size: 13px; font-weight: 700; text-align: right; white-space: nowrap; }
.account-option-check {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid #cbd4e0;
  border-radius: 50%;
  color: transparent;
  font-size: 12px;
  font-weight: 700;
}
.account-option[aria-selected="true"] .account-option-check {
  border-color: #0875e8;
  background: #0875e8;
  color: #fff;
}

/* Receipt hierarchy inspired by the supplied completed-transfer screen. */
.su-screen { background: #eff8fc; }
.su-body { padding-top: 16px; }
.su-brand {
  width: 170px;
  max-width: 170px;
  margin: 0 auto 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.su-brand img {
  width: auto;
  max-width: 100%;
  max-height: 52px;
  height: auto;
  display: block;
  object-fit: contain;
}
.su-title { max-width: 340px; margin: 14px auto 0; font-size: clamp(17px, 4.5vw, 20px); }
.su-parties { padding: 20px 14px; }
.su-mark--ref {
  width: auto;
  min-width: 76px;
  max-width: 84px;
  height: 40px;
  padding: 0 8px 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid #d7e5f8;
  border-radius: 10px;
  background: linear-gradient(145deg, #fff 8%, #edf5ff 100%);
  box-shadow: 0 2px 6px rgba(20, 73, 145, 0.08);
}
.su-mark--brand::before {
  content: "";
  flex: 0 0 27px;
  width: 27px;
  height: 29px;
  background: url("./mb-cambodia-logo.png") left center / auto 29px no-repeat;
}
.su-mark--brand::after {
  content: "MB BANK";
  color: #0756a5;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.15px;
  white-space: nowrap;
}
.su-detail { border-color: #2385ee; border-width: 1.5px; border-radius: 12px; }
.su-row { min-height: 36px; font-size: clamp(12px, 3.5vw, 14px); }
.su-row > span:last-child { overflow-wrap: anywhere; }

@media (max-height: 700px) {
  .otp-sheet { height: 86dvh; padding-top: 7px; }
  .otp-handle { margin-bottom: 8px; }
  .otp-illustration { width: 90px; height: 90px; margin-bottom: 8px; }
  .otp-dots { margin-top: 14px; }
  .otp-forgot { margin-top: 10px; }
  .otp-key { height: clamp(38px, 7.5dvh, 48px); }
}
