.calendar-shell {
    width: min(72vw, 1260px);
    min-width: 840px;
    height: calc(100vh - 116px);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.calendar-toolbar {
    position: relative;
    z-index: 30;
    overflow: visible;
    min-height: 128px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-shrink: 0;
    padding: 22px 26px 18px;
    border-radius: 12px;
    border: 1px solid rgba(135, 164, 209, 0.24);
    background:
        linear-gradient(145deg, rgba(31, 50, 81, 0.86), rgba(24, 42, 70, 0.72));
    box-shadow:
        0 24px 58px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.calendar-toolbar-main {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(190, 207, 231, 0.16);
}

.calendar-month-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.calendar-title {
    min-width: 190px;
    margin: 0;
    color: #f7fbff;
    font-size: 1.55rem;
    font-weight: 780;
    line-height: 1.2;
    text-align: center;
    text-shadow: 0 8px 22px rgba(0, 0, 0, 0.30);
}

.cal-nav-btn,
.cal-today-btn {
    border: 0;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.cal-nav-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #dce8f6;
    background: rgba(15, 29, 49, 0.44);
    border: 1px solid rgba(179, 199, 227, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.cal-nav-btn:hover {
    transform: translateY(-1px);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.11);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.cal-today-btn {
    min-width: 58px;
    height: 36px;
    padding: 0 14px;
    border-radius: 9px;
    color: #d7e3f2;
    background: rgba(15, 29, 49, 0.36);
    border: 1px solid rgba(179, 199, 227, 0.18);
    font-size: 0.82rem;
    font-weight: 720;
}

.cal-today-btn:hover {
    transform: translateY(-1px);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.11);
}

.calendar-filter-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cal-filter-btn {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 15px;
    border-radius: 8px;
    color: #e4edf8;
    background: rgba(15, 29, 49, 0.38);
    border: 1px solid rgba(179, 199, 227, 0.20);
    font-size: 0.84rem;
    font-weight: 720;
    font-family: inherit;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease, border-color 0.16s ease;
}

.cal-filter-btn:hover,
.cal-filter-btn.active {
    color: #ffffff;
    background: rgba(52, 91, 145, 0.38);
    border-color: rgba(132, 177, 236, 0.38);
    transform: translateY(-1px);
}

.cal-type-menu-wrap {
    position: relative;
}

.cal-type-menu {
    min-width: 150px;
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 20;
    padding: 7px;
    border-radius: 10px;
    background: rgba(15, 29, 49, 0.96);
    border: 1px solid rgba(179, 199, 227, 0.20);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.cal-type-menu.open {
    display: block;
}

.cal-type-menu button {
    width: 100%;
    display: block;
    padding: 9px 10px;
    border: 0;
    border-radius: 7px;
    color: #d7e3f2;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 680;
    text-align: left;
}

.cal-type-menu button:hover,
.cal-type-menu button.active {
    color: #ffffff;
    background: rgba(59, 130, 246, 0.24);
}

.cal-color-btn {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: #334155;
    background: rgba(248, 250, 252, 0.92);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.cal-color-btn span {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    flex: 0 0 auto;
}

.cal-color-btn:hover,
.cal-color-btn.active {
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, 0.45);
    background: rgba(239, 246, 255, 0.96);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
}

.calendar-category-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cal-category-pill {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 17px;
    border: 1px solid rgba(179, 199, 227, 0.19);
    border-radius: 999px;
    color: #e3edf8;
    background: rgba(15, 29, 49, 0.34);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 720;
    transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.cal-category-pill:hover,
.cal-category-pill.active {
    transform: translateY(-1px);
    background: rgba(52, 91, 145, 0.38);
    border-color: rgba(132, 177, 236, 0.42);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}

.cal-category-pill i {
    width: 9px;
    height: 9px;
    display: inline-block;
    border-radius: 999px;
    box-shadow: 0 0 14px currentColor;
}

.calendar-card {
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid rgba(214, 224, 236, 0.86);
    background:
        radial-gradient(circle at 50% 0%, rgba(246, 250, 255, 0.52), rgba(255, 255, 255, 0.44) 42%, rgba(249, 252, 255, 0.42) 100%);
    box-shadow:
        0 28px 68px rgba(0, 0, 0, 0.30),
        inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    flex-shrink: 0;
    border-bottom: 1px solid rgba(207, 216, 228, 0.82);
    background: rgba(255, 255, 255, 0.34);
}

.cal-weekday {
    padding: 15px 0 14px;
    color: #4b5d75;
    font-size: 0.82rem;
    font-weight: 780;
    text-align: center;
}

.cal-weekday.sun { color: #d45b6a; }
.cal-weekday.sat { color: #3b7cbf; }

.calendar-grid {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-auto-rows: minmax(108px, 1fr);
    background: rgba(222, 230, 241, 0.50);
    gap: 1px;
}
.calendar-grid::-webkit-scrollbar {
    display: none;
}

.cal-day {
    min-width: 0;
    padding: 12px 10px 8px;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    background: rgba(255, 255, 255, 0.38);
    transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.cal-day:hover {
    z-index: 1;
    background: rgba(255, 255, 255, 0.54);
    box-shadow: inset 0 0 0 1px rgba(76, 118, 172, 0.20), 0 12px 28px rgba(38, 59, 88, 0.08);
}

.cal-day.today {
    background:
        linear-gradient(180deg, rgba(230, 241, 255, 0.32), rgba(247, 251, 255, 0.46));
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.18);
}

.cal-day.other-month {
    background: rgba(250, 252, 254, 0.42);
}

.cal-day.other-month .cal-day-num,
.cal-day.other-month .cal-event-chip,
.cal-day.other-month .cal-more-badge {
    opacity: 0.42;
}

.cal-day-num {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 7px;
    border-radius: 999px;
    color: var(--day-color, #182234);
    font-size: 0.82rem;
    font-weight: 760;
}

.cal-day.today .cal-day-num {
    color: #ffffff !important;
    background: linear-gradient(135deg, #2563eb, #4f8df7);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.30);
}

.cal-event-chip {
    width: 100%;
    min-height: 25px;
    display: block;
    margin-bottom: 5px;
    padding: 5px 8px 5px 10px;
    border: 0;
    border-left: 3px solid var(--event-color, #3b82f6);
    border-radius: 6px;
    color: #183253;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 760;
    line-height: 1.25;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46);
    transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.cal-event-chip:hover {
    transform: translateY(-1px);
    filter: brightness(1.04) saturate(1.04);
    box-shadow: 0 7px 14px rgba(37, 52, 76, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

/* ── 다중일 셀 배경 채우기 ── */
.cal-span-fill {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}
.cal-span-label {
    position: relative;
    z-index: 1;
    font-size: 0.70rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 1px 5px;
    border-radius: 3px;
    margin-bottom: 3px;
    cursor: pointer;
    display: block;
    transition: filter 0.15s;
}
.cal-span-label:hover { filter: brightness(0.88); }
.cal-day-num, .cal-event-chip, .cal-more-badge {
    position: relative;
    z-index: 1;
}
.cal-day.drag-over {
    background: rgba(219, 234, 254, 0.60) !important;
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.40);
    cursor: crosshair;
}

.cal-more-badge {
    padding: 2px 4px 0;
    color: #66758a;
    font-size: 0.68rem;
    font-weight: 700;
}

.calendar-clock-wrap {
    flex-shrink: 0;
    text-align: center;
    padding: 0;
}

.content-panel.calendar-bg #calendarClock {
    color: rgba(217, 228, 244, 0.92) !important;
    font-size: 1.35rem;
    font-weight: 680;
    letter-spacing: 0;
    text-shadow: 0 8px 24px rgba(0, 0, 0, 0.34);
}

@media (max-width: 1180px) {
    .content-panel.calendar-bg {
        padding: 22px;
        background:
            linear-gradient(90deg, rgba(7, 17, 31, 0.90) 0%, rgba(10, 23, 40, 0.78) 70%, rgba(10, 23, 40, 0.46) 100%),
            url("../assets/chul002.webp?v=1") no-repeat right center / cover;
    }
    .calendar-shell {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 760px) {
    .calendar-shell {
        height: calc(var(--mobile-vh, 100vh) - 104px);
        gap: 10px;
    }
    .calendar-toolbar {
        justify-content: space-between;
        padding: 10px 12px;
    }
    .calendar-toolbar-main {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding-bottom: 12px;
    }
    .calendar-month-control {
        gap: 9px;
        justify-content: center;
        flex-wrap: wrap;
    }
    .calendar-filter-actions,
    .calendar-category-row {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    .calendar-title {
        min-width: 128px;
        font-size: 1.05rem;
    }
    .calendar-grid {
        grid-auto-rows: minmax(96px, 1fr);
    }
    .cal-day {
        padding: 6px;
    }
    .cal-event-chip {
        min-height: 21px;
        padding: 3px 6px 3px 8px;
        font-size: 0.7rem;
    }
}

/* 개인용 할 일 뷰 */
.main-layout.personaltodo-main {
    background:
        linear-gradient(90deg, rgba(7, 17, 31, 0.92) 0%, rgba(10, 22, 38, 0.86) 50%, rgba(10, 22, 38, 0.14) 70%, transparent 82%),
        url("../assets/chul003.webp?v=1") no-repeat right center / cover;
    background-color: #07111f;
}
.top-nav.personaltodo-header {
    background: transparent !important;
    border-bottom: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
.top-nav.personaltodo-header #currentPageTitle {
    color: #ffffff;
}
.content-panel.personaltodo-bg {
    padding: 0;
    overflow-y: auto;
    background: transparent;
}
.content-panel.personaltodo-bg .glass-card {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

