You can use isolation: isolate to explicitly create a new stacking context now. It makes the code a bit clearer because position: relative is used for lots of different things.
I know, but it’s still hard to use on a big website where you have to manage a lot of stacking contexts.