/* Native fallback remains readable if JavaScript is unavailable. */
select { color-scheme: dark; }
select[hidden] { display: none !important; }
select option { background: var(--kitty-field); color: var(--ink); }
select option:disabled { color: var(--dim); }

.themed-select {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 150px;
  max-width: 220px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--kitty-arc);
  background: linear-gradient(180deg, var(--kitty-chip-well-top), var(--kitty-chip-well-bottom));
  box-shadow: inset 0 1px 0 var(--kitty-track-inner);
  color: var(--ink);
  font: 12px var(--font);
  text-align: left;
  cursor: pointer;
}
.themed-select-value { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.themed-select::after {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  margin: -3px 2px 0 0;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
}
.themed-select:hover, .themed-select[aria-expanded="true"] { border-color: var(--accent); }
.themed-select[aria-expanded="true"]::after { margin-top: 3px; transform: rotate(225deg); border-color: var(--accent); }
.themed-select:focus-visible { outline: 2px solid var(--kitty-logo-rim); outline-offset: 2px; }
.themed-select:disabled { opacity: .55; cursor: not-allowed; }
.themed-select-menu {
  position: fixed;
  z-index: 40;
  padding: 5px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #614778;
  border-radius: var(--kitty-arc);
  background: var(--kitty-card-surface);
  box-shadow: var(--kitty-card-lip), 0 12px 30px #0008;
  color: var(--ink);
  font: 12px/1.4 var(--font);
  scrollbar-width: thin;
  scrollbar-color: #614778 var(--kitty-field);
}
.themed-select-menu[hidden] { display: none; }
.themed-select-option {
  position: relative;
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 9px 30px 9px 10px;
  border-radius: 6px;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.themed-select-option[aria-selected="true"] { color: #e4c7ff; background: #b677ee14; }
.themed-select-option[aria-selected="true"]::after {
  content: '';
  position: absolute;
  right: 13px;
  width: 5px;
  height: 9px;
  margin-top: -3px;
  border: solid var(--accent);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.themed-select-option.is-active { background: #b677ee29; box-shadow: inset 0 0 0 1px #b677ee38; }
.themed-select-option[aria-disabled="true"] { color: var(--dim); cursor: not-allowed; }
@media (max-width: 650px) {
  .filter-field .themed-select { width: 100%; max-width: none; }
  .themed-select, .themed-select-option { min-height: 44px; }
}
@media (forced-colors: active) {
  .themed-select-menu { border-color: ButtonText; }
  .themed-select-option.is-active { outline: 1px solid Highlight; outline-offset: -1px; }
}
