/* 1. 롯데리아 촵땡겨체 폰트 불러오기 (CSS 최상단 위치) */
@font-face {
    font-family: 'LotteriaChwapttaenggyeo';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2302@1.0/LOTTERIACHAB.woff2') format('woff2');
    font-weight: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Escoredream';
    src: url('https://gcore.jsdelivr.net/gh/projectnoonnu/noonfonts_2105_2@1.0/Cafe24SsurroundAir.woff') format('woff');
    font-weight: normal;
    font-display: swap;
}

@font-face {
    font-family: 'RixInuaridurine';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2207-01@1.0/RixInooAriDuriR.woff2') format('woff2');
    font-weight: normal;
    font-display: swap;
}

@font-face {
    font-family: 'OngleipKonkon';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2411-3@1.0/Ownglyph_ParkDaHyun.woff2') format('woff2');
    font-weight: normal;
    font-display: swap;
}

@font-face {
    font-family: 'KerisKeduLine';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2601-3@1.0/KERISKEDU_Line.woff2') format('woff2');
    font-weight: normal;
    font-display: swap;
}

@font-face {
    font-family: 'SchoolSafetyRoundedSmile';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2408-5@1.0/HakgyoansimDunggeunmisoTTF-R.woff2') format('woff2');
    font-weight: normal;
    font-display: swap;
}

