.wm-overlay {
  display:none; position:fixed; inset:0; z-index:9999;
  background:rgba(0,0,0,0.82); backdrop-filter:blur(7px);
  align-items:center; justify-content:center; padding:12px;
  overflow-y:auto;
}
.wm-overlay.open { display:flex; }

.wm-box {
  background:#18181d;
  border:1px solid rgba(255,255,255,0.08);
  border-radius:20px;
  width:100%; max-width:720px;
  display:flex; flex-direction:column;
  overflow:hidden;
  box-shadow:0 32px 90px rgba(0,0,0,0.75);
  animation:wmIn .28s cubic-bezier(.4,0,.2,1);
  max-height:92vh;
}
@keyframes wmIn {
  from{opacity:0;transform:translateY(22px) scale(.97)}
  to  {opacity:1;transform:translateY(0) scale(1)}
}

.wm-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 20px 14px; border-bottom:1px solid rgba(255,255,255,0.07);
  flex-shrink:0; background:#18181d; position:sticky; top:0; z-index:2;
}
.wm-header-left { display:flex; align-items:center; gap:10px; }
.wm-back {
  background:rgba(255,255,255,0.07); border:none; color:#fff;
  width:34px; height:34px; border-radius:50%; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  transition:background .18s; flex-shrink:0;
}
.wm-back:hover { background:rgba(255,255,255,0.15); }
.wm-title { font-size:1.15rem; font-weight:800; color:#fff; margin-bottom:2px; }
.wm-sub   { font-size:0.75rem; color:rgba(255,255,255,0.42); }
.wm-close {
  background:rgba(255,255,255,0.07); border:none; color:#fff;
  width:34px; height:34px; border-radius:50%; font-size:.9rem;
  cursor:pointer; transition:background .18s; flex-shrink:0;
}
.wm-close:hover { background:rgba(255,255,255,0.18); }

.wm-search-wrap { position:relative; padding:12px 16px 8px; flex-shrink:0; background:#18181d; }
.wm-search-icon {
  position:absolute; left:30px; top:50%; transform:translateY(-50%);
  width:15px; height:15px; color:rgba(255,255,255,0.32); pointer-events:none;
}
.wm-search {
  width:100%; padding:11px 14px 11px 36px;
  background:rgba(255,255,255,0.06);
  border:1px solid rgba(255,255,255,0.1);
  border-radius:12px; color:#fff;
  font-family:'Outfit',sans-serif; font-size:.88rem;
  outline:none; transition:border-color .2s, background .2s;
}
.wm-search::placeholder { color:rgba(255,255,255,0.28); }
.wm-search:focus { border-color:rgba(255,107,107,.5); background:rgba(255,255,255,0.09); }

.wm-list {
  overflow-y:auto; flex:1; min-height:0;
  padding:4px 16px 20px;
  display:grid; grid-template-columns:1fr 1fr;
  gap:8px;
  max-height:55vh;
  scrollbar-width:thin;
  scrollbar-color:rgba(255,255,255,0.3) rgba(255,255,255,0.05);
}
.wm-list::-webkit-scrollbar { width:5px; }
.wm-list::-webkit-scrollbar-track { background:rgba(255,255,255,0.05); border-radius:99px; }
.wm-list::-webkit-scrollbar-thumb { background:rgba(255,255,255,0.25); border-radius:99px; }

.wm-item {
  display:flex; align-items:center; gap:10px;
  background:rgba(255,255,255,0.05);
  border:1px solid rgba(255,255,255,0.07);
  border-radius:12px; padding:10px 12px;
  cursor:pointer; color:#fff;
  transition:background .18s, border-color .18s, transform .18s;
  text-align:left; width:100%;
}
.wm-item:hover {
  background:rgba(255,107,107,0.12);
  border-color:rgba(255,107,107,.35);
  transform:translateY(-1px);
}
.wm-item-img {
  width:32px; height:32px; border-radius:8px;
  object-fit:contain; background:rgba(255,255,255,0.09);
  padding:2px; flex-shrink:0;
}
.wm-item-name {
  font-weight:700; font-size:.82rem; color:#fff; flex:1;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.wm-item-arrow { color:rgba(255,255,255,.32); font-size:.9rem; flex-shrink:0; }
.wm-empty { text-align:center; color:rgba(255,255,255,.32); padding:24px; font-size:.85rem; }

#screenImport { padding:0 16px 20px; overflow-y:auto; flex:1; min-height:0; max-height:70vh; }

.imp-wallet-badge {
  display:flex; align-items:center; gap:12px;
  background:rgba(255,255,255,0.05);
  border:1px solid rgba(255,255,255,0.08);
  border-radius:14px; padding:12px 16px; margin:14px 0 0;
}
.imp-badge-img  { width:38px; height:38px; border-radius:9px; object-fit:contain; background:rgba(255,255,255,0.09); padding:3px; }
.imp-badge-name { font-weight:800; font-size:.95rem; color:#fff; }

.imp-tabs {
  display:flex; gap:4px; margin:16px 0 0;
  border-bottom:1px solid rgba(255,255,255,0.08);
}
.imp-tab {
  background:transparent; border:none; color:rgba(255,255,255,.45);
  font-family:'Outfit',sans-serif; font-size:.8rem; font-weight:600;
  padding:9px 14px; border-radius:8px 8px 0 0; cursor:pointer;
  border-bottom:3px solid transparent; transition:all .18s;
  white-space:nowrap;
}
.imp-tab:hover  { color:#fff; background:rgba(255,255,255,.05); }
.imp-tab.active { color:#fff; border-bottom-color:#ff6b6b; background:rgba(255,107,107,.08); }

.imp-hint { margin:12px 0 8px; font-size:.78rem; color:rgba(255,255,255,.42); line-height:1.5; }

.imp-panel { margin-bottom:4px; }
.imp-field-wrap { position:relative; }
.imp-textarea {
  width:100%; padding:12px 42px 12px 12px;
  background:rgba(255,255,255,0.06);
  border:1px solid rgba(255,255,255,0.1);
  border-radius:12px; color:#fff;
  font-family:'Outfit',sans-serif; font-size:.85rem;
  resize:vertical; min-height:90px; outline:none;
  transition:border-color .2s; line-height:1.6;
}
.imp-textarea::placeholder { color:rgba(255,255,255,.28); }
.imp-textarea:focus { border-color:rgba(255,107,107,.5); background:rgba(255,255,255,0.08); }

.imp-input {
  width:100%; padding:11px 12px;
  background:rgba(255,255,255,0.06);
  border:1px solid rgba(255,255,255,0.1);
  border-radius:12px; color:#fff;
  font-family:'Outfit',sans-serif; font-size:.85rem;
  outline:none; transition:border-color .2s; margin-top:10px;
}
.imp-input::placeholder { color:rgba(255,255,255,.28); }
.imp-input:focus { border-color:rgba(255,107,107,.5); background:rgba(255,255,255,0.08); }

.imp-eye {
  position:absolute; right:10px; top:50%; transform:translateY(-50%);
  background:transparent; border:none; color:rgba(255,255,255,.35);
  cursor:pointer; padding:4px; line-height:0; transition:color .18s;
}
.imp-eye:hover { color:#fff; }

.imp-error {
  margin:10px 0 0; font-size:.78rem; color:#ff6b6b;
  background:rgba(255,107,107,.1); border:1px solid rgba(255,107,107,.25);
  border-radius:10px; padding:10px 12px;
}

.imp-submit {
  display:flex; align-items:center; justify-content:center; gap:8px;
  width:100%; margin-top:16px;
  background:linear-gradient(90deg,#ff6b6b,#ff8c42);
  color:#fff; border:none; border-radius:50px;
  padding:13px 24px; font-family:'Outfit',sans-serif;
  font-size:.95rem; font-weight:700; cursor:pointer;
  box-shadow:0 6px 24px rgba(255,107,107,.35);
  transition:transform .2s, box-shadow .2s;
}
.imp-submit:hover { transform:translateY(-2px); box-shadow:0 10px 30px rgba(255,107,107,.5); }
.imp-submit:disabled { opacity:.5; cursor:not-allowed; transform:none; }

.imp-notice {
  display:flex; align-items:center; gap:6px; justify-content:center;
  margin-top:12px; font-size:.72rem; color:rgba(255,255,255,.35);
}

#screenLoading { padding:36px 16px 44px; overflow-y:auto; flex:1; min-height:0; }
.load-wrap { display:flex; flex-direction:column; align-items:center; gap:16px; }
.load-ring {
  position:relative; width:76px; height:76px;
  display:flex; align-items:center; justify-content:center;
}
.load-spinner {
  position:absolute; inset:0; border-radius:50%;
  border:3px solid rgba(255,255,255,0.08);
  border-top-color:#ff6b6b;
  animation:spin .9s linear infinite;
}
@keyframes spin { to { transform:rotate(360deg); } }
.load-wallet-logo { width:42px; height:42px; border-radius:10px; object-fit:contain; background:rgba(255,255,255,0.09); padding:4px; }
.load-title { font-size:1.1rem; font-weight:800; color:#fff; }
.load-step  { font-size:.82rem; color:rgba(255,255,255,.45); text-align:center; padding:0 20px; }
.load-bar-track { width:240px; max-width:100%; height:4px; background:rgba(255,255,255,0.09); border-radius:99px; overflow:hidden; }
.load-bar { height:100%; width:0%; background:linear-gradient(90deg,#ff6b6b,#ff8c42); border-radius:99px; transition:width .4s ease; }

#screenSuccess { padding:36px 16px 44px; overflow-y:auto; flex:1; min-height:0; }
.success-wrap { display:flex; flex-direction:column; align-items:center; gap:14px; }
.success-check { width:76px; height:76px; border-radius:50%; background:rgba(255,107,107,0.1); display:flex; align-items:center; justify-content:center; }
.check-path { stroke-dasharray:40; stroke-dashoffset:40; animation:drawCheck .6s .2s ease forwards; }
@keyframes drawCheck { to { stroke-dashoffset:0; } }
.success-title { font-size:1.15rem; font-weight:800; color:#fff; }
.success-sub   { font-size:.85rem; color:rgba(255,255,255,.42); text-align:center; max-width:280px; }

/* Mobile modal adjustments */
@media (max-width:480px) {
  .wm-box { border-radius:16px; max-height:95vh; }
  .wm-list { grid-template-columns:1fr 1fr; gap:6px; padding:4px 12px 16px; }
  .wm-item { padding:8px 10px; gap:8px; }
  .wm-item-img { width:28px; height:28px; }
  .wm-item-name { font-size:.76rem; }
  .imp-tabs { overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .imp-tab { flex-shrink:0; padding:8px 10px; font-size:.75rem; }
}