/* Desktop top-bar autocomplete. The top bar itself remains owned by style.css. */
.top-search {
  position: relative;
}

.top-search-input {
  min-width: 0;
}

.top-search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.top-search-clear[hidden],
.top-search-suggestions[hidden] {
  display: none !important;
}

.top-search-clear:hover {
  background: #f1f5f9;
  color: var(--text);
}

.top-search-clear:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 1px;
}

.top-search-suggestions {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 460px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--border, #e6e8eb);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.16), 0 2px 8px rgba(15, 23, 42, 0.06);
}

.top-search-suggestion {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}

.top-search-suggestion:hover,
.top-search-suggestion.is-active {
  /* Calm neutral hover — easier on the eyes than a colored tint (Reddit keeps
     colour in the avatars only). */
  background: #f4f6f8;
}

.top-search-suggestion:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 1px;
}

.top-search-suggestion-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
  color: #94a3b8;
}

.top-search-suggestion-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14.5px;
  line-height: 1.3;
}

.top-search-suggestions-notice {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

/* Group label (e.g. "People") separating the sections in the dropdown.
   Soft, sentence-case, comfortable — separation comes mostly from whitespace
   plus a very light hairline (Google/Reddit calm, not a heavy divider). */
.top-search-group-label {
  padding: 10px 12px 4px;
  margin-top: 4px;
  border-top: 1px solid #eef0f2;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

/* The top "Search <query>" row keeps the brand accent on its icon. */
.top-search-suggestion--query .top-search-suggestion-icon {
  color: var(--primary);
}

.top-search-suggestion--query .top-search-suggestion-text strong {
  font-weight: 600;
}

/* People rows: avatar + name/handle. */
.top-search-person-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  object-fit: cover;
  background: #e2e8f0;
}

.top-search-person-avatar--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.top-search-person-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.top-search-person-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  color: var(--text);
}

.top-search-person-handle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 720px) {
  .top-search-suggestions {
    display: none !important;
  }
}
