I’ve noticed many CSS authors don’t seem to know that you can just repeat a selector to increase its specificity. For your example, `.className.className` increases the specificity without adding more reliance on DOM structure.
If you really have to select that element by ID for some reason, you can use an attribute selector instead—`[id=foo]`—and then it’s also in bucket B and can be controlled in the normal way.
Basically, you should consider ID selectors (and element selectors) an antipattern and never use them.
> Note: Repeated occurrences of the same simple selector are allowed and do increase specificity.
*:is(#a#b, .someclass) {...}
overrides any selector with a single id; you add more ids to override more specific selectors (except inline stiles and !important)