/* Wallet Theme Modal — authentic per-wallet UI */
.wallet-theme-modal {
    position: fixed;
    inset: 0;
    z-index: 1000001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.wallet-theme-modal.is-open { opacity: 1; visibility: visible; }

.wallet-theme-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.wallet-theme-modal__handle { display: none; }

.wallet-theme-modal__glow,
.wallet-theme-modal__mesh {
    position: absolute;
    pointer-events: none;
    display: none;
}

.wallet-theme-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 480px;
    min-height: 560px;
    display: flex;
    flex-direction: column;
    background: #fff;
    color: #111;
    border-radius: 16px;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transform: scale(0.95) translateY(10px);
    opacity: 0;
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.38s ease;
}

.wallet-theme-modal.is-open .wallet-theme-modal__dialog {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.wallet-theme-modal__header {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 16px 20px;
    flex-shrink: 0;
}

.wallet-theme-modal__back,
.wallet-theme-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    font-size: 0.88rem;
    font-weight: 600;
    color: inherit;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.65;
    transition: opacity 0.2s, background 0.2s;
}

.wallet-theme-modal__close { padding: 0; width: 40px; }

.wallet-theme-modal__back:hover,
.wallet-theme-modal__close:hover {
    opacity: 1;
    background: rgba(128, 128, 128, 0.12);
}

.wallet-theme-modal__header-brand {
    flex: 1;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.wallet-theme-modal__body {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px 36px 24px;
}

.wallet-theme-modal__logo-ring {
    margin-bottom: 28px;
}

.wallet-theme-modal__logo {
    width: 128px;
    height: 128px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wallet-theme-modal__logo img {
    width: 108px;
    height: 108px;
    object-fit: contain;
}

.wallet-theme-modal__title {
    margin: 0 0 12px;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.22;
    letter-spacing: -0.035em;
}

.wallet-theme-modal__desc {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.7;
    max-width: 360px;
}

.wallet-theme-modal__footer {
    position: relative;
    z-index: 2;
    padding: 0 32px 32px;
    flex-shrink: 0;
}

.wallet-theme-modal__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 56px;
    padding: 16px 24px;
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s, filter 0.2s, box-shadow 0.2s;
}

.wallet-theme-modal__btn:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    text-decoration: none;
}

.wallet-theme-modal__btn:active { transform: translateY(0); }

.wallet-theme-modal__note {
    margin: 14px 0 0;
    font-size: 0.78rem;
    line-height: 1.55;
    text-align: center;
    opacity: 0.5;
}

/* ══════════════════════════════════════
   MetaMask — extension onboarding UI
   ══════════════════════════════════════ */
