.ai-search {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2000;
  font-size: 15px;
}

.ai-search__launcher,
.ai-search__submit,
.ai-search__close,
.ai-search__examples button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.ai-search__launcher {
  min-width: 108px;
  height: 44px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.ai-search__panel {
  display: flex;
  flex-direction: column;
  width: min(420px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 32px));
  overflow: hidden;
  border: 1px solid rgba(17, 24, 39, 0.14);
  border-radius: 8px;
  background: var(--bs-body-bg, #fff);
  color: var(--bs-body-color, #111827);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
}

.ai-search__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.1);
}

.ai-search__title {
  font-weight: 700;
}

.ai-search__subtitle,
.ai-search__card small,
.ai-search__card em {
  color: var(--bs-secondary-color, #6b7280);
}

.ai-search__subtitle {
  margin-top: 2px;
  font-size: 12px;
}

.ai-search__close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 24px;
  line-height: 1;
}

.ai-search__form {
  display: flex;
  gap: 8px;
  padding: 12px 16px 8px;
}

.ai-search__input {
  min-width: 0;
  flex: 1;
  height: 40px;
  border: 1px solid rgba(17, 24, 39, 0.18);
  border-radius: 6px;
  padding: 0 11px;
  background: var(--bs-body-bg, #fff);
  color: inherit;
  font: inherit;
}

.ai-search__submit {
  width: 64px;
  border-radius: 6px;
  background: #2563eb;
  color: #fff;
}

.ai-search__examples {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 16px 12px;
}

.ai-search__examples button {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  font-size: 12px;
}

.ai-search__answer {
  flex: 0 1 auto;
  max-height: 220px;
  overflow: auto;
  padding: 0 16px 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.ai-search__results {
  flex: 1 1 220px;
  min-height: 160px;
  overflow: auto;
  border-top: 1px solid rgba(17, 24, 39, 0.08);
}

.ai-search__card {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 12px;
  padding: 12px 16px;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.ai-search__card:hover {
  background: rgba(37, 99, 235, 0.06);
  color: inherit;
}

.ai-search__card img {
  width: 74px;
  height: 74px;
  object-fit: cover;
  border-radius: 6px;
  background: rgba(17, 24, 39, 0.08);
}

.ai-search__card-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ai-search__card strong,
.ai-search__card small,
.ai-search__card em,
.ai-search__card span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-search__card strong {
  white-space: nowrap;
  font-size: 14px;
}

.ai-search__card small,
.ai-search__card span {
  white-space: nowrap;
  font-size: 12px;
  font-style: normal;
}

.ai-search__card em {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

@media (max-width: 540px) {
  .ai-search {
    right: 12px;
    bottom: 12px;
  }

  .ai-search__panel {
    width: calc(100vw - 24px);
  }
}
