.toast-stack {
  position: fixed;
  top: 5rem;
  /* Align to the right edge of the centered content area (90rem max-width).
     On narrow viewports this resolves to 2rem. On wide viewports it tracks
     the content boundary so toasts don't drift to the far edge of the screen. */
  right: max(2rem, calc((100vw - 90rem) / 2 + 2rem));
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 28rem;
}

.toast {
  background: var(--color-surface);
  border-left-width: 3px;
  border-left-style: solid;
  border-radius: var(--radius-field);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--shadow-card);
  transform: translateY(-8px);
  opacity: 0;
  animation: toast-enter 300ms var(--ease-spring) forwards;
}

.toast--success {
  border-left-color: rgba(212, 168, 83, 0.8);
  background: rgba(212, 168, 83, 0.06);
}

.toast--error {
  border-left-color: rgba(220, 80, 80, 0.8);
  background: rgba(220, 80, 80, 0.06);
}

.toast--info {
  border-left-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.03);
}

.toast--leaving {
  animation: toast-leave 300ms var(--ease-default) forwards;
}

.toast__message {
  flex: 1;
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--color-ink);
  line-height: 1.5;
}

.toast__dismiss {
  background: transparent;
  border: none;
  color: var(--color-ink-muted);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
  transition: color var(--duration-fast) var(--ease-default);
}

.toast__dismiss:hover {
  color: var(--color-ink);
}

.toast__dismiss:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 168, 83, 0.12);
  border-radius: 2px;
}

@keyframes toast-enter {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes toast-leave {
  to {
    transform: translateY(-8px);
    opacity: 0;
  }
}
