﻿:root {
    --color-bg: #121212;
    --color-bg-glass: rgba(75, 0, 130, 0.07);
    --color-text: #ffffff;
    --color-text-soft: #cccccc;
    --color-accent: #a020f0;
    --color-accent-light: #ba55d3;
    --color-accent-soft: rgba(142, 32, 189, 0.18);
    --color-accent-faint: rgba(146, 3, 168, 0.10);
    --color-border: rgba(255, 255, 255, 0.15);
    --color-glow-1: #8e20bd;
    --color-glow-2: #9203A8;
    --color-rainbow-gradient: linear-gradient(90deg, #ff4d5d, #ff9f1c, #ffe45e, #42d96b, #00c2ff, #b76cff);
    --color-pride-red: #ff4d5d;
    --color-pride-orange: #ff9f1c;
    --color-pride-yellow: #ffe45e;
    --color-pride-green: #42d96b;
    --color-pride-blue: #00c2ff;
    --color-pride-violet: #b76cff;
    --bg-overlay-opacity: 1;

    --font-family: 'Nunito', sans-serif;
    --font-size-base: 16px;
    --font-size-title: 1rem;
    --font-size-artist: 1rem;
    --font-weight-bold: 700;

    --transition-speed: 0.3s;
    --transition-fast: 0.15s;
    --border-radius: 15px;
    --blur-amount: 10px;
    --safe-area-top: env(safe-area-inset-top, 0px);

    --sidebar-width: 260px;
    --playback-height: 90px;
    --app-viewport-height: 100vh;
}

@supports (height: 100dvh) {
    :root {
        --app-viewport-height: 100dvh;
    }
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    overscroll-behavior-x: none;
}

/* Home Dashboard */
.home-dashboard {
    margin-bottom: 12px;
    display: grid;
    gap: 10px;
}

.home-top-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.home-top-actions .option-controls {
    min-height: 34px;
    padding: 8px 11px;
    font-size: 0.82rem;
}

.home-dashboard-panel {
    border-radius: var(--border-radius);
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    min-width: 0;
}

.home-panel-head h2 {
    margin: 0;
    font-family: 'Kanit', sans-serif;
    font-size: 0.98rem;
    line-height: 1.1;
}

.home-panel-head p {
    margin: 4px 0 0;
    color: var(--color-text-soft);
    font-size: 0.8rem;
}

.home-mood-title {
    display: none;
    width: 100%;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    min-height: 38px;
    flex-wrap: wrap;
}

.home-mood-title .home-panel-head {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: 100%;
}

.home-mood-tabs {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    align-self: center;
}

.home-mood-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 14px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--color-text-soft);
    font-family: 'Kanit', sans-serif;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition-fast) ease, color var(--transition-fast) ease, transform var(--transition-fast) ease;
}

.home-mood-tab:hover {
    color: var(--color-text);
    transform: translateY(-1px);
}

.home-mood-tab.active {
    background: linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.08));
    color: var(--color-text);
    box-shadow: 0 8px 18px rgba(0,0,0,0.18);
}

.content-controls.has-home-tabs {
    flex-wrap: wrap;
    align-items: flex-start;
}

.content-controls.has-home-tabs .search-bar {
    flex-basis: 100%;
}

body.app-route-booting #homeDashboard,
body.app-route-booting #playlistHeader,
body.app-route-booting #contentControls,
body.app-route-booting #songTable,
body.app-route-booting #songGrid,
body.app-route-booting #paginationControls,
body.app-route-booting #noPermission {
    visibility: hidden;
}

.home-feed-list {
    margin-top: 9px;
    display: grid;
    gap: 8px;
}

.home-dashboard.is-transition-locked {
    opacity: 0 !important;
    pointer-events: none !important;
}

.home-empty {
    color: var(--color-text-soft);
    font-size: 0.82rem;
    border: 1px dashed rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
}

.home-info-item {
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    padding: 8px 10px;
    background: rgba(255,255,255,0.02);
}

.home-info-item-title {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.home-info-item-title .pin {
    color: var(--color-accent-light);
    font-size: 18px;
}

.home-info-item-body {
    margin-top: 4px;
    color: var(--color-text-soft);
    line-height: 1.25;
    white-space: pre-wrap;
    font-size: 0.82rem;
}


.home-feed-item {
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    padding: 10px;
    background: rgba(255,255,255,0.025);
}

.home-feed-item.is-highlighted {
    border-color: rgba(122, 255, 191, 0.68);
    box-shadow: 0 0 0 1px rgba(122, 255, 191, 0.45), 0 12px 24px rgba(0,0,0,0.24);
}

.home-feed-post-composer {
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    background: linear-gradient(160deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
    padding: 10px;
}

.home-feed-post-form {
    display: grid;
    gap: 8px;
}

.home-feed-post-form textarea {
    width: 100%;
    min-height: 76px;
    resize: none;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.05);
    color: var(--color-text);
    padding: 9px 10px;
    font: inherit;
    font-size: 0.85rem;
}

.home-feed-post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.home-feed-post-limit {
    color: var(--color-text-soft);
    font-size: 0.74rem;
    font-variant-numeric: tabular-nums;
}

.home-feed-post-disabled {
    color: var(--color-text-soft);
    font-size: 0.8rem;
    border: 1px dashed rgba(255,255,255,0.16);
    border-radius: 10px;
    padding: 10px;
}

.home-feed-head {
    display: flex;
    gap: 8px;
}

.home-feed-avatar {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.home-feed-avatar-fallback {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.82rem;
    background: rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.home-feed-title {
    font-weight: 700;
    line-height: 1.2;
    font-size: 0.92rem;
}

.home-feed-meta {
    color: var(--color-text-soft);
    font-size: 0.72rem;
    margin-top: 1px;
}

.home-feed-text {
    margin-top: 6px;
    line-height: 1.25;
    color: var(--color-text-soft);
    white-space: pre-wrap;
    font-size: 0.83rem;
}

.home-feed-content-row {
    margin-top: 6px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    align-items: start;
}

.home-feed-content-row.has-media {
    grid-template-columns: minmax(0, 1fr) auto;
}

.home-feed-content-col {
    min-width: 0;
}

.home-feed-media-side {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    flex-shrink: 0;
}

.home-feed-context-links {
    margin-top: 6px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.home-feed-context-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 30px;
    padding: 5px 9px;
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.76rem;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.home-feed-context-link:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.24);
}

.home-feed-context-link .material-symbols-outlined {
    font-size: 15px;
}

.home-feed-context-more {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 9px;
    color: var(--color-text-soft);
    font-size: 0.74rem;
    border: 1px dashed rgba(255,255,255,0.16);
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
}

.home-feed-quickbar {
    margin-top: 7px;
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: nowrap;
}

.home-feed-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 999px;
    text-decoration: none;
    color: var(--color-text);
    font-size: 0.78rem;
    background: rgba(255,255,255,0.05);
    white-space: nowrap;
}

.home-feed-open-btn .material-symbols-outlined {
    font-size: 16px;
}

.home-feed-open-btn.is-empty {
    color: var(--color-text-soft);
    border-style: dashed;
}

.home-feed-icon-btn,
.home-feed-counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 32px;
    min-width: 44px;
    padding: 6px 8px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    background: rgba(255,255,255,0.03);
    color: var(--color-text);
    font: inherit;
    font-size: 0.75rem;
}

.home-feed-icon-btn {
    cursor: pointer;
}

.home-feed-icon-btn .material-symbols-outlined,
.home-feed-counter .material-symbols-outlined {
    font-size: 16px;
}

.home-feed-icon-count {
    min-width: 12px;
    text-align: center;
}

.home-feed-icon-btn.is-active {
    border-color: rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.08);
}

.home-feed-icon-btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.home-feed-comment-toggle {
    padding-right: 6px;
}

.home-feed-toggle-chevron {
    font-size: 14px !important;
    opacity: 0.85;
    transition: transform 0.2s ease;
}

.home-feed-comment-toggle.is-active .home-feed-toggle-chevron {
    transform: rotate(180deg);
}

.home-feed-comments-panel {
    margin-top: 8px;
    display: grid;
    gap: 8px;
}

.home-feed-comments-panel[hidden] {
    display: none !important;
}

.home-feed-like-btn {
    position: relative;
}

.home-feed-like-icon {
    color: var(--color-text-soft);
    font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 20;
    transform-origin: center;
    transition: color 0.2s ease, font-variation-settings 0.2s ease;
}

.home-feed-like-btn.is-active .home-feed-like-icon {
    color: var(--color-accent-light);
    font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 20;
    filter: drop-shadow(0 0 6px var(--color-accent-soft));
}

.home-feed-like-btn::after {
    content: "favorite";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.3);
    opacity: 0;
    pointer-events: auto;
    font-family: 'Material Symbols Outlined';
    font-size: 16px;
    font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 20;
    color: var(--color-accent-light);
}

.home-feed-like-btn.like-pop {
    animation: feedLikePop 0.34s cubic-bezier(0.22, 1.2, 0.36, 1);
}

.home-feed-like-btn.like-pop .home-feed-like-icon {
    animation: feedHeartPulse 0.34s cubic-bezier(0.22, 1.2, 0.36, 1);
}

.home-feed-like-btn.is-active.like-pop::after {
    animation: feedLikeBurst 0.45s ease-out;
}

@keyframes feedLikePop {
    0% { transform: scale(1); }
    35% { transform: scale(1.18); }
    100% { transform: scale(1); }
}

@keyframes feedHeartPulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.24); }
    100% { transform: scale(1); }
}

@keyframes feedLikeBurst {
    0% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(0.35);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.9);
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-feed-like-btn.like-pop,
    .home-feed-like-btn.like-pop .home-feed-like-icon,
    .home-feed-like-btn.is-active.like-pop::after {
        animation: none !important;
    }
}

.home-feed-comment-list {
    margin-top: 0;
    display: grid;
    gap: 6px;
}

.home-feed-comment-empty {
    border: 1px dashed rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 8px;
    color: var(--color-text-soft);
    font-size: 0.76rem;
    text-align: center;
}

.home-feed-comment {
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.02);
    padding: 6px 8px;
}

.home-feed-comment.is-highlighted {
    border-color: rgba(122, 255, 191, 0.7);
    background: rgba(122, 255, 191, 0.12);
}

.home-feed-comment-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
}

.home-feed-comment-author-wrap {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.home-feed-comment-avatar,
.home-feed-comment-avatar-fallback {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
}

.home-feed-comment-avatar {
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.04);
}

.home-feed-comment-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    background: rgba(255,255,255,0.08);
    color: var(--color-text);
}

.home-feed-comment-author {
    font-weight: 700;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-feed-comment-meta {
    color: var(--color-text-soft);
    font-size: 0.8rem;
}

.home-feed-comment-body {
    margin-top: 3px;
    color: var(--color-text-soft);
    line-height: 1.35;
    white-space: pre-wrap;
    font-size: 0.92rem;
}

.home-feed-comment-actions {
    margin-top: 4px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.home-feed-comment-actions button {
    border: none;
    background: transparent;
    color: var(--color-text-soft);
    cursor: pointer;
    font-size: 0.72rem;
}

.home-feed-comment-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    min-height: auto;
    min-width: auto;
}

.home-feed-comment-like-btn .material-symbols-outlined {
    font-size: 14px;
}

.home-feed-comment-like-count {
    min-width: 10px;
    text-align: center;
}

.home-feed-comment-like-btn.is-active {
    color: var(--color-accent-light);
}

.home-feed-comment-like-btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.home-feed-comment-form {
    margin-top: 6px;
    display: grid;
    gap: 6px;
}

.home-feed-comment-form textarea {
    width: 100%;
    min-height: 56px;
    resize: none;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: var(--color-text);
    padding: 7px 8px;
    font: inherit;
    font-size: 0.82rem;
}

.home-feed-comment-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.home-feed-comment-help {
    color: var(--color-text-soft);
    font-size: 0.72rem;
}

.home-feed-comment-limit {
    color: var(--color-text-soft);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
}

.home-feed-comment-disabled {
    margin-top: 0;
    color: var(--color-text-soft);
    font-size: 0.76rem;
    border: 1px dashed rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 7px 8px;
}

.home-feed-pagination {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    align-items: center;
    padding: 8px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.12);
    background: linear-gradient(160deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
}

.home-feed-pagination .option-controls {
    min-height: 36px;
    padding: 7px 10px;
    border-radius: 12px;
    justify-content: center;
    white-space: nowrap;
    font-family: 'Kanit', sans-serif;
    font-weight: 700;
    font-size: 0.84rem;
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.14);
}

.home-feed-pagination .option-controls[disabled] {
    opacity: 0.42;
    cursor: default;
    pointer-events: auto;
    color: rgba(255,255,255,0.45);
    background: rgba(255,255,255,0.04);
    border-color: rgba(255,255,255,0.10);
}

.home-feed-pagination .option-controls.is-enabled {
    opacity: 1;
    color: var(--color-text);
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.22);
    box-shadow: 0 6px 16px rgba(0,0,0,0.18);
}

.home-feed-pagination .option-controls.is-enabled:hover {
    background: rgba(255,255,255,0.17);
}

.home-feed-page-label {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.06);
    color: var(--color-text);
    font-family: 'Kanit', sans-serif;
    font-size: 0.84rem;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
}

@media (min-width: 981px) {
    .home-feed-list {
        gap: 8px;
    }

    .home-feed-item {
        border-radius: 12px;
        padding: 10px;
    }

    .home-feed-head {
        gap: 10px;
    }

    .home-feed-avatar,
    .home-feed-avatar-fallback {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .home-feed-avatar-fallback {
        font-size: 0.92rem;
    }

    .home-feed-title {
        font-size: 1rem;
    }

    .home-feed-meta {
        margin-top: 2px;
        font-size: 0.78rem;
    }

    .home-feed-text {
        margin-top: 4px;
        line-height: 1.3;
        font-size: 0.9rem;
    }

    .home-feed-content-row {
        margin-top: 4px;
        gap: 8px;
    }

    .home-feed-media-side {
        width: 68px;
        height: 68px;
        border-radius: 9px;
    }

    .home-feed-context-links {
        margin-top: 4px;
        gap: 7px;
    }

    .home-feed-context-link,
    .home-feed-context-more {
        min-height: 34px;
        padding: 6px 11px;
    }

    .home-feed-context-link {
        font-size: 0.82rem;
    }

    .home-feed-context-link .material-symbols-outlined {
        font-size: 17px;
    }

    .home-feed-context-more {
        font-size: 0.8rem;
    }

    .home-feed-quickbar {
        margin-top: 4px;
        gap: 7px;
    }

    .home-feed-open-btn {
        min-height: 36px;
        padding: 7px 12px;
        font-size: 0.84rem;
    }

    .home-feed-open-btn .material-symbols-outlined {
        font-size: 17px;
    }

    .home-feed-icon-btn,
    .home-feed-counter {
        min-height: 36px;
        min-width: 48px;
        padding: 7px 10px;
        font-size: 0.82rem;
    }

    .home-feed-icon-btn .material-symbols-outlined,
    .home-feed-counter .material-symbols-outlined {
        font-size: 18px;
    }

    .home-feed-toggle-chevron {
        font-size: 15px !important;
    }

    .home-feed-comments-panel {
        margin-top: 6px;
        gap: 10px;
    }

    .home-feed-comment-list {
        gap: 8px;
    }

    .home-feed-comment-empty {
        border-radius: 10px;
        padding: 10px;
        font-size: 0.82rem;
    }

    .home-feed-comment {
        border-radius: 10px;
        padding: 8px 10px;
    }

    .home-feed-comment-avatar,
    .home-feed-comment-avatar-fallback {
        width: 28px;
        height: 28px;
    }

    .home-feed-comment-avatar-fallback {
        font-size: 0.74rem;
    }

    .home-feed-comment-author {
        font-size: 0.84rem;
    }

    .home-feed-comment-meta {
        font-size: 0.76rem;
    }

    .home-feed-comment-body {
        margin-top: 4px;
        line-height: 1.3;
        font-size: 0.84rem;
    }

    .home-feed-comment-actions button {
        font-size: 0.76rem;
    }

    .home-feed-comment-actions {
        gap: 12px;
    }

    .home-feed-comment-form textarea {
        min-height: 68px;
        border-radius: 10px;
        padding: 9px 10px;
        font-size: 0.88rem;
    }

    .home-feed-post-form textarea {
        min-height: 84px;
        border-radius: 10px;
        padding: 10px 11px;
        font-size: 0.9rem;
    }

    .home-feed-comment-help,
    .home-feed-comment-limit,
    .home-feed-post-limit {
        font-size: 0.76rem;
    }

    .home-feed-comment-disabled {
        border-radius: 10px;
        padding: 9px 10px;
        font-size: 0.82rem;
    }

    .home-feed-pagination {
        margin-top: 12px;
        padding: 10px;
        gap: 10px;
    }

    .home-feed-pagination .option-controls,
    .home-feed-page-label {
        min-height: 40px;
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}

@media (max-width: 980px) {
}

@media (max-width: 640px) {
    .home-feed-head {
        align-items: flex-start;
    }

    .home-feed-media-side {
        width: 64px;
        height: 64px;
        border-radius: 8px;
    }

    .home-feed-comment-form-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .home-feed-post-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .home-feed-quickbar {
        flex-wrap: wrap;
    }

    .home-feed-pagination {
        gap: 6px;
        padding: 6px;
    }

    .home-feed-pagination .option-controls,
    .home-feed-page-label {
        min-height: 34px;
        font-size: 0.8rem;
        padding: 6px 8px;
    }
}

/* Timeline Redesign */
.home-dashboard-panel {
    border-radius: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.timeline-controls {
    width: 100%;
    margin: 0 auto 16px;
    display: grid;
    justify-items: center;
    gap: 12px;
}

.timeline-filter-tabs {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}

.timeline-filter-tabs::-webkit-scrollbar {
    display: none;
}

.timeline-search {
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 999px;
    background: rgba(255,255,255,0.055);
    padding: 0 14px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.timeline-search > .material-symbols-outlined {
    color: var(--color-text-soft);
    font-size: 22px;
    flex: 0 0 auto;
}

.timeline-search input {
    min-width: 0;
    flex: 1 1 auto;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--color-text);
    font-family: 'Kanit', sans-serif;
    font-size: 0.98rem;
    font-weight: 500;
}

.timeline-search input::placeholder {
    color: var(--color-text-soft);
}

.timeline-search:focus-within {
    border-color: rgba(255,255,255,0.26);
    background: rgba(255,255,255,0.085);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 0 0 3px rgba(255,255,255,0.045);
}

.home-panel-head h2 {
    font-family: 'Kanit', sans-serif;
    font-size: 3rem;
    font-weight: var(--font-weight-bold);
    line-height: 1.1;
    letter-spacing: -0.01em;
    text-align: center;
    margin: 0 0 0.75em 0;
}

.home-mood-title .home-panel-head h2 {
    margin: 0 0 0.375em 0;
}

.home-feed-list {
    margin-top: 10px;
    gap: 12px;
}

.home-feed-post-composer {
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.16);
    background:
        linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.035)),
        rgba(8, 10, 22, 0.34);
    box-shadow: 0 18px 44px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    padding: 14px;
    margin-bottom: 12px;
}

.home-feed-post-form {
    gap: 10px;
}

.home-feed-post-form textarea {
    min-height: 86px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.055);
    color: var(--color-text);
    padding: 12px 13px;
    font-size: 0.9rem;
    line-height: 1.45;
}

.home-feed-post-image-preview {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(0,0,0,0.18);
    max-height: 320px;
}

.home-feed-post-image-preview img {
    width: auto;
    max-width: 100%;
    max-height: 320px;
    display: block;
    object-fit: contain;
}

.home-feed-post-image-preview button {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    background: rgba(7, 8, 18, 0.72);
    color: var(--color-text);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    cursor: pointer;
}

.home-feed-post-image-preview button .material-symbols-outlined {
    font-size: 19px;
}

.home-feed-post-image-preview.is-uploading::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background: rgba(5, 7, 18, 0.58);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.home-feed-post-image-preview.is-uploading::after {
    content: "Bild wird hochgeladen...";
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 3;
    transform: translate(-50%, -50%);
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 999px;
    background: rgba(16, 18, 32, 0.78);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 14px 30px rgba(0,0,0,0.28);
}

.home-feed-post-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
}

.home-feed-image-picker,
.home-feed-post-submit {
    position: relative;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.065);
    color: var(--color-text);
    font-family: 'Kanit', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color var(--transition-fast) ease, background var(--transition-fast) ease, transform var(--transition-fast) ease, opacity var(--transition-fast) ease;
}

.home-feed-image-picker:hover,
.home-feed-post-submit:hover {
    border-color: rgba(255,255,255,0.26);
    background: rgba(255,255,255,0.095);
    transform: translateY(-1px);
}

.home-feed-post-submit {
    appearance: none;
}

.home-feed-post-submit:disabled,
.home-feed-image-picker.is-disabled {
    opacity: 0.68;
    cursor: not-allowed;
    transform: none;
}

.home-feed-post-form.is-submitting {
    pointer-events: none;
}

.home-feed-post-form.is-submitting .home-feed-post-submit {
    pointer-events: auto;
}

.home-feed-image-picker input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    height: 1px;
}

.home-feed-image-picker .material-symbols-outlined,
.home-feed-post-submit .material-symbols-outlined {
    font-size: 19px;
}

.home-feed-post-submit .material-symbols-outlined {
    line-height: 1;
}

.home-feed-post-submit:disabled .material-symbols-outlined {
    animation: timelineSubmitSpin 0.9s linear infinite;
}

@keyframes timelineSubmitSpin {
    to {
        transform: rotate(360deg);
    }
}

.home-feed-post-form textarea:focus,
.home-feed-comment-form textarea:focus {
    outline: none;
    border-color: rgba(255,255,255,0.34);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.08);
}

.home-feed-post-disabled,
.home-feed-comment-disabled {
    border: 1px dashed rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 11px 12px;
    background: rgba(0, 0, 0, 0.14);
}

.home-feed-item {
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.14);
    background:
        radial-gradient(circle at 12% 0%, rgba(255,255,255,0.09), transparent 34%),
        linear-gradient(145deg, rgba(255,255,255,0.055), rgba(255,255,255,0.025)),
        rgba(6, 8, 20, 0.28);
    box-shadow: 0 18px 48px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.07);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    padding: 14px;
    transition: border-color var(--transition-fast) ease, background var(--transition-fast) ease, transform var(--transition-fast) ease;
}

.home-feed-item:hover {
    border-color: rgba(255,255,255,0.22);
    background:
        radial-gradient(circle at 12% 0%, rgba(255,255,255,0.12), transparent 34%),
        linear-gradient(145deg, rgba(255,255,255,0.07), rgba(255,255,255,0.032)),
        rgba(6, 8, 20, 0.32);
    transform: translateY(-1px);
}

.home-feed-item.is-highlighted {
    border-color: rgba(120, 235, 190, 0.72);
    background: linear-gradient(90deg, rgba(120, 235, 190, 0.1), rgba(120, 235, 190, 0.02));
    box-shadow: inset 3px 0 0 rgba(120, 235, 190, 0.72);
}

.home-feed-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
}

.home-feed-head-main {
    min-width: 0;
}

.home-feed-avatar,
.home-feed-avatar-fallback {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.home-feed-avatar {
    border: 1px solid rgba(255,255,255,0.2);
}

.home-feed-avatar-fallback {
    background: linear-gradient(145deg, rgba(255,255,255,0.14), rgba(255,255,255,0.05));
    font-size: 0.88rem;
}

.home-feed-title {
    font-size: 1.12rem;
    line-height: 1.32;
}

.home-feed-inline-name-link {
    color: rgba(179, 138, 214, 0.92);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 0;
}

.home-feed-inline-name-link:hover {
    color: rgba(198, 160, 228, 0.96);
    text-decoration: none;
}

.home-feed-inline-name-link:focus-visible {
    outline: 2px solid rgba(179, 138, 214, 0.72);
    outline-offset: 2px;
    border-radius: 4px;
}

.home-feed-meta {
    margin-top: 3px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.68);
}

.home-feed-type-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.9);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.home-feed-meta-dot {
    opacity: 0.55;
}

.home-feed-content-row {
    margin-top: 10px;
    gap: 10px;
}

.home-feed-main-wrap {
    min-width: 0;
}

.home-feed-main-wrap.has-media {
    position: relative;
    min-height: 122px;
    padding-right: 132px;
}

.home-feed-content-row.has-media {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}

.home-feed-media-side {
    width: 104px;
    height: 104px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(0,0,0,0.16);
    box-shadow: 0 10px 24px rgba(0,0,0,0.2);
    justify-self: center;
    align-self: center;
    position: static;
    transform: none;
}

.home-feed-item.has-media-side {
    position: relative;
}

.home-feed-main-wrap.has-media .home-feed-media-side {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 108px;
    height: 108px;
    z-index: 1;
}

.home-feed-text {
    margin-top: 0;
    color: rgba(255,255,255,0.9);
    font-size: 1.06rem;
    line-height: 1.55;
}

.home-feed-post-image-btn {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: flex-start;
    justify-content: flex-start;
    width: fit-content;
    max-width: min(100%, 560px);
    max-height: min(46vh, 420px);
    margin-top: 12px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    cursor: zoom-in;
}

.home-feed-post-image-btn:hover {
    background: transparent;
}

.home-feed-post-image-btn:focus-visible {
    outline: 2px solid rgba(179, 138, 214, 0.76);
    outline-offset: 3px;
}

.home-feed-post-image {
    display: block;
    width: auto;
    max-width: min(100%, 560px);
    height: auto;
    max-height: min(46vh, 420px);
    object-fit: contain;
}

.timeline-image-viewer-backdrop {
    padding: 24px;
    background: rgba(5, 7, 16, 0.72);
}

.timeline-image-viewer-card {
    width: min(96vw, 1280px);
    max-height: calc(100vh - 48px);
    background: rgba(10, 12, 24, 0.96) !important;
}

.timeline-image-viewer-header {
    flex: 0 0 auto;
}

.timeline-image-viewer-body {
    padding: 12px;
    gap: 12px;
    align-items: center;
    overflow: hidden;
}

.timeline-image-viewer-img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 160px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(0,0,0,0.24);
    box-shadow: 0 18px 50px rgba(0,0,0,0.34);
}

.home-feed-context-links {
    margin-top: 9px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
}

.home-feed-context-entry {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.78);
    font-size: 0.81rem;
}

.home-feed-context-label {
    color: rgba(255,255,255,0.66);
}

.home-feed-context-name-link {
    color: rgba(179, 138, 214, 0.92);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 0;
    line-height: 1.15;
}

.home-feed-context-name-link:hover {
    color: rgba(198, 160, 228, 0.96);
    text-decoration: none;
}

.home-feed-context-name-link:focus-visible {
    outline: 2px solid rgba(179, 138, 214, 0.72);
    outline-offset: 2px;
    border-radius: 4px;
}

.home-feed-quickbar {
    margin-top: 10px;
    gap: 8px;
    flex-wrap: wrap;
}

.home-feed-open-btn {
    min-height: 34px;
    padding: 7px 11px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.07);
    font-size: 0.79rem;
}

.home-feed-open-btn.is-empty {
    display: none;
}

.home-feed-icon-btn {
    min-height: 34px;
    min-width: 40px;
    padding: 6px 9px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.055);
    border-radius: 999px;
}

.home-feed-icon-btn .material-symbols-outlined {
    font-size: 17px;
}

.home-feed-icon-count {
    font-size: 0.75rem;
}

.home-feed-comment-toggle {
    padding-right: 7px;
}

.home-feed-comments-panel {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.12);
    gap: 9px;
}

.home-feed-comment-list {
    gap: 7px;
}

.home-feed-comment-empty {
    border: 1px dashed rgba(255,255,255,0.17);
    border-radius: 11px;
    padding: 10px;
}

.home-feed-comment {
    border-radius: 11px;
    border: 1px solid rgba(255,255,255,0.11);
    background: rgba(255,255,255,0.035);
    padding: 9px 10px;
}

.home-feed-comment-form textarea {
    width: 100%;
    min-height: 72px;
    border-radius: 11px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(0,0,0,0.14);
    padding: 10px 11px;
    font-size: 0.86rem;
}

.home-feed-pagination {
    margin-top: 14px;
}

@media (max-width: 900px) {
    .home-dashboard-panel {
        padding: 0;
        border-radius: 0;
    }

    .home-feed-item {
        padding: 11px;
    }

    .home-feed-content-row.has-media {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .home-feed-media-side {
        width: 92px;
        height: 92px;
    }

    .home-feed-main-wrap.has-media {
        min-height: 108px;
        padding-right: 110px;
    }

    .home-feed-main-wrap.has-media .home-feed-media-side {
        right: 0;
        width: 94px;
        height: 94px;
    }

    .home-feed-post-form textarea {
        min-height: 78px;
    }
}

@media (max-width: 640px) {
    .timeline-controls {
        width: 100%;
        margin-bottom: 12px;
        gap: 10px;
    }

    .timeline-filter-tabs {
        justify-self: center;
    }

    .timeline-search {
        width: 100%;
        min-height: 44px;
        padding: 0 12px;
    }

    .timeline-search input {
        font-size: 0.94rem;
    }

    .home-feed-title {
        font-size: 1rem;
        line-height: 1.28;
    }

    .home-feed-meta {
        font-size: 0.76rem;
    }

    .home-feed-type-badge {
        font-size: 0.72rem;
    }

    .home-feed-text {
        font-size: 0.94rem;
        line-height: 1.44;
    }

    .home-feed-comment-author {
        font-size: 0.82rem;
    }

    .home-feed-comment-meta {
        font-size: 0.74rem;
    }

    .home-feed-comment-body {
        font-size: 0.84rem;
        line-height: 1.3;
    }

    .home-feed-head {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .home-feed-content-row.has-media {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .home-feed-media-side {
        width: 74px;
        height: 74px;
    }

    .home-feed-main-wrap.has-media {
        min-height: 92px;
        padding-right: 90px;
    }

    .home-feed-main-wrap.has-media .home-feed-media-side {
        right: 0;
        width: 78px;
        height: 78px;
    }

    .home-feed-post-footer,
    .home-feed-comment-form-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .home-feed-post-tools {
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
    }

    .home-feed-image-picker,
    .home-feed-post-submit {
        flex: 1 1 0;
        min-width: 0;
    }

    .home-feed-post-image-btn,
    .home-feed-post-image,
    .home-feed-post-image-preview,
    .home-feed-post-image-preview img {
        max-height: 360px;
    }

    .timeline-image-viewer-backdrop {
        padding: 10px;
    }

    .timeline-image-viewer-card {
        width: min(100vw - 20px, 1280px);
        max-height: calc(100vh - 20px);
    }

    .timeline-image-viewer-img {
        max-height: calc(100vh - 150px);
    }

    .home-feed-pagination {
        gap: 6px;
        padding: 6px;
    }

    .home-feed-pagination .option-controls,
    .home-feed-page-label {
        min-height: 34px;
        font-size: 0.8rem;
        padding: 6px 8px;
    }
}

body {
    margin: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--color-text);
    background: var(--color-bg);
    font-weight: 600;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    -moz-user-select: none;
    overflow-x: hidden;
    overscroll-behavior-x: none;
}

html.song-popup-open,
body.song-popup-open {
    overflow: hidden !important;
    overscroll-behavior: none;
}

body.auth-tab-active,
body.auth-tab-active .main-content,
body.auth-tab-active #authTabContainer {
    touch-action: pan-y;
    overscroll-behavior-x: none;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 25% 50%, var(--color-glow-1), transparent 50%),
                radial-gradient(circle at 70% 50%, var(--color-glow-2), transparent 50%);
    background-blend-mode: screen;
    filter: blur(50px) brightness(1.0);
    opacity: var(--bg-overlay-opacity);
    z-index: -999;
}

