.gcl-calendar {
    --gcl-border: #e2e5e9;
    --gcl-muted: #6b7280;
    --gcl-surface: #ffffff;
    --gcl-today: #f3f7ff;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    text-transform: none !important;
    letter-spacing: normal;
}

/* Prevent WordPress themes from forcing calendar controls/event titles to uppercase. */
.gcl-calendar button,
.gcl-calendar label,
.gcl-calendar input,
.gcl-calendar select,
.gcl-calendar textarea {
    text-transform: none !important;
    letter-spacing: normal !important;
}

.gcl-calendar *,
.gcl-calendar *::before,
.gcl-calendar *::after { box-sizing: border-box; }

.gcl-title { margin: 0 0 14px; }

.gcl-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.gcl-month-label {
    min-width: 180px;
    font-weight: 700;
    font-size: 1.15rem;
    text-align: center;
}

.gcl-nav,
.gcl-today {
    appearance: none;
    border: 1px solid var(--gcl-border);
    background: var(--gcl-surface);
    color: inherit;
    border-radius: 7px;
    min-height: 36px;
    cursor: pointer;
    font: inherit;
}

.gcl-nav { width: 38px; font-size: 1.35rem; line-height: 1; }
.gcl-today { padding: 0 12px; margin-left: auto; }
.gcl-nav:hover, .gcl-today:hover { background: #f6f7f8; }

.gcl-filters {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 1px solid var(--gcl-border);
    border-radius: 8px;
    background: #fafafa;
    font-size: .86rem;
}

.gcl-filters:empty { display: none; }

.gcl-filter-label {
    flex: 0 0 auto;
    padding-top: 2px;
    font-weight: 600;
}

.gcl-filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 14px;
}

.gcl-filter-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    cursor: pointer;
    font-weight: 400;
    line-height: 1.25;
}

.gcl-filter-option input {
    margin: 0;
    width: 15px;
    height: 15px;
}

.gcl-filter-swatch {
    width: 11px;
    height: 11px;
    border-radius: 3px;
    display: inline-block;
    flex: 0 0 auto;
}

.gcl-filter-name { font-weight: 400; }

.gcl-status { margin: 8px 0; color: var(--gcl-muted); }
.gcl-status:empty { display: none; }
.gcl-status.gcl-error { color: #b42318; }

.gcl-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-top: 1px solid var(--gcl-border);
    border-left: 1px solid var(--gcl-border);
    background: var(--gcl-surface);
}

.gcl-weekday {
    padding: 8px 6px;
    text-align: center;
    font-size: .82rem;
    font-weight: 700;
    color: var(--gcl-muted);
    border-right: 1px solid var(--gcl-border);
    border-bottom: 1px solid var(--gcl-border);
}

.gcl-day {
    min-height: 116px;
    padding: 6px;
    overflow: hidden;
    border-right: 1px solid var(--gcl-border);
    border-bottom: 1px solid var(--gcl-border);
}

