.hma-chat {
  --hma-chat-primary: #071524;
  --hma-chat-accent: #ff6b1a;
  --hma-chat-surface: #ffffff;
  --hma-chat-muted: #65717d;
  --hma-chat-border: rgba(7, 21, 36, 0.14);
  --hma-chat-shadow: 0 22px 60px rgba(7, 21, 36, 0.22);
  color: var(--hma-chat-primary);
  font-family: Inter, Montserrat, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.hma-chat * {
  box-sizing: border-box;
}

.hma-chat > summary {
  list-style: none;
}

.hma-chat > summary::-webkit-details-marker {
  display: none;
}

.hma-chat__launcher {
  align-items: center;
  background: var(--hma-chat-primary);
  border: 0;
  border-radius: 999px;
  bottom: 24px;
  box-shadow: 0 18px 42px rgba(7, 21, 36, 0.28);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  height: 64px;
  justify-content: center;
  position: fixed;
  right: 104px;
  transition: transform 180ms ease, box-shadow 180ms ease;
  width: 64px;
  z-index: 99998;
}

.hma-chat__launcher:hover,
.hma-chat__launcher:focus-visible {
  box-shadow: 0 20px 48px rgba(7, 21, 36, 0.34);
  outline: none;
  transform: translateY(-2px);
}

.hma-chat__launcher svg {
  height: 30px;
  width: 30px;
}

.hma-chat__panel {
  background: var(--hma-chat-surface);
  border: 1px solid var(--hma-chat-border);
  border-radius: 22px;
  bottom: 104px;
  box-shadow: var(--hma-chat-shadow);
  display: flex;
  flex-direction: column;
  max-height: min(720px, calc(100vh - 130px));
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  position: fixed;
  right: 24px;
  transform: translateY(12px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity 180ms ease, transform 180ms ease;
  width: min(420px, calc(100vw - 32px));
  z-index: 99999;
}

.hma-chat[open] .hma-chat__panel,
.hma-chat.is-open .hma-chat__panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.hma-chat__header {
  align-items: center;
  background: var(--hma-chat-primary);
  color: #ffffff;
  display: flex;
  gap: 12px;
  min-height: 76px;
  padding: 18px 20px;
}

.hma-chat__brand-mark {
  align-items: center;
  background: #ffffff;
  border-radius: 50%;
  color: var(--hma-chat-primary);
  display: flex;
  flex: 0 0 auto;
  font-family: Georgia, serif;
  font-size: 20px;
  height: 42px;
  justify-content: center;
  line-height: 1;
  width: 42px;
}

.hma-chat__brand-mark img {
  display: block;
  height: 28px;
  object-fit: contain;
  width: 28px;
}

.hma-chat__title {
  flex: 1;
  min-width: 0;
}

.hma-chat__title strong {
  display: block;
  font-size: 18px;
  line-height: 1.2;
}

.hma-chat__title span {
  color: rgba(255, 255, 255, 0.78);
  display: block;
  font-size: 13px;
  line-height: 1.4;
  margin-top: 2px;
}

.hma-chat__reset,
.hma-chat__close {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.hma-chat__reset svg,
.hma-chat__close svg {
  height: 24px;
  width: 24px;
}

.hma-chat__reset {
  margin-left: 4px;
}

.hma-chat__close:hover,
.hma-chat__close:focus-visible,
.hma-chat__reset:hover,
.hma-chat__reset:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

.hma-chat__messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  min-height: 330px;
  overflow-y: auto;
  padding: 22px;
}

.hma-chat__message {
  display: flex;
  max-width: 88%;
}

.hma-chat__message--bot {
  align-self: flex-start;
}

.hma-chat__message--user {
  align-self: flex-end;
}

.hma-chat__bubble {
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.45;
  padding: 12px 14px;
  white-space: pre-wrap;
}

.hma-chat__message--bot .hma-chat__bubble {
  background: #f4f7f9;
  color: var(--hma-chat-primary);
}

.hma-chat__message--user .hma-chat__bubble {
  background: var(--hma-chat-primary);
  color: #ffffff;
}

.hma-chat__quick-replies {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.hma-chat__quick-reply {
  background: #ffffff;
  border: 1px solid var(--hma-chat-primary);
  border-radius: 999px;
  color: var(--hma-chat-primary);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
  padding: 11px 14px;
  text-align: center;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.hma-chat__quick-reply:hover,
.hma-chat__quick-reply:focus-visible {
  background: var(--hma-chat-primary);
  color: #ffffff;
  outline: none;
}

.hma-chat__status {
  color: var(--hma-chat-muted);
  display: none;
  font-size: 13px;
  padding: 0 22px 12px;
}

.hma-chat.is-typing .hma-chat__status {
  display: block;
}

.hma-chat__form {
  align-items: center;
  border-top: 1px solid var(--hma-chat-border);
  display: flex;
  gap: 10px;
  padding: 16px;
}

.hma-chat__input {
  background: #f7f9fb;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--hma-chat-primary);
  flex: 1;
  font: inherit;
  font-size: 15px;
  min-width: 0;
  padding: 13px 15px;
}

.hma-chat__input:focus {
  background: #ffffff;
  border-color: rgba(7, 21, 36, 0.34);
  outline: none;
}

.hma-chat__send {
  align-items: center;
  background: var(--hma-chat-accent);
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  flex: 0 0 auto;
  height: 46px;
  justify-content: center;
  width: 46px;
}

.hma-chat__send svg {
  color: #ffffff;
  display: block;
  flex: 0 0 24px;
  height: 24px;
  width: 24px;
}

.hma-chat__send svg path {
  fill: #ffffff;
}

.hma-chat__send:hover,
.hma-chat__send:focus-visible {
  filter: brightness(0.96);
  outline: none;
}

.hma-chat__send:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

#scroll_top,
.scroll_top,
.backtop,
.back-to-top,
.wpestate_scroll_to_top,
.wpestate_back_to_top,
body > a[href="#top"] {
  bottom: 26px !important;
  right: 24px !important;
  z-index: 99997 !important;
}

@media (max-width: 520px) {
  #scroll_top,
  .scroll_top,
  .backtop,
  .back-to-top,
  .wpestate_scroll_to_top,
  .wpestate_back_to_top,
  body > a[href="#top"] {
    bottom: 18px !important;
    right: 18px !important;
  }

  .hma-chat__launcher {
    bottom: 18px;
    height: 58px;
    right: 88px;
    width: 58px;
  }

  .hma-chat__panel {
    border-radius: 20px 20px 0 0;
    bottom: 0;
    height: calc(100dvh - max(12px, env(safe-area-inset-top)));
    max-height: none;
    right: 0;
    top: max(12px, env(safe-area-inset-top));
    width: 100vw;
  }

  .hma-chat__header,
  .hma-chat__form {
    flex: 0 0 auto;
  }

  .hma-chat__header {
    border-radius: 20px 20px 0 0;
    min-height: 76px;
  }

  .hma-chat__messages {
    min-height: 0;
  }
}

@supports not (height: 100dvh) {
  @media (max-width: 520px) {
    .hma-chat__panel {
      height: calc(100vh - max(12px, env(safe-area-inset-top)));
    }
  }
}
