/*
 * One toast region for the whole page (SRS Phase 4 §9). Never place a toast
 * over the popup's close/navigation controls — this region sits at the
 * bottom-center on mobile and bottom-right on wider screens, clear of the
 * popup's own footer nav which is anchored inside the dialog itself.
 */

.toast-region {
  position: fixed;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(360px, calc(100vw - 2rem));
  pointer-events: none;
}

@media (min-width: 768px) {
  .toast-region {
    left: auto;
    right: 1.5rem;
    bottom: 1.5rem;
    transform: none;
  }
}

.toast {
  pointer-events: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-gold);
  color: var(--color-text);
  border-radius: var(--radius-md);
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  box-shadow: var(--shadow-soft);
}
.toast[data-type="error"] { border-left-color: var(--color-warning); }
.toast[data-type="success"] { border-left-color: var(--color-success); }

@media (prefers-reduced-motion: no-preference) {
  .toast {
    animation: toast-in 220ms ease both;
  }
  .toast.is-leaving {
    animation: toast-out 180ms ease both;
  }
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  from { opacity: 1; }
  to { opacity: 0; }
}
