#smartphone *{
  transition: all ease;
}

#back-smartphone-c{
  opacity: 100; 
}

#back-smartphone-d{
  display: none;
  opacity: 0; 
}

#cb-container {
  text-align: center;
}

*,
*::before {
  box-sizing: border-box;
}


.chat {
  display: flex;
  flex-direction: column-reverse;
  height: 12rem;
  overflow: hidden;
  /* border: 1px #ccc dashed; */
  font: .85rem/1.5 Arial;
  color: #313131;
  position: relative;

}



/* new */
.chat {
  display: flex;
  flex-direction: column-reverse;
  height: 11.5rem;
  overflow: hidden;
  /* border: 1px #ccc dashed; */
  font: 0.85rem/1.5 Arial;
  color: #313131;
  position: relative;
  top: -315px;
  width: 312px;
  left: auto;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  /* margin-top: 55px; */
  margin-left: 10vw;
}

#footer-01 {
  display: flex;
  flex-direction: column-reverse;
  /* height: 8rem; */
  overflow: hidden;
  /* border: 1px #ccc dashed; */
  font: 0.85rem/1.5 Arial;
  color: #313131;
  position: relative;
  top: -308px;
  width: 337px;
  left: auto;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  /* margin-top: 55px; */
  margin-left: 10vw;
  /* border-radius: 0 0 30px 30px; */
}

.chat::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: 0;
  height: 40%;
  width: 100%;
  background: linear-gradient(to bottom, white 20%, rgba(255, 255, 255, 0)) repeat-x;
}

.chat p {
  margin: 0;
  padding: 0;
}

.chat__content {
  flex: 0 1 auto;
  /* padding: 0.5rem; */
  margin: 0 0.5rem;
  background: var(--bgcolor);
  border-radius: var(--radius);
}

.chat__message {
  width: 75%;
  display: flex;
  align-items: flex-end;
  transform-origin: 0 100%;
  padding-top: 0;
  transform: scale(0);
  max-height: 0;
  overflow: hidden;
  animation: message 0.15s ease-out 0s forwards;
  animation-delay: var(--delay);
  --bgcolor: #d8d8d8;
  --radius: 8px 8px 8px 0;
  padding: 0 !important;
  z-index: 0;
}

.chat__message#msg1 {
  width: 100%;
  display: flex;
  align-items: flex-end;
  transform-origin: 0 100%;
  transform: scale(0);
  max-height: 0;
  overflow: hidden;
  animation: message 0.15s ease-out 0s forwards;
  animation-delay: var(--delay);
  --bgcolor: none;
  --radius: 8px 8px 8px 0;
  justify-content: center;
  font-size: 1rem;
  padding-top: 0;
}

#msg2 {
  width: 100%;
  display: flex;
  align-items: flex-end;
  transform-origin: 0 100%;
  transform: scale(0);
  max-height: 0;
  overflow: hidden;
  animation: message 0.15s ease-out 0s forwards;
  animation-delay: var(--delay);
  --bgcolor: none;
  --radius: 8px 8px 8px 0;
  justify-content: center;
  font-size: 1rem;
  padding-top: 0.5rem !important;
}

#msg2>div {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  align-content: center;
  gap: 0.5rem;
  justify-content: space-around;
}

#msg2>div>div {
  border: 1px solid #666;
  border-radius: 0.75rem;
  padding: 0.25em;
  font-size: 0.85rem;
}

.chat__message_B {
  flex-direction: row-reverse;
  text-align: right;
  align-self: flex-end;
  transform-origin: 100% 100%;
  --bgcolor: #d2ecd4;
  --radius: 8px 8px 0 8px;
}

/*   
  .chat__message::before {
    content: "";
    flex: 0 0 40px;
    aspect-ratio: 1/1;
    background: var(--bgcolor);
    border-radius: 50%;
  } */

.chat-dots {
  width: 100%;
  justify-content: center;
}

.chat-dots>div>img {
  width: 60%;
  margin-top: 0;
}

.chat-dots > div:nth-child(2){
  display: none;
  opacity: 0;
}

#footer-01 img {
  position: relative;
  display: inline-block;
  border-radius: 0 0 30px 30px;
}

#footer-01 img:nth-child(1) {
  transform: translateY(-250%);
}


#footer-01 img:nth-child(2) {
  transform: translateY(-100%);
}


.chat-dots p{
  font-size: 1.2rem;
}




/* keyframes */
@keyframes message {
  0% {
    max-height: 100vmax;
  }

  80% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
    max-height: 100vmax;
    overflow: visible;
    padding-top: 1rem;
  }
}




.fade-out-image {
  animation: fadeOut var(--delay) !important;
  animation-fill-mode: forwards !important;
}

@keyframes fadeOut {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}


.fade-in-image {
  animation: fadeIn 1s !important;
  animation-fill-mode: both !important;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}




/* MEDIAQUERIES */

@media screen and (min-width: 768px) and (max-width: 1023px) {
  .chat {
    margin-left: 0vw;
  }

  #footer-01 {
    margin-left: 0vw;
  }

  /* #smartphone {
    max-height: 80vh;
  } */

}

@media screen and (max-width: 768px) {
  .chat {
    height: 180px;
    top: -302px;
    width: 275px;
    margin-left: 0vw;
    font: 0.7rem/1.5 Arial;
  }

  .chat::before {
    height: 8%;
    content: none;
  }

  #footer-01 {
    margin-left: 0vw;
    /* height: 7.2rem; */
    top: -286px;
    width: 289px;
    margin-left: 0vw;
    font: 0.7rem/1.5 Arial;
    max-width: 72vw;
  }

  .chat-dots>div>img {
    width: 30%;
  }

  #msg2>div>div {
    padding: 0.3em;
    font-size: 0.75rem;
  }


  /* #smartphone {
    max-height: 80vh;
  } */

  .chatdots > div:nth-child(2){
    transform: translateY(-30%);
  }
}

@media screen and (max-width: 400px) {
  .chat {
    max-width: 72vw;
    height: 6.5rem;
    top: -197px;
    height: 6.5rem;
    top: calc(-197px + 1vw);
    width: 289px;
  }

  #footer-01 {
    height: 7.2rem;
    top: -241px;
    width: 247px;
    margin-left: 0vw;
    font: 0.7rem/1.5 Arial;
    max-width: 72vw;
  }
}