* {
    scrollbar-width: none;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.glass {
    backdrop-filter: blur(var(--blur-amount));
    background: var(--color-bg-glass);
    box-shadow: 0 0 20px rgba(0,0,0,0.4);
    border: 1px solid var(--color-border);
}

/* ========================
   SIDEBAR
   ======================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    z-index: 200;
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
    border-right: 1px solid var(--color-border);
    border-radius: 1em;
    overflow-y: auto;
    animation: fadeIn var(--transition-speed) 0.2s forwards;
    opacity: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 20px;
    font-family: 'Kanit', sans-serif;
    font-size: 1.4rem;
    font-weight: var(--font-weight-bold);
}

.sidebar-logo img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.sidebar-section {
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-label {
    font-family: 'Kanit', sans-serif;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--color-text-soft);
    padding: 8px 10px 4px;
    opacity: 0.6;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--color-text-soft);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast) ease;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.08);
    color: var(--color-text);
}

.sidebar-link.active {
    background: linear-gradient(90deg, var(--color-accent-soft), var(--color-accent-faint));
    box-shadow: inset 0 0 0 1px var(--color-accent-faint);
    color: var(--color-text);
}

.sidebar-link .material-symbols-outlined {
    font-size: 1.3rem;
}

.sidebar-account-avatar-shell {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex: 0 0 24px;
}

.sidebar-account-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}

.sidebar-playlist-list {
    max-height: none;
    overflow: visible;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-playlist-item {
    font-size: 0.9rem;
    padding: 7px 10px;
}

.sidebar-playlist-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sidebar-playlist-label-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-playlist-sort-icon {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 24px;
    cursor: pointer;
    color: var(--color-text-soft);
    background: rgba(255,255,255,0.04);
    transition: transform 0.18s ease, color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.sidebar-playlist-sort-icon .material-symbols-outlined {
    font-size: 1rem;
    line-height: 1;
}

.sidebar-playlist-sort-icon:hover {
    color: var(--color-text);
    border-color: rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.09);
}

.sidebar-playlist-sort-icon.is-active {
    color: var(--color-text);
    border-color: var(--color-accent-faint);
    background: linear-gradient(90deg, var(--color-accent-soft), var(--color-accent-faint));
}

.sidebar-playlist-sort-icon.is-animating {
    animation: sidebarSortIconPulse 0.32s ease;
}

@keyframes sidebarSortIconPulse {
    0% { transform: scale(0.9) rotate(-10deg); }
    50% { transform: scale(1.08) rotate(12deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.sidebar-playlist-item .sidebar-playlist-icon {
    font-size: 1.12rem;
    opacity: 0.9;
}

.sidebar-playlist-item .sidebar-playlist-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar.playlist-sort-mode .sidebar-playlist-item {
    cursor: grab;
    user-select: none;
}

.sidebar.playlist-sort-mode .sidebar-playlist-item:active {
    cursor: grabbing;
}

.sidebar.playlist-sort-mode .sidebar-playlist-item:hover {
    background: rgba(255,255,255,0.08);
    color: var(--color-text);
}

.sidebar-playlist-drag-handle {
    margin-left: auto;
    opacity: 0.75;
    cursor: grab;
    flex: 0 0 auto;
    touch-action: none;
    font-size: 1.18rem !important;
}

.sidebar-playlist-drag-handle:active {
    cursor: grabbing;
}

.sidebar-playlist-drag-ghost {
    opacity: 0.45;
}

.sidebar-playlist-drag-chosen {
    box-shadow: inset 0 0 0 1px var(--color-accent-faint);
}

.sidebar-playlist-dragging {
    opacity: 0.9;
}

.sidebar-playlist-drag-fallback {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

.sidebar-bottom {
    margin-top: auto;
    padding-top: 10px;
}

.sidebar-bottom::before {
    content: "";
    display: block;
    border-top: 1px solid var(--color-border);
    margin-bottom: 12px;
}

/* ========================
   MOBILE HEADER & OVERLAY
   ======================== */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 150;
    padding: 10px 16px;
    align-items: center;
    justify-content: space-between;
    border-radius: 0;
    border-bottom: 1px solid var(--color-border);
}

.mobile-menu-btn {
    background: none;
    border: none;
    color: var(--color-text);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Kanit', sans-serif;
    font-size: 1.4rem;
    font-weight: var(--font-weight-bold);
}

.mobile-logo img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 190;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.open {
    display: block;
    opacity: 1;
}

/* ========================
   MAIN CONTENT
   ======================== */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 24px 30px;
    padding-bottom: calc(var(--playback-height) + 40px);
    min-height: 100vh;
    opacity: 0;
    animation: fadeIn var(--transition-speed) 0.3s forwards;
}

.app-native-dropdown {
    position: relative;
    width: 100%;
    z-index: 1;
}

.app-native-dropdown.is-open {
    z-index: 6500;
}

.app-native-dropdown-source {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.app-native-dropdown-toggle {
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.06);
    color: var(--color-text);
    font-family: var(--font-family);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    outline: none;
}

.app-native-dropdown-toggle:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(160,32,240,0.16);
}

.app-native-dropdown-label {
    flex: 1;
    min-width: 0;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-native-dropdown-arrow {
    font-size: 1.1rem;
    transition: transform 0.18s ease;
}

.app-native-dropdown.is-open .app-native-dropdown-arrow {
    transform: rotate(180deg);
}

.app-native-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 6510;
    display: none;
    flex-direction: column;
    max-height: 260px;
    overflow-y: auto;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    background: rgba(16,16,16,0.95);
    box-shadow: 0 12px 30px rgba(0,0,0,0.36);
}

.app-native-dropdown.is-open .app-native-dropdown-menu {
    display: flex;
}

.app-native-dropdown-menu.is-portal-open {
    position: fixed;
    left: 0;
    right: auto;
    top: 0;
    display: flex;
    z-index: 12500;
}

.app-native-dropdown-option {
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--color-text-soft);
    font-family: var(--font-family);
    font-size: 0.9rem;
    text-align: left;
    padding: 8px 10px;
    cursor: pointer;
}

.app-native-dropdown-option:hover:not(.is-disabled) {
    background: rgba(255,255,255,0.1);
    color: var(--color-text);
}

.app-native-dropdown-option.is-active {
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
    color: #fff;
}

.app-native-dropdown-option.is-disabled {
    opacity: 0.5;
    cursor: default;
}

.auth-tab-container {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
    min-height: 60vh;
    overflow-x: clip;
}

.auth-cards-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: start;
    min-width: 0;
    overflow-x: clip;
}

@media (min-width: 1100px) {
    .auth-cards-row {
        grid-template-columns: minmax(0, 680px) minmax(0, 680px);
        justify-content: flex-start;
    }
}

.auth-native-card {
    border: 1px solid var(--color-border);
    border-radius: 18px;
    padding: 20px;
    background:
        linear-gradient(165deg, rgba(255,255,255,0.12), rgba(255,255,255,0.03) 45%, rgba(255,255,255,0.06)),
        rgba(8, 10, 18, 0.36);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.14),
        0 18px 48px rgba(0,0,0,0.30);
    display: grid;
    gap: 16px;
    max-width: 680px;
    min-width: 0;
    overflow-x: clip;
}

.auth-native-card .hidden {
    display: none !important;
}

.auth-native-card.hidden {
    display: none !important;
}

.auth-native-title {
    font-family: 'Kanit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
}

.auth-native-subtitle {
    font-size: 0.92rem;
    color: var(--color-text-soft);
    line-height: 1.45;
}

.auth-native-mode {
    display: inline-flex;
    width: fit-content;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    gap: 6px;
}

.auth-native-mode button {
    border: 0;
    border-radius: 999px;
    padding: 8px 14px;
    font-family: 'Kanit', sans-serif;
    font-size: 0.9rem;
    color: var(--color-text-soft);
    background: transparent;
    cursor: pointer;
}

.auth-native-mode button.active {
    color: #fff;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-light));
    box-shadow: 0 6px 18px rgba(0,0,0,0.22);
}

.auth-native-form {
    display: grid;
    gap: 12px;
}

.auth-native-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.auth-native-field {
    display: grid;
    gap: 6px;
}

.auth-native-field label {
    font-size: 0.85rem;
    color: var(--color-text-soft);
    font-weight: 700;
}

.auth-native-field input[type="text"],
.auth-native-field input[type="password"],
.auth-native-field input[type="file"],
.auth-native-field textarea,
.auth-native-field input[type="range"] {
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.06);
    color: var(--color-text);
    font-family: var(--font-family);
    font-size: 0.9rem;
    outline: none;
}

.auth-native-field input[type="file"] {
    padding: 8px 10px;
}

.auth-native-field textarea {
    min-height: 92px;
    resize: vertical;
}

.auth-native-field input[type="range"] {
    padding: 8px 0;
    background: transparent;
    border: none;
    border-radius: 0;
}

.auth-native-field input[type="text"]:focus,
.auth-native-field input[type="password"]:focus,
.auth-native-field input[type="file"]:focus,
.auth-native-field textarea:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(160,32,240,0.16);
}

.auth-native-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--color-text-soft);
    font-size: 0.88rem;
}

.auth-native-checkbox input {
    margin-top: 3px;
}

.auth-native-checkbox a {
    color: var(--color-accent-light);
    text-decoration: none;
}

.auth-native-checkbox a:hover {
    text-decoration: underline;
}

.auth-native-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.auth-profile-actions-row {
    justify-content: center;
    flex-wrap: wrap;
}

.auth-profile-actions-row button {
    width: auto;
    min-width: 140px;
    justify-content: center;
    white-space: nowrap;
}

.auth-native-actions button {
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 12px;
    padding: 11px 18px;
    font-family: 'Kanit', sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-light));
    box-shadow: 0 10px 24px rgba(0,0,0,0.28);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.auth-native-actions button.secondary {
    background: rgba(255,255,255,0.10);
    border-color: var(--color-border);
    color: var(--color-text);
    box-shadow: none;
}

.auth-native-actions button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(0,0,0,0.34);
    filter: brightness(1.02);
}

.auth-native-actions button.secondary:hover:not(:disabled) {
    background: rgba(255,255,255,0.16);
    border-color: rgba(255,255,255,0.28);
    box-shadow: 0 8px 18px rgba(0,0,0,0.2);
}

.auth-native-actions button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    filter: grayscale(0.35);
}

.auth-native-status {
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(0,0,0,0.22);
    color: var(--color-text-soft);
    font-size: 0.9rem;
    line-height: 1.45;
}

.auth-native-status.error {
    border-color: rgba(255, 96, 96, 0.35);
    color: #ffd7d7;
}

.auth-native-status.success {
    border-color: rgba(86, 255, 169, 0.35);
    color: #d4ffe8;
}

.auth-native-profile {
    display: grid;
    gap: 12px;
}

.auth-native-profile-header {
    display: flex;
    gap: 10px;
    align-items: center;
    align-items: flex-start;
    min-width: 0;
}

.auth-native-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.2);
}

.auth-native-user {
    font-family: 'Kanit', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
}

.auth-profile-overview-media {
    display: grid;
    gap: 8px;
    width: 132px;
    flex: 0 0 132px;
    min-width: 0;
}

.auth-profile-overview-preview {
    width: 132px;
    height: 132px;
}

.auth-profile-overview-file-picker {
    display: grid;
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.auth-profile-overview-file-picker .auth-public-file-btn {
    width: 100%;
    min-width: 0;
}

.auth-profile-overview-file-picker .auth-public-file-name {
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
    padding-inline: 2px;
}

.auth-profile-overview-image-actions button {
    width: 100%;
}

.auth-profile-overview-image-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    width: 132px;
    max-width: 100%;
    min-width: 0;
    justify-self: center;
    margin-inline: auto;
}

.auth-profile-overview-image-actions .auth-public-file-btn {
    min-height: 48px;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    justify-content: center;
    padding: 8px 10px;
    gap: 6px;
    font-size: 0.82rem;
    line-height: 1.1;
}

.auth-profile-overview-image-actions .auth-public-file-btn > span:last-child {
    min-width: 0;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}

.auth-profile-overview-image-actions .auth-public-file-btn .material-symbols-outlined {
    font-size: 1rem;
}

.auth-profile-overview-main {
    display: grid;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
}

.auth-profile-overview-topline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.auth-profile-handle {
    color: var(--color-accent-light);
    font-size: 0.9rem;
    line-height: 1.2;
    margin-top: -4px;
}

.auth-profile-user-id {
    color: var(--color-text-soft);
    font-size: 0.78rem;
    line-height: 1.25;
    margin-top: -4px;
    font-variant-numeric: tabular-nums;
    opacity: 0.9;
}

.auth-public-profile {
    display: grid;
    gap: 12px;
    margin-top: 10px;
    padding-top: 12px;
    min-width: 0;
}

.auth-public-profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.auth-public-profile-title {
    font-family: 'Kanit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
}

.auth-public-profile-subtitle {
    margin: 0;
    color: var(--color-text-soft);
    font-size: 0.88rem;
    line-height: 1.4;
}

.auth-public-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    min-width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.18);
    padding: 0;
    background: rgba(255,255,255,0.06);
    color: var(--color-text);
    box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}

.auth-public-status-badge .material-symbols-outlined {
    font-size: 20px;
    line-height: 1;
    font-variation-settings: 'FILL' 1, 'wght' 600, 'GRAD' 0, 'opsz' 20;
}

.auth-public-status-badge[data-status="draft"] {
    border-color: rgba(80,160,255,0.35);
    color: #d7ebff;
    background: rgba(80,160,255,0.12);
}

.auth-public-status-badge[data-status="public"] {
    border-color: rgba(86,255,169,0.35);
    color: #cffff0;
    background: rgba(86,255,169,0.12);
}

.auth-public-status-badge[data-status="pending"] {
    border-color: rgba(255,208,86,0.35);
    color: #fff1c7;
    background: rgba(255,208,86,0.12);
}

.auth-public-status-badge[data-status="rejected"] {
    border-color: rgba(255,96,96,0.35);
    color: #ffd7d7;
    background: rgba(255,96,96,0.12);
}

.auth-public-profile-grid {
    display: grid;
    grid-template-columns: 132px 1fr;
    gap: 12px;
    align-items: start;
    min-width: 0;
}

.auth-public-profile-image-col {
    display: grid;
    gap: 8px;
}

.auth-public-profile-fields-col {
    min-width: 0;
}

.auth-public-desc-label {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.auth-public-desc-label .material-symbols-outlined {
    font-size: 18px;
    color: var(--color-text-soft);
}

.auth-public-desc-label strong {
    font-weight: 800;
    color: var(--color-text);
}

.auth-public-desc-counter {
    margin-left: auto;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--color-text-soft);
}

.auth-public-description-input {
    resize: none !important;
}

.auth-public-profile-preview-wrap {
    width: 132px;
    height: 132px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
}

.auth-public-profile-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.auth-public-profile-inline-actions {
    justify-content: stretch;
}

.auth-public-profile-inline-actions button {
    flex: 1;
    justify-content: center;
}

.auth-public-crop-panel {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.auth-public-file-picker {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.06);
}

.auth-public-file-input {
    display: none !important;
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.auth-public-file-btn {
    flex: 0 0 auto;
    min-width: min(150px, 100%);
    max-width: 100%;
    justify-content: center;
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 12px;
    padding: 10px 16px;
    font-family: 'Kanit', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    color: var(--color-text);
    background: rgba(255,255,255,0.10);
    box-shadow: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.auth-public-file-btn .material-symbols-outlined {
    font-size: 1.15rem;
    line-height: 1;
}

.auth-public-file-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.16);
    border-color: rgba(255,255,255,0.28);
    box-shadow: 0 8px 18px rgba(0,0,0,0.2);
    transform: translateY(-1px);
}

.auth-public-file-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    filter: grayscale(0.35);
}

.auth-public-file-name {
    min-width: 0;
    flex: 1 1 auto;
    color: var(--color-text-soft);
    font-size: 0.88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-public-crop-hint {
    width: min(220px, 100%);
    height: 1px;
    margin: 2px auto 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.22), rgba(255,255,255,0));
    opacity: 0.95;
    pointer-events: none;
}

.auth-public-profile-main-actions {
    align-items: center;
    justify-content: center !important;
    width: 100%;
}

.auth-public-profile-main-actions button {
    width: auto !important;
    min-width: 190px;
    flex: 0 1 auto;
    justify-content: center;
    margin-inline: auto;
}

/* Action-specific button colors for clearer grouping */
.auth-profile-actions-row button[type="submit"] {
    background: linear-gradient(135deg, #8b5cf6, #c084fc);
    border-color: rgba(196,132,252,0.45);
}

#authLogoutBtn {
    background: linear-gradient(135deg, #2563eb, #60a5fa) !important;
    color: #fff !important;
    border-color: rgba(96,165,250,0.5) !important;
    box-shadow: 0 10px 24px rgba(0,0,0,0.24);
}

#authDeleteBtn {
    background: linear-gradient(135deg, #dc2626, #fb7185) !important;
    color: #fff !important;
    border-color: rgba(251,113,133,0.48) !important;
    box-shadow: 0 10px 24px rgba(0,0,0,0.24);
}

#authPublicSaveBtn {
    background: linear-gradient(135deg, #d97706, #fbbf24) !important;
    color: #fff !important;
    border-color: rgba(251,191,36,0.5) !important;
}

#authPublicSubmitBtn {
    background: linear-gradient(135deg, #059669, #34d399) !important;
    border-color: rgba(52,211,153,0.45) !important;
}

#authPublicTakeDownBtn {
    background: linear-gradient(135deg, #d97706, #fbbf24) !important;
    color: #fff !important;
    border-color: rgba(251,191,36,0.5) !important;
    box-shadow: 0 8px 18px rgba(0,0,0,0.18);
}

.auth-public-lock-note {
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 12px;
    padding: 10px 12px;
    color: var(--color-text-soft);
    background: rgba(255,255,255,0.03);
    font-size: 0.88rem;
    line-height: 1.4;
}

.auth-public-profile.hidden {
    display: none !important;
}

.account-playlist-card .artist-card-status-badge {
    min-width: 70px;
    justify-content: center;
}

body.auth-tab-active #noPermission,
body.auth-tab-active #homeDashboard,
body.auth-tab-active #favoritesViewToggle,
body.auth-tab-active #playlistHeader,
body.auth-tab-active #contentControls,
body.auth-tab-active #songTable,
body.auth-tab-active #songGrid,
body.auth-tab-active #paginationControls,
body.auth-tab-active #scrollSentinel {
    display: none !important;
}

/* ========================
   HERO SECTION
   ======================== */
.hero-section {
    position: relative;
    border-radius: 0;
    overflow: hidden;
    margin-bottom: 8px;
    padding: 48px 30px 32px;
    background: transparent;
    border: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    gap: 28px;
}

.hero-section.is-public-account-profile .hero-inner {
    align-items: flex-start;
}

.hero-type {
    font-family: 'Kanit', sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-text-soft);
    margin-bottom: 4px;
    display: none;
}

.hero-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.play-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
    color: white;
    font-family: 'Kanit', sans-serif;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    transition: box-shadow 0.2s ease, filter 0.2s ease;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.play-all-btn:hover {
    box-shadow: 0 4px 20px rgba(160,32,240,0.4);
    filter: brightness(1.04);
}

.shuffle-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: var(--color-text);
    font-family: 'Kanit', sans-serif;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.shuffle-all-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

#sharePlaylist,
#favoriteAlbumBtn,
#reportAccountProfileBtn,
#editPlaylistStyleBtn,
#followPlaylistBtn,
#playlistActionsBtn {
    width: 46px;
    min-width: 46px;
    height: 46px;
    padding: 0;
    justify-content: center;
    flex-shrink: 0;
    box-sizing: border-box;
}

#addSongsToPlaylistBtn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: var(--color-text);
    font-family: 'Kanit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

#addSongsToPlaylistBtn .material-symbols-outlined {
    font-size: 1.2rem;
    line-height: 1;
}

#addSongsToPlaylistBtn:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

#followPlaylistBtn.active {
    background: linear-gradient(90deg, rgba(160,32,240,0.22), rgba(186,85,211,0.16));
    border-color: rgba(186,85,211,0.45);
    color: var(--color-accent-light);
}

#followPlaylistBtn.active .material-symbols-outlined {
    color: var(--color-accent-light);
}

#addSongsToPlaylistBtn:disabled {
    opacity: 0.55;
    pointer-events: none;
}

/* ========================
   PLAYLIST COVER
   ======================== */
.playlist-cover {
    width: 180px;
    height: 180px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255,255,255,0.05);
    border: none;
    flex-shrink: 0;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.playlist-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playlist-title {
    font-family: 'Kanit', sans-serif;
    font-size: 3rem;
    font-weight: var(--font-weight-bold);
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.playlist-title-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    vertical-align: top;
}

.playlist-title-label {
    min-width: 0;
}

.playlist-desc {
    font-size: 0.95rem;
    color: var(--color-text-soft);
    line-height: 1.5;
    max-width: 600px;
    opacity: 0.8;
    white-space: pre-line;
}

.playlist-desc-main {
    white-space: pre-line;
}

.playlist-desc-meta-row {
    margin-top: 2px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.playlist-desc-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--color-text);
}

.playlist-desc-meta-icon {
    font-size: 1.02em;
    line-height: 1;
    opacity: 0.9;
}

.playlist-desc-meta-value {
    font-weight: 700;
}

.playlist-desc-meta-separator {
    opacity: 0.5;
    font-weight: 600;
}

.playlist-desc-owner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    color: var(--color-text);
}

.playlist-desc-owner-icon {
    font-size: 1.05em;
    line-height: 1;
    opacity: 0.9;
}

.account-public-discord {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    max-width: min(100%, 360px);
    margin-top: 10px;
    padding: 7px 11px 7px 8px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 999px;
    background: rgba(88,101,242,0.18);
    color: var(--color-text);
    text-decoration: none;
    vertical-align: top;
    white-space: normal;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.hero-actions .account-public-discord {
    min-height: 46px;
    margin-top: 0;
    box-sizing: border-box;
}

a.account-public-discord:hover {
    background: rgba(88,101,242,0.28);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

.account-public-discord-avatar,
.account-public-discord-icon {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 50%;
}

.account-public-discord-avatar {
    display: block;
    object-fit: cover;
    background: rgba(255,255,255,0.12);
}

.account-public-discord-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(88,101,242,0.35);
    font-size: 1.05rem;
}

.account-public-discord-copy {
    display: grid;
    min-width: 0;
    line-height: 1.15;
}

.account-public-discord-label,
.account-public-discord-handle {
    color: var(--color-text-soft);
    font-size: 0.78rem;
    font-weight: 700;
}

.account-public-discord-copy strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--color-text);
    font-size: 0.92rem;
    font-weight: 800;
}

/* ========================
   CONTENT CONTROLS BAR
   ======================== */
.content-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.content-controls.artist-discovery-controls-active {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.content-controls.artist-discovery-controls-active .artist-discovery-switcher {
    order: 0;
    margin: 0 auto;
}

.content-controls.artist-discovery-controls-active .search-bar {
    order: 1;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    flex: 1 1 auto;
    min-width: 0;
}

.content-controls.artist-discovery-controls-active .search-bar input {
    min-width: 0;
}

.content-controls.album-discovery-controls-active {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.content-controls.album-discovery-controls-active .album-discovery-toolbar {
    order: 0;
    margin: 0 auto;
    padding: 0;
}

.content-controls.album-discovery-controls-active .search-bar {
    order: 1;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    flex: 1 1 auto;
    min-width: 0;
}

.content-controls.album-discovery-controls-active .search-bar input {
    min-width: 0;
}

.content-controls.charts-controls-active,
.content-controls.my-songs-controls-active {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.content-controls.charts-controls-active .charts-filter,
.content-controls.my-songs-controls-active .my-songs-filter {
    order: 0;
    margin: 0 auto;
}

.content-controls.charts-controls-active .charts-filter-wrap,
.content-controls.my-songs-controls-active .my-songs-filter-wrap {
    order: 0;
}

.content-controls.charts-controls-active .search-bar,
.content-controls.my-songs-controls-active .search-bar {
    order: 1;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    flex: 1 1 auto;
    min-width: 0;
}

.content-controls.charts-controls-active .search-bar input,
.content-controls.my-songs-controls-active .search-bar input {
    min-width: 0;
}

.song-count {
    font-family: 'Kanit', sans-serif;
    font-size: 0.82rem;
    color: var(--color-text-soft);
    white-space: nowrap;
    margin-bottom: 16px;
    padding-left: 4px;
}

/* ========================
   SEARCH BAR
   ======================== */
.search-bar {
    position: relative;
    min-height: 46px;
    background: rgba(255,255,255,0.055);
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 999px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.search-bar:focus-within {
    border-color: rgba(255,255,255,0.26);
    background: rgba(255,255,255,0.085);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 0 0 3px rgba(255,255,255,0.045);
}

.search-bar .material-symbols-outlined {
    font-size: 22px;
    color: var(--color-text-soft);
    flex: 0 0 auto;
}

.search-bar input {
    min-width: 0;
    flex: 1 1 auto;
    border: none;
    outline: none;
    background: transparent;
    color: var(--color-text);
    font-family: 'Kanit', sans-serif;
    font-size: 0.98rem;
    font-weight: 500;
}

.search-bar input::placeholder {
    color: var(--color-text-soft);
}

.charts-filter-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.charts-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 46px;
    padding: 4px;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 999px;
    background: rgba(255,255,255,0.055);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.charts-filter-btn {
    min-height: 36px;
    border: 0;
    border-radius: 999px;
    padding: 0 13px;
    background: transparent;
    color: var(--color-text-soft);
    cursor: pointer;
    font-family: 'Kanit', sans-serif;
    font-size: 0.84rem;
    font-weight: 700;
    transition: background var(--transition-fast) ease, color var(--transition-fast) ease, transform var(--transition-fast) ease, opacity var(--transition-fast) ease;
}

.charts-filter-btn:hover:not(:disabled) {
    color: var(--color-text);
    transform: translateY(-1px);
}

.charts-filter-btn.active {
    color: var(--color-text);
    background: linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.08));
    box-shadow: 0 8px 18px rgba(0,0,0,0.18);
}

.charts-filter-btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

/* ========================
   SONG TABLE
   ======================== */
.song-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
}

.song-table th,
.song-table td {
    text-align: left;
    padding: 10px 12px;
    font-size: 0.9rem;
}

.song-table th:nth-child(1),
.song-table td:nth-child(1) {
    width: 40px;
    text-align: center;
    color: var(--color-text-soft);
}

.song-table th:nth-child(2),
.song-table td:nth-child(2) {
    width: auto;
}

.song-table th:nth-child(3),
.song-table td:nth-child(3) {
    width: 16%;
    text-align: center;
}

.song-table th:nth-child(4),
.song-table td:nth-child(4) {
    width: 12%;
    text-align: center;
    font-weight: 700;
}

.song-table th:nth-child(5),
.song-table td:nth-child(5) {
    width: 92px;
    min-width: 92px;
    text-align: right;
    padding-right: 10px;
    white-space: nowrap;
}

/* Last visible td gets right radius */
.song-row td:first-child {
    border-radius: 12px 0 0 12px;
}

.song-row td:last-child {
    border-radius: 0 12px 12px 0;
}

.song-actions-cell {
    text-align: right;
    vertical-align: middle;
    white-space: nowrap;
}

.song-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.song-actions-cell .favorite-button {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 10px;
    appearance: none;
    -webkit-appearance: none;
}

.song-actions-cell .favorite-button:hover {
    transform: scale(1.05);
}

.song-actions-cell .favorite-button svg,
.song-actions-cell .favorite-button .material-symbols-outlined {
    width: 20px;
    height: 20px;
    font-size: 20px;
    line-height: 20px;
    display: block;
}

.song-actions-cell .favorite-button.active svg {
    filter: none;
}

.song-table th {
    color: var(--color-text-soft);
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 10px;
}

.song-row {
    transition: background var(--transition-fast) ease, transform var(--transition-fast) ease;
    cursor: pointer;
}

.song-table.playlist-song-sort-mode .song-row {
    cursor: grab;
    user-select: none;
}

.song-table.playlist-song-sort-mode .song-row:active {
    cursor: grabbing;
}

.song-row td {
    background: rgba(255,255,255,0.02);
    transition: background var(--transition-fast) ease;
}

.song-row:hover td {
    background: rgba(255,255,255,0.07);
}

.song-row:hover td:first-child {
    color: var(--color-accent-light);
}

.song-row.playing td {
    background: rgba(160,32,240,0.12);
}

.song-row.playing td:first-child {
    color: var(--color-accent-light);
}

.song-row-drag-ghost td {
    opacity: 0.45;
}

.song-row-drag-chosen td {
    box-shadow: inset 0 0 0 1px var(--color-accent-faint);
}

.song-row-dragging td {
    opacity: 0.92;
}

.song-row-drag-fallback {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

.sortable-fallback {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

#editPlaylistStyleBtn.playlist-song-sort-active {
    background: linear-gradient(90deg, var(--color-accent-soft), var(--color-accent-faint));
    box-shadow: inset 0 0 0 1px var(--color-accent-faint);
}

#editPlaylistStyleBtn.playlist-song-sort-active .material-symbols-outlined {
    color: var(--color-text);
}

.playlist-edit-action-card {
    max-width: 420px;
}

.playlist-follow-report-action-card {
    max-width: 420px;
}

.app-dialog-actions.playlist-edit-action-grid {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
    gap: 10px;
}

.app-dialog-actions.playlist-edit-action-grid .app-dialog-btn {
    width: 100%;
    min-width: 0;
}

.playlist-edit-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.playlist-edit-action-btn.playlist-edit-action-btn-details {
    border-color: rgba(153, 224, 255, 0.42);
    background: linear-gradient(135deg, rgba(13, 126, 221, 0.98), rgba(54, 167, 248, 0.95));
    box-shadow: 0 10px 22px rgba(18, 92, 177, 0.34);
}

.playlist-edit-action-btn.playlist-edit-action-btn-details:hover {
    box-shadow: 0 12px 24px rgba(24, 109, 206, 0.4);
}

.playlist-edit-action-btn.playlist-edit-action-btn-sort {
    border-color: rgba(161, 242, 191, 0.42);
    background: linear-gradient(135deg, rgba(30, 145, 74, 0.96), rgba(67, 193, 113, 0.95));
    box-shadow: 0 10px 22px rgba(20, 108, 62, 0.34);
}

.playlist-edit-action-btn.playlist-edit-action-btn-sort:hover {
    box-shadow: 0 12px 24px rgba(24, 130, 74, 0.4);
}

.playlist-edit-action-btn.playlist-edit-action-btn-collaborators {
    border-color: rgba(255, 213, 153, 0.42);
    background: linear-gradient(135deg, rgba(223, 124, 26, 0.96), rgba(247, 167, 73, 0.95));
    box-shadow: 0 10px 22px rgba(160, 95, 24, 0.34);
}

.playlist-edit-action-btn.playlist-edit-action-btn-collaborators:hover {
    box-shadow: 0 12px 24px rgba(176, 107, 27, 0.4);
}

.playlist-edit-action-btn.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.playlist-edit-action-note {
    margin-top: 8px;
    font-size: 0.82rem;
    color: var(--color-text-soft);
}

.playlist-collaborators-manager-card {
    max-width: 520px;
}

.playlist-collaborators-manager-body {
    gap: 10px;
}

.playlist-collaborators-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.82rem;
    color: var(--color-text-soft);
}

