/* ============================================================
   Scan QR + payment flow
   Ported from artifacts/mockup-sandbox/src/components/mockups/
   payment/QRScanner.tsx + QRScanner.css, extended with camera
   capture, QR decoding and the payment sheet.
   ============================================================ */

#qr-scan {
  --ink: #fffdf9;
  --soft-ink: rgba(255, 253, 249, 0.94);
  --accent: #dce9d3;
  --brand: #0876ed;
  position: fixed;
  inset: 0;
  z-index: 9999;
  isolation: isolate;
  width: 100%;
  height: 100dvh;
  min-height: 620px;
  overflow: hidden;
  color: var(--ink);
  background: #171513;
  font-family: "DM Sans", "Avenir Next", Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
#qr-scan.open { opacity: 1; visibility: visible; pointer-events: auto; }
#qr-scan *, #qr-scan *::before, #qr-scan *::after { box-sizing: border-box; }
#qr-scan [hidden] { display: none !important; }

/* ---------- camera scene ---------- */
#qr-scan .qr-camera-scene {
  position: absolute;
  z-index: -2;
  inset: -34px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 72% 19%, rgba(205, 205, 187, 0.55) 0 17%, transparent 37%),
    radial-gradient(ellipse at 51% 42%, rgba(157, 151, 127, 0.54) 0 20%, transparent 37%),
    radial-gradient(ellipse at 15% 76%, rgba(119, 73, 56, 0.42) 0 13%, transparent 28%),
    linear-gradient(146deg, #25221f 0%, #38342c 40%, #655b4e 66%, #302b28 100%);
  filter: blur(8px);
  transform: scale(1.035);
  transition: filter 220ms ease;
}
#qr-scan .scene-shadow { position: absolute; border-radius: 50%; filter: blur(11px); }
#qr-scan .scene-shadow--left {
  top: -7%; left: 4%; width: 48%; height: 36%;
  background: radial-gradient(ellipse at 54% 43%, #060808 0 31%, #111612 49%, rgba(8, 10, 9, 0) 71%);
  transform: rotate(21deg);
}
#qr-scan .scene-object {
  position: absolute; top: 8%; left: 33%; width: 48%; height: 30%;
  border-radius: 7% 10% 9% 15%;
  background: linear-gradient(119deg, rgba(59, 49, 34, 0.93), rgba(140, 126, 98, 0.78) 39%, rgba(221, 220, 200, 0.86) 76%);
  filter: blur(15px);
  transform: rotate(10deg);
}
#qr-scan .scene-table {
  position: absolute; inset: 34% -5% 9%;
  background:
    radial-gradient(ellipse at 66% 14%, rgba(234, 231, 212, 0.57), transparent 40%),
    radial-gradient(ellipse at 13% 58%, rgba(74, 57, 45, 0.25), transparent 43%),
    repeating-linear-gradient(4deg, rgba(246, 240, 219, 0.08) 0 1px, transparent 1px 5px),
    linear-gradient(171deg, rgba(188, 183, 161, 0.8), rgba(145, 137, 117, 0.64) 55%, rgba(77, 70, 61, 0.78));
  filter: blur(13px);
  transform: rotate(-2deg);
}
#qr-scan .scene-light {
  position: absolute; top: 31%; left: -10%; width: 33%; height: 42%;
  border-radius: 40%; background: rgba(131, 74, 54, 0.8);
  filter: blur(24px); transform: rotate(-8deg);
}
#qr-scan .scene-vignette {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.46), transparent 23%, transparent 65%, rgba(8, 7, 7, 0.76)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.36), transparent 22%, transparent 76%, rgba(0, 0, 0, 0.38)),
    rgba(10, 10, 9, 0.31);
}
#qr-scan.flash .qr-camera-scene { filter: blur(6px) brightness(1.42); }
#qr-scan.flash .frame-empty-state { filter: brightness(1.24); }

