.ai-chatbot {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1200;
  font-family: var(--font-body, Inter, ui-sans-serif, system-ui, sans-serif);
}

.ai-chatbot__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 8px;
  min-width: 128px;
  min-height: 56px;
  padding: 12px 18px;
  color: #fff;
  background:
    radial-gradient(circle at 30% 22%, rgba(255,255,255,.28), transparent 34%),
    linear-gradient(135deg, var(--brand-blue, #0a6cf2), #0856c8);
  box-shadow: 0 18px 44px rgba(10, 108, 242, .32);
  cursor: pointer;
  font-weight: 850;
  letter-spacing: -.01em;
}

.ai-chatbot__button-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: grid;
  place-items: center;
  color: #fff;
}

.ai-chatbot__button-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.ai-chatbot__button strong {
  display: block;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .01em;
}

.ai-chatbot__panel {
  position: absolute;
  right: 0;
  bottom: 68px;
  width: min(390px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 110px));
  display: grid;
  grid-template-rows: auto minmax(220px, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(12, 13, 16, .18);
}

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

.ai-chatbot__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 16px;
  color: var(--ink, #0c0d10);
  background:
    linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
  border-bottom: 1px solid rgba(15, 23, 42, .08);
}

.ai-chatbot__brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.ai-chatbot__avatar {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brand-blue, #0a6cf2);
  font-size: 12px;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}

.ai-chatbot__header h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.1;
  letter-spacing: -.02em;
}

.ai-chatbot__header p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--mute, #637083);
}

.ai-chatbot__close {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 50%;
  color: var(--ink, #0c0d10);
  background: #fff;
  cursor: pointer;
}

.ai-chatbot__messages {
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  background:
    linear-gradient(180deg, #f8fbff 0%, #fff 42%),
    #fff;
}

.ai-chatbot__msg {
  max-width: 86%;
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 10px 28px rgba(12, 13, 16, .06);
}

.ai-chatbot__msg--bot {
  color: var(--ink, #0c0d10);
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .08);
  border-bottom-left-radius: 6px;
}

.ai-chatbot__msg--user {
  margin-left: auto;
  color: #fff;
  background: var(--brand-blue, #0a6cf2);
  border-bottom-right-radius: 6px;
}

.ai-chatbot__thinking {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--mute, #637083);
}

.ai-chatbot__thinking span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-blue, #0a6cf2);
  opacity: .35;
  animation: lexiPulse 1.05s infinite ease-in-out;
}

.ai-chatbot__thinking span:nth-child(2) { animation-delay: .14s; }
.ai-chatbot__thinking span:nth-child(3) { animation-delay: .28s; }

.ai-chatbot__thinking em {
  font-style: normal;
  font-size: 12px;
  margin-left: 2px;
}

@keyframes lexiPulse {
  0%, 80%, 100% { transform: translateY(0); opacity: .32; }
  40% { transform: translateY(-3px); opacity: .95; }
}

.ai-chatbot__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 14px;
}

.ai-chatbot__suggestions button {
  border: 1px solid rgba(10, 108, 242, .18);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--brand-blue, #0a6cf2);
  background: #edf4ff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.ai-chatbot__composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid rgba(15, 23, 42, .08);
  background: #fff;
}

.ai-chatbot__composer input {
  min-height: 44px;
  border: 1px solid rgba(15, 23, 42, .14);
  border-radius: 6px;
  padding: 0 13px;
  font: inherit;
}

.ai-chatbot__composer button,
.ai-chatbot__form button {
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  color: #fff;
  background: var(--brand-blue, #0a6cf2);
  cursor: pointer;
  font-weight: 850;
}

.ai-chatbot__form {
  display: grid;
  gap: 9px;
  padding: 14px;
  margin: 10px 0 14px;
  border: 1px solid rgba(10, 108, 242, .16);
  border-radius: 8px;
  background: #f5f9ff;
}

.ai-chatbot__form h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -.02em;
}

.ai-chatbot__form input,
.ai-chatbot__form textarea {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, .14);
  border-radius: 6px;
  padding: 10px 11px;
  font: inherit;
  font-size: 13px;
  background: #fff;
}

.ai-chatbot__form textarea {
  min-height: 74px;
  resize: vertical;
}

.ai-chatbot__form button {
  min-height: 42px;
}

.ai-chatbot__fine {
  margin: 0;
  color: var(--ink-2, #2c3340);
  font-size: 11px;
  line-height: 1.35;
}

@media (max-width: 640px) {
  .ai-chatbot {
    right: max(10px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
  }
  .ai-chatbot__button {
    min-width: 116px;
    min-height: 52px;
    padding: 11px 15px;
    gap: 8px;
    box-shadow: 0 12px 30px rgba(10, 108, 242, .24);
  }
  .ai-chatbot__button-icon {
    width: 23px;
    height: 23px;
    flex-basis: 23px;
  }
  .ai-chatbot__button strong {
    font-size: 13px;
    line-height: 1;
  }
  .ai-chatbot__panel {
    position: fixed;
    inset: auto 8px calc(64px + env(safe-area-inset-bottom)) 8px;
    width: auto;
    height: min(78dvh, calc(100dvh - 88px));
    max-height: min(78dvh, calc(100dvh - 88px));
    grid-template-rows: auto minmax(0, 1fr) auto;
    border-radius: 8px;
  }
  .ai-chatbot__header {
    padding: 14px;
  }
  .ai-chatbot__avatar {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    font-size: 11px;
  }
  .ai-chatbot__header h2 {
    font-size: 14px;
  }
  .ai-chatbot__header p {
    font-size: 11px;
    line-height: 1.25;
  }
  .ai-chatbot__messages {
    padding: 14px;
  }
  .ai-chatbot__msg {
    max-width: 92%;
    font-size: 13px;
  }
  .ai-chatbot__composer {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px;
  }
  .ai-chatbot__composer input {
    min-width: 0;
  }
  .ai-chatbot__composer input,
  .ai-chatbot__composer button {
    min-height: 42px;
  }
  .ai-chatbot__composer button {
    width: auto;
    padding-inline: 13px;
  }
}

@media (max-width: 360px) {
  .ai-chatbot__panel {
    inset-inline: 6px;
    height: min(80dvh, calc(100dvh - 82px));
    max-height: min(80dvh, calc(100dvh - 82px));
  }
  .ai-chatbot__brand {
    gap: 8px;
  }
  .ai-chatbot__header p {
    display: none;
  }
}
