/* Name autocomplete typeahead (static JSON shards under /autocomplete) */

.ac-wrap {
  position: relative;
  width: 100%;
}

.search-bar-shell {
  position: relative;
  z-index: 1;
}

.search-bar-shell:focus-within {
  z-index: 80;
}

.ac-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.4rem);
  z-index: 90;
  margin: 0;
  padding: 0.4rem 0;
  list-style: none;
  background: #fffefb;
  border: 1px solid rgba(0, 31, 63, 0.12);
  border-radius: 4px;
  box-shadow:
    0 1px 0 rgba(197, 160, 89, 0.35),
    0 18px 40px -20px rgba(0, 31, 63, 0.35);
  max-height: min(22rem, 50vh);
  overflow-x: hidden;
  overflow-y: auto;
}

.ac-panel[hidden] {
  display: none !important;
}

.ac-item {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  width: 100%;
  padding: 0.6rem 1rem;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: var(--sans);
  color: var(--ink);
  border-left: 2px solid transparent;
}

.ac-item:hover,
.ac-item.is-active {
  background: rgba(0, 31, 63, 0.04);
  border-left-color: #c5a059;
}

.ac-item-name {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  color: #001f3f;
}

.ac-item-meta {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 640px) {
  .ac-item {
    padding: 0.7rem 0.9rem;
    min-height: 44px;
  }

  .ac-item-meta {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .ac-panel {
    max-height: min(18rem, 45vh);
  }
}

.ac-empty {
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  color: #94a3b8;
}
