.ai-chatbot {
  position: fixed;
  right: clamp(16px, 3vw, 28px);
  bottom: clamp(16px, 3vw, 28px);
  z-index: 80;
  font-family: "Inter", "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

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

.ai-chatbot__launcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 18px;
  color: #ffffff;
  background: #c62b35;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(198, 43, 53, 0.32);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.ai-chatbot__launcher:hover {
  background: #a9232c;
}

.ai-chatbot__launcher-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #c62b35;
  background: #ffffff;
  border-radius: 999px;
  font-size: 16px;
  line-height: 1;
}

.ai-chatbot__panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  display: none;
  width: min(380px, calc(100vw - 32px));
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(25, 34, 56, 0.2);
}

.ai-chatbot.is-open .ai-chatbot__panel {
  display: block;
}

.ai-chatbot.is-open .ai-chatbot__launcher-label {
  display: none;
}

.ai-chatbot__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  color: #ffffff;
  background: linear-gradient(135deg, #192238, #0f8b8d);
}

.ai-chatbot__title {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}

.ai-chatbot__subtitle {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  line-height: 1.4;
}

.ai-chatbot__close {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.ai-chatbot__language {
  display: flex;
  gap: 8px;
  padding: 12px 12px 0;
}

.ai-chatbot__lang-button,
.ai-chatbot__quick-button,
.ai-chatbot__action {
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}

.ai-chatbot__lang-button {
  min-height: 32px;
  padding: 0 10px;
  color: #303a4e;
  background: #fbfaf7;
  border: 1px solid #dfe5ec;
  font-size: 12px;
  font-weight: 800;
}

.ai-chatbot__lang-button.is-active {
  color: #ffffff;
  background: #192238;
  border-color: #192238;
}

.ai-chatbot__messages {
  display: flex;
  height: 286px;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 14px 12px;
  scroll-behavior: smooth;
}

.ai-chatbot__message {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-line;
}

.ai-chatbot__message--bot {
  align-self: flex-start;
  color: #192238;
  background: #f2f5f7;
}

.ai-chatbot__message--user {
  align-self: flex-end;
  color: #ffffff;
  background: #c62b35;
}

.ai-chatbot__quick {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 12px 12px;
}

.ai-chatbot__quick-button {
  min-height: 38px;
  padding: 8px 10px;
  color: #192238;
  background: #ffffff;
  border: 1px solid #dfe5ec;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.ai-chatbot__quick-button:hover {
  border-color: #c62b35;
}

.ai-chatbot__form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #dfe5ec;
}

.ai-chatbot__input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: #192238;
  background: #ffffff;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
}

.ai-chatbot__input:focus {
  border-color: #0f8b8d;
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 139, 141, 0.14);
}

.ai-chatbot__send {
  min-width: 74px;
  min-height: 42px;
  color: #ffffff;
  background: #0f8b8d;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.ai-chatbot__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 12px 12px;
}

.ai-chatbot__action {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  color: #192238;
  background: #fbfaf7;
  border: 1px solid #dfe5ec;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.ai-chatbot__action--primary {
  color: #ffffff;
  background: #26734d;
  border-color: #26734d;
}

@media (max-width: 640px) {
  .ai-chatbot {
    right: 12px;
    bottom: 12px;
    left: 12px;
  }

  .ai-chatbot__launcher {
    width: 100%;
    justify-content: center;
  }

  .ai-chatbot__panel {
    right: 0;
    bottom: 66px;
    width: 100%;
  }

  .ai-chatbot__messages {
    height: min(330px, 46vh);
  }
}

.home-page .ai-chatbot {
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}

.home-page .ai-chatbot__launcher,
.home-page .ai-chatbot__panel {
  pointer-events: auto;
}

.home-page .ai-chatbot__launcher {
  width: 58px;
  min-width: 58px;
  height: 58px;
  padding: 0;
  border-radius: 50%;
}

.home-page .ai-chatbot__launcher-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.home-page .ai-chatbot {
  display: none;
}
