/* ── Toast Flash Notifications ────────────────────────────────────────────── */

.toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9900;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem 0.65rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-family: var(--f-body);
  border: 1px solid transparent;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  min-width: 200px;
  max-width: 320px;
  pointer-events: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  animation: toast-in 0.22s ease forwards;
  overflow: hidden;
}

.toast--success {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.35);
  color: #86efca;
}

.toast--error {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

/* Light themes */
[data-theme*="-light"] .toast--success {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.5);
  color: #065f46;
}
[data-theme*="-light"] .toast--error {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.5);
  color: #991b1b;
}

.toast__icon {
  font-size: 0.9rem;
  flex-shrink: 0;
  line-height: 1;
}

.toast__msg {
  flex: 1;
  line-height: 1.4;
}

.toast__close {
  background: none;
  border: none;
  color: inherit;
  opacity: 0.45;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0.15rem 0.25rem;
  border-radius: 4px;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.toast__close:hover { opacity: 0.9; }

/* Slide in from right */
@keyframes toast-in {
  from { opacity: 0; transform: translateX(1.5rem); }
  to   { opacity: 1; transform: translateX(0);      }
}

/* Slide out to right + collapse height */
.toast--out {
  animation: toast-out 0.28s ease forwards;
}
@keyframes toast-out {
  0%   { opacity: 1; transform: translateX(0);      max-height: 80px;  margin-bottom: 0; }
  60%  { opacity: 0; transform: translateX(1.5rem); max-height: 80px;  }
  100% { opacity: 0; transform: translateX(1.5rem); max-height: 0;     padding-top: 0; padding-bottom: 0; }
}
