/* Keep native keyboard navigation and option popups. Only style the closed, single-line control.
   Final longhands override feature-specific background/padding shorthands without changing their colors. */
@supports (appearance: none) or (-webkit-appearance: none) {
  @media (forced-colors: none) {
    select:not([multiple]):is(:not([size]), [size="1"]):not([hidden], [aria-hidden="true"], .sr-only, .visually-hidden) {
      -webkit-appearance: none;
      appearance: none;
      padding-inline-end: max(32px, 2.15em) !important;
      /* WebKit otherwise counts the intrinsic width of long options in the surrounding scroll area. */
      overflow: hidden;
      text-overflow: ellipsis;
      background-image:
        linear-gradient(45deg, transparent calc(50% - .8px), currentColor calc(50% - .8px), currentColor calc(50% + .8px), transparent calc(50% + .8px)),
        linear-gradient(-45deg, transparent calc(50% - .8px), currentColor calc(50% - .8px), currentColor calc(50% + .8px), transparent calc(50% + .8px)) !important;
      background-size: 6px 6px, 6px 6px !important;
      background-position: right 17px center, right 11px center !important;
      background-repeat: no-repeat !important;
    }
    select:not([multiple]):is(:not([size]), [size="1"]):not([hidden], [aria-hidden="true"], .sr-only, .visually-hidden):dir(rtl) {
      background-position: left 11px center, left 17px center !important;
    }
  }
}
