/* ══════════════════════════════════════════════════════════════════════════
   UPLIST — modals, sheets, toasts
   ─────────────────────────────────────────────────────────────────────────
   One overlay component does wallet connect and every confirmation. On
   phones it becomes a bottom sheet, because a centred dialog with a form in
   it is unreachable one-handed.
   ══════════════════════════════════════════════════════════════════════════ */

.modal-root{position:fixed;inset:0;z-index:120;display:grid;place-items:center;padding:22px}
.modal-root[hidden]{display:none}
.mo-scrim{
  position:absolute;inset:0;background:rgba(22,19,15,.55);
  backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);
  animation:fade .16s ease-out
}
:root[data-theme="dark"] .mo-scrim{background:rgba(0,0,0,.68)}
@keyframes fade{from{opacity:0}to{opacity:1}}

.mo{
  position:relative;width:100%;max-width:412px;max-height:calc(100vh - 44px);
  display:flex;flex-direction:column;
  background:var(--sheet);border:1px solid var(--ink);border-radius:var(--r);
  box-shadow:6px 6px 0 rgba(22,19,15,.28);
  animation:pop .18s cubic-bezier(.2,.9,.3,1.1)
}
:root[data-theme="dark"] .mo{box-shadow:6px 6px 0 rgba(0,0,0,.5)}
.mo.wide{max-width:520px}
@keyframes pop{from{opacity:0;transform:translateY(10px) scale(.985)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.mo,.mo-scrim{animation:none}}

.mo-hd{
  display:flex;align-items:center;gap:10px;padding:13px 15px;
  border-bottom:1px solid var(--ink);background:var(--ink);color:var(--paper);flex:none
}
:root[data-theme="dark"] .mo-hd{background:var(--pink-2);color:var(--ink)}
.mo-hd h3{font-size:13px;font-weight:700;letter-spacing:.1em;text-transform:uppercase}
.mo-hd .sp{flex:1}
.mo-x{background:none;border:0;color:inherit;cursor:pointer;font-size:22px;line-height:1;opacity:.7;padding:0 2px}
.mo-x:hover{opacity:1}

.mo-bd{padding:16px;overflow:auto;flex:1}
.mo-ft{padding:13px 15px;border-top:1px solid var(--rule);background:var(--paper-2);display:flex;gap:9px;flex:none}
.mo-ft .btn{flex:1}

/* ══ wallet picker ══ */
.wl{display:grid;gap:8px}
.wl button{
  display:flex;align-items:center;gap:12px;padding:12px 13px;width:100%;text-align:left;
  background:var(--sheet);border:1px solid var(--rule);border-radius:var(--r);cursor:pointer
}
.wl button:hover{border-color:var(--ink);box-shadow:var(--press);transform:translate(-1px,-1px)}
.wl .ic{
  width:32px;height:32px;flex:none;border-radius:6px;display:grid;place-items:center;
  font-weight:800;color:#fff;font-size:15px
}
.wl .nm{flex:1}
.wl .nm b{display:block;font-size:14px}
.wl .nm span{font-size:11.5px;color:var(--ink-3)}

/* Same row, but it leaves the site — an install link, not a connect button. */
.wl-link{
  display:flex;align-items:center;gap:12px;padding:12px 13px;
  background:var(--sheet);border:1px solid var(--rule);border-radius:var(--r)
}
.wl-link:hover{border-color:var(--ink);box-shadow:var(--press);transform:translate(-1px,-1px)}
.mo-copy{font-size:14px;line-height:1.6;color:var(--ink-2);margin-bottom:14px}

.mo-note{
  margin-top:14px;padding:11px 12px;border:1px dashed var(--rule);border-radius:2px;
  font-size:12px;line-height:1.55;color:var(--ink-3)
}

.co-rows{border:1px solid var(--rule);border-radius:var(--r);overflow:hidden}
.co-row{display:flex;gap:12px;padding:10px 13px;font-size:13.5px;border-bottom:1px solid var(--rule-2);align-items:baseline}
.co-row:last-child{border-bottom:0}
.co-row .k{flex:1;color:var(--ink-3)}
.co-row .v{font-family:var(--mono);font-variant-numeric:tabular-nums;text-align:right}
.co-row.tot{background:var(--pink);font-weight:600}
:root[data-theme="dark"] .co-row.tot{background:var(--paper-2)}
.co-row.tot .v{font-size:15px}

/* ══ pending / success ══ */
.mo-state{text-align:center;padding:26px 8px}
/* The mark, at rest. Not a spinner: nothing is in progress. */
.mo-state .wait{width:46px;height:46px;margin:0 auto 16px;opacity:.5}
.mo-state .wait svg{width:100%;height:100%}
.mo-state .tick{
  width:44px;height:44px;margin:0 auto 16px;border-radius:50%;background:var(--up);
  display:grid;place-items:center
}
.mo-state .tick svg{width:22px;height:22px;fill:none;stroke:#fff;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.mo-state h4{font-size:17px;margin-bottom:7px;letter-spacing:-.02em}
.mo-state p{font-size:13.5px;color:var(--ink-3);line-height:1.6;max-width:36ch;margin:0 auto}

/* ══ toasts ══ */
.toasts{position:fixed;right:18px;bottom:18px;z-index:140;display:flex;flex-direction:column;gap:8px;pointer-events:none}
.toast{
  display:flex;align-items:flex-start;gap:10px;max-width:340px;
  padding:11px 13px;background:var(--ink);color:var(--paper);border-radius:var(--r);
  font-size:13px;line-height:1.45;pointer-events:auto;
  box-shadow:3px 3px 0 rgba(22,19,15,.25);animation:slidein .2s ease-out
}
:root[data-theme="dark"] .toast{background:var(--sheet);color:var(--ink);border:1px solid var(--rule)}
@keyframes slidein{from{opacity:0;transform:translateX(16px)}to{opacity:1;transform:none}}
.toast.out{opacity:0;transform:translateX(16px);transition:.2s}
.toast .ic{flex:none;width:17px;height:17px;margin-top:1px}
.toast .ic svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.toast.ok .ic{color:var(--up)}
.toast.bad .ic{color:var(--down)}
.toast b{display:block;font-weight:600;margin-bottom:1px}
.toast a{text-decoration:underline;opacity:.75}

@media (max-width:560px){
  .modal-root{padding:0;place-items:end center}
  .mo{
    max-width:none;border-radius:var(--r) var(--r) 0 0;border-bottom:0;
    max-height:92vh;animation:sheetup .22s cubic-bezier(.2,.9,.3,1)
  }
  @keyframes sheetup{from{transform:translateY(100%)}to{transform:none}}
  .toasts{left:12px;right:12px;bottom:12px}
  .toast{max-width:none}
}
