:root {
  --btnDialogForeColor: black;
  --btnDialogBackColor: #ecf2f3;  /* e2e2e2 */
  --btnDialogHoverBackColor: #f7f9f9;  /* efefef  */
  --bgColor: #fff;
}

/* Кнопка виджета */
#chat-button {
  position: fixed;
  border-radius:50%; /*Делаем икноку круглой */
  background-color:#7897cf;
  cursor:pointer;

  transition: all 0.5s ease;
  opacity:0;
  bottom:-16px; right:69px;
  width:1px;  height:1px;

/*
  opacity:1;
  bottom:30px;  right:36px;
  width:66px;  height:66px;
*/
}

#chat-button.animate {  /* Для всплытия снизу */
  opacity: 1;
  bottom:30px;  right:36px;
  width:66px;  height:66px;
}

#chat-button:hover {
  width:72px;
  height:72px;
  bottom:27px; right:33px;
  transition: 0.3s;
  transition-property: all;
  transition-timing-function: ease-in-out;
  box-shadow:0 0 0 33px rgba(0, 0, 0, 0.11) inset;
}

#chat-button-logo {
  position: absolute;
  top: 50%; left: 50%;
  width:34px; height:34px;
  background:url(img/logo_w.png) 0 0 no-repeat;
  background-size: cover;
  transform: translate(-50%,-50%);
}
#chat-button-red-sq {
  display:none;
  position: absolute;
  width:42px;
  height:100%;
}
#chat-button-red-sq-label {
  position:absolute; right:0; top:0;
  margin-top:-6px;
  width:20px; height:20px;
  min-width:20px; min-height:20px;
  max-width:20px; max-height:20px;
  border-radius:16px;
/*  text-align:center;*/

  font-size:14px;
  font-family: Arial, Courier New, Tahoma, Verdana;
  font-weight:400;
  color:white;

  background-color:#df4f4f;

  display: flex;
  align-items: center;
  justify-content:center;
}

/*
  Пульсация для кнопки виджета chat-button при приходе нового сообщения, если чат свернут 
  Псевдо-класс before будем анимировать
*/
.pulse-anim::after,
.pulse-anim::before {
  content: '';
  position: absolute;
  border: 1px solid #7897cf;
  opacity: 0;
  left: -5px;
  top: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: 50%;
  animation: pulse-frames 1.5s linear infinite;
}
.pulse-anim::after {
  animation-delay: 0.75s;
}
@keyframes pulse-frames {
  0% { transform: scale(1.0); opacity: 0; }
  33% { transform: scale(1.33); opacity: 1; }
  66% { transform: scale(1.66); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}

/*Хинт над кнопкой виджета, когда виджет свернут */
#chat-button-hint {
  position: fixed;
  right:36px;

  cursor:pointer;
  font-family: Arial, sans-serif;
  font-size:16px;
  padding:8px 12px; 
  max-width: 220px;
  background-color:white;
  border:1px solid #999;  
  border-radius:8px;
  transition: all .5s ease-in-out;
}
.chat-button-hint-hidden { opacity:0; bottom:95px;  }
.chat-button-hint-showed { opacity:1; bottom:120px; }
.chat-button-hint-cross {
  float:right;
  width:16px;
  height:16px;
  background: url(img/cross16.png) 0 0 no-repeat;
  cursor:pointer;
  transform: scale(0.7); opacity: 0.8;
}
.chat-button-hint-cross:hover {
  transform: scale(1.0); opacity: 1;
}

/* Виджет */

#chat-box { 
  font-family: Calibri, Arial, Tahoma, Verdana;
/*  font-size: 18px;*/
  padding:0;
  text-align:left;
  line-height: 100%;

  display: flex;
  flex-direction: column;

  position:fixed;
/*  bottom:0;*/
  
  z-index:999;  /* прилепим к правому нижнему углу */

  line-height:100%;

  background: rgba(50, 234, 13, 0);  /* Фон полностью прозрачный и неважно какого цвета  */

  font-family: Verdana, Tahoma, Arial;
  font-size: 16px;

  min-height:380px;

  transition: opacity 0.5s ease, bottom 0.3s ease, visibility 0.5s ease;
