.ml-chatbot,
.ml-chatbot-ai {
  --ml-chatbot-card: #ffffff;
  --ml-chatbot-border: #e5e7eb;
  --ml-chatbot-text: #142033;
  --ml-chatbot-muted: #667085;
  --ml-chatbot-primary: #1d4ed8;
  --ml-chatbot-primary-dark: #163ea9;
  --ml-chatbot-primary-hover: #163ea9;
  --ml-chatbot-shadow: 0 20px 50px rgba(15, 23, 42, 0.1);
  color: var(--ml-chatbot-text);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.ml-chatbot {
  width: 100%;
}

.ml-chatbot__surface,
.ml-chatbot-ai__card {
  background: var(--ml-chatbot-card);
  border: 1px solid var(--ml-chatbot-border);
  border-radius: 22px;
  box-shadow: var(--ml-chatbot-shadow);
  color: inherit;
  overflow: hidden;
  width: 100%;
}

.ml-chatbot__container,
.ml-chatbot-ai__frame {
  background: #ffffff;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.ml-chatbot__header,
.ml-chatbot-ai__frame-header {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--ml-chatbot-border);
  display: flex;
  flex-shrink: 0;
  gap: 16px;
  justify-content: space-between;
  padding: 18px 20px;
}

.ml-chatbot-ai__header-main {
  align-items: center;
  display: flex;
  gap: 14px;
  min-width: 0;
}

.ml-chatbot-ai__logo {
  border-radius: 16px;
  height: 52px;
  object-fit: cover;
  width: 52px;
}

.ml-chatbot-ai__logo--fallback,
.ml-chatbot-ai__launcher-badge {
  align-items: center;
  background: var(--ml-chatbot-primary);
  color: #fff;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
}

.ml-chatbot-ai__logo--fallback {
  border-radius: 16px;
  height: 52px;
  width: 52px;
}

.ml-chatbot-ai__brand {
  color: var(--ml-chatbot-primary-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.ml-chatbot-ai__title {
  color: var(--ml-chatbot-text);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 2px;
}

.ml-chatbot-ai__subtitle {
  align-items: center;
  color: var(--ml-chatbot-muted);
  display: inline-flex;
  font-size: 0.84rem;
  font-weight: 500;
  gap: 8px;
  margin: 0;
}

.ml-chatbot__body,
.ml-chatbot-ai__chatkit-shell {
  background: #ffffff;
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}

.ml-chatbot-ai__chatkit {
  display: block;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  width: 100%;
}

.ml-chatbot-ai__chatkit-fallback {
  align-items: center;
  color: var(--ml-chatbot-muted);
  display: flex;
  font-size: 0.95rem;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: absolute;
  text-align: center;
}

.ml-chatbot-ai__close {
  align-items: center;
  background: transparent;
  border-radius: 999px;
  border: 0;
  color: var(--ml-chatbot-muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 1.8rem;
  justify-content: center;
  line-height: 1;
  padding: 0;
  transition: background-color 0.18s ease, color 0.18s ease;
  width: 32px;
}

.ml-chatbot-ai__close:hover,
.ml-chatbot-ai__close:focus-visible {
  background: var(--ml-chatbot-primary-hover);
  color: #fff;
  outline: none;
}

.ml-chatbot-ai-unavailable {
  color: #475467;
  font-size: 0.95rem;
  padding: 12px 0;
}

.ml-chatbot--floating,
.ml-chatbot-ai--popup {
  bottom: 24px;
  display: block;
  position: fixed;
  width: auto;
  z-index: 9999;
}

.ml-chatbot-ai--popup-right {
  right: 24px;
}

.ml-chatbot-ai--popup-left {
  left: 24px;
}

.ml-chatbot--floating .ml-chatbot-ai__panel,
.ml-chatbot-ai--popup .ml-chatbot-ai__panel {
  margin-top: 12px;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity 0.2s ease, transform 0.24s ease;
  width: 380px;
  max-width: calc(100vw - 32px);
}

.ml-chatbot--floating.ml-chatbot-ai--popup-left .ml-chatbot-ai__panel,
.ml-chatbot-ai--popup.ml-chatbot-ai--popup-left .ml-chatbot-ai__panel {
  transform-origin: bottom left;
}

.ml-chatbot--floating.is-open .ml-chatbot-ai__panel,
.ml-chatbot-ai--popup.is-open .ml-chatbot-ai__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.ml-chatbot--floating .ml-chatbot__surface,
.ml-chatbot-ai--popup .ml-chatbot-ai__card {
  max-width: none;
}

.ml-chatbot--floating .ml-chatbot__container,
.ml-chatbot-ai--popup .ml-chatbot-ai__frame {
  display: flex;
  flex-direction: column;
  height: min(520px, calc(100vh - 48px));
  max-height: calc(100vh - 48px);
  min-height: 0;
}

.ml-chatbot--floating .ml-chatbot__body,
.ml-chatbot--floating .ml-chatbot-ai__chatkit,
.ml-chatbot-ai--popup .ml-chatbot-ai__chatkit-shell,
.ml-chatbot-ai--popup .ml-chatbot-ai__chatkit {
  min-height: 0;
}

.ml-chatbot--embedded,
.ml-chatbot-ai--embedded {
  align-items: stretch;
  display: block;
  margin: 0 auto;
  max-width: 960px;
  padding: 24px 16px;
  position: relative;
}

.ml-chatbot--embedded .ml-chatbot-ai__panel,
.ml-chatbot-ai--embedded .ml-chatbot-ai__panel {
  width: 100%;
}

.ml-chatbot--embedded .ml-chatbot__surface,
.ml-chatbot-ai--embedded .ml-chatbot-ai__card {
  max-width: 100%;
}

.ml-chatbot--embedded .ml-chatbot__container,
.ml-chatbot-ai--embedded .ml-chatbot-ai__frame {
  display: flex;
  flex-direction: column;
  height: 600px;
  min-height: 520px;
  max-height: 680px;
}

.ml-chatbot--embedded .ml-chatbot__body,
.ml-chatbot--embedded .ml-chatbot-ai__chatkit,
.ml-chatbot-ai--embedded .ml-chatbot-ai__chatkit-shell,
.ml-chatbot-ai--embedded .ml-chatbot-ai__chatkit {
  min-height: 0;
}

.ml-chatbot-ai__launcher {
  align-items: center;
  background: var(--ml-chatbot-primary);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.2);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  gap: 12px;
  padding: 12px 18px;
  transition: transform 0.18s ease, box-shadow 0.2s ease;
}

.ml-chatbot-ai__launcher:hover {
  background: var(--ml-chatbot-primary-hover);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.24);
  transform: translateY(-1px);
}

.ml-chatbot--floating:not(.is-open) .ml-chatbot-ai__launcher,
.ml-chatbot-ai--popup:not(.is-open) .ml-chatbot-ai__launcher,
.ml-chatbot--floating:not(.is-open) .ml-chatbot-ai__launcher:hover,
.ml-chatbot-ai--popup:not(.is-open) .ml-chatbot-ai__launcher:hover {
  background: var(--ml-chatbot-primary);
}

.ml-chatbot--floating.is-open .ml-chatbot-ai__launcher,
.ml-chatbot-ai--popup.is-open .ml-chatbot-ai__launcher {
  background: var(--ml-chatbot-primary-hover);
}

.ml-chatbot-ai__launcher-logo {
  border-radius: 999px;
  height: 28px;
  object-fit: cover;
  width: 28px;
}

.ml-chatbot-ai__launcher-badge {
  border-radius: 999px;
  font-size: 0.9rem;
  height: 28px;
  width: 28px;
}

.ml-chatbot-ai__launcher-text {
  font-size: 0.95rem;
  font-weight: 700;
}

.ml-chatbot-ai--launcher-no-label .ml-chatbot-ai__launcher {
  gap: 0;
  height: 56px;
  justify-content: center;
  padding: 0;
  width: 56px;
}

.ml-chatbot-ai--launcher-no-label .ml-chatbot-ai__launcher-text {
  display: none;
}

body.admin-bar .ml-chatbot--floating,
body.admin-bar .ml-chatbot-ai--popup {
  bottom: 52px;
}

.ml-chatbot-ai__status-dot {
  background: #22c55e;
  border-radius: 999px;
  display: inline-block;
  height: 8px;
  width: 8px;
}

.ml-chatbot-ai__status-dot.is-offline {
  background: #ef4444;
}

@media (max-width: 640px) {
  .ml-chatbot--floating,
  .ml-chatbot-ai--popup {
    bottom: 12px;
  }

  .ml-chatbot-ai--popup-right {
    left: auto;
    right: 12px;
  }

  .ml-chatbot-ai--popup-left {
    left: 12px;
    right: auto;
  }

  .ml-chatbot--floating .ml-chatbot-ai__panel,
  .ml-chatbot-ai--popup .ml-chatbot-ai__panel {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
  }

  .ml-chatbot--floating .ml-chatbot__container,
  .ml-chatbot-ai--popup .ml-chatbot-ai__frame {
    height: min(78vh, 520px);
    min-height: 0;
  }

  .ml-chatbot--embedded,
  .ml-chatbot-ai--embedded {
    padding: 16px 0;
  }

  .ml-chatbot--embedded .ml-chatbot__container,
  .ml-chatbot-ai--embedded .ml-chatbot-ai__frame {
    height: 70vh;
    min-height: 500px;
    max-height: 700px;
  }

  .ml-chatbot__surface,
  .ml-chatbot-ai__card {
    border-radius: 20px;
  }

  .ml-chatbot__header,
  .ml-chatbot-ai__frame-header {
    padding: 18px;
  }

  .ml-chatbot-ai__launcher {
    border-radius: 999px;
    gap: 0;
    height: 56px;
    justify-content: center;
    padding: 0;
    width: 56px;
  }

  .ml-chatbot-ai__launcher-text {
    display: none;
  }
}
