.ai-chatbot {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 160;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.ai-chatbot__launcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 118px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(101, 132, 255, 0.42);
  background: linear-gradient(135deg, rgba(79, 142, 247, 0.98), rgba(114, 108, 255, 0.92));
  color: #ffffff;
  font-family: "Syne", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

.ai-chatbot__launcher::before {
  content: "";
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12);
}

.ai-chatbot__panel {
  width: min(410px, calc(100vw - 24px));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(8, 13, 24, 0.98);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.46);
  overflow: hidden;
  display: none;
}

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

.ai-chatbot__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ai-chatbot__head h2 {
  margin: 0 0 6px;
  color: #ffffff;
  font-family: "Syne", sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ai-chatbot__head p {
  margin: 0;
  max-width: 240px;
  color: #98a5be;
  font-size: 0.79rem;
  line-height: 1.5;
}

.ai-chatbot__head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ai-chatbot__small-btn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: #dfe7ff;
  font-family: "DM Sans", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.ai-chatbot__small-btn:hover,
.ai-chatbot__small-btn:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
}

.ai-chatbot__progress {
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.ai-chatbot__progress[hidden] {
  display: none;
}

.ai-chatbot__progress-bar {
  height: 100%;
  width: 35%;
  background: linear-gradient(90deg, #4f8ef7, #7b74ff);
  animation: ai-chatbot-load 1.2s linear infinite;
}

.ai-chatbot__body {
  padding: 14px 14px 0;
}

.ai-chatbot__log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
  padding-right: 2px;
}

.ai-chatbot__msg {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.84rem;
  line-height: 1.58;
}

.ai-chatbot__msg--user {
  margin-left: auto;
  color: #ffffff;
  background: linear-gradient(135deg, rgba(79, 142, 247, 0.2), rgba(123, 116, 255, 0.14));
  border-bottom-right-radius: 6px;
}

.ai-chatbot__msg--bot {
  color: #ebf1ff;
  background: #07101b;
  border-bottom-left-radius: 6px;
}

.ai-chatbot__msg p + p {
  margin-top: 8px;
}

.ai-chatbot__status {
  padding: 10px 14px 0;
  color: #8693ab;
  font-size: 0.76rem;
}

.ai-chatbot__menu {
  padding: 12px 14px 0;
}

.ai-chatbot__menu-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.ai-chatbot__menu-title {
  color: #dbe6ff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ai-chatbot__back {
  padding: 0;
  border: 0;
  background: transparent;
  color: #7ea1ff;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.ai-chatbot__back[hidden] {
  display: none;
}

.ai-chatbot__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-chatbot__chip {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.03);
  color: #dbe6ff;
  font-family: "DM Sans", sans-serif;
  font-size: 0.79rem;
  font-weight: 700;
  cursor: pointer;
}

.ai-chatbot__chip:hover,
.ai-chatbot__chip:focus-visible {
  background: rgba(79, 142, 247, 0.12);
  border-color: rgba(101, 132, 255, 0.3);
}

.ai-chatbot__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
}

.ai-chatbot__input {
  min-height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.03);
  color: #ffffff;
  font-family: "DM Sans", sans-serif;
  font-size: 0.9rem;
}

.ai-chatbot__input::placeholder {
  color: #7d8ba5;
}

.ai-chatbot__send {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(101, 132, 255, 0.35);
  background: linear-gradient(135deg, rgba(79, 142, 247, 0.96), rgba(123, 116, 255, 0.9));
  color: #ffffff;
  font-family: "DM Sans", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.ai-chatbot__send:disabled,
.ai-chatbot__input:disabled,
.ai-chatbot__launcher:disabled {
  opacity: 0.64;
  cursor: not-allowed;
}

@keyframes ai-chatbot-load {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(360%); }
}

@media (max-width: 760px) {
  .ai-chatbot {
    right: 12px;
    left: 12px;
    bottom: 12px;
    align-items: stretch;
  }

  .ai-chatbot__panel {
    width: 100%;
  }

  .ai-chatbot__form {
    grid-template-columns: 1fr;
  }

  .ai-chatbot__send {
    width: 100%;
  }
}