.playlist-collaborators-count {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--color-text);
}

.playlist-collaborators-list {
    display: grid;
    gap: 8px;
    max-height: 220px;
    overflow: auto;
}

.playlist-collaborator-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    background: rgba(255, 255, 255, 0.04);
}

.playlist-collaborator-info {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.playlist-collaborator-name {
    color: var(--color-text);
    font-weight: 700;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playlist-collaborator-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.playlist-collaborator-status.is-participant {
    color: #cfffe1;
    background: rgba(43, 176, 99, 0.25);
    border: 1px solid rgba(116, 246, 168, 0.3);
}

.playlist-collaborator-status.is-pending {
    color: #ffe6bf;
    background: rgba(190, 112, 32, 0.25);
    border: 1px solid rgba(255, 201, 125, 0.3);
}

.playlist-collaborator-remove-btn {
    flex: 0 0 28px;
    min-width: 28px;
    max-width: 28px;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.playlist-collaborator-remove-btn:hover {
    transform: none;
}

.playlist-collaborator-remove-btn .material-symbols-outlined {
    font-size: 18px;
    line-height: 1;
}

.playlist-collaborators-empty {
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px;
    color: var(--color-text-soft);
    text-align: center;
    font-size: 0.86rem;
}

.playlist-collaborators-add-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.playlist-collaborators-add-row .playlist-collaborators-input {
    min-height: 40px;
}

.playlist-collaborators-add-btn {
    min-width: 130px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.playlist-collaborators-add-btn .material-symbols-outlined {
    font-size: 18px;
}

.playlist-collaborators-hint {
    min-height: 1.1em;
    font-size: 0.78rem;
    color: var(--color-text-soft);
}

.playlist-collaborators-hint.is-error {
    color: #ffb8c8;
}

.playlist-invite-requests-card {
    max-width: 560px;
}

.playlist-invite-requests-body {
    gap: 10px;
}

.playlist-invite-requests-list {
    display: grid;
    gap: 10px;
    max-height: 280px;
    overflow: auto;
}

.playlist-invite-request-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.playlist-invite-request-info {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.playlist-invite-request-title {
    color: var(--color-text);
    font-weight: 700;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playlist-invite-request-meta {
    color: var(--color-text-soft);
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playlist-invite-request-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.playlist-invite-request-btn {
    min-width: 0;
    padding: 8px 10px;
    font-size: 0.82rem;
}

.playlist-invite-request-empty {
    border: 1px dashed rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    color: var(--color-text-soft);
}

.feed-notifications-card {
    max-width: 620px;
}

.feed-notifications-body {
    gap: 10px;
}

.feed-notifications-list {
    display: grid;
    gap: 10px;
    max-height: 340px;
    overflow: auto;
}

.feed-notification-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.feed-notification-info {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.feed-notification-title {
    color: var(--color-text);
    font-weight: 700;
    line-height: 1.24;
}

.feed-notification-meta {
    color: var(--color-text-soft);
    font-size: 0.8rem;
    line-height: 1.2;
}

.feed-notification-snippet {
    color: var(--color-text-soft);
    font-size: 0.82rem;
    line-height: 1.24;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.feed-notification-missing {
    color: #ffcccf;
    font-size: 0.78rem;
}

.feed-notification-actions {
    display: inline-flex;
    align-items: center;
}

.feed-notification-open-btn {
    min-width: 0;
    padding: 8px 11px;
    font-size: 0.82rem;
}

.feed-notification-empty {
    border: 1px dashed rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    color: var(--color-text-soft);
}

@media (max-width: 640px) {
    .playlist-collaborators-add-row {
        flex-direction: column;
        align-items: stretch;
    }

    .playlist-collaborators-add-btn {
        width: 100%;
    }

    .playlist-invite-request-item {
        flex-direction: column;
        align-items: stretch;
    }

    .playlist-invite-request-actions {
        justify-content: flex-end;
    }

    .feed-notification-item {
        flex-direction: column;
        align-items: stretch;
    }

    .feed-notification-actions {
        justify-content: flex-start;
    }
}

.song-row img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.song-row img.loaded {
    opacity: 1;
}

.song-title-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.song-name {
    font-size: 0.95rem;
    color: var(--color-text);
    font-weight: 600;
}

.song-title-text-wrap {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.song-chart-meta {
    color: var(--color-text-soft);
    font-family: 'Kanit', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
}

.chart-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 48px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 999px;
    color: var(--color-text-soft);
    background: rgba(255,255,255,0.045);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.chart-rank-icon {
    font-size: 18px;
    line-height: 1;
}

.chart-rank-number {
    font-family: 'Kanit', sans-serif;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
}

.chart-rank-1 {
    color: #facc15;
    border-color: rgba(250, 204, 21, 0.72);
    background: rgba(250, 204, 21, 0.12);
}

.chart-rank-2 {
    color: #d1d5db;
    border-color: rgba(209, 213, 219, 0.72);
    background: rgba(209, 213, 219, 0.12);
}

.chart-rank-3 {
    color: #d97706;
    border-color: rgba(217, 119, 6, 0.72);
    background: rgba(217, 119, 6, 0.12);
}

.song-artist {
    font-size: var(--font-size-artist);
    color: var(--color-text-soft);
}

.artist-button {
    color: var(--color-text-soft);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    transition: color var(--transition-fast) ease;
    cursor: pointer;
}

.song-artist-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
}

.song-artist-avatar,
.song-popup-artist-avatar {
    display: inline-block;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.18);
}

.song-artist-avatar {
    width: 20px;
    height: 20px;
}

.song-popup-artist-avatar {
    width: 28px;
    height: 28px;
}

.artist-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Kanit', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--color-text-soft);
    line-height: 1;
}

.song-table td:nth-child(3) .artist-button {
    display: inline-block;
    text-align: center;
}

.song-table td:nth-child(3) .song-artist-cell {
    justify-content: center;
}

.artist-button:hover {
    color: var(--color-text);
}

/* ========================
   PLAYBACK BAR
   ======================== */
.playback-menu {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - var(--sidebar-width) - 36px);
    max-width: 1200px;
    min-height: 78px;
    z-index: 1000;
    display: flex;
    align-items: center;
    border-radius: 999px;
    padding: 9px 16px;
    overflow: visible;
    opacity: 0;
    animation: fadeIn3 var(--transition-speed) 0.5s forwards;
}

.playback-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 640px) minmax(0, 1fr);
    align-items: center;
    width: 100%;
    gap: 10px;
}

.song-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    cursor: pointer;
    overflow: hidden;
}

.song-info img {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: cover;
    transition: transform var(--transition-speed) ease;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.song-info:hover img {
    transform: scale(1.05);
}

.song-info-text {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
    gap: 1px;
    overflow: hidden;
}

.song-info .title {
    font-weight: var(--font-weight-bold);
    font-size: 1.05rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-info .artist {
    font-size: 0.9rem;
    color: var(--color-text-soft);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Playback Center */
.playback-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    max-width: 640px;
    width: 100%;
    height: 100%;
    margin: 0 auto;
    position: relative;
    padding-bottom: 8px;
}

.main-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.main-controls #shuffleButton,
.main-controls #loopButton {
    margin: 0 4px;
}

.main-controls button,
#shuffleButton,
#loopButton {
    background: none;
    border: none;
    color: var(--color-text);
    cursor: pointer;
    transition: color var(--transition-fast) ease, transform var(--transition-fast) ease;
    outline: none;
    padding: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Legacy safety: queue toggle was removed from playback bar. */
#queueToggleButton,
#queueCountBadge {
    display: none !important;
}

.main-controls button:hover,
#shuffleButton:hover,
#loopButton:hover {
    color: var(--color-accent-light);
    transform: scale(1.05);
}

.main-controls button.active,
#shuffleButton.active,
#loopButton.active {
    color: var(--color-accent-light);
}

.main-controls svg,
#shuffleButton svg,
#loopButton svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    line-height: 1;
}

.play-pause-main {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.14) !important;
    color: var(--color-text) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.22);
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.play-pause-main:hover {
    transform: scale(1.05) !important;
    background: rgba(255,255,255,0.2) !important;
    box-shadow: 0 5px 14px rgba(0,0,0,0.28);
}

.play-pause-main svg {
    fill: var(--color-text) !important;
}

/* Progress Row */
.progress-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: calc(100% + 2px);
    position: absolute;
    bottom: -1px;
    left: -1px;
    right: -1px;
    padding: 0;
}

.time-display {
    font-size: 0.82rem;
    color: var(--color-text-soft);
    min-width: 38px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-family: var(--font-family);
    display: none;
}

.progress-bar {
    flex: 1;
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.1);
    border-radius: 999px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: height 0.15s ease;
}

.progress-bar:hover {
    height: 4px;
}

.progress-bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 100%;
    width: var(--progress, 0%);
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
    transition: width 0.1s linear;
    border-radius: 999px;
}

/* Playback Right */
.playback-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 4px;
}

.volume-icon-btn {
    background: none;
    border: none;
    color: var(--color-text-soft);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

.volume-icon-btn:hover {
    color: var(--color-text);
}

.volume-icon-btn svg {
    fill: currentColor;
}

#volumeSlider {
    -webkit-appearance: none;
    background: rgba(255,255,255,0.12);
    height: 4px;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    width: 92px;
    transition: background 0.2s ease;
}

#volumeSlider:hover {
    background: rgba(255,255,255,0.2);
}

.playback-queue-panel {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: calc(var(--playback-height) + 30px);
    transform: translateX(-50%);
    width: min(420px, calc(100vw - 26px));
    max-height: min(58vh, 520px);
    z-index: 1120;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(14, 16, 26, 0.92);
    box-shadow: 0 16px 38px rgba(0,0,0,0.35);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.playback-queue-panel.is-open {
    display: flex;
    animation: playbackQueuePanelFadeIn 0.16s ease-out forwards;
}

@keyframes playbackQueuePanelFadeIn {
    0% { opacity: 0; transform: translateX(-50%) scale(0.95) translateY(10px); }
    100% { opacity: 1; transform: translateX(-50%) scale(1) translateY(0); }
}

.playback-queue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 12px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.playback-queue-title-wrap h3 {
    margin: 0;
    font-family: 'Kanit', sans-serif;
    font-size: 1rem;
    line-height: 1.1;
}

.playback-queue-count-text {
    margin: 3px 0 0;
    color: var(--color-text-soft);
    font-size: 0.74rem;
}

.playback-queue-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.playback-queue-clear-btn {
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 10px;
    background: rgba(255,255,255,0.07);
    color: var(--color-text);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    min-height: 32px;
    padding: 0 10px;
    cursor: pointer;
}

.playback-queue-clear-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.24);
}

.playback-queue-clear-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.playback-queue-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.07);
    color: var(--color-text-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.playback-queue-close-btn:hover {
    color: var(--color-text);
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.24);
}

.playback-queue-close-btn .material-symbols-outlined {
    font-size: 1.1rem;
}

.playback-queue-list {
    display: grid;
    gap: 6px;
    overflow: auto;
    padding: 8px 10px 10px;
}

.playback-queue-item {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 11px;
    padding: 7px;
    background: rgba(255,255,255,0.04);
}

.playback-queue-item-cover {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(255,255,255,0.08);
}

.playback-queue-item-main {
    min-width: 0;
}

.playback-queue-item-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playback-queue-item-artist {
    margin-top: 1px;
    font-size: 0.74rem;
    color: var(--color-text-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playback-queue-item-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.playback-queue-action-btn {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    color: var(--color-text-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.playback-queue-action-btn:hover:not(:disabled) {
    color: var(--color-text);
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.24);
}

.playback-queue-action-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.playback-queue-action-btn .material-symbols-outlined {
    font-size: 1rem;
}

.playback-queue-empty {
    padding: 12px;
    color: var(--color-text-soft);
    font-size: 0.82rem;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.playback-queue-empty[hidden] {
    display: none !important;
}

#volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 12px;
    width: 12px;
    border-radius: 50%;
    background: var(--color-accent-light);
    cursor: pointer;
    transition: transform 0.15s ease;
}

#volumeSlider:hover::-webkit-slider-thumb {
    transform: scale(1.3);
}

/* ========================
   OPTION CONTROLS & BUTTONS
   ======================== */
.option-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    padding: 6px 10px;
    cursor: pointer;
    transition: background var(--transition-fast) ease;
    color: var(--color-text-soft);
    text-decoration: none;
    font-family: var(--font-family);
    font-size: 0.85rem;
}

.option-controls:hover {
    background: rgba(255,255,255,0.15);
    color: var(--color-text);
}

.option-controls.active {
    color: var(--color-accent-light);
}

.play-button {
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: var(--font-weight-bold);
    padding: 10px 15px;
    cursor: pointer;
    transition: background var(--transition-fast) ease, transform var(--transition-speed) ease;
    width: 150px;
    margin-left: auto;
    margin-right: auto;
}

.share-button {
    background: linear-gradient(90deg, #4F58FF, #55C0FF);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: var(--font-weight-bold);
    padding: 10px 15px;
    cursor: pointer;
    transition: background var(--transition-fast) ease, transform var(--transition-speed) ease;
    width: 150px;
    margin-left: auto;
    margin-right: auto;
}

.favorite-button {
    background: none !important;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease, transform 0.3s ease, filter 0.3s ease;
    color: var(--color-text-soft);
    border-radius: 50%;
    box-shadow: none !important;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.favorite-button svg {
    fill: var(--color-text-soft);
    transition: fill 0.3s ease;
}

.favorite-button:hover svg {
    fill: var(--color-accent);
}

.favorite-button:hover {
    background: none !important;
    transform: scale(1.15);
}

.favorite-button.active {
    color: var(--color-accent-light);
}

.favorite-button.active svg {
    fill: var(--color-accent-light);
    filter: drop-shadow(0 0 5px var(--color-accent-light));
    transition: fill 0.3s ease, filter 0.3s ease;
}

.favorite-button.fav-pop {
    animation: favPop 0.35s ease forwards;
}

@keyframes favPop {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.25); }
    60%  { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.song-actions-cell .song-favorite-btn {
    --song-like-main: var(--color-accent-light);
    --song-like-alt: var(--color-accent);
    --song-like-soft: var(--color-accent-soft);
    --song-like-faint: var(--color-accent-faint);
    position: relative;
    overflow: visible;
    isolation: isolate;
    border-radius: 999px;
    background: rgba(255,255,255,0.04) !important;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.12), 0 6px 12px rgba(0,0,0,0.14) !important;
    transition: box-shadow 0.2s ease, transform 0.18s ease, background 0.2s ease, color 0.2s ease;
}

.song-actions-cell .song-favorite-btn .material-symbols-outlined {
    font-size: 20px;
    line-height: 20px;
    color: rgba(255,255,255,0.78);
    transition: transform 0.22s ease, color 0.22s ease, filter 0.22s ease;
}

.song-actions-cell .song-favorite-btn:hover {
    transform: none;
    background: rgba(255,255,255,0.04) !important;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.12), 0 6px 12px rgba(0,0,0,0.14) !important;
}

.song-actions-cell .song-favorite-btn:hover .material-symbols-outlined {
    color: rgba(255,255,255,0.78);
}

.song-actions-cell .song-favorite-btn.active {
    background: radial-gradient(circle at 30% 30%, var(--song-like-soft), var(--song-like-faint)) !important;
    box-shadow: 0 0 0 1px var(--song-like-soft), 0 10px 20px var(--song-like-faint) !important;
}

.song-actions-cell .song-favorite-btn.active .material-symbols-outlined {
    color: var(--song-like-main);
    filter: drop-shadow(0 0 8px var(--song-like-soft));
}

.song-actions-cell .song-favorite-btn::before,
.song-actions-cell .song-favorite-btn::after {
    content: "";
    position: absolute;
    pointer-events: none;
    opacity: 0;
}

.song-actions-cell .song-favorite-btn::before {
    inset: -4px;
    border-radius: 999px;
    border: 1.5px solid var(--song-like-main);
    transform: scale(0.65);
}

.song-actions-cell .song-favorite-btn::after {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow:
        0 -14px 0 var(--song-like-main),
        10px -10px 0 var(--song-like-main),
        14px 0 0 var(--song-like-alt),
        10px 10px 0 var(--song-like-alt),
        0 14px 0 var(--song-like-main),
        -10px 10px 0 var(--song-like-main),
        -14px 0 0 var(--song-like-alt),
        -10px -10px 0 var(--song-like-alt);
}

.song-actions-cell .song-favorite-btn.like-pop.like-pop-active {
    animation: songFavoritePopIn 0.46s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.song-actions-cell .song-favorite-btn.like-pop.like-pop-active .material-symbols-outlined {
    animation: songFavoriteHeartIn 0.46s cubic-bezier(0.18, 0.85, 0.22, 1) both;
}

.song-actions-cell .song-favorite-btn.like-pop.like-pop-active::before {
    animation: songFavoriteRing 0.44s ease-out both;
}

.song-actions-cell .song-favorite-btn.like-pop.like-pop-active::after {
    animation: songFavoriteBurst 0.42s ease-out both;
}

.song-actions-cell .song-favorite-btn.like-pop.like-pop-inactive {
    animation: songFavoritePopOut 0.3s ease both;
}

.song-actions-cell .song-favorite-btn.like-pop.like-pop-inactive .material-symbols-outlined {
    animation: songFavoriteHeartOut 0.3s ease both;
}

.hero-actions .hero-favorite-btn {
    --song-like-main: var(--color-accent-light);
    --song-like-alt: var(--color-accent);
    --song-like-soft: var(--color-accent-soft);
    --song-like-faint: var(--color-accent-faint);
    position: relative;
    overflow: visible;
    isolation: isolate;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 999px;
    background: rgba(255,255,255,0.08) !important;
    box-shadow: 0 6px 16px rgba(0,0,0,0.22) !important;
    color: rgba(255,255,255,0.82);
    transition: box-shadow 0.2s ease, transform 0.18s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.hero-actions .hero-favorite-btn .material-symbols-outlined {
    font-size: 20px;
    line-height: 20px;
    color: currentColor;
    transition: transform 0.22s ease, color 0.22s ease, filter 0.22s ease;
}

.hero-actions .hero-favorite-btn:hover {
    transform: none;
    background: rgba(255,255,255,0.12) !important;
    border-color: rgba(255,255,255,0.24);
    box-shadow: 0 8px 18px rgba(0,0,0,0.26) !important;
}

.hero-actions .hero-favorite-btn:hover .material-symbols-outlined {
    color: currentColor;
}

.hero-actions .hero-favorite-btn.active {
    background: radial-gradient(circle at 30% 30%, var(--song-like-soft), var(--song-like-faint)) !important;
    border-color: var(--song-like-soft);
    box-shadow: 0 0 0 1px var(--song-like-soft), 0 10px 20px var(--song-like-faint) !important;
    color: var(--song-like-main);
}

.hero-actions .hero-favorite-btn.active .material-symbols-outlined {
    color: var(--song-like-main);
    filter: drop-shadow(0 0 8px var(--song-like-soft));
}

.hero-actions .hero-favorite-btn::before,
.hero-actions .hero-favorite-btn::after {
    content: "";
    position: absolute;
    pointer-events: none;
    opacity: 0;
}

.hero-actions .hero-favorite-btn::before {
    inset: -4px;
    border-radius: 999px;
    border: 1.5px solid var(--song-like-main);
    transform: scale(0.65);
}

.hero-actions .hero-favorite-btn::after {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow:
        0 -14px 0 var(--song-like-main),
        10px -10px 0 var(--song-like-main),
        14px 0 0 var(--song-like-alt),
        10px 10px 0 var(--song-like-alt),
        0 14px 0 var(--song-like-main),
        -10px 10px 0 var(--song-like-main),
        -14px 0 0 var(--song-like-alt),
        -10px -10px 0 var(--song-like-alt);
}

.hero-actions .hero-favorite-btn.like-pop.like-pop-active {
    animation: songFavoritePopIn 0.46s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.hero-actions .hero-favorite-btn.like-pop.like-pop-active .material-symbols-outlined {
    animation: songFavoriteHeartIn 0.46s cubic-bezier(0.18, 0.85, 0.22, 1) both;
}

.hero-actions .hero-favorite-btn.like-pop.like-pop-active::before {
    animation: songFavoriteRing 0.44s ease-out both;
}

.hero-actions .hero-favorite-btn.like-pop.like-pop-active::after {
    animation: songFavoriteBurst 0.42s ease-out both;
}

.hero-actions .hero-favorite-btn.like-pop.like-pop-inactive {
    animation: songFavoritePopOut 0.3s ease both;
}

.hero-actions .hero-favorite-btn.like-pop.like-pop-inactive .material-symbols-outlined {
    animation: songFavoriteHeartOut 0.3s ease both;
}

.song-actions-cell .song-queue-btn {
    position: relative;
    overflow: visible;
    border-radius: 10px;
    background: none !important;
    box-shadow: none !important;
    transition: color 0.18s ease, transform 0.16s ease;
}

.song-actions-cell .song-queue-btn .material-symbols-outlined {
    font-size: 20px;
    line-height: 20px;
    color: rgba(255,255,255,0.78);
    transition: color 0.18s ease;
}

.song-actions-cell .song-queue-btn:hover {
    background: none !important;
    box-shadow: none !important;
}

.song-actions-cell .song-queue-btn:hover .material-symbols-outlined {
    color: var(--color-text);
}

.song-actions-cell .song-queue-btn.is-added {
    animation: queueBtnPulse 0.24s ease;
}

@keyframes queueBtnPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.16); }
    100% { transform: scale(1); }
}

@keyframes songFavoritePopIn {
    0% { transform: scale(0.9); }
    40% { transform: scale(1.16); }
    70% { transform: scale(0.96); }
    100% { transform: scale(1); }
}

@keyframes songFavoriteHeartIn {
    0% { transform: scale(0.7); }
    45% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

@keyframes songFavoriteRing {
    0% { opacity: 0.85; transform: scale(0.65); }
    100% { opacity: 0; transform: scale(1.55); }
}

@keyframes songFavoriteBurst {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.25); }
    20% { opacity: 0.95; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.3); }
}

@keyframes songFavoritePopOut {
    0% { transform: scale(1); }
    40% { transform: scale(0.86); }
    100% { transform: scale(1); }
}

@keyframes songFavoriteHeartOut {
    0% { transform: scale(1); }
    50% { transform: scale(0.72); }
    100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .song-actions-cell .song-favorite-btn,
    .song-actions-cell .song-favorite-btn .material-symbols-outlined {
        transition: none !important;
        animation: none !important;
    }

    .song-actions-cell .song-favorite-btn::before,
    .song-actions-cell .song-favorite-btn::after {
        display: none !important;
        animation: none !important;
    }

    .hero-actions .hero-favorite-btn,
    .hero-actions .hero-favorite-btn .material-symbols-outlined {
        transition: none !important;
        animation: none !important;
    }

    .hero-actions .hero-favorite-btn::before,
    .hero-actions .hero-favorite-btn::after {
        display: none !important;
        animation: none !important;
    }

    .album-card-favorite,
    .album-card-favorite .material-symbols-outlined {
        transition: none !important;
        animation: none !important;
    }

    .album-card-favorite::before,
    .album-card-favorite::after {
        display: none !important;
        animation: none !important;
    }
}

/* ========================
   MOOD FILTER
   ======================== */
.mood-filter {
    position: relative;
    display: flex;
    align-items: stretch;
}

.mood-filter .app-native-dropdown {
    min-width: 108px;
    width: 108px;
}

.mood-filter .app-native-dropdown-toggle {
    height: 38px;
    border-radius: 999px;
    padding: 8px 12px;
    font-family: 'Kanit', sans-serif;
    font-size: 0.85rem;
}

.mood-filter .app-native-dropdown-menu {
    left: auto;
    right: 0;
    min-width: 170px;
}

.mood-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--color-text);
    font-family: 'Kanit', sans-serif;
    font-size: 0.82rem;
    cursor: pointer;
    outline: none;
    transition: background var(--transition-fast) ease, border-color var(--transition-fast) ease, color var(--transition-fast) ease;
    white-space: nowrap;
    height: 38px;
}

.mood-filter-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--color-accent);
    color: var(--color-accent-light);
}

.mood-filter-toggle .material-symbols-outlined {
    font-size: 1rem;
}

.mood-filter-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 190px;
    max-height: 340px;
    overflow-y: auto;
    padding: 6px;
    border-radius: 12px;
    background: rgba(18, 18, 18, 0.95);
    border: 1px solid var(--color-border);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    display: none;
    flex-direction: column;
    gap: 2px;
    z-index: 999999999;
    backdrop-filter: blur(20px);
}

.mood-filter.open .mood-filter-menu {
    display: flex;
}

.mood-filter-option {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-family: 'Kanit', sans-serif;
    cursor: pointer;
    background: transparent;
    color: var(--color-text-soft);
    transition: background var(--transition-fast) ease, color var(--transition-fast) ease;
    text-align: left;
}

.mood-filter-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text);
}

.mood-filter-option.active {
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
    color: #ffffff;
}

/* ========================
   PAGINATION
   ======================== */
.pagination-controls {
    margin-top: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--border-radius);
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

.pagination-btn {
    height: 36px;
    padding: 8px 12px;
    font-family: 'Kanit', sans-serif;
    font-weight: bold;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.pagination-label {
    min-width: 110px;
    text-align: center;
    font-family: 'Kanit', sans-serif;
    font-size: 0.95rem;
    color: var(--color-text-soft);
    padding: 6px 10px;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    background: rgba(255,255,255,0.06);
}

.pagination-btn.disabled,
.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* ========================
   POPUPS
   ======================== */
#playlistPopupBackdrop,
#addSongPopupBackdrop,
#songPopupBackdrop,
#addToPlPickerBackdrop,
.theme-picker-backdrop,
#legalPopupBackdrop,
#legalLabelsPopupBackdrop {
    background: rgba(8, 10, 20, 0.42) !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

#legalPopupBackdrop,
#legalLabelsPopupBackdrop {
    z-index: 27000 !important;
    padding: max(18px, env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-right, 0px)) max(18px, env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px)) !important;
    background:
        radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--color-accent-light) 24%, transparent), transparent 34%),
        radial-gradient(circle at 82% 80%, color-mix(in srgb, var(--color-accent) 18%, transparent), transparent 38%),
        rgba(5, 7, 14, 0.64) !important;
    backdrop-filter: blur(18px) saturate(135%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(135%) !important;
}

.theme-picker-backdrop {
    background:
        radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--color-accent-light) 24%, transparent), transparent 34%),
        radial-gradient(circle at 82% 80%, color-mix(in srgb, var(--color-accent) 18%, transparent), transparent 38%),
        rgba(5, 7, 14, 0.64) !important;
    backdrop-filter: blur(18px) saturate(135%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(135%) !important;
}

#playlistPopup,
#addSongPopup,
#songPopup,
#addToPlPicker,
.theme-picker,
#legalPopup,
#legalLabelsPopup {
    background: var(--color-bg-glass) !important;
    border: 1px solid var(--color-border) !important;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.32) !important;
    backdrop-filter: blur(18px) saturate(130%);
    -webkit-backdrop-filter: blur(18px) saturate(130%);
}

#legalPopup .option-controls,
#legalPopup .legal-link {
    font-weight: 700;
}

#legalPopup,
#legalLabelsPopup {
    width: min(92vw, 560px) !important;
    max-width: 560px !important;
    max-height: min(82svh, 760px) !important;
    padding: 24px !important;
    border-radius: 26px !important;
    border: 1px solid color-mix(in srgb, var(--color-border) 72%, rgba(255,255,255,0.22)) !important;
    background:
        linear-gradient(145deg, rgba(255,255,255,0.12), rgba(255,255,255,0.035)),
        color-mix(in srgb, var(--color-bg) 78%, var(--color-accent) 22%) !important;
    box-shadow: 0 28px 90px rgba(0,0,0,0.48), inset 0 1px 0 rgba(255,255,255,0.14) !important;
    backdrop-filter: blur(28px) saturate(145%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(145%) !important;
}

.theme-picker,
.custom-theme-creator {
    border: 1px solid color-mix(in srgb, var(--color-border) 72%, rgba(255,255,255,0.22)) !important;
    background:
        linear-gradient(145deg, rgba(255,255,255,0.12), rgba(255,255,255,0.035)),
        color-mix(in srgb, var(--color-bg) 78%, var(--color-accent) 22%) !important;
    box-shadow: 0 28px 90px rgba(0,0,0,0.48), inset 0 1px 0 rgba(255,255,255,0.14) !important;
    backdrop-filter: blur(28px) saturate(145%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(145%) !important;
}

.theme-picker,
.custom-theme-creator,
.custom-theme-preview-panel,
.custom-theme-step {
    border-radius: 26px !important;
}

.theme-picker-header,
.custom-theme-creator-header {
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)) !important;
    border-bottom-color: rgba(255,255,255,0.11) !important;
}

.theme-card,
.custom-theme-preview-panel,
.custom-theme-step {
    border-color: rgba(255,255,255,0.13) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.055);
}

.theme-card {
    background: rgba(255,255,255,0.055) !important;
}

.custom-theme-preview-panel,
.custom-theme-step {
    background: rgba(255,255,255,0.055) !important;
}

.theme-dot {
    opacity: 1 !important;
    filter: none !important;
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.18),
        0 4px 10px rgba(0,0,0,0.16);
}

.theme-card:hover,
.custom-theme-preset-row button:hover {
    background: rgba(255,255,255,0.095) !important;
    border-color: rgba(255,255,255,0.22) !important;
}

.theme-card.active {
    border-color: color-mix(in srgb, var(--color-accent-light) 72%, rgba(255,255,255,0.28)) !important;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--color-accent) 20%, transparent), rgba(255,255,255,0.055)) !important;
}

.custom-theme-actions {
    background: transparent !important;
}

.custom-theme-reset {
    background: rgba(255,255,255,0.13) !important;
}

#legalPopup > div,
#legalLabelsPopup > div {
    padding: 4px 2px 0 !important;
}

#legalPopup h2,
#legalLabelsPopup h2 {
    margin: 0 42px 8px !important;
    font-family: 'Kanit', sans-serif;
    font-size: clamp(1.45rem, 4vw, 2rem);
    font-weight: 800;
    line-height: 1.08;
    color: var(--color-text);
}

#legalPopup p,
#legalLabelsPopup p {
    color: var(--color-text-soft);
    font-size: 0.98rem;
    line-height: 1.45;
}

#legalPopup .close-legal-popup,
#legalLabelsPopup .close-legal-labels-popup {
    top: 14px !important;
    right: 14px !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
    background: rgba(255,255,255,0.1) !important;
    color: var(--color-text) !important;
    box-shadow: none !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

