.calendar-year-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #a9bf91;
}

.calendar-year {
    margin: 0;
    color: var(--green-950);
    font-size: 20px;
}

.calendar-controls {
    display: none;
}

.calendar-months {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.calendar-month {
    position: relative;
    min-width: 0;
    padding: 8px;
    border: 1px solid #bdcdaa;
    background: #f5f6e8;
}

.calendar-month:hover {
    z-index: 2;
}

.calendar-month[hidden] {
    display: none;
}

.calendar-month h3 {
    margin: 0 0 7px;
    color: var(--green-950);
    font-size: 14px;
    text-align: center;
    text-transform: capitalize;
}

.calendar-month table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.calendar-legend {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 12px 0 0;
    color: var(--green-950);
    font-size: 13px;
}

.calendar-legend-swatch {
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    border: 1px solid #e1a3a3;
    background: #f6cccc;
}

.calendar-month th {
    padding: 3px 1px;
    color: #527149;
    font-size: 10px;
    font-weight: bold;
    text-align: center;
}

.calendar-month td {
    height: 27px;
    padding: 2px;
    text-align: center;
}

.calendar-date {
    display: grid;
    min-height: 22px;
    place-items: center;
    border: 1px solid #e0e8d2;
    background: #fbfaec;
    color: var(--ink);
    font-size: 11px;
}

.calendar-date.is-highlighted-day {
    position: relative;
    z-index: 1;
    border-color: #e1a3a3;
    background: #f6cccc;
    color: #5f2525;
    cursor: help;
}

.calendar-date.is-highlighted-day::after {
    position: absolute;
    z-index: 3;
    bottom: calc(100% + 5px);
    left: 50%;
    padding: 4px 7px;
    transform: translate(-50%, 3px);
    border: 2px solid #123b29;
    background: #fbfaec;
    box-shadow: 2px 2px 0 #123b29;
    color: #174c32;
    content: attr(data-holiday);
    font-family: inherit;
    font-size: 12px;
    font-weight: bold;
    line-height: 1.2;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.calendar-date.is-highlighted-day:hover::after {
    transform: translate(-50%, 0);
    opacity: 1;
    visibility: visible;
}

.calendar-date.is-today {
    border-color: var(--green-800);
    background: var(--green-700);
    color: #fff;
    font-weight: bold;
}

.calendar-step {
    display: inline-grid;
    width: 42px;
    min-height: 40px;
    place-items: center;
    font-family: inherit;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.calendar-step:disabled {
    cursor: not-allowed;
    opacity: .45;
}

@media (max-width: 800px) {
    .calendar-months {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .calendar-year {
        display: none;
    }

    .calendar-controls {
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .calendar-controls p {
        flex: 1;
        margin: 0;
        color: var(--green-950);
        font-size: 18px;
        font-weight: bold;
        text-align: center;
        text-transform: capitalize;
    }

    .calendar-months {
        grid-template-columns: minmax(0, 1fr);
        touch-action: pan-y;
    }

    .calendar-month h3 {
        display: none;
    }

    .calendar-month {
        padding: 10px;
    }

    .calendar-month th {
        font-size: 12px;
    }

    .calendar-month td {
        height: 38px;
    }

    .calendar-date {
        min-height: 32px;
        font-size: 14px;
    }
}
