.search-result img {
  width: 32px;
  height: 32px;
}

.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  height: 1em;
  width: 1em;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23777'><path d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/></svg>")
    center/cover no-repeat;
  cursor: pointer;
}

.search-input::-moz-clear-button {
  display: none;
}

#unifiedSearchResultsOverlay {
  position: absolute;
  z-index: 1050;
  background: var(--bs-dark);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  display: none;
  /* Width hugs the filter group / results; clamped by viewport on mobile. */
  width: fit-content;
  min-width: 0;
  max-width: calc(100vw - 16px);
  overflow: hidden; /* Filters stay at top */
}

#unifiedSearchFilterBox {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  background-color: var(--bs-dark);
  border: 1px solid var(--bs-border-color);
  padding: 0.5rem !important;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05); /* very subtle top highlight */
}

/* Individual Filter Labels - slate theme */
#unifiedSearchFilterBox label {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #1e293b; /* slate-800 */
  border: 1px solid #334155; /* slate-700 */
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base image rules */
#unifiedSearchFilterBox label img {
  width: 24px;
  height: 24px;
  transition: filter 0.2s;
  image-rendering: pixelated;
}

/* Hover - slate-700 bg, slate-600 border */
#unifiedSearchFilterBox label:hover {
  background-color: #334155;
  border-color: #475569;
}

/* Active/Checked State - styling like btn-outline-light active */
#unifiedSearchFilterBox label:has(input:checked) {
  background-color: #f8f9fa; /* standard bs light */
  border-color: #f8f9fa;
  box-shadow: 0 0 0 2px rgba(248, 249, 250, 0.25);
}

/* Since the background is now almost white, we need to invert the colored sprite
   so it's black/dark just like a dark icon inside a white button. */
#unifiedSearchFilterBox label:has(input:checked) img {
  filter: brightness(0) invert(0);
}

#unifiedSearchFilterBox input {
  display: none;
}

#unifiedSearchFilterBox img {
  max-width: 32px;
  max-height: 32px;
  object-fit: contain;
  image-rendering: pixelated;
}

#unifiedSearchFilterBox .filter-wand {
  transform: rotate(90deg);
}

#unifiedSearchResults {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
}

#unifiedSearchResults .list-group-item {
  border: none;
  border-bottom: 1px solid var(--bs-border-color);
  border-radius: 0;
  cursor: pointer;
  transition: background-color 0.15s ease-in-out;
  padding: 0.5rem 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#unifiedSearchResults .list-group-item.d-flex {
  white-space: normal;
  overflow: visible;
}

#unifiedSearchResults .list-group-item.d-flex > div {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

#unifiedSearchResults .list-group-item:hover,
#unifiedSearchResults .list-group-item:focus {
  background-color: var(--bs-dark-border-subtle);
  outline: none;
}

#unifiedSearchResults .list-group-item:last-child {
  border-bottom: none;
}
