   /* ── Overlay ── */
    #cwl-overlay {
      position: fixed; inset: 0;
      background: rgba(0,0,0,0.75);
      z-index: 9990;
      display: flex; align-items: center; justify-content: center;
      opacity: 0; pointer-events: none;
      transition: opacity 0.3s ease;
    }
    #cwl-overlay.cwl-open { opacity: 1; pointer-events: all; }

    /* ── Modal shell — fixed size so height never changes between views ── */
    #cwl-modal {
      background: #0c1018;
      border-radius: 22px;
      width: min(390px, 92vw);
      height: 415px;
      overflow: hidden;
      display: flex; flex-direction: column;
      transform: scale(0.95); opacity: 0;
      transition: transform 0.3s ease, opacity 0.3s ease;
    }
    #cwl-overlay.cwl-open #cwl-modal { transform: scale(1); opacity: 1; }

    /* ── Views — each fills the full fixed modal height ── */
    .cwl-view { display: none; flex-direction: column; height: 100%; overflow: hidden; }
    .cwl-view.cwl-active { display: flex; }

    /* ══════════════════════════════════
       VIEW 1 — Main list
    ══════════════════════════════════ */
    #view-main .close-row {
      display: flex; justify-content: center;
      padding-top: 14px; flex-shrink: 0;
    }
    #view-main .modal-close {
      width: 42px; height: 42px; border-radius: 50%;
      background: #1c2030; border: none;
      color: #7a7f96; font-size: 18px;
      display: flex; align-items: center; justify-content: center;
      cursor: pointer; transition: background 0.15s;
    }
    #view-main .modal-close:hover { background: #242a3a; color: #aab0c8; }

    #view-main .modal-title {
      text-align: center; font-size: 28px; font-weight: 300;
      color: #fff; line-height: 1.28;
      padding: 14px 36px 18px; flex-shrink: 0;
    }

    .wallet-list {
      display: flex; flex-direction: column;
      padding: 0 18px; overflow-y: auto; flex: 1;
    }
    /* ── Each wallet row ── */
    .wallet-item {
      display: flex; align-items: center; gap: 18px;
      padding: 10px 10px;
      cursor: pointer; border-radius: 10px;
      border: none; background: none;
      width: 100%; text-align: left;
      font-family: inherit;
      transition: background 0.12s;
    }
    .wallet-item:hover { background: rgba(255,255,255,0.05); }

    /* ── Wallet icon — swap src to change icon ── */
    .wallet-icon {
      width: 48px; height: 48px;
      border-radius: 12px;
      flex-shrink: 0; overflow: hidden;
    }
    .wallet-icon img {
      width: 100%; height: 100%;
      object-fit: cover; border-radius: 12px;
      display: block;
    }

    .wallet-label {
      font-size: 20px; font-weight: 400; color: #fff;
    }

    .modal-footer {
      flex-shrink: 0; margin-top: 10px; padding: 12px;
      text-align: center; font-size: 14px; color: #3d4257;
      border-top: 1px solid #13181f;
    }

    /* ══════════════════════════════════
       SHARED top-bar (views 2-4)
    ══════════════════════════════════ */
    .cwl-inner { padding: 22px 22px 16px; display: flex; flex-direction: column; flex: 1; overflow-y: auto; height: 100%; }
    .cwl-top-bar {
      display: flex; justify-content: space-between; align-items: center;
      margin-bottom: 20px; flex-shrink: 0;
    }
    .cwl-back-link {
      font-size: 14px; font-weight: 600; color: #5b8def;
      cursor: pointer; background: none; border: none; font-family: inherit;
    }
    .cwl-back-link:hover { color: #4a7cd6; }
    .cwl-x-btn {
      background: none; border: none; color: #7a7f96;
      font-size: 22px; cursor: pointer; line-height: 1;
    }
    .cwl-x-btn:hover { color: #aab0c8; }

    /* ══════════════════════════════════
       VIEW 2 — Connecting / Loading
    ══════════════════════════════════ */
    .cwl-loader-center { display: flex; justify-content: center; margin: 40px 0 22px; }
    .cwl-wallet-loader {
      position: relative; width: 90px; height: 90px;
      display: flex; align-items: center; justify-content: center;
    }
    .cwl-wallet-loader img {
      width: 60px; height: 60px; border-radius: 16px;
      object-fit: cover; z-index: 2;
    }
    .cwl-loader-svg { position: absolute; width: 90px; height: 90px; transform: rotate(-90deg); }
    .cwl-loader-rect {
      fill: none; stroke: #5b8def; stroke-width: 4;
      stroke-linecap: round; stroke-dasharray: 60 300;
      animation: cwlStroke 1.6s linear infinite;
    }
    @keyframes cwlStroke { 0%{stroke-dashoffset:0} 100%{stroke-dashoffset:-360} }

    .cwl-connecting-name { text-align: center; font-size: 16px; font-weight: 600; color: #e4e6eb; margin-bottom: 8px; }
    .cwl-loading-text { text-align: center; font-size: 13px; color: #8e9197; }
    .cwl-dots::after {
      content: ''; animation: cwlDots 1s steps(3,end) infinite;
    }
    @keyframes cwlDots {
      0%,20%{content:''} 40%{content:'.'} 60%{content:'..'} 80%,100%{content:'...'}
    }
    .cwl-secured-note {
      margin-top: auto; text-align: center; font-size: 11px; color: #e4e6eb;
      background: rgba(91,141,239,0.08); border: 1px solid rgba(91,141,239,0.18);
      border-radius: 8px; padding: 10px;
    }

    /* ══════════════════════════════════
       VIEW 3 — Failed
    ══════════════════════════════════ */
    .cwl-failed-center { display: flex; flex-direction: column; align-items: center; flex: 1; padding: 20px 0; overflow-y: auto; justify-content: center; }
    .cwl-failure-circle {
      width: 120px; height: 120px; border-radius: 50%;
      background: rgba(239,68,68,0.1); border: 2px solid rgba(239,68,68,0.35);
      display: flex; align-items: center; justify-content: center;
      font-size: 52px; color: #ef4444; margin-bottom: 20px;
      animation: cwlPulse 1.5s ease-in-out infinite;
    }
    @keyframes cwlPulse { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.05);opacity:.75} }

    .cwl-failure-title { font-size: 16px; font-weight: 700; color: #ef4444; margin-bottom: 12px; }
    .cwl-failure-desc { font-size: 13px; color: #8e9197; text-align: center; line-height: 1.5; padding: 0 10px; }
    .cwl-error-bar { width: 100%; height: 3px; background: rgba(239,68,68,0.2); border-radius: 2px; margin-top: 18px; overflow: hidden; }
    .cwl-error-fill {
      height: 100%; background: #ef4444; border-radius: 2px;
      animation: cwlShrink 2s linear forwards; transform-origin: left;
    }
    @keyframes cwlShrink { from{transform:scaleX(1)} to{transform:scaleX(0)} }

    .cwl-failed-banner {
      position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
      background: #ef4444; color: #fff; padding: 12px 22px;
      border-radius: 10px; font-size: 14px; font-family: 'Sora', system-ui, sans-serif;
      z-index: 99998; animation: cwlFadeInOut 3.5s forwards;
    }
    @keyframes cwlFadeInOut { 0%{opacity:0} 10%,80%{opacity:1} 100%{opacity:0} }

    /* ══════════════════════════════════
       VIEW 4 — Restore / Seed phrase
    ══════════════════════════════════ */
    #view-restore .cwl-inner { overflow-y: auto; }
    .cwl-restore-toprow {
      display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-shrink: 0;
    }
    .cwl-restore-toprow img { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; }
    .cwl-restore-toprow span { font-size: 15px; font-weight: 500; color: #e4e6eb; flex: 1; }

    .cwl-tabs { display: flex; gap: 22px; margin-bottom: 6px; flex-shrink: 0; }
    .cwl-tab {
      font-size: 13px; font-weight: 600; color: #8e9197;
      cursor: pointer; background: none; border: none; font-family: inherit;
      padding-bottom: 4px; border-bottom: 2px solid transparent;
      transition: color 0.2s, border-color 0.2s;
    }
    .cwl-tab.active { color: #5b8def; border-bottom-color: #5b8def; }

    .cwl-divider-line { height: 1px; background: rgba(255,255,255,0.08); margin: 6px 0 14px; flex-shrink: 0; }

    #cwl-restore-input {
      width: 100%; padding: 10px 12px; border-radius: 8px;
      border: 1px solid #3a3b3e; background: #1e2232;
      color: #e4e6eb; font-size: 14px; font-family: inherit;
      outline: none; resize: none; flex-shrink: 0;
    }
    #cwl-restore-input:focus { border-color: rgba(91,141,239,0.5); }

    #cwl-seed-hint { font-size: 12px; color: #8e9197; margin: 6px 0 14px; flex-shrink: 0; }

    #cwl-proceed-btn {
      width: 100%; padding: 12px; border: none; border-radius: 8px;
      background: #5b8def; color: #fff; font-size: 14px; font-weight: 500;
      cursor: pointer; font-family: inherit; flex-shrink: 0;
      transition: background 0.2s;
    }
    #cwl-proceed-btn:hover { background: #4a7cd6; }

    .cwl-enc-note {
      display: flex; align-items: center; gap: 8px; margin-top: 12px;
      background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.25);
      border-radius: 8px; padding: 9px 10px; flex-shrink: 0;
    }
    .cwl-enc-note p { font-size: 10px; color: #8e9197; font-weight: 500; }

    /* ══════════════════════════════════
       VIEW 5 — WalletConnect grid
    ══════════════════════════════════ */
    #view-wc .cwl-inner { padding: 16px 16px 0; overflow: hidden; }
    .cwl-wc-header {
      display: flex; align-items: center; justify-content: space-between;
      margin-bottom: 14px; flex-shrink: 0;
    }
    .cwl-wc-header .cwl-wc-title {
      display: flex; align-items: center; gap: 8px;
      font-size: 17px; font-weight: 700; color: #e4e6eb;
    }
    .cwl-wc-header .cwl-wc-title img { width: 26px; height: 26px; border-radius: 6px; }

    .cwl-wc-search-wrap {
      background: #1e2232; border-radius: 12px; padding: 10px 14px;
      margin-bottom: 14px; flex-shrink: 0;
      border: 1.5px solid transparent; transition: border-color 0.2s;
    }
    .cwl-wc-search-wrap:focus-within { border-color: rgba(91,141,239,0.4); }
    #cwl-wc-search {
      background: none; border: none; outline: none;
      font-size: 14px; color: #e4e6eb; width: 100%; font-family: inherit;
    }
    #cwl-wc-search::placeholder { color: #8e9197; }

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

    .cwl-wc-item {
      background: #1e2232; border-radius: 14px;
      padding: 14px 8px 12px;
      display: flex; flex-direction: column; align-items: center; gap: 8px;
      cursor: pointer; border: 1.5px solid transparent;
      transition: background 0.15s, border-color 0.15s, transform 0.1s;
      font-family: inherit;
    }
    .cwl-wc-item:hover { background: #252b3b; border-color: rgba(91,141,239,0.25); transform: translateY(-2px); }
    .cwl-wc-item img { width: 50px; height: 50px; border-radius: 12px; object-fit: cover; }
    .cwl-wc-item p { font-size: 11px; font-weight: 600; color: #e4e6eb; text-align: center; margin: 0; }

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

    /* ── Toast ── */
    #cwl-toast {
      position: fixed; top: -100px; left: 50%; transform: translateX(-50%);
      background: #1a1b1e; color: #e4e6eb;
      padding: 14px 22px; border-radius: 12px;
      box-shadow: 0 8px 20px rgba(0,0,0,0.5);
      border: 1px solid rgba(255,255,255,0.08);
      display: flex; align-items: center; gap: 10px;
      z-index: 99999; font-size: 14px; font-weight: 500;
      font-family: 'Sora', system-ui, sans-serif;
      transition: top 0.4s ease;
    }
    #cwl-toast.cwl-show { top: 20px; }
    .cwl-toast-icon {
      width: 22px; height: 22px; border-radius: 50%;
      background: rgba(239,68,68,0.15); color: #ef4444;
      display: flex; align-items: center; justify-content: center;
      font-size: 14px; font-weight: 700;
    }