.flash-stack {
  position: fixed;
  top: max(20px, env(safe-area-inset-top));
  right: max(20px, env(safe-area-inset-right));
  width: min(420px, calc(100vw - 40px));
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 10000;
  pointer-events: none;
}
.flash-toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px;
  border: 1px solid #e6d9e1;
  border-left: 4px solid #69896d;
  border-radius: 14px;
  color: #4f213b;
  background: #fff;
  box-shadow: 0 8px 28px #4f213b24;
  pointer-events: auto;
  animation: flash-toast-lifetime 3s ease both;
}
.flash-toast-error { border-left-color: #bb507a; }
.flash-toast-persistent { animation: none; border-left-color: #fa83ad; }
.flash-toast-persistent .flash-toast-icon { background: #fff0f6; color: #80516b; }
.flash-toast-icon {
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  height: 24px;
  border-radius: 50%;
  background: #edf4ee;
  color: #456b49;
  font-size: 14px;
  font-weight: 700;
}
.flash-toast-error .flash-toast-icon { background: #fceaf1; color: #a03661; }
.flash-toast .flash-toast-text { flex: 1; min-width: 0; margin: 0; font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.flash-toast-close { flex-shrink: 0; border: 0; background: none; color: #80516b; font: inherit; font-size: 22px; line-height: 24px; padding: 0 3px; cursor: pointer; }
.flash-toast-close:focus-visible { outline: 2px solid #bb507a; outline-offset: 3px; border-radius: 3px; }
@keyframes flash-toast-lifetime {
  0% { opacity: 0; transform: translateX(20px); }
  8%, 75% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(12px); }
}
@media (prefers-reduced-motion: reduce) {
  @keyframes flash-toast-lifetime {
    0%, 90% { opacity: 1; }
    100% { opacity: 0; }
  }
}
@media print { .flash-stack { display: none; } }
