.mm-live-chat {
  position: fixed;
  right: 86px;
  bottom: 20px;
  z-index: 9998;
  font-size: 16px;
  font-family: inherit;
  --mm-live-chat-primary: var(--color-primary, #510d02);
  --mm-live-chat-secondary: var(--color-secondary, #f7cfc8);
  --mm-live-chat-text: var(--color-quaternary, #181818);
  --mm-live-chat-light: var(--color-background-tertiary, #fefef2);
  --mm-live-chat-muted: var(--color-background-secondary, #f4f5f9);
}

.mm-live-chat .mm-btn {
  min-height: 42px;
  padding: 10px 18px;
  font-size: 14px !important;
  line-height: 1.2;
  text-transform: none !important;
}

.mm-live-chat__launcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px !important;
  border-radius: 999px;
  box-shadow: 0 12px 35px rgba(17, 24, 39, 0.22);
  cursor: pointer;
}

.mm-live-chat__launcher-icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #9ca3af;
  box-shadow: 0 0 0 5px rgba(156, 163, 175, 0.18);
}

.mm-live-chat.is-operator-online .mm-live-chat__launcher-icon {
  background: #34d399;
  box-shadow: 0 0 0 5px rgba(52, 211, 153, 0.18);
}

.mm-live-chat.is-ai-online .mm-live-chat__launcher-icon {
  background: #a78bfa;
  box-shadow: 0 0 0 5px rgba(167, 139, 250, 0.2);
}

.mm-live-chat__panel {
  position: absolute;
  right: 0;
  bottom: 64px;
  width: min(480px, calc(100vw - 30px));
  overflow: hidden;
  background: var(--mm-live-chat-light);
  box-shadow: 0 24px 70px rgba(17, 24, 39, 0.28);
  pointer-events: none;
  transform: translateY(18px);
  transform-origin: right bottom;
  transition: transform 0.22s ease-out;
}

.mm-live-chat__panel[hidden] {
  display: none !important;
}

.mm-live-chat.is-open .mm-live-chat__panel {
  pointer-events: auto;
  transform: translateY(0);
}

.mm-live-chat__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  background: var(--mm-live-chat-primary) !important;
  background-color: var(--mm-live-chat-primary) !important;
  background-image: none !important;
  color: var(--color-tertiary, #fdfdfd);
} .mm-live-chat__header::before {
  content: none !important;
  height: 0 !important;
}

.mm-live-chat__header strong {
  display: block;
  font-size: 16px;
  line-height: 1.3;
}

.mm-live-chat__header span {
  display: block;
  margin-top: 3px;
  color: rgb(from var(--color-tertiary, #fdfdfd) r g b / 74%);
  font-size: 12px;
  line-height: 1.35;
}

.mm-live-chat__close {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  width: 42px;
  height: 38px;
  min-height: 28px !important;
  padding: 0 !important;
  color: var(--color-tertiary, #fdfdfd) !important;
  cursor: pointer;
  pointer-events: auto;
  border-color: transparent !important;
  outline-color: transparent !important;
} .mm-live-chat__close svg {
  width: 16px;
  height: 16px;
  color: inherit;
}

.mm-live-chat__close:focus,
.mm-live-chat__close:focus-visible {
  outline: 1px solid var(--color-tertiary, #fdfdfd) !important;
  outline-offset: 2px;
  border-color: transparent !important;
}

.mm-live-chat__identity {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid rgb(from var(--mm-live-chat-text) r g b / 10%);
}

.mm-live-chat__identity[hidden] {
  display: none !important;
}

.mm-live-chat__ai-consent {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgb(from var(--mm-live-chat-text) r g b / 10%);
  background: rgb(from var(--mm-live-chat-secondary) r g b / 38%);
  color: var(--mm-live-chat-primary);
  font-size: 12px;
  line-height: 1.4;
} .mm-live-chat__ai-consent-text {
  flex: 1 1 auto;
} .mm-live-chat__ai-consent-dismiss {
  flex: 0 0 auto;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  padding: 5px 8px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
} .mm-live-chat__ai-consent[hidden] {
  display: none !important;
}

.mm-live-chat .mm-form-control {
  font-family: inherit;
}

.mm-live-chat__identity .mm-form-control {
  height: 38px;
}

.mm-live-chat__messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 300px;
  max-height: 42vh;
  overflow-y: auto;
  padding: 14px;
  background: var(--mm-live-chat-muted);
}

.mm-live-chat__message {
  max-width: 86%;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--mm-live-chat-text);
  background: var(--mm-live-chat-light);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.mm-live-chat__message a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mm-live-chat__message code {
  padding: 2px 4px;
  border-radius: 4px;
  background: rgb(from var(--mm-live-chat-text) r g b / 10%);
  font-family: monospace;
  font-size: 0.92em;
}

.mm-live-chat__message--visitor {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: var(--mm-live-chat-primary);
  color: var(--color-tertiary, #fdfdfd);
}

.mm-live-chat__message--operator,
.mm-live-chat__message--ai {
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.mm-live-chat__message--system {
  align-self: center;
  max-width: 100%;
  background: rgb(from var(--mm-live-chat-secondary) r g b / 45%);
  color: var(--mm-live-chat-primary);
  text-align: center;
}

.mm-live-chat__typing {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-style: italic;
}

.mm-live-chat__typing-dots {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.mm-live-chat__typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.35;
  animation: mm-live-chat-typing 1s ease-in-out infinite;
}

.mm-live-chat__typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.mm-live-chat__typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes mm-live-chat-typing {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }

  40% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

.mm-live-chat__form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgb(from var(--mm-live-chat-text) r g b / 10%);
  background: var(--mm-live-chat-light);
}

.mm-live-chat__form[hidden],
.mm-live-chat__closed[hidden] {
  display: none !important;
}

.mm-live-chat.is-closed .mm-live-chat__form {
  display: none !important;
}

.mm-live-chat:not(.is-closed) .mm-live-chat__closed {
  display: none !important;
}

.mm-live-chat__input {
  min-height: 42px;
  max-height: 120px;
  resize: vertical;
}

.mm-live-chat__send {
  min-width: 72px;
}

.mm-live-chat__closed {
  padding: 12px;
  border-top: 1px solid rgb(from var(--mm-live-chat-text) r g b / 10%);
  background: var(--mm-live-chat-light);
}

.mm-live-chat__new {
  width: 100%;
  min-height: 42px;
}

.mm-live-chat.is-closed .mm-live-chat__messages {
  height: 330px;
}

.mm-live-chat__send:disabled,
.mm-live-chat__input:disabled {
  opacity: 0.65;
  cursor: wait;
}

@media (max-width: 767px) {
  html.mm-live-chat-open,
  html.mm-live-chat-open body {
    overflow: hidden !important;
    overscroll-behavior: none;
  }

  .mm-live-chat {
    right: 12px;
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    --mm-live-chat-mobile-top: calc(
      env(safe-area-inset-top, 0px) + var(--mm-mobile-sticky-vv-top, 0px) +
        var(--mm-mobile-top-bar-stuck-height, 35px) + 64px
    );
  }

  .mm-live-chat__panel {
    position: fixed;
    top: var(--mm-live-chat-mobile-top);
    left: 0;
    bottom: calc(0px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    height: auto;
    width: auto;
    max-height: none;
    transform: translateY(calc(100% + 16px));
    transform-origin: center bottom;
  }

  @supports (height: 100dvh) {
    .mm-live-chat__panel {
      height: auto;
    }
  }

  .mm-live-chat__header,
  .mm-live-chat__identity,
  .mm-live-chat__ai-consent,
  .mm-live-chat__form,
  .mm-live-chat__closed {
    flex: 0 0 auto;
  }

  .mm-live-chat__ai-consent {
    align-items: flex-start;
    font-size: 11px;
  }

  .mm-live-chat__messages,
  .mm-live-chat.is-closed .mm-live-chat__messages {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .mm-live-chat__input {
    touch-action: manipulation;
  }

  .mm-live-chat__identity {
    grid-template-columns: 1fr;
  }

  html.mm-live-chat-open .scroll-top {
    display: none !important;
    pointer-events: none !important;
  }
}
