.ttvm-calendar {
    --ttvm-border: #d7dce2;
    --ttvm-muted: #667085;
    --ttvm-surface: #ffffff;
    --ttvm-soft: #f5f7fa;
    color: #1f2933;
    background-color: #eeeeeedc;
    padding: 0.25rem;
}

.ttvm-calendar a {
    text-decoration: none;
}

.calendar-abo {
    margin: 0 0 1rem;
}

.calendar-abo h4 {
    margin: 0 0 .5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.calendar-abo-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.calendar-abo-btn,
.calendar-view-toggle button,
.cal-nav,
.cal-today {
    border: 1px solid var(--ttvm-border);
    background: var(--ttvm-surface);
    color: #1f2933;
    border-radius: 6px;
}

.calendar-abo-btn {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .35rem .6rem;
    font-size: .9rem;
}

.calendar-legend-item {
    cursor: default;
}

.legend-color {
    width: .85rem;
    height: .85rem;
    border-radius: 50%;
    flex: 0 0 auto;
}

.calendar-view-toggle {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    margin: .75rem 0;
}

.calendar-view-toggle button {
    padding: .35rem .7rem;
}

.calendar-view-toggle .is-active {
    background: #1f2933;
    color: #fff;
}

.calendar-header {
    display: grid;
    grid-template-columns: 3rem 1fr 3rem;
    align-items: center;
    gap: .75rem;
    margin: .75rem 0 1rem;
}

.cal-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    font-size: 1.25rem;
}

.calendar-current {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    font-size: 1.45rem;
    font-weight: 700;
    text-align: center;
}

.cal-today {
    padding: .25rem .55rem;
    font-size: .85rem;
    font-weight: 600;
}

.calendar-errors {
    display: grid;
    gap: .5rem;
    margin-bottom: 1rem;
}

.calendar-error {
    border: 1px solid #f5c2c7;
    background: #f8d7da;
    color: #842029;
    border-radius: 6px;
    padding: .65rem .8rem;
}

.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekdays {
    border: 1px solid var(--ttvm-border);
    border-bottom: 0;
    background: #e9edf2;
    font-weight: 700;
    font-size: .85rem;
    text-align: center;
}

.calendar-weekdays div {
    padding: .55rem .25rem;
}

.calendar-grid {
    border-left: 1px solid var(--ttvm-border);
    border-top: 1px solid var(--ttvm-border);
}

.calendar-cell {
    min-height: 8.5rem;
    border-right: 1px solid var(--ttvm-border);
    border-bottom: 1px solid var(--ttvm-border);
    background: var(--ttvm-surface);
    padding: .45rem;
}

.calendar-cell.is-weekend {
    background: #3a39399d;
}

.calendar-cell.is-outside-month {
    background: #f1f3f5;
    color: var(--ttvm-muted);
}

.calendar-cell.is-today {
    box-shadow: inset 0 0 0 2px #7c7c7c;
}

.calendar-cell.is-today .calendar-day {
    background: #7c7c7c;
}

.calendar-cell[data-past="1"] .calendar-event {
    opacity: .62;
}

.calendar-day {
    background-color: #c8c8ca;
    margin-bottom: .4rem;
    font-size: .82rem;
    font-weight: 700;
    padding: 0 .25rem;
}

.calendar-event {
    color:black;
    border-radius: 5px;
    padding: .35rem .45rem;
    margin-bottom: .35rem;
    font-size: .78rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.calendar-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
}

.calendar-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgb(0 0 0 / .45);
}

.calendar-modal-dialog {
    position: relative;
    width: min(24rem, calc(100% - 2rem));
    margin: 12vh auto 0;
    background: #fff;
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 1rem 3rem rgb(0 0 0 / .24);
}

.calendar-modal-close {
    position: absolute;
    top: .6rem;
    right: .6rem;
    border: 0;
    background: transparent;
    font-size: 1.2rem;
    line-height: 1;
}

.calendar-modal-links {
    display: grid;
    gap: .5rem;
    padding: 0;
    margin: 1rem 0 0;
    list-style: none;
}

.calendar-modal-links a {
    display: block;
    border: 1px solid var(--ttvm-border);
    border-radius: 6px;
    padding: .65rem .75rem;
}

@media (max-width: 760px) {
    .calendar-weekdays {
        display: none;
    }

    .calendar-grid {
        display: grid;
        grid-template-columns: 1fr;
        border: 0;
        gap: .6rem;
    }

    .calendar-cell {
        min-height: auto;
        border: 1px solid var(--ttvm-border);
        border-radius: 6px;
    }

    .calendar-cell.is-outside-month {
        display: none;
    }

    .calendar-header {
        grid-template-columns: 2.5rem 1fr 2.5rem;
    }

    .calendar-current {
        flex-direction: column;
        gap: .35rem;
        font-size: 1.2rem;
    }
}


/* Verwaltung: Termin aus dem Kalender bearbeiten */
.calendar-event {
    position: relative;
}

.calendar-event-edit {
    position: absolute;
    top: .15rem;
    right: .3rem;
    color: inherit;
    opacity: .6;
    text-decoration: none;
}

.calendar-event-edit:hover,
.calendar-event-edit:focus {
    opacity: 1;
}
