/* جست‌وجوی تایپی — ظاهرِ هم‌خانوادهٔ بوت‌استرپ، بدون وابستگی تازه */
.ac { position: relative; }
.ac-box { position: relative; display: flex; }
.ac-input { padding-inline-end: 2rem; }

.ac-clear {
  position: absolute; inset-inline-end: .4rem; top: 50%; transform: translateY(-50%);
  border: 0; background: none; color: var(--bs-secondary-color, #6c757d);
  font-size: 1.15rem; line-height: 1; cursor: pointer; padding: 0 .25rem;
  opacity: 0; pointer-events: none; transition: opacity .12s;
}
.ac.ac-has .ac-clear { opacity: .75; pointer-events: auto; }
.ac-clear:hover { opacity: 1; }

.ac.ac-has .ac-input { border-color: var(--bs-success-border-subtle, #a3cfbb); }

.ac.ac-loading .ac-box::after {
  content: ''; position: absolute; inset-inline-end: .55rem; top: 50%;
  width: .85rem; height: .85rem; margin-top: -.42rem;
  border: 2px solid var(--bs-border-color, #dee2e6);
  border-top-color: var(--bs-primary, #0d6efd);
  border-radius: 50%; animation: ac-spin .6s linear infinite;
}
@keyframes ac-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .ac.ac-loading .ac-box::after { animation: none; }
  .ac-clear { transition: none; }
}

.ac-menu {
  position: absolute; z-index: 1060; inset-inline: 0; top: calc(100% + 2px);
  max-height: 17rem; overflow-y: auto;
  background: var(--bs-body-bg, #fff);
  border: 1px solid var(--bs-border-color, #dee2e6); border-radius: .375rem;
  box-shadow: 0 .5rem 1.25rem rgba(0, 0, 0, .12);
}
.ac-item {
  display: flex; align-items: baseline; gap: .5rem;
  padding: .42rem .7rem; cursor: pointer; border-bottom: 1px solid var(--bs-border-color-translucent, #0000000f);
}
.ac-item:last-child { border-bottom: 0; }
.ac-item.on { background: var(--bs-primary-bg-subtle, #cfe2ff); }
.ac-text { font-weight: 500; }
.ac-hint { font-size: .78rem; color: var(--bs-secondary-color, #6c757d); margin-inline-start: auto; }
.ac-empty { padding: .55rem .7rem; color: var(--bs-secondary-color, #6c757d); font-size: .87rem; }
.ac-note { font-size: .78rem; color: var(--bs-secondary-color, #6c757d); min-height: 1rem; margin-top: .15rem; }
