.pic {
  width: 2rem;
  height: 2rem;
  padding: .5rem;
  background-color: #ddd;
  border-radius: 50%;
}

.contact {
  position: relative;
  margin-bottom: 1rem;
  padding-left: 4rem;
  height: 3.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1;
}
.contact .pic {
  position: absolute;
  left: 0;
  box-sizing: unset;
}
.contact .name {
  font-weight: 500;
}

.hidden {
  visibility: hidden;
}

.chat_btn {
    position: fixed;
    right: .5rem;
    bottom: .5rem;
    width: 3rem;
    height: 3rem;
    margin: 0.75rem;
    padding: 0.8rem;
    border: 0;
    background-color: #0d6efd;
    color: #eee;
    border-radius: 50%;
    cursor: pointer;
    font-size: initial;
    line-height: initial;
}
.chat_btn:hover {
  background-color: #3393ff;
}

.chat {
  /* font-size: 14px; */
  /* font-family: Verdana, Geneva, Tahoma, sans-serif; */
  position: fixed;
  right: 0;
  bottom: 0;
  margin: 0 .5rem 4.5rem 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 24rem;
  height: 38rem;
  z-index: 2;
  box-sizing: border-box;
  border-radius: 1rem;
  color: #333;
  background: #F7F7F7;
  box-shadow: 0 0 8rem 0 rgba(0, 0, 0, 0.1), 0rem 2rem 4rem -3rem rgba(0, 0, 0, 0.5);
  line-height: 1.3;
}
.chat .contact.bar {
  flex-basis: 2.5rem;
  flex-shrink: 0;
  margin: 1rem;
  box-sizing: border-box;
}
.chat .messages {
  position: relative;
  padding: 1rem;
  background: #F7F7F7;
  flex-grow: 1;
  flex-shrink: 2;
  overflow-y: auto;
  box-shadow: inset 0 2rem 2rem -2rem rgba(0, 0, 0, 0.05), inset 0 -2rem 2rem -2rem rgba(0, 0, 0, 0.05);
}
.chat .messages .message {
  box-sizing: border-box;
  padding: 0.5rem 1rem;
  margin: 1rem;
  background: #FFF;
  border-radius: 1.125rem 1.125rem 1.125rem 0;
  min-height: 2.25rem;
  width: -webkit-fit-content;
  width: -moz-fit-content;
  width: fit-content;
  max-width: 66%;
  box-shadow: 0 0 2rem rgba(0, 0, 0, 0.075), 0rem 1rem 1rem -1rem rgba(0, 0, 0, 0.1);
}
.chat .messages .message.my {
  margin: 1rem 1rem 1rem auto;
  border-radius: 1.125rem 1.125rem 0 1.125rem;
  background: #333;
  color: white;
}
.chat .messages .message .typing {
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  margin-right: 0rem;
  box-sizing: border-box;
  background: #ccc;
  border-radius: 50%;
}
.chat .messages .message .typing.typing-1 {
  -webkit-animation: typing 3s infinite;
          animation: typing 3s infinite;
}
.chat .messages .message .typing.typing-2 {
  -webkit-animation: typing 3s 250ms infinite;
          animation: typing 3s 250ms infinite;
}
.chat .messages .message .typing.typing-3 {
  -webkit-animation: typing 3s 500ms infinite;
          animation: typing 3s 500ms infinite;
}
.chat .input {
  box-sizing: border-box;
  flex-basis: 4rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 0.5rem 0 1.5rem;
}
.chat .input i {
  font-size: 1.5rem;
  margin-right: 1rem;
  color: #666;
  cursor: pointer;
  transition: color 200ms;
  width: 24px;
  height: 24px;
  line-height: 1;
}
.chat .input i:hover {
  color: #333;
}
.chat .input input {
  border: none;
  background-image: none;
  background-color: white;
  padding: 0.5rem 1rem;
  margin-right: 1rem;
  border-radius: 1.125rem;
  flex-grow: 2;
  box-shadow: 0 0 1rem rgba(0, 0, 0, 0.1), 0rem 1rem 1rem -1rem rgba(0, 0, 0, 0.2);
  font-family: Red hat Display, sans-serif;
  font-weight: 400;
  letter-spacing: 0.025em;
}
.chat .input input:placeholder {
  color: #999;
}
.chat .message_btns {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
}
.chat .message_btns .message_btn {
  margin: 0 .5rem .5rem 20%;
  background-color: #fefefe;
  padding: .5rem .75rem;
  border: 1px solid #999;
  border-radius: .5rem;
  text-align: start;
}
.chat .message_btns .message_btn:hover {
  cursor: pointer;
  background-color: #eee;
  border-color: #333;
  box-shadow: 0 0 2rem rgba(0, 0, 0, 0.075), 0rem 1rem 1rem -1rem rgba(0, 0, 0, 0.1);
}

@-webkit-keyframes typing {
  0%, 75%, 100% {
    transform: translate(0, 0.25rem) scale(0.9);
    opacity: 0.5;
  }
  25% {
    transform: translate(0, -0.25rem) scale(1);
    opacity: 1;
  }
}

@keyframes typing {
  0%, 75%, 100% {
    transform: translate(0, 0.25rem) scale(0.9);
    opacity: 0.5;
  }
  25% {
    transform: translate(0, -0.25rem) scale(1);
    opacity: 1;
  }
}

@media (max-width: 400px) {
  .chat {
    width: 100%;
    margin-right: 0;
  }
}

@media (max-height: 700px) {
  .chat {
    height: calc(100% - 4rem);
  }
}