/* Single source for dropdown arrows in the public UI and Django administration.
 * Controls inherit the page's dir; forms must not position their own arrows.
 * Multiple selects and visible listboxes retain their native appearance.
 * Arrow geometry is a site invariant: important declarations protect it from
 * widget background shorthands and inline padding, while colors remain local. */
select:not([multiple]):is(:not([size]), [size="0"], [size="1"]) {
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-size: 1rem 1rem !important;
  padding-inline-start: .75rem !important;
  padding-inline-end: 2.1rem !important;
  text-align: start;
}

select:not([multiple]):is(:not([size]), [size="0"], [size="1"]):dir(rtl) {
  direction: rtl !important;
  background-position: left .65rem center !important;
}
select:not([multiple]):is(:not([size]), [size="0"], [size="1"]):dir(ltr) {
  direction: ltr !important;
  background-position: right .65rem center !important;
}

/* Keep logical geometry aligned with HTML dir even inside older CSS-only RTL panels. */
.select2-container:dir(rtl) { direction: rtl !important; }
.select2-container:dir(ltr) { direction: ltr !important; }
.select2-container:is(:dir(rtl), :dir(ltr)) .select2-selection--single .select2-selection__arrow {
  left: auto !important;
  right: auto !important;
  inset-inline-end: .4rem !important;
}
.select2-container:is(:dir(rtl), :dir(ltr)) .select2-selection--single .select2-selection__rendered {
  padding-inline-start: .75rem !important;
  padding-inline-end: 2.1rem !important;
}