#legalPopup .legal-link,
#legalPopup #legalLabelsInfoButton {
    width: 100% !important;
    min-height: 52px;
    border: 1px solid rgba(255,255,255,0.12) !important;
    border-radius: 16px !important;
    justify-content: flex-start !important;
    padding: 13px 16px !important;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--color-accent) 58%, rgba(255,255,255,0.1)), color-mix(in srgb, var(--color-accent-light) 54%, rgba(255,255,255,0.08))) !important;
    color: #fff !important;
    box-shadow: 0 14px 30px rgba(0,0,0,0.18) !important;
    transition: transform 0.16s ease, filter 0.16s ease, border-color 0.16s ease;
}

#legalPopup .legal-link:nth-of-type(2) {
    background:
        linear-gradient(135deg, color-mix(in srgb, #2f80ed 60%, var(--color-accent) 20%), color-mix(in srgb, #56ccf2 64%, rgba(255,255,255,0.08))) !important;
}

#legalPopup .legal-link:nth-of-type(3) {
    background:
        linear-gradient(135deg, color-mix(in srgb, #20bf6b 58%, var(--color-accent) 18%), color-mix(in srgb, #8fdc78 64%, rgba(255,255,255,0.08))) !important;
}

#legalPopup #legalLabelsInfoButton {
    background:
        linear-gradient(135deg, color-mix(in srgb, #ff8a00 62%, var(--color-accent) 18%), color-mix(in srgb, #ff5f6d 68%, rgba(255,255,255,0.08))) !important;
}

#legalPopup .legal-link:hover,
#legalPopup #legalLabelsInfoButton:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
    border-color: rgba(255,255,255,0.24) !important;
}

#legalLabelsPopup .glass {
    background: rgba(255,255,255,0.055) !important;
    border-color: rgba(255,255,255,0.12) !important;
    box-shadow: none !important;
}

#legalLabelsBackButton {
    width: 100% !important;
    min-height: 48px;
    border-radius: 15px !important;
    justify-content: center !important;
}

@media (max-width: 640px) {
    #legalPopup,
    #legalLabelsPopup {
        width: min(94vw, 520px) !important;
        max-height: calc(100svh - 36px) !important;
        padding: 20px !important;
        border-radius: 24px !important;
    }

    #legalPopup h2,
    #legalLabelsPopup h2 {
        margin-left: 34px !important;
        margin-right: 34px !important;
    }
}

#playlistPopupBackdrop {
    display: none;
    position: fixed;
    inset: 0;
    font-family: 'Kanit', sans-serif;
    text-align: center;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    padding: 18px;
}

#playlistPopupHeader {
    margin-bottom: 10px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
}

#playlistPopup {
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    width: min(92vw, 1000px);
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px;
    position: relative;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.4);
    animation: popupFadeIn 0.3s ease-out forwards;
    background: rgba(18, 18, 18, 0.9);
    backdrop-filter: blur(20px);
}

.playlist-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.playlist-item {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-family: 'Kanit', sans-serif;
    font-size: 1.1em;
    font-weight: bold;
}

.playlist-item:hover {
    background: linear-gradient(90deg, rgba(160,32,240,0.2), rgba(186,85,211,0.15));
    border-color: var(--color-accent);
    transform: translateY(-2px);
}

.close-playlist-popup {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.08);
    border: none;
    color: var(--color-text-soft);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.close-playlist-popup:hover {
    background: rgba(255,255,255,0.15);
}

/* createPlaylistBtn uses .sidebar-link styles */

/* Add Song Popup */
#addSongPopupBackdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 4000;
    background: rgba(8, 10, 20, 0.42);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    justify-content: center;
    align-items: center;
    padding: 18px;
    animation: backdropFadeIn 0.15s ease-out;
}

#addSongPopup {
    width: min(92vw, 560px) !important;
    max-height: 82vh !important;
    overflow: hidden;
}

.add-song-popup-header {
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.add-song-popup-body {
    display: grid;
    gap: 10px;
    padding: 14px 16px 14px;
}

.close-add-song-popup {
    font-size: 1.35rem;
}

#addSongPopup h2 {
    margin: 0;
}

#addSongSearchInput {
    width: 100%;
    min-height: 42px;
    font-size: 0.92rem;
    font-weight: 600;
}

#addSongSearchInput::placeholder {
    color: var(--color-text-soft);
    opacity: 0.85;
}

#addSongSearchResults {
    max-height: min(52vh, 360px);
    overflow-y: auto;
    padding-right: 1px;
    display: grid;
    gap: 8px;
}

#addSongSearchResults .add-song-status {
    padding: 10px 8px;
    color: var(--color-text-soft);
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    border: 1px dashed rgba(255,255,255,0.14);
    border-radius: 10px;
    background: rgba(255,255,255,0.02);
}

#addSongSearchResults .add-song-status.error {
    color: #ffb3c1;
    border-color: rgba(255, 112, 146, 0.35);
    background: rgba(255, 112, 146, 0.08);
}

#addSongSearchResults .add-song-result {
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 9px 10px;
    background: rgba(255,255,255,0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: background 0.16s ease, border-color 0.16s ease;
}

#addSongSearchResults .add-song-result:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.2);
}

.add-song-result-main {
    min-width: 0;
}

.add-song-result-title {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.add-song-result-artist {
    margin-top: 1px;
    color: var(--color-text-soft);
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#addSongSearchResults .add-song-result-add-btn {
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 10px;
    min-width: 38px;
    min-height: 36px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.06);
    color: var(--color-text);
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}

#addSongSearchResults .add-song-result-add-btn .material-symbols-outlined {
    font-size: 1.2rem;
    line-height: 1;
}

#addSongSearchResults .add-song-result-add-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.32);
}

#addSongSearchResults .add-song-result-add-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

/* Song Popup */
#songPopupBackdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 11000;
    justify-content: center;
    align-items: flex-end;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 0;
    pointer-events: auto;
}

#songPopup {
    --song-popup-glow-a: color-mix(in srgb, var(--color-glow-1) 24%, transparent);
    --song-popup-glow-b: color-mix(in srgb, var(--color-glow-2) 21%, transparent);
    --song-popup-glow-c: color-mix(in srgb, var(--color-accent-light) 16%, transparent);
    --song-popup-panel-top: color-mix(in srgb, var(--color-bg) 76%, var(--color-accent) 24%);
    --song-popup-panel-bottom: color-mix(in srgb, var(--color-bg) 82%, var(--color-accent-light) 18%);
    --song-popup-surface: color-mix(in srgb, var(--color-bg) 82%, var(--color-accent) 18%);
    --song-popup-button-bg: linear-gradient(135deg, var(--color-accent), var(--color-accent-light));
    --song-popup-progress-bg: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border) !important;
    box-shadow:
        0 26px 72px color-mix(in srgb, var(--color-bg) 52%, rgba(0,0,0,0.78) 48%),
        0 0 34px color-mix(in srgb, var(--color-accent) 18%, transparent),
        inset 0 1px 0 rgba(255,255,255,0.18),
        inset 0 -1px 0 color-mix(in srgb, var(--color-accent-light) 12%, transparent) !important;
    border-radius: 24px;
    width: calc(100% - var(--sidebar-width) - 36px);
    max-width: 1200px;
    top: clamp(34px, 5vh, 58px);
    bottom: 20px;
    height: auto;
    max-height: none;
    overflow: hidden;
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    backdrop-filter: blur(34px) saturate(145%) !important;
    -webkit-backdrop-filter: blur(34px) saturate(145%) !important;
    padding: clamp(28px, 3.2vh, 44px) clamp(24px, 3vw, 42px) clamp(22px, 2.6vh, 32px);
    animation: songPopupPlayerIn 0.28s cubic-bezier(0.2, 0.85, 0.2, 1) forwards;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.018) 45%, rgba(255,255,255,0.048)),
        radial-gradient(circle at 16% 8%, var(--song-popup-glow-a), transparent 46%),
        radial-gradient(circle at 84% 14%, var(--song-popup-glow-b), transparent 44%),
        radial-gradient(circle at 56% 94%, var(--song-popup-glow-c), transparent 50%),
        linear-gradient(180deg,
            color-mix(in srgb, var(--song-popup-panel-top) 68%, transparent),
            color-mix(in srgb, var(--song-popup-panel-bottom) 72%, transparent)
        ) !important;
    scrollbar-gutter: stable;
    pointer-events: auto;
}

#songPopupBody {
    display: grid;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    grid-template-columns: minmax(250px, 360px) 1px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto auto auto auto minmax(0, 1fr) auto;
    grid-template-areas:
        "empty divider lyrics"
        "hero divider lyrics"
        "meta divider lyrics"
        "actions divider lyrics"
        "progress divider lyrics"
        "empty2 divider lyrics"
        "uploadDate divider lyrics";
    column-gap: clamp(24px, 3.2vw, 46px);
    row-gap: 12px;
    align-items: start;
}

.close-song-popup {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--color-accent-faint);
    border: none;
    color: var(--color-text-soft);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.close-song-popup:hover {
    transform: scale(1.04);
    background: var(--color-accent-soft);
    color: var(--color-text);
}

.song-popup-hero {
    grid-area: hero;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.song-popup-cover-wrap {
    width: clamp(180px, min(24vw, 30vh), 268px);
    max-width: 268px;
    aspect-ratio: 1;
    margin: 0 auto 20px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow:
        0 10px 22px color-mix(in srgb, var(--color-bg) 62%, rgba(0,0,0,0.5) 38%),
        0 0 0 1px color-mix(in srgb, var(--color-text) 12%, transparent);
    background: var(--color-accent-faint);
}

.song-popup-cover {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.song-popup-title {
    max-width: 100%;
    margin: 0;
    font-family: 'Kanit', sans-serif;
    font-size: clamp(1.75rem, 1.38rem + 0.9vw, 2.35rem);
    line-height: 1.1;
    color: var(--color-text);
    white-space: normal;
    overflow: hidden;
    text-wrap: balance;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.song-popup-artist-meta {
    grid-area: meta;
    min-width: 0;
    margin: 0 auto 4px;
    font-family: 'Kanit', sans-serif;
    color: var(--color-text-soft);
}

.song-popup-artist-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    flex-wrap: wrap;
}

.song-popup-artist-name-row .song-popup-artist-name {
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.16;
}

.song-popup-artist-mood {
    margin-top: 2px;
    color: var(--color-text-soft);
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.2;
}

.song-popup-artist-mood.is-subtle {
    color: color-mix(in srgb, var(--color-text-soft) 76%, transparent);
    font-size: 0.9rem;
}

.song-popup-action-row {
    grid-area: actions;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
    flex-wrap: wrap;
    margin: 6px auto 4px;
}

.song-popup-icon-btn {
    width: 50px !important;
    min-width: 50px !important;
    height: 50px;
    min-height: 50px;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 13px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0;
    border: 1px solid var(--color-border) !important;
    color: #fff !important;
    box-shadow:
        0 10px 22px color-mix(in srgb, var(--color-bg) 58%, #000 42%),
        0 0 18px color-mix(in srgb, var(--color-accent) 26%, transparent);
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.song-popup-play-btn {
    background: var(--song-popup-button-bg) !important;
}

.song-popup-share-btn {
    background: linear-gradient(135deg, var(--color-accent-light), var(--color-accent)) !important;
}

.song-popup-favorite-btn {
    --song-like-main: var(--color-accent-light);
    --song-like-alt: var(--color-accent);
    --song-like-soft: var(--color-accent-soft);
    --song-like-faint: var(--color-accent-faint);
    position: relative;
    overflow: visible;
    isolation: isolate;
    background: color-mix(in srgb, var(--song-popup-surface) 70%, transparent) !important;
}

.song-popup-favorite-btn .material-symbols-outlined {
    color: rgba(255,255,255,0.84);
    transition: transform 0.22s ease, color 0.22s ease, filter 0.22s ease;
}

.song-popup-favorite-btn.active {
    background: radial-gradient(circle at 30% 30%, var(--song-like-soft), var(--song-like-faint)) !important;
    box-shadow: 0 0 0 1px var(--song-like-soft), 0 10px 20px var(--song-like-faint) !important;
}

.song-popup-favorite-btn.active .material-symbols-outlined {
    color: var(--song-like-main);
    filter: drop-shadow(0 0 8px var(--song-like-soft));
}

.song-popup-favorite-btn::before,
.song-popup-favorite-btn::after {
    content: "";
    position: absolute;
    pointer-events: none;
    opacity: 0;
}

.song-popup-favorite-btn::before {
    inset: -4px;
    border-radius: 999px;
    border: 1.5px solid var(--song-like-main);
    transform: scale(0.65);
}

.song-popup-favorite-btn::after {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow:
        0 -14px 0 var(--song-like-main),
        10px -10px 0 var(--song-like-main),
        14px 0 0 var(--song-like-alt),
        10px 10px 0 var(--song-like-alt),
        0 14px 0 var(--song-like-main),
        -10px 10px 0 var(--song-like-main),
        -14px 0 0 var(--song-like-alt),
        -10px -10px 0 var(--song-like-alt);
}

.song-popup-favorite-btn.like-pop.like-pop-active {
    animation: songFavoritePopIn 0.46s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.song-popup-favorite-btn.like-pop.like-pop-active .material-symbols-outlined {
    animation: songFavoriteHeartIn 0.46s cubic-bezier(0.18, 0.85, 0.22, 1) both;
}

.song-popup-favorite-btn.like-pop.like-pop-active::before {
    animation: songFavoriteRing 0.44s ease-out both;
}

.song-popup-favorite-btn.like-pop.like-pop-active::after {
    animation: songFavoriteBurst 0.42s ease-out both;
}

.song-popup-favorite-btn.like-pop.like-pop-inactive {
    animation: songFavoritePopOut 0.3s ease both;
}

.song-popup-favorite-btn.like-pop.like-pop-inactive .material-symbols-outlined {
    animation: songFavoriteHeartOut 0.3s ease both;
}

.song-popup-icon-btn .material-symbols-outlined {
    margin: 0 !important;
    font-size: 1.48rem;
    line-height: 1;
}

.song-popup-icon-btn:active:not(:disabled) {
    transform: translateY(1px) scale(0.94);
    box-shadow: 0 6px 14px rgba(0,0,0,0.22);
    filter: brightness(0.96);
}

.song-popup-progress-block {
    grid-area: progress;
    width: 100%;
    align-self: start;
    margin: 14px auto 0;
}

.song-popup-progress-times {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    font-size: 0.94rem;
    color: var(--color-text-soft);
    font-variant-numeric: tabular-nums;
}

.song-popup-progress-slider {
    --song-popup-progress: 0%;
    width: 100%;
    height: 22px;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    cursor: pointer;
    touch-action: pan-y;
}

.song-popup-progress-slider:disabled {
    cursor: default;
    opacity: 0.65;
}

.song-popup-progress-slider:focus-visible {
    outline: none;
}

.song-popup-progress-slider::-webkit-slider-runnable-track {
    height: 5px;
    border-radius: 999px;
    background:
        var(--song-popup-progress-bg) 0 / var(--song-popup-progress) 100% no-repeat,
        color-mix(in srgb, var(--color-text-soft) 18%, transparent);
}

.song-popup-progress-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 17px;
    height: 17px;
    margin-top: -6px;
    border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--color-text) 86%, transparent);
    background: var(--song-popup-button-bg);
    box-shadow: 0 2px 10px color-mix(in srgb, var(--color-accent) 32%, transparent);
}

.song-popup-progress-slider::-moz-range-track {
    height: 5px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--color-text-soft) 18%, transparent);
}

.song-popup-progress-slider::-moz-range-progress {
    height: 5px;
    border-radius: 999px;
    background: var(--song-popup-progress-bg);
}

.song-popup-progress-slider::-moz-range-thumb {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--color-text) 86%, transparent);
    background: var(--song-popup-button-bg);
    box-shadow: 0 2px 10px color-mix(in srgb, var(--color-accent) 32%, transparent);
}

.song-popup-lyrics-toolbar {
    grid-area: lyrics;
    display: flex;
    position: relative;
    z-index: 3;
    justify-content: center;
    align-self: end;
    justify-self: center;
    margin: 0 0 clamp(10px, 1.7vh, 18px);
    pointer-events: none;
}

.song-popup-copy-lyrics-btn {
    min-height: 40px;
    padding: 0 13px;
    gap: 7px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--song-popup-surface) 70%, transparent);
    color: var(--color-text-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 0.84rem;
    font-weight: 700;
    pointer-events: auto;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.song-popup-copy-lyrics-btn:hover {
    transform: translateY(-1px);
    background: color-mix(in srgb, var(--color-accent) 24%, var(--song-popup-surface));
    border-color: color-mix(in srgb, var(--color-accent-light) 36%, var(--color-border));
    color: var(--color-text);
}

.song-popup-copy-lyrics-btn .material-symbols-outlined {
    font-size: 1.2rem;
    line-height: 1;
    transition: transform 0.2s ease, color 0.2s ease;
}

.song-popup-artist-name-row .song-popup-artist-name {
    line-height: 1.2;
}

.song-popup-upload-date {
    grid-area: uploadDate;
    align-self: end;
    justify-self: center;
    margin: 10px auto 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--color-text-soft);
    font-size: 0.9rem;
    line-height: 1.25;
    opacity: 1;
    font-weight: 800;
}

.song-popup-upload-date .material-symbols-outlined {
    font-size: 1.05rem;
    line-height: 1;
}

.song-license-badge {
    --song-license-color: var(--color-accent-light);
    min-height: 30px;
    margin: 10px auto 0;
    padding: 0 10px;
    border: 1px solid color-mix(in srgb, var(--song-license-color) 58%, var(--color-border));
    border-radius: 999px;
    background: color-mix(in srgb, var(--song-license-color) 15%, transparent);
    color: color-mix(in srgb, var(--song-license-color) 82%, var(--color-text));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: 'Kanit', sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    max-width: min(100%, 280px);
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.song-license-badge:hover {
    transform: translateY(-1px);
    background: color-mix(in srgb, var(--song-license-color) 23%, transparent);
    border-color: color-mix(in srgb, var(--song-license-color) 76%, var(--color-border));
}

.song-license-badge .material-symbols-outlined {
    font-size: 1rem;
    line-height: 1;
}

.song-license-badge span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.song-popup-stats-row {
    margin: 10px auto 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.song-popup-stat-pill {
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid color-mix(in srgb, var(--color-accent-light) 28%, var(--color-border));
    border-radius: 999px;
    background: color-mix(in srgb, var(--song-popup-surface) 64%, transparent);
    color: color-mix(in srgb, var(--color-text) 88%, var(--color-text-soft));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 8px 18px color-mix(in srgb, var(--color-bg) 46%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.song-popup-stat-pill .material-symbols-outlined {
    font-size: 1rem;
    line-height: 1;
    color: color-mix(in srgb, var(--color-accent-light) 78%, var(--color-text));
}

.song-popup-divider {
    grid-area: divider;
    width: 1px;
    height: 100%;
    margin: 0;
    background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--color-accent-light) 42%, var(--color-border)), transparent);
}

.song-row img.song-artist-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    opacity: 1;
}

.song-popup-copy-lyrics-btn.copied {
    animation: songPopupCopyPulse 0.55s ease;
}

.song-popup-copy-lyrics-btn.copied .material-symbols-outlined {
    color: #7CFFD1;
    animation: songPopupCopySpin 0.55s ease;
}

.song-popup-lyrics-content {
    grid-area: lyrics;
    align-self: stretch;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    padding:
        clamp(12px, 1.8vh, 20px)
        clamp(14px, 2vw, 26px)
        clamp(54px, 7vh, 72px);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.075), rgba(255,255,255,0.018) 46%, rgba(255,255,255,0.055)),
        color-mix(in srgb, var(--song-popup-surface) 38%, transparent);
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--color-border) 78%, transparent),
        inset 0 1px 0 rgba(255,255,255,0.08);
    backdrop-filter: blur(12px) saturate(135%);
    -webkit-backdrop-filter: blur(12px) saturate(135%);
    color: var(--color-text);
    text-align: center;
    white-space: normal;
    font-family: 'Kanit', sans-serif;
    font-size: clamp(1.18rem, 1rem + 0.45vw, 1.55rem);
    font-weight: 500;
    line-height: 1.62;
    scrollbar-gutter: stable;
}

.song-popup-lyrics-inner {
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.song-popup-lyrics-inner :is(p, ul, ol, blockquote) {
    margin: 0 0 0.72em;
    font-weight: 500;
}

.song-popup-lyrics-inner p {
    white-space: pre-wrap;
}

.song-popup-lyrics-inner :is(h1, h2, h3) {
    margin: 0.82em 0 0.48em;
    line-height: 1.15;
    font-weight: 800;
    text-wrap: balance;
}

.song-popup-lyrics-inner h1 {
    font-size: 1.45em;
}

.song-popup-lyrics-inner h2 {
    font-size: 1.24em;
}

.song-popup-lyrics-inner h3 {
    font-size: 1.08em;
}

.song-popup-lyrics-inner :is(strong, b) {
    font-weight: 800;
    color: var(--color-text);
}

.song-popup-lyrics-inner em {
    font-style: italic;
    font-weight: inherit;
}

.song-popup-lyrics-inner :is(ul, ol) {
    display: inline-block;
    padding-left: 1.2em;
    text-align: left;
}

.song-popup-lyrics-inner blockquote {
    display: inline-block;
    max-width: 100%;
    padding: 0.08em 0 0.08em 0.8em;
    border-left: 3px solid color-mix(in srgb, var(--color-accent-light) 64%, transparent);
    color: var(--color-text-soft);
    text-align: left;
}

.song-popup-lyrics-inner > :first-child {
    margin-top: 0;
}

.song-popup-lyrics-inner > :last-child {
    margin-bottom: 0;
}

@keyframes songPopupCopyPulse {
    0% { transform: scale(1); }
    35% { transform: scale(1.18); }
    65% { transform: scale(0.94); }
    100% { transform: scale(1); }
}

@keyframes songPopupPlayerIn {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(28px) scale(0.985);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@keyframes songPopupPlayerInMobile {
    0% {
        opacity: 0;
        transform: translateY(28px) scale(0.985);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes songPopupCopySpin {
    0% { transform: rotate(0deg) scale(1); }
    60% { transform: rotate(16deg) scale(1.08); }
    100% { transform: rotate(0deg) scale(1); }
}

/* App Dialogs (replaces browser alert/confirm/prompt on website) */
html.account-ban-locked,
body.account-ban-locked {
    overflow: hidden !important;
}

body.account-ban-locked > *:not(#accountBanLockOverlay) {
    pointer-events: none !important;
    user-select: none;
}

#accountBanLockOverlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 12000;
    background: rgba(8, 11, 18, 0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    isolation: isolate;
}

#accountBanLockOverlay::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(255, 92, 92, 0.08), rgba(255, 92, 92, 0) 34%),
        linear-gradient(140deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0) 42%);
}

#accountBanLockOverlay.is-visible {
    display: flex;
}

.account-ban-lock-card {
    width: min(92vw, 560px);
    border-radius: 18px;
    border: 1px solid rgba(255, 125, 125, 0.38);
    background: rgba(18, 14, 18, 0.9) !important;
    box-shadow: 0 20px 58px rgba(0, 0, 0, 0.48) !important;
    padding: 24px 22px;
    text-align: center;
}

.account-ban-lock-title {
    font-family: 'Kanit', sans-serif;
    font-weight: 700;
    font-size: clamp(1.35rem, 2.7vw, 2rem);
    color: #ffe2e2;
    letter-spacing: 0.01em;
}

.account-ban-lock-text {
    margin-top: 12px;
    color: #ffd6d6;
    font-size: 1rem;
    line-height: 1.55;
}

.account-ban-lock-meta {
    margin-top: 10px;
    color: var(--color-text-soft);
    font-size: 0.88rem;
}

.request-rate-limit-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(6, 8, 16, 0.56);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease;
    z-index: 9300;
}

.request-rate-limit-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.request-rate-limit-card {
    width: min(92vw, 430px);
    padding: 24px 22px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(18, 14, 18, 0.92) !important;
    box-shadow: 0 20px 58px rgba(0, 0, 0, 0.48) !important;
    text-align: center;
}

.request-rate-limit-title {
    font-family: 'Kanit', sans-serif;
    font-weight: 700;
    font-size: clamp(1.3rem, 2.6vw, 1.95rem);
    color: #ffe8cb;
    letter-spacing: 0.01em;
}

.request-rate-limit-text {
    margin-top: 12px;
    color: #fff2df;
    font-size: 0.98rem;
    line-height: 1.55;
}

.request-rate-limit-meta {
    margin-top: 10px;
    color: var(--color-text-soft);
    font-size: 0.9rem;
}

.app-mini-toast {
    position: fixed;
    left: 50%;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
    transform: translate(-50%, 10px);
    max-width: min(82vw, 420px);
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(10, 10, 16, 0.84);
    color: #fff;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    opacity: 0;
    z-index: 13200;
    box-shadow: 0 8px 24px rgba(0,0,0,0.28);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    transition: opacity 0.16s ease, transform 0.18s ease;
}

.app-mini-toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
    .app-mini-toast {
        transition: opacity 0.01s linear, transform 0.01s linear;
    }
}

.app-dialog-root {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 26000;
}

.app-dialog-backdrop {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(8, 10, 20, 0.42);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    pointer-events: auto;
    animation: backdropFadeIn 0.15s ease-out;
}

.app-dialog-backdrop.closing {
    animation: backdropFadeOut 0.12s ease-in forwards;
}

.app-dialog-card {
    width: min(92vw, 540px);
    max-width: calc(100vw - 36px);
    max-height: calc(100vh - 36px);
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    background: rgba(18, 18, 18, 0.92) !important;
    border: 1px solid var(--color-border) !important;
    box-shadow: 0 14px 40px rgba(0,0,0,0.38) !important;
    backdrop-filter: blur(20px) saturate(130%);
    -webkit-backdrop-filter: blur(20px) saturate(130%);
    animation: popupFadeIn 0.2s ease-out forwards;
    overflow: hidden;
}

.app-dialog-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    gap: 8px;
    padding: 14px 16px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.app-dialog-header.has-close-button {
    padding-left: 46px;
    padding-right: 46px;
}

.app-dialog-title {
    font-family: 'Kanit', sans-serif;
    font-size: 1.05rem;
    color: var(--color-text);
    text-align: center;
    width: 100%;
}

.app-dialog-close {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: var(--color-text-soft);
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-dialog-close:hover {
    background: rgba(255,255,255,0.16);
    color: var(--color-text);
}

.app-dialog-body {
    padding: 14px 16px 10px;
    display: grid;
    gap: 12px;
    min-width: 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

.app-dialog-body > * {
    min-width: 0;
}

.app-dialog-message {
    color: var(--color-text);
    font-size: 0.95rem;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    text-align: center;
    max-width: 44ch;
    margin: 0 auto;
}

.app-dialog-card.app-dialog-kind-prompt .app-dialog-message {
    max-width: none;
}

.app-dialog-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.06);
    color: var(--color-text);
    font-family: var(--font-family);
    font-size: 0.92rem;
    outline: none;
    resize: vertical;
    min-height: 42px;
}

textarea.app-dialog-input {
    min-height: 108px;
}

textarea.app-dialog-input[data-resize-mode="both"] {
    resize: both;
    overflow: auto;
}

textarea.app-dialog-input[data-resize-mode="vertical"] {
    resize: vertical;
    overflow: auto;
}

textarea.app-dialog-input[data-resize-mode="none"] {
    resize: none;
}

.app-dialog-char-counter {
    margin-top: -8px;
    text-align: right;
    font-size: 0.75rem;
    color: var(--color-text-soft);
    opacity: 0.9;
    font-variant-numeric: tabular-nums;
}

.app-dialog-char-counter.is-limit {
    color: var(--color-accent-light);
    opacity: 1;
}

.app-dialog-input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(160,32,240,0.16);
}

.app-dialog-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 16px 16px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.app-dialog-actions.app-dialog-actions-two {
    gap: 18px;
}

.app-dialog-btn {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    padding: 10px 14px;
    min-width: 122px;
    max-width: 100%;
    font-family: 'Kanit', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.app-dialog-btn:hover {
    transform: translateY(-1px);
}

.app-dialog-btn-primary {
    color: #fff;
    border-color: rgba(255,255,255,0.2);
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-light));
    box-shadow: 0 8px 20px rgba(0,0,0,0.28);
}

.app-dialog-btn-secondary {
    color: var(--color-text);
    background: rgba(255,255,255,0.08);
}

.app-dialog-btn-secondary:hover {
    background: rgba(255,255,255,0.14);
}

.app-dialog-btn-danger {
    color: #ffe8ed;
    border-color: rgba(255, 110, 137, 0.42);
    background: linear-gradient(135deg, rgba(175, 26, 59, 0.9), rgba(224, 61, 102, 0.9));
}

.app-dialog-btn-danger:hover {
    box-shadow: 0 8px 20px rgba(150, 20, 50, 0.34);
}

.app-dialog-btn.playlist-collaborator-remove-btn {
    box-sizing: border-box;
    flex: 0 0 28px;
    min-width: 28px;
    max-width: 28px;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 9px;
}

.app-dialog-btn.playlist-collaborator-remove-btn:hover {
    transform: none;
}

.app-dialog-btn.playlist-collaborator-remove-btn .material-symbols-outlined {
    font-size: 18px;
    line-height: 1;
}

.playlist-style-editor {
    width: min(94vw, 620px);
    max-width: calc(100vw - 36px);
    overflow: hidden;
}

.playlist-style-editor-body {
    gap: 10px;
}

.playlist-style-description-input {
    resize: none;
    min-height: 108px;
}

.playlist-style-char-counter {
    margin-top: -8px;
    text-align: right;
    font-size: 0.75rem;
    color: var(--color-text-soft);
    opacity: 0.85;
}

.playlist-style-char-counter.is-limit {
    color: var(--color-accent-light);
    opacity: 1;
}

.playlist-style-cover-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.playlist-style-cover-preview {
    width: 92px;
    height: 92px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.16);
    background: linear-gradient(160deg, rgba(255,255,255,0.1), rgba(255,255,255,0.04));
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.playlist-style-cover-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.playlist-style-cover-fallback {
    font-size: 1.8rem;
    color: var(--color-text-soft);
    opacity: 0.9;
}

.playlist-style-cover-controls {
    flex: 1 1 220px;
    min-width: 0;
    display: grid;
    gap: 8px;
}

.playlist-style-cover-button-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    flex-wrap: wrap;
}

