* {
    box-sizing: border-box;
}

:root {
    --background: #f6f3fb;
    --background-soft: #eee8f7;

    --surface: #ffffff;
    --surface-hover: #f8f4ff;

    --text: #20182e;
    --text-muted: #756c82;

    --primary: #8d5ce6;
    --primary-light: #b18af2;
    --primary-soft: #eee5ff;

    --border: rgba(77, 53, 111, 0.13);

    --success: #2fbf71;
    --danger: #ee6674;
    --collaboration: #9c63ff;

    --shadow: 0 16px 45px rgba(72, 48, 104, 0.1);
}

body.dark-mode {
    --background: #090b14;
    --background-soft: #101320;

    --surface: #151824;
    --surface-hover: #1c2030;

    --text: #f7f3ff;
    --text-muted: #aaa3b7;

    --primary: #9c63ff;
    --primary-light: #c09bff;
    --primary-soft: rgba(156, 99, 255, 0.16);

    --border: rgba(255, 255, 255, 0.09);

    --success: #55df87;
    --danger: #ff6d79;
    --collaboration: #b582ff;

    --shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;

    font-family:
        Pretendard,
        "Noto Sans KR",
        Arial,
        sans-serif;

    color: var(--text);
    background: var(--background);

    transition:
        color 0.3s,
        background-color 0.3s;
}

button,
input {
    font: inherit;
}

button {
    color: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);

    min-height: 100vh;
}

/* 왼쪽 사이드바 */

.sidebar {
    position: sticky;
    top: 0;

    display: flex;
    flex-direction: column;

    height: 100vh;
    padding: 24px 18px;

    background: var(--surface);
    border-right: 1px solid var(--border);
}

.sidebar-logo {
    margin-bottom: 25px;
}

.sidebar-logo h1 {
    margin: 0;

    color: var(--primary);
    font-size: 24px;
}

.sidebar-logo p {
    margin: 6px 0 0;

    color: var(--text-muted);
    font-size: 11px;
    letter-spacing: 1px;
}

.sidebar-profile {
    display: flex;
    align-items: center;
    flex-direction: column;

    margin-bottom: 20px;
}

.profile-image,
.summary-profile-image {
    display: grid;
    place-items: center;

    color: white;
    font-weight: 800;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            #55347e
        );

    border: 3px solid var(--primary-soft);
    border-radius: 50%;
}

.profile-image {
    width: 88px;
    height: 88px;

    margin-bottom: 12px;
}

.sidebar-profile strong {
    font-size: 17px;
}

.sidebar-profile span {
    margin-top: 5px;

    color: var(--text-muted);
    font-size: 10px;
}

.sidebar-status {
    margin-bottom: 20px;
    padding: 15px;

    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.status-title {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 12px;

    font-size: 13px;
    font-weight: 700;
}

.live-badge {
    padding: 4px 7px;

    color: white;
    background: var(--danger);
    border-radius: 20px;

    font-size: 10px;
}

.status-live {
    margin: 0 0 8px;

    color: var(--success);
    font-size: 13px;
    font-weight: 700;
}

.status-description {
    margin: 0;

    color: var(--text-muted);
    font-size: 12px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.menu-button {
    display: flex;
    align-items: center;
    gap: 12px;

    width: 100%;
    padding: 12px 14px;

    background: transparent;
    border: 0;
    border-radius: 12px;

    text-align: left;
    cursor: pointer;
}

.menu-button:hover {
    background: var(--surface-hover);
}

.menu-button.active {
    color: white;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            #7041ba
        );
}

.sidebar-bottom {
    display: flex;
    flex-direction: column;
    gap: 8px;

    margin-top: auto;
}

.bottom-button {
    padding: 10px;

    color: var(--text-muted);
    background: transparent;

    border: 1px solid var(--border);
    border-radius: 10px;

    cursor: pointer;
}

/* 오른쪽 영역 */

.page-area {
    min-width: 0;
}

.top-header {
    position: sticky;
    top: 0;
    z-index: 10;

    display: flex;
    align-items: center;
    gap: 18px;

    min-height: 76px;
    padding: 15px 28px;

    background: color-mix(in srgb, var(--background) 90%, transparent);
    border-bottom: 1px solid var(--border);

    backdrop-filter: blur(15px);
}

.notice-bar {
    display: flex;
    align-items: center;
    gap: 13px;

    flex: 1;
    padding: 13px 16px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;

    font-size: 14px;
}

.notice-bar strong {
    color: var(--primary);
}

.theme-button {
    flex-shrink: 0;

    padding: 12px 16px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 13px;

    cursor: pointer;
}

.theme-button:hover {
    border-color: var(--primary);
}

.main-content {
    max-width: 1500px;

    margin: 0 auto;
    padding: 28px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

/* 프로필 카드 */

.profile-summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 180px;
    align-items: center;
    gap: 22px;

    margin-bottom: 22px;
    padding: 24px;
}

.summary-profile-image {
    width: 105px;
    height: 105px;
}

.profile-text h2 {
    margin: 4px 0 8px;
}

.profile-text p {
    max-width: 650px;
    margin: 0;

    color: var(--text-muted);
    line-height: 1.7;
}

.small-title {
    color: var(--primary) !important;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;

    margin-top: 15px;
}

.tag-list span {
    padding: 6px 10px;

    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 20px;

    font-size: 12px;
}

.profile-links {
    display: flex;
    flex-direction: column;
    gap: 8px;

    padding-left: 22px;

    border-left: 1px solid var(--border);
}

.profile-links h3 {
    margin: 0 0 5px;

    font-size: 14px;
}

.profile-links a {
    color: var(--primary);
    font-size: 13px;
}

/* 대시보드 카드 */

.dashboard-grid {
    display: grid;
    grid-template-columns:
        minmax(330px, 1.15fr)
        minmax(360px, 1.2fr)
        minmax(270px, 0.9fr);

    gap: 20px;
}

.schedule-card,
.songbook-card,
.homework-card {
    padding: 20px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 17px;
}

.card-header h2 {
    margin: 0;

    font-size: 18px;
}

.card-header button {
    padding: 7px 10px;

    color: var(--primary);
    background: transparent;

    border: 1px solid var(--border);
    border-radius: 9px;

    font-size: 11px;
    cursor: pointer;
}

/* 일정 */

.schedule-list {
    display: flex;
    flex-direction: column;
}

.schedule-item {
    display: grid;
    grid-template-columns: 25px 48px minmax(0, 1fr);
    align-items: center;
    gap: 9px;

    min-height: 48px;

    border-bottom: 1px solid var(--border);

    font-size: 13px;
}

.schedule-item:last-child {
    border-bottom: 0;
}

.schedule-type {
    font-size: 11px;
    font-weight: 700;
}

.schedule-type.broadcast {
    color: var(--success);
}

.schedule-type.off {
    color: var(--danger);
}

.schedule-type.collaboration {
    color: var(--collaboration);
}

/* 노래책 */

.song-search input {
    width: 100%;
    padding: 12px 14px;

    color: var(--text);
    background: var(--background-soft);

    border: 1px solid var(--border);
    border-radius: 12px;

    outline: none;
}

.song-search input:focus {
    border-color: var(--primary);
}

.filter-list {
    display: flex;
    gap: 7px;

    margin: 12px 0 15px;

    overflow-x: auto;
}

.filter-list button {
    flex-shrink: 0;

    padding: 7px 11px;

    color: var(--text-muted);
    background: var(--background-soft);

    border: 1px solid var(--border);
    border-radius: 20px;

    font-size: 11px;
    cursor: pointer;
}

.filter-list button.active {
    color: white;
    background: var(--primary);
    border-color: var(--primary);
}

 .song-list {
    display: flex;
    flex-direction: column;
}

.song-table-header,
.song-row {
    display: grid;
    grid-template-columns:
        58px
        minmax(150px, 1fr)
        74px
        74px
        76px;

    align-items: center;
    column-gap: 12px;
}

.song-table-header {
    min-height: 34px;
    padding: 0 10px;

    color: var(--text-muted);
    background: var(--background-soft);

    border: 1px solid var(--border);
    border-radius: 10px;

    font-size: 10px;
    font-weight: 700;
    text-align: center;
}

.song-table-header span:nth-child(2) {
    text-align: left;
}

.song-row {
    min-height: 66px;
    padding: 0 10px;

    border-bottom: 1px solid var(--border);
}

.song-row:last-child {
    border-bottom: 0;
}

.favorite-button {
    display: grid;
    place-items: center;

    width: 42px;
    height: 42px;
    padding: 0;

    color: var(--text-muted);
    background: transparent;

    border: 0;
    border-radius: 10px;

    font-size: 23px;
    cursor: pointer;
}

.favorite-button:hover {
    background: var(--background-soft);
}

.favorite-button.active {
    color: #f6c959;
}

.song-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.song-info strong {
    overflow: hidden;
    font-size: 13px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.song-info span,
.genre,
.difficulty {
    color: var(--text-muted);
    font-size: 11px;
}

.genre,
.difficulty {
    text-align: center;
}

.difficulty {
    padding: 5px 7px;
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 20px;
}

.difficulty.no-difficulty {
    padding: 0;
    color: var(--text-muted);
    background: transparent;
    border-color: transparent;
    opacity: 0.65;
}

.song-table-header small {
    font-size: 9px;
    font-weight: 500;
    opacity: 0.7;
}

.song-status {
    padding: 5px 7px;
    border-radius: 20px;
    font-size: 10px;
    text-align: center;
}

.song-status.homework {
    color: var(--primary);
    background: var(--primary-soft);
}

.song-status.practice {
    color: var(--success);
    background: rgba(47, 191, 113, 0.12);
}

/* 숙제 */

.homework-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;

    margin-bottom: 15px;
    padding: 4px;

    background: var(--background-soft);
    border-radius: 12px;
}

.homework-tabs button {
    padding: 8px;

    color: var(--text-muted);
    background: transparent;

    border: 0;
    border-radius: 9px;

    font-size: 11px;
    cursor: pointer;
}

.homework-tabs button.active {
    color: white;
    background: var(--primary);
}

.homework-summary {
    margin-bottom: 15px;
}

.homework-summary > div:first-child {
    display: flex;
    justify-content: space-between;

    margin-bottom: 9px;

    font-size: 11px;
}

.homework-summary span {
    color: var(--text-muted);
}

.progress {
    height: 6px;

    overflow: hidden;

    background: var(--background-soft);
    border-radius: 20px;
}

.progress-value {
    width: 60%;
    height: 100%;

    background:
        linear-gradient(
            90deg,
            var(--primary),
            var(--primary-light)
        );

    border-radius: inherit;
}

.homework-list {
    display: flex;
    flex-direction: column;
}

.homework-item {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 62px;

    border-bottom: 1px solid var(--border);
}

.homework-item:last-child {
    border-bottom: 0;
}

.homework-item div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.homework-item strong {
    font-size: 13px;
}

.homework-item span,
.homework-item time {
    color: var(--text-muted);
    font-size: 11px;
}

.site-footer {
    padding: 10px 28px 28px;

    color: var(--text-muted);

    font-size: 11px;
    text-align: center;
}

/* 작은 PC 및 태블릿 */

@media (max-width: 1150px) {
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }

    .songbook-card {
        grid-column: 1 / -1;
        grid-row: 1;
    }
}

/* 모바일은 다음 단계에서 완성할 예정 */

@media (max-width: 760px) {
    .app-layout {
        display: block;
    }

    .sidebar {
        display: none;
    }

    .top-header {
        padding: 12px 15px;
    }

    .notice-bar {
        min-width: 0;
    }

    .notice-bar span {
        overflow: hidden;

        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .theme-button {
        padding: 11px;
        font-size: 0;
    }

    .theme-button::first-letter {
        font-size: 16px;
    }

    .main-content {
        padding: 16px;
    }

    .profile-summary {
        grid-template-columns: 70px minmax(0, 1fr);
        gap: 15px;

        padding: 18px;
    }

    .summary-profile-image {
        width: 70px;
        height: 70px;
    }

    .profile-links {
        display: none;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .songbook-card {
        grid-column: auto;
        grid-row: auto;
    }

    .song-table-header {
        display: none;
    }

    .song-row {
        grid-template-columns:
            42px
            minmax(0, 1fr)
            68px;
        grid-template-areas:
            "favorite info status"
            "favorite meta status";
        row-gap: 5px;
        min-height: 76px;
        padding: 10px 4px;
    }

    .favorite-button {
        grid-area: favorite;
    }

    .song-info {
        grid-area: info;
    }

    .genre {
        grid-area: meta;
        justify-self: start;
    }

    .difficulty {
        grid-area: meta;
        justify-self: end;
        margin-right: 6px;
        padding: 3px 7px;
    }

    .song-status {
        grid-area: status;
    }
    .difficulty.no-difficulty {
        display: none;
    }

}

/* 검색 결과가 없을 때 표시되는 문구 */
.empty-song-message {
    margin: 20px 0 5px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

/* hidden 속성이 붙은 노래는 숨깁니다. */
.song-row[hidden] {
    display: none !important;
}

/* 완료된 숙제입니다. */
.homework-item.completed {
    opacity: 0.65;
}

.homework-item.completed strong {
    text-decoration: line-through;
}

/* 버튼을 눌렀을 때 살짝 작아지는 효과입니다. */
.favorite-button,
.menu-button,
.theme-button,
.filter-list button,
.homework-tabs button,
.card-header button {
    transition:
        transform 0.15s,
        background-color 0.2s,
        border-color 0.2s,
        color 0.2s;
}

.favorite-button:active,
.menu-button:active,
.theme-button:active,
.filter-list button:active,
.homework-tabs button:active,
.card-header button:active {
    transform: scale(0.96);
}


/* 모바일 홈 요약과 하단 메뉴 */
.mobile-home-summary,
.mobile-bottom-nav {
    display: none;
}

@media (max-width: 760px) {
    body {
        padding-bottom: 82px;
    }

    .top-header {
        position: sticky;
        top: 0;
        z-index: 30;
    }

    .main-content {
        min-height: calc(100vh - 150px);
    }

    .mobile-home-summary {
        display: grid;
        gap: 14px;
    }

    .mobile-summary-card {
        padding: 18px;
    }

    .mobile-summary-card h2 {
        margin: 0;
        font-size: 17px;
    }

    .mobile-summary-card p {
        margin: 12px 0 5px;
    }

    .mobile-summary-card > span,
    .mobile-song-preview span {
        color: var(--text-muted);
        font-size: 12px;
    }

    .mobile-summary-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .mobile-jump-button {
        padding: 7px 10px;
        color: var(--primary);
        background: var(--primary-soft);
        border: 0;
        border-radius: 10px;
        font-size: 11px;
        cursor: pointer;
    }

    .mobile-song-preview {
        display: grid;
        gap: 10px;
        margin-top: 14px;
    }

    .mobile-bottom-nav {
        position: fixed;
        right: 12px;
        bottom: 12px;
        left: 12px;
        z-index: 50;

        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;

        padding: 7px;
        padding-bottom: calc(7px + env(safe-area-inset-bottom));

        background: color-mix(in srgb, var(--surface) 94%, transparent);
        border: 1px solid var(--border);
        border-radius: 20px;
        box-shadow: var(--shadow);
        backdrop-filter: blur(18px);
    }

    .mobile-nav-button {
        display: flex;
        align-items: center;
        flex-direction: column;
        justify-content: center;
        gap: 3px;

        min-height: 54px;
        padding: 5px;

        color: var(--text-muted);
        background: transparent;
        border: 0;
        border-radius: 14px;
        font-size: 10px;
        cursor: pointer;
    }

    .mobile-nav-icon {
        font-size: 19px;
        line-height: 1;
    }

    .mobile-nav-button.active {
        color: white;
        background: linear-gradient(135deg, var(--primary), #7041ba);
    }

    body[data-mobile-page="home"] [data-mobile-page]:not([data-mobile-page="home"]),
    body[data-mobile-page="schedule"] [data-mobile-page]:not([data-mobile-page="schedule"]),
    body[data-mobile-page="songbook"] [data-mobile-page]:not([data-mobile-page="songbook"]),
    body[data-mobile-page="homework"] [data-mobile-page]:not([data-mobile-page="homework"]) {
        display: none !important;
    }

    body[data-mobile-page="home"] .dashboard-grid {
        display: block;
    }

    body:not([data-mobile-page="home"]) .profile-summary {
        display: none !important;
    }

    body[data-mobile-page="schedule"] .dashboard-grid,
    body[data-mobile-page="songbook"] .dashboard-grid,
    body[data-mobile-page="homework"] .dashboard-grid {
        display: block;
    }

    body[data-mobile-page="schedule"] .schedule-card,
    body[data-mobile-page="songbook"] .songbook-card,
    body[data-mobile-page="homework"] .homework-card {
        display: block !important;
    }

    .site-footer {
        padding-bottom: 20px;
    }
}


/* 오늘 일정 강조 */
.schedule-item {
    position: relative;
    padding: 0 8px;
    border-radius: 12px;
}

.schedule-item.today {
    margin: 4px 0;
    padding: 0 74px 0 12px;
    background: var(--primary-soft);
    border: 1px solid color-mix(in srgb, var(--primary) 45%, transparent);
    box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 16%, transparent);
}

.schedule-item.today > strong {
    color: var(--primary);
    font-size: 15px;
}

.today-badge {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    padding: 4px 9px;
    color: white;
    background: var(--primary);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
}

/* 오늘 상태 유형별 색상 */
.status-live[data-status-type="broadcast"] {
    color: var(--success);
}

.status-live[data-status-type="collaboration"] {
    color: var(--collaboration);
}

.status-live[data-status-type="off"] {
    color: var(--danger);
}

.live-badge[data-status-type="broadcast"] {
    background: var(--success);
}

.live-badge[data-status-type="collaboration"] {
    background: var(--collaboration);
}

.live-badge[data-status-type="off"] {
    background: var(--danger);
}

/* 동적으로 생성되는 노래 목록 */
#songRows {
    display: flex;
    flex-direction: column;
}

.song-status.confident {
    color: #477ee8;
    background: rgba(71, 126, 232, 0.12);
}

.song-status.hold {
    color: #d28a2f;
    background: rgba(210, 138, 47, 0.13);
}

.song-status.no-status {
    color: var(--text-muted);
    background: var(--background-soft);
    opacity: 0.7;
}

/* 관리자 모드 */
body.admin-open {
    overflow: hidden;
}

.admin-overlay[hidden] {
    display: none;
}

.admin-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;

    display: grid;
    place-items: center;

    padding: 24px;
    background: rgba(5, 6, 13, 0.72);
    backdrop-filter: blur(8px);
}

.admin-panel {
    width: min(1280px, 100%);
    max-height: calc(100vh - 48px);
    overflow: hidden;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

.admin-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;

    padding: 24px 26px;
    border-bottom: 1px solid var(--border);
}

.admin-panel-header h2 {
    margin: 3px 0 5px;
}

.admin-panel-header > div > span {
    color: var(--text-muted);
    font-size: 12px;
}

.admin-close-button {
    display: grid;
    place-items: center;

    width: 42px;
    height: 42px;

    color: var(--text-muted);
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 12px;

    font-size: 26px;
    cursor: pointer;
}

.admin-layout {
    display: grid;
    grid-template-columns: minmax(320px, 0.85fr) minmax(360px, 1.15fr);
    min-height: 0;
    max-height: calc(100vh - 160px);
}

.admin-song-form,
.admin-song-list-section {
    overflow-y: auto;
    padding: 24px 26px;
}

.admin-song-form {
    border-right: 1px solid var(--border);
}

.admin-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.admin-song-form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-song-form label > span {
    font-size: 12px;
    font-weight: 700;
}

.admin-song-form label b {
    color: var(--danger);
}

.admin-song-form input,
.admin-song-form select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;

    color: var(--text);
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 11px;
    outline: none;
}

.admin-song-form input:focus,
.admin-song-form select:focus {
    border-color: var(--primary);
}

.admin-song-form select:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.admin-difficulty-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: end;
    gap: 16px;

    margin-top: 18px;
    padding: 14px;

    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.admin-switch-row {
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
}

.admin-switch-row input {
    width: 20px;
    min-height: 20px;
    accent-color: var(--primary);
}

.admin-details {
    margin-top: 18px;
    padding: 14px;

    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.admin-details summary {
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.admin-genre-add {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-top: 14px;
}

.admin-genre-add button,
.admin-item-actions button,
.secondary-button,
.primary-button {
    min-height: 40px;
    padding: 9px 13px;

    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
}

.admin-genre-add button,
.secondary-button,
.admin-item-actions button {
    color: var(--text);
    background: var(--surface);
}

.primary-button {
    color: white;
    background: var(--primary);
    border-color: var(--primary);
}

.admin-genre-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px;
}

.admin-genre-chips span {
    padding: 5px 9px;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 20px;
    font-size: 10px;
}

.admin-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 20px;
}

.admin-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.admin-list-header h3 {
    margin: 0;
}

.admin-list-header span {
    color: var(--text-muted);
    font-size: 12px;
}

.admin-song-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.admin-song-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    padding: 13px 14px;
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 13px;
}

.admin-song-item > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.admin-song-item strong,
.admin-song-item span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.admin-song-item strong {
    font-size: 13px;
}

.admin-song-item span {
    color: var(--text-muted);
    font-size: 11px;
}

.admin-item-actions {
    display: flex;
    flex-shrink: 0;
    gap: 6px;
}

.admin-item-actions button {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 11px;
}

.admin-item-actions .danger-button {
    color: var(--danger);
}

