:not(.thing) {
  color: red;
}

:not(.thing[disabled]):not([disabled]:not(.thing[disabled])):not([disabled]:has(:not(.thing[disabled]))) {
  background: blue;
}

:has(:not(.thing[disabled]):not([disabled]:not(.thing[disabled])):not([disabled]:has(:not(.thing[disabled])))) {
  background: blue;
}