/* ---------- header ---------- */
#qr-scan .qr-header {
  position: absolute; top: max(20px, env(safe-area-inset-top)); left: 0; right: 0;
  height: 44px; display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; padding: 0 26px;
}
#qr-scan .qr-header h1 {
  margin: 0; font-size: 21px; line-height: 1; font-weight: 600; letter-spacing: -0.5px;
}
#qr-scan .back-button {
  display: flex; align-items: center; justify-self: start;
  width: 38px; height: 42px; padding: 0; color: var(--ink);
  border: 0; background: none; cursor: pointer;
}
#qr-scan .back-button:focus-visible,
#qr-scan .scanner-action:focus-visible,
#qr-scan .pay-btn:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
#qr-scan .header-balance { justify-self: end; width: 38px; }

/* ---------- frame ---------- */
#qr-scan .scanner-content {
  position: absolute; top: clamp(112px, 14.4vh, 148px); left: 0; width: 100%;
  display: flex; align-items: center; flex-direction: column;
}
#qr-scan .qr-frame {
  position: relative; display: grid; place-items: center;
  width: min(78vw, 394px); aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.17);
  background: rgba(251, 249, 235, 0.035);
  box-shadow: 0 0 0 999px rgba(5, 5, 5, 0.13);
}
#qr-scan .frame-empty-state {
  position: absolute; inset: 0;
  background:
    linear-gradient(rgba(18, 18, 16, 0.15), rgba(18, 18, 16, 0.15)),
    url("./qr-camera-feed.jpg") center / cover;
  transition: filter 220ms ease;
}
#qr-scan.camera-on .frame-empty-state { display: none; }
#qr-scan .camera-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: none; background: #000;
}
#qr-scan.camera-on .camera-video { display: block; }

#qr-scan .qr-corner {
  position: absolute; z-index: 2; width: 18px; height: 18px;
  border-color: #fff; border-style: solid;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}
#qr-scan .qr-corner--tl { top: -1px; left: -1px; border-width: 4px 0 0 4px; }
#qr-scan .qr-corner--tr { top: -1px; right: -1px; border-width: 4px 4px 0 0; }
#qr-scan .qr-corner--bl { bottom: -1px; left: -1px; border-width: 0 0 4px 4px; }
#qr-scan .qr-corner--br { bottom: -1px; right: -1px; border-width: 0 4px 4px 0; }

#qr-scan .selected-image {
  position: absolute; inset: 0; display: grid; place-items: center;
  overflow: hidden; background: rgba(10, 10, 10, 0.7); z-index: 1;
}
#qr-scan .selected-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
#qr-scan .selected-image-label {
  position: absolute; right: 10px; bottom: 10px; padding: 6px 9px;
  color: #fff; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 6px;
  background: rgba(10, 10, 10, 0.72); font-size: 11px;
}

/* ---------- copy + actions ---------- */
#qr-scan .scanner-instruction {
  margin: 50px 16px 0; color: var(--soft-ink);
  font-size: 18px; line-height: 1.25; font-weight: 400; text-align: center;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.34);
}
#qr-scan .scan-laser {
  position: absolute;
  left: 6px;
  right: 6px;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #0877ef 20%, #60a5fa 50%, #0877ef 80%, transparent 100%);
  box-shadow: 0 0 12px 3px rgba(8, 119, 239, 0.7);
  border-radius: 2px;
  z-index: 3;
  pointer-events: none;
  animation: scanLaserAnim 2.2s ease-in-out infinite alternate;
}
@keyframes scanLaserAnim {
  0% { top: 6%; opacity: 0.3; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { top: 92%; opacity: 0.3; }
}

#qr-scan .camera-hint {
  margin: 10px 16px 0; font-size: 12px; color: rgba(255, 253, 249, 0.62);
  text-align: center;
}
#qr-scan .scanner-actions { display: flex; justify-content: center; gap: 10px; margin-top: 36px; flex-wrap: wrap; }
#qr-scan .scanner-action {
  position: relative; display: inline-flex; justify-content: center; align-items: center;
  gap: 7px; min-width: 96px; height: 44px; padding: 0 14px;
  color: var(--ink); border: 1.4px solid rgba(255, 255, 255, 0.96); border-radius: 9px;
  background: rgba(12, 12, 11, 0.19); font: inherit; font-size: 14.5px; line-height: 1;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}
