I just remembered this great topic from the past and thought I’d share it. It might offer some kind of hint or inspiration. Apologies if it’s completely unrelated.
It looks like we’ll need to replace the entire HTML rather than just the CSS, so if possible, this might actually lead to a simpler solution.