.calendar-surface { --calendar-panel-height: min(60vh, 36rem); }
.calendar-surface .calendar-category { max-width: 26rem; }
.calendar-surface [hidden], #eventModal [hidden] { display: none !important; }
.calendar-viewport { position: relative; max-height: var(--calendar-panel-height); overflow: auto; scrollbar-gutter: stable; }
.calendar-current-list, .calendar-upcoming-list { overflow: auto; scrollbar-gutter: stable; }
.calendar-current-list { max-height: min(25vh, 10rem); }
.calendar-upcoming-list { max-height: var(--calendar-panel-height); }
.calendar-viewport:focus-visible, .calendar-current-list:focus-visible, .calendar-upcoming-list:focus-visible { outline: 2px solid var(--bs-primary, #0d6efd); outline-offset: -2px; }
.calendar-viewport thead th { position: sticky; top: 0; z-index: 4; background-color: var(--bs-body-bg, white); box-shadow: 0 1px var(--bs-border-color, #dee2e6); }
.calendar-surface #weeklyCalendar .calendar-time-column { position: sticky; left: 0; z-index: 3; background-color: var(--bs-body-bg, white); white-space: nowrap; }
.calendar-surface #weeklyCalendar thead .calendar-time-column { z-index: 5; }
.calendar-description { white-space: pre-wrap; }
.calendar-event { border-left: 4px solid; border-radius: .25rem; color: var(--bs-body-color); }
.calendar-event:hover, .calendar-event:focus-visible { background-color: var(--bs-tertiary-bg, #eee); }
.calendar-surface #monthlyCalendar { min-width: 560px; table-layout: fixed; }
.calendar-month-day { height: 125px; vertical-align: top; padding: .4rem !important; }
.calendar-month-event { display: block; width: 100%; font-size: .75rem; padding: .15rem .25rem; margin-bottom: .25rem; }
.calendar-month-event > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-surface #weeklyCalendar { min-width: 700px; table-layout: fixed; }
.calendar-time-column { width: 75px; }
.calendar-week-slot { position: relative; height: 60px; padding: 0 !important; vertical-align: top; }
.calendar-week-event { position: absolute; z-index: 2; overflow: hidden; padding: .15rem; font-size: .7rem; background-color: var(--bs-body-bg, white); }
.calendar-surface #agendaView .calendar-event { border-left-width: 5px !important; }
.calendar-surface #agendaView h6 { position: sticky; top: 0; z-index: 3; padding-top: .5rem; background-color: var(--bs-body-bg, white); }
@media (max-width: 575px) {
    .calendar-surface { --calendar-panel-height: min(55vh, 30rem); }
    .calendar-upcoming-list { max-height: 16rem; }
    .calendar-surface .card-header > div { justify-content: center !important; }
    .calendar-surface #calendarTitle { flex-basis: 100%; text-align: center; order: -1; }
    .calendar-surface #agendaView { padding: .75rem !important; }
    .calendar-surface .calendar-event { white-space: normal; overflow-wrap: anywhere; }
    #eventModal .modal-footer > * { flex: 1 1 auto; }
}
