Write the app in Electron. Problem solved. No more OS overriding your look.
(I don't have a horse in the Electron-is-great-or-crap race)
That's a hard problem to solve, since there are many ways of styling Electron - Bootstrap/Bulma/Material Design/custom stuff. So it's hard to just override CSS rules.
On the other hand, it's the kind of problem perfectly suited for Machine Learning - just take the whole screenshot/image of the app and use a stylistic ML to change it - make it Dark Theme/whatever...
I suspect in 10 years OSes will support ML-based automatic themeing/customization of all apps, regardless of what they are written in.
https://www.ghacks.net/2019/05/24/firefox-69-userchrome-css-...