/* Shared toast placement for all ResearchVault workspaces. */
.toast-stack,
.registration-toast-stack,
.toast-container {
  position: fixed !important;
  top: 18px !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  z-index: 2147483000 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 8px !important;
  width: min(380px, calc(100vw - 28px)) !important;
  max-width: calc(100vw - 28px) !important;
  transform: translateX(-50%) !important;
  pointer-events: none !important;
}

.toast-stack[popover],
.registration-toast-stack[popover],
.toast-container[popover] {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: inherit !important;
  overflow: visible !important;
}

.toast-stack > .toast,
.registration-toast-stack > .registration-toast,
.toast-container > .toast {
  position: static !important;
  width: min(360px, 100%) !important;
  max-width: 100% !important;
  pointer-events: auto;
  animation: rvUpperToastIn .34s cubic-bezier(.16, 1, .3, 1) both !important;
}

.toast-stack > .toast.fade-out,
.registration-toast-stack > .registration-toast.fade-out,
.toast-container > .toast.fade-out {
  animation: rvUpperToastOut .26s ease forwards !important;
  transition: none !important;
}

@keyframes rvUpperToastIn {
  from { opacity: 0; transform: translateY(-22px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes rvUpperToastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-8px) scale(.98); }
}

@media (max-width: 480px) {
  .toast-stack,
  .registration-toast-stack,
  .toast-container {
    top: 12px !important;
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast-stack > .toast,
  .registration-toast-stack > .registration-toast,
  .toast-container > .toast,
  .toast-stack > .toast.fade-out,
  .registration-toast-stack > .registration-toast.fade-out,
  .toast-container > .toast.fade-out {
    animation: none !important;
  }
}