/*  visibility:hidden;*/
  visibility:hidden;
  opacity:0;     /* Не виден изначально */
  bottom:-60px;  /* Чтобы при раскрытии виджета он выплыл снизу экрана */

/*  width:1px;  height:1px;*/
/*border:1px solid red;*/
}
/* При показе виджета добавится класс .animate */
#chat-box.animate {
/*  width:auto;  height:auto;*/
  visibility:visible;
  opacity:1;
  bottom:0;
/*  max-height:1px;*/
}

/* Крестик закрытия виджета */
#chat-cross-button {
  width:30px; height:28px;
  min-width:30px;
  padding-left:2px;
  align-self:center;

  cursor:pointer;
  opacity: 0.85;

/*  background: url(img/rollbutt.png) 14px 6px no-repeat;*/
  background-image: url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2228%22%20height%3D%2228%22%20viewBox%3D%220%200%2028%2028%22%3E%0A%20%20%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20transform%3D%22translate\(2%202\)%22%3E%0A%20%20%20%20%20%20%20%20%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2212%22%20fill%3D%22%23FFF%22%20opacity%3D%221%22%2F%3E%0A%20%20%20%20%20%20%20%20%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%2212.75%22%20stroke%3D%22%23222D38%22%20stroke-width%3D%221.5%22%20opacity%3D%221%22%2F%3E%0A%20%20%20%20%20%20%20%20%3Cg%20fill%3D%22%23222D38%22%20opacity%3D%221%22%20transform%3D%22translate\(6%206\)%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3Crect%20width%3D%221.611%22%20height%3D%2213.9%22%20x%3D%225.435%22%20y%3D%22-.941%22%20rx%3D%22.806%22%20transform%3D%22rotate\(45%206.24%206.01\)%22%2F%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3Crect%20width%3D%221.611%22%20height%3D%2213.9%22%20x%3D%225.435%22%20y%3D%22-.941%22%20rx%3D%22.806%22%20transform%3D%22scale\(-1%201\)%20rotate\(45%200%20-9.058\)%22%2F%3E%0A%20%20%20%20%20%20%20%20%3C%2Fg%3E%0A%20%20%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A);
  background-position: 2px 0;
  background-repeat:no-repeat;
/*  position:absolute;
  right:0; top:0;*/	
/*border: 1px solid red;*/
}
#chat-cross-button:hover {
  opacity: 1;
/*  background: url(img/rollbutt.png) 14px 8px no-repeat;
  background-color:#3c5562;*/
}

/* HEADER of widget */
 
#chat-header {
/* border: 1px solid red; */

  display:flex;
  flex-direction:row;
  
  flex: 0 1 auto;

  padding: 10px 8px 10px 20px;

  background-image: url(img/header1back.png);
  background-repeat: no-repeat;
  background-color:#607d8b;

  border-radius: 40px 6px 0px 0px;
  cursor:pointer;
  user-select: none;
/*  height:60px;*/
/*outline: 1px dashed red;*/
}

#chat-opinfo-wrapper {
  display:block;
  overflow:hidden;
  flex-grow:2;
/*  padding-top:6px; Выставляется программно в RefreshHeader() */
  margin-left:12px;
/*outline: 1px solid magenta;*/
}
#chat-header-photo {
  display:block;
  width:42px;  height:42px;
  max-width:42px;
  background-repeat: no-repeat;
  background-size: cover;
  border-radius:20px;
/*min-height:42px;*/
/*outline: 1px solid green;*/
}
#chat-header-fio {
/*  display:block;*/
  display: flex; align-items: center; /* чтобы по центру по вертикали */

  width:100%;
  color:#eee;
  font-family: Arial, Tahoma, Verdana;
  font-size: 16px;
  overflow: hidden; text-overflow: ellipsis;  white-space: nowrap; /* чтобы многоточие ставилось */
