html.body-lock,
body.body-lock {
  overflow: hidden;
  height: 100%;
  touch-action: none;
}
#chat-widget-toggle {
  /*position: fixed;
  right: 20px;
  bottom: 20px;
  width: 50px;
  height: 50px;
  cursor:pointer;
  z-index:9999;*/
}

#chat-widget-toggle.has-unread::after {
	content: '';
	position: absolute;
	top: 1px;
	right: 3px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #27d061;
}

#chat-widget {
  position:fixed;
  right:20px;
  bottom:20px;
  width:320px;
	max-height: calc(100% - 40px);
	height: 500px;
  background:#fff;
  border-radius:12px;
  box-shadow:0 2px 12px rgba(0,0,0,.25);
  display:none;
  flex-direction:column;
  z-index:99999;
  overflow:hidden;
  font-family: 'Montserrat', sans-serif;
}

#chat-widget.open { display:flex; }

#chat-widget-header {
	display: flex;
	align-items: center;
	background: #EF3C46;
	color: #fff;
	padding: 12px 12px;
}

.chat-widget-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #f2636b;
	margin-right: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.chat-widget-avatar svg {
	width: 20px;
	height: 20px;
}

.chat-widget-title { flex:1; font-weight:bold; font-size:14px; }




.chat-widget-reset,
.chat-widget-close {
	position: relative;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 6px;
	border-radius: 6px;
}

.chat-widget-reset:hover,
.chat-widget-close:hover {
	background: #f25d65;
}

.chat-widget-reset {
	margin-right: 2px;
}

.chat-widget-reset svg {
  width:20px;
	height:20px;
}

.chat-widget-close {

}

.chat-widget-close svg {
  width:20px;
	height:20px;
}


/* Базовый стиль тултипа */
.chat-widget-reset::after,
.chat-widget-close::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 120%;              /* ниже кнопки */
  right: 0;
  white-space: nowrap;
  backdrop-filter: blur(6px);
  background: rgba(15, 23, 42, 0.9);
  color: #f9fafb;         /* почти белый текст */
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,.25);
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity .18s ease-out, transform .18s ease-out;
  z-index: 1000;
}


/* Показываем при наведении */
.chat-widget-reset:hover::after,
.chat-widget-close:hover::after {
  opacity: 1;
  transform: translateY(0);
}








#chat-widget-body {
  flex:1;
  display:flex;
  flex-direction:column;
  padding:8px;
  background:#f9fafb;
	overflow-y: auto;
}

.chat-widget-history {
  flex:1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
	overflow-x: hidden;
  padding: 0px 8px 0px 8px;
	color:#3a3a3a;
}

.chat-widget-history a {
	color: #3a3a3a;
	border-bottom: 1px dashed #b3b3b3;
	text-decoration:none;
}

.chat-widget-date-separator {
  text-align:center;
  font-size:11px;
  color:#888;
  margin:4px 0;
	display: none;
}

.chat-msg {
  margin:4px 0;
  max-width:85%;
  clear:both;
}

.chat-msg-text {
	padding: 8px 10px;
	border-radius: 10px;
	font-size: 13px;
	line-height: 1.4;
	white-space: pre-line;
}

.chat-msg-text b {
   font-weight:500;
}

.chat-msg-time {
  font-size:10px;
  color:#999;
  margin-top:2px;
}

.chat-msg-user { float:right; text-align:right; }
.chat-msg-user .chat-msg-text {
	background: #f04f58;
	border: 1px solid #f04f58;
	color: #fff;
	border-bottom-right-radius: 2px;
}
.chat-msg-bot { float:left; }
.chat-msg-bot .chat-msg-text {
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-bottom-left-radius: 2px;
	box-shadow: 1px 1px 2px 0px rgba(0, 0, 0, 0.1);
}

#chat-widget-input {
	display: flex;
	border-top: 1px solid #e0e0e0;
	padding: 12px;
}

#chat-widget-input textarea {
	flex: 1;
	border: 1px solid #d1d5dc;
	border-radius: 6px;
	padding: 6px;
	font-size: 13px;
	resize: none;
	height: 36px;
	min-height:36px;
	max-height: 100px;
	margin-right: 10px;
}

#chat-widget-input textarea:focus { outline:none; }

#chat-widget-input .chat-widget-send {
	border: none;
	background: #ef3c46;
	width: 36px;
	height: 36px;
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
}

#chat-widget-input .chat-widget-send svg {
  width:20px;
	height:20px;
}

#chat-widget-typing {
  padding:2px 8px;
  font-size:11px;
  color:#999;
}

#chat-widget-quick-buttons {
  display:flex;
  flex-wrap:wrap;
  padding:4px 12px;
  gap:4px;
  background:#f7f7f7;
}





.chat-widget-button {
	border-radius: 6px;
	border: 1px solid #e5e5e5;
	background: #ffffff;
	font-size: 12px;
	padding: 3px 8px;
	cursor: pointer;
}




#chat-widget-new {
	position: absolute;
	left: 50%;
	bottom: 80px;
	transform: translateX(-50%);
	background: #fff;
	padding: 4px 12px;
	border-radius: 12px;
	font-size: 12px;
	border: 1px solid #d1d5dc;
	cursor: pointer;
	box-shadow: 0 2px 5px rgba(0, 0, 0, .1);
	width: 100%;
	max-width: 200px;
	align-items: center;
	justify-content: center;
	display: none;
}

#chat-widget-new i {
	position: relative;
	width: 8px;
	height: 8px;
	background: green;
	border-radius: 50%;
	display: block;
	margin-right: 6px;
}

#chat-widget-new.show {
  display: flex !important;
}









/* адаптив для мобилок */
@media (max-width: 480px) {
  #chat-widget {
		right: 0;
		left: auto;
		width: 100vw;
		bottom: 0;
		height: 100%;
		max-height: 100%;
		border-radius: 0;
  }
}
