.lanets-toast-stack {
  position: fixed;
  inset-inline-end: clamp(1rem, 2vw, 2rem);
  inset-block-end: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  z-index: 1100;
  display: grid;
  gap: 0.75rem;
  width: min(26rem, calc(100vw - 2rem));
  pointer-events: none;
}

.lanets-toast {
  --toast-accent: #82baff;
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) 2rem;
  align-items: center;
  gap: 0.875rem;
  width: 100%;
  padding: 0.9rem 1rem;
  color: #f7f7f5;
  background: #191b1f;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.42);
  pointer-events: auto;
  animation: lanets-toast-enter 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: opacity 200ms ease, transform 200ms ease;
}

.lanets-toast--success {
  --toast-accent: #71d8a3;
}

.lanets-toast--warning {
  --toast-accent: #ffc15a;
}

.lanets-toast--error {
  --toast-accent: #ff7c78;
}

.lanets-toast__icon {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  color: var(--toast-accent);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid color-mix(in srgb, var(--toast-accent) 40%, transparent);
  border-radius: 50%;
  font-size: 1rem;
}

.lanets-toast__message {
  min-width: 0;
  margin: 0;
  color: #f3f3f1;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.lanets-toast__close {
  display: grid;
  width: 2rem;
  height: 2rem;
  padding: 0;
  place-items: center;
  color: #b9bbc0;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}

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

.lanets-toast__close:focus-visible {
  color: #fff;
  outline: 2px solid #ff741f;
  outline-offset: 2px;
}

.lanets-toast.is-leaving {
  opacity: 0;
  transform: translateY(0.5rem);
}

@keyframes lanets-toast-enter {
  from {
    opacity: 0;
    transform: translateY(0.6rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 600px) {
  .lanets-toast-stack {
    inset-inline: 1rem;
    inset-block-end: calc(1rem + env(safe-area-inset-bottom, 0px));
    width: auto;
  }

  .lanets-toast {
    gap: 0.7rem;
    padding: 0.8rem;
  }
}

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