.atla-chat {
  --chat-ink: #182b3b;
  --chat-muted: #49606c;
  --chat-border: #d0dce2;
  --chat-surface: #f6fafb;
  --chat-header: #123649;
  --chat-accent: #087376;
  --chat-bottom: 19px;
  position: fixed;
  right: max(19px, env(safe-area-inset-right));
  bottom: calc(var(--chat-bottom) + env(safe-area-inset-bottom));
  z-index: 24;
  color: var(--chat-ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
}

@media (max-width: 767px) {
  .atla-chat {
    --chat-bottom: var(--atla-chat-mobile-bottom, 24px);
  }
}

.atla-chat,
.atla-chat * {
  box-sizing: border-box;
}

.atla-chat [hidden],
.atla-chat[hidden] {
  display: none !important;
}

.atla-chat button,
.atla-chat input {
  margin: 0;
  font-family: inherit;
  line-height: inherit;
}

.atla-chat :where(button, a, input, [tabindex]):focus-visible {
  outline: 2px solid var(--chat-accent);
  outline-offset: 3px;
}

.atla-chat__launcher {
  display: flex;
  min-height: 49px;
  align-items: center;
  gap: 9px;
  padding: 0 17px;
  border: 1px solid #164759;
  border-radius: 30px;
  background: #123649;
  color: #ffffff;
  box-shadow: 0 6px 20px #16364835;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.atla-chat__launcher:hover {
  background: #174d5e;
}

.atla-chat__bubble-icon {
  position: relative;
  display: inline-block;
  width: 17px;
  height: 13px;
  flex: none;
  border: 1.5px solid currentColor;
  border-radius: 5px;
}

.atla-chat__bubble-icon::after {
  position: absolute;
  bottom: -4px;
  left: 3px;
  width: 5px;
  height: 5px;
  border-bottom: 1.5px solid currentColor;
  border-left: 1.5px solid currentColor;
  background: inherit;
  content: '';
  transform: skewY(-36deg);
}

.atla-chat__panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 11px);
  display: flex;
  width: min(386px, calc(100vw - max(19px, env(safe-area-inset-right)) - max(12px, env(safe-area-inset-left))));
  height: 532px;
  max-height: calc(100vh - var(--chat-bottom) - 74px - env(safe-area-inset-bottom));
  max-height: calc(100dvh - var(--chat-bottom) - 74px - env(safe-area-inset-bottom));
  flex-direction: column;
  overflow: auto;
  border: 1px solid var(--chat-border);
  border-radius: 20px;
  background: var(--chat-surface);
  box-shadow: 0 16px 44px #15354330;
  overscroll-behavior: contain;
}

.atla-chat--keyboard-open {
  bottom: calc(var(--chat-viewport-gap) + 8px);
}

.atla-chat--keyboard-open .atla-chat__launcher {
  visibility: hidden;
}

.atla-chat--keyboard-open .atla-chat__panel {
  bottom: 0;
  max-height: calc(var(--chat-viewport-height) - 16px - env(safe-area-inset-top));
}

.atla-chat--keyboard-open .atla-chat__messages {
  min-height: 48px;
  padding-block: 8px;
}

.atla-chat__header {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 42px;
  min-height: 62px;
  flex: none;
  align-items: center;
  gap: 10px;
  padding: 8px 11px 8px 15px;
  background: var(--chat-header);
}

.atla-chat__emblem {
  display: grid;
  width: 34px;
  height: 34px;
  flex: none;
  place-items: center;
  border-radius: 50%;
  background: #23546a;
  color: #f7fcfe;
}

.atla-chat__emblem .atla-chat__bubble-icon {
  background: #23546a;
}

.atla-chat__launcher .atla-chat__bubble-icon {
  background: #123649;
}

.atla-chat__launcher:hover .atla-chat__bubble-icon {
  background: #174d5e;
}

.atla-chat .atla-chat__title {
  min-width: 0;
  margin: 0;
  color: #ffffff;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
  writing-mode: horizontal-tb;
}

.atla-chat .atla-chat__close {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #ffffff;
  font-size: 25px;
  font-weight: 400;
  cursor: pointer;
}

