/* Keep native menus and keyboard behavior; searchable widgets own their indicator. */
body select:is(.form-select, .form-control):not([multiple]):not([size]:not([size="1"])):not(.choices__input) {
  --bs-form-select-bg-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='20' viewBox='0 0 28 20'%3E%3Cpath fill='none' stroke='%23d5dde3' d='M1 2v16'/%3E%3Cpath fill='none' stroke='%23475569' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8' d='m11 8 5 5 5-5'/%3E%3C/svg%3E");
  -webkit-appearance: none;
  appearance: none;
  padding-right: 3.1rem;
  background-image: var(--bs-form-select-bg-img), var(--bs-form-select-bg-icon, none);
  background-repeat: no-repeat;
  background-position: right .65rem center, right 2.9rem center;
  background-size: 1.75rem 1.25rem, 1rem 1rem;
  text-overflow: ellipsis;
  cursor: pointer;
}

body select:is(.form-select, .form-control):not([multiple]):not([size]:not([size="1"])):not(.choices__input):enabled:hover:not(.is-valid, .is-invalid, .was-validated select) {
  border-color: var(--primary-text, #475569);
}

body select:is(.form-select, .form-control):not([multiple]):not([size]:not([size="1"])):not(.choices__input):focus-visible {
  outline: 2px solid var(--primary-text, #475569);
  outline-offset: 2px;
}

/* Leave room for Bootstrap's separate validation icon as well as the chevron. */
body select:is(.form-select, .form-control):not([multiple]):not([size]:not([size="1"])):not(.choices__input):is(.is-valid, .is-invalid),
body .was-validated select:is(.form-select, .form-control):not([multiple]):not([size]:not([size="1"])):not(.choices__input):is(:valid, :invalid) {
  padding-right: 4.5rem;
}

body select.form-control:not(.form-select):is(.is-valid, .was-validated select:valid) {
  --bs-form-select-bg-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23198754' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m2 6 3 3 5-6'/%3E%3C/svg%3E");
}

body select.form-control:not(.form-select):is(.is-invalid, .was-validated select:invalid) {
  --bs-form-select-bg-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Ccircle cx='6' cy='6' r='4.5' fill='none' stroke='%23dc3545'/%3E%3Cpath stroke='%23dc3545' stroke-width='1.5' d='M6 3v4m0 1v1'/%3E%3C/svg%3E");
}

body select:is(.form-select, .form-control):not([multiple]):not([size]:not([size="1"])):not(.choices__input):disabled {
  background-color: var(--bs-secondary-bg, #e9ecef);
  cursor: not-allowed;
}

@media (forced-colors: active) {
  body select:is(.form-select, .form-control):not([multiple]):not([size]:not([size="1"])):not(.choices__input) {
    -webkit-appearance: auto;
    appearance: auto;
    background-image: none !important;
  }
}
