/* Teaspot toast notifications — always bottom-right */
.ts-toast-host {
  --toast-offset: var(--chat-offset, 20px);
  position: fixed;
  right: var(--toast-offset);
  bottom: var(--toast-offset);
  z-index: 100000;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: min(420px, calc(100vw - 40px));
  max-width: 100%;
  pointer-events: none;
}

/* Скрываем исходные alerts из потока, пока не станут тостами */
body .alert:not(.ts-toast) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.ts-toast.alert {
  position: relative !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 14px 40px 14px 16px !important;
  overflow: visible !important;
  clip: auto !important;
  white-space: normal !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  border: 0 !important;
  border-radius: var(--radius-btn, 10px);
  box-shadow: 0 8px 28px rgba(26, 26, 26, 0.16);
  font-family: var(--font-family, Gilroy, sans-serif);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  animation: ts-toast-in 0.28s ease;
}

.ts-toast.alert.is-hiding {
  animation: ts-toast-out 0.25s ease forwards;
}

.ts-toast.alert > .close {
  position: absolute;
  top: 8px;
  right: 10px;
  opacity: 0.55;
  text-shadow: none;
  outline: none;
  box-shadow: none;
}

.ts-toast.alert > .close:hover,
.ts-toast.alert > .close:focus {
  opacity: 1;
  outline: none;
  box-shadow: none;
}

.ts-toast.alert-success {
  background: #E8F2E8;
  color: var(--color-catalog, #3F4E3E);
}

.ts-toast.alert-danger {
  background: #FDECEC;
  color: #8B1A1A;
}

.ts-toast.alert-warning {
  background: #FFF6E5;
  color: #7A5A12;
}

.ts-toast.alert-info {
  background: #EAF2F8;
  color: #1F4B6B;
}

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

@keyframes ts-toast-out {
  to {
    opacity: 0;
    transform: translateY(8px) translateX(8px);
  }
}

@media (max-width: 768px) {
  .ts-toast-host {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }
}