#qr-scan .scanner-action:hover { background: rgba(255, 255, 255, 0.12); }
#qr-scan .scanner-action:active { transform: scale(0.98); }
#qr-scan .scanner-action.active {
  background: rgba(233, 239, 221, 0.22);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(233, 239, 221, 0.13);
}
#qr-scan .flash-state {
  position: absolute; top: -7px; right: 7px; padding: 2px 5px;
  color: #22281e; border-radius: 5px; background: #e4edd8;
  font-size: 9px; font-weight: 700; letter-spacing: 0.3px;
}
#qr-scan .flash-state:empty { display: none; }
#qr-scan .file-input {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
#qr-scan .selected-file {
  display: flex; align-items: center; gap: 8px;
  max-width: min(84vw, 350px); margin: 12px 0 0; padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 20px;
  background: rgba(12, 12, 11, 0.58); color: rgba(255, 255, 255, 0.94); font-size: 12px;
}
#qr-scan .file-indicator { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: #dce9d3; }
#qr-scan .selected-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- toast ---------- */
#qr-scan .scan-toast {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0.96);
  max-width: 80vw; padding: 12px 18px; border-radius: 12px;
  background: rgba(12, 12, 11, 0.86); border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 14px; text-align: center; opacity: 0; pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease; z-index: 20;
}
#qr-scan .scan-toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ---------- footer ---------- */
#qr-scan .payment-support {
  position: absolute; left: 0; right: 0;
  bottom: calc(max(65px, env(safe-area-inset-bottom) + 52px));
  display: flex; align-items: center; flex-direction: column;
}
#qr-scan .payment-support p {
  margin: 0 0 12px; color: rgba(255, 255, 255, 0.9);
  font-size: 17px; line-height: 1.25; font-weight: 400;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.32);
}
#qr-scan .provider-marks { display: flex; align-items: center; justify-content: center; }
#qr-scan .provider-logo-image { display: block; width: min(68vw, 210px); height: auto; object-fit: contain; }

#qr-scan .system-home-indicator {
  position: absolute; right: 0; bottom: max(8px, env(safe-area-inset-bottom)); left: 0;
  display: flex; justify-content: center;
}
#qr-scan .system-home-indicator span {
  width: 138px; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.93);
}

/* ============================================================
   Payment sheet
   ============================================================ */
#qr-pay {
  position: absolute; inset: 0; z-index: 30;
  display: flex; flex-direction: column; justify-content: flex-end;
  visibility: hidden; pointer-events: none;
  font-family: "DM Sans", "Avenir Next", Inter, system-ui, sans-serif;
}
#qr-pay.show { visibility: visible; pointer-events: auto; }
#qr-pay .pay-backdrop {
  position: absolute; inset: 0; background: rgba(6, 8, 10, 0.5);
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
  opacity: 0; transition: opacity 0.25s ease;
}
#qr-pay.show .pay-backdrop { opacity: 1; }
#qr-pay .pay-sheet {
  position: relative; background: #fff; color: #10161d;
  border-radius: 24px 24px 0 0; padding: 10px 22px calc(22px + env(safe-area-inset-bottom));
  transform: translateY(104%); transition: transform 0.32s cubic-bezier(0.2, 0.85, 0.25, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.28);
}
#qr-pay.show .pay-sheet { transform: none; }
#qr-pay .pay-handle {
  width: 42px; height: 4px; border-radius: 999px; background: #d9dee5; margin: 2px auto 14px;
}
#qr-pay .pay-head { display: flex; align-items: center; justify-content: space-between; }
#qr-pay .pay-label { font-size: 13px; color: #6b7684; letter-spacing: 0.2px; }
#qr-pay .pay-close {
  width: 30px; height: 30px; border: 0; border-radius: 50%; background: #f1f4f8;
  color: #5b6675; font-size: 18px; line-height: 1; cursor: pointer;
}
#qr-pay .pay-merchant { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
#qr-pay .pay-avatar {
  width: 46px; height: 46px; border-radius: 14px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #e8f0ff, #d7e6ff); color: #0b62c4;
  font-size: 15px; font-weight: 700; letter-spacing: 0.4px;
}
#qr-pay .pay-name {
  margin: 0; font-size: 17px; font-weight: 600; line-height: 1.2;
  max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#qr-pay .pay-sub { margin: 3px 0 0; font-size: 12.5px; color: #77828f; }

