/* Фиксированные уведомления CRM — внизу экрана, видны при прокрутке на телефоне */
.crm-toast-stack {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 102000;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  width: min(420px, calc(100vw - 24px));
  pointer-events: none;
}

.crm-toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  pointer-events: auto;
  padding: 14px 16px 14px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.97) 0%, rgba(30, 41, 59, 0.96) 100%);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(252, 211, 77, 0.08) inset;
  color: #f8fafc;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: crm-toast-in 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  touch-action: manipulation;
}

.crm-toast.out {
  animation: crm-toast-out 0.24s ease forwards;
}

.crm-toast-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 16px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.08);
}

.crm-toast.is-ok .crm-toast-icon {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
}

.crm-toast.is-err .crm-toast-icon {
  background: rgba(248, 113, 113, 0.16);
  color: #fca5a5;
}

.crm-toast.is-warn .crm-toast-icon {
  background: rgba(252, 211, 77, 0.16);
  color: #fcd34d;
}

.crm-toast.is-info .crm-toast-icon {
  background: rgba(96, 165, 250, 0.16);
  color: #93c5fd;
}

.crm-toast-body {
  min-width: 0;
  flex: 1;
  padding-top: 2px;
}

.crm-toast-text {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: #f8fafc;
}

.crm-toast-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  margin: -4px -4px -4px 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(248, 250, 252, 0.55);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.crm-toast-close:hover,
.crm-toast-close:focus {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

@keyframes crm-toast-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes crm-toast-out {
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

/* Успех «контакт вне CRM» — в карточке лида */
.lead-touch-success {
  margin-top: 10px;
  padding: 14px 14px 12px;
  border-radius: 14px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: linear-gradient(145deg, rgba(6, 78, 59, 0.12) 0%, rgba(16, 185, 129, 0.08) 100%);
  animation: lead-touch-success-in 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.lead-touch-success-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lead-touch-success-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  color: #065f46;
  background: linear-gradient(145deg, #a7f3d0 0%, #6ee7b7 100%);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.28);
}

.lead-touch-success-title {
  font-size: 15px;
  font-weight: 800;
  color: #065f46;
  line-height: 1.25;
}

.lead-touch-success-sub {
  margin-top: 6px;
  margin-left: 46px;
  font-size: 12px;
  line-height: 1.45;
  color: #047857;
}

@keyframes lead-touch-success-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
