/* Toasts — glass capsules matching the nav, stacked below it */
.toast-stack {
  position: fixed;
  top: calc(84px + env(safe-area-inset-top, 0px));
  right: 16px;
  left: 16px;
  z-index: 95;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 420px;
  padding: 13px 10px 13px 18px;
  border-radius: 18px;
  background:
    linear-gradient(
      110deg,
      rgba(255, 255, 255, 0.12),
      rgba(255, 255, 255, 0.03) 45%,
      rgba(255, 255, 255, 0) 80%
    ),
    rgba(16, 19, 26, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  color: var(--fg);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
}
.toast--success {
  border-color: rgba(57, 198, 151, 0.4);
}
.toast--success .toast-icon {
  color: var(--green);
}
.toast--error {
  border-color: rgba(221, 107, 87, 0.45);
}
.toast--error .toast-icon {
  color: var(--red);
}

.toast-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.toast-close {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  color: var(--mutedfg);
  transition:
    color 0.2s ease,
    background-color 0.2s ease;
}
.toast-close:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.08);
}

.toast.hiding {
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .toast {
    animation: toast-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .toast.hiding {
    animation: toast-out 0.25s ease forwards;
  }
  @keyframes toast-in {
    from {
      opacity: 0;
      transform: translateY(-10px) scale(0.98);
    }
  }
  @keyframes toast-out {
    to {
      opacity: 0;
      transform: translateY(-8px) scale(0.98);
    }
  }
}
