.setup-banner,
.calendar-shell,
.event-list-card,
.calendar-event-modal {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.setup-banner,
.calendar-shell {
    border-radius: 1.8rem;
    border: 1px solid rgba(232, 232, 232, 0.12);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.22);
}

.setup-banner {
    padding: 1.35rem 1.5rem;
    margin-bottom: 1.2rem;
    background: linear-gradient(
            135deg,
            rgba(244, 184, 25, 0.12),
            rgba(224, 122, 95, 0.06)
    );
}

.setup-banner h3 {
    margin: 0 0 0.7rem;
    color: #f2cc8f;
    font-size: 1rem;
}

.setup-banner p,
.calendar-subtitle,
.event-list-time,
.calendar-modal-meta,
.calendar-modal-desc,
.calendar-step {
    line-height: 1.75;
    color: rgba(232, 232, 232, 0.8);
}

.setup-banner code {
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #f2cc8f;
    font-family: Consolas, "Courier New", monospace;
}

.calendar-steps {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.8rem;
}

.calendar-step {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.86rem;
}

.step-num {
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(242, 204, 143, 0.18);
    color: #f2cc8f;
    margin-top: 0.1rem;
}

.calendar-shell {
    padding: 1.5rem;
    margin: 8.2rem 0 3rem;
    background: rgba(232, 232, 232, 0.04);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.calendar-header h2 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3rem);
    font-family: "Palatino Linotype", "Book Antiqua", serif;
    letter-spacing: 0.02em;
}

.calendar-subtitle {
    margin-top: 0.35rem;
    font-size: 0.92rem;
}

.nav-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
}

.nav-btn,
.today-btn,
.view-toggle button,
.sync-btn,
.calendar-modal-btn,
.list-sync-btn {
    border-radius: 12px;
    border: 1px solid rgba(232, 232, 232, 0.12);
    color: rgba(232, 232, 232, 0.82);
    background: rgba(232, 232, 232, 0.05);
    cursor: pointer;
    text-decoration: none;
}

.nav-btn {
    width: 40px;
    height: 40px;
    font-size: 1.15rem;
}

