.kcsf-ai-chatbot-root {
  --kcsf-primary: #2a2a86;
  --kcsf-header-text: #ffffff;
  --kcsf-bot-bubble: #ffffff;
  --kcsf-font-size: 14px;
  --kcsf-button-size: 64px;
  --kcsf-window-width: 360px;
  --kcsf-window-height: 520px;
  --kcsf-bottom-offset: 24px;
  --kcsf-side-offset: 24px;
  font-family: Arial, sans-serif;
  font-size: var(--kcsf-font-size);
  position: relative;
  z-index: 999999;
}

.kcsf-ai-chatbot-root * {
  box-sizing: border-box;
}

.kcsf-ai-chatbot-launcher {
  align-items: center;
  background: var(--kcsf-primary);
  border: 0;
  border-radius: 999px;
  bottom: var(--kcsf-bottom-offset);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font: 700 15px/1 Arial, sans-serif;
  gap: 8px;
  height: var(--kcsf-button-size);
  justify-content: center;
  min-width: var(--kcsf-button-size);
  padding: 0 18px;
  position: fixed;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.kcsf-ai-chatbot-launcher-icon {
  align-items: center;
  display: inline-flex;
  font-size: 20px;
  height: 24px;
  justify-content: center;
  line-height: 1;
  width: 24px;
}

.kcsf-ai-chatbot-launcher-icon img {
  display: block;
  height: 24px;
  object-fit: contain;
  width: 24px;
}

.kcsf-ai-chatbot-launcher-label {
  display: inline-flex;
  line-height: 1;
}

.kcsf-ai-chatbot-launcher:hover,
.kcsf-ai-chatbot-launcher:focus-visible {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.kcsf-ai-chatbot-root[data-position="bottom_right"] .kcsf-ai-chatbot-launcher,
.kcsf-ai-chatbot-root[data-position="bottom_right"] .kcsf-ai-chatbot-panel,
.kcsf-ai-chatbot-root[data-position="bottom_right"] .kcsf-ai-chatbot-proactive {
  right: var(--kcsf-side-offset);
}

.kcsf-ai-chatbot-root[data-position="bottom_left"] .kcsf-ai-chatbot-launcher,
.kcsf-ai-chatbot-root[data-position="bottom_left"] .kcsf-ai-chatbot-panel,
.kcsf-ai-chatbot-root[data-position="bottom_left"] .kcsf-ai-chatbot-proactive {
  left: var(--kcsf-side-offset);
}

.kcsf-ai-chatbot-proactive {
  align-items: flex-start;
  background: #ffffff;
  border: 1px solid rgba(42, 42, 134, 0.12);
  border-radius: 16px;
  bottom: calc(var(--kcsf-bottom-offset) + var(--kcsf-button-size) + 12px);
  box-shadow: 0 14px 34px rgba(17, 24, 39, 0.18);
  color: #1f2937;
  display: flex;
  gap: 10px;
  line-height: 1.4;
  max-width: min(300px, calc(100vw - 32px));
  opacity: 0;
  padding: 12px 12px 12px 14px;
  pointer-events: none;
  position: fixed;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
  visibility: hidden;
}

.kcsf-ai-chatbot-proactive.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

.kcsf-ai-chatbot-proactive::after {
  background: #ffffff;
  bottom: -5px;
  content: "";
  height: 10px;
  position: absolute;
  transform: rotate(45deg);
  width: 10px;
}

.kcsf-ai-chatbot-root[data-position="bottom_right"] .kcsf-ai-chatbot-proactive::after {
  right: 26px;
}

.kcsf-ai-chatbot-root[data-position="bottom_left"] .kcsf-ai-chatbot-proactive::after {
  left: 26px;
}

.kcsf-ai-chatbot-proactive-close {
  align-items: center;
  background: #eef0ff;
  border: 0;
  border-radius: 999px;
  color: var(--kcsf-primary);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 22px;
  height: 22px;
  justify-content: center;
  margin-top: -2px;
  padding: 0;
  position: relative;
  transition: background-color 160ms ease, transform 160ms ease;
  width: 22px;
}

.kcsf-ai-chatbot-proactive-close:hover,
.kcsf-ai-chatbot-proactive-close:focus-visible {
  background: #dfe3ff;
  outline: none;
  transform: rotate(90deg);
}

.kcsf-ai-chatbot-proactive-close::before,
.kcsf-ai-chatbot-proactive-close::after {
  background: currentColor;
  border-radius: 999px;
  content: "";
  height: 2px;
  position: absolute;
  width: 10px;
}

.kcsf-ai-chatbot-proactive-close::before {
  transform: rotate(45deg);
}

.kcsf-ai-chatbot-proactive-close::after {
  transform: rotate(-45deg);
}

.kcsf-ai-chatbot-panel {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  bottom: calc(var(--kcsf-bottom-offset) + var(--kcsf-button-size) + 14px);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  height: var(--kcsf-window-height);
  max-height: calc(100vh - 32px);
  overflow: hidden;
  position: fixed;
  width: var(--kcsf-window-width);
}

.kcsf-ai-chatbot-panel[hidden] {
  display: none !important;
}

.kcsf-ai-chatbot-header {
  align-items: center;
  background: var(--kcsf-primary);
  color: var(--kcsf-header-text);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 16px;
}

.kcsf-ai-chatbot-header strong,
.kcsf-ai-chatbot-header small {
  display: block;
}

.kcsf-ai-chatbot-header strong {
  font-size: 16px;
  line-height: 1.25;
}

.kcsf-ai-chatbot-header small {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
  margin-top: 4px;
  opacity: 0.9;
}

.kcsf-ai-chatbot-close {
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 50%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  color: var(--kcsf-header-text);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 34px;
  height: 34px;
  justify-content: center;
  padding: 0;
  position: relative;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  width: 34px;
}

.kcsf-ai-chatbot-close:hover,
.kcsf-ai-chatbot-close:focus-visible {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 6px 16px rgba(0, 0, 0, 0.16);
  outline: none;
  transform: translateY(-1px) rotate(90deg);
}

.kcsf-ai-chatbot-close::before,
.kcsf-ai-chatbot-close::after {
  background: currentColor;
  border-radius: 999px;
  content: "";
  height: 2px;
  position: absolute;
  width: 14px;
}

.kcsf-ai-chatbot-close::before {
  transform: rotate(45deg);
}

.kcsf-ai-chatbot-close::after {
  transform: rotate(-45deg);
}

.kcsf-ai-chatbot-messages {
  background: #f7f7fb;
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  padding: 14px;
}

.kcsf-ai-chatbot-message {
  border-radius: 14px;
  font-size: var(--kcsf-font-size);
  line-height: 1.45;
  margin-bottom: 10px;
  max-width: 85%;
  overflow-wrap: break-word;
  padding: 10px 12px;
  white-space: pre-line;
}

.kcsf-ai-chatbot-message-user {
  background: var(--kcsf-primary);
  border-bottom-right-radius: 4px;
  color: #ffffff;
  margin-left: auto;
}

.kcsf-ai-chatbot-message-bot {
  background: var(--kcsf-bot-bubble);
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
  color: #1f2937;
  margin-right: auto;
}

.kcsf-ai-chatbot-message-bot a {
  color: var(--kcsf-primary);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.kcsf-ai-chatbot-message-bot a:hover,
.kcsf-ai-chatbot-message-bot a:focus-visible {
  text-decoration-thickness: 2px;
}

.kcsf-ai-chatbot-quick-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 12px;
}

.kcsf-ai-chatbot-pre-input {
  background: #ffffff;
  display: block;
  padding: 0 12px;
}

.kcsf-ai-chatbot-pre-input:empty {
  display: none;
}

.kcsf-ai-chatbot-pre-input .kcsf-ai-chatbot-quick-questions {
  margin: 0;
  padding: 10px 0;
}

.kcsf-ai-chatbot-quick-questions.is-boxed {
  background: #f7f7fb;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  margin: 10px 0;
  padding: 12px;
}

.kcsf-ai-chatbot-quick-question {
  background: #ffffff;
  border: 1px solid rgba(42, 42, 134, 0.18);
  border-radius: 999px;
  color: var(--kcsf-primary);
  cursor: pointer;
  font: 700 12px/1.25 Arial, sans-serif;
  padding: 8px 10px;
  text-align: left;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.kcsf-ai-chatbot-quick-question:hover,
.kcsf-ai-chatbot-quick-question:focus-visible {
  background: var(--kcsf-primary);
  border-color: var(--kcsf-primary);
  color: #ffffff;
  outline: none;
  transform: translateY(-1px);
}

.kcsf-ai-chatbot-logo {
  align-items: center;
  display: flex;
  justify-content: center;
  padding: 10px 0;
  width: 100%;
}

.kcsf-ai-chatbot-logo.is-bottom {
  margin-top: auto;
}

.kcsf-ai-chatbot-logo img {
  display: block;
  height: auto;
  max-width: min(180px, 70%);
  object-fit: contain;
}

.kcsf-ai-chatbot-logo-small img {
  max-height: 40px;
}

.kcsf-ai-chatbot-logo-medium img {
  max-height: 55px;
}

.kcsf-ai-chatbot-logo-large img {
  max-height: 70px;
}

.kcsf-ai-chatbot-form {
  align-items: center;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 8px;
  padding: 12px;
}

.kcsf-ai-chatbot-input {
  border: 1px solid #d1d5db;
  border-radius: 999px;
  flex: 1;
  font: 400 var(--kcsf-font-size)/1.3 Arial, sans-serif;
  min-width: 0;
  outline: none;
  padding: 10px 12px;
}

.kcsf-ai-chatbot-input:focus {
  border-color: var(--kcsf-primary);
  box-shadow: 0 0 0 3px rgba(42, 42, 134, 0.12);
}

.kcsf-ai-chatbot-send {
  background: var(--kcsf-primary);
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  cursor: pointer;
  flex: 0 0 auto;
  font: 700 var(--kcsf-font-size)/1 Arial, sans-serif;
  min-height: 40px;
  padding: 0 16px;
}

.kcsf-ai-chatbot-send:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

@media (max-width: 480px) {
  .kcsf-ai-chatbot-panel {
    bottom: calc(var(--kcsf-bottom-offset) + var(--kcsf-button-size) + 12px);
    height: 70vh;
    left: 12px !important;
    max-height: 70vh;
    right: 12px !important;
    width: auto;
  }

  .kcsf-ai-chatbot-root[data-position="bottom_right"] .kcsf-ai-chatbot-launcher {
    right: 18px;
  }

  .kcsf-ai-chatbot-root[data-position="bottom_left"] .kcsf-ai-chatbot-launcher {
    left: 18px;
  }

  .kcsf-ai-chatbot-root[data-position="bottom_right"] .kcsf-ai-chatbot-proactive {
    right: 18px;
  }

  .kcsf-ai-chatbot-root[data-position="bottom_left"] .kcsf-ai-chatbot-proactive {
    left: 18px;
  }
}
