/* Mobile/tablet floating mini player. Loaded after style.css. */
/* Maintenance map:
   - This file is the late-cascade layer for responsive fixes, floating player,
     tablet app-shell UI, and fullscreen player guards.
   - style.css should keep base design tokens and broad page components.
   - For fullscreen player overlap bugs, edit section "67.0" first; sections
     "65.x" and "66.0" are legacy compatibility guards kept for cascade safety.
   - Avoid unscoped !important rules. Scope fixes to a page root, body layout
     class, or .expand-player-overlay.
*/
@media (max-width: 1199px) {
    :root {
        --floating-player-size-final: 74px;
        --floating-player-width-final: min(360px, calc(100vw - 28px));
    }

    .player-bar {
        position: fixed !important;
        grid-column: auto !important;
        grid-row: auto !important;
        left: auto !important;
        right: 14px !important;
        bottom: calc(14px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
        width: var(--floating-player-width-final) !important;
        max-width: var(--floating-player-width-final) !important;
        min-width: 0 !important;
        height: var(--floating-player-size-final) !important;
        min-height: var(--floating-player-size-final) !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        align-items: center !important;
        gap: 10px !important;
        padding: 9px 10px !important;
        border: 1px solid var(--player-control-border, var(--border-color)) !important;
        border-radius: 22px !important;
        box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28) !important;
        overflow: visible !important;
        z-index: var(--z-player, 1000) !important;
        cursor: pointer;
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }

    .player-bar:focus-visible {
        outline: 3px solid color-mix(in srgb, var(--accent-color) 44%, transparent);
        outline-offset: 3px;
    }

    .player-song-info {
        width: auto !important;
        min-width: 0 !important;
        gap: 10px !important;
    }

    .player-album-art,
    .player-album-art img {
        width: 52px !important;
        height: 52px !important;
        min-width: 52px !important;
        border-radius: 15px !important;
    }

    .player-song-details {
        min-width: 0 !important;
    }

    .player-song-title,
    .player-song-artist {
        max-width: 100% !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .player-song-title {
        font-size: 0.9rem !important;
        line-height: 1.25 !important;
    }

    .player-song-artist {
        font-size: 0.78rem !important;
    }

    .player-controls {
        width: auto !important;
        min-width: 52px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .control-buttons {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0 !important;
    }

    #btn-shuffle,
    #btn-prev,
    #btn-next,
    #btn-repeat,
    .player-utils,
    .player-bar .progress-container {
        display: none !important;
    }

    #btn-play-pause {
        display: inline-flex !important;
        width: 52px !important;
        height: 52px !important;
        min-width: 52px !important;
        min-height: 52px !important;
        border-radius: 999px !important;
        flex: 0 0 52px !important;
    }

    .content-body,
    .app-main,
    .main-content,
    .admin-dashboard,
    .settings-page {
        padding-bottom: calc(104px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
    }

    .queue-panel,
    .melon-lite-toast,
    .pwa-install-banner:not(.pwa-install-modal),
    .guest-preview-prompt.preview-premium-sheet {
        bottom: calc(104px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
    }
}

/* 31차: 최근 재생 정리 / 이어듣기 복원 UI */
.recent-history-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 14px;
    padding: 14px 16px;
    border: 1px solid color-mix(in srgb, var(--border-color, #d8e2ee) 86%, transparent);
    border-radius: 16px;
    background: color-mix(in srgb, var(--surface, #fff) 92%, transparent);
}

.recent-history-toolbar > div {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.recent-history-toolbar strong {
    color: var(--text-primary, #0f172a);
    font-weight: 900;
}

.recent-history-toolbar span {
    color: var(--text-secondary, #64748b);
    font-size: 0.9rem;
}

.song-action-group .recent-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    min-width: 36px;
    height: 36px;
    border: 1px solid color-mix(in srgb, #ef4444 22%, var(--border-color, #d8e2ee));
    border-radius: 999px;
    background: color-mix(in srgb, #ef4444 7%, var(--surface, #fff));
    color: #dc2626;
    cursor: pointer;
}

.song-action-group .recent-remove-btn:disabled {
    opacity: 0.55;
    cursor: wait;
}

.recent-history-empty {
    min-height: 180px;
}

.resume-listening-card {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 16px !important;
    border-color: color-mix(in srgb, var(--accent-color, #00c73c) 28%, var(--border-color, #d8e2ee)) !important;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--accent-color, #00c73c) 9%, transparent), transparent 46%),
        color-mix(in srgb, var(--surface, #fff) 94%, transparent) !important;
}

.resume-listening-media img {
    display: block;
    width: 72px;
    height: 72px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.resume-listening-copy {
    min-width: 0;
}

.resume-listening-copy .section-title,
.resume-listening-copy .section-description {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resume-listening-progress {
    width: min(100%, 420px);
    height: 5px;
    margin: 10px 0 5px;
    overflow: hidden;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-secondary, #64748b) 18%, transparent);
}

.resume-listening-progress span {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: var(--accent-color, #00c73c);
    transition: width 180ms ease;
}

.resume-listening-copy small {
    color: var(--text-secondary, #64748b);
    font-weight: 800;
}

.resume-listening-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

body.theme-dark .recent-history-toolbar,
body.theme-dark .resume-listening-card {
    background: color-mix(in srgb, var(--surface, #111827) 88%, transparent) !important;
}

@media (max-width: 1023px) {
    .resume-listening-card {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .resume-listening-media img {
        width: 64px;
        height: 64px;
        border-radius: 14px;
    }

    .resume-listening-actions {
        grid-column: 1 / -1;
        justify-content: stretch;
    }

    .resume-listening-actions .btn {
        flex: 1 1 140px;
        justify-content: center;
    }
}

@media (max-width: 767px) {
    .recent-history-toolbar {
        align-items: stretch;
        flex-direction: column;
        padding: 13px;
    }

    .recent-history-toolbar .btn {
        width: 100%;
        justify-content: center;
    }
}

/* 19.0 commercial: library sort/view/density controls and responsive library layouts. */
.music-list-page .library-display-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 14px 0 18px;
    padding: 12px;
    border: 1px solid var(--border-color, #d8e2ef);
    border-radius: 18px;
    background: color-mix(in srgb, var(--bg-secondary, #ffffff) 92%, transparent);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.music-list-page .library-control-group {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.music-list-page .library-control-label {
    color: var(--text-secondary, #64748b);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.music-list-page .library-segmented {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border-color, #d8e2ef);
    border-radius: 14px;
    background: var(--bg-primary, #f8fafc);
}

.music-list-page .library-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 12px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--text-secondary, #64748b);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
}

.music-list-page .library-toggle.active {
    background: color-mix(in srgb, var(--accent-color, #00c73c) 15%, var(--bg-secondary, #ffffff));
    color: var(--text-primary, #0f172a);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-color, #00c73c) 42%, transparent);
}

.music-list-page.library-density-dense .song-table td {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}

.music-list-page.library-density-dense .list-cover {
    width: 40px !important;
    height: 40px !important;
}

.music-list-page.library-density-large .song-table td {
    padding-top: 18px !important;
    padding-bottom: 18px !important;
}

.music-list-page.library-density-large .list-cover {
    width: 58px !important;
    height: 58px !important;
}

.music-list-page.library-view-mode-list .song-list-container .song-table {
    table-layout: fixed !important;
    width: 100% !important;
    min-width: 0 !important;
}

.music-list-page.library-view-mode-list .song-list-container .song-table th,
.music-list-page.library-view-mode-list .song-list-container .song-table td {
    box-sizing: border-box !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
}

.music-list-page.library-view-mode-list .song-list-container .song-table th:nth-child(1),
.music-list-page.library-view-mode-list .song-list-container .song-table td:nth-child(1) {
    width: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
}

.music-list-page.library-view-mode-list .song-list-container .song-table th:nth-child(2),
.music-list-page.library-view-mode-list .song-list-container .song-table td.song-title-cell {
    width: 30% !important;
    min-width: 190px !important;
    max-width: none !important;
}

.music-list-page.library-view-mode-list .song-list-container .song-table th:nth-child(3),
.music-list-page.library-view-mode-list .song-list-container .song-table td.artist-cell {
    width: 14% !important;
    min-width: 100px !important;
    max-width: none !important;
}

.music-list-page.library-view-mode-list .song-list-container .song-table th:nth-child(4),
.music-list-page.library-view-mode-list .song-list-container .song-table td.album-cell {
    width: 17% !important;
    min-width: 120px !important;
    max-width: none !important;
}

.music-list-page.library-view-mode-list .song-list-container .song-table th:nth-child(5),
.music-list-page.library-view-mode-list .song-list-container .song-table td.genre-cell {
    width: 10% !important;
    min-width: 86px !important;
    max-width: none !important;
}

.music-list-page.library-view-mode-list .song-list-container .song-table th:nth-child(6),
.music-list-page.library-view-mode-list .song-list-container .song-table td.duration-cell,
.music-list-page.library-view-mode-list .song-list-container .song-table th:nth-child(7),
.music-list-page.library-view-mode-list .song-list-container .song-table td.format-cell,
.music-list-page.library-view-mode-list .song-list-container .song-table th:nth-child(8),
.music-list-page.library-view-mode-list .song-list-container .song-table td.play-count-td {
    width: 74px !important;
    min-width: 64px !important;
    max-width: 82px !important;
}

.music-list-page.library-view-mode-list .song-list-container .song-table th:last-child,
.music-list-page.library-view-mode-list .song-list-container .song-table td.actions-cell {
    width: 176px !important;
    min-width: 156px !important;
    max-width: 176px !important;
}

.music-list-page .song-title-wrap,
.music-list-page .song-title-stack,
.music-list-page .song-list-badges {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

.music-list-page .song-title-link,
.music-list-page .artist-cell,
.music-list-page .album-cell,
.music-list-page .genre-cell {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.music-list-page .song-title-link {
    display: block !important;
}

.music-list-page.library-view-mode-card .song-list-container,
.music-list-page.library-view-mode-compact .song-list-container {
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.music-list-page.library-view-mode-card .song-table,
.music-list-page.library-view-mode-card .song-table tbody,
.music-list-page.library-view-mode-compact .song-table,
.music-list-page.library-view-mode-compact .song-table tbody {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
}

.music-list-page.library-view-mode-card .song-table thead,
.music-list-page.library-view-mode-compact .song-table thead {
    display: none !important;
}

.music-list-page.library-view-mode-card .song-table tbody,
.music-list-page.library-view-mode-compact .song-table tbody {
    display: grid !important;
    gap: 12px !important;
}

.music-list-page.library-view-mode-card .song-table tbody {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
}

.music-list-page.library-view-mode-compact .song-table tbody {
    grid-template-columns: 1fr !important;
}

.music-list-page.library-view-mode-card .song-table tr.song-item,
.music-list-page.library-view-mode-compact .song-table tr.song-item {
    display: grid !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
    border: 1px solid var(--border-color, #d8e2ef) !important;
    border-radius: 18px !important;
    background: var(--bg-secondary, #ffffff) !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05) !important;
}

.music-list-page.library-view-mode-card .song-table tr.song-item {
    grid-template-columns: 42px minmax(0, 1fr) auto !important;
    padding: 14px !important;
    min-height: 136px !important;
}

.music-list-page.library-view-mode-compact .song-table tr.song-item {
    grid-template-columns: 42px minmax(0, 1fr) auto !important;
    padding: 10px 12px !important;
    min-height: 76px !important;
}

.music-list-page.library-view-mode-card .song-table tr.song-item td,
.music-list-page.library-view-mode-compact .song-table tr.song-item td {
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 0 !important;
    border: 0 !important;
    text-align: left !important;
}

.music-list-page.library-view-mode-card .song-table tr.song-item td:first-child,
.music-list-page.library-view-mode-compact .song-table tr.song-item td:first-child {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: center;
    text-align: center !important;
}

.music-list-page.library-view-mode-card .song-title-cell,
.music-list-page.library-view-mode-compact .song-title-cell {
    grid-column: 2;
    grid-row: 1;
}

.music-list-page.library-view-mode-card .artist-cell,
.music-list-page.library-view-mode-card .album-cell,
.music-list-page.library-view-mode-card .genre-cell,
.music-list-page.library-view-mode-card .duration-cell,
.music-list-page.library-view-mode-card .format-cell,
.music-list-page.library-view-mode-card .play-count-td,
.music-list-page.library-view-mode-compact .artist-cell,
.music-list-page.library-view-mode-compact .album-cell {
    grid-column: 2;
    color: var(--text-secondary, #64748b);
    font-size: 13px;
}

.music-list-page.library-view-mode-card .genre-cell,
.music-list-page.library-view-mode-card .duration-cell,
.music-list-page.library-view-mode-card .format-cell,
.music-list-page.library-view-mode-card .play-count-td,
.music-list-page.library-view-mode-compact .genre-cell,
.music-list-page.library-view-mode-compact .duration-cell,
.music-list-page.library-view-mode-compact .format-cell,
.music-list-page.library-view-mode-compact .play-count-td {
    display: none !important;
}

.music-list-page.library-view-mode-card .actions-cell,
.music-list-page.library-view-mode-compact .actions-cell {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
    justify-self: end;
}

.music-list-page.library-view-mode-card .song-title-wrap,
.music-list-page.library-view-mode-compact .song-title-wrap {
    gap: 12px !important;
}

.music-list-page.library-view-mode-card .list-cover {
    width: 64px !important;
    height: 64px !important;
}

.music-list-page.library-view-mode-compact .list-cover {
    width: 46px !important;
    height: 46px !important;
}

.music-list-page.library-view-mode-card .song-action-group,
.music-list-page.library-view-mode-compact .song-action-group {
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
}

@media (max-width: 1199px) {
    .music-list-page .library-display-controls {
        align-items: stretch;
    }

    .music-list-page .library-control-group {
        width: 100%;
        justify-content: space-between;
    }

    .music-list-page .library-segmented {
        flex: 1;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .music-list-page .library-segmented::-webkit-scrollbar {
        display: none;
    }

    .music-list-page.library-view-mode-list .song-list-container {
        overflow: visible !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .music-list-page.library-view-mode-list .song-list-container .song-table,
    .music-list-page.library-view-mode-list .song-list-container .song-table tbody {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .music-list-page.library-view-mode-list .song-list-container .song-table thead {
        display: none !important;
    }

    .music-list-page.library-view-mode-list .song-list-container .song-table tbody {
        display: grid !important;
        gap: 12px !important;
    }

    .music-list-page.library-view-mode-list .song-list-container .song-table tr.song-item {
        display: grid !important;
        grid-template-columns: 42px minmax(0, 1fr) auto !important;
        gap: 10px !important;
        align-items: center !important;
        padding: 12px !important;
        border: 1px solid var(--border-color, #d8e2ef) !important;
        border-radius: 18px !important;
        background: var(--bg-secondary, #ffffff) !important;
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05) !important;
    }

    .music-list-page.library-view-mode-list .song-list-container .song-table tr.song-item td {
        display: block !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        padding: 0 !important;
        border: 0 !important;
        text-align: left !important;
    }

    .music-list-page.library-view-mode-list .song-list-container .song-table tr.song-item td:first-child {
        grid-column: 1;
        grid-row: 1 / span 2;
        align-self: center;
        text-align: center !important;
    }

    .music-list-page.library-view-mode-list .song-title-cell {
        grid-column: 2;
        grid-row: 1;
    }

    .music-list-page.library-view-mode-list .artist-cell,
    .music-list-page.library-view-mode-list .album-cell {
        grid-column: 2;
        color: var(--text-secondary, #64748b);
        font-size: 13px;
    }

    .music-list-page.library-view-mode-list .genre-cell,
    .music-list-page.library-view-mode-list .duration-cell,
    .music-list-page.library-view-mode-list .format-cell,
    .music-list-page.library-view-mode-list .play-count-td {
        display: none !important;
    }

    .music-list-page.library-view-mode-list .actions-cell {
        grid-column: 3;
        grid-row: 1 / span 2;
        align-self: center;
        justify-self: end;
    }
}

@media (max-width: 1199px) {
    .music-list-page .library-display-controls {
        margin-top: 10px;
        padding: 10px;
        border-radius: 16px;
    }

    .music-list-page .library-control-group {
        display: grid;
        gap: 7px;
    }

    .music-list-page .library-toggle {
        min-height: 34px;
        padding: 0 10px;
        font-size: 12px;
    }

    .music-list-page.library-view-mode-card .song-table tbody {
        grid-template-columns: 1fr !important;
    }

    .music-list-page .song-action-group {
        display: grid !important;
        grid-template-columns: repeat(2, 36px) !important;
        gap: 6px !important;
        width: 78px !important;
    }
}

/* Missing files page final layout guard */
.missing-files-page {
    display: grid;
    gap: 16px;
}

.missing-files-page .missing-files-toolbar {
    display: grid;
    gap: 12px;
}

.missing-files-page .missing-files-toolbar .section-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.missing-files-page .missing-table-container {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

.missing-files-page .missing-files-table {
    display: table !important;
    width: 100% !important;
    min-width: 1180px !important;
    table-layout: fixed !important;
}

.missing-files-page .missing-files-table thead {
    display: table-header-group !important;
}

.missing-files-page .missing-files-table tbody {
    display: table-row-group !important;
}

.missing-files-page .missing-files-table tr {
    display: table-row !important;
}

.missing-files-page .missing-files-table th,
.missing-files-page .missing-files-table td {
    display: table-cell !important;
    vertical-align: middle !important;
    white-space: nowrap;
}

.missing-files-page .missing-song-title,
.missing-files-page .missing-files-table td[data-label="앨범"],
.missing-files-page .missing-files-table td[data-label="폴더"] {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.missing-files-page .missing-file-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
    gap: 16px !important;
}

.missing-files-page .status-badge-missing {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(245, 158, 11, .14);
    color: #b45309;
    font-size: 12px;
    font-weight: 800;
}

/* 카드 뷰 내의 액션 정렬 설정 */
.missing-files-page .missing-file-card .song-action-group {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

.missing-files-page .missing-file-card .song-action-group .btn,
.missing-files-page .missing-file-card .song-action-group .inline-action-form,
.missing-files-page .missing-file-card .song-action-group .inline-action-form .btn {
    display: inline-block !important;
    margin: 0 !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
}

@media (max-width: 1199px) {
    .missing-files-page .missing-file-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }

    .missing-files-page .missing-file-card {
        min-width: 0;
        padding: 16px;
        border: 1px solid var(--border-color);
        border-radius: 16px;
        background: var(--bg-secondary);
        box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
    }

    .missing-files-page .missing-file-card strong,
    .missing-files-page .missing-card-meta,
    .missing-files-page .missing-file-card small {
        min-width: 0;
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: keep-all;
    }

    .missing-files-page .missing-file-card strong {
        color: var(--text-primary);
        font-size: 16px;
        line-height: 1.35;
    }

    .missing-files-page .missing-card-meta,
    .missing-files-page .missing-file-card small {
        color: var(--text-secondary);
    }
}

@media (max-width: 767px) {
    .missing-files-page .missing-files-toolbar .section-heading-row,
    .missing-files-page .missing-files-toolbar .inline-action-form,
    .missing-files-page .missing-files-toolbar .btn {
        width: 100%;
    }

    .missing-files-page .missing-file-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .missing-files-page .missing-file-card .song-action-group {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
    }

    .missing-files-page .missing-file-card .song-action-group .btn,
    .missing-files-page .missing-file-card .song-action-group .inline-action-form {
        width: auto !important;
    }
}

/* Final scan log table guard: keep recent scan history readable on tablet/mobile. */
.scan-admin-page .scan-log-table-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
}

.scan-admin-page .scan-log-table {
    width: 100% !important;
    min-width: 980px !important;
    table-layout: auto !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.scan-admin-page .scan-log-table thead {
    display: table-header-group !important;
}

.scan-admin-page .scan-log-table tbody {
    display: table-row-group !important;
}

.scan-admin-page .scan-log-table tr {
    display: table-row !important;
}

.scan-admin-page .scan-log-table th,
.scan-admin-page .scan-log-table td {
    display: table-cell !important;
    vertical-align: middle !important;
    white-space: nowrap;
}

.scan-admin-page .scan-log-table .log-message-td {
    min-width: 320px;
    max-width: 520px;
    white-space: normal !important;
    line-height: 1.45;
}

@media (max-width: 1199px) {
    .scan-admin-page .scan-log-table-wrap {
        overflow-x: visible !important;
    }

    .scan-admin-page .scan-log-table,
    .scan-admin-page .scan-log-table tbody,
    .scan-admin-page .scan-log-table tr,
    .scan-admin-page .scan-log-table td {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .scan-admin-page .scan-log-table {
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .scan-admin-page .scan-log-table thead {
        display: none !important;
    }

    .scan-admin-page .scan-log-table tbody {
        display: grid !important;
        gap: 12px;
    }

    .scan-admin-page .scan-log-table tr {
        padding: 14px !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 16px !important;
        background: var(--bg-secondary) !important;
        box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
    }

    .scan-admin-page .scan-log-table tr.scan-empty-row {
        display: block !important;
    }

    .scan-admin-page .scan-log-table tr.scan-empty-row td {
        display: block !important;
        text-align: center !important;
    }

    .scan-admin-page .scan-log-table td[data-label] {
        display: grid !important;
        grid-template-columns: 92px minmax(0, 1fr);
        align-items: start;
        gap: 10px;
        padding: 7px 0 !important;
        border: 0 !important;
        white-space: normal !important;
        text-align: left !important;
    }

    .scan-admin-page .scan-log-table td[data-label]::before {
        content: attr(data-label);
        color: var(--text-secondary);
        font-size: 12px;
        font-weight: 700;
    }

    .scan-admin-page .scan-log-table .log-message-td {
        min-width: 0 !important;
        max-width: 100% !important;
        overflow-wrap: anywhere;
        word-break: keep-all;
    }
}

/* Scan admin polish: scoped to admin/scan.php */
.scan-admin-page {
    display: grid;
    gap: 18px;
}

.scan-admin-page .scan-page-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.scan-admin-page .scan-overview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.scan-admin-page .stats-card {
    min-width: 0;
}

.scan-admin-page .stats-card small,
.scan-admin-page .scan-mode-card p,
.scan-admin-page .scan-guide-grid p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.55;
}

.scan-admin-page .scan-runner {
    display: grid;
    grid-template-columns: minmax(240px, .8fr) minmax(0, 1.6fr);
    align-items: stretch;
    gap: 18px;
}

.scan-admin-page .scan-status-summary {
    min-width: 0;
}

.scan-admin-page .scan-status-summary h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

.scan-admin-page .scan-mode-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.scan-admin-page .scan-mode-card {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-primary);
    display: grid;
    gap: 10px;
}

.scan-admin-page .scan-mode-card > i {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(0, 205, 60, .12);
    color: var(--accent-color);
}

.scan-admin-page .scan-mode-card strong {
    color: var(--text-primary);
    font-size: 16px;
}

.scan-admin-page .scan-mode-card p {
    margin: 0;
}

.scan-admin-page .scan-mode-card .btn {
    width: 100%;
    min-height: 42px;
    margin-top: auto;
}

.scan-admin-page .scan-mode-danger {
    border-color: rgba(245, 158, 11, .48);
}

.scan-admin-page .scan-mode-danger > i {
    background: rgba(245, 158, 11, .14);
    color: #d97706;
}

.scan-admin-page .scan-live-panel {
    grid-column: 1 / -1;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-primary);
}

.scan-admin-page .scan-live-head,
.scan-admin-page .scan-live-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.scan-admin-page .scan-progress-track {
    height: 8px;
    margin: 14px 0;
    overflow: hidden;
    border-radius: 999px;
    background: var(--bg-tertiary);
}

.scan-admin-page .scan-progress-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent-color), #16a34a);
    transition: width .35s ease;
}

.scan-admin-page .scan-result-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.scan-admin-page .scan-result-grid div {
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
}

.scan-admin-page .scan-result-grid span {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
}

.scan-admin-page .scan-result-grid strong {
    display: block;
    margin-top: 4px;
    color: var(--text-primary);
    font-size: 17px;
}

.scan-admin-page .scan-guide-section {
    padding: 20px;
}

.scan-admin-page .scan-guide-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.scan-admin-page .scan-guide-grid > div {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-primary);
}

.scan-admin-page .scan-log-table-wrap {
    overflow-x: auto;
}

.scan-admin-page .scan-log-table {
    min-width: 980px;
}

.scan-admin-page .log-message-td {
    max-width: 380px;
    white-space: normal;
    overflow-wrap: anywhere;
}

body.theme-light .scan-admin-page .scan-mode-card,
body.theme-light .scan-admin-page .scan-live-panel,
body.theme-light .scan-admin-page .scan-guide-grid > div,
body.theme-light .scan-admin-page .scan-result-grid div {
    background: #fff;
    border-color: #d8e2ee;
}

body.theme-dark .scan-admin-page .scan-mode-card,
body.theme-dark .scan-admin-page .scan-live-panel,
body.theme-dark .scan-admin-page .scan-guide-grid > div,
body.theme-dark .scan-admin-page .scan-result-grid div {
    background: rgba(15, 23, 42, .74);
}

@media (max-width: 1199px) {
    .scan-admin-page .scan-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .scan-admin-page .scan-runner {
        grid-template-columns: minmax(0, 1fr);
    }

    .scan-admin-page .scan-result-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .scan-admin-page .scan-page-title {
        display: grid;
    }

    .scan-admin-page .scan-page-title .btn {
        width: 100%;
    }

    .scan-admin-page .scan-overview-grid,
    .scan-admin-page .scan-mode-grid,
    .scan-admin-page .scan-guide-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .scan-admin-page .scan-result-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .scan-admin-page .scan-live-head,
    .scan-admin-page .scan-live-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .scan-admin-page .scan-live-actions .btn {
        width: 100%;
    }
}

@media (max-width: 520px) {
    :root {
        --floating-player-size-final: 68px;
        --floating-player-width-final: min(300px, calc(100vw - 24px));
    }

    .player-bar {
        right: 12px !important;
        bottom: calc(12px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
        border-radius: 20px !important;
        padding: 8px !important;
    }

    .player-album-art,
    .player-album-art img {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        border-radius: 14px !important;
    }

    #btn-play-pause {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        flex-basis: 48px !important;
    }
}

/* Tablet portrait uses a drawer sidebar. A fixed desktop rail leaves too little
   content width at 768-900px and breaks both browser and standalone PWA layouts. */
@media (min-width: 768px) and (max-width: 1199px) and (orientation: portrait) {
    :root {
        --sidebar-width: min(320px, 84vw);
        --tablet-topbar-height: 76px;
    }

    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .app-container {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    .main-content {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100vw !important;
        padding-bottom: calc(112px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
        overflow-x: hidden !important;
    }

    .content-body {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding-left: 18px !important;
        padding-right: 18px !important;
        padding-bottom: calc(112px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
        overflow-x: hidden !important;
    }

    .top-bar {
        min-height: var(--tablet-topbar-height) !important;
        padding: calc(12px + var(--safe-top, env(safe-area-inset-top, 0px))) 18px 12px !important;
        gap: 12px !important;
    }

    .mobile-menu-btn {
        display: inline-flex !important;
        flex: 0 0 46px !important;
        width: 46px !important;
        height: 46px !important;
        min-width: 46px !important;
        min-height: 46px !important;
        z-index: calc(var(--z-sidebar, 1000) + 2) !important;
    }

    .search-container {
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    .search-form,
    .quick-search-form {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .user-profile {
        flex: 0 0 auto !important;
        max-width: 170px !important;
    }

    .user-profile span {
        max-width: 126px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: var(--sidebar-width) !important;
        max-width: var(--sidebar-width) !important;
        min-width: 0 !important;
        height: 100dvh !important;
        padding: calc(18px + var(--safe-top, env(safe-area-inset-top, 0px))) 18px calc(118px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
        transform: translateX(-104%) !important;
        transition: transform 180ms ease !important;
        z-index: var(--z-sidebar, 1000) !important;
        overflow: hidden !important;
    }

    .sidebar.open {
        transform: translateX(0) !important;
    }

    body.sidebar-collapsed .sidebar {
        width: var(--sidebar-width) !important;
        max-width: var(--sidebar-width) !important;
        transform: translateX(-104%) !important;
        padding: calc(18px + var(--safe-top, env(safe-area-inset-top, 0px))) 18px calc(118px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
    }

    body.sidebar-collapsed .sidebar.open {
        transform: translateX(0) !important;
    }

    body.sidebar-collapsed .brand-name,
    body.sidebar-collapsed .sidebar-search-form,
    body.sidebar-collapsed .menu-group-toggle span,
    body.sidebar-collapsed .menu-group-toggle > i,
    body.sidebar-collapsed .nav-label,
    body.sidebar-collapsed .sidebar-footer,
    body.sidebar-collapsed .sidebar-quick-actions span {
        display: initial !important;
    }

    body.sidebar-collapsed .sidebar-search-form {
        display: grid !important;
    }

    .sidebar-scroll {
        max-height: calc(100dvh - 120px - var(--safe-top, env(safe-area-inset-top, 0px)) - var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding-bottom: calc(118px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
    }

    .sidebar-collapse-btn {
        display: none !important;
    }

    .sidebar-overlay.open {
        display: block !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        z-index: calc(var(--z-sidebar, 1000) - 1) !important;
    }

    .dashboard-grid,
    .stats-grid,
    .recent-grid,
    .songs-grid,
    .playlist-grid,
    .playlist-card-grid,
    .explore-card-grid,
    .admin-card-grid,
    .settings-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .table-responsive,
    .admin-table-wrapper,
    .backup-table-wrapper {
        max-width: 100% !important;
        overflow-x: auto !important;
    }
}

@media (min-width: 768px) and (max-width: 840px) and (orientation: portrait) {
    .dashboard-grid,
    .stats-grid,
    .recent-grid,
    .songs-grid,
    .playlist-grid,
    .playlist-card-grid,
    .explore-card-grid,
    .admin-card-grid,
    .settings-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

/* Tablet overflow guard for both portrait and landscape. Keep wide data tables
   scrollable inside their own wrappers, but prevent the whole page from sliding. */
@media (min-width: 768px) and (max-width: 1199px) {
    html,
    body {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    *,
    *::before,
    *::after {
        box-sizing: border-box;
    }

    .app-container {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: clip !important;
    }

    .main-content,
    .content-body,
    .top-bar,
    .admin-dashboard,
    .settings-page,
    .page-title-section,
    .dashboard-section,
    .section-card,
    .panel,
    .content-card,
    .form-card,
    .stats-card,
    .library-stat-card,
    .entity-card,
    .genre-card,
    .explore-card,
    .auto-playlist-card,
    .playlist-card,
    .quick-action-card,
    .backup-file-card,
    .admin-user-card,
    .song-item,
    .compact-song-card {
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .content-body {
        overflow-x: clip !important;
    }

    .top-bar {
        width: 100% !important;
    }

    .search-container,
    .search-form,
    .quick-search-form,
    .sidebar-search-form,
    .filter-form,
    .backup-form,
    .form-row,
    .form-grid,
    .button-group,
    .actions,
    .page-actions {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    input,
    select,
    textarea,
    button,
    .btn,
    .form-control {
        max-width: 100% !important;
    }

    img,
    svg,
    video,
    canvas {
        max-width: 100%;
    }

    .dashboard-grid,
    .stats-grid,
    .recent-grid,
    .songs-grid,
    .playlist-grid,
    .playlist-card-grid,
    .explore-card-grid,
    .admin-card-grid,
    .settings-grid,
    .backup-file-list,
    .metadata-grid,
    .quality-grid,
    .recommend-grid,
    .auto-playlist-grid {
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .table-container,
    .table-responsive,
    .table-wrapper,
    .song-table-wrapper,
    .admin-table-wrapper,
    .backup-table-wrapper,
    .metadata-table-container,
    .log-table-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .data-table,
    .song-list-table,
    .admin-table,
    .backup-table,
    .metadata-table,
    .log-table {
        max-width: 100% !important;
    }

    .player-bar {
        max-width: min(360px, calc(100vw - 28px)) !important;
    }

    .expand-player-overlay,
    .modal-overlay,
    .pwa-install-banner.pwa-install-modal,
    .guest-preview-prompt.preview-premium-modal,
    .pwa-guide-modal {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    .expand-player-container,
    .modal-box,
    .pwa-install-card,
    .guest-preview-card,
    .pwa-guide-card {
        max-width: calc(100vw - 32px) !important;
        min-width: 0 !important;
    }
}

@supports not (overflow: clip) {
    @media (min-width: 768px) and (max-width: 1199px) {
        .app-container,
        .content-body {
            overflow-x: hidden !important;
        }
    }
}

/* Tablet page system: use medium-density layouts instead of stretched desktop
   pages or oversized mobile stacks. This is intentionally loaded last. */
@media (min-width: 768px) and (max-width: 1199px) {
    :root {
        --tablet-page-gutter: 22px;
        --tablet-card-gap: 14px;
        --tablet-card-radius: 12px;
    }

    .content-body {
        padding: 22px var(--tablet-page-gutter) calc(118px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
    }

    .top-bar {
        padding-left: var(--tablet-page-gutter) !important;
        padding-right: var(--tablet-page-gutter) !important;
    }

    .page-title-section,
    .section-heading-row,
    .playlist-hero,
    .playlist-detail-hero,
    .settings-header,
    .admin-header,
    .stats-header {
        display: flex !important;
        align-items: flex-start !important;
        justify-content: space-between !important;
        flex-wrap: wrap !important;
        gap: 12px 16px !important;
        margin-bottom: 18px !important;
    }

    .page-main-title,
    .page-title-section h1,
    .playlist-hero h1,
    .playlist-detail-hero h1 {
        font-size: clamp(1.55rem, 3.1vw, 2.05rem) !important;
        line-height: 1.18 !important;
        max-width: 100% !important;
        overflow-wrap: anywhere !important;
    }

    .page-subtitle,
    .page-title-section p,
    .playlist-hero p,
    .playlist-detail-hero p {
        font-size: 0.95rem !important;
        line-height: 1.55 !important;
        max-width: min(680px, 100%) !important;
    }

    .page-actions,
    .section-actions,
    .playlist-action-row,
    .playlist-toolbar,
    .metadata-bulk-actions,
    .backup-actions,
    .maintenance-actions,
    .filter-left,
    .filter-tabs,
    .metadata-filter-tabs,
    .auto-playlist-actions,
    .button-group,
    .actions {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 8px !important;
        min-width: 0 !important;
    }

    .page-actions .btn,
    .section-actions .btn,
    .playlist-action-row .btn,
    .playlist-toolbar .btn,
    .metadata-bulk-actions .btn,
    .backup-actions .btn,
    .maintenance-actions .btn,
    .filter-tabs .filter-tab,
    .metadata-filter-tabs .filter-tab {
        min-height: 40px !important;
        white-space: nowrap !important;
    }

    .search-page-form,
    .enhanced-search-form,
    .advanced-filter-form,
    .filter-sort-form,
    .log-filter-form,
    .playlist-filter-form,
    .playlist-inline-form,
    .settings-form,
    .backup-form,
    .metadata-edit-form {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
        align-items: end !important;
    }

    .search-page-form,
    .enhanced-search-form,
    .playlist-inline-form {
        grid-template-columns: minmax(0, 1fr) auto !important;
    }

    .advanced-filter-form .filter-grid,
    .filter-grid,
    .settings-grid,
    .form-grid,
    .backup-table-counts {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }

    .dashboard-grid,
    .stats-grid,
    .recent-grid,
    .songs-grid,
    .playlist-grid,
    .playlist-card-grid,
    .explore-card-grid,
    .genre-card-grid,
    .admin-card-grid,
    .backup-file-list,
    .metadata-card-list,
    .auto-playlist-grid,
    .smart-card-grid,
    .quality-grid,
    .recommend-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: var(--tablet-card-gap) !important;
    }

    .stats-card,
    .library-stat-card,
    .entity-card,
    .genre-card,
    .explore-card,
    .auto-playlist-card,
    .playlist-card,
    .quick-action-card,
    .backup-file-card,
    .metadata-mobile-card,
    .metadata-status-panel,
    .admin-card,
    .form-card,
    .section-card,
    .settings-card,
    .content-card,
    .panel {
        border-radius: var(--tablet-card-radius) !important;
        padding: 16px !important;
    }

    .compact-song-card {
        grid-template-columns: 40px 52px minmax(0, 1fr) auto !important;
        gap: 10px !important;
        padding: 12px !important;
    }

    .playlist-song-item {
        grid-template-columns: 48px 44px 52px minmax(0, 1fr) auto !important;
        gap: 10px !important;
        padding: 12px !important;
    }

    .playlist-song-sub {
        display: none !important;
    }

    .playlist-song-actions {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: flex-end !important;
        gap: 6px !important;
    }

    .table-container,
    .table-responsive,
    .table-wrapper,
    .song-table-wrapper,
    .admin-table-wrapper,
    .backup-table-wrapper,
    .metadata-table-container,
    .log-table-wrapper {
        border-radius: 12px !important;
        border: 1px solid var(--border-color, rgba(148, 163, 184, 0.28)) !important;
        background: var(--surface, var(--card-bg, #fff)) !important;
    }

    .data-table,
    .song-list-table,
    .admin-table,
    .backup-table,
    .metadata-table,
    .log-table {
        min-width: 720px !important;
        width: 100% !important;
    }

    .data-table th,
    .data-table td,
    .admin-table th,
    .admin-table td,
    .metadata-table th,
    .metadata-table td,
    .log-table th,
    .log-table td {
        padding: 10px 12px !important;
        font-size: 0.9rem !important;
    }

    .music-list-page .list-filter-section {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 12px !important;
        padding: 12px !important;
        border: 1px solid var(--border-color, rgba(148, 163, 184, 0.28)) !important;
        border-radius: 14px !important;
        background: var(--surface, var(--card-bg, #fff)) !important;
    }

    .music-list-page .filter-left {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        overflow-x: auto !important;
        padding-bottom: 2px !important;
        -webkit-overflow-scrolling: touch;
    }

    .music-list-page .filter-tab {
        flex: 0 0 auto !important;
        min-height: 38px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 999px !important;
        border: 1px solid var(--border-color, rgba(148, 163, 184, 0.28)) !important;
        background: var(--surface-soft, transparent) !important;
    }

    .music-list-page .filter-right,
    .music-list-page .filter-sort-form {
        width: 100% !important;
    }

    .music-list-page .filter-sort-form {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .music-list-page .sort-select,
    .music-list-page .filter-sort-form select {
        width: 100% !important;
        min-height: 40px !important;
        min-width: 0 !important;
    }

    .music-list-page .table-container,
    .music-list-page .table-responsive,
    .music-list-page .song-table-wrapper {
        border: none !important;
        background: transparent !important;
        overflow: visible !important;
    }

    .music-list-page .data-table,
    .music-list-page .data-table thead,
    .music-list-page .data-table tbody,
    .music-list-page .data-table tr,
    .music-list-page .data-table td {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .music-list-page .data-table {
        min-width: 0 !important;
        border: 0 !important;
        background: transparent !important;
    }

    .music-list-page .data-table thead {
        display: none !important;
    }

    .music-list-page .data-table tbody {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }

    .music-list-page .data-table tbody tr.song-item {
        display: grid !important;
        grid-template-columns: 44px minmax(0, 1fr) auto !important;
        align-items: center !important;
        gap: 10px !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 12px !important;
        border: 1px solid var(--border-color, rgba(148, 163, 184, 0.28)) !important;
        border-radius: 14px !important;
        background: var(--surface, var(--card-bg, #fff)) !important;
        box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08) !important;
    }

    .music-list-page .data-table tbody tr.song-item td {
        padding: 0 !important;
        border: 0 !important;
        min-width: 0 !important;
        white-space: normal !important;
    }

    .music-list-page .data-table tr.song-item td.text-center:first-child {
        grid-column: 1 !important;
        grid-row: 1 !important;
        align-self: center !important;
        justify-self: center !important;
        color: var(--text-muted, var(--text-secondary)) !important;
        font-weight: 800 !important;
    }

    .music-list-page .data-table tr.song-item td:has(.play-row-btn) {
        grid-column: 1 !important;
        grid-row: 1 / span 3 !important;
        justify-self: center !important;
    }

    .music-list-page .data-table tr.song-item td.song-title-cell,
    .music-list-page .data-table tr.song-item td:nth-of-type(2) {
        grid-column: 2 !important;
        grid-row: 1 !important;
        min-width: 0 !important;
    }

    .music-list-page .data-table tr.song-item .song-title-wrap {
        display: grid !important;
        grid-template-columns: 56px minmax(0, 1fr) !important;
        gap: 10px !important;
        align-items: center !important;
        min-width: 0 !important;
    }

    .music-list-page .data-table tr.song-item .list-cover {
        width: 56px !important;
        height: 56px !important;
        min-width: 56px !important;
        border-radius: 12px !important;
        object-fit: cover !important;
    }

    .music-list-page .data-table tr.song-item .song-title-stack,
    .music-list-page .data-table tr.song-item .song-title-link {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .music-list-page .data-table tr.song-item .song-title-link {
        display: block !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        font-weight: 800 !important;
    }

    .music-list-page .data-table tr.song-item td:nth-of-type(3) {
        grid-column: 2 !important;
        grid-row: 2 !important;
        color: var(--text-primary, inherit) !important;
        font-weight: 700 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .music-list-page .data-table tr.song-item td:nth-of-type(4) {
        grid-column: 2 !important;
        grid-row: 3 !important;
        color: var(--text-muted, var(--text-secondary)) !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .music-list-page .data-table tr.song-item td:nth-of-type(5),
    .music-list-page .data-table tr.song-item td:nth-of-type(8),
    .music-list-page .data-table tr.song-item td.play-count-td {
        display: none !important;
    }

    .music-list-page .data-table tr.song-item td:nth-of-type(6) {
        grid-column: 2 !important;
        grid-row: 4 !important;
        font-size: 0.82rem !important;
        color: var(--text-muted, var(--text-secondary)) !important;
    }

    .music-list-page .data-table tr.song-item td:nth-of-type(7) {
        grid-column: 2 !important;
        grid-row: 5 !important;
        justify-self: start !important;
    }

    .music-list-page .data-table tr.song-item td:last-child {
        grid-column: 3 !important;
        grid-row: 1 / span 5 !important;
        align-self: center !important;
        justify-self: end !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
        margin: 0 !important;
    }

    .music-list-page .data-table tr.song-item .like-btn,
    .music-list-page .data-table tr.song-item .add-playlist-btn,
    .music-list-page .data-table tr.song-item .remove-playlist-song-btn,
    .music-list-page .data-table tr.song-item .play-row-btn {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
    }

    .home-section-grid,
    .daily-summary-grid,
    .folder-card-grid,
    .listening-note-list {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: var(--tablet-card-gap) !important;
    }

    .listening-note-row {
        grid-template-columns: 42px 54px minmax(0, 1fr) !important;
        align-items: start !important;
    }

    .listening-note-rating {
        grid-column: 3 / -1 !important;
        justify-self: start !important;
    }

    .stats-page .home-section-grid,
    .stats-page .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .modal-box,
    .pwa-install-card,
    .guest-preview-card,
    .pwa-guide-card {
        width: min(560px, calc(100vw - 48px)) !important;
    }

    .expand-player-container {
        width: calc(100vw - 44px) !important;
        max-height: calc(100dvh - 44px - var(--safe-top, env(safe-area-inset-top, 0px)) - var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
        overflow: auto !important;
    }

    .expand-player-main {
        display: grid !important;
        grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.1fr) !important;
        gap: 18px !important;
    }
}

@media (min-width: 768px) and (max-width: 840px) and (orientation: portrait) {
    :root {
        --tablet-page-gutter: 16px;
        --tablet-card-gap: 12px;
    }

    .content-body {
        padding-left: var(--tablet-page-gutter) !important;
        padding-right: var(--tablet-page-gutter) !important;
    }

    .page-title-section,
    .section-heading-row,
    .playlist-hero,
    .playlist-detail-hero {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .search-page-form,
    .enhanced-search-form,
    .advanced-filter-form,
    .filter-sort-form,
    .log-filter-form,
    .playlist-filter-form,
    .playlist-inline-form,
    .settings-form,
    .backup-form,
    .metadata-edit-form,
    .advanced-filter-form .filter-grid,
    .filter-grid,
    .settings-grid,
    .form-grid,
    .backup-table-counts,
    .dashboard-grid,
    .stats-grid,
    .recent-grid,
    .songs-grid,
    .playlist-grid,
    .playlist-card-grid,
    .explore-card-grid,
    .genre-card-grid,
    .admin-card-grid,
    .backup-file-list,
    .metadata-card-list,
    .auto-playlist-grid,
    .smart-card-grid,
    .quality-grid,
    .recommend-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .search-page-form,
    .enhanced-search-form,
    .playlist-inline-form {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .playlist-song-item {
        grid-template-columns: 44px 48px minmax(0, 1fr) !important;
    }

    .playlist-song-order,
    .playlist-order-buttons {
        display: none !important;
    }

    .playlist-song-actions {
        grid-column: 1 / -1 !important;
        justify-content: flex-start !important;
    }

    .music-list-page .filter-sort-form,
    .music-list-page .data-table tbody,
    .home-section-grid,
    .daily-summary-grid,
    .folder-card-grid,
    .listening-note-list,
    .stats-page .home-section-grid,
    .stats-page .stats-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .music-list-page .data-table tbody tr.song-item {
        grid-template-columns: 42px minmax(0, 1fr) !important;
    }

    .music-list-page .data-table tr.song-item td:last-child {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
        justify-self: start !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        padding-left: 52px !important;
    }

    .expand-player-main {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

@media (min-width: 841px) and (max-width: 1199px) and (orientation: landscape) {
    :root {
        --tablet-page-gutter: 20px;
        --sidebar-width: 248px;
        --sidebar-collapsed-width: 72px;
    }

    .app-container {
        grid-template-columns: var(--sidebar-width) minmax(0, 1fr) !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    .sidebar {
        width: var(--sidebar-width) !important;
        min-width: var(--sidebar-width) !important;
        max-width: var(--sidebar-width) !important;
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    body.sidebar-collapsed .app-container {
        grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr) !important;
    }

    body.sidebar-collapsed .sidebar {
        width: var(--sidebar-collapsed-width) !important;
        min-width: var(--sidebar-collapsed-width) !important;
        max-width: var(--sidebar-collapsed-width) !important;
    }

    .content-body {
        padding-left: var(--tablet-page-gutter) !important;
        padding-right: var(--tablet-page-gutter) !important;
        max-width: 100% !important;
    }

    .top-bar {
        gap: 12px !important;
        padding-left: var(--tablet-page-gutter) !important;
        padding-right: var(--tablet-page-gutter) !important;
    }

    .search-container {
        min-width: 0 !important;
        max-width: min(460px, 46vw) !important;
    }

    .user-profile {
        max-width: 180px !important;
    }

    .expand-player-container {
        width: calc(100vw - 56px) !important;
        max-width: 1040px !important;
    }

    .expand-album-art {
        width: clamp(190px, 28vw, 300px) !important;
        height: clamp(190px, 28vw, 300px) !important;
    }

    .expand-lyrics-full-text {
        max-height: 34vh !important;
        overflow-y: auto !important;
    }

    .dashboard-grid,
    .stats-grid,
    .recent-grid,
    .songs-grid,
    .playlist-grid,
    .playlist-card-grid,
    .explore-card-grid,
    .genre-card-grid,
    .admin-card-grid,
    .backup-file-list,
    .metadata-card-list,
    .auto-playlist-grid,
    .smart-card-grid,
    .quality-grid,
    .recommend-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* 44.6 tablet app shell polish: iPad/Android tablet/PWA */
@media (min-width: 768px) and (max-width: 1199px) {
    :root {
        --tablet-app-gutter: clamp(16px, 2.3vw, 24px);
        --tablet-app-radius: 22px;
        --tablet-sheet-radius: 28px;
        --tablet-mini-player-size: 76px;
        --tablet-app-shadow: 0 18px 48px rgba(15, 23, 42, 0.14);
        --tablet-app-border: color-mix(in srgb, var(--border-color, rgba(148, 163, 184, 0.28)) 82%, transparent);
    }

    html,
    body {
        max-width: 100%;
        overflow-x: hidden !important;
        overscroll-behavior-x: none;
    }

    body.is-tablet-layout {
        background:
            radial-gradient(circle at top left, color-mix(in srgb, var(--primary-color, #00c73c) 10%, transparent) 0, transparent 36vw),
            var(--body-bg, var(--background-color, #f6f8fb)) !important;
        -webkit-tap-highlight-color: transparent;
    }

    body.is-tablet-layout .app-container {
        width: 100%;
        max-width: 100vw;
        height: 100dvh;
        overflow: hidden !important;
    }

    body.is-tablet-layout .main-content {
        min-width: 0 !important;
        height: 100dvh;
        overflow-x: hidden !important;
        overflow-y: auto;
        scroll-padding-top: calc(82px + var(--safe-top, env(safe-area-inset-top, 0px)));
        background: transparent !important;
    }

    body.is-tablet-layout .content-body {
        width: 100%;
        max-width: 1080px !important;
        margin: 0 auto !important;
        padding-left: var(--tablet-app-gutter) !important;
        padding-right: var(--tablet-app-gutter) !important;
        padding-bottom: calc(132px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
        overflow-x: clip;
    }

    body.is-tablet-layout .top-bar {
        position: sticky !important;
        top: 0 !important;
        z-index: 940 !important;
        min-height: 72px;
        margin: 0 !important;
        padding:
            calc(12px + var(--safe-top, env(safe-area-inset-top, 0px)))
            var(--tablet-app-gutter)
            12px !important;
        border-bottom: 1px solid var(--tablet-app-border) !important;
        background: color-mix(in srgb, var(--surface-color, #ffffff) 98%, transparent) !important;
        box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08) !important;
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    body.is-tablet-layout .search-container,
    body.is-tablet-layout .quick-search-form {
        min-width: 0 !important;
    }

    body.is-tablet-layout input,
    body.is-tablet-layout select,
    body.is-tablet-layout textarea,
    body.is-tablet-layout .form-control,
    body.is-tablet-layout .search-input {
        max-width: 100%;
        min-height: 44px;
        border-radius: 14px !important;
    }

    body.is-tablet-layout .btn,
    body.is-tablet-layout button,
    body.is-tablet-layout .control-btn,
    body.is-tablet-layout .mobile-menu-btn,
    body.is-tablet-layout .sidebar-collapse-btn,
    body.is-tablet-layout .like-btn,
    body.is-tablet-layout .add-playlist-btn,
    body.is-tablet-layout .play-row-btn {
        min-width: 44px;
        min-height: 44px;
        touch-action: manipulation;
    }

    body.is-tablet-layout .home-section,
    body.is-tablet-layout .settings-card,
    body.is-tablet-layout .admin-card,
    body.is-tablet-layout .operation-status-card,
    body.is-tablet-layout .quick-action-card,
    body.is-tablet-layout .playlist-card,
    body.is-tablet-layout .entity-card,
    body.is-tablet-layout .explore-card,
    body.is-tablet-layout .compact-song-card,
    body.is-tablet-layout .stat-card,
    body.is-tablet-layout .metadata-card,
    body.is-tablet-layout .backup-card,
    body.is-tablet-layout .dashboard-card {
        border: 1px solid var(--tablet-app-border) !important;
        border-radius: var(--tablet-app-radius) !important;
        background: color-mix(in srgb, var(--surface-color, #ffffff) 96%, transparent) !important;
        box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08) !important;
    }

    body.is-tablet-layout .data-table,
    body.is-tablet-layout .metadata-table,
    body.is-tablet-layout .table-responsive,
    body.is-tablet-layout .metadata-table-container {
        max-width: 100%;
        overflow-x: auto;
        border-radius: var(--tablet-app-radius);
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    body.is-tablet-layout .data-table th,
    body.is-tablet-layout .data-table td,
    body.is-tablet-layout .metadata-table th,
    body.is-tablet-layout .metadata-table td {
        overflow-wrap: anywhere;
    }

    body.is-tablet-layout .sidebar {
        border-right: 1px solid var(--tablet-app-border) !important;
        box-shadow: 18px 0 44px rgba(15, 23, 42, 0.10) !important;
    }

    body.is-tablet-layout .sidebar .nav-link,
    body.is-tablet-layout .sidebar .nav-group-toggle,
    body.is-tablet-layout .sidebar a {
        min-height: 44px;
        border-radius: 14px !important;
    }

    body.is-tablet-layout .sidebar .nav-link.active,
    body.is-tablet-layout .sidebar .nav-link[aria-current="page"] {
        box-shadow: inset 3px 0 0 var(--primary-color, #00c73c);
    }

    body.is-tablet-layout .player-bar {
        border: 1px solid color-mix(in srgb, var(--primary-color, #00c73c) 18%, var(--tablet-app-border)) !important;
        border-radius: 26px !important;
        box-shadow: 0 22px 58px rgba(15, 23, 42, 0.20) !important;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    body.is-tablet-layout .player-bar .player-title,
    body.is-tablet-layout .player-bar .player-artist,
    body.is-tablet-layout .expand-player-title,
    body.is-tablet-layout .expand-player-artist,
    body.is-tablet-layout .expand-player-album {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.is-tablet-layout .expand-player-overlay,
    body.is-tablet-layout .modal-overlay,
    body.is-tablet-layout .pwa-install-banner.pwa-install-modal,
    body.is-tablet-layout .guest-preview-prompt.preview-premium-modal {
        padding:
            calc(18px + var(--safe-top, env(safe-area-inset-top, 0px)))
            18px
            calc(18px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }

    body.is-tablet-layout .modal-box,
    body.is-tablet-layout .pwa-install-card,
    body.is-tablet-layout .guest-preview-card,
    body.is-tablet-layout .pwa-guide-card {
        border-radius: var(--tablet-sheet-radius) !important;
        border: 1px solid var(--tablet-app-border) !important;
        box-shadow: var(--tablet-app-shadow) !important;
    }

    body.is-tablet-layout .expand-player-container {
        border-radius: 30px !important;
        border: 1px solid var(--tablet-app-border) !important;
        background: color-mix(in srgb, var(--surface-color, #ffffff) 94%, transparent) !important;
        box-shadow: 0 28px 80px rgba(15, 23, 42, 0.24) !important;
    }

    body.is-tablet-layout .expand-album-art {
        border-radius: 26px !important;
        box-shadow: 0 24px 54px rgba(15, 23, 42, 0.22) !important;
    }

    body.is-tablet-layout .expand-player-controls .progress-bar-wrapper,
    body.is-tablet-layout .player-bar .progress-container {
        min-height: 18px;
        touch-action: none;
    }

    body.is-tablet-layout .expand-lyrics-full-text,
    body.is-tablet-layout .lyrics-content,
    body.is-tablet-layout .lyrics-display {
        white-space: pre-line;
        overflow-wrap: anywhere;
        line-height: 1.85;
    }

    body.theme-light.is-tablet-layout .top-bar,
    body.theme-light.is-tablet-layout .player-bar,
    body.theme-light.is-tablet-layout .expand-player-container,
    body.theme-light.is-tablet-layout .modal-box,
    body.theme-light.is-tablet-layout .pwa-install-card,
    body.theme-light.is-tablet-layout .guest-preview-card {
        background: rgba(255, 255, 255, 0.98) !important;
        color: var(--text-primary, #0f172a) !important;
    }

    body.theme-light.is-tablet-layout .home-section,
    body.theme-light.is-tablet-layout .settings-card,
    body.theme-light.is-tablet-layout .admin-card,
    body.theme-light.is-tablet-layout .operation-status-card,
    body.theme-light.is-tablet-layout .quick-action-card,
    body.theme-light.is-tablet-layout .playlist-card,
    body.theme-light.is-tablet-layout .entity-card,
    body.theme-light.is-tablet-layout .explore-card,
    body.theme-light.is-tablet-layout .compact-song-card,
    body.theme-light.is-tablet-layout .stat-card,
    body.theme-light.is-tablet-layout .metadata-card,
    body.theme-light.is-tablet-layout .backup-card,
    body.theme-light.is-tablet-layout .dashboard-card {
        background: #ffffff !important;
    }
}

@media (min-width: 768px) and (max-width: 1199px) and (orientation: portrait) {
    body.is-tablet-layout .top-bar {
        display: grid !important;
        grid-template-columns: 48px minmax(0, 1fr) auto;
        align-items: center;
        gap: 12px !important;
    }

    body.is-tablet-layout .search-container {
        max-width: none !important;
        width: 100% !important;
    }

    body.is-tablet-layout .user-profile {
        max-width: 172px !important;
        min-width: 0 !important;
    }

    body.is-tablet-layout .sidebar {
        width: min(360px, calc(100vw - 56px)) !important;
        max-width: min(360px, calc(100vw - 56px)) !important;
        border-radius: 0 28px 28px 0 !important;
        padding-top: calc(16px + var(--safe-top, env(safe-area-inset-top, 0px))) !important;
    }

    body.is-tablet-layout .sidebar-overlay.open,
    body.is-tablet-layout .sidebar-overlay.show {
        background: rgba(15, 23, 42, 0.34) !important;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    body.is-tablet-layout .page-title-section,
    body.is-tablet-layout .section-heading-row {
        gap: 12px !important;
        margin-bottom: 18px !important;
    }

    body.is-tablet-layout .filter-sort-form,
    body.is-tablet-layout .advanced-filter-form,
    body.is-tablet-layout .search-page-form,
    body.is-tablet-layout .enhanced-search-form {
        border-radius: var(--tablet-app-radius) !important;
        box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06) !important;
    }

    body.is-tablet-layout .player-bar {
        right: 16px !important;
        bottom: calc(14px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
        width: min(430px, calc(100vw - 32px)) !important;
        max-width: calc(100vw - 32px) !important;
    }

    body.is-tablet-layout .expand-player-container {
        width: min(620px, calc(100vw - 28px)) !important;
        max-height: calc(100dvh - 28px - var(--safe-top, env(safe-area-inset-top, 0px)) - var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
        overflow-y: auto !important;
    }

    body.is-tablet-layout .expand-player-main {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 16px !important;
    }

    body.is-tablet-layout .expand-album-art {
        width: clamp(220px, 48vw, 340px) !important;
        height: clamp(220px, 48vw, 340px) !important;
        margin: 0 auto !important;
    }

    body.is-tablet-layout .expand-tab-section,
    body.is-tablet-layout .expand-lyrics-full-text {
        max-height: 34dvh !important;
        overflow-y: auto !important;
    }

    body.is-tablet-layout .modal-box,
    body.is-tablet-layout .pwa-install-card,
    body.is-tablet-layout .guest-preview-card,
    body.is-tablet-layout .pwa-guide-card {
        width: min(560px, calc(100vw - 32px)) !important;
        max-height: calc(88dvh - var(--safe-top, env(safe-area-inset-top, 0px)) - var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
        overflow-y: auto !important;
    }
}

@media (min-width: 900px) and (max-width: 1199px) and (orientation: landscape) {
    body.is-tablet-layout .app-container {
        grid-template-columns: var(--sidebar-width, 218px) minmax(0, 1fr) !important;
    }

    body.is-tablet-layout.sidebar-collapsed .app-container {
        grid-template-columns: var(--sidebar-collapsed-width, 72px) minmax(0, 1fr) !important;
    }

    body.is-tablet-layout .sidebar {
        padding-top: calc(14px + var(--safe-top, env(safe-area-inset-top, 0px))) !important;
    }

    body.is-tablet-layout .content-body {
        max-width: 1000px !important;
    }

    body.is-tablet-layout .top-bar {
        display: flex !important;
        gap: 14px !important;
    }

    body.is-tablet-layout .search-container {
        max-width: min(500px, 48vw) !important;
    }

    body.is-tablet-layout .player-bar {
        right: 20px !important;
        bottom: calc(16px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
        width: min(440px, calc(100vw - var(--sidebar-width, 248px) - 48px)) !important;
    }

    body.is-tablet-layout.sidebar-collapsed .player-bar {
        width: min(440px, calc(100vw - var(--sidebar-collapsed-width, 72px) - 48px)) !important;
    }

    body.is-tablet-layout .expand-player-container {
        width: min(1040px, calc(100vw - 48px)) !important;
        max-height: calc(100dvh - 48px - var(--safe-top, env(safe-area-inset-top, 0px)) - var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
        overflow: hidden !important;
    }

    body.is-tablet-layout .expand-player-main {
        grid-template-columns: minmax(220px, 0.86fr) minmax(0, 1.14fr) !important;
        gap: 22px !important;
    }

    body.is-tablet-layout .expand-tab-section,
    body.is-tablet-layout .expand-lyrics-full-text {
        max-height: 44dvh !important;
        overflow-y: auto !important;
    }

    body.is-tablet-layout .dashboard-grid,
    body.is-tablet-layout .stats-grid,
    body.is-tablet-layout .recent-grid,
    body.is-tablet-layout .songs-grid,
    body.is-tablet-layout .playlist-grid,
    body.is-tablet-layout .playlist-card-grid,
    body.is-tablet-layout .explore-card-grid,
    body.is-tablet-layout .genre-card-grid,
    body.is-tablet-layout .admin-card-grid,
    body.is-tablet-layout .auto-playlist-grid,
    body.is-tablet-layout .smart-card-grid,
    body.is-tablet-layout .quality-grid,
    body.is-tablet-layout .recommend-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 1024px) and (max-width: 1199px) and (orientation: landscape) {
    body.is-tablet-layout .dashboard-grid,
    body.is-tablet-layout .explore-card-grid,
    body.is-tablet-layout .genre-card-grid,
    body.is-tablet-layout .playlist-card-grid,
    body.is-tablet-layout .recommend-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 768px) and (max-width: 1199px) and (prefers-reduced-motion: no-preference) {
    body.is-tablet-layout .sidebar,
    body.is-tablet-layout .main-content,
    body.is-tablet-layout .player-bar,
    body.is-tablet-layout .expand-player-container,
    body.is-tablet-layout .home-section,
    body.is-tablet-layout .settings-card,
    body.is-tablet-layout .admin-card,
    body.is-tablet-layout .playlist-card,
    body.is-tablet-layout .entity-card,
    body.is-tablet-layout .compact-song-card {
        transition:
            transform 180ms ease,
            box-shadow 180ms ease,
            border-color 180ms ease,
            background-color 180ms ease;
    }
}

/* 44.6.1 tablet UI bugfix: reduce oversized cards and harsh borders */
@media (min-width: 768px) and (max-width: 1199px) {
    body.is-tablet-layout {
        --tablet-app-border: rgba(203, 213, 225, 0.72);
        --tablet-card-border-soft: rgba(203, 213, 225, 0.68);
        --tablet-card-shadow-soft: 0 8px 22px rgba(15, 23, 42, 0.06);
    }

    body.is-standalone.is-tablet-layout .app-container {
        padding-top: 0 !important;
        height: 100dvh !important;
    }

    body.is-standalone.is-tablet-layout .top-bar {
        padding-top: calc(10px + var(--safe-top, env(safe-area-inset-top, 0px))) !important;
    }

    body.theme-dark.is-tablet-layout,
    body:not(.theme-light).is-tablet-layout {
        --tablet-app-border: rgba(71, 85, 105, 0.54);
        --tablet-card-border-soft: rgba(71, 85, 105, 0.48);
        --tablet-card-shadow-soft: 0 12px 28px rgba(0, 0, 0, 0.22);
    }

    body.is-tablet-layout .home-section,
    body.is-tablet-layout .metadata-status-summary,
    body.is-tablet-layout .listening-note-card,
    body.is-tablet-layout .song-lyrics-card,
    body.is-tablet-layout .settings-card,
    body.is-tablet-layout .admin-card,
    body.is-tablet-layout .operation-status-card,
    body.is-tablet-layout .playlist-card,
    body.is-tablet-layout .entity-card,
    body.is-tablet-layout .explore-card,
    body.is-tablet-layout .compact-song-card,
    body.is-tablet-layout .stat-card,
    body.is-tablet-layout .metadata-card,
    body.is-tablet-layout .backup-card,
    body.is-tablet-layout .dashboard-card {
        border: 1px solid var(--tablet-card-border-soft) !important;
        box-shadow: var(--tablet-card-shadow-soft) !important;
    }

    body.is-tablet-layout .song-detail-page .home-section,
    body.is-tablet-layout .song-detail-page .song-lyrics-card {
        border-radius: 22px !important;
        padding: 22px !important;
    }

    body.is-tablet-layout .metadata-status-panel,
    body.is-tablet-layout .lyrics-container,
    body.is-tablet-layout .song-note-form textarea,
    body.is-tablet-layout .tag-form input {
        border-color: var(--tablet-card-border-soft) !important;
        box-shadow: none !important;
    }

    body.is-tablet-layout .content-body {
        padding-top: 20px !important;
    }
}

@media (min-width: 768px) and (max-width: 1199px) and (orientation: portrait) {
    body.is-tablet-layout .content-body {
        padding-top: 14px !important;
    }

    body.is-tablet-layout .music-list-page .filter-sort-form {
        padding: 14px !important;
        gap: 10px !important;
    }

    body.is-tablet-layout .music-list-page .filter-sort-form select,
    body.is-tablet-layout .music-list-page .filter-sort-form input {
        min-height: 42px !important;
    }

    body.is-tablet-layout .music-list-page .data-table tbody {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 14px !important;
    }

    body.is-tablet-layout .music-list-page .data-table tbody tr.song-item {
        grid-template-columns: 44px 62px minmax(0, 1fr) auto !important;
        grid-template-rows: auto auto auto !important;
        align-items: center !important;
        gap: 6px 12px !important;
        min-height: 0 !important;
        padding: 14px !important;
        border-radius: 18px !important;
        border-color: var(--tablet-card-border-soft) !important;
        box-shadow: var(--tablet-card-shadow-soft) !important;
    }

    body.is-tablet-layout .music-list-page .data-table tbody tr.song-item td {
        width: auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
        align-self: center !important;
    }

    body.is-tablet-layout .music-list-page .data-table tr.song-item td:has(.play-row-btn) {
        grid-column: 1 !important;
        grid-row: 1 / span 3 !important;
        align-self: center !important;
        justify-self: center !important;
    }

    body.is-tablet-layout .music-list-page .data-table tr.song-item td.song-title-cell,
    body.is-tablet-layout .music-list-page .data-table tr.song-item td:nth-of-type(2) {
        grid-column: 2 / 4 !important;
        grid-row: 1 !important;
    }

    body.is-tablet-layout .music-list-page .data-table tr.song-item .song-title-wrap {
        grid-template-columns: 62px minmax(0, 1fr) !important;
        gap: 12px !important;
        align-items: center !important;
    }

    body.is-tablet-layout .music-list-page .data-table tr.song-item .list-cover {
        width: 62px !important;
        height: 62px !important;
        min-width: 62px !important;
        border-radius: 14px !important;
    }

    body.is-tablet-layout .music-list-page .data-table tr.song-item .song-title-link {
        font-size: 1rem !important;
        line-height: 1.25 !important;
    }

    body.is-tablet-layout .music-list-page .data-table tr.song-item td:nth-of-type(3) {
        grid-column: 3 !important;
        grid-row: 2 !important;
        font-size: 0.92rem !important;
        line-height: 1.3 !important;
    }

    body.is-tablet-layout .music-list-page .data-table tr.song-item td:nth-of-type(4) {
        grid-column: 3 !important;
        grid-row: 3 !important;
        display: block !important;
        font-size: 0.88rem !important;
        line-height: 1.35 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    body.is-tablet-layout .music-list-page .data-table tr.song-item td:nth-of-type(6),
    body.is-tablet-layout .music-list-page .data-table tr.song-item td:nth-of-type(7),
    body.is-tablet-layout .music-list-page .data-table tr.song-item td:nth-of-type(8),
    body.is-tablet-layout .music-list-page .data-table tr.song-item td:nth-of-type(5),
    body.is-tablet-layout .music-list-page .data-table tr.song-item td.play-count-td {
        display: none !important;
    }

    body.is-tablet-layout .music-list-page .data-table tr.song-item td:last-child {
        grid-column: 4 !important;
        grid-row: 1 / span 3 !important;
        align-self: center !important;
        justify-self: end !important;
        flex-direction: row !important;
        gap: 4px !important;
        padding-left: 0 !important;
    }

    body.is-tablet-layout .music-list-page .data-table tr.song-item .like-btn,
    body.is-tablet-layout .music-list-page .data-table tr.song-item .add-playlist-btn,
    body.is-tablet-layout .music-list-page .data-table tr.song-item .remove-playlist-song-btn {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
    }
}

/* 44.6.3 tablet PWA top app bar: compact standalone header */
@media (min-width: 768px) and (max-width: 1199px) and (orientation: portrait) {
    body.is-standalone.is-tablet-layout .top-bar {
        grid-template-columns: 56px minmax(0, 1fr) minmax(104px, max-content) !important;
        min-height: 68px !important;
        padding:
            calc(6px + var(--safe-top, env(safe-area-inset-top, 0px)))
            max(18px, var(--tablet-app-gutter, 18px))
            8px !important;
        gap: 12px !important;
        box-sizing: border-box !important;
        align-items: center !important;
    }

    body.is-standalone.is-tablet-layout .mobile-menu-btn {
        width: 54px !important;
        height: 54px !important;
        min-width: 54px !important;
        min-height: 54px !important;
        margin: 0 !important;
        border-radius: 16px !important;
        align-self: center !important;
    }

    body.is-standalone.is-tablet-layout .search-container,
    body.is-standalone.is-tablet-layout .quick-search-form {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
    }

    body.is-standalone.is-tablet-layout .quick-search-form input,
    body.is-standalone.is-tablet-layout .search-form input {
        height: 52px !important;
        min-height: 52px !important;
        border-radius: 18px !important;
        font-size: 1rem !important;
    }

    body.is-standalone.is-tablet-layout .user-profile {
        height: 52px !important;
        min-height: 52px !important;
        max-width: 132px !important;
        padding: 0 14px !important;
        border-radius: 18px !important;
        justify-content: center !important;
        align-self: center !important;
        background: color-mix(in srgb, var(--surface-color, #ffffff) 98%, transparent) !important;
    }

    body.is-standalone.is-tablet-layout .user-profile span {
        max-width: 78px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    body.is-standalone.is-tablet-layout .content-body {
        padding-top: 34px !important;
    }

    body.is-standalone.is-tablet-layout .page-title-section,
    body.is-standalone.is-tablet-layout .music-list-page > h1:first-child,
    body.is-standalone.is-tablet-layout .content-body > h1:first-child {
        margin-top: 0 !important;
        scroll-margin-top: calc(86px + var(--safe-top, env(safe-area-inset-top, 0px))) !important;
    }
}

@media (min-width: 768px) and (max-width: 860px) and (orientation: portrait) {
    body.is-standalone.is-tablet-layout .top-bar {
        grid-template-columns: 54px minmax(0, 1fr) 112px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
        gap: 10px !important;
    }

    body.is-standalone.is-tablet-layout .user-profile {
        max-width: 112px !important;
        padding: 0 10px !important;
    }

    body.is-standalone.is-tablet-layout .user-profile span {
        max-width: 58px !important;
    }

    body.is-standalone.is-tablet-layout .content-body {
        padding-top: 38px !important;
    }
}

/* 44.7 tablet header/content offset: prevent top toolbar from covering page titles */
@media (min-width: 768px) and (max-width: 1199px) and (orientation: portrait) {
    :root {
        --tablet-toolbar-control-size: 52px;
        --tablet-toolbar-gap: 12px;
        --tablet-toolbar-content-gap: 24px;
        --tablet-toolbar-x: clamp(16px, 2.4vw, 24px);
    }

    .main-content > .top-bar {
        position: sticky !important;
        top: 0 !important;
        z-index: 940 !important;
        display: grid !important;
        grid-template-columns: var(--tablet-toolbar-control-size) minmax(0, 1fr) minmax(108px, max-content) !important;
        align-items: center !important;
        gap: var(--tablet-toolbar-gap) !important;
        width: 100% !important;
        min-height: calc(var(--tablet-toolbar-control-size) + 18px) !important;
        margin: 0 0 var(--tablet-toolbar-content-gap) !important;
        padding: 9px var(--tablet-toolbar-x) !important;
        box-sizing: border-box !important;
        overflow: visible !important;
        background: color-mix(in srgb, var(--surface-color, var(--bg-primary, #ffffff)) 98%, transparent) !important;
        border-bottom: 1px solid rgba(203, 213, 225, 0.72) !important;
        box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08) !important;
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    body.is-standalone .main-content > .top-bar,
    body.is-standalone.is-tablet-layout .main-content > .top-bar {
        min-height: calc(var(--tablet-toolbar-control-size) + var(--safe-top, env(safe-area-inset-top, 0px)) + 18px) !important;
        padding-top: calc(9px + var(--safe-top, env(safe-area-inset-top, 0px))) !important;
    }

    .main-content > .content-body {
        padding-top: 0 !important;
        margin-top: 0 !important;
        scroll-padding-top: calc(var(--tablet-toolbar-control-size) + var(--safe-top, env(safe-area-inset-top, 0px)) + 48px) !important;
    }

    .main-content > .content-body > :first-child,
    .main-content > .content-body .page-title-section:first-child,
    .main-content > .content-body .music-list-page > h1:first-child,
    .main-content > .content-body .library-page > h1:first-child,
    .main-content > .content-body .song-detail-page > h1:first-child {
        margin-top: 0 !important;
    }

    .main-content > .top-bar .mobile-menu-btn {
        width: var(--tablet-toolbar-control-size) !important;
        height: var(--tablet-toolbar-control-size) !important;
        min-width: var(--tablet-toolbar-control-size) !important;
        min-height: var(--tablet-toolbar-control-size) !important;
        margin: 0 !important;
        align-self: center !important;
        border-radius: 16px !important;
    }

    .main-content > .top-bar .search-container,
    .main-content > .top-bar .quick-search-form {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
    }

    .main-content > .top-bar .quick-search-form input,
    .main-content > .top-bar .search-form input {
        height: var(--tablet-toolbar-control-size) !important;
        min-height: var(--tablet-toolbar-control-size) !important;
        border-radius: 18px !important;
        font-size: 1rem !important;
    }

    .main-content > .top-bar .user-profile {
        width: auto !important;
        max-width: 132px !important;
        height: var(--tablet-toolbar-control-size) !important;
        min-height: var(--tablet-toolbar-control-size) !important;
        margin: 0 !important;
        padding: 0 14px !important;
        justify-content: center !important;
        align-self: center !important;
        border-radius: 18px !important;
        background: color-mix(in srgb, var(--surface-color, var(--bg-primary, #ffffff)) 98%, transparent) !important;
    }

    .main-content > .top-bar .user-profile span {
        max-width: 76px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
}

@media (min-width: 768px) and (max-width: 860px) and (orientation: portrait) {
    :root {
        --tablet-toolbar-control-size: 50px;
        --tablet-toolbar-gap: 10px;
        --tablet-toolbar-content-gap: 28px;
        --tablet-toolbar-x: 16px;
    }

    .main-content > .top-bar {
        grid-template-columns: var(--tablet-toolbar-control-size) minmax(0, 1fr) 112px !important;
    }

    .main-content > .top-bar .user-profile {
        max-width: 112px !important;
        padding: 0 10px !important;
    }

    .main-content > .top-bar .user-profile span {
        max-width: 58px !important;
    }
}

@media (min-width: 900px) and (max-width: 1199px) and (orientation: landscape) {
    .main-content > .top-bar {
        margin-bottom: 18px !important;
    }

    .main-content > .content-body {
        padding-top: 0 !important;
    }
}

/* 44.8 floating player UI polish */
@media (max-width: 1199px) {
    :root {
        --floating-player-size-final: 80px;
        --floating-player-width-final: min(430px, calc(100vw - 28px));
        --floating-player-art-size: 56px;
        --floating-player-play-size: 56px;
    }

    .player-bar {
        height: var(--floating-player-size-final) !important;
        min-height: var(--floating-player-size-final) !important;
        width: var(--floating-player-width-final) !important;
        max-width: var(--floating-player-width-final) !important;
        grid-template-columns: minmax(0, 1fr) var(--floating-player-play-size) !important;
        gap: 12px !important;
        padding: 10px 12px 14px !important;
        border-radius: 28px !important;
        border: 1px solid color-mix(in srgb, var(--accent-color, #00c73c) 22%, var(--player-control-border, var(--border-color))) !important;
        background:
            linear-gradient(135deg, color-mix(in srgb, var(--player-bg, #111827) 96%, transparent), color-mix(in srgb, var(--player-elevated, #1f2937) 88%, transparent)),
            var(--player-bg, #111827) !important;
        box-shadow:
            0 22px 54px rgba(15, 23, 42, 0.24),
            0 8px 18px rgba(15, 23, 42, 0.12) !important;
        isolation: isolate;
        overflow: hidden !important;
    }

    .player-bar::before {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        border-radius: inherit;
        background:
            radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--accent-color, #00c73c) 18%, transparent) 0, transparent 42%),
            linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 54%);
        opacity: 0.72;
        z-index: -1;
    }

    .player-bar.is-playing {
        border-color: color-mix(in srgb, var(--accent-color, #00c73c) 42%, var(--player-control-border, var(--border-color))) !important;
        box-shadow:
            0 24px 58px rgba(15, 23, 42, 0.28),
            0 0 0 1px color-mix(in srgb, var(--accent-color, #00c73c) 16%, transparent),
            0 0 30px color-mix(in srgb, var(--accent-color, #00c73c) 18%, transparent) !important;
    }

    .player-song-info {
        display: grid !important;
        grid-template-columns: var(--floating-player-art-size) minmax(0, 1fr) !important;
        align-items: center !important;
        gap: 12px !important;
        min-width: 0 !important;
    }

    .player-album-art,
    .player-album-art img {
        width: var(--floating-player-art-size) !important;
        height: var(--floating-player-art-size) !important;
        min-width: var(--floating-player-art-size) !important;
        border-radius: 18px !important;
    }

    .player-album-art {
        position: relative;
        box-shadow: 0 10px 22px rgba(15, 23, 42, 0.22);
        overflow: hidden;
    }

    .player-album-art::after {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: inherit;
        border: 1px solid rgba(255, 255, 255, 0.18);
        pointer-events: none;
    }

    .player-album-art.playing::before {
        content: "";
        position: absolute;
        right: 5px;
        bottom: 5px;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: var(--accent-color, #00c73c);
        box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-color, #00c73c) 22%, transparent);
        z-index: 2;
    }

    .player-song-details {
        display: grid !important;
        gap: 4px !important;
        padding-right: 2px !important;
    }

    .player-song-title {
        font-size: 0.96rem !important;
        font-weight: 900 !important;
        line-height: 1.2 !important;
        letter-spacing: 0 !important;
    }

    .player-song-artist {
        font-size: 0.82rem !important;
        line-height: 1.25 !important;
        opacity: 0.86;
    }

    .player-controls {
        position: static !important;
        min-width: var(--floating-player-play-size) !important;
        width: var(--floating-player-play-size) !important;
        align-self: center !important;
    }

    #btn-play-pause {
        width: var(--floating-player-play-size) !important;
        height: var(--floating-player-play-size) !important;
        min-width: var(--floating-player-play-size) !important;
        min-height: var(--floating-player-play-size) !important;
        flex-basis: var(--floating-player-play-size) !important;
        font-size: 1.08rem !important;
        background:
            linear-gradient(135deg, color-mix(in srgb, var(--accent-color, #00c73c) 92%, #ffffff), var(--accent-color, #00c73c)) !important;
        color: #ffffff !important;
        border: 1px solid color-mix(in srgb, var(--accent-color, #00c73c) 72%, #ffffff) !important;
        box-shadow:
            0 14px 30px color-mix(in srgb, var(--accent-color, #00c73c) 32%, rgba(15, 23, 42, 0.22)),
            inset 0 1px 0 rgba(255, 255, 255, 0.24) !important;
    }

    #btn-play-pause i {
        transform: translateX(1px);
    }

    .player-bar.is-playing #btn-play-pause i.fa-pause {
        transform: translateX(0);
    }

    .player-bar .progress-container {
        display: grid !important;
        position: absolute !important;
        left: calc(12px + var(--floating-player-art-size) + 12px) !important;
        right: calc(12px + var(--floating-player-play-size) + 12px) !important;
        bottom: 8px !important;
        width: auto !important;
        min-width: 0 !important;
        height: 7px !important;
        grid-template-columns: minmax(0, 1fr) !important;
        align-items: center !important;
        gap: 0 !important;
        pointer-events: auto;
    }

    .player-bar .time-label {
        display: none !important;
    }

    .player-bar .progress-bar-wrapper {
        width: 100% !important;
        height: 5px !important;
        min-height: 5px !important;
        border-radius: 999px !important;
        overflow: hidden !important;
        background: color-mix(in srgb, var(--player-progress-bg, rgba(148, 163, 184, 0.28)) 72%, transparent) !important;
        box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.18);
    }

    .player-bar .progress-bar {
        height: 100% !important;
        border-radius: inherit !important;
        background: linear-gradient(90deg, var(--accent-color, #00c73c), color-mix(in srgb, var(--accent-color, #00c73c) 72%, #ffffff)) !important;
    }

    .player-bar .progress-handle {
        display: none !important;
    }
}

@media (max-width: 520px) {
    :root {
        --floating-player-size-final: 74px;
        --floating-player-width-final: min(342px, calc(100vw - 24px));
        --floating-player-art-size: 50px;
        --floating-player-play-size: 52px;
    }

    .player-bar {
        border-radius: 24px !important;
        padding: 9px 10px 13px !important;
    }

    .player-song-info {
        gap: 10px !important;
    }

    .player-song-title {
        font-size: 0.9rem !important;
    }

    .player-song-artist {
        font-size: 0.76rem !important;
    }

    .player-bar .progress-container {
        left: calc(10px + var(--floating-player-art-size) + 10px) !important;
        right: calc(10px + var(--floating-player-play-size) + 10px) !important;
        bottom: 7px !important;
    }
}

body.theme-light .player-bar {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94)),
        #ffffff !important;
    border-color: color-mix(in srgb, var(--accent-color, #00c73c) 24%, #cbd5e1) !important;
    box-shadow:
        0 22px 48px rgba(15, 23, 42, 0.16),
        0 6px 18px rgba(15, 23, 42, 0.08) !important;
}

body.theme-light .player-bar::before {
    background:
        radial-gradient(circle at 18% 0%, color-mix(in srgb, var(--accent-color, #00c73c) 16%, transparent) 0, transparent 44%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.78), transparent 62%);
}

body.theme-light .player-song-title {
    color: #0f172a !important;
}

body.theme-light .player-song-artist {
    color: #52606f !important;
}

/* 54th update: premium fullscreen player polish */
.expand-player-overlay {
    padding:
        max(24px, var(--safe-top, env(safe-area-inset-top, 0px)))
        24px
        max(24px, var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
    background:
        linear-gradient(145deg, rgba(248, 250, 252, 0.96), rgba(238, 244, 249, 0.92)) !important;
    backdrop-filter: blur(22px) saturate(1.05) !important;
    -webkit-backdrop-filter: blur(22px) saturate(1.05) !important;
    overflow-y: auto !important;
}

.expand-player-container {
    width: min(1180px, calc(100vw - 48px)) !important;
    height: min(860px, calc(100dvh - var(--safe-top, 0px) - var(--safe-bottom, 0px) - 48px)) !important;
    max-width: none !important;
    max-height: none !important;
    padding: clamp(22px, 3vw, 38px) !important;
    border: 1px solid rgba(148, 163, 184, 0.32) !important;
    border-radius: 32px !important;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.9)) !important;
    box-shadow:
        0 28px 80px rgba(15, 23, 42, 0.18),
        0 8px 24px rgba(15, 23, 42, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.78) !important;
    color: #0f172a !important;
    isolation: isolate;
    overflow: hidden !important;
}

.expand-player-container::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(120deg, color-mix(in srgb, var(--accent-color, #00c73c) 13%, transparent), transparent 42%),
        linear-gradient(315deg, rgba(15, 23, 42, 0.06), transparent 48%);
}

.expand-close {
    top: 18px !important;
    left: auto !important;
    right: 18px !important;
    width: 44px !important;
    height: 44px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 999px !important;
    border: 1px solid rgba(148, 163, 184, 0.26) !important;
    background: rgba(255, 255, 255, 0.78) !important;
    color: #0f172a !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12) !important;
}

.expand-close:hover,
.expand-close:focus-visible {
    transform: translateY(-1px) !important;
    border-color: color-mix(in srgb, var(--accent-color, #00c73c) 42%, rgba(148, 163, 184, 0.26)) !important;
    color: var(--accent-color, #00c73c) !important;
}

.expand-player-main {
    display: grid !important;
    grid-template-columns: minmax(300px, 0.92fr) minmax(360px, 1.08fr) !important;
    gap: clamp(24px, 4vw, 52px) !important;
    align-items: stretch !important;
    margin-top: 22px !important;
    min-height: 0 !important;
}

.expand-art-section {
    min-width: 0;
    justify-content: center !important;
    gap: 22px !important;
    padding: clamp(12px, 2vw, 24px) !important;
}

.expand-album-art {
    width: min(360px, 72vw) !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    border-radius: 28px !important;
    border: 1px solid rgba(255, 255, 255, 0.72) !important;
    box-shadow:
        0 30px 70px rgba(15, 23, 42, 0.26),
        0 10px 24px rgba(15, 23, 42, 0.12) !important;
    margin-bottom: 0 !important;
    background: #111827 !important;
}

.expand-song-meta {
    max-width: min(460px, 100%);
}

.expand-song-meta h2 {
    color: #0f172a !important;
    font-size: clamp(1.75rem, 3vw, 2.7rem) !important;
    line-height: 1.08 !important;
    letter-spacing: 0 !important;
    margin-bottom: 12px !important;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.expand-song-meta p {
    color: #64748b !important;
    font-size: 1rem !important;
    line-height: 1.55 !important;
}

.expand-song-meta #expand-player-artist {
    color: var(--accent-color, #00c73c) !important;
    font-weight: 800 !important;
}

.mini-lyrics-line {
    margin-top: 12px !important;
    color: #475569 !important;
}

.expand-tab-section {
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    border-radius: 28px !important;
    border: 1px solid rgba(148, 163, 184, 0.28) !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 250, 252, 0.74)) !important;
    box-shadow:
        0 20px 48px rgba(15, 23, 42, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.68) !important;
    overflow: hidden !important;
}

.expand-tab-headers {
    min-height: 58px !important;
    padding: 8px !important;
    gap: 8px !important;
    background: rgba(241, 245, 249, 0.84) !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.24) !important;
}

.tab-header-btn {
    min-height: 42px !important;
    border-radius: 16px !important;
    border: 1px solid transparent !important;
    color: #475569 !important;
    font-size: 0.92rem !important;
    font-weight: 800 !important;
    padding: 10px 14px !important;
}

.tab-header-btn:hover,
.tab-header-btn:focus-visible {
    color: #0f172a !important;
    background: rgba(255, 255, 255, 0.72) !important;
}

.tab-header-btn.active {
    color: #063f1c !important;
    border-color: color-mix(in srgb, var(--accent-color, #00c73c) 34%, transparent) !important;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.94), color-mix(in srgb, var(--accent-color, #00c73c) 12%, #ffffff)) !important;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08) !important;
}

.expand-tab-content {
    padding: 12px !important;
    min-height: 0 !important;
}

#expand-queue-list,
#expand-tab-lyrics-content {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--accent-color, #00c73c) 45%, #94a3b8) transparent;
}

#expand-queue-list .queue-item,
.queue-panel .queue-item {
    position: relative;
    min-height: 72px;
    margin: 0 0 8px;
    padding: 12px 14px !important;
    border: 1px solid rgba(148, 163, 184, 0.18) !important;
    border-radius: 20px !important;
    background: rgba(255, 255, 255, 0.64) !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05) !important;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

#expand-queue-list .queue-item:hover,
.queue-panel .queue-item:hover {
    transform: translateY(-1px);
    border-color: rgba(148, 163, 184, 0.34) !important;
    background: rgba(255, 255, 255, 0.9) !important;
}

#expand-queue-list .queue-item.active,
#expand-queue-list .queue-item.is-playing,
.queue-panel .queue-item.active,
.queue-panel .queue-item.is-playing {
    border-color: color-mix(in srgb, var(--accent-color, #00c73c) 52%, rgba(148, 163, 184, 0.18)) !important;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--accent-color, #00c73c) 16%, #ffffff), rgba(255, 255, 255, 0.92)) !important;
    box-shadow:
        0 16px 34px color-mix(in srgb, var(--accent-color, #00c73c) 16%, rgba(15, 23, 42, 0.08)),
        inset 4px 0 0 var(--accent-color, #00c73c) !important;
}

.queue-item.active .queue-item-title,
.queue-item.is-playing .queue-item-title {
    color: #062a14 !important;
}

.queue-now-playing-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--accent-color, #00c73c);
    color: #ffffff;
    font-size: 0.68rem;
    line-height: 1;
    font-weight: 800;
    vertical-align: middle;
    box-shadow: 0 8px 18px color-mix(in srgb, var(--accent-color, #00c73c) 28%, transparent);
}

.queue-item-thumb {
    width: 48px !important;
    height: 48px !important;
    border-radius: 14px !important;
    border-color: rgba(148, 163, 184, 0.32) !important;
}

.queue-item.active .queue-item-thumb,
.queue-item.is-playing .queue-item-thumb {
    border-color: color-mix(in srgb, var(--accent-color, #00c73c) 68%, #ffffff) !important;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-color, #00c73c) 12%, transparent);
}

.queue-item-title {
    color: #0f172a !important;
    font-size: 0.94rem !important;
    line-height: 1.3 !important;
}

.queue-item-artist,
.queue-item-duration {
    color: #64748b !important;
}

.queue-item-position {
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.78);
    color: #475569;
}

.queue-item.active .queue-item-position,
.queue-item.is-playing .queue-item-position {
    background: color-mix(in srgb, var(--accent-color, #00c73c) 16%, #ffffff);
    color: #087a2f;
    font-weight: 800;
}

.expand-lyrics-full-text {
    padding: clamp(18px, 2.4vw, 28px) !important;
    color: #1f2937 !important;
    font-size: 1rem !important;
    line-height: 1.9 !important;
}

.expand-player-controls {
    margin-top: clamp(18px, 2.8vw, 30px) !important;
    padding: 0 clamp(4px, 2vw, 24px) !important;
}

.expand-player-controls .progress-container {
    max-width: 860px !important;
    margin-bottom: 22px !important;
    gap: 14px !important;
}

.expand-player-controls .progress-bar-wrapper {
    height: 10px !important;
    border-radius: 999px !important;
    background: rgba(203, 213, 225, 0.78) !important;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.16) !important;
    position: relative !important;
    cursor: pointer !important;
    touch-action: none !important;
}

.expand-player-controls .progress-bar {
    border-radius: inherit !important;
    background:
        linear-gradient(90deg, var(--accent-color, #00c73c), color-mix(in srgb, var(--accent-color, #00c73c) 68%, #ffffff)) !important;
}

.expand-player-controls .time-label {
    min-width: 46px;
    color: #64748b !important;
    font-weight: 800;
    font-size: 0.8rem;
}

.expand-control-buttons-row {
    gap: clamp(12px, 2.4vw, 26px) !important;
    margin-bottom: 18px !important;
}

.expand-player-container .control-btn {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    min-height: 46px !important;
    border-radius: 999px !important;
}

.expand-player-container .control-btn:not(.play-btn) {
    background: rgba(255, 255, 255, 0.82) !important;
    border-color: rgba(148, 163, 184, 0.32) !important;
    color: #334155 !important;
}

.expand-player-container .control-btn.play-btn,
#expand-btn-play-pause {
    width: 72px !important;
    height: 72px !important;
    min-width: 72px !important;
    min-height: 72px !important;
    background: #0f172a !important;
    color: #ffffff !important;
    border-color: #0f172a !important;
    box-shadow:
        0 18px 38px rgba(15, 23, 42, 0.24),
        0 0 0 8px rgba(15, 23, 42, 0.06) !important;
}

.expand-secondary-actions {
    display: flex !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
}

.expand-secondary-actions .btn {
    min-height: 42px !important;
    border-radius: 999px !important;
    padding-inline: 16px !important;
    background: rgba(255, 255, 255, 0.78) !important;
    border-color: rgba(148, 163, 184, 0.32) !important;
    color: #0f172a !important;
    font-weight: 800 !important;
}

body.theme-dark .expand-player-overlay,
body:not(.theme-light) .expand-player-overlay {
    background:
        linear-gradient(145deg, rgba(3, 7, 18, 0.94), rgba(15, 23, 42, 0.92)) !important;
}

body.theme-dark .expand-player-container,
body:not(.theme-light) .expand-player-container {
    border-color: rgba(148, 163, 184, 0.18) !important;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(2, 6, 23, 0.9)) !important;
    color: #f8fafc !important;
}

body.theme-dark .expand-player-container::before,
body:not(.theme-light) .expand-player-container::before {
    background:
        linear-gradient(120deg, color-mix(in srgb, var(--accent-color, #00c73c) 18%, transparent), transparent 44%),
        linear-gradient(315deg, rgba(255, 255, 255, 0.04), transparent 48%);
}

body.theme-dark .expand-close,
body:not(.theme-light) .expand-close,
body.theme-dark .expand-player-container .control-btn:not(.play-btn),
body:not(.theme-light) .expand-player-container .control-btn:not(.play-btn),
body.theme-dark .expand-secondary-actions .btn,
body:not(.theme-light) .expand-secondary-actions .btn {
    background: rgba(15, 23, 42, 0.76) !important;
    border-color: rgba(148, 163, 184, 0.2) !important;
    color: #e2e8f0 !important;
}

body.theme-dark .expand-song-meta h2,
body:not(.theme-light) .expand-song-meta h2,
body.theme-dark .queue-item-title,
body:not(.theme-light) .queue-item-title {
    color: #f8fafc !important;
}

body.theme-dark .expand-song-meta p,
body:not(.theme-light) .expand-song-meta p,
body.theme-dark .mini-lyrics-line,
body:not(.theme-light) .mini-lyrics-line,
body.theme-dark .queue-item-artist,
body:not(.theme-light) .queue-item-artist,
body.theme-dark .queue-item-duration,
body:not(.theme-light) .queue-item-duration {
    color: #94a3b8 !important;
}

body.theme-dark .expand-tab-section,
body:not(.theme-light) .expand-tab-section {
    border-color: rgba(148, 163, 184, 0.18) !important;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(2, 6, 23, 0.5)) !important;
}

body.theme-dark .expand-tab-headers,
body:not(.theme-light) .expand-tab-headers {
    background: rgba(2, 6, 23, 0.56) !important;
    border-bottom-color: rgba(148, 163, 184, 0.18) !important;
}

body.theme-dark .tab-header-btn,
body:not(.theme-light) .tab-header-btn {
    color: #94a3b8 !important;
}

body.theme-dark .tab-header-btn.active,
body:not(.theme-light) .tab-header-btn.active {
    color: #dfffe9 !important;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.92), color-mix(in srgb, var(--accent-color, #00c73c) 16%, rgba(15, 23, 42, 0.88))) !important;
}

body.theme-dark #expand-queue-list .queue-item,
body:not(.theme-light) #expand-queue-list .queue-item,
body.theme-dark .queue-panel .queue-item,
body:not(.theme-light) .queue-panel .queue-item {
    border-color: rgba(148, 163, 184, 0.14) !important;
    background: rgba(15, 23, 42, 0.56) !important;
}

body.theme-dark #expand-queue-list .queue-item.active,
body:not(.theme-light) #expand-queue-list .queue-item.active,
body.theme-dark #expand-queue-list .queue-item.is-playing,
body:not(.theme-light) #expand-queue-list .queue-item.is-playing,
body.theme-dark .queue-panel .queue-item.active,
body:not(.theme-light) .queue-panel .queue-item.active,
body.theme-dark .queue-panel .queue-item.is-playing,
body:not(.theme-light) .queue-panel .queue-item.is-playing {
    border-color: color-mix(in srgb, var(--accent-color, #00c73c) 54%, rgba(148, 163, 184, 0.18)) !important;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--accent-color, #00c73c) 18%, rgba(15, 23, 42, 0.9)), rgba(15, 23, 42, 0.82)) !important;
}

body.theme-dark .queue-item.active .queue-item-title,
body:not(.theme-light) .queue-item.active .queue-item-title,
body.theme-dark .queue-item.is-playing .queue-item-title,
body:not(.theme-light) .queue-item.is-playing .queue-item-title {
    color: #f8fafc !important;
}

body.theme-dark .expand-lyrics-full-text,
body:not(.theme-light) .expand-lyrics-full-text {
    color: #e2e8f0 !important;
}

body.theme-dark .expand-player-controls .progress-bar-wrapper,
body:not(.theme-light) .expand-player-controls .progress-bar-wrapper {
    background: rgba(51, 65, 85, 0.8) !important;
}

@media (min-width: 768px) and (max-width: 1023px) {
    .expand-player-container {
        width: min(760px, calc(100vw - 32px)) !important;
        height: min(940px, calc(100dvh - var(--safe-top, 0px) - var(--safe-bottom, 0px) - 32px)) !important;
        padding: 22px !important;
    }

    .expand-player-main {
        grid-template-columns: 1fr !important;
        gap: 18px !important;
        overflow-y: auto !important;
        padding-right: 2px;
    }

    .expand-art-section {
        padding-bottom: 0 !important;
    }

    .expand-album-art {
        width: min(300px, 54vw) !important;
        border-radius: 24px !important;
    }

    .expand-tab-section {
        min-height: 320px !important;
    }
}

@media (max-width: 767px) {
    .expand-player-overlay {
        padding: max(12px, var(--safe-top, env(safe-area-inset-top, 0px))) 12px max(12px, var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
        align-items: stretch !important;
    }

    .expand-player-container {
        width: 100% !important;
        height: calc(100dvh - var(--safe-top, 0px) - var(--safe-bottom, 0px) - 24px) !important;
        border-radius: 26px !important;
        padding: 18px !important;
    }

    .expand-player-main {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        margin-top: 34px !important;
        overflow-y: auto !important;
    }

    .expand-album-art {
        width: min(240px, 66vw) !important;
        border-radius: 22px !important;
    }

    .expand-song-meta h2 {
        font-size: 1.5rem !important;
    }

    .expand-tab-section {
        min-height: 300px !important;
    }

    .expand-player-controls .progress-container {
        display: grid !important;
        grid-template-columns: 42px minmax(0, 1fr) 42px !important;
        width: 100% !important;
        gap: 8px !important;
    }

    .expand-control-buttons-row {
        gap: 10px !important;
    }

    .expand-player-container .control-btn:not(.play-btn) {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
    }

    .expand-player-container .control-btn.play-btn,
    #expand-btn-play-pause {
        width: 62px !important;
        height: 62px !important;
        min-width: 62px !important;
        min-height: 62px !important;
    }

    #expand-queue-list .queue-item,
    .queue-panel .queue-item {
        grid-template-columns: 48px minmax(0, 1fr) auto !important;
        min-height: 68px;
    }

    .queue-now-playing-badge {
        display: flex;
        width: fit-content;
        margin: 6px 0 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .expand-player-container,
    .expand-player-overlay,
    #expand-queue-list .queue-item,
    .queue-panel .queue-item {
        animation: none !important;
        transition: none !important;
    }
}

/* 56.1 mobile bottom floating player stability patch */
@media (max-width: 767px) {
    :root {
        --mobile-player-height: 76px;
        --mobile-player-gutter: 12px;
        --mobile-player-art: 50px;
        --mobile-player-play: 52px;
    }

    .player-bar {
        left: var(--mobile-player-gutter) !important;
        right: var(--mobile-player-gutter) !important;
        bottom: calc(12px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
        height: var(--mobile-player-height) !important;
        min-height: var(--mobile-player-height) !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) var(--mobile-player-play) !important;
        align-items: center !important;
        column-gap: 10px !important;
        padding: 9px 10px 14px !important;
        border-radius: 24px !important;
        overflow: hidden !important;
        transform: translateZ(0);
    }

    .player-song-info {
        display: grid !important;
        grid-template-columns: var(--mobile-player-art) minmax(0, 1fr) !important;
        align-items: center !important;
        gap: 10px !important;
        width: 100% !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .player-album-art,
    .player-album-art img {
        width: var(--mobile-player-art) !important;
        height: var(--mobile-player-art) !important;
        min-width: var(--mobile-player-art) !important;
        border-radius: 15px !important;
    }

    .player-song-details {
        min-width: 0 !important;
        width: 100% !important;
        overflow: hidden !important;
        padding-right: 0 !important;
    }

    .player-song-title,
    .player-song-artist {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        word-break: normal !important;
    }

    .player-song-title {
        font-size: 0.92rem !important;
        line-height: 1.18 !important;
        margin-bottom: 3px !important;
    }

    .player-song-artist {
        font-size: 0.76rem !important;
        line-height: 1.2 !important;
    }

    .player-controls {
        width: var(--mobile-player-play) !important;
        min-width: var(--mobile-player-play) !important;
        height: var(--mobile-player-play) !important;
        min-height: var(--mobile-player-play) !important;
        align-self: center !important;
        justify-self: end !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .control-buttons {
        width: var(--mobile-player-play) !important;
        min-width: var(--mobile-player-play) !important;
        justify-content: center !important;
    }

    #btn-play-pause {
        width: var(--mobile-player-play) !important;
        height: var(--mobile-player-play) !important;
        min-width: var(--mobile-player-play) !important;
        min-height: var(--mobile-player-play) !important;
        flex: 0 0 var(--mobile-player-play) !important;
        border-radius: 999px !important;
    }

    .player-bar .progress-container {
        left: calc(10px + var(--mobile-player-art) + 10px) !important;
        right: calc(10px + var(--mobile-player-play) + 10px) !important;
        bottom: 7px !important;
        height: 6px !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .player-utils,
    #btn-shuffle,
    #btn-prev,
    #btn-next,
    #btn-repeat {
        display: none !important;
    }

    .content-body,
    .app-main,
    .main-content,
    .admin-dashboard,
    .settings-page,
    .lyrics-edit-page,
    .search-page {
        padding-bottom: calc(var(--mobile-player-height) + 42px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
    }

    .melon-lite-toast,
    .queue-panel,
    .pwa-install-banner:not(.pwa-install-modal),
    .guest-preview-prompt.preview-premium-sheet {
        bottom: calc(var(--mobile-player-height) + 34px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
    }
}

@media (max-width: 380px) {
    :root {
        --mobile-player-height: 72px;
        --mobile-player-gutter: 10px;
        --mobile-player-art: 46px;
        --mobile-player-play: 48px;
    }

    .player-bar {
        padding: 8px 9px 13px !important;
        border-radius: 22px !important;
    }

    .player-song-title {
        font-size: 0.86rem !important;
    }

    .player-song-artist {
        font-size: 0.72rem !important;
    }
}

/* 56.2 player-side long metadata overflow guard */
.player-bar,
.expand-player-container,
.expand-player-main,
.expand-song-meta,
.expand-tab-section,
.queue-body,
#expand-queue-list,
.queue-panel,
.queue-item,
.queue-item-info,
.queue-item-title,
.queue-item-artist {
    min-width: 0 !important;
}

.expand-song-meta h2,
.expand-song-meta p,
.queue-item-title,
.queue-item-artist,
.mini-lyrics-line,
.expand-lyrics-full-text {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: keep-all;
}

.queue-item-title,
.queue-item-artist {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 768px) {
    .queue-item-title,
    .queue-item-artist {
        white-space: nowrap;
    }
}

@media (max-width: 767px) {
    .expand-song-meta h2,
    .queue-item-title {
        white-space: normal !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .expand-song-meta p,
    .queue-item-artist,
    .mini-lyrics-line {
        white-space: normal !important;
    }
}

/* 56.4 mobile music list clean card layout */
@media (max-width: 767px) {
    .music-list-page .song-list-container,
    .music-list-page .table-container {
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    .music-list-page .song-table,
    .music-list-page .song-table thead,
    .music-list-page .song-table tbody,
    .music-list-page .song-table tr,
    .music-list-page .song-table td {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        border: 0 !important;
        background: transparent !important;
    }

    .music-list-page .song-table thead {
        display: none !important;
    }

    .music-list-page .song-table tbody {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 10px !important;
    }

    .music-list-page .song-table tr.song-item {
        position: relative !important;
        display: grid !important;
        grid-template-columns: 42px 54px minmax(0, 1fr) auto !important;
        grid-template-rows: auto auto !important;
        grid-template-areas:
            "play cover title actions"
            "play cover meta actions" !important;
        align-items: center !important;
        gap: 4px 10px !important;
        min-height: 78px !important;
        padding: 12px !important;
        border: 1px solid color-mix(in srgb, var(--border-color, #d8e2ee) 86%, transparent) !important;
        border-radius: 18px !important;
        background: var(--card-bg, var(--surface, #ffffff)) !important;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07) !important;
        overflow: hidden !important;
    }

    .music-list-page .song-table tr.song-item .rank-cell {
        position: absolute !important;
        left: 52px !important;
        top: 8px !important;
        z-index: 2;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 24px !important;
        height: 24px !important;
        min-width: 24px !important;
        max-width: 24px !important;
        padding: 0 !important;
        border-radius: 999px !important;
        background: color-mix(in srgb, var(--accent-color, #00c73c) 92%, #111827) !important;
        color: #ffffff !important;
        font-size: 0.72rem !important;
        font-weight: 900 !important;
        line-height: 1 !important;
        box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
        pointer-events: none;
    }

    .music-list-page .song-table tr.song-item.playing,
    .music-list-page .song-table tr.song-item.is-playing {
        border-color: color-mix(in srgb, var(--accent-color, #00c73c) 48%, var(--border-color, #d8e2ee)) !important;
        background: color-mix(in srgb, var(--accent-color, #00c73c) 8%, var(--card-bg, #ffffff)) !important;
    }

    .music-list-page .song-table tr.song-item td {
        padding: 0 !important;
        margin: 0 !important;
        align-self: center !important;
        white-space: normal !important;
    }

    .music-list-page .song-table tr.song-item td:has(.play-row-btn) {
        grid-area: play !important;
        justify-self: center !important;
        align-self: center !important;
    }

    .music-list-page .song-table tr.song-item .play-row-btn {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
        border-radius: 999px !important;
    }

    .music-list-page .song-table tr.song-item td.song-title-cell,
    .music-list-page .song-table tr.song-item td:nth-of-type(2) {
        display: contents !important;
    }

    .music-list-page .song-table tr.song-item .song-title-wrap {
        display: contents !important;
    }

    .music-list-page .song-table tr.song-item .list-cover {
        grid-area: cover !important;
        width: 54px !important;
        height: 54px !important;
        min-width: 54px !important;
        border-radius: 14px !important;
        object-fit: cover !important;
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
    }

    .music-list-page .song-table tr.song-item .song-title-stack {
        grid-area: title !important;
        min-width: 0 !important;
        max-width: 100% !important;
        align-self: end !important;
    }

    .music-list-page .song-table tr.song-item .song-title-link {
        display: -webkit-box !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: normal !important;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        font-size: 0.96rem !important;
        font-weight: 900 !important;
        line-height: 1.25 !important;
        color: var(--text-primary) !important;
    }

    .music-list-page .song-table tr.song-item .song-list-badges {
        display: none !important;
    }

    .music-list-page .song-table tr.song-item .artist-cell {
        grid-area: meta !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        color: var(--text-secondary) !important;
        font-size: 0.82rem !important;
        font-weight: 700 !important;
        line-height: 1.25 !important;
        align-self: start !important;
    }

    .music-list-page .song-table tr.song-item .album-cell {
        grid-area: meta !important;
        margin-top: 18px !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        color: var(--text-muted, var(--text-secondary)) !important;
        font-size: 0.78rem !important;
        line-height: 1.25 !important;
        align-self: start !important;
    }

    .music-list-page .song-table tr.song-item .genre-cell,
    .music-list-page .song-table tr.song-item .duration-cell,
    .music-list-page .song-table tr.song-item .format-cell,
    .music-list-page .song-table tr.song-item td.play-count-td,
    .music-list-page .song-table tr.song-item .file-ext-badge {
        display: none !important;
    }

    .music-list-page .song-table tr.song-item .actions-cell,
    .music-list-page .song-table tr.song-item td:last-child {
        grid-area: actions !important;
        justify-self: end !important;
        align-self: center !important;
        display: block !important;
        width: auto !important;
        padding: 0 !important;
    }

    .music-list-page .song-table tr.song-item .song-action-group {
        display: grid !important;
        grid-template-columns: 36px !important;
        gap: 6px !important;
        width: 36px !important;
        min-width: 36px !important;
    }

    .music-list-page .song-table tr.song-item .like-btn,
    .music-list-page .song-table tr.song-item .add-playlist-btn,
    .music-list-page .song-table tr.song-item .remove-playlist-song-btn {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        border-radius: 999px !important;
    }
}

@media (max-width: 380px) {
    .music-list-page .song-table tr.song-item {
        grid-template-columns: 38px 48px minmax(0, 1fr) 36px !important;
        gap: 4px 8px !important;
        padding: 10px !important;
        min-height: 72px !important;
    }

    .music-list-page .song-table tr.song-item .list-cover {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
    }

    .music-list-page .song-table tr.song-item .song-title-link {
        font-size: 0.9rem !important;
    }

    .music-list-page .song-table tr.song-item .rank-cell {
        left: 46px !important;
        top: 7px !important;
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
        max-width: 22px !important;
        font-size: 0.68rem !important;
    }
}

/* 56.5 apply the same clean mobile song list to every page using renderSongTable() */
@media (max-width: 767px) {
    .song-list-container {
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    .song-list-container .song-table,
    .song-list-container .song-table thead,
    .song-list-container .song-table tbody,
    .song-list-container .song-table tr,
    .song-list-container .song-table td {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        border: 0 !important;
        background: transparent !important;
    }

    .song-list-container .song-table thead {
        display: none !important;
    }

    .song-list-container .song-table tbody {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 10px !important;
    }

    .song-list-container .song-table tr.song-item {
        position: relative !important;
        display: grid !important;
        grid-template-columns: 42px 54px minmax(0, 1fr) auto !important;
        grid-template-rows: auto auto !important;
        grid-template-areas:
            "play cover title actions"
            "play cover meta actions" !important;
        align-items: center !important;
        gap: 4px 10px !important;
        min-height: 78px !important;
        padding: 12px !important;
        border: 1px solid color-mix(in srgb, var(--border-color, #d8e2ee) 86%, transparent) !important;
        border-radius: 18px !important;
        background: var(--card-bg, var(--surface, #ffffff)) !important;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07) !important;
        overflow: hidden !important;
    }

    .song-list-container .song-table tr.song-item .rank-cell {
        position: absolute !important;
        left: 52px !important;
        top: 8px !important;
        z-index: 2;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 24px !important;
        height: 24px !important;
        min-width: 24px !important;
        max-width: 24px !important;
        padding: 0 !important;
        border-radius: 999px !important;
        background: color-mix(in srgb, var(--accent-color, #00c73c) 92%, #111827) !important;
        color: #ffffff !important;
        font-size: 0.72rem !important;
        font-weight: 900 !important;
        line-height: 1 !important;
        box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
        pointer-events: none;
    }

    .song-list-container .song-table tr.song-item.playing,
    .song-list-container .song-table tr.song-item.is-playing {
        border-color: color-mix(in srgb, var(--accent-color, #00c73c) 48%, var(--border-color, #d8e2ee)) !important;
        background: color-mix(in srgb, var(--accent-color, #00c73c) 8%, var(--card-bg, #ffffff)) !important;
    }

    .song-list-container .song-table tr.song-item td {
        padding: 0 !important;
        margin: 0 !important;
        align-self: center !important;
        white-space: normal !important;
    }

    .song-list-container .song-table tr.song-item td:has(.play-row-btn) {
        grid-area: play !important;
        justify-self: center !important;
        align-self: center !important;
    }

    .song-list-container .song-table tr.song-item .play-row-btn {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
        border-radius: 999px !important;
    }

    .song-list-container .song-table tr.song-item td.song-title-cell {
        display: contents !important;
    }

    .song-list-container .song-table tr.song-item .song-title-wrap {
        display: contents !important;
    }

    .song-list-container .song-table tr.song-item .list-cover {
        grid-area: cover !important;
        width: 54px !important;
        height: 54px !important;
        min-width: 54px !important;
        border-radius: 14px !important;
        object-fit: cover !important;
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
    }

    .song-list-container .song-table tr.song-item .song-title-stack {
        grid-area: title !important;
        min-width: 0 !important;
        max-width: 100% !important;
        align-self: end !important;
    }

    .song-list-container .song-table tr.song-item .song-title-link {
        display: -webkit-box !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: normal !important;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        font-size: 0.96rem !important;
        font-weight: 900 !important;
        line-height: 1.25 !important;
        color: var(--text-primary) !important;
    }

    .song-list-container .song-table tr.song-item .song-list-badges {
        display: none !important;
    }

    .song-list-container .song-table tr.song-item .artist-cell {
        grid-area: meta !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        color: var(--text-secondary) !important;
        font-size: 0.82rem !important;
        font-weight: 700 !important;
        line-height: 1.25 !important;
        align-self: start !important;
    }

    .song-list-container .song-table tr.song-item .album-cell {
        grid-area: meta !important;
        margin-top: 18px !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        color: var(--text-muted, var(--text-secondary)) !important;
        font-size: 0.78rem !important;
        line-height: 1.25 !important;
        align-self: start !important;
    }

    .song-list-container .song-table tr.song-item .genre-cell,
    .song-list-container .song-table tr.song-item .duration-cell,
    .song-list-container .song-table tr.song-item .format-cell,
    .song-list-container .song-table tr.song-item td.play-count-td,
    .song-list-container .song-table tr.song-item .file-ext-badge {
        display: none !important;
    }

    .song-list-container .song-table tr.song-item .actions-cell,
    .song-list-container .song-table tr.song-item td:last-child {
        grid-area: actions !important;
        justify-self: end !important;
        align-self: center !important;
        display: block !important;
        width: auto !important;
        padding: 0 !important;
    }

    .song-list-container .song-table tr.song-item .song-action-group {
        display: grid !important;
        grid-template-columns: 36px !important;
        gap: 6px !important;
        width: 36px !important;
        min-width: 36px !important;
    }

    .song-list-container .song-table tr.song-item .like-btn,
    .song-list-container .song-table tr.song-item .add-playlist-btn,
    .song-list-container .song-table tr.song-item .remove-playlist-song-btn {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        border-radius: 999px !important;
    }
}

@media (max-width: 380px) {
    .song-list-container .song-table tr.song-item {
        grid-template-columns: 38px 48px minmax(0, 1fr) 36px !important;
        gap: 4px 8px !important;
        padding: 10px !important;
        min-height: 72px !important;
    }

    .song-list-container .song-table tr.song-item .list-cover {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
    }

    .song-list-container .song-table tr.song-item .song-title-link {
        font-size: 0.9rem !important;
    }

    .song-list-container .song-table tr.song-item .rank-cell {
        left: 46px !important;
        top: 7px !important;
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
        max-width: 22px !important;
        font-size: 0.68rem !important;
    }
}

/* 56.6 mobile filter UI polish */
@media (max-width: 767px) {
    :root {
        --mobile-filter-control-height: 44px;
    }

    .list-filter-section,
    .advanced-filter-form,
    .advanced-filter-panel,
    .filter-panel,
    .filter-card,
    .search-filter-card,
    .metadata-filter-panel,
    .operation-filter-bar {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 12px !important;
        padding: 12px !important;
        border-radius: 18px !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    .filter-left,
    .filter-right,
    .filter-grid,
    .filter-sort-form,
    .filter-actions,
    .search-actions,
    .advanced-filter-actions,
    .metadata-bulk-actions,
    .metadata-filter-tabs,
    .filter-tabs,
    .filter-tab-row {
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .filter-grid,
    .filter-sort-form,
    .advanced-filter-form .filter-grid,
    .advanced-filter-panel .filter-grid,
    .enhanced-search-page .filter-grid,
    .music-list-page .filter-sort-form {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 10px !important;
    }

    .filter-grid > *,
    .filter-sort-form > *,
    .advanced-filter-form .filter-grid > *,
    .advanced-filter-panel .filter-grid > *,
    .enhanced-search-page .filter-grid > *,
    .music-list-page .filter-sort-form > * {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .filter-grid label,
    .advanced-filter-form label,
    .advanced-filter-panel label {
        display: grid !important;
        gap: 6px !important;
        min-width: 0 !important;
        color: var(--text-muted, var(--text-secondary)) !important;
        font-size: 0.84rem !important;
        line-height: 1.35 !important;
    }

    .filter-grid select,
    .filter-grid input,
    .filter-sort-form select,
    .filter-sort-form input,
    .advanced-filter-form select,
    .advanced-filter-form input,
    .advanced-filter-panel select,
    .advanced-filter-panel input,
    .enhanced-search-page .filter-grid .form-control,
    .music-list-page .filter-sort-form select,
    .music-list-page .filter-sort-form input {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        min-height: var(--mobile-filter-control-height) !important;
        border-radius: 14px !important;
        padding: 0 36px 0 12px !important;
        font-size: 0.92rem !important;
        line-height: 1.35 !important;
        box-sizing: border-box !important;
    }

    .filter-left,
    .filter-tabs,
    .filter-tab-row,
    .metadata-filter-tabs {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding: 2px 2px 6px !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }

    .filter-left::-webkit-scrollbar,
    .filter-tabs::-webkit-scrollbar,
    .filter-tab-row::-webkit-scrollbar,
    .metadata-filter-tabs::-webkit-scrollbar {
        display: none !important;
    }

    .filter-tab,
    .filter-tabs .filter-tab,
    .metadata-filter-tabs .filter-tab,
    .music-list-page .filter-tab {
        flex: 0 0 auto !important;
        min-height: 40px !important;
        min-width: max-content !important;
        padding: 0 14px !important;
        border-radius: 999px !important;
        white-space: nowrap !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .filter-actions,
    .search-actions,
    .advanced-filter-actions,
    .metadata-bulk-actions {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 8px !important;
    }

    .filter-actions .btn,
    .search-actions .btn,
    .advanced-filter-actions .btn,
    .metadata-bulk-actions .btn {
        width: 100% !important;
        min-height: 44px !important;
        justify-content: center !important;
        white-space: nowrap !important;
    }
}

@media (min-width: 560px) and (max-width: 1199px) {
    .filter-grid,
    .filter-sort-form,
    .advanced-filter-form .filter-grid,
    .advanced-filter-panel .filter-grid,
    .enhanced-search-page .filter-grid,
    .music-list-page .filter-sort-form {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .filter-actions,
    .search-actions,
    .advanced-filter-actions,
    .metadata-bulk-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* 56.7 mobile filter drawer: keep page content visible until filters are needed */
.mobile-filter-toggle {
    display: none;
}

@media (min-width: 1200px) {
    .mobile-filter-shell {
        display: contents;
    }
}

@media (max-width: 1199px) {
    .mobile-filter-shell {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 0 14px !important;
        box-sizing: border-box !important;
    }

    .mobile-filter-toggle {
        width: 100% !important;
        min-height: 48px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px !important;
        padding: 0 14px !important;
        border: 1px solid var(--border-color, rgba(148, 163, 184, 0.32)) !important;
        border-radius: 16px !important;
        background: var(--surface, var(--card-bg, #fff)) !important;
        color: var(--text-primary, #0f172a) !important;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08) !important;
        font-weight: 900 !important;
        cursor: pointer !important;
        box-sizing: border-box !important;
    }

    .mobile-filter-toggle:focus-visible {
        outline: 3px solid color-mix(in srgb, var(--accent-color, #00c73c) 34%, transparent);
        outline-offset: 3px;
    }

    .mobile-filter-toggle-main {
        min-width: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .mobile-filter-toggle-main i {
        color: var(--accent-color, #00c73c) !important;
    }

    .mobile-filter-hint,
    .mobile-filter-count {
        flex: 0 0 auto !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 30px !important;
        padding: 0 10px !important;
        border-radius: 999px !important;
        border: 1px solid var(--border-color, rgba(148, 163, 184, 0.32)) !important;
        background: var(--surface-soft, rgba(148, 163, 184, 0.12)) !important;
        color: var(--text-secondary, #475569) !important;
        font-size: 0.78rem !important;
        font-weight: 900 !important;
        white-space: nowrap !important;
    }

    .mobile-filter-count {
        border-color: color-mix(in srgb, var(--accent-color, #00c73c) 40%, var(--border-color, #d8e2ee)) !important;
        background: color-mix(in srgb, var(--accent-color, #00c73c) 12%, var(--surface, #fff)) !important;
        color: var(--accent-color, #00a832) !important;
    }

    .mobile-filter-shell:not(.is-open) .mobile-filter-panel {
        display: none !important;
    }

    .mobile-filter-shell.is-open .mobile-filter-panel {
        margin-top: 10px !important;
    }
}

/* 56.8 mobile in-app polish */
@media (max-width: 767px) {
    :root {
        --mobile-app-gutter: 14px;
        --mobile-app-radius: 18px;
        --mobile-app-shadow: 0 12px 34px rgba(15, 23, 42, 0.10);
        --mobile-header-safe-top: min(var(--safe-top, env(safe-area-inset-top, 0px)), 8px);
    }

    html,
    body {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        background: var(--app-bg, var(--bg-color, #f6f8fb)) !important;
    }

    .app-container,
    .main-content {
        width: 100% !important;
        max-width: 100vw !important;
        min-width: 0 !important;
        overflow-x: clip !important;
        background:
            radial-gradient(circle at 18% 0%, color-mix(in srgb, var(--accent-color, #00c73c) 9%, transparent) 0, transparent 30%),
            var(--app-bg, var(--bg-color, #f6f8fb)) !important;
    }

    .top-bar {
        position: sticky !important;
        top: 0 !important;
        z-index: calc(var(--z-header, 900) + 2) !important;
        min-height: calc(56px + var(--mobile-header-safe-top, 0px)) !important;
        padding: calc(6px + var(--mobile-header-safe-top, 0px)) var(--mobile-app-gutter) 6px !important;
        gap: 8px !important;
        border-bottom: 1px solid color-mix(in srgb, var(--border-color, #d8e2ee) 70%, transparent) !important;
        background: color-mix(in srgb, var(--surface, #fff) 88%, transparent) !important;
        box-shadow: 0 10px 26px rgba(15, 23, 42, 0.07) !important;
        backdrop-filter: blur(18px) saturate(1.25) !important;
        -webkit-backdrop-filter: blur(18px) saturate(1.25) !important;
    }

    .mobile-menu-btn {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        border-radius: 16px !important;
        background: var(--surface, #fff) !important;
        border: 1px solid var(--border-color, #d8e2ee) !important;
        box-shadow: 0 10px 22px rgba(15, 23, 42, 0.10) !important;
        color: var(--text-primary, #0f172a) !important;
    }

    .search-container,
    .search-form,
    .quick-search-form {
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    .search-form,
    .quick-search-form,
    .top-bar .search-container form {
        min-height: 44px !important;
        border-radius: 17px !important;
        background: var(--surface, #fff) !important;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08) !important;
    }

    .top-bar input[type="search"],
    .top-bar .search-input {
        min-height: 44px !important;
        font-size: 0.95rem !important;
    }

    .user-profile {
        min-height: 44px !important;
        max-width: 104px !important;
        padding: 0 10px !important;
        border-radius: 17px !important;
        background: var(--surface, #fff) !important;
        border: 1px solid var(--border-color, #d8e2ee) !important;
        box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08) !important;
    }

    .user-profile span {
        max-width: 64px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .content-body {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding: 16px var(--mobile-app-gutter) calc(112px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
        overflow-x: clip !important;
    }

    .page-title-section {
        margin: 4px 0 14px !important;
        padding: 0 2px !important;
        gap: 8px !important;
    }

    .page-main-title,
    .page-title-section h1,
    .content-body > h1:first-child {
        font-size: clamp(1.58rem, 7.1vw, 2.02rem) !important;
        line-height: 1.14 !important;
        letter-spacing: 0 !important;
        overflow-wrap: anywhere !important;
    }

    .page-subtitle,
    .page-title-section p {
        font-size: 0.92rem !important;
        line-height: 1.55 !important;
        color: var(--text-secondary, #475569) !important;
    }

    .dashboard-section,
    .section-card,
    .content-card,
    .settings-card,
    .form-card,
    .panel,
    .stats-card,
    .library-stat-card,
    .quick-action-card,
    .playlist-card,
    .entity-card,
    .genre-card,
    .explore-card,
    .auto-playlist-card,
    .metadata-status-panel,
    .metadata-mobile-card {
        border-radius: var(--mobile-app-radius) !important;
        border: 1px solid color-mix(in srgb, var(--border-color, #d8e2ee) 82%, transparent) !important;
        background: var(--surface, var(--card-bg, #fff)) !important;
        box-shadow: var(--mobile-app-shadow) !important;
    }

    .dashboard-section,
    .section-card,
    .content-card,
    .settings-card,
    .form-card,
    .panel {
        padding: 16px !important;
    }

    .dashboard-grid,
    .stats-grid,
    .recent-grid,
    .songs-grid,
    .playlist-grid,
    .playlist-card-grid,
    .explore-card-grid,
    .genre-card-grid,
    .admin-card-grid,
    .settings-grid,
    .quick-actions-grid,
    .metadata-grid,
    .quality-grid,
    .recommend-grid,
    .auto-playlist-grid {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 12px !important;
    }

    .btn,
    button,
    input,
    select,
    textarea,
    .form-control {
        max-width: 100% !important;
    }

    .btn,
    button.btn {
        min-height: 42px !important;
        border-radius: 14px !important;
    }

    .table-container,
    .table-responsive,
    .table-wrapper,
    .song-table-wrapper,
    .admin-table-wrapper,
    .backup-table-wrapper,
    .metadata-table-container,
    .log-table-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: var(--mobile-app-radius) !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        box-shadow: var(--mobile-app-shadow) !important;
    }

    .player-bar {
        border-radius: 24px !important;
        border-color: color-mix(in srgb, var(--accent-color, #00c73c) 22%, var(--border-color, #d8e2ee)) !important;
        background: color-mix(in srgb, var(--surface, #fff) 92%, transparent) !important;
        box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22) !important;
        backdrop-filter: blur(18px) saturate(1.2) !important;
        -webkit-backdrop-filter: blur(18px) saturate(1.2) !important;
    }

    #btn-play-pause,
    .player-bar .play-btn {
        box-shadow: 0 12px 24px color-mix(in srgb, var(--accent-color, #00c73c) 28%, transparent) !important;
    }
}

@supports not (overflow: clip) {
    @media (max-width: 767px) {
        .app-container,
        .main-content,
        .content-body {
            overflow-x: hidden !important;
        }
    }
}

/* 56.9 song detail action buttons should not inherit mobile song-list card rules */
.song-detail-page .song-detail-art-card > .song-item {
    position: static !important;
    width: 100% !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
}

.song-detail-page .song-detail-art-card > .song-item .play-row-btn {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 44px !important;
    min-height: 44px !important;
    border-radius: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    white-space: nowrap !important;
}

.song-detail-page .song-detail-art-card > .song-item .like-btn,
.song-detail-page .song-detail-art-card > .song-item .add-playlist-btn {
    flex: 0 0 44px !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    border-radius: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}

@media (max-width: 420px) {
    .song-detail-page .song-detail-art-card > .song-item {
        gap: 8px !important;
    }

    .song-detail-page .song-detail-art-card > .song-item .play-row-btn {
        font-size: 0.9rem !important;
    }

    .song-detail-page .song-detail-art-card > .song-item .like-btn,
    .song-detail-page .song-detail-art-card > .song-item .add-playlist-btn {
        flex-basis: 42px !important;
        width: 42px !important;
        min-width: 42px !important;
        max-width: 42px !important;
        height: 42px !important;
        min-height: 42px !important;
    }
}

/* 19.2 touch filter drawer: mobile and tablet use the same compact filter entry. */
@media (max-width: 1199px) {
    .mobile-filter-shell {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 0 14px !important;
        display: block !important;
        box-sizing: border-box !important;
    }

    .mobile-filter-toggle {
        width: 100% !important;
        min-height: 48px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px !important;
        padding: 0 14px !important;
        border: 1px solid var(--border-color, rgba(148, 163, 184, 0.32)) !important;
        border-radius: 16px !important;
        background: var(--surface, var(--card-bg, #fff)) !important;
        color: var(--text-primary, #0f172a) !important;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08) !important;
        font-weight: 900 !important;
        cursor: pointer !important;
        box-sizing: border-box !important;
    }

    .mobile-filter-shell:not(.is-open) .mobile-filter-panel {
        display: none !important;
    }

    .mobile-filter-shell.is-open .mobile-filter-panel {
        display: grid !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-top: 10px !important;
        box-sizing: border-box !important;
    }

    .mobile-filter-shell.is-open .filter-sort-form,
    .mobile-filter-shell.is-open form.filter-sort-form {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
}

@media (max-width: 767px) {
    .mobile-filter-shell.is-open .filter-sort-form,
    .mobile-filter-shell.is-open form.filter-sort-form {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

/* Fullscreen player motion: expand upward from the mini player without rebuilding audio state. */
.expand-player-overlay {
    --expand-motion-duration: 260ms;
    --expand-motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.expand-player-overlay.is-expand-opening,
.expand-player-overlay.is-expand-closing {
    pointer-events: none !important;
    will-change: opacity;
    transition:
        opacity var(--expand-motion-duration) var(--expand-motion-ease),
        background var(--expand-motion-duration) ease !important;
}

.expand-player-overlay.is-expand-opening {
    opacity: 0;
}

.expand-player-overlay.is-expand-opening.is-expand-motion-active,
.expand-player-overlay.is-expand-open {
    opacity: 1;
}

.expand-player-overlay.is-expand-closing {
    opacity: 0;
}

.expand-player-overlay.is-expand-opening .expand-player-container,
.expand-player-overlay.is-expand-closing .expand-player-container {
    transform-origin: bottom center !important;
    will-change: transform, opacity;
    transition:
        transform var(--expand-motion-duration) var(--expand-motion-ease),
        opacity var(--expand-motion-duration) ease !important;
}

.expand-player-overlay.is-expand-opening .expand-player-container {
    opacity: 0;
    transform: translate3d(0, min(22vh, 180px), 0) scale(0.965) !important;
}

.expand-player-overlay.is-expand-opening.is-expand-motion-active .expand-player-container,
.expand-player-overlay.is-expand-open .expand-player-container {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1) !important;
}

.expand-player-overlay.is-expand-closing .expand-player-container {
    opacity: 0;
    transform: translate3d(0, min(24vh, 220px), 0) scale(0.97) !important;
}

@media (max-width: 767px) {
    .expand-player-overlay.is-expand-opening .expand-player-container {
        transform: translate3d(0, 74dvh, 0) scale(0.96) !important;
    }

    .expand-player-overlay.is-expand-closing .expand-player-container {
        transform: translate3d(0, 82dvh, 0) scale(0.965) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .expand-player-overlay.is-expand-opening,
    .expand-player-overlay.is-expand-closing,
    .expand-player-overlay.is-expand-opening .expand-player-container,
    .expand-player-overlay.is-expand-closing .expand-player-container {
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
}

/* Fullscreen album art swipe navigation. */
.expand-player-overlay .expand-album-art {
    touch-action: pan-y;
    user-select: none;
    -webkit-user-drag: none;
    transform-origin: center center;
    transition:
        transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 220ms ease !important;
}

.expand-player-overlay .expand-album-art.is-art-dragging {
    transition: none !important;
    cursor: grabbing;
    will-change: transform, opacity;
}

.expand-player-overlay .expand-album-art.is-art-swipe-out-left,
.expand-player-overlay .expand-album-art.is-art-swipe-out-right {
    will-change: transform, opacity;
    transition:
        transform 180ms cubic-bezier(0.32, 0, 0.67, 0),
        opacity 160ms ease !important;
}

.expand-player-overlay .expand-album-art.is-art-swipe-out-left {
    opacity: 0;
    transform: translate3d(-42%, 0, 0) rotate(-4deg) scale(0.965) !important;
}

.expand-player-overlay .expand-album-art.is-art-swipe-out-right {
    opacity: 0;
    transform: translate3d(42%, 0, 0) rotate(4deg) scale(0.965) !important;
}

.expand-player-overlay .expand-album-art.is-art-swipe-in-left,
.expand-player-overlay .expand-album-art.is-art-swipe-in-right {
    opacity: 0;
    transition: none !important;
    will-change: transform, opacity;
}

.expand-player-overlay .expand-album-art.is-art-swipe-in-left {
    transform: translate3d(-34%, 0, 0) rotate(-3deg) scale(0.975) !important;
}

.expand-player-overlay .expand-album-art.is-art-swipe-in-right {
    transform: translate3d(34%, 0, 0) rotate(3deg) scale(0.975) !important;
}

.expand-player-overlay .expand-album-art.is-art-swipe-settling {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1) !important;
    transition:
        transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
        opacity 220ms ease !important;
}

@media (prefers-reduced-motion: reduce) {
    .expand-player-overlay .expand-album-art.is-art-dragging,
    .expand-player-overlay .expand-album-art.is-art-swipe-out-left,
    .expand-player-overlay .expand-album-art.is-art-swipe-out-right,
    .expand-player-overlay .expand-album-art.is-art-swipe-in-left,
    .expand-player-overlay .expand-album-art.is-art-swipe-in-right,
    .expand-player-overlay .expand-album-art.is-art-swipe-settling {
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
}

.today-recommend-actions .today-recommend-play-btn,
body.is-tablet-layout .today-recommend-actions .today-recommend-play-btn {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 118px !important;
    max-width: none !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 16px !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    white-space: nowrap !important;
}

@media (max-width: 767px) {
    .today-recommend-actions .today-recommend-play-btn,
    body.is-tablet-layout .today-recommend-actions .today-recommend-play-btn {
        flex: 1 1 150px !important;
        min-width: 0 !important;
    }
}

/* 56.10 sidebar usability and state stability */
.sidebar-menu-filter {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) 32px;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    padding: 8px 8px 8px 12px;
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.32));
    border-radius: 12px;
    background: var(--card-bg, var(--surface, #fff));
    color: var(--text-secondary, #475569);
}

.sidebar-scroll > .sidebar-quick-actions {
    margin: 0 0 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid color-mix(in srgb, var(--border-color, rgba(148, 163, 184, 0.32)) 78%, transparent);
}

.sidebar-scroll > .nav-menu {
    display: grid;
    gap: 2px;
}

.sidebar .menu-group-toggle span,
.sidebar .sidebar-quick-actions span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-menu-filter input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary, var(--text-color, #111827));
    font-size: 13px;
}

.sidebar-menu-filter button {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border: 0;
    border-radius: 9px;
    background: color-mix(in srgb, var(--accent-color, #00c73c) 12%, transparent);
    color: var(--accent-color, #00a832);
    cursor: pointer;
}

.sidebar-menu-filter button[hidden],
.sidebar-menu-empty[hidden] {
    display: none !important;
}

.sidebar-menu-empty {
    margin: 4px 8px 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--text-secondary, #475569) 8%, transparent);
    color: var(--text-secondary, #475569);
    font-size: 0.86rem;
    text-align: center;
}

.sidebar.is-menu-filtering .menu-group-toggle {
    pointer-events: none;
}

.sidebar.is-menu-filtering .menu-group-items,
.sidebar.is-menu-filtering .sidebar-single-menu {
    display: grid !important;
}

.sidebar.is-menu-filtering .sidebar-quick-actions {
    display: grid !important;
}

body.sidebar-collapsed .sidebar-menu-filter,
body.sidebar-collapsed .sidebar-menu-empty {
    display: none !important;
}

body.is-tablet-layout .sidebar .nav-item,
body.is-tablet-layout .sidebar .menu-group-toggle,
body.is-tablet-layout .sidebar .sidebar-quick-actions a {
    min-height: 44px !important;
    border-radius: 14px !important;
}

body.is-tablet-layout .sidebar .nav-item.active,
body.is-tablet-layout .sidebar .nav-item[aria-current="page"] {
    box-shadow: inset 3px 0 0 var(--accent-color, #00c73c);
}

body.is-mobile-layout.sidebar-compact .sidebar.open .brand-name,
body.is-mobile-layout.sidebar-compact .sidebar.open .sidebar-search-form,
body.is-mobile-layout.sidebar-compact .sidebar.open .sidebar-menu-filter,
body.is-mobile-layout.sidebar-compact .sidebar.open .menu-group-toggle span,
body.is-mobile-layout.sidebar-compact .sidebar.open .nav-label,
body.is-mobile-layout.sidebar-compact .sidebar.open .sidebar-footer,
body.is-mobile-layout.sidebar-compact .sidebar.open .sidebar-quick-actions span,
body.is-tablet-portrait.sidebar-compact .sidebar.open .brand-name,
body.is-tablet-portrait.sidebar-compact .sidebar.open .sidebar-search-form,
body.is-tablet-portrait.sidebar-compact .sidebar.open .sidebar-menu-filter,
body.is-tablet-portrait.sidebar-compact .sidebar.open .menu-group-toggle span,
body.is-tablet-portrait.sidebar-compact .sidebar.open .nav-label,
body.is-tablet-portrait.sidebar-compact .sidebar.open .sidebar-footer,
body.is-tablet-portrait.sidebar-compact .sidebar.open .sidebar-quick-actions span {
    display: initial !important;
}

body.is-mobile-layout.sidebar-compact .sidebar.open .sidebar-search-form,
body.is-mobile-layout.sidebar-compact .sidebar.open .sidebar-menu-filter,
body.is-tablet-portrait.sidebar-compact .sidebar.open .sidebar-search-form,
body.is-tablet-portrait.sidebar-compact .sidebar.open .sidebar-menu-filter {
    display: grid !important;
}

body.is-mobile-layout.sidebar-compact .sidebar.open .nav-item,
body.is-tablet-portrait.sidebar-compact .sidebar.open .nav-item {
    justify-content: flex-start !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
}

body.is-mobile-layout.sidebar-compact .sidebar.open .menu-group-toggle,
body.is-tablet-portrait.sidebar-compact .sidebar.open .menu-group-toggle {
    justify-content: space-between !important;
}

/* 56.35 sidebar premium navigation polish */
.sidebar {
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--surface, #fff) 96%, transparent), color-mix(in srgb, var(--bg-primary, #f8fafc) 96%, transparent)),
        var(--bg-secondary, #fff) !important;
}

.sidebar-scroll {
    padding-bottom: calc(var(--player-height, 92px) + var(--safe-bottom, env(safe-area-inset-bottom, 0px)) + 36px) !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

.sidebar-scroll::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
}

.sidebar-utility-panel {
    margin: 0 0 14px !important;
    padding: 10px !important;
    border: 1px solid color-mix(in srgb, var(--border-color, rgba(148, 163, 184, 0.32)) 82%, transparent) !important;
    border-radius: 16px !important;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--accent-color, #00c73c) 8%, transparent), transparent 64%),
        color-mix(in srgb, var(--surface, #fff) 96%, transparent) !important;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06) !important;
}

.sidebar-panel-label {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin: 0 2px 8px !important;
    color: var(--text-muted, #64748b) !important;
    font-size: 0.72rem !important;
    font-weight: 900 !important;
    letter-spacing: 0 !important;
}

.sidebar-panel-label::after {
    content: "";
    width: 28px;
    height: 3px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent-color, #00c73c) 36%, transparent);
}

.sidebar-scroll > .sidebar-quick-actions,
.sidebar-utility-panel .sidebar-quick-actions {
    margin: 0 !important;
    padding: 0 !important;
    border-bottom: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
}

.sidebar-utility-panel .sidebar-quick-actions a {
    min-height: 38px !important;
    border-radius: 12px !important;
    background: color-mix(in srgb, var(--surface, #fff) 94%, transparent) !important;
    border-color: color-mix(in srgb, var(--border-color, rgba(148, 163, 184, 0.32)) 86%, transparent) !important;
    box-shadow: none !important;
}

.sidebar-utility-panel .sidebar-quick-actions a:hover,
.sidebar-utility-panel .sidebar-quick-actions a:focus-visible {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--accent-color, #00c73c) 42%, var(--border-color, #d8e2ee)) !important;
    background: color-mix(in srgb, var(--accent-color, #00c73c) 10%, var(--surface, #fff)) !important;
    outline: none;
}

.sidebar .nav-menu {
    gap: 6px !important;
}

.sidebar-single-menu,
.menu-group-items {
    gap: 4px !important;
}

.menu-group {
    margin-top: 10px !important;
    padding-top: 10px !important;
    border-top: 1px solid color-mix(in srgb, var(--border-color, rgba(148, 163, 184, 0.32)) 62%, transparent) !important;
}

.menu-group:first-of-type {
    border-top: 0 !important;
}

.menu-group-toggle {
    min-height: 34px !important;
    padding: 6px 10px !important;
    border-radius: 12px !important;
    color: var(--text-muted, #64748b) !important;
}

.menu-group-toggle:hover,
.menu-group.has-active .menu-group-toggle {
    background: color-mix(in srgb, var(--accent-color, #00c73c) 7%, transparent) !important;
    color: var(--text-primary, #0f172a) !important;
}

.sidebar .nav-item {
    position: relative !important;
    min-height: 42px !important;
    padding: 10px 12px !important;
    border-radius: 14px !important;
    margin-bottom: 0 !important;
    color: var(--text-secondary, #475569) !important;
}

.sidebar .nav-item::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 999px;
    background: transparent;
    transition: background 160ms ease, top 160ms ease, bottom 160ms ease;
}

.sidebar .nav-item:hover {
    background: color-mix(in srgb, var(--text-primary, #0f172a) 5%, transparent) !important;
    color: var(--text-primary, #0f172a) !important;
}

.sidebar .nav-item.active,
.sidebar .nav-item[aria-current="page"],
body.is-tablet-layout .sidebar .nav-item.active,
body.is-tablet-layout .sidebar .nav-item[aria-current="page"] {
    background: color-mix(in srgb, var(--accent-color, #00c73c) 13%, transparent) !important;
    color: var(--text-primary, #0f172a) !important;
    box-shadow: none !important;
    font-weight: 900 !important;
}

.sidebar .nav-item.active::before,
.sidebar .nav-item[aria-current="page"]::before {
    top: 8px;
    bottom: 8px;
    background: var(--accent-color, #00c73c);
}

.sidebar .nav-item.active .nav-icon,
.sidebar .nav-item[aria-current="page"] .nav-icon {
    color: var(--accent-color, #00c73c) !important;
}

body.sidebar-collapsed .sidebar-utility-panel {
    padding: 8px 6px !important;
    background: transparent !important;
    box-shadow: none !important;
    border-color: transparent !important;
}

body.sidebar-collapsed .sidebar-panel-label,
body.sidebar-collapsed .sidebar-search-form,
body.sidebar-collapsed .sidebar-menu-filter,
body.sidebar-collapsed .sidebar-menu-empty {
    display: none !important;
}

body.sidebar-collapsed .sidebar-utility-panel .sidebar-quick-actions {
    grid-template-columns: 1fr !important;
}

body.sidebar-collapsed .sidebar-utility-panel .sidebar-quick-actions span {
    display: none !important;
}

body.sidebar-collapsed .sidebar .nav-item {
    justify-content: center !important;
    padding: 12px !important;
}

body.sidebar-collapsed .sidebar .nav-item::before {
    left: 50%;
    right: auto;
    top: auto;
    bottom: 5px;
    width: 18px;
    height: 3px;
    transform: translateX(-50%);
}

body.sidebar-collapsed .menu-group {
    padding-top: 8px !important;
}

body.sidebar-collapsed .menu-group-toggle {
    justify-content: center !important;
}

@media (max-width: 1199px) {
    .sidebar-utility-panel {
        border-radius: 18px !important;
    }

    .sidebar .nav-item {
        min-height: 46px !important;
    }
}

@media (max-width: 767px), (min-width: 768px) and (max-width: 1199px) and (orientation: portrait) {
    .sidebar-scroll {
        padding-bottom: calc(var(--mobile-player-height, var(--player-height, 92px)) + var(--safe-bottom, env(safe-area-inset-bottom, 0px)) + 52px) !important;
    }
}

/* 56.12 synced lyrics reader */
.expand-lyrics-full-text.is-synced-lyrics {
    padding-left: clamp(14px, 2vw, 22px) !important;
    padding-right: clamp(14px, 2vw, 22px) !important;
}

.synced-lyrics-list {
    display: grid;
    gap: 8px;
    padding: 18px 0 42px;
}

.synced-lyrics-line {
    width: 100%;
    min-height: 40px;
    padding: 10px 14px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--player-muted, var(--text-secondary, #64748b));
    font: inherit;
    font-size: 0.98rem;
    line-height: 1.65;
    text-align: center;
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: anywhere;
    cursor: pointer;
    opacity: 0.72;
    transition: color 0.18s ease, opacity 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.synced-lyrics-line:hover,
.synced-lyrics-line:focus-visible {
    opacity: 1;
    color: var(--text-primary, #0f172a);
    background: color-mix(in srgb, var(--accent-color, #00c73c) 8%, transparent);
    outline: 2px solid color-mix(in srgb, var(--accent-color, #00c73c) 36%, transparent);
    outline-offset: 2px;
}

.synced-lyrics-line.is-active {
    opacity: 1;
    color: var(--accent-color, #00c73c);
    font-weight: 900;
    transform: scale(1.035);
    background: color-mix(in srgb, var(--accent-color, #00c73c) 12%, transparent);
    box-shadow: inset 3px 0 0 var(--accent-color, #00c73c);
}

body.theme-dark .synced-lyrics-line,
body:not(.theme-light) .synced-lyrics-line {
    color: rgba(226, 232, 240, 0.66);
}

body.theme-dark .synced-lyrics-line:hover,
body:not(.theme-light) .synced-lyrics-line:hover,
body.theme-dark .synced-lyrics-line:focus-visible,
body:not(.theme-light) .synced-lyrics-line:focus-visible {
    color: #f8fafc;
}

/* 56.15 fullscreen queue/lyrics panel collapse */
.expand-tab-collapse-btn {
    flex: 0 0 auto !important;
    min-width: 92px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    position: relative !important;
    z-index: 5 !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

.expand-tab-collapse-btn i {
    font-size: 0.78rem;
}

@media (max-width: 767px) {
    .expand-player-container.is-tab-collapsed {
        grid-template-rows: auto auto minmax(0, auto) !important;
    }

    .expand-player-container.is-tab-collapsed .expand-player-main {
        grid-template-rows: auto auto !important;
        overflow: visible !important;
        min-height: 0 !important;
    }

    .expand-player-container.is-tab-collapsed .expand-tab-section {
        height: auto !important;
        min-height: 0 !important;
        border-radius: 20px !important;
    }

    .expand-player-container.is-tab-collapsed .expand-tab-headers {
        border-bottom: 0 !important;
    }

    .expand-player-container.is-tab-collapsed .expand-tab-content,
    .expand-player-container.is-tab-collapsed #expand-tab-queue-content,
    .expand-player-container.is-tab-collapsed #expand-tab-lyrics-content {
        display: none !important;
    }

    .expand-player-container.is-tab-collapsed .expand-player-controls {
        margin-top: 10px !important;
        padding-bottom: calc(4px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
    }

    .expand-player-container.is-tab-collapsed .expand-tab-collapse-btn {
        min-width: 82px !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        background: color-mix(in srgb, var(--accent-color, #00c73c) 14%, #ffffff) !important;
        color: #063f1c !important;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1) !important;
    }

    body.theme-dark .expand-player-container.is-tab-collapsed .expand-tab-collapse-btn,
    body:not(.theme-light) .expand-player-container.is-tab-collapsed .expand-tab-collapse-btn {
        background: color-mix(in srgb, var(--accent-color, #00c73c) 18%, rgba(15, 23, 42, 0.92)) !important;
        color: #d7ffe3 !important;
    }
}

/* 56.14 mobile fullscreen swipe-down to mini player */
@media (max-width: 767px) {
    .expand-player-overlay {
        --swipe-progress: 0;
    }

    .expand-player-overlay.is-swipe-active {
        background:
            linear-gradient(
                145deg,
                rgba(248, 250, 252, calc(0.96 - (var(--swipe-progress) * 0.18))),
                rgba(238, 244, 249, calc(0.92 - (var(--swipe-progress) * 0.16)))
            ) !important;
    }

    .expand-player-container {
        touch-action: pan-y !important;
        transform-origin: top center !important;
        transition:
            transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
            opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1) !important;
        will-change: transform;
    }

    .expand-player-container::after {
        content: "";
        position: absolute;
        top: 10px;
        left: 50%;
        z-index: 9;
        width: 46px;
        height: 5px;
        border-radius: 999px;
        transform: translateX(-50%);
        background: color-mix(in srgb, var(--text-secondary, #64748b) 36%, transparent);
        box-shadow: 0 1px 8px rgba(15, 23, 42, 0.12);
        pointer-events: none;
    }

    .expand-player-container.is-swipe-dragging {
        transition: none !important;
    }

    .expand-player-container.is-swipe-closing {
        pointer-events: none !important;
        transition:
            transform 0.22s cubic-bezier(0.32, 0, 0.67, 0),
            opacity 0.2s linear !important;
    }

    .expand-tab-content,
    .expand-lyrics-full-text,
    #expand-queue-list {
        overscroll-behavior-y: contain;
    }
}

/* 56.13 mobile fullscreen queue reader */
@media (max-width: 767px) {
    .expand-player-container.is-queue-view {
        display: grid !important;
        grid-template-rows: auto minmax(0, 1fr) auto !important;
        height: calc(100dvh - var(--safe-top, 0px) - var(--safe-bottom, 0px) - 20px) !important;
        min-height: 0 !important;
        padding: 14px !important;
        overflow: hidden !important;
    }

    .expand-player-container.is-queue-view .expand-close {
        position: absolute !important;
        top: 12px !important;
        right: 12px !important;
        z-index: 8 !important;
    }

    .expand-player-container.is-queue-view .expand-player-main {
        display: grid !important;
        grid-template-rows: auto minmax(0, 1fr) !important;
        gap: 12px !important;
        margin-top: 36px !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .expand-player-container.is-queue-view .expand-art-section {
        display: grid !important;
        grid-template-columns: 64px minmax(0, 1fr) !important;
        align-items: center !important;
        gap: 12px !important;
        padding: 4px 44px 8px 2px !important;
        text-align: left !important;
    }

    .expand-player-container.is-queue-view .expand-album-art {
        width: 64px !important;
        min-width: 64px !important;
        border-radius: 16px !important;
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18) !important;
    }

    .expand-player-container.is-queue-view .expand-song-meta {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .expand-player-container.is-queue-view .expand-song-meta h2 {
        display: -webkit-box !important;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden !important;
        margin: 0 0 4px !important;
        font-size: 1.08rem !important;
        line-height: 1.22 !important;
    }

    .expand-player-container.is-queue-view .expand-song-meta p,
    .expand-player-container.is-queue-view .mini-lyrics-line {
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        margin: 0 !important;
        font-size: 0.86rem !important;
        line-height: 1.35 !important;
    }

    .expand-player-container.is-queue-view .expand-tab-section {
        min-height: 0 !important;
        height: 100% !important;
        border-radius: 22px !important;
        overflow: hidden !important;
    }

    .expand-player-container.is-queue-view .expand-tab-headers {
        position: sticky !important;
        top: 0 !important;
        z-index: 3 !important;
        min-height: 50px !important;
        padding: 6px !important;
    }

    .expand-player-container.is-queue-view .tab-header-btn {
        min-height: 38px !important;
        padding: 8px 10px !important;
        font-size: 0.88rem !important;
    }

    .expand-player-container.is-queue-view #expand-tab-queue-content {
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important;
        height: 100% !important;
        padding: 10px !important;
        overflow: hidden !important;
    }

    .expand-player-container.is-queue-view #expand-queue-list {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding: 4px 2px 24px !important;
    }

    .expand-player-container.is-queue-view #expand-queue-list .queue-item {
        display: grid !important;
        grid-template-columns: 58px minmax(0, 1fr) auto auto !important;
        grid-template-areas:
            "thumb meta duration remove"
            "thumb meta order remove";
        gap: 8px 12px !important;
        align-items: center !important;
        min-height: 84px !important;
        margin-bottom: 10px !important;
        padding: 12px !important;
        border-radius: 22px !important;
    }

    .expand-player-container.is-queue-view #expand-queue-list .queue-item-thumb {
        grid-area: thumb;
        width: 58px !important;
        height: 58px !important;
        border-radius: 16px !important;
    }

    .expand-player-container.is-queue-view #expand-queue-list .queue-item-meta {
        grid-area: meta;
        min-width: 0 !important;
    }

    .expand-player-container.is-queue-view #expand-queue-list .queue-item-title {
        display: -webkit-box !important;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden !important;
        font-size: 0.98rem !important;
        line-height: 1.34 !important;
    }

    .expand-player-container.is-queue-view #expand-queue-list .queue-item-artist {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        min-width: 0 !important;
        margin-top: 5px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .expand-player-container.is-queue-view #expand-queue-list .queue-item-position {
        flex: 0 0 auto !important;
        padding: 4px 8px !important;
        font-size: 0.72rem !important;
    }

    .expand-player-container.is-queue-view #expand-queue-list .queue-item-duration {
        grid-area: duration;
        justify-self: end !important;
        align-self: start !important;
        font-size: 0.78rem !important;
        font-weight: 800 !important;
    }

    .expand-player-container.is-queue-view #expand-queue-list .queue-item-order {
        grid-area: order;
        display: inline-flex !important;
        justify-self: end !important;
        gap: 6px !important;
    }

    .expand-player-container.is-queue-view #expand-queue-list .queue-item-move,
    .expand-player-container.is-queue-view #expand-queue-list .queue-item-remove {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        border-radius: 12px !important;
    }

    .expand-player-container.is-queue-view #expand-queue-list .queue-item-remove {
        position: static !important;
        grid-area: remove;
        justify-self: end !important;
        align-self: center !important;
        transform: none !important;
        margin-left: 0 !important;
    }

    .expand-player-container.is-queue-view #expand-queue-list .queue-item.is-playing,
    .expand-player-container.is-queue-view #expand-queue-list .queue-item.active {
        transform: none !important;
        box-shadow:
            0 18px 36px color-mix(in srgb, var(--accent-color, #00c73c) 18%, rgba(15, 23, 42, 0.1)),
            inset 5px 0 0 var(--accent-color, #00c73c) !important;
    }

    .expand-player-container.is-queue-view .queue-now-playing-badge {
        display: flex !important;
        width: fit-content !important;
        margin: 6px 0 0 !important;
    }

    .expand-player-container.is-queue-view .expand-player-controls {
        margin-top: 10px !important;
        padding: 0 !important;
    }

    .expand-player-container.is-queue-view .expand-player-controls .progress-container {
        margin-bottom: 10px !important;
    }

    .expand-player-container.is-queue-view .expand-control-buttons-row {
        margin-bottom: 8px !important;
    }
}

/* 56.11 mobile fullscreen lyrics reader */
@media (max-width: 767px) {
    .expand-player-overlay.is-lyrics-view {
        padding:
            max(10px, var(--safe-top, env(safe-area-inset-top, 0px)))
            10px
            max(10px, var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
    }

    .expand-player-container.is-lyrics-view {
        display: grid !important;
        grid-template-rows: auto minmax(0, 1fr) auto !important;
        height: calc(100dvh - var(--safe-top, 0px) - var(--safe-bottom, 0px) - 20px) !important;
        min-height: 0 !important;
        padding: 14px !important;
        overflow: hidden !important;
    }

    .expand-player-container.is-lyrics-view .expand-close {
        position: absolute !important;
        top: 12px !important;
        right: 12px !important;
        z-index: 8 !important;
    }

    .expand-player-container.is-lyrics-view .expand-player-main {
        display: grid !important;
        grid-template-rows: auto minmax(0, 1fr) !important;
        gap: 12px !important;
        margin-top: 36px !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .expand-player-container.is-lyrics-view .expand-art-section {
        display: grid !important;
        grid-template-columns: 64px minmax(0, 1fr) !important;
        align-items: center !important;
        gap: 12px !important;
        padding: 4px 44px 8px 2px !important;
        text-align: left !important;
    }

    .expand-player-container.is-lyrics-view .expand-album-art {
        width: 64px !important;
        min-width: 64px !important;
        border-radius: 16px !important;
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18) !important;
    }

    .expand-player-container.is-lyrics-view .expand-song-meta {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .expand-player-container.is-lyrics-view .expand-song-meta h2 {
        display: -webkit-box !important;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden !important;
        margin: 0 0 4px !important;
        font-size: 1.08rem !important;
        line-height: 1.22 !important;
    }

    .expand-player-container.is-lyrics-view .expand-song-meta p,
    .expand-player-container.is-lyrics-view .mini-lyrics-line {
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        margin: 0 !important;
        font-size: 0.86rem !important;
        line-height: 1.35 !important;
    }

    .expand-player-container.is-lyrics-view .mini-lyrics-line {
        display: none !important;
    }

    .expand-player-container.is-lyrics-view .expand-tab-section {
        min-height: 0 !important;
        height: 100% !important;
        border-radius: 22px !important;
        overflow: hidden !important;
    }

    .expand-player-container.is-lyrics-view .expand-tab-headers {
        position: sticky !important;
        top: 0 !important;
        z-index: 3 !important;
        min-height: 50px !important;
        padding: 6px !important;
    }

    .expand-player-container.is-lyrics-view .tab-header-btn {
        min-height: 38px !important;
        padding: 8px 10px !important;
        font-size: 0.88rem !important;
    }

    .expand-player-container.is-lyrics-view #expand-tab-lyrics-content {
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important;
        height: 100% !important;
        padding: 10px !important;
        overflow: hidden !important;
    }

    .expand-player-container.is-lyrics-view #expand-btn-lyrics-toggle {
        align-self: flex-start !important;
        min-height: 36px !important;
        margin: 0 0 10px !important;
    }

    .expand-player-container.is-lyrics-view .expand-lyrics-full-text {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        padding: 18px 16px 26px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        border-radius: 18px !important;
        background: rgba(255, 255, 255, 0.58) !important;
        font-size: 1rem !important;
        line-height: 1.82 !important;
        text-align: left !important;
        white-space: pre-line !important;
        word-break: keep-all !important;
        overflow-wrap: anywhere !important;
    }

    body.theme-dark .expand-player-container.is-lyrics-view .expand-lyrics-full-text,
    body:not(.theme-light) .expand-player-container.is-lyrics-view .expand-lyrics-full-text {
        background: rgba(15, 23, 42, 0.42) !important;
    }

    .expand-player-container.is-lyrics-view .expand-lyrics-full-text .queue-empty-text {
        margin: 32px auto 12px !important;
        max-width: 260px !important;
        line-height: 1.65 !important;
    }

    .expand-player-container.is-lyrics-view .expand-lyrics-full-text .lyrics-edit-inline-link {
        display: flex !important;
        width: fit-content !important;
        margin: 10px auto 0 !important;
    }

    .expand-player-container.is-lyrics-view .synced-lyrics-list {
        gap: 10px !important;
        padding: 30px 0 54px !important;
    }

    .expand-player-container.is-lyrics-view .synced-lyrics-line {
        min-height: 46px !important;
        padding: 12px 10px !important;
        font-size: 1.04rem !important;
        line-height: 1.72 !important;
    }

    .expand-player-container.is-lyrics-view .synced-lyrics-line.is-active {
        transform: scale(1.045);
    }

    .expand-player-container.is-lyrics-view .expand-player-controls {
        margin-top: 10px !important;
        padding: 0 !important;
    }

    .expand-player-container.is-lyrics-view .expand-player-controls .progress-container {
        margin-bottom: 10px !important;
    }

    .expand-player-container.is-lyrics-view .expand-control-buttons-row {
        margin-bottom: 8px !important;
    }

    .expand-player-container.is-lyrics-view .expand-secondary-actions {
        display: flex !important;
        gap: 8px !important;
        overflow-x: auto !important;
        padding-bottom: 2px !important;
        scrollbar-width: none;
    }

    .expand-player-container.is-lyrics-view .expand-secondary-actions::-webkit-scrollbar {
        display: none;
    }
}

/* 56.16 final mobile player panel sizing: keep controls reachable */
@media (max-width: 767px) {
    .expand-player-container.is-queue-view,
    .expand-player-container.is-lyrics-view {
        display: grid !important;
        grid-template-rows: minmax(0, 1fr) auto !important;
        height: calc(100dvh - var(--safe-top, 0px) - var(--safe-bottom, 0px) - 20px) !important;
        max-height: calc(100dvh - var(--safe-top, 0px) - var(--safe-bottom, 0px) - 20px) !important;
        overflow: hidden !important;
    }

    .expand-player-container.is-queue-view .expand-player-main,
    .expand-player-container.is-lyrics-view .expand-player-main {
        min-height: 0 !important;
        height: 100% !important;
        overflow: hidden !important;
    }

    .expand-player-container.is-queue-view .expand-tab-section,
    .expand-player-container.is-lyrics-view .expand-tab-section {
        min-height: 0 !important;
        height: 100% !important;
        max-height: none !important;
    }

    .expand-player-container.is-queue-view #expand-tab-queue-content,
    .expand-player-container.is-lyrics-view #expand-tab-lyrics-content {
        min-height: 0 !important;
        height: 100% !important;
        overflow: hidden !important;
    }

    .expand-player-container.is-queue-view .expand-player-controls,
    .expand-player-container.is-lyrics-view .expand-player-controls {
        position: relative !important;
        z-index: 4 !important;
        flex: 0 0 auto !important;
        margin-top: 8px !important;
        padding: 0 0 calc(2px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
        background: transparent !important;
    }

    .expand-player-container.is-queue-view .expand-player-controls .progress-container,
    .expand-player-container.is-lyrics-view .expand-player-controls .progress-container {
        margin-bottom: 8px !important;
    }

    .expand-player-container.is-queue-view .expand-control-buttons-row,
    .expand-player-container.is-lyrics-view .expand-control-buttons-row {
        margin-bottom: 6px !important;
    }

    .expand-player-container.is-queue-view .expand-secondary-actions,
    .expand-player-container.is-lyrics-view .expand-secondary-actions {
        max-height: 40px !important;
    }

    .expand-player-container.is-tab-collapsed .expand-tab-content,
    .expand-player-container.is-tab-collapsed #expand-tab-queue-content,
    .expand-player-container.is-tab-collapsed #expand-tab-lyrics-content {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    .expand-player-container.is-tab-collapsed .expand-player-main {
        grid-template-rows: auto auto !important;
        height: auto !important;
        overflow: visible !important;
    }

    .expand-player-container.is-tab-collapsed .expand-tab-section {
        height: auto !important;
        min-height: 0 !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view,
    .expand-player-container.is-tab-collapsed.is-lyrics-view {
        grid-template-rows: minmax(0, 1fr) auto !important;
        padding: 18px 16px calc(14px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-player-main,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-player-main {
        display: grid !important;
        grid-template-rows: minmax(0, 1fr) auto !important;
        gap: 14px !important;
        height: 100% !important;
        min-height: 0 !important;
        margin-top: 34px !important;
        overflow: hidden !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-art-section,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-art-section {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 14px !important;
        min-height: 0 !important;
        padding: 8px 6px !important;
        text-align: center !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-album-art,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-album-art {
        width: min(72vw, 320px) !important;
        min-width: 0 !important;
        height: auto !important;
        aspect-ratio: 1 / 1 !important;
        border-radius: 26px !important;
        box-shadow:
            0 28px 64px rgba(15, 23, 42, 0.22),
            0 8px 18px rgba(15, 23, 42, 0.1) !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-song-meta,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-song-meta {
        width: min(100%, 420px) !important;
        max-width: min(100%, 420px) !important;
        min-width: 0 !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-song-meta h2,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-song-meta h2 {
        display: -webkit-box !important;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden !important;
        margin: 0 0 8px !important;
        font-size: clamp(1.45rem, 8vw, 2.15rem) !important;
        line-height: 1.12 !important;
        text-align: center !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-song-meta p,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-song-meta p {
        margin: 0 !important;
        font-size: 0.98rem !important;
        line-height: 1.45 !important;
        text-align: center !important;
        white-space: normal !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .mini-lyrics-line,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .mini-lyrics-line {
        display: block !important;
        margin-top: 8px !important;
        white-space: normal !important;
        opacity: 0.8;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-tab-section,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-tab-section {
        align-self: end !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        border-radius: 18px !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-tab-headers,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-tab-headers {
        min-height: 46px !important;
        padding: 5px !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .tab-header-btn,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .tab-header-btn {
        min-height: 36px !important;
        font-size: 0.84rem !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-player-controls,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-player-controls {
        margin-top: 12px !important;
        padding: 0 !important;
    }

    /* 56.17 collapsed now-playing polish: separate tab strip from controls */
    .expand-player-container.is-tab-collapsed.is-queue-view,
    .expand-player-container.is-tab-collapsed.is-lyrics-view {
        padding:
            18px
            16px
            calc(18px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-player-main,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-player-main {
        grid-template-rows: minmax(0, 1fr) auto !important;
        gap: 18px !important;
        margin-top: 30px !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-art-section,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-art-section {
        justify-content: center !important;
        gap: 12px !important;
        padding: 6px 4px 2px !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-album-art,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-album-art {
        width: min(62vw, 270px) !important;
        border-radius: 24px !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-song-meta h2,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-song-meta h2 {
        font-size: clamp(1.34rem, 6.8vw, 1.92rem) !important;
        line-height: 1.14 !important;
        margin-bottom: 7px !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-song-meta p,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-song-meta p {
        font-size: 0.92rem !important;
        line-height: 1.34 !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .mini-lyrics-line,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .mini-lyrics-line {
        display: none !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-tab-section,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-tab-section {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        border-radius: 18px !important;
        box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08) !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-tab-headers,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-tab-headers {
        min-height: 44px !important;
        padding: 5px !important;
        gap: 5px !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .tab-header-btn,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .tab-header-btn {
        min-height: 34px !important;
        border-radius: 13px !important;
        font-size: 0.8rem !important;
        padding: 7px 8px !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-player-controls,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-player-controls {
        margin-top: 16px !important;
        padding: 0 !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-player-controls .progress-container,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-player-controls .progress-container {
        margin-bottom: 16px !important;
        padding: 0 4px !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-control-buttons-row,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-control-buttons-row {
        margin-bottom: 14px !important;
    }
}

@media (max-width: 380px) {
    .expand-player-container.is-tab-collapsed.is-queue-view .expand-album-art,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-album-art {
        width: min(58vw, 232px) !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-song-meta h2,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-song-meta h2 {
        font-size: clamp(1.18rem, 6.2vw, 1.62rem) !important;
    }
}

/* 56.18 fullscreen player responsive premium polish */
.expand-player-overlay {
    align-items: center !important;
    justify-content: center !important;
}

.expand-player-container {
    display: grid !important;
    grid-template-rows: minmax(0, 1fr) auto !important;
    gap: clamp(16px, 2vw, 24px) !important;
}

.expand-player-main {
    min-height: 0 !important;
}

.expand-art-section,
.expand-tab-section,
.expand-player-controls {
    min-width: 0 !important;
}

.expand-song-meta h2,
.expand-song-meta p,
.mini-lyrics-line {
    max-width: 100% !important;
}

.expand-player-controls {
    width: min(760px, 100%) !important;
    margin-inline: auto !important;
}

.expand-player-controls .progress-container {
    gap: 10px !important;
}

.expand-player-controls .progress-bar-wrapper {
    min-height: 14px !important;
    position: relative !important;
    touch-action: none !important;
    cursor: pointer !important;
}

.expand-player-controls .progress-bar-wrapper::before {
    content: "";
    position: absolute;
    inset: -10px 0;
}

.expand-secondary-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 10px !important;
}

.expand-secondary-actions .btn {
    min-height: 42px !important;
    border-radius: 999px !important;
}

@media (min-width: 768px) and (max-width: 1199px) {
    .expand-player-overlay {
        padding:
            max(18px, var(--safe-top, env(safe-area-inset-top, 0px)))
            18px
            max(18px, var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
    }

    .expand-player-container {
        width: min(940px, calc(100vw - 36px)) !important;
        height: min(760px, calc(100dvh - var(--safe-top, 0px) - var(--safe-bottom, 0px) - 36px)) !important;
        padding: clamp(20px, 2.6vw, 30px) !important;
        border-radius: 30px !important;
    }

    .expand-player-main {
        grid-template-columns: minmax(260px, 0.9fr) minmax(330px, 1.1fr) !important;
        gap: clamp(20px, 3vw, 34px) !important;
        margin-top: 12px !important;
    }

    .expand-art-section {
        padding: 12px !important;
        gap: 18px !important;
    }

    .expand-album-art {
        width: min(36vw, 330px) !important;
        border-radius: 26px !important;
    }

    .expand-song-meta h2 {
        font-size: clamp(1.55rem, 3.2vw, 2.25rem) !important;
        line-height: 1.14 !important;
        min-height: calc(1.14em * 2) !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden !important;
    }

    .expand-tab-section {
        display: grid !important;
        grid-template-rows: auto minmax(0, 1fr) !important;
    }

    .expand-tab-content {
        min-height: 0 !important;
        overflow: hidden !important;
    }

    #expand-queue-list,
    .expand-lyrics-full-text {
        max-height: none !important;
        height: 100% !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .expand-player-controls {
        width: min(720px, 100%) !important;
    }

    .expand-player-container .control-btn:not(.play-btn) {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
    }

    .expand-player-container .control-btn.play-btn {
        width: 70px !important;
        height: 70px !important;
        min-width: 70px !important;
        min-height: 70px !important;
    }
}

@media (min-width: 768px) and (max-width: 1023px) and (orientation: portrait) {
    .expand-player-container {
        width: min(720px, calc(100vw - 32px)) !important;
        height: calc(100dvh - var(--safe-top, 0px) - var(--safe-bottom, 0px) - 32px) !important;
    }

    .expand-player-main {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto minmax(0, 1fr) !important;
        gap: 18px !important;
    }

    .expand-art-section {
        display: grid !important;
        grid-template-columns: 180px minmax(0, 1fr) !important;
        align-items: center !important;
        text-align: left !important;
        justify-content: start !important;
        padding: 8px 48px 4px 4px !important;
    }

    .expand-album-art {
        width: 180px !important;
        min-width: 180px !important;
        border-radius: 24px !important;
    }

    .expand-song-meta {
        max-width: 100% !important;
    }

    .expand-song-meta h2 {
        font-size: clamp(1.55rem, 4.5vw, 2.15rem) !important;
        min-height: calc(1.14em * 2) !important;
        -webkit-line-clamp: 2;
    }

    .expand-tab-section {
        min-height: 0 !important;
    }
}

@media (max-width: 767px) {
    .expand-player-overlay {
        padding:
            max(8px, var(--safe-top, env(safe-area-inset-top, 0px)))
            8px
            max(8px, var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
        align-items: stretch !important;
    }

    .expand-player-container {
        width: 100% !important;
        height: calc(100dvh - var(--safe-top, 0px) - var(--safe-bottom, 0px) - 16px) !important;
        max-height: calc(100dvh - var(--safe-top, 0px) - var(--safe-bottom, 0px) - 16px) !important;
        padding: 16px 14px calc(14px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
        border-radius: 30px !important;
        gap: 12px !important;
        overflow: hidden !important;
    }

    .expand-close {
        top: 12px !important;
        right: 12px !important;
        width: 46px !important;
        height: 46px !important;
        z-index: 12 !important;
    }

    .expand-player-main {
        display: grid !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: minmax(0, 1fr) auto !important;
        gap: 12px !important;
        height: 100% !important;
        margin-top: 28px !important;
        overflow: hidden !important;
    }

    .expand-art-section {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 12px !important;
        min-height: 0 !important;
        padding: 4px 8px !important;
        text-align: center !important;
    }

    .expand-album-art {
        width: min(68vw, 310px) !important;
        min-width: 0 !important;
        border-radius: 26px !important;
        box-shadow:
            0 26px 58px rgba(15, 23, 42, 0.24),
            0 8px 18px rgba(15, 23, 42, 0.12) !important;
    }

    .expand-song-meta {
        width: min(100%, 420px) !important;
        max-width: min(100%, 420px) !important;
        min-width: 0 !important;
    }

    .expand-song-meta h2 {
        display: -webkit-box !important;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden !important;
        font-size: clamp(1.42rem, 7.2vw, 2rem) !important;
        line-height: 1.14 !important;
        min-height: calc(1.14em * 2) !important;
        margin: 0 0 7px !important;
        text-align: center !important;
    }

    .expand-song-meta p {
        margin: 0 !important;
        font-size: 0.94rem !important;
        line-height: 1.38 !important;
        text-align: center !important;
    }

    .mini-lyrics-line {
        display: none !important;
    }

    .expand-tab-section {
        align-self: end !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        border-radius: 20px !important;
    }

    .expand-tab-headers {
        min-height: 48px !important;
        padding: 6px !important;
        gap: 6px !important;
        position: relative !important;
        z-index: 6 !important;
    }

    .tab-header-btn {
        min-height: 36px !important;
        padding: 7px 10px !important;
        border-radius: 14px !important;
        font-size: 0.84rem !important;
    }

    .expand-tab-collapse-btn {
        flex: 0 0 40px !important;
        width: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        padding: 0 !important;
        border-radius: 14px !important;
    }

    .expand-tab-collapse-btn span {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        overflow: hidden !important;
        clip: rect(0 0 0 0) !important;
        white-space: nowrap !important;
    }

    .expand-player-controls {
        width: 100% !important;
        margin-top: 10px !important;
        padding: 0 !important;
    }

    .expand-player-controls .progress-container {
        grid-template-columns: 44px minmax(0, 1fr) 44px !important;
        gap: 8px !important;
        margin-bottom: 14px !important;
    }

    .expand-player-controls .progress-bar-wrapper {
        height: 16px !important;
        min-height: 16px !important;
        border-radius: 999px !important;
    }

    .expand-control-buttons-row {
        gap: clamp(10px, 3vw, 16px) !important;
        margin-bottom: 12px !important;
    }

    .expand-player-container .control-btn:not(.play-btn) {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
    }

    .expand-player-container .control-btn.play-btn {
        width: 68px !important;
        height: 68px !important;
        min-width: 68px !important;
        min-height: 68px !important;
    }

    .expand-secondary-actions {
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        overflow-x: auto !important;
        padding: 0 2px 2px !important;
        scrollbar-width: none;
    }

    .expand-secondary-actions::-webkit-scrollbar {
        display: none;
    }

    .expand-secondary-actions .btn {
        flex: 0 0 auto !important;
        min-height: 42px !important;
        padding: 9px 14px !important;
    }
}

@media (max-width: 767px) and (max-height: 720px) {
    .expand-player-container {
        padding-top: 12px !important;
        border-radius: 26px !important;
    }

    .expand-player-main {
        margin-top: 24px !important;
        gap: 10px !important;
    }

    .expand-album-art {
        width: min(54vw, 230px) !important;
        border-radius: 22px !important;
    }

    .expand-song-meta h2 {
        font-size: clamp(1.2rem, 6vw, 1.58rem) !important;
        -webkit-line-clamp: 2;
    }

    .expand-player-container .control-btn:not(.play-btn) {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
    }

    .expand-player-container .control-btn.play-btn {
        width: 60px !important;
        height: 60px !important;
        min-width: 60px !important;
        min-height: 60px !important;
    }
}

@media (max-width: 360px) {
    .expand-album-art {
        width: min(52vw, 210px) !important;
    }

    .expand-control-buttons-row {
        gap: 8px !important;
    }
}

/* 56.19 mobile fullscreen visual balance */
@media (max-width: 767px) {
    .expand-player-container.is-tab-collapsed.is-queue-view,
    .expand-player-container.is-tab-collapsed.is-lyrics-view {
        grid-template-rows: auto auto !important;
        align-content: center !important;
        justify-content: stretch !important;
        gap: 14px !important;
        padding:
            54px
            14px
            calc(14px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-player-main,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-player-main {
        grid-template-rows: auto auto !important;
        align-content: center !important;
        align-self: auto !important;
        height: auto !important;
        gap: 14px !important;
        margin-top: 0 !important;
        overflow: visible !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-art-section,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-art-section {
        justify-content: center !important;
        gap: 10px !important;
        padding: 0 4px !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-album-art,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-album-art {
        width: min(58vw, 252px) !important;
        border-radius: 24px !important;
        box-shadow:
            0 22px 48px rgba(15, 23, 42, 0.22),
            0 7px 16px rgba(15, 23, 42, 0.1) !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-song-meta h2,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-song-meta h2 {
        font-size: clamp(1.28rem, 6.4vw, 1.78rem) !important;
        line-height: 1.14 !important;
        min-height: auto !important;
        margin-bottom: 6px !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-song-meta p,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-song-meta p {
        font-size: 0.9rem !important;
        line-height: 1.28 !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-tab-section,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-tab-section {
        margin-top: 2px !important;
        border-radius: 20px !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-tab-headers,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-tab-headers {
        min-height: 48px !important;
        padding: 5px !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-player-controls,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-player-controls {
        margin-top: 0 !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-player-controls .progress-container,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-player-controls .progress-container {
        margin-bottom: 12px !important;
        padding: 0 !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-control-buttons-row,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-control-buttons-row {
        margin-bottom: 12px !important;
    }
}

@media (max-width: 767px) and (min-height: 780px) {
    .expand-player-container.is-tab-collapsed.is-queue-view .expand-album-art,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-album-art {
        width: min(60vw, 268px) !important;
    }
}

@media (max-width: 767px) and (max-height: 700px) {
    .expand-player-container.is-tab-collapsed.is-queue-view .expand-player-main,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-player-main {
        margin-top: 0 !important;
        gap: 10px !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-album-art,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-album-art {
        width: min(50vw, 214px) !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-song-meta h2,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-song-meta h2 {
        font-size: clamp(1.14rem, 5.8vw, 1.5rem) !important;
    }
}

/* 56.20 fullscreen collapsed panel alignment for mobile/tablet */
@media (max-width: 1199px) {
    .expand-player-overlay.is-tab-collapsed {
        align-items: center !important;
        justify-content: center !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view,
    .expand-player-container.is-tab-collapsed.is-lyrics-view,
    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-queue-view,
    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-lyrics-view {
        display: grid !important;
        grid-template-rows: auto auto !important;
        align-content: center !important;
        justify-content: stretch !important;
        gap: 16px !important;
        overflow: hidden !important;
    }

    .expand-player-container.is-tab-collapsed .expand-tab-content,
    .expand-player-container.is-tab-collapsed #expand-tab-queue-content,
    .expand-player-container.is-tab-collapsed #expand-tab-lyrics-content,
    body.is-tablet-layout .expand-player-container.is-tab-collapsed .expand-tab-content,
    body.is-tablet-layout .expand-player-container.is-tab-collapsed #expand-tab-queue-content,
    body.is-tablet-layout .expand-player-container.is-tab-collapsed #expand-tab-lyrics-content {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        max-height: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-player-main,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-player-main,
    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-queue-view .expand-player-main,
    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-player-main {
        display: grid !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto !important;
        align-content: center !important;
        align-self: auto !important;
        gap: 16px !important;
        height: auto !important;
        min-height: 0 !important;
        margin-top: 0 !important;
        overflow: visible !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-art-section,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-art-section,
    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-queue-view .expand-art-section,
    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-art-section {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
        gap: 12px !important;
        padding: 0 6px !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-song-meta,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-song-meta,
    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-queue-view .expand-song-meta,
    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-song-meta {
        width: min(100%, 520px) !important;
        max-width: min(100%, 520px) !important;
        margin: 0 auto !important;
        text-align: center !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-song-meta h2,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-song-meta h2,
    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-queue-view .expand-song-meta h2,
    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-song-meta h2 {
        text-align: center !important;
        min-height: auto !important;
        margin: 0 0 7px !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-song-meta p,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-song-meta p,
    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-queue-view .expand-song-meta p,
    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-song-meta p {
        text-align: center !important;
        white-space: normal !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-tab-section,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-tab-section,
    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-queue-view .expand-tab-section,
    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-tab-section {
        width: min(100%, 520px) !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin: 0 auto !important;
        align-self: center !important;
        overflow: visible !important;
    }

    .expand-player-container.is-tab-collapsed .expand-tab-collapse-btn,
    body.is-tablet-layout .expand-player-container.is-tab-collapsed .expand-tab-collapse-btn {
        min-width: 92px !important;
        min-height: 40px !important;
        pointer-events: auto !important;
        touch-action: manipulation !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-player-controls,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-player-controls,
    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-queue-view .expand-player-controls,
    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-player-controls {
        margin-top: 0 !important;
        padding-bottom: calc(2px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-queue-view,
    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-lyrics-view {
        width: min(680px, calc(100vw - 40px)) !important;
        max-height: calc(100dvh - 40px - var(--safe-top, env(safe-area-inset-top, 0px)) - var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
        padding:
            52px
            24px
            calc(22px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
        row-gap: 18px !important;
    }

    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-queue-view .expand-album-art,
    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-album-art {
        width: clamp(220px, 30vw, 310px) !important;
        height: clamp(220px, 30vw, 310px) !important;
    }

    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-queue-view .expand-player-main,
    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-player-main {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 14px !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-queue-view .expand-art-section,
    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-art-section {
        gap: 10px !important;
    }

    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-queue-view .expand-song-meta h2,
    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-song-meta h2 {
        font-size: clamp(1.5rem, 3vw, 2rem) !important;
        line-height: 1.12 !important;
        margin-bottom: 5px !important;
    }

    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-queue-view .expand-tab-section,
    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-tab-section {
        position: relative !important;
        z-index: 1 !important;
        width: min(100%, 500px) !important;
        flex: 0 0 auto !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-queue-view .expand-player-controls,
    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-player-controls {
        position: relative !important;
        z-index: 2 !important;
        width: min(100%, 560px) !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-queue-view .expand-player-controls .progress-container,
    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-player-controls .progress-container {
        margin-top: 0 !important;
        margin-bottom: 16px !important;
    }
}

@media (min-width: 900px) and (max-width: 1199px) and (orientation: landscape) {
    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-queue-view,
    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-lyrics-view {
        width: min(640px, calc(100vw - 48px)) !important;
        row-gap: 16px !important;
    }

    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-queue-view .expand-album-art,
    body.is-tablet-layout .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-album-art {
        width: clamp(210px, 25vw, 300px) !important;
        height: clamp(210px, 25vw, 300px) !important;
    }
}

/* 56.21 iPad/tablet collapsed fullscreen separation fallback */
@media (min-width: 768px) and (max-width: 1366px) {
    .expand-player-container.is-tab-collapsed.is-queue-view,
    .expand-player-container.is-tab-collapsed.is-lyrics-view {
        width: min(660px, calc(100vw - 48px)) !important;
        max-height: calc(100dvh - 48px - var(--safe-top, env(safe-area-inset-top, 0px)) - var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
        grid-template-rows: minmax(0, auto) auto !important;
        align-content: center !important;
        row-gap: 28px !important;
        padding:
            52px
            26px
            calc(26px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-player-main,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-player-main {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 16px !important;
        height: auto !important;
        min-height: 0 !important;
        margin-top: 0 !important;
        overflow: hidden !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-art-section,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-art-section {
        flex: 0 1 auto !important;
        gap: 10px !important;
        padding: 0 !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-album-art,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-album-art {
        width: clamp(210px, 28vw, 300px) !important;
        height: clamp(210px, 28vw, 300px) !important;
        max-height: 34dvh !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-song-meta h2,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-song-meta h2 {
        font-size: clamp(1.42rem, 3vw, 1.96rem) !important;
        line-height: 1.12 !important;
        margin-bottom: 5px !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-song-meta p,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-song-meta p {
        line-height: 1.3 !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-tab-section,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-tab-section {
        flex: 0 0 auto !important;
        width: min(100%, 500px) !important;
        margin: 2px auto 0 !important;
        transform: none !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-tab-headers,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-tab-headers {
        min-height: 46px !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-player-controls,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-player-controls {
        width: min(100%, 560px) !important;
        margin: 0 auto !important;
        padding-top: 0 !important;
        transform: none !important;
        position: relative !important;
        z-index: 20 !important;
        pointer-events: auto !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-player-controls .progress-container,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-player-controls .progress-container {
        margin-top: 0 !important;
        margin-bottom: 18px !important;
        position: relative !important;
        z-index: 21 !important;
        pointer-events: auto !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-control-buttons-row,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-control-buttons-row,
    .expand-player-container.is-tab-collapsed.is-queue-view .expand-secondary-actions,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-secondary-actions {
        position: relative !important;
        z-index: 22 !important;
        pointer-events: auto !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .control-btn,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .control-btn,
    .expand-player-container.is-tab-collapsed.is-queue-view .btn,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .btn {
        pointer-events: auto !important;
        touch-action: manipulation !important;
    }
}

@media (min-width: 768px) and (max-width: 1366px) and (orientation: landscape) {
    .expand-player-container.is-tab-collapsed.is-queue-view,
    .expand-player-container.is-tab-collapsed.is-lyrics-view {
        row-gap: 30px !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-album-art,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-album-art {
        width: clamp(200px, 22vw, 280px) !important;
        height: clamp(200px, 22vw, 280px) !important;
        max-height: 32dvh !important;
    }
}

/* 56.22 center expanded queue/lyrics player on mobile and tablet */
@media (max-width: 1199px) {
    .expand-player-overlay.is-queue-view,
    .expand-player-overlay.is-lyrics-view {
        align-items: center !important;
        justify-content: center !important;
    }

    .expand-player-container.is-queue-view,
    .expand-player-container.is-lyrics-view {
        width: min(100%, 560px) !important;
        margin-left: auto !important;
        margin-right: auto !important;
        justify-self: center !important;
    }

    .expand-player-container.is-queue-view .expand-player-main,
    .expand-player-container.is-lyrics-view .expand-player-main {
        width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .expand-player-container.is-queue-view .expand-art-section,
    .expand-player-container.is-lyrics-view .expand-art-section {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        width: min(100%, 420px) !important;
        margin: 0 auto !important;
        padding: 4px 52px 10px !important;
        gap: 10px !important;
        text-align: center !important;
    }

    .expand-player-container.is-queue-view .expand-album-art,
    .expand-player-container.is-lyrics-view .expand-album-art {
        width: clamp(84px, 24vw, 132px) !important;
        min-width: 0 !important;
        height: clamp(84px, 24vw, 132px) !important;
        margin: 0 auto !important;
        border-radius: 22px !important;
        object-fit: cover !important;
    }

    .expand-player-container.is-queue-view .expand-song-meta,
    .expand-player-container.is-lyrics-view .expand-song-meta {
        width: min(100%, 360px) !important;
        max-width: min(100%, 360px) !important;
        min-width: 0 !important;
        margin: 0 auto !important;
        text-align: center !important;
    }

    .expand-player-container.is-queue-view .expand-song-meta h2,
    .expand-player-container.is-lyrics-view .expand-song-meta h2,
    .expand-player-container.is-queue-view .expand-song-meta p,
    .expand-player-container.is-lyrics-view .expand-song-meta p,
    .expand-player-container.is-queue-view .mini-lyrics-line,
    .expand-player-container.is-lyrics-view .mini-lyrics-line {
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .expand-player-container.is-queue-view .expand-tab-section,
    .expand-player-container.is-lyrics-view .expand-tab-section,
    .expand-player-container.is-queue-view .expand-player-controls,
    .expand-player-container.is-lyrics-view .expand-player-controls {
        width: min(100%, 420px) !important;
        margin-left: auto !important;
        margin-right: auto !important;
        align-self: center !important;
    }

    .expand-player-container.is-queue-view .expand-tab-headers,
    .expand-player-container.is-lyrics-view .expand-tab-headers,
    .expand-player-container.is-queue-view .progress-container,
    .expand-player-container.is-lyrics-view .progress-container,
    .expand-player-container.is-queue-view .expand-control-buttons-row,
    .expand-player-container.is-lyrics-view .expand-control-buttons-row,
    .expand-player-container.is-queue-view .expand-secondary-actions,
    .expand-player-container.is-lyrics-view .expand-secondary-actions {
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .expand-player-container.is-queue-view .expand-tab-headers,
    .expand-player-container.is-lyrics-view .expand-tab-headers {
        display: grid !important;
        grid-template-columns: minmax(96px, 1fr) minmax(96px, 1fr) minmax(82px, 0.78fr) !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .expand-player-container.is-queue-view .tab-header-btn,
    .expand-player-container.is-lyrics-view .tab-header-btn,
    .expand-player-container.is-queue-view .expand-tab-collapse-btn,
    .expand-player-container.is-lyrics-view .expand-tab-collapse-btn {
        width: 100% !important;
        min-width: 0 !important;
        white-space: nowrap !important;
        word-break: keep-all !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .expand-player-container.is-queue-view .expand-tab-collapse-btn,
    .expand-player-container.is-lyrics-view .expand-tab-collapse-btn {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

@media (max-width: 480px) {
    .expand-player-container.is-queue-view .expand-art-section,
    .expand-player-container.is-lyrics-view .expand-art-section {
        width: min(100%, 380px) !important;
        padding-left: 44px !important;
        padding-right: 44px !important;
    }

    .expand-player-container.is-queue-view .expand-tab-section,
    .expand-player-container.is-lyrics-view .expand-tab-section,
    .expand-player-container.is-queue-view .expand-player-controls,
    .expand-player-container.is-lyrics-view .expand-player-controls {
        width: min(100%, 390px) !important;
    }

    .expand-player-container.is-queue-view .expand-tab-headers,
    .expand-player-container.is-lyrics-view .expand-tab-headers {
        grid-template-columns: minmax(82px, 1fr) minmax(82px, 1fr) minmax(66px, 0.72fr) !important;
        gap: 6px !important;
    }

    .expand-player-container.is-queue-view .tab-header-btn,
    .expand-player-container.is-lyrics-view .tab-header-btn,
    .expand-player-container.is-queue-view .expand-tab-collapse-btn,
    .expand-player-container.is-lyrics-view .expand-tab-collapse-btn {
        padding-left: 8px !important;
        padding-right: 8px !important;
        font-size: 0.88rem !important;
    }
}

/* 56.23 hard center expanded player content group */
@media (max-width: 1199px) {
    .expand-player-container.is-queue-view,
    .expand-player-container.is-lyrics-view {
        justify-items: center !important;
        text-align: center !important;
    }

    .expand-player-container.is-queue-view .expand-player-main,
    .expand-player-container.is-lyrics-view .expand-player-main {
        width: 100% !important;
        max-width: 100% !important;
        justify-self: center !important;
        justify-items: center !important;
        align-items: center !important;
    }

    .expand-player-container.is-queue-view .expand-art-section,
    .expand-player-container.is-lyrics-view .expand-art-section,
    .expand-player-container.is-queue-view .expand-tab-section,
    .expand-player-container.is-lyrics-view .expand-tab-section,
    .expand-player-container.is-queue-view .expand-player-controls,
    .expand-player-container.is-lyrics-view .expand-player-controls {
        box-sizing: border-box !important;
        justify-self: center !important;
        align-self: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
    }

    .expand-player-container.is-queue-view .expand-art-section,
    .expand-player-container.is-lyrics-view .expand-art-section {
        width: min(calc(100% - 56px), 520px) !important;
        max-width: 520px !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .expand-player-container.is-queue-view .expand-tab-section,
    .expand-player-container.is-lyrics-view .expand-tab-section,
    .expand-player-container.is-queue-view .expand-player-controls,
    .expand-player-container.is-lyrics-view .expand-player-controls {
        width: min(calc(100% - 56px), 520px) !important;
        max-width: 520px !important;
    }

    .expand-player-container.is-queue-view .expand-tab-headers,
    .expand-player-container.is-lyrics-view .expand-tab-headers,
    .expand-player-container.is-queue-view .progress-container,
    .expand-player-container.is-lyrics-view .progress-container,
    .expand-player-container.is-queue-view .expand-control-buttons-row,
    .expand-player-container.is-lyrics-view .expand-control-buttons-row,
    .expand-player-container.is-queue-view .expand-secondary-actions,
    .expand-player-container.is-lyrics-view .expand-secondary-actions {
        width: 100% !important;
        max-width: 100% !important;
        justify-content: center !important;
    }
}

@media (max-width: 480px) {
    .expand-player-container.is-queue-view .expand-art-section,
    .expand-player-container.is-lyrics-view .expand-art-section,
    .expand-player-container.is-queue-view .expand-tab-section,
    .expand-player-container.is-lyrics-view .expand-tab-section,
    .expand-player-container.is-queue-view .expand-player-controls,
    .expand-player-container.is-lyrics-view .expand-player-controls {
        width: min(calc(100% - 28px), 420px) !important;
        max-width: 420px !important;
    }
}

/* 56.24 center the no-lyrics empty state without changing real lyric text layout */
@media (max-width: 1199px) {
    .expand-player-container.is-lyrics-view #expand-btn-lyrics-toggle.no-lyrics {
        align-self: center !important;
        margin: 0 auto 10px !important;
        justify-content: center !important;
    }

    .expand-player-container.is-lyrics-view .expand-lyrics-full-text.is-lyrics-empty {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 22px 18px 28px !important;
    }

    .expand-player-container.is-lyrics-view .expand-lyrics-full-text.is-lyrics-empty .queue-empty-text {
        width: min(100%, 280px) !important;
        max-width: 280px !important;
        margin: 0 auto 16px !important;
        text-align: center !important;
    }

    .expand-player-container.is-lyrics-view .expand-lyrics-full-text.is-lyrics-empty .lyrics-edit-inline-link {
        align-self: center !important;
        justify-content: center !important;
        margin: 0 auto !important;
    }
}

/* 56.25 keep queue/lyrics panels physically centered in fullscreen player */
@media (max-width: 1199px) {
    .expand-player-container.is-queue-view .expand-player-main,
    .expand-player-container.is-lyrics-view .expand-player-main {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .expand-player-container.is-queue-view .expand-art-section,
    .expand-player-container.is-lyrics-view .expand-art-section,
    .expand-player-container.is-queue-view .expand-tab-section,
    .expand-player-container.is-lyrics-view .expand-tab-section {
        flex: 0 0 auto !important;
        width: min(calc(100vw - 56px), 520px) !important;
        max-width: min(calc(100vw - 56px), 520px) !important;
        min-width: 0 !important;
        margin-left: auto !important;
        margin-right: auto !important;
        align-self: center !important;
        justify-self: center !important;
    }

    .expand-player-container.is-queue-view .expand-tab-section,
    .expand-player-container.is-lyrics-view .expand-tab-section {
        flex: 1 1 auto !important;
        min-height: 0 !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-tab-section,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-tab-section {
        flex: 0 0 auto !important;
        min-height: 0 !important;
        height: auto !important;
    }

    .expand-player-container.is-queue-view .expand-player-controls,
    .expand-player-container.is-lyrics-view .expand-player-controls {
        width: min(calc(100vw - 56px), 520px) !important;
        max-width: min(calc(100vw - 56px), 520px) !important;
        margin-left: auto !important;
        margin-right: auto !important;
        align-self: center !important;
        justify-self: center !important;
    }

    .expand-player-container.is-queue-view .expand-tab-content,
    .expand-player-container.is-lyrics-view .expand-tab-content,
    .expand-player-container.is-queue-view #expand-tab-queue-content,
    .expand-player-container.is-lyrics-view #expand-tab-lyrics-content {
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 480px) {
    .expand-player-container.is-queue-view .expand-art-section,
    .expand-player-container.is-lyrics-view .expand-art-section,
    .expand-player-container.is-queue-view .expand-tab-section,
    .expand-player-container.is-lyrics-view .expand-tab-section,
    .expand-player-container.is-queue-view .expand-player-controls,
    .expand-player-container.is-lyrics-view .expand-player-controls {
        width: min(calc(100vw - 40px), 420px) !important;
        max-width: min(calc(100vw - 40px), 420px) !important;
    }
}

/* 56.26 tablet/web stability polish */
body.is-tablet-layout,
body.is-desktop-layout {
    overflow-x: hidden;
}

body.is-tablet-layout .app-container,
body.is-tablet-layout .main-content,
body.is-tablet-layout .content-body,
body.is-desktop-layout .app-container,
body.is-desktop-layout .main-content,
body.is-desktop-layout .content-body {
    min-width: 0 !important;
}

body.is-tablet-layout .main-content,
body.is-desktop-layout .main-content {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: clip;
}

body.is-tablet-layout .content-body {
    width: min(100%, 1120px) !important;
    max-width: 1120px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: clamp(18px, 3.2vw, 34px) !important;
    padding-right: clamp(18px, 3.2vw, 34px) !important;
    overflow-x: clip;
}

body.is-desktop-layout .content-body {
    width: min(100%, 1480px) !important;
    max-width: 1480px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    overflow-x: clip;
}

body.is-tablet-layout .content-body > *,
body.is-desktop-layout .content-body > *,
body.is-tablet-layout .card,
body.is-tablet-layout .panel,
body.is-tablet-layout .section-card,
body.is-tablet-layout .song-list-container,
body.is-tablet-layout .table-responsive,
body.is-desktop-layout .song-list-container,
body.is-desktop-layout .table-responsive {
    max-width: 100%;
    min-width: 0;
}

body.is-tablet-layout .top-bar {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: clamp(10px, 2vw, 16px) !important;
    min-height: 72px !important;
    padding-left: clamp(18px, 3vw, 30px) !important;
    padding-right: clamp(18px, 3vw, 30px) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 900 !important;
}

body.is-standalone.is-tablet-layout .top-bar {
    min-height: calc(72px + var(--safe-top, env(safe-area-inset-top, 0px))) !important;
    padding-top: max(12px, var(--safe-top, env(safe-area-inset-top, 0px))) !important;
}

body.is-tablet-layout .search-container,
body.is-tablet-layout .search-form,
body.is-tablet-layout .quick-search-form {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
}

body.is-tablet-layout .search-form input,
body.is-tablet-layout .quick-search-form input {
    width: 100% !important;
    min-width: 0 !important;
    text-overflow: ellipsis;
}

body.is-tablet-layout .user-profile {
    flex: 0 0 auto !important;
    max-width: min(180px, 24vw) !important;
    white-space: nowrap !important;
}

body.is-tablet-layout .user-profile span {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

body.is-tablet-layout .song-title-link,
body.is-tablet-layout .compact-title,
body.is-tablet-layout .album-title,
body.is-tablet-layout .artist-name,
body.is-tablet-layout .playlist-title,
body.is-tablet-layout .song-detail-page h1,
body.is-desktop-layout .song-title-link,
body.is-desktop-layout .compact-title,
body.is-desktop-layout .album-title,
body.is-desktop-layout .artist-name,
body.is-desktop-layout .playlist-title {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: keep-all;
}

body.is-tablet-layout .data-table,
body.is-tablet-layout .song-table,
body.is-desktop-layout .data-table,
body.is-desktop-layout .song-table {
    max-width: 100%;
}

body.is-tablet-layout .table-responsive,
body.is-tablet-layout .song-list-container {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}

@media (pointer: coarse) and (min-width: 1200px) and (max-width: 1366px) {
    .expand-player-overlay.is-queue-view,
    .expand-player-overlay.is-lyrics-view {
        align-items: center !important;
        justify-content: center !important;
        padding:
            max(18px, var(--safe-top, env(safe-area-inset-top, 0px)))
            20px
            max(18px, var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
    }

    .expand-player-container.is-queue-view,
    .expand-player-container.is-lyrics-view {
        width: min(700px, calc(100vw - 56px)) !important;
        height: min(860px, calc(100dvh - var(--safe-top, 0px) - var(--safe-bottom, 0px) - 40px)) !important;
        max-width: min(700px, calc(100vw - 56px)) !important;
        margin-left: auto !important;
        margin-right: auto !important;
        display: grid !important;
        grid-template-rows: minmax(0, 1fr) auto !important;
        justify-items: center !important;
    }

    .expand-player-container.is-queue-view .expand-player-main,
    .expand-player-container.is-lyrics-view .expand-player-main {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .expand-player-container.is-queue-view .expand-art-section,
    .expand-player-container.is-lyrics-view .expand-art-section,
    .expand-player-container.is-queue-view .expand-tab-section,
    .expand-player-container.is-lyrics-view .expand-tab-section,
    .expand-player-container.is-queue-view .expand-player-controls,
    .expand-player-container.is-lyrics-view .expand-player-controls {
        width: min(100%, 560px) !important;
        max-width: 560px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        align-self: center !important;
        justify-self: center !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-tab-section,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-tab-section {
        height: auto !important;
        flex: 0 0 auto !important;
    }
}

/* 56.27 tablet queue/lyrics panel display fix */
@media (min-width: 768px) and (max-width: 1366px) {
    .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-tab-section,
    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-tab-section {
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .expand-player-container.is-queue-view:not(.is-tab-collapsed) #expand-tab-queue-content,
    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) #expand-tab-lyrics-content {
        display: flex !important;
        flex: 1 1 auto !important;
        flex-direction: column !important;
        min-height: 0 !important;
        height: 100% !important;
        overflow: hidden !important;
    }

    .expand-player-container.is-queue-view:not(.is-tab-collapsed) #expand-queue-list,
    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-lyrics-full-text {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .expand-player-container.is-tab-collapsed #expand-tab-queue-content,
    .expand-player-container.is-tab-collapsed #expand-tab-lyrics-content {
        display: none !important;
    }

    .expand-player-container.is-queue-view .expand-tab-headers,
    .expand-player-container.is-lyrics-view .expand-tab-headers {
        flex: 0 0 auto !important;
        width: 100% !important;
    }

    .expand-player-container.is-queue-view .expand-player-controls,
    .expand-player-container.is-lyrics-view .expand-player-controls {
        flex: 0 0 auto !important;
    }
}

/* 56.28 tablet landscape queue/lyrics panel layout */
@media (min-width: 768px) and (max-width: 1366px) and (orientation: landscape) {
    .expand-player-overlay.is-queue-view,
    .expand-player-overlay.is-lyrics-view {
        align-items: center !important;
        justify-content: center !important;
        overflow: hidden !important;
        padding:
            max(14px, var(--safe-top, env(safe-area-inset-top, 0px)))
            22px
            max(14px, var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
    }

    .expand-player-container.is-queue-view:not(.is-tab-collapsed),
    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) {
        display: grid !important;
        grid-template-rows: minmax(0, 1fr) auto !important;
        row-gap: 16px !important;
        width: min(1120px, calc(100vw - 48px)) !important;
        max-width: min(1120px, calc(100vw - 48px)) !important;
        height: min(720px, calc(100dvh - var(--safe-top, env(safe-area-inset-top, 0px)) - var(--safe-bottom, env(safe-area-inset-bottom, 0px)) - 36px)) !important;
        max-height: calc(100dvh - var(--safe-top, env(safe-area-inset-top, 0px)) - var(--safe-bottom, env(safe-area-inset-bottom, 0px)) - 36px) !important;
        margin: auto !important;
        padding: clamp(18px, 2.2vw, 28px) !important;
        overflow: hidden !important;
    }

    .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-player-main,
    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-player-main {
        display: grid !important;
        grid-template-columns: minmax(250px, 0.9fr) minmax(360px, 1.1fr) !important;
        grid-template-rows: minmax(0, 1fr) !important;
        align-items: stretch !important;
        justify-items: stretch !important;
        gap: clamp(18px, 3vw, 36px) !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
    }

    .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-art-section,
    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-art-section {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 8px !important;
        text-align: center !important;
    }

    .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-album-art,
    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-album-art {
        width: clamp(180px, 25vw, 310px) !important;
        height: clamp(180px, 25vw, 310px) !important;
        min-width: 0 !important;
        margin: 0 auto !important;
        object-fit: cover !important;
    }

    .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-song-meta,
    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-song-meta {
        width: min(100%, 420px) !important;
        max-width: min(100%, 420px) !important;
        min-width: 0 !important;
        margin: 0 auto !important;
        text-align: center !important;
    }

    .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-song-meta h2,
    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-song-meta h2 {
        font-size: clamp(1.35rem, 2.6vw, 2.15rem) !important;
        line-height: 1.12 !important;
        margin-bottom: 8px !important;
        text-align: center !important;
    }

    .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-song-meta p,
    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-song-meta p,
    .expand-player-container.is-queue-view:not(.is-tab-collapsed) .mini-lyrics-line,
    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .mini-lyrics-line {
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-tab-section,
    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-tab-section {
        display: flex !important;
        flex-direction: column !important;
        align-self: stretch !important;
        justify-self: stretch !important;
        width: 100% !important;
        max-width: none !important;
        height: 100% !important;
        min-height: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
    }

    .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-tab-headers,
    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-tab-headers {
        display: grid !important;
        grid-template-columns: minmax(96px, 1fr) minmax(96px, 1fr) minmax(86px, 0.82fr) !important;
        flex: 0 0 auto !important;
        width: 100% !important;
        min-height: 48px !important;
        gap: 8px !important;
    }

    .expand-player-container.is-queue-view:not(.is-tab-collapsed) .tab-header-btn,
    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .tab-header-btn,
    .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-tab-collapse-btn,
    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-tab-collapse-btn {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 38px !important;
        padding: 8px 10px !important;
        white-space: nowrap !important;
    }

    .expand-player-container.is-queue-view:not(.is-tab-collapsed) #expand-tab-queue-content,
    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) #expand-tab-lyrics-content {
        display: flex !important;
        flex: 1 1 auto !important;
        flex-direction: column !important;
        min-height: 0 !important;
        height: 100% !important;
        padding: 12px !important;
        overflow: hidden !important;
    }

    .expand-player-container.is-queue-view:not(.is-tab-collapsed) #expand-queue-list,
    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-lyrics-full-text {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-lyrics-full-text.is-lyrics-empty {
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
    }

    .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-player-controls,
    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-player-controls {
        align-self: center !important;
        justify-self: center !important;
        width: min(760px, 100%) !important;
        max-width: min(760px, 100%) !important;
        margin: 0 auto !important;
        padding: 0 !important;
        flex: 0 0 auto !important;
    }

    .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-player-controls .progress-container,
    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-player-controls .progress-container {
        margin-bottom: 14px !important;
    }

    .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-control-buttons-row,
    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-control-buttons-row {
        margin-bottom: 12px !important;
    }
}

/* 56.29 tablet landscape page layout stabilization */
@media (min-width: 768px) and (max-width: 1366px) and (orientation: landscape) {
    html,
    body {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    body.is-tablet-layout {
        --tablet-landscape-gutter: clamp(20px, 2.6vw, 34px);
        --tablet-landscape-max: 1180px;
    }

    body.is-tablet-layout .app-container,
    body.is-tablet-layout .main-content,
    body.is-tablet-layout .content-body {
        min-width: 0 !important;
        max-width: 100% !important;
        overflow-x: clip !important;
    }

    body.is-tablet-layout .main-content {
        width: 100% !important;
        padding-bottom: calc(118px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
    }

    body.is-tablet-layout .content-body {
        width: min(100%, var(--tablet-landscape-max)) !important;
        max-width: var(--tablet-landscape-max) !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: var(--tablet-landscape-gutter) !important;
        padding-right: var(--tablet-landscape-gutter) !important;
        padding-bottom: calc(124px + var(--safe-bottom, env(safe-area-inset-bottom, 0px))) !important;
    }

    body.is-tablet-layout .page-title-section,
    body.is-tablet-layout .section-heading-row,
    body.is-tablet-layout .settings-header,
    body.is-tablet-layout .admin-header,
    body.is-tablet-layout .stats-header,
    body.is-tablet-layout .playlist-hero,
    body.is-tablet-layout .playlist-detail-hero {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: flex-start !important;
        justify-content: space-between !important;
        gap: 12px 18px !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    body.is-tablet-layout .page-main-title,
    body.is-tablet-layout .page-title-section h1,
    body.is-tablet-layout .section-heading-row h1,
    body.is-tablet-layout .section-heading-row h2,
    body.is-tablet-layout .playlist-hero h1,
    body.is-tablet-layout .playlist-detail-hero h1 {
        max-width: 100% !important;
        font-size: clamp(1.55rem, 2.8vw, 2.15rem) !important;
        line-height: 1.16 !important;
        word-break: keep-all !important;
        overflow-wrap: anywhere !important;
    }

    body.is-tablet-layout .page-actions,
    body.is-tablet-layout .section-actions,
    body.is-tablet-layout .playlist-action-row,
    body.is-tablet-layout .playlist-toolbar,
    body.is-tablet-layout .metadata-bulk-actions,
    body.is-tablet-layout .backup-actions,
    body.is-tablet-layout .maintenance-actions,
    body.is-tablet-layout .button-group,
    body.is-tablet-layout .actions {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 8px !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    body.is-tablet-layout .list-filter-section,
    body.is-tablet-layout .advanced-filter-panel,
    body.is-tablet-layout .compact-filter-form,
    body.is-tablet-layout .filter-sort-form,
    body.is-tablet-layout .advanced-filter-form,
    body.is-tablet-layout .log-filter-form,
    body.is-tablet-layout .playlist-filter-form {
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: clip !important;
    }

    body.is-tablet-layout .filter-sort-form,
    body.is-tablet-layout .advanced-filter-form,
    body.is-tablet-layout .log-filter-form,
    body.is-tablet-layout .playlist-filter-form {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 10px !important;
        align-items: end !important;
    }

    body.is-tablet-layout .advanced-filter-form .filter-grid,
    body.is-tablet-layout .filter-grid,
    body.is-tablet-layout .settings-grid,
    body.is-tablet-layout .form-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
        min-width: 0 !important;
    }

    body.is-tablet-layout .dashboard-grid,
    body.is-tablet-layout .stats-grid,
    body.is-tablet-layout .recent-grid,
    body.is-tablet-layout .songs-grid,
    body.is-tablet-layout .playlist-grid,
    body.is-tablet-layout .playlist-card-grid,
    body.is-tablet-layout .explore-card-grid,
    body.is-tablet-layout .genre-card-grid,
    body.is-tablet-layout .admin-card-grid,
    body.is-tablet-layout .backup-file-list,
    body.is-tablet-layout .metadata-card-list,
    body.is-tablet-layout .auto-playlist-grid,
    body.is-tablet-layout .smart-card-grid,
    body.is-tablet-layout .quality-grid,
    body.is-tablet-layout .recommend-grid,
    body.is-tablet-layout .home-section-grid,
    body.is-tablet-layout .daily-summary-grid,
    body.is-tablet-layout .folder-card-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 14px !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    body.is-tablet-layout .stats-card,
    body.is-tablet-layout .library-stat-card,
    body.is-tablet-layout .entity-card,
    body.is-tablet-layout .genre-card,
    body.is-tablet-layout .explore-card,
    body.is-tablet-layout .auto-playlist-card,
    body.is-tablet-layout .playlist-card,
    body.is-tablet-layout .quick-action-card,
    body.is-tablet-layout .backup-file-card,
    body.is-tablet-layout .metadata-mobile-card,
    body.is-tablet-layout .metadata-status-panel,
    body.is-tablet-layout .admin-card,
    body.is-tablet-layout .form-card,
    body.is-tablet-layout .section-card,
    body.is-tablet-layout .settings-card,
    body.is-tablet-layout .content-card,
    body.is-tablet-layout .panel,
    body.is-tablet-layout .home-section {
        max-width: 100% !important;
        min-width: 0 !important;
        border-radius: 14px !important;
    }

    body.is-tablet-layout .table-container,
    body.is-tablet-layout .table-responsive,
    body.is-tablet-layout .table-wrapper,
    body.is-tablet-layout .song-table-wrapper,
    body.is-tablet-layout .admin-table-wrapper,
    body.is-tablet-layout .backup-table-wrapper,
    body.is-tablet-layout .metadata-table-container,
    body.is-tablet-layout .log-table-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    body.is-tablet-layout .data-table,
    body.is-tablet-layout .song-list-table,
    body.is-tablet-layout .admin-table,
    body.is-tablet-layout .backup-table,
    body.is-tablet-layout .metadata-table,
    body.is-tablet-layout .log-table {
        width: 100% !important;
        max-width: none !important;
    }

    body.is-tablet-layout .song-title-link,
    body.is-tablet-layout .compact-title,
    body.is-tablet-layout .album-title,
    body.is-tablet-layout .artist-name,
    body.is-tablet-layout .playlist-title,
    body.is-tablet-layout .card-title,
    body.is-tablet-layout .item-title {
        max-width: 100% !important;
        min-width: 0 !important;
        word-break: keep-all !important;
        overflow-wrap: anywhere !important;
    }

    body.is-tablet-layout input,
    body.is-tablet-layout select,
    body.is-tablet-layout textarea,
    body.is-tablet-layout button,
    body.is-tablet-layout .btn,
    body.is-tablet-layout .form-control {
        max-width: 100% !important;
        min-width: 0;
    }

    body.is-tablet-layout img,
    body.is-tablet-layout svg,
    body.is-tablet-layout video,
    body.is-tablet-layout canvas {
        max-width: 100%;
    }
}

@media (min-width: 768px) and (max-width: 980px) and (orientation: landscape) {
    body.is-tablet-layout .filter-sort-form,
    body.is-tablet-layout .advanced-filter-form,
    body.is-tablet-layout .log-filter-form,
    body.is-tablet-layout .playlist-filter-form,
    body.is-tablet-layout .advanced-filter-form .filter-grid,
    body.is-tablet-layout .filter-grid,
    body.is-tablet-layout .settings-grid,
    body.is-tablet-layout .form-grid,
    body.is-tablet-layout .dashboard-grid,
    body.is-tablet-layout .stats-grid,
    body.is-tablet-layout .recent-grid,
    body.is-tablet-layout .songs-grid,
    body.is-tablet-layout .playlist-grid,
    body.is-tablet-layout .playlist-card-grid,
    body.is-tablet-layout .explore-card-grid,
    body.is-tablet-layout .genre-card-grid,
    body.is-tablet-layout .admin-card-grid,
    body.is-tablet-layout .backup-file-list,
    body.is-tablet-layout .metadata-card-list,
    body.is-tablet-layout .auto-playlist-grid,
    body.is-tablet-layout .smart-card-grid,
    body.is-tablet-layout .quality-grid,
    body.is-tablet-layout .recommend-grid,
    body.is-tablet-layout .home-section-grid,
    body.is-tablet-layout .daily-summary-grid,
    body.is-tablet-layout .folder-card-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

/* 56.30 tablet landscape music list compact cards */
@media (min-width: 768px) and (max-width: 1366px) and (orientation: landscape) {
    body.is-tablet-layout .music-list-page {
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: clip !important;
    }

    body.is-tablet-layout .music-list-page .list-filter-section {
        display: grid !important;
        grid-template-columns: minmax(0, auto) minmax(0, 1fr) !important;
        gap: 12px !important;
        align-items: center !important;
        padding: 12px !important;
        margin-bottom: 16px !important;
        max-width: 100% !important;
        overflow: visible !important;
    }

    body.is-tablet-layout .music-list-page .filter-left {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        min-width: 0 !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        padding-bottom: 0 !important;
        -webkit-overflow-scrolling: touch;
    }

    body.is-tablet-layout .music-list-page .filter-tab {
        flex: 0 0 auto !important;
        min-height: 38px !important;
        padding: 0 14px !important;
    }

    body.is-tablet-layout .music-list-page .filter-right {
        min-width: 0 !important;
        width: 100% !important;
    }

    body.is-tablet-layout .music-list-page .filter-sort-form {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 10px !important;
        width: 100% !important;
        min-width: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    body.is-tablet-layout .music-list-page .filter-sort-form select {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 40px !important;
    }

    body.is-tablet-layout .music-list-page .song-list-container,
    body.is-tablet-layout .song-list-container {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        overflow: visible !important;
    }

    body.is-tablet-layout .song-list-container .song-table,
    body.is-tablet-layout .song-list-container .song-table thead,
    body.is-tablet-layout .song-list-container .song-table tbody,
    body.is-tablet-layout .song-list-container .song-table tr,
    body.is-tablet-layout .song-list-container .song-table td {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        border: 0 !important;
        background: transparent !important;
    }

    body.is-tablet-layout .song-list-container .song-table thead {
        display: none !important;
    }

    body.is-tablet-layout .song-list-container .song-table {
        min-width: 0 !important;
        border: 0 !important;
    }

    body.is-tablet-layout .song-list-container .song-table tbody {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
        align-items: stretch !important;
    }

    body.is-tablet-layout .song-list-container .song-table tr.song-item {
        position: relative !important;
        display: grid !important;
        grid-template-columns: 42px 56px minmax(0, 1fr) auto !important;
        grid-template-rows: auto auto !important;
        grid-template-areas:
            "play cover title actions"
            "play cover meta actions" !important;
        align-items: center !important;
        gap: 6px 12px !important;
        min-height: 92px !important;
        height: auto !important;
        max-height: none !important;
        padding: 14px !important;
        margin: 0 !important;
        border: 1px solid color-mix(in srgb, var(--border-color, #d8e2ee) 86%, transparent) !important;
        border-radius: 18px !important;
        background: var(--card-bg, var(--surface, #ffffff)) !important;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07) !important;
        overflow: hidden !important;
    }

    body.is-tablet-layout .song-list-container .song-table tr.song-item.playing,
    body.is-tablet-layout .song-list-container .song-table tr.song-item.is-playing {
        border-color: color-mix(in srgb, var(--accent-color, #00c73c) 48%, var(--border-color, #d8e2ee)) !important;
        background: color-mix(in srgb, var(--accent-color, #00c73c) 8%, var(--card-bg, #ffffff)) !important;
    }

    body.is-tablet-layout .song-list-container .song-table tr.song-item td {
        padding: 0 !important;
        margin: 0 !important;
        align-self: center !important;
        white-space: normal !important;
    }

    body.is-tablet-layout .song-list-container .song-table tr.song-item td:has(.play-row-btn) {
        grid-area: play !important;
        justify-self: center !important;
        align-self: center !important;
    }

    body.is-tablet-layout .song-list-container .song-table tr.song-item .play-row-btn {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
        border-radius: 999px !important;
    }

    body.is-tablet-layout .song-list-container .song-table tr.song-item td.song-title-cell {
        display: contents !important;
    }

    body.is-tablet-layout .song-list-container .song-table tr.song-item .song-title-wrap {
        display: contents !important;
    }

    body.is-tablet-layout .song-list-container .song-table tr.song-item .list-cover {
        grid-area: cover !important;
        width: 56px !important;
        height: 56px !important;
        min-width: 56px !important;
        border-radius: 14px !important;
        object-fit: cover !important;
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
    }

    body.is-tablet-layout .song-list-container .song-table tr.song-item .song-title-stack {
        grid-area: title !important;
        min-width: 0 !important;
        max-width: 100% !important;
        align-self: end !important;
    }

    body.is-tablet-layout .song-list-container .song-table tr.song-item .song-title-link {
        display: -webkit-box !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: normal !important;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        font-size: 0.98rem !important;
        font-weight: 900 !important;
        line-height: 1.25 !important;
        color: var(--text-primary) !important;
    }

    body.is-tablet-layout .song-list-container .song-table tr.song-item .song-list-badges,
    body.is-tablet-layout .song-list-container .song-table tr.song-item .rank-cell {
        display: none !important;
    }

    body.is-tablet-layout .song-list-container .song-table tr.song-item .artist-cell {
        grid-area: meta !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        color: var(--text-secondary) !important;
        font-size: 0.84rem !important;
        font-weight: 700 !important;
        line-height: 1.25 !important;
        align-self: start !important;
    }

    body.is-tablet-layout .song-list-container .song-table tr.song-item .album-cell {
        grid-area: meta !important;
        margin-top: 20px !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        color: var(--text-muted, var(--text-secondary)) !important;
        font-size: 0.78rem !important;
        line-height: 1.25 !important;
        align-self: start !important;
    }

    body.is-tablet-layout .song-list-container .song-table tr.song-item .genre-cell,
    body.is-tablet-layout .song-list-container .song-table tr.song-item .duration-cell,
    body.is-tablet-layout .song-list-container .song-table tr.song-item .format-cell,
    body.is-tablet-layout .song-list-container .song-table tr.song-item td.play-count-td,
    body.is-tablet-layout .song-list-container .song-table tr.song-item .file-ext-badge {
        display: none !important;
    }

    body.is-tablet-layout .song-list-container .song-table tr.song-item .actions-cell,
    body.is-tablet-layout .song-list-container .song-table tr.song-item td:last-child {
        grid-area: actions !important;
        justify-self: end !important;
        align-self: center !important;
        display: block !important;
        width: auto !important;
        padding: 0 !important;
    }

    body.is-tablet-layout .song-list-container .song-table tr.song-item .song-action-group {
        display: grid !important;
        grid-template-columns: 38px !important;
        gap: 6px !important;
        width: 38px !important;
        min-width: 38px !important;
    }

    body.is-tablet-layout .song-list-container .song-table tr.song-item .like-btn,
    body.is-tablet-layout .song-list-container .song-table tr.song-item .add-playlist-btn,
    body.is-tablet-layout .song-list-container .song-table tr.song-item .remove-playlist-song-btn {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
        border-radius: 999px !important;
    }
}

@media (min-width: 768px) and (max-width: 980px) and (orientation: landscape) {
    body.is-tablet-layout .music-list-page .list-filter-section {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body.is-tablet-layout .music-list-page .filter-sort-form {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body.is-tablet-layout .song-list-container .song-table tbody {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

/* 56.31 secure song download action and tablet action layout */
.download-song-btn,
.song-action-group .download-song-btn {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid var(--border-color);
    border-radius: 999px !important;
    background: var(--surface-soft, var(--bg-tertiary));
    color: var(--text-primary);
    text-decoration: none !important;
    cursor: pointer;
    transition: transform 0.16s ease, color 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.download-song-btn:hover,
.song-action-group .download-song-btn:hover {
    color: var(--accent-color);
    border-color: color-mix(in srgb, var(--accent-color) 36%, var(--border-color));
    background: color-mix(in srgb, var(--accent-color) 10%, var(--surface-soft, var(--bg-tertiary)));
    transform: translateY(-1px);
}

.download-song-btn:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent-color) 34%, transparent);
    outline-offset: 2px;
}

.song-detail-page .song-detail-art-card > .song-item {
    flex-wrap: wrap !important;
}

.song-detail-page .song-detail-art-card > .song-item .download-song-btn {
    flex: 0 0 40px !important;
}

@media (max-width: 767px) {
    .song-list-container .song-table tr.song-item .song-action-group {
        grid-template-columns: repeat(2, 36px) !important;
        width: 78px !important;
        min-width: 78px !important;
    }

    .song-list-container .song-table tr.song-item .download-song-btn {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
    }
}

@media (min-width: 768px) and (max-width: 1366px) and (orientation: landscape) {
    body.is-tablet-layout .song-list-container .song-table tr.song-item .song-action-group {
        grid-template-columns: repeat(2, 38px) !important;
        width: 82px !important;
        min-width: 82px !important;
    }
}

@media (min-width: 768px) and (max-width: 1199px) and (orientation: portrait) {
    body.is-tablet-layout .song-list-container .song-table tr.song-item .song-action-group {
        grid-template-columns: repeat(2, 38px) !important;
        width: 82px !important;
        min-width: 82px !important;
    }
}

/* 58.0 download modal with progress */
.download-modal-overlay {
    z-index: 2600;
    align-items: center;
    justify-content: center;
    padding: calc(18px + var(--safe-top, env(safe-area-inset-top, 0px))) 18px calc(18px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(12px);
}

.download-modal-overlay[hidden] {
    display: none !important;
}

.download-modal-box {
    width: min(94vw, 520px);
    max-height: min(86vh, 680px);
    border: 1px solid color-mix(in srgb, var(--border-color, #d7e2ee) 82%, transparent);
    border-radius: 22px;
    background: color-mix(in srgb, var(--surface, #ffffff) 94%, transparent);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
    overflow: hidden;
}

.download-modal-box .modal-header {
    padding: 18px 20px 12px;
    border-bottom: 1px solid color-mix(in srgb, var(--border-color, #d7e2ee) 75%, transparent);
}

.download-modal-box .modal-header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--text-primary);
}

.download-modal-content {
    display: grid;
    gap: 14px;
    padding: 18px 20px;
}

.download-track-summary {
    padding: 14px;
    border: 1px solid color-mix(in srgb, var(--accent-color, #00c73c) 20%, var(--border-color, #d7e2ee));
    border-radius: 16px;
    background: color-mix(in srgb, var(--accent-color, #00c73c) 7%, var(--surface-soft, #f5f8fb));
}

.download-track-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 900;
    color: var(--text-primary);
}

.download-track-meta {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.45;
}

.download-field-label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 800;
}

.download-filename-input {
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--input-bg, var(--surface, #ffffff));
    color: var(--text-primary);
    font-weight: 700;
}

.download-filename-input:focus {
    border-color: color-mix(in srgb, var(--accent-color, #00c73c) 58%, var(--border-color));
    outline: 3px solid color-mix(in srgb, var(--accent-color, #00c73c) 18%, transparent);
}

.download-location-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--surface-soft, #f5f8fb);
}

.download-location-text {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.86rem;
    line-height: 1.45;
}

.download-progress-wrap {
    display: grid;
    gap: 8px;
}

.download-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 800;
}

.download-progress-track {
    width: 100%;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: color-mix(in srgb, var(--border-color, #d7e2ee) 70%, transparent);
}

.download-progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent-color, #00c73c), color-mix(in srgb, var(--accent-color, #00c73c) 78%, #ffffff));
    transition: width 0.16s ease;
}

.download-status-text {
    min-height: 20px;
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.45;
}

.download-status-text[data-type="success"] {
    color: var(--accent-color, #00c73c);
    font-weight: 800;
}

.download-status-text[data-type="warning"] {
    color: var(--warning, #b7791f);
    font-weight: 800;
}

.download-status-text[data-type="error"] {
    color: var(--danger, #dc2626);
    font-weight: 800;
}

.download-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px 20px;
    border-top: 1px solid color-mix(in srgb, var(--border-color, #d7e2ee) 75%, transparent);
}

@media (max-width: 767px) {
    .download-modal-box {
        width: calc(100vw - 28px);
        max-height: calc(100vh - 40px - var(--safe-top, env(safe-area-inset-top, 0px)) - var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
        border-radius: 20px;
    }

    .download-location-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .download-modal-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 768px) and (max-width: 1366px) {
    body.is-tablet-layout .download-modal-box {
        width: min(620px, calc(100vw - 64px));
    }
}

/* 59.1 tablet portrait/landscape stabilization */
@media (min-width: 768px) and (max-width: 1366px) {
    body.is-tablet-layout,
    body.is-tablet-layout .app-container,
    body.is-tablet-layout .main-content,
    body.is-tablet-layout .content-body {
        min-width: 0 !important;
        max-width: 100% !important;
        overflow-x: clip !important;
    }

    body.is-tablet-layout .content-body > *,
    body.is-tablet-layout .home-section,
    body.is-tablet-layout .section-card,
    body.is-tablet-layout .panel,
    body.is-tablet-layout .song-list-container,
    body.is-tablet-layout .table-container,
    body.is-tablet-layout .list-filter-section {
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    body.is-tablet-layout .song-title-link,
    body.is-tablet-layout .compact-title,
    body.is-tablet-layout .album-title,
    body.is-tablet-layout .artist-name,
    body.is-tablet-layout .page-main-title,
    body.is-tablet-layout .page-subtitle,
    body.is-tablet-layout .song-detail-page h1 {
        min-width: 0 !important;
        max-width: 100% !important;
        word-break: keep-all !important;
        overflow-wrap: anywhere !important;
    }

    body.is-tablet-layout .filter-sort-form > *,
    body.is-tablet-layout .advanced-filter-form > *,
    body.is-tablet-layout .compact-filter-form > *,
    body.is-tablet-layout .filter-grid > *,
    body.is-tablet-layout .form-grid > * {
        min-width: 0 !important;
    }
}

@media (min-width: 768px) and (max-width: 1199px) and (orientation: landscape) {
    body.is-tablet-layout {
        --tablet-landscape-gutter: clamp(16px, 2.2vw, 26px);
    }

    body.is-tablet-layout .content-body {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: var(--tablet-landscape-gutter) !important;
        padding-right: var(--tablet-landscape-gutter) !important;
    }

    body.is-tablet-layout .music-list-page .list-filter-section {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 12px !important;
    }

    body.is-tablet-layout .music-list-page .filter-left {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    body.is-tablet-layout .music-list-page .filter-right,
    body.is-tablet-layout .music-list-page .filter-sort-form {
        width: 100% !important;
        min-width: 0 !important;
    }

    body.is-tablet-layout .music-list-page .filter-sort-form,
    body.is-tablet-layout .filter-sort-form,
    body.is-tablet-layout .advanced-filter-form,
    body.is-tablet-layout .compact-filter-form,
    body.is-tablet-layout .log-filter-form,
    body.is-tablet-layout .playlist-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body.is-tablet-layout .song-list-container .song-table tbody {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 12px !important;
    }

    body.is-tablet-layout .song-list-container .song-table tr.song-item {
        grid-template-columns: 42px 58px minmax(0, 1fr) auto !important;
        min-height: 92px !important;
        padding: 14px !important;
    }

    body.is-tablet-layout .song-list-container .song-table tr.song-item .song-action-group {
        grid-template-columns: repeat(2, 38px) !important;
        width: 82px !important;
        min-width: 82px !important;
    }
}

@media (min-width: 1200px) and (max-width: 1366px) and (orientation: landscape) {
    body.is-tablet-layout .music-list-page .filter-sort-form,
    body.is-tablet-layout .filter-sort-form {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    body.is-tablet-layout .song-list-container .song-table tbody {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 14px !important;
    }

    body.is-tablet-layout .song-list-container .song-table tr.song-item {
        grid-template-columns: 40px 56px minmax(0, 1fr) auto !important;
        min-height: 98px !important;
    }
}

@media (min-width: 768px) and (max-width: 1199px) and (orientation: portrait) {
    body.is-tablet-layout .content-body {
        width: 100% !important;
        max-width: 100% !important;
    }

    body.is-tablet-layout .music-list-page .filter-sort-form,
    body.is-tablet-layout .filter-sort-form,
    body.is-tablet-layout .advanced-filter-form,
    body.is-tablet-layout .compact-filter-form,
    body.is-tablet-layout .log-filter-form,
    body.is-tablet-layout .playlist-filter-form {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body.is-tablet-layout .song-list-container .song-table tbody {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

/* 60.1 music discovery tablet portrait/landscape polish */
@media (min-width: 768px) and (max-width: 1366px) {
    body.is-tablet-layout .discovery-page,
    body.is-tablet-layout .discovery-page .home-section,
    body.is-tablet-layout .discovery-hero,
    body.is-tablet-layout .discovery-summary-grid,
    body.is-tablet-layout .discovery-grid,
    body.is-tablet-layout .discovery-card {
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: clip !important;
    }

    body.is-tablet-layout .discovery-page {
        width: 100% !important;
        gap: 14px !important;
    }

    body.is-tablet-layout .discovery-hero {
        grid-template-columns: minmax(0, 1fr) !important;
        align-items: stretch !important;
        gap: 14px !important;
        padding: 18px !important;
    }

    body.is-tablet-layout .discovery-hero-copy h2 {
        margin-top: 8px !important;
        font-size: clamp(1.25rem, 2.6vw, 1.7rem) !important;
        line-height: 1.28 !important;
    }

    body.is-tablet-layout .discovery-hero-copy p,
    body.is-tablet-layout .discovery-reason,
    body.is-tablet-layout .discovery-note-list {
        overflow-wrap: anywhere !important;
        word-break: keep-all !important;
    }

    body.is-tablet-layout .discovery-toolbar {
        display: flex !important;
        justify-content: flex-start !important;
        align-items: stretch !important;
        gap: 8px !important;
    }

    body.is-tablet-layout .discovery-toolbar .btn {
        min-width: 0 !important;
        min-height: 44px !important;
        white-space: normal !important;
        text-align: center !important;
    }

    body.is-tablet-layout .discovery-summary-grid {
        gap: 12px !important;
    }

    body.is-tablet-layout .discovery-summary-grid .stats-card {
        min-height: auto !important;
        padding: 16px !important;
    }

    body.is-tablet-layout .discovery-summary-grid .card-value,
    body.is-tablet-layout .discovery-card h3,
    body.is-tablet-layout .discovery-artist,
    body.is-tablet-layout .discovery-album,
    body.is-tablet-layout .discovery-chip,
    body.is-tablet-layout .discovery-link-row a {
        min-width: 0 !important;
        max-width: 100% !important;
        overflow-wrap: anywhere !important;
        word-break: keep-all !important;
    }

    body.is-tablet-layout .discovery-chip-list {
        gap: 8px !important;
    }

    body.is-tablet-layout .discovery-chip {
        min-height: 38px !important;
        padding: 8px 11px !important;
    }

    body.is-tablet-layout .discovery-grid {
        gap: 14px !important;
    }

    body.is-tablet-layout .discovery-card {
        min-height: auto !important;
        padding: 18px !important;
        border-radius: 18px !important;
    }

    body.is-tablet-layout .discovery-link-row {
        gap: 8px !important;
    }

    body.is-tablet-layout .discovery-link-row a {
        flex: 1 1 120px !important;
        min-height: 38px !important;
    }
}

@media (min-width: 768px) and (max-width: 1023px) and (orientation: portrait) {
    body.is-tablet-layout .discovery-summary-grid,
    body.is-tablet-layout .discovery-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body.is-tablet-layout .discovery-toolbar {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
    }

    body.is-tablet-layout .discovery-toolbar .btn {
        width: 100% !important;
        justify-content: center !important;
    }
}

@media (min-width: 768px) and (max-width: 1199px) and (orientation: landscape) {
    body.is-tablet-layout .discovery-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    body.is-tablet-layout .discovery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body.is-tablet-layout .discovery-toolbar .btn {
        flex: 1 1 180px !important;
        justify-content: center !important;
    }
}

@media (min-width: 1200px) and (max-width: 1366px) and (orientation: landscape) {
    body.is-tablet-layout .discovery-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    body.is-tablet-layout .discovery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* 60.2 discovery tablet fallback when runtime tablet class is not present */
@media (min-width: 768px) and (max-width: 1366px) {
    .discovery-page,
    .discovery-hero,
    .discovery-summary-grid,
    .discovery-grid,
    .discovery-card {
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: clip !important;
    }

    .discovery-hero {
        grid-template-columns: minmax(0, 1fr) !important;
        align-items: stretch !important;
        gap: 14px !important;
    }

    .discovery-toolbar {
        justify-content: flex-start !important;
        gap: 8px !important;
    }

    .discovery-toolbar .btn {
        min-height: 44px !important;
        white-space: normal !important;
        text-align: center !important;
    }

    .discovery-card {
        min-height: auto !important;
    }

    .discovery-summary-grid .card-value,
    .discovery-card h3,
    .discovery-artist,
    .discovery-album,
    .discovery-chip,
    .discovery-link-row a {
        min-width: 0 !important;
        max-width: 100% !important;
        overflow-wrap: anywhere !important;
        word-break: keep-all !important;
    }
}

@media (min-width: 768px) and (max-width: 1023px) and (orientation: portrait) {
    .discovery-summary-grid,
    .discovery-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .discovery-toolbar {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .discovery-toolbar .btn {
        width: 100% !important;
        justify-content: center !important;
    }
}

@media (min-width: 768px) and (max-width: 1366px) and (orientation: landscape) {
    .discovery-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .discovery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* 61.1 mobile landscape player optimization */
@media (orientation: landscape) and (max-height: 540px) and (pointer: coarse) {
    .player-bar {
        --floating-player-size-final: 64px;
        --floating-player-width-final: min(460px, calc(100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) - 24px));
        --floating-player-art-size: 44px;
        --floating-player-play-size: 48px;
        right: max(10px, env(safe-area-inset-right, 0px)) !important;
        bottom: max(8px, env(safe-area-inset-bottom, 0px)) !important;
        width: var(--floating-player-width-final) !important;
        max-width: var(--floating-player-width-final) !important;
        height: var(--floating-player-size-final) !important;
        min-height: var(--floating-player-size-final) !important;
        padding: 8px 10px 12px !important;
        border-radius: 22px !important;
        gap: 10px !important;
    }

    .player-bar .player-song-info {
        grid-template-columns: var(--floating-player-art-size) minmax(0, 1fr) !important;
        gap: 10px !important;
    }

    .player-bar .player-album-art,
    .player-bar .player-album-art img {
        width: var(--floating-player-art-size) !important;
        height: var(--floating-player-art-size) !important;
        min-width: var(--floating-player-art-size) !important;
        border-radius: 13px !important;
    }

    .player-bar .player-song-title {
        font-size: 0.86rem !important;
        line-height: 1.16 !important;
    }

    .player-bar .player-song-artist {
        font-size: 0.74rem !important;
        line-height: 1.18 !important;
    }

    .player-bar #btn-play-pause {
        width: var(--floating-player-play-size) !important;
        height: var(--floating-player-play-size) !important;
        min-width: var(--floating-player-play-size) !important;
        min-height: var(--floating-player-play-size) !important;
        flex-basis: var(--floating-player-play-size) !important;
    }

    .player-bar .progress-container {
        left: calc(10px + var(--floating-player-art-size) + 10px) !important;
        right: calc(10px + var(--floating-player-play-size) + 10px) !important;
        bottom: 6px !important;
        height: 6px !important;
    }

    .expand-player-overlay {
        align-items: center !important;
        justify-content: center !important;
        overflow: hidden !important;
        padding:
            max(8px, env(safe-area-inset-top, 0px))
            max(10px, env(safe-area-inset-right, 0px))
            max(8px, env(safe-area-inset-bottom, 0px))
            max(10px, env(safe-area-inset-left, 0px)) !important;
    }

    .expand-player-container {
        display: grid !important;
        grid-template-rows: minmax(0, 1fr) auto !important;
        row-gap: 8px !important;
        width: min(920px, calc(100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) - 20px)) !important;
        height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 16px) !important;
        max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 16px) !important;
        min-height: 0 !important;
        margin: auto !important;
        padding: 10px 12px !important;
        border-radius: 22px !important;
        overflow: hidden !important;
    }

    .expand-close {
        top: 8px !important;
        right: 8px !important;
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        z-index: 20 !important;
    }

    .expand-player-main {
        display: grid !important;
        grid-template-columns: minmax(170px, 0.88fr) minmax(230px, 1.12fr) !important;
        grid-template-rows: minmax(0, 1fr) !important;
        align-items: stretch !important;
        justify-items: stretch !important;
        gap: clamp(10px, 2.5vw, 18px) !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
    }

    .expand-art-section {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        min-width: 0 !important;
        min-height: 0 !important;
        padding: 4px 6px !important;
        text-align: center !important;
    }

    .expand-album-art {
        width: clamp(112px, 34vh, 170px) !important;
        height: clamp(112px, 34vh, 170px) !important;
        min-width: 0 !important;
        aspect-ratio: 1 / 1 !important;
        border-radius: 20px !important;
        object-fit: cover !important;
        margin: 0 auto !important;
    }

    .expand-song-meta {
        width: min(100%, 320px) !important;
        max-width: min(100%, 320px) !important;
        min-width: 0 !important;
        margin: 0 auto !important;
        text-align: center !important;
    }

    .expand-song-meta h2 {
        display: -webkit-box !important;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden !important;
        min-height: auto !important;
        margin: 0 0 4px !important;
        font-size: clamp(1rem, 3.4vw, 1.42rem) !important;
        line-height: 1.12 !important;
        text-align: center !important;
    }

    .expand-song-meta p {
        margin: 0 !important;
        font-size: 0.76rem !important;
        line-height: 1.2 !important;
        text-align: center !important;
    }

    .mini-lyrics-line {
        display: none !important;
    }

    .expand-tab-section {
        display: flex !important;
        flex-direction: column !important;
        align-self: stretch !important;
        justify-self: stretch !important;
        width: 100% !important;
        max-width: none !important;
        height: 100% !important;
        min-height: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
        border-radius: 18px !important;
    }

    .expand-tab-headers {
        display: grid !important;
        grid-template-columns: minmax(74px, 1fr) minmax(74px, 1fr) 40px !important;
        flex: 0 0 auto !important;
        min-height: 42px !important;
        padding: 4px !important;
        gap: 5px !important;
    }

    .tab-header-btn,
    .expand-tab-collapse-btn {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 34px !important;
        padding: 5px 7px !important;
        border-radius: 12px !important;
        font-size: 0.76rem !important;
        line-height: 1.1 !important;
        white-space: nowrap !important;
    }

    .expand-tab-collapse-btn {
        padding: 0 !important;
    }

    .expand-tab-content,
    #expand-tab-queue-content,
    #expand-tab-lyrics-content {
        flex: 1 1 auto !important;
        flex-direction: column !important;
        min-height: 0 !important;
        height: 100% !important;
        padding: 8px !important;
        overflow: hidden !important;
    }

    .expand-player-container.is-queue-view:not(.is-tab-collapsed) #expand-tab-queue-content,
    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) #expand-tab-lyrics-content {
        display: flex !important;
    }

    .expand-player-container.is-queue-view:not(.is-tab-collapsed) #expand-tab-lyrics-content,
    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) #expand-tab-queue-content {
        display: none !important;
    }

    .expand-player-container.is-tab-collapsed #expand-tab-queue-content,
    .expand-player-container.is-tab-collapsed #expand-tab-lyrics-content {
        display: none !important;
        height: 0 !important;
        padding: 0 !important;
    }

    #expand-queue-list,
    .expand-lyrics-full-text {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        font-size: 0.84rem !important;
        line-height: 1.5 !important;
    }

    .expand-lyrics-full-text.is-lyrics-empty {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
    }

    #expand-queue-list .queue-item {
        min-height: 52px !important;
        padding: 8px !important;
        gap: 8px !important;
        border-radius: 14px !important;
    }

    #expand-queue-list .queue-item-thumb {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
    }

    .expand-player-container.is-tab-collapsed .expand-player-main {
        grid-template-columns: minmax(210px, 1fr) minmax(180px, 0.72fr) !important;
    }

    .expand-player-container.is-tab-collapsed .expand-album-art {
        width: clamp(128px, 40vh, 192px) !important;
        height: clamp(128px, 40vh, 192px) !important;
    }

    .expand-player-container.is-tab-collapsed .expand-tab-section {
        height: auto !important;
        align-self: center !important;
        justify-self: center !important;
    }

    .expand-player-controls {
        align-self: end !important;
        justify-self: center !important;
        width: min(620px, 100%) !important;
        max-width: min(620px, 100%) !important;
        margin: 0 auto !important;
        padding: 0 !important;
        min-height: 0 !important;
    }

    .expand-player-controls .progress-container {
        grid-template-columns: 42px minmax(0, 1fr) 42px !important;
        gap: 7px !important;
        margin-bottom: 7px !important;
        font-size: 0.74rem !important;
    }

    .expand-player-controls .progress-bar-wrapper {
        height: 14px !important;
        min-height: 14px !important;
        border-radius: 999px !important;
    }

    .expand-control-buttons-row {
        gap: clamp(8px, 2vw, 12px) !important;
        margin-bottom: 7px !important;
    }

    .expand-player-container .control-btn:not(.play-btn) {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
    }

    .expand-player-container .control-btn.play-btn {
        width: 54px !important;
        height: 54px !important;
        min-width: 54px !important;
        min-height: 54px !important;
    }

    .expand-secondary-actions {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: center !important;
        gap: 7px !important;
        overflow-x: auto !important;
        padding: 0 2px 2px !important;
        scrollbar-width: none;
    }

    .expand-secondary-actions::-webkit-scrollbar {
        display: none;
    }

    .expand-secondary-actions .btn {
        flex: 0 0 auto !important;
        min-height: 34px !important;
        padding: 6px 10px !important;
        border-radius: 999px !important;
        font-size: 0.76rem !important;
        white-space: nowrap !important;
    }
}

/* 62.1 slimmer mobile/tablet player progress bars */
@media (max-width: 1199px) {
    .player-bar .progress-container {
        height: 6px !important;
    }

    .player-bar .progress-bar-wrapper {
        height: 4px !important;
        min-height: 4px !important;
        box-shadow: none !important;
    }

    .player-bar .progress-bar {
        height: 100% !important;
    }

    .expand-player-controls .progress-container {
        align-items: center !important;
    }

    .expand-player-controls .progress-bar-wrapper {
        height: 8px !important;
        min-height: 8px !important;
        box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.12) !important;
    }

    .expand-player-controls .progress-bar-wrapper::before {
        inset: -10px 0 !important;
    }

    .expand-player-controls .progress-bar {
        height: 100% !important;
        border-radius: inherit !important;
    }
}

@media (max-width: 767px) {
    .expand-player-controls .progress-bar-wrapper {
        height: 7px !important;
        min-height: 7px !important;
    }
}

@media (orientation: landscape) and (max-height: 540px) and (pointer: coarse) {
    .player-bar .progress-container {
        height: 5px !important;
        bottom: 6px !important;
    }

    .player-bar .progress-bar-wrapper {
        height: 3px !important;
        min-height: 3px !important;
    }

    .expand-player-controls .progress-bar-wrapper {
        height: 6px !important;
        min-height: 6px !important;
    }
}

/* 63.1 portrait progress thickness and movement visibility fix */
@media (max-width: 1199px) and (orientation: portrait) {
    .player-bar .progress-container {
        height: 5px !important;
        bottom: 6px !important;
        align-items: center !important;
    }

    .player-bar .progress-bar-wrapper,
    body.is-mobile-layout .player-bar .progress-bar-wrapper,
    body.is-tablet-layout .player-bar .progress-bar-wrapper {
        height: 3px !important;
        min-height: 3px !important;
        max-height: 3px !important;
        overflow: hidden !important;
        box-shadow: none !important;
    }

    .expand-player-container .expand-player-controls .progress-bar-wrapper,
    .expand-player-container.is-queue-view .expand-player-controls .progress-bar-wrapper,
    .expand-player-container.is-lyrics-view .expand-player-controls .progress-bar-wrapper,
    .expand-player-container.is-tab-collapsed .expand-player-controls .progress-bar-wrapper,
    body.is-mobile-layout .expand-player-container .expand-player-controls .progress-bar-wrapper,
    body.is-tablet-layout .expand-player-container .expand-player-controls .progress-bar-wrapper,
    body.is-tablet-layout .expand-player-container.is-queue-view .expand-player-controls .progress-bar-wrapper,
    body.is-tablet-layout .expand-player-container.is-lyrics-view .expand-player-controls .progress-bar-wrapper {
        height: 6px !important;
        min-height: 6px !important;
        max-height: 6px !important;
        overflow: hidden !important;
        border-radius: 999px !important;
        box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.1) !important;
    }

    .player-bar .progress-bar,
    .expand-player-container .expand-player-controls .progress-bar,
    .expand-player-container.is-queue-view .expand-player-controls .progress-bar,
    .expand-player-container.is-lyrics-view .expand-player-controls .progress-bar,
    body.is-mobile-layout .expand-player-container .expand-player-controls .progress-bar,
    body.is-tablet-layout .expand-player-container .expand-player-controls .progress-bar {
        display: block !important;
        height: 100% !important;
        min-height: 100% !important;
        max-width: 100% !important;
        border-radius: inherit !important;
        transition: width 120ms linear !important;
        transform: none !important;
    }

    .player-bar .progress-handle,
    .expand-player-container .expand-player-controls .progress-handle,
    body.is-mobile-layout .expand-player-container .expand-player-controls .progress-handle,
    body.is-tablet-layout .expand-player-container .expand-player-controls .progress-handle {
        display: none !important;
    }
}

/* 64.1 fullscreen portrait progress hard override: remove mobile tap padding from visible bar */
@media (max-width: 1199px) and (orientation: portrait) {
    .expand-player-container .expand-player-controls .progress-container,
    .expand-player-container.is-queue-view .expand-player-controls .progress-container,
    .expand-player-container.is-lyrics-view .expand-player-controls .progress-container,
    .expand-player-container.is-tab-collapsed .expand-player-controls .progress-container,
    body.is-mobile-layout .expand-player-container .expand-player-controls .progress-container,
    body.is-tablet-layout .expand-player-container .expand-player-controls .progress-container {
        min-height: 0 !important;
        height: auto !important;
        padding: 0 !important;
        background: transparent !important;
        overflow: visible !important;
        align-items: center !important;
    }

    #expand-progress-wrapper,
    .expand-player-controls #expand-progress-wrapper,
    .expand-player-container .expand-player-controls #expand-progress-wrapper,
    .expand-player-container.is-queue-view .expand-player-controls #expand-progress-wrapper,
    .expand-player-container.is-lyrics-view .expand-player-controls #expand-progress-wrapper,
    .expand-player-container.is-tab-collapsed .expand-player-controls #expand-progress-wrapper,
    body.is-mobile-layout .expand-player-container .expand-player-controls #expand-progress-wrapper,
    body.is-tablet-layout .expand-player-container .expand-player-controls #expand-progress-wrapper {
        box-sizing: border-box !important;
        display: block !important;
        flex: 1 1 auto !important;
        height: 6px !important;
        min-height: 6px !important;
        max-height: 6px !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 999px !important;
        background: rgba(203, 213, 225, 0.74) !important;
        background-clip: padding-box !important;
        overflow: hidden !important;
        touch-action: none !important;
    }

    #expand-progress-wrapper::before,
    .expand-player-controls #expand-progress-wrapper::before {
        content: "" !important;
        position: absolute !important;
        inset: -12px 0 !important;
        background: transparent !important;
    }

    #expand-progress-bar,
    .expand-player-controls #expand-progress-bar,
    .expand-player-container .expand-player-controls #expand-progress-bar,
    body.is-mobile-layout .expand-player-container .expand-player-controls #expand-progress-bar,
    body.is-tablet-layout .expand-player-container .expand-player-controls #expand-progress-bar {
        display: block !important;
        height: 100% !important;
        min-height: 100% !important;
        max-height: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        padding: 0 !important;
        border-radius: inherit !important;
        background: linear-gradient(90deg, var(--accent-color, #00c73c), color-mix(in srgb, var(--accent-color, #00c73c) 72%, #ffffff)) !important;
        transition: width 120ms linear !important;
        transform: none !important;
    }

    #expand-progress-bar .progress-handle,
    .expand-player-controls #expand-progress-bar .progress-handle {
        display: none !important;
    }
}

/* 65.1 search page UI stabilization */
.enhanced-search-page,
.enhanced-search-page *,
.enhanced-search-page *::before,
.enhanced-search-page *::after {
    box-sizing: border-box;
}

.enhanced-search-page {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.enhanced-search-page .page-title-section,
.enhanced-search-page .home-section,
.enhanced-search-page .advanced-filter-panel,
.enhanced-search-page .search-recent-panel,
.enhanced-search-page .search-page-form,
.enhanced-search-page .search-category-grid {
    max-width: 100%;
    min-width: 0;
}

.enhanced-search-page .section-heading-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
}

.enhanced-search-page .section-heading-row > * {
    min-width: 0;
}

.enhanced-search-page .section-title {
    overflow-wrap: anywhere;
}

.enhanced-search-page .settings-muted {
    max-width: 100%;
    white-space: normal !important;
    overflow-wrap: anywhere;
    text-align: right;
}

.enhanced-search-page .search-page-form {
    position: relative;
    min-width: 0;
}

.enhanced-search-page .search-page-form input {
    min-width: 0;
    max-width: 100%;
}

.top-bar,
.top-bar .search-container,
.top-bar .search-form,
.top-bar .quick-search-form,
.enhanced-search-page .search-page-form,
.enhanced-search-page .enhanced-search-form {
    position: relative;
    overflow: visible !important;
}

.quick-suggest-box:not([hidden]) {
    display: block !important;
}

.top-bar .quick-suggest-box,
.enhanced-search-page .quick-suggest-box {
    z-index: 7000 !important;
    color: var(--text-color, #0f172a);
}

.enhanced-search-page .quick-suggest-box {
    left: 0;
    right: 0;
    width: auto;
    max-width: 100%;
    overflow-x: hidden;
}

.enhanced-search-page .quick-suggest-item,
.enhanced-search-page .quick-suggest-item strong,
.enhanced-search-page .quick-suggest-item small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.quick-suggest-box.quick-suggest-box-floating {
    position: fixed !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 7000 !important;
    max-width: calc(100vw - 24px) !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain;
}

.quick-search-assist {
    display: grid;
    gap: 14px;
    padding: 12px;
}

.search-assist-section {
    display: grid;
    gap: 8px;
}

.search-assist-head,
.search-assist-subhead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    color: var(--text-primary, #0f172a);
    font-size: 0.9rem;
}

.search-assist-head span,
.search-assist-subhead span {
    color: var(--text-secondary, #64748b);
    font-size: 0.78rem;
    white-space: nowrap;
}

.search-assist-head button {
    border: 0;
    background: transparent;
    color: var(--primary-color, #00b050);
    font-weight: 800;
    cursor: pointer;
    padding: 4px 0;
}

.search-assist-chip-list,
.recent-search-list,
.search-keyword-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.recent-search-chip-wrap {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    border: 1px solid var(--border-color, #d8e2ef);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    overflow: hidden;
}

.recent-search-chip,
.search-keyword-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: min(260px, 100%);
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 999px;
    color: var(--text-primary, #0f172a);
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.recent-search-chip {
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-search-chip i,
.search-keyword-chip i {
    color: var(--primary-color, #00b050);
}

.recent-search-delete {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-left: 1px solid var(--border-color, #d8e2ef);
    background: transparent;
    color: var(--text-secondary, #64748b);
    cursor: pointer;
}

.search-keyword-chip {
    border: 1px solid rgba(0, 176, 80, 0.22);
    background: rgba(0, 176, 80, 0.08);
}

.search-keyword-chip span,
.recent-search-chip span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-assist-empty {
    margin: 0;
    color: var(--text-secondary, #64748b);
    font-size: 0.9rem;
}

.search-assist-page-panel {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.search-assist-page-panel[hidden] {
    display: none !important;
}

.search-assist-page-head .settings-muted {
    margin: 4px 0 0;
    text-align: left;
}

.search-assist-page-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.search-assist-page-grid-js {
    margin-top: 4px;
}

.search-assist-block {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--border-color, #d8e2ef);
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.72);
}

.top-bar .quick-suggest-box.quick-suggest-box-floating,
.sidebar-search-form .quick-suggest-box.quick-suggest-box-floating,
.enhanced-search-page .quick-suggest-box.quick-suggest-box-floating {
    color: var(--text-color, #0f172a);
}

@media (max-width: 1199px) {
    .quick-suggest-box.quick-suggest-box-floating {
        border-radius: 18px !important;
        box-shadow: 0 18px 48px rgba(15, 23, 42, 0.2) !important;
    }

    .quick-suggest-box.quick-suggest-box-floating .quick-suggest-item {
        min-height: 54px;
    }

    .quick-search-assist {
        max-height: min(58vh, 460px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .search-assist-page-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .recent-search-chip,
    .search-keyword-chip {
        max-width: min(72vw, 320px);
    }
}

@media (max-width: 767px) {
    .quick-search-assist {
        padding: 10px;
    }

    .search-assist-page-panel {
        padding: 14px;
        border-radius: 20px;
    }

    .search-assist-head,
    .search-assist-subhead {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .search-assist-chip-list,
    .recent-search-list,
    .search-keyword-list {
        gap: 7px;
    }

    .recent-search-chip,
    .search-keyword-chip {
        min-height: 38px;
        max-width: min(78vw, 360px);
        padding: 8px 12px;
    }

    .recent-search-delete {
        width: 38px;
        height: 38px;
    }
}

/* Commercial home shortcut strip: compact, practical entry points only. */
.home-dashboard.home-commercial {
    display: grid;
    gap: 18px;
}

.home-dashboard .home-hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px 20px;
    align-items: end;
    padding: clamp(18px, 3vw, 28px) !important;
    border: 1px solid color-mix(in srgb, var(--border-color, #d8e2ee) 78%, transparent);
    border-radius: 22px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--accent-color, #00c73c) 10%, transparent), transparent 50%),
        linear-gradient(180deg, color-mix(in srgb, var(--surface, #fff) 94%, transparent), var(--card-bg, #fff));
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.07);
    overflow: hidden;
}

.home-dashboard .home-hero-panel .page-title-section {
    margin: 0 !important;
    min-width: 0;
}

.home-dashboard .home-hero-panel .section-kicker {
    display: inline-flex;
    width: fit-content;
    margin-bottom: 8px;
    padding: 5px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent-color, #00c73c) 12%, transparent);
    color: var(--accent-color, #00c73c);
    font-size: 0.78rem;
    font-weight: 900;
}

.home-dashboard .home-hero-panel .page-main-title {
    max-width: 760px;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.06;
    letter-spacing: 0;
}

.home-dashboard .home-hero-panel .page-subtitle {
    max-width: 620px;
    margin-top: 10px;
    color: var(--text-secondary, #64748b);
}

.home-dashboard .home-hero-panel .home-library-summary {
    grid-column: 1 / -1;
    margin: 4px 0 0 !important;
}

.home-browse-strip {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 260px;
}

.home-browse-strip a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 13px;
    border: 1px solid color-mix(in srgb, var(--border-color, #d8e2ee) 88%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface, #fff) 88%, transparent);
    color: var(--text-primary, #0f172a);
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.home-browse-strip a:hover,
.home-browse-strip a:focus-visible {
    border-color: color-mix(in srgb, var(--accent-color, #00c73c) 42%, var(--border-color, #d8e2ee));
    color: var(--accent-color, #00c73c);
}

.home-edit-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 13px;
    border: 1px solid color-mix(in srgb, var(--accent-color, #00c73c) 42%, var(--border-color, #d8e2ee));
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent-color, #00c73c) 10%, var(--surface, #fff));
    color: var(--accent-color, #00c73c);
    font: inherit;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.home-edit-trigger:hover,
.home-edit-trigger:focus-visible {
    background: color-mix(in srgb, var(--accent-color, #00c73c) 16%, var(--surface, #fff));
}

.home-customizer-panel {
    display: grid;
    gap: 14px;
}

.home-customizer-panel[hidden] {
    display: none !important;
}

.home-customizer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.home-customizer-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
}

.home-editor-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    padding: 10px;
    border: 1px solid color-mix(in srgb, var(--border-color, #d8e2ee) 88%, transparent);
    border-radius: 16px;
    background: color-mix(in srgb, var(--surface, #fff) 92%, transparent);
}

.home-editor-toggle {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    margin: 0;
    font-weight: 900;
    color: var(--text-primary, #0f172a);
}

.home-editor-toggle span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-editor-toggle input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-color, #00c73c);
}

.home-editor-move {
    display: inline-flex;
    gap: 6px;
    flex: 0 0 auto;
}

.home-editor-move .btn {
    width: 34px;
    min-width: 34px;
    height: 34px;
    padding: 0;
}

.home-section-grid > [data-home-section="auto_mix"],
.home-section-grid > [data-home-section="today_recommend"] {
    grid-column: 1 / -1;
}

.home-section-shell {
    min-width: 0;
}

.home-section-shell > .today-recommend-section {
    height: 100%;
}

.home-custom-empty {
    grid-column: 1 / -1;
    text-align: center;
}

[data-home-section][hidden] {
    display: none !important;
}

body.theme-dark .home-dashboard .home-hero-panel {
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--accent-color, #00c73c) 10%, transparent), transparent 48%),
        linear-gradient(180deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.94));
    box-shadow: none;
}

body.theme-dark .home-browse-strip a {
    background: color-mix(in srgb, var(--surface, #111827) 82%, transparent);
    box-shadow: none;
}

body.theme-dark .home-edit-trigger,
body.theme-dark .home-editor-item {
    background: color-mix(in srgb, var(--surface, #111827) 82%, transparent);
    box-shadow: none;
}

/* Home edit trigger refinement: keep the action compact and prevent vertical text wrapping. */
.home-browse-strip > a,
.home-edit-trigger {
    flex: 0 0 auto;
    white-space: nowrap;
    line-height: 1;
}

.home-edit-trigger {
    justify-content: center;
    min-width: max-content;
}

.home-edit-trigger span {
    display: inline-block;
    white-space: nowrap;
}

.home-dashboard .home-action-strip {
    padding: clamp(14px, 2vw, 18px) !important;
}

.home-dashboard .home-action-strip .section-heading-row {
    margin-bottom: 12px;
}

.home-dashboard .home-action-strip .section-description {
    margin: 4px 0 0;
    color: var(--text-secondary, #64748b);
    font-size: 0.92rem;
}

.home-dashboard .home-action-strip .dashboard-quick-actions {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
    grid-auto-flow: row !important;
    grid-auto-columns: initial !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}

.home-dashboard .home-action-strip .quick-action-card {
    display: grid !important;
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-areas:
        "icon title"
        "icon copy";
    align-items: center;
    gap: 2px 10px !important;
    min-height: 68px !important;
    padding: 12px !important;
    border-radius: 16px !important;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--accent-color, #00c73c) 5%, transparent), transparent 58%),
        var(--card-bg, var(--surface, #fff)) !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06) !important;
}

.home-dashboard .home-action-strip .quick-action-card i {
    grid-area: icon;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 38px !important;
    height: 38px !important;
    border-radius: 14px;
    background: color-mix(in srgb, var(--accent-color, #00c73c) 12%, var(--surface-soft, #f1f5f9));
    color: var(--accent-color, #00c73c);
    font-size: 1rem !important;
}

.home-dashboard .home-action-strip .quick-action-card strong {
    grid-area: title;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary, #0f172a);
    font-size: 0.98rem;
    line-height: 1.2;
}

.home-dashboard .home-action-strip .quick-action-card span {
    grid-area: copy;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary, #64748b);
    font-size: 0.82rem;
    line-height: 1.25;
}

.home-dashboard .home-action-strip .quick-action-card.primary {
    border-color: color-mix(in srgb, var(--accent-color, #00c73c) 34%, var(--border-color, #d8e2ee)) !important;
}

.home-dashboard .home-action-strip .quick-action-card.admin {
    background:
        linear-gradient(135deg, color-mix(in srgb, #2563eb 7%, transparent), transparent 62%),
        var(--card-bg, var(--surface, #fff)) !important;
}

.home-dashboard .home-action-strip .quick-action-card.admin i {
    background: color-mix(in srgb, #2563eb 12%, var(--surface-soft, #f1f5f9));
    color: #2563eb;
}

@media (max-width: 767px) {
    .home-dashboard.home-commercial {
        gap: 14px;
    }

    .home-dashboard .home-hero-panel {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        padding: 18px 16px !important;
        border-radius: 22px;
    }

    .home-dashboard .home-hero-panel .page-main-title {
        font-size: clamp(1.95rem, 8.5vw, 2.55rem) !important;
    }

    .home-dashboard .home-hero-panel .page-subtitle {
        font-size: 0.95rem !important;
    }

    .home-browse-strip {
        justify-content: flex-start;
        min-width: 0;
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .home-browse-strip::-webkit-scrollbar {
        display: none;
    }

    .home-browse-strip a {
        flex: 0 0 auto;
        min-height: 38px;
        padding: 0 12px;
    }

    .home-edit-trigger {
        width: 42px;
        min-width: 42px;
        height: 42px;
        min-height: 42px;
        padding: 0;
        border-radius: 999px;
        aspect-ratio: 1 / 1;
    }

    .home-edit-trigger i {
        font-size: 1rem;
    }

    .home-edit-trigger span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .home-dashboard .home-action-strip {
        padding: 14px !important;
    }

    .home-dashboard .home-action-strip .section-description {
        display: none;
    }

    .home-dashboard .home-action-strip .dashboard-quick-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 9px !important;
    }

    .home-dashboard .home-action-strip .quick-action-card {
        grid-template-columns: 34px minmax(0, 1fr);
        min-height: 62px !important;
        padding: 10px !important;
        border-radius: 15px !important;
    }

    .home-dashboard .home-action-strip .quick-action-card i {
        width: 34px !important;
        height: 34px !important;
        border-radius: 12px;
    }

    .home-dashboard .home-action-strip .quick-action-card strong {
        font-size: 0.92rem;
    }

    .home-dashboard .home-action-strip .quick-action-card span {
        font-size: 0.76rem;
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .home-dashboard .home-hero-panel {
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
    }

    .home-browse-strip {
        justify-content: flex-start;
        min-width: 0;
    }
}

/* Global scroll-to-top action. Kept above the floating player and away from feedback. */
.scroll-top-btn {
    position: fixed;
    right: clamp(16px, 2.4vw, 28px);
    bottom: calc(var(--player-height, 92px) + var(--safe-bottom, env(safe-area-inset-bottom, 0px)) + 22px);
    z-index: 1265;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 1px solid color-mix(in srgb, var(--accent-color, #00c73c) 26%, var(--border-color, #d8e2ee));
    border-radius: 999px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--accent-color, #00c73c) 10%, transparent), transparent 62%),
        color-mix(in srgb, var(--surface, #fff) 94%, transparent);
    color: var(--text-primary, #0f172a);
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.18);
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px) scale(0.96);
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease, border-color 160ms ease, color 160ms ease;
    backdrop-filter: blur(16px);
}

.scroll-top-btn:not([hidden]).is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.scroll-top-btn:hover,
.scroll-top-btn:focus-visible {
    border-color: var(--accent-color, #00c73c);
    color: var(--accent-color, #00c73c);
    outline: none;
}

body.theme-dark .scroll-top-btn {
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--accent-color, #00c73c) 10%, transparent), transparent 62%),
        color-mix(in srgb, var(--surface, #111827) 90%, transparent);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.34);
}

body.expand-player-open .scroll-top-btn,
body.pwa-install-open .scroll-top-btn,
body.guest-preview-ended .scroll-top-btn {
    display: none !important;
}

@media (max-width: 767px) {
    .scroll-top-btn {
        right: 16px;
        bottom: calc(var(--mobile-player-height, var(--player-height, 92px)) + var(--safe-bottom, env(safe-area-inset-bottom, 0px)) + 18px);
        width: 44px;
        height: 44px;
    }

    .scroll-top-btn {
        z-index: 1266;
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .scroll-top-btn {
        right: max(18px, env(safe-area-inset-right, 0px) + 18px) !important;
        left: auto !important;
        bottom: calc(var(--player-height, 92px) + var(--safe-bottom, env(safe-area-inset-bottom, 0px)) + 22px) !important;
        z-index: 1295 !important;
    }
}

@media (min-width: 768px) and (max-width: 1199px) and (orientation: portrait) {
    body.is-tablet-layout .scroll-top-btn {
        right: max(18px, env(safe-area-inset-right, 0px) + 18px) !important;
        left: auto !important;
        bottom: calc(var(--player-height, 92px) + var(--safe-bottom, env(safe-area-inset-bottom, 0px)) + 24px) !important;
        width: 46px;
        height: 46px;
    }
}

@media (min-width: 900px) and (max-width: 1199px) and (orientation: landscape) {
    body.is-tablet-layout .scroll-top-btn {
        right: max(22px, env(safe-area-inset-right, 0px) + 22px) !important;
        left: auto !important;
        bottom: calc(var(--player-height, 92px) + var(--safe-bottom, env(safe-area-inset-bottom, 0px)) + 22px) !important;
        width: 44px;
        height: 44px;
        z-index: 1295 !important;
    }

    body.is-tablet-layout.sidebar-collapsed .scroll-top-btn {
        right: max(22px, env(safe-area-inset-right, 0px) + 22px) !important;
        left: auto !important;
    }
}

.enhanced-search-page .advanced-filter-form,
.enhanced-search-page .filter-grid,
.enhanced-search-page .filter-check-row,
.enhanced-search-page .filter-actions,
.enhanced-search-page .active-filter-badges,
.enhanced-search-page .search-pagination,
.enhanced-search-page .recent-search-list {
    min-width: 0;
    max-width: 100%;
}

.enhanced-search-page .filter-grid > *,
.enhanced-search-page .filter-check-row > *,
.enhanced-search-page .filter-actions > * {
    min-width: 0;
}

.enhanced-search-page .song-list-container {
    max-width: 100%;
    min-width: 0;
}

.enhanced-search-page .song-table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
}

.enhanced-search-page .song-title-wrap,
.enhanced-search-page .song-title-stack,
.enhanced-search-page .song-title-link,
.enhanced-search-page .artist-cell,
.enhanced-search-page .album-cell,
.enhanced-search-page .genre-cell {
    min-width: 0 !important;
    max-width: 100%;
}

.enhanced-search-page .song-title-link {
    overflow-wrap: anywhere;
    word-break: keep-all;
}

.enhanced-search-page .search-category-grid {
    display: grid;
    gap: 16px;
}

.enhanced-search-page .search-category-grid .explore-card-grid,
.enhanced-search-page .search-category-grid .album-card-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    min-width: 0;
}

.enhanced-search-page .search-category-grid .explore-card,
.enhanced-search-page .search-category-grid .album-card {
    display: grid !important;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
    color: var(--text-color, #0f172a) !important;
    text-decoration: none !important;
}

.enhanced-search-page .search-category-grid .explore-card strong,
.enhanced-search-page .search-category-grid .album-card strong,
.enhanced-search-page .search-category-grid .explore-card span,
.enhanced-search-page .search-category-grid .album-card span {
    min-width: 0;
    max-width: 100%;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: keep-all;
    text-decoration: none !important;
}

.enhanced-search-page .search-category-grid .explore-card span,
.enhanced-search-page .search-category-grid .album-card span {
    color: var(--text-muted, var(--text-secondary));
}

.enhanced-search-page .search-category-grid .tag-cloud {
    min-width: 0;
    max-width: 100%;
}

.enhanced-search-page .search-category-grid .tag-badge {
    max-width: 100%;
    min-width: 0;
}

@media (min-width: 768px) and (max-width: 1366px) {
    body.is-tablet-layout .enhanced-search-page .advanced-filter-form {
        display: grid;
        gap: 14px;
    }

    body.is-tablet-layout .enhanced-search-page .filter-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px;
    }

    body.is-tablet-layout .enhanced-search-page .song-list-container {
        overflow: visible !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    body.is-tablet-layout .enhanced-search-page .song-table {
        min-width: 0 !important;
    }

    body.is-tablet-layout .enhanced-search-page .search-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 768px) and (max-width: 1199px) and (orientation: portrait) {
    body.is-tablet-layout .enhanced-search-page .filter-grid,
    body.is-tablet-layout .enhanced-search-page .search-category-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

@media (max-width: 767px) {
    .enhanced-search-page {
        gap: 14px;
    }

    .enhanced-search-page .search-page-form {
        grid-template-columns: 38px minmax(0, 1fr) !important;
        gap: 8px;
        padding: 10px;
        border-radius: 18px;
    }

    .enhanced-search-page .search-page-form > i {
        justify-self: center;
    }

    .enhanced-search-page .search-page-form .btn {
        grid-column: 1 / -1;
        width: 100%;
        min-height: 42px;
        justify-content: center;
    }

    .enhanced-search-page .advanced-filter-panel,
    .enhanced-search-page .search-recent-panel,
    .enhanced-search-page .home-section {
        border-radius: 18px;
    }

    .enhanced-search-page .filter-grid,
    .enhanced-search-page .filter-check-row,
    .enhanced-search-page .filter-actions {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 10px;
    }

    .enhanced-search-page .filter-actions .btn,
    .enhanced-search-page .filter-actions a {
        width: 100%;
        justify-content: center;
    }

    .enhanced-search-page .active-filter-badges,
    .enhanced-search-page .search-pagination,
    .enhanced-search-page .recent-search-list {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .enhanced-search-page .song-list-container {
        margin-left: 0 !important;
        margin-right: 0 !important;
        overflow: visible !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .enhanced-search-page .song-list-container .song-table tr.song-item {
        grid-template-columns: 38px 52px minmax(0, 1fr) auto !important;
        gap: 4px 9px !important;
        padding: 12px !important;
    }

    .enhanced-search-page .song-list-container .song-table tr.song-item .song-action-group {
        grid-template-columns: 34px !important;
        width: 34px !important;
        min-width: 34px !important;
    }

    .enhanced-search-page .song-list-container .song-table tr.song-item .like-btn,
    .enhanced-search-page .song-list-container .song-table tr.song-item .add-playlist-btn,
    .enhanced-search-page .song-list-container .song-table tr.song-item .download-song-btn,
    .enhanced-search-page .song-list-container .song-table tr.song-item .remove-playlist-song-btn {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        min-height: 34px !important;
    }

    .enhanced-search-page .search-category-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .enhanced-search-page .search-category-grid .home-section {
        padding: 14px;
    }

    .enhanced-search-page .search-category-grid .explore-card,
    .enhanced-search-page .search-category-grid .album-card {
        grid-template-columns: 58px minmax(0, 1fr);
        min-height: 78px;
    }

    .enhanced-search-page .search-category-grid .explore-card img,
    .enhanced-search-page .search-category-grid .album-card-cover {
        width: 58px !important;
        height: 58px !important;
        max-width: 58px;
    }
}

/* Final scan log table guard: this must stay after generic table/mobile rules. */
.scan-admin-page .scan-log-table-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
}

.scan-admin-page .scan-log-table {
    width: 100% !important;
    min-width: 980px !important;
    table-layout: auto !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

.scan-admin-page .scan-log-table thead {
    display: table-header-group !important;
}

.scan-admin-page .scan-log-table tbody {
    display: table-row-group !important;
}

.scan-admin-page .scan-log-table tr {
    display: table-row !important;
}

.scan-admin-page .scan-log-table th,
.scan-admin-page .scan-log-table td {
    display: table-cell !important;
    vertical-align: middle !important;
    white-space: nowrap;
}

.scan-admin-page .scan-log-table .log-message-td {
    min-width: 320px;
    max-width: 520px;
    white-space: normal !important;
    line-height: 1.45;
}

@media (max-width: 1199px) {
    .scan-admin-page .scan-log-table-wrap {
        overflow-x: visible !important;
    }

    .scan-admin-page .scan-log-table,
    .scan-admin-page .scan-log-table tbody,
    .scan-admin-page .scan-log-table tr,
    .scan-admin-page .scan-log-table td {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .scan-admin-page .scan-log-table {
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .scan-admin-page .scan-log-table thead {
        display: none !important;
    }

    .scan-admin-page .scan-log-table tbody {
        display: grid !important;
        gap: 12px;
    }

    .scan-admin-page .scan-log-table tr {
        padding: 14px !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 16px !important;
        background: var(--bg-secondary) !important;
        box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
    }

    .scan-admin-page .scan-log-table tr.scan-empty-row {
        display: block !important;
    }

    .scan-admin-page .scan-log-table tr.scan-empty-row td {
        display: block !important;
        text-align: center !important;
    }

    .scan-admin-page .scan-log-table td[data-label] {
        display: grid !important;
        grid-template-columns: 92px minmax(0, 1fr);
        align-items: start;
        gap: 10px;
        padding: 7px 0 !important;
        border: 0 !important;
        white-space: normal !important;
        text-align: left !important;
    }

    .scan-admin-page .scan-log-table td[data-label]::before {
        content: attr(data-label);
        color: var(--text-secondary);
        font-size: 12px;
        font-weight: 700;
    }

    .scan-admin-page .scan-log-table .log-message-td {
        min-width: 0 !important;
        max-width: 100% !important;
        overflow-wrap: anywhere;
        word-break: keep-all;
    }
}

/* EOF missing files layout guard: tablet/mobile must use cards, desktop must keep the table. */
.missing-files-page .missing-table-container {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

.missing-files-page .missing-files-table {
    display: table !important;
    width: 100% !important;
    min-width: 1180px !important;
    table-layout: fixed !important;
}

.missing-files-page .missing-files-table thead {
    display: table-header-group !important;
}

.missing-files-page .missing-files-table tbody {
    display: table-row-group !important;
}

.missing-files-page .missing-files-table tr {
    display: table-row !important;
}

.missing-files-page .missing-files-table th,
.missing-files-page .missing-files-table td {
    display: table-cell !important;
    vertical-align: middle !important;
    white-space: nowrap;
}

.missing-files-page .missing-file-grid {
    display: none !important;
}

.missing-files-page .missing-files-table th:nth-child(1),
.missing-files-page .missing-files-table td:nth-child(1) {
    width: 260px;
}

.missing-files-page .missing-files-table th:nth-child(2),
.missing-files-page .missing-files-table td:nth-child(2) {
    width: 150px;
}

.missing-files-page .missing-files-table th:nth-child(3),
.missing-files-page .missing-files-table td:nth-child(3) {
    width: 190px;
}

.missing-files-page .missing-files-table th:nth-child(4),
.missing-files-page .missing-files-table td:nth-child(4) {
    width: 230px;
}

.missing-files-page .missing-files-table th:nth-child(5),
.missing-files-page .missing-files-table td:nth-child(5) {
    width: 130px;
}

.missing-files-page .missing-files-table th:nth-child(6),
.missing-files-page .missing-files-table td:nth-child(6) {
    width: 160px;
}

.missing-files-page .missing-files-table th:nth-child(7),
.missing-files-page .missing-files-table td:nth-child(7) {
    width: 300px;
}

.missing-files-page .missing-song-main {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.missing-files-page .missing-song-main small,
.missing-files-page .missing-folder-name {
    display: block;
    color: var(--text-secondary);
    font-size: .78rem;
    font-weight: 700;
}

.missing-files-page .status-badge.muted {
    width: fit-content;
    background: rgba(100, 116, 139, .14);
    color: var(--text-secondary);
    border: 1px solid rgba(100, 116, 139, .24);
}

.missing-files-page .missing-song-title,
.missing-files-page .missing-file-name,
.missing-files-page .missing-folder-name,
.missing-files-page .missing-files-table td:nth-child(2),
.missing-files-page .missing-files-table td:nth-child(3) {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.missing-files-page .missing-files-table td:nth-child(7) {
    white-space: normal !important;
}

.missing-files-page .missing-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 6px !important;
    min-width: 0 !important;
}

.missing-files-page .missing-actions .btn {
    min-height: 34px;
    padding: 7px 10px;
    font-size: .82rem;
}

@media (max-width: 1199px) {
    .missing-files-page .missing-table-container {
        display: none !important;
    }

    .missing-files-page .missing-file-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .missing-files-page .missing-file-card {
        min-width: 0;
        padding: 16px;
        border: 1px solid var(--border-color);
        border-radius: 16px;
        background: var(--bg-secondary);
        box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
    }

    .missing-files-page .missing-file-card strong,
    .missing-files-page .missing-card-meta,
    .missing-files-page .missing-file-card small {
        min-width: 0;
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: keep-all;
    }
}

@media (max-width: 767px) {
    .missing-files-page .missing-file-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .missing-files-page .missing-file-card .song-action-group {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .missing-files-page .missing-file-card .song-action-group .btn,
    .missing-files-page .missing-file-card .song-action-group .inline-action-form {
        width: 100%;
    }
}

/* Auto playlist pages: stable card/action layout across mobile, tablet, and desktop */
.auto-playlists-page,
.auto-playlist-page {
    width: 100%;
    max-width: min(1180px, 100%);
    margin: 0 auto;
    display: grid;
    gap: clamp(16px, 2vw, 24px);
    min-width: 0;
}

.auto-playlist-hero,
.auto-playlist-detail-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    min-width: 0;
    padding: clamp(18px, 2.6vw, 28px);
    border: 1px solid var(--border-color, rgba(148, 163, 184, .28));
    border-radius: 20px;
    background:
        radial-gradient(circle at top right, color-mix(in srgb, var(--accent-color, #00c73c) 12%, transparent), transparent 34%),
        var(--card-bg, #fff);
    box-shadow: 0 18px 42px rgba(15, 23, 42, .07);
}

.auto-playlist-hero-copy {
    min-width: 0;
    display: grid;
    gap: 8px;
}

.auto-playlist-kicker {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent-color, #00c73c) 12%, transparent);
    color: var(--accent-color, #00a832);
    font-size: .82rem;
    font-weight: 900;
}

.auto-playlist-back-link {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary, #64748b);
    font-size: .9rem;
    font-weight: 800;
    text-decoration: none;
}

.auto-playlist-back-link:hover,
.auto-playlist-back-link:focus-visible {
    color: var(--accent-color, #00a832);
}

.auto-playlist-hero .page-main-title,
.auto-playlist-detail-hero .page-main-title,
.auto-playlist-hero .page-subtitle,
.auto-playlist-detail-hero .page-subtitle {
    min-width: 0;
    max-width: 760px;
    overflow-wrap: anywhere;
    word-break: keep-all;
}

.auto-playlist-hero-meta {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.auto-playlist-hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid var(--border-color, rgba(148, 163, 184, .28));
    border-radius: 999px;
    background: color-mix(in srgb, var(--card-bg, #fff) 88%, transparent);
    color: var(--text-secondary, #64748b);
    font-size: .9rem;
    font-weight: 800;
    white-space: nowrap;
}

.auto-playlist-hero-meta strong {
    color: var(--text-color, #0f172a);
}

.auto-playlist-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)) !important;
    gap: 16px !important;
    align-items: stretch;
    min-width: 0;
}

.auto-playlist-card {
    position: relative;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 16px !important;
    min-width: 0;
    min-height: 198px;
    padding: 18px !important;
    border-radius: 18px !important;
    overflow: hidden;
    border: 1px solid var(--border-color, rgba(148, 163, 184, .28)) !important;
    background: linear-gradient(180deg, color-mix(in srgb, var(--card-bg, #fff) 96%, var(--accent-color, #00c73c)), var(--card-bg, #fff)) !important;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .06);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.auto-playlist-card:hover,
.auto-playlist-card:focus-visible {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--accent-color, #00c73c) 50%, var(--border-color, rgba(148, 163, 184, .28))) !important;
    box-shadow: 0 20px 46px rgba(15, 23, 42, .1);
}

.auto-playlist-card-icon {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: color-mix(in srgb, var(--accent-color, #00c73c) 13%, transparent);
    color: var(--accent-color, #00a832);
}

.auto-playlist-card-icon i,
.auto-playlist-card i {
    color: currentColor !important;
    font-size: 20px !important;
}

.auto-playlist-card-copy {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 8px;
}

.auto-playlist-card strong {
    min-width: 0;
    color: var(--text-color, #0f172a);
    font-size: clamp(1rem, 1.1vw, 1.14rem) !important;
    line-height: 1.25;
    overflow-wrap: anywhere;
    word-break: keep-all;
}

.auto-playlist-card span,
.auto-playlist-card small {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: keep-all;
}

.auto-playlist-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.auto-playlist-card-footer small {
    color: var(--text-secondary, #64748b);
    font-weight: 800;
}

.auto-playlist-card-footer em {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-color, #00a832);
    font-size: .86rem;
    font-style: normal;
    font-weight: 900;
    white-space: nowrap;
}

.auto-playlist-action-panel {
    display: grid !important;
    gap: 16px !important;
    min-width: 0;
    padding: clamp(16px, 2vw, 22px) !important;
    border-radius: 18px !important;
}

.auto-playlist-action-panel .section-heading-row,
.auto-playlist-song-section .section-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.auto-playlist-action-panel .section-title,
.auto-playlist-action-panel .section-subtitle {
    min-width: 0;
    overflow-wrap: anywhere;
}

.auto-playlist-action-panel .section-subtitle {
    margin-top: 4px;
    color: var(--text-secondary, #64748b);
    font-size: .92rem;
}

.auto-playlist-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    min-width: 0;
}

.auto-playlist-actions .btn {
    min-height: 44px;
    white-space: normal;
}

.auto-save-form {
    width: 100%;
    max-width: none !important;
    padding: 14px;
    border: 1px solid var(--border-color, rgba(148, 163, 184, .28));
    border-radius: 16px;
    background: color-mix(in srgb, var(--card-bg, #fff) 88%, var(--bg-secondary, #f8fafc));
}

.auto-save-form label {
    color: var(--text-color, #0f172a) !important;
    font-weight: 900;
}

.auto-save-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px !important;
    align-items: center !important;
    min-width: 0;
}

.auto-save-row .form-control {
    min-width: 0;
}

.auto-playlist-song-section {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.auto-playlist-song-section .section-count {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent-color, #00c73c) 10%, transparent);
    color: var(--accent-color, #00a832);
    font-size: .86rem;
    font-weight: 900;
}

.auto-playlist-song-section .song-list-container {
    margin-top: 0;
}

.auto-playlist-song-section .song-table {
    table-layout: fixed;
}

.auto-playlist-song-section .song-table th:last-child,
.auto-playlist-song-section .song-table td.actions-cell,
.auto-playlist-song-section .song-table td:last-child {
    width: 156px;
    min-width: 156px;
}

.auto-playlist-song-section .song-table .song-action-group {
    display: inline-grid !important;
    grid-template-columns: repeat(3, 38px);
    gap: 8px;
    width: 130px;
    min-width: 130px;
    justify-content: center;
}

.auto-playlist-song-section .song-table .like-btn,
.auto-playlist-song-section .song-table .add-playlist-btn,
.auto-playlist-song-section .song-table .download-song-btn {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
}

.auto-playlist-empty-state {
    display: grid !important;
    justify-items: center;
    gap: 12px;
    padding: clamp(28px, 5vw, 54px) !important;
    text-align: center;
}

.auto-playlist-empty-state > i {
    width: 58px;
    height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: color-mix(in srgb, var(--accent-color, #00c73c) 12%, transparent);
    color: var(--accent-color, #00a832);
    font-size: 24px;
}

.auto-playlist-empty-state h2,
.auto-playlist-empty-state p {
    max-width: 560px;
    margin: 0;
    overflow-wrap: anywhere;
    word-break: keep-all;
}

body.theme-dark .auto-playlist-hero,
body.theme-dark .auto-playlist-detail-hero,
body.theme-dark .auto-playlist-card,
body.theme-dark .auto-save-form {
    box-shadow: none;
}

@media (min-width: 768px) and (max-width: 1199px) {
    body.is-tablet-layout .auto-playlists-page,
    body.is-tablet-layout .auto-playlist-page {
        max-width: 100%;
    }

    body.is-tablet-layout .auto-playlist-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body.is-tablet-layout .auto-playlist-card {
        min-height: 188px;
    }

    body.is-tablet-layout .auto-playlist-song-section .song-table tr.song-item {
        grid-template-columns: 42px 58px minmax(0, 1fr) 130px !important;
    }

    body.is-tablet-layout .auto-playlist-song-section .song-table tr.song-item .actions-cell,
    body.is-tablet-layout .auto-playlist-song-section .song-table tr.song-item td:last-child {
        width: 130px !important;
        min-width: 130px !important;
    }

    body.is-tablet-layout .auto-playlist-song-section .song-table tr.song-item .song-action-group {
        grid-template-columns: repeat(3, 38px) !important;
        width: 130px !important;
        min-width: 130px !important;
    }
}

@media (max-width: 767px) {
    .auto-playlist-hero,
    .auto-playlist-detail-hero {
        align-items: stretch;
        flex-direction: column;
        padding: 18px;
        border-radius: 18px;
    }

    .auto-playlist-hero-meta {
        justify-content: flex-start;
    }

    .auto-playlist-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 12px !important;
    }

    .auto-playlist-card {
        min-height: 0;
        gap: 12px !important;
    }

    .auto-playlist-card-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .auto-playlist-action-panel .section-heading-row,
    .auto-playlist-song-section .section-heading-row {
        align-items: stretch;
        flex-direction: column;
    }

    .auto-playlist-actions,
    .auto-save-row {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100%;
    }

    .auto-playlist-actions .btn,
    .auto-save-row .btn,
    .auto-save-row .form-control {
        width: 100%;
    }

    .auto-playlist-song-section .song-table tr.song-item {
        grid-template-columns: 40px 54px minmax(0, 1fr) 84px !important;
    }

    .auto-playlist-song-section .song-table tr.song-item .actions-cell,
    .auto-playlist-song-section .song-table tr.song-item td:last-child {
        width: 84px !important;
        min-width: 84px !important;
    }

    .auto-playlist-song-section .song-table tr.song-item .song-action-group {
        grid-template-columns: repeat(2, 38px) !important;
        width: 84px !important;
        min-width: 84px !important;
        gap: 8px !important;
    }
}

/* Metadata quality page UI stabilization */
.metadata-quality-page {
    width: 100%;
    max-width: min(1220px, 100%);
    margin: 0 auto;
    display: grid;
    gap: clamp(16px, 2vw, 22px);
    min-width: 0;
}

.metadata-quality-page .page-title-section,
.metadata-quality-filter-section,
.metadata-quality-results {
    min-width: 0;
    overflow: hidden;
}

.metadata-quality-filter-section {
    display: grid !important;
    gap: 16px !important;
    padding: 24px !important;
    border-radius: 20px !important;
    background: var(--bg-secondary, rgba(255, 255, 255, 0.8)) !important;
    border: 1px solid var(--border-color, rgba(226, 232, 240, 0.8)) !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.02) !important;
}

.metadata-quality-filter-section .compact-filter-form {
    width: 100%;
    min-width: 0;
}

.metadata-quality-filter-section .form-row {
    display: grid !important;
    grid-template-columns: minmax(160px, 1fr) minmax(220px, 1.8fr) minmax(150px, 1fr) auto;
    gap: 16px !important;
    align-items: flex-end !important;
    min-width: 0;
}

.metadata-quality-filter-section .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.metadata-quality-filter-section .form-group label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary, #64748b);
}

.metadata-quality-filter-section select,
.metadata-quality-filter-section input {
    height: 42px !important;
    padding: 8px 14px !important;
    border-radius: 12px !important;
    border: 1px solid var(--border-color, #cbd5e1) !important;
    background: var(--bg-primary, #ffffff) !important;
    color: var(--text-color, #0f172a) !important;
    font-size: 0.9rem !important;
    transition: all 0.2s ease !important;
}

.metadata-quality-filter-section select:focus,
.metadata-quality-filter-section input:focus {
    outline: none !important;
    border-color: var(--accent-color, #00CD3C) !important;
    box-shadow: 0 0 0 3px rgba(0, 205, 60, 0.12) !important;
}

.metadata-quality-filter-section .form-group-actions .btn {
    height: 42px !important;
    padding: 0 20px !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    transition: all 0.2s ease !important;
}

.metadata-quality-filter-section .form-group-actions .btn:hover {
    transform: scale(1.02) !important;
}

.metadata-quality-filter-section .metadata-filter-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 2px;
    -ms-overflow-style: none !important;  /* IE and Edge */
    scrollbar-width: none !important;  /* Firefox */
    -webkit-overflow-scrolling: touch;
}

/* 스크롤바 감추기 */
.metadata-quality-filter-section .metadata-filter-tabs::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.metadata-quality-filter-section .metadata-filter-tabs .filter-tab {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 16px;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 999px;
    background: var(--bg-primary, #ffffff);
    color: var(--text-secondary, #475569);
    border: 1px solid var(--border-color, #e2e8f0);
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    cursor: pointer;
}

.metadata-quality-filter-section .metadata-filter-tabs .filter-tab.active {
    background: var(--accent-color, #00CD3C) !important;
    color: #ffffff !important;
    border-color: var(--accent-color, #00CD3C) !important;
    box-shadow: 0 4px 12px rgba(0, 205, 60, 0.2) !important;
}

.metadata-quality-filter-section .metadata-filter-tabs .filter-tab:hover:not(.active) {
    background: var(--border-color, #e2e8f0);
    color: var(--text-color, #0f172a);
}

.metadata-quality-results {
    display: grid !important;
    gap: 14px !important;
    padding: clamp(14px, 2vw, 20px) !important;
    border-radius: 18px !important;
}

.metadata-quality-results .section-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
}

.metadata-quality-results .section-title,
.metadata-quality-results .section-subtitle {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: keep-all;
}

.metadata-quality-results .section-subtitle {
    margin-top: 4px;
    color: var(--text-secondary, #64748b);
    font-size: .92rem;
}

.metadata-result-count {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 11px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent-color, #00c73c) 10%, transparent);
    color: var(--accent-color, #00a832);
    font-size: .86rem;
    font-weight: 900;
    white-space: nowrap;
}

.metadata-quality-page .metadata-bulk-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    width: 100%;
    min-width: 0;
    margin: 0 !important;
}

.metadata-quality-table-container {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.metadata-quality-table-container .metadata-table {
    min-width: 1060px;
}

.metadata-quality-table-container .metadata-table td,
.metadata-quality-table-container .metadata-table th {
    vertical-align: top;
}

.metadata-quality-table-container .metadata-table td:nth-child(3),
.metadata-quality-table-container .metadata-table td:nth-child(4),
.metadata-quality-table-container .metadata-table td:nth-child(7) {
    max-width: 280px;
    overflow-wrap: anywhere;
    word-break: keep-all;
}

.metadata-quality-table-container .metadata-table small {
    display: block;
    margin-top: 4px;
    color: var(--text-secondary, #64748b);
    overflow-wrap: anywhere;
}

.metadata-quality-page .metadata-card-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
    gap: 16px !important;
}

.metadata-quality-card {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    min-width: 0;
    padding: 20px !important;
    border-radius: 20px !important;
    background: var(--card-bg, rgba(255, 255, 255, 0.85)) !important;
    border: 1px solid var(--border-color, rgba(226, 232, 240, 0.8)) !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.03), 0 1px 8px rgba(15, 23, 42, 0.02) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    overflow: hidden;
}

.metadata-quality-card:hover {
    transform: translateY(-5px) !important;
    border-color: var(--accent-color, #00CD3C) !important;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08), 0 1px 10px rgba(0, 205, 60, 0.05) !important;
}

.metadata-quality-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    border-bottom: 1px solid var(--border-color, rgba(226, 232, 240, 0.6));
    padding-bottom: 10px;
    margin-bottom: 2px;
}

.metadata-card-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary, #64748b);
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
}

.metadata-card-check input {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    accent-color: var(--accent-color, #00CD3C);
    cursor: pointer;
}

.metadata-card-id {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--accent-color, #00CD3C);
    background: color-mix(in srgb, var(--accent-color, #00CD3C) 10%, transparent);
    padding: 3px 8px;
    border-radius: 999px;
}

.metadata-quality-card strong,
.metadata-quality-card span,
.metadata-quality-card small,
.metadata-quality-card p {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: keep-all;
}

.metadata-quality-card strong {
    font-size: 1.12rem !important;
    font-weight: 700 !important;
    color: var(--text-color, #1e293b) !important;
    letter-spacing: -0.02em;
    line-height: 1.4 !important;
}

.metadata-quality-card span {
    font-size: 0.92rem !important;
    color: var(--text-color, #334155) !important;
    font-weight: 500;
}

.metadata-quality-card small {
    font-size: 0.82rem !important;
    color: var(--text-secondary, #64748b) !important;
}

.metadata-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
    margin-top: 4px;
}

.metadata-quality-page .metadata-badge {
    margin: 0;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    padding: 4px 10px !important;
    border-radius: 8px !important;
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #e2e8f0 !important;
    letter-spacing: -0.01em;
}

/* 뱃지 타입별 프리미엄 스타일 지정 */
.metadata-quality-page .metadata-badge.badge-danger {
    background: rgba(239, 68, 68, 0.08) !important;
    color: #dc2626 !important;
    border-color: rgba(239, 68, 68, 0.15) !important;
}

.metadata-quality-page .metadata-badge.badge-warning {
    background: rgba(245, 158, 11, 0.08) !important;
    color: #d97706 !important;
    border-color: rgba(245, 158, 11, 0.15) !important;
}

.metadata-quality-page .metadata-badge.badge-success {
    background: rgba(16, 185, 129, 0.08) !important;
    color: #059669 !important;
    border-color: rgba(16, 185, 129, 0.15) !important;
}

.metadata-quality-page .metadata-badge.badge-info {
    background: rgba(59, 130, 246, 0.08) !important;
    color: #2563eb !important;
    border-color: rgba(59, 130, 246, 0.15) !important;
}

.metadata-quality-page .metadata-error {
    margin: 4px 0 0 0 !important;
    padding: 12px 14px !important;
    border-radius: 12px !important;
    background: rgba(239, 68, 68, 0.04) !important;
    color: #b91c1c !important;
    font-size: 0.8rem !important;
    line-height: 1.5 !important;
    border-left: 3px solid #ef4444 !important;
    word-break: break-all !important;
}

/* 카드 뷰 내의 액션 정렬 설정 */
.metadata-quality-page .song-action-group {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    margin-top: 6px !important;
}

.metadata-quality-page .song-action-group .btn,
.metadata-quality-page .song-action-group .inline-action-form,
.metadata-quality-page .song-action-group .inline-action-form .btn {
    display: inline-block !important;
    margin: 0 !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
}

.metadata-quality-page .inline-action-form {
    display: inline-block !important;
}

body.theme-dark .metadata-quality-card {
    box-shadow: none !important;
    background: var(--bg-secondary, #1e293b) !important;
    border-color: var(--border-color, #334155) !important;
}

@media (max-width: 1199px) {
    .metadata-quality-filter-section .form-row {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .metadata-quality-page .metadata-card-list {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }

    .metadata-quality-page .metadata-bulk-actions {
        display: flex !important;
        justify-content: flex-start !important;
    }

    .metadata-quality-page .song-action-group .btn,
    .metadata-quality-page .song-action-group .inline-action-form {
        width: auto !important;
    }
}

@media (max-width: 767px) {
    .metadata-quality-filter-section .form-row {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .metadata-quality-results .section-heading-row {
        align-items: stretch;
        flex-direction: column;
    }

    .metadata-result-count {
        width: fit-content;
    }

    .metadata-quality-page .metadata-card-list {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 12px !important;
    }

    .metadata-quality-page .metadata-bulk-actions {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        justify-content: stretch !important;
    }

    .metadata-quality-page .metadata-bulk-actions .btn {
        width: 100% !important;
    }

    .metadata-quality-page .song-action-group .btn,
    .metadata-quality-page .song-action-group .inline-action-form {
        width: auto !important;
    }
}

/* Auto playlist detail action column final clamp */
.auto-playlist-song-section .song-list-container {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-gutter: stable both-edges;
}

.auto-playlist-song-section .song-table {
    table-layout: auto !important;
    width: 100% !important;
    min-width: 1120px !important;
}

.auto-playlist-song-section .song-table th:first-child,
.auto-playlist-song-section .song-table td:first-child {
    width: 74px !important;
    min-width: 74px !important;
}

.auto-playlist-song-section .song-table th:nth-child(2),
.auto-playlist-song-section .song-table td.song-title-cell {
    width: 28% !important;
    min-width: 260px !important;
}

.auto-playlist-song-section .song-table th:nth-child(3),
.auto-playlist-song-section .song-table td.artist-cell {
    width: 150px !important;
    min-width: 150px !important;
}

.auto-playlist-song-section .song-table th:nth-child(4),
.auto-playlist-song-section .song-table td.album-cell {
    min-width: 170px !important;
}

.auto-playlist-song-section .song-table th:nth-child(6),
.auto-playlist-song-section .song-table td.duration-cell,
.auto-playlist-song-section .song-table th:nth-child(7),
.auto-playlist-song-section .song-table td.format-cell,
.auto-playlist-song-section .song-table th:nth-child(8),
.auto-playlist-song-section .song-table td.play-count-td {
    width: 92px !important;
    min-width: 92px !important;
}

.auto-playlist-song-section .song-table th:last-child,
.auto-playlist-song-section .song-table td.actions-cell,
.auto-playlist-song-section .song-table td:last-child {
    width: 178px !important;
    min-width: 178px !important;
    max-width: 178px !important;
    padding-left: 12px !important;
    padding-right: 18px !important;
    overflow: visible !important;
    white-space: nowrap !important;
}

.auto-playlist-song-section .song-table .song-action-group {
    display: inline-grid !important;
    grid-template-columns: repeat(3, 42px) !important;
    justify-content: center !important;
    justify-items: center !important;
    align-items: center !important;
    gap: 8px !important;
    width: 142px !important;
    min-width: 142px !important;
    max-width: 142px !important;
    overflow: visible !important;
}

.auto-playlist-song-section .song-table .like-btn,
.auto-playlist-song-section .song-table .add-playlist-btn,
.auto-playlist-song-section .song-table .download-song-btn {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
    flex: 0 0 42px !important;
}

.auto-playlist-song-section .song-title-wrap,
.auto-playlist-song-section .song-title-stack {
    min-width: 0 !important;
    max-width: 100% !important;
}

.auto-playlist-song-section .song-list-badges {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    max-width: 100% !important;
}

.auto-playlist-song-section .recommend-reason-badge {
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    line-height: 1.2 !important;
}

@media (min-width: 768px) and (max-width: 1366px) {
    body.is-tablet-layout .auto-playlist-song-section .song-list-container {
        overflow-x: visible;
    }

    body.is-tablet-layout .auto-playlist-song-section .song-table {
        min-width: 0 !important;
    }

    body.is-tablet-layout .auto-playlist-song-section .song-table tr.song-item {
        grid-template-columns: 42px 58px minmax(0, 1fr) 142px !important;
    }

    body.is-tablet-layout .auto-playlist-song-section .song-table tr.song-item .actions-cell,
    body.is-tablet-layout .auto-playlist-song-section .song-table tr.song-item td:last-child {
        width: 142px !important;
        min-width: 142px !important;
        max-width: 142px !important;
        padding-right: 0 !important;
    }

    body.is-tablet-layout .auto-playlist-song-section .song-table tr.song-item .song-action-group {
        grid-template-columns: repeat(3, 40px) !important;
        width: 136px !important;
        min-width: 136px !important;
        max-width: 136px !important;
        gap: 8px !important;
    }

    body.is-tablet-layout .auto-playlist-song-section .song-table tr.song-item .like-btn,
    body.is-tablet-layout .auto-playlist-song-section .song-table tr.song-item .add-playlist-btn,
    body.is-tablet-layout .auto-playlist-song-section .song-table tr.song-item .download-song-btn {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
    }
}

@media (max-width: 767px) {
    .auto-playlist-song-section .song-list-container {
        overflow-x: visible;
    }

    .auto-playlist-song-section .song-table {
        min-width: 0 !important;
    }

    .auto-playlist-song-section .song-table tr.song-item {
        grid-template-columns: 40px 54px minmax(0, 1fr) 88px !important;
    }

    .auto-playlist-song-section .song-table tr.song-item .actions-cell,
    .auto-playlist-song-section .song-table tr.song-item td:last-child {
        width: 88px !important;
        min-width: 88px !important;
        max-width: 88px !important;
        padding-right: 0 !important;
    }

    .auto-playlist-song-section .song-table tr.song-item .song-action-group {
        grid-template-columns: repeat(2, 38px) !important;
        width: 84px !important;
        min-width: 84px !important;
        max-width: 84px !important;
        gap: 8px !important;
    }
}

/* Desktop song table action column guard */
@media (min-width: 1200px) {
    .song-list-container {
        max-width: 100%;
        overflow-x: auto;
        overflow-y: visible;
        scrollbar-gutter: stable both-edges;
    }

    .song-list-container .song-table {
        width: 100% !important;
        min-width: 1120px !important;
        table-layout: auto !important;
    }

    .song-list-container .song-table th:first-child,
    .song-list-container .song-table td:first-child {
        width: 74px !important;
        min-width: 74px !important;
    }

    .song-list-container .song-table th:nth-child(2),
    .song-list-container .song-table td.song-title-cell {
        width: 28% !important;
        min-width: 260px !important;
    }

    .song-list-container .song-table th:nth-child(3),
    .song-list-container .song-table td.artist-cell {
        min-width: 150px !important;
    }

    .song-list-container .song-table th:nth-child(4),
    .song-list-container .song-table td.album-cell {
        min-width: 170px !important;
    }

    .song-list-container .song-table th:nth-child(6),
    .song-list-container .song-table td.duration-cell,
    .song-list-container .song-table th:nth-child(7),
    .song-list-container .song-table td.format-cell,
    .song-list-container .song-table th:nth-child(8),
    .song-list-container .song-table td.play-count-td {
        width: 92px !important;
        min-width: 92px !important;
    }

    .song-list-container .song-table th:last-child,
    .song-list-container .song-table td.actions-cell,
    .song-list-container .song-table td:last-child {
        width: 190px !important;
        min-width: 190px !important;
        max-width: 190px !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
        overflow: visible !important;
        white-space: nowrap !important;
    }

    .song-list-container .song-table .song-action-group {
        display: inline-grid !important;
        grid-template-columns: repeat(4, 38px) !important;
        justify-content: center !important;
        justify-items: center !important;
        align-items: center !important;
        gap: 6px !important;
        width: 170px !important;
        min-width: 170px !important;
        max-width: 170px !important;
        overflow: visible !important;
    }

    .song-list-container .song-table .like-btn,
    .song-list-container .song-table .add-playlist-btn,
    .song-list-container .song-table .download-song-btn,
    .song-list-container .song-table .metadata-request-btn,
    .song-list-container .song-table .remove-playlist-song-btn {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
        flex: 0 0 38px !important;
    }

    .song-list-container .song-table .song-title-wrap,
    .song-list-container .song-table .song-title-stack {
        min-width: 0 !important;
        max-width: 100% !important;
    }
}

/* Song detail spec card cleanup */
.song-detail-page .song-spec-card {
    display: grid !important;
    align-content: start !important;
    gap: 16px !important;
    overflow: hidden;
}

.song-detail-page .song-spec-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    margin: 0;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.song-detail-page .song-spec-heading i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent-color, #00c73c) 12%, transparent);
    color: var(--accent-color, #00a832);
}

.song-detail-page .song-spec-heading h2 {
    margin: 0;
    min-width: 0;
    color: var(--text-primary, var(--text-color, #0f172a));
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1.3;
    overflow-wrap: anywhere;
    word-break: keep-all;
}

.song-detail-page .song-spec-list {
    display: grid;
    gap: 0;
    margin: 0;
    min-width: 0;
}

.song-detail-page .song-spec-row {
    display: grid;
    grid-template-columns: minmax(104px, 0.34fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    min-width: 0;
    padding: 13px 0;
    border-top: 1px solid color-mix(in srgb, var(--border-color) 86%, transparent);
}

.song-detail-page .song-spec-row:first-child {
    border-top: 0;
}

.song-detail-page .song-spec-row dt,
.song-detail-page .song-spec-row dd {
    min-width: 0;
    max-width: 100%;
    margin: 0;
    background: transparent !important;
    box-shadow: none !important;
    overflow-wrap: anywhere;
    word-break: keep-all;
}

.song-detail-page .song-spec-row dt {
    color: var(--text-secondary, #64748b);
    font-size: .86rem;
    font-weight: 800;
    line-height: 1.35;
}

.song-detail-page .song-spec-row dd {
    color: var(--text-primary, var(--text-color, #0f172a));
    font-size: .94rem;
    font-weight: 700;
    line-height: 1.45;
}

.song-detail-page .song-spec-primary {
    font-weight: 900 !important;
}

.song-detail-page .song-spec-muted {
    color: var(--text-muted, var(--text-secondary, #64748b)) !important;
    font-weight: 700 !important;
}

.song-detail-page .song-spec-accent {
    color: var(--accent-color, #00a832) !important;
    font-weight: 900 !important;
}

.song-detail-page .song-spec-liked {
    color: #e11d48 !important;
    font-weight: 900 !important;
}

.song-detail-page .song-spec-format {
    display: inline-flex !important;
    width: fit-content;
    min-height: 24px;
    align-items: center;
    justify-content: center;
    padding: 3px 9px !important;
    border-radius: 8px !important;
    background: var(--surface-soft, var(--bg-tertiary)) !important;
    color: var(--text-secondary, #64748b) !important;
    font-size: .78rem !important;
    font-weight: 900 !important;
    letter-spacing: 0 !important;
}

@media (min-width: 768px) and (max-width: 1199px) {
    body.is-tablet-layout .song-detail-page .song-spec-row {
        grid-template-columns: minmax(96px, .32fr) minmax(0, 1fr);
        gap: 14px;
    }
}

@media (max-width: 767px) {
    .song-detail-page .song-spec-card {
        gap: 12px !important;
    }

    .song-detail-page .song-spec-heading {
        padding-bottom: 12px;
    }

    .song-detail-page .song-spec-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 5px;
        padding: 11px 0;
    }

    .song-detail-page .song-spec-row dt {
        font-size: .78rem;
    }

    .song-detail-page .song-spec-row dd {
        font-size: .94rem;
    }
}
/* Metadata correction request */
.metadata-request-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--text);
    cursor: pointer;
    transition: border-color .2s ease, color .2s ease, background .2s ease, transform .2s ease;
}

.metadata-request-btn:hover,
.metadata-request-btn:focus-visible {
    border-color: rgba(0, 200, 83, .45);
    color: var(--primary);
    background: rgba(0, 200, 83, .08);
    outline: none;
}

.compact-song-actions .metadata-request-btn,
.song-action-group .metadata-request-btn {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
}

.compact-song-actions {
    flex-wrap: wrap !important;
    min-width: 86px !important;
    max-width: 90px !important;
}

.metadata-request-context {
    display: grid;
    gap: 5px;
}

.metadata-request-context span,
.metadata-request-admin-page dd,
.metadata-request-admin-page .feedback-body-box {
    overflow-wrap: anywhere;
}

.metadata-request-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 16px 0;
}

.metadata-request-detail-grid h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.metadata-request-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0;
}

.feedback-status-badge.status-applied {
    background: rgba(0, 200, 83, .12);
    color: var(--primary);
}

.feedback-status-badge.status-rejected {
    background: rgba(239, 68, 68, .1);
    color: var(--danger);
}

@media (max-width: 767px) {
    .metadata-request-detail-grid {
        grid-template-columns: 1fr;
    }

    .compact-song-actions {
        min-width: 42px !important;
        max-width: 42px !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
    }
}

/* All music desktop table spacing */
@media (min-width: 1200px) {
    .music-list-page .song-list-container .song-table {
        table-layout: fixed !important;
        min-width: 1080px !important;
    }

    .music-list-page .song-list-container .song-table th,
    .music-list-page .song-list-container .song-table td {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .music-list-page .song-list-container .song-table th:nth-child(1),
    .music-list-page .song-list-container .song-table td:nth-child(1) {
        width: 58px !important;
        min-width: 58px !important;
        max-width: 58px !important;
    }

    .music-list-page .song-list-container .song-table th:nth-child(2),
    .music-list-page .song-list-container .song-table td.song-title-cell {
        width: 24% !important;
        min-width: 250px !important;
        max-width: 340px !important;
        padding-right: 8px !important;
    }

    .music-list-page .song-list-container .song-table th:nth-child(3),
    .music-list-page .song-list-container .song-table td.artist-cell {
        width: 13% !important;
        min-width: 130px !important;
        max-width: 190px !important;
        padding-left: 8px !important;
    }

    .music-list-page .song-list-container .song-table th:nth-child(4),
    .music-list-page .song-list-container .song-table td.album-cell {
        width: 18% !important;
        min-width: 170px !important;
        max-width: 250px !important;
    }

    .music-list-page .song-list-container .song-table th:nth-child(5),
    .music-list-page .song-list-container .song-table td.genre-cell {
        width: 11% !important;
        min-width: 120px !important;
        max-width: 160px !important;
    }

    .music-list-page .song-list-container .song-table th:nth-child(6),
    .music-list-page .song-list-container .song-table td.duration-cell,
    .music-list-page .song-list-container .song-table th:nth-child(7),
    .music-list-page .song-list-container .song-table td.format-cell,
    .music-list-page .song-list-container .song-table th:nth-child(8),
    .music-list-page .song-list-container .song-table td.play-count-td {
        width: 78px !important;
        min-width: 72px !important;
        max-width: 84px !important;
    }

    .music-list-page .song-list-container .song-table th:last-child,
    .music-list-page .song-list-container .song-table td.actions-cell,
    .music-list-page .song-list-container .song-table td:last-child {
        width: 190px !important;
        min-width: 190px !important;
        max-width: 190px !important;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .music-list-page .song-list-container .song-table .song-action-group {
        display: inline-grid !important;
        grid-template-columns: repeat(4, 38px) !important;
        justify-content: center !important;
        justify-items: center !important;
        align-items: center !important;
        gap: 6px !important;
        width: 170px !important;
        min-width: 170px !important;
        max-width: 170px !important;
        overflow: visible !important;
        white-space: nowrap !important;
    }

    .music-list-page .song-list-container .song-table .like-btn,
    .music-list-page .song-list-container .song-table .add-playlist-btn,
    .music-list-page .song-list-container .song-table .download-song-btn,
    .music-list-page .song-list-container .song-table .metadata-request-btn,
    .music-list-page .song-list-container .song-table .remove-playlist-song-btn {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
        flex: 0 0 38px !important;
    }

    .music-list-page .song-list-container .song-table .song-title-wrap,
    .music-list-page .song-list-container .song-table .song-title-stack {
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .music-list-page .song-list-container .song-table .song-title-wrap {
        overflow: hidden !important;
    }

    .music-list-page .song-list-container .song-table .song-title-link,
    .music-list-page .song-list-container .song-table .artist-cell,
    .music-list-page .song-list-container .song-table .album-cell,
    .music-list-page .song-list-container .song-table .genre-cell {
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .music-list-page .song-list-container .song-table .song-title-link {
        display: block !important;
        max-width: 100% !important;
    }

    .music-list-page .song-list-container .song-table .song-list-badges {
        max-width: 100% !important;
        overflow: hidden !important;
    }

    .music-list-page .song-list-container .song-table .song-note-badge,
    .music-list-page .song-list-container .song-table .recommend-reason-badge {
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
}

/* Fullscreen player maintenance zone:
   - 65.x and 66.0 are legacy late overrides from previous bug fixes.
   - 67.0 is the structural source of truth for tab/progress/control spacing.
   - When the fullscreen player overlaps, adjust 67.0 variables first.
*/

/* 65.1 fullscreen queue/lyrics collapsed polish */
@media (min-width: 1200px) {
    .expand-player-container.is-tab-collapsed {
        width: min(1040px, calc(100vw - 72px)) !important;
        height: min(820px, calc(100dvh - var(--safe-top, 0px) - var(--safe-bottom, 0px) - 56px)) !important;
        display: grid !important;
        grid-template-rows: minmax(0, 1fr) auto !important;
        row-gap: clamp(14px, 2vw, 24px) !important;
        padding: clamp(26px, 3vw, 42px) !important;
    }

    .expand-player-container.is-tab-collapsed .expand-player-main {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: clamp(14px, 2vw, 22px) !important;
        width: 100% !important;
        max-width: 760px !important;
        min-height: 0 !important;
        margin: 0 auto !important;
        overflow: visible !important;
    }

    .expand-player-container.is-tab-collapsed .expand-art-section {
        width: min(100%, 640px) !important;
        max-width: 640px !important;
        margin: 0 auto !important;
        padding: 0 !important;
        gap: clamp(14px, 1.8vw, 20px) !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
    }

    .expand-player-container.is-tab-collapsed .expand-album-art {
        width: clamp(260px, 27vw, 380px) !important;
        height: clamp(260px, 27vw, 380px) !important;
        margin: 0 auto !important;
    }

    .expand-player-container.is-tab-collapsed .expand-song-meta {
        width: min(100%, 640px) !important;
        max-width: 640px !important;
        margin: 0 auto !important;
        text-align: center !important;
    }

    .expand-player-container.is-tab-collapsed .expand-song-meta h2 {
        max-width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        text-align: center !important;
        font-size: clamp(2rem, 3vw, 3rem) !important;
    }

    .expand-player-container.is-tab-collapsed .expand-song-meta p,
    .expand-player-container.is-tab-collapsed .mini-lyrics-line {
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .expand-player-container.is-tab-collapsed .expand-tab-section {
        width: min(560px, 100%) !important;
        max-width: 560px !important;
        min-height: 0 !important;
        height: auto !important;
        flex: 0 0 auto !important;
        align-self: center !important;
        justify-self: center !important;
        margin: 0 auto !important;
        border-radius: 24px !important;
        box-shadow:
            0 16px 36px rgba(15, 23, 42, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.72) !important;
    }

    .expand-player-container.is-tab-collapsed .expand-tab-headers {
        display: grid !important;
        grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) minmax(104px, .78fr) !important;
        width: 100% !important;
        min-height: 56px !important;
        padding: 8px !important;
        border-bottom: 0 !important;
        gap: 8px !important;
    }

    .expand-player-container.is-tab-collapsed .tab-header-btn,
    .expand-player-container.is-tab-collapsed .expand-tab-collapse-btn {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 40px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .expand-player-container.is-tab-collapsed #expand-tab-queue-content,
    .expand-player-container.is-tab-collapsed #expand-tab-lyrics-content {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    .expand-player-container.is-tab-collapsed .expand-player-controls {
        width: min(760px, 100%) !important;
        max-width: 760px !important;
        margin: 0 auto !important;
        padding: 0 !important;
        align-self: center !important;
        justify-self: center !important;
    }
}

.expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-lyrics-full-text.is-lyrics-empty {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 16px !important;
    text-align: center !important;
    min-height: 100% !important;
}

.expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-lyrics-full-text.is-lyrics-empty .queue-empty-text {
    max-width: 320px !important;
    margin: 0 auto !important;
    color: var(--text-secondary, #64748b) !important;
    font-weight: 700 !important;
}

/* 65.2 PC fullscreen player panel spacing and empty lyrics polish */
@media (min-width: 1200px) {
    .expand-player-container.is-tab-collapsed {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: clamp(20px, 2.4vw, 34px) !important;
    }

    .expand-player-container.is-tab-collapsed .expand-player-main {
        flex: 0 1 auto !important;
        min-height: 0 !important;
    }

    .expand-player-container.is-tab-collapsed .expand-tab-section {
        margin-bottom: 0 !important;
    }

    .expand-player-container.is-tab-collapsed .expand-player-controls {
        position: relative !important;
        z-index: 4 !important;
        flex: 0 0 auto !important;
        width: min(720px, 100%) !important;
        max-width: 720px !important;
        margin: 0 auto !important;
    }

    .expand-player-container.is-tab-collapsed .expand-player-controls .progress-container {
        margin-bottom: clamp(14px, 1.6vw, 20px) !important;
    }

    .expand-player-container.is-queue-view:not(.is-tab-collapsed),
    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) {
        grid-template-rows: minmax(0, 1fr) auto !important;
        row-gap: clamp(26px, 3vw, 42px) !important;
    }

    .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-player-main,
    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-player-main {
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-tab-section,
    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-tab-section {
        margin-bottom: clamp(8px, 1.2vw, 16px) !important;
    }

    .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-player-controls,
    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-player-controls {
        position: relative !important;
        z-index: 4 !important;
        width: min(720px, 100%) !important;
        max-width: 720px !important;
        margin: 0 auto !important;
        padding: 0 !important;
    }

    .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-player-controls .progress-container,
    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-player-controls .progress-container {
        margin-bottom: clamp(14px, 1.6vw, 20px) !important;
    }

    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) #expand-tab-lyrics-content {
        align-items: stretch !important;
    }

    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) #expand-btn-lyrics-toggle {
        flex: 0 0 auto !important;
        align-self: flex-start !important;
        width: auto !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 38px !important;
        writing-mode: horizontal-tb !important;
        white-space: nowrap !important;
    }

    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) #expand-btn-lyrics-toggle.no-lyrics {
        display: none !important;
    }

    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-lyrics-full-text.is-lyrics-empty {
        width: 100% !important;
        min-height: 0 !important;
        padding: clamp(28px, 4vw, 48px) clamp(18px, 3vw, 32px) !important;
    }

    .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-lyrics-full-text.is-lyrics-empty .lyrics-edit-inline-link {
        display: inline-flex !important;
        flex: 0 0 auto !important;
        align-self: center !important;
        justify-content: center !important;
        width: auto !important;
        max-width: 100% !important;
        min-height: 40px !important;
        padding: 10px 18px !important;
        writing-mode: horizontal-tb !important;
        white-space: nowrap !important;
    }
}

/* 65.3 stronger PC collapsed fullscreen separation */
@media (min-width: 1200px) {
    .expand-player-container.is-tab-collapsed.is-queue-view,
    .expand-player-container.is-tab-collapsed.is-lyrics-view {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0 !important;
        overflow: hidden !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-player-main,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-player-main {
        display: flex !important;
        flex: 0 1 auto !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        max-width: 760px !important;
        min-height: 0 !important;
        margin: 0 auto !important;
        gap: clamp(18px, 2vw, 28px) !important;
        overflow: visible !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-tab-section,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-tab-section {
        flex: 0 0 auto !important;
        width: min(560px, 100%) !important;
        max-width: 560px !important;
        min-height: 0 !important;
        height: auto !important;
        margin: clamp(8px, 1.1vw, 14px) auto 0 !important;
        align-self: center !important;
        justify-self: center !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-tab-headers,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-tab-headers {
        min-height: 56px !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-player-controls,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-player-controls {
        position: relative !important;
        z-index: 6 !important;
        display: block !important;
        flex: 0 0 auto !important;
        width: min(720px, 100%) !important;
        max-width: 720px !important;
        min-height: 0 !important;
        margin: clamp(32px, 3vw, 48px) auto 0 !important;
        padding: 0 !important;
        transform: none !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-player-controls .progress-container,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-player-controls .progress-container {
        position: relative !important;
        z-index: 1 !important;
        display: grid !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 0 clamp(16px, 1.8vw, 22px) !important;
        padding: 0 !important;
        transform: none !important;
        background: transparent !important;
    }

    .expand-player-container.is-tab-collapsed.is-queue-view .expand-player-controls #expand-progress-wrapper,
    .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-player-controls #expand-progress-wrapper {
        position: relative !important;
        z-index: 1 !important;
        margin: 0 !important;
        transform: none !important;
    }
}

/* 66.0 final CSS conflict guard for fullscreen player */
@media (min-width: 1200px) {
    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-queue-view,
    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-lyrics-view {
        display: grid !important;
        grid-template-rows: auto auto !important;
        align-content: center !important;
        justify-items: center !important;
        row-gap: clamp(28px, 3vw, 46px) !important;
        width: min(980px, calc(100vw - 72px)) !important;
        height: auto !important;
        max-height: calc(100dvh - var(--safe-top, 0px) - var(--safe-bottom, 0px) - 56px) !important;
        padding: clamp(28px, 3vw, 42px) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-queue-view .expand-player-main,
    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-player-main {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        width: min(720px, 100%) !important;
        max-width: 720px !important;
        min-height: 0 !important;
        margin: 0 auto !important;
        gap: clamp(16px, 2vw, 24px) !important;
        overflow: visible !important;
    }

    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-queue-view .expand-art-section,
    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-art-section {
        width: min(620px, 100%) !important;
        max-width: 620px !important;
        gap: clamp(12px, 1.7vw, 18px) !important;
        padding: 0 !important;
        text-align: center !important;
    }

    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-queue-view .expand-album-art,
    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-album-art {
        width: clamp(220px, 22vw, 320px) !important;
        height: clamp(220px, 22vw, 320px) !important;
        margin: 0 auto !important;
        object-fit: cover !important;
    }

    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-queue-view .expand-song-meta,
    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-song-meta {
        width: min(620px, 100%) !important;
        max-width: 620px !important;
        margin: 0 auto !important;
        text-align: center !important;
    }

    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-queue-view .expand-song-meta h2,
    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-song-meta h2 {
        display: -webkit-box !important;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden !important;
        max-width: 100% !important;
        margin: 0 auto 10px !important;
        font-size: clamp(1.7rem, 2.7vw, 2.7rem) !important;
        line-height: 1.1 !important;
        text-align: center !important;
        word-break: keep-all !important;
        overflow-wrap: anywhere !important;
    }

    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-queue-view .expand-song-meta p,
    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-song-meta p,
    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-queue-view .mini-lyrics-line,
    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-lyrics-view .mini-lyrics-line {
        margin-left: auto !important;
        margin-right: auto !important;
        text-align: center !important;
    }

    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-queue-view .expand-tab-section,
    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-tab-section {
        flex: 0 0 auto !important;
        width: min(540px, 100%) !important;
        max-width: 540px !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 auto !important;
        align-self: center !important;
        justify-self: center !important;
        overflow: hidden !important;
    }

    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-queue-view .expand-tab-headers,
    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-tab-headers {
        display: grid !important;
        grid-template-columns: minmax(108px, 1fr) minmax(108px, 1fr) minmax(96px, .78fr) !important;
        min-height: 54px !important;
        padding: 7px !important;
        gap: 7px !important;
        border-bottom: 0 !important;
    }

    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-queue-view .expand-tab-content,
    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-tab-content,
    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-queue-view #expand-tab-queue-content,
    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-lyrics-view #expand-tab-queue-content,
    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-queue-view #expand-tab-lyrics-content,
    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-lyrics-view #expand-tab-lyrics-content {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-queue-view .expand-player-controls,
    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-player-controls {
        position: static !important;
        z-index: auto !important;
        display: block !important;
        width: min(700px, 100%) !important;
        max-width: 700px !important;
        margin: 0 auto !important;
        padding: 0 !important;
        align-self: center !important;
        justify-self: center !important;
        transform: none !important;
    }

    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-queue-view .expand-player-controls .progress-container,
    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-player-controls .progress-container {
        position: static !important;
        display: grid !important;
        grid-template-columns: 50px minmax(0, 1fr) 50px !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 0 clamp(18px, 1.8vw, 24px) !important;
        padding: 0 !important;
        background: transparent !important;
        transform: none !important;
    }

    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-queue-view .expand-player-controls #expand-progress-wrapper,
    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-lyrics-view .expand-player-controls #expand-progress-wrapper {
        position: relative !important;
        margin: 0 !important;
        transform: none !important;
    }

    .expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed),
    .expand-player-overlay .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) {
        grid-template-rows: minmax(0, 1fr) auto !important;
        row-gap: clamp(30px, 3vw, 48px) !important;
        overflow: hidden !important;
    }

    .expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-player-controls,
    .expand-player-overlay .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-player-controls {
        position: static !important;
        width: min(720px, 100%) !important;
        max-width: 720px !important;
        margin: 0 auto !important;
        padding: 0 !important;
        transform: none !important;
    }

    .expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-player-controls .progress-container,
    .expand-player-overlay .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-player-controls .progress-container {
        margin-bottom: clamp(18px, 1.8vw, 24px) !important;
    }

    .expand-player-overlay .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) #expand-btn-lyrics-toggle.no-lyrics {
        display: none !important;
    }

    .expand-player-overlay .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-lyrics-full-text.is-lyrics-empty {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        min-height: 100% !important;
        padding: clamp(28px, 4vw, 48px) clamp(18px, 3vw, 32px) !important;
        text-align: center !important;
    }

    .expand-player-overlay .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-lyrics-full-text.is-lyrics-empty .lyrics-edit-inline-link {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: auto !important;
        min-height: 40px !important;
        padding: 10px 18px !important;
        writing-mode: horizontal-tb !important;
        white-space: nowrap !important;
    }
}

/* 67.0 fullscreen player structural guard: keep tabs, progress, and controls from overlapping */
:root {
    --expand-pc-shell-width: min(1120px, calc(100vw - 72px));
    --expand-pc-shell-max-height: calc(100vh - var(--safe-top, 0px) - var(--safe-bottom, 0px) - 56px);
    --expand-pc-shell-padding: clamp(34px, 3vw, 52px);
    --expand-pc-shell-row-gap: clamp(34px, 3vw, 54px);
    --expand-pc-main-gap: clamp(42px, 5vw, 84px);
    --expand-pc-art-width: min(500px, 100%);
    --expand-pc-panel-width: min(540px, 100%);
    --expand-pc-panel-height: min(58vh, 560px);
    --expand-pc-panel-min-height: 360px;
    --expand-pc-controls-width: min(760px, 100%);
    --expand-mobile-panel-row-gap: clamp(14px, 2.6vh, 24px);
    --expand-landscape-panel-height: clamp(220px, 54vh, 430px);
}

@supports (height: 100dvh) {
    :root {
        --expand-pc-shell-max-height: calc(100dvh - var(--safe-top, 0px) - var(--safe-bottom, 0px) - 56px);
        --expand-pc-panel-height: min(58dvh, 560px);
        --expand-mobile-panel-row-gap: clamp(14px, 2.6dvh, 24px);
        --expand-landscape-panel-height: clamp(220px, 54dvh, 430px);
    }
}

.expand-player-overlay .expand-player-container {
    box-sizing: border-box;
}

.expand-player-overlay .expand-player-main,
.expand-player-overlay .expand-player-controls,
.expand-player-overlay .expand-tab-section,
.expand-player-overlay .expand-tab-content,
.expand-player-overlay #expand-tab-queue-content,
.expand-player-overlay #expand-tab-lyrics-content,
.expand-player-overlay .expand-lyrics-full-text {
    box-sizing: border-box;
    min-width: 0;
}

.expand-player-overlay .expand-player-controls {
    flex: 0 0 auto !important;
}

.expand-player-overlay .expand-player-controls .progress-container {
    isolation: isolate;
}

@media (min-width: 1200px) {
    .expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed),
    .expand-player-overlay .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-rows: minmax(0, 1fr) auto !important;
        align-content: center !important;
        justify-items: center !important;
        row-gap: var(--expand-pc-shell-row-gap) !important;
        width: var(--expand-pc-shell-width) !important;
        max-height: var(--expand-pc-shell-max-height) !important;
        overflow: hidden !important;
        padding: var(--expand-pc-shell-padding) !important;
    }

    .expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-player-main,
    .expand-player-overlay .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-player-main {
        grid-row: 1 !important;
        display: grid !important;
        grid-template-columns: minmax(320px, 1fr) minmax(420px, 540px) !important;
        align-items: center !important;
        justify-items: center !important;
        column-gap: var(--expand-pc-main-gap) !important;
        width: 100% !important;
        min-height: 0 !important;
        margin: 0 auto !important;
        overflow: hidden !important;
    }

    .expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-art-section,
    .expand-player-overlay .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-art-section {
        grid-column: 1 !important;
        width: var(--expand-pc-art-width) !important;
        max-width: 500px !important;
        min-width: 0 !important;
        align-self: center !important;
        justify-self: center !important;
    }

    .expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-tab-section,
    .expand-player-overlay .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-tab-section {
        grid-column: 2 !important;
        display: flex !important;
        flex-direction: column !important;
        width: var(--expand-pc-panel-width) !important;
        max-width: 540px !important;
        height: var(--expand-pc-panel-height) !important;
        min-height: var(--expand-pc-panel-min-height) !important;
        max-height: var(--expand-pc-panel-height) !important;
        margin: 0 auto !important;
        align-self: center !important;
        justify-self: center !important;
        overflow: hidden !important;
    }

    .expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-tab-headers,
    .expand-player-overlay .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-tab-headers {
        flex: 0 0 auto !important;
    }

    .expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-tab-content,
    .expand-player-overlay .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-tab-content {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) #expand-queue-list,
    .expand-player-overlay .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) #expand-tab-lyrics-content,
    .expand-player-overlay .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-lyrics-full-text {
        min-height: 0 !important;
        max-height: none !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

    .expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-player-controls,
    .expand-player-overlay .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-player-controls {
        grid-row: 2 !important;
        position: relative !important;
        z-index: 3 !important;
        width: var(--expand-pc-controls-width) !important;
        max-width: 760px !important;
        margin: 0 auto !important;
        padding: 0 !important;
        transform: none !important;
    }

    .expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-player-controls .progress-container,
    .expand-player-overlay .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-player-controls .progress-container {
        position: relative !important;
        z-index: 1 !important;
        display: grid !important;
        grid-template-columns: 52px minmax(0, 1fr) 52px !important;
        align-items: center !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 0 !important;
        margin: 0 0 clamp(22px, 2vw, 30px) !important;
        padding: 0 !important;
        background: transparent !important;
        transform: none !important;
    }

    .expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-player-controls #expand-progress-wrapper,
    .expand-player-overlay .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-player-controls #expand-progress-wrapper {
        position: relative !important;
        z-index: 1 !important;
        margin: 0 !important;
        transform: none !important;
    }
}

@media (max-width: 1199px) {
    .expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed),
    .expand-player-overlay .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-rows: minmax(0, 1fr) auto !important;
        row-gap: var(--expand-mobile-panel-row-gap) !important;
        overflow: hidden !important;
    }

    .expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-player-main,
    .expand-player-overlay .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-player-main {
        grid-row: 1 !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-tab-section,
    .expand-player-overlay .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-tab-section {
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-tab-content,
    .expand-player-overlay .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-tab-content,
    .expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) #expand-queue-list,
    .expand-player-overlay .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) #expand-tab-lyrics-content,
    .expand-player-overlay .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-lyrics-full-text {
        min-height: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

    .expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-player-controls,
    .expand-player-overlay .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-player-controls {
        grid-row: 2 !important;
        position: relative !important;
        z-index: 3 !important;
        width: 100% !important;
        max-width: min(720px, 100%) !important;
        margin: 0 auto !important;
        padding: 0 !important;
        transform: none !important;
    }
}

@media (max-width: 1199px) and (orientation: landscape) {
    .expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-player-main,
    .expand-player-overlay .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-player-main {
        display: grid !important;
        grid-template-columns: minmax(220px, 0.9fr) minmax(320px, 1.1fr) !important;
        align-items: center !important;
        column-gap: clamp(18px, 4vw, 42px) !important;
    }

    .expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-tab-section,
    .expand-player-overlay .expand-player-container.is-lyrics-view:not(.is-tab-collapsed) .expand-tab-section {
        width: 100% !important;
        height: var(--expand-landscape-panel-height) !important;
        max-height: var(--expand-landscape-panel-height) !important;
    }
}

/* 67.1 fullscreen outer-scroll guard: only queue/lyrics content may scroll */
body.expand-player-open {
    overflow: hidden !important;
    overscroll-behavior: none;
}

.expand-player-overlay {
    overflow: hidden !important;
    overscroll-behavior: contain;
}

.expand-player-overlay .expand-player-container,
.expand-player-overlay .expand-player-container.is-tab-collapsed,
.expand-player-overlay .expand-player-container.is-tab-collapsed.is-queue-view,
.expand-player-overlay .expand-player-container.is-tab-collapsed.is-lyrics-view,
.expand-player-overlay .expand-player-container.is-queue-view,
.expand-player-overlay .expand-player-container.is-lyrics-view {
    overflow: hidden !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.expand-player-overlay .expand-player-container::-webkit-scrollbar,
.expand-player-overlay .expand-player-container.is-tab-collapsed::-webkit-scrollbar,
.expand-player-overlay .expand-player-container.is-queue-view::-webkit-scrollbar,
.expand-player-overlay .expand-player-container.is-lyrics-view::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.expand-player-overlay #expand-queue-list,
.expand-player-overlay .expand-lyrics-full-text {
    overscroll-behavior: contain;
}

@media (min-width: 1200px) {
    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-queue-view,
    .expand-player-overlay .expand-player-container.is-tab-collapsed.is-lyrics-view {
        overflow: hidden !important;
        max-height: var(--expand-pc-shell-max-height) !important;
    }
}

/* Final mobile input zoom guard for styles loaded after style.css. */
@media (hover: none), (max-width: 1199px) {
    input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]),
    select,
    textarea,
    .form-control,
    .search-input,
    .filter-input,
    .download-filename-input,
    .sidebar-menu-filter input {
        font-size: 16px !important;
        line-height: 1.35 !important;
        -webkit-text-size-adjust: 100%;
    }

    input::placeholder,
    textarea::placeholder,
    .search-input::placeholder,
    .filter-input::placeholder {
        font-size: 16px !important;
        line-height: 1.35 !important;
    }
}

/* Mobile/tablet bottom player progress must remain visible and JS-width driven. */
@media (max-width: 1199px) {
    body.player-mobile-compact .player-bar .progress-container,
    body.is-mobile-layout.player-mobile-compact .player-bar .progress-container,
    body.is-tablet-layout.player-mobile-compact .player-bar .progress-container,
    .player-bar .progress-container {
        display: grid !important;
        position: absolute !important;
        left: calc(10px + var(--floating-player-art-size, 50px) + 10px) !important;
        right: calc(10px + var(--floating-player-play-size, 52px) + 10px) !important;
        bottom: 6px !important;
        width: auto !important;
        min-width: 0 !important;
        height: 5px !important;
        grid-template-columns: minmax(0, 1fr) !important;
        align-items: center !important;
        gap: 0 !important;
        pointer-events: auto !important;
    }

    body.player-mobile-compact .player-bar .progress-bar-wrapper,
    body.is-mobile-layout.player-mobile-compact .player-bar .progress-bar-wrapper,
    body.is-tablet-layout.player-mobile-compact .player-bar .progress-bar-wrapper,
    .player-bar .progress-bar-wrapper {
        display: block !important;
        position: relative !important;
        width: 100% !important;
        height: 3px !important;
        min-height: 3px !important;
        max-height: 3px !important;
        border-radius: 999px !important;
        overflow: hidden !important;
        background: linear-gradient(90deg, var(--accent-color, #00c73c) 0%, var(--accent-color, #00c73c) var(--player-progress-width, 0%), var(--player-progress-bg, rgba(148, 163, 184, 0.28)) var(--player-progress-width, 0%), var(--player-progress-bg, rgba(148, 163, 184, 0.28)) 100%) !important;
    }

body.player-mobile-compact .player-bar #progress-bar,
body.is-mobile-layout.player-mobile-compact .player-bar #progress-bar,
body.is-tablet-layout.player-mobile-compact .player-bar #progress-bar,
.player-bar #progress-bar {
        display: block !important;
        width: var(--player-progress-width, 0%) !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: 100% !important;
        transform: none !important;
        transition: width 120ms linear !important;
        will-change: width;
    }
}

/* 29차: continuous playback transition state */
.player-bar.is-track-loading {
    border-color: color-mix(in srgb, var(--accent-color, #00c73c) 42%, var(--border-color, #dbe4ef)) !important;
}

.player-bar.is-track-loading .player-album-art,
.expand-player-overlay.is-track-loading .expand-album-art {
    position: relative;
    filter: saturate(1.04);
}

.player-bar.is-track-loading .player-album-art::after {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    border: 2px solid color-mix(in srgb, var(--accent-color, #00c73c) 70%, transparent);
    border-top-color: transparent;
    animation: playerTrackLoadingSpin 0.8s linear infinite;
    pointer-events: none;
}

.player-transition-notice {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translate(-50%, 8px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: min(420px, calc(100vw - 28px));
    padding: 9px 14px;
    border: 1px solid color-mix(in srgb, var(--accent-color, #00c73c) 34%, var(--border-color, #dbe4ef));
    border-radius: 999px;
    background: color-mix(in srgb, var(--card-bg, #ffffff) 94%, transparent);
    color: var(--text-primary, #0f172a);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
    font-size: 0.84rem;
    font-weight: 800;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 3;
    transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}

.player-transition-notice.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.queue-empty-state {
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 22px 14px;
    text-align: center;
}

.queue-empty-state .queue-empty-text {
    margin: 0;
}

.queue-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.queue-save-btn,
.queue-clear-after-btn {
    white-space: nowrap;
}

.queue-save-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147482500;
    display: grid;
    place-items: center;
    padding: calc(var(--safe-top, env(safe-area-inset-top, 0px)) + 18px) 18px calc(var(--player-height, 88px) + var(--safe-bottom, env(safe-area-inset-bottom, 0px)) + 18px);
    background: rgba(15, 23, 42, 0.34);
    backdrop-filter: blur(12px);
}

.queue-save-modal-overlay[hidden] {
    display: none !important;
}

.queue-save-modal-box {
    width: min(520px, 100%);
    max-height: min(680px, calc(100dvh - var(--player-height, 88px) - 48px));
    overflow: auto;
    border-radius: 20px;
    border: 1px solid var(--border-color, #dbe4ef);
    background: var(--card-bg, #ffffff);
    color: var(--text-primary, #0f172a);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
    padding: 22px;
}

.queue-save-modal-box h2 {
    margin: 0 36px 8px 0;
    font-size: clamp(1.16rem, 2vw, 1.42rem);
}

.queue-save-summary {
    margin: 0 0 18px;
    color: var(--text-secondary, #64748b);
    font-weight: 700;
}

.queue-save-form {
    display: grid;
    gap: 10px;
}

.queue-save-form label {
    font-weight: 900;
    color: var(--text-primary, #0f172a);
}

.queue-save-form textarea {
    resize: vertical;
    min-height: 88px;
}

.queue-save-open .queue-save-modal-overlay {
    touch-action: manipulation;
}

body.theme-dark .queue-save-modal-box,
body:not(.theme-light) .queue-save-modal-box {
    background: rgba(15, 23, 42, 0.98);
    border-color: rgba(148, 163, 184, 0.3);
    color: #f8fafc;
}

body.theme-dark .queue-save-summary,
body:not(.theme-light) .queue-save-summary {
    color: rgba(226, 232, 240, 0.76);
}

@media (max-width: 767px) {
    .queue-header {
        align-items: flex-start;
        gap: 10px;
    }

    .queue-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .queue-header-actions .btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .queue-save-modal-overlay {
        align-items: end;
        padding: 16px 12px calc(var(--mobile-player-height, var(--player-height, 88px)) + var(--safe-bottom, env(safe-area-inset-bottom, 0px)) + 12px);
    }

    .queue-save-modal-box {
        width: 100%;
        max-height: min(620px, calc(100dvh - var(--mobile-player-height, var(--player-height, 88px)) - 32px));
        border-radius: 18px;
        padding: 18px;
    }
}

@keyframes playerTrackLoadingSpin {
    to {
        transform: rotate(360deg);
    }
}

body.theme-dark .player-transition-notice,
body:not(.theme-light) .player-transition-notice {
    background: rgba(15, 23, 42, 0.96);
    color: #f8fafc;
    border-color: rgba(34, 197, 94, 0.42);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
}

@media (max-width: 1199px) {
    .player-transition-notice {
        bottom: calc(100% + 8px);
        max-width: calc(100vw - 24px);
        padding: 8px 12px;
        font-size: 0.78rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .player-bar.is-track-loading .player-album-art::after {
        animation: none;
    }

    .player-transition-notice {
        transition: none;
    }
}

/* Mobile toast visibility guard: keep notices above the floating player and safe-area. */
.melon-lite-toast {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: calc(var(--player-height, 88px) + var(--safe-bottom, env(safe-area-inset-bottom, 0px)) + 18px) !important;
    width: max-content !important;
    max-width: min(420px, calc(100vw - 28px)) !important;
    transform: translate(-50%, 16px) !important;
    z-index: 2147483000 !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none !important;
}

.melon-lite-toast.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translate(-50%, 0) !important;
}

@media (max-width: 1199px) {
    .melon-lite-toast {
        bottom: calc(var(--mobile-player-height, var(--player-height, 88px)) + var(--safe-bottom, env(safe-area-inset-bottom, 0px)) + 16px) !important;
        max-width: calc(100vw - 24px) !important;
    }
}

body.expand-player-open .melon-lite-toast {
    bottom: calc(var(--safe-bottom, env(safe-area-inset-bottom, 0px)) + 22px) !important;
}

/* Apple Music-like compact player: expose next track next to play on touch layouts. */
@media (max-width: 1199px) {
    .player-bar .player-controls {
        width: calc(var(--mobile-player-play, var(--floating-player-play-size, 52px)) + var(--mobile-player-play, var(--floating-player-play-size, 52px)) + 8px) !important;
        min-width: calc(var(--mobile-player-play, var(--floating-player-play-size, 52px)) + var(--mobile-player-play, var(--floating-player-play-size, 52px)) + 8px) !important;
        height: var(--mobile-player-play, var(--floating-player-play-size, 52px)) !important;
        min-height: var(--mobile-player-play, var(--floating-player-play-size, 52px)) !important;
        justify-self: end !important;
    }

    .player-bar .control-buttons {
        width: 100% !important;
        min-width: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 8px !important;
    }

    .player-bar #btn-shuffle,
    .player-bar #btn-prev,
    .player-bar #btn-repeat,
    .player-bar .player-utils {
        display: none !important;
    }

    .player-bar #btn-next {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: var(--mobile-player-play, var(--floating-player-play-size, 52px)) !important;
        height: var(--mobile-player-play, var(--floating-player-play-size, 52px)) !important;
        min-width: var(--mobile-player-play, var(--floating-player-play-size, 52px)) !important;
        min-height: var(--mobile-player-play, var(--floating-player-play-size, 52px)) !important;
        flex: 0 0 var(--mobile-player-play, var(--floating-player-play-size, 52px)) !important;
        border-radius: 999px !important;
        background: color-mix(in srgb, var(--player-control-bg, #ffffff) 88%, transparent) !important;
        color: var(--text-primary, #0f172a) !important;
        border: 1px solid var(--player-control-border, var(--border-color, #dbe4ef)) !important;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12) !important;
    }

    .player-bar #btn-next i {
        transform: translateX(1px);
    }

    .player-bar .progress-container {
        right: calc(10px + var(--mobile-player-play, var(--floating-player-play-size, 52px)) + var(--mobile-player-play, var(--floating-player-play-size, 52px)) + 18px) !important;
    }
}

@media (max-width: 380px) {
    .player-bar .player-controls {
        width: 102px !important;
        min-width: 102px !important;
    }

    .player-bar .control-buttons {
        gap: 6px !important;
    }

    .player-bar #btn-next {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        flex-basis: 48px !important;
    }

    .player-bar .progress-container {
        right: calc(10px + 96px + 16px) !important;
    }
}

/* Mobile home polish: make library stats feel like an app summary, not an admin counter grid. */
.home-library-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 18px;
}

.home-library-summary span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid color-mix(in srgb, var(--border-color, #dbe4ef) 78%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg-secondary, #ffffff) 88%, transparent);
    color: var(--text-secondary, #64748b);
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.045);
}

.home-library-summary i {
    color: var(--accent-color, #00c73c);
    font-size: 12px;
}

.home-library-summary strong {
    color: var(--text-primary, #0f172a);
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0;
}

body.theme-dark .home-library-summary span {
    background: color-mix(in srgb, var(--bg-secondary, #0f172a) 86%, transparent);
    box-shadow: none;
}

.auto-mix-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--accent-color, #00c73c) 11%, transparent), transparent 56%),
        var(--surface-card, #fff);
}

.auto-mix-copy {
    min-width: 0;
}

.auto-mix-copy p {
    margin: 8px 0 0;
    color: var(--text-secondary, #64748b);
    line-height: 1.55;
}

.auto-mix-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-auto-mix[disabled] {
    opacity: .74;
    cursor: wait;
}

body.theme-dark .auto-mix-panel {
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--accent-color, #00c73c) 14%, transparent), transparent 56%),
        color-mix(in srgb, var(--bg-secondary, #0f172a) 92%, transparent);
}

.listening-report-card {
    display: grid;
    gap: 18px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--accent-color, #00c73c) 10%, transparent), transparent 54%),
        var(--surface-card, #fff);
    overflow: hidden;
}

.listening-report-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
}

.listening-report-head .section-description {
    margin: 5px 0 0;
    color: var(--text-secondary, #64748b);
}

.report-period-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    flex: 0 0 auto;
}

.report-period-tabs a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border-color, #d8e2ef);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface, #fff) 88%, transparent);
    color: var(--text-secondary, #64748b);
    font-weight: 900;
    text-decoration: none;
}

.report-period-tabs a.active {
    border-color: color-mix(in srgb, var(--accent-color, #00c73c) 46%, var(--border-color, #d8e2ef));
    background: color-mix(in srgb, var(--accent-color, #00c73c) 12%, var(--surface, #fff));
    color: var(--accent-color, #00c73c);
}

.listening-report-layout {
    display: grid;
    gap: 14px;
}

.report-metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.report-metric-grid div {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 14px;
    border: 1px solid color-mix(in srgb, var(--border-color, #d8e2ef) 82%, transparent);
    border-radius: 16px;
    background: color-mix(in srgb, var(--surface, #fff) 78%, transparent);
}

.report-metric-grid span,
.report-metric-grid em {
    color: var(--text-secondary, #64748b);
    font-size: 0.82rem;
    font-style: normal;
    font-weight: 800;
}

.report-metric-grid strong {
    color: var(--text-primary, #0f172a);
    font-size: clamp(1.25rem, 2.4vw, 1.9rem);
    line-height: 1.08;
    overflow-wrap: anywhere;
}

.report-top-song {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--accent-color, #00c73c) 28%, var(--border-color, #d8e2ef));
    border-radius: 18px;
    background: color-mix(in srgb, var(--accent-color, #00c73c) 8%, var(--surface, #fff));
}

.report-top-song img {
    width: 92px;
    height: 92px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.report-top-song-meta {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.report-top-song-meta span {
    color: var(--accent-color, #00c73c);
    font-size: 0.78rem;
    font-weight: 900;
}

.report-top-song-meta a {
    color: var(--text-primary, #0f172a);
    font-size: 1.14rem;
    font-weight: 900;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-top-song-meta p {
    margin: 0;
    color: var(--text-secondary, #64748b);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-rank-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.report-rank-box {
    display: grid;
    gap: 8px;
    min-width: 0;
    padding: 14px;
    border: 1px solid color-mix(in srgb, var(--border-color, #d8e2ef) 82%, transparent);
    border-radius: 18px;
    background: color-mix(in srgb, var(--surface, #fff) 76%, transparent);
}

.report-rank-box > strong {
    color: var(--text-primary, #0f172a);
    font-size: 1rem;
}

.report-rank-box a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    padding: 8px 0;
    color: var(--text-primary, #0f172a);
    font-weight: 800;
    text-decoration: none;
    border-top: 1px solid color-mix(in srgb, var(--border-color, #d8e2ef) 58%, transparent);
}

.report-rank-box a span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-rank-box a em {
    flex: 0 0 auto;
    color: var(--text-secondary, #64748b);
    font-size: 0.82rem;
    font-style: normal;
}

.report-action-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.report-footer-actions {
    justify-content: flex-start;
}

.report-empty-state {
    display: grid;
    justify-items: center;
    gap: 9px;
    padding: 28px 14px;
    text-align: center;
}

.report-empty-state i {
    display: inline-grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: color-mix(in srgb, var(--accent-color, #00c73c) 12%, var(--surface, #fff));
    color: var(--accent-color, #00c73c);
    font-size: 1.25rem;
}

body.theme-dark .listening-report-card,
body.theme-dark .report-period-tabs a,
body.theme-dark .report-metric-grid div,
body.theme-dark .report-rank-box {
    background: color-mix(in srgb, var(--bg-secondary, #0f172a) 88%, transparent);
}

body.theme-dark .report-top-song {
    background: color-mix(in srgb, var(--accent-color, #00c73c) 12%, var(--bg-secondary, #0f172a));
}

@media (max-width: 767px) {
    .home-library-summary {
        display: grid !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 6px !important;
        margin: 10px 0 14px !important;
    }

    .home-library-summary span {
        min-width: 0;
        min-height: 42px;
        padding: 6px 4px;
        justify-content: center;
        flex-direction: column;
        gap: 3px;
        border-radius: 14px;
        font-size: 10px;
    }

    .home-library-summary span i {
        font-size: 12px;
    }

    .home-library-summary span strong {
        font-size: 17px;
        line-height: 1;
    }

    .auto-mix-panel {
        align-items: stretch;
        flex-direction: column;
        gap: 14px;
    }

    .auto-mix-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .auto-mix-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .listening-report-head {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .report-period-tabs {
        justify-content: flex-start;
        width: 100%;
    }

    .report-period-tabs a {
        flex: 1 1 96px;
        justify-content: center;
    }

    .report-metric-grid,
    .report-rank-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .report-top-song {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .report-top-song img {
        width: 72px;
        height: 72px;
        border-radius: 14px;
    }

    .report-top-song .report-action-row {
        grid-column: 1 / -1;
        width: 100%;
    }

    .report-top-song .report-action-row .btn,
    .report-footer-actions .btn {
        flex: 1 1 130px;
        justify-content: center;
    }

    .home-browse-strip {
        justify-content: flex-start;
        min-width: 0;
        width: 100%;
    }

    .home-edit-trigger {
        width: 42px;
        min-width: 42px;
        height: 42px;
        min-height: 42px;
        padding: 0;
        border-radius: 999px;
        aspect-ratio: 1 / 1;
    }

    .home-customizer-panel {
        gap: 12px;
        padding: 14px !important;
    }

    .home-customizer-actions {
        justify-content: stretch;
        width: 100%;
    }

    .home-customizer-actions .btn {
        flex: 1 1 130px;
    }

    .home-customizer-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-editor-item {
        min-height: 56px;
        padding: 11px;
    }

    .home-editor-move .btn {
        width: 40px;
        min-width: 40px;
        height: 40px;
    }

    .home-dashboard > .library-stat-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        margin: 14px 0 18px !important;
    }

    .home-dashboard > .library-stat-grid .library-stat-card {
        min-height: 54px !important;
        padding: 10px 12px !important;
        border-radius: 16px !important;
        border-color: color-mix(in srgb, var(--border-color, #dbe4ef) 72%, transparent) !important;
        background: color-mix(in srgb, var(--bg-secondary, #ffffff) 92%, transparent) !important;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.045) !important;
        display: grid !important;
        align-content: center !important;
        gap: 3px !important;
    }

    .home-dashboard > .library-stat-grid .library-stat-card:first-child {
        grid-column: 1 / -1 !important;
        min-height: 66px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 12px 14px !important;
        background:
            linear-gradient(135deg, color-mix(in srgb, var(--accent-color, #00c73c) 13%, transparent), transparent 62%),
            color-mix(in srgb, var(--bg-secondary, #ffffff) 94%, transparent) !important;
    }

    .home-dashboard > .library-stat-grid .library-stat-label {
        margin: 0 !important;
        color: var(--text-secondary, #64748b) !important;
        font-size: 11px !important;
        line-height: 1.2 !important;
        font-weight: 800 !important;
        letter-spacing: 0 !important;
        white-space: nowrap !important;
    }

    .home-dashboard > .library-stat-grid .library-stat-card:first-child .library-stat-label {
        font-size: 13px !important;
        color: var(--text-primary, #0f172a) !important;
    }

    .home-dashboard > .library-stat-grid .library-stat-value {
        margin: 0 !important;
        color: var(--text-primary, #0f172a) !important;
        font-size: 19px !important;
        line-height: 1.05 !important;
        font-weight: 900 !important;
        letter-spacing: 0 !important;
    }

    .home-dashboard > .library-stat-grid .library-stat-card:first-child .library-stat-value {
        font-size: clamp(28px, 8vw, 38px) !important;
    }
}

/* 20.0 commercial: richer song detail page and related songs. */
.song-detail-page .song-detail-title-section {
    margin-bottom: 18px;
}

.song-detail-page .song-detail-container {
    align-items: stretch !important;
    gap: clamp(18px, 3vw, 34px) !important;
}

.song-detail-page .song-detail-art-card,
.song-detail-page .song-detail-info-card,
.song-detail-page .song-album-summary-card,
.song-detail-page .related-song-section,
.song-detail-page .song-lyrics-card,
.song-detail-page .metadata-status-summary,
.song-detail-page .tag-editor-card,
.song-detail-page .listening-note-card {
    border-radius: 20px !important;
    border: 1px solid var(--border-color, #d8e2ef) !important;
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--bg-secondary, #ffffff) 94%, transparent), color-mix(in srgb, var(--accent-color, #00c73c) 4%, var(--bg-secondary, #ffffff))),
        var(--bg-secondary, #ffffff) !important;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.06) !important;
}

.song-detail-page .album-art-large {
    border-radius: 18px !important;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18) !important;
}

.song-detail-page .song-art-meta h3 {
    max-width: 100%;
    margin: 0 0 6px !important;
    font-size: clamp(1.15rem, 2vw, 1.5rem) !important;
    line-height: 1.2 !important;
    overflow-wrap: anywhere;
}

.song-detail-page .song-art-meta p {
    margin: 0;
    font-weight: 800;
}

.song-detail-page .song-detail-art-card > .song-item {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px !important;
}

.song-detail-page .song-detail-art-card > .song-item .play-row-btn {
    flex: 1 1 138px !important;
}

.song-detail-page .song-detail-art-card > .song-item .btn,
.song-detail-page .song-detail-art-card > .song-item .download-song-btn {
    min-width: 0;
}

.song-detail-page .song-spec-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.song-detail-page .song-spec-heading h2 {
    margin: 0;
    font-size: 1.12rem;
}

.song-detail-page .song-spec-list {
    display: grid;
    gap: 0;
    margin: 0;
}

.song-detail-page .song-spec-row {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--border-color, #d8e2ef) 78%, transparent);
}

.song-detail-page .song-spec-row dt {
    color: var(--text-secondary, #64748b);
    font-weight: 800;
}

.song-detail-page .song-spec-row dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}

.song-detail-page .song-spec-primary,
.song-detail-page .song-spec-accent,
.song-detail-page .song-spec-liked {
    color: var(--accent-color, #00c73c);
    font-weight: 900;
}

.song-detail-page .song-spec-muted {
    color: var(--text-secondary, #64748b);
}

.song-detail-page .song-detail-stat-strip,
.song-detail-page .song-album-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.song-detail-page .song-detail-stat-strip span,
.song-detail-page .song-album-summary-grid div {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border-color, #d8e2ef);
    border-radius: 14px;
    background: color-mix(in srgb, var(--bg-primary, #f8fafc) 78%, transparent);
    color: var(--text-secondary, #64748b);
    font-size: 12px;
    font-weight: 800;
}

.song-detail-page .song-detail-stat-strip strong,
.song-detail-page .song-album-summary-grid strong {
    display: block;
    margin-top: 5px;
    color: var(--text-primary, #0f172a);
    font-size: 1.06rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.song-detail-page .song-album-description {
    margin-top: 14px;
    color: var(--text-secondary, #64748b);
    line-height: 1.7;
    white-space: normal;
    overflow-wrap: anywhere;
}

.song-detail-page .metadata-hint-panel,
.song-detail-page .detail-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 104px;
    margin-top: 12px;
    padding: 16px;
    border: 1px solid color-mix(in srgb, var(--accent-color, #00c73c) 24%, var(--border-color, #d8e2ef));
    border-radius: 16px;
    background: color-mix(in srgb, var(--accent-color, #00c73c) 7%, transparent);
    color: var(--text-secondary, #64748b);
    text-align: center;
}

.song-detail-page .metadata-hint-panel {
    justify-content: flex-start;
    text-align: left;
}

.song-detail-page .metadata-hint-panel strong {
    display: block;
    color: var(--text-primary, #0f172a);
    margin-bottom: 4px;
}

.song-detail-page .metadata-hint-panel p,
.song-detail-page .detail-empty-state p {
    margin: 0;
}

.song-detail-page .related-song-sections {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.song-detail-page .related-song-section {
    min-width: 0;
    padding: 18px;
}

.song-detail-page .related-song-section .compact-song-grid {
    gap: 10px;
}

.song-detail-page .related-song-section .compact-song-card {
    grid-template-columns: 36px 48px minmax(0, 1fr) auto !important;
    border-radius: 16px !important;
}

.song-detail-page .related-song-section .compact-song-actions {
    min-width: 42px !important;
    flex-direction: column !important;
}

.song-detail-page .song-detail-bottom-actions {
    margin-bottom: calc(var(--player-height, 92px) + var(--safe-bottom, 0px));
}

@media (max-width: 1199px) {
    .song-detail-page .song-detail-container {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .song-detail-page .song-detail-art-card,
    .song-detail-page .song-detail-info-card {
        width: 100% !important;
        max-width: 100% !important;
    }

    .song-detail-page .related-song-sections {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .song-detail-page .song-detail-art-card,
    .song-detail-page .song-detail-info-card,
    .song-detail-page .song-album-summary-card,
    .song-detail-page .related-song-section {
        padding: 16px !important;
        border-radius: 18px !important;
    }

    .song-detail-page .song-detail-art-card > .song-item .play-row-btn {
        flex-basis: 100% !important;
    }

    .song-detail-page .song-detail-art-card > .song-item {
        justify-content: center !important;
    }

    .song-detail-page .song-spec-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .song-detail-page .song-detail-stat-strip,
    .song-detail-page .song-album-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .song-detail-page .metadata-hint-panel {
        align-items: flex-start;
    }

    .song-detail-page .song-lyrics-header,
    .song-detail-page .section-heading-row {
        gap: 10px;
    }
}

/* 20.1 regression fix: mobile/tablet music list cards must not expose table-only cells. */
@media (max-width: 1199px) {
    .music-list-page .library-display-controls {
        display: none !important;
    }

    .music-list-page {
        --library-touch-card-gap: 12px;
    }

    .music-list-page .song-list-container {
        overflow: visible !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    .music-list-page .song-list-container .song-table,
    .music-list-page .song-list-container .song-table tbody {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        table-layout: auto !important;
        border: 0 !important;
        background: transparent !important;
    }

    .music-list-page .song-list-container .song-table thead {
        display: none !important;
    }

    .music-list-page .song-list-container .song-table tbody {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: var(--library-touch-card-gap) !important;
    }

    .music-list-page .song-list-container .song-table tr.song-item {
        display: grid !important;
        grid-template-columns: 42px minmax(0, 1fr) 92px !important;
        grid-template-rows: auto auto auto !important;
        align-items: center !important;
        gap: 5px 10px !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        min-height: 118px !important;
        padding: 14px !important;
        border: 1px solid var(--border-color, #d8e2ef) !important;
        border-radius: 20px !important;
        background: var(--bg-secondary, #ffffff) !important;
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06) !important;
    }

    .music-list-page .song-list-container .song-table tr.song-item > td {
        display: block !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: auto !important;
        padding: 0 !important;
        border: 0 !important;
        text-align: left !important;
        white-space: normal !important;
    }

    .music-list-page .song-list-container .song-table tr.song-item > td:first-child {
        grid-column: 1 !important;
        grid-row: 1 / span 3 !important;
        align-self: center !important;
        justify-self: center !important;
        text-align: center !important;
    }

    .music-list-page .song-list-container .song-table tr.song-item > .song-title-cell {
        grid-column: 2 !important;
        grid-row: 1 !important;
        align-self: end !important;
    }

    .music-list-page .song-list-container .song-table tr.song-item > .artist-cell {
        grid-column: 2 !important;
        grid-row: 2 !important;
        align-self: center !important;
        color: var(--text-primary, #0f172a) !important;
        font-size: 0.92rem !important;
        font-weight: 800 !important;
    }

    .music-list-page .song-list-container .song-table tr.song-item > .album-cell {
        grid-column: 2 !important;
        grid-row: 3 !important;
        align-self: start !important;
        color: var(--text-secondary, #64748b) !important;
        font-size: 0.86rem !important;
        font-weight: 600 !important;
    }

    .music-list-page .song-list-container .song-table tr.song-item > .genre-cell,
    .music-list-page .song-list-container .song-table tr.song-item > .duration-cell,
    .music-list-page .song-list-container .song-table tr.song-item > .format-cell,
    .music-list-page .song-list-container .song-table tr.song-item > .play-count-td {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        visibility: hidden !important;
    }

    .music-list-page .song-list-container .song-table tr.song-item > .actions-cell,
    .music-list-page .song-list-container .song-table tr.song-item > td:last-child {
        grid-column: 3 !important;
        grid-row: 1 / span 3 !important;
        align-self: center !important;
        justify-self: end !important;
        width: 92px !important;
        min-width: 92px !important;
        max-width: 92px !important;
    }

    .music-list-page .song-list-container .song-table .song-title-wrap {
        display: grid !important;
        grid-template-columns: 54px minmax(0, 1fr) !important;
        align-items: center !important;
        gap: 10px !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .music-list-page .song-list-container .song-table .list-cover {
        width: 54px !important;
        height: 54px !important;
        border-radius: 12px !important;
        grid-column: 1 !important;
    }

    .music-list-page .song-list-container .song-table .song-title-stack {
        min-width: 0 !important;
        max-width: 100% !important;
        grid-column: 2 !important;
    }

    .music-list-page .song-list-container .song-table .song-title-link,
    .music-list-page .song-list-container .song-table .artist-cell,
    .music-list-page .song-list-container .song-table .album-cell {
        display: block !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        word-break: normal !important;
    }

    .music-list-page .song-list-container .song-table .song-list-badges {
        display: none !important;
    }

    .music-list-page .song-list-container .song-table .song-action-group {
        display: grid !important;
        grid-template-columns: repeat(2, 40px) !important;
        gap: 8px !important;
        width: 88px !important;
        min-width: 88px !important;
        max-width: 88px !important;
        justify-content: end !important;
        justify-items: center !important;
        align-items: center !important;
        overflow: visible !important;
    }

    .music-list-page .song-list-container .song-table .like-btn,
    .music-list-page .song-list-container .song-table .add-playlist-btn,
    .music-list-page .song-list-container .song-table .download-song-btn,
    .music-list-page .song-list-container .song-table .metadata-request-btn,
    .music-list-page .song-list-container .song-table .remove-playlist-song-btn {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        border-radius: 50% !important;
    }
}

@media (max-width: 420px) {
    .music-list-page .song-list-container .song-table tr.song-item {
        grid-template-columns: 34px minmax(0, 1fr) 86px !important;
        padding: 12px !important;
        gap: 5px 8px !important;
    }

    .music-list-page .song-list-container .song-table .song-title-wrap {
        grid-template-columns: 48px minmax(0, 1fr) !important;
        gap: 8px !important;
    }

    .music-list-page .song-list-container .song-table .list-cover {
        width: 48px !important;
        height: 48px !important;
    }

    .music-list-page .song-list-container .song-table tr.song-item > .actions-cell,
    .music-list-page .song-list-container .song-table tr.song-item > td:last-child {
        width: 86px !important;
        min-width: 86px !important;
        max-width: 86px !important;
    }

    .music-list-page .song-list-container .song-table .song-action-group {
        grid-template-columns: repeat(2, 38px) !important;
        gap: 7px !important;
        width: 83px !important;
        min-width: 83px !important;
        max-width: 83px !important;
    }

    .music-list-page .song-list-container .song-table .like-btn,
    .music-list-page .song-list-container .song-table .add-playlist-btn,
    .music-list-page .song-list-container .song-table .download-song-btn,
    .music-list-page .song-list-container .song-table .metadata-request-btn,
    .music-list-page .song-list-container .song-table .remove-playlist-song-btn {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
    }
}

/* 20.3 EOF priority: premium mobile/tablet player surface. */
@media (max-width: 1199px) {
    :root {
        --touch-player-width-final: min(660px, calc(100vw - 24px));
        --touch-player-height-final: 86px;
        --touch-player-art-final: 58px;
        --touch-player-play-final: 58px;
        --touch-player-next-final: 52px;
        --touch-player-pad-final: 12px;
    }

    .player-bar {
        left: 50% !important;
        right: auto !important;
        bottom: calc(var(--safe-bottom, env(safe-area-inset-bottom, 0px)) + 12px) !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        align-items: center !important;
        gap: 12px !important;
        width: var(--touch-player-width-final) !important;
        max-width: var(--touch-player-width-final) !important;
        height: var(--touch-player-height-final) !important;
        min-height: var(--touch-player-height-final) !important;
        padding: 10px var(--touch-player-pad-final) 15px !important;
        border: 1px solid color-mix(in srgb, var(--accent-color, #00b940) 34%, var(--border-color, #d8e2ef)) !important;
        border-radius: 28px !important;
        background: linear-gradient(135deg, rgba(232, 255, 239, 0.88), rgba(255, 255, 255, 0.97) 50%, rgba(248, 251, 255, 0.94)) !important;
        box-shadow: 0 24px 52px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.62) inset !important;
        transform: translateX(-50%) translateZ(0) !important;
        overflow: hidden !important;
        backdrop-filter: blur(20px) saturate(1.14) !important;
        -webkit-backdrop-filter: blur(20px) saturate(1.14) !important;
    }

    body.theme-dark .player-bar,
    body:not(.theme-light) .player-bar {
        background: linear-gradient(135deg, rgba(11, 45, 28, 0.92), rgba(15, 23, 42, 0.96) 55%, rgba(20, 31, 49, 0.95)) !important;
        border-color: color-mix(in srgb, var(--accent-color, #22c55e) 42%, rgba(148, 163, 184, 0.4)) !important;
        box-shadow: 0 24px 52px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(255, 255, 255, 0.06) inset !important;
    }

    .player-bar .player-song-info {
        display: grid !important;
        grid-template-columns: var(--touch-player-art-final) minmax(0, 1fr) !important;
        align-items: center !important;
        gap: 12px !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .player-bar .player-album-art,
    .player-bar #player-art-container {
        position: relative !important;
        width: var(--touch-player-art-final) !important;
        height: var(--touch-player-art-final) !important;
        min-width: var(--touch-player-art-final) !important;
        border-radius: 18px !important;
        overflow: visible !important;
        box-shadow: 0 13px 24px rgba(15, 23, 42, 0.18) !important;
    }

    .player-bar #player-album-image {
        width: 100% !important;
        height: 100% !important;
        border-radius: inherit !important;
        object-fit: cover !important;
    }

    .player-bar.is-playing .player-album-art::after {
        content: "";
        position: absolute;
        right: -3px;
        bottom: -3px;
        width: 18px;
        height: 18px;
        border-radius: 999px;
        border: 3px solid rgba(255, 255, 255, 0.92);
        background: var(--accent-color, #00b940);
        box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent-color, #00b940) 16%, transparent);
    }

    .player-bar .player-song-details {
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .player-bar #player-title,
    .player-bar #player-artist {
        display: block !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        word-break: keep-all !important;
        letter-spacing: 0 !important;
    }

    .player-bar #player-title {
        margin: 0 0 4px !important;
        color: var(--text-primary, #0f172a) !important;
        font-size: clamp(1rem, 2.6vw, 1.2rem) !important;
        font-weight: 950 !important;
        line-height: 1.16 !important;
    }

    .player-bar #player-artist {
        color: var(--text-secondary, #64748b) !important;
        font-size: clamp(0.84rem, 2.1vw, 0.96rem) !important;
        font-weight: 750 !important;
        line-height: 1.2 !important;
    }

    .player-bar .player-controls {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        width: calc(var(--touch-player-play-final) + var(--touch-player-next-final) + 8px) !important;
        min-width: calc(var(--touch-player-play-final) + var(--touch-player-next-final) + 8px) !important;
        height: var(--touch-player-play-final) !important;
    }

    .player-bar .control-buttons {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .player-bar #btn-shuffle,
    .player-bar #btn-prev,
    .player-bar #btn-repeat,
    .player-bar .player-utils {
        display: none !important;
    }

    .player-bar #btn-play-pause,
    .player-bar #btn-next {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 999px !important;
        flex: 0 0 auto !important;
    }

    .player-bar #btn-play-pause {
        width: var(--touch-player-play-final) !important;
        height: var(--touch-player-play-final) !important;
        min-width: var(--touch-player-play-final) !important;
        min-height: var(--touch-player-play-final) !important;
        background: #0f172a !important;
        color: #fff !important;
        border: 0 !important;
        box-shadow: 0 16px 30px rgba(15, 23, 42, 0.26) !important;
    }

    .player-bar #btn-next {
        width: var(--touch-player-next-final) !important;
        height: var(--touch-player-next-final) !important;
        min-width: var(--touch-player-next-final) !important;
        min-height: var(--touch-player-next-final) !important;
        background: rgba(255, 255, 255, 0.92) !important;
        color: #0f172a !important;
        border: 1px solid rgba(203, 213, 225, 0.82) !important;
        box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12) !important;
    }

    .player-bar .progress-container {
        display: grid !important;
        position: absolute !important;
        left: calc(var(--touch-player-pad-final) + var(--touch-player-art-final) + 12px) !important;
        right: calc(var(--touch-player-pad-final) + var(--touch-player-play-final) + var(--touch-player-next-final) + 20px) !important;
        bottom: 10px !important;
        width: auto !important;
        height: 5px !important;
        min-height: 5px !important;
        grid-template-columns: minmax(0, 1fr) !important;
        padding: 0 !important;
        background: transparent !important;
    }

    .player-bar .time-label,
    .player-bar .progress-handle {
        display: none !important;
    }

    .player-bar .progress-bar-wrapper {
        height: 3px !important;
        min-height: 3px !important;
        max-height: 3px !important;
        border-radius: 999px !important;
        background: rgba(148, 163, 184, 0.24) !important;
        overflow: hidden !important;
    }

    .player-bar #progress-bar {
        height: 100% !important;
        border-radius: inherit !important;
        background: var(--accent-color, #00b940) !important;
        box-shadow: none !important;
    }

    .expand-player-overlay {
        padding: calc(var(--safe-top, env(safe-area-inset-top, 0px)) + 12px) 12px calc(var(--safe-bottom, env(safe-area-inset-bottom, 0px)) + 12px) !important;
        background: radial-gradient(circle at 18% 12%, rgba(187, 247, 208, 0.38), transparent 34%), radial-gradient(circle at 92% 8%, rgba(219, 234, 254, 0.34), transparent 28%), rgba(241, 245, 249, 0.78) !important;
        backdrop-filter: blur(18px) saturate(1.14) !important;
        -webkit-backdrop-filter: blur(18px) saturate(1.14) !important;
    }

    .expand-player-overlay .expand-player-container {
        width: min(620px, calc(100vw - 24px)) !important;
        max-width: min(620px, calc(100vw - 24px)) !important;
        max-height: calc(100dvh - var(--safe-top, env(safe-area-inset-top, 0px)) - var(--safe-bottom, env(safe-area-inset-bottom, 0px)) - 24px) !important;
        margin: auto !important;
        padding: clamp(18px, 3.4vw, 28px) !important;
        border: 1px solid rgba(203, 213, 225, 0.72) !important;
        border-radius: clamp(28px, 5vw, 40px) !important;
        background: linear-gradient(145deg, rgba(235, 255, 241, 0.84), rgba(255, 255, 255, 0.95) 45%, rgba(248, 251, 255, 0.92)) !important;
        box-shadow: 0 30px 80px rgba(15, 23, 42, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.7) inset !important;
        overflow: hidden !important;
    }

    .expand-player-overlay .expand-close {
        top: 16px !important;
        right: 16px !important;
        width: 48px !important;
        height: 48px !important;
        border-radius: 999px !important;
        background: rgba(255, 255, 255, 0.92) !important;
        color: #0f172a !important;
        border: 1px solid rgba(203, 213, 225, 0.72) !important;
        box-shadow: 0 16px 34px rgba(15, 23, 42, 0.14) !important;
    }

    .expand-player-overlay .expand-album-art {
        display: block !important;
        width: clamp(190px, 58vw, 320px) !important;
        height: clamp(190px, 58vw, 320px) !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        border-radius: clamp(24px, 5vw, 34px) !important;
        object-fit: cover !important;
        box-shadow: 0 26px 48px rgba(15, 23, 42, 0.23) !important;
    }

    .expand-player-overlay .expand-song-meta {
        width: min(100%, 520px) !important;
        margin: clamp(14px, 2.6dvh, 22px) auto 0 !important;
        text-align: center !important;
    }

    .expand-player-overlay .expand-song-meta h2 {
        margin: 0 auto 8px !important;
        max-width: 100% !important;
        color: var(--text-primary, #0f172a) !important;
        font-size: clamp(1.65rem, 6vw, 2.65rem) !important;
        font-weight: 950 !important;
        line-height: 1.06 !important;
        letter-spacing: 0 !important;
        word-break: keep-all !important;
        overflow-wrap: anywhere !important;
    }

    .expand-player-overlay #expand-player-artist {
        color: var(--accent-color, #00b940) !important;
        font-weight: 900 !important;
    }

    .expand-player-overlay .expand-tab-section {
        border: 1px solid rgba(203, 213, 225, 0.68) !important;
        border-radius: 24px !important;
        background: rgba(255, 255, 255, 0.72) !important;
        box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08) !important;
        overflow: hidden !important;
    }

    .expand-player-overlay .expand-tab-headers {
        min-height: 58px !important;
        padding: 7px !important;
        gap: 7px !important;
        background: rgba(248, 250, 252, 0.78) !important;
        border-bottom: 1px solid rgba(203, 213, 225, 0.64) !important;
    }

    .expand-player-overlay .tab-header-btn,
    .expand-player-overlay .expand-tab-collapse-btn {
        min-height: 44px !important;
        border-radius: 17px !important;
        font-size: 0.98rem !important;
        font-weight: 900 !important;
    }

    .expand-player-overlay .tab-header-btn.active {
        background: linear-gradient(135deg, rgba(240, 253, 244, 0.98), rgba(220, 252, 231, 0.88)) !important;
        color: #0f5132 !important;
        border-color: rgba(34, 197, 94, 0.4) !important;
        box-shadow: 0 10px 24px rgba(34, 197, 94, 0.12) !important;
    }

    .expand-player-overlay .expand-player-controls {
        width: min(100%, 560px) !important;
        margin: clamp(12px, 2.4dvh, 20px) auto 0 !important;
        padding: 0 !important;
    }

    .expand-player-overlay .expand-player-controls .progress-container {
        display: grid !important;
        grid-template-columns: 48px minmax(0, 1fr) 48px !important;
        align-items: center !important;
        gap: 8px !important;
        width: 100% !important;
        min-height: 28px !important;
        margin: 0 auto 16px !important;
        padding: 4px 6px !important;
        border-radius: 999px !important;
        background: rgba(226, 232, 240, 0.72) !important;
    }

    .expand-player-overlay .expand-control-buttons-row {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: clamp(10px, 3.2vw, 18px) !important;
        margin: 0 auto 16px !important;
    }

    .expand-player-overlay .expand-control-buttons-row .control-btn {
        width: 50px !important;
        height: 50px !important;
        min-width: 50px !important;
        min-height: 50px !important;
        border-radius: 999px !important;
        background: rgba(255, 255, 255, 0.86) !important;
        color: #0f172a !important;
        border: 1px solid rgba(203, 213, 225, 0.76) !important;
        box-shadow: 0 12px 26px rgba(15, 23, 42, 0.1) !important;
    }

    .expand-player-overlay .expand-control-buttons-row .play-btn {
        width: 68px !important;
        height: 68px !important;
        min-width: 68px !important;
        min-height: 68px !important;
        background: #0f172a !important;
        color: #fff !important;
        border: 0 !important;
        box-shadow: 0 18px 36px rgba(15, 23, 42, 0.26) !important;
    }
}

@media (max-width: 767px) {
    :root {
        --touch-player-width-final: calc(100vw - 24px);
        --touch-player-height-final: 84px;
        --touch-player-art-final: 56px;
        --touch-player-play-final: 58px;
        --touch-player-next-final: 50px;
        --touch-player-pad-final: 10px;
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .expand-player-overlay .expand-player-container {
        width: min(940px, calc(100vw - 42px)) !important;
        max-width: min(940px, calc(100vw - 42px)) !important;
    }
}

/* 21.0 EOF priority: artist detail and artist links. */
.song-meta-link {
    color: inherit;
    font-weight: inherit;
    text-decoration: none;
}

.artist-meta-link:hover,
.artist-meta-link:focus-visible,
.album-meta-link:hover,
.album-meta-link:focus-visible,
.genre-meta-link:hover,
.genre-meta-link:focus-visible {
    color: var(--accent-color, #00b940);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.artist-detail-page {
    padding-bottom: calc(var(--bottom-player-height, 96px) + env(safe-area-inset-bottom, 0px) + 32px);
}

.artist-hero-card {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: center;
    gap: 28px;
    margin-bottom: 24px;
    padding: clamp(22px, 3vw, 34px);
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 28px;
    background:
        radial-gradient(circle at 12% 18%, rgba(34, 197, 94, 0.16), transparent 34%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.86));
    box-shadow: 0 22px 56px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.artist-cover-stack {
    width: 220px;
    height: 220px;
    border-radius: 30px;
    overflow: hidden;
    background: rgba(226, 232, 240, 0.7);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.16);
}

.artist-hero-cover {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.artist-hero-copy {
    min-width: 0;
}

.artist-hero-copy .section-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 8px;
}

.artist-hero-copy .page-main-title {
    margin: 0 0 10px;
    overflow-wrap: anywhere;
}

.artist-action-row {
    justify-content: flex-start;
    margin-top: 18px;
}

.artist-album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
}

.artist-album-card {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(203, 213, 225, 0.82);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    color: inherit;
    text-decoration: none;
}

.artist-album-card:hover,
.artist-mini-row:hover {
    border-color: rgba(34, 197, 94, 0.42);
    background: rgba(240, 253, 244, 0.72);
}

.artist-album-card img,
.artist-mini-row img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 14px;
    background: rgba(226, 232, 240, 0.8);
}

.artist-album-card span,
.artist-mini-row span {
    min-width: 0;
}

.artist-album-card b,
.artist-mini-row b {
    display: block;
    overflow: hidden;
    color: var(--text-primary, #0f172a);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.artist-album-card small,
.artist-mini-row small {
    display: block;
    overflow: hidden;
    margin-top: 4px;
    color: var(--text-secondary, #64748b);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.artist-insight-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.artist-mini-list {
    display: grid;
    gap: 10px;
}

.artist-mini-row {
    display: grid;
    grid-template-columns: 34px 44px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(203, 213, 225, 0.74);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    color: inherit;
    text-decoration: none;
}

.artist-mini-row-compact {
    grid-template-columns: 44px minmax(0, 1fr);
}

.artist-mini-row > strong {
    color: var(--accent-color, #00b940);
    text-align: center;
}

.artist-mini-row img {
    width: 44px;
}

@media (max-width: 1199px) {
    .artist-hero-card {
        grid-template-columns: 180px minmax(0, 1fr);
        gap: 22px;
    }

    .artist-cover-stack {
        width: 180px;
        height: 180px;
    }

    .artist-album-grid {
        grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    }
}

@media (max-width: 767px) {
    .artist-hero-card {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        border-radius: 24px;
    }

    .artist-cover-stack {
        width: min(170px, 58vw);
        height: min(170px, 58vw);
        border-radius: 24px;
    }

    .artist-action-row {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .artist-action-row .btn {
        width: 100%;
        justify-content: center;
    }

    .artist-insight-grid {
        grid-template-columns: 1fr;
    }

    .artist-album-grid {
        grid-template-columns: 1fr;
    }

    .artist-mini-row {
        grid-template-columns: 30px 42px minmax(0, 1fr);
    }

    .artist-mini-row-compact {
        grid-template-columns: 42px minmax(0, 1fr);
    }
}

/* 22.0 EOF priority: album detail page. */
.album-detail-page {
    padding-bottom: calc(var(--bottom-player-height, 96px) + env(safe-area-inset-bottom, 0px) + 32px);
}

.album-hero-card {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: center;
    gap: 30px;
    padding: clamp(22px, 3vw, 34px);
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 28px;
    background:
        radial-gradient(circle at 10% 14%, rgba(34, 197, 94, 0.16), transparent 34%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.9));
    box-shadow: 0 22px 56px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.album-cover-stack {
    width: 220px;
    height: 220px;
    border-radius: 30px;
    overflow: hidden;
    background: rgba(226, 232, 240, 0.72);
    box-shadow: 0 22px 42px rgba(15, 23, 42, 0.16);
}

.album-hero-cover {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.album-hero-copy {
    min-width: 0;
}

.album-hero-copy .page-main-title {
    margin: 0 0 10px;
    overflow-wrap: anywhere;
}

.album-action-row {
    justify-content: flex-start;
    margin-top: 18px;
}

.album-track-section .section-heading-row {
    align-items: flex-end;
}

.album-track-section .section-subtitle {
    margin: 6px 0 0;
    color: var(--text-secondary, #64748b);
    font-size: 0.94rem;
}

.album-detail-page .filter-sort-form {
    margin: 18px 0;
}

.album-detail-page .album-intro-section {
    margin-top: 20px;
}

@media (max-width: 1199px) {
    .album-hero-card {
        grid-template-columns: 180px minmax(0, 1fr);
        gap: 22px;
    }

    .album-cover-stack {
        width: 180px;
        height: 180px;
    }
}

@media (max-width: 767px) {
    .album-hero-card {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        border-radius: 24px;
    }

    .album-cover-stack {
        width: min(176px, 60vw);
        height: min(176px, 60vw);
        border-radius: 24px;
    }

    .album-action-row {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .album-action-row .btn {
        width: 100%;
        justify-content: center;
    }

    .album-track-section .section-heading-row {
        align-items: flex-start;
    }
}

/* 23.0 EOF priority: genre detail page. */
.genre-detail-page {
    padding-bottom: calc(var(--bottom-player-height, 96px) + env(safe-area-inset-bottom, 0px) + 32px);
}

.genre-hero-card {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: center;
    gap: 30px;
    margin-bottom: 24px;
    padding: clamp(22px, 3vw, 34px);
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 28px;
    background:
        radial-gradient(circle at 14% 18%, rgba(34, 197, 94, 0.17), transparent 34%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.88));
    box-shadow: 0 22px 56px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.genre-cover-stack {
    width: 220px;
    height: 220px;
    border-radius: 30px;
    overflow: hidden;
    background: rgba(226, 232, 240, 0.72);
    box-shadow: 0 22px 42px rgba(15, 23, 42, 0.16);
}

.genre-hero-cover {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.genre-hero-copy {
    min-width: 0;
}

.genre-hero-copy .page-main-title {
    margin: 0 0 10px;
    overflow-wrap: anywhere;
}

.genre-action-row {
    justify-content: flex-start;
    margin-top: 18px;
}

.genre-recommend-section .section-subtitle,
.genre-song-section .section-subtitle {
    margin: 6px 0 0;
    color: var(--text-secondary, #64748b);
    font-size: 0.94rem;
}

.genre-recommend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
}

.genre-recommend-card {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(203, 213, 225, 0.82);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.86);
    color: inherit;
    text-decoration: none;
}

.genre-recommend-card:hover {
    border-color: rgba(34, 197, 94, 0.42);
    background: rgba(240, 253, 244, 0.75);
}

.genre-recommend-card img {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    object-fit: cover;
    background: rgba(226, 232, 240, 0.78);
}

.genre-recommend-card span {
    min-width: 0;
}

.genre-recommend-card b,
.genre-recommend-card small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.genre-recommend-card b {
    color: var(--text-primary, #0f172a);
}

.genre-recommend-card small {
    margin-top: 4px;
    color: var(--text-secondary, #64748b);
}

.genre-recommend-cue {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: rgba(241, 245, 249, 0.95);
    color: var(--text-secondary, #64748b);
}

.genre-insight-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 1199px) {
    .genre-hero-card {
        grid-template-columns: 180px minmax(0, 1fr);
        gap: 22px;
    }

    .genre-cover-stack {
        width: 180px;
        height: 180px;
    }

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

@media (max-width: 767px) {
    .genre-hero-card {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
        border-radius: 24px;
    }

    .genre-cover-stack {
        width: min(176px, 60vw);
        height: min(176px, 60vw);
        border-radius: 24px;
    }

    .genre-action-row {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .genre-action-row .btn {
        width: 100%;
        justify-content: center;
    }

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

    .genre-recommend-card {
        grid-template-columns: 58px minmax(0, 1fr) 40px;
    }

    .genre-recommend-card img {
        width: 58px;
        height: 58px;
        border-radius: 14px;
    }
}

/* 24.0 EOF priority: search result tabs and lyric previews. */
.search-result-overview {
    display: grid;
    gap: 14px;
    margin: 18px 0;
    padding: 16px;
    border: 1px solid rgba(203, 213, 225, 0.78);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

.search-result-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-wrap: wrap;
}

.search-result-summary strong {
    color: var(--text-primary, #0f172a);
    font-size: 1rem;
}

.search-result-summary span {
    color: var(--text-secondary, #64748b);
    font-size: 0.94rem;
}

.search-result-summary em {
    margin-left: auto;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(220, 252, 231, 0.95);
    color: #047857;
    font-style: normal;
    font-weight: 800;
    white-space: nowrap;
}

.search-result-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    overflow: visible;
}

.search-tab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 13px;
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 999px;
    background: rgba(248, 250, 252, 0.92);
    color: var(--text-primary, #0f172a);
    font-weight: 800;
    text-decoration: none;
}

.search-tab-btn small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.9);
    color: var(--text-secondary, #64748b);
    font-size: 0.78rem;
}

.search-tab-btn.active {
    border-color: rgba(34, 197, 94, 0.55);
    background: rgba(220, 252, 231, 0.96);
    color: #047857;
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.16);
}

.search-tab-btn.active small {
    background: rgba(255, 255, 255, 0.82);
    color: #047857;
}

.lyrics-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.lyrics-result-card {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    min-width: 0;
    padding: 14px;
    border: 1px solid rgba(203, 213, 225, 0.82);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
}

.lyrics-result-cover img {
    width: 74px;
    height: 74px;
    border-radius: 16px;
    object-fit: cover;
    background: rgba(226, 232, 240, 0.8);
}

.lyrics-result-body {
    min-width: 0;
}

.lyrics-result-title,
.lyrics-result-meta,
.lyrics-result-snippet {
    min-width: 0;
    overflow-wrap: anywhere;
}

.lyrics-result-title {
    display: block;
    color: var(--text-primary, #0f172a);
    font-weight: 900;
    text-decoration: none;
}

.lyrics-result-meta {
    margin: 4px 0 0;
    color: var(--text-secondary, #64748b);
    font-size: 0.9rem;
}

.lyrics-result-snippet {
    margin: 10px 0 0;
    color: var(--text-primary, #0f172a);
    line-height: 1.55;
    white-space: normal;
}

.lyrics-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.search-empty-state {
    display: grid;
    gap: 6px;
    justify-items: center;
    padding: 28px 16px;
    text-align: center;
}

.search-empty-state span {
    color: var(--text-secondary, #64748b);
}

@media (max-width: 1023px) {
    .search-result-overview {
        border-radius: 18px;
        padding: 14px;
    }

    .search-result-summary {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
    }

    .search-result-summary em {
        margin-left: 0;
        justify-self: start;
    }

    .search-result-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .search-tab-btn {
        width: 100%;
        min-width: 0;
        padding-inline: 10px;
    }
}

@media (max-width: 767px) {
    .search-result-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .search-tab-btn {
        min-height: 44px;
        font-size: 0.92rem;
    }

    .lyrics-result-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .lyrics-result-card {
        grid-template-columns: 58px minmax(0, 1fr);
        padding: 12px;
        border-radius: 18px;
    }

    .lyrics-result-cover img {
        width: 58px;
        height: 58px;
        border-radius: 14px;
    }

    .lyrics-result-actions .btn {
        min-height: 38px;
        padding-inline: 11px;
    }
}

/* 25.0 EOF priority: saved search filter presets. */
.filter-preset-panel {
    display: grid;
    gap: 14px;
    margin: 18px 0;
    padding: 16px;
    border: 1px solid rgba(203, 213, 225, 0.78);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

.filter-preset-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
}

.filter-preset-head .section-title {
    margin: 0 0 4px;
}

.filter-preset-save {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: min(440px, 48%);
}

.filter-preset-save .form-control {
    min-width: 0;
}

.filter-preset-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
}

.filter-preset-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(203, 213, 225, 0.78);
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.86);
}

.filter-preset-card-main {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.filter-preset-card-main strong,
.filter-preset-card-main span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-preset-card-main strong {
    color: var(--text-primary, #0f172a);
    font-weight: 900;
}

.filter-preset-card-main span {
    color: var(--text-secondary, #64748b);
    font-size: 0.88rem;
}

.filter-preset-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-preset-card-actions .btn {
    white-space: nowrap;
}

.filter-preset-empty[hidden] {
    display: none !important;
}

.filter-preset-panel-compact {
    margin-top: 0;
}

@media (max-width: 1023px) {
    .filter-preset-head {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .filter-preset-save {
        width: 100%;
        min-width: 0;
    }

    .filter-preset-list {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 767px) {
    .filter-preset-panel {
        padding: 14px;
        border-radius: 18px;
    }

    .filter-preset-save {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .filter-preset-save .btn {
        width: 100%;
        justify-content: center;
    }

    .filter-preset-card {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .filter-preset-card-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 42px 42px;
        width: 100%;
    }

    .filter-preset-card-actions .btn {
        min-height: 40px;
        justify-content: center;
    }
}

/* 31차 order lock: keep recent/resume controls above older generic list rules. */
.recent-history-page .song-action-group .recent-remove-btn {
    width: 36px;
    min-width: 36px;
    height: 36px;
    padding: 0;
    color: #dc2626;
}

.home-dashboard .resume-listening-card[hidden] {
    display: none !important;
}

.home-dashboard .resume-listening-card {
    display: grid;
}

/* 32차: admin automatic diagnostic report */
.admin-auto-diagnostic-section {
    display: grid;
    gap: 18px;
    overflow: hidden;
}

.admin-auto-diagnostic-head {
    gap: 14px;
}

.admin-auto-diagnostic-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.diagnostic-state-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 900;
    border: 1px solid rgba(148, 163, 184, 0.3);
    white-space: nowrap;
}

.diagnostic-state-pill.status-ok {
    color: #047857;
    background: rgba(220, 252, 231, 0.86);
    border-color: rgba(34, 197, 94, 0.24);
}

.diagnostic-state-pill.status-warning {
    color: #a16207;
    background: rgba(254, 249, 195, 0.9);
    border-color: rgba(234, 179, 8, 0.3);
}

.diagnostic-state-pill.status-error {
    color: #b91c1c;
    background: rgba(254, 226, 226, 0.9);
    border-color: rgba(239, 68, 68, 0.3);
}

.admin-auto-diagnostic-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    min-width: 0;
}

.admin-auto-diagnostic-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(203, 213, 225, 0.78);
    background: rgba(255, 255, 255, 0.88);
    color: var(--text-primary, #0f172a);
    text-decoration: none;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.admin-auto-diagnostic-card:hover {
    transform: translateY(-1px);
    border-color: rgba(34, 197, 94, 0.28);
}

.admin-auto-diagnostic-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    color: #0f766e;
    background: rgba(240, 253, 250, 0.9);
}

.admin-auto-diagnostic-card.status-warning .admin-auto-diagnostic-icon {
    color: #a16207;
    background: rgba(254, 249, 195, 0.9);
}

.admin-auto-diagnostic-card.status-error .admin-auto-diagnostic-icon {
    color: #b91c1c;
    background: rgba(254, 226, 226, 0.92);
}

.admin-auto-diagnostic-main {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.admin-auto-diagnostic-title,
.admin-auto-diagnostic-main small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-auto-diagnostic-title {
    color: var(--text-secondary, #475569);
    font-size: 0.86rem;
    font-weight: 800;
}

.admin-auto-diagnostic-main strong {
    color: var(--text-primary, #0f172a);
    font-size: 1.35rem;
    font-weight: 950;
    line-height: 1.05;
}

.admin-auto-diagnostic-main small {
    color: var(--text-muted, #64748b);
    font-size: 0.82rem;
}

.admin-auto-diagnostic-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 900;
    color: #047857;
    background: rgba(220, 252, 231, 0.88);
}

.admin-auto-diagnostic-card.status-warning .admin-auto-diagnostic-badge {
    color: #a16207;
    background: rgba(254, 249, 195, 0.92);
}

.admin-auto-diagnostic-card.status-error .admin-auto-diagnostic-badge {
    color: #b91c1c;
    background: rgba(254, 226, 226, 0.92);
}

.admin-auto-diagnostic-empty {
    margin: 0;
    padding: 12px 14px;
    border-radius: 14px;
    color: #047857;
    background: rgba(220, 252, 231, 0.65);
    font-weight: 800;
}

body.theme-dark .admin-auto-diagnostic-card {
    background: rgba(15, 23, 42, 0.74);
    border-color: rgba(148, 163, 184, 0.24);
}

body.theme-dark .admin-auto-diagnostic-title,
body.theme-dark .admin-auto-diagnostic-main small {
    color: rgba(226, 232, 240, 0.72);
}

body.theme-dark .admin-auto-diagnostic-main strong {
    color: #f8fafc;
}

@media (max-width: 1199px) {
    .admin-auto-diagnostic-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .admin-auto-diagnostic-head,
    .admin-auto-diagnostic-actions {
        align-items: stretch;
    }

    .admin-auto-diagnostic-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        width: 100%;
    }

    .admin-auto-diagnostic-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .admin-auto-diagnostic-card {
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 10px;
        padding: 13px;
    }

    .admin-auto-diagnostic-badge {
        grid-column: 2;
        justify-self: start;
    }
}

/* 33차: backup status and restore readiness */
.backup-status-summary,
.backup-status-dashboard-section {
    display: grid;
    gap: 18px;
    overflow: hidden;
}

.backup-status-summary-head,
.backup-status-dashboard-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.backup-status-dashboard-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.backup-status-grid,
.backup-status-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    min-width: 0;
}

.backup-status-card,
.backup-status-dashboard-card {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(203, 213, 225, 0.78);
    background: rgba(255, 255, 255, 0.88);
}

.backup-status-card span,
.backup-status-card small,
.backup-status-dashboard-card span,
.backup-status-dashboard-card small,
.backup-status-card strong,
.backup-status-dashboard-card strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.backup-status-card span,
.backup-status-dashboard-card span {
    color: var(--text-secondary, #475569);
    font-size: 0.86rem;
    font-weight: 850;
}

.backup-status-card strong,
.backup-status-dashboard-card strong {
    color: var(--text-primary, #0f172a);
    font-size: 1.18rem;
    font-weight: 950;
}

.backup-status-card small,
.backup-status-dashboard-card small {
    color: var(--text-muted, #64748b);
    font-size: 0.82rem;
}

.backup-status-issues {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 12px 14px 12px 32px;
    border-radius: 14px;
    color: #92400e;
    background: rgba(254, 249, 195, 0.75);
    font-weight: 800;
}

.backup-status-summary.status-error .backup-status-issues,
.backup-status-dashboard-section.status-error .backup-status-issues {
    color: #991b1b;
    background: rgba(254, 226, 226, 0.78);
}

.backup-status-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

body.theme-dark .backup-status-card,
body.theme-dark .backup-status-dashboard-card {
    background: rgba(15, 23, 42, 0.74);
    border-color: rgba(148, 163, 184, 0.24);
}

body.theme-dark .backup-status-card span,
body.theme-dark .backup-status-card small,
body.theme-dark .backup-status-dashboard-card span,
body.theme-dark .backup-status-dashboard-card small {
    color: rgba(226, 232, 240, 0.72);
}

body.theme-dark .backup-status-card strong,
body.theme-dark .backup-status-dashboard-card strong {
    color: #f8fafc;
}

@media (max-width: 1199px) {
    .backup-status-grid,
    .backup-status-dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .backup-status-summary-head,
    .backup-status-dashboard-head {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .backup-status-dashboard-actions {
        justify-content: stretch;
    }

    .backup-status-grid,
    .backup-status-dashboard-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .backup-status-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .backup-status-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* 34th commercialization update: service policy pages */
.policy-page,
.policy-admin-page {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 4px 0 calc(var(--player-safe-bottom, 120px) + 28px);
}

.policy-hero,
.policy-content-card,
.policy-note-card,
.policy-admin-layout .settings-card {
    border: 1px solid var(--border-color, #dbe4ef);
    background: var(--card-bg, #fff);
    box-shadow: var(--card-shadow, 0 18px 44px rgba(15, 23, 42, 0.08));
}

.policy-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    border-radius: 22px;
    margin-bottom: 16px;
}

.policy-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--accent-color, #00b050);
    font-weight: 800;
}

.policy-tabs,
.policy-admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.policy-tab,
.policy-admin-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--border-color, #dbe4ef);
    border-radius: 999px;
    background: var(--surface-bg, #f8fafc);
    color: var(--text-primary, #0f172a);
    font-weight: 800;
    text-decoration: none;
}

.policy-tab.is-active,
.policy-admin-tab.is-active {
    border-color: rgba(0, 176, 80, 0.45);
    background: rgba(0, 176, 80, 0.1);
    color: var(--accent-color, #00a33a);
}

.policy-content-card {
    padding: 26px;
    border-radius: 22px;
}

.policy-content-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.policy-content-head h2 {
    margin: 0 0 4px;
    font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.policy-content-head p {
    margin: 0;
    color: var(--text-secondary, #64748b);
}

.policy-content-icon,
.policy-note-card i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: rgba(0, 176, 80, 0.12);
    color: var(--accent-color, #00a33a);
    flex: 0 0 auto;
}

.policy-body {
    color: var(--text-primary, #0f172a);
    font-size: 1rem;
    line-height: 1.78;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.policy-note-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.policy-note-card {
    padding: 20px;
    border-radius: 20px;
}

.policy-note-card h3 {
    margin: 14px 0 8px;
    font-size: 1.05rem;
}

.policy-note-card p {
    margin: 0;
    color: var(--text-secondary, #64748b);
    line-height: 1.6;
}

.sidebar-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-top: 6px;
    font-size: 0.78rem;
}

.sidebar-footer-links a {
    color: var(--text-secondary, #64748b);
    text-decoration: none;
}

.sidebar-footer-links a:hover {
    color: var(--accent-color, #00a33a);
}

.policy-admin-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 16px;
}

.policy-admin-nav,
.policy-editor-card {
    min-width: 0;
}

.policy-admin-tabs {
    flex-direction: column;
}

.policy-admin-tab {
    justify-content: flex-start;
    width: 100%;
}

.policy-editor-form textarea {
    width: 100%;
    min-height: 420px;
    resize: vertical;
    line-height: 1.65;
}

.policy-editor-actions,
.policy-settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

body.theme-dark .policy-hero,
body.theme-dark .policy-content-card,
body.theme-dark .policy-note-card,
body.theme-dark .policy-admin-layout .settings-card {
    background: rgba(15, 23, 42, 0.92);
    border-color: rgba(148, 163, 184, 0.22);
}

@media (max-width: 1023px) {
    .policy-page,
    .policy-admin-page {
        padding-inline: 0;
    }

    .policy-hero,
    .policy-content-card,
    .policy-note-card {
        border-radius: 18px;
    }

    .policy-admin-layout,
    .policy-note-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .policy-admin-tabs {
        flex-direction: row;
    }
}

@media (max-width: 767px) {
    .policy-page,
    .policy-admin-page {
        padding-bottom: calc(var(--player-safe-bottom, 140px) + env(safe-area-inset-bottom, 0px) + 24px);
    }

    .policy-hero {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        padding: 20px;
    }

    .policy-tabs,
    .policy-admin-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .policy-tab,
    .policy-admin-tab {
        min-width: 0;
        padding: 0 10px;
        font-size: 0.9rem;
    }

    .policy-content-card {
        padding: 20px;
    }

    .policy-content-head {
        align-items: flex-start;
    }

    .policy-body {
        font-size: 0.95rem;
    }

    .policy-editor-actions .btn,
    .policy-settings-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* 35th commercialization update: accessibility, keyboard focus, touch targets. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent-color, #00c73c) 70%, white);
    outline-offset: 3px;
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent-color, #00c73c) 16%, transparent);
}

body.theme-dark :where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline-color: color-mix(in srgb, var(--accent-color, #00c73c) 78%, white);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent-color, #00c73c) 24%, transparent);
}

.control-btn,
.modal-close-btn,
.close-btn,
.like-btn,
.add-next-btn,
.add-playlist-btn,
.download-song-btn,
.metadata-request-btn,
.play-row-btn,
.compact-play,
.queue-item-move,
.queue-item-remove,
.sidebar-collapse-btn,
.mobile-menu-btn,
.feedback-fab,
.scroll-top-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.modal-overlay,
.expand-player-overlay,
.pwa-guide-modal,
.pwa-install-modal,
.guest-preview-prompt {
    overscroll-behavior: contain;
}

.modal-box,
.pwa-install-card,
.pwa-guide-card,
.guest-preview-card,
.onboarding-card,
.expand-player-container {
    max-width: min(100%, calc(100vw - 24px));
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px);
}

@media (pointer: coarse), (max-width: 1199px) {
    .control-btn,
    .modal-close-btn,
    .close-btn,
    .like-btn,
    .add-next-btn,
    .add-playlist-btn,
    .download-song-btn,
    .metadata-request-btn,
    .play-row-btn,
    .compact-play,
    .queue-item-move,
    .queue-item-remove,
    .sidebar-collapse-btn,
    .mobile-menu-btn,
    .tab-header-btn,
    .playlist-option-item,
    .rating-star {
        min-width: 44px;
        min-height: 44px;
    }

    .btn,
    button,
    input,
    select,
    textarea {
        font-size: max(16px, 1rem);
    }

    .modal-actions,
    .feedback-modal-actions,
    .download-modal-actions,
    .settings-action-row,
    .page-actions,
    .toolbar-actions {
        gap: 10px;
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    body.is-tablet-layout,
    body.is-tablet-layout .app-container,
    body.is-tablet-layout .main-content,
    body.is-tablet-layout .content-body {
        max-width: 100vw;
        overflow-x: clip;
    }

    body.is-tablet-layout .content-body {
        padding-bottom: calc(var(--player-height, 92px) + var(--safe-bottom, env(safe-area-inset-bottom, 0px)) + 42px) !important;
    }

    body.is-tablet-layout .top-bar {
        gap: 12px !important;
    }

    body.is-tablet-layout .search-container {
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    body.is-tablet-layout .quick-search-form input,
    body.is-tablet-layout .search-form input[type="search"] {
        min-width: 0 !important;
    }

    body.is-tablet-layout .user-profile {
        flex: 0 0 auto !important;
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.is-tablet-layout .modal-box,
    body.is-tablet-layout .pwa-install-card,
    body.is-tablet-layout .pwa-guide-card,
    body.is-tablet-layout .guest-preview-card,
    body.is-tablet-layout .onboarding-card {
        width: min(680px, calc(100vw - 36px));
    }

    body.is-tablet-layout .queue-panel {
        max-width: min(520px, calc(100vw - 36px));
        max-height: calc(100dvh - var(--safe-top, env(safe-area-inset-top, 0px)) - var(--player-height, 92px) - 48px);
    }
}

@media (min-width: 1024px) and (max-width: 1199px) {
    body.is-tablet-layout .top-bar {
        min-height: 72px !important;
        padding-right: max(18px, env(safe-area-inset-right, 0px) + 18px) !important;
    }

    body.is-tablet-layout .mobile-menu-btn,
    body.is-tablet-layout .user-profile {
        min-width: 48px;
        min-height: 48px;
    }
}

@media (max-width: 767px) {
    .modal-box,
    .pwa-install-card,
    .pwa-guide-card,
    .guest-preview-card,
    .onboarding-card {
        width: calc(100vw - 24px);
        max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - var(--mobile-player-height, 92px) - 28px);
    }

    .modal-actions,
    .feedback-modal-actions,
    .download-modal-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .modal-actions .btn,
    .feedback-modal-actions .btn,
    .download-modal-actions .btn {
        width: 100%;
        justify-content: center;
    }
}
/* 36th commercialization update: API error notices must stay above player UI. */
.melon-lite-toast[data-type="error"] {
    max-width: min(92vw, 420px);
    word-break: keep-all;
    overflow-wrap: anywhere;
}

@media (max-width: 1199px) {
    .melon-lite-toast[data-type="error"] {
        left: max(14px, env(safe-area-inset-left, 0px));
        right: max(14px, env(safe-area-inset-right, 0px));
        bottom: calc(var(--bottom-player-height, 92px) + env(safe-area-inset-bottom, 0px) + 16px);
        max-width: none;
    }
}

/* 37th commercialization update: stable installed-app and PWA guide layout. */
body.is-standalone {
    min-height: 100dvh;
    padding-top: env(safe-area-inset-top, 0px);
}

body.is-standalone .content-body,
body.is-standalone .offline-page {
    padding-bottom: calc(var(--bottom-player-height, 96px) + env(safe-area-inset-bottom, 0px) + 40px) !important;
}

.offline-page {
    min-height: calc(100dvh - var(--player-height, 92px));
    padding: calc(24px + env(safe-area-inset-top, 0px)) 18px calc(var(--player-height, 92px) + env(safe-area-inset-bottom, 0px) + 28px);
}

.offline-card {
    max-width: min(640px, 100%);
    margin-inline: auto;
}

.offline-checklist {
    display: grid;
    gap: 10px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
    color: var(--text-secondary, #64748b);
}

.offline-checklist li {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    line-height: 1.55;
}

.offline-checklist i {
    color: var(--accent-color, #00cd3c);
    margin-top: 3px;
}

.pwa-install-banner.pwa-install-modal,
.pwa-guide-modal {
    padding:
        calc(18px + env(safe-area-inset-top, 0px))
        max(18px, env(safe-area-inset-right, 0px) + 18px)
        calc(var(--player-height, 92px) + env(safe-area-inset-bottom, 0px) + 28px)
        max(18px, env(safe-area-inset-left, 0px) + 18px) !important;
}

.pwa-install-card,
.pwa-guide-card {
    max-height: calc(100dvh - var(--player-height, 92px) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 44px) !important;
    overflow: auto;
    overscroll-behavior: contain;
}

.pwa-install-steps {
    max-height: min(34dvh, 220px);
    overflow: auto;
}

@media (min-width: 768px) and (max-width: 1199px) {
    body.is-tablet-layout .pwa-install-card,
    body.is-tablet-layout .pwa-guide-card {
        width: min(560px, calc(100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px) - 44px));
    }

    body.is-tablet-layout .offline-page {
        padding-inline: clamp(28px, 5vw, 64px);
    }
}

@media (max-width: 767px) {
    body.is-standalone {
        padding-top: 0 !important;
    }

    body.is-standalone .app-container {
        padding-top: 0 !important;
        height: 100dvh !important;
    }

    body.is-standalone .top-bar {
        --mobile-standalone-header-safe-top: min(var(--safe-top, env(safe-area-inset-top, 0px)), 48px);
        min-height: calc(64px + var(--mobile-standalone-header-safe-top, 0px)) !important;
        padding-top: calc(12px + var(--mobile-standalone-header-safe-top, 0px)) !important;
        padding-bottom: 8px !important;
    }

    .pwa-install-banner.pwa-install-modal,
    .pwa-guide-modal {
        padding:
            calc(12px + env(safe-area-inset-top, 0px))
            max(12px, env(safe-area-inset-right, 0px) + 12px)
            calc(var(--mobile-player-height, 92px) + env(safe-area-inset-bottom, 0px) + 20px)
            max(12px, env(safe-area-inset-left, 0px) + 12px) !important;
    }

    .pwa-install-card,
    .pwa-guide-card {
        max-height: calc(100dvh - var(--mobile-player-height, 92px) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 28px) !important;
    }

    .offline-page {
        padding-inline: 14px;
    }
}

/* Queue polish: keep the fullscreen queue compact on mobile and tablet. */
.expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-tab-section {
    border-radius: 18px !important;
}

.expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-tab-content {
    padding: 8px !important;
}

.expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) #expand-queue-list {
    display: grid !important;
    gap: 8px !important;
    padding: 2px 0 4px !important;
}

.expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) #expand-queue-list .queue-item {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 42px 36px 34px !important;
    grid-template-areas: none !important;
    align-items: center !important;
    min-height: 58px !important;
    margin: 0 !important;
    padding: 9px 11px !important;
    gap: 9px !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05) !important;
}

.expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) #expand-queue-list .queue-item.active,
.expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) #expand-queue-list .queue-item.is-playing {
    box-shadow:
        0 10px 24px color-mix(in srgb, var(--accent-color, #00c73c) 13%, rgba(15, 23, 42, 0.08)),
        inset 4px 0 0 var(--accent-color, #00c73c) !important;
}

.expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) #expand-queue-list .queue-item-thumb {
    grid-area: auto !important;
    display: none !important;
}

.expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) #expand-queue-list .queue-item-meta {
    grid-area: auto !important;
    grid-column: 1 !important;
    justify-self: stretch !important;
    min-width: 0 !important;
    display: grid !important;
    gap: 3px !important;
}

.expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) #expand-queue-list .queue-item-title {
    margin: 0 !important;
    font-size: 0.9rem !important;
    line-height: 1.18 !important;
    font-weight: 850 !important;
}

.expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) #expand-queue-list .queue-item-artist {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    min-width: 0 !important;
    font-size: 0.73rem !important;
    line-height: 1.2 !important;
}

.expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) #expand-queue-list .queue-item-position {
    flex: 0 0 auto !important;
    padding: 2px 6px !important;
    font-size: 0.66rem !important;
    line-height: 1.2 !important;
}

.expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) #expand-queue-list .queue-item-duration {
    grid-area: auto !important;
    grid-column: 2 !important;
    justify-self: end !important;
    align-self: start !important;
    padding-top: 2px !important;
    font-size: 0.76rem !important;
    font-weight: 800 !important;
}

.expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) #expand-queue-list .queue-item-order {
    grid-area: auto !important;
    grid-column: 3 !important;
    gap: 4px !important;
}

.expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) #expand-queue-list .queue-item-move {
    width: 36px !important;
    height: 32px !important;
    min-width: 36px !important;
    min-height: 32px !important;
    border-radius: 11px !important;
    font-size: 0.72rem !important;
}

.expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) #expand-queue-list .queue-item-remove {
    grid-area: auto !important;
    grid-column: 4 !important;
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    border-radius: 12px !important;
    font-size: 0.78rem !important;
}

@media (max-width: 767px) {
    .expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-tab-headers {
        min-height: 48px !important;
        padding: 5px !important;
        gap: 5px !important;
    }

    .expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) .tab-header-btn,
    .expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) .expand-tab-collapse-btn {
        min-height: 38px !important;
        border-radius: 14px !important;
        font-size: 0.88rem !important;
    }

    .expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) #expand-queue-list .queue-item {
        grid-template-columns: minmax(0, 1fr) 38px 34px 32px !important;
        grid-template-areas: none !important;
        min-height: 54px !important;
        padding: 8px 10px !important;
        gap: 8px !important;
        border-radius: 15px !important;
    }

    .expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) #expand-queue-list .queue-item-title {
        font-size: 0.84rem !important;
    }

    .expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) #expand-queue-list .queue-item-artist {
        font-size: 0.68rem !important;
    }

    .expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) #expand-queue-list .queue-item-duration {
        font-size: 0.7rem !important;
    }

    .expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) #expand-queue-list .queue-item-move {
        width: 34px !important;
        height: 29px !important;
        min-width: 34px !important;
        min-height: 29px !important;
    }

    .expand-player-overlay .expand-player-container.is-queue-view:not(.is-tab-collapsed) #expand-queue-list .queue-item-remove {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
    }
}

@media (max-width: 1199px) {
    .queue-panel .queue-item {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 42px 36px 34px !important;
        grid-template-areas: none !important;
        align-items: center !important;
        min-height: 58px !important;
        padding: 9px 11px !important;
        gap: 9px !important;
    }

    .queue-panel .queue-item-thumb {
        grid-area: auto !important;
        display: none !important;
    }

    .queue-panel .queue-item-meta {
        grid-area: auto !important;
        grid-column: 1 !important;
        justify-self: stretch !important;
        min-width: 0 !important;
    }

    .queue-panel .queue-item-duration {
        grid-area: auto !important;
        grid-column: 2 !important;
        justify-self: end !important;
    }

    .queue-panel .queue-item-order {
        grid-area: auto !important;
        grid-column: 3 !important;
    }

    .queue-panel .queue-item-remove {
        grid-area: auto !important;
        grid-column: 4 !important;
    }
}