.gcl-day.gcl-outside { background: #fafafa; }
.gcl-day.gcl-is-today { background: var(--gcl-today); }

.gcl-day-number {
    font-size: .82rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.gcl-outside .gcl-day-number { color: #a0a5ad; }

.gcl-event {
    display: block;
    padding: 4px 6px;
    margin: 0 0 4px;
    border-radius: 5px;
    font-size: .72rem;
    font-weight: 400 !important;
    line-height: 1.2;
    text-decoration: none !important;
    overflow: hidden;
}

.gcl-event:hover { filter: brightness(.96); }
.gcl-event-time { font-weight: 700; margin-right: 5px; }
.gcl-event-title { overflow-wrap: anywhere; font-weight: 400 !important; }


/* Responsive calendar views */
.gcl-list { display: none; }

@media (max-width: 1050px) {
    .gcl-calendar { font-size: .96em; }
    .gcl-toolbar { gap: 6px; }
    .gcl-month-label { min-width: 155px; font-size: 1.05rem; }
    .gcl-filters { padding: 9px 10px; gap: 8px; }
    .gcl-filter-options { gap: 6px 10px; }
    .gcl-weekday { padding: 7px 4px; font-size: .76rem; }
    .gcl-day { min-height: 98px; padding: 5px 4px; }
    .gcl-day-number { font-size: .77rem; margin-bottom: 4px; }
    .gcl-event { padding: 3px 4px; margin-bottom: 3px; font-size: .67rem; line-height: 1.18; }
}

@media (max-width: 820px) {
    .gcl-toolbar { flex-wrap: wrap; }
    .gcl-month-label { min-width: 130px; flex: 1 1 150px; }
    .gcl-today { margin-left: 0; }
    .gcl-filters { flex-direction: column; gap: 7px; }
    .gcl-filter-label { padding-top: 0; }
    .gcl-filter-options { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 12px; }
    .gcl-filter-option { min-width: 0; }
    .gcl-filter-name { overflow-wrap: anywhere; }
    .gcl-day { min-height: 90px; padding: 4px 3px; }
    .gcl-event { padding: 3px; font-size: .63rem; }
}

@media (max-width: 640px) {
    .gcl-title { margin-bottom: 10px; }
    .gcl-toolbar { display: grid; grid-template-columns: 40px 1fr 40px; gap: 6px; margin-bottom: 10px; }
    .gcl-nav { width: 40px; min-height: 40px; }
    .gcl-month-label { min-width: 0; font-size: 1.05rem; }
    .gcl-today { grid-column: 1 / -1; width: 100%; margin: 0; min-height: 36px; }

    .gcl-filters { margin-bottom: 10px; padding: 9px; font-size: .82rem; }
    .gcl-filter-options { grid-template-columns: 1fr; gap: 7px; }
    .gcl-filter-option { min-height: 24px; }
    .gcl-filter-option input { width: 17px; height: 17px; }
    .gcl-filter-swatch { width: 12px; height: 12px; }

    .gcl-grid { display: none; }
    .gcl-list { display: block; border: 1px solid var(--gcl-border); border-radius: 8px; overflow: hidden; background: var(--gcl-surface); }
    .gcl-list-day { display: grid; grid-template-columns: minmax(82px, 28%) 1fr; gap: 10px; padding: 10px; border-bottom: 1px solid var(--gcl-border); align-items: start; }
    .gcl-list-day:last-child { border-bottom: 0; }
    .gcl-list-day.gcl-is-today { background: var(--gcl-today); }
    .gcl-list-date { font-size: .78rem; font-weight: 600; line-height: 1.3; color: var(--gcl-muted); padding-top: 3px; }
    .gcl-list-events { min-width: 0; }
    .gcl-list-events .gcl-event { font-size: .82rem; line-height: 1.25; padding: 7px 8px; margin-bottom: 6px; border-radius: 6px; }
    .gcl-list-events .gcl-event:last-child { margin-bottom: 0; }
    .gcl-list-day-empty { min-height: 44px; }
    .gcl-list-no-events {
        padding: 4px 0;
        color: #9aa0a6;
        font-size: .8rem;
        line-height: 1.3;
        font-style: italic;
    }
    .gcl-list-empty { padding: 18px 12px; color: var(--gcl-muted); text-align: center; font-size: .9rem; }
}

@media (max-width: 380px) {
    .gcl-list-day { grid-template-columns: 1fr; gap: 5px; padding: 9px; }
    .gcl-list-date { padding-top: 0; }
}

/* Event details popup */
.gcl-event {
    width: 100%;
    border: 0;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.gcl-event:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

body.gcl-modal-open { overflow: hidden; }

.gcl-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, .42);
}

.gcl-modal {
    position: relative;
    width: min(560px, 100%);
    max-height: min(80vh, 700px);
    overflow-y: auto;
    background: #fff;
    color: #202124;
    border-radius: 14px;
    box-shadow: 0 16px 50px rgba(0, 0, 0, .28);
    padding: 28px 30px 30px;
    font-family: inherit;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.gcl-modal *,
.gcl-modal button {
    text-transform: none !important;
    letter-spacing: normal !important;
}

.gcl-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #5f6368;
    font: inherit;
    font-size: 29px;
    line-height: 36px;
    cursor: pointer;
}

.gcl-modal-close:hover,
.gcl-modal-close:focus-visible { background: #f1f3f4; }

.gcl-modal-title {
    margin: 0 42px 8px 0;
    color: #202124;
    font: inherit;
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.35;
}

.gcl-modal-range {
    margin: 0 0 20px;
    color: #5f6368;
    font-size: .96rem;
    line-height: 1.45;
}

.gcl-modal-description {
    padding-top: 18px;
    border-top: 1px solid #e8eaed;
    color: #3c4043;
    font-size: .96rem;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

@media (max-width: 600px) {
    .gcl-modal-overlay { align-items: flex-end; padding: 12px; }
    .gcl-modal { width: 100%; max-height: 86vh; border-radius: 14px; padding: 24px 22px 26px; }
    .gcl-modal-title { font-size: 1.2rem; }
}


/* v1.4.1: keep the mobile calendar inside the content column and prevent horizontal drift. */
@media (max-width: 640px) {
    .gcl-calendar {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    .gcl-calendar > *,
    .gcl-toolbar,
    .gcl-filters,
    .gcl-filter-options,
    .gcl-status,
    .gcl-list,
    .gcl-list-day,
    .gcl-list-events {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .gcl-toolbar,
    .gcl-filters,
    .gcl-list {
        margin-left: 0;
        margin-right: 0;
    }

    .gcl-list-day {
        grid-template-columns: minmax(76px, 27%) minmax(0, 1fr);
    }

    .gcl-list-events .gcl-event,
    .gcl-event-title,
    .gcl-filter-name {
        max-width: 100%;
        min-width: 0;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}

@media (max-width: 380px) {
    .gcl-list-day {
        grid-template-columns: minmax(0, 1fr);
    }
}


/* v1.4.2: hard-contain the mobile month navigation buttons. */
@media (max-width: 640px) {
    .gcl-toolbar {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        grid-template-columns: 38px minmax(0, 1fr) 38px !important;
        column-gap: 6px;
        padding: 0 2px;
        overflow: hidden;
        box-sizing: border-box !important;
    }

    .gcl-toolbar .gcl-nav {
        width: 38px !important;
        min-width: 0 !important;
        max-width: 38px !important;
        height: 40px;
        min-height: 40px;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        position: static !important;
        transform: none !important;
    }

    .gcl-toolbar .gcl-prev { justify-self: start; }
    .gcl-toolbar .gcl-next { justify-self: end; }

    .gcl-toolbar .gcl-month-label {
        width: auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 2px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .gcl-toolbar .gcl-today {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }
}
