/* Progressive enhancement: the native control remains available without JS. */
.searchable-select { position: relative; min-width: 0; width: 100%; }
.searchable-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.searchable-select-trigger {
  display: block;
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: var(--sf-ink);
  background-color: var(--sf-panel);
}
.searchable-select-trigger.is-placeholder { color: var(--sf-muted); }
.searchable-select-trigger:disabled { cursor: not-allowed; background-color: var(--sf-panel-soft); }
.searchable-select-value { display: block; overflow-wrap: anywhere; white-space: normal; }
.searchable-select-trigger[aria-invalid="true"] { border-color: var(--sf-danger); }
.searchable-select-error { display: block; color: var(--sf-danger); font-size: .85rem; margin-top: 5px; }
.searchable-select-panel {
  position: fixed;
  z-index: 1100;
  padding: 8px;
  border: 1px solid var(--sf-line-strong);
  border-radius: var(--sf-radius);
  background: var(--sf-panel);
  color: var(--sf-ink);
  box-shadow: var(--sf-shadow);
  font-size: .94rem;
  text-align: left;
}
.searchable-select-panel[hidden], .searchable-select-error[hidden] { display: none; }
.searchable-select-search { width: 100%; min-height: 40px; margin-bottom: 6px; }
.searchable-select-options { position: relative; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.searchable-select-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 40px;
  padding: 9px 8px;
  border-radius: var(--sf-radius-sm);
  cursor: pointer;
  line-height: 1.4;
}
.searchable-select-option-text { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.searchable-select-option.is-active { background: var(--sf-primary-soft); }
.searchable-select-option[aria-selected="true"] { color: var(--sf-primary-dark); font-weight: 600; }
.searchable-select-option[aria-disabled="true"] { color: var(--sf-subtle); cursor: not-allowed; }
.searchable-select-check { width: 18px; flex: 0 0 18px; font-weight: 700; }
.searchable-select-group { padding: 8px; color: var(--sf-muted); font-size: .8rem; font-weight: 700; }
.searchable-select-status { border-top: 1px solid var(--sf-line); margin-top: 6px; padding: 7px 4px 0; font-size: .78rem; color: var(--sf-muted); }
@media (max-width: 640px) {
  .searchable-select-search { font-size: 16px; }
  .searchable-select-option { min-height: 44px; }
}
