/* Keep native select behaviour, with a consistently inset dropdown arrow. */
:root {
  --dropdown-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%231b2a4a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
html[data-theme="dark"] {
  --dropdown-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23eeeeee' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
:is(select:not([size]), select[size="0"], select[size="1"]):not([multiple]):not(.select2-hidden-accessible) {
  -webkit-appearance: none;
  appearance: none;
  background-image: var(--dropdown-arrow);
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
  padding-right: 44px;
}
/* Django's compact action dropdown has its own more specific padding rule. */
#changelist .actions select:not([multiple]) { padding-right: 44px; }
[dir="rtl"] :is(select:not([size]), select[size="0"], select[size="1"]):not([multiple]):not(.select2-hidden-accessible) {
  background-position: left 14px center;
  padding-left: 44px;
  padding-right: 12px;
}
@media (forced-colors: active) {
  :is(select:not([size]), select[size="0"], select[size="1"]):not([multiple]):not(.select2-hidden-accessible) {
    -webkit-appearance: auto;
    appearance: auto;
    background-image: none;
  }
}

/* Draw admin filter disclosure arrows without depending on font glyphs. */
#changelist #changelist-filter details > summary::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 10px 2px 2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
}
#changelist #changelist-filter details[open] > summary::before { transform: rotate(45deg); }
