document.addEventListener("DOMContentLoaded", function () {
const interval = setInterval(() => {
const wrapper = document.querySelector('div[class*="am-wrapper"], div[class*="amelia"]');
if (!wrapper) return;
const shadowRootHost = wrapper.shadowRoot || wrapper.attachShadow;
// If it's a shadow root or inside iframe
if (shadowRootHost && shadowRootHost.querySelector) {
const style = document.createElement("style");
style.textContent = `
.am-date.available:not(.am-selected):not(.am-disabled) {
background-color: #e8f5e9 !important;
color: #2e7d32 !important;
border-color: #a5d6a7 !important;
}
.am-date.available:not(.am-selected):not(.am-disabled):hover {
background-color: #c8e6c9 !important;
color: #1b5e20 !important;
}
`;
shadowRootHost.appendChild(style);
clearInterval(interval);
} else {
// Fallback: Try injecting globally if not shadowRoot
const style = document.createElement("style");
style.innerHTML = `
.am-date.available:not(.am-selected):not(.am-disabled) {
background-color: #e8f5e9 !important;
color: #2e7d32 !important;
border-color: #a5d6a7 !important;
}
.am-date.available:not(.am-selected):not(.am-disabled):hover {
background-color: #c8e6c9 !important;
color: #1b5e20 !important;
}
`;
document.head.appendChild(style);
clearInterval(interval);
}
}, 500); // Retry every 500ms
});