/* Keep native details semantics; only replace the browser's painted marker. */
details > summary {
  list-style: none;
  cursor: pointer;
}
details > summary::marker {
  content: "";
}
details > summary::-webkit-details-marker {
  display: none;
}

/* An empty, decorative box keeps the sign out of the control's accessible name. */
details > summary::before,
.expand-indicator {
  display: inline-block;
  box-sizing: border-box;
  inline-size: 1.125rem;
  block-size: 1.125rem;
  flex: 0 0 1.125rem;
  vertical-align: -0.18em;
  color: inherit;
  border: 1px solid currentColor;
  border-color: color-mix(in srgb, currentColor 40%, transparent);
  border-radius: 0.35rem;
  background-color: color-mix(in srgb, currentColor 6%, transparent);
  background-image: linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 0.56rem 2px, 2px 0.56rem;
  pointer-events: none;
}
details > summary::before {
  content: "";
  margin-inline-end: 0.48em;
}
details[open] > summary::before,
.expand-indicator[data-expanded="true"] {
  background-size: 0.56rem 2px, 0 0;
}
.table-action:has(> .expand-indicator) {
  gap: .4rem;
}
@media (forced-colors: active) {
  details > summary::before, .expand-indicator {
    forced-color-adjust: none;
    color: ButtonText;
    border-color: ButtonText;
    background-color: ButtonFace;
  }
}

/* Single-choice popup fields keep native selection and keyboard interaction.
   Background shorthands in individual forms must not erase this affordance. */
select:not([multiple]):is(:not([size]), [size="0"], [size="1"]) {
  appearance: none;
  padding-inline-end: 2.35rem !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Crect x='1' y='1' width='18' height='18' rx='5' fill='%23eef2f8' stroke='%2393a4ba'/%3E%3Cpath d='M6 7h8M6 10h8M6 13h8' fill='none' stroke='%23394f6b' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E") !important;
  background-size: 1.125rem !important;
  background-position: right .65rem center !important;
  background-repeat: no-repeat !important;
}
select:not([multiple]):is(:not([size]), [size="0"], [size="1"]):dir(rtl) {
  background-position: left .65rem center !important;
}
