/* =========================================================
   Toast / message component — Klar
   ----------------------------------------------------------
   Die Referenz legt ihren Hinweis unten über die Navigation. Dort
   liegt in dieser App die andockende Hauptaktion: beide träfen
   sich auf demselben Streifen, und der Hinweis verdeckte genau den
   Knopf, auf den er sich bezieht. Deshalb erscheint die Meldung
   hier oben unter dem Kopf — dieselbe Gestaltung, anderer Platz,
   und die Hauptaktion bleibt erreichbar.
   ========================================================= */

.toast-stack {
  position: fixed;
  top: calc(var(--app-header-h) + var(--safe-top) + 10px);
  left: max(var(--page-gutter), var(--safe-left));
  right: max(var(--page-gutter), var(--safe-right));
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  align-items: center;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #23283a;
  color: #fff;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.5;
  width: 100%;
  max-width: var(--container-max);
  animation: toast-in 240ms var(--ease-out);
  transition:
    opacity var(--t-med),
    transform var(--t-med);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    animation: none;
  }
}

.toast.is-closing {
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
}

.toast__icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  line-height: 1;
  color: #cfd3e4;
}

.toast__icon svg {
  width: 19px;
  height: 19px;
}

.toast__body {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.toast__close {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  min-width: 44px;
  margin: -10px -8px -10px 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #cfd3e4;
  border-radius: 10px;
  cursor: pointer;
}

.toast__close svg {
  width: 18px;
  height: 18px;
}

.toast__close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.toast__close:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: -2px;
}

/* Die Art der Meldung trägt eine Farbe am Rand und im Symbol —
   die Farbe ist nie die einzige Information, der Text steht daneben. */
.toast--success .toast__icon {
  color: #a9dfb6;
}

.toast--error .toast__icon,
.toast--danger .toast__icon {
  color: #f3b3b7;
}

.toast--warning .toast__icon {
  color: #f0c89a;
}

.toast--success {
  box-shadow:
    inset 3px 0 0 #6fae7f,
    0 8px 30px rgba(0, 0, 0, 0.2);
}

.toast--error,
.toast--danger {
  box-shadow:
    inset 3px 0 0 #d97b83,
    0 8px 30px rgba(0, 0, 0, 0.2);
}

.toast--warning {
  box-shadow:
    inset 3px 0 0 #dda35f,
    0 8px 30px rgba(0, 0, 0, 0.2);
}
