/* ── Toast / Snackbar ─────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: min(400px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px 13px 14px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .22), 0 1px 4px rgba(0, 0, 0, .14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: auto;
  cursor: default;
  min-width: 220px;
  max-width: 100%;

  /* enter animation */
  animation: toast-in 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) both;

  background: var(--panel, #fff);
  border: 1px solid var(--line, #e0e0e0);
  color: var(--fg, #172620);
}

.toast.is-leaving {
  animation: toast-out 0.2s ease-in both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px) scale(0.93); }
  to   { opacity: 1; transform: translateX(0)    scale(1);    }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0)    scale(1); max-height: 120px; margin-bottom: 0; }
  to   { opacity: 0; transform: translateX(40px) scale(0.93); max-height: 0; margin-bottom: -10px; }
}

/* Colour variants */
.toast--success {
  background: color-mix(in srgb, var(--panel, #fff) 88%, #22c55e);
  border-color: color-mix(in srgb, var(--line, #e0e0e0) 40%, #22c55e);
}

.toast--error {
  background: color-mix(in srgb, var(--panel, #fff) 88%, #ef4444);
  border-color: color-mix(in srgb, var(--line, #e0e0e0) 40%, #ef4444);
}

.toast--warning {
  background: color-mix(in srgb, var(--panel, #fff) 88%, #f59e0b);
  border-color: color-mix(in srgb, var(--line, #e0e0e0) 40%, #f59e0b);
}

.toast--info {
  background: color-mix(in srgb, var(--panel, #fff) 88%, #3b82f6);
  border-color: color-mix(in srgb, var(--line, #e0e0e0) 40%, #3b82f6);
}

/* Icon */
.toast-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  line-height: 1;
  font-size: 15px;
  margin-top: 1px;
}

/* Body */
.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
  word-break: break-word;
}

.toast-message {
  font-size: 12.5px;
  color: var(--muted, #6b7280);
  margin: 2px 0 0;
  line-height: 1.4;
  word-break: break-word;
}

/* Close button */
.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted, #6b7280);
  padding: 0 0 0 4px;
  font-size: 16px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.15s;
  margin-top: -1px;
}

.toast-close:hover { opacity: 1; }

/* Progress bar */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 12px 12px;
  background: currentColor;
  opacity: 0.35;
  transform-origin: left;
  animation: toast-progress linear both;
}

.toast {
  position: relative;
  overflow: hidden;
}

@keyframes toast-progress {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* Mobile: position above sticky nav toggle */
@media (max-width: 480px) {
  .toast-container {
    bottom: 72px;
    right: 8px;
    left: 8px;
    max-width: 100%;
  }
}
