#cwl-overlay {
            --cwl-bg: #f8f9fb;
            --cwl-card: #ffffff;
            --cwl-border: rgba(200, 210, 225, 0.5);
            --cwl-text: #1f2937;
            --cwl-muted: #6b7280;
            --cwl-accent: #4f8cff;
            --cwl-success: #10b981;
            --cwl-error: #ef4444;
        }

        #cwl-overlay *,
        #cwl-loading-overlay *,
        #cwl-toast * {
            box-sizing: border-box;
            font-family: 'Sora', system-ui, -apple-system, sans-serif;
        }

        #cwl-overlay button {
            cursor: pointer;
            border: none;
            background: none;
            font-family: inherit;
        }

        .cwl-open-btn {
            padding: 14px 28px;
            border-radius: 12px;
            background: #4f8cff;
            color: #fff;
            font-size: 16px;
            font-weight: 600;
            transition: background 0.3s ease;
            cursor: pointer;
            border: none;
            font-family: 'Sora', system-ui, sans-serif;
        }

        .cwl-open-btn:hover { background: #3b6fd1; }

        #cwl-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.35);
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.4s ease;
            z-index: 99990;
        }

        #cwl-overlay.cwl-show { opacity: 1; pointer-events: all; }

        #cwl-overlay .cwl-valletlist {
            width: 420px;
            max-height: 85vh;
            background: var(--cwl-card);
            border-radius: 20px;
            box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
            display: flex;
            flex-direction: column;
            padding: 24px;
            transform: scale(0.95);
            opacity: 0;
            transition: transform 0.4s ease, opacity 0.4s ease;
        }

        @media (min-width: 601px) {
            #cwl-overlay.cwl-show .cwl-valletlist { transform: scale(1); opacity: 1; }
        }

        @media (max-width: 600px) {
            #cwl-overlay { align-items: flex-end; }
            #cwl-overlay .cwl-valletlist {
                width: 100%; max-height: 88vh; height: auto;
                border-radius: 20px 20px 0 0;
                transform: translateY(100%); opacity: 0;
            }
            #cwl-overlay.cwl-show .cwl-valletlist { transform: translateY(0); opacity: 1; }
        }

        #cwl-overlay .cwl-vallet-header {
            display: flex; justify-content: center; align-items: center; position: relative;
        }
        #cwl-overlay .cwl-vallet-header h3 { margin: 0; font-size: 20px; font-weight: 600; color: var(--cwl-text); }

        #cwl-overlay .cwl-close-btn {
            position: absolute; right: 0; font-size: 22px;
            color: var(--cwl-muted); background: none; border: none;
            cursor: pointer; transition: color 0.2s ease;
        }
        #cwl-overlay .cwl-close-btn:hover { color: var(--cwl-accent); }

        #cwl-overlay .cwl-vallet-content {
            margin-top: 20px; flex: 1; overflow-y: auto; padding-right: 6px;
        }
        #cwl-overlay .cwl-vallet-content::-webkit-scrollbar { width: 6px; }
        #cwl-overlay .cwl-vallet-content::-webkit-scrollbar-thumb { background: #cfd5e3; border-radius: 10px; }

        #cwl-overlay .cwl-h4 {
            margin: 20px 0 12px; font-size: 17px; font-weight: 600;
            color: var(--cwl-text); letter-spacing: 0.5px;
        }

        #cwl-overlay .cwl-vallet {
            display: flex; align-items: center; gap: 14px;
            padding: 10px 0; border-radius: 14px; border: none;
            margin-bottom: 12px; cursor: pointer;
            transition: background 0.2s ease, transform 0.2s ease;
            background: none; width: 100%; text-align: left;
        }
        #cwl-overlay .cwl-vallet:hover { background: #f0f4ff; transform: translateY(-2px); }
        #cwl-overlay .cwl-vallet img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
        #cwl-overlay .cwl-vallet p { margin: 0; font-size: 16px; font-weight: 500; color: var(--cwl-text); }

        #cwl-overlay .cwl-secured-wrapper {
            position: sticky; bottom: 0; background: var(--cwl-card); padding-top: 16px;
        }
        #cwl-overlay .cwl-divider { height: 1px; background: var(--cwl-border); margin-bottom: 12px; }
        #cwl-overlay .cwl-secured { text-align: center; font-size: 13px; color: var(--cwl-muted); padding-bottom: 12px; }

        #cwl-overlay .cwl-footer {
            display: flex; justify-content: space-between; align-items: center;
            font-size: 13px; margin-top: 12px;
        }
        #cwl-overlay .cwl-footer p { margin: 0; color: var(--cwl-muted); }
        #cwl-overlay .cwl-footer .cwl-learn {
            font-weight: 600; color: var(--cwl-accent); cursor: pointer;
            transition: color 0.2s ease; text-decoration: none;
        }
        #cwl-overlay .cwl-footer .cwl-learn:hover { color: #3b6fd1; }

        #cwl-overlay .cwl-wallet-selected,
        #cwl-overlay .cwl-wallet-failed {
            display: flex; flex-direction: column; align-items: center; text-align: center;
            opacity: 0; transform: scale(0.95); transition: transform 0.4s ease, opacity 0.4s ease;
        }
        #cwl-overlay .cwl-wallet-selected.cwl-show,
        #cwl-overlay .cwl-wallet-failed.cwl-show { opacity: 1; transform: scale(1); }

        #cwl-overlay .cwl-wallet-selected .cwl-top-bar,
        #cwl-overlay .cwl-wallet-failed .cwl-top-bar {
            width: 100%; display: flex; justify-content: space-between; margin-bottom: 22px;
        }
        #cwl-overlay .cwl-wallet-selected .cwl-top-bar p,
        #cwl-overlay .cwl-wallet-failed .cwl-top-bar p {
            cursor: pointer; font-weight: 600; color: var(--cwl-accent); transition: color 0.2s ease; margin: 0;
        }
        #cwl-overlay .cwl-wallet-selected .cwl-top-bar p:hover,
        #cwl-overlay .cwl-wallet-failed .cwl-top-bar p:hover { color: #3b6fd1; }

        #cwl-overlay .cwl-wallet-selected .cwl-img-wrapper,
        #cwl-overlay .cwl-wallet-failed .cwl-img-wrapper {
            position: relative; width: 140px; height: 140px;
            display: flex; align-items: center; justify-content: center; margin-bottom: 20px;
        }
        #cwl-overlay .cwl-wallet-selected .cwl-img-wrapper img {
            width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
            box-shadow: 0 4px 20px rgba(0,0,0,0.1);
        }
        #cwl-overlay .cwl-wallet-selected .cwl-img-wrapper::after {
            content: ''; position: absolute; top: -6px; left: -6px;
            width: calc(100% + 12px); height: calc(100% + 12px);
            border: 2px solid #b19cd9; border-radius: 50%;
            border-top-color: transparent; border-right-color: transparent;
            border-bottom-color: transparent; border-left-color: #b19cd9;
            box-shadow: 0 0 10px rgba(177,156,217,0.4); box-sizing: border-box;
            animation: cwlRotateCorners 1.5s linear infinite;
        }
        @keyframes cwlRotateCorners { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

        #cwl-overlay .cwl-wallet-selected .cwl-wallet-name { font-weight: 600; margin-bottom: 10px; color: var(--cwl-text); }
        #cwl-overlay .cwl-wallet-selected .cwl-loading-text { font-size: 14px; color: var(--cwl-muted); }
        #cwl-overlay .cwl-wallet-selected .cwl-loading-text span.cwl-dots::after {
            content: ''; display: inline-block; width: 1ch; text-align: left;
            animation: cwlLoadingDots 1s steps(3, end) infinite;
        }
        @keyframes cwlLoadingDots {
            0%,20%{content:''} 40%{content:'.'} 60%{content:'..'} 80%,100%{content:'...'}
        }

        #cwl-overlay .cwl-wallet-failed .cwl-failure-text { font-weight: 600; color: var(--cwl-error); margin-bottom: 12px; }
        #cwl-overlay .cwl-wallet-failed .cwl-failure-img {
            width: 140px; height: 140px; border-radius: 50%; background: #fff5f5;
            display: flex; align-items: center; justify-content: center;
            font-size: 64px; color: var(--cwl-error); margin-bottom: 20px;
            border: 2px solid #fca5a5; animation: cwlPulseRed 1.5s infinite ease-in-out;
        }
        @keyframes cwlPulseRed {
            0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.05);opacity:0.75}
        }

        #cwl-overlay .cwl-error-progress-bar {
            width: 100%; height: 3px; background: rgba(239,68,68,0.2);
            border-radius: 2px; margin-top: 18px; overflow: hidden;
        }
        #cwl-overlay .cwl-error-progress-fill {
            height: 100%; width: 100%; background: var(--cwl-error); border-radius: 2px;
            animation: cwlShrinkBar 2s linear forwards; transform-origin: left;
        }
        @keyframes cwlShrinkBar { from{transform:scaleX(1)} to{transform:scaleX(0)} }

        .cwl-failed-notification {
            position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
            background: #ef4444; color: white; padding: 14px 22px; border-radius: 10px;
            box-shadow: 0 6px 15px rgba(0,0,0,0.15); font-size: 14px; z-index: 99995;
            opacity: 0; font-family: 'Sora', system-ui, sans-serif;
            animation: cwlFadeInOut 4s forwards;
        }
        @keyframes cwlFadeInOut { 0%{opacity:0} 10%,90%{opacity:1} 100%{opacity:0} }

        #cwl-overlay textarea.cwl-textarea { font-family: inherit; font-size: 14px; resize: none; }

        #cwl-overlay .cwl-option.cwl-selected {
            color: #4f8cff; border-bottom: 2px solid #4f8cff; padding-bottom: 2px;
        }

        #cwl-loading-overlay {
            position: fixed; inset: 0; background: rgba(0,0,0,0.85);
            display: flex; align-items: center; justify-content: center;
            z-index: 99997; opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
        }
        #cwl-loading-overlay.cwl-show { opacity: 1; pointer-events: all; }
        #cwl-loading-overlay .cwl-spinner {
            width: 60px; height: 60px; border: 4px solid rgba(255,255,255,0.3);
            border-top-color: #fff; border-radius: 50%; animation: cwlSpin 1s linear infinite;
        }
        @keyframes cwlSpin { to { transform: rotate(360deg); } }

        #cwl-toast {
            position: fixed; top: -100px; left: 50%; transform: translateX(-50%);
            background: #fff; color: #1f2937; padding: 16px 24px; border-radius: 12px;
            box-shadow: 0 8px 20px rgba(0,0,0,0.2); display: flex; align-items: center;
            gap: 12px; z-index: 99999; transition: top 0.4s ease; font-size: 15px;
            font-weight: 500; font-family: 'Sora', system-ui, sans-serif;
        }
        #cwl-toast.cwl-show { top: 20px; }
        #cwl-toast .cwl-icon {
            width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
            border-radius: 50%; background: #fee; color: #ef4444; font-size: 18px; font-weight: bold;
        }

        /* ── Mobile styles ── */
        @media (max-width: 600px) {
            #cwl-overlay .cwl-mobile-header {
                display: flex; align-items: center; justify-content: center;
                position: relative; margin-top: 6px;
            }
            #cwl-overlay .cwl-mobile-header h2 { margin: 0; font-size: 20px; font-weight: 600; color: #1f2937; }
            #cwl-overlay .cwl-mobile-header .cwl-close-btn { position: absolute; right: 0; top: 0; }

            #cwl-overlay .cwl-wallet-grid {
                display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 20px; text-align: center;
            }
            #cwl-overlay .cwl-wallet-grid .cwl-vallet { flex-direction: column; gap: 6px; padding: 0; }
            #cwl-overlay .cwl-wallet-grid img { width: 54px; height: 54px; border-radius: 14px; }
            #cwl-overlay .cwl-wallet-grid p { font-size: 12px; margin: 0; color: #1f2937; font-weight: 500; }

            #cwl-overlay .cwl-wallet-info { margin-top: 18px; text-align: center; }
            #cwl-overlay .cwl-wallet-info h3 { margin: 0 0 8px; font-size: 16px; font-weight: 600; }
            #cwl-overlay .cwl-wallet-info p { font-size: 13px; color: #6b7280; line-height: 1.4; margin-top: 10px; margin-bottom: 20px; }

            #cwl-overlay .cwl-wallet-actions { display: flex; gap: 10px; margin-top: 14px; }
            #cwl-overlay .cwl-wallet-actions button {
                flex: 1; padding: 10px; border-radius: 10px; border: 1px solid #e5e7eb;
                background: #fff; font-weight: 500; cursor: pointer; color: #1f2937;
            }
            #cwl-overlay .cwl-wallet-actions a {
                flex: 1; padding: 10px; border-radius: 10px; border: 1px solid #e5e7eb;
                background: #fff; font-weight: 500; cursor: pointer; text-decoration: none;
                color: #1f2937; font-size: 14px; display: flex; align-items: center; justify-content: center;
            }

            #cwl-overlay .cwl-get-wallet-header {
                display: flex; align-items: center; justify-content: center;
                position: relative; margin-top: 6px;
            }
            #cwl-overlay .cwl-get-wallet-header h2 { margin: 0; font-size: 20px; font-weight: 600; color: #1f2937; }
            #cwl-overlay .cwl-get-wallet-header .cwl-back-btn { position: absolute; left: 0; font-size: 16px; font-weight: 600; color: #4f8cff; cursor: pointer; }
            #cwl-overlay .cwl-get-wallet-header .cwl-close-btn { position: absolute; right: 0; }

            #cwl-overlay .cwl-get-wallet-list { margin-top: 20px; }
            #cwl-overlay .cwl-get-wallet-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px; }
            #cwl-overlay .cwl-get-wallet-item h4 { margin: 0; font-size: 15px; font-weight: 500; color: #1f2937; }
            #cwl-overlay .cwl-get-wallet-item h3 { margin: 0; font-size: 14px; font-weight: 600; color: #4f8cff; cursor: pointer; }
            #cwl-overlay .cwl-get-wallet-divider { height: 1px; background: rgba(200,210,225,0.5); margin: 6px 0; }
            #cwl-overlay .cwl-get-wallet-left { display: flex; align-items: center; gap: 10px; }
            #cwl-overlay .cwl-get-wallet-left img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }

            #cwl-overlay .cwl-get-wallet-footer { margin-top: 26px; text-align: center; }
            #cwl-overlay .cwl-get-wallet-footer h3 { margin: 0 0 8px; font-size: 15px; font-weight: 600; color: #1f2937; }
            #cwl-overlay .cwl-get-wallet-footer p { margin: 0 auto; max-width: 300px; font-size: 13px; color: #6b7280; line-height: 1.4; }
        }

        /* ══════════════════════════════════════════
           NEW WalletConnect "All Wallets" card grid — light theme
        ══════════════════════════════════════════ */
        #cwl-overlay .cwl-wc-view {
            display: flex; flex-direction: column; height: 100%; overflow: hidden;
        }

        #cwl-overlay .cwl-wc-topbar {
            display: flex; align-items: center; justify-content: space-between;
            padding: 4px 0 16px; flex-shrink: 0;
        }

        #cwl-overlay .cwl-wc-topbar .cwl-wc-back {
            width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
            border-radius: 50%; background: #f1f3f7; cursor: pointer; color: #1f2937;
            font-size: 18px; user-select: none; transition: background 0.2s; border: none;
        }
        #cwl-overlay .cwl-wc-topbar .cwl-wc-back:hover { background: #e5e8ef; }

        #cwl-overlay .cwl-wc-topbar h3 {
            margin: 0; font-size: 18px; font-weight: 700; color: #1f2937; letter-spacing: -0.3px;
        }

        #cwl-overlay .cwl-wc-topbar .cwl-wc-close {
            width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
            border-radius: 50%; background: #f1f3f7; cursor: pointer; color: #6b7280;
            font-size: 20px; line-height: 1; border: none; transition: background 0.2s, color 0.2s;
        }
        #cwl-overlay .cwl-wc-topbar .cwl-wc-close:hover { background: #e5e8ef; color: #1f2937; }

        #cwl-overlay .cwl-wc-search-row {
            display: flex; align-items: center; gap: 10px;
            background: #f1f3f7; border-radius: 14px; padding: 10px 14px;
            flex-shrink: 0; margin-bottom: 16px;
            border: 1.5px solid transparent; transition: border-color 0.2s;
        }
        #cwl-overlay .cwl-wc-search-row:focus-within { border-color: rgba(79,140,255,0.4); }
        #cwl-overlay .cwl-wc-search-row svg { flex-shrink: 0; opacity: 0.4; }

        #cwl-overlay #cwl-wc-search {
            background: none; border: none; outline: none; font-size: 14px;
            font-family: 'Sora', system-ui, sans-serif; color: #1f2937; width: 100%;
        }
        #cwl-overlay #cwl-wc-search::placeholder { color: #9ca3af; }

        #cwl-overlay .cwl-wc-toggle-row {
            display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-shrink: 0;
        }

        #cwl-overlay .cwl-wc-toggle-pill {
            display: flex; align-items: center; gap: 8px; background: #f1f3f7;
            border-radius: 20px; padding: 6px 14px 6px 10px; cursor: pointer;
            font-size: 13px; font-weight: 600; color: #6b7280; border: none;
            transition: color 0.2s; font-family: inherit;
        }
        #cwl-overlay .cwl-wc-toggle-pill .cwl-wc-toggle-dot {
            width: 10px; height: 10px; border-radius: 50%;
            background: #9ca3af; transition: background 0.2s; flex-shrink: 0;
        }

        #cwl-overlay .cwl-wc-grid-btn {
            margin-left: auto; width: 36px; height: 36px; display: flex; align-items: center;
            justify-content: center; background: #f1f3f7; border-radius: 10px; cursor: pointer;
            border: none; color: #6b7280; transition: background 0.2s, color 0.2s;
        }
        #cwl-overlay .cwl-wc-grid-btn:hover { background: #e5e8ef; color: #1f2937; }

        #cwl-overlay .cwl-wc-wallets-grid {
            display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
            overflow-y: auto; flex: 1; padding-right: 2px;
            scrollbar-width: thin; scrollbar-color: #cfd5e3 transparent;
        }
        #cwl-overlay .cwl-wc-wallets-grid::-webkit-scrollbar { width: 4px; }
        #cwl-overlay .cwl-wc-wallets-grid::-webkit-scrollbar-thumb { background: #cfd5e3; border-radius: 10px; }

        #cwl-overlay .cwl-wc-card {
            background: #f8f9fb; border-radius: 16px; padding: 14px 10px 12px;
            display: flex; flex-direction: column; align-items: center; gap: 10px;
            cursor: pointer; border: 1.5px solid transparent;
            transition: background 0.2s, border-color 0.2s, transform 0.15s;
            position: relative;
        }
        #cwl-overlay .cwl-wc-card:hover {
            background: #eef2ff; border-color: rgba(79,140,255,0.3); transform: translateY(-2px);
        }

        #cwl-overlay .cwl-wc-card-img-wrap {
            position: relative; width: 56px; height: 56px;
        }
        #cwl-overlay .cwl-wc-card-img-wrap img {
            width: 56px; height: 56px; border-radius: 14px; object-fit: cover;
        }

        #cwl-overlay .cwl-wc-badge {
            position: absolute; bottom: -4px; right: -4px; width: 18px; height: 18px;
            border-radius: 50%; background: #3b99fc;
            display: flex; align-items: center; justify-content: center;
            border: 2px solid #f8f9fb;
        }
        #cwl-overlay .cwl-wc-badge svg { width: 10px; height: 10px; }

        #cwl-overlay .cwl-wc-card p {
            margin: 0; font-size: 11.5px; font-weight: 600; color: #374151;
            text-align: center; line-height: 1.3; word-break: break-word; max-width: 100%;
        }

        @media (max-width: 600px) {
            #cwl-overlay .cwl-valletlist { padding: 20px 16px; }
            #cwl-overlay .cwl-wc-wallets-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
            #cwl-overlay .cwl-wc-card-img-wrap img { width: 50px; height: 50px; }
            #cwl-overlay .cwl-wc-card-img-wrap { width: 50px; height: 50px; }
        }