Use the templates
Implement a Shadow DOM on every Custom Elements, adding to the constructor
this.root = this.attachShadow({ mode: "open" });
const template = document.getElementById("details-page-template");
const content = template.content.cloneNode(true);
this.root.appendChild(content);
See the difference in DevTools inspecting the project.