.toast-stack {
  position: fixed;
  bottom: var(--s-6);
  right: var(--s-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column-reverse;
  gap: var(--s-2);
  pointer-events: none;
  max-width: 360px;
}

.toast {
  display: flex; align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-4);
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  box-shadow: var(--sh-raised);
  pointer-events: auto;
  font-size: var(--t-sm);
  color: var(--ink-1);
  animation: toast-in var(--d-slow) var(--ease-spring);
  position: relative;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px) scale(0.95); }
  to { opacity: 1; transform: none; }
}

.toast.is-out { animation: toast-out var(--d-base) var(--ease-accel) forwards; }
@keyframes toast-out {
  to { opacity: 0; transform: translateX(20px); }
}

.toast--success { border-left-color: var(--up); }
.toast--error { border-left-color: var(--down); }
.toast--warn { border-left-color: var(--warn); }
.toast--info { border-left-color: var(--accent); }

.toast__icon {
  flex-shrink: 0;
  width: 22px; height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-3);
  color: var(--accent);
  font-weight: 700;
  font-size: var(--t-xs);
}
.toast--success .toast__icon { color: var(--up); }
.toast--error .toast__icon { color: var(--down); }
.toast--warn .toast__icon { color: var(--warn); }

.toast__body { flex: 1; line-height: var(--lh-base); }
.toast__title { font-weight: 600; color: var(--ink-1); }
.toast__msg { color: var(--ink-2); margin-top: 2px; font-size: var(--t-xs); }
.toast__action {
  display: inline-block;
  margin-top: 6px;
  color: var(--accent);
  font-weight: 600;
  font-size: var(--t-xs);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.toast__close {
  flex-shrink: 0;
  width: 20px; height: 20px;
  color: var(--ink-3);
  position: relative;
  border-radius: 50%;
}
.toast__close:hover { color: var(--ink-1); background: var(--bg-3); }
.toast__close::before, .toast__close::after {
  content: ""; position: absolute;
  inset: 50% 50% auto auto;
  width: 10px; height: 1.5px;
  background: currentColor;
  transform-origin: right center;
}
.toast__close::before { transform: translateY(-50%) rotate(45deg); }
.toast__close::after { transform: translateY(-50%) rotate(-45deg); }

.toast__progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--accent);
  transform-origin: left;
  animation: toast-progress 5s linear forwards;
}
@keyframes toast-progress { to { transform: scaleX(0); } }

@media (max-width: 480px) {
  .toast-stack { left: var(--s-3); right: var(--s-3); bottom: var(--s-3); max-width: none; }
}