.playlist-style-cover-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.playlist-style-cover-select-btn {
    flex: 1 1 180px;
    min-width: 0;
    max-width: 100%;
    padding: 9px 12px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.playlist-style-cover-select-btn .material-symbols-outlined {
    font-size: 1.15rem;
    line-height: 1;
}

.playlist-style-cover-file-name {
    font-size: 0.8rem;
    line-height: 1.3;
    color: var(--color-text-soft);
    opacity: 0.9;
    overflow-wrap: anywhere;
}

.playlist-style-cover-remove-btn {
    flex: 1 1 180px;
    min-width: 0;
    max-width: 100%;
    padding: 9px 12px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.playlist-style-cover-remove-btn .material-symbols-outlined {
    font-size: 1.1rem;
    line-height: 1;
}

.playlist-style-cover-select-btn span:last-child,
.playlist-style-cover-remove-btn span:last-child,
.playlist-style-default-toggle span {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
}

.playlist-style-preview {
    width: 68px;
    height: 68px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.2);
    background: linear-gradient(160deg, rgba(255,255,255,0.12), rgba(255,255,255,0.05));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
}

.playlist-style-preview .material-symbols-outlined {
    font-size: 2rem;
    color: var(--color-text);
}

.playlist-style-label {
    font-family: 'Kanit', sans-serif;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    color: var(--color-text-soft);
    text-transform: uppercase;
}

.playlist-style-icon-dropdown {
    position: relative;
}

.playlist-style-icon-dropdown-toggle {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 42px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-radius: 12px;
}

.playlist-style-icon-dropdown-value {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 0.92rem;
}

.playlist-style-icon-dropdown-value span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playlist-style-icon-dropdown-value .material-symbols-outlined,
.playlist-style-icon-dropdown-arrow {
    font-size: 1.2rem;
    line-height: 1;
}

.playlist-style-icon-dropdown-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: auto;
    bottom: calc(100% + 6px);
    z-index: 40;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 6px;
    display: none;
    max-height: 220px;
    overflow-y: auto;
    background: rgba(18, 18, 18, 0.95);
}

.playlist-style-icon-dropdown.is-open .playlist-style-icon-dropdown-menu {
    display: block;
}

.playlist-style-icon-dropdown-option {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--color-text);
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-family);
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
}

.playlist-style-icon-dropdown-option .material-symbols-outlined {
    font-size: 1.12rem;
    line-height: 1;
}

.playlist-style-icon-dropdown-option:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.12);
}

.playlist-style-icon-dropdown-option.is-active {
    background: rgba(186, 85, 211, 0.18);
    border-color: rgba(198, 126, 255, 0.52);
}

.playlist-style-color-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.playlist-style-color-input {
    -webkit-appearance: none;
    appearance: none;
    width: 48px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.22);
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.playlist-style-color-input:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.playlist-style-color-input::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 9px;
}

.playlist-style-color-input::-webkit-color-swatch {
    border: none;
    border-radius: 9px;
}

.playlist-style-default-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.88rem;
    color: var(--color-text-soft);
    cursor: pointer;
    user-select: none;
    padding: 2px 2px 2px 0;
    transition: color 0.18s ease;
}

.playlist-style-default-toggle input {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    box-sizing: border-box;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.28);
    background: rgba(255,255,255,0.07);
    display: inline-grid;
    place-items: center;
    position: relative;
    margin: 0;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.playlist-style-default-toggle input::before {
    content: "";
    width: 6px;
    height: 10px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -56%) rotate(45deg) scale(0);
    transform-origin: center;
    transition: transform 0.16s ease;
}

.playlist-style-default-toggle:hover input {
    border-color: rgba(198,126,255,0.62);
    background: rgba(186,85,211,0.14);
}

.playlist-style-default-toggle input:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(160,32,240,0.22);
    border-color: rgba(198,126,255,0.75);
}

.playlist-style-default-toggle input:active {
    transform: translateY(1px);
}

.playlist-style-default-toggle input:checked {
    border-color: rgba(198,126,255,0.78);
    background: linear-gradient(135deg, rgba(160,32,240,0.88), rgba(186,85,211,0.86));
}

.playlist-style-default-toggle input:checked::before {
    transform: translate(-50%, -56%) rotate(45deg) scale(1);
}

.playlist-style-default-toggle.is-active {
    color: var(--color-text);
}

.playlist-style-editor-actions {
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

@media (max-width: 640px), (max-height: 760px) {
    .app-dialog-backdrop {
        padding: 12px;
    }

    .app-dialog-card,
    .playlist-style-editor {
        max-width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
    }

    .playlist-style-editor-actions .app-dialog-btn {
        flex: 1 1 100%;
    }
}

@keyframes backdropFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ========================
   MISC
   ======================== */
.no-permission {
    font-size: 1.5rem;
    color: var(--color-text-soft);
    text-align: center;
    margin-top: 60px;
}

#songGrid {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 10px;
}

#songGrid.artist-discovery-active {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

#songGrid[data-content-mode="albums"],
#songGrid[data-content-mode="favorite-albums"] {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 18px;
    align-items: stretch;
}

#songGrid[data-content-mode="music-videos"] {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 22px;
    align-items: stretch;
}

#songGrid[data-content-mode="podcasts"],
#songGrid[data-content-mode="podcasts-detail"] {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

@media (max-width: 640px) {
    #songGrid,
    #songGrid.artist-discovery-active {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    #songGrid[data-content-mode="albums"],
    #songGrid[data-content-mode="favorite-albums"],
    #songGrid[data-content-mode="music-videos"],
    #songGrid[data-content-mode="podcasts"],
    #songGrid[data-content-mode="podcasts-detail"] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 13px;
    }

    #songGrid[data-content-mode="music-videos"],
    #songGrid[data-content-mode="podcasts"],
    #songGrid[data-content-mode="podcasts-detail"] {
        grid-template-columns: minmax(0, 1fr);
    }

    .music-video-card-info {
        padding: 11px;
    }

    .music-video-play-pill {
        width: 40px;
        height: 40px;
    }

    .music-video-player-backdrop {
        padding:
            max(10px, env(safe-area-inset-top, 0px))
            max(10px, env(safe-area-inset-right, 0px))
            max(10px, env(safe-area-inset-bottom, 0px))
            max(10px, env(safe-area-inset-left, 0px));
        align-items: stretch;
    }

    .music-video-player {
        width: 100%;
        max-height: 100%;
        border-radius: 18px;
        align-self: center;
    }

    .music-video-stage {
        max-height: 62vh;
    }

    .music-video-info {
        padding: 12px;
        align-items: flex-start;
        flex-direction: column;
    }

    .music-video-quality {
        width: 100%;
    }

    .music-video-quality-btn {
        flex: 1;
    }
}

@media (max-height: 520px) and (orientation: landscape) {
    .music-video-player-backdrop {
        padding: max(8px, env(safe-area-inset-top, 0px)) max(8px, env(safe-area-inset-right, 0px)) max(8px, env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
    }

    .music-video-player {
        grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
        grid-template-rows: minmax(0, 1fr);
    }

    .music-video-stage {
        max-height: calc(100vh - 16px);
    }

    .music-video-info {
        min-width: 0;
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        padding: 14px;
    }

    .music-video-quality {
        width: 100%;
    }

    .music-video-quality-btn {
        flex: 1;
    }
}

.artist-discovery-switcher {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    width: fit-content;
}

.artist-discovery-switch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border: none;
    background: transparent;
    color: var(--color-text-soft);
    padding: 0 14px;
    border-radius: 999px;
    cursor: pointer;
    font-family: 'Kanit', sans-serif;
    font-weight: 700;
    font-size: 0.84rem;
    transition: background var(--transition-fast) ease, color var(--transition-fast) ease, transform var(--transition-fast) ease;
}

.artist-discovery-switch-btn:hover {
    color: var(--color-text);
    transform: translateY(-1px);
}

.artist-discovery-switch-btn.active {
    color: var(--color-text);
    background: linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.08));
    box-shadow: 0 8px 18px rgba(0,0,0,0.18);
}

.favorites-view-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0 auto 18px;
    padding: 0;
    border: none;
    background: transparent;
}

.favorites-view-toggle-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
}

.my-songs-manager {
    width: min(1120px, 100%);
    margin: 0 auto 120px;
    padding: 18px;
}

.my-songs-manager-filter {
    justify-content: center;
    margin: 0 0 18px;
}

.my-songs-manager.is-opening {
    animation: mySongsManagerOpen 0.34s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes mySongsManagerOpen {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.99);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.my-songs-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.my-songs-head h2 {
    margin: 0;
    font-family: 'Kanit', sans-serif;
    font-size: 1.55rem;
    font-weight: var(--font-weight-bold);
}

.my-songs-head p {
    margin: 5px 0 0;
    color: var(--color-text-soft);
    font-size: 0.94rem;
}

.my-songs-quota-track {
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255,255,255,0.1);
    margin-bottom: 18px;
}

.my-songs-quota-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
    transition: width 0.2s ease;
}

.my-songs-form {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 18px;
}

.my-songs-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.my-songs-form label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: var(--color-text-soft);
    font-size: 0.88rem;
}

.my-songs-form input[type="text"],
.my-songs-form select,
.my-songs-form textarea {
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: rgba(255,255,255,0.07);
    color: var(--color-text);
    padding: 11px 12px;
    font: inherit;
}

.my-songs-form select {
    -webkit-appearance: none;
    appearance: none;
    min-height: 46px;
    padding-right: 42px;
    background-image:
        linear-gradient(135deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.72)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat, no-repeat;
    background-position: 0 0, right 14px center;
    background-size: auto, 16px 16px;
    cursor: pointer;
}

.my-songs-form input[type="text"]:focus,
.my-songs-form select:focus,
.my-songs-form textarea:focus {
    outline: none;
    border-color: var(--color-accent-light);
    background-color: rgba(255,255,255,0.1);
    box-shadow: 0 0 0 3px var(--color-accent-faint);
}

.my-songs-form select option {
    color: #111;
}

.my-songs-form .app-native-dropdown {
    min-height: 46px;
}

.my-songs-form .app-native-dropdown-toggle {
    min-height: 46px;
    border-radius: 8px;
    padding: 11px 12px;
    background: rgba(255,255,255,0.07);
    font: inherit;
}

.my-songs-form .app-native-dropdown-toggle:hover,
.my-songs-form .app-native-dropdown-toggle:focus {
    border-color: var(--color-accent-light);
    background: rgba(255,255,255,0.1);
    box-shadow: 0 0 0 3px var(--color-accent-faint);
}

.my-songs-form .app-native-dropdown-menu {
    border-radius: 8px;
    background: rgba(18,18,22,0.98);
}

.my-songs-form .app-native-dropdown-option {
    min-height: 38px;
    display: flex;
    align-items: center;
}

.my-songs-file-control {
    position: relative;
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 46px;
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: rgba(255,255,255,0.07);
    padding: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.my-songs-file-control:hover,
.my-songs-file-control:focus-within {
    border-color: var(--color-accent-light);
    background: rgba(255,255,255,0.1);
    box-shadow: 0 0 0 3px var(--color-accent-faint);
}

.my-songs-file-control input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.my-songs-file-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 7px;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-light));
    color: #fff;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
}

.my-songs-file-button .material-symbols-outlined {
    font-size: 19px;
}

.my-songs-file-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-text);
    font-weight: 600;
    pointer-events: none;
}

.my-songs-form textarea {
    min-height: 132px;
    resize: none;
}

.my-songs-lyrics-field {
    grid-column: 1 / -1;
}

.my-songs-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.my-songs-form-message {
    min-height: 20px;
    margin-top: 10px;
    color: var(--color-text-soft);
    font-size: 0.9rem;
}

.my-songs-form-message.is-error {
    color: #ff8f8f;
}

.my-songs-manager .my-songs-list {
    display: grid;
    gap: 10px;
}

.my-songs-manager .my-songs-item {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.065);
    border: 1px solid var(--color-border);
}

.my-songs-cover {
    width: 58px;
    height: 58px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(255,255,255,0.08);
}

.my-songs-title {
    color: var(--color-text);
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.my-songs-meta {
    color: var(--color-text-soft);
    font-size: 0.88rem;
    margin-top: 4px;
}

.my-songs-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.my-songs-empty {
    padding: 24px;
    text-align: center;
    color: var(--color-text-soft);
    border: 1px dashed var(--color-border);
    border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
    .my-songs-manager.is-opening {
        animation: none !important;
    }
}

@media (max-width: 760px) {
    .my-songs-manager {
        padding: 12px;
        margin-bottom: 100px;
    }

    .my-songs-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .my-songs-form-grid,
    .my-songs-item {
        grid-template-columns: 1fr;
    }

    .my-songs-item {
        align-items: stretch;
    }

    .my-songs-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

/* My Songs Manager Redesign */
.my-songs-manager {
    width: min(1080px, 100%);
    padding: 0 10px 128px;
}

.my-songs-manager-filter {
    margin: 0 0 16px;
}

.my-songs-head {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    margin: 0;
    padding: 18px;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 18px 18px 0 0;
    background:
        linear-gradient(145deg, rgba(255,255,255,0.09), rgba(255,255,255,0.035)),
        rgba(8, 10, 22, 0.34);
    box-shadow: 0 18px 44px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.my-songs-head-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.08);
    color: var(--color-text);
    font-size: 27px;
    line-height: 1;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}

.my-songs-head > div {
    min-width: 0;
}

.my-songs-head h2 {
    font-size: 1.35rem;
    line-height: 1.05;
}

.my-songs-head p {
    margin-top: 7px;
    font-size: 0.88rem;
}

.my-songs-head #mySongsUploadToggle {
    min-height: 42px;
    padding: 0 16px;
    box-shadow: 0 14px 30px rgba(0,0,0,0.22);
}

.my-songs-quota-track {
    height: 10px;
    margin: 0 0 16px;
    border: 1px solid rgba(255,255,255,0.13);
    border-top: 0;
    border-radius: 0 0 18px 18px;
    background: rgba(255,255,255,0.055);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.my-songs-quota-fill {
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light), rgba(255,255,255,0.72));
    box-shadow: 0 0 18px var(--color-accent-faint);
}

.my-songs-form {
    position: relative;
    padding: 16px;
    border-radius: 18px;
    margin: 0 0 16px;
    border: 1px solid rgba(255,255,255,0.16);
    background:
        linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.035)),
        rgba(8, 10, 22, 0.34);
    box-shadow: 0 18px 44px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.my-songs-form-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(190px, 0.72fr) minmax(0, 1fr);
    gap: 12px;
}

.my-songs-form label {
    gap: 8px;
    color: var(--color-text);
    font-size: 0.82rem;
    font-weight: 700;
}

.my-songs-form label > span:first-child {
    color: var(--color-text-soft);
    font-weight: 700;
}

.my-songs-form input[type="text"],
.my-songs-form select,
.my-songs-form textarea,
.my-songs-file-control {
    min-height: 46px;
    border-radius: 14px;
    border-color: rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.055);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.my-songs-form input[type="text"],
.my-songs-form select,
.my-songs-form textarea {
    padding: 12px 13px;
    font-size: 0.92rem;
    line-height: 1.45;
}

.my-songs-form input[type="text"]:focus,
.my-songs-form select:focus,
.my-songs-form textarea:focus,
.my-songs-file-control:hover,
.my-songs-file-control:focus-within {
    border-color: rgba(255,255,255,0.28);
    background: rgba(255,255,255,0.085);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 0 0 3px rgba(255,255,255,0.045);
}

.my-songs-form .app-native-dropdown-toggle {
    min-height: 46px;
    border-radius: 14px;
    border-color: rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.055);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.my-songs-form .app-native-dropdown-toggle:hover,
.my-songs-form .app-native-dropdown-toggle:focus {
    border-color: rgba(255,255,255,0.28);
    background: rgba(255,255,255,0.085);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 0 0 3px rgba(255,255,255,0.045);
}

.my-songs-file-control {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 6px;
}

.my-songs-file-button {
    min-height: 34px;
    border-radius: 11px;
    background: rgba(255,255,255,0.095);
    border: 1px solid rgba(255,255,255,0.14);
    color: var(--color-text);
}

.my-songs-file-name {
    font-size: 0.9rem;
}

.my-songs-form textarea {
    min-height: 120px;
}

.my-songs-form-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.my-songs-form-actions .shuffle-all-btn,
.my-songs-form-actions .play-all-btn {
    min-height: 42px;
    min-width: 150px;
    padding: 0 18px;
    justify-content: center;
    text-align: center;
    gap: 7px;
}

.my-songs-form-actions .shuffle-all-btn .material-symbols-outlined,
.my-songs-form-actions .play-all-btn .material-symbols-outlined {
    font-size: 20px;
    flex: 0 0 auto;
}

.my-songs-manager.is-saving .my-songs-form,
.my-songs-manager.is-saving .my-songs-list {
    cursor: progress;
}

.my-songs-form.is-saving input,
.my-songs-form.is-saving textarea,
.my-songs-form.is-saving select,
.my-songs-form.is-saving button,
.my-songs-list.is-saving button,
#mySongsUploadToggle:disabled {
    cursor: not-allowed;
}

.my-songs-form.is-saving input,
.my-songs-form.is-saving textarea,
.my-songs-form.is-saving select,
.my-songs-file-control:has(input:disabled) {
    opacity: 0.72;
}

.my-songs-list.is-saving {
    opacity: 0.72;
    pointer-events: none;
}

.my-songs-form-actions .play-all-btn:disabled,
.my-songs-form-actions .shuffle-all-btn:disabled,
#mySongsUploadToggle:disabled {
    opacity: 0.68;
    transform: none;
}

.my-songs-submit-spinner {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mySongsSubmitSpin 0.78s linear infinite;
}

@keyframes mySongsSubmitSpin {
    to {
        transform: rotate(360deg);
    }
}

.my-songs-form-message {
    min-height: 18px;
    margin-top: 8px;
    font-size: 0.84rem;
}

.my-songs-manager .my-songs-list {
    gap: 8px;
}

.my-songs-manager .my-songs-item {
    position: relative;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 10px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.14);
    background:
        linear-gradient(145deg, rgba(255,255,255,0.065), rgba(255,255,255,0.028)),
        rgba(8, 10, 22, 0.26);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.07);
    transition: border-color var(--transition-fast) ease, background var(--transition-fast) ease, transform var(--transition-fast) ease, box-shadow var(--transition-fast) ease;
}

.my-songs-manager .my-songs-item:hover {
    border-color: rgba(255,255,255,0.22);
    background:
        linear-gradient(145deg, rgba(255,255,255,0.09), rgba(255,255,255,0.038)),
        rgba(8, 10, 22, 0.34);
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.08);
}

.my-songs-manager .my-songs-cover {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.18);
}

.my-songs-manager .my-songs-title {
    font-size: 0.96rem;
}

.my-songs-manager .my-songs-meta {
    font-size: 0.82rem;
}

.my-songs-manager .my-songs-actions {
    gap: 6px;
}

.my-songs-manager .my-songs-actions .favorite-button {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.14);
}

.my-songs-manager .my-songs-actions .favorite-button:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.24);
}

.my-songs-manager .my-songs-empty {
    padding: 30px 18px;
    border-radius: 18px;
    border-color: rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.045);
}

@media (max-width: 760px) {
    .my-songs-manager {
        padding: 0 4px 108px;
    }

    .my-songs-filter-wrap {
        width: 100%;
        padding: 0 2px;
        box-sizing: border-box;
    }

    .my-songs-filter {
        width: min(100%, 320px);
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .my-songs-filter-btn {
        flex: 1 1 0;
        min-width: 0;
        padding: 0 8px;
        font-size: 0.78rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .my-songs-head {
        grid-template-columns: auto minmax(0, 1fr);
        padding: 16px;
        border-radius: 16px 16px 0 0;
    }

    .my-songs-head-icon {
        width: 42px;
        height: 42px;
        border-radius: 12px;
        font-size: 24px;
    }

    .my-songs-head #mySongsUploadToggle {
        grid-column: 1 / -1;
        width: 100%;
    }

    .my-songs-form {
        padding: 12px;
        border-radius: 16px;
    }

    .my-songs-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .my-songs-file-control {
        grid-template-columns: minmax(0, 1fr);
        gap: 7px;
    }

    .my-songs-file-button {
        width: 100%;
    }

    .my-songs-form-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .my-songs-form-actions .shuffle-all-btn,
    .my-songs-form-actions .play-all-btn {
        width: 100%;
        min-width: 0;
    }

    .my-songs-manager .my-songs-item {
        grid-template-columns: 48px minmax(0, 1fr);
        align-items: center;
    }

    .my-songs-manager .my-songs-cover {
        width: 48px;
        height: 48px;
    }

    .my-songs-manager .my-songs-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 380px) {
    .my-songs-filter {
        gap: 3px;
        padding: 3px;
    }

    .my-songs-filter-btn {
        min-height: 32px;
        padding: 0 6px;
        font-size: 0.72rem;
    }
}

.album-discovery-toolbar {
    grid-column: 1 / -1;
    justify-self: center;
    width: fit-content;
    margin: 0 auto;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.album-discovery-sort {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    flex-wrap: nowrap;
}

.artist-card {
    font-family: var(--font-family);
    border: 1px solid var(--color-border);
    background: rgba(255,255,255,0.04);
    border-radius: 14px;
    padding: 0;
    overflow: hidden;
    min-width: 0;
    text-align: left;
    color: inherit;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
    display: flex;
    flex-direction: column;
}

.album-card {
    position: relative;
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.026)),
        rgba(255,255,255,0.035);
    height: 100%;
}

.album-card[role="button"] {
    outline: none;
}

.album-card-media {
    position: relative;
    background: rgba(0,0,0,0.18);
}

.album-card-favorite {
    --song-like-main: var(--color-accent-light);
    --song-like-alt: var(--color-accent);
    --song-like-soft: var(--color-accent-soft);
    --song-like-faint: var(--color-accent-faint);
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: rgba(14, 15, 23, 0.72) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.24) !important;
    overflow: visible;
    isolation: isolate;
    z-index: 2;
    transition: box-shadow 0.2s ease, transform 0.18s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.album-card-favorite:hover {
    background: rgba(20, 21, 31, 0.92) !important;
}

.album-card-favorite .material-symbols-outlined {
    font-size: 20px;
    line-height: 20px;
    color: rgba(255,255,255,0.88);
    transition: transform 0.22s ease, color 0.22s ease, filter 0.22s ease;
}

.album-card-favorite.active {
    background: radial-gradient(circle at 30% 30%, var(--song-like-soft), var(--song-like-faint)) !important;
    box-shadow: 0 0 0 1px var(--song-like-soft), 0 10px 22px var(--song-like-faint) !important;
    color: var(--song-like-main);
}

.album-card-favorite.active .material-symbols-outlined {
    color: var(--song-like-main);
    filter: drop-shadow(0 0 8px var(--song-like-soft));
}

.album-card-favorite::before,
.album-card-favorite::after {
    content: "";
    position: absolute;
    pointer-events: none;
    opacity: 0;
}

.album-card-favorite::before {
    inset: -4px;
    border-radius: 999px;
    border: 1.5px solid var(--song-like-main);
    transform: scale(0.65);
}

.album-card-favorite::after {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow:
        0 -14px 0 var(--song-like-main),
        10px -10px 0 var(--song-like-main),
        14px 0 0 var(--song-like-alt),
        10px 10px 0 var(--song-like-alt),
        0 14px 0 var(--song-like-main),
        -10px 10px 0 var(--song-like-main),
        -14px 0 0 var(--song-like-alt),
        -10px -10px 0 var(--song-like-alt);
}

.album-card-favorite.like-pop.like-pop-active {
    animation: songFavoritePopIn 0.46s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.album-card-favorite.like-pop.like-pop-active .material-symbols-outlined {
    animation: songFavoriteHeartIn 0.46s cubic-bezier(0.18, 0.85, 0.22, 1) both;
}

.album-card-favorite.like-pop.like-pop-active::before {
    animation: songFavoriteRing 0.44s ease-out both;
}

.album-card-favorite.like-pop.like-pop-active::after {
    animation: songFavoriteBurst 0.42s ease-out both;
}

.album-card-favorite.like-pop.like-pop-inactive {
    animation: songFavoritePopOut 0.3s ease both;
}

.album-card-favorite.like-pop.like-pop-inactive .material-symbols-outlined {
    animation: songFavoriteHeartOut 0.3s ease both;
}

@media (min-width: 1100px) {
    #songGrid.artist-discovery-active {
        grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
        gap: 18px;
    }

    #songGrid[data-content-mode="albums"],
    #songGrid[data-content-mode="favorite-albums"] {
        grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
        gap: 20px;
    }
}

@media (min-width: 1440px) {
    #songGrid.artist-discovery-active {
        grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    }

    #songGrid[data-content-mode="albums"],
    #songGrid[data-content-mode="favorite-albums"] {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

.artist-card:hover {
    transform: translateY(-4px);
    background: rgba(255,255,255,0.07);
    box-shadow: 0 10px 28px rgba(0,0,0,0.25);
    border-color: rgba(255,255,255,0.22);
}

.artist-card:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.artist-card-image,
.artist-card-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    transition: transform 0.26s ease, filter 0.26s ease;
}

.artist-card:hover .artist-card-image {
    transform: scale(1.035);
    filter: saturate(1.08) contrast(1.03);
}

.artist-card-placeholder {
    display: grid;
    place-items: center;
    font-family: 'Kanit', sans-serif;
    font-weight: 700;
    font-size: 2rem;
    color: rgba(255,255,255,0.92);
    background:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.15), transparent 50%),
        linear-gradient(135deg, var(--color-accent-soft), var(--color-accent-faint));
}

.artist-card-info {
    padding: 13px 13px 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: transparent;
}

.album-card .artist-card-info {
    padding: 13px 13px 18px;
    gap: 6px;
    height: 134px;
    min-height: 134px;
}

.artist-card-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.artist-card-title {
    min-width: 0;
    flex: 1;
    font-family: 'Kanit', var(--font-family);
    font-weight: 800;
    font-size: 1.04rem;
    line-height: 1.12;
    letter-spacing: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.album-card .artist-card-title-row {
    justify-content: center;
}

.album-card .artist-card-title {
    text-align: center;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.artist-card-handle {
    font-family: var(--font-family);
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--color-accent-light);
    opacity: 0.95;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.album-card .artist-card-handle {
    color: rgba(255,255,255,0.76);
    opacity: 1;
    font-weight: 700;
    text-align: center;
    flex: 0 0 auto;
}

.album-card .artist-card-meta,
.album-card .artist-card-desc {
    text-align: center;
}

.album-card .artist-card-meta {
    flex: 0 0 auto;
}

.album-card .artist-card-desc {
    min-height: calc(0.84rem * 1.35 * 2);
    margin-top: auto;
    margin-bottom: 0;
}

@media (max-width: 720px) {
    .favorites-view-toggle {
        width: fit-content;
        justify-content: center;
    }

    .favorites-view-toggle .artist-discovery-switch-btn {
        flex: 0 0 auto;
        text-align: center;
    }

    .album-discovery-toolbar {
        width: min(100%, 100%);
        justify-content: center;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .album-discovery-sort {
        width: fit-content;
        max-width: 100%;
        gap: 6px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .album-discovery-sort .artist-discovery-switch-btn {
        flex: 0 0 auto;
        min-width: auto;
        padding-inline: 12px;
    }

    .album-discovery-sort::-webkit-scrollbar {
        display: none;
    }
}

.artist-card-meta {
    font-family: var(--font-family);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--color-text-soft);
}

.status-badge,
.artist-card-status-badge {
    flex: 0 0 auto;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0;
    border-radius: 999px;
    width: 28px;
    height: 24px;
    padding: 0;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-family);
    white-space: nowrap;
}

.status-badge .material-symbols-outlined,
.artist-card-status-badge .material-symbols-outlined {
    font-size: 17px;
    line-height: 1;
    font-variation-settings: 'FILL' 0, 'wght' 650, 'GRAD' 0, 'opsz' 20;
}

.status-badge.ai,
.artist-card-status-badge.ai {
    color: #b7f1ff;
    border: 1px solid rgba(120, 220, 255, 0.35);
    background: rgba(120, 220, 255, 0.08);
}

.status-badge.human,
.artist-card-status-badge.human {
    color: #bbffcf;
    border: 1px solid rgba(80, 220, 140, 0.35);
    background: rgba(80, 220, 140, 0.10);
}

.status-badge.mood,
.artist-card-status-badge.mood {
    color: #ffe6b0;
    border: 1px solid rgba(255, 191, 94, 0.34);
    background: rgba(255, 191, 94, 0.12);
}

.mood-home-card .artist-card-placeholder {
    background:
        radial-gradient(circle at 18% 18%, rgba(255,255,255,0.18), transparent 45%),
        linear-gradient(140deg, rgba(255, 191, 94, 0.52), rgba(160, 32, 240, 0.28));
}

.status-badge-compact {
    width: 26px;
    height: 22px;
}

.status-badge-compact .material-symbols-outlined {
    font-size: 16px;
}

.status-badge-hero {
    font-size: 0.72rem;
    padding: 4px 9px;
    transform: translateY(1px);
}

.status-badge-popup {
    font-size: 0.72rem;
    padding: 3px 9px;
}

.artist-card-desc {
    margin-top: 2px;
    color: var(--color-text-soft);
    font-family: var(--font-family);
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.artist-discovery-empty {
    grid-column: 1 / -1;
    padding: 18px;
    border-radius: 12px;
    text-align: center;
    color: var(--color-text-soft);
    border: 1px solid var(--color-border);
}

.music-video-card {
    font-family: var(--font-family);
    min-width: 0;
    overflow: hidden;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255,255,255,0.065), rgba(255,255,255,0.028));
    color: var(--color-text);
    cursor: pointer;
    text-align: left;
    display: flex;
    flex-direction: column;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.music-video-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255,255,255,0.24);
    background: linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.04));
    box-shadow: 0 12px 28px rgba(0,0,0,0.24);
}

.music-video-thumb-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: rgba(0,0,0,0.26);
}

.music-video-thumb-wrap img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.26s ease, filter 0.26s ease;
}

.music-video-card:hover .music-video-thumb-wrap img {
    transform: scale(1.025);
    filter: saturate(1.08) contrast(1.03);
}

.music-video-play-pill {
    position: absolute;
    left: 14px;
    bottom: 14px;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.18);
    background:
        linear-gradient(135deg, rgba(255,255,255,0.18), rgba(255,255,255,0.07)),
        rgba(10, 10, 18, 0.62);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.28), 0 0 18px var(--color-accent-faint);
}

.music-video-play-pill .material-symbols-outlined {
    font-size: 2.2rem;
}

.music-video-duration {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 5px 9px;
    border-radius: 999px;
    color: #fff;
    background: rgba(0,0,0,0.68);
    font-size: 0.84rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.music-video-card-info {
    padding: 15px;
    display: grid;
    gap: 6px;
    min-width: 0;
    background: transparent;
}

.music-video-title,
.music-video-meta,
.music-video-saving {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.music-video-title {
    font-family: 'Kanit', sans-serif;
    font-size: 1.08rem;
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: 0;
}

.music-video-meta {
    color: var(--color-text-soft);
    font-family: var(--font-family);
    font-size: 0.86rem;
    line-height: 1.25;
    font-weight: 700;
}

.music-video-saving {
    color: color-mix(in srgb, var(--color-accent-light) 78%, var(--color-text));
    font-size: 0.78rem;
    font-weight: 800;
}

.podcast-discovery-shell,
.podcast-detail-shell {
    grid-column: 1 / -1;
    display: grid;
    gap: 20px;
    width: 100%;
}

.podcast-discovery-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    border-radius: 22px;
}

.podcast-discovery-hero span,
.podcast-card-kicker,
.podcast-player-kicker {
    color: var(--color-text-soft);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
}

.podcast-discovery-hero h2,
.podcast-detail-head h2,
.podcast-player h2 {
    margin: 4px 0 8px;
    font-family: 'Kanit', sans-serif;
    font-weight: var(--font-weight-bold);
}

.podcast-discovery-hero p,
.podcast-detail-head p,
.podcast-player p {
    margin: 0;
    color: var(--color-text-soft);
}

.podcast-request-btn {
    border: 0;
    border-radius: 16px;
    padding: 14px 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    box-shadow: 0 16px 34px rgba(0,0,0,.24);
}

.podcast-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
}

