Indeed, Shadow DOM is a great way to isolate styles when working with browser extensions. In fact I’ve made a tutorial and it shows how CSS is scoped to the extension without interfering with any website style:
https://www.freecodecamp.org/news/chrome-extension-with-parc...