.ai-chatbot-widget {
  position: fixed;
  right: var(--ai-chatbot-right, 18px);
  bottom: var(--ai-chatbot-bottom, 18px);
  z-index: 99999;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}

.ai-chatbot-toggle {
  border: none;
  border-radius: 999px;
  background: #0b5fff;
  color: #fff;
  padding: 12px 18px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.ai-chatbot-toggle.has-image {
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.ai-chatbot-toggle-image {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 50%;
}

.ai-chatbot-panel {
  width: min(360px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 90px));
  margin-top: 10px;
  background: #fff;
  border: 1px solid #d7dbe0;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.2);
}

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

.ai-chatbot-header {
  background: #f2f5fa;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #d7dbe0;
}

.ai-chatbot-close {
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
}

.ai-chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: linear-gradient(180deg, #f9fbff 0%, #ffffff 100%);
}

.ai-chatbot-message {
  margin-bottom: 10px;
  max-width: 88%;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}

.ai-chatbot-message.user {
  margin-left: auto;
  background: #0b5fff;
  color: #fff;
}

.ai-chatbot-message.assistant {
  margin-right: auto;
  background: #eef2f7;
  color: #222;
}

.ai-chatbot-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #d7dbe0;
  background: #fff;
}

#ai-chatbot-input {
  flex: 1;
  resize: none;
  border: 1px solid #b8c1cc;
  border-radius: 8px;
  padding: 8px;
  font-size: 14px;
}

#ai-chatbot-send {
  border: none;
  border-radius: 8px;
  background: #0b5fff;
  color: #fff;
  padding: 0 14px;
  cursor: pointer;
}

#ai-chatbot-send[disabled] {
  background: #93b2f7;
  cursor: default;
}

.ai-chatbot-status {
  min-height: 22px;
  padding: 0 10px 10px;
  color: #8a2131;
  font-size: 12px;
}

.ai-chatbot-lead {
  border-top: 1px solid #d7dbe0;
  background: #f9fbff;
  padding: 10px;
}

.ai-chatbot-lead-intro {
  font-size: 12px;
  color: #334;
  margin-bottom: 8px;
}

.ai-chatbot-lead-form {
  display: grid;
  gap: 6px;
}

.ai-chatbot-lead-label {
  font-size: 12px;
  color: #222;
}

.ai-chatbot-lead-form input[type="email"],
.ai-chatbot-lead-form input[type="text"] {
  width: 100%;
  border: 1px solid #b8c1cc;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 13px;
  box-sizing: border-box;
}

.ai-chatbot-lead-consent {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11px;
  color: #333;
}

.ai-chatbot-lead-submit,
.ai-chatbot-lead-skip {
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 12px;
}

.ai-chatbot-lead-submit {
  background: #0b5fff;
  color: #fff;
  width: 100%;
  margin-top: 6px;
}

.ai-chatbot-lead-skip {
  background: #e8edf6;
  color: #223;
}

.ai-chatbot-lead-actions {
  display: flex;
  gap: 6px;
}

@media (max-width: 600px) {
  .ai-chatbot-panel {
    width: calc(100vw - 16px);
    height: calc(100vh - 84px);
  }
}