.podcast-card,
.podcast-continue-card,
.podcast-episode-card {
    border: 1px solid var(--color-border);
    color: var(--color-text);
    cursor: pointer;
    text-align: left;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.podcast-card:hover,
.podcast-continue-card:hover,
.podcast-episode-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary);
}

.podcast-card {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 14px;
    border-radius: 18px;
}

.podcast-card img,
.podcast-continue-card img,
.podcast-detail-head img,
.podcast-episode-card img,
.podcast-player-hero img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 14px;
}

.podcast-card strong {
    display: block;
    margin: 4px 0;
    font-size: 1.05rem;
}

.podcast-card small,
.podcast-episode-card span,
.podcast-continue-card span,
.podcast-detail-head small {
    color: var(--color-text-soft);
}

.podcast-continue-rail h3 {
    margin: 0 0 10px;
    font-family: 'Kanit', sans-serif;
}

.podcast-continue-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.podcast-continue-card {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 16px;
}

.podcast-continue-card i,
.podcast-progress {
    display: block;
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,.16);
    margin-top: 8px;
}

.podcast-continue-card b,
.podcast-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
}

.podcast-back-btn {
    justify-self: start;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    color: var(--color-text);
    padding: 10px 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.podcast-detail-head {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    padding: 24px;
    border-radius: 24px;
}

.podcast-episode-list {
    display: grid;
    gap: 12px;
}

.podcast-episode-card {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border-radius: 18px;
}

.podcast-episode-info strong {
    display: block;
    font-size: 1rem;
}

.podcast-episode-side {
    display: grid;
    justify-items: end;
    gap: 6px;
    color: var(--color-text-soft);
}

.podcast-episode-side .material-symbols-outlined {
    color: var(--accent-primary);
    font-size: 2rem;
}

.podcast-player-backdrop,
.podcast-request-backdrop {
    position: fixed;
    inset: 0;
    z-index: 25000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(0,0,0,.54);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

body.podcast-player-open {
    overflow: hidden;
}

.podcast-player,
.podcast-request-modal {
    position: relative;
    width: min(820px, 100%);
    max-height: min(760px, calc(100svh - 48px));
    overflow: auto;
    border-radius: 26px;
    padding: 24px;
    border: 1px solid var(--color-border);
}

.podcast-player-close,
.podcast-request-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--color-text);
    background: rgba(255,255,255,.12);
    cursor: pointer;
}

.podcast-player-hero {
    display: grid;
    grid-template-columns: 170px minmax(0,1fr);
    gap: 20px;
    align-items: center;
    padding-right: 44px;
}

.podcast-player audio {
    width: 100%;
    margin-top: 20px;
}

.podcast-transcript {
    margin-top: 18px;
    border: 1px solid var(--color-border);
    border-radius: 18px;
    padding: 14px;
    color: var(--color-text);
}

.podcast-transcript summary {
    cursor: pointer;
    font-weight: 800;
}

.podcast-transcript div {
    margin-top: 12px;
    color: var(--color-text-soft);
    line-height: 1.65;
}

.podcast-request-modal {
    display: grid;
    gap: 14px;
}

.podcast-request-modal h2 {
    margin: 0 50px 0 0;
    font-family: 'Kanit', sans-serif;
}

.podcast-request-modal label {
    display: grid;
    gap: 7px;
    color: var(--color-text-soft);
    font-weight: 800;
}

.podcast-request-modal input,
.podcast-request-modal textarea {
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 13px 14px;
    color: var(--color-text);
    background: rgba(255,255,255,.08);
    outline: none;
}

.podcast-request-message {
    min-height: 20px;
    color: var(--color-text-soft);
}

.music-video-player-backdrop {
    position: fixed;
    inset: 0;
    z-index: 14000;
    padding:
        max(18px, env(safe-area-inset-top, 0px))
        max(18px, env(safe-area-inset-right, 0px))
        max(18px, env(safe-area-inset-bottom, 0px))
        max(18px, env(safe-area-inset-left, 0px));
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.58);
    backdrop-filter: blur(22px) saturate(130%);
    -webkit-backdrop-filter: blur(22px) saturate(130%);
}

body.music-video-player-open {
    overflow: hidden;
}

.music-video-player {
    position: relative;
    width: min(1180px, 100%);
    max-height: 100%;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.025)),
        color-mix(in srgb, var(--color-bg) 76%, var(--color-accent) 24%);
    box-shadow: 0 28px 80px rgba(0,0,0,0.48), inset 0 1px 0 rgba(255,255,255,0.16);
    display: grid;
    grid-template-rows: minmax(0, auto) auto;
}

.music-video-stage {
    background: #000;
    width: 100%;
    max-height: min(74vh, 720px);
    aspect-ratio: 16 / 9;
}

.music-video-stage video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
    object-fit: contain;
}

.music-video-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 999px;
    color: #fff;
    background: rgba(0,0,0,0.46);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.music-video-info {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.music-video-info h2 {
    margin: 0;
    font-family: 'Kanit', sans-serif;
    font-size: clamp(1.2rem, 1rem + 0.7vw, 1.7rem);
    line-height: 1.1;
}

.music-video-info p {
    margin: 3px 0 0;
    color: var(--color-text-soft);
    font-weight: 700;
}

.music-video-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}

.music-video-share-btn {
    width: 42px;
    height: 42px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    color: #fff;
    background: rgba(0,0,0,0.24);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.music-video-share-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(255,255,255,0.28);
    background: rgba(255,255,255,0.11);
}

.music-video-share-btn .material-symbols-outlined {
    font-size: 1.35rem;
}

.music-video-quality {
    display: inline-flex;
    gap: 6px;
    padding: 4px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: rgba(0,0,0,0.22);
    flex: 0 0 auto;
}

.music-video-quality[hidden] {
    display: none !important;
}

.music-video-quality-btn {
    min-height: 34px;
    padding: 0 12px;
    border: none;
    border-radius: 999px;
    color: var(--color-text-soft);
    background: transparent;
    cursor: pointer;
    font-weight: 800;
}

.music-video-quality-btn.active {
    color: #fff;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-light));
}

@media (max-width: 640px) {
    .music-video-card-info {
        padding: 11px;
    }

    .music-video-play-pill {
        width: 40px;
        height: 40px;
    }

    .music-video-player-backdrop {
        padding:
            max(10px, env(safe-area-inset-top, 0px))
            max(10px, env(safe-area-inset-right, 0px))
            max(10px, env(safe-area-inset-bottom, 0px))
            max(10px, env(safe-area-inset-left, 0px));
        align-items: stretch;
    }

    .music-video-player {
        width: 100%;
        max-height: 100%;
        border-radius: 18px;
        align-self: center;
    }

    .music-video-stage {
        max-height: 62vh;
    }

    .music-video-info {
        padding: 12px;
        align-items: flex-start;
        flex-direction: column;
    }

    .music-video-actions {
        width: 100%;
        align-items: stretch;
        justify-content: flex-start;
    }

    .music-video-share-btn {
        flex: 0 0 42px;
    }

    .music-video-quality {
        min-width: 0;
        flex: 1 1 auto;
    }

    .music-video-quality-btn {
        flex: 1;
    }
}

@media (max-height: 520px) and (orientation: landscape) {
    .music-video-player-backdrop {
        padding: max(8px, env(safe-area-inset-top, 0px)) max(8px, env(safe-area-inset-right, 0px)) max(8px, env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
    }

    .music-video-player {
        grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
        grid-template-rows: minmax(0, 1fr);
    }

    .music-video-stage {
        max-height: calc(100vh - 16px);
    }

    .music-video-info {
        min-width: 0;
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        padding: 14px;
    }

    .music-video-quality {
        width: 100%;
    }

    .music-video-quality-btn {
        flex: 1;
    }
}

.song-tile {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    animation: fadeIn 0.3s ease;
}

.song-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    background: rgba(255,255,255,0.08);
}

.song-tile img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.tile-info {
    padding: 10px;
    text-align: center;
}

.tile-title {
    font-size: 1.1em;
    font-weight: var(--font-weight-bold);
    margin-bottom: 4px;
}

.tile-artist {
    font-size: 0.9em;
    color: var(--color-text-soft);
}

.second-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

#scrollSentinel {
    height: 1em;
}

.no-animations * {
    animation: none !important;
    transition: none !important;
}

/* ========================
   ADD TO PLAYLIST PICKER
   ======================== */
.add-to-pl-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-soft);
    border-radius: 50%;
    transition: color var(--transition-fast) ease, background var(--transition-fast) ease;
}

.add-to-pl-btn:hover {
    color: var(--color-accent-light);
    background: rgba(255,255,255,0.08);
}

#addToPlPickerBackdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 6000;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
}

#addToPlPicker {
    display: flex;
    flex-direction: column;
    width: 90vw;
    max-width: 380px;
    max-height: 70vh;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    animation: popupFadeIn 0.25s ease-out forwards;
    overflow: hidden;
}

.add-to-pl-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--color-border);
}

.add-to-pl-header h3 {
    font-family: 'Kanit', sans-serif;
    font-size: 1.1rem;
    margin: 0;
}

.add-to-pl-song {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: rgba(160,32,240,0.08);
    border-bottom: 1px solid var(--color-border);
}

.add-to-pl-song img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
}

.add-to-pl-song-info {
    min-width: 0;
}

.add-to-pl-song-title {
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.add-to-pl-song-artist {
    font-size: 0.8rem;
    color: var(--color-text-soft);
}

.add-to-pl-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 10px;
}

.add-to-pl-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
    font-size: 0.9rem;
    font-weight: 600;
}

.add-to-pl-item:hover {
    background: rgba(255,255,255,0.08);
}

.add-to-pl-item .material-symbols-outlined {
    font-size: 1.2rem;
    color: var(--color-accent-light);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.add-to-pl-item:hover .material-symbols-outlined {
    opacity: 1;
}

.add-to-pl-item.added {
    color: var(--color-accent-light);
}

.add-to-pl-item.added .material-symbols-outlined {
    opacity: 1;
    color: var(--color-accent-light);
}

.add-to-pl-empty {
    text-align: center;
    color: var(--color-text-soft);
    padding: 24px 16px;
    font-size: 0.9rem;
}

.add-to-pl-done {
    width: auto;
    padding: 8px 28px;
    margin: 12px auto 4px;
    display: block;
    border: none;
    border-radius: 999px;
    background: var(--color-accent);
    color: #fff;
    font-family: 'Nunito', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.add-to-pl-done:hover {
    background: var(--color-accent-light);
    transform: scale(1.02);
}

.add-to-pl-done:active {
    transform: scale(0.98);
}

.add-to-pl-close {
    background: none;
    border: none;
    color: var(--color-text-soft);
    cursor: pointer;
    padding: 4px;
    display: flex;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.add-to-pl-close:hover {
    background: rgba(255,255,255,0.1);
}

/* ========================
   THEME PICKER
   ======================== */
.theme-picker-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 7000;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
}

.theme-picker {
    width: 90vw;
    max-width: 520px;
    max-height: 82vh;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    animation: popupFadeIn 0.25s ease-out forwards;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.theme-picker-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 14px;
    overflow-y: auto;
}

.theme-picker-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.theme-picker-section-custom {
    padding-top: 4px;
    border-top: 1px solid var(--color-border);
}

.theme-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.theme-section-head > div {
    min-width: 0;
}

.theme-picker-section-custom .theme-section-head {
    align-items: center;
}

.theme-section-head h4 {
    margin: 0;
    font-family: 'Kanit', sans-serif;
    font-size: 1rem;
}

.theme-section-head p {
    margin: 4px 0 0;
    color: var(--color-text-soft);
    font-size: 0.88rem;
    line-height: 1.45;
}

.custom-theme-open-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    margin-left: auto;
    margin-top: 2px;
    padding: 0 12px;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    background: rgba(255,255,255,0.08);
    color: #ffffff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition-fast) ease, color var(--transition-fast) ease, transform 0.15s ease;
}

.custom-theme-open-btn:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,0.15);
    color: var(--color-text);
}

.custom-theme-open-btn .material-symbols-outlined {
    font-size: 1.05rem;
}

.theme-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--color-border);
}

.theme-picker-header h3 {
    font-family: 'Kanit', sans-serif;
    font-size: 1.1rem;
    margin: 0;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.theme-grid-custom {
    min-height: 0;
}

/* Center only when a theme card is explicitly marked as lone item in last row */
.theme-grid .theme-card.theme-card-lone-last {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc(50% - 5px);
}

/* Featured theme card (Purple/default) spans full row */
.theme-grid .theme-card.theme-card-featured {
    grid-column: 1 / -1;
    justify-self: stretch;
    width: 100%;
}

.theme-card {
    position: relative;
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    transition: border-color 0.2s ease, transform 0.15s ease, background 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 90px;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    overflow: hidden;
}

.theme-card-custom {
    min-height: 116px;
}

.theme-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    opacity: 0.15;
    z-index: 0;
}

.theme-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.2);
}

.theme-card.active {
    border-color: var(--color-accent-light);
}

.theme-card-name {
    font-family: 'Kanit', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
    color: var(--theme-name-fallback, #ffffff);
    background: var(--theme-name-gradient, linear-gradient(90deg, #ffffff 0%, var(--color-accent-light) 100%));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 1px 0 rgba(0,0,0,0.18);
}

.theme-card-preview,
.theme-dots {
    display: flex;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.theme-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.15);
    flex-shrink: 0;
}

.theme-card-check {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 1.1rem;
    color: var(--color-accent-light);
    z-index: 1;
    display: none;
}

.theme-card.active .theme-card-check {
    display: block;
}

.theme-card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.theme-card-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.theme-card-icon-btn {
    border: 0;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: inherit;
    cursor: pointer;
    padding: 0;
    opacity: 0.88;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, opacity 0.2s ease, transform 0.15s ease;
}

.theme-card-icon-btn .material-symbols-outlined {
    font-size: 18px;
}

.theme-card-edit:hover,
.theme-card-delete:hover {
    opacity: 1;
    background: rgba(255,255,255,0.16);
    transform: translateY(-1px);
}

.theme-card-delete:hover {
    background: rgba(255,120,120,0.18);
}

.theme-empty-state {
    grid-column: 1 / -1;
    padding: 14px;
    border-radius: 12px;
    border: 1px dashed var(--color-border);
    background: rgba(255,255,255,0.04);
    color: var(--color-text-soft);
    text-align: center;
    font-size: 0.9rem;
}

.custom-theme-status {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    background: rgba(255,255,255,0.04);
    font-size: 0.88rem;
    line-height: 1.4;
}

.custom-theme-status[data-state="success"] {
    border-color: rgba(52, 211, 153, 0.32);
    background: rgba(16, 185, 129, 0.12);
}

.custom-theme-status[data-state="error"] {
    border-color: rgba(248, 113, 113, 0.34);
    background: rgba(239, 68, 68, 0.12);
}

html.theme-popup-open,
body.theme-popup-open {
    overflow: hidden !important;
    overscroll-behavior: none !important;
}

.custom-theme-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.custom-theme-creator-backdrop {
    z-index: 7100;
    align-items: flex-start;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding:
        max(28px, calc(22px + env(safe-area-inset-top, 0px)))
        14px
        max(30px, calc(22px + env(safe-area-inset-bottom, 0px)));
}

.custom-theme-creator {
    width: min(92vw, 560px);
    max-height: calc(100vh - 58px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 58px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    margin: auto 0;
    display: flex;
    flex-direction: column;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    overflow: hidden;
    animation: popupFadeIn 0.25s ease-out forwards;
}

.custom-theme-creator-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--color-border);
}

.custom-theme-creator-header > div {
    flex: 1;
    text-align: center;
}

.custom-theme-creator-header h3 {
    margin: 2px 0 0;
    font-family: 'Kanit', sans-serif;
    font-size: 1.1rem;
    line-height: 1.1;
}

.custom-theme-creator-kicker {
    margin: 0;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-accent-light);
    font-weight: 700;
}

.custom-theme-creator-body {
    min-height: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 14px;
}

.custom-theme-status-popup {
    margin-bottom: 2px;
}

.custom-theme-preview-panel {
    --custom-theme-preview-accent: var(--color-accent);
    --custom-theme-preview-accent-light: var(--color-accent-light);
    --custom-theme-preview-bg: var(--color-bg);
    --custom-theme-preview-text: var(--color-text);
    --custom-theme-preview-soft: var(--color-text-soft);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 14px;
    background:
        linear-gradient(150deg, rgba(255,255,255,0.08), rgba(255,255,255,0.025)),
        var(--custom-theme-preview-bg);
    overflow: hidden;
}

.custom-theme-preview-card {
    display: grid;
    gap: 14px;
    min-height: 132px;
    border-radius: 14px;
    padding: 14px;
    color: var(--custom-theme-preview-text);
    background:
        radial-gradient(circle at 18% 0%, color-mix(in srgb, var(--custom-theme-preview-accent) 30%, transparent), transparent 42%),
        linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.035));
    border: 1px solid rgba(255,255,255,0.18);
}

.custom-theme-preview-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.custom-theme-preview-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'Kanit', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
}

.custom-theme-preview-badge {
    flex: 0 0 auto;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 999px;
    padding: 5px 9px;
    color: var(--custom-theme-preview-soft);
    background: rgba(255,255,255,0.08);
    font-size: 0.78rem;
    font-weight: 800;
}

.custom-theme-preview-bars {
    display: grid;
    grid-template-columns: 1.2fr 1fr 0.8fr;
    gap: 8px;
}

.custom-theme-preview-bars span {
    height: 12px;
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(0,0,0,0.20);
}

.custom-theme-preview-mini {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    background: rgba(0,0,0,0.16);
}

.custom-theme-preview-mini span {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.custom-theme-preview-mini span::before,
.custom-theme-preview-mini span::after {
    content: "";
    display: block;
    height: 9px;
    border-radius: 999px;
    background: rgba(255,255,255,0.18);
}

.custom-theme-preview-mini span::before {
    width: min(180px, 100%);
}

.custom-theme-preview-mini span::after {
    width: min(120px, 70%);
    opacity: 0.7;
}

.custom-theme-preview-mini button {
    border: 0;
    border-radius: 12px;
    min-height: 38px;
    padding: 0 16px;
    color: #fff;
    font-family: 'Kanit', sans-serif;
    font-weight: 800;
    background: linear-gradient(135deg, var(--custom-theme-preview-accent), var(--custom-theme-preview-accent-light));
    pointer-events: none;
}

.custom-theme-step {
    display: grid;
    gap: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 14px;
    background: rgba(255,255,255,0.045);
}

.custom-theme-step-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.custom-theme-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    color: #fff;
    font-family: 'Kanit', sans-serif;
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-light));
}

.custom-theme-step-head h4 {
    margin: 0;
    font-family: 'Kanit', sans-serif;
    font-size: 1rem;
    line-height: 1.15;
}

.custom-theme-step-head p {
    margin: 3px 0 0;
    color: var(--color-text-soft);
    font-size: 0.86rem;
    line-height: 1.35;
}

.custom-theme-preset-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.custom-theme-preset-row button {
    min-height: 38px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 0 10px;
    color: var(--color-text);
    font-family: 'Kanit', sans-serif;
    font-weight: 800;
    background: rgba(255,255,255,0.07);
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.custom-theme-preset-row button:hover {
    transform: translateY(-1px);
    border-color: rgba(255,255,255,0.28);
    background: rgba(255,255,255,0.12);
}

.custom-theme-form-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.custom-theme-form-row-wide {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
}

.custom-theme-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.custom-theme-field span {
    font-size: 0.8rem;
    color: var(--color-text-soft);
}

.custom-theme-field small {
    margin-top: -3px;
    color: color-mix(in srgb, var(--color-text-soft) 82%, transparent);
    font-size: 0.74rem;
    line-height: 1.25;
}

.custom-theme-field input[type="text"],
.custom-theme-field select {
    width: 100%;
    min-height: 42px;
    border-radius: 10px;
    border: 1px solid var(--color-border);
    background: rgba(255,255,255,0.06);
    color: var(--color-text);
    padding: 0 12px;
    font: inherit;
}

.custom-theme-field .app-native-dropdown-toggle {
    min-height: 42px;
    padding: 0 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
}

.custom-theme-field .app-native-dropdown-menu {
    z-index: 7200;
    border-radius: 10px;
}

.custom-theme-field input[type="text"]::placeholder {
    color: var(--color-text-soft);
}

.custom-theme-color-field input[type="color"] {
    width: 100%;
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--color-border);
    background: rgba(255,255,255,0.06);
    padding: 4px;
    cursor: pointer;
}

.custom-theme-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: center;
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 2px 0 0;
    padding: 10px 0 0;
    background: transparent;
    border-top: 0;
}

.custom-theme-submit,
.custom-theme-reset {
    min-height: 42px;
    border-radius: 10px;
    border: 1px solid var(--color-border);
    padding: 0 14px;
    font: inherit;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
}

.custom-theme-submit {
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light));
    color: #ffffff;
    border: none;
}

.custom-theme-reset {
    background: rgba(255,255,255,0.13);
    backdrop-filter: blur(22px) saturate(1.35);
    -webkit-backdrop-filter: blur(22px) saturate(1.35);
    color: var(--color-text);
    border-color: rgba(255,255,255,0.26);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.18),
        0 10px 24px rgba(0,0,0,0.18);
}

.custom-theme-submit:hover,
.custom-theme-reset:hover {
    transform: translateY(-1px);
}

/* ========================
   PRIDE THEME
   ======================== */
html[data-theme-id="pride"] body::before {
    background:
        radial-gradient(circle at 18% 22%, rgba(255,77,93,0.24), transparent 34%),
        radial-gradient(circle at 82% 18%, rgba(0,194,255,0.18), transparent 36%),
        radial-gradient(circle at 50% 78%, rgba(183,108,255,0.18), transparent 38%);
}

html[data-theme-id="pride"] .sidebar-link.active,
html[data-theme-id="pride"] .home-mood-tab.active,
html[data-theme-id="pride"] .app-native-dropdown-option.is-active {
    background:
        linear-gradient(90deg, rgba(7,7,11,0.68), rgba(7,7,11,0.58)),
        var(--color-rainbow-gradient);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14);
    color: #ffffff;
}

html[data-theme-id="pride"] .play-button,
html[data-theme-id="pride"] .custom-theme-submit {
    background: var(--color-rainbow-gradient);
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.45);
}

html[data-theme-id="pride"] .option-controls.active,
html[data-theme-id="pride"] .mobile-nav-bar a.active {
    color: var(--color-pride-yellow);
}

html[data-theme-id="pride"] .theme-card.active {
    border-color: rgba(255,255,255,0.42);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.12), 0 12px 26px rgba(0,0,0,0.22);
}

html[data-theme-id="pride"] .theme-card.active::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 9px;
    height: 3px;
    border-radius: 999px;
    background: var(--color-rainbow-gradient);
    opacity: 0.95;
    z-index: 1;
    pointer-events: none;
}

