.scot-chat {
  box-sizing: border-box;
  z-index: 10;
  bottom: 20px;
  font-size: 14px;
  line-height: 1.2;
}
.scot-chat *, .scot-chat *::before, .scot-chat *::after {
  box-sizing: border-box;
}
.scot-chat.positionFixed {
  position: fixed;
}
.scot-chat.positionFixed .scot-chat__messages {
  position: absolute;
}
.scot-chat.positionFixed.position-right {
  right: 20px;
}
.scot-chat.positionFixed.position-right .scot-chat__messages {
  right: 0;
}
.scot-chat.positionFixed.position-left {
  left: 20px;
}
.scot-chat.positionFixed.position-left .scot-chat__messages {
  left: 0;
}
.scot-chat.positionFixed.position-left .scot-chat__messages:before {
  left: 12px;
}
.scot-chat.positionInitial .scot-chat__messages::before {
  display: none !important;
}
.scot-chat.positionInitial .scot-chat__messages__messages {
  height: 300px;
}
.scot-chat img {
  max-width: 100%;
  height: auto;
}
.scot-chat__trigger {
  cursor: pointer;
  position: relative;
}
.scot-chat__trigger .message-counter {
  position: absolute;
  top: 0;
  right: 0;
}
.scot-chat .message-counter {
  width: 20px;
  height: 20px;
  display: inline-block;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 600;
  background: red;
  color: #fff;
  text-align: center;
  line-height: 20px;
  vertical-align: middle;
}
.scot-chat__messages {
  bottom: calc(100% + 15px);
  width: var(--scot-widget-width, 300px);
  max-width: calc(100vw - 40px);
  background: var(--scot-message-bg, #f1f6fb);
  color: var(--scot-message-color);
  border-radius: 6px;
  padding: 10px;
  filter: drop-shadow(0px 2px 5px rgba(0, 0, 0, 0.2));
  opacity: 0;
  visibility: hidden;
  z-index: -1;
}
.scot-chat__messages a {
  color: var(--scot-message-color);
}
.scot-chat__messages.open {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}
.scot-chat__messages:before {
  content: "";
  position: absolute;
  display: block;
  width: 0;
  height: 0;
  border-top: 10px solid var(--scot-message-bg, #f1f6fb);
  border-left: 12px solid transparent;
  top: 100%;
  right: 12px;
}
.scot-chat__messages__header {
  padding: 8px 30px 8px 10px;
  background: var(--scot-header-bg, #fff);
  width: 100%;
  border-radius: 6px;
  box-shadow: 1px 0 5px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
}
.scot-chat__messages__header .user-name {
  max-width: 100%;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  color: var(--scot-header-color);
}
.scot-chat__messages__header .user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  -o-object-fit: cover;
     object-fit: cover;
  margin-right: 8px;
}
.scot-chat__messages__header .message-counter {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}
.scot-chat__messages__messages {
  max-height: 50vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 0;
  min-height: 200px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.scot-chat__messages__messages .scroll-down-icon {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
  bottom: 60px;
  right: 10px;
  background: var(--scot-support-message-bg, #fff);
  z-index: 2;
}
.scot-chat__messages__messages .scroll-down-icon:before, .scot-chat__messages__messages .scroll-down-icon:after {
  content: "";
  position: absolute;
  display: block;
  width: 12px;
  height: 1px;
  background: #8b8b8b;
  transform: rotate(45deg);
  top: 16px;
  left: 6px;
}
.scot-chat__messages__messages .scroll-down-icon:after {
  transform: rotate(-45deg);
  top: 16px;
  left: 14px;
}
.scot-chat__messages__messages .scroll-down-icon .message-counter {
  top: -5px;
  right: -5px;
  position: absolute;
  width: 16px;
  height: 16px;
  line-height: 16px;
}
.scot-chat__messages__messages::-webkit-scrollbar {
  display: none;
}
.scot-chat__messages__messages p {
  margin: 0;
}
.scot-chat__messages__messages .single-message {
  background: var(--scot-customer-message-bg, #fff);
  border-radius: 10px;
  padding: 10px;
  max-width: 80%;
  align-self: flex-end;
}
.scot-chat__messages__messages .single-message.admin-message {
  align-self: flex-start;
  background: var(--scot-support-message-bg, #fff);
}
.scot-chat__messages__messages .single-message .message {
  margin-bottom: 2px;
  overflow-wrap: break-word;
}
.scot-chat__messages__messages .single-message .message img {
  cursor: pointer;
}
.scot-chat__messages__messages .single-message.skeleton {
  background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
  background-size: 200% 100%;
  animation: 1.5s shine linear infinite;
  width: 80%;
  min-height: 60px;
}
.scot-chat__messages__messages .single-message .message-date {
  font-size: 10px;
  opacity: 0.7;
  text-align: right;
}
.scot-chat__messages__messages .single-message .message-date img {
  width: 12px;
  opacity: 0.7;
  animation: rotate 1s infinite;
  vert-align: top;
}
.scot-chat__messages__input {
  max-height: 40%;
  box-shadow: 1px 0 5px rgba(0, 0, 0, 0.1);
  position: relative;
}
.scot-chat__messages__input textarea {
  width: 100%;
  padding: 50px;
  border-radius: 0;
  border: none;
  box-shadow: none;
  outline: none;
  background: var(--scot-input-field-bg, #fff);
  color: var(--scot-input-field-color, #1e1e1e);
  margin: 0;
}
.scot-chat__messages__input .textarea-wrapper {
  display: grid;
  overflow-y: auto;
  max-height: 200px;
  border-radius: 6px;
}
.scot-chat__messages__input .textarea-wrapper:after {
  content: attr(data-replicated-value) " ";
  white-space: pre-wrap;
  visibility: hidden;
}
.scot-chat__messages__input .textarea-wrapper textarea {
  resize: none;
  overflow: hidden;
  margin: 0;
}
.scot-chat__messages__input .textarea-wrapper textarea, .scot-chat__messages__input .textarea-wrapper:after {
  padding: 10px 35px 10px 15px;
  font: inherit;
  grid-area: 1/1/2/2;
  width: 100%;
  overflow: hidden;
}
.scot-chat__messages__input .file-picker {
  position: absolute;
  left: 10px;
  bottom: 10px;
  cursor: pointer;
  color: rgba(0, 0, 0, 0.5);
  transition: 0.3s;
  display: flex;
}
.scot-chat__messages__input .file-picker:hover {
  color: rgba(0, 0, 0, 0.8);
}
.scot-chat__messages__input .file-picker svg {
  width: 16px;
}
.scot-chat__messages__input .file-picker input[type=file] {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  opacity: 0;
  width: 16px;
  height: 18px;
}
.scot-chat__messages__input .send-button {
  position: absolute;
  right: 10px;
  bottom: 8px;
  z-index: 2;
  cursor: pointer;
  color: rgba(0, 0, 0, 0.5);
  transition: 0.3s;
  display: flex;
}
.scot-chat__messages__input .send-button:hover {
  color: rgba(0, 0, 0, 0.8);
}
.scot-chat__messages__input .send-button svg {
  width: 22px;
}
.scot-chat__messages__file_popup {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.2);
  z-index: 50;
}
.scot-chat .popup-image {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 11111;
}
.scot-chat .popup-image img {
  max-width: 100%;
  height: auto;
  position: relative;
  z-index: 2;
}
.scot-chat .popup-image .popup-backdrop {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  background: rgba(0, 0, 0, 0.5);
}
.scot-chat .popup-image .close-popup {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 2;
  cursor: pointer;
  width: 30px;
  height: 30px;
}
.scot-chat .popup-image .close-popup div {
  width: 20px;
  height: 2px;
  transform: rotate(45deg);
  background: #fff;
  position: absolute;
  top: 15px;
  left: 5px;
}
.scot-chat .popup-image .close-popup div:last-child {
  transform: rotate(-45deg);
}

body.admin-bar .scot-chat .popup-image .close-popup {
  top: 40px;
}

@keyframes rotate {
  0% {
    transform: rotate(0);
  }
  100% {
    transform: rotate(360deg);
  }
}
@keyframes shine {
  to {
    background-position-x: -200%;
  }
}
