.toast-wrap{
  position:fixed;top:22px;right:22px;z-index:10000;display:flex;flex-direction:column;
  gap:12px;pointer-events:none;max-width:calc(100vw - 44px);
}
.toast{
  pointer-events:auto;position:relative;display:flex;align-items:flex-start;gap:13px;
  min-width:300px;max-width:380px;padding:15px 16px 15px 15px;border-radius:15px;overflow:hidden;
  background:rgba(22,22,25,.82);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);
  border:1px solid var(--stroke);box-shadow:0 18px 50px rgba(0,0,0,.55);color:var(--txt);
  transform:translateX(130%) rotate(3deg);opacity:0;
  animation:toastIn .55s cubic-bezier(.2,1.1,.3,1) forwards;
}
.toast.leaving{animation:toastOut .38s cubic-bezier(.4,0,.6,1) forwards}
@keyframes toastIn{to{transform:translateX(0) rotate(0);opacity:1}}
@keyframes toastOut{to{transform:translateX(130%) scale(.9);opacity:0}}

/* left accent glow bar by type */
.toast::before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px}
.toast.success::before{background:linear-gradient(var(--pos),#1aa885)}
.toast.error::before{background:linear-gradient(var(--neg),#c93a4f)}
.toast.info::before{background:linear-gradient(var(--accent),var(--accent2))}
.toast.loading::before{background:linear-gradient(var(--accent),var(--accent2))}

.toast-ic{flex-shrink:0;width:30px;height:30px;border-radius:50%;display:grid;place-items:center;
  margin-top:1px}
.toast.success .toast-ic{background:rgba(37,208,160,.16)}
.toast.error .toast-ic{background:rgba(255,93,115,.16)}
.toast.info .toast-ic{background:rgba(253,185,19,.16)}
.toast.loading .toast-ic{background:rgba(253,185,19,.16)}
.toast-ic svg{width:17px;height:17px}

/* animated check draw */
.toast-ic .draw{stroke-dasharray:24;stroke-dashoffset:24;animation:draw .5s .1s ease forwards}
@keyframes draw{to{stroke-dashoffset:0}}
.toast.error .toast-ic{animation:shake .45s .05s both}
@keyframes shake{0%,100%{transform:translateX(0)}20%,60%{transform:translateX(-3px)}40%,80%{transform:translateX(3px)}}

/* loading spinner */
.toast-spin{width:17px;height:17px;border:2px solid rgba(253,185,19,.3);border-top-color:var(--accent);
  border-radius:50%;animation:tspin .7s linear infinite}
@keyframes tspin{to{transform:rotate(360deg)}}

.toast-body{flex:1;min-width:0;padding-right:6px}
.toast-title{font-weight:700;font-size:14px;letter-spacing:.2px;margin-bottom:2px}
.toast-msg{font-size:13px;color:var(--muted);line-height:1.45;word-wrap:break-word}
.toast-close{position:absolute;top:9px;right:10px;background:none;border:none;color:var(--muted);
  cursor:pointer;font-size:16px;line-height:1;padding:2px;opacity:.6;transition:.2s}
.toast-close:hover{opacity:1;color:var(--txt);transform:scale(1.15)}

/* auto-dismiss progress bar */
.toast-bar{position:absolute;left:0;bottom:0;height:2px;width:100%;transform-origin:left;
  background:linear-gradient(90deg,var(--accent),var(--accent2))}
.toast.success .toast-bar{background:linear-gradient(90deg,var(--pos),#1aa885)}
.toast.error .toast-bar{background:linear-gradient(90deg,var(--neg),#c93a4f)}
.toast.timed .toast-bar{animation:toastBar var(--dur,4s) linear forwards}
.toast:hover .toast-bar{animation-play-state:paused}
@keyframes toastBar{to{transform:scaleX(0)}}

@media (prefers-reduced-motion: reduce){
  .toast{animation:none;transform:none;opacity:1}
  .toast.timed .toast-bar{animation:none}
}
