@keyframes fadeInOpacity {
	0% {
		opacity: 0;
	}
	100% {
		opacity: 1;
	}
}
.fadeIn {
	opacity: 1;
	animation-name: fadeInOpacity;
	animation-iteration-count: 1;
	animation-timing-function: ease-in;
	animation-duration: 500ms;
}

@keyframes fadeOutOpacity {
	0% {
		opacity: 1;
	}
	100% {
		opacity: 0;
	}
}
.fadeOut {
	opacity: 0;
	animation-name: fadeOutOpacity;
	animation-iteration-count: 1;
	animation-timing-function: ease-in;
	animation-duration: 500ms;
}

/* QuickReset */ * {margin: 0; box-sizing: border-box;}

.chat {
	--rad: 20px;
	--rad-sm: 3px;
	font: 16px/1.5 sans-serif;
	display: flex;
	flex-direction: column;
	padding-top: 20px;
	padding-left: 10px;
	padding-right: 10px;
	margin: auto;
  }
  
  .msg {
	position: relative;
	max-width: 75%;
	padding: 7px 15px;
	margin-bottom: 25px;
  }
  
  .msg.sent {
	border-radius: var(--rad) var(--rad-sm) var(--rad-sm) var(--rad);
	background: #42a5f5;
	color: #fff;
	/* moves it to the right */
	margin-left: auto;
  }
  
  .msg.rcvd {
	border-radius: var(--rad-sm) var(--rad) var(--rad) var(--rad-sm);
	background: #f1f1f1;
	color: #555;
	/* moves it to the left */
	margin-right: auto;
  }
  
  /* Improve radius for messages group */
  
  .msg.sent:first-child,
  .msg.rcvd+.msg.sent {
	border-top-right-radius: var(--rad);
  }
  
  .msg.rcvd:first-child,
  .msg.sent+.msg.rcvd {
	border-top-left-radius: var(--rad);
  }
  
  
  /* time */
  
  .msg::before {
	content: attr(data-time);
	font-size: 0.8rem;
	position: absolute;
	bottom: 100%;
	color: #888;
	white-space: nowrap;
  }
  
  .msg.sent::before {
	right: 15px;
  }
  
  .msg.rcvd::before {
	left: 15px;
  }