/* ============================================================
   LD-TOAST — Snackbar-System
   Stapelbar, oben rechts, mit ARIA-Live
   ============================================================ */

.ld-toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: calc(100vw - 48px);
  width: 380px;
  pointer-events: none;
}

@media (max-width: 640px) {
  .ld-toast-container {
    top: auto;
    bottom: 16px;
    right: 16px;
    left: 16px;
    width: auto;
  }
}

.ld-toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--ink);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(20, 19, 18, 0.14), 0 2px 6px rgba(20, 19, 18, 0.06);
  font-family: var(--font-body);
  color: var(--ink);
  transform: translateX(110%);
  opacity: 0;
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.35s ease-out;
}

.ld-toast.show {
  transform: translateX(0);
  opacity: 1;
}
.ld-toast.hide {
  transform: translateX(110%);
  opacity: 0;
}

.ld-toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 1px;
}
.ld-toast-icon svg { width: 16px; height: 16px; }

.ld-toast-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ld-toast-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
}
.ld-toast-msg {
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.ld-toast-close {
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--ink-muted);
  font-size: 20px;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 0;
  transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.ld-toast-close:hover {
  background: var(--bg-deep);
  color: var(--ink);
}

/* === Typ-Varianten === */
.ld-toast-success {
  border-left-color: #15803D;
}
.ld-toast-success .ld-toast-icon {
  background: #DCFCE7;
  color: #15803D;
}

.ld-toast-error {
  border-left-color: #DC2626;
}
.ld-toast-error .ld-toast-icon {
  background: #FEE2E2;
  color: #DC2626;
}

.ld-toast-warning {
  border-left-color: var(--accent);
}
.ld-toast-warning .ld-toast-icon {
  background: var(--accent-tint);
  color: var(--accent-deep);
}

.ld-toast-info {
  border-left-color: var(--ink);
}
.ld-toast-info .ld-toast-icon {
  background: var(--bg-deep);
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  .ld-toast {
    transition: opacity 0.15s ease-out;
    transform: none !important;
  }
  .ld-toast.show { opacity: 1; }
  .ld-toast.hide { opacity: 0; }
}