#qr-pay .pay-amount-box { margin: 22px 0 4px; text-align: center; }
#qr-pay .pay-amount-line {
  display: inline-flex; align-items: baseline; gap: 6px; justify-content: center;
}
#qr-pay .pay-cur { font-size: 24px; font-weight: 500; color: #35404d; }
#qr-pay .pay-amount {
  width: auto; max-width: 62vw; border: 0; outline: 0; background: transparent;
  font-family: inherit; font-size: 40px; font-weight: 700; letter-spacing: -1px;
  color: #10161d; text-align: center;
}
#qr-pay .pay-amount::placeholder { color: #c3cad4; }
#qr-pay .pay-amount-hint { margin: 2px 0 0; font-size: 12px; color: #8b95a1; text-align: center; }

#qr-pay .pay-meta {
  margin: 18px 0 0; padding: 14px 0 0; border-top: 1px solid #eef1f5;
  display: flex; flex-direction: column; gap: 10px;
}
#qr-pay .pay-meta > div { display: flex; justify-content: space-between; font-size: 13.5px; }
#qr-pay .pay-meta span:first-child { color: #77828f; }
#qr-pay .pay-meta span:last-child { color: #10161d; font-weight: 500; }

#qr-pay .pay-btn {
  width: 100%; height: 52px; margin-top: 20px; border: 0; border-radius: 14px;
  background: var(--brand, #0876ed); color: #fff; font-family: inherit;
  font-size: 16px; font-weight: 600; cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
#qr-pay .pay-btn:active { transform: scale(0.985); }
#qr-pay .pay-btn[disabled] { opacity: 0.45; cursor: not-allowed; }
#qr-pay .pay-note { margin: 12px 0 0; font-size: 11.5px; color: #9aa4b0; text-align: center; }

#qr-pay .pay-status {
  margin: 14px 0 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;
}
#qr-pay .pay-status::before {
  content: ""; flex: 0 0 auto; width: 12px; height: 12px; margin-top: 2px;
  border: 2px solid #0876ed; border-radius: 50%; border-right-color: transparent;
  animation: mb-spin 0.9s linear infinite;
}
#qr-pay .pay-status[data-tone="error"] { background: #fdf1f1; color: #a3262b; }
#qr-pay .pay-status[data-tone="error"]::before { border-color: #a3262b; animation: none; }
#qr-pay .pay-status[hidden] { display: none; }
@keyframes mb-spin { to { transform: rotate(360deg); } }

/* success state */
#qr-pay .pay-success {
  position: absolute; inset: 0; background: #fff; color: #10161d;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 30px 26px calc(26px + env(safe-area-inset-bottom));
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
#qr-pay.done .pay-success { opacity: 1; pointer-events: auto; }
#qr-pay.done .pay-sheet { transform: translateY(104%); }
#qr-pay .success-badge {
  width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center;
  background: #e7f7ee; color: #12a150;
  animation: pop 0.35s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#qr-pay .pay-success h2 { margin: 20px 0 0; font-size: 21px; font-weight: 600; }
