/* Search autocomplete (home + explore) */
.ac-field {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.ac-field > .home-search-in,
.ac-field > .searchbar-input {
  width: 100%;
}

.ac-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 9px);
  z-index: 1200;
  display: none;
  max-height: min(56vh, 420px);
  overflow: auto;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(14, 18, 28, .92);
  box-shadow: 0 20px 56px rgba(0, 0, 0, .45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ac-dropdown.is-open {
  display: block;
  animation: acDropIn .14s ease-out;
}

@keyframes acDropIn {
  from {
    opacity: 0;
    transform: translateY(-3px) scale(.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ac-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  border: 0;
  cursor: pointer;
  border-radius: 12px;
  padding: 10px 11px;
  color: var(--text);
  background: transparent;
}

.ac-item:hover,
.ac-item.is-active {
  background: rgba(58, 167, 255, .18);
}

.ac-item:focus-visible {
  outline: 2px solid rgba(58, 167, 255, .42);
  outline-offset: 1px;
}

.ac-item-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ac-item-title {
  font-weight: 760;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ac-item-sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ac-item-stat {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .15px;
  color: rgba(255,255,255,.85);
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  padding: 4px 8px;
  border-radius: 999px;
}

.ac-item-stat--up {
  border-color: rgba(84,209,200,.35);
  background: rgba(84,209,200,.14);
  color: rgba(84,209,200,.98);
}

.ac-item-stat--down {
  border-color: rgba(255,92,122,.35);
  background: rgba(255,92,122,.12);
  color: rgba(255,92,122,.98);
}

.ac-item-stat--flat {
  color: var(--muted);
}

:root[data-theme="light"] .ac-dropdown {
  border-color: rgba(15, 23, 42, .10);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 16px 48px rgba(15, 23, 42, .16);
}

:root[data-theme="light"] .ac-item:hover,
:root[data-theme="light"] .ac-item.is-active {
  background: rgba(15, 23, 42, .06);
}

:root[data-theme="light"] .ac-item-stat {
  border-color: rgba(15, 23, 42, .12);
  background: rgba(15,23,42,.04);
}

:root[data-theme="light"] .ac-item-stat--up {
  border-color: rgba(0,92,86,.35);
  background: rgba(0,92,86,.10);
  color: rgba(0,92,86,.95);
}

:root[data-theme="light"] .ac-item-stat--down {
  border-color: rgba(176,0,32,.35);
  background: rgba(176,0,32,.08);
  color: rgba(176,0,32,.95);
}

@media (max-width: 720px) {
  .ac-dropdown {
    top: calc(100% + 8px);
    border-radius: 14px;
    max-height: min(52vh, 360px);
  }
}
