When dealing with a "#shadow-root (open)" element, it appears that manipulating the style using only CSS is not feasible. The shadow-root was generated by a third-party JavaScript script and displays an element as an overlay on the page that I am trying to eliminate.
My attempt to alter the style of the element using JavaScript was met with an error:
document.querySelector(".element").style.display = "none"
The error message reads:
Uncaught TypeError: Cannot read properties of null (reading 'style')
Is there a way to adjust the CSS instead?