.admin-empty {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

@media (max-width: 760px) {
    .admin-overlay {
        padding: 0;
        place-items: stretch;
    }

    .admin-panel {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .admin-panel-header {
        padding: 18px 16px;
    }

    .admin-layout {
        display: block;
        max-height: calc(100vh - 95px);
        overflow-y: auto;
    }

    .admin-song-form,
    .admin-song-list-section {
        overflow: visible;
        padding: 18px 16px;
    }

    .admin-song-form {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .admin-form-grid,
    .admin-difficulty-box {
        grid-template-columns: 1fr;
    }

    .admin-genre-add {
        grid-template-columns: 1fr;
    }
}

/* 즐겨찾기 노래만 보기 필터 */
.favorite-filter-button {
    border-color: rgba(245, 189, 61, 0.38) !important;
}

.favorite-filter-button.active {
    color: #5a4300 !important;
    background: var(--favorite) !important;
    border-color: var(--favorite) !important;
}

body.dark-mode .favorite-filter-button.active {
    color: #221900 !important;
}

/* 관리자 탭 및 월간 일정 */
.admin-tabs {
    display: flex;
    gap: 8px;
    padding: 0 24px 18px;
    border-bottom: 1px solid var(--border);
}

.admin-tab-button {
    padding: 10px 15px;
    color: var(--text-muted);
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 11px;
    cursor: pointer;
}

.admin-tab-button.active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

.admin-tab-panel { padding: 22px 24px 26px; }
.admin-tab-panel[hidden] { display: none; }
.admin-tab-panel .admin-layout { padding: 0; }

.admin-schedule-layout {
    display: grid;
    grid-template-columns: minmax(520px, 1fr) minmax(320px, 360px);
    gap: 22px;
}

.admin-calendar-section,
.admin-schedule-form {
    padding: 20px;
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 17px;
}

.admin-calendar-header {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.admin-calendar-header h3 { margin: 0; text-align: center; }
.admin-weekday-row,
.admin-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.admin-weekday-row { margin-bottom: 7px; }
.admin-weekday-row span {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.admin-calendar-day {
    position: relative;
    min-height: 78px;
    padding: 9px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 11px;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
}

.admin-calendar-day:hover { border-color: var(--primary); }
.admin-calendar-day.other-month { opacity: .38; }
.admin-calendar-day.today { box-shadow: inset 0 0 0 2px var(--primary); }
.admin-calendar-day.selected { background: var(--primary-soft); border-color: var(--primary); }
.admin-calendar-day-number { font-size: 12px; font-weight: 800; }
.admin-calendar-event {
    display: block;
    margin-top: 8px;
    padding: 4px 6px;
    border-radius: 7px;
    font-size: 10px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.admin-calendar-event.broadcast { color: var(--success); background: rgba(47,191,113,.12); }
.admin-calendar-event.collaboration { color: var(--collaboration); background: var(--primary-soft); }
.admin-calendar-event.off { color: var(--danger); background: rgba(238,102,116,.12); }

.admin-calendar-help {
    margin: 13px 0 0;
    color: var(--text-muted);
    font-size: 11px;
    text-align: center;
}

.admin-schedule-form { display: flex; flex-direction: column; gap: 14px; }
.admin-schedule-form label { display: flex; flex-direction: column; gap: 7px; }
.admin-schedule-form label > span { font-size: 12px; font-weight: 700; }
.admin-schedule-form input,
.admin-schedule-form select,
.admin-schedule-form textarea {
    width: 100%;
    padding: 11px 12px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.admin-schedule-form textarea {
    min-height: 72px;
    max-height: 150px;
    resize: vertical;
    line-height: 1.5;
}

.admin-schedule-form .admin-schedule-note-input {
    min-height: 72px;
}

.admin-schedule-preview {
    min-height: 75px;
    padding: 13px;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 11px;
    font-size: 12px;
    line-height: 1.65;
}

.schedule-date {
    color: var(--text-muted);
    font-size: 10px;
}
.schedule-item {
    grid-template-columns: 25px 42px 48px minmax(0, 1fr);
}
.schedule-item .today-badge { grid-column: auto; }

@media (max-width: 900px) {
    .admin-schedule-layout { grid-template-columns: 1fr; }
    .admin-calendar-day { min-height: 68px; padding: 7px; }
}

@media (max-width: 600px) {
    .admin-tabs { padding-inline: 14px; }
    .admin-tab-panel { padding: 16px 14px 20px; }
    .admin-calendar-section, .admin-schedule-form { padding: 13px; }
    .admin-calendar-grid, .admin-weekday-row { gap: 3px; }
    .admin-calendar-day { min-height: 56px; border-radius: 8px; }
    .admin-calendar-event { font-size: 0; width: 7px; height: 7px; padding: 0; border-radius: 50%; }
}


/* 방문자 일정 한 줄 표시 및 관리자 입력창 간소화 */
.schedule-item {
    overflow: hidden;
}

.schedule-content {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.schedule-item.today .schedule-content {
    min-width: 0;
}

.admin-schedule-form .admin-schedule-title-input {
    min-height: auto;
}

@media (max-width: 760px) {
    .schedule-item {
        grid-template-columns: 24px 38px 42px minmax(0, 1fr);
        gap: 7px;
    }

    .schedule-item.today {
        padding-right: 62px;
    }

    .today-badge {
        right: 8px;
        padding: 3px 7px;
    }
}


/* 방문자용 일정 상세창 */
.schedule-item {
    cursor: pointer;
}

.schedule-item:hover {
    background: var(--surface-hover);
}

.schedule-item:focus-visible {
    outline: 3px solid var(--primary-soft);
    outline-offset: 2px;
}

.schedule-item.today:hover {
    background: var(--primary-soft);
}

.schedule-detail-overlay[hidden] {
    display: none;
}

.schedule-detail-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(6, 7, 14, 0.68);
    backdrop-filter: blur(8px);
}

.schedule-detail-dialog {
    width: min(500px, 100%);
    max-height: min(720px, calc(100vh - 40px));
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.schedule-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 22px 16px;
    border-bottom: 1px solid var(--border);
}

.schedule-detail-header h2 {
    margin: 3px 0 0;
    font-size: 20px;
}

.schedule-detail-date {
    margin: 0;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
}

.schedule-detail-close {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: var(--text-muted);
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.schedule-detail-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px 22px 24px;
}

.schedule-detail-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.schedule-detail-status {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.schedule-detail-status.broadcast {
    color: var(--success);
    background: color-mix(in srgb, var(--success) 13%, transparent);
}

.schedule-detail-status.collaboration {
    color: var(--collaboration);
    background: color-mix(in srgb, var(--collaboration) 13%, transparent);
}

.schedule-detail-status.off {
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 13%, transparent);
}

.schedule-detail-status.none {
    color: var(--text-muted);
    background: var(--background-soft);
}

.schedule-detail-time {
    color: var(--text-muted);
    font-size: 13px;
}

.schedule-detail-section {
    padding: 15px 16px;
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.schedule-detail-label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
}

.schedule-detail-content,
.schedule-detail-note {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

@media (max-width: 600px) {
    .schedule-detail-overlay {
        align-items: end;
        padding: 12px;
    }

    .schedule-detail-dialog {
        width: 100%;
        max-height: calc(100vh - 24px);
        border-radius: 20px;
    }
}


/* 일정 행 자체에서 자연스럽게 펼치기 */
.schedule-detail-overlay {
    display: none !important;
}

.schedule-item {
    grid-template-columns: 25px 42px 52px minmax(0, 1fr);
    align-items: center;
}

.schedule-item.expanded {
    overflow: visible;
    align-items: start;
    padding-top: 13px;
    padding-bottom: 13px;
    background: var(--surface-hover);
}

.schedule-item.expanded .schedule-content {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

/* 메모는 기존 일정 문장 바로 아래에서 이어집니다. */
.schedule-inline-detail {
    grid-column: 4;
    margin: -4px 0 0;
    padding: 0;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    cursor: default;
    font-size: 12px;
}

.schedule-inline-detail[hidden] {
    display: none;
}

.schedule-inline-detail p {
    margin: 0;
    line-height: 1.55;
    white-space: normal;
    overflow-wrap: anywhere;
}

.schedule-inline-detail p::before {
    content: "↳ ";
    color: var(--primary);
}

@media (max-width: 760px) {
    .schedule-item {
        grid-template-columns: 24px 38px 42px minmax(0, 1fr);
    }

    .schedule-item.expanded {
        padding-bottom: 12px;
    }

    .schedule-inline-detail {
        grid-column: 4;
        font-size: 12px;
    }
}


/* 일정 펼침: 기존 문장이 같은 칸에서 그대로 이어져 보이도록 */
.schedule-inline-detail {
    display: none !important;
}

.schedule-item.expanded .schedule-content {
    grid-column: 4;
    display: block;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.schedule-item.expanded {
    align-items: start;
}


/* 관리자 숙제 관리 */
.admin-homework-layout {
    display: grid;
    grid-template-columns: minmax(320px, .9fr) minmax(360px, 1.1fr);
    gap: 18px;
}

.admin-homework-form,
.admin-homework-list-section {
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.admin-homework-form label,
.admin-full-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.admin-homework-form label > span,
.admin-full-field > span {
    font-size: 12px;
    font-weight: 700;
}

.admin-homework-form input,
.admin-homework-form select,
.admin-homework-form textarea {
    width: 100%;
    padding: 11px 12px;
    color: var(--text);
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 11px;
    outline: none;
}

.admin-homework-form textarea { resize: vertical; min-height: 82px; }
.admin-full-field { margin-top: 14px; }
.admin-homework-filter { display: flex; gap: 7px; margin-bottom: 12px; }
.admin-homework-filter button {
    padding: 7px 11px;
    color: var(--text-muted);
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
}
.admin-homework-filter button.active { color: white; background: var(--primary); border-color: var(--primary); }
.admin-homework-list { display: flex; flex-direction: column; }
.admin-homework-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.admin-homework-item:last-child { border-bottom: 0; }
.admin-homework-item > div { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.admin-homework-item strong { font-size: 13px; }
.admin-homework-item span { color: var(--text-muted); font-size: 11px; }
.admin-homework-item button { flex-shrink: 0; }

@media (max-width: 900px) {
    .admin-homework-layout { grid-template-columns: 1fr; }
}

/* 관리자 일괄 등록·기본 설정·백업 */
.admin-help-text {
    margin: 8px 0 12px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.6;
}

.admin-bulk-details textarea,
.admin-settings-form textarea,
.admin-settings-form input,
.admin-backup-section input {
    width: 100%;
}

.compact-actions {
    margin-top: 10px;
}

.admin-inline-message {
    min-height: 18px;
    margin: 10px 0 0;
    color: var(--primary);
    font-size: 12px;
}

.admin-settings-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
    gap: 22px;
}

.admin-settings-form,
.admin-backup-section {
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
}

.admin-backup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
}

.file-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.file-button input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.admin-reset-all {
    width: 100%;
    margin-top: 18px;
}

@media (max-width: 900px) {
    .admin-settings-layout {
        grid-template-columns: 1fr;
    }
}

/* 2026-08 긴급 수정: 관리자 기본 설정 화면 및 다크모드 */
.admin-settings-form,
.admin-settings-form * ,
.admin-backup-section,
.admin-backup-section * {
    box-sizing: border-box;
}

.settings-page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 2px 2px 16px;
    border-bottom: 1px solid var(--border);
}

.settings-page-heading h3 {
    margin: 4px 0 5px;
    font-size: 21px;
}

.settings-page-heading p {
    margin: 0;
    color: var(--text-muted);
    font-size: 12px;
}

.settings-kicker {
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.4px;
}

.admin-settings-layout {
    align-items: start;
}

.admin-settings-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 0;
    background: transparent;
    border: 0;
}

.settings-group {
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.settings-group-title {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 16px;
}

.settings-group-icon,
.backup-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid color-mix(in srgb, var(--primary) 28%, transparent);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 800;
}

.settings-group-title h4 {
    margin: 0 0 3px;
    font-size: 14px;
}

.settings-group-title p {
    margin: 0;
    color: var(--text-muted);
    font-size: 11px;
}

.admin-settings-form label {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.admin-settings-form label > span {
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.admin-settings-form input,
.admin-settings-form textarea,
.admin-backup-section input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    color: var(--text);
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 11px;
    outline: none;
    caret-color: var(--primary);
}

.admin-settings-form textarea {
    min-height: 86px;
    resize: vertical;
    line-height: 1.55;
}

.admin-settings-form input::placeholder,
.admin-settings-form textarea::placeholder {
    color: var(--text-muted);
    opacity: .75;
}

.admin-settings-form input:focus,
.admin-settings-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.settings-save-bar {
    position: sticky;
    bottom: -1px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 14px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border: 1px solid var(--border);
    border-radius: 14px;
    backdrop-filter: blur(12px);
}

.settings-save-bar .admin-inline-message {
    margin: 0;
}

.settings-save-button {
    min-width: 150px;
}

.admin-backup-section {
    position: sticky;
    top: 0;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.admin-backup-section h3 {
    margin: 13px 0 4px;
    font-size: 17px;
}

.admin-backup-actions {
    display: grid;
    grid-template-columns: 1fr;
}

.admin-backup-actions .primary-button,
.admin-backup-actions .secondary-button {
    width: 100%;
    min-height: 42px;
}

.backup-warning {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 18px;
    padding: 12px;
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--danger) 24%, transparent);
    border-radius: 12px;
}

.backup-warning strong {
    font-size: 12px;
}

.backup-warning span {
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.5;
}

/* 관리자 전체 입력 요소가 다크모드 변수 색을 반드시 사용하도록 보강 */
.admin-panel input,
.admin-panel textarea,
.admin-panel select,
.admin-panel button {
    font-family: inherit;
}

body.dark-mode .admin-panel,
body.dark-mode .settings-group,
body.dark-mode .admin-backup-section {
    color: var(--text);
    background: var(--surface);
}

body.dark-mode .admin-panel input,
body.dark-mode .admin-panel textarea,
body.dark-mode .admin-panel select {
    color: var(--text);
    background: var(--background-soft);
    border-color: var(--border);
    color-scheme: dark;
}

body:not(.dark-mode) .admin-panel input,
body:not(.dark-mode) .admin-panel textarea,
body:not(.dark-mode) .admin-panel select {
    color-scheme: light;
}

/* 일괄 등록 버튼과 입력칸을 확실히 보이게 */
.admin-bulk-details textarea {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 11px;
    line-height: 1.65;
    resize: vertical;
}

body.dark-mode .admin-bulk-details textarea {
    background: var(--surface-hover);
}

.admin-bulk-details .compact-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
}

@media (max-width: 760px) {
    .settings-page-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .settings-page-heading > button {
        width: 100%;
    }

    .settings-group {
        padding: 14px;
    }

    .settings-save-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .settings-save-button {
        width: 100%;
    }

    .admin-backup-section {
        position: static;
    }
}

/* 2026-08 관리자 창 스크롤 및 초기화 버튼 개선 */
.admin-panel {
    display: flex;
    flex-direction: column;
    height: min(900px, calc(100vh - 48px));
    max-height: calc(100vh - 48px);
    min-height: 0;
}

.admin-panel-header,
.admin-tabs {
    flex: 0 0 auto;
}

.admin-tabs {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.admin-tab-button {
    flex: 0 0 auto;
}

.admin-tab-panel {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.admin-tab-panel.active {
    display: block;
}

/* 노래책·숙제 관리도 내용이 길어지면 관리자 탭 전체에서 스크롤 */
.admin-layout,
.admin-homework-layout,
.admin-schedule-layout,
.admin-settings-layout {
    min-height: min-content;
    max-height: none;
}

.admin-song-form,
.admin-song-list-section,
.admin-homework-form,
.admin-homework-list-section {
    overflow: visible;
    max-height: none;
}

/* 설정 화면 오른쪽 백업 영역은 스크롤 중에도 자연스럽게 보이도록 제한 */
.admin-backup-section {
    top: 8px;
    max-height: calc(100vh - 190px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* 관리자 스크롤바 */
.admin-tab-panel::-webkit-scrollbar,
.admin-backup-section::-webkit-scrollbar,
.admin-tabs::-webkit-scrollbar {
    width: 10px;
    height: 7px;
}

.admin-tab-panel::-webkit-scrollbar-track,
.admin-backup-section::-webkit-scrollbar-track,
.admin-tabs::-webkit-scrollbar-track {
    background: transparent;
}

.admin-tab-panel::-webkit-scrollbar-thumb,
.admin-backup-section::-webkit-scrollbar-thumb,
.admin-tabs::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--primary) 38%, var(--border));
    border: 3px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

/* 기본값 복원 버튼 */
#adminSettingsResetButton {
    position: relative;
    min-height: 42px;
    padding: 10px 15px 10px 39px;
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid color-mix(in srgb, var(--primary) 32%, var(--border));
    border-radius: 12px;
    font-weight: 700;
    box-shadow: none;
}

#adminSettingsResetButton::before {
    content: "↺";
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-52%);
    font-size: 19px;
    line-height: 1;
}

#adminSettingsResetButton:hover {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 18%, var(--surface));
}

/* 전체 초기화는 위험 버튼답게 별도 카드형으로 명확하게 */
#adminResetAllButton {
    position: relative;
    min-height: 48px;
    padding: 12px 16px 12px 44px;
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 9%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--danger) 34%, var(--border));
    border-radius: 13px;
    font-weight: 800;
    text-align: center;
}

#adminResetAllButton::before {
    content: "!";
    position: absolute;
    left: 15px;
    top: 50%;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    transform: translateY(-50%);
    color: white;
    background: var(--danger);
    border-radius: 50%;
    font-size: 13px;
    font-weight: 900;
}

#adminResetAllButton:hover {
    color: white;
    background: var(--danger);
    border-color: var(--danger);
}

#adminResetAllButton:hover::before {
    color: var(--danger);
    background: white;
}

@media (max-width: 900px) {
    .admin-panel {
        height: calc(100dvh - 20px);
        max-height: calc(100dvh - 20px);
    }

    .admin-tab-panel {
        padding-bottom: 34px;
    }

    .admin-backup-section {
        position: static;
        max-height: none;
        overflow: visible;
    }
}