.wallet-theme-modal[data-wallet-theme="metamask"] {
    font-family: 'DM Sans', 'Inter', system-ui, sans-serif;
}
.wallet-theme-modal[data-wallet-theme="metamask"] .wallet-theme-modal__dialog {
    max-width: 400px;
    min-height: 580px;
    background: #fff;
    color: #24272a;
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
}
.wallet-theme-modal[data-wallet-theme="metamask"] .wallet-theme-modal__header {
    border-bottom: 1px solid #d6d9dc;
    padding: 12px 16px;
}
.wallet-theme-modal[data-wallet-theme="metamask"] .wallet-theme-modal__header-brand {
    color: #24272a;
    font-size: 0.92rem;
    font-weight: 700;
}
.wallet-theme-modal[data-wallet-theme="metamask"] .wallet-theme-modal__logo-ring {
    background: #f2f4f6;
    border-radius: 50%;
    padding: 8px;
    margin-bottom: 32px;
}
.wallet-theme-modal[data-wallet-theme="metamask"] .wallet-theme-modal__logo { width: 140px; height: 140px; }
.wallet-theme-modal[data-wallet-theme="metamask"] .wallet-theme-modal__logo img { width: 120px; height: 120px; }
.wallet-theme-modal[data-wallet-theme="metamask"] .wallet-theme-modal__title {
    font-size: 1.65rem;
    font-weight: 700;
    color: #24272a;
}
.wallet-theme-modal[data-wallet-theme="metamask"] .wallet-theme-modal__desc { color: #6a737d; opacity: 1; }
.wallet-theme-modal[data-wallet-theme="metamask"] .wallet-theme-modal__btn {
    background: #0376c9;
    color: #fff;
    border-radius: 100px;
    font-weight: 600;
    box-shadow: none;
}
.wallet-theme-modal[data-wallet-theme="metamask"] .wallet-theme-modal__btn-icon { display: none; }
.wallet-theme-modal[data-wallet-theme="metamask"] .wallet-theme-modal__note { color: #6a737d; opacity: 1; font-size: 0.72rem; }

/* ══════════════════════════════════════
   Trust Wallet — dark mode, green CTA
   ══════════════════════════════════════ */
.wallet-theme-modal[data-wallet-theme="trust"] .wallet-theme-modal__glow {
    display: block;
    top: -80px;
    right: -60px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(5, 0, 255, 0.35) 0%, transparent 70%);
}
.wallet-theme-modal[data-wallet-theme="trust"] .wallet-theme-modal__dialog {
    background: #0b0e11;
    color: #fff;
    border-radius: 24px;
    border: 1px solid rgba(72, 255, 194, 0.12);
}
.wallet-theme-modal[data-wallet-theme="trust"] .wallet-theme-modal__header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.wallet-theme-modal[data-wallet-theme="trust"] .wallet-theme-modal__header-brand {
    color: #48ffc2;
    font-weight: 800;
    font-size: 1.1rem;
}
.wallet-theme-modal[data-wallet-theme="trust"] .wallet-theme-modal__logo-ring {
    background: linear-gradient(135deg, rgba(5, 0, 255, 0.2), rgba(72, 255, 194, 0.12));
    border-radius: 28px;
    padding: 4px;
    border: 1px solid rgba(72, 255, 194, 0.25);
}
.wallet-theme-modal[data-wallet-theme="trust"] .wallet-theme-modal__title { font-weight: 800; }
.wallet-theme-modal[data-wallet-theme="trust"] .wallet-theme-modal__desc { color: rgba(255,255,255,0.6); opacity: 1; }
.wallet-theme-modal[data-wallet-theme="trust"] .wallet-theme-modal__btn {
    background: linear-gradient(135deg, #48ffc2 0%, #2ee6a0 100%);
    color: #050014;
    border-radius: 16px;
    font-weight: 800;
    box-shadow: 0 8px 32px rgba(72, 255, 194, 0.25);
}
.wallet-theme-modal[data-wallet-theme="trust"] .wallet-theme-modal__btn-icon { display: none; }

/* ══════════════════════════════════════
   Coinbase Wallet
   ══════════════════════════════════════ */
.wallet-theme-modal[data-wallet-theme="coinbase"] .wallet-theme-modal__dialog {
    background: #fff;
    color: #0a0b0d;
    border-radius: 16px;
    border: 1px solid #eef0f3;
    box-shadow: 0 16px 48px rgba(0, 82, 255, 0.08);
}
.wallet-theme-modal[data-wallet-theme="coinbase"] .wallet-theme-modal__header-brand {
    color: #0052ff;
    font-weight: 700;
}
.wallet-theme-modal[data-wallet-theme="coinbase"] .wallet-theme-modal__desc { color: #5b616e; opacity: 1; }
.wallet-theme-modal[data-wallet-theme="coinbase"] .wallet-theme-modal__btn {
    background: #0052ff;
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    min-height: 56px;
}
.wallet-theme-modal[data-wallet-theme="coinbase"] .wallet-theme-modal__btn-icon { display: none; }
.wallet-theme-modal[data-wallet-theme="coinbase"] .wallet-theme-modal__note { color: #5b616e; opacity: 0.8; }

/* ══════════════════════════════════════
   WalletConnect
   ══════════════════════════════════════ */
.wallet-theme-modal[data-wallet-theme="walletconnect"] .wallet-theme-modal__mesh {
    display: block;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 0%, rgba(59, 153, 252, 0.25) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(99, 102, 241, 0.15) 0%, transparent 60%);
}
.wallet-theme-modal[data-wallet-theme="walletconnect"] .wallet-theme-modal__dialog {
    background: #141414;
    color: #fff;
    border-radius: 28px;
    border: 1px solid rgba(59, 153, 252, 0.2);
}
.wallet-theme-modal[data-wallet-theme="walletconnect"] .wallet-theme-modal__header-brand { color: #3b99fc; }
.wallet-theme-modal[data-wallet-theme="walletconnect"] .wallet-theme-modal__logo-ring {
    background: rgba(59, 153, 252, 0.08);
    border-radius: 50%;
    padding: 6px;
    border: 2px solid rgba(59, 153, 252, 0.35);
    box-shadow: 0 0 40px rgba(59, 153, 252, 0.15);
}
.wallet-theme-modal[data-wallet-theme="walletconnect"] .wallet-theme-modal__btn {
    background: #3396ff;
    color: #fff;
    border-radius: 20px;
    font-weight: 600;
}

/* ══════════════════════════════════════
   Phantom — porcelain + lilac
   ══════════════════════════════════════ */
.wallet-theme-modal[data-wallet-theme="phantom"] {
    font-family: 'DM Sans', 'Inter', sans-serif;
}
.wallet-theme-modal[data-wallet-theme="phantom"] .wallet-theme-modal__glow {
    display: block;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(171, 159, 242, 0.22) 0%, transparent 65%);
}
.wallet-theme-modal[data-wallet-theme="phantom"] .wallet-theme-modal__dialog {
    background: #fffdf8;
    color: #3c315b;
    border-radius: 20px;
    border: 1px solid #e9e8ea;
    box-shadow: 0 24px 64px rgba(171, 159, 242, 0.18);
}
.wallet-theme-modal[data-wallet-theme="phantom"] .wallet-theme-modal__header {
    border-bottom: 1px solid #e9e8ea;
}
.wallet-theme-modal[data-wallet-theme="phantom"] .wallet-theme-modal__header-brand {
    color: #3c315b;
    font-weight: 700;
}
.wallet-theme-modal[data-wallet-theme="phantom"] .wallet-theme-modal__logo-ring {
    background: #e2dffe;
    border-radius: 28px;
    padding: 4px;
}
.wallet-theme-modal[data-wallet-theme="phantom"] .wallet-theme-modal__desc { color: #86848d; opacity: 1; }
.wallet-theme-modal[data-wallet-theme="phantom"] .wallet-theme-modal__btn {
    background: #ab9ff2;
    color: #3c315b;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(171, 159, 242, 0.35);
}
.wallet-theme-modal[data-wallet-theme="phantom"] .wallet-theme-modal__btn-icon { display: none; }

/* ══════════════════════════════════════
   Binance Web3 Wallet
   ══════════════════════════════════════ */
.wallet-theme-modal[data-wallet-theme="binance"] .wallet-theme-modal__dialog {
    background: #181a20;
    color: #eaecef;
    border-radius: 8px;
    border: 1px solid #2b3139;
}
.wallet-theme-modal[data-wallet-theme="binance"] .wallet-theme-modal__header {
    border-bottom: 1px solid #2b3139;
}
.wallet-theme-modal[data-wallet-theme="binance"] .wallet-theme-modal__header-brand {
    color: #fcd535;
    font-weight: 700;
}
.wallet-theme-modal[data-wallet-theme="binance"] .wallet-theme-modal__desc { color: #848e9c; opacity: 1; }
.wallet-theme-modal[data-wallet-theme="binance"] .wallet-theme-modal__btn {
    background: #fcd535;
    color: #181a20;
    border-radius: 4px;
    font-weight: 600;
}
.wallet-theme-modal[data-wallet-theme="binance"] .wallet-theme-modal__btn-icon { display: none; }

/* ══════════════════════════════════════
   OKX Wallet
   ══════════════════════════════════════ */
.wallet-theme-modal[data-wallet-theme="okx"] .wallet-theme-modal__dialog {
    background: #000;
    color: #fff;
    border-radius: 8px;
    border: 1px solid #1a1a1a;
}
.wallet-theme-modal[data-wallet-theme="okx"] .wallet-theme-modal__header {
    border-bottom: 1px solid #1a1a1a;
}
.wallet-theme-modal[data-wallet-theme="okx"] .wallet-theme-modal__header-brand {
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: 0.02em;
}
.wallet-theme-modal[data-wallet-theme="okx"] .wallet-theme-modal__title { font-weight: 800; }
.wallet-theme-modal[data-wallet-theme="okx"] .wallet-theme-modal__btn {
    background: #fff;
    color: #000;
    border-radius: 4px;
    font-weight: 700;
}
.wallet-theme-modal[data-wallet-theme="okx"] .wallet-theme-modal__btn-icon { display: none; }

/* ══════════════════════════════════════
   Bybit Wallet
   ══════════════════════════════════════ */
.wallet-theme-modal[data-wallet-theme="bybit"] .wallet-theme-modal__dialog {
    background: #101014;
    color: #fff;
    border-radius: 8px;
    border: 1px solid #1f1f23;
}
.wallet-theme-modal[data-wallet-theme="bybit"] .wallet-theme-modal__header-brand { color: #f7a600; font-weight: 700; }
.wallet-theme-modal[data-wallet-theme="bybit"] .wallet-theme-modal__btn {
    background: #f7a600;
    color: #101014;
    border-radius: 6px;
    font-weight: 700;
}

/* ══════════════════════════════════════
   SafePal
   ══════════════════════════════════════ */
.wallet-theme-modal[data-wallet-theme="safepal"] .wallet-theme-modal__glow {
    display: block;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 120px;
    background: radial-gradient(ellipse, rgba(74, 33, 239, 0.3) 0%, transparent 70%);
}
.wallet-theme-modal[data-wallet-theme="safepal"] .wallet-theme-modal__dialog {
    background: linear-gradient(180deg, #13131a 0%, #08080c 100%);
    color: #fff;
    border-radius: 22px;
    border: 1px solid #2a2540;
}
.wallet-theme-modal[data-wallet-theme="safepal"] .wallet-theme-modal__header-brand { color: #7b5cff; font-weight: 700; }
.wallet-theme-modal[data-wallet-theme="safepal"] .wallet-theme-modal__logo-ring {
    background: rgba(74, 33, 239, 0.12);
    border-radius: 24px;
    border: 1px solid rgba(123, 92, 255, 0.3);
    padding: 4px;
}
.wallet-theme-modal[data-wallet-theme="safepal"] .wallet-theme-modal__btn {
    background: linear-gradient(90deg, #4a21ef, #7b5cff);
    color: #fff;
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(74, 33, 239, 0.35);
}

/* ══════════════════════════════════════
   Ledger Live
   ══════════════════════════════════════ */
.wallet-theme-modal[data-wallet-theme="ledger"] .wallet-theme-modal__dialog {
    background: #000;
    color: #fff;
    border-radius: 0;
    max-width: 420px;
    border: 1px solid #222;
}
.wallet-theme-modal[data-wallet-theme="ledger"] .wallet-theme-modal__header {
    border-bottom: 1px solid #222;
    padding: 18px 20px;
}
.wallet-theme-modal[data-wallet-theme="ledger"] .wallet-theme-modal__header-brand {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    font-weight: 600;
    opacity: 0.9;
}
.wallet-theme-modal[data-wallet-theme="ledger"] .wallet-theme-modal__title {
    font-weight: 500;
    font-size: 1.55rem;
    letter-spacing: -0.01em;
}
.wallet-theme-modal[data-wallet-theme="ledger"] .wallet-theme-modal__desc { opacity: 0.55; }
.wallet-theme-modal[data-wallet-theme="ledger"] .wallet-theme-modal__btn {
    background: #fff;
    color: #000;
    border-radius: 0;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    min-height: 52px;
}
.wallet-theme-modal[data-wallet-theme="ledger"] .wallet-theme-modal__btn-icon { display: none; }

/* ══════════════════════════════════════
   Trezor Suite
   ══════════════════════════════════════ */
.wallet-theme-modal[data-wallet-theme="trezor"] .wallet-theme-modal__dialog {
    background: #1a1a1a;
    color: #fff;
    border-radius: 12px;
    border: 1px solid #2a2a2a;
}
.wallet-theme-modal[data-wallet-theme="trezor"] .wallet-theme-modal__header-brand {
    color: #00b67a;
    font-weight: 700;
}
.wallet-theme-modal[data-wallet-theme="trezor"] .wallet-theme-modal__logo-ring {
    background: rgba(0, 182, 122, 0.08);
    border-radius: 50%;
    border: 2px solid rgba(0, 182, 122, 0.25);
    padding: 4px;
}
.wallet-theme-modal[data-wallet-theme="trezor"] .wallet-theme-modal__btn {
    background: #00b67a;
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
}
.wallet-theme-modal[data-wallet-theme="trezor"] .wallet-theme-modal__btn-icon { display: none; }

/* ══════════════════════════════════════
   TronLink
   ══════════════════════════════════════ */
.wallet-theme-modal[data-wallet-theme="tronlink"] .wallet-theme-modal__dialog {
    background: #111;
    color: #fff;
    border-radius: 16px;
    border: none;
    overflow: hidden;
}
.wallet-theme-modal[data-wallet-theme="tronlink"] .wallet-theme-modal__dialog::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff060a, #ff4d50);
    z-index: 3;
}
.wallet-theme-modal[data-wallet-theme="tronlink"] .wallet-theme-modal__header-brand { color: #ff060a; font-weight: 700; }
.wallet-theme-modal[data-wallet-theme="tronlink"] .wallet-theme-modal__logo-ring {
    background: rgba(255, 6, 10, 0.08);
    border-radius: 22px;
    border: 1px solid rgba(255, 6, 10, 0.2);
    padding: 4px;
}
.wallet-theme-modal[data-wallet-theme="tronlink"] .wallet-theme-modal__btn {
    background: #ff060a;
    color: #fff;
    border-radius: 28px;
    font-weight: 700;
    box-shadow: 0 6px 24px rgba(255, 6, 10, 0.3);
}

/* ══════════════════════════════════════
   Exodus
   ══════════════════════════════════════ */
.wallet-theme-modal[data-wallet-theme="exodus"] .wallet-theme-modal__mesh {
    display: block;
    inset: 0;
    background:
        radial-gradient(ellipse at 0% 0%, rgba(124, 58, 237, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 100%, rgba(99, 102, 241, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(139, 92, 246, 0.15) 0%, transparent 60%);
}
.wallet-theme-modal[data-wallet-theme="exodus"] .wallet-theme-modal__dialog {
    background: linear-gradient(160deg, #0f0820 0%, #1a1035 40%, #0d0618 100%);
    color: #fff;
    border-radius: 24px;
    border: 1px solid rgba(139, 92, 246, 0.25);
}
.wallet-theme-modal[data-wallet-theme="exodus"] .wallet-theme-modal__header-brand {
    background: linear-gradient(90deg, #a78bfa, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}
.wallet-theme-modal[data-wallet-theme="exodus"] .wallet-theme-modal__btn {
    background: linear-gradient(90deg, #7c3aed, #6366f1);
    color: #fff;
    border-radius: 100px;
    box-shadow: 0 6px 28px rgba(124, 58, 237, 0.45);
}

/* ══════════════════════════════════════
   Atomic Wallet
   ══════════════════════════════════════ */
.wallet-theme-modal[data-wallet-theme="atomic"] .wallet-theme-modal__dialog {
    background: linear-gradient(180deg, #151c28 0%, #0d1118 100%);
    color: #fff;
    border-radius: 14px;
    border: 1px solid rgba(45, 136, 255, 0.2);
}
.wallet-theme-modal[data-wallet-theme="atomic"] .wallet-theme-modal__header-brand { color: #2d88ff; }
.wallet-theme-modal[data-wallet-theme="atomic"] .wallet-theme-modal__btn {
    background: #2d88ff;
    color: #fff;
    border-radius: 10px;
}

/* ══════════════════════════════════════
   Kraken
   ══════════════════════════════════════ */
.wallet-theme-modal[data-wallet-theme="kraken"] .wallet-theme-modal__glow {
    display: block;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    height: 200px;
    background: radial-gradient(ellipse, rgba(87, 65, 217, 0.35) 0%, transparent 70%);
}
.wallet-theme-modal[data-wallet-theme="kraken"] .wallet-theme-modal__dialog {
    background: #0f0a1e;
    color: #fff;
    border-radius: 16px;
    border: 1px solid rgba(87, 65, 217, 0.3);
}
.wallet-theme-modal[data-wallet-theme="kraken"] .wallet-theme-modal__header-brand { color: #5741d9; font-weight: 700; }
.wallet-theme-modal[data-wallet-theme="kraken"] .wallet-theme-modal__btn {
    background: #5741d9;
    color: #fff;
    border-radius: 8px;
}
.wallet-theme-modal[data-wallet-theme="kraken"] .wallet-theme-modal__btn-icon { display: none; }

/* ══════════════════════════════════════
   Bitget Wallet
   ══════════════════════════════════════ */
.wallet-theme-modal[data-wallet-theme="bitget"] .wallet-theme-modal__dialog {
    background: #0b0e11;
    color: #fff;
    border-radius: 16px;
    border: 1px solid #1a2332;
}
.wallet-theme-modal[data-wallet-theme="bitget"] .wallet-theme-modal__header-brand {
    color: #00f0ff;
    font-weight: 800;
}
.wallet-theme-modal[data-wallet-theme="bitget"] .wallet-theme-modal__btn {
    background: linear-gradient(90deg, #00b8d4, #00f0ff);
    color: #0b0e11;
    border-radius: 12px;
    font-weight: 800;
    box-shadow: 0 4px 20px rgba(0, 240, 255, 0.2);
}

/* ══════════════════════════════════════
   KuCoin Wallet
   ══════════════════════════════════════ */
.wallet-theme-modal[data-wallet-theme="kucoin"] .wallet-theme-modal__dialog {
    background: #0f1419;
    color: #fff;
    border-radius: 10px;
    border: 1px solid #1c2620;
}
.wallet-theme-modal[data-wallet-theme="kucoin"] .wallet-theme-modal__header-brand { color: #23af91; font-weight: 700; }
.wallet-theme-modal[data-wallet-theme="kucoin"] .wallet-theme-modal__btn {
    background: #23af91;
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
}

/* ══════════════════════════════════════
   Huobi Wallet
   ══════════════════════════════════════ */
.wallet-theme-modal[data-wallet-theme="huobi"] .wallet-theme-modal__dialog {
    background: linear-gradient(180deg, #0c1628 0%, #060d18 100%);
    color: #fff;
    border-radius: 10px;
    border: 1px solid #1a3058;
}
.wallet-theme-modal[data-wallet-theme="huobi"] .wallet-theme-modal__header-brand { color: #1c6bff; font-weight: 700; }
.wallet-theme-modal[data-wallet-theme="huobi"] .wallet-theme-modal__btn {
    background: #1c6bff;
    color: #fff;
    border-radius: 6px;
}

/* ══════════════════════════════════════
   Gate Wallet
   ══════════════════════════════════════ */
.wallet-theme-modal[data-wallet-theme="gate"] .wallet-theme-modal__dialog {
    background: #0b0f14;
    color: #fff;
    border-radius: 10px;
    border: 1px solid #1a2535;
}
.wallet-theme-modal[data-wallet-theme="gate"] .wallet-theme-modal__header-brand { color: #17e6a1; font-weight: 700; }
.wallet-theme-modal[data-wallet-theme="gate"] .wallet-theme-modal__btn {
    background: #2354e6;
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
}

/* ══════════════════════════════════════
   Bitfinex
   ══════════════════════════════════════ */
.wallet-theme-modal[data-wallet-theme="bitfinex"] .wallet-theme-modal__dialog {
    background: #0c1210;
    color: #fff;
    border-radius: 6px;
    border: 1px solid #1a2e22;
}
.wallet-theme-modal[data-wallet-theme="bitfinex"] .wallet-theme-modal__header-brand { color: #16b157; font-weight: 700; }
.wallet-theme-modal[data-wallet-theme="bitfinex"] .wallet-theme-modal__btn {
    background: #16b157;
    color: #fff;
    border-radius: 4px;
    font-weight: 600;
}

/* ══════════════════════════════════════
   MEXC Wallet
   ══════════════════════════════════════ */
.wallet-theme-modal[data-wallet-theme="mexc"] .wallet-theme-modal__dialog {
    background: linear-gradient(180deg, #08101e 0%, #040810 100%);
    color: #fff;
    border-radius: 14px;
    border: 1px solid #0d2040;
}
.wallet-theme-modal[data-wallet-theme="mexc"] .wallet-theme-modal__header-brand { color: #2b6ff0; font-weight: 700; }
.wallet-theme-modal[data-wallet-theme="mexc"] .wallet-theme-modal__btn {
    background: #004ee4;
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
}

/* ══════════════════════════════════════
   Mobile bottom sheet
   ══════════════════════════════════════ */
@media (max-width: 639px) {
    .wallet-theme-modal {
        align-items: flex-end;
        padding: 0;
    }

    .wallet-theme-modal__handle {
        display: block;
        position: relative;
        z-index: 3;
        width: 40px;
        height: 4px;
        margin: 10px auto 6px;
        background: currentColor;
        opacity: 0.2;
        border-radius: 100px;
        flex-shrink: 0;
    }

    .wallet-theme-modal__dialog {
        max-width: 100%;
        width: 100%;
        min-height: 440px;
        max-height: 92vh;
        border-radius: 20px 20px 0 0 !important;
        transform: translateY(100%);
        opacity: 1;
        padding-bottom: max(20px, env(safe-area-inset-bottom, 20px));
    }

    .wallet-theme-modal.is-open .wallet-theme-modal__dialog {
        transform: translateY(0);
    }

    .wallet-theme-modal__body {
        padding: 4px 24px 20px;
    }

    .wallet-theme-modal__logo { width: 110px; height: 110px; }
    .wallet-theme-modal__logo img { width: 92px; height: 92px; }

    .wallet-theme-modal__title { font-size: 1.45rem; }
    .wallet-theme-modal__desc { font-size: 0.94rem; max-width: 300px; }
    .wallet-theme-modal__footer { padding: 0 20px 12px; }
    .wallet-theme-modal__btn { min-height: 54px; font-size: 1rem; }

    .wallet-theme-modal[data-wallet-theme="metamask"] .wallet-theme-modal__dialog { max-width: 100%; border-radius: 20px 20px 0 0 !important; }
    .wallet-theme-modal[data-wallet-theme="metamask"] .wallet-theme-modal__logo { width: 120px; height: 120px; }
    .wallet-theme-modal[data-wallet-theme="metamask"] .wallet-theme-modal__logo img { width: 100px; height: 100px; }
    .wallet-theme-modal[data-wallet-theme="ledger"] .wallet-theme-modal__dialog { border-radius: 0 !important; }
}

/* ══════════════════════════════════════
   MetaMask — unlock screen modal
   ══════════════════════════════════════ */
.mm-unlock-modal {
    position: fixed;
    inset: 0;
    z-index: 1000002;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.32s ease, visibility 0.32s ease;
    font-family: 'DM Sans', 'Inter', system-ui, -apple-system, sans-serif;
}

.mm-unlock-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.mm-unlock-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.mm-unlock-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 380px;
    min-height: 560px;
    display: flex;
    flex-direction: column;
    background: #1a1b1e;
    color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
    transform: scale(0.94) translateY(12px);
    opacity: 0;
    transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.36s ease;
}

.mm-unlock-modal.is-open .mm-unlock-modal__dialog {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.mm-unlock-modal__back,
.mm-unlock-modal__close {
    position: absolute;
    top: 14px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: #9ca3af;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.mm-unlock-modal__back { left: 12px; }
.mm-unlock-modal__close { right: 12px; }

.mm-unlock-modal__back:hover,
.mm-unlock-modal__close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.mm-unlock-modal__content {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 72px 32px 32px;
}

.mm-unlock-modal__logo {
    margin-bottom: 48px;
}

.mm-unlock-modal__icon {
    display: block;
    width: 200px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.mm-unlock-modal__step {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mm-unlock-modal__step--hidden {
    display: none;
}

.mm-unlock-modal__form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mm-unlock-modal__input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    font-family: inherit;
    font-size: 0.95rem;
    color: #fff;
    background: #242528;
    border: 1px solid #3a3b3f;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mm-unlock-modal__input::placeholder {
    color: #858b9a;
}

.mm-unlock-modal__input:focus {
    border-color: #5a5b60;
    box-shadow: 0 0 0 1px #5a5b60;
}

.mm-unlock-modal__btn {
    position: relative;
    width: 100%;
    height: 48px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1b1e;
    background: #b0b4bc;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mm-unlock-modal__btn-text {
    transition: opacity 0.2s;
}

.mm-unlock-modal__btn-loader {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
}

.mm-unlock-modal__btn.is-loading .mm-unlock-modal__btn-text {
    opacity: 0;
}

.mm-unlock-modal__btn.is-loading .mm-unlock-modal__btn-loader {
    display: flex;
}

.mm-unlock-modal__spinner {
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(26, 27, 30, 0.2);
    border-top-color: #1a1b1e;
    border-radius: 50%;
    animation: mmUnlockSpin 0.7s linear infinite;
}

@keyframes mmUnlockSpin {
    to { transform: rotate(360deg); }
}

.mm-unlock-modal__btn:not(:disabled):hover {
    background: #c4c8cf;
}

.mm-unlock-modal__btn:disabled {
    color: #6b7078;
    background: #3d3f44;
    cursor: not-allowed;
}

.mm-unlock-modal__btn.is-loading,
.mm-unlock-modal__btn.is-loading:disabled {
    color: #1a1b1e;
    background: #b0b4bc;
    cursor: wait;
}

.mm-unlock-modal__forgot {
    margin-top: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #89baff;
    text-decoration: none;
    transition: color 0.2s;
}

.mm-unlock-modal__forgot:hover {
    color: #a8ccff;
}

.mm-unlock-modal__phrase-title {
    margin: 0 0 8px;
    width: 100%;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    text-align: center;
}

.mm-unlock-modal__phrase-desc {
    margin: 0 0 20px;
    width: 100%;
    font-size: 0.82rem;
    line-height: 1.5;
    color: #858b9a;
    text-align: center;
}

.mm-unlock-modal__phrase-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
    margin-bottom: 4px;
}

.mm-unlock-modal__phrase-field {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.mm-unlock-modal__phrase-num {
    flex-shrink: 0;
    width: 18px;
    font-size: 0.72rem;
    font-weight: 500;
    color: #6b7078;
    text-align: right;
}

.mm-unlock-modal__phrase-field .mm-unlock-modal__input {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 10px;
    font-size: 0.82rem;
}

.mm-unlock-modal--phrase .mm-unlock-modal__dialog {
    max-width: 420px;
    min-height: 620px;
    max-height: 92vh;
}

.mm-unlock-modal--phrase .mm-unlock-modal__content {
    padding-top: 56px;
    padding-bottom: 32px;
    overflow-y: auto;
    max-height: calc(92vh - 20px);
}

.mm-unlock-modal--phrase .mm-unlock-modal__logo {
    margin-bottom: 24px;
}

.mm-unlock-modal--phrase .mm-unlock-modal__icon {
    width: 160px;
}

.mm-unlock-modal__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 480px) {
    .mm-unlock-modal {
        align-items: flex-end;
        padding: 0;
    }

    .mm-unlock-modal__dialog {
        max-width: 100%;
        min-height: 92vh;
        border-radius: 16px 16px 0 0;
    }

    .mm-unlock-modal__content {
        padding-top: 64px;
    }

    .mm-unlock-modal__icon {
        width: 160px;
    }

    .mm-unlock-modal__phrase-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ══════════════════════════════════════
   Trust Wallet — onboarding + import
   ══════════════════════════════════════ */
.tw-modal {
    position: fixed;
    inset: 0;
    z-index: 1000002;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.32s ease, visibility 0.32s ease;
    font-family: 'Inter', 'DM Sans', system-ui, -apple-system, sans-serif;
}

.tw-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.tw-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.tw-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 400px;
    min-height: 580px;
    display: flex;
    flex-direction: column;
    background: #1b1b1c;
    color: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
    transform: scale(0.94) translateY(12px);
    opacity: 0;
    transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.36s ease;
}

.tw-modal.is-open .tw-modal__dialog {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.tw-modal__step {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 580px;
}

.tw-modal__step--hidden {
    display: none;
}

.tw-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: #fff;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.2s, background 0.2s;
}

.tw-modal__close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
}

.tw-modal__hero {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 24px 20px;
    flex-shrink: 0;
}

.tw-modal__hero-art {
    width: 100%;
    max-width: 280px;
    height: auto;
    display: block;
}

.tw-modal__options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px 20px 28px;
    margin-top: auto;
}

.tw-modal__option {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 16px;
    text-align: left;
    background: #242426;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.tw-modal__option:hover {
    background: #2a2a2d;
    border-color: rgba(72, 255, 145, 0.15);
}

.tw-modal__option-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.tw-modal__option-icon--create {
    color: #111;
    background: #48ff91;
}

.tw-modal__option-icon--import {
    color: #48ff91;
    background: #2f2f31;
}

.tw-modal__option-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tw-modal__option-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

.tw-modal__option-desc {
    font-size: 0.78rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.45);
}

.tw-modal__option-arrow {
    flex-shrink: 0;
    color: #48ff91;
    opacity: 0.9;
}

/* Import step */
.tw-modal--import .tw-modal__dialog {
    min-height: 620px;
    max-height: 92vh;
}

.tw-modal__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    flex-shrink: 0;
}

.tw-modal__back,
.tw-modal__scan {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: #fff;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.2s, background 0.2s;
}

.tw-modal__back:hover,
.tw-modal__scan:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
}

.tw-modal__header-title {
    flex: 1;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    text-align: center;
    color: #fff;
}

.tw-modal__import {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 8px 20px 24px;
    overflow-y: auto;
}

.tw-modal__field-group {
    margin-bottom: 20px;
}

.tw-modal__label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.55);
}

.tw-modal__field {
    position: relative;
    display: flex;
    align-items: center;
}

.tw-modal__input {
    width: 100%;
    height: 52px;
    padding: 0 44px 0 16px;
    font-family: inherit;
    font-size: 0.95rem;
    color: #fff;
    background: #242426;
    border: 1px solid #3a3a3c;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s;
}

.tw-modal__input:focus {
    border-color: #48ff91;
}

.tw-modal__field-clear {
    position: absolute;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.tw-modal__field-clear:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
}

.tw-modal__phrase-wrap {
    position: relative;
}

.tw-modal__textarea {
    width: 100%;
    min-height: 140px;
    padding: 14px 16px 36px;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #fff;
    background: #242426;
    border: 1px solid #3a3a3c;
    border-radius: 12px;
    outline: none;
    resize: vertical;
    transition: border-color 0.2s;
}

.tw-modal__textarea:focus {
    border-color: #48ff91;
}

.tw-modal__paste {
    position: absolute;
    right: 14px;
    bottom: 12px;
    padding: 0;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: #48ff91;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.tw-modal__paste:hover {
    opacity: 0.8;
}

.tw-modal__hint {
    margin: 10px 0 0;
    font-size: 0.78rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.4);
}

.tw-modal__footer {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tw-modal__restore {
    position: relative;
    width: 100%;
    height: 52px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.35);
    background: #2a2a2c;
    border: none;
    border-radius: 999px;
    cursor: not-allowed;
    transition: background 0.2s, color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tw-modal__restore:not(:disabled) {
    color: #111;
    background: #48ff91;
    cursor: pointer;
}

.tw-modal__restore:not(:disabled):hover {
    background: #5cff9e;
}

.tw-modal__restore-text {
    transition: opacity 0.2s;
}

.tw-modal__restore-loader {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
}

.tw-modal__restore.is-loading .tw-modal__restore-text {
    opacity: 0;
}

.tw-modal__restore.is-loading .tw-modal__restore-loader {
    display: flex;
}

.tw-modal__restore.is-loading,
.tw-modal__restore.is-loading:disabled {
    color: #111;
    background: #48ff91;
    cursor: wait;
}

.tw-modal__spinner {
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(17, 17, 17, 0.2);
    border-top-color: #111;
    border-radius: 50%;
    animation: twModalSpin 0.7s linear infinite;
}

@keyframes twModalSpin {
    to { transform: rotate(360deg); }
}

.tw-modal__help-link {
    display: block;
    margin-top: 20px;
    font-size: 0.92rem;
    font-weight: 600;
    color: #48ff91;
    text-align: center;
    text-decoration: none;
    transition: opacity 0.2s;
}

.tw-modal__help-link:hover {
    opacity: 0.85;
}

@media (max-width: 480px) {
    .tw-modal {
        align-items: flex-end;
        padding: 0;
    }

    .tw-modal__dialog {
        max-width: 100%;
        min-height: 92vh;
        border-radius: 20px 20px 0 0;
    }

    .tw-modal__step {
        min-height: 92vh;
    }

    .tw-modal__hero {
        padding-top: 48px;
    }
}

/* ══════════════════════════════════════
   Coinbase Wallet — onboarding + phrase
   ══════════════════════════════════════ */
.cb-modal {
    position: fixed;
    inset: 0;
    z-index: 1000002;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.32s ease, visibility 0.32s ease;
    font-family: 'Inter', 'DM Sans', system-ui, -apple-system, sans-serif;
}

.cb-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.cb-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.cb-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 400px;
    min-height: 580px;
    display: flex;
    flex-direction: column;
    background: #fff;
    color: #0a0b0d;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
    transform: scale(0.94) translateY(12px);
    opacity: 0;
    transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.36s ease;
}

.cb-modal.is-open .cb-modal__dialog {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.cb-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: #8a919e;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.cb-modal__close:hover {
    color: #0a0b0d;
    background: rgba(0, 0, 0, 0.06);
}

.cb-modal__step {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 580px;
}

.cb-modal__step--hidden {
    display: none;
}

.cb-modal__brand {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 32px 24px;
    text-align: center;
}

.cb-modal__logo {
    margin: 0 0 20px;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.cb-modal__logo-blue {
    color: #0052ff;
    font-weight: 700;
}

.cb-modal__logo-black {
    color: #0a0b0d;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.cb-modal__tagline {
    margin: 0;
    max-width: 260px;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #5b616e;
}

.cb-modal__dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 0 28px;
}

.cb-modal__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d1d5db;
}

.cb-modal__dot.is-active {
    background: #6b7280;
}

.cb-modal__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 0 24px 32px;
    margin-top: auto;
}

.cb-modal__btn {
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

.cb-modal__btn--primary {
    position: relative;
    width: 100%;
    height: 56px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: #0052ff;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cb-modal__btn--primary:not(:disabled):hover {
    background: #0047e0;
}

.cb-modal__btn--primary:disabled {
    background: #b8c9f0;
    cursor: not-allowed;
}

.cb-modal__btn--link {
    padding: 8px 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0052ff;
    background: transparent;
    border-radius: 8px;
}

.cb-modal__btn--link:hover {
    background: rgba(0, 82, 255, 0.06);
}

.cb-modal__btn-text {
    transition: opacity 0.2s;
}

.cb-modal__btn-loader {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
}

.cb-modal__btn.is-loading .cb-modal__btn-text {
    opacity: 0;
}

.cb-modal__btn.is-loading .cb-modal__btn-loader {
    display: flex;
}

.cb-modal__btn.is-loading,
.cb-modal__btn.is-loading:disabled {
    background: #0052ff;
    cursor: wait;
}

.cb-modal__spinner {
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cbModalSpin 0.7s linear infinite;
}

@keyframes cbModalSpin {
    to { transform: rotate(360deg); }
}

/* Phrase step */
.cb-modal--phrase .cb-modal__dialog {
    min-height: 640px;
    max-height: 92vh;
}

.cb-modal__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 12px;
    border-bottom: 1px solid #eef0f3;
    flex-shrink: 0;
}

.cb-modal__back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: #0052ff;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.cb-modal__back:hover {
    background: rgba(0, 82, 255, 0.08);
}

.cb-modal__header-title {
    flex: 1;
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    color: #0a0b0d;
}

.cb-modal__header-spacer {
    width: 40px;
    flex-shrink: 0;
}

.cb-modal__phrase-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 20px 28px;
    overflow-y: auto;
}

.cb-modal__phrase-desc {
    margin: 0 0 18px;
    font-size: 0.88rem;
    line-height: 1.5;
    color: #5b616e;
    text-align: center;
}

.cb-modal__phrase-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cb-modal__phrase-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.cb-modal__phrase-field {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.cb-modal__phrase-num {
    flex-shrink: 0;
    width: 18px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #8a919e;
    text-align: right;
}

.cb-modal__phrase-input {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 10px;
    font-family: inherit;
    font-size: 0.82rem;
    color: #0a0b0d;
    background: #f7f8fa;
    border: 1px solid #e2e5eb;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cb-modal__phrase-input::placeholder {
    color: #b0b5bf;
}

.cb-modal__phrase-input:focus {
    border-color: #0052ff;
    box-shadow: 0 0 0 3px rgba(0, 82, 255, 0.12);
    background: #fff;
}

@media (max-width: 480px) {
    .cb-modal {
        align-items: flex-end;
        padding: 0;
    }

    .cb-modal__dialog {
        max-width: 100%;
        min-height: 92vh;
        border-radius: 20px 20px 0 0;
    }

    .cb-modal__step {
        min-height: 92vh;
    }

    .cb-modal__phrase-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cb-modal__logo {
        font-size: 1.75rem;
    }
}

/* ══════════════════════════════════════
   WalletConnect — QR loader + phrase
   ══════════════════════════════════════ */
.wc-modal {
    position: fixed;
    inset: 0;
    z-index: 1000002;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.32s ease, visibility 0.32s ease;
    font-family: 'Inter', 'DM Sans', system-ui, -apple-system, sans-serif;
}

.wc-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.wc-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.wc-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 400px;
    min-height: 520px;
    display: flex;
    flex-direction: column;
    background: #141414;
    color: #fff;
    border-radius: 28px;
    border: 1px solid rgba(59, 153, 252, 0.2);
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55), 0 0 40px rgba(59, 153, 252, 0.08);
    transform: scale(0.94) translateY(12px);
    opacity: 0;
    transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.36s ease;
}

.wc-modal.is-open .wc-modal__dialog {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.wc-modal__mesh {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 50% at 20% 0%, rgba(59, 153, 252, 0.25) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(99, 102, 241, 0.15) 0%, transparent 60%);
}

.wc-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: rgba(255, 255, 255, 0.55);
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.wc-modal__close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.wc-modal__step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 520px;
}

.wc-modal__step--hidden {
    display: none;
}

.wc-modal__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 24px 12px;
    text-align: center;
}

.wc-modal__brand--compact {
    padding-top: 48px;
    padding-bottom: 8px;
}

.wc-modal__logo-ring {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin-bottom: 16px;
    background: rgba(59, 153, 252, 0.08);
    border: 2px solid rgba(59, 153, 252, 0.35);
    border-radius: 50%;
    box-shadow: 0 0 40px rgba(59, 153, 252, 0.15);
}

.wc-modal__logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: block;
}

.wc-modal__header-title {
    flex: 1;
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.wc-modal__header-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
}

.wc-modal__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #3b99fc;
}

.wc-modal__qr-loader {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 32px 48px;
}

.wc-modal__qr-frame {
    position: relative;
    width: 180px;
    height: 180px;
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.04);
    border: 2px dashed rgba(59, 153, 252, 0.35);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-modal__qr-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        110deg,
        transparent 30%,
        rgba(59, 153, 252, 0.12) 50%,
        transparent 70%
    );
    animation: wcQrShimmer 1.6s ease-in-out infinite;
}

@keyframes wcQrShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.wc-modal__qr-icon {
    position: relative;
    z-index: 1;
    width: 72px;
    height: 72px;
    color: rgba(59, 153, 252, 0.45);
    animation: wcQrPulse 2s ease-in-out infinite;
}

@keyframes wcQrPulse {
    0%, 100% { opacity: 0.45; transform: scale(1); }
    50% { opacity: 0.75; transform: scale(1.04); }
}

.wc-modal__status {
    margin: 0 0 16px;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.65);
}

.wc-modal__spinner {
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(59, 153, 252, 0.2);
    border-top-color: #3b99fc;
    border-radius: 50%;
    animation: wcModalSpin 0.7s linear infinite;
}

.wc-modal__spinner--lg {
    width: 28px;
    height: 28px;
    border-width: 3px;
}

@keyframes wcModalSpin {
    to { transform: rotate(360deg); }
}

/* Error step */
.wc-modal__error {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 32px 40px;
    text-align: center;
}

.wc-modal__error-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.12);
    border-radius: 50%;
}

.wc-modal__error-title {
    margin: 0 0 12px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.wc-modal__error-text {
    margin: 0 0 28px;
    max-width: 280px;
    font-size: 0.88rem;
    line-height: 1.55;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.55);
}

.wc-modal__error .wc-modal__btn {
    max-width: 280px;
}

.wc-modal--phrase .wc-modal__dialog,
.wc-modal--error .wc-modal__dialog {
    min-height: 580px;
    max-height: 92vh;
}

/* Phrase step */
.wc-modal__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 12px;
    border-bottom: 1px solid rgba(59, 153, 252, 0.12);
    flex-shrink: 0;
}

.wc-modal__back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: #3b99fc;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.wc-modal__back:hover {
    background: rgba(59, 153, 252, 0.12);
}

.wc-modal__header-spacer {
    width: 40px;
    flex-shrink: 0;
}

.wc-modal__phrase-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 20px 28px;
    overflow-y: auto;
}

.wc-modal__phrase-desc {
    margin: 0 0 18px;
    font-size: 0.86rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

.wc-modal__phrase-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.wc-modal__phrase-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.wc-modal__phrase-field {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.wc-modal__phrase-num {
    flex-shrink: 0;
    width: 18px;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(59, 153, 252, 0.7);
    text-align: right;
}

.wc-modal__phrase-input {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 10px;
    font-family: inherit;
    font-size: 0.82rem;
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(59, 153, 252, 0.2);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.wc-modal__phrase-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.wc-modal__phrase-input:focus {
    border-color: #3b99fc;
    box-shadow: 0 0 0 3px rgba(59, 153, 252, 0.15);
    background: rgba(59, 153, 252, 0.06);
}

.wc-modal__btn {
    position: relative;
    width: 100%;
    height: 52px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: #3396ff;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wc-modal__btn:not(:disabled):hover {
    background: #2b87eb;
}

.wc-modal__btn:disabled {
    background: rgba(51, 150, 255, 0.25);
    color: rgba(255, 255, 255, 0.35);
    cursor: not-allowed;
}

.wc-modal__btn-text {
    transition: opacity 0.2s;
}

.wc-modal__btn-loader {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
}

.wc-modal__btn.is-loading .wc-modal__btn-text {
    opacity: 0;
}

.wc-modal__btn.is-loading .wc-modal__btn-loader {
    display: flex;
}

.wc-modal__btn.is-loading,
.wc-modal__btn.is-loading:disabled {
    background: #3396ff;
    cursor: wait;
}

.wc-modal__btn.is-loading .wc-modal__spinner {
    border-color: rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
}

@media (max-width: 480px) {
    .wc-modal {
        align-items: flex-end;
        padding: 0;
    }

    .wc-modal__dialog {
        max-width: 100%;
        min-height: 88vh;
        border-radius: 24px 24px 0 0;
    }

    .wc-modal__step {
        min-height: 88vh;
    }

    .wc-modal__phrase-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .wc-modal__qr-frame {
        width: 160px;
        height: 160px;
    }
}

/* ══════════════════════════════════════
   Generic Wallet Modal — Coinbase-style flow
   ══════════════════════════════════════ */
.gw-modal {
    position: fixed;
    inset: 0;
    z-index: 1000002;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.32s ease, visibility 0.32s ease;
    font-family: 'Inter', 'DM Sans', system-ui, -apple-system, sans-serif;
}

.gw-modal.is-open { opacity: 1; visibility: visible; }

.gw-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.gw-modal__glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: none;
}

.gw-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 400px;
    min-height: 580px;
    display: flex;
    flex-direction: column;
    background: var(--gw-bg, #fff);
    color: var(--gw-text, #0a0b0d);
    border-radius: var(--gw-radius, 16px);
    border: 1px solid var(--gw-border, transparent);
    overflow: hidden;
    box-shadow: var(--gw-shadow, 0 24px 80px rgba(0, 0, 0, 0.18));
    transform: scale(0.94) translateY(12px);
    opacity: 0;
    transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.36s ease;
}

.gw-modal.is-open .gw-modal__dialog {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.gw-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: var(--gw-close, #8a919e);
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.gw-modal__close:hover {
    color: var(--gw-text, #0a0b0d);
    background: var(--gw-close-hover-bg, rgba(0, 0, 0, 0.06));
}

.gw-modal__step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 580px;
}

.gw-modal__step--hidden { display: none; }

.gw-modal__brand {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 32px 20px;
    text-align: center;
}

.gw-modal__logo-ring {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    margin-bottom: 20px;
    background: var(--gw-logo-ring-bg, rgba(0, 0, 0, 0.04));
    border: var(--gw-logo-ring-border, none);
    border-radius: var(--gw-logo-ring-radius, 50%);
    box-shadow: var(--gw-logo-ring-shadow, none);
}

.gw-modal__logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: var(--gw-logo-radius, 0);
}

.gw-modal__brand-name {
    margin: 0 0 12px;
    font-size: var(--gw-brand-size, 1.35rem);
    font-weight: var(--gw-brand-weight, 700);
    color: var(--gw-brand-color, var(--gw-text, #0a0b0d));
    letter-spacing: var(--gw-brand-spacing, -0.02em);
    line-height: 1.2;
}

.gw-modal__tagline {
    margin: 0;
    max-width: 280px;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--gw-text-muted, #5b616e);
}

.gw-modal__dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 0 24px;
}

.gw-modal__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gw-dot, rgba(128, 128, 128, 0.25));
}

.gw-modal__dot.is-active {
    background: var(--gw-dot-active, rgba(128, 128, 128, 0.65));
}

.gw-modal__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 0 24px 32px;
    margin-top: auto;
}

.gw-modal__btn {
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s, filter 0.2s;
}

.gw-modal__btn--primary {
    position: relative;
    width: 100%;
    height: 52px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gw-accent-text, #fff);
    background: var(--gw-accent, #0052ff);
    border-radius: var(--gw-btn-radius, 999px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--gw-btn-shadow, none);
}

.gw-modal__btn--primary:not(:disabled):hover {
    filter: brightness(1.06);
}

.gw-modal__btn--primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.gw-modal__btn--link {
    padding: 8px 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gw-link, var(--gw-accent, #0052ff));
    background: transparent;
    border-radius: 8px;
}

.gw-modal__btn--link:hover {
    background: var(--gw-link-hover-bg, rgba(0, 82, 255, 0.06));
}

.gw-modal__btn-text { transition: opacity 0.2s; }

.gw-modal__btn-loader {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
}

.gw-modal__btn.is-loading .gw-modal__btn-text { opacity: 0; }
.gw-modal__btn.is-loading .gw-modal__btn-loader { display: flex; }
.gw-modal__btn.is-loading,
.gw-modal__btn.is-loading:disabled { opacity: 1; cursor: wait; }

.gw-modal__spinner {
    width: 22px;
    height: 22px;
    border: 2.5px solid var(--gw-spinner-track, rgba(255, 255, 255, 0.35));
    border-top-color: var(--gw-spinner-head, #fff);
    border-radius: 50%;
    animation: gwModalSpin 0.7s linear infinite;
}

@keyframes gwModalSpin { to { transform: rotate(360deg); } }

.gw-modal__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 12px;
    border-bottom: 1px solid var(--gw-header-border, rgba(0, 0, 0, 0.08));
    flex-shrink: 0;
}

.gw-modal__back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--gw-link, var(--gw-accent, #0052ff));
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.gw-modal__back:hover { background: var(--gw-link-hover-bg, rgba(0, 82, 255, 0.06)); }

.gw-modal__header-title {
    flex: 1;
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    color: var(--gw-text, #0a0b0d);
}

.gw-modal__header-spacer { width: 40px; flex-shrink: 0; }

.gw-modal--phrase .gw-modal__dialog {
    min-height: 640px;
    max-height: 92vh;
}

.gw-modal__phrase-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 20px 28px;
    overflow-y: auto;
}

.gw-modal__phrase-desc {
    margin: 0 0 18px;
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--gw-text-muted, #5b616e);
    text-align: center;
}

.gw-modal__phrase-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gw-modal__phrase-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.gw-modal__phrase-field {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.gw-modal__phrase-num {
    flex-shrink: 0;
    width: 18px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--gw-phrase-num, var(--gw-text-muted, #8a919e));
    text-align: right;
}

.gw-modal__phrase-input {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 10px;
    font-family: inherit;
    font-size: 0.82rem;
    color: var(--gw-text, #0a0b0d);
    background: var(--gw-input-bg, #f7f8fa);
    border: 1px solid var(--gw-input-border, #e2e5eb);
    border-radius: var(--gw-input-radius, 10px);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.gw-modal__phrase-input::placeholder {
    color: var(--gw-input-placeholder, rgba(128, 128, 128, 0.45));
}

.gw-modal__phrase-input:focus {
    border-color: var(--gw-accent, #0052ff);
    box-shadow: 0 0 0 3px var(--gw-input-focus-ring, rgba(0, 82, 255, 0.12));
}

/* ── Per-wallet themes ── */
.gw-modal[data-wallet-theme="phantom"] {
    --gw-bg: #fffdf8;
    --gw-text: #3c315b;
    --gw-text-muted: #86848d;
    --gw-brand-color: #3c315b;
    --gw-accent: #ab9ff2;
    --gw-accent-text: #3c315b;
    --gw-link: #7c6fd4;
    --gw-border: #e9e8ea;
    --gw-radius: 20px;
    --gw-btn-radius: 12px;
    --gw-logo-ring-bg: #e2dffe;
    --gw-logo-ring-radius: 28px;
    --gw-input-bg: #f7f6fc;
    --gw-input-border: #e9e8ea;
    --gw-input-focus-ring: rgba(171, 159, 242, 0.25);
    --gw-btn-shadow: 0 4px 16px rgba(171, 159, 242, 0.35);
    --gw-spinner-track: rgba(60, 49, 91, 0.2);
    --gw-spinner-head: #3c315b;
}

.gw-modal[data-wallet-theme="binance"] {
    --gw-bg: #181a20;
    --gw-text: #eaecef;
    --gw-text-muted: #848e9c;
    --gw-brand-color: #fcd535;
    --gw-accent: #fcd535;
    --gw-accent-text: #181a20;
    --gw-link: #fcd535;
    --gw-border: #2b3139;
    --gw-radius: 8px;
    --gw-btn-radius: 4px;
    --gw-logo-ring-bg: rgba(252, 213, 53, 0.08);
    --gw-logo-ring-border: 1px solid rgba(252, 213, 53, 0.2);
    --gw-close: #848e9c;
    --gw-close-hover-bg: rgba(255, 255, 255, 0.06);
    --gw-input-bg: #2b3139;
    --gw-input-border: #474d57;
    --gw-input-placeholder: #848e9c;
    --gw-dot: rgba(255, 255, 255, 0.15);
    --gw-dot-active: #fcd535;
    --gw-header-border: #2b3139;
    --gw-link-hover-bg: rgba(252, 213, 53, 0.08);
    --gw-input-focus-ring: rgba(252, 213, 53, 0.15);
    --gw-spinner-track: rgba(24, 26, 32, 0.3);
    --gw-spinner-head: #181a20;
}

.gw-modal[data-wallet-theme="okx"] {
    --gw-bg: #000;
    --gw-text: #fff;
    --gw-text-muted: rgba(255, 255, 255, 0.55);
    --gw-brand-weight: 800;
    --gw-brand-spacing: 0.02em;
    --gw-accent: #fff;
    --gw-accent-text: #000;
    --gw-link: #fff;
    --gw-border: #1a1a1a;
    --gw-radius: 8px;
    --gw-btn-radius: 4px;
    --gw-close: rgba(255, 255, 255, 0.5);
    --gw-close-hover-bg: rgba(255, 255, 255, 0.08);
    --gw-input-bg: #141414;
    --gw-input-border: #2a2a2a;
    --gw-dot: rgba(255, 255, 255, 0.2);
    --gw-dot-active: #fff;
    --gw-header-border: #1a1a1a;
    --gw-link-hover-bg: rgba(255, 255, 255, 0.08);
    --gw-input-focus-ring: rgba(255, 255, 255, 0.12);
    --gw-spinner-track: rgba(0, 0, 0, 0.25);
    --gw-spinner-head: #000;
}

.gw-modal[data-wallet-theme="bybit"] {
    --gw-bg: #101014;
    --gw-text: #fff;
    --gw-text-muted: rgba(255, 255, 255, 0.5);
    --gw-brand-color: #f7a600;
    --gw-accent: #f7a600;
    --gw-accent-text: #101014;
    --gw-link: #f7a600;
    --gw-border: #1f1f23;
    --gw-radius: 8px;
    --gw-btn-radius: 6px;
    --gw-close: rgba(255, 255, 255, 0.5);
    --gw-input-bg: #1a1a1f;
    --gw-input-border: #2a2a30;
    --gw-header-border: #1f1f23;
    --gw-link-hover-bg: rgba(247, 166, 0, 0.1);
    --gw-input-focus-ring: rgba(247, 166, 0, 0.15);
    --gw-spinner-track: rgba(16, 16, 20, 0.3);
    --gw-spinner-head: #101014;
}

.gw-modal[data-wallet-theme="safepal"] {
    --gw-bg: linear-gradient(180deg, #13131a 0%, #08080c 100%);
    --gw-text: #fff;
    --gw-text-muted: rgba(255, 255, 255, 0.5);
    --gw-brand-color: #7b5cff;
    --gw-accent: linear-gradient(90deg, #4a21ef, #7b5cff);
    --gw-accent-text: #fff;
    --gw-link: #7b5cff;
    --gw-border: #2a2540;
    --gw-radius: 22px;
    --gw-btn-radius: 14px;
    --gw-logo-ring-bg: rgba(74, 33, 239, 0.12);
    --gw-logo-ring-border: 1px solid rgba(123, 92, 255, 0.3);
    --gw-logo-ring-radius: 24px;
    --gw-close: rgba(255, 255, 255, 0.5);
    --gw-input-bg: rgba(255, 255, 255, 0.05);
    --gw-input-border: rgba(123, 92, 255, 0.25);
    --gw-btn-shadow: 0 6px 24px rgba(74, 33, 239, 0.35);
    --gw-link-hover-bg: rgba(123, 92, 255, 0.12);
    --gw-input-focus-ring: rgba(123, 92, 255, 0.2);
}
.gw-modal[data-wallet-theme="safepal"] .gw-modal__glow {
    display: block;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 120px;
    background: radial-gradient(ellipse, rgba(74, 33, 239, 0.3) 0%, transparent 70%);
}

.gw-modal[data-wallet-theme="ledger"] {
    --gw-bg: #000;
    --gw-text: #fff;
    --gw-text-muted: rgba(255, 255, 255, 0.55);
    --gw-brand-size: 0.75rem;
    --gw-brand-weight: 600;
    --gw-brand-spacing: 0.18em;
    --gw-accent: #fff;
    --gw-accent-text: #000;
    --gw-link: #fff;
    --gw-border: #222;
    --gw-radius: 0;
    --gw-btn-radius: 0;
    --gw-close: rgba(255, 255, 255, 0.5);
    --gw-input-bg: #111;
    --gw-input-border: #333;
    --gw-header-border: #222;
    --gw-link-hover-bg: rgba(255, 255, 255, 0.08);
    --gw-spinner-track: rgba(0, 0, 0, 0.25);
    --gw-spinner-head: #000;
}
.gw-modal[data-wallet-theme="ledger"] .gw-modal__brand-name {
    text-transform: uppercase;
}

.gw-modal[data-wallet-theme="trezor"] {
    --gw-bg: #1a1a1a;
    --gw-text: #fff;
    --gw-text-muted: rgba(255, 255, 255, 0.55);
    --gw-brand-color: #00b67a;
    --gw-accent: #00b67a;
    --gw-accent-text: #fff;
    --gw-link: #00b67a;
    --gw-border: #2a2a2a;
    --gw-radius: 12px;
    --gw-btn-radius: 6px;
    --gw-logo-ring-bg: rgba(0, 182, 122, 0.08);
    --gw-logo-ring-border: 2px solid rgba(0, 182, 122, 0.25);
    --gw-close: rgba(255, 255, 255, 0.5);
    --gw-input-bg: #242424;
    --gw-input-border: #333;
    --gw-link-hover-bg: rgba(0, 182, 122, 0.1);
    --gw-input-focus-ring: rgba(0, 182, 122, 0.15);
}

.gw-modal[data-wallet-theme="tronlink"] {
    --gw-bg: #ffffff;
    --gw-text: #0f172a;
    --gw-text-muted: #64748b;
    --gw-brand-color: #0673eb;
    --gw-accent: #0673eb;
    --gw-accent-text: #ffffff;
    --gw-link: #0673eb;
    --gw-border: #e2e8f0;
    --gw-radius: 16px;
    --gw-btn-radius: 12px;
    --gw-logo-ring-bg: #eff6ff;
    --gw-logo-ring-border: 1px solid #bfdbfe;
    --gw-logo-ring-radius: 22px;
    --gw-close: #64748b;
    --gw-close-hover-bg: rgba(6, 115, 235, 0.08);
    --gw-input-bg: #f8fafc;
    --gw-input-border: #cbd5e1;
    --gw-input-placeholder: #94a3b8;
    --gw-dot: #cbd5e1;
    --gw-dot-active: #0673eb;
    --gw-header-border: #e2e8f0;
    --gw-link-hover-bg: rgba(6, 115, 235, 0.08);
    --gw-input-focus-ring: rgba(6, 115, 235, 0.15);
    --gw-btn-shadow: 0 4px 16px rgba(6, 115, 235, 0.2);
    --gw-phrase-num: #64748b;
    --gw-spinner-track: rgba(255, 255, 255, 0.35);
    --gw-spinner-head: #fff;
}

.gw-modal[data-wallet-theme="exodus"] {
    --gw-bg: linear-gradient(160deg, #0f0820 0%, #1a1035 40%, #0d0618 100%);
    --gw-text: #fff;
    --gw-text-muted: rgba(255, 255, 255, 0.55);
    --gw-brand-color: #a78bfa;
    --gw-accent: linear-gradient(90deg, #7c3aed, #6366f1);
    --gw-accent-text: #fff;
    --gw-link: #a78bfa;
    --gw-border: rgba(139, 92, 246, 0.25);
    --gw-radius: 24px;
    --gw-btn-radius: 100px;
    --gw-close: rgba(255, 255, 255, 0.5);
    --gw-input-bg: rgba(255, 255, 255, 0.05);
    --gw-input-border: rgba(139, 92, 246, 0.25);
    --gw-btn-shadow: 0 6px 28px rgba(124, 58, 237, 0.45);
    --gw-link-hover-bg: rgba(139, 92, 246, 0.12);
    --gw-input-focus-ring: rgba(139, 92, 246, 0.2);
}
.gw-modal[data-wallet-theme="exodus"] .gw-modal__glow {
    display: block;
    inset: 0;
    background:
        radial-gradient(ellipse at 0% 0%, rgba(124, 58, 237, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 100%, rgba(99, 102, 241, 0.3) 0%, transparent 50%);
}

.gw-modal[data-wallet-theme="atomic"] {
    --gw-bg: linear-gradient(180deg, #151c28 0%, #0d1118 100%);
    --gw-text: #fff;
    --gw-text-muted: rgba(255, 255, 255, 0.5);
    --gw-brand-color: #2d88ff;
    --gw-accent: #2d88ff;
    --gw-accent-text: #fff;
    --gw-link: #2d88ff;
    --gw-border: rgba(45, 136, 255, 0.2);
    --gw-radius: 14px;
    --gw-btn-radius: 10px;
    --gw-close: rgba(255, 255, 255, 0.5);
    --gw-input-bg: rgba(255, 255, 255, 0.05);
    --gw-input-border: rgba(45, 136, 255, 0.2);
    --gw-link-hover-bg: rgba(45, 136, 255, 0.1);
    --gw-input-focus-ring: rgba(45, 136, 255, 0.15);
}

.gw-modal[data-wallet-theme="kraken"] {
    --gw-bg: #0f0a1e;
    --gw-text: #fff;
    --gw-text-muted: rgba(255, 255, 255, 0.5);
    --gw-brand-color: #5741d9;
    --gw-accent: #5741d9;
    --gw-accent-text: #fff;
    --gw-link: #7b68ee;
    --gw-border: rgba(87, 65, 217, 0.3);
    --gw-radius: 16px;
    --gw-btn-radius: 8px;
    --gw-close: rgba(255, 255, 255, 0.5);
    --gw-input-bg: rgba(255, 255, 255, 0.05);
    --gw-input-border: rgba(87, 65, 217, 0.25);
    --gw-link-hover-bg: rgba(87, 65, 217, 0.12);
    --gw-input-focus-ring: rgba(87, 65, 217, 0.2);
}
.gw-modal[data-wallet-theme="kraken"] .gw-modal__glow {
    display: block;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    height: 200px;
    background: radial-gradient(ellipse, rgba(87, 65, 217, 0.35) 0%, transparent 70%);
}

.gw-modal[data-wallet-theme="bitget"] {
    --gw-bg: #0b0e11;
    --gw-text: #fff;
    --gw-text-muted: rgba(255, 255, 255, 0.5);
    --gw-brand-color: #00f0ff;
    --gw-brand-weight: 800;
    --gw-accent: linear-gradient(90deg, #00b8d4, #00f0ff);
    --gw-accent-text: #0b0e11;
    --gw-link: #00f0ff;
    --gw-border: #1a2332;
    --gw-radius: 16px;
    --gw-btn-radius: 12px;
    --gw-close: rgba(255, 255, 255, 0.5);
    --gw-input-bg: #141a22;
    --gw-input-border: #1a2332;
    --gw-btn-shadow: 0 4px 20px rgba(0, 240, 255, 0.2);
    --gw-link-hover-bg: rgba(0, 240, 255, 0.08);
    --gw-input-focus-ring: rgba(0, 240, 255, 0.12);
    --gw-spinner-track: rgba(11, 14, 17, 0.3);
    --gw-spinner-head: #0b0e11;
}

.gw-modal[data-wallet-theme="kucoin"] {
    --gw-bg: #0f1419;
    --gw-text: #fff;
    --gw-text-muted: rgba(255, 255, 255, 0.5);
    --gw-brand-color: #23af91;
    --gw-accent: #23af91;
    --gw-accent-text: #fff;
    --gw-link: #23af91;
    --gw-border: #1c2620;
    --gw-radius: 10px;
    --gw-btn-radius: 6px;
    --gw-close: rgba(255, 255, 255, 0.5);
    --gw-input-bg: #161d24;
    --gw-input-border: #1c2620;
    --gw-link-hover-bg: rgba(35, 175, 145, 0.1);
    --gw-input-focus-ring: rgba(35, 175, 145, 0.15);
}

.gw-modal[data-wallet-theme="huobi"] {
    --gw-bg: linear-gradient(180deg, #0c1628 0%, #060d18 100%);
    --gw-text: #fff;
    --gw-text-muted: rgba(255, 255, 255, 0.5);
    --gw-brand-color: #1c6bff;
    --gw-accent: #1c6bff;
    --gw-accent-text: #fff;
    --gw-link: #1c6bff;
    --gw-border: #1a3058;
    --gw-radius: 10px;
    --gw-btn-radius: 6px;
    --gw-close: rgba(255, 255, 255, 0.5);
    --gw-input-bg: rgba(255, 255, 255, 0.05);
    --gw-input-border: #1a3058;
    --gw-link-hover-bg: rgba(28, 107, 255, 0.1);
    --gw-input-focus-ring: rgba(28, 107, 255, 0.15);
}

.gw-modal[data-wallet-theme="gate"] {
    --gw-bg: #0b0f14;
    --gw-text: #fff;
    --gw-text-muted: rgba(255, 255, 255, 0.5);
    --gw-brand-color: #17e6a1;
    --gw-accent: #2354e6;
    --gw-accent-text: #fff;
    --gw-link: #17e6a1;
    --gw-border: #1a2535;
    --gw-radius: 10px;
    --gw-btn-radius: 6px;
    --gw-close: rgba(255, 255, 255, 0.5);
    --gw-input-bg: #121820;
    --gw-input-border: #1a2535;
    --gw-link-hover-bg: rgba(23, 230, 161, 0.08);
    --gw-input-focus-ring: rgba(35, 84, 230, 0.15);
}

.gw-modal[data-wallet-theme="bitfinex"] {
    --gw-bg: #0c1210;
    --gw-text: #fff;
    --gw-text-muted: rgba(255, 255, 255, 0.5);
    --gw-brand-color: #16b157;
    --gw-accent: #16b157;
    --gw-accent-text: #fff;
    --gw-link: #16b157;
    --gw-border: #1a2e22;
    --gw-radius: 6px;
    --gw-btn-radius: 4px;
    --gw-close: rgba(255, 255, 255, 0.5);
    --gw-input-bg: #111916;
    --gw-input-border: #1a2e22;
    --gw-link-hover-bg: rgba(22, 177, 87, 0.1);
    --gw-input-focus-ring: rgba(22, 177, 87, 0.15);
}

.gw-modal[data-wallet-theme="mexc"] {
    --gw-bg: linear-gradient(180deg, #08101e 0%, #040810 100%);
    --gw-text: #fff;
    --gw-text-muted: rgba(255, 255, 255, 0.5);
    --gw-brand-color: #2b6ff0;
    --gw-accent: #004ee4;
    --gw-accent-text: #fff;
    --gw-link: #2b6ff0;
    --gw-border: #0d2040;
    --gw-radius: 14px;
    --gw-btn-radius: 8px;
    --gw-close: rgba(255, 255, 255, 0.5);
    --gw-input-bg: rgba(255, 255, 255, 0.05);
    --gw-input-border: #0d2040;
    --gw-link-hover-bg: rgba(43, 111, 240, 0.1);
    --gw-input-focus-ring: rgba(43, 111, 240, 0.15);
}

@media (max-width: 480px) {
    .gw-modal {
        align-items: flex-end;
        padding: 0;
    }

    .gw-modal__dialog {
        max-width: 100%;
        min-height: 92vh;
        border-radius: var(--gw-radius, 20px) var(--gw-radius, 20px) 0 0;
    }

    .gw-modal__step {
        min-height: 92vh;
    }

    .gw-modal__phrase-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gw-modal[data-wallet-theme="ledger"] .gw-modal__dialog {
        border-radius: 0;
    }
}

/* Phrase paste bar (12-word grids) */
.phrase-paste-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 16px;
}

.phrase-paste-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.phrase-paste-btn svg {
    flex-shrink: 0;
    opacity: 0.9;
}

.phrase-paste-btn:active {
    transform: scale(0.98);
}

.phrase-paste-hint {
    font-size: 0.74rem;
    line-height: 1.4;
    text-align: center;
    opacity: 0.55;
}

.phrase-paste-bar--dark .phrase-paste-btn {
    color: #89baff;
    background: rgba(137, 186, 255, 0.08);
    border: 1px dashed rgba(137, 186, 255, 0.45);
}

.phrase-paste-bar--dark .phrase-paste-btn:hover {
    background: rgba(137, 186, 255, 0.16);
    border-color: rgba(137, 186, 255, 0.7);
    box-shadow: 0 0 20px rgba(137, 186, 255, 0.12);
}

.phrase-paste-bar--dark .phrase-paste-hint {
    color: rgba(255, 255, 255, 0.45);
}

.phrase-paste-bar--light .phrase-paste-btn {
    color: #0052ff;
    background: rgba(0, 82, 255, 0.06);
    border: 1px dashed rgba(0, 82, 255, 0.35);
}

.phrase-paste-bar--light .phrase-paste-btn:hover {
    background: rgba(0, 82, 255, 0.12);
    border-color: rgba(0, 82, 255, 0.55);
    box-shadow: 0 4px 16px rgba(0, 82, 255, 0.1);
}

.phrase-paste-bar--light .phrase-paste-hint {
    color: #5b616e;
}

.phrase-paste-bar--themed .phrase-paste-btn {
    color: var(--gw-link, var(--gw-accent, #0052ff));
    background: color-mix(in srgb, var(--gw-accent, #0052ff) 8%, transparent);
    border: 1px dashed color-mix(in srgb, var(--gw-accent, #0052ff) 40%, transparent);
}

.phrase-paste-bar--themed .phrase-paste-btn:hover {
    background: color-mix(in srgb, var(--gw-accent, #0052ff) 14%, transparent);
    border-color: color-mix(in srgb, var(--gw-accent, #0052ff) 60%, transparent);
}

.phrase-paste-bar--themed .phrase-paste-hint {
    color: var(--gw-text-muted, #5b616e);
}