@font-face {
    font-family: 'SchoolSafetyRoundedSmile';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2408-5@1.0/HakgyoansimDunggeunmisoTTF-B.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

:root {
    --point-blue: #BFDBFE;
    --point-text: #1E3A8A;
    --light-blue: #DBEAFE;
    --bg-base: #F8FAFC;
    --text-dark: #1E3A8A;
    --white: #FFFFFF;
    --radius-xl: 40px;
    --radius-lg: 30px;
    --radius-md: 20px;
    --font-main: 16px;
    --font-date: 16px;
    --font-event: 15px;
    --font-modal-label: 14px;
    --color-personal: #DBEAFE;
    --color-collab: #B3E5FC;
    --color-off: #E0E0E0;
    --color-tbd: #E1BEE7;
    --admin-color: #FF7043;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; width: 100%; }

body {
    font-family: 'Escoredream', sans-serif !important;
    background-color: var(--bg-base);
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 60px;
    padding-bottom: 80px;
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
    background: linear-gradient(
        to bottom,
        #eff6fd 0%,       
        #eff6fd 60%,      
        #eff6fd 100%      
    ) fixed;
}

/* 하단에 은은한 깊이감을 더해주는 오버레이 */
body::after {
    content: "";
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 120%, #d8ecff 0%, transparent 60%);
    opacity: 0.5;
    pointer-events: none;
    z-index: -1;
}

.fixed-top-bar {
    position: fixed; top: 0; left: 0; width: 100%; height: 60px;
    background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.05); display: flex;
    justify-content: center; z-index: 9999;
}
.top-bar-inner {
    width: 96%; max-width: 1600px; display: flex; justify-content: space-between;
    align-items: center; height: 100%;
}
.top-bar-left { display: flex; gap: 12px; }
.top-bar-right { display: flex; gap: 16px; align-items: center; }
.nav-tab {
    background: transparent; border: none; font-weight: 900; font-size: 16px;
    color: #94A3B8; cursor: pointer; padding: 8px 16px; border-radius: 12px;
    transition: all 0.2s; display: flex; align-items: center; font-family: 'Escoredream', sans-serif;
}
.nav-tab:hover { background: #F1F5F9; color: #3B82F6; }
.nav-tab.active { 
    background: #F8FAFC; 
    color: #3B82F6 !important; 
    border: 2px solid #3B82F6; 
}

.top-bar-link {
    display: flex; align-items: center; justify-content: center; width: 36px; height: 36px;
    border-radius: 50%; transition: transform 0.2s ease; overflow: hidden;
}
.top-bar-link:hover { transform: scale(1.1); }
.top-bar-link img { width: 100%; height: 100%; object-fit: cover; }
.yt-link { color: #FF0000; }

.top-admin-actions {
    display: flex; gap: 8px; align-items: center; margin-left: 8px;
    border-left: 1px solid #E5E7EB; padding-left: 16px; position: relative;
}
.top-icon-btn {
    background: transparent; border: none; width: 36px; height: 36px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: 0.2s; border-radius: 50%; padding: 0;
}
.top-icon-btn:hover { background: #F3F4F6; }
.top-icon-btn svg { transition: 0.2s; }
.top-icon-btn:hover svg { transform: translateY(-1px); }

.main-header {
    width: 96%; max-width: 1600px; display: grid; grid-template-columns: 1fr auto minmax(320px, 1fr);
    align-items: center; padding: 20px 45px 20px; margin: 0 auto; position: relative; gap: 24px;
}

.header-left, .header-right { display: flex; }
.header-left { justify-content: flex-start; }
.header-right { justify-content: flex-end; align-items: flex-start; }

.header-center {
    grid-column: 2; justify-self: center; display: flex; flex-direction: column;
    align-items: center; position: relative; padding: 0 40px;
}

.logo-link {
    display: inline-block; text-decoration: none; outline: none; border-radius: 20px;
    padding: 10px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-link:hover .main-logo {
    transform: translate(4px, 4px);
    filter: none;
}

.main-logo { height: 120px; object-fit: contain; display: block; transition: all 0.25s ease-out; filter: drop-shadow(4px 4px 0px #1E3A8A); }
body, button, input, textarea, select, .track-info, .song-title {
    color: #1E3A8A !important;
}

/* 레이아웃 래퍼 */
.top-grid-wrapper { flex: 1; min-width: 0; position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; width: 100%; }
.today-panel-wrapper { display: flex; justify-content: flex-start; }
.logo-wrapper { text-align: center; padding-left: 55px; }
.empty-placeholder { }

.layout-container + .layout-container { margin-top: 18px !important; }

.today-summary {
    background-color: #ffffff;
    border: 2px solid #1E3A8A; 
    border-radius: 25px;
    padding: 20px;
    box-shadow: 4px 4px 0px 0px #1E3A8A !important; 
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%; max-width: 350px;
}
.today-summary:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px 0px #1E3A8A !important;
}

/* ===== 오늘 일정 - 링(고리) 달린 탈력달력 스타일 ===== */
.today-summary.ring-calendar-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    transition: none;
    position: relative;
}
.today-summary.ring-calendar-card:hover {
    transform: none;
    box-shadow: none !important;
}

.ring-card-header {
    background: #819fff;
    border: 3px solid #1E3A8A;
    border-radius: 30px 30px 16px 16px;
    padding: 20px 24px 28px;
    box-shadow: 5px 5px 0px 0px #1E3A8A, inset 0 0 0 4px rgba(255, 255, 255, 0.75);
    position: relative;
    z-index: 2;
    transform: rotate(-0.7deg);
}
.ring-card-header h4 {
    margin: 0 !important;
    color: #ffffff !important;
}

/* 카드 상단 왼쪽의 작은 말림/포인트 장식 */
.ring-card-header::before {
    content: "";
    position: absolute;
    top: 14px;
    left: 18px;
    width: 14px;
    height: 14px;
    border-left: 2.5px solid rgba(255, 255, 255, 0.85);
    border-top: 2.5px solid rgba(255, 255, 255, 0.85);
    border-radius: 60% 0 0 0;
}
.ring-card-header::after {
    content: "";
    position: absolute;
    top: 12px;
    left: 38px;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 50%;
}

/* 두 카드를 이어주는 클립(링) 줄 */
.ring-clip-row {
    display: flex;
    justify-content: center;
    gap: 46px;
    margin: -20px 0 -16px;
    position: relative;
    z-index: 5;
    pointer-events: none;
}
.ring-clip {
    position: relative;
    width: 18px;
    height: 38px;
    transform: rotate(-0.7deg);
}
.ring-clip::before,
.ring-clip::after {
    content: "";
    position: absolute;
    top: 0;
    width: 7px;
    height: 100%;
    border-radius: 8px;
    background: #ffffff;
    border: 3px solid #1E3A8A;
}
.ring-clip::before { left: 0; }
.ring-clip::after { left: 11px; }

.ring-card-body {
    background: #ffffff;
    border: 3px solid #1E3A8A;
    border-radius: 16px 16px 30px 30px;
    padding: 26px 20px 20px;
    box-shadow: 5px 5px 0px 0px #1E3A8A;
    margin-top: 6px;
    position: relative;
    z-index: 1;
    transform: rotate(0.5deg);
}
.ring-card-body #summaryContent { margin-top: 0; }

.summary-dot { display: none !important; }
.summary-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    word-break: break-word;
    padding: 14px 16px !important;
    border-radius: 20px !important;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none !important;
}
.summary-item:has(.type-dot-휴방) { background-color: #94A3B8 !important; }

.summary-title { flex: 1; font-weight: 700; color: inherit !important; }
.summary-time { font-size: 12px; color: inherit !important; white-space: nowrap; font-weight: bold; opacity: 0.8; } 
.summary-item:has(.type-dot-휴방) .summary-title { color: #475569 !important; }
.summary-item:has(.type-dot-휴방) .summary-time { color: #94A3B8 !important; }
.summary-item:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }

.wave-container { width: 100%; height: 12px; margin: 10px 0; overflow: hidden; background: #F8F8F8; border-radius: 25px; }
.wave {
    width: 200%; height: 100%;
    background: linear-gradient(90deg, rgba(191, 219, 254, 0.4), rgba(191, 219, 254, 0.9), rgba(191, 219, 254, 0.4), rgba(191, 219, 254, 0.9), rgba(191, 219, 254, 0.4));
    background-size: 50% 100%; animation: wave-move 3s linear infinite;
}
@keyframes wave-move { 0% { transform: translateX(-50%); } 100% { transform: translateX(0%); } }

.player-controls { display: flex; justify-content: center; align-items: center; gap: 10px; }
#btnMin {
    width: 30px; height: 30px; background: #E5E7EB; color: #4B5563;
    border-radius: 50%; border: none; cursor: pointer; display: flex;
    align-items: center; justify-content: center; position: absolute; left: 0; bottom: 0;
}
#btnMin:hover { background: #D1D5DB; color: #374151; }
.ctrl-btn { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-dark); transition: 0.2s; display: flex; align-items: center; justify-content: center; }
.ctrl-btn:hover { transform: scale(1.1); color: #3B82F6; }
.play-btn { width: 48px; height: 48px; background: var(--point-blue); border-radius: 50%; font-size: 20px; color: #0F172A; box-shadow: 0 4px 10px rgba(0,0,0,0.1); display: flex; align-items: center; justify-content: center; line-height: 1; padding: 0; border: none; cursor: pointer; vertical-align: middle; font-weight: 700; }
.play-btn:hover { background: #93C5FD; }

#playPauseBtn { display: flex !important; align-items: center !important; justify-content: center !important; line-height: 1 !important; padding-top: 7px !important; padding-left: 2px !important; }
.track-info { font-weight: 800; text-align: center; font-size: 15px; color: var(--text-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 10px; }
.track-artist { font-size: 12px; color: #7a7a7a; text-align: center; margin-top: 4px; }

.container {
    width: 100% !important; max-width: 100% !important; margin: 0 auto !important; background: var(--white);
    padding: 45px; box-sizing: border-box; position: relative; display: flex; flex-direction: column;
}

.calendar-top { display: flex; justify-content: center; align-items: center; margin-bottom: 32px; width: 100%; }
.calendar-header { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; width: 100%; max-width: none; margin: 0 auto; }
.calendar-header-top { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; gap: 12px; }
.calendar-header-title { display: flex; align-items: center; justify-content: center; gap: 12px; flex: 1; }

#monthDisplay { font-family: 'SchoolSafetyRoundedSmile', sans-serif !important; font-weight: 700 !important; }

.memo-btn {
    display: flex; align-items: center; justify-content: center; border: none !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); background-color: #ffffff; color: var(--text-dark);
    transition: all 0.2s ease; cursor: pointer; font-weight: 800; font-family: 'Escoredream', sans-serif;
    padding: 6px 12px; border-radius: 12px; transform: translateY(-3px) !important;
}
.memo-btn:hover, .memo-btn.board-active { background-color: #DBEAFE !important; color: #2563EB !important; border: none !important; }

.calendar-body { display: flex; align-items: stretch; gap: 24px; width: 100%; }

.calendar-section .container {
    background: transparent !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* ===== 캘린더 - 오늘 일정 카드와 통일된 링(고리) 스타일 ===== */
.calendar-header-card {
    background: #819fff;
    border: 4px solid #1E3A8A;
    border-radius: 50px 50px 22px 22px;
    padding: 28px 45px 36px;
    box-shadow: 6px 6px 0px 0px #1E3A8A, inset 0 0 0 5px rgba(255, 255, 255, 0.75);
    position: relative;
    z-index: 2;
}
.calendar-header-card .calendar-top { margin-bottom: 0; }
.calendar-header-card #monthDisplay { color: #ffffff !important; transition: color 0.2s; }
.calendar-header-card #monthDisplay:hover { color: #38BDF8 !important; }

.calendar-header-card::before {
    content: "";
    position: absolute;
    top: 18px;
    left: 24px;
    width: 16px;
    height: 16px;
    border-left: 3px solid rgba(255, 255, 255, 0.85);
    border-top: 3px solid rgba(255, 255, 255, 0.85);
    border-radius: 60% 0 0 0;
}
.calendar-header-card::after {
    content: "";
    position: absolute;
    top: 15px;
    left: 47px;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 50%;
}

.calendar-ring-clip-row {
    justify-content: center;
    gap: 12vw;
    max-width: 480px;
    margin: -26px auto -20px;
}
.ring-clip.lg { width: 22px; height: 46px; }
.ring-clip.lg::before, .ring-clip.lg::after { width: 8px; border-width: 3.5px; }
.ring-clip.lg::after { left: 13px; }

.calendar-body-card {
    background: #ffffff;
    border: 4px solid #1E3A8A;
    border-radius: 22px 22px 50px 50px;
    padding: 38px 40px 32px;
    box-shadow: 6px 6px 0px 0px #1E3A8A;
    margin-top: 8px;
    position: relative;
    z-index: 1;
}

.calendar-main { 
    flex: 1; min-width: 0; width: 100%;
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important; 
    box-shadow: none !important; 
}

.memo-panel-container {
    display: none; width: 400px; flex-shrink: 0; border-radius: var(--radius-lg); background: #ffffff; border: none !important; box-shadow: 0 20px 45px rgba(0,0,0,0.08); padding: 22px; box-sizing: border-box; align-self: stretch; overflow: hidden; position: relative; padding-bottom: 90px;
}
.memo-panel-container.active { display: block !important; }
.memo-panel-container.open { display: flex; flex-direction: column; }
.memo-panel-header { display: flex; justify-content: flex-end !important; align-items: center; gap: 14px; margin-bottom: 18px; border-bottom: none !important; padding-bottom: 5px !important; }
.memo-board-title { display: block; width: 100%; flex: 1; margin-bottom: 12px; font-size: 20px; font-weight: 900; letter-spacing: 0.08em; color: #819fff; text-transform: uppercase; text-align: left; }
.memo-tabs { display: none !important; }
.memo-tab { background: #F5F5F5; border: none; border-radius: 999px; padding: 10px 16px; cursor: pointer; font-weight: 800; color: #4E4942; transition: background 0.2s, color 0.2s; font-family: 'Escoredream', sans-serif; }
.memo-tab.memo-tab-active { background: #B3E5FC; color: #0D47A1; }
.memo-tab-active { background: #0284C7 !important; color: white !important; border-color: #0284C7 !important; }

.memo-add-button { position: absolute; bottom: 18px; right: 20px; background: #819fff !important; color: #ffffff !important; border: none; border-radius: 50%; width: 50px; height: 50px; cursor: pointer; font-weight: 900; font-size: 24px; line-height: 1; transition: background 0.2s, color 0.2s; display: flex; align-items: center; justify-content: center; padding: 0; box-shadow: 0 8px 18px rgba(30, 64, 175, 0.2); }
.memo-add-button:hover { background: #1D4ED8 !important; }
.memo-add-icon { display: inline-block !important; transform: translateY(2px) !important; }

.panel-close-btn { position: absolute; top: 20px; right: 18px; width: 34px; height: 34px; border: none; border-radius: 50%; background: #F1F5F9; color: #819fff; font-size: 20px; font-weight: 900; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 2; transition: background 0.2s, color 0.2s; }
.panel-close-btn:hover { background: #819fff; color: #ffffff; }
.panel-close-icon { display: inline-block !important; transform: translateY(2px) !important; }

.memo-input-area { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; align-items: center; }
.memo-input-area.hidden { display: none; }
.memo-item-input { width: 100%; max-width: 100%; min-height: 100px; border: 2px solid #F5F5F5; border-radius: 18px; padding: 16px; resize: vertical; font-family: 'Escoredream', sans-serif; background: #FFFFFF; color: var(--text-dark); box-sizing: border-box; }
.memo-input-actions { display: flex; justify-content: flex-end; gap: 12px; width: 100%; }

.memo-list { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; max-height: calc(100% - 180px); padding-right: 4px; }
.memo-item-entry { background: #FFFFFF; border: 1px solid #F5F5F5; border-radius: 18px; padding: 16px; display: flex; align-items: center; gap: 10px; word-break: break-word; }
.memo-content-wrapper { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.memo-datetime { font-size: 12px; font-weight: 800; color: #94A3B8; background: #F9F9F9; padding: 4px 10px; border-radius: 12px; font-family: 'Escoredream', sans-serif !important; }
.memo-text-content { font-size: 16px; font-weight: 800; line-height: 1.5; color: var(--text-dark); white-space: pre-wrap; font-family: 'Escoredream', sans-serif !important; text-align: center; width: 100%; }
.memo-item-delete { background: transparent; border: none; color: #D32F2F; font-weight: 900; cursor: pointer; padding: 5px; flex-shrink: 0;}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-button { display: none !important; width: 0 !important; height: 0 !important; -webkit-appearance: none; }
::-webkit-scrollbar-track { background: #FFFFFF; border-radius: 999px; }
::-webkit-scrollbar-thumb { background: #93C5FD; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #60A5FA; }

* { scrollbar-color: #93C5FD #FFFFFF; scrollbar-width: thin; }

.admin-input { width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid #E5E7EB; background: #F8FAFC; font-size: 1rem; color: var(--text-dark); outline: none; font-family: 'Escoredream', sans-serif;}

.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0; width: 100%; }
.week-row { display: grid; grid-template-columns: 72px 1fr; gap: 16px; padding: 16px; border: 1px solid #F3F4F6; border-radius: var(--radius-md); align-items: center; background: #FFFFFF; transition: all 0.2s ease; }
.week-row:hover { border-color: var(--point-blue); background: #F8FAFC; }
.week-day-label { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.week-day-name { font-weight: normal; font-size: 13px; color: #819fff; margin-bottom: 2px; font-family: 'SchoolSafetyRoundedSmile', sans-serif; }
.week-day-num { font-size: 20px; font-weight: 900; color: var(--text-dark); }
.event-container { 
    display: flex !important; 
    flex-direction: column !important; 
    flex: 1 !important; 
    min-height: 0 !important; /* 🔥 핵심 추가: 컨테이너가 줄어들 수 있게 하여 스크롤을 유도합니다 */
    overflow-y: auto !important; 
    gap: 4px; 
    padding: 4px; 
    padding-bottom: 5px; 
}

/* 스크롤바 디자인 (이전과 동일) */
.event-container::-webkit-scrollbar { 
    width: 5px; 
}
.event-container::-webkit-scrollbar-thumb { 
    background: #BAE6FD; 
    border-radius: 10px; 
}
.event-container::-webkit-scrollbar-track { 
    background: transparent; 
}
.week-events { display: flex !important; flex-direction: column !important; gap: 4px; }
.week-no-event { color: #A1A1AA; font-size: 13px; font-weight: 700; padding: 10px 14px; background: #FAFAFA; border-radius: 12px; border: 1.5px dashed #E4E4E7; }

.day-label {
    font-family: 'SchoolSafetyRoundedSmile', sans-serif;
    font-weight: normal;
    font-size: 16px;
    color: #1E3A8A;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: 0 auto 12px;
    border-radius: 999px;
    background: var(--light-blue);
    box-shadow: 2px 2px 0px 0px rgba(30, 58, 138, 0.18);
}
.day-label.text-blue-400 { background: #DBEAFE !important; color: #2563EB !important; }
.day-label.text-red-400 { background: #FEE2E2 !important; color: #EF4444 !important; }

.day { 
    min-height: 200px; 
    height: 200px; /* auto에서 200px로 변경하여 칸 높이를 완전히 고정 */
    overflow: hidden; /* visible에서 hidden으로 변경하여 날짜 칸 자체가 커지는 것 방지 */
    display: flex; 
    flex-direction: column; 
    background: #ffffff; 
    border: 1px dashed #94A3B8; 
    border-radius: 24px;
    transition: 0.2s; 
    width: 100%; 
    box-sizing: border-box;
}
.day:hover { background: #F8FAFC; border-color: var(--point-blue); transform: translateY(-2px); z-index: 10; }
.day.not-current { pointer-events: none; border-color: #E5E7EB; box-shadow: none; background: #FAFAFA; transform: none; }
.day-num { padding: 10px 15px; font-weight: 800; font-size: var(--font-date); position: relative; z-index: 5; background: transparent; height: 45px; display: flex; align-items: center; box-sizing: border-box; }

.calendar-grid .day::-webkit-scrollbar { width: 4px; }
.calendar-grid .day::-webkit-scrollbar-thumb { background: #BAE6FD; border-radius: 10px; }

/* 일정 카드 호버 스케일링 효과 */
/* 일정 카드 호버 스케일링 효과 */
.event-tag {
    position: relative; width: 100%; 
    height: auto; 
    flex: 1 1 auto; /* <- 이 줄을 추가해 주세요! (남는 공간을 자연스럽게 채움) */
    flex-shrink: 0 !important; /* 🔥 핵심 변경: 일정이 많아져도 높이가 찌그러지지 않고 모양을 유지하게 합니다 (기존 flex: 1 1 auto; 대체) */
    min-height: 45px; padding: 6px 8px;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    box-sizing: border-box; 
    overflow: visible; 
    text-align: center; transition: 0.2s;
    border-radius: 20px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); gap: 4px;
    border: 2px solid rgba(255, 255, 255, 0.7);
    font-family: 'Escoredream', sans-serif !important; font-weight: 700; font-size: 15px; line-height: 1.3;
    cursor: pointer;
}
.event-tag:hover { 
    transform: scale(0.98); 
}

.event-time-badge {
    /* position과 top, left 속성 제거 */
    display: inline-block; 
    align-self: flex-start; /* 뱃지를 박스 좌측 상단으로 정렬 */
    margin-bottom: -15px; /* 제목과 겹치지 않도록 하단 여백 추가 */
    flex-shrink: 0; /* 칸이 좁아져도 시간 뱃지가 찌그러지지 않도록 보호 */
    background-color: #FFFFFF; padding: 3px 8px; font-size: 10px;
    border-radius: 999px;
    font-weight: 800; line-height: 1; color: inherit; font-family: 'Escoredream', sans-serif !important;
    transform: translate(-4px, -3px);
}

.event-tag div { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; width: 100%; text-align: center; }
.dragging-ghost { background-color: #BFDBFE !important; opacity: 0.4; border: 2px dashed #3B82F6; }
.event-tag.long-term { font-size: 14px !important; padding: 4px; white-space: nowrap; }

/* 이벤트 유형별 색상 */
.type-휴방 { background-color: #c1cfe2 !important; color: #2d3136 !important; }
.type-개인방송 { background-color: #BFDBFE !important; color: #1E3A8A !important; border: none !important; }
.type-합방 { background-color: #FFF9C4; color: #B45309; }
.type-시네티 { background-color: #DCEDC8; color: #33691E; }
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(8px); align-items: center; justify-content: center; z-index: 2000; }
.modal-content {
    background: var(--white); width: 90%; max-width: 480px; padding: 30px;
    border-radius: var(--radius-xl); box-shadow: 0 30px 60px rgba(0,0,0,0.2);
    position: relative; display: flex; flex-direction: column; height: auto; max-height: 95vh;
}
.event-modal-box { max-width: 850px; width: 95%; }
#eventModal .modal-content { max-width: 850px; width: 95%; }
.modal-content, .event-modal-box { border: 2px solid #93C5FD !important; }
.modal-title { font-size: 24px; font-weight: 900; margin-bottom: 25px; font-family: 'Escoredream', sans-serif;}

#eventModal .modal-content { padding: 0; overflow: hidden; }
#eventModal .modal-header { padding: 30px 30px 15px 30px; flex-shrink: 0; border-bottom: 1px solid #F5F5F5; }
#eventModal .modal-header .modal-title { margin-bottom: 0; }
#eventModal .modal-body { padding: 20px 30px; overflow-y: auto; flex: 1; min-height: 0; }
#eventModal .modal-footer { padding: 15px 30px 30px 30px; flex-shrink: 0; margin-top: 0; border-top: 1px solid #F5F5F5; background: var(--white); }

.form-group { margin-bottom: 24px; }
.form-group label { display: block; font-size: var(--font-modal-label); font-weight: 800; color: #94A3B8; margin-bottom: 10px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 15px; border-radius: var(--radius-md); border: 2px solid #F5F5F5; background: #F9F9F9; font-family: 'Escoredream', sans-serif; outline: none; box-sizing: border-box; }

.ampm-toggle { display: flex; gap: 8px; align-items: center; }
.ampm-btn { flex: 0 1 auto; min-width: 92px; width: auto; padding: 12px; border-radius: 12px; border: 2px solid #F0F0EE; background: #F9F9F9; font-weight: 800; cursor: pointer; transition: 0.2s; font-family: 'Escoredream', sans-serif; white-space: nowrap; }
.ampm-btn.active { background-color: #bae6fd; border-color: #38bdf8; color: #0369a1; }

.btn-group { display: flex; gap: 12px; margin-top: 35px; flex-wrap: wrap; }
.btn { flex: 1; padding: 16px; border: none; border-radius: var(--radius-md); font-weight: 900; cursor: pointer; transition: 0.2s; text-align: center; font-family: 'Escoredream', sans-serif;}
.btn-save { background: #819fff !important; color: #ffffff !important; box-shadow: 0 4px 10px rgba(30, 64, 175, 0.3) !important; }
.btn-save:hover { background: #1E3A8A !important; }
#eventModal button[onclick="saveEvent()"] { color: #ffffff !important; }
.btn-cancel { background: #F0F0EE; color: #757575; }
.btn-danger { background: #fee2e2; color: #dc2626; }

#infoModal .modal-content { max-width: 720px; width: 90%; padding: 40px; display: flex; flex-direction: column; max-height: 90vh; overflow: hidden; }
#infoModal .info-title { font-size: 32px; font-weight: 900; margin-bottom: 12px; text-align: center; flex-shrink: 0; }
#infoModal .info-block { flex: 1; overflow-y: auto; display: flex; flex-direction: column; align-items: center; min-height: 0; padding: 10px 0; }
#infoModal .time-badge { background: #E1F5FE; color: #0288D1; border: 2px solid #B3E5FC; font-size: 15px; font-weight: normal; padding: 8px 15px; border-radius: 30px; margin-bottom: 16px; flex-shrink: 0; text-align: center; word-break: keep-all; font-family: 'Escoredream', sans-serif;}
#infoModal .info-image-container { width: 100%; display: flex; justify-content: center; flex-shrink: 0; overflow: hidden; }
#infoModal .info-image { width: 100%; max-width: 100%; height: auto; object-fit: contain; border-radius: 24px; border: 1px solid #F5F5F5; }
#infoModal .btn { font-size: 18px; padding: 18px; border-radius: 25px; flex-shrink: 0; margin-top: 15px; }

.member-list-item { 
    position: relative; /* 이 줄이 추가되어야 합니다 */
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    gap: 10px; 
    padding: 16px 10px; 
    background: #F8FAFC; 
    border: 1px solid #E2E8F0;
    border-radius: 25px; 
}
.member-img-preview { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; background: #EEE; }

#infoModal .profile-list { display: grid; grid-template-columns: repeat(6, auto); gap: 15px; margin-top: 20px; justify-content: center; }
#infoModal .profile-card { display: flex; flex-direction: column; align-items: center; width: 80px; gap: 8px; }
#infoModal .profile-img { width: 70px; height: 70px; border-radius: 50%; object-fit: cover; border: 2px solid var(--point-blue); background: #F0F0F0; }
#infoModal .profile-name { font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; text-align: center; }
.profile-img { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; border: 2px solid var(--point-blue); background: #F0F0F0; }
.profile-name { font-size: 11px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; text-align: center; }

.admin-only-btn { display: none !important; }
.admin-only-btn.admin-visible { display: flex !important; }
.admin-active svg { fill: var(--admin-color) !important; }
#adminProfilePic { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

.nav-btn {
    background: transparent;
    border: none;
    width: 46px; height: 46px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: 0.2s;
    flex-shrink: 0;
    font-family: 'Escoredream', sans-serif;
    font-size: 18px;
    color: #ffffff;
}
.nav-btn:hover { transform: translateY(-2px); opacity: 1; color: #38BDF8; }
.nav-btn:active { transform: translateY(0); }

.today-circle { background: #819fff !important; color: white !important; border: 2px solid #ffffff; border-radius: 50%; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 16px; margin-left: 0 !important; box-shadow: 0 0 0 2px #1E3A8A; }
#toastMessage { display: none; position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.8); color: white; padding: 12px 25px; border-radius: 30px; z-index: 9999; font-weight: 700; font-size: 14px; font-family: 'Escoredream', sans-serif;}

.pw-modal { width: 320px; }
.admin-pw { width: 100%; padding: 16px; border-radius: 2rem; border: 2px solid #E5E7EB; margin-bottom: 12px; font-family: 'Escoredream', sans-serif;}
.pw-error { color: #ef4444; font-size: 12px; text-align: center; margin-bottom: 12px; }
.hidden { display: none; }

.member-list { 
    max-height: 350px; 
    overflow-y: auto; 
    overflow-x: hidden; /* 🔥 가로 스크롤이 생기지 않도록 강제로 숨김 */
    margin-bottom: 20px;
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)); 
    gap: 12px;
    padding-right: 4px;
}
.info-block { background: transparent; padding: 10px 20px; border-radius: 15px; display: flex; flex-direction: column; align-items: center; }
.month-btn { padding: 15px 0; border-radius: 12px; border: 2px solid #F5F5F5; background: #F9F9F9; font-weight: 800; cursor: pointer; transition: 0.2s; text-align: center; font-family: 'Escoredream', sans-serif;}
.month-btn:hover, .month-btn.active { background: var(--point-blue); border-color: var(--point-blue); color: #0F172A; }

.loading-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: var(--bg-base); z-index: 999999;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: opacity 0.5s ease-out;
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; }
.mobile-nav-arrow { display: none; }

.cute-loading-text {
    font-family: 'RixInuaridurine', sans-serif;
    font-size: 38px;
    font-weight: normal; 
    letter-spacing: 6px;
    display: flex; gap: 4px;
    color: #81D4FA;
}

.cute-loading-text span { 
    display: inline-block; 
    animation: freeze-shatter 2.5s infinite; 
    transform-origin: center center;
    color: #0284C7 !important;
}
.cute-loading-text span:nth-child(1) { --x: -30px; --y: 40px; --r: -45deg; }
.cute-loading-text span:nth-child(2) { --x: -15px; --y: -20px; --r: 25deg; }
.cute-loading-text span:nth-child(3) { --x: 10px; --y: 35px; --r: -15deg; }
.cute-loading-text span:nth-child(4) { --x: 20px; --y: -30px; --r: 45deg; }
.cute-loading-text span:nth-child(5) { --x: -5px; --y: 50px; --r: -60deg; }
.cute-loading-text span:nth-child(6) { --x: 30px; --y: 20px; --r: 30deg; }
.cute-loading-text span:nth-child(7) { --x: 40px; --y: -10px; --r: 60deg; }

@keyframes freeze-shatter { 
    0%, 15% { 
        transform: translate(0, 0) rotate(0); 
        color: #81D4FA !important; 
        text-shadow: none; 
        opacity: 1; 
    } 
    35%, 48% { 
        transform: scale(0.98); 
        color: #FFFFFF !important; 
        text-shadow: 0 0 10px #E0F2FE, 0 0 20px #7DD3FC, 0 0 30px #0284C7; 
        opacity: 1; 
    } 
    49% { transform: translate(2px, -2px) scale(0.98); color: #FFFFFF !important; text-shadow: 0 0 20px #7DD3FC; opacity: 1; }
    51% { transform: translate(-2px, 2px) scale(0.98); color: #FFFFFF !important; text-shadow: 0 0 20px #7DD3FC; opacity: 1; }
    53% { transform: translate(2px, 2px) scale(0.98); color: #FFFFFF !important; text-shadow: 0 0 20px #7DD3FC; opacity: 1; }
    60%, 100% { 
        transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(0.7); 
        color: #E0F2FE !important;
        text-shadow: none;
        opacity: 0; 
    } 
}
.notice-preview { margin-top: 20px; padding: 0; background: transparent; border: none; width: 100%; text-align: left; box-sizing: border-box; box-shadow: none; }
.premium-notice-card { display: flex; flex-direction: column; width: 100%; height: auto; box-sizing: border-box; overflow-wrap: break-word; word-break: break-all; background-color: #EFF6FF; padding: 16px; border-radius: 12px; text-decoration: none; }
.premium-notice-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.premium-notice-badge { background-color: #FFFFFF; color: #3B82F6; border: 1.5px solid #3B82F6; font-size: 12px; font-weight: 900; padding: 4px 10px; border-radius: 999px; }
.premium-notice-date { font-size: 12px; font-weight: 900; color: #7B8BA3; font-family: 'Escoredream', sans-serif;}
.premium-notice-title { height: auto; flex-shrink: 0; color: #1E3A8A; font-size: 18px; font-weight: 900; line-height: 1.4; margin: 0 0 12px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: keep-all; font-family: 'Escoredream', sans-serif;}
.premium-notice-desc { white-space: normal; overflow: visible; margin-top: 8px; line-height: 1.5; color: #1E3A8A; font-size: 14px; font-family: 'Escoredream', sans-serif;}
#infoNoticePreview { width: 100%; box-sizing: border-box; }

.up-item-card { background: white; border: 2px solid #bae6fd; border-radius: 12px; padding: 16px; margin-bottom: 12px; position: relative; }
.up-title { font-weight: 800; color: #0284c7; font-size: 16px; font-family: 'Escoredream', sans-serif;}
.up-time { position: absolute; top: 12px; right: 12px; background: #E1F5FE; color: #0288D1; border: 2px solid #B3E5FC; font-size: 10px; font-weight: 800; padding: 4px 10px; border-radius: 30px; font-family: 'Escoredream', sans-serif;}
.up-desc { margin-top: 8px; color: #1E3A8A; font-size: 14px; font-family: 'Escoredream', sans-serif;} 

/* 인포 모달 시간 뱃지 색상 통일 */
#infoTime.type-휴방 { background-color: #c1cfe2 !important; color: #2d3136 !important; border: none !important; }
#infoTime.type-개인방송 { background-color: #BFDBFE !important; color: #1E3A8A !important; border: none !important; }
#infoTime.type-합방 { background-color: #ffef5e !important; color: #B45309 !important; border: none !important; }
#infoTime.type-시네티 { background-color: var(--color-tbd) !important; color: #4A148C !important; border: none !important; }

/* 일정 추가 모달 전용 반응형 & 꾸미기 스타일 (파란색 버전) */
.event-modal-box { background: #ffffff; padding: 32px 40px; border-radius: 20px; max-width: 850px; width: 95%; max-height: 90vh; overflow-y: auto; box-shadow: 0 10px 30px rgba(30, 64, 175, 0.15); }
.event-modal-box h2 { font-family: 'OngleipKonkon', sans-serif !important; }
.event-modal-grid { display: flex; flex-direction: column; gap: 24px; }
.event-modal-left, .event-modal-right { display: flex; flex-direction: column; gap: 18px; }
.event-custom-input { width: 100%; padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 10px; font-size: 14px; background-color: #f8fafc; transition: all 0.2s; }
.event-custom-input:focus { outline: none; border-color: #819fff; background-color: #ffffff; box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.2); }

@media(min-width: 900px) {
    .event-modal-grid { flex-direction: row; align-items: flex-start; justify-content: space-between; }
    .event-modal-left, .event-modal-right { width: 48%; }
    .event-modal-right { max-width: 420px; }
}

@media(min-width: 768px) {
    .memo-panel-container.open {
        animation: slideFromSidebar 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
    }
}

@keyframes slideFromSidebar {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

/* =========================================
   가로 레이아웃 (좌: 캘린더 / 우: 사이드바)
========================================= */
.layout-container {
    max-width: 1600px !important;
    width: 96% !important;
    margin: 20px auto;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    height: 100%;
}

.layout-container::before { content: ""; width: 60px !important; display: block; }

.calendar-section { flex: 1; min-width: 0; transition: all 0.3s ease; display: flex; flex-direction: column; gap: 24px; width: 100%; align-items: center; }
.calendar-section .container { width: 100% !important; max-width: 100% !important; margin: 0 auto !important; }

.right-sidebar {
    width: 75px !important; 
    padding: 22px 8px !important; 
    gap: 14px !important; 
    position: fixed !important;
    top: 50% !important;
    right: 20px !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    background-color: #819fff !important;
    border: 4px solid #1E3A8A !important;
    border-radius: 34px !important;
    box-shadow: 5px 5px 0px 0px #1E3A8A, inset 0 0 0 4px rgba(255, 255, 255, 0.55) !important;
    z-index: 9999 !important;
    flex-shrink: 0;
}
.right-sidebar::before {
    content: "";
    position: absolute;
    top: 14px;
    left: 16px;
    width: 12px;
    height: 12px;
    border-left: 2.5px solid rgba(255, 255, 255, 0.75);
    border-top: 2.5px solid rgba(255, 255, 255, 0.75);
    border-radius: 60% 0 0 0;
}

.right-sidebar .sidebar-title { font-size: 1.1rem; font-weight: 900; color: var(--text-dark); margin-bottom: 18px; }

.sidebar-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%;
    padding: 8px 0 !important; border: none; border-radius: 18px; background: transparent; cursor: pointer; text-decoration: none;
    color: #1E3A8A !important; font-family: 'Cafe24SurroundAir', sans-serif; transition: all 0.2s ease-in-out;
}
.sidebar-btn:hover, .sidebar-btn.active, .sidebar-btn.admin-active {
    background-color: transparent !important;
    color: #ffffff !important;
    transform: translateY(-2px);
}
.sidebar-btn svg, .sidebar-btn svg * { fill: none !important; stroke: #1E3A8A !important; }
.sidebar-btn:hover svg, .sidebar-btn:hover svg *, .sidebar-btn.active svg, .sidebar-btn.active svg *, .sidebar-btn.admin-active svg, .sidebar-btn.admin-active svg * {
    fill: none !important; stroke: #ffffff !important;
}
.sidebar-btn.member-btn svg, .sidebar-btn.member-btn svg *, .sidebar-btn.admin-btn svg, .sidebar-btn.admin-btn svg * {
    fill: #1E3A8A !important; stroke: none !important; 
}
.sidebar-btn.member-btn:hover svg, .sidebar-btn.member-btn:hover svg *, .sidebar-btn.member-btn.active svg, .sidebar-btn.member-btn.active svg *, .sidebar-btn.admin-btn:hover svg, .sidebar-btn.admin-btn:hover svg *, .sidebar-btn.admin-active svg, .sidebar-btn.admin-active svg * {
    fill: #ffffff !important; stroke: none !important; 
}
.sidebar-btn.admin-active { border: none !important; box-shadow: none !important; }

.sidebar-divider { width: 70% !important; border: none; border-top: 2px solid rgba(255, 255, 255, 0.6) !important; margin: 4px auto !important; }

.sidebar-btn svg { width: 24px !important; height: 24px !important; margin-bottom: 6px !important; }
.sidebar-btn img { width: 28px !important; height: 28px !important; border-radius: 8px !important; margin-bottom: 6px !important; }
.sidebar-btn span { font-size: 12px !important; letter-spacing: -0.5px; font-weight: 900 !important; }

@media screen and (max-width: 1024px) {
    .main-header { display: grid; grid-template-columns: 1fr; gap: 20px; padding: 40px 45px 20px; align-items: center; }
    .header-left, .header-right { justify-content: center; width: 100%; padding: 0; }
    .header-right { margin-left: 0; align-items: center; position: static; justify-self: center; }
    .header-center { grid-column: 1; justify-self: center; }
    .calendar-top { flex-direction: column; }
    .calendar-body { flex-direction: column; }
    .today-summary { width: 100%; max-width: 400px; }
    .main-layout-wrapper { grid-template-columns: 1fr; }
}

/* ========================================================
   모바일 전용 레이아웃 최적화 (여백 제거, 꽉 차게, 하단바 등)
========================================================= */
@media screen and (max-width: 768px) {
    .mobile-menu-container { display: none !important; }

    .layout-container { 
        width: 100% !important; 
        max-width: 100% !important; 
        margin: 0 !important; 
        padding: 0 !important; 
        flex-direction: column; 
    }
    
    .layout-container::before { display: none !important; }
    .sidebar-placeholder { display: none !important; }
    
    .calendar-section { width: 100%; display: flex; flex-direction: column; align-items: center; margin: 0 !important; }
    
    .calendar-section .container { 
        width: 95% !important; 
        padding: 0 !important; 
        border-radius: 0 !important; 
        box-shadow: none !important; 
        border: none !important; 
        margin: 0 auto !important;
    }
    .calendar-header-card {
        border-radius: 32px 32px 16px 16px;
        border-width: 3px;
        padding: 18px 20px 26px;
        box-shadow: 4px 4px 0px 0px #1E3A8A, inset 0 0 0 4px rgba(255, 255, 255, 0.75);
    }
    .calendar-body-card {
        border-radius: 16px 16px 32px 32px;
        border-width: 3px;
        padding: 20px 14px 18px;
        box-shadow: 4px 4px 0px 0px #1E3A8A;
        margin-top: 6px;
    }
    .calendar-ring-clip-row { gap: 18vw; margin: -20px auto -16px; }
    .ring-clip.lg { width: 16px; height: 32px; }
    .ring-clip.lg::before, .ring-clip.lg::after { width: 6px; border-width: 3px; }
    .ring-clip.lg::after { left: 10px; }
    .calendar-main { 
        border: none !important; 
        box-shadow: none !important; 
        padding: 0 !important; 
        background-color: transparent !important; 
        width: 100%;
    }

    .top-grid-wrapper { display: flex !important; flex-direction: column !important; gap: 20px !important; width: 100%; align-items: center; padding: 20px 0 0 0; }
    .logo-wrapper { order: 1; margin-bottom: 5px; text-align: center; }
    .today-panel-wrapper { order: 2; width: 100%; display: flex; justify-content: center; padding: 0 15px; box-sizing: border-box; }
    .today-panel-wrapper .today-summary { margin: 0 auto; width: 100%; max-width: 100%; }
    .empty-placeholder { display: none; }

    .layout-container + .layout-container { margin-top: 12px !important; }

    .calendar-grid { 
        display: flex !important; 
        flex-direction: column !important; 
        gap: 0 !important; 
        width: 100% !important;
    }
    .day-label { 
        display: none !important; 
    }
    .day { 
        width: 100% !important;
        min-height: 80px !important; 
        aspect-ratio: auto !important; 
        height: auto !important;       
        overflow: visible !important; 
        border-radius: 22px; 
        border: 2px dotted #94A3B8; 
        box-shadow: 3px 3px 0px 0px rgba(30, 58, 138, 0.25);
        display: flex !important; 
        flex-direction: row !important; 
        align-items: flex-start !important; 
        padding: 12px 14px !important; 
        background: #ffffff;
    }
    .day-num { 
        font-size: 16px !important; 
        height: auto !important; 
        padding: 0 !important; 
        justify-content: flex-start !important; 
        display: flex !important; 
        flex-direction: column !important; 
        align-items: center !important; 
        width: 40px !important; 
        margin-right: 12px !important; 
        margin-top: 2px !important;
        flex-shrink: 0; 
    }
    .today-circle { 
        width: 30px !important; 
        height: 30px !important; 
        font-size: 15px !important; 
        margin: 0 !important; 
    }
    
    .day:nth-child(1) .day-num::before { content: "월"; display: block; font-size: 12px; color: #1E3A8A; font-weight: normal; margin-bottom: 2px; font-family: 'SchoolSafetyRoundedSmile', sans-serif; }
    .day:nth-child(2) .day-num::before { content: "화"; display: block; font-size: 12px; color: #1E3A8A; font-weight: normal; margin-bottom: 2px; font-family: 'SchoolSafetyRoundedSmile', sans-serif; }
    .day:nth-child(3) .day-num::before { content: "수"; display: block; font-size: 12px; color: #1E3A8A; font-weight: normal; margin-bottom: 2px; font-family: 'SchoolSafetyRoundedSmile', sans-serif; }
    .day:nth-child(4) .day-num::before { content: "목"; display: block; font-size: 12px; color: #1E3A8A; font-weight: normal; margin-bottom: 2px; font-family: 'SchoolSafetyRoundedSmile', sans-serif; }
    .day:nth-child(5) .day-num::before { content: "금"; display: block; font-size: 12px; color: #1E3A8A; font-weight: normal; margin-bottom: 2px; font-family: 'SchoolSafetyRoundedSmile', sans-serif; }
    .day:nth-child(6) .day-num::before { content: "토"; display: block; font-size: 12px; color: #3B82F6; font-weight: normal; margin-bottom: 2px; font-family: 'SchoolSafetyRoundedSmile', sans-serif; }
    .day:nth-child(7) .day-num::before { content: "일"; display: block; font-size: 12px; color: #EF4444; font-weight: normal; margin-bottom: 2px; font-family: 'SchoolSafetyRoundedSmile', sans-serif; }

    .event-container { 
        flex: 1; 
        min-width: 0 !important;
        display: flex !important; 
        flex-direction: column !important; 
        gap: 8px !important; 
        padding: 0 !important;
        height: auto !important; 
        overflow: visible !important; 
    }
    
    .event-tag { 
        font-size: 14px !important; 
        min-height: auto !important; 
        height: auto !important; 
        padding: 10px 12px !important; 
        flex-direction: row !important; 
        align-items: center !important;
        justify-content: space-between !important;
        text-align: left !important;
        white-space: normal !important; 
        word-break: break-word !important; 
        border-radius: 16px !important;
        box-shadow: 0 2px 6px rgba(0,0,0,0.04) !important;
        overflow: visible !important; 
    }
    .event-tag:hover {
        transform: scale(0.98) !important;
    }

    .event-tag div { 
        order: 1 !important; 
        flex: 1; 
        min-width: 0 !important;
        text-align: left !important; 
        width: auto !important;
        display: block !important;
        -webkit-line-clamp: unset !important; 
        overflow: visible !important;
        white-space: normal !important;
        word-break: break-word !important;
    }
    
    .event-time-badge { 
        order: 2 !important; 
        font-size: 11px !important; 
        position: static !important; 
        display: inline-block !important; 
        margin: 0 0 0 10px !important; 
        flex-shrink: 0 !important; 
        border: none !important; 
        padding: 4px 8px !important; 
        background: rgba(255, 255, 255, 0.9) !important;
        border-radius: 6px !important;
        top: auto !important; left: auto !important;
    }

    .calendar-header { flex-direction: column; align-items: center; gap: 16px; }
    .calendar-header-top { flex-direction: column; align-items: center; width: 100%; }
    .calendar-header-title { width: 100%; justify-content: center; }
    .calendar-header h2 { font-size: 1.25rem !important; line-height: 1.75rem !important; text-align: center; min-width: 170px !important; }
    .calendar-body { display: flex; align-items: flex-start; gap: 16px; width: 100%; flex-direction: column; }
    .mobile-nav-arrow {
        display: flex; position: fixed; top: 50%; transform: translateY(-50%);
        width: 44px; height: 44px; background: rgba(255, 255, 255, 0.8);
        border: 2px solid #60A5FA; border-radius: 50%; align-items: center; justify-content: center;
        z-index: 100; color: #1E3A8A; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); cursor: pointer;
        opacity: 0.3; transition: all 0.2s ease;
    }
    .mobile-nav-arrow:active { opacity: 0.8; background: #DBEAFE; transform: translateY(-50%) scale(0.9); }
    .mobile-nav-arrow svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
    .mobile-nav-arrow.left-arrow { left: 8px; }
    .mobile-nav-arrow.right-arrow { right: 8px; }

    /* 우측 사이드바 -> 하단 고정 네비게이션 바로 전환 */
    .right-sidebar { 
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-around !important;
        align-items: center !important;
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 75px !important;
        padding: 0 5px !important;
        margin: 0 !important;
        background-color: #ffffff !important;
        border: none !important;
        border-top: 4px solid #1E3A8A !important;
        border-radius: 32px 32px 0 0 !important;
        box-shadow: 0 -4px 20px rgba(30, 58, 138, 0.1) !important;
        transform: none !important;
        gap: 2px !important;
        z-index: 9999 !important;
    }
    
    .right-sidebar::before { display: none !important; }

    .sidebar-btn {
        flex: 1 !important;
        height: 100% !important;
        padding: 5px 0 !important;
        border-radius: 12px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
    }
    .sidebar-btn.admin-only-btn { display: none !important; }
    .sidebar-btn.admin-only-btn.admin-visible { display: flex !important; }
    
    .sidebar-btn svg { width: 22px !important; height: 22px !important; margin-bottom: 4px !important; }
    .sidebar-btn img { width: 22px !important; height: 22px !important; border-radius: 6px !important; margin-bottom: 4px !important; }
    .sidebar-btn span { font-size: 10px !important; white-space: nowrap; transform: scale(0.9); }
    
    .sidebar-divider { display: none !important; }
    
    body { padding-bottom: 100px !important; } 
    
    /* 바텀 시트 (메모/UP 모달)를 하단에서 올라오도록 설정 */
    .memo-panel-container {
        display: flex !important; flex-direction: column !important; position: fixed !important;
        bottom: -120% !important; left: 0 !important; right: 0 !important; top: auto !important;
        width: 100% !important; margin: 0 !important; border-radius: 28px 28px 0 0 !important;
        z-index: 10000 !important; box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2) !important;
        transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important; background: var(--white) !important;
        padding: 50px 24px 40px 24px !important; border: none !important; height: 75vh !important; max-height: none !important;
    }
    
    .memo-panel-container.active { bottom: 75px !important; }

    .memo-panel-container.open { width: 100%; padding-left: 0; }
    .memo-panel-header { flex-direction: column; align-items: stretch; gap: 12px; }
    .memo-tabs { width: 100%; display: flex; justify-content: center; overflow-x: auto; padding: 0 12px 8px; margin: 0 -12px 10px -12px; }
    .memo-tab { flex: 0 0 auto; min-width: auto; padding: 10px 14px; margin-right: 8px; }
    .memo-tab:last-child { margin-right: 0; }
    .memo-add-button { align-self: flex-end; }
    .memo-input-area { gap: 14px; align-items: center; margin-left: 8px; }
    .memo-item-input { min-height: 120px; padding: 16px; width: 100%; max-width: 100%; }
    .memo-list { max-height: none !important; padding: 0 4px 0 0; flex: 1 !important; overflow-y: auto !important; }
    .memo-item-entry { padding: 14px; width: 100%; flex-direction: column; align-items: stretch; }
    .memo-content-wrapper { align-items: stretch; }
    .memo-text-content { text-align: center; }
    .memo-item-delete { align-self: flex-end; }
    .memo-input-actions { flex-wrap: wrap; justify-content: space-between; gap: 10px; width: 100%; }
    .memo-input-actions .btn { flex: 1; min-width: 140px; }
    
    .main-header { display: flex; flex-direction: column; grid-template-columns: none; width: 100%; padding: 20px 16px 20px; gap: 16px; }
    .header-center { width: 100%; padding: 0; }
    .header-left, .header-right { padding: 0; width: 100%; justify-content: center; }
    .fixed-top-bar { padding: 0 16px; justify-content: flex-end; }
    .top-bar-inner { width: 100%; justify-content: flex-end; }
    .top-bar-left { display: none; }
    .top-admin-actions { border-left: none; }
    .calendar-header-top .memo-btn { display: none !important; }
}

/* =========================================================
   위키 컨테이너 (캘린더와 동일한 디자인) 및 토글 애니메이션
   ========================================================= */
.wiki-container {
    border: 2px solid #1E3A8A !important;
    box-shadow: 4px 4px 0px 0px #1E3A8A !important; 
    border-radius: 25px !important;
    background: #ffffff;
    display: flex !important;
    flex-direction: row;
    padding: 0 !important;
    overflow: hidden;
    min-height: 700px;
    position: relative;
    width: 100%;
    margin: 0 auto !important;
}

.wiki-sidebar {
    width: 250px;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
    z-index: 15;
}

.wiki-sidebar-inner {
    width: 250px; 
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    /* 모든 요소 강제 우측 정렬 */
    text-align: right;
    align-items: flex-end;
}

/* 목차 타이틀 우측 정렬 */
.wiki-sidebar-inner h4 {
    width: 100%;
    text-align: right;
}

/* 목차 리스트 우측 정렬 */
#wikiTocList {
    width: 100%;
}

#wikiTocList li {
    width: 100%;
}

#wikiTocList a {
    text-align: right !important;
}

/* 목차 추가 영역 100% 꽉 채우기 */
#wikiTocInputArea {
    width: 100%;
}

.wiki-sidebar.collapsed {
    width: 0;
    border-right: none;
}

.wiki-content-area {
    flex: 1;
    padding: 40px 40px 40px 70px;
    overflow-y: auto;
    scroll-behavior: smooth;
    min-width: 0;
    position: relative;
}

.wiki-toc-toggle-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #F1F5F9;
    border: 2px solid #E2E8F0;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #1E3A8A;
    z-index: 20;
    transition: all 0.2s;
}
.wiki-toc-toggle-btn:hover {
    background: #DBEAFE;
    border-color: #93C5FD;
}

@media screen and (max-width: 768px) {
    .wiki-container {
        flex-direction: column;
        min-height: 80vh;
        width: 95% !important; /* 모바일에서 캘린더와 동일하게 95% 채움 */
    }
    .wiki-sidebar {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        background: rgba(248, 250, 252, 0.98);
        backdrop-filter: blur(10px);
        box-shadow: 4px 0 15px rgba(0,0,0,0.1);
        transform: translateX(0);
        width: 250px;
    }
    .wiki-sidebar.collapsed {
        transform: translateX(-100%);
        width: 250px; 
    }
    .wiki-content-area {
        padding: 70px 20px 20px 20px;
    }
    .wiki-toc-toggle-btn {
        top: 15px;
        left: 15px;
    }
    .wiki-edit-btn-wrapper {
        top: 15px !important;
        right: 15px !important;
    }
}