.loading-chat {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  color: #fff;
  background: #1b1a18;
  visibility: visible;
  overflow: hidden;
}

html.has-chat-loader:not(.skip-full-loader) .loading-screen {
  display: block !important;
}

html.has-chat-loader:not(.skip-full-loader):not(.loading-chat-release) .loading-container {
  transform: translateY(0) !important;
}

html.has-chat-loader.loading-chat-release .loading-container {
  pointer-events: none;
  transform: translateY(-100%) !important;
  transition: transform 1.15s cubic-bezier(.76, 0, .24, 1);
}

.loading-chat__shell {
  width: min(900px, 100%);
  max-height: calc(100dvh - 64px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.loading-chat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.loading-chat__brand {
  font-family: Lektorat, Impact, sans-serif;
  font-size: 30px;
  line-height: 1;
  font-weight: 800;
  text-transform: uppercase;
}

.loading-chat__online {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
  line-height: 1;
}

.loading-chat__online::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: #39d77d;
  box-shadow: 0 0 0 5px rgba(57, 215, 125, 0.15);
}

.loading-chat__thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.loading-chat__message {
  width: min(82%, 700px);
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: end;
  gap: 10px;
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  transition: opacity 260ms ease, transform 360ms cubic-bezier(.2, .8, .2, 1);
}

.loading-chat__message.is-ruslan {
  align-self: flex-end;
  grid-template-columns: minmax(0, 1fr) 46px;
}

.loading-chat__message.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.loading-chat__avatar {
  grid-column: 1;
  width: 46px;
  height: 46px;
  border: 2px solid #f05235;
  border-radius: 50%;
  object-fit: cover;
  background: #000;
}

.loading-chat__message.is-ruslan .loading-chat__avatar {
  grid-column: 2;
}

.loading-chat__content {
  min-width: 0;
}

.loading-chat__message.is-ruslan .loading-chat__content {
  grid-column: 1;
  grid-row: 1;
}

.loading-chat__name {
  margin: 0 0 5px;
  color: #f05235;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
}

.loading-chat__message.is-ruslan .loading-chat__name {
  text-align: right;
}

.loading-chat__bubble {
  margin: 0;
  padding: 13px 16px 14px;
  color: #111;
  background: #efede7;
  border-radius: 22px 22px 22px 7px;
  font-size: 18px;
  line-height: 1.25;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.loading-chat__message.is-ruslan .loading-chat__bubble {
  color: #fff;
  background: #f05235;
  border-radius: 22px 22px 7px 22px;
}

.loading-chat__message.is-typing {
  width: auto;
  max-width: 230px;
}

.loading-chat__message.is-typing .loading-chat__bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  min-width: 62px;
  min-height: 42px;
}

.loading-chat__typing-label {
  margin-right: 5px;
  font-size: 13px;
  opacity: 0.68;
}

.loading-chat__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.35;
  animation: loading-chat-dot 900ms infinite ease-in-out;
}

.loading-chat__dot:nth-child(3) {
  animation-delay: 120ms;
}

.loading-chat__dot:nth-child(4) {
  animation-delay: 240ms;
}

html.has-chat-loader .loading__numbers,
html.has-chat-loader .loading__progress {
  display: none !important;
  visibility: hidden !important;
}

@keyframes loading-chat-dot {
  0%, 60%, 100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@media (max-width: 767px) {
  .loading-chat {
    align-items: flex-start;
    padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
  }

  .loading-chat__shell {
    max-height: calc(100dvh - 36px);
    gap: 14px;
  }

  .loading-chat__brand {
    font-size: 25px;
  }

  .loading-chat__online {
    font-size: 11px;
  }

  .loading-chat__thread {
    gap: 9px;
  }

  .loading-chat__message {
    width: 91%;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 8px;
  }

  .loading-chat__message.is-ruslan {
    grid-template-columns: minmax(0, 1fr) 38px;
  }

  .loading-chat__avatar {
    width: 38px;
    height: 38px;
  }

  .loading-chat__name {
    margin-bottom: 4px;
    font-size: 10px;
  }

  .loading-chat__bubble {
    padding: 10px 12px 11px;
    border-radius: 18px 18px 18px 6px;
    font-size: 15px;
    line-height: 1.22;
  }

  .loading-chat__message.is-ruslan .loading-chat__bubble {
    border-radius: 18px 18px 6px 18px;
  }
}

@media (max-height: 680px) {
  .loading-chat__shell {
    gap: 9px;
  }

  .loading-chat__head {
    padding-bottom: 8px;
  }

  .loading-chat__thread {
    gap: 6px;
  }

  .loading-chat__avatar {
    width: 34px;
    height: 34px;
  }

  .loading-chat__message {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .loading-chat__message.is-ruslan {
    grid-template-columns: minmax(0, 1fr) 34px;
  }

  .loading-chat__bubble {
    padding: 8px 11px 9px;
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-chat__message {
    transition-duration: 1ms;
  }

  .loading-chat__dot {
    animation: none;
  }

  html.has-chat-loader.loading-chat-release .loading-container {
    transition-duration: 180ms;
  }
}
