:root {
  --chatbot-color: #724ae8;
}
.chatbot-toggler {
  position: fixed;
  right: 40px;
  bottom: 35px;
  height: 50px;
  width: 50px;
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  cursor: pointer;
  background: var(--chatbot-color);
  border-radius: 50%;
  transition: all 0.2s ease;
}
.show-chatbot .chatbot-toggler {
  transform: rotate(90deg);
}
.chatbot-toggler span {
  position: absolute;
}
.show-chatbot .chatbot-toggler span:first-child,
.chatbot-toggler span:last-child {
  opacity: 0;
}
.show-chatbot .chatbot-toggler span:last-child {
  opacity: 1;
}
.chatbot {
  right: 40px;
  bottom: 100px;
  width: 420px;
  transform: scale(0.5);
  position: fixed;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  background: #fff;
  border-radius: 15px;
  transform-origin: bottom right;
  box-shadow: 0 0 128px 0 rgba(0, 0, 0, 0.1),
    0 32px 64px -48px rgba(0, 0, 0, 0.5);
  transition: all 0.1s ease;
  z-index: 99999;
}
.show-chatbot .chatbot {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}
.chatbot header {
  background: var(--chatbot-color);
  padding: 0;
  text-align: center;
  position: relative;
}
.chatbot header h2 {
  color: #fff;
  font-size: 1.4rem;
  margin: 0;
}
.chatbot header span {
  position: absolute;
  right: 20px;
  top: 50%;
  color: #fff;
  cursor: pointer;
  display: none;
  transform: translateY(-50%);
}
.chatbot .chatbox {
  height: 510px;
  overflow-y: auto;
  padding: 30px 20px 100px;
  margin: 0;
}
.chatbox .chat {
  display: flex;
  flex-wrap: wrap;
}
.chatbox .incoming span {
  height: 32px;
  width: 32px;
  color: #fff;
  background: var(--chatbot-color);
  align-self: flex-end;
  text-align: center;
  line-height: 32px;
  border-radius: 4px;
  margin: 0 10px 7px 0;
}
.chatbox .outgoing {
  margin: 20px 0;
  justify-content: flex-end;
}
.chatbox .chat p {
  color: #fff;
  font-size: 0.95rem;
  max-width: 75%;
  white-space: pre-wrap;
  padding: 12px 16px;
  margin: 0;
  border-radius: 10px 10px 0 10px;
  background: var(--chatbot-color);
}
.chatbox .chat p.error {
  color: #721c24;
  background: #f8d7da;
}
.chatbox .incoming p {
  color: #000;
  background: #f2f2f2;
  border-radius: 10px 10px 10px 0;
}
.chatbot .chat-input {
  position: absolute;
  bottom: 0;
  width: 100%;
  display: flex;
  gap: 5px;
  background: #fff;
  padding: 5px 20px;
  border-top: 1px solid #ccc;
}
.chat-input textarea {
  min-height: 55px;
  width: 100%;
  border: none;
  outline: none;
  max-height: 180px;
  font-size: 1.02rem;
  resize: none;
  padding: 16px 15px 16px 0;
  color: #000;
}
.chat-input span {
  align-self: flex-end;
  height: 55px;
  line-height: 55px;
  color: var(--chatbot-color);
  font-size: 1.5rem;
  cursor: pointer;
  visibility: hidden;
}
.chat-input textarea:valid ~ span {
  visibility: visible;
}
.chatbot .loader {
  width: 25px; /* control the size */
  aspect-ratio: 8/5;
  --_g: no-repeat radial-gradient(#000 68%, #0000 71%);
  -webkit-mask: var(--_g), var(--_g), var(--_g);
  -webkit-mask-size: 25% 40%;
  background: black;
  animation: load 1s infinite;
}

@keyframes load {
  0% {
    -webkit-mask-position: 0% 0%, 50% 0%, 100% 0%;
  }
  16.67% {
    -webkit-mask-position: 0% 100%, 50% 0%, 100% 0%;
  }
  33.33% {
    -webkit-mask-position: 0% 100%, 50% 100%, 100% 0%;
  }
  50% {
    -webkit-mask-position: 0% 100%, 50% 100%, 100% 100%;
  }
  66.67% {
    -webkit-mask-position: 0% 0%, 50% 100%, 100% 100%;
  }
  83.33% {
    -webkit-mask-position: 0% 0%, 50% 0%, 100% 100%;
  }
  100% {
    -webkit-mask-position: 0% 0%, 50% 0%, 100% 0%;
  }
}
li .chatimg {
}

li .chatimg img {
  border-radius: 5px;
  margin-top: 5px;
}

@media (max-width: 490px) {
  .chatbot {
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
  }
  .chatbot .chatbox {
    height: 90%;
  }
  .chatbot header span {
    display: block;
  }
}