.atla-chat .atla-chat__close:hover {
  background: #ffffff24;
}

.atla-chat__header :where(button, [tabindex]):focus-visible {
  outline-color: #dcf9fc;
}

.atla-chat__messages {
  display: flex;
  min-height: 76px;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 13px;
  overflow: auto;
  padding: 16px;
  background: #f2f7f9;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.atla-chat__messages:focus-visible {
  outline-offset: -3px;
}

.atla-chat__message {
  max-width: 92%;
  flex: none;
  align-self: flex-start;
  padding: 10px 13px;
  border: 1px solid #d3e1e5;
  border-radius: 16px 16px 16px 5px;
  background: #e7f1f3;
  overflow-wrap: anywhere;
}

.atla-chat__message--visitor {
  max-width: 86%;
  align-self: flex-end;
  border-color: var(--chat-accent);
  border-radius: 16px 16px 5px;
  background: var(--chat-accent);
  color: #ffffff;
}

.atla-chat__message p {
  margin: 0;
  color: inherit;
  line-height: 1.6;
  white-space: pre-line;
}

.atla-chat__message--pending {
  color: var(--chat-muted);
}

.atla-chat__typing {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 18px;
}

.atla-chat__typing > span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: atla-chat-dot 1.2s ease-in-out infinite;
}

.atla-chat__typing > span:nth-child(2) {
  animation-delay: .15s;
}

.atla-chat__typing > span:nth-child(3) {
  animation-delay: .3s;
}

@keyframes atla-chat-dot {
  0%, 60%, 100% { opacity: .45; }
  30% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .atla-chat__typing > span {
    animation: none;
  }
}


.atla-chat__message-links {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 6px;
  margin-top: 8px;
}

.atla-chat__retry,
.atla-chat__contacts a {
  color: #075e64;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.atla-chat__message-links a {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid #cadde1;
  border-radius: 7px;
  background: #f3fcfc;
  color: #175263;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.atla-chat__message-links a:hover {
  border-color: #73a8ad;
  background: #e4f3f4;
}

.atla-chat__retry {
  padding: 2px 0;
  border: 0;
  background: transparent;
  font-size: inherit;
  cursor: pointer;
}

.atla-chat__actions {
  flex: none;
  padding: 12px 14px 8px;
  border-top: 1px solid var(--chat-border);
}

.atla-chat__questions {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-self: flex-start;
  gap: 6px 7px;
}

.atla-chat__question {
  min-height: 36px;
  max-width: 100%;
  padding: 5px 11px;
  border: 1px solid #cbdcdf;
  border-radius: 18px;
  background: #ffffff;
  color: #174d5e;
  font-size: 12px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.atla-chat__question:not(:disabled):hover {
  border-color: #85b4b8;
  background: #e6f4f4;
}

.atla-chat__form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.atla-chat__form input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 7px 13px;
  border: 1px solid #c7d9e0;
  border-radius: 24px;
  background: #ffffff;
  color: var(--chat-ink);
  font-size: 16px;
}

.atla-chat__form input::placeholder {
  color: var(--chat-muted);
  font-size: 13px;
}

.atla-chat__send {
  min-width: 60px;
  min-height: 44px;
  flex: none;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 24px;
  background: var(--chat-accent);
  color: #f6fafb;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.atla-chat__send:not(:disabled):hover {
  background: #075e64;
}

.atla-chat__send:disabled {
  background: #dce7ec;
  color: #49606c;
  cursor: default;
}

.atla-chat__form[aria-busy="true"] .atla-chat__send,
.atla-chat__question:disabled {
  cursor: wait;
}

.atla-chat__privacy {
  margin: 5px 0 0;
  color: var(--chat-muted);
  font-size: 11px;
}

.atla-chat__contacts {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 5px 10px;
  padding: 6px 13px 8px;
  border-top: 1px solid var(--chat-border);
  background: #eaf3f5;
  font-size: 12px;
}

.atla-chat__contacts a {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
}

.atla-chat__visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 520px) {
  .atla-chat__question {
    min-height: 40px;
  }

  .atla-chat__header {
    min-height: 57px;
  }

  .atla-chat__contacts {
    padding-block: 4px;
  }
}
