Issue #3177918 by mherchel: Holistically refactor use of Olivero's z-index rules to play nice with Core (cherry picked from commit bdf6131d)