/* ── Layout ──────────────────────────────────────────────── */
.ai-search {
  max-width: 860px;
  margin: 20px auto;
  padding: 0 16px;
  box-sizing: border-box;
}

/* ── Search box ──────────────────────────────────────────── */
.ai-search-box {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.ai-search-box input {
  flex: 1;
  padding: 10px 14px;
  font-size: 15px;
  border: 1px solid #dde4ee;
  border-radius: 10px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
  box-shadow: 0 1px 3px rgba(15,23,42,.06);
}

.ai-search-box input:focus {
  border-color: #1c69bd;
  box-shadow: 0 0 0 3px rgba(28,105,189,.12);
}

.ai-search-box button {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #1c69bd, #22a8a4);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(28,105,189,.28);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

.ai-search-box button:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(28,105,189,.32);
  filter: saturate(1.08);
}

/* ── Sort bar ────────────────────────────────────────────── */
.ais-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.ais-sort span {
  font-size: 13px;
  color: #5a6473;
  white-space: nowrap;
}

.ais-sort select {
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid #dde4ee;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  box-shadow: 0 1px 3px rgba(15,23,42,.06);
  cursor: pointer;
  transition: border-color .15s ease;
}

.ais-sort select:focus {
  outline: none;
  border-color: #1c69bd;
}

/* ── Result card ─────────────────────────────────────────── */
.ais-item {
  padding: 18px 20px;
  border: 1px solid #dfe4ea;
  border-radius: 14px;
  margin-bottom: 16px;
  background: #fff;
  box-shadow:
    0 1px 2px rgba(15,23,42,.04),
    0 4px 16px rgba(15,23,42,.06);
  transition: transform .18s ease, box-shadow .18s ease;
}

.ais-item:hover {
  transform: translateY(-2px);
  box-shadow:
    0 2px 4px rgba(15,23,42,.06),
    0 10px 28px rgba(15,23,42,.11);
}

/* ── Card title ──────────────────────────────────────────── */
.ais-item h4 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.ais-item h4 a {
  color: #1c69bd;
  text-decoration: none;
  transition: color .15s ease;
}

.ais-item h4 a:hover {
  color: #22a8a4;
  text-decoration: underline;
}

/* ── Snippet ─────────────────────────────────────────────── */
.ais-item .ais-snippet {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.65;
  color: #4d5968;
}

/* ── Meta row ────────────────────────────────────────────── */
.ais-item .ais-meta {
  font-size: 12px;
  color: #8e97a3;
  line-height: 1.5;
  padding-top: 8px;
  border-top: 1px solid #f0f3f7;
}

/* ── Sort active indicator ───────────────────────────────── */
.ais-sort-active {
  margin: 0 0 14px;
  font-size: 12px;
  color: #8e97a3;
  font-style: italic;
}

/* ── Blocked message ─────────────────────────────────────── */
.ais-blocked-message {
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid rgba(180,60,40,.18);
  border-radius: 12px;
  background: #fff5f2;
  color: #8a2f1e;
  font-size: 14px;
}

/* ── Classic results link ────────────────────────────────── */
.ais-classic-link {
  margin-top: 12px;
  font-size: 13px;
  opacity: .85;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .ai-search {
    padding: 0 12px;
    margin: 12px auto;
  }

  .ai-search-box {
    flex-direction: column;
  }

  .ai-search-box button {
    width: 100%;
    justify-content: center;
  }

  .ais-item {
    padding: 14px 16px;
  }

  .ais-item h4 {
    font-size: 15px;
  }
}