#qr-pay .success-amount { margin: 10px 0 0; font-size: 34px; font-weight: 700; letter-spacing: -0.8px; }
#qr-pay .success-to { margin: 6px 0 0; font-size: 14px; color: #6b7684; }
#qr-pay .success-rows {
  width: 100%; max-width: 340px; margin: 26px 0 0; padding: 14px 0 0;
  border-top: 1px solid #eef1f5; display: flex; flex-direction: column; gap: 10px;
}
#qr-pay .success-rows > div { display: flex; justify-content: space-between; font-size: 13.5px; }
#qr-pay .success-rows span:first-child { color: #77828f; }
#qr-pay .success-rows span:last-child { color: #10161d; font-weight: 500; }
#qr-pay .pay-success .pay-btn { max-width: 340px; margin-top: 30px; }

/* ---------- responsive ---------- */
@media (max-height: 740px) {
  #qr-scan { min-height: 560px; }
  #qr-scan .scanner-content { top: 104px; }
  #qr-scan .qr-frame { width: min(70vw, 290px); }
  #qr-scan .scanner-instruction { margin-top: 26px; font-size: 18px; }
  #qr-scan .scanner-actions { margin-top: 24px; }
  #qr-scan .payment-support { bottom: calc(max(52px, env(safe-area-inset-bottom) + 42px)); }
  #qr-scan .payment-support p { margin-bottom: 10px; font-size: 17px; }
}
@media (max-width: 360px) {
  #qr-scan .qr-frame { width: min(78vw, 300px); }
  #qr-scan .scanner-actions { gap: 10px; }
  #qr-scan .scanner-action { min-width: 132px; padding: 0 13px; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  #qr-scan, #qr-scan .qr-camera-scene, #qr-scan .frame-empty-state,
  #qr-scan .scanner-action, #qr-pay .pay-sheet, #qr-pay .pay-backdrop {
    transition: none;
  }
}

/* ---------- scan-to-pay header + gallery / my QR ---------- */
#qr-scan .header-icon {
  justify-self: end; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 42px; padding: 0; color: var(--ink);
  border: 0; background: none; cursor: pointer; position: relative;
  transition: color 160ms ease, transform 160ms ease;
}
#qr-scan .header-icon.active { color: #ffd76a; }
#qr-scan .header-icon:active { transform: scale(0.94); }

#qr-scan .scanner-action--icon {
  flex-direction: column; gap: 5px; min-width: 104px; height: 62px; padding: 0 16px;
  font-size: 13px; line-height: 1;
}
#qr-scan .scanner-action--icon svg { opacity: 0.95; }

