.searchable-select {
  position: relative;
  min-width: 0;
}

.searchable-select__row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 1fr);
  gap: 12px;
  align-items: stretch;
  min-width: 0;
}

.searchable-select--stacked .searchable-select__row {
  grid-template-columns: 1fr;
}

.searchable-select__search,
.searchable-select select {
  width: 100%;
  min-width: 0;
}

.searchable-select--readonly .searchable-select__row {
  grid-template-columns: minmax(0, 1fr) 96px;
}

.searchable-select__search {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(71, 85, 105, 0.42);
  background: rgba(15, 23, 42, 0.72);
  color: inherit;
  font: inherit;
}

.searchable-select__search::placeholder {
  color: rgba(148, 163, 184, 0.95);
}

.searchable-select__display {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(71, 85, 105, 0.42);
  background: rgba(15, 23, 42, 0.72);
  color: inherit;
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
}

.searchable-select--readonly select {
  position: absolute;
  inset: auto auto auto -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.searchable-select__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 40;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.96);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.3);
  overflow: hidden;
}

.searchable-select__results {
  max-height: 320px;
  overflow-y: auto;
}

.searchable-select__option {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.searchable-select__option:last-child {
  border-bottom: 0;
}

.searchable-select__option:hover,
.searchable-select__option.is-active {
  background: rgba(59, 130, 246, 0.18);
}

.searchable-select__option.is-selected {
  background: rgba(34, 197, 94, 0.16);
}

.searchable-select__option-label mark {
  padding: 0 1px;
  border-radius: 3px;
  background: rgba(250, 204, 21, 0.28);
  color: inherit;
}

.searchable-select__option-meta,
.searchable-select__empty {
  color: rgba(148, 163, 184, 0.95);
  font-size: 12px;
}

.searchable-select__empty {
  display: none;
  padding: 12px 14px;
}

.searchable-select.is-empty .searchable-select__empty {
  display: block;
}

html[data-app-theme="light"] .searchable-select__search {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(148, 163, 184, 0.42);
}

html[data-app-theme="light"] .searchable-select__display {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(148, 163, 184, 0.42);
}

html[data-app-theme="light"] .searchable-select__panel {
  border-color: rgba(148, 163, 184, 0.36);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.14);
}

html[data-app-theme="light"] .searchable-select__option:hover,
html[data-app-theme="light"] .searchable-select__option.is-active {
  background: rgba(37, 99, 235, 0.1);
}

html[data-app-theme="light"] .searchable-select__option.is-selected {
  background: rgba(34, 197, 94, 0.12);
}

@media (max-width: 640px) {
  .searchable-select__row {
    grid-template-columns: 1fr;
  }

  .searchable-select--readonly .searchable-select__row {
    grid-template-columns: 1fr;
  }
}
