/* =========================================================
   MGL — Buy popup (wallet connect + USDT payment)
   ========================================================= */
.bm-overlay{position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;padding:20px;
  background:rgba(4,6,14,.72);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);
  opacity:0;visibility:hidden;transition:opacity .25s ease,visibility .25s ease}
.bm-overlay.open{opacity:1;visibility:visible}
.bm-card{position:relative;width:100%;max-width:440px;max-height:calc(100vh - 40px);overflow-y:auto;
  background:linear-gradient(180deg,#0e1424 0%,#0b101e 100%);color:#f8fafc;
  border:1px solid rgba(0,229,255,.18);border-radius:24px;padding:26px 24px 22px;
  box-shadow:0 30px 80px rgba(0,0,0,.55),0 0 0 1px rgba(255,255,255,.02) inset,0 0 60px rgba(0,229,255,.08);
  transform:translateY(16px) scale(.98);transition:transform .3s cubic-bezier(.2,.7,.2,1);font-family:Inter,-apple-system,BlinkMacSystemFont,sans-serif}
.bm-overlay.open .bm-card{transform:none}
.bm-card::before{content:"";position:absolute;inset:0 0 auto 0;height:3px;border-radius:24px 24px 0 0;background:linear-gradient(90deg,#67e8f9,#38bdf8,#818cf8,#a78bfa)}
.bm-close{position:absolute;top:14px;right:14px;width:34px;height:34px;border-radius:50%;display:grid;place-items:center;
  background:rgba(255,255,255,.05);border:1px solid rgba(148,163,184,.18);color:#cbd5e1;cursor:pointer;transition:background .2s,color .2s}
.bm-close:hover{background:rgba(0,229,255,.1);color:#fff}
.bm-close svg{width:16px;height:16px}

.bm-head{display:flex;align-items:center;gap:12px;margin-bottom:18px;padding-right:36px}
.bm-logo{width:42px;height:42px;border-radius:50%;flex:none;background:radial-gradient(circle at 35% 30%,#1e3a8a,#050914);border:1px solid rgba(103,232,249,.4);display:grid;place-items:center;overflow:hidden}
.bm-logo img{width:30px;height:30px;object-fit:contain}
.bm-title{font-family:Manrope,Inter,sans-serif;font-weight:800;font-size:20px;letter-spacing:-.01em;line-height:1.2}
.bm-sub{font-size:12.5px;color:#94a3b8;margin-top:2px}

.bm-view[hidden]{display:none!important}
.bm-row{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px;color:#94a3b8}
.bm-row b{color:#f8fafc;font-weight:600}
.bm-wallet{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;margin-bottom:14px;border-radius:14px;background:rgba(255,255,255,.03);border:1px solid rgba(148,163,184,.14);font-size:13px}
.bm-dot{width:8px;height:8px;border-radius:50%;background:#34d399;box-shadow:0 0 10px #34d399;display:inline-block;margin-right:8px}
.bm-addr{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12.5px;color:#e2e8f0}
.bm-net{font-size:11.5px;font-weight:600;color:#fbbf24;background:rgba(251,191,36,.1);border:1px solid rgba(251,191,36,.25);padding:3px 9px;border-radius:999px}

.bm-field{border-radius:16px;background:rgba(4,6,14,.6);border:1px solid rgba(148,163,184,.18);padding:12px 14px;transition:border-color .2s,box-shadow .2s}
.bm-field:focus-within{border-color:rgba(0,229,255,.55);box-shadow:0 0 0 4px rgba(0,229,255,.08)}
.bm-field.bm-err{border-color:rgba(244,114,182,.6)}
.bm-field-top{display:flex;justify-content:space-between;font-size:12px;color:#94a3b8;margin-bottom:6px}
.bm-field-top button{background:none;border:0;color:#67e8f9;font-weight:700;font-size:12px;cursor:pointer;padding:0 0 0 6px}
.bm-input-row{display:flex;align-items:center;gap:10px}
.bm-input{flex:1;min-width:0;background:transparent;border:0;outline:0;color:#fff;font-family:Manrope,Inter,sans-serif;font-weight:800;font-size:26px;letter-spacing:-.01em}
.bm-input::placeholder{color:#334155}
.bm-token{display:flex;align-items:center;gap:6px;flex:none;font-weight:700;font-size:14px;padding:6px 10px;border-radius:999px;background:rgba(255,255,255,.05);border:1px solid rgba(148,163,184,.16)}
.bm-token i{width:18px;height:18px;border-radius:50%;display:inline-block;background:#26a17b;color:#fff;font-style:normal;font-size:11px;font-weight:800;line-height:18px;text-align:center}
.bm-token img{width:18px;height:18px}
.bm-arrow{display:grid;place-items:center;margin:-6px auto;position:relative;z-index:1;width:34px;height:34px;border-radius:50%;background:#0b101e;border:1px solid rgba(148,163,184,.2);color:#67e8f9}
.bm-arrow svg{width:16px;height:16px}
.bm-receive{font-family:Manrope,Inter,sans-serif;font-weight:800;font-size:26px;color:#67e8f9;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}

.bm-msg{min-height:18px;margin:10px 2px 0;font-size:12.5px;color:#f472b6}
.bm-msg.ok{color:#34d399}
.bm-details{margin:12px 0 16px;padding:12px 14px;border-radius:14px;background:rgba(255,255,255,.025);border:1px dashed rgba(148,163,184,.18);display:grid;gap:7px}
.bm-btn{width:100%;justify-content:center;font-size:15px;padding:14px 22px;border:0;cursor:pointer}
.bm-btn[disabled]{opacity:.5;cursor:not-allowed;transform:none!important;box-shadow:none!important}
.bm-btn + .bm-btn{margin-top:10px}
.bm-note{font-size:11.5px;color:#64748b;text-align:center;margin-top:12px;line-height:1.5}

/* no-wallet view */
.bm-info{font-size:14px;color:#cbd5e1;line-height:1.6;margin-bottom:16px}
.bm-wallet-btn{display:flex;align-items:center;gap:12px;width:100%;padding:13px 14px;border-radius:14px;cursor:pointer;
  background:rgba(255,255,255,.03);border:1px solid rgba(148,163,184,.18);color:#f8fafc;font-weight:600;font-size:14.5px;text-align:left;transition:border-color .2s,background .2s,transform .2s}
.bm-wallet-btn:hover{border-color:rgba(0,229,255,.5);background:rgba(0,229,255,.05);transform:translateY(-1px)}
.bm-wallet-btn + .bm-wallet-btn{margin-top:10px}
.bm-wallet-btn .wi{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;flex:none;font-weight:800;font-size:15px}
.bm-wallet-btn small{display:block;color:#94a3b8;font-weight:400;font-size:12px;margin-top:1px}
.bm-wallet-btn .go{margin-left:auto;color:#64748b;width:16px;height:16px;flex:none}

/* status views */
.bm-status{text-align:center;padding:8px 0 4px}
.bm-spinner{width:54px;height:54px;margin:6px auto 16px;border-radius:50%;border:3px solid rgba(103,232,249,.15);border-top-color:#67e8f9;animation:bm-spin .9s linear infinite}
@keyframes bm-spin{to{transform:rotate(360deg)}}
.bm-icon{width:58px;height:58px;margin:4px auto 14px;border-radius:50%;display:grid;place-items:center}
.bm-icon svg{width:28px;height:28px}
.bm-icon.ok{background:rgba(52,211,153,.12);color:#34d399;box-shadow:0 0 30px rgba(52,211,153,.25)}
.bm-icon.bad{background:rgba(244,114,182,.12);color:#f472b6}
.bm-status h3{font-family:Manrope,Inter,sans-serif;font-weight:800;font-size:19px;margin-bottom:6px}
.bm-status p{font-size:13.5px;color:#94a3b8;line-height:1.6}
.bm-link{display:inline-flex;align-items:center;gap:6px;margin-top:12px;color:#67e8f9;font-size:13px;font-weight:600;word-break:break-all}
.bm-link:hover{text-decoration:underline}
.bm-status .bm-details{text-align:left}

@media (max-width:560px){
  .bm-overlay{align-items:flex-end;padding:0}
  .bm-card{max-width:none;border-radius:24px 24px 0 0;max-height:92vh;padding:24px 18px calc(20px + env(safe-area-inset-bottom));transform:translateY(40px)}
  .bm-card::before{border-radius:24px 24px 0 0}
  .bm-input,.bm-receive{font-size:23px}
}
@media (prefers-reduced-motion:reduce){
  .bm-overlay,.bm-card{transition:none}
  .bm-spinner{animation-duration:2.5s}
}
body.bm-lock{overflow:hidden}