/* 방문자 전체 보기 */
body.full-view-open { overflow: hidden; }
.full-view-overlay {
    position: fixed;
    inset: 0;
    z-index: 1900;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(8, 7, 15, 0.72);
    backdrop-filter: blur(10px);
}
.full-view-overlay[hidden] { display: none; }
.full-view-panel {
    display: flex;
    flex-direction: column;
    width: min(1080px, 100%);
    max-height: min(860px, calc(100vh - 48px));
    overflow: hidden;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 24px 80px rgba(0,0,0,.35);
}
.full-view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--border);
}
.full-view-header h2 { margin: 3px 0 0; font-size: 22px; }
.full-view-kicker { margin: 0; color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: 1.5px; }
.full-view-close {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    color: var(--text-muted);
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 13px;
    font-size: 25px;
    cursor: pointer;
}
.full-view-body { overflow-y: auto; padding: 24px; }
.full-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.full-toolbar input,
.full-toolbar select {
    min-width: 0;
    padding: 11px 13px;
    color: var(--text);
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.full-toolbar input { flex: 1 1 260px; }
.full-toolbar button {
    padding: 10px 13px;
    color: var(--text);
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
}
.full-toolbar button.active { color: white; background: var(--primary); border-color: var(--primary); }
.full-song-list { display: flex; flex-direction: column; }
.full-song-row {
    display: grid;
    grid-template-columns: 38px minmax(180px,1fr) 110px 100px 100px;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    border-bottom: 1px solid var(--border);
}
.full-song-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.full-song-main strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.full-song-main span, .full-song-meta { color: var(--text-muted); font-size: 12px; }
.full-empty { margin: 38px 0; color: var(--text-muted); text-align: center; }
.full-homework-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.full-homework-list { display: flex; flex-direction: column; }
.full-homework-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 66px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.full-homework-row > div { display: flex; flex-direction: column; gap: 5px; }
.full-homework-row span, .full-homework-row time { color: var(--text-muted); font-size: 12px; }
.full-month-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.full-month-head h3 { margin: 0; }
.full-month-head button { padding: 9px 12px; color: var(--text); background: var(--background-soft); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.full-calendar-weekdays, .full-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 8px; }
.full-calendar-weekdays { margin-bottom: 8px; color: var(--text-muted); font-size: 12px; text-align: center; }
.full-calendar-day {
    min-height: 94px;
    padding: 9px;
    color: var(--text);
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 13px;
    text-align: left;
    cursor: pointer;
}
.full-calendar-day.empty { visibility: hidden; }
.full-calendar-day.today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.full-calendar-number { display: block; margin-bottom: 7px; font-weight: 700; }
.full-calendar-label { display: block; overflow: hidden; color: var(--text-muted); font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.full-calendar-label.has-event { color: var(--primary); }
.full-schedule-detail { margin-top: 16px; padding: 16px; background: var(--background-soft); border: 1px solid var(--border); border-radius: 14px; }
.full-schedule-detail h4 { margin: 0 0 9px; }
.full-schedule-detail p { margin: 5px 0; color: var(--text-muted); line-height: 1.6; }
@media (max-width: 760px) {
    .full-view-overlay { padding: 0; }
    .full-view-panel { width: 100%; height: 100%; max-height: none; border-radius: 0; }
    .full-view-header { padding: 17px 16px; }
    .full-view-body { padding: 16px 16px 92px; }
    .full-song-row { grid-template-columns: 34px minmax(0,1fr) auto; gap: 9px; }
    .full-song-row .full-song-genre, .full-song-row .full-song-difficulty { display: none; }
    .full-calendar-weekdays, .full-calendar-grid { gap: 5px; }
    .full-calendar-day { min-height: 72px; padding: 7px; }
}


/* 방문자용 주간 전체 일정 */
.full-week-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}
.full-week-head > button,
.full-week-title button {
    padding: 9px 12px;
    color: var(--primary);
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
}
.full-week-title { text-align: center; }
.full-week-title h3 { margin: 0 0 7px; font-size: 17px; }
.full-week-title button { padding: 5px 10px; font-size: 11px; }
.full-week-list { display: flex; flex-direction: column; }
.full-week-row {
    display: grid;
    grid-template-columns: 66px 72px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    min-height: 72px;
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
}
.full-week-row:last-child { border-bottom: 0; }
.full-week-row.today {
    margin: 3px 0;
    padding-left: 12px;
    padding-right: 12px;
    background: var(--primary-soft);
    border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
    border-radius: 14px;
}
.full-week-date { display: flex; flex-direction: column; gap: 4px; }
.full-week-date strong { color: var(--primary); font-size: 16px; }
.full-week-date span { color: var(--text-muted); font-size: 11px; }
.full-week-state { font-size: 11px; font-weight: 800; }
.full-week-state.broadcast { color: var(--success); }
.full-week-state.collaboration { color: var(--collaboration); }
.full-week-state.off { color: var(--danger); }
.full-week-state.none { color: var(--text-muted); }
.full-week-content { min-width: 0; }
.full-week-content strong { display: block; overflow-wrap: anywhere; font-size: 14px; }
.full-week-content p { margin: 6px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
@media (max-width: 760px) {
    .full-week-head { grid-template-columns: 1fr 1fr; }
    .full-week-title { grid-column: 1 / -1; grid-row: 1; }
    .full-week-head > button { width: 100%; }
    .full-week-row { grid-template-columns: 48px 54px minmax(0, 1fr); gap: 9px; min-height: 66px; padding: 10px 5px; }
    .full-week-date strong { font-size: 14px; }
    .full-week-state { font-size: 10px; }
    .full-week-content strong { font-size: 13px; }
}


/* 별도 페이지 전환 화면 */
.route-page {
    max-width: 1500px;
    min-height: calc(100vh - 76px);
    margin: 0 auto;
    padding: 28px;
}
.route-page[hidden] { display: none; }
.route-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}
.route-page-kicker { margin: 0 0 5px; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: 1px; }
.route-page-header h2 { margin: 0; font-size: 26px; }
.route-home-button,
.route-toolbar button,
.route-week-head button {
    padding: 10px 14px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
}
.route-home-button:hover,
.route-toolbar button:hover,
.route-week-head button:hover { border-color: var(--primary); }
.route-page-body {
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
}
.route-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.route-toolbar input,
.route-toolbar select {
    min-width: 0;
    padding: 11px 13px;
    color: var(--text);
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.route-toolbar input { flex: 1 1 280px; }
.route-toolbar button.active { color: white; background: var(--primary); border-color: var(--primary); }
.route-song-list, .route-homework-list, .route-week-list { display: flex; flex-direction: column; }
.route-song-row {
    display: grid;
    grid-template-columns: 38px minmax(180px,1fr) 110px 100px 100px;
    align-items: center;
    gap: 12px;
    min-height: 66px;
    border-bottom: 1px solid var(--border);
}
.route-song-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.route-song-main strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.route-song-main span, .route-song-meta { color: var(--text-muted); font-size: 12px; }
.route-homework-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 68px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.route-homework-row > div { display: flex; flex-direction: column; gap: 5px; }
.route-homework-row span, .route-homework-row time { color: var(--text-muted); font-size: 12px; }
.route-empty { margin: 38px 0; color: var(--text-muted); text-align: center; }
.route-week-head {
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}
.route-week-title { text-align: center; }
.route-week-title h3 { margin: 0 0 7px; }
.route-week-title button { padding: 6px 10px; font-size: 11px; }
.route-week-row {
    display: grid;
    grid-template-columns: 66px 72px minmax(0,1fr);
    align-items: center;
    gap: 14px;
    min-height: 72px;
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
}
.route-week-row.today { margin: 3px 0; background: var(--primary-soft); border: 1px solid var(--primary); border-radius: 14px; }
.route-week-date { display: flex; flex-direction: column; gap: 4px; }
.route-week-date strong { color: var(--primary); font-size: 16px; }
.route-week-date span { color: var(--text-muted); font-size: 11px; }
.route-week-state { font-size: 11px; font-weight: 800; }
.route-week-state.broadcast { color: var(--success); }
.route-week-state.collaboration { color: var(--collaboration); }
.route-week-state.off { color: var(--danger); }
.route-week-state.none { color: var(--text-muted); }
.route-week-content p { margin: 6px 0 0; color: var(--text-muted); font-size: 12px; white-space: pre-wrap; }
@media (max-width: 760px) {
    .route-page { padding: 16px 16px 96px; }
    .route-page-header { align-items: flex-start; }
    .route-page-header h2 { font-size: 22px; }
    .route-page-body { padding: 16px; border-radius: 16px; }
    .route-song-row { grid-template-columns: 34px minmax(0,1fr) auto; gap: 9px; }
    .route-song-genre, .route-song-difficulty { display: none; }
    .route-week-head { grid-template-columns: 1fr 1fr; }
    .route-week-title { grid-column: 1 / -1; grid-row: 1; }
    .route-week-head > button { width: 100%; }
    .route-week-row { grid-template-columns: 48px 54px minmax(0,1fr); gap: 9px; min-height: 66px; padding: 10px 5px; }
}


/* 모바일 화면 최적화 보강 */
@media (max-width: 760px) {
    body {
        background: var(--background);
        padding-bottom: 86px;
    }

    .top-header {
        min-height: 58px;
        gap: 8px;
        padding: 9px 12px;
    }

    .notice-bar {
        padding: 10px 12px;
        border-radius: 12px;
        font-size: 12px;
    }

    .notice-bar strong {
        flex: 0 0 auto;
    }

    .theme-button {
        width: 42px;
        height: 42px;
        padding: 0;
        border-radius: 12px;
    }

    .main-content {
        padding: 12px 12px 22px;
    }

    /* 모바일 홈 프로필 복원 및 정리 */
    body[data-mobile-page="home"] .profile-summary,
    body:not([data-mobile-page]) .profile-summary {
        display: grid !important;
    }

    .profile-summary {
        grid-template-columns: 76px minmax(0, 1fr);
        align-items: start;
        gap: 14px;
        margin-bottom: 12px;
        padding: 17px;
        border-radius: 18px;
    }

    .summary-profile-image {
        width: 76px;
        height: 76px;
        font-size: 14px;
        box-shadow: 0 8px 22px color-mix(in srgb, var(--primary) 20%, transparent);
    }

    .profile-text {
        min-width: 0;
    }

    .profile-text .small-title {
        margin-bottom: 3px;
        font-size: 9px;
        letter-spacing: .7px;
    }

    .profile-text h2 {
        margin: 2px 0 6px;
        font-size: 20px;
    }

    .profile-text > p:not(.small-title) {
        display: -webkit-box;
        overflow: hidden;
        margin: 0;
        font-size: 12px;
        line-height: 1.55;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
    }

    .tag-list {
        grid-column: 1 / -1;
        gap: 6px;
        margin-top: 12px;
    }

    .tag-list span {
        padding: 5px 9px;
        font-size: 10px;
    }

    .mobile-home-summary {
        gap: 10px;
    }

    .mobile-summary-card {
        padding: 15px 16px;
        border-radius: 17px;
        box-shadow: none;
    }

    .mobile-summary-card h2 {
        font-size: 15px;
    }

    .mobile-summary-header {
        align-items: center;
    }

    .mobile-jump-button {
        min-height: 34px;
        padding: 7px 10px;
    }

    .mobile-song-preview {
        gap: 0;
        margin-top: 10px;
    }

    .mobile-song-preview span {
        display: block;
        overflow: hidden;
        padding: 9px 0;
        border-bottom: 1px solid var(--border);
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .mobile-song-preview span:last-child {
        border-bottom: 0;
    }

    /* 전용 페이지 헤더 */
    .route-page {
        min-height: calc(100vh - 58px);
        padding: 12px 12px 94px;
    }

    .route-page-header {
        position: sticky;
        top: 58px;
        z-index: 20;
        align-items: center;
        gap: 10px;
        margin: 0 -12px 12px;
        padding: 11px 12px;
        background: color-mix(in srgb, var(--background) 94%, transparent);
        border-bottom: 1px solid var(--border);
        backdrop-filter: blur(14px);
    }

    .route-page-kicker {
        display: none;
    }

    .route-page-header h2 {
        font-size: 20px;
    }

    .route-home-button {
        min-height: 40px;
        padding: 8px 11px;
        white-space: nowrap;
    }

    .route-page-body {
        padding: 0;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    /* 모바일 노래책 */
    .route-toolbar {
        position: sticky;
        top: 118px;
        z-index: 15;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        margin: 0 0 10px;
        padding: 10px 0;
        background: var(--background);
    }

    .route-toolbar input {
        grid-column: 1 / -1;
        width: 100%;
        min-height: 44px;
        flex: none;
    }

    .route-toolbar select,
    .route-toolbar button {
        width: 100%;
        min-height: 40px;
    }

    .route-song-list {
        gap: 9px;
    }

    .route-song-row {
        display: grid;
        grid-template-columns: 38px minmax(0, 1fr) auto;
        grid-template-areas:
            "favorite main status"
            "favorite meta status";
        align-items: center;
        gap: 4px 9px;
        min-height: 78px;
        padding: 11px 12px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 15px;
    }

    .route-song-row .favorite-button {
        grid-area: favorite;
        width: 38px;
        height: 48px;
    }

    .route-song-main {
        grid-area: main;
        gap: 4px;
    }

    .route-song-main strong {
        font-size: 14px;
    }

    .route-song-main span {
        font-size: 11px;
    }

    .route-song-genre {
        display: inline-flex !important;
        grid-area: meta;
        justify-self: start;
        width: auto;
        padding: 3px 7px;
        background: var(--background-soft);
        border-radius: 999px;
        font-size: 10px;
    }

    .route-song-difficulty {
        display: none !important;
    }

    .route-song-row .song-status {
        grid-area: status;
        max-width: 68px;
        padding: 6px 8px;
        white-space: nowrap;
    }

    /* 모바일 일정 */
    .route-week-head {
        gap: 8px;
        margin-bottom: 10px;
    }

    .route-week-title h3 {
        font-size: 15px;
    }

    .route-week-list {
        gap: 8px;
    }

    .route-week-row {
        grid-template-columns: 48px 52px minmax(0, 1fr);
        gap: 8px;
        min-height: 68px;
        padding: 11px 10px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 14px;
    }

    .route-week-row.today {
        margin: 0;
        box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 12%, transparent);
    }

    .route-week-content strong {
        display: block;
        overflow: hidden;
        font-size: 13px;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .route-week-content p {
        display: -webkit-box;
        overflow: hidden;
        margin-top: 4px;
        line-height: 1.45;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    /* 모바일 노래 숙제 */
    .route-homework-tabs {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        padding: 4px;
        background: var(--background-soft);
        border-radius: 13px;
    }

    .route-homework-list {
        gap: 9px;
    }

    .route-homework-row {
        min-height: 72px;
        padding: 12px 13px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 14px;
    }

    .route-homework-row strong {
        font-size: 14px;
    }

    .route-homework-row time {
        flex: 0 0 auto;
        padding-left: 8px;
    }

    .mobile-bottom-nav {
        right: 8px;
        bottom: 8px;
        left: 8px;
        border-radius: 18px;
    }
}

@media (max-width: 390px) {
    .profile-summary {
        grid-template-columns: 64px minmax(0, 1fr);
        padding: 14px;
    }
    .summary-profile-image {
        width: 64px;
        height: 64px;
    }
    .route-song-row {
        grid-template-columns: 34px minmax(0,1fr) auto;
        padding: 10px 9px;
    }
    .route-week-row {
        grid-template-columns: 42px 46px minmax(0, 1fr);
        padding: 10px 7px;
    }
}

/* 노래책 전용 페이지: 제목·가수·장르·난이도·상태를 칸별로 분리 */
.route-song-table { min-width: 0; }
.route-song-header,
.route-song-row {
    display: grid;
    grid-template-columns: 38px minmax(150px, 1.45fr) minmax(110px, 1fr) 100px 90px 92px;
    align-items: center;
    gap: 12px;
}
.route-song-header {
    min-height: 42px;
    padding: 0 4px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    font-weight: 700;
}
.route-song-header span:first-child { text-align: center; }
.route-song-row { min-height: 62px; }
.route-song-title,
.route-song-artist,
.route-song-meta {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.route-song-title { color: var(--text); font-size: 13px; }
.route-song-artist,
.route-song-meta { color: var(--text-muted); font-size: 12px; }

@media (max-width: 760px) {
    .route-song-table { overflow-x: hidden; }
    .route-song-header,
    .route-song-row {
        grid-template-columns: 28px minmax(0, 1.35fr) minmax(0, 1fr) minmax(42px, .78fr) minmax(46px, .82fr) minmax(52px, .9fr);
        gap: 5px;
    }
    .route-song-header {
        min-height: 38px;
        padding: 0 2px;
        font-size: 9px;
        text-align: center;
    }
    .route-song-row {
        grid-template-areas: none;
        min-height: 58px;
        padding: 8px 2px;
        background: transparent;
        border: 0;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
    }
    .route-song-row .favorite-button,
    .route-song-title,
    .route-song-artist,
    .route-song-genre,
    .route-song-difficulty,
    .route-song-row .song-status { grid-area: auto; }
    .route-song-row .favorite-button {
        width: 28px;
        height: 40px;
        font-size: 20px;
    }
    .route-song-title,
    .route-song-artist,
    .route-song-meta {
        display: block !important;
        width: auto;
        padding: 0;
        background: transparent;
        border-radius: 0;
        font-size: 10px;
        text-align: center;
    }
    .route-song-title {
        color: var(--text);
        font-size: 11px;
        font-weight: 700;
        text-align: left;
    }
    .route-song-artist { text-align: left; }
    .route-song-difficulty { display: block !important; }
    .route-song-row .song-status {
        max-width: none;
        padding: 4px 3px;
        font-size: 9px;
        text-align: center;
        white-space: nowrap;
    }
}

/* 노래책 제목·가수 정렬 버튼 */
.route-song-star-head {
    text-align: center;
    color: var(--primary);
}

.route-sort-button {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    width: fit-content;
    min-height: 30px;
    padding: 5px 9px;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .12s ease;
}

.route-sort-button:hover {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: color-mix(in srgb, var(--primary) 24%, transparent);
}

.route-sort-button:active {
    transform: scale(.96);
}

.route-sort-button.active {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: color-mix(in srgb, var(--primary) 32%, transparent);
}

.route-sort-icon {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    color: currentColor;
    background: color-mix(in srgb, var(--surface) 78%, transparent);
    border-radius: 50%;
    font-size: 11px;
    line-height: 1;
}

.route-song-row:nth-child(even) {
    background: color-mix(in srgb, var(--primary-soft) 30%, transparent);
}

.route-song-row:hover {
    background: color-mix(in srgb, var(--primary-soft) 52%, transparent);
}

@media (max-width: 760px) {
    .route-sort-button {
        justify-content: center;
        width: 100%;
        min-height: 28px;
        padding: 4px 3px;
        gap: 2px;
        font-size: 9px;
    }

    .route-sort-icon {
        width: 15px;
        height: 15px;
        font-size: 9px;
    }

    .route-song-row:nth-child(even) {
        background: color-mix(in srgb, var(--primary-soft) 22%, transparent);
    }
}

/* 노래책 전체/간편 보기 전환 */
.route-view-toggle {
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    flex: 0 0 auto;
    padding: 3px;
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
}
.route-view-toggle button {
    min-height: 34px;
    padding: 6px 12px;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: color .18s ease, background-color .18s ease, transform .12s ease;
}
.route-view-toggle button:active { transform: scale(.96); }
.route-view-toggle button.active {
    color: white;
    background: linear-gradient(135deg, var(--primary), #7446c7);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 24%, transparent);
}

/* 간편 모드: 즐겨찾기 · 제목 · 가수 · 난이도 */
.route-song-table.compact-mode .route-song-header,
.route-song-table.compact-mode .route-song-row {
    grid-template-columns: 42px minmax(180px, 1.6fr) minmax(140px, 1.2fr) 110px;
    gap: 14px;
}
.route-song-table.compact-mode .route-song-header > span:nth-child(4),
.route-song-table.compact-mode .route-song-header > span:nth-child(6),
.route-song-table.compact-mode .route-song-genre,
.route-song-table.compact-mode .song-status {
    display: none !important;
}
.route-song-table.compact-mode .route-song-star-head { grid-column: 1; }
.route-song-table.compact-mode .route-song-header .route-sort-button:nth-of-type(1) { grid-column: 2; }
.route-song-table.compact-mode .route-song-header .route-sort-button:nth-of-type(2) { grid-column: 3; }
.route-song-table.compact-mode .route-song-header > span:nth-child(5) { grid-column: 4; }
.route-song-table.compact-mode .route-song-row {
    min-height: 58px;
    padding-inline: 12px;
    border-radius: 12px;
}
.route-song-table.compact-mode .route-song-title {
    font-size: 14px;
    font-weight: 800;
}
.route-song-table.compact-mode .route-song-artist,
.route-song-table.compact-mode .route-song-difficulty {
    font-size: 13px;
}
.route-song-table.compact-mode .route-song-difficulty {
    display: inline-flex !important;
    justify-content: center;
    padding: 5px 8px;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 999px;
    font-weight: 800;
}

@media (max-width: 760px) {
    .route-toolbar { align-items: stretch; }
    .route-view-toggle { width: 100%; }
    .route-view-toggle button { min-height: 38px; font-size: 12px; }
    .route-song-table.compact-mode .route-song-header,
    .route-song-table.compact-mode .route-song-row {
        grid-template-columns: 32px minmax(0, 1.35fr) minmax(0, 1fr) 68px;
        gap: 7px;
    }
    .route-song-table.compact-mode .route-song-header {
        padding: 0 8px;
        font-size: 10px;
    }
    .route-song-table.compact-mode .route-song-row {
        min-height: 62px;
        padding: 10px 8px;
        border: 1px solid var(--border);
        border-radius: 13px;
        margin-bottom: 8px;
    }
    .route-song-table.compact-mode .route-song-title {
        font-size: 12px;
        text-align: left;
    }
    .route-song-table.compact-mode .route-song-artist {
        font-size: 11px;
        text-align: left;
    }
    .route-song-table.compact-mode .route-song-difficulty {
        font-size: 10px;
        text-align: center;
    }
}


/* 전용 페이지 상단 액션 */
.route-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.route-view-toggle-mobile { display: none; }

@media (max-width: 760px) {
    .route-page-header {
        align-items: center;
        gap: 10px;
    }
    .route-header-actions {
        margin-left: auto;
        gap: 7px;
        flex-shrink: 0;
    }
    .route-view-toggle-mobile:not([hidden]) {
        display: inline-grid;
        width: auto;
        grid-template-columns: auto auto;
        padding: 2px;
    }
    .route-view-toggle-mobile button {
        min-height: 34px;
        padding: 5px 9px;
        font-size: 11px;
    }
    .route-page-body .route-view-toggle {
        display: none;
    }
    .route-home-button {
        min-height: 38px;
        padding: 7px 10px;
        white-space: nowrap;
    }
}

@media (max-width: 390px) {
    .route-page-header > div:first-child .route-page-kicker { display: none; }
    .route-page-header h2 { font-size: 19px; }
    .route-view-toggle-mobile button { padding-inline: 7px; font-size: 10px; }
    .route-home-button { padding-inline: 8px; font-size: 11px; }
}

/* 노래책 목록: 고정 헤더 + 가로 확장/스크롤 */
.route-song-table {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--primary) 45%, transparent) transparent;
}

.route-song-table::-webkit-scrollbar {
    height: 8px;
}

.route-song-table::-webkit-scrollbar-track {
    background: transparent;
}

.route-song-table::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--primary) 42%, transparent);
    border-radius: 999px;
}

.route-song-header,
.route-song-list {
    min-width: 860px;
}

.route-song-header,
.route-song-row {
    grid-template-columns: 42px minmax(270px, 1.8fr) minmax(150px, 1fr) 110px 100px 100px;
}

.route-song-header {
    position: sticky;
    top: 76px;
    z-index: 18;
    padding: 7px 8px;
    background: color-mix(in srgb, var(--surface) 97%, transparent);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 18px color-mix(in srgb, var(--background) 72%, transparent);
    backdrop-filter: blur(12px);
}

.route-song-title {
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
    overflow-wrap: anywhere;
    line-height: 1.42;
}

.route-song-row {
    min-height: 66px;
}

.route-song-table.compact-mode .route-song-header,
.route-song-table.compact-mode .route-song-list {
    min-width: 700px;
}

.route-song-table.compact-mode .route-song-header,
.route-song-table.compact-mode .route-song-row {
    grid-template-columns: 42px minmax(300px, 1.8fr) minmax(180px, 1fr) 110px;
}

@media (max-width: 760px) {
    .route-song-table {
        margin-inline: 0;
        padding-bottom: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .route-song-header,
    .route-song-list {
        min-width: 780px;
    }

    .route-song-header,
    .route-song-row {
        grid-template-columns: 36px minmax(260px, 1.7fr) minmax(145px, 1fr) 92px 84px 92px;
        gap: 8px;
    }

    .route-song-header {
        top: 116px;
        min-height: 42px;
        padding: 6px 8px;
        font-size: 10px;
        text-align: left;
    }

    .route-song-row {
        min-height: 64px;
        padding: 9px 8px;
    }

    .route-song-title {
        font-size: 12px;
        text-align: left;
    }

    .route-song-artist,
    .route-song-meta {
        font-size: 11px;
        text-align: left;
    }

    .route-song-table.compact-mode .route-song-header,
    .route-song-table.compact-mode .route-song-list {
        min-width: 650px;
    }

    .route-song-table.compact-mode .route-song-header,
    .route-song-table.compact-mode .route-song-row {
        grid-template-columns: 36px minmax(280px, 1.8fr) minmax(160px, 1fr) 100px;
        gap: 8px;
    }

    .route-song-table::after {
        content: "← 좌우로 밀어 긴 제목 보기 →";
        position: sticky;
        left: 0;
        display: block;
        width: max-content;
        margin: 8px auto 0;
        padding: 4px 9px;
        color: var(--text-muted);
        background: var(--background-soft);
        border-radius: 999px;
        font-size: 9px;
        pointer-events: none;
    }
}

/* 2026-08-03 노래책 레이아웃 복구: 고정 헤더는 유지하고 표 깨짐/과도한 가로폭 제거 */
.route-song-table,
.route-song-table.compact-mode {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: visible;
    padding-bottom: 0;
}

.route-song-table::after {
    content: none !important;
    display: none !important;
}

.route-song-header,
.route-song-list,
.route-song-table.compact-mode .route-song-header,
.route-song-table.compact-mode .route-song-list {
    width: 100%;
    min-width: 0;
}

.route-song-header {
    position: sticky;
    top: 76px;
    z-index: 30;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 7px 18px rgba(30, 20, 50, .10);
    backdrop-filter: blur(12px);
}

.route-song-row {
    width: 100%;
    max-width: 100%;
}

/* PC 전체 보기 */
.route-song-header,
.route-song-row {
    grid-template-columns: 42px minmax(220px, 1.7fr) minmax(130px, 1fr) 96px 88px 92px;
    gap: 12px;
}

/* PC 간편 보기 */
.route-song-table.compact-mode .route-song-header,
.route-song-table.compact-mode .route-song-row {
    grid-template-columns: 42px minmax(260px, 1.8fr) minmax(160px, 1fr) 100px;
    gap: 14px;
}

.route-song-title,
.route-song-artist {
    min-width: 0;
}

.route-song-title {
    overflow: visible;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: keep-all;
    line-height: 1.45;
}

.route-song-artist,
.route-song-meta,
.route-song-row .song-status {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

@media (max-width: 760px) {
    .route-song-table,
    .route-song-table.compact-mode {
        overflow-x: hidden;
        -webkit-overflow-scrolling: auto;
    }

    .route-song-header {
        top: 78px;
        min-height: 42px;
        padding: 5px 6px;
        border-radius: 11px;
        font-size: 10px;
    }

    /* 모바일 전체 보기: 화면 안에서 모든 칸이 정돈되도록 */
    .route-song-header,
    .route-song-row {
        grid-template-columns: 30px minmax(92px, 1.65fr) minmax(62px, 1fr) 52px 54px 58px;
        gap: 5px;
    }

    .route-song-row {
        min-height: 64px;
        padding: 9px 6px;
        margin: 0;
        border: 0;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
        background: transparent;
    }

    .route-song-row:nth-child(even) {
        background: color-mix(in srgb, var(--primary-soft) 18%, transparent);
    }

    .route-song-title {
        font-size: 12px;
        font-weight: 800;
        text-align: left;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: keep-all;
        line-height: 1.35;
    }

    .route-song-artist,
    .route-song-meta,
    .route-song-row .song-status {
        font-size: 10px;
        text-align: center;
    }

    /* 모바일 간편 보기: 즐겨찾기 + 제목 + 가수 + 난이도 */
    .route-song-table.compact-mode .route-song-header,
    .route-song-table.compact-mode .route-song-row {
        grid-template-columns: 30px minmax(130px, 1.8fr) minmax(78px, 1fr) 62px;
        gap: 7px;
    }

    .route-song-table.compact-mode .route-song-header {
        padding: 5px 7px;
    }

    .route-song-table.compact-mode .route-song-row {
        min-height: 62px;
        padding: 9px 7px;
        margin: 0;
        border: 0;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
    }

    .route-song-table.compact-mode .route-song-title {
        font-size: 12px;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: keep-all;
        line-height: 1.35;
    }

    .route-song-table.compact-mode .route-song-artist,
    .route-song-table.compact-mode .route-song-difficulty {
        font-size: 10px;
        text-align: center;
    }

    .route-song-table.compact-mode .route-song-difficulty {
        padding: 4px 5px;
    }
}

@media (max-width: 390px) {
    .route-song-header,
    .route-song-row {
        grid-template-columns: 28px minmax(82px, 1.6fr) minmax(54px, .95fr) 46px 48px 52px;
        gap: 4px;
    }

    .route-song-table.compact-mode .route-song-header,
    .route-song-table.compact-mode .route-song-row {
        grid-template-columns: 28px minmax(112px, 1.75fr) minmax(68px, 1fr) 56px;
        gap: 5px;
    }

    .route-song-title { font-size: 11px; }
    .route-song-artist,
    .route-song-meta,
    .route-song-row .song-status { font-size: 9px; }
}

/* 모바일 노래책 헤더 위치 복구
   - 검색/필터 영역은 일반 흐름으로 스크롤
   - 칼럼 헤더는 원래 자리에서 시작해 페이지 헤더 아래에 자연스럽게 고정 */
@media (max-width: 760px) {
    body[data-mobile-page="songbook"] .route-toolbar {
        position: static;
        top: auto;
        z-index: auto;
        margin-bottom: 0;
        padding: 10px 0 12px;
        background: transparent;
    }

    body[data-mobile-page="songbook"] .route-song-table,
    body[data-mobile-page="songbook"] .route-song-table.compact-mode {
        position: relative;
        margin-top: 0;
        overflow: visible;
    }

    body[data-mobile-page="songbook"] .route-song-header {
        position: sticky;
        top: 118px;
        z-index: 19;
        width: 100%;
        margin: 0;
        padding: 6px;
        border: 1px solid var(--border);
        border-radius: 12px 12px 0 0;
        background: color-mix(in srgb, var(--surface) 98%, transparent);
        box-shadow: 0 5px 14px rgba(30, 20, 50, .08);
        backdrop-filter: blur(12px);
    }

    body[data-mobile-page="songbook"] .route-song-list {
        margin-top: 0;
        border-right: 1px solid var(--border);
        border-left: 1px solid var(--border);
        border-radius: 0 0 12px 12px;
        overflow: hidden;
    }

    body[data-mobile-page="songbook"] .route-song-row:last-child {
        border-bottom: 1px solid var(--border);
        border-radius: 0 0 12px 12px;
    }
}

@media (max-width: 390px) {
    body[data-mobile-page="songbook"] .route-song-header {
        top: 114px;
    }
}

/* =========================================================
   2026-08-03 스크롤 UX 통합 개선
   - PC/모바일 고정 헤더의 겹침 방지
   - 스크롤 중 자연스러운 배경/그림자 전환
   - 최상단 이동 버튼
   ========================================================= */

:root {
    --global-sticky-height: 76px;
    --route-sticky-height: 76px;
    --song-column-sticky-top: 152px;
}

/* 기본 상단 헤더는 스크롤 중에도 내용과 자연스럽게 구분됩니다. */
.top-header,
.route-page-header,
.route-song-header {
    transition:
        background-color .2s ease,
        border-color .2s ease,
        box-shadow .2s ease,
        backdrop-filter .2s ease;
}

.top-header.is-scrolled,
body.page-is-scrolled .top-header {
    background: color-mix(in srgb, var(--background) 92%, transparent);
    box-shadow: 0 8px 22px rgba(25, 16, 45, .09);
    backdrop-filter: blur(18px) saturate(1.15);
}

/* 전용 페이지 상단 헤더: PC에서도 고정하고 전역 헤더 바로 아래에 배치 */
.route-page-header {
    position: sticky;
    top: var(--global-sticky-height);
    z-index: 42;
    min-height: var(--route-sticky-height);
    margin: -12px -8px 18px;
    padding: 14px 16px;
    background: color-mix(in srgb, var(--background) 96%, transparent);
    border: 1px solid transparent;
    border-bottom-color: var(--border);
    border-radius: 0 0 16px 16px;
    backdrop-filter: blur(18px) saturate(1.12);
}

.route-page-header.is-scrolled,
body.page-is-scrolled .route-page-header {
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border-color: var(--border);
    box-shadow: 0 10px 25px rgba(28, 18, 48, .11);
}

/* 노래책 칼럼 헤더는 전용 페이지 헤더 바로 아래에 붙습니다. */
.route-song-header,
body[data-mobile-page="songbook"] .route-song-header {
    top: var(--song-column-sticky-top);
    z-index: 38;
    margin: 0;
    border-radius: 12px 12px 0 0;
    background: color-mix(in srgb, var(--surface) 97%, transparent);
    box-shadow: 0 6px 16px rgba(27, 18, 48, .08);
    backdrop-filter: blur(16px) saturate(1.1);
}

body.page-is-scrolled .route-song-header {
    border-color: color-mix(in srgb, var(--primary) 20%, var(--border));
    box-shadow: 0 8px 20px rgba(28, 18, 48, .12);
}

/* 목록 시작부가 고정 헤더와 한 덩어리처럼 보이게 연결 */
.route-song-list,
body[data-mobile-page="songbook"] .route-song-list {
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 0 13px 13px;
    overflow: hidden;
}

.route-song-row:last-child {
    border-bottom: 0;
}

/* 고정 영역으로 이동했을 때 콘텐츠가 헤더 뒤에 숨지 않도록 */
.route-page-body,
#scheduleSection,
#songbookSection,
#homeworkSection {
    scroll-margin-top: calc(var(--song-column-sticky-top) + 16px);
}

/* 최상단 이동 버튼 */
.scroll-top-button {
    position: fixed;
    right: 24px;
    bottom: 64px;
    z-index: 120;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    color: white;
    background: linear-gradient(145deg, var(--primary), #7041ba);
    border: 1px solid color-mix(in srgb, white 24%, transparent);
    border-radius: 16px;
    box-shadow: 0 12px 28px color-mix(in srgb, var(--primary) 28%, transparent);
    font-size: 23px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(14px) scale(.92);
    transition:
        opacity .2s ease,
        visibility .2s ease,
        transform .2s ease,
        box-shadow .2s ease;
}

.scroll-top-button.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.scroll-top-button:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 15px 32px color-mix(in srgb, var(--primary) 38%, transparent);
}

.scroll-top-button:active {
    transform: translateY(0) scale(.95);
}

.scroll-top-button:focus-visible {
    outline: 3px solid var(--primary-soft);
    outline-offset: 3px;
}

@media (max-width: 1150px) and (min-width: 761px) {
    :root {
        --route-sticky-height: 72px;
        --song-column-sticky-top: 148px;
    }

    .route-page-header {
        min-height: var(--route-sticky-height);
    }
}

@media (max-width: 760px) {
    :root {
        --global-sticky-height: 58px;
        --route-sticky-height: 60px;
        --song-column-sticky-top: 118px;
    }

    .route-page-header {
        top: var(--global-sticky-height);
        min-height: var(--route-sticky-height);
        margin: 0 -12px 12px;
        padding: 9px 12px;
        border-right: 0;
        border-left: 0;
        border-radius: 0 0 14px 14px;
    }

    .route-page-header.is-scrolled,
    body.page-is-scrolled .route-page-header {
        box-shadow: 0 7px 18px rgba(28, 18, 48, .10);
    }

    .route-song-header,
    body[data-mobile-page="songbook"] .route-song-header {
        top: var(--song-column-sticky-top);
        border-radius: 10px 10px 0 0;
        box-shadow: 0 5px 13px rgba(28, 18, 48, .08);
    }

    .scroll-top-button {
        right: 14px;
        bottom: calc(104px + env(safe-area-inset-bottom));
        width: 44px;
        height: 44px;
        border-radius: 15px;
        font-size: 21px;
    }
}

@media (max-width: 390px) {
    :root {
        --song-column-sticky-top: 114px;
    }

    .scroll-top-button {
        right: 12px;
        width: 42px;
        height: 42px;
    }
}

/* 움직임 최소화 설정을 사용하는 환경 */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .scroll-top-button,
    .top-header,
    .route-page-header,
    .route-song-header {
        transition: none;
    }
}

/* 방송 일정 전용 페이지: 관리자에서 등록한 내용을 생략 없이 표시 */
.route-page[data-route="schedule"] .route-week-row,
body[data-mobile-page="schedule"] .route-week-row {
    align-items: start;
}

.route-page[data-route="schedule"] .route-week-content,
body[data-mobile-page="schedule"] .route-week-content {
    min-width: 0;
}

.route-page[data-route="schedule"] .route-week-content strong,
body[data-mobile-page="schedule"] .route-week-content strong {
    display: block;
    overflow: visible;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    text-overflow: clip;
    line-height: 1.55;
}

.route-week-time {
    display: inline-flex;
    align-items: center;
    margin: 0 0 6px;
    padding: 4px 8px;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.route-page[data-route="schedule"] .route-week-content p,
body[data-mobile-page="schedule"] .route-week-content p {
    display: block;
    overflow: visible;
    margin: 8px 0 0;
    padding-top: 8px;
    color: var(--text-muted);
    border-top: 1px dashed var(--border);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.55;
    -webkit-line-clamp: unset;
}

.route-week-note-label {
    display: inline-block;
    margin-right: 7px;
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
}

@media (max-width: 760px) {
    body[data-mobile-page="schedule"] .route-week-row {
        min-height: 0;
        padding: 13px 11px;
    }

    body[data-mobile-page="schedule"] .route-week-content strong {
        font-size: 13px;
    }
}

/* 공지사항 */
.route-notice-list {
    display: grid;
    gap: 12px;
}

.route-notice-item {
    overflow: hidden;
    border: 1px solid var(--border-color, rgba(119, 86, 160, 0.18));
    border-radius: 16px;
    background: var(--card-bg, #fff);
    box-shadow: 0 10px 26px rgba(73, 49, 104, 0.06);
}

.route-notice-item.pinned {
    border-color: rgba(141, 92, 220, 0.36);
}

.route-notice-summary {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    padding: 17px 18px;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.route-notice-summary strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notice-category {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(137, 91, 215, 0.12);
    color: #7650b4;
    font-size: 12px;
    font-weight: 800;
}

.route-notice-summary time {
    color: var(--muted-text, #8b8494);
    font-size: 13px;
    white-space: nowrap;
}

.notice-chevron {
    transition: transform .2s ease;
}

.route-notice-item.open .notice-chevron {
    transform: rotate(180deg);
}

.route-notice-content {
    padding: 0 18px 18px;
    border-top: 1px solid rgba(119, 86, 160, 0.12);
    white-space: pre-wrap;
    line-height: 1.75;
    color: var(--body-text, #514b59);
}

.route-notice-content:not([hidden]) {
    padding-top: 17px;
}

.notice-option-row {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin: 14px 0 4px;
}

.admin-check-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.admin-check-field input {
    width: 18px;
    height: 18px;
}

.admin-notice-list {
    display: grid;
    gap: 10px;
}

.admin-notice-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid rgba(119, 86, 160, 0.16);
    border-radius: 14px;
    background: rgba(255,255,255,.55);
}

.admin-notice-item > div {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.admin-notice-item strong,
.admin-notice-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-notice-item span {
    color: var(--muted-text, #8b8494);
    font-size: 13px;
}

body.dark-mode .route-notice-item,
body.dark-mode .admin-notice-item {
    background: rgba(31, 27, 39, .94);
}

@media (max-width: 760px) {
    .route-notice-summary {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 9px;
        padding: 14px;
    }

    .route-notice-summary time {
        grid-column: 2;
        grid-row: 2;
        font-size: 12px;
    }

    .notice-chevron {
        grid-column: 3;
        grid-row: 1 / span 2;
    }

    .route-notice-summary strong {
        white-space: normal;
        line-height: 1.35;
    }

    .route-notice-content {
        padding-left: 14px;
        padding-right: 14px;
    }

    .admin-notice-item {
        align-items: flex-start;
    }
}


/* 노래책 제목 옆 전용 공지 */
.route-title-line {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.songbook-notice-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid rgba(139, 92, 246, 0.28);
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.10);
    color: var(--primary-color, #7c3aed);
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.songbook-notice-chip:hover,
.songbook-notice-chip.active {
    background: rgba(139, 92, 246, 0.18);
    box-shadow: 0 8px 22px rgba(76, 29, 149, 0.12);
    transform: translateY(-1px);
}

.songbook-inline-notice {
    margin: 0 0 14px;
    padding: 15px 17px;
    border: 1px solid rgba(139, 92, 246, 0.22);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.10), rgba(236, 72, 153, 0.06));
}

.songbook-inline-notice-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.songbook-inline-notice-head > div {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.songbook-inline-notice-head strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.songbook-inline-notice-head time {
    color: var(--text-subtle, #777);
    font-size: 12px;
    white-space: nowrap;
}

.songbook-inline-notice p {
    margin: 10px 0 0;
    color: var(--text-secondary, #555);
    line-height: 1.65;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

body.dark-mode .songbook-notice-chip {
    border-color: rgba(196, 181, 253, 0.30);
    background: rgba(139, 92, 246, 0.16);
    color: #ddd6fe;
}

body.dark-mode .songbook-inline-notice {
    border-color: rgba(196, 181, 253, 0.20);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.17), rgba(190, 24, 93, 0.09));
}

@media (max-width: 760px) {
    .route-title-line { gap: 7px; }
    .songbook-notice-chip {
        min-height: 30px;
        padding: 5px 9px;
        font-size: 11px;
    }
    .songbook-inline-notice {
        margin-bottom: 10px;
        padding: 12px 13px;
        border-radius: 13px;
    }
    .songbook-inline-notice-head { align-items: flex-start; }
    .songbook-inline-notice-head > div { align-items: flex-start; flex-wrap: wrap; gap: 6px; }
    .songbook-inline-notice-head strong { white-space: normal; }
    .songbook-inline-notice p { font-size: 13px; line-height: 1.6; }
}

/* 노래책 전용 공지는 노래책 페이지에서만 표시 */
.songbook-notice-chip[hidden] {
    display: none !important;
}

/* 노래책 공지 펼침 영역 - 다크모드 가독성 보정 */
body.dark-mode .songbook-inline-notice {
    border-color: rgba(196, 181, 253, 0.36);
    background: linear-gradient(135deg, rgba(76, 29, 149, 0.50), rgba(76, 29, 149, 0.30));
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

body.dark-mode .songbook-inline-notice-head strong {
    color: #ffffff;
}

body.dark-mode .songbook-inline-notice-head time {
    color: #d8d2e7;
}

body.dark-mode .songbook-inline-notice .notice-category {
    border-color: rgba(221, 214, 254, 0.34);
    background: rgba(221, 214, 254, 0.14);
    color: #ede9fe;
}

body.dark-mode .songbook-inline-notice p {
    color: #f1edf8;
}

body.dark-mode .songbook-inline-notice a {
    color: #c4b5fd;
}


/* 선택형 회원 로그인 화면 */
.top-header-actions { display:flex; align-items:center; gap:10px; flex-shrink:0; }
.member-login-button { border:1px solid var(--border-color); background:var(--card-bg); color:var(--text-main); border-radius:999px; padding:10px 16px; font-weight:800; cursor:pointer; }
.member-login-button:hover { transform:translateY(-1px); border-color:var(--primary); }
.member-overlay { position:fixed; inset:0; z-index:1300; display:grid; place-items:center; padding:20px; background:rgba(10, 8, 18, 0.84); backdrop-filter:blur(3px); }
.member-overlay[hidden] { display:none !important; }
.member-panel {
    width:min(520px,100%);
    max-height:min(780px,calc(100vh - 40px));
    overflow:auto;
    border:1px solid var(--border-color);
    border-radius:24px;
    padding:24px;
    background:#ffffff;
    color:var(--text-main);
    box-shadow:0 26px 80px rgba(0,0,0,.34);
}
.member-panel-header { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:18px; }
.member-panel-header h2 { margin:3px 0 0; }
.member-close-button { width:40px; height:40px; border:0; border-radius:50%; background:var(--soft-bg); color:var(--text-main); font-size:26px; cursor:pointer; }
.member-benefit-card {
    padding:16px;
    border:1px solid color-mix(in srgb,var(--primary) 26%,var(--border-color));
    border-radius:18px;
    background:#fbf8ff;
}
.member-benefit-card strong { color:var(--text-main); }
.member-benefit-card p { margin:7px 0 0; color:var(--text-sub); line-height:1.65; }
.member-auth-tabs { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:18px 0; padding:5px; border-radius:14px; background:var(--soft-bg); }
.member-auth-tab { border:0; border-radius:10px; padding:11px; background:transparent; color:var(--text-sub); font-weight:800; cursor:pointer; }
.member-auth-tab.active { background:#ffffff; color:var(--primary); box-shadow:0 4px 14px rgba(0,0,0,.08); }
.member-auth-form { display:grid; gap:14px; }
.member-auth-form[hidden] { display:none !important; }
.member-auth-form label { display:grid; gap:7px; font-weight:800; }
.member-auth-form input { width:100%; border:1px solid var(--border-color); border-radius:12px; padding:12px 13px; background:#ffffff; color:var(--text-main); }
.member-auth-form input:disabled { opacity:.78; cursor:not-allowed; }
.member-security-note { margin:18px 0 0; padding-top:14px; border-top:1px solid var(--border-color); color:var(--text-sub); font-size:13px; line-height:1.6; }
body.member-open { overflow:hidden; }
[data-theme="dark"] .member-overlay { background:rgba(4, 4, 10, 0.86); backdrop-filter:blur(4px); }
[data-theme="dark"] .member-panel { background:#171322; color:#f8f5ff; border-color:#4b3d6a; }
[data-theme="dark"] .member-close-button { background:#261f35; color:#f8f5ff; }
[data-theme="dark"] .member-benefit-card { background:#211a31; border-color:#5b477d; }
[data-theme="dark"] .member-benefit-card strong { color:#ffffff; }
[data-theme="dark"] .member-benefit-card p, [data-theme="dark"] .member-security-note { color:#ded7ef; }
[data-theme="dark"] .member-auth-tab.active { background:#221a31; color:#c4b5fd; }
[data-theme="dark"] .member-auth-form input { background:#110d1b; border-color:#493b64; color:#f8f5ff; }
@media (max-width:760px) {
  .top-header-actions { gap:6px; }
  .member-login-button { padding:8px 11px; font-size:12px; }
  .member-panel { padding:20px 16px; border-radius:20px; }
}

/* 회원가입 단미 퀴즈 */
.signup-quiz-card {
    display:grid;
    gap:14px;
    padding:16px;
    border:1px solid color-mix(in srgb,var(--primary) 26%,var(--border-color));
    border-radius:18px;
    background:#faf7ff;
}
.signup-quiz-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.signup-quiz-head strong { display:block; color:var(--text-main); font-size:15px; }
.signup-quiz-head p { margin:5px 0 0; color:var(--text-sub); font-size:12px; line-height:1.55; }
.signup-quiz-check { width:100%; }
.signup-quiz-message { min-height:20px; margin:0; color:var(--text-sub); font-size:12px; font-weight:700; }
.signup-quiz-message.success { color:#16a34a; }
.signup-quiz-message.error { color:#dc2626; }
.signup-profile-quiz-list {
    display:grid;
    grid-template-columns:1fr;
    gap:14px;
}
.signup-profile-quiz {
    margin:0;
    padding:14px;
    border:1px solid color-mix(in srgb,var(--primary) 18%,var(--border-color));
    border-radius:14px;
    background:#ffffff;
}
.signup-profile-quiz legend {
    padding:0 4px;
    color:var(--text-main);
    font-size:13px;
    font-weight:800;
    line-height:1.5;
}
.signup-profile-quiz label {
    position:relative;
    display:grid;
    grid-template-columns:18px 32px minmax(0,1fr);
    align-items:center;
    gap:10px;
    min-height:48px;
    margin-top:10px;
    padding:12px 14px;
    border:1px solid var(--border-color);
    border-radius:12px;
    background:#fafafa;
    cursor:pointer;
}
.signup-profile-quiz label:hover { border-color: var(--primary-color); background:#f7f2ff; }
.signup-profile-quiz input {
    margin:0;
    accent-color: var(--primary-color);
}
.quiz-choice-badge {
    display:grid;
    place-items:center;
    width:28px;
    height:28px;
    border-radius:999px;
    background:rgba(141, 92, 230, 0.12);
    color:var(--primary);
    font-size:12px;
    font-weight:800;
}
.quiz-choice-text {
    min-width:0;
    color:var(--text-main);
    font-size:13px;
    line-height:1.45;
}
[data-theme="dark"] .signup-quiz-card { background:#211a31; border-color:#5b477d; }
[data-theme="dark"] .signup-quiz-head strong { color:#ffffff; }
[data-theme="dark"] .signup-quiz-head p, [data-theme="dark"] .signup-quiz-message { color:#d7cfea; }
[data-theme="dark"] .signup-quiz-message.success { color:#86efac; }
[data-theme="dark"] .signup-quiz-message.error { color:#fca5a5; }
[data-theme="dark"] .signup-profile-quiz { background:#1a1426; border-color:#4d3d69; }
[data-theme="dark"] .signup-profile-quiz legend { color:#f8f5ff; }
[data-theme="dark"] .signup-profile-quiz label { background:#110d1b; border-color:#493b64; }
[data-theme="dark"] .signup-profile-quiz label:hover { border-color:#a78bfa; background:#171224; }
[data-theme="dark"] .quiz-choice-badge { background:rgba(167, 139, 250, 0.18); color:#ddd6fe; }
[data-theme="dark"] .quiz-choice-text { color:#f8f5ff; }
@media (max-width:760px) {
    .signup-profile-quiz label { grid-template-columns:18px 30px minmax(0,1fr); gap:9px; padding:11px 12px; }
    .quiz-choice-text { font-size:12px; }
}

.admin-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;

    display: grid;
    place-items: center;

    padding: 24px;
    background: rgba(5, 6, 13, 0.72);
    backdrop-filter: blur(8px);
}

.admin-panel {
    width: min(1280px, 100%);
    max-height: calc(100vh - 48px);
    overflow: hidden;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

.admin-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;

    padding: 24px 26px;
    border-bottom: 1px solid var(--border);
}

.admin-panel-header h2 {
    margin: 3px 0 5px;
}

.admin-panel-header > div > span {
    color: var(--text-muted);
    font-size: 12px;
}

.admin-close-button {
    display: grid;
    place-items: center;

    width: 42px;
    height: 42px;

    color: var(--text-muted);
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 12px;

    font-size: 26px;
    cursor: pointer;
}

.admin-layout {
    display: grid;
    grid-template-columns: minmax(320px, 0.85fr) minmax(360px, 1.15fr);
    min-height: 0;
    max-height: calc(100vh - 160px);
}

.admin-song-form,
.admin-song-list-section {
    overflow-y: auto;
    padding: 24px 26px;
}

.admin-song-form {
    border-right: 1px solid var(--border);
}

.admin-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.admin-song-form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-song-form label > span {
    font-size: 12px;
    font-weight: 700;
}

.admin-song-form label b {
    color: var(--danger);
}

.admin-song-form input,
.admin-song-form select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;

    color: var(--text);
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 11px;
    outline: none;
}

.admin-song-form input:focus,
.admin-song-form select:focus {
    border-color: var(--primary);
}

.admin-song-form select:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.admin-difficulty-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: end;
    gap: 16px;

    margin-top: 18px;
    padding: 14px;

    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.admin-switch-row {
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
}

.admin-switch-row input {
    width: 20px;
    min-height: 20px;
    accent-color: var(--primary);
}

.admin-details {
    margin-top: 18px;
    padding: 14px;

    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.admin-details summary {
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.admin-genre-add {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-top: 14px;
}

.admin-genre-add button,
.admin-item-actions button,
.secondary-button,
.primary-button {
    min-height: 40px;
    padding: 9px 13px;

    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
}

.admin-genre-add button,
.secondary-button,
.admin-item-actions button {
    color: var(--text);
    background: var(--surface);
}

.primary-button {
    color: white;
    background: var(--primary);
    border-color: var(--primary);
}

.admin-genre-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px;
}

.admin-genre-chips span {
    padding: 5px 9px;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 20px;
    font-size: 10px;
}

.admin-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 20px;
}

.admin-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.admin-list-header h3 {
    margin: 0;
}

.admin-list-header span {
    color: var(--text-muted);
    font-size: 12px;
}

.admin-song-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.admin-song-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    padding: 13px 14px;
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 13px;
}

.admin-song-item > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.admin-song-item strong,
.admin-song-item span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.admin-song-item strong {
    font-size: 13px;
}

.admin-song-item span {
    color: var(--text-muted);
    font-size: 11px;
}

.admin-item-actions {
    display: flex;
    flex-shrink: 0;
    gap: 6px;
}

.admin-item-actions button {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 11px;
}

.admin-item-actions .danger-button {
    color: var(--danger);
}

.admin-empty {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

@media (max-width: 760px) {
    .admin-overlay {
        padding: 0;
        place-items: stretch;
    }

    .admin-panel {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .admin-panel-header {
        padding: 18px 16px;
    }

    .admin-layout {
        display: block;
        max-height: calc(100vh - 95px);
        overflow-y: auto;
    }

    .admin-song-form,
    .admin-song-list-section {
        overflow: visible;
        padding: 18px 16px;
    }

    .admin-song-form {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .admin-form-grid,
    .admin-difficulty-box {
        grid-template-columns: 1fr;
    }

    .admin-genre-add {
        grid-template-columns: 1fr;
    }
}

/* 즐겨찾기 노래만 보기 필터 */
.favorite-filter-button {
    border-color: rgba(245, 189, 61, 0.38) !important;
}

.favorite-filter-button.active {
    color: #5a4300 !important;
    background: var(--favorite) !important;
    border-color: var(--favorite) !important;
}

body.dark-mode .favorite-filter-button.active {
    color: #221900 !important;
}

/* 관리자 탭 및 월간 일정 */
.admin-tabs {
    display: flex;
    gap: 8px;
    padding: 0 24px 18px;
    border-bottom: 1px solid var(--border);
}

.admin-tab-button {
    padding: 10px 15px;
    color: var(--text-muted);
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 11px;
    cursor: pointer;
}

.admin-tab-button.active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

.admin-tab-panel { padding: 22px 24px 26px; }
.admin-tab-panel[hidden] { display: none; }
.admin-tab-panel .admin-layout { padding: 0; }

.admin-schedule-layout {
    display: grid;
    grid-template-columns: minmax(520px, 1fr) minmax(320px, 360px);
    gap: 22px;
}

.admin-calendar-section,
.admin-schedule-form {
    padding: 20px;
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 17px;
}

.admin-calendar-header {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.admin-calendar-header h3 { margin: 0; text-align: center; }
.admin-weekday-row,
.admin-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.admin-weekday-row { margin-bottom: 7px; }
.admin-weekday-row span {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.admin-calendar-day {
    position: relative;
    min-height: 78px;
    padding: 9px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 11px;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
}

.admin-calendar-day:hover { border-color: var(--primary); }
.admin-calendar-day.other-month { opacity: .38; }
.admin-calendar-day.today { box-shadow: inset 0 0 0 2px var(--primary); }
.admin-calendar-day.selected { background: var(--primary-soft); border-color: var(--primary); }
.admin-calendar-day-number { font-size: 12px; font-weight: 800; }
.admin-calendar-event {
    display: block;
    margin-top: 8px;
    padding: 4px 6px;
    border-radius: 7px;
    font-size: 10px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.admin-calendar-event.broadcast { color: var(--success); background: rgba(47,191,113,.12); }
.admin-calendar-event.collaboration { color: var(--collaboration); background: var(--primary-soft); }
.admin-calendar-event.off { color: var(--danger); background: rgba(238,102,116,.12); }

.admin-calendar-help {
    margin: 13px 0 0;
    color: var(--text-muted);
    font-size: 11px;
    text-align: center;
}

.admin-schedule-form { display: flex; flex-direction: column; gap: 14px; }
.admin-schedule-form label { display: flex; flex-direction: column; gap: 7px; }
.admin-schedule-form label > span { font-size: 12px; font-weight: 700; }
.admin-schedule-form input,
.admin-schedule-form select,
.admin-schedule-form textarea {
    width: 100%;
    padding: 11px 12px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.admin-schedule-form textarea {
    min-height: 72px;
    max-height: 150px;
    resize: vertical;
    line-height: 1.5;
}

.admin-schedule-form .admin-schedule-note-input {
    min-height: 72px;
}

.admin-schedule-preview {
    min-height: 75px;
    padding: 13px;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 11px;
    font-size: 12px;
    line-height: 1.65;
}

.schedule-date {
    color: var(--text-muted);
    font-size: 10px;
}
.schedule-item {
    grid-template-columns: 25px 42px 48px minmax(0, 1fr);
}
.schedule-item .today-badge { grid-column: auto; }

@media (max-width: 900px) {
    .admin-schedule-layout { grid-template-columns: 1fr; }
    .admin-calendar-day { min-height: 68px; padding: 7px; }
}

@media (max-width: 600px) {
    .admin-tabs { padding-inline: 14px; }
    .admin-tab-panel { padding: 16px 14px 20px; }
    .admin-calendar-section, .admin-schedule-form { padding: 13px; }
    .admin-calendar-grid, .admin-weekday-row { gap: 3px; }
    .admin-calendar-day { min-height: 56px; border-radius: 8px; }
    .admin-calendar-event { font-size: 0; width: 7px; height: 7px; padding: 0; border-radius: 50%; }
}


/* 방문자 일정 한 줄 표시 및 관리자 입력창 간소화 */
.schedule-item {
    overflow: hidden;
}

.schedule-content {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.schedule-item.today .schedule-content {
    min-width: 0;
}

.admin-schedule-form .admin-schedule-title-input {
    min-height: auto;
}

@media (max-width: 760px) {
    .schedule-item {
        grid-template-columns: 24px 38px 42px minmax(0, 1fr);
        gap: 7px;
    }

    .schedule-item.today {
        padding-right: 62px;
    }

    .today-badge {
        right: 8px;
        padding: 3px 7px;
    }
}


/* 방문자용 일정 상세창 */
.schedule-item {
    cursor: pointer;
}

.schedule-item:hover {
    background: var(--surface-hover);
}

.schedule-item:focus-visible {
    outline: 3px solid var(--primary-soft);
    outline-offset: 2px;
}

.schedule-item.today:hover {
    background: var(--primary-soft);
}

.schedule-detail-overlay[hidden] {
    display: none;
}

.schedule-detail-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(6, 7, 14, 0.68);
    backdrop-filter: blur(8px);
}

.schedule-detail-dialog {
    width: min(500px, 100%);
    max-height: min(720px, calc(100vh - 40px));
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.schedule-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 22px 16px;
    border-bottom: 1px solid var(--border);
}

.schedule-detail-header h2 {
    margin: 3px 0 0;
    font-size: 20px;
}

.schedule-detail-date {
    margin: 0;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
}

.schedule-detail-close {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: var(--text-muted);
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.schedule-detail-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px 22px 24px;
}

.schedule-detail-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.schedule-detail-status {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.schedule-detail-status.broadcast {
    color: var(--success);
    background: color-mix(in srgb, var(--success) 13%, transparent);
}

.schedule-detail-status.collaboration {
    color: var(--collaboration);
    background: color-mix(in srgb, var(--collaboration) 13%, transparent);
}

.schedule-detail-status.off {
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 13%, transparent);
}

.schedule-detail-status.none {
    color: var(--text-muted);
    background: var(--background-soft);
}

.schedule-detail-time {
    color: var(--text-muted);
    font-size: 13px;
}

.schedule-detail-section {
    padding: 15px 16px;
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.schedule-detail-label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
}

.schedule-detail-content,
.schedule-detail-note {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

@media (max-width: 600px) {
    .schedule-detail-overlay {
        align-items: end;
        padding: 12px;
    }

    .schedule-detail-dialog {
        width: 100%;
        max-height: calc(100vh - 24px);
        border-radius: 20px;
    }
}


/* 일정 행 자체에서 자연스럽게 펼치기 */
.schedule-detail-overlay {
    display: none !important;
}

.schedule-item {
    grid-template-columns: 25px 42px 52px minmax(0, 1fr);
    align-items: center;
}

.schedule-item.expanded {
    overflow: visible;
    align-items: start;
    padding-top: 13px;
    padding-bottom: 13px;
    background: var(--surface-hover);
}

.schedule-item.expanded .schedule-content {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

/* 메모는 기존 일정 문장 바로 아래에서 이어집니다. */
.schedule-inline-detail {
    grid-column: 4;
    margin: -4px 0 0;
    padding: 0;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    cursor: default;
    font-size: 12px;
}

.schedule-inline-detail[hidden] {
    display: none;
}

.schedule-inline-detail p {
    margin: 0;
    line-height: 1.55;
    white-space: normal;
    overflow-wrap: anywhere;
}

.schedule-inline-detail p::before {
    content: "↳ ";
    color: var(--primary);
}

@media (max-width: 760px) {
    .schedule-item {
        grid-template-columns: 24px 38px 42px minmax(0, 1fr);
    }

    .schedule-item.expanded {
        padding-bottom: 12px;
    }

    .schedule-inline-detail {
        grid-column: 4;
        font-size: 12px;
    }
}


/* 일정 펼침: 기존 문장이 같은 칸에서 그대로 이어져 보이도록 */
.schedule-inline-detail {
    display: none !important;
}

.schedule-item.expanded .schedule-content {
    grid-column: 4;
    display: block;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.schedule-item.expanded {
    align-items: start;
}


/* 관리자 숙제 관리 */
.admin-homework-layout {
    display: grid;
    grid-template-columns: minmax(320px, .9fr) minmax(360px, 1.1fr);
    gap: 18px;
}

.admin-homework-form,
.admin-homework-list-section {
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.admin-homework-form label,
.admin-full-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.admin-homework-form label > span,
.admin-full-field > span {
    font-size: 12px;
    font-weight: 700;
}

.admin-homework-form input,
.admin-homework-form select,
.admin-homework-form textarea {
    width: 100%;
    padding: 11px 12px;
    color: var(--text);
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 11px;
    outline: none;
}

.admin-homework-form textarea { resize: vertical; min-height: 82px; }
.admin-full-field { margin-top: 14px; }
.admin-homework-filter { display: flex; gap: 7px; margin-bottom: 12px; }
.admin-homework-filter button {
    padding: 7px 11px;
    color: var(--text-muted);
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
}
.admin-homework-filter button.active { color: white; background: var(--primary); border-color: var(--primary); }
.admin-homework-list { display: flex; flex-direction: column; }
.admin-homework-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.admin-homework-item:last-child { border-bottom: 0; }
.admin-homework-item > div { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.admin-homework-item strong { font-size: 13px; }
.admin-homework-item span { color: var(--text-muted); font-size: 11px; }
.admin-homework-item button { flex-shrink: 0; }

@media (max-width: 900px) {
    .admin-homework-layout { grid-template-columns: 1fr; }
}

/* 관리자 일괄 등록·기본 설정·백업 */
.admin-help-text {
    margin: 8px 0 12px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.6;
}

.admin-bulk-details textarea,
.admin-settings-form textarea,
.admin-settings-form input,
.admin-backup-section input {
    width: 100%;
}

.compact-actions {
    margin-top: 10px;
}

.admin-inline-message {
    min-height: 18px;
    margin: 10px 0 0;
    color: var(--primary);
    font-size: 12px;
}

.admin-settings-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
    gap: 22px;
}

.admin-settings-form,
.admin-backup-section {
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
}

.admin-backup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
}

.file-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.file-button input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.admin-reset-all {
    width: 100%;
    margin-top: 18px;
}

@media (max-width: 900px) {
    .admin-settings-layout {
        grid-template-columns: 1fr;
    }
}

/* 2026-08 긴급 수정: 관리자 기본 설정 화면 및 다크모드 */
.admin-settings-form,
.admin-settings-form * ,
.admin-backup-section,
.admin-backup-section * {
    box-sizing: border-box;
}

.settings-page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 2px 2px 16px;
    border-bottom: 1px solid var(--border);
}

.settings-page-heading h3 {
    margin: 4px 0 5px;
    font-size: 21px;
}

.settings-page-heading p {
    margin: 0;
    color: var(--text-muted);
    font-size: 12px;
}

.settings-kicker {
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.4px;
}

.admin-settings-layout {
    align-items: start;
}

.admin-settings-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 0;
    background: transparent;
    border: 0;
}

.settings-group {
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.settings-group-title {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 16px;
}

.settings-group-icon,
.backup-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid color-mix(in srgb, var(--primary) 28%, transparent);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 800;
}

.settings-group-title h4 {
    margin: 0 0 3px;
    font-size: 14px;
}

.settings-group-title p {
    margin: 0;
    color: var(--text-muted);
    font-size: 11px;
}

.admin-settings-form label {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.admin-settings-form label > span {
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.admin-settings-form input,
.admin-settings-form textarea,
.admin-backup-section input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    color: var(--text);
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 11px;
    outline: none;
    caret-color: var(--primary);
}

.admin-settings-form textarea {
    min-height: 86px;
    resize: vertical;
    line-height: 1.55;
}

.admin-settings-form input::placeholder,
.admin-settings-form textarea::placeholder {
    color: var(--text-muted);
    opacity: .75;
}

.admin-settings-form input:focus,
.admin-settings-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.settings-save-bar {
    position: sticky;
    bottom: -1px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 14px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border: 1px solid var(--border);
    border-radius: 14px;
    backdrop-filter: blur(12px);
}

.settings-save-bar .admin-inline-message {
    margin: 0;
}

.settings-save-button {
    min-width: 150px;
}

.admin-backup-section {
    position: sticky;
    top: 0;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.admin-backup-section h3 {
    margin: 13px 0 4px;
    font-size: 17px;
}

.admin-backup-actions {
    display: grid;
    grid-template-columns: 1fr;
}

.admin-backup-actions .primary-button,
.admin-backup-actions .secondary-button {
    width: 100%;
    min-height: 42px;
}

.backup-warning {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 18px;
    padding: 12px;
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--danger) 24%, transparent);
    border-radius: 12px;
}

.backup-warning strong {
    font-size: 12px;
}

.backup-warning span {
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.5;
}

/* 관리자 전체 입력 요소가 다크모드 변수 색을 반드시 사용하도록 보강 */
.admin-panel input,
.admin-panel textarea,
.admin-panel select,
.admin-panel button {
    font-family: inherit;
}

body.dark-mode .admin-panel,
body.dark-mode .settings-group,
body.dark-mode .admin-backup-section {
    color: var(--text);
    background: var(--surface);
}

body.dark-mode .admin-panel input,
body.dark-mode .admin-panel textarea,
body.dark-mode .admin-panel select {
    color: var(--text);
    background: var(--background-soft);
    border-color: var(--border);
    color-scheme: dark;
}

body:not(.dark-mode) .admin-panel input,
body:not(.dark-mode) .admin-panel textarea,
body:not(.dark-mode) .admin-panel select {
    color-scheme: light;
}

/* 일괄 등록 버튼과 입력칸을 확실히 보이게 */
.admin-bulk-details textarea {
    width: 100%;
    min-height: 150px;
    padding: 12px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 11px;
    line-height: 1.65;
    resize: vertical;
}

body.dark-mode .admin-bulk-details textarea {
    background: var(--surface-hover);
}

.admin-bulk-details .compact-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
}

@media (max-width: 760px) {
    .settings-page-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .settings-page-heading > button {
        width: 100%;
    }

    .settings-group {
        padding: 14px;
    }

    .settings-save-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .settings-save-button {
        width: 100%;
    }

    .admin-backup-section {
        position: static;
    }
}

/* 2026-08 관리자 창 스크롤 및 초기화 버튼 개선 */
.admin-panel {
    display: flex;
    flex-direction: column;
    height: min(900px, calc(100vh - 48px));
    max-height: calc(100vh - 48px);
    min-height: 0;
}

.admin-panel-header,
.admin-tabs {
    flex: 0 0 auto;
}

.admin-tabs {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.admin-tab-button {
    flex: 0 0 auto;
}

.admin-tab-panel {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.admin-tab-panel.active {
    display: block;
}

/* 노래책·숙제 관리도 내용이 길어지면 관리자 탭 전체에서 스크롤 */
.admin-layout,
.admin-homework-layout,
.admin-schedule-layout,
.admin-settings-layout {
    min-height: min-content;
    max-height: none;
}

.admin-song-form,
.admin-song-list-section,
.admin-homework-form,
.admin-homework-list-section {
    overflow: visible;
    max-height: none;
}

/* 설정 화면 오른쪽 백업 영역은 스크롤 중에도 자연스럽게 보이도록 제한 */
.admin-backup-section {
    top: 8px;
    max-height: calc(100vh - 190px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* 관리자 스크롤바 */
.admin-tab-panel::-webkit-scrollbar,
.admin-backup-section::-webkit-scrollbar,
.admin-tabs::-webkit-scrollbar {
    width: 10px;
    height: 7px;
}

.admin-tab-panel::-webkit-scrollbar-track,
.admin-backup-section::-webkit-scrollbar-track,
.admin-tabs::-webkit-scrollbar-track {
    background: transparent;
}

.admin-tab-panel::-webkit-scrollbar-thumb,
.admin-backup-section::-webkit-scrollbar-thumb,
.admin-tabs::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--primary) 38%, var(--border));
    border: 3px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

/* 기본값 복원 버튼 */
#adminSettingsResetButton {
    position: relative;
    min-height: 42px;
    padding: 10px 15px 10px 39px;
    color: var(--primary);
    background: var(--primary-soft);
    border: 1px solid color-mix(in srgb, var(--primary) 32%, var(--border));
    border-radius: 12px;
    font-weight: 700;
    box-shadow: none;
}

#adminSettingsResetButton::before {
    content: "↺";
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-52%);
    font-size: 19px;
    line-height: 1;
}

#adminSettingsResetButton:hover {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 18%, var(--surface));
}

/* 전체 초기화는 위험 버튼답게 별도 카드형으로 명확하게 */
#adminResetAllButton {
    position: relative;
    min-height: 48px;
    padding: 12px 16px 12px 44px;
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 9%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--danger) 34%, var(--border));
    border-radius: 13px;
    font-weight: 800;
    text-align: center;
}

#adminResetAllButton::before {
    content: "!";
    position: absolute;
    left: 15px;
    top: 50%;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    transform: translateY(-50%);
    color: white;
    background: var(--danger);
    border-radius: 50%;
    font-size: 13px;
    font-weight: 900;
}

#adminResetAllButton:hover {
    color: white;
    background: var(--danger);
    border-color: var(--danger);
}

#adminResetAllButton:hover::before {
    color: var(--danger);
    background: white;
}

@media (max-width: 900px) {
    .admin-panel {
        height: calc(100dvh - 20px);
        max-height: calc(100dvh - 20px);
    }

    .admin-tab-panel {
        padding-bottom: 34px;
    }

    .admin-backup-section {
        position: static;
        max-height: none;
        overflow: visible;
    }
}


/* 방문자 전체 보기 */
body.full-view-open { overflow: hidden; }
.full-view-overlay {
    position: fixed;
    inset: 0;
    z-index: 1900;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(8, 7, 15, 0.72);
    backdrop-filter: blur(10px);
}
.full-view-overlay[hidden] { display: none; }
.full-view-panel {
    display: flex;
    flex-direction: column;
    width: min(1080px, 100%);
    max-height: min(860px, calc(100vh - 48px));
    overflow: hidden;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 24px 80px rgba(0,0,0,.35);
}
.full-view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--border);
}
.full-view-header h2 { margin: 3px 0 0; font-size: 22px; }
.full-view-kicker { margin: 0; color: var(--primary); font-size: 10px; font-weight: 800; letter-spacing: 1.5px; }
.full-view-close {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    color: var(--text-muted);
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 13px;
    font-size: 25px;
    cursor: pointer;
}
.full-view-body { overflow-y: auto; padding: 24px; }
.full-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 18px; }
.full-toolbar input,
.full-toolbar select {
    min-width: 0;
    padding: 11px 13px;
    color: var(--text);
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.full-toolbar input { flex: 1 1 260px; }
.full-toolbar button {
    padding: 10px 13px;
    color: var(--text);
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
}
.full-toolbar button.active { color: white; background: var(--primary); border-color: var(--primary); }
.full-song-list { display: flex; flex-direction: column; }
.full-song-row {
    display: grid;
    grid-template-columns: 38px minmax(180px,1fr) 110px 100px 100px;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    border-bottom: 1px solid var(--border);
}
.full-song-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.full-song-main strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.full-song-main span, .full-song-meta { color: var(--text-muted); font-size: 12px; }
.full-empty { margin: 38px 0; color: var(--text-muted); text-align: center; }
.full-homework-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.full-homework-list { display: flex; flex-direction: column; }
.full-homework-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 66px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.full-homework-row > div { display: flex; flex-direction: column; gap: 5px; }
.full-homework-row span, .full-homework-row time { color: var(--text-muted); font-size: 12px; }
.full-month-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.full-month-head h3 { margin: 0; }
.full-month-head button { padding: 9px 12px; color: var(--text); background: var(--background-soft); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.full-calendar-weekdays, .full-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 8px; }
.full-calendar-weekdays { margin-bottom: 8px; color: var(--text-muted); font-size: 12px; text-align: center; }
.full-calendar-day {
    min-height: 94px;
    padding: 9px;
    color: var(--text);
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 13px;
    text-align: left;
    cursor: pointer;
}
.full-calendar-day.empty { visibility: hidden; }
.full-calendar-day.today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.full-calendar-number { display: block; margin-bottom: 7px; font-weight: 700; }
.full-calendar-label { display: block; overflow: hidden; color: var(--text-muted); font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.full-calendar-label.has-event { color: var(--primary); }
.full-schedule-detail { margin-top: 16px; padding: 16px; background: var(--background-soft); border: 1px solid var(--border); border-radius: 14px; }
.full-schedule-detail h4 { margin: 0 0 9px; }
.full-schedule-detail p { margin: 5px 0; color: var(--text-muted); line-height: 1.6; }
@media (max-width: 760px) {
    .full-view-overlay { padding: 0; }
    .full-view-panel { width: 100%; height: 100%; max-height: none; border-radius: 0; }
    .full-view-header { padding: 17px 16px; }
    .full-view-body { padding: 16px 16px 92px; }
    .full-song-row { grid-template-columns: 34px minmax(0,1fr) auto; gap: 9px; }
    .full-song-row .full-song-genre, .full-song-row .full-song-difficulty { display: none; }
    .full-calendar-weekdays, .full-calendar-grid { gap: 5px; }
    .full-calendar-day { min-height: 72px; padding: 7px; }
}


/* 방문자용 주간 전체 일정 */
.full-week-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}
.full-week-head > button,
.full-week-title button {
    padding: 9px 12px;
    color: var(--primary);
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
}
.full-week-title { text-align: center; }
.full-week-title h3 { margin: 0 0 7px; font-size: 17px; }
.full-week-title button { padding: 5px 10px; font-size: 11px; }
.full-week-list { display: flex; flex-direction: column; }
.full-week-row {
    display: grid;
    grid-template-columns: 66px 72px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    min-height: 72px;
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
}
.full-week-row:last-child { border-bottom: 0; }
.full-week-row.today {
    margin: 3px 0;
    padding-left: 12px;
    padding-right: 12px;
    background: var(--primary-soft);
    border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
    border-radius: 14px;
}
.full-week-date { display: flex; flex-direction: column; gap: 4px; }
.full-week-date strong { color: var(--primary); font-size: 16px; }
.full-week-date span { color: var(--text-muted); font-size: 11px; }
.full-week-state { font-size: 11px; font-weight: 800; }
.full-week-state.broadcast { color: var(--success); }
.full-week-state.collaboration { color: var(--collaboration); }
.full-week-state.off { color: var(--danger); }
.full-week-state.none { color: var(--text-muted); }
.full-week-content { min-width: 0; }
.full-week-content strong { display: block; overflow-wrap: anywhere; font-size: 14px; }
.full-week-content p { margin: 6px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
@media (max-width: 760px) {
    .full-week-head { grid-template-columns: 1fr 1fr; }
    .full-week-title { grid-column: 1 / -1; grid-row: 1; }
    .full-week-head > button { width: 100%; }
    .full-week-row { grid-template-columns: 48px 54px minmax(0, 1fr); gap: 9px; min-height: 66px; padding: 10px 5px; }
    .full-week-date strong { font-size: 14px; }
    .full-week-state { font-size: 10px; }
    .full-week-content strong { font-size: 13px; }
}


/* 별도 페이지 전환 화면 */
.route-page {
    max-width: 1500px;
    min-height: calc(100vh - 76px);
    margin: 0 auto;
    padding: 28px;
}
.route-page[hidden] { display: none; }
.route-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}
.route-page-kicker { margin: 0 0 5px; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: 1px; }
.route-page-header h2 { margin: 0; font-size: 26px; }
.route-home-button,
.route-toolbar button,
.route-week-head button {
    padding: 10px 14px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
}
.route-home-button:hover,
.route-toolbar button:hover,
.route-week-head button:hover { border-color: var(--primary); }
.route-page-body {
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
}
.route-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.route-toolbar input,
.route-toolbar select {
    min-width: 0;
    padding: 11px 13px;
    color: var(--text);
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.route-toolbar input { flex: 1 1 280px; }
.route-toolbar button.active { color: white; background: var(--primary); border-color: var(--primary); }
.route-song-list, .route-homework-list, .route-week-list { display: flex; flex-direction: column; }
.route-song-row {
    display: grid;
    grid-template-columns: 38px minmax(180px,1fr) 110px 100px 100px;
    align-items: center;
    gap: 12px;
    min-height: 66px;
    border-bottom: 1px solid var(--border);
}
.route-song-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.route-song-main strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.route-song-main span, .route-song-meta { color: var(--text-muted); font-size: 12px; }
.route-homework-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 68px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.route-homework-row > div { display: flex; flex-direction: column; gap: 5px; }
.route-homework-row span, .route-homework-row time { color: var(--text-muted); font-size: 12px; }
.route-empty { margin: 38px 0; color: var(--text-muted); text-align: center; }
.route-week-head {
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}
.route-week-title { text-align: center; }
.route-week-title h3 { margin: 0 0 7px; }
.route-week-title button { padding: 6px 10px; font-size: 11px; }
.route-week-row {
    display: grid;
    grid-template-columns: 66px 72px minmax(0,1fr);
    align-items: center;
    gap: 14px;
    min-height: 72px;
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
}
.route-week-row.today { margin: 3px 0; background: var(--primary-soft); border: 1px solid var(--primary); border-radius: 14px; }
.route-week-date { display: flex; flex-direction: column; gap: 4px; }
.route-week-date strong { color: var(--primary); font-size: 16px; }
.route-week-date span { color: var(--text-muted); font-size: 11px; }
.route-week-state { font-size: 11px; font-weight: 800; }
.route-week-state.broadcast { color: var(--success); }
.route-week-state.collaboration { color: var(--collaboration); }
.route-week-state.off { color: var(--danger); }
.route-week-state.none { color: var(--text-muted); }
.route-week-content p { margin: 6px 0 0; color: var(--text-muted); font-size: 12px; white-space: pre-wrap; }
@media (max-width: 760px) {
    .route-page { padding: 16px 16px 96px; }
    .route-page-header { align-items: flex-start; }
    .route-page-header h2 { font-size: 22px; }
    .route-page-body { padding: 16px; border-radius: 16px; }
    .route-song-row { grid-template-columns: 34px minmax(0,1fr) auto; gap: 9px; }
    .route-song-genre, .route-song-difficulty { display: none; }
    .route-week-head { grid-template-columns: 1fr 1fr; }
    .route-week-title { grid-column: 1 / -1; grid-row: 1; }
    .route-week-head > button { width: 100%; }
    .route-week-row { grid-template-columns: 48px 54px minmax(0,1fr); gap: 9px; min-height: 66px; padding: 10px 5px; }
}


/* 모바일 화면 최적화 보강 */
@media (max-width: 760px) {
    body {
        background: var(--background);
        padding-bottom: 86px;
    }

    .top-header {
        min-height: 58px;
        gap: 8px;
        padding: 9px 12px;
    }

    .notice-bar {
        padding: 10px 12px;
        border-radius: 12px;
        font-size: 12px;
    }

    .notice-bar strong {
        flex: 0 0 auto;
    }

    .theme-button {
        width: 42px;
        height: 42px;
        padding: 0;
        border-radius: 12px;
    }

    .main-content {
        padding: 12px 12px 22px;
    }

    /* 모바일 홈 프로필 복원 및 정리 */
    body[data-mobile-page="home"] .profile-summary,
    body:not([data-mobile-page]) .profile-summary {
        display: grid !important;
    }

    .profile-summary {
        grid-template-columns: 76px minmax(0, 1fr);
        align-items: start;
        gap: 14px;
        margin-bottom: 12px;
        padding: 17px;
        border-radius: 18px;
    }

    .summary-profile-image {
        width: 76px;
        height: 76px;
        font-size: 14px;
        box-shadow: 0 8px 22px color-mix(in srgb, var(--primary) 20%, transparent);
    }

    .profile-text {
        min-width: 0;
    }

    .profile-text .small-title {
        margin-bottom: 3px;
        font-size: 9px;
        letter-spacing: .7px;
    }

    .profile-text h2 {
        margin: 2px 0 6px;
        font-size: 20px;
    }

    .profile-text > p:not(.small-title) {
        display: -webkit-box;
        overflow: hidden;
        margin: 0;
        font-size: 12px;
        line-height: 1.55;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
    }

    .tag-list {
        grid-column: 1 / -1;
        gap: 6px;
        margin-top: 12px;
    }

    .tag-list span {
        padding: 5px 9px;
        font-size: 10px;
    }

    .mobile-home-summary {
        gap: 10px;
    }

    .mobile-summary-card {
        padding: 15px 16px;
        border-radius: 17px;
        box-shadow: none;
    }

    .mobile-summary-card h2 {
        font-size: 15px;
    }

    .mobile-summary-header {
        align-items: center;
    }

    .mobile-jump-button {
        min-height: 34px;
        padding: 7px 10px;
    }

    .mobile-song-preview {
        gap: 0;
        margin-top: 10px;
    }

    .mobile-song-preview span {
        display: block;
        overflow: hidden;
        padding: 9px 0;
        border-bottom: 1px solid var(--border);
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .mobile-song-preview span:last-child {
        border-bottom: 0;
    }

    /* 전용 페이지 헤더 */
    .route-page {
        min-height: calc(100vh - 58px);
        padding: 12px 12px 94px;
    }

    .route-page-header {
        position: sticky;
        top: 58px;
        z-index: 20;
        align-items: center;
        gap: 10px;
        margin: 0 -12px 12px;
        padding: 11px 12px;
        background: color-mix(in srgb, var(--background) 94%, transparent);
        border-bottom: 1px solid var(--border);
        backdrop-filter: blur(14px);
    }

    .route-page-kicker {
        display: none;
    }

    .route-page-header h2 {
        font-size: 20px;
    }

    .route-home-button {
        min-height: 40px;
        padding: 8px 11px;
        white-space: nowrap;
    }

    .route-page-body {
        padding: 0;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    /* 모바일 노래책 */
    .route-toolbar {
        position: sticky;
        top: 118px;
        z-index: 15;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        margin: 0 0 10px;
        padding: 10px 0;
        background: var(--background);
    }

    .route-toolbar input {
        grid-column: 1 / -1;
        width: 100%;
        min-height: 44px;
        flex: none;
    }

    .route-toolbar select,
    .route-toolbar button {
        width: 100%;
        min-height: 40px;
    }

    .route-song-list {
        gap: 9px;
    }

    .route-song-row {
        display: grid;
        grid-template-columns: 38px minmax(0, 1fr) auto;
        grid-template-areas:
            "favorite main status"
            "favorite meta status";
        align-items: center;
        gap: 4px 9px;
        min-height: 78px;
        padding: 11px 12px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 15px;
    }

    .route-song-row .favorite-button {
        grid-area: favorite;
        width: 38px;
        height: 48px;
    }

    .route-song-main {
        grid-area: main;
        gap: 4px;
    }

    .route-song-main strong {
        font-size: 14px;
    }

    .route-song-main span {
        font-size: 11px;
    }

    .route-song-genre {
        display: inline-flex !important;
        grid-area: meta;
        justify-self: start;
        width: auto;
        padding: 3px 7px;
        background: var(--background-soft);
        border-radius: 999px;
        font-size: 10px;
    }

    .route-song-difficulty {
        display: none !important;
    }

    .route-song-row .song-status {
        grid-area: status;
        max-width: 68px;
        padding: 6px 8px;
        white-space: nowrap;
    }

    /* 모바일 일정 */
    .route-week-head {
        gap: 8px;
        margin-bottom: 10px;
    }

    .route-week-title h3 {
        font-size: 15px;
    }

    .route-week-list {
        gap: 8px;
    }

    .route-week-row {
        grid-template-columns: 48px 52px minmax(0, 1fr);
        gap: 8px;
        min-height: 68px;
        padding: 11px 10px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 14px;
    }

    .route-week-row.today {
        margin: 0;
        box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 12%, transparent);
    }

    .route-week-content strong {
        display: block;
        overflow: hidden;
        font-size: 13px;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .route-week-content p {
        display: -webkit-box;
        overflow: hidden;
        margin-top: 4px;
        line-height: 1.45;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    /* 모바일 노래 숙제 */
    .route-homework-tabs {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        padding: 4px;
        background: var(--background-soft);
        border-radius: 13px;
    }

    .route-homework-list {
        gap: 9px;
    }

    .route-homework-row {
        min-height: 72px;
        padding: 12px 13px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 14px;
    }

    .route-homework-row strong {
        font-size: 14px;
    }

    .route-homework-row time {
        flex: 0 0 auto;
        padding-left: 8px;
    }

    .mobile-bottom-nav {
        right: 8px;
        bottom: 8px;
        left: 8px;
        border-radius: 18px;
    }
}

@media (max-width: 390px) {
    .profile-summary {
        grid-template-columns: 64px minmax(0, 1fr);
        padding: 14px;
    }
    .summary-profile-image {
        width: 64px;
        height: 64px;
    }
    .route-song-row {
        grid-template-columns: 34px minmax(0,1fr) auto;
        padding: 10px 9px;
    }
    .route-week-row {
        grid-template-columns: 42px 46px minmax(0, 1fr);
        padding: 10px 7px;
    }
}

/* 노래책 전용 페이지: 제목·가수·장르·난이도·상태를 칸별로 분리 */
.route-song-table { min-width: 0; }
.route-song-header,
.route-song-row {
    display: grid;
    grid-template-columns: 38px minmax(150px, 1.45fr) minmax(110px, 1fr) 100px 90px 92px;
    align-items: center;
    gap: 12px;
}
.route-song-header {
    min-height: 42px;
    padding: 0 4px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    font-weight: 700;
}
.route-song-header span:first-child { text-align: center; }
.route-song-row { min-height: 62px; }
.route-song-title,
.route-song-artist,
.route-song-meta {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.route-song-title { color: var(--text); font-size: 13px; }
.route-song-artist,
.route-song-meta { color: var(--text-muted); font-size: 12px; }

@media (max-width: 760px) {
    .route-song-table { overflow-x: hidden; }
    .route-song-header,
    .route-song-row {
        grid-template-columns: 28px minmax(0, 1.35fr) minmax(0, 1fr) minmax(42px, .78fr) minmax(46px, .82fr) minmax(52px, .9fr);
        gap: 5px;
    }
    .route-song-header {
        min-height: 38px;
        padding: 0 2px;
        font-size: 9px;
        text-align: center;
    }
    .route-song-row {
        grid-template-areas: none;
        min-height: 58px;
        padding: 8px 2px;
        background: transparent;
        border: 0;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
    }
    .route-song-row .favorite-button,
    .route-song-title,
    .route-song-artist,
    .route-song-genre,
    .route-song-difficulty,
    .route-song-row .song-status { grid-area: auto; }
    .route-song-row .favorite-button {
        width: 28px;
        height: 40px;
        font-size: 20px;
    }
    .route-song-title,
    .route-song-artist,
    .route-song-meta {
        display: block !important;
        width: auto;
        padding: 0;
        background: transparent;
        border-radius: 0;
        font-size: 10px;
        text-align: center;
    }
    .route-song-title {
        color: var(--text);
        font-size: 11px;
        font-weight: 700;
        text-align: left;
    }
    .route-song-artist { text-align: left; }
    .route-song-difficulty { display: block !important; }
    .route-song-row .song-status {
        max-width: none;
        padding: 4px 3px;
        font-size: 9px;
        text-align: center;
        white-space: nowrap;
    }
}

/* 노래책 제목·가수 정렬 버튼 */
.route-song-star-head {
    text-align: center;
    color: var(--primary);
}

.route-sort-button {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    width: fit-content;
    min-height: 30px;
    padding: 5px 9px;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .12s ease;
}

.route-sort-button:hover {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: color-mix(in srgb, var(--primary) 24%, transparent);
}

.route-sort-button:active {
    transform: scale(.96);
}

.route-sort-button.active {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: color-mix(in srgb, var(--primary) 32%, transparent);
}

.route-sort-icon {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    color: currentColor;
    background: color-mix(in srgb, var(--surface) 78%, transparent);
    border-radius: 50%;
    font-size: 11px;
    line-height: 1;
}

.route-song-row:nth-child(even) {
    background: color-mix(in srgb, var(--primary-soft) 30%, transparent);
}

.route-song-row:hover {
    background: color-mix(in srgb, var(--primary-soft) 52%, transparent);
}

@media (max-width: 760px) {
    .route-sort-button {
        justify-content: center;
        width: 100%;
        min-height: 28px;
        padding: 4px 3px;
        gap: 2px;
        font-size: 9px;
    }

    .route-sort-icon {
        width: 15px;
        height: 15px;
        font-size: 9px;
    }

    .route-song-row:nth-child(even) {
        background: color-mix(in srgb, var(--primary-soft) 22%, transparent);
    }
}

/* 노래책 전체/간편 보기 전환 */
.route-view-toggle {
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    flex: 0 0 auto;
    padding: 3px;
    background: var(--background-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
}
.route-view-toggle button {
    min-height: 34px;
    padding: 6px 12px;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: color .18s ease, background-color .18s ease, transform .12s ease;
}
.route-view-toggle button:active { transform: scale(.96); }
.route-view-toggle button.active {
    color: white;
    background: linear-gradient(135deg, var(--primary), #7446c7);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 24%, transparent);
}

/* 간편 모드: 즐겨찾기 · 제목 · 가수 · 난이도 */
.route-song-table.compact-mode .route-song-header,
.route-song-table.compact-mode .route-song-row {
    grid-template-columns: 42px minmax(180px, 1.6fr) minmax(140px, 1.2fr) 110px;
    gap: 14px;
}
.route-song-table.compact-mode .route-song-header > span:nth-child(4),
.route-song-table.compact-mode .route-song-header > span:nth-child(6),
.route-song-table.compact-mode .route-song-genre,
.route-song-table.compact-mode .song-status {
    display: none !important;
}
.route-song-table.compact-mode .route-song-star-head { grid-column: 1; }
.route-song-table.compact-mode .route-song-header .route-sort-button:nth-of-type(1) { grid-column: 2; }
.route-song-table.compact-mode .route-song-header .route-sort-button:nth-of-type(2) { grid-column: 3; }
.route-song-table.compact-mode .route-song-header > span:nth-child(5) { grid-column: 4; }
.route-song-table.compact-mode .route-song-row {
    min-height: 58px;
    padding-inline: 12px;
    border-radius: 12px;
}
.route-song-table.compact-mode .route-song-title {
    font-size: 14px;
    font-weight: 800;
}
.route-song-table.compact-mode .route-song-artist,
.route-song-table.compact-mode .route-song-difficulty {
    font-size: 13px;
}
.route-song-table.compact-mode .route-song-difficulty {
    display: inline-flex !important;
    justify-content: center;
    padding: 5px 8px;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 999px;
    font-weight: 800;
}

@media (max-width: 760px) {
    .route-toolbar { align-items: stretch; }
    .route-view-toggle { width: 100%; }
    .route-view-toggle button { min-height: 38px; font-size: 12px; }
    .route-song-table.compact-mode .route-song-header,
    .route-song-table.compact-mode .route-song-row {
        grid-template-columns: 32px minmax(0, 1.35fr) minmax(0, 1fr) 68px;
        gap: 7px;
    }
    .route-song-table.compact-mode .route-song-header {
        padding: 0 8px;
        font-size: 10px;
    }
    .route-song-table.compact-mode .route-song-row {
        min-height: 62px;
        padding: 10px 8px;
        border: 1px solid var(--border);
        border-radius: 13px;
        margin-bottom: 8px;
    }
    .route-song-table.compact-mode .route-song-title {
        font-size: 12px;
        text-align: left;
    }
    .route-song-table.compact-mode .route-song-artist {
        font-size: 11px;
        text-align: left;
    }
    .route-song-table.compact-mode .route-song-difficulty {
        font-size: 10px;
        text-align: center;
    }
}


/* 전용 페이지 상단 액션 */
.route-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.route-view-toggle-mobile { display: none; }

@media (max-width: 760px) {
    .route-page-header {
        align-items: center;
        gap: 10px;
    }
    .route-header-actions {
        margin-left: auto;
        gap: 7px;
        flex-shrink: 0;
    }
    .route-view-toggle-mobile:not([hidden]) {
        display: inline-grid;
        width: auto;
        grid-template-columns: auto auto;
        padding: 2px;
    }
    .route-view-toggle-mobile button {
        min-height: 34px;
        padding: 5px 9px;
        font-size: 11px;
    }
    .route-page-body .route-view-toggle {
        display: none;
    }
    .route-home-button {
        min-height: 38px;
        padding: 7px 10px;
        white-space: nowrap;
    }
}

@media (max-width: 390px) {
    .route-page-header > div:first-child .route-page-kicker { display: none; }
    .route-page-header h2 { font-size: 19px; }
    .route-view-toggle-mobile button { padding-inline: 7px; font-size: 10px; }
    .route-home-button { padding-inline: 8px; font-size: 11px; }
}

/* 노래책 목록: 고정 헤더 + 가로 확장/스크롤 */
.route-song-table {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--primary) 45%, transparent) transparent;
}

.route-song-table::-webkit-scrollbar {
    height: 8px;
}

.route-song-table::-webkit-scrollbar-track {
    background: transparent;
}

.route-song-table::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--primary) 42%, transparent);
    border-radius: 999px;
}

.route-song-header,
.route-song-list {
    min-width: 860px;
}

.route-song-header,
.route-song-row {
    grid-template-columns: 42px minmax(270px, 1.8fr) minmax(150px, 1fr) 110px 100px 100px;
}

.route-song-header {
    position: sticky;
    top: 76px;
    z-index: 18;
    padding: 7px 8px;
    background: color-mix(in srgb, var(--surface) 97%, transparent);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 18px color-mix(in srgb, var(--background) 72%, transparent);
    backdrop-filter: blur(12px);
}

.route-song-title {
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
    overflow-wrap: anywhere;
    line-height: 1.42;
}

.route-song-row {
    min-height: 66px;
}

.route-song-table.compact-mode .route-song-header,
.route-song-table.compact-mode .route-song-list {
    min-width: 700px;
}

.route-song-table.compact-mode .route-song-header,
.route-song-table.compact-mode .route-song-row {
    grid-template-columns: 42px minmax(300px, 1.8fr) minmax(180px, 1fr) 110px;
}

@media (max-width: 760px) {
    .route-song-table {
        margin-inline: 0;
        padding-bottom: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .route-song-header,
    .route-song-list {
        min-width: 780px;
    }

    .route-song-header,
    .route-song-row {
        grid-template-columns: 36px minmax(260px, 1.7fr) minmax(145px, 1fr) 92px 84px 92px;
        gap: 8px;
    }

    .route-song-header {
        top: 116px;
        min-height: 42px;
        padding: 6px 8px;
        font-size: 10px;
        text-align: left;
    }

    .route-song-row {
        min-height: 64px;
        padding: 9px 8px;
    }

    .route-song-title {
        font-size: 12px;
        text-align: left;
    }

    .route-song-artist,
    .route-song-meta {
        font-size: 11px;
        text-align: left;
    }

    .route-song-table.compact-mode .route-song-header,
    .route-song-table.compact-mode .route-song-list {
        min-width: 650px;
    }

    .route-song-table.compact-mode .route-song-header,
    .route-song-table.compact-mode .route-song-row {
        grid-template-columns: 36px minmax(280px, 1.8fr) minmax(160px, 1fr) 100px;
        gap: 8px;
    }

    .route-song-table::after {
        content: "← 좌우로 밀어 긴 제목 보기 →";
        position: sticky;
        left: 0;
        display: block;
        width: max-content;
        margin: 8px auto 0;
        padding: 4px 9px;
        color: var(--text-muted);
        background: var(--background-soft);
        border-radius: 999px;
        font-size: 9px;
        pointer-events: none;
    }
}

/* 2026-08-03 노래책 레이아웃 복구: 고정 헤더는 유지하고 표 깨짐/과도한 가로폭 제거 */
.route-song-table,
.route-song-table.compact-mode {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: visible;
    padding-bottom: 0;
}

.route-song-table::after {
    content: none !important;
    display: none !important;
}

.route-song-header,
.route-song-list,
.route-song-table.compact-mode .route-song-header,
.route-song-table.compact-mode .route-song-list {
    width: 100%;
    min-width: 0;
}

.route-song-header {
    position: sticky;
    top: 76px;
    z-index: 30;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 7px 18px rgba(30, 20, 50, .10);
    backdrop-filter: blur(12px);
}

.route-song-row {
    width: 100%;
    max-width: 100%;
}

/* PC 전체 보기 */
.route-song-header,
.route-song-row {
    grid-template-columns: 42px minmax(220px, 1.7fr) minmax(130px, 1fr) 96px 88px 92px;
    gap: 12px;
}

/* PC 간편 보기 */
.route-song-table.compact-mode .route-song-header,
.route-song-table.compact-mode .route-song-row {
    grid-template-columns: 42px minmax(260px, 1.8fr) minmax(160px, 1fr) 100px;
    gap: 14px;
}

.route-song-title,
.route-song-artist {
    min-width: 0;
}

.route-song-title {
    overflow: visible;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: keep-all;
    line-height: 1.45;
}

.route-song-artist,
.route-song-meta,
.route-song-row .song-status {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

@media (max-width: 760px) {
    .route-song-table,
    .route-song-table.compact-mode {
        overflow-x: hidden;
        -webkit-overflow-scrolling: auto;
    }

    .route-song-header {
        top: 78px;
        min-height: 42px;
        padding: 5px 6px;
        border-radius: 11px;
        font-size: 10px;
    }

    /* 모바일 전체 보기: 화면 안에서 모든 칸이 정돈되도록 */
    .route-song-header,
    .route-song-row {
        grid-template-columns: 30px minmax(92px, 1.65fr) minmax(62px, 1fr) 52px 54px 58px;
        gap: 5px;
    }

    .route-song-row {
        min-height: 64px;
        padding: 9px 6px;
        margin: 0;
        border: 0;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
        background: transparent;
    }

    .route-song-row:nth-child(even) {
        background: color-mix(in srgb, var(--primary-soft) 18%, transparent);
    }

    .route-song-title {
        font-size: 12px;
        font-weight: 800;
        text-align: left;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: keep-all;
        line-height: 1.35;
    }

    .route-song-artist,
    .route-song-meta,
    .route-song-row .song-status {
        font-size: 10px;
        text-align: center;
    }

    /* 모바일 간편 보기: 즐겨찾기 + 제목 + 가수 + 난이도 */
    .route-song-table.compact-mode .route-song-header,
    .route-song-table.compact-mode .route-song-row {
        grid-template-columns: 30px minmax(130px, 1.8fr) minmax(78px, 1fr) 62px;
        gap: 7px;
    }

    .route-song-table.compact-mode .route-song-header {
        padding: 5px 7px;
    }

    .route-song-table.compact-mode .route-song-row {
        min-height: 62px;
        padding: 9px 7px;
        margin: 0;
        border: 0;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
    }

    .route-song-table.compact-mode .route-song-title {
        font-size: 12px;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: keep-all;
        line-height: 1.35;
    }

    .route-song-table.compact-mode .route-song-artist,
    .route-song-table.compact-mode .route-song-difficulty {
        font-size: 10px;
        text-align: center;
    }

    .route-song-table.compact-mode .route-song-difficulty {
        padding: 4px 5px;
    }
}

@media (max-width: 390px) {
    .route-song-header,
    .route-song-row {
        grid-template-columns: 28px minmax(82px, 1.6fr) minmax(54px, .95fr) 46px 48px 52px;
        gap: 4px;
    }

    .route-song-table.compact-mode .route-song-header,
    .route-song-table.compact-mode .route-song-row {
        grid-template-columns: 28px minmax(112px, 1.75fr) minmax(68px, 1fr) 56px;
        gap: 5px;
    }

    .route-song-title { font-size: 11px; }
    .route-song-artist,
    .route-song-meta,
    .route-song-row .song-status { font-size: 9px; }
}

/* 모바일 노래책 헤더 위치 복구
   - 검색/필터 영역은 일반 흐름으로 스크롤
   - 칼럼 헤더는 원래 자리에서 시작해 페이지 헤더 아래에 자연스럽게 고정 */
@media (max-width: 760px) {
    body[data-mobile-page="songbook"] .route-toolbar {
        position: static;
        top: auto;
        z-index: auto;
        margin-bottom: 0;
        padding: 10px 0 12px;
        background: transparent;
    }

    body[data-mobile-page="songbook"] .route-song-table,
    body[data-mobile-page="songbook"] .route-song-table.compact-mode {
        position: relative;
        margin-top: 0;
        overflow: visible;
    }

    body[data-mobile-page="songbook"] .route-song-header {
        position: sticky;
        top: 118px;
        z-index: 19;
        width: 100%;
        margin: 0;
        padding: 6px;
        border: 1px solid var(--border);
        border-radius: 12px 12px 0 0;
        background: color-mix(in srgb, var(--surface) 98%, transparent);
        box-shadow: 0 5px 14px rgba(30, 20, 50, .08);
        backdrop-filter: blur(12px);
    }

    body[data-mobile-page="songbook"] .route-song-list {
        margin-top: 0;
        border-right: 1px solid var(--border);
        border-left: 1px solid var(--border);
        border-radius: 0 0 12px 12px;
        overflow: hidden;
    }

    body[data-mobile-page="songbook"] .route-song-row:last-child {
        border-bottom: 1px solid var(--border);
        border-radius: 0 0 12px 12px;
    }
}

@media (max-width: 390px) {
    body[data-mobile-page="songbook"] .route-song-header {
        top: 114px;
    }
}

/* =========================================================
   2026-08-03 스크롤 UX 통합 개선
   - PC/모바일 고정 헤더의 겹침 방지
   - 스크롤 중 자연스러운 배경/그림자 전환
   - 최상단 이동 버튼
   ========================================================= */

:root {
    --global-sticky-height: 76px;
    --route-sticky-height: 76px;
    --song-column-sticky-top: 152px;
}

/* 기본 상단 헤더는 스크롤 중에도 내용과 자연스럽게 구분됩니다. */
.top-header,
.route-page-header,
.route-song-header {
    transition:
        background-color .2s ease,
        border-color .2s ease,
        box-shadow .2s ease,
        backdrop-filter .2s ease;
}

.top-header.is-scrolled,
body.page-is-scrolled .top-header {
    background: color-mix(in srgb, var(--background) 92%, transparent);
    box-shadow: 0 8px 22px rgba(25, 16, 45, .09);
    backdrop-filter: blur(18px) saturate(1.15);
}

/* 전용 페이지 상단 헤더: PC에서도 고정하고 전역 헤더 바로 아래에 배치 */
.route-page-header {
    position: sticky;
    top: var(--global-sticky-height);
    z-index: 42;
    min-height: var(--route-sticky-height);
    margin: -12px -8px 18px;
    padding: 14px 16px;
    background: color-mix(in srgb, var(--background) 96%, transparent);
    border: 1px solid transparent;
    border-bottom-color: var(--border);
    border-radius: 0 0 16px 16px;
    backdrop-filter: blur(18px) saturate(1.12);
}

.route-page-header.is-scrolled,
body.page-is-scrolled .route-page-header {
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border-color: var(--border);
    box-shadow: 0 10px 25px rgba(28, 18, 48, .11);
}

/* 노래책 칼럼 헤더는 전용 페이지 헤더 바로 아래에 붙습니다. */
.route-song-header,
body[data-mobile-page="songbook"] .route-song-header {
    top: var(--song-column-sticky-top);
    z-index: 38;
    margin: 0;
    border-radius: 12px 12px 0 0;
    background: color-mix(in srgb, var(--surface) 97%, transparent);
    box-shadow: 0 6px 16px rgba(27, 18, 48, .08);
    backdrop-filter: blur(16px) saturate(1.1);
}

body.page-is-scrolled .route-song-header {
    border-color: color-mix(in srgb, var(--primary) 20%, var(--border));
    box-shadow: 0 8px 20px rgba(28, 18, 48, .12);
}

/* 목록 시작부가 고정 헤더와 한 덩어리처럼 보이게 연결 */
.route-song-list,
body[data-mobile-page="songbook"] .route-song-list {
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 0 13px 13px;
    overflow: hidden;
}

.route-song-row:last-child {
    border-bottom: 0;
}

/* 고정 영역으로 이동했을 때 콘텐츠가 헤더 뒤에 숨지 않도록 */
.route-page-body,
#scheduleSection,
#songbookSection,
#homeworkSection {
    scroll-margin-top: calc(var(--song-column-sticky-top) + 16px);
}

/* 최상단 이동 버튼 */
.scroll-top-button {
    position: fixed;
    right: 24px;
    bottom: 64px;
    z-index: 120;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    color: white;
    background: linear-gradient(145deg, var(--primary), #7041ba);
    border: 1px solid color-mix(in srgb, white 24%, transparent);
    border-radius: 16px;
    box-shadow: 0 12px 28px color-mix(in srgb, var(--primary) 28%, transparent);
    font-size: 23px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(14px) scale(.92);
    transition:
        opacity .2s ease,
        visibility .2s ease,
        transform .2s ease,
        box-shadow .2s ease;
}

.scroll-top-button.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.scroll-top-button:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 15px 32px color-mix(in srgb, var(--primary) 38%, transparent);
}

.scroll-top-button:active {
    transform: translateY(0) scale(.95);
}

.scroll-top-button:focus-visible {
    outline: 3px solid var(--primary-soft);
    outline-offset: 3px;
}

@media (max-width: 1150px) and (min-width: 761px) {
    :root {
        --route-sticky-height: 72px;
        --song-column-sticky-top: 148px;
    }

    .route-page-header {
        min-height: var(--route-sticky-height);
    }
}

@media (max-width: 760px) {
    :root {
        --global-sticky-height: 58px;
        --route-sticky-height: 60px;
        --song-column-sticky-top: 118px;
    }

    .route-page-header {
        top: var(--global-sticky-height);
        min-height: var(--route-sticky-height);
        margin: 0 -12px 12px;
        padding: 9px 12px;
        border-right: 0;
        border-left: 0;
        border-radius: 0 0 14px 14px;
    }

    .route-page-header.is-scrolled,
    body.page-is-scrolled .route-page-header {
        box-shadow: 0 7px 18px rgba(28, 18, 48, .10);
    }

    .route-song-header,
    body[data-mobile-page="songbook"] .route-song-header {
        top: var(--song-column-sticky-top);
        border-radius: 10px 10px 0 0;
        box-shadow: 0 5px 13px rgba(28, 18, 48, .08);
    }

    .scroll-top-button {
        right: 14px;
        bottom: calc(104px + env(safe-area-inset-bottom));
        width: 44px;
        height: 44px;
        border-radius: 15px;
        font-size: 21px;
    }
}

@media (max-width: 390px) {
    :root {
        --song-column-sticky-top: 114px;
    }

    .scroll-top-button {
        right: 12px;
        width: 42px;
        height: 42px;
    }
}

/* 움직임 최소화 설정을 사용하는 환경 */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .scroll-top-button,
    .top-header,
    .route-page-header,
    .route-song-header {
        transition: none;
    }
}

/* 방송 일정 전용 페이지: 관리자에서 등록한 내용을 생략 없이 표시 */
.route-page[data-route="schedule"] .route-week-row,
body[data-mobile-page="schedule"] .route-week-row {
    align-items: start;
}

.route-page[data-route="schedule"] .route-week-content,
body[data-mobile-page="schedule"] .route-week-content {
    min-width: 0;
}

.route-page[data-route="schedule"] .route-week-content strong,
body[data-mobile-page="schedule"] .route-week-content strong {
    display: block;
    overflow: visible;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    text-overflow: clip;
    line-height: 1.55;
}

.route-week-time {
    display: inline-flex;
    align-items: center;
    margin: 0 0 6px;
    padding: 4px 8px;
    color: var(--primary);
    background: var(--primary-soft);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.route-page[data-route="schedule"] .route-week-content p,
body[data-mobile-page="schedule"] .route-week-content p {
    display: block;
    overflow: visible;
    margin: 8px 0 0;
    padding-top: 8px;
    color: var(--text-muted);
    border-top: 1px dashed var(--border);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.55;
    -webkit-line-clamp: unset;
}

.route-week-note-label {
    display: inline-block;
    margin-right: 7px;
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
}

@media (max-width: 760px) {
    body[data-mobile-page="schedule"] .route-week-row {
        min-height: 0;
        padding: 13px 11px;
    }

    body[data-mobile-page="schedule"] .route-week-content strong {
        font-size: 13px;
    }
}

/* 공지사항 */
.route-notice-list {
    display: grid;
    gap: 12px;
}

.route-notice-item {
    overflow: hidden;
    border: 1px solid var(--border-color, rgba(119, 86, 160, 0.18));
    border-radius: 16px;
    background: var(--card-bg, #fff);
    box-shadow: 0 10px 26px rgba(73, 49, 104, 0.06);
}

.route-notice-item.pinned {
    border-color: rgba(141, 92, 220, 0.36);
}

.route-notice-summary {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    padding: 17px 18px;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.route-notice-summary strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notice-category {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(137, 91, 215, 0.12);
    color: #7650b4;
    font-size: 12px;
    font-weight: 800;
}

.route-notice-summary time {
    color: var(--muted-text, #8b8494);
    font-size: 13px;
    white-space: nowrap;
}

.notice-chevron {
    transition: transform .2s ease;
}

.route-notice-item.open .notice-chevron {
    transform: rotate(180deg);
}

.route-notice-content {
    padding: 0 18px 18px;
    border-top: 1px solid rgba(119, 86, 160, 0.12);
    white-space: pre-wrap;
    line-height: 1.75;
    color: var(--body-text, #514b59);
}

.route-notice-content:not([hidden]) {
    padding-top: 17px;
}

.notice-option-row {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin: 14px 0 4px;
}

.admin-check-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.admin-check-field input {
    width: 18px;
    height: 18px;
}

.admin-notice-list {
    display: grid;
    gap: 10px;
}

.admin-notice-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid rgba(119, 86, 160, 0.16);
    border-radius: 14px;
    background: rgba(255,255,255,.55);
}

.admin-notice-item > div {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.admin-notice-item strong,
.admin-notice-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-notice-item span {
    color: var(--muted-text, #8b8494);
    font-size: 13px;
}

body.dark-mode .route-notice-item,
body.dark-mode .admin-notice-item {
    background: rgba(31, 27, 39, .94);
}

@media (max-width: 760px) {
    .route-notice-summary {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 9px;
        padding: 14px;
    }

    .route-notice-summary time {
        grid-column: 2;
        grid-row: 2;
        font-size: 12px;
    }

    .notice-chevron {
        grid-column: 3;
        grid-row: 1 / span 2;
    }

    .route-notice-summary strong {
        white-space: normal;
        line-height: 1.35;
    }

    .route-notice-content {
        padding-left: 14px;
        padding-right: 14px;
    }

    .admin-notice-item {
        align-items: flex-start;
    }
}


/* 노래책 제목 옆 전용 공지 */
.route-title-line {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.songbook-notice-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid rgba(139, 92, 246, 0.28);
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.10);
    color: var(--primary-color, #7c3aed);
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.songbook-notice-chip:hover,
.songbook-notice-chip.active {
    background: rgba(139, 92, 246, 0.18);
    box-shadow: 0 8px 22px rgba(76, 29, 149, 0.12);
    transform: translateY(-1px);
}

.songbook-inline-notice {
    margin: 0 0 14px;
    padding: 15px 17px;
    border: 1px solid rgba(139, 92, 246, 0.22);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.10), rgba(236, 72, 153, 0.06));
}

.songbook-inline-notice-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.songbook-inline-notice-head > div {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.songbook-inline-notice-head strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.songbook-inline-notice-head time {
    color: var(--text-subtle, #777);
    font-size: 12px;
    white-space: nowrap;
}

.songbook-inline-notice p {
    margin: 10px 0 0;
    color: var(--text-secondary, #555);
    line-height: 1.65;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

body.dark-mode .songbook-notice-chip {
    border-color: rgba(196, 181, 253, 0.30);
    background: rgba(139, 92, 246, 0.16);
    color: #ddd6fe;
}

body.dark-mode .songbook-inline-notice {
    border-color: rgba(196, 181, 253, 0.20);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.17), rgba(190, 24, 93, 0.09));
}

@media (max-width: 760px) {
    .route-title-line { gap: 7px; }
    .songbook-notice-chip {
        min-height: 30px;
        padding: 5px 9px;
        font-size: 11px;
    }
    .songbook-inline-notice {
        margin-bottom: 10px;
        padding: 12px 13px;
        border-radius: 13px;
    }
    .songbook-inline-notice-head { align-items: flex-start; }
    .songbook-inline-notice-head > div { align-items: flex-start; flex-wrap: wrap; gap: 6px; }
    .songbook-inline-notice-head strong { white-space: normal; }
    .songbook-inline-notice p { font-size: 13px; line-height: 1.6; }
}

/* 노래책 전용 공지는 노래책 페이지에서만 표시 */
.songbook-notice-chip[hidden] {
    display: none !important;
}

/* 노래책 공지 펼침 영역 - 다크모드 가독성 보정 */
body.dark-mode .songbook-inline-notice {
    border-color: rgba(196, 181, 253, 0.36);
    background: linear-gradient(135deg, rgba(76, 29, 149, 0.50), rgba(76, 29, 149, 0.30));
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

body.dark-mode .songbook-inline-notice-head strong {
    color: #ffffff;
}

body.dark-mode .songbook-inline-notice-head time {
    color: #d8d2e7;
}

body.dark-mode .songbook-inline-notice .notice-category {
    border-color: rgba(221, 214, 254, 0.34);
    background: rgba(221, 214, 254, 0.14);
    color: #ede9fe;
}

body.dark-mode .songbook-inline-notice p {
    color: #f1edf8;
}

body.dark-mode .songbook-inline-notice a {
    color: #c4b5fd;
}

/* 회원가입/로그인 창 다크모드 가독성 최종 보정 */
body.dark-mode .member-overlay {
    background: rgba(4, 4, 10, 0.88);
    backdrop-filter: blur(4px);
}

body.dark-mode .member-panel {
    background: #171322;
    color: #f8f5ff;
    border-color: #51416f;
}

body.dark-mode .member-panel .small-title,
body.dark-mode .member-panel-header h2,
body.dark-mode .member-auth-form > label > span,
body.dark-mode .member-benefit-card strong,
body.dark-mode .signup-quiz-head strong,
body.dark-mode .signup-profile-quiz legend,
body.dark-mode .quiz-choice-text {
    color: #ffffff !important;
}

body.dark-mode .member-benefit-card {
    background: #211a31;
    border-color: #665086;
}

body.dark-mode .member-benefit-card p,
body.dark-mode .member-security-note,
body.dark-mode .signup-quiz-head p,
body.dark-mode .signup-quiz-message {
    color: #ded7ef !important;
}

body.dark-mode .member-auth-tabs {
    background: #100c19;
}

body.dark-mode .member-auth-tab {
    color: #cfc5e4;
}

body.dark-mode .member-auth-tab.active {
    background: #2a203b;
    color: #ddd6fe;
}

body.dark-mode .member-close-button {
    background: #2a2139;
    color: #ffffff;
}

body.dark-mode .member-auth-form input {
    background: #100c19;
    color: #ffffff;
    border-color: #51416f;
    opacity: 1;
}

body.dark-mode .member-auth-form input::placeholder {
    color: #a99fbc;
    opacity: 1;
}

body.dark-mode .signup-quiz-card {
    background: #211a31;
    border-color: #665086;
}

body.dark-mode .signup-profile-quiz {
    background: #1a1426;
    border-color: #51416f;
}

body.dark-mode .signup-profile-quiz label {
    background: #100c19;
    border-color: #51416f;
    color: #ffffff;
}

body.dark-mode .signup-profile-quiz label:hover {
    background: #21182f;
    border-color: #a78bfa;
}

body.dark-mode .quiz-choice-badge {
    background: rgba(167, 139, 250, 0.22);
    color: #ede9fe;
}

body.dark-mode .signup-quiz-message.success {
    color: #86efac !important;
}

body.dark-mode .signup-quiz-message.error {
    color: #fca5a5 !important;
}

body.dark-mode .member-security-note {
    border-top-color: #51416f;
}

/* 관리자 전용 로그인 준비 화면 */
.admin-login-overlay {
    position: fixed;
    inset: 0;
    z-index: 1390;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(10, 8, 18, 0.86);
    backdrop-filter: blur(4px);
}
.admin-login-overlay[hidden] { display: none !important; }
.admin-login-panel {
    width: min(520px, 100%);
    max-height: min(820px, calc(100vh - 40px));
    overflow: auto;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: #ffffff;
    color: var(--text);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
}
.admin-login-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.admin-login-header h2 { margin: 3px 0 5px; }
.admin-login-header span { color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.admin-login-close {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border: 0;
    border-radius: 50%;
    background: var(--surface-soft);
    color: var(--text);
    font-size: 26px;
    cursor: pointer;
}
.admin-security-summary,
.admin-device-status,
.admin-preview-access {
    border: 1px solid var(--border);
    border-radius: 16px;
}
.admin-security-summary {
    padding: 16px;
    background: #f8f3ff;
}
.admin-security-summary strong { color: var(--text); }
.admin-security-summary p,
.admin-device-status p,
.admin-preview-access p {
    margin: 7px 0 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
}
.admin-device-status {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    padding: 14px;
    background: #ffffff;
}
.admin-device-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: #f1e9ff;
    font-size: 20px;
}
.admin-device-status strong { color: var(--text); }
.admin-device-badge {
    padding: 6px 9px;
    border-radius: 999px;
    background: #f1e9ff;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}
.admin-login-form {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}
.admin-login-form label { display: grid; gap: 7px; font-weight: 800; }
.admin-login-form input {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
    color: var(--text);
}
.admin-login-form input:disabled { opacity: .75; cursor: not-allowed; }
.admin-preview-access {
    margin-top: 18px;
    padding: 15px;
    background: #fafafa;
}
.admin-preview-access .secondary-button { width: 100%; margin-top: 12px; }
.admin-login-warning {
    margin: 16px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.65;
}
body.admin-login-open { overflow: hidden; }

body.dark-mode .admin-login-overlay { background: rgba(3, 3, 8, 0.88); }
body.dark-mode .admin-login-panel {
    background: #171322;
    color: #f8f5ff;
    border-color: #4b3d6a;
}
body.dark-mode .admin-login-header h2,
body.dark-mode .admin-security-summary strong,
body.dark-mode .admin-device-status strong,
body.dark-mode .admin-login-form label { color: #ffffff; }
body.dark-mode .admin-login-header span,
body.dark-mode .admin-security-summary p,
body.dark-mode .admin-device-status p,
body.dark-mode .admin-preview-access p,
body.dark-mode .admin-login-warning { color: #ded7ef; }
body.dark-mode .admin-login-close { background: #261f35; color: #ffffff; }
body.dark-mode .admin-security-summary { background: #211a31; border-color: #5b477d; }
body.dark-mode .admin-device-status,
body.dark-mode .admin-preview-access { background: #110d1b; border-color: #493b64; }
body.dark-mode .admin-device-icon,
body.dark-mode .admin-device-badge { background: rgba(167, 139, 250, .17); color: #ddd6fe; }
body.dark-mode .admin-login-form input { background: #110d1b; color: #ffffff; border-color: #493b64; }

@media (max-width: 640px) {
    .admin-login-panel { padding: 20px 16px; border-radius: 20px; }
    .admin-device-status { grid-template-columns: 42px minmax(0, 1fr); }
    .admin-device-badge { grid-column: 2; justify-self: start; }
}

/* 회원 즐겨찾기 동기화 준비 */
.member-sync-preview {
    margin-top: 14px;
    padding: 15px;
    border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border-color));
    border-radius: 16px;
    background: color-mix(in srgb, var(--primary) 5%, var(--card-bg));
}
.member-sync-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.member-sync-preview-head strong { color: var(--text-main); }
.member-sync-preview-head p,
.member-sync-note {
    margin: 5px 0 0;
    color: var(--text-sub);
    font-size: 12px;
    line-height: 1.55;
}
.member-sync-count {
    flex: 0 0 auto;
    min-width: 54px;
    padding: 7px 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 900;
    text-align: center;
}
.member-merge-option {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: flex-start;
    gap: 9px !important;
    margin-top: 13px;
    padding: 11px 12px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--text-main);
    font-size: 12px;
    line-height: 1.5;
}
.member-merge-option input {
    width: auto !important;
    margin: 2px 0 0;
    accent-color: var(--primary);
}
body.dark-mode .member-sync-preview,
[data-theme="dark"] .member-sync-preview {
    background: #211a31;
    border-color: #5b477d;
}
body.dark-mode .member-sync-preview-head strong,
body.dark-mode .member-merge-option,
[data-theme="dark"] .member-sync-preview-head strong,
[data-theme="dark"] .member-merge-option { color: #ffffff; }
body.dark-mode .member-sync-preview-head p,
body.dark-mode .member-sync-note,
[data-theme="dark"] .member-sync-preview-head p,
[data-theme="dark"] .member-sync-note { color: #d7cfea; }
body.dark-mode .member-merge-option,
[data-theme="dark"] .member-merge-option {
    background: #110d1b;
    border-color: #493b64;
}
body.dark-mode .member-sync-count,
[data-theme="dark"] .member-sync-count {
    background: rgba(167, 139, 250, 0.18);
    color: #ddd6fe;
}

/* 관리자 회원 관리 준비 화면 */
.admin-member-preview {
    display: grid;
    gap: 18px;
}

.admin-member-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.admin-member-summary article {
    display: grid;
    gap: 7px;
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
}

.admin-member-summary span {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.admin-member-summary strong {
    color: var(--text);
    font-size: 17px;
}

.admin-member-policy-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    border: 1px solid color-mix(in srgb, var(--primary) 34%, var(--border));
    border-radius: 18px;
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.admin-member-policy-card h3 {
    margin: 4px 0 7px;
    color: var(--text);
}

.admin-member-policy-card p:last-child {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.65;
}

.admin-member-lock {
    flex: 0 0 auto;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
}

.admin-member-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
}

.admin-member-toolbar label {
    display: grid;
    flex: 1;
    gap: 7px;
    color: var(--text);
    font-weight: 800;
}

.admin-member-toolbar input {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
    color: var(--text);
}

.admin-member-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
}

.admin-member-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

.admin-member-table th,
.admin-member-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    text-align: left;
    font-size: 12px;
}

.admin-member-table th {
    background: var(--surface-soft);
    color: var(--text-muted);
    font-weight: 800;
}

.admin-member-table tbody tr:last-child td {
    border-bottom: 0;
}

.admin-member-empty {
    padding: 34px 16px !important;
    color: var(--text-muted) !important;
    text-align: center !important;
}

.admin-member-rules {
    padding: 17px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-soft);
    color: var(--text);
}

.admin-member-rules ul {
    display: grid;
    gap: 7px;
    margin: 11px 0 0;
    padding-left: 20px;
    color: var(--text-muted);
    line-height: 1.55;
}

body.dark-mode .admin-member-summary article,
body.dark-mode .admin-member-table-wrap,
body.dark-mode .admin-member-toolbar input {
    background: #171322;
    border-color: #493b64;
}

body.dark-mode .admin-member-policy-card {
    background: #211a31;
    border-color: #5b477d;
}

body.dark-mode .admin-member-table th,
body.dark-mode .admin-member-rules {
    background: #211a31;
}

body.dark-mode .admin-member-summary strong,
body.dark-mode .admin-member-policy-card h3,
body.dark-mode .admin-member-toolbar label,
body.dark-mode .admin-member-table th,
body.dark-mode .admin-member-table td,
body.dark-mode .admin-member-rules strong {
    color: #f8f5ff;
}

body.dark-mode .admin-member-summary span,
body.dark-mode .admin-member-policy-card p:last-child,
body.dark-mode .admin-member-empty,
body.dark-mode .admin-member-rules ul {
    color: #d7cfea !important;
}

@media (max-width: 760px) {
    .admin-member-summary {
        grid-template-columns: 1fr;
    }

    .admin-member-policy-card,
    .admin-member-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-member-lock {
        align-self: flex-start;
    }
}

/* 회원/즐겨찾기 후속 기능 */
.site-footer {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    flex-wrap:wrap;
}
.footer-links {
    display:flex;
    align-items:center;
    gap:6px;
    flex-wrap:wrap;
}
.footer-links button {
    border:0;
    padding:5px 7px;
    background:transparent;
    color:var(--text-muted, var(--text-sub));
    font:inherit;
    font-size:12px;
    cursor:pointer;
}
.footer-links button:hover { color:var(--primary); text-decoration:underline; }

.favorite-local-tools {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:8px;
    margin-top:12px;
}
.favorite-import-label {
    display:flex !important;
    align-items:center;
    justify-content:center;
    min-height:40px;
    cursor:pointer;
    text-align:center;
}
.favorite-import-label input { display:none; }
.favorite-reset-button {
    min-height:40px;
    border:1px solid rgba(220,38,38,.28);
    border-radius:10px;
    background:rgba(220,38,38,.06);
    color:#b91c1c;
    font-weight:800;
    cursor:pointer;
}
.favorite-local-message {
    min-height:18px;
    margin:8px 0 0;
    color:var(--text-sub);
    font-size:12px;
    font-weight:700;
}
.favorite-local-message.success { color:#15803d; }
.favorite-local-message.error { color:#dc2626; }

.signup-consent-box {
    display:grid;
    gap:8px;
    padding:13px;
    border:1px solid var(--border-color);
    border-radius:14px;
    background:var(--soft-bg);
}
.member-auth-form .signup-consent-box label {
    display:grid;
    grid-template-columns:18px minmax(0,1fr);
    align-items:start;
    gap:9px;
    font-size:12px;
    font-weight:700;
    line-height:1.55;
}
.signup-consent-box input { width:auto; margin-top:2px; }
.signup-consent-box strong { color:var(--primary); }
.inline-policy-button {
    border:0;
    padding:0;
    background:transparent;
    color:var(--primary);
    font:inherit;
    font-weight:800;
    text-decoration:underline;
    cursor:pointer;
}
.password-rule-card {
    display:flex;
    align-items:flex-start;
    gap:10px;
    padding:12px 13px;
    border-radius:13px;
    background:rgba(141,92,230,.08);
    color:var(--text-sub);
    font-size:12px;
    line-height:1.55;
}
.password-rule-card strong { flex:0 0 auto; color:var(--text-main); }

.policy-overlay {
    position:fixed;
    inset:0;
    z-index:1450;
    display:grid;
    place-items:center;
    padding:20px;
    background:rgba(8,6,15,.82);
    backdrop-filter:blur(5px);
}
.policy-overlay[hidden] { display:none !important; }
.policy-panel {
    width:min(620px,100%);
    max-height:min(760px,calc(100vh - 40px));
    overflow:auto;
    border:1px solid var(--border-color);
    border-radius:24px;
    padding:24px;
    background:var(--card-bg);
    color:var(--text-main);
    box-shadow:0 28px 90px rgba(0,0,0,.38);
}
.policy-header {
    position:sticky;
    top:-24px;
    z-index:2;
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:16px;
    margin:-24px -24px 18px;
    padding:24px;
    border-bottom:1px solid var(--border-color);
    background:var(--card-bg);
}
.policy-header h2 { margin:4px 0 0; }
.policy-close-button {
    width:40px;
    height:40px;
    border:0;
    border-radius:50%;
    background:var(--soft-bg);
    color:var(--text-main);
    font-size:26px;
    cursor:pointer;
}
.policy-content { display:grid; gap:12px; }
.policy-content section {
    padding:16px;
    border:1px solid var(--border-color);
    border-radius:16px;
    background:var(--soft-bg);
}
.policy-content h3 { margin:0 0 7px; font-size:15px; color:var(--text-main); }
.policy-content p { margin:0; color:var(--text-sub); line-height:1.75; font-size:13px; }
body.policy-open { overflow:hidden; }

body.dark-mode .footer-links button,
[data-theme="dark"] .footer-links button { color:#cfc7e3; }
body.dark-mode .favorite-reset-button,
[data-theme="dark"] .favorite-reset-button {
    border-color:rgba(248,113,113,.38);
    background:rgba(127,29,29,.22);
    color:#fca5a5;
}
body.dark-mode .favorite-local-message,
[data-theme="dark"] .favorite-local-message { color:#d7cfea; }
body.dark-mode .favorite-local-message.success,
[data-theme="dark"] .favorite-local-message.success { color:#86efac; }
body.dark-mode .favorite-local-message.error,
[data-theme="dark"] .favorite-local-message.error { color:#fca5a5; }
body.dark-mode .signup-consent-box,
[data-theme="dark"] .signup-consent-box { background:#110d1b; border-color:#493b64; }
body.dark-mode .signup-consent-box span,
[data-theme="dark"] .signup-consent-box span { color:#eee9f8; }
body.dark-mode .password-rule-card,
[data-theme="dark"] .password-rule-card { background:rgba(167,139,250,.12); color:#ddd6ee; }
body.dark-mode .password-rule-card strong,
[data-theme="dark"] .password-rule-card strong { color:#fff; }
body.dark-mode .policy-panel,
body.dark-mode .policy-header,
[data-theme="dark"] .policy-panel,
[data-theme="dark"] .policy-header { background:#171322; border-color:#493b64; color:#f8f5ff; }
body.dark-mode .policy-content section,
[data-theme="dark"] .policy-content section { background:#110d1b; border-color:#493b64; }
body.dark-mode .policy-content h3,
[data-theme="dark"] .policy-content h3 { color:#fff; }
body.dark-mode .policy-content p,
[data-theme="dark"] .policy-content p { color:#ded7ef; }
body.dark-mode .policy-close-button,
[data-theme="dark"] .policy-close-button { background:#261f35; color:#fff; }

@media (max-width:760px) {
    .site-footer { justify-content:center; text-align:center; }
    .footer-links { justify-content:center; }
    .favorite-local-tools { grid-template-columns:1fr; }
    .policy-panel { padding:18px 15px; border-radius:20px; }
    .policy-header { top:-18px; margin:-18px -15px 15px; padding:18px 15px; }
}

/* 관리자 관리 홈 · CSV 도구 */
.admin-dashboard { display:grid; gap:18px; }
.admin-dashboard-hero { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:20px; border:1px solid var(--border); border-radius:18px; background:linear-gradient(135deg,var(--primary-soft),var(--surface)); }
.admin-dashboard-hero h3 { margin:4px 0 6px; font-size:22px; }
.admin-dashboard-hero p { margin:0; color:var(--text-muted); line-height:1.55; }
.admin-dashboard-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.admin-dashboard-stats article { padding:18px; border:1px solid var(--border); border-radius:16px; background:var(--surface); }
.admin-dashboard-stats span { display:block; color:var(--text-muted); font-size:12px; font-weight:700; }
.admin-dashboard-stats strong { display:block; margin-top:8px; color:var(--text); font-size:22px; }
.admin-dashboard-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.admin-dashboard-card { display:grid; align-content:start; gap:14px; padding:18px; border:1px solid var(--border); border-radius:16px; background:var(--surface); }
.admin-dashboard-card h4 { margin:0 0 4px; font-size:16px; }
.admin-dashboard-card p { margin:0; color:var(--text-muted); font-size:12px; }
.admin-quick-actions { display:grid; grid-template-columns:1fr 1fr; gap:9px; }
.admin-quick-actions button { min-height:44px; border:1px solid var(--border); border-radius:12px; background:var(--background); color:var(--text); font-weight:800; cursor:pointer; }
.admin-quick-actions button:hover { border-color:var(--primary); color:var(--primary); }
.admin-health-result { min-height:54px; padding:14px; border:1px dashed var(--border); border-radius:12px; background:var(--background); color:var(--text-muted); line-height:1.55; }
.admin-health-result.is-good { border-style:solid; border-color:rgba(34,197,94,.35); background:rgba(34,197,94,.08); color:#15803d; }
.admin-health-result.has-issues { border-style:solid; border-color:rgba(239,68,68,.35); background:rgba(239,68,68,.08); color:#b91c1c; }
.admin-song-list-header { align-items:flex-start; gap:12px; }
.admin-song-list-header > div:first-child { display:grid; gap:4px; }
.admin-song-file-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
.admin-song-file-actions .secondary-button { display:inline-flex; align-items:center; justify-content:center; }
[data-theme="dark"] .admin-health-result.is-good, body.dark-mode .admin-health-result.is-good { color:#86efac; }
[data-theme="dark"] .admin-health-result.has-issues, body.dark-mode .admin-health-result.has-issues { color:#fca5a5; }
@media (max-width:900px) {
  .admin-dashboard-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .admin-dashboard-grid { grid-template-columns:1fr; }
}
@media (max-width:600px) {
  .admin-dashboard-hero { align-items:stretch; flex-direction:column; padding:16px; }
  .admin-dashboard-stats { grid-template-columns:1fr 1fr; gap:8px; }
  .admin-dashboard-stats article { padding:14px; }
  .admin-dashboard-stats strong { font-size:18px; }
  .admin-quick-actions { grid-template-columns:1fr; }
  .admin-song-list-header { flex-direction:column; }
  .admin-song-file-actions { width:100%; justify-content:stretch; }
  .admin-song-file-actions > * { flex:1 1 140px; }
}

/* 방문자 노래책 곡 수 표시 */
.songbook-heading-group {
    display: flex;
    align-items: baseline;
    min-width: 0;
    gap: 10px;
}

.songbook-count-summary,
.route-song-count-summary {
    color: var(--text-muted, var(--text-sub));
    font-size: 12px;
    font-weight: 750;
    line-height: 1.4;
    white-space: nowrap;
}

.route-song-count-summary {
    display: flex;
    align-items: center;
    min-height: 34px;
    margin: -7px 0 12px;
    padding: 7px 11px;
    border: 1px solid var(--border-color, var(--border));
    border-radius: 11px;
    background: var(--soft-bg, rgba(126, 87, 194, 0.06));
}

body.dark-mode .songbook-count-summary,
body.dark-mode .route-song-count-summary,
[data-theme="dark"] .songbook-count-summary,
[data-theme="dark"] .route-song-count-summary {
    color: #ddd6ee;
}

body.dark-mode .route-song-count-summary,
[data-theme="dark"] .route-song-count-summary {
    border-color: #493b64;
    background: #1b1528;
}

@media (max-width: 760px) {
    .songbook-card-header {
        align-items: center;
        gap: 10px;
    }

    .songbook-heading-group {
        flex-wrap: wrap;
        gap: 2px 8px;
    }

    .songbook-count-summary {
        width: 100%;
        font-size: 11px;
    }

    .route-song-count-summary {
        margin-top: -5px;
        font-size: 11px;
    }
}

/* 선택한 장르의 곡 수 표시 */
.filter-list button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.genre-filter-count {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    color: inherit;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
}

body.dark-mode .filter-list button.active .genre-filter-count,
[data-theme="dark"] .filter-list button.active .genre-filter-count {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.songbook-count-summary[hidden],
.route-song-count-summary[hidden] {
    display: none !important;
}

/* 장르 목록: 스크롤바 없이 마우스·터치로 잡아 끌기 */
.filter-list {
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior-inline: contain;
    scroll-behavior: smooth;
    touch-action: pan-x;
    cursor: grab;
    -webkit-overflow-scrolling: touch;
}

.filter-list::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.filter-list.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
    user-select: none;
    -webkit-user-select: none;
}

.filter-list.is-dragging button {
    pointer-events: none;
}

/* 전체보기 노래책 장르 선택 */
.route-genre-filter-list {
    margin: 14px 0 16px;
    padding-bottom: 2px;
}

.route-genre-filter-list button {
    flex: 0 0 auto;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .route-genre-filter-list {
        margin: 12px -2px 14px;
    }
}


/* 홈 화면 노래책 미리보기는 어떤 상황에서도 최대 3곡 */
#songbookSection #songRows.home-song-preview > .song-row:nth-of-type(n + 4) {
    display: none !important;
}

/* 홈 노래책 무작위 3곡 전환 */
.home-song-preview.is-random-preview .song-row {
    animation: homeSongPreviewIn 240ms ease both;
}

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

@media (prefers-reduced-motion: reduce) {
    .home-song-preview.is-random-preview .song-row { animation: none; }
}

/* 회원가입 입력 검증 미리보기 */
.password-input-wrap {
    position: relative;
    display: grid;
}
.password-input-wrap input {
    padding-right: 64px;
}
.password-toggle-button {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    min-width: 46px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: var(--soft-bg);
    color: var(--text-main);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}
.password-strength {
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: color-mix(in srgb, var(--border-color) 60%, transparent);
}
.password-strength span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #ef4444;
    transition: width .2s ease, background .2s ease;
}
.password-strength span[data-level="2"] { background: #f59e0b; }
.password-strength span[data-level="3"] { background: #22c55e; }
.signup-field-message {
    min-height: 17px;
    color: var(--text-sub);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.45;
}
.signup-field-message.success { color: #15803d; }
.signup-field-message.error { color: #dc2626; }
.signup-consent-box input:not(:disabled) { cursor: pointer; }
.signup-preview-submit:not(:disabled) {
    cursor: pointer;
    opacity: 1;
}
body.dark-mode .password-toggle-button,
[data-theme="dark"] .password-toggle-button {
    background: #251d34;
    border-color: #51416e;
    color: #f8f5ff;
}
body.dark-mode .signup-field-message,
[data-theme="dark"] .signup-field-message { color: #d8d0e8; }
body.dark-mode .signup-field-message.success,
[data-theme="dark"] .signup-field-message.success { color: #86efac; }
body.dark-mode .signup-field-message.error,
[data-theme="dark"] .signup-field-message.error { color: #fca5a5; }
body.dark-mode .password-strength,
[data-theme="dark"] .password-strength { background: rgba(255,255,255,.12); }

/* 회원가입 창: 바깥 클릭 방지 및 테스트 가입 안내 */
.member-panel-attention {
    animation: memberPanelAttention .24s ease;
}
@keyframes memberPanelAttention {
    0%, 100% { transform: translateY(0); }
    40% { transform: translateY(-3px); }
    70% { transform: translateY(2px); }
}
.signup-submit-message {
    min-height: 20px;
    margin: -4px 0 0;
    color: var(--text-sub);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.55;
}
.signup-submit-message.success { color: #15803d; }
body.dark-mode .signup-submit-message,
[data-theme="dark"] .signup-submit-message { color: #d7cfea; }
body.dark-mode .signup-submit-message.success,
[data-theme="dark"] .signup-submit-message.success { color: #86efac; }

/* 회원가입·로그인 창 스크롤바 디자인 */
.member-panel {
    scrollbar-width: thin;
    scrollbar-color: #a98be8 rgba(125, 98, 170, 0.10);
    scrollbar-gutter: stable;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
}

.member-panel::-webkit-scrollbar {
    width: 11px;
}

.member-panel::-webkit-scrollbar-track {
    margin-block: 18px;
    border-radius: 999px;
    background: rgba(125, 98, 170, 0.09);
    box-shadow: inset 0 0 0 1px rgba(125, 98, 170, 0.07);
}

.member-panel::-webkit-scrollbar-thumb {
    min-height: 58px;
    border: 3px solid transparent;
    border-radius: 999px;
    background: linear-gradient(180deg, #b79af1, #8b63d7) padding-box;
}

.member-panel::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #c5adf6, #7650c7) padding-box;
}

.member-panel::-webkit-scrollbar-thumb:active {
    background: #744bc8 padding-box;
}

body.dark-mode .member-panel,
[data-theme="dark"] .member-panel {
    scrollbar-color: #a78bfa rgba(255, 255, 255, 0.07);
}

body.dark-mode .member-panel::-webkit-scrollbar-track,
[data-theme="dark"] .member-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.055);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.045);
}

body.dark-mode .member-panel::-webkit-scrollbar-thumb,
[data-theme="dark"] .member-panel::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #bda7f7, #8461d5) padding-box;
}

body.dark-mode .member-panel::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .member-panel::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #d0c1ff, #9b79e7) padding-box;
}

@media (max-width: 760px) {
    .member-panel {
        scrollbar-gutter: auto;
    }

    .member-panel::-webkit-scrollbar {
        width: 7px;
    }

    .member-panel::-webkit-scrollbar-track {
        margin-block: 14px;
        background: transparent;
        box-shadow: none;
    }

    .member-panel::-webkit-scrollbar-thumb {
        min-height: 46px;
        border-width: 2px;
    }
}

/* 테스트 회원 로그인 상태 */
.member-session-card {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    padding:16px;
    border:1px solid color-mix(in srgb,var(--primary) 28%,var(--border-color));
    border-radius:16px;
    background:color-mix(in srgb,var(--primary) 8%,var(--card-bg));
}
.member-session-card[hidden], #memberLoginFields[hidden] { display:none !important; }
.member-session-card strong { display:block; color:var(--text-main); font-size:15px; }
.member-session-card p { margin:5px 0 0; color:var(--text-sub); font-size:12px; line-height:1.5; }
#memberLoginFields { display:grid; gap:14px; }
.member-login-button.logged-in {
    border-color:color-mix(in srgb,var(--primary) 55%,var(--border-color));
    background:color-mix(in srgb,var(--primary) 12%,var(--card-bg));
    color:var(--primary);
}
body.dark-mode .member-session-card,
[data-theme="dark"] .member-session-card {
    background:#211a31;
    border-color:#5b477d;
}
body.dark-mode .member-session-card strong,
[data-theme="dark"] .member-session-card strong { color:#fff; }
body.dark-mode .member-session-card p,
[data-theme="dark"] .member-session-card p { color:#d7cfea; }
body.dark-mode .member-login-button.logged-in,
[data-theme="dark"] .member-login-button.logged-in {
    background:#2a203c;
    border-color:#6f58a0;
    color:#ddd6fe;
}
@media (max-width:520px) {
    .member-session-card { align-items:flex-start; flex-direction:column; }
    .member-session-card .secondary-button { width:100%; }
}

/* PHP·MySQL 서버 연결 상태 */
.member-server-status {
    display:flex;
    align-items:center;
    gap:8px;
    margin-top:14px;
    padding:10px 12px;
    border:1px solid var(--border-color);
    border-radius:12px;
    background:var(--soft-bg);
    color:var(--text-sub);
    font-size:12px;
    font-weight:800;
}
.member-server-dot {
    width:9px;
    height:9px;
    border-radius:50%;
    background:#f59e0b;
    box-shadow:0 0 0 4px rgba(245,158,11,.12);
}
.member-server-status.connected { color:#15803d; border-color:rgba(34,197,94,.35); background:rgba(34,197,94,.08); }
.member-server-status.connected .member-server-dot { background:#22c55e; box-shadow:0 0 0 4px rgba(34,197,94,.12); }
.member-server-status.offline { color:var(--text-sub); }
.member-server-status.offline .member-server-dot { background:#94a3b8; box-shadow:0 0 0 4px rgba(148,163,184,.12); }
body.dark-mode .member-server-status,
[data-theme="dark"] .member-server-status { background:#120e1d; border-color:#493b64; color:#ddd6fe; }
body.dark-mode .member-server-status.connected,
[data-theme="dark"] .member-server-status.connected { background:rgba(34,197,94,.1); border-color:rgba(74,222,128,.35); color:#86efac; }