.today-btn,
.sync-btn {
    height: 40px;
    padding: 0 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.today-btn {
    color: #f2cc8f;
}

.sync-btn {
    color: #e8e8e8;
}

.month-label {
    min-width: 180px;
    text-align: center;
    font-family: "Palatino Linotype", "Book Antiqua", serif;
    font-size: 1.35rem;
    font-weight: 700;
}

.view-toggle {
    display: flex;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(232, 232, 232, 0.12);
    background: rgba(232, 232, 232, 0.05);
}

.view-toggle button {
    border: none;
    border-radius: 0;
    padding: 0.7rem 1rem;
    min-width: 5rem;
}

.view-toggle button.active {
    background: linear-gradient(
            135deg,
            rgba(224, 122, 95, 0.24),
            rgba(255, 134, 61, 0.16)
    );
    color: #e8e8e8;
}

.calendar-grid-wrapper {
    display: block;
}
.calendar-grid-wrapper.hidden {
    display: none;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: rgba(232, 232, 232, 0.12);
    border-radius: 1.2rem;
    overflow: hidden;
    border: 1px solid rgba(232, 232, 232, 0.12);
}

.day-header {
    background: rgba(25, 28, 35, 0.8);
    padding: 1rem 0.5rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: rgba(232, 232, 232, 0.62);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.day-cell {
    background: rgba(25, 28, 35, 0.76);
    min-height: 118px;
    padding: 0.55rem;
    cursor: pointer;
    transition:
            background 0.2s ease,
            box-shadow 0.2s ease;
}

.day-cell:hover {
    background: rgba(61, 64, 91, 0.62);
}
.day-cell.other-month {
    opacity: 0.33;
}

.day-cell.today {
    box-shadow: inset 0 0 0 1px rgba(242, 204, 143, 0.22);
    background: rgba(25, 28, 35, 0.76);
}

.day-num {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: rgba(232, 232, 232, 0.78);
    margin-bottom: 0.35rem;
}

.day-cell.today .day-num {
    background: #f2cc8f;
    color: #191c23;
}

.event-pill {
    display: block;
    padding: 4px 8px;
    border-radius: 7px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-bottom: 3px;
    min-height: 1.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.45;
    cursor: pointer;
    transition:
            transform 0.15s ease,
            box-shadow 0.15s ease;
}

.event-pill:hover {
    transform: translateX(2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.24);
}

.event-pill.color-0 {
    background: rgba(129, 178, 154, 0.18);
    color: #81b29a;
}
.event-pill.color-1 {
    background: rgba(224, 122, 95, 0.18);
    color: #e07a5f;
}
.event-pill.color-2 {
    background: rgba(242, 204, 143, 0.16);
    color: #f2cc8f;
}
.event-pill.color-3 {
    background: rgba(244, 184, 25, 0.18);
    color: #f4b819;
}
.event-pill.color-4 {
    background: rgba(140, 40, 50, 0.18);
    color: #f0b4bc;
}

.event-pill.segment-start {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    margin-right: -0.55rem;
}

.event-pill.segment-middle {
    border-radius: 0;
    margin-left: -0.55rem;
    margin-right: -0.55rem;
}

.event-pill.segment-end {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: -0.55rem;
}

.more-events {
    font-size: 0.68rem;
    color: rgba(232, 232, 232, 0.55);
    padding: 2px 7px;
    cursor: pointer;
}

.event-list {
    display: none;
    flex-direction: column;
    gap: 0.75rem;
}

.event-list.active {
    display: flex;
}

.event-list-card {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    background: rgba(25, 28, 35, 0.78);
    border: 1px solid rgba(232, 232, 232, 0.12);
    border-radius: 1.1rem;
    padding: 1.25rem 1.4rem;
    transition:
            transform 0.2s ease,
            background 0.2s ease;
    animation: fadeSlideIn 0.35s ease-out backwards;
}

.event-list-card:hover {
    transform: translateY(-1px);
    background: rgba(61, 64, 91, 0.48);
}

.event-list-date {
    text-align: center;
    min-width: 52px;
    flex-shrink: 0;
}

.day-big {
    font-family: "Palatino Linotype", "Book Antiqua", serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #f2cc8f;
    line-height: 1;
}

.day-name,
.month-sm {
    font-size: 0.72rem;
    color: rgba(232, 232, 232, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.2rem;
}

.event-list-divider {
    width: 3px;
    min-height: 3rem;
    border-radius: 3px;
    flex-shrink: 0;
}

.event-list-body {
    flex: 1;
    min-width: 0;
}
.event-list-title {
    font-weight: 700;
    font-size: 1rem;
    color: #e8e8e8;
    margin-bottom: 0.3rem;
}
.event-list-desc {
    font-size: 0.82rem;
    color: rgba(232, 232, 232, 0.78);
    margin-top: 0.45rem;
    line-height: 1.5;
}

.list-sync-btn,
.calendar-modal-btn {
    padding: 0.75rem 0.95rem;
    font-weight: 700;
}

.list-sync-btn {
    flex: 0 0 auto;
}

.calendar-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.66);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.calendar-modal-overlay.open {
    display: flex;
}

.calendar-event-modal {
    width: 100%;
    max-width: 480px;
    padding: 2rem;
    border-radius: 1.4rem;
    border: 1px solid rgba(232, 232, 232, 0.12);
    background: linear-gradient(
            150deg,
            rgba(25, 28, 35, 0.96),
            rgba(61, 64, 91, 0.86)
    );
    animation: modalIn 0.25s ease-out;
}

.calendar-modal-close {
    float: right;
    border: none;
    background: none;
    color: rgba(232, 232, 232, 0.6);
    font-size: 1.4rem;
    cursor: pointer;
}

.calendar-event-modal h3 {
    margin: 0 0 1rem;
    font-size: 1.5rem;
    font-family: "Palatino Linotype", "Book Antiqua", serif;
}

.calendar-modal-meta {
    display: grid;
    gap: 0.55rem;
    font-size: 0.9rem;
}

.calendar-modal-meta-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.calendar-modal-desc {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(232, 232, 232, 0.12);
    font-size: 0.9rem;
}

.calendar-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.2rem;
}

.calendar-modal-btn.primary {
    background: linear-gradient(
            135deg,
            rgba(224, 122, 95, 0.82),
            rgba(255, 134, 61, 0.72)
    );
    color: #fff9f2;
    border-color: transparent;
}

.calendar-modal-btn.secondary {
    background: rgba(232, 232, 232, 0.05);
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: rgba(232, 232, 232, 0.64);
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@media (max-width: 768px) {
    .day-cell {
        min-height: 72px;
        padding: 0.35rem;
    }
    .event-pill {
        font-size: 0.62rem;
        padding: 2px 5px;
        min-height: 1.45rem;
    }
    .event-pill.segment-start {
        margin-right: -0.35rem;
    }
    .event-pill.segment-middle {
        margin-left: -0.35rem;
        margin-right: -0.35rem;
    }
    .event-pill.segment-end {
        margin-left: -0.35rem;
    }
    .month-label {
        font-size: 1rem;
        min-width: 150px;
    }
    .event-list-card {
        padding: 1rem;
        gap: 0.9rem;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .day-header {
        font-size: 0.65rem;
        padding: 0.6rem 0.25rem;
    }
    .day-cell {
        min-height: 58px;
    }
    .day-num {
        width: 22px;
        height: 22px;
        font-size: 0.72rem;
    }
    .nav-controls {
        flex-wrap: wrap;
    }
    .event-list-card {
        flex-direction: column;
    }
    .list-sync-btn {
        width: 100%;
        text-align: center;
    }
}