@media (prefers-color-scheme: dark) {
    .piecal-wrapper.piecal-theme-adaptive {
        --fc-border-color: #303643;
        --fc-event-bg-color: #0d1117;
        --fc-event-text-color: #8b949e;
        --fc-today-bg-color: #0d1117;
        --fc-event-border-color: #303643; 
        --fc-neutral-bg-color: #0d1117;
        --fc-list-event-hover-bg-color: #0d1117;
    
        color: white;
    }
    
    .piecal-wrapper.piecal-theme-adaptive a {
        color: #58a6ff;
    }
    
    .piecal-wrapper.piecal-theme-adaptive .fc-event {
        border-color: #303643;
    }
    
    .piecal-wrapper.piecal-theme-adaptive .fc-day-today > div {
        border: 1px dashed white;
    }
    
    .piecal-wrapper.piecal-theme-adaptive .fc .fc-toolbar-title {
        color: white;
    }
    
    .piecal-wrapper.piecal-theme-adaptive .fc a {
        color: white;
    }
    
    .piecal-wrapper.piecal-theme-adaptive .fc .fc-button-primary {
        background-color: white;
        color: black;
    }
    
    .piecal-wrapper.piecal-theme-adaptive .piecal-popover__inner {
        background: var(--fc-event-bg-color);
    }
    
    .piecal-wrapper.piecal-theme-adaptive .piecal-popover__inner hr {
        background: var(--fc-event-border-color);
    }
    
    .piecal-wrapper.piecal-theme-adaptive .piecal-popover__close-button {
        background: none;
    }
    
    .piecal-wrapper.piecal-theme-adaptive .piecal-popover__close-button::before,
    .piecal-wrapper.piecal-theme-adaptive .piecal-popover__close-button::after {
        background: white;
    }

    .piecal-wrapper.piecal-theme-adaptive--widget .fc-daygrid-day-frame:has(.fc-daygrid-event-harness)::after {
        box-shadow: 0px 0px 0px 1px white;
    }
    
    @media only screen and (max-width: 768px) {
        .piecal-wrapper--responsive-widget[data-view="dayGridMonth"].piecal-theme-adaptive .fc-daygrid-day-frame:has(.fc-daygrid-event-harness)::after {
            box-shadow: 0px 0px 0px 1px white;
        }
    }
}