/* Center-floating toast — larger + neon glow */
.toast-host {
  position: fixed;
  top: max(18vh, calc(12px + env(safe-area-inset-top)));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(92vw, 420px);
  pointer-events: none;
}

.toast {
  pointer-events: none;
  width: max-content;
  max-width: 100%;
  padding: 14px 22px;
  border-radius: 14px;
  border: 1px solid rgba(15, 143, 134, 0.35);
  background: #fffcf7;
  font-family: "IBM Plex Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(14px, 3.6vw, 16px);
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  color: #0a7a72;
  opacity: 0;
  transform: translateY(-16px) scale(0.96);
  animation:
    toast-in 420ms cubic-bezier(0.22, 1, 0.36, 1) forwards,
    toast-neon 1.8s ease-in-out 420ms 2;
  box-shadow:
    0 10px 28px rgba(40, 36, 28, 0.14),
    0 0 0 1px rgba(15, 143, 134, 0.12),
    0 0 18px rgba(15, 143, 134, 0.35),
    0 0 36px rgba(64, 200, 180, 0.22);
}

.toast.is-leaving {
  animation: toast-out 260ms ease-in forwards;
}

.toast.is-error {
  color: #b83a3a;
  border-color: rgba(196, 92, 92, 0.4);
  box-shadow:
    0 10px 28px rgba(40, 36, 28, 0.14),
    0 0 0 1px rgba(196, 92, 92, 0.15),
    0 0 18px rgba(220, 80, 80, 0.4),
    0 0 36px rgba(255, 100, 100, 0.22);
  animation:
    toast-in 420ms cubic-bezier(0.22, 1, 0.36, 1) forwards,
    toast-neon-err 1.8s ease-in-out 420ms 2;
}

.toast.is-info {
  color: #4a453c;
  border-color: rgba(92, 87, 78, 0.28);
  box-shadow:
    0 10px 28px rgba(40, 36, 28, 0.14),
    0 0 0 1px rgba(92, 87, 78, 0.1),
    0 0 16px rgba(184, 137, 45, 0.28),
    0 0 32px rgba(184, 137, 45, 0.16);
  animation:
    toast-in 420ms cubic-bezier(0.22, 1, 0.36, 1) forwards,
    toast-neon-info 1.8s ease-in-out 420ms 2;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
  }
}

@keyframes toast-neon {
  0%,
  100% {
    box-shadow:
      0 10px 28px rgba(40, 36, 28, 0.14),
      0 0 0 1px rgba(15, 143, 134, 0.12),
      0 0 14px rgba(15, 143, 134, 0.28),
      0 0 28px rgba(64, 200, 180, 0.16);
  }
  50% {
    box-shadow:
      0 12px 32px rgba(40, 36, 28, 0.16),
      0 0 0 1px rgba(15, 143, 134, 0.28),
      0 0 26px rgba(15, 143, 134, 0.55),
      0 0 52px rgba(64, 200, 180, 0.38);
  }
}

@keyframes toast-neon-err {
  0%,
  100% {
    box-shadow:
      0 10px 28px rgba(40, 36, 28, 0.14),
      0 0 14px rgba(220, 80, 80, 0.28),
      0 0 28px rgba(255, 100, 100, 0.16);
  }
  50% {
    box-shadow:
      0 12px 32px rgba(40, 36, 28, 0.16),
      0 0 26px rgba(220, 80, 80, 0.55),
      0 0 52px rgba(255, 100, 100, 0.35);
  }
}

@keyframes toast-neon-info {
  0%,
  100% {
    box-shadow:
      0 10px 28px rgba(40, 36, 28, 0.14),
      0 0 14px rgba(184, 137, 45, 0.22),
      0 0 28px rgba(184, 137, 45, 0.12);
  }
  50% {
    box-shadow:
      0 12px 32px rgba(40, 36, 28, 0.16),
      0 0 24px rgba(184, 137, 45, 0.45),
      0 0 48px rgba(184, 137, 45, 0.28);
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast,
  .toast.is-leaving,
  .toast.is-error,
  .toast.is-info {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