/* ---------- my QR code sheet ---------- */
.myqr {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; flex-direction: column;
  background: #f4f6fa; opacity: 0; pointer-events: none;
  transition: opacity 200ms ease;
  font-family: inherit;
}
.myqr.open { opacity: 1; pointer-events: auto; }
.myqr-header {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 10px; color: #fff;
  background: linear-gradient(180deg, #0b74f0 0%, #0a6ceb 100%);
}
.myqr-icon-btn {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: #fff; cursor: pointer; border-radius: 10px; padding: 0;
}
.myqr-icon-btn svg { width: 22px; height: 22px; }
.myqr-title {
  margin: 0; font-size: 19px; font-weight: 700; letter-spacing: 0.2px; color: #fff;
}
.myqr-body {
  width: min(100%, 440px); margin: 0 auto; padding: 18px 16px calc(30px + env(safe-area-inset-bottom));
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.myqr-label {
  margin: 0 0 12px; color: #1a1a1a; font-size: 15px; font-weight: 600;
}
.myqr-accounts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.myqr-accounts.single { grid-template-columns: 1fr; }
.myqr-acct {
  position: relative; background: #fff; border: 1.5px solid #dde3ee; border-radius: 16px;
  padding: 12px 14px; cursor: pointer; text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.myqr-acct.active { border-color: #0a66e8; box-shadow: 0 0 0 3px rgba(10,102,232,0.12); }
.myqr-acct-cur { display: block; font-size: 18px; font-weight: 800; color: #0a1936; }
.myqr-acct-num { display: block; margin-top: 2px; font-size: 13px; color: #6b7689; }
.myqr-acct-star { position: absolute; top: 10px; right: 12px; width: 20px; height: 20px; color: #f5b400; }
.myqr-acct-badge {
  position: absolute; top: 8px; right: 34px; font-size: 10px; font-weight: 700; color: #159447;
  background: #e5f6ec; border-radius: 6px; padding: 2px 6px;
}
.myqr-khqr-card {
  background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 6px 22px rgba(25,42,70,0.08);
}
.myqr-khqr-band {
  position: relative; height: 62px; background: #e01b24;
  display: flex; align-items: center; justify-content: center;
}
.myqr-khqr-band::after {
  content: ""; position: absolute; right: 0; bottom: -16px; width: 40px; height: 40px;
  background: #e01b24; clip-path: polygon(0 0, 100% 100%, 100% 0);
}
.myqr-khqr-wordmark { color: #fff; font-size: 28px; font-weight: 800; letter-spacing: 1px; }
.myqr-khqr-wordmark em { font-style: normal; color: rgba(255,255,255,0.95); }
.myqr-name { margin: 18px 0 2px; text-align: center; font-size: 19px; font-weight: 700; color: #0a1936; }
.myqr-amount { margin: 0; text-align: center; font-size: 28px; font-weight: 800; color: #0a1936; }
.myqr-dashed {
  margin: 18px 22px 0; border-top: 2px dashed #c9d0dc;
}
.myqr-box {
  position: relative; display: grid; place-items: center;
  padding: 18px 18px 22px;
}
.myqr-box img { width: 210px; height: 210px; display: none; }
.myqr-box img[data-ready="1"] { display: block; }
.myqr-loading { margin: 0; font-size: 13px; color: #7a88a6; }
.myqr-box img[data-ready="1"] ~ .myqr-loading { display: none; }
.myqr-center-logo {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 42px; height: 42px; border-radius: 50%; background: #fff; padding: 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.myqr-center-logo svg { display: block; width: 100%; height: 100%; }
.myqr-set-amount {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 54px; margin-top: 18px; border: 0; border-radius: 16px;
  background: #0a66e8; color: #fff; font: inherit; font-size: 17px; font-weight: 700; cursor: pointer;
}
.myqr-set-amount svg { width: 20px; height: 20px; }
.myqr-actions { display: flex; justify-content: center; gap: 18px; margin-top: 18px; }
.myqr-action {
  width: 58px; height: 58px; border: 0; border-radius: 16px; background: #fff;
  color: #4a5568; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(25,42,70,0.08);
}
.myqr-action svg { width: 24px; height: 24px; }
.myqr-status { margin: 12px 0 0; text-align: center; min-height: 16px; font-size: 12.5px; color: #c2413a; }
.myqr-status[data-kind="note"] { color: #6b7689; }

/* set amount sheet */
.myqr-amount-sheet {
  position: fixed; inset: 0; z-index: 10001; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(6,12,26,0.5); opacity: 0; pointer-events: none; transition: opacity 180ms ease;
}
.myqr-amount-sheet.open { opacity: 1; pointer-events: auto; }
.myqr-amount-card {
  width: min(100%, 440px); background: #fff; border-radius: 22px 22px 0 0; padding: 18px 18px 24px;
  transform: translateY(16px); transition: transform 220ms ease;
}
.myqr-amount-sheet.open .myqr-amount-card { transform: translateY(0); }
.myqr-amount-title { margin: 0 0 14px; font-size: 18px; font-weight: 700; color: #0a1936; text-align: center; }
.myqr-amount-input {
  width: 100%; height: 54px; border: 1.5px solid #dde3ee; border-radius: 14px;
  font-size: 22px; font-weight: 700; text-align: center; color: #0a1936; outline: none;
}
.myqr-amount-input:focus { border-color: #0a66e8; }
.myqr-amount-row { display: flex; gap: 10px; margin-top: 14px; }
.myqr-amount-btn {
  flex: 1; height: 50px; border: 0; border-radius: 14px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.myqr-amount-btn.cancel { background: #eef1f6; color: #4a5568; }
.myqr-amount-btn.confirm { background: #0a66e8; color: #fff; }