/*outline: 1px solid blue;*/
}
#chat-header-jobtitle {
  display:block;
  width:100%;
  color:#ccc;
  font-family: Arial, Tahoma, Verdana;
  font-size: 14px;
  overflow: hidden; text-overflow: ellipsis;  white-space: nowrap; /* чтобы многоточие ставилось */
  margin-top:4px;
/* outline: 1px solid red; */
}
#chat-status {
  display:block;
  border-radius: 10px;
  height: 10px;
  width: 10px; 
  margin-left:36px;
  margin-top:34px;
  border:1px solid #607c8a;
}
.chat-status-online {  /* зеленый */
  display:block;
  background-color: #71d751;
}
.chat-status-offline {  /* красный */
  display:block;
  background-color: #e1413b;
}
.chat-status-away {  /* желтый */
  display:block;
  background-color: #ffee00;
}
#chat-common-status {  /* Общий красный крупный шарик Когда все операторы НЕ в сети */
  display:block;
  border-radius: 100%;

  height: 12px;
  width: 12px; 
  margin-top:16px;
  margin-left:0px;
/*  border:1px solid #607c8a;*/
  border:1px solid #999;
/*border:1px solid yellow;*/
}
.chat-common-status-offline { background-color: #d22c2c; outline: 2px solid #d06363; }
.chat-common-status-online { background-color: #18c139; outline: 2px solid #4dd868; }

.chat-box-overlay {
/*  min-width: 100%;
  min-height: 100%;*/
/*  position: fixed;*/
  position: absolute;
/*  top: 30px; left: 0;
  right:0;  bottom:0;*/
  width:100%;
/*  height:100%;*/
  height:calc(100% - 100px); /* на глазок, а то высота подложки при height=100% выходит вниз нза экран */

  display: flex;
  align-items: center;
  align-content: center;
  justify-content: center;

/*    overflow: auto;*/
overflow:hidden;
/*  background: #000;*/
  background-color: rgba(0, 0, 0, 0.3);
/*border:1px solid red;*/
}

.chat-msgbox {
  background-color: var(--bgColor);
/*  border-radius: 10px;*/
  box-shadow: 0 10px 20px rgba(64, 64, 64, 0.15);

/*  max-width: 208px;*/
  padding:12px 22px 16px 16px;

  line-height:100%;

/*  transition: all .7s ease;*/
  -webkit-animation: animatezoom 0.2s;
  animation: animatezoom 0.2s;
/*overflow:hidden;*/
}
@-webkit-keyframes animatezoom {
  from {-webkit-transform: scale(0)}
  to {-webkit-transform: scale(1)}
}

@keyframes animatezoom {
  from {transform: scale(0)}
  to {transform: scale(1)}
}

.chat-msgbox-icon-exclam, .chat-msgbox-icon-info, .chat-msgbox-icon-question {
  width:42px; height:42px; min-width:42px; max-width:42px;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}
.chat-msgbox-icon-exclam { background-image: url(../controls/img/iconexclamation42.png); }
.chat-msgbox-icon-info { background-image: url(../controls/img/iconinfo42.png); }
.chat-msgbox-icon-question { background-image: url(../controls/img/iconquestion42.png); }

#connecting-label {
  display:none;
  font-size:12px;
  margin:0; padding:0;
  text-align:right;
  border: 1px solid #ed8a8a;
  color:red;
  background-color:#fff9f9;
  margin-top:0px;
  padding:4px 6px 4px 8px;
  border-radius:6px;
}

.chat-msgbox-cross {
  float:right;
  width:16px; height:16px;
  background: url(../controls/img/cross16.png) no-repeat;
  background-position: center center;
  background-size: 90% 90%;
/*border:1px solid red;*/
}
.chat-msgbox-cross:hover {
  background-size: 100% 100%;
  cursor:pointer;
}
.chat-msgbox-body {
/*  border-top: 1px solid var(--borderColor);*/
/*  padding-top:16px;
  padding-bottom:16px;*/
  padding-left: 12px; padding-right:4px;
  font-size:16px;
  line-height:120%;
/* border:1px solid red; */
}
.chat-msgbox-buttons {  /* Набор кнопок в окне-диалоге */
  display:flex;
  flex-direction:row;
  justify-content:center;
  margin-top:22px;
  margin-bottom:0;
/* border:1px solid red;*/
}

.chat-msgbox-btn {  /* кнопка в окне-диалоге */
 
  font: inherit;
  outline: none;
  border:1px solid #ccc;
  padding: 8px 15px 8px 15px;
  border-radius: 8px;
  background-color:var(--btnDialogBackColor);
  color: var(--btnDialogForeColor);
  text-align:center;

  display: flex; align-items: center;  /* верт.выравн-е текста внутри кнопки */

  user-select: none;
}
.chat-msgbox-btn:hover {
  background-color:var(--btnDialogHoverBackColor);
  cursor:pointer;  
}
.chat-msgbox-btn:hover:disabled {
  color: var(--btnDialogHoverBackColor);
}
.chat-msgbox-btn:not(:last-child) {
  margin-right:12px;
}

/* Сцена Тех.Работы - поверх текущей сцены */

#chat-box-techwork-overlay {

  display:flex;
  flex-direction:column;
  justify-content: center;
  align-items: center;
  line-height:20px;

  overflow:hidden;
  overflow-y:auto;

  background-color: #fff;

/*  position: absolute;*/

/*  width:100%;
  height:calc(100% - 4px);*/ /* на глазок, а то высота подложки при height=100% выходит вниз нза экран */


/*  top:0; left:0;*/

/*outline:2px solid red;*/
}