@media (max-width: 640px) {
    .theme-section-head {
        flex-direction: column;
    }

    .custom-theme-creator-backdrop {
        padding:
            max(34px, calc(26px + env(safe-area-inset-top, 0px)))
            12px
            max(38px, calc(28px + env(safe-area-inset-bottom, 0px)));
    }

    .custom-theme-creator {
        width: min(100%, calc(100vw - 24px));
        max-height: calc(100vh - 72px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
        max-height: calc(100dvh - 72px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    }

    .custom-theme-open-btn {
        width: 100%;
        margin-left: 0;
    }

    .custom-theme-form-row,
    .custom-theme-form-row-wide {
        grid-template-columns: 1fr;
    }

    .custom-theme-preview-panel,
    .custom-theme-step {
        border-radius: 14px;
        padding: 12px;
    }

    .custom-theme-preview-card {
        min-height: 118px;
    }

    .custom-theme-preset-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .custom-theme-preset-row button:last-child {
        grid-column: 1 / -1;
    }

    .custom-theme-actions {
        grid-template-columns: 1fr;
    }

    .custom-theme-creator-header,
    .custom-theme-creator-body {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ========================
   ANIMATIONS
   ======================== */
@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn3 {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes popupFadeIn {
    0% { opacity: 0; transform: scale(0.95) translateY(10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ========================
   RESPONSIVE
   ======================== */
@media (max-width: 900px) {
    html,
    body {
        width: 100%;
        height: var(--app-viewport-height);
        min-height: var(--app-viewport-height);
        overflow: hidden !important;
        overscroll-behavior: none;
        position: relative;
    }

    body {
        touch-action: manipulation;
    }

    html:not(.mobile-entry) .main-content,
    html:not(.mobile-entry) .playback-menu,
    html:not(.mobile-entry) .mobile-header {
        opacity: 1 !important;
        transform: none !important;
    }

    html.mobile-entry .main-content,
    html.mobile-entry .playback-menu,
    html.mobile-entry .mobile-header {
        transition: opacity 420ms cubic-bezier(0.22, 0.61, 0.36, 1),
                    transform 420ms cubic-bezier(0.22, 0.61, 0.36, 1);
        will-change: opacity, transform;
    }

    html.mobile-entry:not(.mobile-entry-ready) .main-content,
    html.mobile-entry:not(.mobile-entry-ready) .playback-menu {
        opacity: 0 !important;
        transform: translateY(12px);
    }

    html.mobile-entry:not(.mobile-entry-ready) .mobile-header {
        opacity: 0 !important;
        transform: translateY(-8px);
    }

    html.mobile-entry.mobile-entry-ready .main-content,
    html.mobile-entry.mobile-entry-ready .playback-menu,
    html.mobile-entry.mobile-entry-ready .mobile-header {
        opacity: 1 !important;
        transform: translateY(0);
    }

    @media (prefers-reduced-motion: reduce) {
        html.mobile-entry .main-content,
        html.mobile-entry .playback-menu,
        html.mobile-entry .mobile-header {
            transition: none !important;
            transform: none !important;
            opacity: 1 !important;
        }
    }

    .sidebar,
    .main-content,
    .playback-menu,
    .mobile-header {
        animation: none !important;
    }

    .sidebar {
        left: auto;
        right: 0;
        top: 0;
        bottom: auto;
        height: var(--app-viewport-height);
        max-height: var(--app-viewport-height);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 1300;
        width: 280px;
        border-right: none;
        border-left: 1px solid var(--color-border);
        animation: none;
        opacity: 1;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar {
        padding-top: calc(env(safe-area-inset-top, 0px) + 12px);
    }

    .mobile-header {
        flex-direction: row-reverse;
    }

    .sidebar-bottom {
        padding-bottom: 100px;
    }

    .mobile-header {
        display: flex;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1200;
        border-bottom: 1px solid var(--color-border) !important;
        background: linear-gradient(0deg, var(--color-accent-soft), var(--color-accent-soft)), var(--color-bg-glass) !important;
        box-shadow: 0 2px 15px rgba(0,0,0,0.28), inset 0 -1px 0 var(--color-accent-faint);
        backdrop-filter: blur(var(--blur-amount)) saturate(140%);
        transform: translate3d(0, 0, 0);
        -webkit-transform: translate3d(0, 0, 0);
    }

    .main-content {
        position: fixed;
        inset: 0;
        margin-left: 0;
        padding: 12px;
        padding-top: calc(calc(env(safe-area-inset-top, 0px) + 54px) + 50px);
        padding-bottom: 110px;
        width: 100%;
        height: var(--app-viewport-height);
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }

    .playback-menu {
        position: fixed;
        width: calc(100% - 20px);
        left: 10px;
        right: 10px;
        bottom: 14px;
        transform: translate3d(0, 0, 0);
        -webkit-transform: translate3d(0, 0, 0);
        min-height: 72px;
        border-radius: 999px;
        padding: 9px 12px;
        max-width: none;
        z-index: 1100;
        border: 1px solid var(--color-border) !important;
        background: linear-gradient(0deg, var(--color-accent-soft), var(--color-accent-soft)), var(--color-bg-glass) !important;
        box-shadow: 0 4px 20px rgba(0,0,0,0.28), inset 0 0 0 1px var(--color-accent-faint);
        backdrop-filter: blur(var(--blur-amount)) saturate(140%);
        overflow: hidden;
    }

    .mobile-overlay {
        z-index: 1250;
        height: var(--app-viewport-height);
        overscroll-behavior: none;
        touch-action: none;
    }

    .playback-inner {
        grid-template-columns: minmax(130px, 180px) minmax(0, 1fr) auto;
        gap: 8px;
        align-items: center;
    }

    .song-info {
        max-width: 180px;
    }

    .playback-right {
        display: flex;
    }

    #volumeSlider {
        display: none;
    }

    .playback-center {
        max-width: none;
        padding-bottom: 0;
        height: auto;
    }

    .main-controls {
        gap: 8px;
    }

    .main-controls svg {
        width: 20px;
        height: 20px;
    }

    .play-pause-main {
        width: 36px;
        height: 36px;
    }

    .charts-filter {
        width: 100%;
        flex-wrap: wrap;
        border-radius: 18px;
    }

    .charts-filter-btn {
        flex: 1 1 calc(33.333% - 4px);
        min-width: 0;
        padding: 0 8px;
    }

    .my-songs-filter {
        width: min(100%, 320px);
        flex-wrap: nowrap;
        border-radius: 999px;
    }

    .my-songs-filter-btn {
        flex: 1 1 0;
        min-width: 0;
        font-size: 0.78rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .progress-row {
        gap: 0;
    }

    .time-display {
        display: none;
    }

    .hero-inner {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .hero-section.is-public-account-profile .hero-inner {
        align-items: center;
    }

    .hero-actions {
        justify-content: center;
    }

    .playlist-cover {
        width: 140px;
        height: 140px;
    }

    .playlist-title,
    .home-panel-head h2 {
        font-size: 2.6rem;
    }

    .playlist-desc {
        text-align: center;
        margin: 0 auto;
        font-size: 0.9rem;
    }

    .mood-filter-toggle {
        height: 38px;
        font-size: 0.85rem;
    }

    .mood-filter .app-native-dropdown-toggle {
        font-size: 0.85rem;
    }

    .content-controls {
        display: flex;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .search-bar {
        min-height: 44px;
        padding: 0 12px;
    }

    /* Table: KÃ¼nstler-Spalte ausblenden auf Tablet */
    .song-table th:nth-child(3),
    .song-table td:nth-child(3) {
        display: none;
    }

    .song-row img {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .song-title-cell {
        gap: 10px;
    }

    /* Popups bleiben Card-basiert auf Tablet */
    #playlistPopup {
        width: min(92vw, 760px);
        max-height: 85vh;
    }

    #songPopup {
        width: calc(100% - 20px);
        height: calc(100vh - 28px);
        max-height: calc(100vh - 28px);
        bottom: 14px;
        padding: 30px 24px 24px;
    }

    #songPopupBody {
        grid-template-columns: minmax(220px, 300px) 1px minmax(0, 1fr);
        column-gap: 22px;
    }

    .song-popup-cover-wrap {
        width: clamp(160px, min(28vw, 28vh), 220px);
        margin-bottom: 14px;
        border-radius: 18px;
    }

    .song-popup-title {
        font-size: clamp(1.45rem, 1.1rem + 1.2vw, 1.9rem);
    }

    .song-popup-artist-name-row .song-popup-artist-name {
        font-size: 1.18rem;
    }

    .song-popup-action-row {
        gap: 10px;
    }

    .song-popup-icon-btn {
        width: 48px !important;
        min-width: 48px !important;
        height: 48px;
        min-height: 48px;
    }

    .song-popup-lyrics-content {
        padding: 4px 14px;
    }

    #addSongPopup {
        width: min(92vw, 560px) !important;
        max-height: 82vh !important;
    }

    .playlist-list {
        grid-template-columns: 1fr;
    }

    /* createPlaylistBtn uses .sidebar-link styles */

    .hero-actions {
        gap: 8px;
    }

    .play-all-btn,
    .shuffle-all-btn,
    #addSongsToPlaylistBtn {
        padding: 8px 18px;
        font-size: 0.85rem;
    }

    #deletePlaylistBtn {
        padding: 10px 12px;
        min-width: 44px;
    }

    #deletePlaylistBtn .delete-text {
        display: none;
    }

    #deletePlaylistBtn .material-symbols-outlined {
        font-size: 20px;
    }
}

@media (max-width: 900px) {
    .playback-menu {
        bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }

    .main-content { padding-bottom: calc(102px + env(safe-area-inset-bottom, 0px)); }

    .hero-section {
        padding: 24px 16px 20px;
        margin-bottom: 8px;
    }

    .playlist-cover {
        width: 110px;
        height: 110px;
    }

    .playlist-title,
    .home-panel-head h2 {
        font-size: 2rem;
    }

    .playlist-desc {
        font-size: 0.85rem;
    }

    .playlist-desc-meta-row {
        justify-content: center;
    }

    .auth-native-card {
        border-radius: 14px;
        padding: 12px;
    }

    .auth-native-mode {
        width: 100%;
        justify-content: space-between;
    }

    .auth-native-mode button {
        flex: 1;
    }

    .auth-native-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .auth-native-actions button {
        width: 100%;
    }

    .auth-public-profile-main-actions {
        justify-content: center !important;
    }

    .auth-public-profile-main-actions button {
        width: auto !important;
        max-width: 100%;
        min-width: min(220px, 100%);
        flex: 0 1 auto;
        margin-inline: auto;
    }

    .auth-public-profile-grid {
        grid-template-columns: 1fr;
    }

    .auth-public-profile-image-col {
        justify-items: center;
    }

    .auth-native-profile-header {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-profile-overview-media {
        width: 132px;
        max-width: 100%;
        flex: 0 0 auto;
        justify-self: center;
        margin-inline: auto;
    }

    .auth-profile-overview-preview {
        width: 132px;
        height: 132px;
        justify-self: center;
    }

    .auth-profile-overview-image-actions {
        width: 132px;
        max-width: 100%;
        justify-content: center;
        margin-inline: auto;
    }

    .auth-profile-overview-image-actions button {
        width: 100%;
        min-width: 0;
        margin-inline: 0;
    }

    .auth-public-file-picker {
        flex-wrap: wrap;
    }

    .auth-public-file-btn {
        width: 100%;
        min-width: 0;
    }

    .auth-public-file-name {
        width: 100%;
    }

    .auth-profile-actions-row {
        justify-content: center;
        flex-wrap: wrap;
    }

    .auth-profile-actions-row button {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        flex: 1 1 100%;
    }

    .play-all-btn,
    .shuffle-all-btn,
    #addSongsToPlaylistBtn {
        padding: 9px 18px;
        font-size: 0.9rem;
    }

    .hero-actions {
        width: 100%;
        flex-wrap: nowrap;
        gap: clamp(6px, 1.2vw, 8px);
        justify-content: center;
    }

    .hero-actions .play-all-btn,
    .hero-actions .shuffle-all-btn {
        gap: 4px;
        padding: clamp(8px, calc(6px + 0.6vw), 11px) clamp(10px, calc(6px + 1.6vw), 16px);
        font-size: clamp(0.78rem, calc(0.68rem + 0.5vw), 0.92rem);
        line-height: 1;
        min-height: clamp(42px, calc(36px + 1.6vw), 48px);
        flex-shrink: 1;
    }

    .hero-actions .play-all-btn .material-symbols-outlined,
    .hero-actions .shuffle-all-btn .material-symbols-outlined {
        font-size: clamp(18px, calc(14px + 1.2vw), 22px);
    }

    #sharePlaylist,
    #favoriteAlbumBtn,
    #reportAccountProfileBtn,
    #deletePlaylistBtn,
    #editPlaylistStyleBtn,
    #followPlaylistBtn,
    #playlistActionsBtn {
        width: clamp(42px, calc(36px + 1.8vw), 48px);
        min-width: clamp(42px, calc(36px + 1.8vw), 48px);
        height: clamp(42px, calc(36px + 1.8vw), 48px);
        padding: 0;
        justify-content: center;
        flex-shrink: 0;
    }

    /* Playback Bar Mobile */
    .playback-menu {
        min-height: 66px;
        padding: 9px 11px;
        bottom: calc(4px + env(safe-area-inset-bottom, 0px));
        left: 8px;
        right: 8px;
        width: calc(100% - 16px);
        transform: none;
        border-radius: 999px;
        overflow: hidden;
    }

    .playback-inner {
        grid-template-columns: auto 1fr;
        gap: 0;
        align-items: center;
    }

    .song-info {
        gap: 8px;
        max-width: none;
        flex-shrink: 0;
        grid-column: 1;
    }

    .song-info img {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }

    .song-info .title {
        font-size: 0.95rem;
    }

    .song-info .artist {
        font-size: 0.84rem;
    }

    .playback-center {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        padding-bottom: 0;
        height: auto;
        grid-column: 2;
    }

    .main-controls {
        gap: 6px;
        justify-content: flex-end;
        flex-wrap: nowrap;
        min-width: 0;
    }

    #shuffleButton {
        margin-right: 2px;
        flex-shrink: 0;
    }

    #loopButton {
        margin-left: 2px;
        flex-shrink: 0;
    }

    .main-controls button:hover,
    #shuffleButton:hover,
    #loopButton:hover {
        color: var(--color-text);
        transform: none;
    }

    .main-controls button.active:hover,
    #shuffleButton.active:hover,
    #loopButton.active:hover {
        color: var(--color-accent-light);
    }

    .main-controls button {
        flex-shrink: 0;
        min-width: 28px;
    }

    .main-controls button svg {
        width: 18px;
        height: 18px;
    }

    .play-pause-main {
        width: 34px;
        height: 34px;
        flex-shrink: 0;
    }

    .play-pause-main svg {
        width: 22px !important;
        height: 22px !important;
    }

    .progress-row {
        display: none;
    }

    .playback-right {
        display: none;
    }

    .playback-queue-panel {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: calc(100% - 20px);
        max-height: min(62vh, 460px);
        bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    }

    /* Song Table Mobile */
    .song-table {
        width: 100%;
        max-width: 100%;
        table-layout: fixed;
        border-spacing: 0 3px;
        overflow: visible;
    }

    .song-table,
    .song-table tbody,
    .song-row {
        max-width: 100%;
    }

    .song-table th,
    .song-table td {
        padding: 8px 8px;
        font-size: 0.9rem;
    }

    .song-table th:nth-child(1),
    .song-table td:nth-child(1) {
        width: 30px;
        font-size: 0.85rem;
    }

    /* KÃ¼nstler-Spalte auf Mobile ausblenden */
    .song-table th:nth-child(3),
    .song-table td:nth-child(3) {
        display: none;
    }

    .song-table th:nth-child(4),
    .song-table td:nth-child(4) {
        width: 124px;
        min-width: 124px;
        text-align: right;
        padding-left: 4px;
        padding-right: 10px;
        white-space: nowrap;
        overflow: visible;
    }

    .song-table td:nth-child(2),
    .song-title-cell {
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
    }

    .song-row img {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }

    .song-title-cell {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .song-title-cell img {
        flex: 0 0 38px;
    }

    .song-name {
        font-size: 0.95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: none;
        min-width: 0;
        flex: 1 1 auto;
        display: block;
    }

    .song-actions {
        gap: 4px;
        overflow: visible;
    }

    .song-table td:nth-child(4) .favorite-button {
        width: 34px;
        height: 34px;
        min-width: 34px;
        min-height: 34px;
        padding: 0;
        border-radius: 999px;
    }

    .song-table td:nth-child(4) .favorite-button svg,
    .song-table td:nth-child(4) .favorite-button .material-symbols-outlined {
        width: 20px;
        height: 20px;
        font-size: 20px;
        line-height: 20px;
        display: block;
    }

    /* Controls: Suchleiste + Mood nebeneinander */
    .content-controls {
        display: flex;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .search-bar {
        flex: 1;
        min-height: 44px;
        padding: 0 12px;
    }

    .search-bar input {
        font-size: 0.9rem;
    }

    .mood-filter {
        flex-shrink: 0;
    }

    .mood-filter-toggle {
        height: 38px;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .mood-filter .app-native-dropdown {
        min-width: 104px;
        width: 104px;
    }

    .mood-filter .app-native-dropdown-toggle {
        height: 38px;
        font-size: 0.9rem;
    }

    .mood-filter-menu {
        right: 0;
        left: auto;
        min-width: 180px;
    }

    .song-count {
        font-size: 0.85rem;
    }

    /* Pagination Mobile */
    .pagination-controls {
        max-width: 100%;
        gap: 6px;
    }

    .pagination-btn {
        font-size: 0.9rem;
        padding: 8px 12px;
        height: 36px;
    }

    .pagination-label {
        font-size: 0.9rem;
        min-width: 80px;
        padding: 6px 10px;
    }

    /* Mobile Header */
    .mobile-header {
        padding: 8px 12px;
        padding-top: calc(env(safe-area-inset-top, 0px) + 10px);
        border-bottom-left-radius: 1em;
        border-bottom-right-radius: 1em;
    }

    .mobile-logo {
        font-size: 1.4rem;
    }

    .mobile-logo img {
        width: 36px;
        height: 36px;
    }

    /* Popups bleiben auch mobile als zentrierte Cards */
    #playlistPopup {
        width: min(94vw, 760px);
        max-height: 82vh;
        border-radius: var(--border-radius);
    }

    #songPopup {
        width: calc(100% - 20px);
        height: calc(100svh - 24px - env(safe-area-inset-bottom, 0px));
        max-height: calc(100svh - 24px - env(safe-area-inset-bottom, 0px));
        left: 10px;
        right: 10px;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        transform: none;
        border-radius: 20px;
        padding:
            max(48px, calc(env(safe-area-inset-top, 0px) + 28px))
            18px
            max(22px, calc(env(safe-area-inset-bottom, 0px) + 18px));
        animation: songPopupPlayerInMobile 0.28s cubic-bezier(0.2, 0.85, 0.2, 1) forwards;
    }

    #songPopupBody {
        display: flex;
        flex-direction: column;
        gap: 0;
        overflow-y: auto;
        padding: 0 1px 0 0;
        overscroll-behavior: contain;
    }

    .song-popup-cover-wrap {
        width: min(42vw, 148px);
        margin-bottom: 10px;
        border-radius: 18px;
    }

    .song-popup-title {
        font-size: 1.38rem;
        line-height: 1.12;
        -webkit-line-clamp: 2;
    }

    .song-popup-artist-name-row .song-popup-artist-name {
        font-size: 1rem;
    }

    .song-popup-artist-meta {
        margin-bottom: 6px;
    }

    .song-popup-artist-mood {
        font-size: 0.86rem;
    }

    .song-popup-upload-date {
        margin-top: 7px;
        font-size: 0.78rem;
        flex-wrap: wrap;
    }

    .song-popup-stats-row {
        margin-top: 8px;
        gap: 7px;
    }

    .song-popup-stat-pill {
        min-height: 28px;
        padding: 0 9px;
        font-size: 0.74rem;
    }

    .song-popup-divider {
        width: 86%;
        height: 1px;
        margin: 14px auto 16px;
    }

    .song-popup-lyrics-content {
        min-height: 150px;
        overflow-y: visible;
        padding: 0 2px;
        font-size: 1.08rem;
        line-height: 1.58;
    }

    .song-popup-progress-block {
        width: 100%;
        margin-top: 8px;
    }

    .song-popup-action-row {
        gap: 10px;
        margin: 7px auto 8px;
    }

    .song-popup-icon-btn {
        width: 44px !important;
        min-width: 44px !important;
        height: 44px;
        min-height: 44px;
        border-radius: 12px;
    }

    .song-popup-icon-btn .material-symbols-outlined {
        font-size: 1.35rem;
    }

    .song-popup-lyrics-toolbar {
        justify-content: center;
        margin-top: 12px;
    }

    #addSongPopup {
        width: min(94vw, 560px) !important;
        max-height: 82vh !important;
        border-radius: var(--border-radius);
    }
}

@media (max-width: 430px) {
    .song-table th,
    .song-table td {
        padding-left: 6px;
        padding-right: 6px;
    }

    .song-table th:nth-child(1),
    .song-table td:nth-child(1) {
        width: 28px;
        padding-left: 4px;
        padding-right: 4px;
    }

    .song-table th:nth-child(4),
    .song-table td:nth-child(4) {
        width: 118px;
        min-width: 118px;
        padding-left: 2px;
        padding-right: 8px;
        overflow: visible;
    }

    .song-row img,
    .song-title-cell img {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .song-title-cell {
        gap: 7px;
    }

    .song-table td:nth-child(4) .favorite-button {
        width: 34px;
        height: 34px;
        min-width: 34px;
        min-height: 34px;
        border-radius: 999px;
    }

    .song-table td:nth-child(4) .favorite-button svg,
    .song-table td:nth-child(4) .favorite-button .material-symbols-outlined {
        width: 20px;
        height: 20px;
        font-size: 20px;
        line-height: 20px;
    }
}

@media (max-width: 980px) {
    #songPopup {
        width: calc(100% - 20px);
        top: max(22px, calc(env(safe-area-inset-top, 0px) + 12px));
        bottom: max(18px, calc(env(safe-area-inset-bottom, 0px) + 14px));
        height: auto;
        max-height: none;
        left: 10px;
        right: 10px;
        transform: none;
        border-radius: 20px;
        padding:
            44px
            20px
            22px;
        animation: songPopupPlayerInMobile 0.28s cubic-bezier(0.2, 0.85, 0.2, 1) forwards;
    }

    #songPopupBody {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        overflow-x: hidden;
        overflow-y: auto;
        min-height: 0;
        padding: 0 1px;
        overscroll-behavior: contain;
    }

    .song-popup-hero {
        flex: 0 0 auto;
        align-items: center;
    }

    .song-popup-cover-wrap {
        width: clamp(160px, 48vw, 220px);
        margin: 0 auto 16px;
        border-radius: 18px;
    }

    .song-popup-title {
        font-size: 1.72rem;
        line-height: 1.12;
        -webkit-line-clamp: 2;
    }

    .song-popup-artist-meta {
        margin: 8px auto 12px;
    }

    .song-popup-artist-name-row .song-popup-artist-name {
        font-size: 1.26rem;
    }

    .song-popup-artist-mood {
        font-size: 1rem;
    }

    .song-popup-upload-date {
        margin-top: 10px;
        font-size: 0.94rem;
        flex-wrap: wrap;
    }

    .song-popup-stats-row {
        margin-top: 10px;
        gap: 8px;
    }

    .song-popup-stat-pill {
        min-height: 32px;
        padding: 0 11px;
        font-size: 0.86rem;
    }

    .song-popup-stat-pill .material-symbols-outlined {
        font-size: 1.08rem;
    }

    .song-popup-action-row {
        gap: 12px;
        margin: 13px auto 13px;
    }

    .song-popup-icon-btn {
        width: 52px !important;
        min-width: 52px !important;
        height: 52px;
        min-height: 52px;
        border-radius: 13px;
    }

    .song-popup-icon-btn .material-symbols-outlined {
        font-size: 1.54rem;
    }

    .song-popup-progress-block {
        width: 100%;
        margin-top: 12px;
    }

    .song-popup-progress-times {
        margin-top: 10px;
        font-size: 1rem;
    }

    .song-popup-divider {
        width: 86%;
        height: 1px;
        margin: 18px auto 18px;
    }

    .song-popup-lyrics-content {
        flex: 0 0 auto;
        min-height: auto;
        max-height: none;
        overflow: visible;
        padding: 12px 12px;
        font-size: 1.22rem;
        line-height: 1.62;
        scrollbar-gutter: auto;
    }

    .song-popup-lyrics-inner {
        min-height: auto;
        justify-content: flex-start;
    }

    .song-popup-lyrics-toolbar {
        position: static;
        flex: 0 0 auto;
        align-self: center;
        width: auto;
        z-index: 3;
        justify-content: center;
        margin: 14px auto 0;
        padding: 0 0 2px;
        background: transparent;
        pointer-events: auto;
    }

    .song-popup-copy-lyrics-btn {
        min-height: 44px;
        padding: 0 16px;
        font-size: 0.96rem;
        margin: 0 auto;
    }
}


/* ========================
   LIGHT MODE OVERRIDES
   ======================== */
[data-theme="light"] body::before {
    filter: blur(80px) brightness(1.0);
    opacity: 0.5;
}

[data-theme="light"] .glass,
[data-theme="light"] .sidebar {
    background: rgba(255, 255, 255, 0.65);
    border-color: var(--color-border);
}

[data-theme="light"] .sidebar-link {
    color: var(--color-text);
}

[data-theme="light"] .sidebar-link:hover,
[data-theme="light"] .sidebar-link.active {
    background: linear-gradient(90deg, var(--color-accent-soft), var(--color-accent-faint));
    box-shadow: inset 0 0 0 1px var(--color-accent-faint);
    color: var(--color-accent);
}

[data-theme="light"] .sidebar-section-title {
    color: var(--color-text-soft);
}

[data-theme="light"] .hero-section {
    background: transparent;
}

[data-theme="light"] .hero-title,
[data-theme="light"] .hero-subtitle,
[data-theme="light"] .hero-description {
    color: var(--color-text);
}

[data-theme="light"] #playlistPopupBackdrop,
[data-theme="light"] #addSongPopupBackdrop,
[data-theme="light"] #songPopupBackdrop,
[data-theme="light"] #addToPlPickerBackdrop,
[data-theme="light"] .theme-picker-backdrop,
[data-theme="light"] #legalPopupBackdrop,
[data-theme="light"] #legalLabelsPopupBackdrop {
    background: rgba(32, 26, 48, 0.2) !important;
}

[data-theme="light"] #songPopupBackdrop {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

[data-theme="light"] #playlistPopup,
[data-theme="light"] #addSongPopup,
[data-theme="light"] #addToPlPicker,
[data-theme="light"] .theme-picker,
[data-theme="light"] #legalPopup,
[data-theme="light"] #legalLabelsPopup {
    background: var(--color-bg-glass) !important;
    border-color: var(--color-border) !important;
    box-shadow: 0 10px 30px rgba(30, 24, 44, 0.12) !important;
}

[data-theme="light"] #legalPopupBackdrop,
[data-theme="light"] #legalLabelsPopupBackdrop {
    background:
        radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--color-accent-light) 18%, transparent), transparent 34%),
        radial-gradient(circle at 82% 80%, color-mix(in srgb, var(--color-accent) 13%, transparent), transparent 38%),
        rgba(245, 244, 252, 0.58) !important;
    backdrop-filter: blur(18px) saturate(135%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(135%) !important;
}

[data-theme="light"] #legalPopup,
[data-theme="light"] #legalLabelsPopup {
    background:
        linear-gradient(145deg, rgba(255,255,255,0.84), rgba(255,255,255,0.52)),
        color-mix(in srgb, var(--color-bg) 80%, var(--color-accent) 20%) !important;
    box-shadow: 0 28px 90px rgba(30, 24, 44, 0.2), inset 0 1px 0 rgba(255,255,255,0.86) !important;
}

[data-theme="light"] .theme-picker-backdrop {
    background:
        radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--color-accent-light) 18%, transparent), transparent 34%),
        radial-gradient(circle at 82% 80%, color-mix(in srgb, var(--color-accent) 13%, transparent), transparent 38%),
        rgba(245, 244, 252, 0.58) !important;
    backdrop-filter: blur(18px) saturate(135%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(135%) !important;
}

[data-theme="light"] .theme-picker,
[data-theme="light"] .custom-theme-creator {
    background:
        linear-gradient(145deg, rgba(255,255,255,0.84), rgba(255,255,255,0.52)),
        color-mix(in srgb, var(--color-bg) 80%, var(--color-accent) 20%) !important;
    box-shadow: 0 28px 90px rgba(30, 24, 44, 0.2), inset 0 1px 0 rgba(255,255,255,0.86) !important;
}

[data-theme="light"] .theme-picker-header,
[data-theme="light"] .custom-theme-creator-header {
    background: linear-gradient(180deg, rgba(255,255,255,0.68), rgba(255,255,255,0.24)) !important;
    border-bottom-color: rgba(30, 24, 44, 0.12) !important;
}

[data-theme="light"] .theme-card,
[data-theme="light"] .custom-theme-preview-panel,
[data-theme="light"] .custom-theme-step {
    border-color: rgba(30, 24, 44, 0.12) !important;
}

[data-theme="light"] .theme-card {
    background: rgba(255,255,255,0.58) !important;
}

[data-theme="light"] .custom-theme-preview-panel,
[data-theme="light"] .custom-theme-step {
    background: rgba(255,255,255,0.58) !important;
}

[data-theme="light"] .theme-dot {
    border-color: rgba(30, 24, 44, 0.18);
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.76),
        0 4px 10px rgba(30, 24, 44, 0.12);
}

[data-theme="light"] #songPopup {
    --song-popup-glow-a: color-mix(in srgb, var(--color-glow-1) 18%, transparent);
    --song-popup-glow-b: color-mix(in srgb, var(--color-glow-2) 16%, transparent);
    --song-popup-glow-c: color-mix(in srgb, var(--color-accent-light) 12%, transparent);
    --song-popup-panel-top: color-mix(in srgb, var(--color-bg) 82%, var(--color-accent) 18%);
    --song-popup-panel-bottom: color-mix(in srgb, var(--color-bg) 86%, var(--color-accent-light) 14%);
    --song-popup-surface: color-mix(in srgb, var(--color-bg) 84%, var(--color-accent) 16%);
    box-shadow:
        0 24px 58px rgba(30, 24, 44, 0.18),
        0 0 30px color-mix(in srgb, var(--color-accent) 14%, transparent),
        inset 0 1px 0 rgba(255,255,255,0.5) !important;
}

:root[data-theme-id="pride"] #songPopup {
    --song-popup-button-bg: var(--color-rainbow-gradient);
    --song-popup-progress-bg: var(--color-rainbow-gradient);
    --song-popup-glow-a: color-mix(in srgb, var(--color-pride-red) 22%, transparent);
    --song-popup-glow-b: color-mix(in srgb, var(--color-pride-blue) 20%, transparent);
    --song-popup-glow-c: color-mix(in srgb, var(--color-pride-yellow) 14%, transparent);
    --song-popup-panel-top: color-mix(in srgb, var(--color-bg) 76%, var(--color-pride-violet) 24%);
    --song-popup-panel-bottom: color-mix(in srgb, var(--color-bg) 82%, var(--color-pride-blue) 18%);
    --song-popup-surface: color-mix(in srgb, var(--color-bg) 82%, var(--color-pride-violet) 18%);
}

[data-theme="light"] .song-popup-lyrics-content {
    color: var(--color-text);
}

[data-theme="light"] .song-popup-title {
    color: var(--color-text);
}

[data-theme="light"] .song-popup-artist-meta,
[data-theme="light"] .song-popup-progress-times {
    color: var(--color-text-soft);
}

[data-theme="light"] .song-popup-artist-mood,
[data-theme="light"] .song-popup-artist-mood.is-subtle,
[data-theme="light"] .song-popup-upload-date {
    color: var(--color-text-soft);
}

[data-theme="light"] .song-popup-divider {
    background: rgba(0,0,0,0.12);
}

[data-theme="light"] .song-popup-copy-lyrics-btn {
    background: rgba(0,0,0,0.045);
    border-color: rgba(0,0,0,0.1);
    color: var(--color-text-soft);
}

[data-theme="light"] .song-popup-copy-lyrics-btn:hover {
    background: rgba(0,0,0,0.075);
    border-color: rgba(0,0,0,0.16);
    color: var(--color-text);
}

[data-theme="light"] .playlist-style-default-toggle input {
    border-color: rgba(0,0,0,0.22);
    background: rgba(0,0,0,0.05);
}

[data-theme="light"] .playlist-style-default-toggle:hover input {
    border-color: rgba(124,58,237,0.5);
    background: rgba(124,58,237,0.12);
}

[data-theme="light"] .app-dialog-backdrop {
    background: rgba(32, 26, 48, 0.2);
}

[data-theme="light"] #accountBanLockOverlay {
    background: rgba(246, 241, 245, 0.8);
}

[data-theme="light"] #accountBanLockOverlay::before {
    background:
        linear-gradient(180deg, rgba(200, 70, 70, 0.09), rgba(200, 70, 70, 0) 34%),
        linear-gradient(140deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0) 45%);
}

[data-theme="light"] .account-ban-lock-card {
    background: rgba(255, 252, 253, 0.94) !important;
    border-color: rgba(200, 70, 70, 0.34);
    box-shadow: 0 10px 30px rgba(42, 30, 44, 0.14) !important;
}

[data-theme="light"] .account-ban-lock-title {
    color: #8e2020;
}

[data-theme="light"] .account-ban-lock-text {
    color: #6a2b2b;
}

[data-theme="light"] .account-ban-lock-meta {
    color: #704848;
}

[data-theme="light"] .app-mini-toast {
    background: rgba(255,255,255,0.92);
    border-color: var(--color-border);
    color: var(--color-text);
    box-shadow: 0 8px 20px rgba(30, 24, 44, 0.14);
}

[data-theme="light"] .app-dialog-card {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: var(--color-border) !important;
    box-shadow: 0 10px 30px rgba(30, 24, 44, 0.12) !important;
}

[data-theme="light"] .app-dialog-header,
[data-theme="light"] .app-dialog-actions {
    border-color: rgba(0,0,0,0.06);
}

[data-theme="light"] .app-dialog-close {
    background: rgba(0,0,0,0.05);
    color: var(--color-text-soft);
}

[data-theme="light"] .app-dialog-close:hover {
    background: rgba(0,0,0,0.08);
    color: var(--color-text);
}

[data-theme="light"] .app-dialog-input {
    background: rgba(0,0,0,0.04);
    border-color: var(--color-border);
    color: var(--color-text);
}

[data-theme="light"] .app-dialog-btn-secondary {
    background: rgba(0,0,0,0.05);
    color: var(--color-text);
}

[data-theme="light"] .app-dialog-btn-secondary:hover {
    background: rgba(0,0,0,0.08);
}

[data-theme="light"] .hero-subtitle {
    color: var(--color-text-soft);
}

[data-theme="light"] .search-bar,
[data-theme="light"] .charts-filter,
[data-theme="light"] .timeline-search {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(20, 24, 36, 0.12);
    color: var(--color-text);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.78), 0 10px 28px rgba(20,24,36,0.06);
}

[data-theme="light"] .search-bar:focus-within,
[data-theme="light"] .timeline-search:focus-within {
    border-color: rgba(20,24,36,0.2);
    background: rgba(255,255,255,0.86);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 0 0 3px rgba(20,24,36,0.045);
}

[data-theme="light"] .search-bar input,
[data-theme="light"] .timeline-search input {
    color: var(--color-text);
}

[data-theme="light"] .search-bar input::placeholder,
[data-theme="light"] .timeline-search input::placeholder {
    color: var(--color-text-soft);
}

[data-theme="light"] .search-bar .material-symbols-outlined,
[data-theme="light"] .timeline-search > .material-symbols-outlined {
    color: var(--color-text-soft);
}

[data-theme="light"] .home-feed-post-composer,
[data-theme="light"] .home-feed-item {
    border-color: rgba(20, 24, 36, 0.12);
    background:
        radial-gradient(circle at 12% 0%, rgba(255,255,255,0.72), transparent 34%),
        linear-gradient(145deg, rgba(255,255,255,0.76), rgba(245,248,255,0.5)),
        rgba(255,255,255,0.58);
    box-shadow: 0 18px 44px rgba(20,24,36,0.1), inset 0 1px 0 rgba(255,255,255,0.8);
}

[data-theme="light"] .home-feed-post-form textarea,
[data-theme="light"] .home-feed-comment-form textarea {
    border-color: rgba(20,24,36,0.12);
    background: rgba(255,255,255,0.72);
    color: rgba(20,24,36,0.92);
}

[data-theme="light"] .home-feed-title,
[data-theme="light"] .home-feed-text,
[data-theme="light"] .home-feed-comment-body,
[data-theme="light"] .home-feed-image-picker,
[data-theme="light"] .home-feed-post-submit,
[data-theme="light"] .home-feed-icon-btn {
    color: rgba(20,24,36,0.92);
}

[data-theme="light"] .home-feed-meta,
[data-theme="light"] .home-feed-comment-meta {
    color: rgba(20,24,36,0.62);
}

[data-theme="light"] .home-feed-type-badge,
[data-theme="light"] .home-feed-image-picker,
[data-theme="light"] .home-feed-post-submit,
[data-theme="light"] .home-feed-icon-btn,
[data-theme="light"] .home-feed-post-image-btn,
[data-theme="light"] .home-feed-comment,
[data-theme="light"] .home-feed-comment-empty {
    border-color: rgba(20,24,36,0.12);
    background: rgba(255,255,255,0.55);
}

[data-theme="light"] .home-feed-post-image-btn {
    border: 0;
    background: transparent;
    box-shadow: none;
}

[data-theme="light"] .home-feed-post-image-btn:hover {
    background: transparent;
}

[data-theme="light"] .timeline-image-viewer-card {
    background: rgba(255, 255, 255, 0.96) !important;
}

[data-theme="light"] .song-table td {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .song-table tr:hover td {
    background: rgba(124, 58, 237, 0.06);
}

[data-theme="light"] .song-row.playing td {
    background: rgba(124, 58, 237, 0.1);
}

[data-theme="light"] .song-table th {
    color: var(--color-text-soft);
    border-bottom-color: var(--color-border);
}

[data-theme="light"] .song-title {
    color: var(--color-text);
}

[data-theme="light"] .artist-button {
    color: var(--color-text-soft);
}

[data-theme="light"] .artist-button:hover {
    color: var(--color-accent);
}


[data-theme="light"] .playback-menu .song-info-title,
[data-theme="light"] .playback-menu .current-time,
[data-theme="light"] .playback-menu .total-time {
    color: var(--color-text);
}

[data-theme="light"] .playback-menu .song-info-artist {
    color: var(--color-text-soft);
}

[data-theme="light"] .playback-menu button {
    color: var(--color-text);
    background: none;
}

[data-theme="light"] .playback-menu button svg {
    fill: var(--color-text);
}

[data-theme="light"] .playback-controls button:hover {
    color: var(--color-accent);
}

[data-theme="light"] .playback-controls button:hover svg {
    fill: var(--color-accent);
}

[data-theme="light"] .progress-bar {
    background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] #volumeSlider {
    background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] #volumeSlider:hover {
    background: rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .playback-queue-panel {
    background: rgba(255,255,255,0.92);
    border-color: var(--color-border);
    box-shadow: 0 14px 30px rgba(30,24,44,0.14);
}

