/* New, lean search styles */
.ni-search__wrap {
  position: relative;
  width: 100%;
  max-width: 640px;
}

.ni-search {
  display: flex;
  align-items: center;
  width: 100%;
  background: var(--bg-primary, #fff);
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: 12px;
  padding: 6px 12px; /* tighter vertical padding to accommodate larger buttons */
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.ni-search:focus-within {
  border-color: var(--primary-300, #93c5fd);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.ni-search__icon {
  color: var(--slate-500, #64748b);
  font-size: 20px;
  margin-right: 8px;
}

.ni-search__input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  color: var(--text-primary, #0f172a);
}

.ni-search__input::placeholder {
  color: var(--slate-400, #94a3b8);
}

.ni-search__clear,
.ni-search__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; /* bigger click target */
  height: 44px; /* bigger click target */
  border: none;
  background: transparent;
  color: var(--slate-500, #64748b);
  cursor: pointer;
  border-radius: 8px;
}

.ni-search__clear svg,
.ni-search__submit svg {
  width: 20px;
  height: 20px;
}

.ni-search__clear:hover,
.ni-search__submit:hover {
  background: var(--bg-tertiary, #e2e8f0);
}

@media (max-width: 768px) {
  .ni-search {
    padding: 6px 10px;
  }
  .ni-search__input {
    font-size: 16px; /* prevent iOS zoom */
  }
}

/* Autocomplete dropdown */
.ni-search__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--slate-200, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  overflow: hidden;
  z-index: 20;
  max-height: 360px;
  overflow-y: auto;
}

.ni-suggestion {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--slate-100, #f1f5f9);
}

.ni-suggestion:last-child {
  border-bottom: none;
}

.ni-suggestion:hover,
.ni-suggestion.is-active {
  background: var(--slate-50, #f8fafc);
}

.ni-suggestion__icon {
  color: var(--slate-500, #64748b);
  font-size: 18px;
}

.ni-suggestion__body {
  flex: 1;
  min-width: 0;
}

.ni-suggestion__title {
  display: block;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ni-suggestion__meta {
  display: block;
  font-size: 12px;
  color: var(--text-secondary, #475569);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ni-suggestion__type {
  font-size: 12px;
  color: var(--slate-500, #64748b);
  background: var(--slate-100, #f1f5f9);
  padding: 2px 6px;
  border-radius: 6px;
  text-transform: uppercase;
}

.ni-suggestion--viewall {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-600, #1d4ed8);
  font-weight: 600;
}

.ni-suggestion--loading,
.ni-suggestion--empty {
  cursor: default;
  color: var(--slate-500, #64748b);
}