.aicvs-chatbot {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  font-family: var(--font-sans, Inter, system-ui, sans-serif);
  color: #0f172a;
}

.aicvs-chatbot-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 58px;
  min-width: 58px;
  max-width: 58px;
  min-height: 48px;
  padding: 0;
  justify-content: center;
  border: 1px solid rgba(37, 99, 235, 0.35);
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.28), 0 4px 10px rgba(15, 23, 42, 0.16);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
}

.aicvs-chatbot-toggle > span:not(.aicvs-chatbot-toggle-dot) {
  display: none;
}

.aicvs-chatbot-toggle::after {
  content: "Ask";
  font-size: 13px;
  font-weight: 800;
}

.aicvs-chatbot-toggle:hover {
  background: #1d4ed8;
}

.aicvs-chatbot-toggle-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18);
}

.aicvs-chatbot-panel {
  display: none;
  width: min(390px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 112px));
  overflow: hidden;
  border: 1px solid #dbe5f2;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.aicvs-chatbot.is-open .aicvs-chatbot-panel {
  display: flex;
  flex-direction: column;
}

.aicvs-chatbot.is-open .aicvs-chatbot-toggle {
  display: none;
}

.aicvs-chatbot-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.aicvs-chatbot-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 800;
  color: #0f172a;
}

.aicvs-chatbot-subtitle {
  margin: 3px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: #64748b;
}

.aicvs-chatbot-close {
  width: 32px;
  height: 32px;
  border: 1px solid #dbe5f2;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.aicvs-chatbot-close:hover {
  background: #f8fafc;
}

.aicvs-chatbot-messages {
  flex: 1;
  min-height: 250px;
  overflow-y: auto;
  padding: 14px;
  background: #f8fafc;
}

.aicvs-chatbot-message {
  max-width: 92%;
  margin: 0 0 10px;
  padding: 11px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.52;
  white-space: pre-wrap;
}

.aicvs-chatbot-message.bot {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #1e293b;
}

.aicvs-chatbot-message.user {
  margin-left: auto;
  background: #1d4ed8;
  color: #fff;
}

.aicvs-chatbot-source {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 12px;
}

.aicvs-chatbot-source a {
  color: #1d4ed8;
  font-weight: 700;
  text-decoration: none;
}

.aicvs-chatbot-source a:hover {
  text-decoration: underline;
}

.aicvs-chatbot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px 0;
  background: #f8fafc;
}

.aicvs-chatbot-chip {
  border: 1px solid #dbe5f2;
  border-radius: 999px;
  background: #fff;
  color: #1e293b;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.aicvs-chatbot-chip:hover {
  border-color: #93c5fd;
  color: #1d4ed8;
}

.aicvs-chatbot-form {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.aicvs-chatbot-input {
  min-width: 0;
  flex: 1;
  height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
  color: #0f172a;
}

.aicvs-chatbot-input:focus {
  outline: 2px solid rgba(37, 99, 235, 0.18);
  border-color: #2563eb;
}

.aicvs-chatbot-send {
  width: 44px;
  height: 42px;
  border: 1px solid #1d4ed8;
  border-radius: 9px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
}

.aicvs-chatbot-send:hover {
  background: #1d4ed8;
}

.aicvs-chatbot-note {
  padding: 0 14px 13px;
  background: #fff;
  color: #64748b;
  font-size: 11px;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .aicvs-chatbot {
    left: auto;
    right: 14px;
    bottom: 14px;
  }

  .aicvs-chatbot-toggle {
    width: 58px !important;
    min-width: 58px !important;
    max-width: 58px !important;
    min-height: 40px;
    padding: 0 !important;
    justify-content: center;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24), 0 3px 8px rgba(15, 23, 42, 0.14);
    font-size: 0 !important;
    overflow: hidden;
  }

  .aicvs-chatbot-toggle > span:not(.aicvs-chatbot-toggle-dot) {
    display: none !important;
  }

  .aicvs-chatbot-panel {
    width: calc(100vw - 24px);
    max-height: 78vh;
    border-radius: 12px;
  }
}
