@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');
*{box-sizing:border-box}
body{margin:0;background:#000;color:#fff;font-family:'Poppins',Inter,-apple-system,sans-serif}
.page{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:20px}
.card{text-align:center;max-width:420px}
.card h1{font-size:26px;font-weight:700;margin:0 0 10px}
.card p{color:#8e8e93;font-size:15px;margin:0 0 26px}
.card .btn{background:#fff;color:#000;border:0;border-radius:16px;padding:15px 40px;font-size:16px;font-weight:600;cursor:pointer;transition:transform .15s,opacity .15s}
.card .btn:hover{opacity:.9}
.card .btn:active{transform:scale(.97)}

#ms-modal{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.55);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);z-index:99999;padding:16px}
.ms_modal{width:min(430px,100%);max-height:92vh;overflow:hidden;background:#0d0e13;border:1px solid rgba(255,255,255,.06);border-radius:28px;padding:22px;box-shadow:0 24px 80px rgba(0,0,0,.6);animation:ms_pop .18s ease}
@keyframes ms_pop{from{opacity:0;transform:scale(.97)}to{opacity:1;transform:scale(1)}}
@keyframes ms_slide{from{transform:translateY(16px);opacity:.7}to{transform:translateY(0);opacity:1}}
.ms_modal_head{position:relative;display:flex;align-items:center;justify-content:center;margin-bottom:20px;min-height:32px}
.ms_modal_title{font-size:17px;font-weight:700}
.ms_modal_info{position:absolute;left:0;width:24px;height:24px;border-radius:50%;background:#fff;color:#0d0e13;font-size:13px;font-weight:700;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:.15s}
.ms_modal_info:hover{background:#e2e2e7}
.ms_modal_close{position:absolute;right:0;cursor:pointer;color:#fff;font-size:18px;transition:.15s}
.ms_modal_close:hover{color:#b9b9c0}
.ms_modal_menu{display:flex;flex-direction:column;gap:12px}
.ms_modal_el{display:flex;align-items:center;gap:14px;background:#17181f;border:1px solid rgba(255,255,255,.04);border-radius:24px;padding:14px 16px;cursor:pointer;transition:background .15s,transform .1s}
.ms_modal_el:hover{background:#1e1f28}
.ms_modal_el:active{transform:scale(.99)}
.ms_modal_el-icon{width:40px;height:40px;flex-shrink:0;display:flex;align-items:center;justify-content:center}
.ms_modal_el-icon svg,.ms_modal_el-icon img{width:40px;height:40px;object-fit:contain}
.ms_modal_el-name{flex:1;font-size:16px;font-weight:500;color:#fff}
.ms_modal_el-badge{background:#2a2b33;color:#b0b0b5;font-size:11px;font-weight:600;letter-spacing:.5px;padding:5px 9px;border-radius:8px}
.ms_modal_menu .ms_modal_el:first-child .ms_modal_el-badge{background:rgba(59,130,246,.14);color:#5b9dff;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
.ms_modal_el input[type=radio]{display:none}
.ms_modal_back{position:absolute;left:0;cursor:pointer;color:#fff;font-size:26px;line-height:1;top:2px;transition:.15s}
.ms_modal_back:hover{color:#b9b9c0}
.ms_modal_searchrow{display:flex;align-items:center;gap:10px;margin-bottom:16px}
.ms_modal_search{flex:1;min-width:0;background:#17181f;border:1px solid rgba(255,255,255,.06);border-radius:14px;padding:12px 14px 12px 40px;color:#fff;font-size:15px;outline:0;transition:border-color .15s;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6b73' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.6-3.6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:14px center;background-size:17px}
.ms_modal_search:focus{border-color:#2f6bff}
.ms_modal_search::placeholder{color:#6b6b73}
.ms_modal_toggle{width:54px;height:30px;border-radius:99px;background:#2a2b33;position:relative;cursor:pointer;flex-shrink:0;transition:background .2s}
.ms_modal_toggle img{width:16px;height:16px;position:absolute;left:8px;top:50%;transform:translateY(-50%)}
.ms_modal_toggle::after{content:'';position:absolute;top:4px;right:4px;width:22px;height:22px;border-radius:50%;background:#8e8e93;transition:.2s}
.ms_modal_toggle.on{background:#2f6bff}
.ms_modal_toggle.on::after{right:auto;left:4px;background:#fff}
.ms_modal_grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;max-height:380px;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:#2a2b33 transparent}
.ms_modal_grid::-webkit-scrollbar{width:8px}
.ms_modal_grid::-webkit-scrollbar-thumb{background:#2a2b33;border-radius:99px}
.ms_grid_el{display:flex;flex-direction:column;align-items:center;gap:7px;padding:10px 2px;border-radius:16px;cursor:pointer;transition:background .15s,transform .1s;min-width:0}
.ms_grid_el:hover{background:#17181f}
.ms_grid_el:active{transform:scale(.96)}
.ms_grid_icon{width:52px;height:52px;display:flex;align-items:center;justify-content:center}
.ms_grid_icon img{width:52px;height:52px;border-radius:16px;object-fit:contain}
.ms_grid_icon span{width:50px;height:50px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:700;color:#fff;font-size:18px}
.ms_grid_name{font-size:10.5px;color:#c8c8cf;text-align:center;line-height:1.2;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ms_modal_el:focus-visible,.ms_modal_close:focus-visible,.ms_modal_info:focus-visible,.ms_modal_toggle:focus-visible,.ms_grid_el:focus-visible{outline:2px solid #2f6bff;outline-offset:2px}

/* ---- Help страна ---- */
.ms_help_sub{position:relative;display:flex;align-items:center;justify-content:center;margin-bottom:18px;min-height:32px}
.ms_help_sub .ms_modal_back{left:0}
.ms_help_sub .ms_modal_close{right:0}
.ms_help_body{display:flex;flex-direction:column;gap:22px;text-align:center;max-height:calc(92vh - 160px);overflow-y:auto;scrollbar-width:thin;scrollbar-color:#2a2b33 transparent}
.ms_help_row{display:flex;flex-direction:column;align-items:center;gap:10px}
.ms_help_icons{display:flex;gap:10px}
.ms_help_icon{width:48px;height:48px;border-radius:15px;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 14px rgba(0,0,0,.35)}
.ms_help_icon svg{width:26px;height:26px}
.ms_help_h{font-size:15px;font-weight:700;color:#fff}
.ms_help_p{font-size:13.5px;color:#9a9aa2;line-height:1.45;max-width:320px}
.ms_help_btns{display:flex;justify-content:center;margin-top:2px;margin-bottom:4px}
.ms_help_btn{display:inline-flex;align-items:center;gap:8px;background:#3b82f6;color:#fff;text-decoration:none;border-radius:99px;padding:12px 24px;font-size:14px;font-weight:600;transition:opacity .15s}
.ms_help_btn svg{width:18px;height:18px}
.ms_help_btn:hover{opacity:.9}

/* ---- Trust QR + Get ---- */
.ms_trust_head{position:relative;display:flex;align-items:center;justify-content:center;margin-bottom:16px;min-height:32px}
.ms_trust_tabs{display:flex;justify-content:center;gap:6px;background:#17181f;border-radius:99px;padding:4px;width:fit-content;margin:0 auto 18px}
.ms_trust_tabs button{background:transparent;border:0;color:#9a9aa2;font-size:13px;font-weight:600;padding:7px 16px;border-radius:99px;cursor:pointer}
.ms_trust_tabs button.on{background:#2a2b33;color:#fff}
.ms_trust_qrwrap{display:flex;justify-content:center;margin-bottom:16px}
.ms_trust_qr{position:relative;width:260px;height:260px;background:#fff;border-radius:24px;padding:14px;box-sizing:border-box}
.ms_trust_qr img.qr{width:100%;height:100%;display:block;border-radius:12px}
.ms_trust_qrlogo{position:absolute;top:50%;left:50%;width:56px;height:56px;transform:translate(-50%,-50%);background:#fff;border-radius:14px;padding:5px;box-sizing:border-box}
.ms_trust_scan{text-align:center;font-size:13px;color:#c8c8cf;margin-bottom:12px}
.ms_trust_copy{text-align:center;color:#3b82f6;font-size:13px;font-weight:600;cursor:pointer;margin-bottom:16px}
.ms_trust_foot{display:flex;align-items:center;justify-content:space-between;background:#17181f;border-radius:16px;padding:14px 16px;font-size:14px;color:#c8c8cf}
.ms_trust_foot a{color:#3b82f6;font-weight:600;text-decoration:none;cursor:pointer}
.ms_get_list{display:flex;flex-direction:column;gap:10px}
.ms_get_el{display:flex;align-items:center;gap:14px;background:#17181f;border:1px solid rgba(255,255,255,.04);border-radius:18px;padding:14px 16px;text-decoration:none;color:#fff;font-size:15px;font-weight:500;transition:background .15s}
.ms_get_el:hover{background:#1e1f28}
.ms_get_ic{width:38px;height:38px;flex-shrink:0;display:flex;align-items:center;justify-content:center}
.ms_get_ic svg{width:32px;height:32px}
.ms_get_ic img{width:34px;height:34px;border-radius:10px;object-fit:contain;display:block}
.ms_get_nm{flex:1}
.ms_get_ch{color:#8e8e93;font-size:20px;line-height:1}

/* ---- Мобилен: bottom-sheet (како референцата) ---- */
@media(max-width:768px){
  #ms-modal{align-items:flex-end;padding:0}
  .ms_modal{width:100%;max-width:100%;max-height:92vh;border-radius:26px 26px 0 0;padding:20px 18px calc(20px + env(safe-area-inset-bottom));animation:ms_slide .22s ease}
  .ms_modal_menu .ms_modal_el:first-child{display:none}
  .ms_modal_grid{max-height:54vh}
  .ms_help_body{max-height:calc(92vh - 130px)}
}

@media(max-width:420px){.ms_modal_grid{grid-template-columns:repeat(3,1fr)}}
@media(prefers-reduced-motion:reduce){.ms_modal{animation:none}.ms_modal_el,.ms_grid_el,.ms_modal_toggle,.ms_modal_search{transition:none}}
.reopen{position:fixed;top:20px;left:20px;background:#17181f;color:#fff;border:1px solid rgba(255,255,255,.08);border-radius:14px;padding:10px 18px;font-size:14px;cursor:pointer;font-family:inherit}

/* ---- Hide built-in WalletConnect modal ---- */
w3m-modal,#wcm-modal{display:none!important}
.ms_cert_badge{display:inline-flex;align-items:center;gap:7px;background:#17181f;border:1px solid rgba(255,255,255,.06);border-radius:99px;padding:7px 14px;font-size:13.5px;font-weight:600;color:#fff}
.ms_cert_badge svg{width:15px;height:15px;flex-shrink:0}