[data-theme="light"] .playback-queue-item {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.08);
}

[data-theme="light"] .playback-queue-action-btn,
[data-theme="light"] .playback-queue-clear-btn,
[data-theme="light"] .playback-queue-close-btn {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.12);
    color: var(--color-text);
}

[data-theme="light"] .filter-button {
    background: rgba(0, 0, 0, 0.05);
    border-color: var(--color-border);
    color: var(--color-text);
}

[data-theme="light"] .filter-button:hover {
    background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .category-dropdown {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--color-border);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .category-dropdown label {
    color: var(--color-text);
}

[data-theme="light"] .category-dropdown label:hover {
    background: rgba(124, 58, 237, 0.06);
}

[data-theme="light"] .popup-backdrop .popup-box,
[data-theme="light"] .add-to-pl-popup {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--color-border);
    color: var(--color-text);
}

[data-theme="light"] .add-to-pl-item {
    border-color: var(--color-border);
    color: var(--color-text);
}

[data-theme="light"] .add-to-pl-item:hover {
    background: rgba(124, 58, 237, 0.06);
}

[data-theme="light"] .theme-card {
    border-color: var(--color-border);
}

[data-theme="light"] .theme-card:hover {
    border-color: rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .theme-card-icon-btn,
[data-theme="light"] .custom-theme-open-btn,
[data-theme="light"] .custom-theme-field input[type="text"],
[data-theme="light"] .custom-theme-field select,
[data-theme="light"] .custom-theme-color-field input[type="color"],
[data-theme="light"] .custom-theme-reset,
[data-theme="light"] .theme-empty-state,
[data-theme="light"] .custom-theme-status {
    background: rgba(255,255,255,0.78);
}

[data-theme="light"] .custom-theme-open-btn {
    color: var(--color-text);
    border-color: rgba(30, 24, 44, 0.14);
    background: rgba(255,255,255,0.66) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.78);
    backdrop-filter: blur(18px) saturate(130%);
    -webkit-backdrop-filter: blur(18px) saturate(130%);
}

[data-theme="light"] .custom-theme-open-btn:hover {
    color: var(--color-text);
    background: rgba(255,255,255,0.86) !important;
    border-color: rgba(30, 24, 44, 0.22);
}

[data-theme="light"] .custom-theme-creator {
    background: rgba(255,255,255,0.92);
}

[data-theme="light"] .custom-theme-creator-header {
    border-bottom-color: var(--color-border);
}

[data-theme="light"] .theme-card-delete {
    color: var(--color-text-soft);
}

[data-theme="light"] .theme-card-edit {
    color: var(--color-text-soft);
}

[data-theme="light"] .sidebar-bottom a,
[data-theme="light"] .sidebar-bottom button {
    color: var(--color-text-soft);
}

[data-theme="light"] .sidebar-bottom a:hover,
[data-theme="light"] .sidebar-bottom button:hover {
    color: var(--color-accent);
}


[data-theme="light"] .mobile-nav-bar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    border-color: var(--color-border);
}

[data-theme="light"] .mobile-nav-bar a {
    color: var(--color-text-soft);
}

[data-theme="light"] .mobile-nav-bar a.active {
    color: var(--color-accent);
}

[data-theme="light"] .hero-btn-secondary {
    background: rgba(0, 0, 0, 0.06);
    color: var(--color-text);
}

[data-theme="light"] #followPlaylistBtn.active {
    background: rgba(124, 58, 237, 0.10);
    border-color: rgba(124, 58, 237, 0.28);
    color: var(--color-accent);
}

[data-theme="light"] .favorite-button {
    color: var(--color-text-soft) !important;
}

[data-theme="light"] .favorite-button svg {
    fill: var(--color-text-soft) !important;
}

[data-theme="light"] .favorite-button:hover {
    color: var(--color-accent) !important;
}

[data-theme="light"] .favorite-button:hover svg {
    fill: var(--color-accent) !important;
}

[data-theme="light"] .favorite-button.active {
    color: var(--color-accent) !important;
}

[data-theme="light"] .favorite-button.active svg {
    fill: var(--color-accent) !important;
}

.content-controls.artist-discovery-controls-active {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
}

.content-controls.artist-discovery-controls-active .artist-discovery-switcher {
    order: 0;
    margin: 0 auto;
}

.content-controls.artist-discovery-controls-active .search-bar {
    order: 1;
    box-sizing: border-box !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
}

.content-controls.artist-discovery-controls-active .search-bar input {
    min-width: 0 !important;
}

.content-controls.album-discovery-controls-active {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
}

.content-controls.album-discovery-controls-active .album-discovery-toolbar {
    order: 0;
    margin: 0 auto;
    padding: 0;
}

.content-controls.album-discovery-controls-active .search-bar {
    order: 1;
    box-sizing: border-box !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
}

.content-controls.album-discovery-controls-active .search-bar input {
    min-width: 0 !important;
}

[data-theme="light"] .add-to-pl-btn {
    color: var(--color-text-soft);
}

[data-theme="light"] .add-to-pl-btn:hover {
    color: var(--color-accent);
}

[data-theme="light"] .option-controls {
    background: rgba(0, 0, 0, 0.05);
    border-color: var(--color-border);
    color: var(--color-text);
}

[data-theme="light"] .option-controls:hover {
    background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .song-row td:nth-child(1) {
    color: var(--color-text-soft);
}

@media (hover: none), (pointer: coarse) {
    .favorite-button:hover {
        background: none !important;
        color: var(--color-text-soft);
        transform: none;
    }

    .favorite-button:hover svg {
        fill: var(--color-text-soft);
    }

    .favorite-button.active:hover {
        color: var(--color-accent-light);
    }

    .favorite-button.active:hover svg {
        fill: var(--color-accent-light);
        filter: drop-shadow(0 0 5px var(--color-accent-light));
    }

    .song-actions-cell .song-favorite-btn:hover {
        transform: none;
        background: rgba(255,255,255,0.04) !important;
        box-shadow: 0 0 0 1px rgba(255,255,255,0.12), 0 6px 12px rgba(0,0,0,0.14) !important;
    }

    [data-theme="light"] .favorite-button:hover {
        color: var(--color-text-soft) !important;
    }

    [data-theme="light"] .favorite-button:hover svg {
        fill: var(--color-text-soft) !important;
    }

    [data-theme="light"] .favorite-button.active:hover {
        color: var(--color-accent) !important;
    }

    [data-theme="light"] .favorite-button.active:hover svg {
        fill: var(--color-accent) !important;
        filter: none;
    }
}

/* Account Section Redesign */
.auth-tab-container {
    gap: 16px;
    margin-top: 10px;
    min-height: 68vh;
}

.auth-tab-container .auth-tab-toolbar {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    width: 100%;
    text-align: center;
}

.auth-tab-container .auth-tab-title-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    font-family: 'Kanit', sans-serif;
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.auth-tab-container .auth-tab-title-wrap .material-symbols-outlined {
    font-size: 1.9rem;
    opacity: 0.9;
}

.auth-cards-row {
    grid-template-columns: minmax(0, 1040px);
    justify-content: center;
    gap: 16px;
}

.auth-cards-row.is-guest-mode {
    grid-template-columns: minmax(0, 620px);
    min-height: min(76vh, 760px);
    align-content: center;
}

.auth-native-card {
    max-width: none;
    width: 100%;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(6, 8, 20, 0.28);
    box-shadow: none;
    padding: 18px;
    gap: 14px;
}

.auth-native-card.is-guest-mode #authGuestView .auth-native-form {
    width: min(540px, 100%);
    margin-inline: auto;
}

.auth-native-card.is-guest-mode {
    max-width: 620px;
    margin-inline: auto;
}

.auth-native-title {
    font-size: 1.32rem;
    line-height: 1.2;
}

.auth-native-subtitle {
    margin-top: -2px;
    font-size: 0.92rem;
    color: rgba(255,255,255,0.74);
}

.auth-native-status {
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(0,0,0,0.24);
}

.auth-native-mode {
    width: fit-content;
    min-height: 44px;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.04);
    gap: 4px;
    margin-inline: auto;
    justify-self: center;
}

.auth-native-mode button {
    min-height: 36px;
    padding: 7px 14px;
    font-size: 0.88rem;
    font-weight: 700;
}

.auth-native-mode button.active {
    background: rgba(255,255,255,0.2);
    color: #fff;
    box-shadow: none;
}

#authGuestView,
#authProfileView {
    display: grid;
    gap: 14px;
}

#authGuestView .auth-native-form,
#authProfileView > .auth-native-form,
#authProfileView > .auth-public-profile {
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
}

.auth-native-grid {
    gap: 10px;
}

.auth-native-field {
    gap: 5px;
}

.auth-native-field label {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.72);
}

.auth-native-field input[type="text"],
.auth-native-field input[type="password"],
.auth-native-field input[type="file"],
.auth-native-field textarea {
    border-radius: 11px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
    min-height: 42px;
    padding: 10px 12px;
}

.auth-native-field textarea {
    min-height: 96px;
}

.auth-native-field input[type="text"]:focus,
.auth-native-field input[type="password"]:focus,
.auth-native-field input[type="file"]:focus,
.auth-native-field textarea:focus {
    border-color: rgba(255,255,255,0.34);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.08);
}

.auth-native-checkbox {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.78);
}

.auth-native-checkbox a {
    color: rgba(192, 151, 223, 0.95);
}

#authRegisterForm .auth-native-checkbox {
    justify-content: center;
}

.auth-native-actions {
    gap: 8px;
}

#authGuestView .auth-native-actions {
    justify-content: center;
}

.auth-native-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    min-height: 40px;
    padding: 9px 14px;
    font-size: 0.88rem;
    background: linear-gradient(135deg, rgba(178, 116, 214, 0.95), rgba(152, 102, 198, 0.95));
    border-color: rgba(211, 172, 234, 0.45);
    box-shadow: none;
}

#authGuestView .auth-native-actions button {
    width: auto;
    min-width: 180px;
}

.auth-native-actions button:hover:not(:disabled) {
    transform: none;
    filter: brightness(1.03);
    box-shadow: none;
}

.auth-native-actions button.secondary {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.16);
}

#authLogoutBtn,
#authDeleteBtn,
#authPublicSaveBtn,
#authPublicSubmitBtn,
#authPublicTakeDownBtn {
    box-shadow: none !important;
    transform: none !important;
}

.auth-native-profile {
    gap: 14px;
}

.auth-native-profile-header {
    display: grid;
    grid-template-columns: 146px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.auth-profile-overview-media {
    width: 146px;
    flex: 0 0 146px;
}

.auth-profile-overview-preview,
.auth-public-profile-preview-wrap {
    width: 146px;
    height: 146px;
    border-radius: 14px;
}

.auth-profile-overview-image-actions {
    width: 146px;
}

.auth-profile-overview-main {
    gap: 8px;
}

.auth-profile-overview-topline {
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
}

.auth-native-user {
    font-size: 1.2rem;
    line-height: 1.2;
}

.auth-profile-handle {
    margin-top: 0;
    color: rgba(192, 151, 223, 0.95);
}

.auth-profile-user-id {
    margin-top: 0;
}

.auth-public-status-badge {
    width: auto;
    min-width: 0;
    height: 28px;
    border-radius: 999px;
    padding: 0 10px;
}

.auth-public-status-badge .material-symbols-outlined {
    font-size: 16px;
}

.auth-public-profile {
    margin-top: 2px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.12);
}

.auth-public-profile-grid {
    grid-template-columns: 146px minmax(0, 1fr);
    gap: 14px;
}

.auth-public-profile-image-col {
    gap: 10px;
}

.auth-public-profile-main-actions {
    justify-content: flex-start !important;
}

.auth-public-profile-main-actions button {
    min-width: 170px;
}

.auth-public-lock-note {
    border-radius: 12px;
    border-color: rgba(255,255,255,0.16);
    background: rgba(0,0,0,0.2);
    text-align: center;
}

@media (max-width: 980px) {
    .auth-cards-row {
        grid-template-columns: minmax(0, 1fr);
        justify-content: stretch;
    }

    .auth-cards-row.is-guest-mode {
        grid-template-columns: minmax(0, 560px);
        min-height: 66vh;
        justify-content: center;
    }

    .auth-tab-container .auth-tab-title-wrap {
        font-size: 1.56rem;
    }

    .auth-native-card {
        padding: 14px;
    }

    .auth-native-profile-header {
        grid-template-columns: 1fr;
    }

    .auth-profile-overview-media,
    .auth-profile-overview-preview,
    .auth-public-profile-preview-wrap,
    .auth-profile-overview-image-actions {
        width: 136px;
    }

    .auth-profile-overview-preview,
    .auth-public-profile-preview-wrap {
        height: 136px;
    }

    .auth-public-profile-grid {
        grid-template-columns: 1fr;
    }

    .auth-public-profile-image-col {
        justify-items: center;
    }

    .auth-public-profile-main-actions {
        justify-content: center !important;
    }

    .auth-public-profile-main-actions button {
        min-width: min(220px, 100%);
    }
}

@media (max-width: 640px) {
    .auth-tab-container .auth-tab-title-wrap {
        font-size: 1.34rem;
    }

    .auth-native-mode {
        width: 100%;
    }

    .auth-native-mode button {
        flex: 1;
    }

    .auth-native-grid {
        grid-template-columns: 1fr;
    }

    .auth-native-actions button,
    .auth-profile-actions-row button {
        width: 100%;
        min-width: 0;
    }

    .auth-cards-row.is-guest-mode {
        grid-template-columns: minmax(0, 1fr);
        min-height: 60vh;
    }

    .auth-native-card.is-guest-mode #authGuestView .auth-native-form {
        width: 100%;
    }
}

/* Account area polish: roomier profile layout without making the page feel like stacked cards. */
.auth-cards-row.is-profile-mode {
    grid-template-columns: minmax(0, 920px);
    justify-content: center;
}

.auth-native-card.is-profile-mode {
    width: min(100%, 920px);
    max-width: 920px;
    gap: 20px;
    padding: clamp(18px, 2.2vw, 26px);
}

.auth-native-card.is-profile-mode #authProfileView {
    gap: 20px;
}

.auth-native-card.is-profile-mode .auth-native-profile-header {
    grid-template-columns: 168px minmax(0, 1fr);
    gap: clamp(18px, 2.5vw, 28px);
    align-items: center;
}

.auth-native-card.is-profile-mode .auth-profile-overview-media,
.auth-native-card.is-profile-mode .auth-profile-overview-image-actions {
    width: 168px;
}

.auth-native-card.is-profile-mode .auth-profile-overview-preview,
.auth-native-card.is-profile-mode .auth-public-profile-preview-wrap {
    width: 168px;
    height: 168px;
}

.auth-native-card.is-profile-mode .auth-profile-overview-main {
    gap: 11px;
}

.auth-native-card.is-profile-mode .auth-native-user {
    font-size: clamp(1.28rem, 1.05rem + 0.7vw, 1.68rem);
}

.auth-native-card.is-profile-mode .auth-public-profile-subtitle {
    max-width: 60ch;
}

.auth-native-card.is-profile-mode #authPasswordForm,
.auth-native-card.is-profile-mode .auth-public-profile {
    padding-top: 18px !important;
    border-top: 1px solid rgba(255,255,255,0.12) !important;
}

.auth-native-card.is-profile-mode #authPasswordForm {
    gap: 14px;
}

.auth-native-card.is-profile-mode .auth-profile-actions-row,
.auth-native-card.is-profile-mode .auth-public-profile-main-actions {
    justify-content: flex-start !important;
}

.auth-native-card.is-profile-mode .auth-profile-actions-row button,
.auth-native-card.is-profile-mode .auth-public-profile-main-actions button {
    min-width: 164px;
}

@media (max-width: 980px) {
    .auth-cards-row.is-profile-mode {
        grid-template-columns: minmax(0, 1fr);
    }

    .auth-native-card.is-profile-mode {
        max-width: 100%;
    }

    .auth-native-card.is-profile-mode .auth-native-profile-header {
        grid-template-columns: 150px minmax(0, 1fr);
        gap: 16px;
    }

    .auth-native-card.is-profile-mode .auth-profile-overview-media,
    .auth-native-card.is-profile-mode .auth-profile-overview-image-actions {
        width: 150px;
    }

    .auth-native-card.is-profile-mode .auth-profile-overview-preview,
    .auth-native-card.is-profile-mode .auth-public-profile-preview-wrap {
        width: 150px;
        height: 150px;
    }
}

@media (max-width: 700px) {
    .podcast-discovery-hero {
        align-items: stretch;
        flex-direction: column;
        padding: 18px;
    }

    .podcast-request-btn {
        justify-content: center;
        width: 100%;
    }

    .podcast-card-grid,
    .podcast-continue-list {
        grid-template-columns: 1fr;
    }

    .podcast-card {
        grid-template-columns: 78px minmax(0,1fr);
        padding: 12px;
    }

    .podcast-detail-head,
    .podcast-player-hero {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .podcast-detail-head img,
    .podcast-player-hero img {
        width: min(220px, 70vw);
        justify-self: center;
    }

    .podcast-player-hero {
        padding-right: 0;
    }

    .podcast-episode-card {
        grid-template-columns: 58px minmax(0,1fr);
    }

    .podcast-episode-side {
        grid-column: 1 / -1;
        grid-template-columns: 1fr auto;
        align-items: center;
        justify-items: start;
    }

    .podcast-player-backdrop,
    .podcast-request-backdrop {
        padding: max(14px, env(safe-area-inset-top, 0px)) 12px max(14px, env(safe-area-inset-bottom, 0px));
    }

    .podcast-player,
    .podcast-request-modal {
        max-height: calc(100svh - 28px);
        padding: 18px;
        border-radius: 22px;
    }

    .auth-native-card.is-profile-mode {
        gap: 18px;
        padding: 16px;
    }

    .auth-native-card.is-profile-mode #authProfileView {
        gap: 18px;
    }

    .auth-native-card.is-profile-mode .auth-native-profile-header {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .auth-native-card.is-profile-mode .auth-profile-overview-main,
    .auth-native-card.is-profile-mode .auth-profile-overview-topline {
        width: 100%;
        justify-content: center;
    }

    .auth-native-card.is-profile-mode .auth-profile-handle,
    .auth-native-card.is-profile-mode .auth-profile-user-id,
    .auth-native-card.is-profile-mode .auth-public-profile-subtitle {
        text-align: center;
        margin-inline: auto;
    }

    .auth-native-card.is-profile-mode .auth-profile-actions-row,
    .auth-native-card.is-profile-mode .auth-public-profile-main-actions {
        justify-content: center !important;
    }

    .auth-native-card.is-profile-mode .auth-profile-actions-row button,
    .auth-native-card.is-profile-mode .auth-public-profile-main-actions button {
        width: 100% !important;
        min-width: 0;
    }

}

@media (max-width: 900px) {
    html,
    body {
        height: var(--app-viewport-height) !important;
        min-height: var(--app-viewport-height) !important;
        overflow: hidden !important;
        overscroll-behavior: none !important;
    }

    .main-content {
        position: fixed !important;
        inset: 0 !important;
        height: var(--app-viewport-height) !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .mobile-header,
    .playback-menu {
        position: fixed !important;
        transform: translate3d(0, 0, 0) !important;
        -webkit-transform: translate3d(0, 0, 0) !important;
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }

    .mobile-header {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1200 !important;
    }

    .playback-menu {
        left: 8px !important;
        right: 8px !important;
        bottom: calc(4px + env(safe-area-inset-bottom, 0px)) !important;
        width: calc(100% - 16px) !important;
        z-index: 1100 !important;
    }

    .mobile-overlay {
        position: fixed !important;
        inset: 0 !important;
        height: var(--app-viewport-height) !important;
        z-index: 1250 !important;
        touch-action: none;
        overscroll-behavior: none;
    }

    .sidebar {
        height: var(--app-viewport-height) !important;
        max-height: var(--app-viewport-height) !important;
        z-index: 1300 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
    }
}

@media (max-width: 900px) {
    html.admin-root,
    html.admin-root body.admin-page {
        height: var(--app-viewport-height) !important;
        min-height: var(--app-viewport-height) !important;
        overflow: hidden !important;
        overscroll-behavior: none !important;
        position: relative !important;
        touch-action: manipulation !important;
    }

    html.admin-root body.admin-page {
        -webkit-overflow-scrolling: auto;
    }

    html.admin-root .admin-wrap,
    html.admin-root .wrap {
        min-height: 0;
    }
}

@media (max-width: 900px) {
    .auth-native-card.is-profile-mode .auth-account-profile-panel.auth-native-profile-header {
        grid-template-columns: minmax(0, 1fr) !important;
        justify-items: stretch !important;
    }

    .auth-native-card.is-profile-mode .auth-account-profile-panel .auth-profile-overview-media {
        justify-self: center !important;
    }

    .auth-native-card.is-profile-mode .auth-account-profile-panel .auth-profile-overview-main {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        justify-self: stretch !important;
    }

    .auth-native-card.is-profile-mode .auth-account-profile-panel .auth-profile-overview-main > .auth-native-field {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        justify-self: stretch !important;
    }

    .auth-native-card.is-profile-mode #authPublicDisplayName,
    .auth-native-card.is-profile-mode #authPublicDescription {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
}

/* Account settings redesign */
.auth-cards-row.is-profile-mode {
    grid-template-columns: minmax(0, 1120px);
    justify-content: center;
}

.auth-native-card.is-profile-mode {
    width: min(100%, 1120px);
    max-width: 1120px;
    padding: clamp(18px, 2vw, 28px);
    gap: 18px;
}

.auth-native-card.is-profile-mode #authProfileView {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        "admin"
        "profile"
        "security"
        "discord"
        "public";
    gap: 16px;
}

.auth-account-profile-panel {
    grid-area: profile;
    display: grid !important;
    grid-template-columns: 188px minmax(0, 1fr);
    gap: clamp(18px, 2.2vw, 30px);
    align-items: start;
    padding: clamp(16px, 1.8vw, 22px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 18px;
    background:
        linear-gradient(145deg, rgba(255,255,255,0.10), rgba(255,255,255,0.035) 58%, rgba(255,255,255,0.06)),
        rgba(0,0,0,0.12);
}

.auth-native-card.is-profile-mode .auth-profile-overview-media,
.auth-native-card.is-profile-mode .auth-profile-overview-image-actions {
    width: 188px;
}

.auth-native-card.is-profile-mode .auth-profile-overview-preview,
.auth-native-card.is-profile-mode .auth-public-profile-preview-wrap {
    width: 188px;
    height: 188px;
    border-radius: 18px;
}

.auth-native-card.is-profile-mode .auth-profile-overview-image-actions .auth-public-file-btn {
    min-height: 44px;
}

.auth-native-card.is-profile-mode .auth-profile-overview-main {
    gap: 12px;
    align-self: stretch;
}

.auth-native-card.is-profile-mode .auth-profile-overview-topline {
    gap: 10px;
}

.auth-native-card.is-profile-mode .auth-native-user {
    font-size: clamp(1.45rem, 1.15rem + 0.9vw, 1.95rem);
}

.auth-native-card.is-profile-mode .auth-profile-handle,
.auth-native-card.is-profile-mode .auth-profile-user-id {
    font-size: 0.94rem;
}

.auth-native-card.is-profile-mode .auth-public-description-input {
    min-height: 124px;
}

.auth-access-tools {
    grid-area: admin;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.auth-access-tool-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    background:
        linear-gradient(150deg, rgba(255,255,255,0.075), rgba(255,255,255,0.025)),
        rgba(0,0,0,0.10);
    box-shadow: none;
}

.auth-ai-prompt-entry {
    border-color: rgba(255,255,255,0.12);
}

.auth-admin-panel-copy {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    text-align: left;
}

.auth-admin-panel-copy > .material-symbols-outlined {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.07);
    color: #fff;
    font-size: 1.65rem;
}

.auth-admin-panel-copy strong {
    display: block;
    font-family: 'Kanit', sans-serif;
    font-size: 1.08rem;
    line-height: 1.15;
    color: #fff;
}

.auth-admin-panel-copy p {
    margin: 2px 0 0;
    font-size: 0.9rem;
    line-height: 1.3;
    color: var(--color-text-soft);
}

.auth-admin-panel-link {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 12px;
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-family: 'Kanit', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.auth-admin-panel-link:hover {
    transform: translateY(-1px);
    border-color: rgba(255,255,255,0.28);
    background: rgba(255,255,255,0.13);
}

.auth-admin-panel-link .material-symbols-outlined {
    font-size: 1.05rem;
}

.auth-account-section {
    min-width: 0;
    margin-top: 0 !important;
    padding: 16px !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
    border-radius: 16px !important;
    background:
        linear-gradient(150deg, rgba(255,255,255,0.075), rgba(255,255,255,0.025)),
        rgba(0,0,0,0.10) !important;
}

.auth-account-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.auth-account-section-head h3 {
    margin: 0;
    font-family: 'Kanit', sans-serif;
    font-size: 1.12rem;
    line-height: 1.1;
}

.auth-account-section-head p {
    margin: 4px 0 0;
    font-size: 0.9rem;
    line-height: 1.35;
    color: var(--color-text-soft);
}

.auth-account-public-section {
    grid-area: public;
    display: grid;
    align-content: start;
    gap: 12px;
}

.auth-account-security-section {
    grid-area: security;
    display: grid;
    align-content: start;
    gap: 12px;
}

.auth-account-discord-section {
    grid-area: discord;
    display: grid;
    align-content: start;
    gap: 12px;
}

.auth-discord-panel {
    display: grid;
    gap: 10px;
    justify-items: center;
}

.auth-discord-panel.hidden,
.auth-account-discord-section.hidden,
.auth-discord-linked-card.hidden,
#authDiscordLinkBtn.hidden,
#authDiscordUnlinkBtn.hidden {
    display: none !important;
}

.auth-discord-divider {
    display: grid;
    grid-template-columns: minmax(32px, 1fr) auto minmax(32px, 1fr);
    align-items: center;
    gap: 10px;
    width: min(540px, 100%);
    color: rgba(255,255,255,0.58);
    font-size: 0.82rem;
    font-weight: 700;
}

.auth-discord-divider::before,
.auth-discord-divider::after {
    content: "";
    height: 1px;
    background: rgba(255,255,255,0.12);
}

.auth-discord-actions,
.auth-discord-profile-actions {
    align-items: center;
}

.auth-native-actions .auth-discord-btn {
    min-width: 220px;
}

.auth-native-actions button .material-symbols-outlined {
    font-size: 19px;
    line-height: 1;
}

.auth-discord-linked-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    width: min(100%, 420px);
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
}

.auth-discord-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255,255,255,0.08);
}

.auth-discord-avatar.is-empty {
    visibility: hidden;
}

.auth-discord-linked-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.auth-discord-linked-copy strong,
.auth-discord-linked-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-discord-linked-copy span {
    color: rgba(255,255,255,0.66);
    font-size: 0.84rem;
}

.auth-native-card.is-profile-mode .auth-account-public-section .auth-public-crop-hint {
    display: none;
}

.auth-native-card.is-profile-mode .auth-public-profile-main-actions,
.auth-native-card.is-profile-mode .auth-profile-actions-row {
    justify-content: stretch !important;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.auth-native-card.is-profile-mode .auth-public-profile-main-actions button,
.auth-native-card.is-profile-mode .auth-profile-actions-row button {
    width: 100% !important;
    min-width: 0;
    margin: 0;
}

.auth-native-card.is-profile-mode #authDeleteBtn {
    grid-column: 1 / -1;
}

.auth-native-card.is-profile-mode .auth-public-lock-note {
    margin-top: 2px;
    text-align: left;
}

@media (max-width: 900px) {
    .auth-native-card.is-profile-mode #authProfileView {
        grid-template-columns: 1fr;
        grid-template-areas:
            "admin"
            "profile"
            "discord"
            "public"
            "security";
        gap: 14px;
    }

    .auth-account-profile-panel {
        grid-template-columns: 150px minmax(0, 1fr);
        gap: 16px;
    }

    .auth-native-card.is-profile-mode .auth-profile-overview-media,
    .auth-native-card.is-profile-mode .auth-profile-overview-image-actions,
    .auth-native-card.is-profile-mode .auth-profile-overview-preview,
    .auth-native-card.is-profile-mode .auth-public-profile-preview-wrap {
        width: 150px;
    }

    .auth-native-card.is-profile-mode .auth-profile-overview-preview,
    .auth-native-card.is-profile-mode .auth-public-profile-preview-wrap {
        height: 150px;
    }
}

@media (max-width: 760px) {
    .auth-native-card.is-profile-mode {
        padding: 14px;
    }

    .auth-account-profile-panel {
        grid-template-columns: 1fr;
        justify-items: stretch;
        text-align: center;
        gap: 18px;
        padding: 16px;
    }

    .auth-native-card.is-profile-mode .auth-profile-overview-media {
        justify-self: center;
    }

    .auth-native-card.is-profile-mode .auth-profile-overview-main,
    .auth-native-card.is-profile-mode .auth-profile-overview-topline {
        width: 100%;
        min-width: 0;
        justify-self: stretch;
        justify-content: center;
    }

    .auth-native-card.is-profile-mode .auth-profile-overview-media,
    .auth-native-card.is-profile-mode .auth-profile-overview-image-actions,
    .auth-native-card.is-profile-mode .auth-profile-overview-preview,
    .auth-native-card.is-profile-mode .auth-public-profile-preview-wrap {
        width: min(190px, 100%);
    }

    .auth-native-card.is-profile-mode .auth-profile-overview-preview,
    .auth-native-card.is-profile-mode .auth-public-profile-preview-wrap {
        height: min(190px, calc(100vw - 88px));
    }

    .auth-native-card.is-profile-mode .auth-profile-overview-main {
        max-width: 100%;
        gap: 14px;
    }

    .auth-native-card.is-profile-mode .auth-profile-overview-main .auth-native-field {
        width: 100%;
        max-width: none;
        text-align: left;
        gap: 9px;
    }

    .auth-native-card.is-profile-mode #authPublicDisplayName,
    .auth-native-card.is-profile-mode #authPublicDescription {
        width: 100%;
        max-width: none;
        box-sizing: border-box;
        border-radius: 15px;
        background: rgba(255,255,255,0.075);
    }

    .auth-native-card.is-profile-mode #authPublicDisplayName {
        min-height: 54px;
        font-size: 1rem;
        padding: 14px 15px;
    }

    .auth-native-card.is-profile-mode #authPublicDescription {
        min-height: 156px;
        font-size: 1rem;
        line-height: 1.45;
        padding: 14px 15px;
    }

    .auth-native-card.is-profile-mode .auth-public-desc-label {
        gap: 8px;
        align-items: center;
        min-height: 24px;
    }

    .auth-native-card.is-profile-mode .auth-public-profile-main-actions,
    .auth-native-card.is-profile-mode .auth-profile-actions-row {
        grid-template-columns: 1fr;
    }

    .auth-access-tool-card {
        align-items: stretch;
        flex-direction: column;
    }

    .auth-admin-panel-link {
        width: 100%;
    }

}

.auth-native-card.is-profile-mode {
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