#chat-box-techwork-title { font-size:22px; color:#444; font-family:Arial, Verdana, Tahoma; line-height:120%; padding:0 10px 0 10px; text-align:center;}
#chat-box-techwork-img {
  background-image: url(../img/techwork2.png);
  background-repeat: no-repeat;
  background-size: 100px 100px;
  width:100px; height:100px;
  margin-top:20px;
/*border:1px solid red;*/
}
#chat-box-techwork-message {
  color:#444;
  margin-top:20px;
  text-align:center;
  padding:0 10px 0 10px;
  line-height:120%;
/*border:1px solid red;*/
}


/* Сцена OFFLINE */

#chat-box-offline-overlay {
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
  line-height:20px;

  overflow:hidden;
  overflow-y:auto;
  padding:10px;

  background-color:#eee;
/*  height:100%;
  height:calc(100% - 24px); */  /* на глазок, а то высота подложки при height=100% выходит вниз нза экран */
/*outline:2px solid red;*/
}
#OfflineSentHeader {
  font-size: 22px;
  color: #607c8a;
  padding-top:16px;
  padding-bottom:16px;
}

#bottom-info {
  overflow:hidden;
border:0px solid red;
}
#err-label {
  display:none;
  border:0px solid blue;
}

#chat-ad {
/*  border:1px solid green;*/

/*  display:block;*/
  display:none; /* none - ВРЕМЕННО, ДО 1-го КОММЕРЧЕСКОГО ЗАПУСКА, потом поставить display:block */

  position:absolute; right:0;

  width:114px; height:20px;
  margin-right:10px;
  background-image: url(/widget/img/ad.png);
  background-repeat: no-repeat;
  background-size:114px 20px;
  background-position: center right;
  cursor:pointer;
}

.att-block {
  max-width:134px;  /* перекроим именно для Виджета */
}

/* Media Queries - перекрываем некот.верхние стили, если ширина экрана мала */
@media all and (max-width : 560px)   /* Если это число меняем, то и на JS в обраб-ке windows.resize меняем!!! */
{
  #chat-button {
    bottom:-16px; right:69px;
/*    width:1px;  height:1px;*/
  }
  #chat-button.animate {
    bottom:25px;  right:30px;
  }

} /* конец перекрытых стилей @media */
