.searchable-filter {
  position: relative;
  width: 100%;
  min-width: 0;
}

.searchable-filter__control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(10, 7, 49, 0.16);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.searchable-filter.is-open .searchable-filter__control,
.searchable-filter__control:focus-within {
  border-color: rgba(24, 99, 220, 0.72);
  box-shadow: 0 0 0 3px rgba(24, 99, 220, 0.12);
}

.searchable-filter__input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 8px 11px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink, #0a0731);
  font: inherit;
  font-weight: 600;
  outline: 0;
}

.searchable-filter__input::placeholder {
  color: var(--muted, #74809b);
  font-weight: 500;
}

.searchable-filter__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-width: 42px;
  min-height: 40px;
  padding: 0;
  border: 0;
  border-left: 1px solid rgba(10, 7, 49, 0.1);
  border-radius: 0;
  background: rgba(24, 99, 220, 0.06);
  color: var(--blue, #1863dc);
  cursor: pointer;
}

.searchable-filter__toggle::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.18s ease;
}

.searchable-filter.is-open .searchable-filter__toggle::before {
  transform: translateY(2px) rotate(225deg);
}

.searchable-filter__menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  display: none;
  max-height: min(320px, 48vh);
  padding: 6px;
  border: 1px solid rgba(10, 7, 49, 0.12);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(10, 7, 49, 0.18);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.searchable-filter.is-open .searchable-filter__menu {
  display: grid;
  gap: 2px;
}

.searchable-filter__option {
  display: block;
  width: 100%;
  min-height: 38px;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink, #0a0731);
  font: inherit;
  font-weight: 650;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.searchable-filter__option:hover,
.searchable-filter__option.is-active {
  background: rgba(24, 99, 220, 0.1);
  color: var(--blue, #1863dc);
}

.searchable-filter__option.is-selected {
  box-shadow: inset 3px 0 0 var(--blue, #1863dc);
}

.searchable-filter__message {
  padding: 10px;
  color: var(--muted, #74809b);
  font-size: 0.82rem;
  font-weight: 600;
}

select.searchable-filter__native {
  display: none !important;
}

.hms-filter-bar--searchable {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
  gap: 10px;
  width: 100%;
}

.hms-filter-bar--searchable > .searchable-filter {
  min-width: 0;
}

.hms-filter-bar--searchable > [data-hms-filter-clear] {
  min-height: 42px;
}

@media (max-width: 640px) {
  .searchable-filter__menu {
    max-height: 42vh;
  }

  .hms-filter-bar--searchable {
    grid-template-columns: 1fr;
  }
}
