:root {
    --bg: #0d0d14;
    --bg2: #12121e;
    --bg3: #1a1a2e;
    --card: #16162a;
    --card2: #1e1e35;
    --border: rgba(255, 255, 255, 0.06);
    --accent: #8b5cf6;
    --accent2: #a78bfa;
    --pink: #ec4899;
    --text: #f0f0ff;
    --muted: #7070a0;
    --muted2: #4a4a70;
    --glow: rgba(139, 92, 246, 0.35);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "DM Sans", sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    display: grid;
    grid-template-rows: 1fr;
    overflow: hidden;
    user-select: none;
}

/* ── MAIN LAYOUT ── */
.app {
    display: grid;
    grid-template-columns: 210px 1fr 400px;
    overflow: hidden;
}

/* ── SIDEBAR ── */
.sidebar {
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    overflow-y: auto;
    scrollbar-width: none;
}
.sidebar::-webkit-scrollbar {
    display: none;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 22px;
    font-family: "Syne", sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.logo-icon {
    width: 36px;
    height: 36px;
    overflow: hidden;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #050615;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 0 18px rgba(197, 76, 255, 0.22);
}

.logo-icon img,
.logo-icon svg {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

nav {
    padding: 0 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 400;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.18s;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: var(--card2);
    color: var(--text);
}
.nav-item.active {
    background: linear-gradient(
        135deg,
        rgba(139, 92, 246, 0.25),
        rgba(139, 92, 246, 0.1)
    );
    color: var(--text);
    font-weight: 500;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.nav-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.nav-section {
    font-family: "Syne", sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted2);
    padding: 14px 22px 6px;
}

.sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 12px 16px;
}

.playlist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.18s;
    margin-bottom: 2px;
}

.playlist-item:hover {
    background: var(--card2);
}

.playlist-thumb {
    width: 36px;
    height: 36px;
    border-radius: 7px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--card2);
}

.playlist-img {
    width: 36px;
    height: 36px;
    border-radius: 7px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #1a1a3e, #2d2d5e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    overflow: hidden;
}

.playlist-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playlist-info {
    overflow: hidden;
}
.playlist-name {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.playlist-count {
    font-size: 11px;
    color: var(--muted);
}

.premium-card {
    margin: 14px 10px 0;
    background: linear-gradient(
        135deg,
        rgba(139, 92, 246, 0.15),
        rgba(236, 72, 153, 0.1)
    );
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 14px;
    padding: 14px;
}

.premium-card-title {
    font-family: "Syne", sans-serif;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.crown {
    font-size: 14px;
}

.premium-card-text {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 12px;
}

.btn-premium {
    width: 100%;
    padding: 9px;
    background: linear-gradient(135deg, var(--accent), var(--pink));
    border: none;
    border-radius: 8px;
    color: white;
    font-family: "DM Sans", sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn-premium:hover {
    opacity: 0.88;
}

/* ── CENTER ── */
.center {
    background: var(--bg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#homeView,
#searchView,
#favoritesView,
#playlistsView,
#cloudView,
#downloadsView,
#settingsView {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
#homeView,
#playlistsView,
#cloudView,
#settingsView {
    overflow-y: auto;
    scrollbar-width: none;
}
#homeView::-webkit-scrollbar,
#playlistsView::-webkit-scrollbar,
#cloudView::-webkit-scrollbar,
#settingsView::-webkit-scrollbar {
    display: none;
}

/* TOPBAR */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 10;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 9px 14px;
    width: 300px;
    transition: border-color 0.2s;
}

.search-box:focus-within {
    border-color: rgba(139, 92, 246, 0.4);
}
.search-box input {
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    width: 100%;
}
.search-box input::placeholder {
    color: var(--muted2);
}
.search-box svg {
    color: var(--muted);
    flex-shrink: 0;
}

.kbd {
    font-size: 10px;
    color: var(--muted2);
    background: var(--bg3);
    border-radius: 4px;
    padding: 2px 5px;
    margin-left: auto;
}

.search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 1000;
    max-height: 420px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(18, 18, 30, 0.97);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(18px);
    scrollbar-width: thin;
    scrollbar-color: rgba(167, 139, 250, 0.4) transparent;
}

.search-suggestion-group {
    padding: 4px 0;
}

.search-suggestion-group + .search-suggestion-group {
    border-top: 1px solid var(--border);
}

.search-suggestion-group-title {
    padding: 7px 10px 6px;
    color: var(--muted);
    font-family: "Syne", sans-serif;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.search-suggestion-item {
    width: 100%;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-family: "DM Sans", sans-serif;
    text-align: left;
    transition:
        background 0.18s,
        color 0.18s;
}

.search-suggestion-item:hover,
.search-suggestion-item.active {
    background: rgba(139, 92, 246, 0.14);
}

.search-suggestion-cover {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 10px;
    background: linear-gradient(135deg, #1a0a3e, #2d1065);
    color: var(--accent2);
    font-family: "Syne", sans-serif;
    font-size: 16px;
    font-weight: 800;
}

.search-suggestion-cover.artist {
    border-radius: 50%;
}

.search-suggestion-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-suggestion-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" fill="white" xmlns="http://www.w3.org/2000/svg"><path d="M8 5v14l11-7z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    pointer-events: none;
}

.search-suggestion-cover.artist::after {
    display: none;
}

.search-suggestion-item:hover .search-suggestion-cover::after {
    opacity: 1;
}

.search-suggestion-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.search-suggestion-title,
.search-suggestion-subtitle {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-suggestion-title {
    font-size: 13px;
    font-weight: 600;
}

.search-suggestion-subtitle {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11.5px;
}

.search-suggestion-meta {
    color: var(--muted);
    font-size: 11.5px;
    white-space: nowrap;
}

.search-suggestion-message {
    padding: 12px 10px;
    color: var(--muted);
    font-size: 12.5px;
    text-align: center;
}

.nav-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
}

.topbar-quality-select {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 12px;
    padding-left: 14px;
    border-left: 1px solid var(--border);
}

.topbar-quality-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.topbar-quality-options {
    gap: 6px;
}

.topbar-quality-option {
    min-width: 82px;
    padding: 6px 10px;
}

.topbar-quality-option .qname {
    font-size: 11px;
}

.topbar-quality-option .qbps {
    font-size: 9px;
}

.tab {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.18s;
}
.tab:hover {
    color: var(--text);
}
.tab.active {
    color: var(--text);
    border-bottom: 2px solid var(--accent2);
    border-radius: 0;
}

.mobile-only-tab {
    display: none;
}

.topbar-right {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}
.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s;
    color: var(--muted);
    position: relative;
    padding: 0;
    font: inherit;
}
.icon-btn:hover,
.icon-btn.active {
    background: var(--card2);
    color: var(--text);
}
.badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--pink);
    border: 2px solid var(--bg);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
}

.notification-panel {
    position: absolute;
    top: 48px;
    right: 84px;
    width: min(360px, calc(100vw - 32px));
    max-height: 430px;
    display: flex;
    flex-direction: column;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
    overflow: hidden;
    z-index: 100;
}

.notification-panel.hidden {
    display: none;
}

.notification-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid var(--border);
}

.notification-title {
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}

.notification-subtitle {
    color: var(--muted);
    font-size: 11px;
    margin-top: 2px;
}

.notification-clear {
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--muted);
    border-radius: 999px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 10px;
    transition: all 0.18s;
}

.notification-clear:hover {
    color: var(--text);
    background: var(--card2);
}

.notification-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    overflow-y: auto;
}

.notification-item {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.notification-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 92, 246, 0.16);
    color: var(--accent2);
    font-size: 12px;
    font-weight: 900;
}

.notification-item.error .notification-icon {
    background: rgba(239, 68, 68, 0.14);
    color: #f87171;
}

.notification-item.download .notification-icon {
    background: rgba(37, 99, 235, 0.14);
    color: #93c5fd;
}

.notification-item.success .notification-icon {
    background: rgba(16, 185, 129, 0.14);
    color: #34d399;
}

.notification-body {
    min-width: 0;
}

.notification-text {
    color: var(--text);
    font-size: 12px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.notification-time {
    color: var(--muted2);
    font-size: 10px;
    margin-top: 4px;
}

.notification-empty {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
    padding: 18px 12px;
    text-align: center;
}

.avatar {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--pink));
    color: white;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Syne", sans-serif;
    font-weight: 700;
    font-size: 14px;
    transition:
        transform 0.18s,
        box-shadow 0.18s;
}

.avatar:hover,
.avatar.active {
    transform: translateY(-1px);
    box-shadow: 0 0 18px rgba(139, 92, 246, 0.38);
}

.profile-panel {
    position: absolute;
    top: 48px;
    right: 0;
    z-index: 120;
    width: 260px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--bg2);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
}

.profile-panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.profile-panel-header > div:last-child {
    min-width: 0;
}

.profile-avatar-small {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--pink));
    color: white;
    font-family: "Syne", sans-serif;
    font-size: 13px;
    font-weight: 800;
}

.profile-title {
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}

.profile-subtitle {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.3;
}

.profile-provider-select {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 6px;
    margin-top: 12px;
}

.profile-provider-option {
    padding: 8px 9px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    color: var(--muted);
    cursor: pointer;
    font-family: "DM Sans", sans-serif;
    font-size: 11.5px;
    font-weight: 800;
    transition: all 0.18s;
}

.profile-provider-option:hover {
    color: var(--text);
    background: var(--card2);
}

.profile-provider-option.active {
    border-color: rgba(167, 139, 250, 0.45);
    background: rgba(139, 92, 246, 0.16);
    color: var(--text);
}

.profile-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    color: var(--muted);
    font-size: 12px;
}

.profile-status-dot {
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--muted2);
    box-shadow: 0 0 0 4px rgba(74, 74, 112, 0.16);
}

.profile-panel.authenticated .profile-status-dot {
    background: #34d399;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.14);
}

.profile-action {
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--pink));
    color: white;
    cursor: pointer;
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    font-weight: 700;
    transition:
        opacity 0.18s,
        transform 0.18s;
}

.profile-action:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

.profile-action:disabled {
    cursor: wait;
    opacity: 0.65;
}

.profile-panel.authenticated .profile-action {
    border: 1px solid rgba(216, 107, 140, 0.28);
    background: rgba(216, 107, 140, 0.08);
    color: #fb7185;
}

.profile-panel.authenticated .profile-action:hover:not(:disabled) {
    border-color: rgba(216, 107, 140, 0.42);
    background: rgba(216, 107, 140, 0.14);
}

.profile-settings-btn {
    width: 100%;
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.18s;
}

.profile-settings-btn:hover {
    background: var(--card2);
    border-color: var(--muted);
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px 24px 30px 24px;
}

.settings-placeholder-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 600px;
    margin: 40px auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.settings-placeholder-icon {
    font-size: 48px;
    margin-bottom: 20px;
    animation: rotateGear 10s linear infinite;
    display: inline-block;
}

@keyframes rotateGear {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.settings-placeholder-title {
    font-family: "Syne", sans-serif;
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--text);
}

.settings-placeholder-desc {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.5;
    max-width: 400px;
}

.tidal-auth-copy {
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.tidal-auth-link {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--pink));
    color: white;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.tidal-auth-code,
.tidal-auth-pending {
    margin-top: 10px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.tidal-auth-code {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.tidal-auth-code.hidden {
    display: none;
}

.tidal-auth-code-value {
    border: 1px solid rgba(167, 139, 250, 0.32);
    border-radius: 9px;
    background: rgba(139, 92, 246, 0.12);
    color: var(--text);
    cursor: copy;
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 5px 8px;
    user-select: text;
}

.tidal-auth-copy-code {
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--card);
    color: var(--accent2);
    cursor: pointer;
    font-family: "DM Sans", sans-serif;
    font-size: 11px;
    font-weight: 800;
    padding: 5px 9px;
    transition: all 0.18s;
}

.tidal-auth-copy-code:hover {
    background: var(--card2);
    color: var(--text);
}

.deezer-auth-form {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.deezer-auth-form.hidden {
    display: none;
}

.deezer-auth-steps {
    display: grid;
    gap: 6px;
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
    user-select: text;
}

.deezer-auth-save {
    width: 100%;
    padding: 11px 12px;
}

/* NOW PLAYING */
.now-playing-section {
    padding: 24px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.now-playing-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin-bottom: 20px;
}

.eq-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
}

.eq-bar {
    width: 3px;
    background: var(--accent2);
    border-radius: 2px;
    animation: eq 0.6s ease-in-out infinite alternate;
}

.eq-bar:nth-child(1) {
    height: 6px;
    animation-delay: 0s;
}
.eq-bar:nth-child(2) {
    height: 10px;
    animation-delay: 0.1s;
}
.eq-bar:nth-child(3) {
    height: 14px;
    animation-delay: 0.2s;
}
.eq-bar:nth-child(4) {
    height: 8px;
    animation-delay: 0.15s;
}
.eq-bar:nth-child(5) {
    height: 12px;
    animation-delay: 0.05s;
}

@keyframes eq {
    from {
        transform: scaleY(0.4);
    }
    to {
        transform: scaleY(1);
    }
}

.player-card {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 28px;
    align-items: start;
}

.player-card > div:last-child {
    max-width: 540px;
    width: 100%;
}

.album-art-wrap {
    position: relative;
}

.album-art {
    width: 220px;
    height: 220px;
    border-radius: 16px;
    background: linear-gradient(135deg, #1a0a3e 0%, #2d1065 40%, #0f172a 100%);
    overflow: hidden;
    position: relative;
    box-shadow:
        0 20px 60px rgba(139, 92, 246, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

.album-art-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 16px;
    background:
        radial-gradient(
            circle at 60% 30%,
            rgba(167, 139, 250, 0.3) 0%,
            transparent 60%
        ),
        radial-gradient(
            circle at 30% 70%,
            rgba(236, 72, 153, 0.2) 0%,
            transparent 50%
        ),
        linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, 0.6) 100%);
}

.album-person {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(
            ellipse at 55% 40%,
            rgba(167, 139, 250, 0.5) 0%,
            transparent 55%
        ),
        radial-gradient(
            ellipse at 30% 60%,
            rgba(139, 92, 246, 0.3) 0%,
            transparent 45%
        );
}

.album-person::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cellipse cx='110' cy='140' rx='55' ry='70' fill='rgba(80,40,120,0.7)'/%3E%3Cellipse cx='110' cy='90' rx='28' ry='35' fill='rgba(100,60,140,0.8)'/%3E%3C/svg%3E")
        center / cover no-repeat;
}

.album-ring {
    position: absolute;
    width: 160px;
    height: 160px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    border-radius: 50%;
    border: 2px solid rgba(167, 139, 250, 0.6);
    box-shadow:
        0 0 30px rgba(139, 92, 246, 0.4),
        inset 0 0 20px rgba(139, 92, 246, 0.1);
    animation: pulse-ring 3s ease-in-out infinite;
}

@keyframes pulse-ring {
    0%,
    100% {
        opacity: 0.5;
        transform: translate(-50%, -55%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -55%) scale(1.04);
    }
}

.album-title-overlay {
    font-family: "Syne", sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    position: relative;
    z-index: 2;
    text-align: center;
    line-height: 1.4;
}

.quality-badges {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}
.quality-badge {
    padding: 3px 7px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    border: 1px solid;
}
.quality-badge.hd {
    border-color: var(--accent2);
    color: var(--accent2);
}
.quality-badge.flac {
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--muted);
}

.track-title {
    font-family: "Syne", sans-serif;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.track-artist {
    font-size: 14px;
    color: var(--accent2);
    font-weight: 500;
    margin-bottom: 18px;
    cursor: pointer;
}
.track-artist:hover {
    text-decoration: underline;
}

.track-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}
.action-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--card2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--muted);
    transition: all 0.2s;
}
.action-btn:hover {
    background: var(--card);
    color: var(--text);
}
.action-btn.liked {
    color: var(--pink);
    border-color: rgba(236, 72, 153, 0.3);
}

.waveform {
    height: 40px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1.5px;
    margin-bottom: 8px;
    overflow: hidden;
}

.wave-bar {
    flex: 1;
    border-radius: 2px;
    background: rgba(139, 92, 246, 0.25);
    min-width: 2px;
    transition: background 0.3s;
}

.wave-bar.played {
    background: var(--accent2);
}
.wave-bar.current {
    background: var(--pink);
}

.progress-wrap {
    margin-bottom: 16px;
}

.progress-bar {
    height: 3px;
    background: var(--card2);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    margin-bottom: 6px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 10px;
    width: 38%;
    position: relative;
}

.progress-fill::after {
    content: "";
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 6px rgba(139, 92, 246, 0.8);
}

.progress-times {
    display: flex;
    justify-content: space-between;
    font-size: 11.5px;
    color: var(--muted);
}

.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 22px;
}

.ctrl-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
}
.ctrl-btn:hover {
    color: var(--text);
}

.play-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 0 24px var(--glow);
    transition: all 0.2s;
}
.play-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 0 36px var(--glow);
}

.cta-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 22px;
}

.btn-listen {
    flex: 1;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--accent), var(--pink));
    border: none;
    border-radius: 10px;
    color: white;
    font-family: "DM Sans", sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-listen:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
}

.btn-download {
    flex: 1;
    padding: 12px 20px;
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: "DM Sans", sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-download:hover {
    background: var(--card);
    border-color: rgba(139, 92, 246, 0.3);
}

.quality-select-wrap {
    flex-shrink: 0;
}

.quality-label {
    font-size: 10.5px;
    color: var(--muted);
    margin-bottom: 6px;
    text-align: right;
}

.quality-options {
    display: flex;
    gap: 6px;
}

.quality-option {
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--card2);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.18s;
    text-align: center;
}
.quality-option.selected {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.4);
}
.quality-option .qname {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
}
.quality-option .qbps {
    font-size: 10px;
    color: var(--muted);
}

/* RECOMMENDATIONS */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 14px;
    background: transparent;
}

.section-title {
    font-family: "Syne", sans-serif;
    font-size: 16px;
    font-weight: 700;
}

.see-all {
    font-size: 12.5px;
    color: var(--accent2);
    cursor: pointer;
}
.see-all:hover {
    text-decoration: underline;
}

.playlists-row {
    display: flex;
    gap: 12px;
    padding: 0 24px 24px;
    overflow-x: auto;
    scrollbar-width: none;
}
.playlists-row::-webkit-scrollbar {
    display: none;
}

.playlist-card {
    flex-shrink: 0;
    width: 140px;
    cursor: pointer;
}

.playlist-cover {
    width: 140px;
    height: 140px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    margin-bottom: 10px;
    transition: transform 0.2s;
}
.playlist-card:hover .playlist-cover {
    transform: translateY(-3px);
}

.playlist-cover-bg {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
}

.pc1 {
    background: linear-gradient(135deg, #0f172a, #1e3a5f);
}
.pc2 {
    background: linear-gradient(135deg, #1a0a2e, #3b1f6e);
}
.pc3 {
    background: linear-gradient(135deg, #1f0a2e, #6b21a8);
}
.pc4 {
    background: linear-gradient(135deg, #0a1628, #1e3a6e);
}
.pc5 {
    background: linear-gradient(135deg, #0f1a28, #1a3a5e);
}

.play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}
.playlist-card:hover .play-overlay {
    opacity: 1;
}

.play-overlay-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg);
}

.playlist-card-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}
.playlist-card-type {
    font-size: 11px;
    color: var(--muted);
}

/* ── RIGHT PANEL ── */
.right-panel {
    background: var(--bg2);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    flex-shrink: 0;
}

.panel-tab {
    padding: 14px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.18s;
}
.panel-tab:hover {
    color: var(--text);
}
.panel-tab.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.tracklist {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}
.tracklist::-webkit-scrollbar {
    width: 4px;
}
.tracklist::-webkit-scrollbar-track {
    background: transparent;
}
.tracklist::-webkit-scrollbar-thumb {
    background: var(--card2);
    border-radius: 4px;
}

.track-item {
    display: grid;
    grid-template-columns: 24px 40px 1fr auto 28px 28px 28px;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 8px;
    margin: 1px 6px;
    cursor: pointer;
    transition: all 0.18s;
}
.track-item:hover {
    background: var(--card2);
}
.track-item.active {
    background: rgba(139, 92, 246, 0.1);
}

.track-num {
    font-size: 12px;
    color: var(--muted);
    text-align: center;
}
.track-item.active .track-num {
    color: var(--accent2);
}

.track-thumb {
    width: 40px;
    height: 40px;
    border-radius: 7px;
    background: linear-gradient(135deg, #1a0a3e, #2d1065);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    overflow: hidden;
}

.track-info {
    overflow: hidden;
}
.track-name {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.track-item.active .track-name {
    color: var(--accent2);
}
.track-by {
    font-size: 11px;
    color: var(--muted);
}

.track-dur {
    font-size: 12px;
    color: var(--muted);
}

.track-dl {
    position: relative;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--card2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.18s;
}
.track-dl:hover {
    color: var(--accent2);
    border-color: rgba(139, 92, 246, 0.3);
}

/* ALBUM INFO */
.album-info-panel {
    padding: 16px;
    overflow-y: auto;
}
.album-info-panel.hidden {
    display: none;
}
.tracklist.hidden {
    display: none;
}

.album-info-cover {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #1a0a3e, #3b1f6e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 72px;
    margin-bottom: 14px;
    box-shadow: 0 12px 40px rgba(139, 92, 246, 0.35);
}

.album-info-title {
    font-family: "Syne", sans-serif;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}
.album-info-desc {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 14px;
}

.album-meta {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}
.meta-item .meta-label {
    font-size: 10px;
    color: var(--muted);
    margin-bottom: 3px;
}
.meta-item .meta-value {
    font-family: "Syne", sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.album-tracks-section,
.search-album-tracks {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.album-tracks-section {
    margin-top: 16px;
    padding: 12px;
}

.search-album-tracks {
    grid-column: 1 / -1;
    margin: 2px 0 6px 56px;
    padding: 10px;
    cursor: default;
}

.album-tracks-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.album-tracks-count,
.album-tracks-empty {
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

.album-tracks-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.album-track-row {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto 26px 26px 26px;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 5px 6px;
    border-radius: 9px;
    cursor: pointer;
    transition:
        background 0.18s,
        color 0.18s;
}

.album-track-row:hover {
    background: rgba(139, 92, 246, 0.1);
}

.album-track-row.active {
    background: rgba(139, 92, 246, 0.14);
}

.album-track-index,
.album-track-duration {
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

.album-track-row.active .album-track-index,
.album-track-row.active .album-track-title {
    color: var(--accent2);
}

.album-track-main {
    min-width: 0;
}

.album-track-title,
.album-track-artist {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.album-track-title {
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
}

.album-track-artist {
    color: var(--muted);
    font-size: 10.5px;
    margin-top: 1px;
}

.result-item.album-result.expanded {
    align-items: start;
    background: rgba(139, 92, 246, 0.08);
}

.bottom-bar {
    min-height: 76px;
    flex-shrink: 0;
    background: #050508;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    grid-template-columns: minmax(180px, 260px) minmax(240px, 1fr) minmax(
            120px,
            170px
        );
    align-items: center;
    padding: 10px 18px;
    gap: 18px;
    box-shadow: 0 -16px 50px rgba(0, 0, 0, 0.28);
}

#audioPlayer {
    display: none;
}

.bar-track {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bar-track-meta {
    min-width: 0;
    overflow: hidden;
}

.bar-local-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    height: 18px;
    padding: 0 7px;
    border: 1px solid rgba(34, 197, 94, 0.35);
    border-radius: 999px;
    color: #22c55e;
    background: rgba(34, 197, 94, 0.09);
    font-family: "Syne", sans-serif;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.bar-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: linear-gradient(135deg, #1a0a3e, #2d1065);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    overflow: hidden;
}
.bar-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bar-track-name {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bar-track-artist {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bar-heart {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pink);
    cursor: pointer;
}

.bar-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.bar-btns {
    display: flex;
    align-items: center;
    gap: 14px;
}

.bar-ctrl {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    transition: color 0.18s;
    display: flex;
    align-items: center;
}
.bar-ctrl:hover {
    color: var(--text);
}

.bar-play {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 0 16px var(--glow);
    transition: all 0.2s;
}
.bar-play:hover {
    transform: scale(1.05);
}

.bar-progress {
    width: 100%;
    max-width: 620px;
    display: grid;
    grid-template-columns: auto minmax(140px, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding-top: 18px;
}

.bar-progress-bar {
    position: relative;
    grid-column: 2;
    grid-row: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    overflow: visible;
    cursor: pointer;
    touch-action: none;
    transition:
        height 0.16s ease,
        background 0.16s ease;
}

.bar-progress-bar::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -10px;
    bottom: -10px;
}

.bar-progress-bar:hover,
.bar-progress-bar.is-hovering,
.bar-progress-bar.is-dragging {
    height: 6px;
    background: rgba(255, 255, 255, 0.26);
}

.bar-progress-fill {
    position: absolute;
    inset: 0 auto 0 0;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    width: 0;
    max-width: 100%;
    border-radius: 999px;
    pointer-events: none;
}

.bar-progress-fill::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    box-shadow:
        0 0 0 2px rgba(5, 5, 8, 0.85),
        0 0 10px rgba(167, 139, 250, 0.65);
    transform: translate(50%, -50%);
}

.bar-progress-tooltip {
    position: absolute;
    left: 0;
    bottom: calc(100% + 9px);
    z-index: 2;
    min-width: 38px;
    padding: 4px 7px;
    border-radius: 5px;
    background: rgba(26, 26, 35, 0.96);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%);
    transition: opacity 0.12s ease;
}

.bar-progress-tooltip::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    width: 6px;
    height: 6px;
    background: rgba(26, 26, 35, 0.96);
    transform: translate(-50%, -50%) rotate(45deg);
}

.bar-progress-bar.is-hovering .bar-progress-tooltip {
    opacity: 1;
}

.bar-times {
    display: contents;
    font-size: 11px;
    color: var(--muted);
}

#barCurTime,
#barTotalTime {
    grid-row: 1;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

#barCurTime {
    grid-column: 1;
}

#barTotalTime {
    grid-column: 3;
}

.bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}

.bar-audio-tools {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
}

.bar-volume-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vol-slider {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100px;
    margin: -10px 0;
    padding: 10px 0;
    cursor: pointer;
    touch-action: none;
}
.vol-bar {
    position: relative;
    flex: 1;
    height: 3px;
    background: var(--card2);
    border-radius: 4px;
    overflow: visible;
    pointer-events: none;
}

.vol-slider.is-dragging .vol-bar,
.vol-slider:hover .vol-bar {
    background: rgba(255, 255, 255, 0.22);
}
.vol-fill {
    height: 100%;
    width: 70%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 4px;
}

.bar-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    transition: color 0.18s;
    display: flex;
    align-items: center;
    width: 28px;
    height: 28px;
    justify-content: center;
}
.bar-icon-btn:hover {
    color: var(--text);
}

.equalizer-toggle {
    width: 42px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    border: none;
    background: transparent;
    color: var(--accent2);
    cursor: pointer;
    border-radius: 8px;
    transition:
        background 0.18s ease,
        transform 0.18s ease,
        color 0.18s ease;
}

.equalizer-toggle:hover,
.equalizer-toggle.is-open,
.equalizer-toggle.is-active {
    background: rgba(139, 92, 246, 0.14);
    color: #c4b5fd;
}

.equalizer-toggle:hover {
    transform: translateY(-1px);
}

.equalizer-toggle-bars {
    height: 24px;
    display: inline-flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
}

.equalizer-toggle-bars span {
    width: 3px;
    min-height: 7px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 10px rgba(167, 139, 250, 0.4);
}

.equalizer-popover {
    position: fixed;
    right: 18px;
    bottom: 92px;
    z-index: 10000;
    width: min(920px, calc(100vw - 36px));
    filter: drop-shadow(0 28px 80px rgba(0, 0, 0, 0.48));
}

.equalizer-popover-arrow {
    position: absolute;
    right: 70px;
    bottom: -7px;
    width: 16px;
    height: 16px;
    background: #12121e;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transform: rotate(45deg);
}

.equalizer-panel {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(18, 18, 30, 0.98);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.equalizer-modal-card {
    width: 100%;
    max-height: min(680px, calc(100vh - 120px));
    overflow: hidden;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.equalizer-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.equalizer-subtitle,
.equalizer-mode-desc {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.equalizer-close {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition:
        color 0.18s ease,
        background 0.18s ease,
        border-color 0.18s ease;
}

.equalizer-close:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
}

.equalizer-preset-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.equalizer-presets {
    display: flex;
    flex: 1 1 360px;
    flex-wrap: wrap;
    gap: 8px;
}

.equalizer-custom-presets {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.equalizer-custom-dropdown {
    position: relative;
    min-width: 230px;
}

.equalizer-custom-trigger {
    width: 100%;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(139, 92, 246, 0.42);
    border-radius: 999px;
    padding: 8px 12px 8px 14px;
    background: rgba(139, 92, 246, 0.1);
    color: var(--text);
    font-family: "DM Sans", sans-serif;
    font-size: 12px;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.equalizer-custom-trigger:hover,
.equalizer-custom-trigger.active,
.equalizer-custom-dropdown.open .equalizer-custom-trigger {
    border-color: rgba(196, 181, 253, 0.72);
    background: rgba(139, 92, 246, 0.18);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 0 0 3px rgba(139, 92, 246, 0.12);
}

.equalizer-custom-arrow {
    color: #c4b5fd;
    font-size: 14px;
    line-height: 1;
    transition: transform 0.18s ease;
}

.equalizer-custom-dropdown.open .equalizer-custom-arrow {
    transform: rotate(180deg);
}

.equalizer-custom-menu {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    z-index: 30;
    width: 100%;
    min-width: 230px;
    padding: 6px;
    border: 1px solid rgba(167, 139, 250, 0.5);
    border-radius: 14px;
    background: rgba(18, 18, 30, 0.98);
    box-shadow:
        0 18px 42px rgba(0, 0, 0, 0.46),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(18px);
}

.equalizer-custom-option {
    width: 100%;
    border: none;
    border-radius: 9px;
    padding: 8px 9px;
    background: transparent;
    color: var(--muted);
    font-family: "DM Sans", sans-serif;
    font-size: 12px;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
    transition:
        color 0.16s ease,
        background 0.16s ease;
}

.equalizer-custom-option:hover,
.equalizer-custom-option.active {
    color: var(--text);
    background: rgba(139, 92, 246, 0.24);
}

.equalizer-save-preset {
    border: 1px solid rgba(167, 139, 250, 0.5);
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(139, 92, 246, 0.2);
    color: var(--text);
    font-family: "DM Sans", sans-serif;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease;
}

.equalizer-save-preset:hover {
    border-color: rgba(196, 181, 253, 0.82);
    background: rgba(139, 92, 246, 0.32);
    transform: translateY(-1px);
}

.equalizer-preset-btn {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    padding: 7px 11px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-family: "DM Sans", sans-serif;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition:
        color 0.18s ease,
        background 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease;
}

.equalizer-preset-btn:hover,
.equalizer-preset-btn.active {
    color: var(--text);
    border-color: rgba(139, 92, 246, 0.45);
    background: rgba(139, 92, 246, 0.18);
}

.equalizer-preset-btn:hover {
    transform: translateY(-1px);
}

.equalizer-mode-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 13px 14px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
}

.equalizer-mode-title {
    color: var(--text);
    font-size: 13.5px;
    font-weight: 700;
}

.equalizer-chart {
    position: relative;
    min-height: 276px;
    padding: 14px 16px 14px 122px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    background:
        linear-gradient(rgba(167, 139, 250, 0.32), rgba(167, 139, 250, 0.32))
            122px 50% / calc(100% - 138px) 2px no-repeat,
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.045),
            rgba(255, 255, 255, 0.02)
        );
    overflow: hidden;
}

.equalizer-chart::before,
.equalizer-chart::after {
    content: "";
    position: absolute;
    left: 122px;
    right: 16px;
    height: 1px;
    background: rgba(255, 255, 255, 0.07);
    pointer-events: none;
}

.equalizer-chart::before {
    top: calc(50% - 70px);
}

.equalizer-chart::after {
    top: calc(50% + 70px);
}

.equalizer-level-control {
    position: absolute;
    left: 14px;
    top: 14px;
    bottom: 14px;
    width: 42px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 2;
}

.equalizer-level-control::after {
    content: "";
    position: absolute;
    top: 34px;
    bottom: 28px;
    right: -10px;
    width: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.equalizer-level-control .equalizer-band-label {
    color: var(--accent2);
    font-size: 10px;
    text-transform: lowercase;
}

.equalizer-db-scale {
    position: absolute;
    left: 65px;
    top: 52px;
    bottom: 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    color: var(--accent2);
    font-size: 10px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    opacity: 0.95;
    pointer-events: none;
}

.equalizer-db-scale span:nth-child(2) {
    color: #ddd6fe;
    text-shadow: 0 0 10px rgba(167, 139, 250, 0.45);
}

.equalizer-bands {
    position: relative;
    z-index: 1;
    min-height: 248px;
    display: grid;
    grid-template-columns: repeat(
        var(--equalizer-band-count, 5),
        minmax(54px, 1fr)
    );
    gap: 12px;
    overflow: hidden;
}

.equalizer-band {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.equalizer-band-value {
    min-height: 18px;
    color: var(--accent2);
    font-size: 11px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.equalizer-slider-wrap {
    height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.equalizer-slider {
    width: 160px;
    height: 28px;
    accent-color: var(--accent2);
    cursor: pointer;
    transform: rotate(-90deg);
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
}

.equalizer-slider::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), #ddd6fe);
    box-shadow: 0 0 12px rgba(167, 139, 250, 0.3);
}

.equalizer-slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    margin-top: -7px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #5b21b6;
    box-shadow:
        0 0 0 2px rgba(18, 18, 30, 0.95),
        0 0 14px rgba(167, 139, 250, 0.7);
}

.equalizer-slider::-moz-range-track {
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), #ddd6fe);
    box-shadow: 0 0 12px rgba(167, 139, 250, 0.3);
}

.equalizer-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #5b21b6;
    box-shadow:
        0 0 0 2px rgba(18, 18, 30, 0.95),
        0 0 14px rgba(167, 139, 250, 0.7);
}

.equalizer-band-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.equalizer-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 2px;
}

@media (max-width: 860px) {
    .equalizer-custom-presets {
        width: 100%;
        margin-left: 0;
        flex-wrap: wrap;
    }

    .equalizer-custom-dropdown {
        flex: 1 1 180px;
        min-width: 0;
    }

    .equalizer-popover {
        right: 12px;
        left: 12px;
        bottom: 88px;
        width: auto;
    }

    .equalizer-popover-arrow {
        right: 58px;
    }

    .equalizer-modal-card {
        max-height: min(680px, calc(100vh - 108px));
        padding: 16px;
    }

    .equalizer-chart {
        padding-left: 112px;
        background-position:
            112px 50%,
            0 0;
        background-size:
            calc(100% - 128px) 2px,
            auto;
    }

    .equalizer-chart::before,
    .equalizer-chart::after {
        left: 112px;
    }

    .equalizer-db-scale {
        left: 60px;
    }

    .equalizer-bands {
        gap: 8px;
    }
}

/* ── UTILS & EXTRA STYLES ── */
.hidden {
    display: none !important;
}

/* ── PAGINATION ── */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.page-button {
    min-width: 112px;
    padding: 8px 16px;
    color: var(--text);
    font-family: "DM Sans", sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--card2);
    cursor: pointer;
    transition: all 0.18s;
}

.page-button:not(:disabled):hover {
    background: var(--card);
    border-color: rgba(139, 92, 246, 0.3);
}

.page-button:disabled {
    cursor: not-allowed;
    opacity: 0.38;
}

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

.page-number {
    display: grid;
    min-width: 34px;
    height: 34px;
    place-items: center;
    padding: 0 10px;
    color: var(--text);
    font-family: "DM Sans", sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--card2);
    cursor: pointer;
    transition: all 0.18s;
}

.page-number.active {
    background: rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 18px rgba(139, 92, 246, 0.2);
}

.page-number:not(.active):hover {
    background: var(--card);
}

.page-ellipsis {
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.08em;
}

/* ── SEARCH RESULTS STYLING ── */
.result-list-container {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    scrollbar-width: none;
}
.result-list-container::-webkit-scrollbar {
    display: none;
}

.result-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.result-item {
    display: grid;
    grid-template-columns: 44px 1fr auto 28px 28px 28px 28px;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    border-radius: 10px;
    margin: 1px 0;
    cursor: pointer;
    transition: all 0.18s;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

.result-item:hover {
    background: var(--card2);
}

.result-item.active {
    background: rgba(139, 92, 246, 0.1);
}

.result-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.result-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clickable-artist {
    cursor: pointer;
    transition:
        color 0.2s,
        text-decoration 0.2s;
}

.clickable-artist:hover {
    color: var(--accent2);
    text-decoration: underline;
}

.result-subtitle {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-meta {
    font-size: 12px;
    color: var(--muted);
}

.result-more {
    position: relative;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--card2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.18s;
    padding: 0;
    text-decoration: none;
}

.result-more:hover {
    color: var(--accent2);
    border-color: rgba(139, 92, 246, 0.3);
}

.result-download:hover {
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.35);
}

.result-favorite.active,
.track-favorite.active {
    color: #d86b8c;
    border-color: rgba(216, 107, 140, 0.35);
    background: rgba(216, 107, 140, 0.08);
}

.result-favorite:hover,
.track-favorite:hover {
    color: #d86b8c;
    border-color: rgba(216, 107, 140, 0.35);
}

.cover {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: linear-gradient(135deg, #1a0a3e, #2d1065);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.cover.artist {
    border-radius: 50%;
}

.cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" fill="white" xmlns="http://www.w3.org/2000/svg"><path d="M8 5v14l11-7z"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 24px;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    pointer-events: none;
}

.cover.artist::after {
    display: none;
}

.result-item:hover .cover::after,
.track-item:hover .cover::after,
.playlist-item:hover .cover::after,
.cover:hover::after {
    opacity: 1;
}

.empty {
    display: grid;
    min-height: 200px;
    place-items: center;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: 12px;
    margin: 10px 0;
}

.inline-loader {
    display: flex;
    min-height: 200px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: 12px;
    margin: 10px 0;
    grid-column: 1 / -1;
}

.inline-loader-ring {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--accent2);
    border-radius: 50%;
    animation: loader-spin 0.8s linear infinite;
    flex-shrink: 0;
}

/* ── PLAYLISTS ── */
.sidebar-playlists {
    padding: 0 10px;
    flex: 1;
    overflow-y: auto;
}

.playlist-empty {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
    padding: 8px 12px;
}

.sidebar-loader {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: var(--muted);
    font-size: 12px;
}

.sidebar-loader-ring {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--accent2);
    border-radius: 50%;
    animation: loader-spin 0.8s linear infinite;
    flex-shrink: 0;
}

.playlist-page {
    padding: 0 24px 24px;
}

.playlist-page-header {
    align-items: flex-start;
    gap: 16px;
}

.playlist-page-subtitle {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
}

.btn-create-playlist,
.modal-btn {
    border: none;
    border-radius: 10px;
    color: white;
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
}

.btn-create-playlist {
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--accent), var(--pink));
}

.btn-create-playlist:hover,
.modal-btn.primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.playlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 14px;
}

.playlist-page-card {
    position: relative;
    min-height: 180px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--card);
    cursor: pointer;
    transition: all 0.18s;
}

.playlist-page-card:hover {
    transform: translateY(-2px);
    background: var(--card2);
    border-color: rgba(139, 92, 246, 0.3);
}

.delete-album-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(26, 26, 26, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text);
    opacity: 0;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.delete-album-btn:hover {
    background: rgba(239, 68, 68, 0.9);
    border-color: rgba(239, 68, 68, 0.9);
    color: #ffffff;
    transform: scale(1.05);
}

.playlist-page-card:hover .delete-album-btn {
    opacity: 1;
}

.playlist-page-cover,
.playlist-detail-cover {
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, #1a0a3e, #2d1065);
    color: var(--accent2);
    font-family: "Syne", sans-serif;
    font-weight: 800;
    overflow: hidden;
}

.playlist-page-cover img,
.playlist-detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playlist-page-cover {
    width: 76px;
    height: 76px;
    margin-bottom: 12px;
    font-size: 32px;
}

.playlist-page-name {
    margin-bottom: 4px;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.playlist-page-desc,
.playlist-page-count,
.playlist-detail-description,
.playlist-detail-meta {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.playlist-page-desc {
    min-height: 34px;
    margin-bottom: 10px;
}

.playlist-detail-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.playlist-detail-actions .playlist-delete {
    margin-left: auto;
}

.playlist-back,
.playlist-delete {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--card2);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.playlist-play-btn {
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: linear-gradient(
        135deg,
        rgba(92, 139, 246, 0.25),
        rgba(139, 92, 246, 0.25)
    );
    border-color: rgba(92, 139, 246, 0.35);
    color: var(--text);
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(92, 139, 246, 0.15);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.playlist-play-btn:hover {
    background: linear-gradient(
        135deg,
        rgba(92, 139, 246, 0.35),
        rgba(139, 92, 246, 0.35)
    );
    box-shadow: 0 4px 16px rgba(92, 139, 246, 0.25);
    transform: translateY(-1px);
}

.playlist-play-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(92, 139, 246, 0.15);
}

.playlist-delete {
    color: #d86b8c;
    border-color: rgba(216, 107, 140, 0.28);
}

.playlist-delete:hover {
    background: rgba(216, 107, 140, 0.08);
    border-color: rgba(216, 107, 140, 0.42);
}

.playlist-detail-card {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 20px;
    align-items: center;
    margin-bottom: 22px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--card);
}

.playlist-detail-cover {
    width: 130px;
    height: 130px;
    font-size: 56px;
}

.playlist-detail-kicker {
    margin-bottom: 6px;
    color: var(--accent2);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.playlist-detail-title {
    margin-bottom: 8px;
    color: var(--text);
    font-family: "Syne", sans-serif;
    font-size: 28px;
    font-weight: 800;
}

.playlist-tracks {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.playlist-track-row {
    display: grid;
    grid-template-columns: 34px 1fr auto auto;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.playlist-track-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.playlist-track-delete {
    position: relative;
    width: 26px;
    height: 26px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--card2);
    color: var(--muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s;
}

.playlist-track-delete:hover {
    color: #d86b8c;
    border-color: rgba(216, 107, 140, 0.35);
}

.playlist-track-actions .track-download:hover {
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.35);
}

.playlist-track-index,
.playlist-track-quality,
.playlist-track-artist {
    color: var(--muted);
    font-size: 12px;
}

.playlist-track-main {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.playlist-track-title {
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.68);
    backdrop-filter: blur(8px);
}

.modal-card {
    width: min(420px, 100%);
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--bg2);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.modal-title {
    margin-bottom: 16px;
    color: var(--text);
    font-family: "Syne", sans-serif;
    font-size: 18px;
    font-weight: 800;
}

.modal-label {
    display: block;
    margin: 12px 0 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.modal-input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    background: var(--card);
    color: var(--text);
    font-family: "DM Sans", sans-serif;
}

.modal-input:focus {
    border-color: rgba(139, 92, 246, 0.45);
}

.modal-textarea {
    min-height: 92px;
    resize: vertical;
}

.playlist-cover-picker {
    display: grid;
    grid-template-columns: 82px 1fr;
    gap: 12px;
    align-items: center;
}

.playlist-cover-preview {
    width: 82px;
    height: 82px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: linear-gradient(135deg, #1a0a3e, #2d1065);
    color: var(--accent2);
    font-family: "Syne", sans-serif;
    font-size: 32px;
    font-weight: 800;
}

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

.playlist-cover-picker-actions {
    min-width: 0;
}

.playlist-cover-picker-actions input[type="file"] {
    width: 100%;
    color: var(--muted);
    font-size: 12px;
}

.playlist-cover-help {
    margin-top: 6px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
}

.playlist-cover-clear {
    margin-top: 8px;
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--card2);
    color: var(--muted);
    cursor: pointer;
    font-family: "DM Sans", sans-serif;
    font-size: 11px;
}

.playlist-cover-clear:hover {
    color: var(--text);
    border-color: rgba(139, 92, 246, 0.35);
}

.modal-error {
    min-height: 18px;
    margin-top: 10px;
    color: #fb7185;
    font-size: 12px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.modal-btn {
    padding: 10px 14px;
}

.modal-btn.secondary {
    border: 1px solid var(--border);
    background: var(--card2);
    color: var(--text);
}

.modal-btn.primary {
    background: linear-gradient(135deg, var(--accent), var(--pink));
}

.playlist-menu {
    position: fixed;
    z-index: 9999;
    width: max-content;
    min-width: 210px;
    max-width: min(320px, calc(100vw - 20px));
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg2);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}

.playlist-menu-title {
    padding: 6px 8px 8px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.playlist-menu button {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-family: "DM Sans", sans-serif;
    line-height: 1.25;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
}

.playlist-menu button:hover,
.result-playlist:hover,
.track-playlist:hover {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.08);
    border-color: rgba(251, 191, 36, 0.35);
}

.result-more.is-loading,
.track-dl.is-loading,
.playlist-track-delete.is-loading,
.playlist-download-cloud.is-loading,
.mobile-track-download.is-loading {
    pointer-events: none;
    opacity: 0.85;
}

.result-more.is-loading.is-cancellable,
.track-dl.is-loading.is-cancellable,
.playlist-track-delete.is-loading.is-cancellable,
.playlist-download-cloud.is-loading.is-cancellable,
.mobile-track-download.is-loading.is-cancellable {
    pointer-events: auto;
    cursor: pointer;
}

.result-more.is-loading svg,
.track-dl.is-loading svg,
.playlist-track-delete.is-loading svg,
.mobile-track-download.is-loading svg {
    opacity: 0;
}

.result-more.is-loading::after,
.track-dl.is-loading::after,
.playlist-track-delete.is-loading::after,
.mobile-track-download.is-loading::after {
    content: "";
    position: absolute;
    inset: 6px;
    border: 2px solid rgba(255, 255, 255, 0.18);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: loader-spin 0.75s linear infinite;
}

.result-more.is-loading.is-cancellable:hover::after,
.track-dl.is-loading.is-cancellable:hover::after,
.playlist-track-delete.is-loading.is-cancellable:hover::after,
.mobile-track-download.is-loading.is-cancellable:hover::after {
    content: "";
    position: absolute;
    inset: auto;
    left: 50%;
    top: 50%;
    width: 16px;
    height: 16px;
    border: 1px solid rgba(239, 68, 68, 0.45);
    border-radius: 50%;
    background:
        linear-gradient(
                45deg,
                transparent 43%,
                #ef4444 44%,
                #ef4444 56%,
                transparent 57%
            )
            center / 8px 8px no-repeat,
        linear-gradient(
                -45deg,
                transparent 43%,
                #ef4444 44%,
                #ef4444 56%,
                transparent 57%
            )
            center / 8px 8px no-repeat,
        rgba(239, 68, 68, 0.1);
    transform: translate(-50%, -50%);
    animation: none;
}

.screen-loader {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: grid;
    place-items: center;
    background: rgba(13, 13, 20, 0.5);
    backdrop-filter: blur(4px);
}

.screen-loader-card {
    display: flex;
    min-width: 220px;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 22px 24px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(18, 18, 30, 0.94);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.5);
}

.screen-loader-ring {
    width: 46px;
    height: 46px;
    border: 4px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--accent2);
    border-radius: 50%;
    animation: loader-spin 0.85s linear infinite;
    flex-shrink: 0;
}

.screen-loader-text {
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

@keyframes loader-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── FullHD / Large Screen Optimization ── */
@media (min-width: 1400px) {
    .now-playing-section {
        padding: 40px;
    }
    .player-card {
        grid-template-columns: 320px 1fr;
        gap: 40px;
    }
    .album-art {
        width: 320px;
        height: 320px;
        border-radius: 20px;
    }
    .album-art-inner {
        padding: 24px;
    }
    .album-ring {
        width: 240px;
        height: 240px;
    }
    .album-title-overlay {
        font-size: 14px;
        margin-bottom: 20px;
    }
    .player-card > div:last-child {
        max-width: 720px;
    }
    .track-title {
        font-size: 34px;
        margin-bottom: 8px;
    }
    .track-artist {
        font-size: 16px;
        margin-bottom: 24px;
    }
    .waveform {
        height: 52px;
        margin-bottom: 12px;
    }
    .progress-wrap {
        margin-bottom: 20px;
    }
    .controls {
        margin-bottom: 28px;
        gap: 28px;
    }
}

/* Downloads View Styling */
.downloads-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    margin: 0 24px 24px;
    padding-bottom: 8px;
}

.downloads-tab {
    cursor: pointer;
    font-family: "Syne", sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--muted);
    padding: 6px 12px;
    border-radius: 6px;
    background: transparent;
    border: none;
    transition: all 0.2s;
}

.downloads-tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.downloads-tab.active {
    color: var(--text);
    background: var(--card2);
}

/* Track Download Progress Bar */
.track-download-progress-container {
    display: none;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
    min-height: 14px;
    width: 100%;
}
.track-download-progress-bar-wrapper {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}
.track-download-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent2), #a855f7);
    border-radius: 2px;
    transition: width 0.3s ease;
}
.track-download-progress-text {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    font-size: 10px;
    color: var(--accent2);
    font-weight: 600;
    min-width: 54px;
    min-height: 14px;
    text-align: right;
    line-height: 14px;
}

/* ── SETTINGS VIEW STYLING ── */
.settings-title-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.settings-gear-icon {
    font-size: 32px;
    display: inline-block;
    animation: rotateGear 20s linear infinite;
    transform-origin: center;
    filter: drop-shadow(0 0 8px var(--glow));
}

.settings-gear-icon:hover {
    animation: rotateGear 5s linear infinite;
}

@keyframes rotateGear {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Settings Content inherits from main definition */

.settings-card {
    background: rgba(22, 22, 42, 0.45);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 28px;
    margin-top: 10px;
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
    max-width: 720px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-card:hover {
    box-shadow: 0 16px 48px 0 rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.25);
    background: rgba(22, 22, 42, 0.55);
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 20px;
}

.settings-card-icon {
    font-size: 24px;
    background: rgba(139, 92, 246, 0.15);
    width: 46px;
    height: 46px;
    border-radius: 12px;
    color: var(--accent2);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.15);
}

.settings-card-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.3px;
}

.settings-card-subtitle {
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.2px;
}

.settings-input-wrapper {
    position: relative;
    width: 100%;
}

.settings-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(13, 13, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
    background: rgba(26, 26, 46, 0.85);
}

.settings-input::placeholder {
    color: var(--muted2);
}

.settings-hint {
    font-size: 12px;
    color: var(--muted);
    font-style: italic;
    padding-left: 4px;
    transition: color 0.3s ease;
}

.settings-hint.resolved-active {
    color: var(--accent2);
    font-style: normal;
    font-weight: 500;
}

.settings-actions {
    display: flex;
    gap: 14px;
    justify-content: flex-end;
    margin-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 24px;
}

.settings-btn {
    padding: 11px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.settings-btn.primary {
    background: linear-gradient(135deg, var(--accent), var(--pink));
    color: #fff;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.settings-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.45);
    filter: brightness(1.1);
}

.settings-btn.primary:active {
    transform: translateY(0);
}

.settings-btn.secondary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.settings-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.settings-btn.secondary:active {
    transform: translateY(0);
}

.settings-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.settings-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

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

/* ── TOGGLE SWITCH STYLING ── */
.toggle-group {
    flex-direction: row !important;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 8px;
}

.settings-toggle-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 80%;
}

.settings-desc {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
}

.local-download-directories {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    max-height: 820px;
    opacity: 1;
    transform: translateY(0);
    transition:
        max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.25s ease,
        transform 0.25s ease,
        margin-top 0.25s ease,
        padding-top 0.25s ease,
        border-color 0.25s ease;
}

.local-download-directories:not(.is-visible) {
    margin-top: 0;
    padding-top: 0;
    border-top-color: transparent;
    max-height: 0;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
}

.local-download-directories .settings-card-header {
    margin-bottom: 22px;
    padding-bottom: 18px;
}

/* Switch container */
.switch-container {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.switch-container input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.switch-container input:checked + .switch-slider {
    background: linear-gradient(135deg, var(--accent), var(--pink));
    border-color: transparent;
}

.switch-container input:checked + .switch-slider:before {
    transform: translateX(20px);
}

.badge-atmos {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffd700, #b8860b);
    color: #000000;
    font-size: 8.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 4px;
    border-radius: 3px;
    margin-left: 6px;
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 215, 0, 0.5);
    user-select: none;
    line-height: 1;
}

.playlist-download-cloud {
    position: relative;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: linear-gradient(
        135deg,
        rgba(236, 72, 153, 0.25),
        rgba(139, 92, 246, 0.25)
    );
    border-color: rgba(236, 72, 153, 0.35);
    color: var(--text);
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.15);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.playlist-download-cloud-icon {
    position: relative;
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    display: inline-grid;
    place-items: center;
}

.playlist-download-cloud-label {
    min-width: 0;
}

.playlist-download-cloud.is-loading .playlist-download-cloud-icon svg {
    opacity: 0;
}

.playlist-download-cloud.is-loading .playlist-download-cloud-icon::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 2px solid rgba(255, 255, 255, 0.18);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: loader-spin 0.75s linear infinite;
}

.playlist-download-cloud.is-loading.is-cancellable:hover {
    border-color: rgba(239, 68, 68, 0.6);
    background: rgba(239, 68, 68, 0.14);
    color: #ef4444;
}

.playlist-download-cloud.is-loading.is-cancellable:hover
    .playlist-download-cloud-icon::after {
    content: "";
    position: absolute;
    inset: auto;
    left: 50%;
    top: 50%;
    width: 16px;
    height: 16px;
    border: 1px solid rgba(239, 68, 68, 0.45);
    border-radius: 50%;
    background:
        linear-gradient(
                45deg,
                transparent 43%,
                #ef4444 44%,
                #ef4444 56%,
                transparent 57%
            )
            center / 8px 8px no-repeat,
        linear-gradient(
                -45deg,
                transparent 43%,
                #ef4444 44%,
                #ef4444 56%,
                transparent 57%
            )
            center / 8px 8px no-repeat,
        rgba(239, 68, 68, 0.1);
    transform: translate(-50%, -50%);
    animation: none;
}

.playlist-download-cloud.is-loading.is-cancellable:hover
    .playlist-download-cloud-label {
    font-size: 0;
}

.playlist-download-cloud.is-loading.is-cancellable:hover
    .playlist-download-cloud-label::after {
    content: attr(data-cancel-label);
    font-size: 13px;
}

.playlist-download-cloud:hover {
    background: linear-gradient(
        135deg,
        rgba(236, 72, 153, 0.4),
        rgba(139, 92, 246, 0.4)
    );
    border-color: rgba(236, 72, 153, 0.6);
    box-shadow: 0 4px 16px rgba(236, 72, 153, 0.25);
    transform: translateY(-1px);
}

.playlist-download-cloud:active {
    transform: translateY(1px);
}

/* ── GLOBAL DOWNLOAD WIDGET ── */
.global-download-widget {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9999;
}

.global-download-widget.hidden {
    display: none;
}

.global-download-btn {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bg2);
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}
.global-download-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.global-download-ring {
    position: absolute;
    top: -2px;
    left: -2px;
    width: 60px;
    height: 60px;
    pointer-events: none;
    transform: rotate(-90deg);
}

.global-download-ring-bg {
    fill: none;
    stroke: transparent;
    stroke-width: 3;
}

.global-download-ring-progress {
    fill: none;
    stroke: var(--accent);
    stroke-width: 3;
    stroke-dasharray: 138.2;
    stroke-dashoffset: 138.2;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.3s linear;
}

.global-download-icon {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
}

.global-download-popup {
    position: absolute;
    bottom: calc(100% + 16px);
    left: 0;
    width: 280px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.global-download-popup.hidden {
    display: none;
}

.global-download-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.playlist-menu button {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: var(--text);
    text-align: left;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.playlist-menu button svg {
    margin-right: 10px;
}

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

.global-download-close {
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    display: grid;
    place-items: center;
    border-radius: 4px;
    transition:
        color 0.2s,
        background 0.2s;
    padding: 4px;
}
.global-download-close:hover {
    color: var(--text);
    background: var(--card2);
}

.global-download-list {
    max-height: 260px;
    overflow-y: auto;
    padding: 4px 0;
}
.global-download-list::-webkit-scrollbar {
    width: 6px;
}
.global-download-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.global-dl-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    gap: 10px;
    border-bottom: 1px solid var(--border);
}
.global-dl-item:last-child {
    border-bottom: none;
}
.global-dl-item:hover {
    background: var(--card2);
}

.global-dl-info {
    min-width: 0;
    flex: 1;
}

.global-dl-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.global-dl-subtitle {
    font-size: 10px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.global-dl-progress {
    font-size: 10px;
    color: var(--accent2);
    margin-top: 4px;
}

.global-dl-cancel {
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    transition:
        color 0.2s,
        background 0.2s;
}
.global-dl-cancel:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.queue-clear-btn {
    padding: 8px 16px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.queue-clear-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.3);
}

.queue-clear-btn:active {
    transform: translateY(1px);
}

/* ── MOBILE TRACK PLAYER ── */
.mobile-track-player {
    display: none;
}

@media (max-width: 860px) {
    body.mobile-track-player-open {
        overflow: hidden;
    }

    .mobile-track-player {
        position: fixed;
        inset: 0;
        z-index: 10050;
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        min-height: 100dvh;
        padding: calc(16px + env(safe-area-inset-top, 0px)) 20px
            calc(18px + env(safe-area-inset-bottom, 0px));
        background:
            radial-gradient(
                circle at 50% 38%,
                rgba(139, 92, 246, 0.24),
                transparent 30%
            ),
            radial-gradient(
                circle at 12% 8%,
                rgba(59, 130, 246, 0.12),
                transparent 32%
            ),
            linear-gradient(
                180deg,
                rgba(13, 13, 20, 0.98),
                rgba(7, 7, 13, 0.99)
            );
        color: var(--text);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-track-player.hidden {
        display: none !important;
    }

    .mobile-track-player-shell {
        width: min(100%, 440px);
        min-height: 100%;
        display: flex;
        flex-direction: column;
        margin: 0 auto;
        touch-action: pan-y;
    }

    .mobile-track-player-top {
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr) 42px;
        align-items: center;
        gap: 10px;
        margin-bottom: 18px;
    }

    .mobile-track-top-btn,
    .mobile-track-top-spacer {
        width: 42px;
        height: 42px;
    }

    .mobile-track-top-btn {
        display: grid;
        place-items: center;
        border: none;
        border-radius: 50%;
        background: transparent;
        color: var(--accent2);
        cursor: pointer;
    }

    .mobile-track-queue-btn.active {
        background: rgba(139, 92, 246, 0.18);
        color: var(--text);
    }

    .mobile-track-now {
        color: var(--text);
        font-size: 13px;
        font-weight: 700;
        text-align: center;
    }

    .mobile-track-player-top,
    .mobile-track-cover,
    .mobile-track-heading {
        touch-action: none;
    }

    .mobile-track-cover {
        width: min(72vw, 290px);
        aspect-ratio: 1;
        display: grid;
        place-items: center;
        align-self: center;
        overflow: hidden;
        border-radius: 24px;
        background:
            radial-gradient(
                circle at 55% 28%,
                rgba(167, 139, 250, 0.36),
                transparent 42%
            ),
            linear-gradient(135deg, #1a0a3e, #2d1065 48%, #0f172a);
        color: var(--accent2);
        font-family: "Syne", sans-serif;
        font-size: 76px;
        font-weight: 800;
        box-shadow:
            0 26px 80px rgba(139, 92, 246, 0.38),
            0 0 0 1px rgba(255, 255, 255, 0.06);
    }

    .mobile-track-cover img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .mobile-track-heading {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 14px;
        margin-top: 24px;
    }

    .mobile-track-heading-text {
        min-width: 0;
    }

    .mobile-track-title {
        overflow: hidden;
        color: var(--text);
        font-family: "Syne", sans-serif;
        font-size: clamp(24px, 7vw, 32px);
        font-weight: 800;
        line-height: 1.1;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-track-artist {
        max-width: 100%;
        margin-top: 6px;
        padding: 0;
        overflow: hidden;
        border: none;
        background: transparent;
        color: var(--accent2);
        cursor: pointer;
        font-family: inherit;
        font-size: 15px;
        font-weight: 500;
        text-align: left;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-track-artist:disabled {
        cursor: default;
        opacity: 0.75;
    }

    .mobile-track-like {
        width: 42px;
        height: 42px;
        display: grid;
        place-items: center;
        border: none;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--accent), var(--pink));
        color: white;
        cursor: pointer;
        box-shadow: 0 0 22px rgba(139, 92, 246, 0.36);
    }

    .mobile-track-like svg {
        width: 18px;
        height: 18px;
    }

    .mobile-track-progress-wrap {
        margin-top: 18px;
    }

    .mobile-track-progress {
        position: relative;
        height: 4px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.16);
        cursor: pointer;
        touch-action: none;
        user-select: none;
        -webkit-user-select: none;
        transition:
            height 0.16s ease,
            background 0.16s ease;
    }

    .mobile-track-progress.is-dragging {
        height: 6px;
        background: rgba(255, 255, 255, 0.24);
    }

    .mobile-track-progress::before {
        content: "";
        position: absolute;
        inset: -12px 0;
    }

    .mobile-track-progress-fill {
        position: absolute;
        inset: 0 auto 0 0;
        width: 0;
        max-width: 100%;
        border-radius: inherit;
        background: linear-gradient(90deg, var(--accent), var(--accent2));
        pointer-events: none;
    }

    .mobile-track-progress-fill::after {
        content: "";
        position: absolute;
        top: 50%;
        right: 0;
        width: 11px;
        height: 11px;
        border-radius: 50%;
        background: #fff;
        box-shadow: 0 0 12px rgba(167, 139, 250, 0.75);
        transform: translate(50%, -50%);
    }

    .mobile-track-times {
        display: flex;
        justify-content: space-between;
        margin-top: 9px;
        color: var(--muted);
        font-size: 11px;
        font-variant-numeric: tabular-nums;
    }

    .mobile-track-controls {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin: 8px 0 0;
    }

    .mobile-track-control,
    .mobile-track-play {
        border: none;
        color: var(--text);
        cursor: pointer;
        display: grid;
        place-items: center;
    }

    .mobile-track-control {
        position: relative;
        width: 42px;
        height: 42px;
        border-radius: 50%;
        background: transparent;
        color: var(--muted);
    }

    .mobile-track-control.repeat-one::after {
        content: "1";
        position: absolute;
        top: 7px;
        right: 7px;
        display: grid;
        min-width: 12px;
        height: 12px;
        place-items: center;
        border-radius: 999px;
        background: var(--accent2);
        color: #050508;
        font-family: "Syne", sans-serif;
        font-size: 8px;
        font-weight: 800;
        line-height: 1;
        box-shadow: 0 0 8px rgba(167, 139, 250, 0.45);
    }

    .mobile-track-control.active {
        color: var(--accent2);
        background: rgba(139, 92, 246, 0.14);
    }

    .mobile-track-play {
        width: 64px;
        height: 64px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--accent), #7c3aed);
        box-shadow: 0 0 30px rgba(139, 92, 246, 0.58);
    }

    .mobile-track-action-row {
        display: grid;
        grid-template-columns: 42px 42px minmax(0, 1fr);
        align-items: center;
        gap: 10px;
        margin: 18px 0 16px;
    }

    .mobile-track-download,
    .mobile-track-equalizer {
        width: 42px;
        height: 42px;
        display: grid;
        place-items: center;
        border: 1px solid var(--border);
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.04);
        color: var(--accent2);
        cursor: pointer;
        position: relative;
    }

    .mobile-track-equalizer {
        color: var(--accent2);
    }

    .mobile-track-equalizer .equalizer-toggle-bars {
        height: 24px;
    }

    .mobile-track-equalizer .equalizer-toggle-bars span {
        width: 3px;
    }

    .mobile-track-download span {
        display: none;
    }

    .mobile-track-quality-options {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
        gap: 8px;
    }

    .mobile-track-quality-option {
        min-width: 0;
        padding: 8px 9px;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.04);
    }

    .mobile-track-quality-option .qname,
    .mobile-track-quality-option .qbps {
        display: block;
    }

    .mobile-track-queue-view {
        display: none;
    }

    .mobile-track-player.is-queue-open .mobile-track-cover,
    .mobile-track-player.is-queue-open .mobile-track-heading,
    .mobile-track-player.is-queue-open .mobile-track-progress-wrap,
    .mobile-track-player.is-queue-open .mobile-track-action-row,
    .mobile-track-player.is-queue-open .mobile-track-controls {
        display: none;
    }

    .mobile-track-player.is-queue-open .mobile-track-queue-view {
        min-height: 0;
        display: flex;
        flex: 1;
        flex-direction: column;
        padding-top: 22px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-track-queue-label {
        margin: 0 0 10px;
        color: var(--text);
        font-family: "Syne", sans-serif;
        font-size: 16px;
        font-weight: 800;
    }

    .mobile-track-queue-list {
        display: grid;
        gap: 8px;
    }

    .mobile-track-queue-current {
        margin-bottom: 26px;
    }

    .mobile-track-queue-row {
        width: 100%;
        min-width: 0;
        display: grid;
        grid-template-columns: 52px minmax(0, 1fr) auto;
        align-items: center;
        gap: 12px;
        padding: 9px;
        border: none;
        border-radius: 12px;
        background: transparent;
        color: var(--text);
        cursor: pointer;
        font: inherit;
        text-align: left;
    }

    .mobile-track-queue-row.active {
        background: rgba(255, 255, 255, 0.08);
    }

    .mobile-track-queue-cover {
        width: 52px;
        height: 52px;
        display: grid;
        place-items: center;
        overflow: hidden;
        border-radius: 8px;
        background: linear-gradient(135deg, #1a0a3e, #2d1065);
        color: var(--accent2);
        font-family: "Syne", sans-serif;
        font-size: 22px;
        font-weight: 800;
    }

    .mobile-track-queue-cover img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .mobile-track-queue-text {
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 3px;
    }

    .mobile-track-queue-title,
    .mobile-track-queue-artist {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-track-queue-title {
        color: var(--text);
        font-size: 14px;
        font-weight: 800;
    }

    .mobile-track-queue-artist {
        color: var(--muted);
        font-size: 13px;
        font-weight: 600;
    }

    .mobile-track-queue-more {
        color: var(--muted);
        font-size: 16px;
        letter-spacing: 0.08em;
    }

    .mobile-track-queue-empty {
        padding: 14px 0;
        color: var(--muted);
        font-size: 13px;
    }

    body.mobile-track-player-open .equalizer-popover {
        top: calc(10px + env(safe-area-inset-top, 0px));
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        left: 10px;
        z-index: 12100;
        width: auto;
        display: flex;
        filter: drop-shadow(0 24px 70px rgba(0, 0, 0, 0.52));
    }

    body.mobile-track-player-open .equalizer-panel {
        width: 100%;
        min-height: 0;
        display: flex;
        overflow: hidden;
        border-radius: 18px;
    }

    body.mobile-track-player-open .equalizer-modal-card {
        height: 100%;
        max-height: none;
        min-height: 0;
        overflow-y: auto;
        padding: 16px;
        gap: 12px;
        -webkit-overflow-scrolling: touch;
    }

    body.mobile-track-player-open .equalizer-modal-header {
        gap: 10px;
    }

    body.mobile-track-player-open .equalizer-subtitle,
    body.mobile-track-player-open .equalizer-mode-desc {
        font-size: 12px;
    }

    body.mobile-track-player-open .equalizer-preset-row,
    body.mobile-track-player-open .equalizer-presets {
        gap: 7px;
    }

    body.mobile-track-player-open .equalizer-preset-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    body.mobile-track-player-open .equalizer-mode-row {
        gap: 12px;
        padding: 11px 12px;
    }

    body.mobile-track-player-open .equalizer-chart {
        min-height: 222px;
        padding: 12px 12px 12px 82px;
        overflow-x: auto;
        overflow-y: hidden;
        background-position:
            82px 50%,
            0 0;
        background-size:
            calc(100% - 94px) 2px,
            auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(167, 139, 250, 0.45) transparent;
    }

    body.mobile-track-player-open .equalizer-chart::-webkit-scrollbar {
        height: 5px;
    }

    body.mobile-track-player-open .equalizer-chart::-webkit-scrollbar-thumb {
        border-radius: 999px;
        background: rgba(167, 139, 250, 0.45);
    }

    body.mobile-track-player-open .equalizer-chart::before,
    body.mobile-track-player-open .equalizer-chart::after {
        left: 82px;
        right: 12px;
    }

    body.mobile-track-player-open .equalizer-chart::before {
        top: calc(50% - 54px);
    }

    body.mobile-track-player-open .equalizer-chart::after {
        top: calc(50% + 54px);
    }

    body.mobile-track-player-open .equalizer-level-control {
        left: 10px;
        top: 12px;
        bottom: 12px;
        width: 34px;
        gap: 6px;
    }

    body.mobile-track-player-open .equalizer-level-control::after {
        top: 30px;
        bottom: 25px;
        right: -8px;
    }

    body.mobile-track-player-open .equalizer-db-scale {
        left: 50px;
        top: 46px;
        bottom: 42px;
        font-size: 9px;
    }

    body.mobile-track-player-open .equalizer-bands {
        min-width: calc(var(--equalizer-band-count, 5) * 38px);
        min-height: 196px;
        grid-template-columns: repeat(
            var(--equalizer-band-count, 5),
            minmax(30px, 1fr)
        );
        gap: 6px;
        overflow: visible;
    }

    body.mobile-track-player-open .equalizer-band {
        gap: 6px;
    }

    body.mobile-track-player-open .equalizer-band-value,
    body.mobile-track-player-open .equalizer-band-label {
        font-size: 9px;
    }

    body.mobile-track-player-open .equalizer-slider-wrap {
        height: 132px;
    }

    body.mobile-track-player-open .equalizer-slider {
        width: 124px;
        height: 24px;
    }

    body.mobile-track-player-open .equalizer-footer {
        position: sticky;
        right: 0;
        bottom: -16px;
        margin: 0 -16px -16px;
        padding: 12px 16px 16px;
        background: linear-gradient(
            180deg,
            rgba(18, 18, 30, 0),
            rgba(18, 18, 30, 0.98) 34%
        );
    }
}

@media (max-width: 380px) {
    .mobile-track-player {
        padding-inline: 16px;
    }

    .mobile-track-cover {
        width: min(70vw, 240px);
        border-radius: 20px;
    }

    .mobile-track-controls {
        gap: 6px;
    }

    .mobile-track-control {
        width: 38px;
        height: 38px;
    }

    .mobile-track-play {
        width: 58px;
        height: 58px;
    }

    .mobile-track-action-row {
        grid-template-columns: 38px 38px minmax(0, 1fr);
        gap: 8px;
    }

    .mobile-track-download,
    .mobile-track-equalizer {
        width: 38px;
        height: 38px;
    }

    .mobile-track-quality-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ── RESPONSIVE LAYOUT ── */
html {
    min-height: 100%;
    background: var(--bg);
}

.app {
    height: 100vh;
    height: 100dvh;
    min-width: 0;
}

.center,
.right-panel,
.sidebar,
.topbar,
.bottom-bar,
.result-item,
.track-item,
.playlist-track-row,
.album-track-row {
    min-width: 0;
}

@media (max-width: 1280px) {
    .app {
        grid-template-columns: 76px minmax(0, 1fr) minmax(300px, 34vw);
    }

    .sidebar {
        padding: 16px 0;
    }

    .logo {
        justify-content: center;
        padding: 0 0 18px;
        font-size: 0;
    }

    .logo-icon {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    nav {
        padding: 0 8px;
    }

    .nav-item {
        justify-content: center;
        gap: 0;
        padding: 12px 10px;
        font-size: 0;
    }

    .nav-item svg {
        width: 19px;
        height: 19px;
    }

    #localSidebarSection,
    .nav-section,
    .sidebar-divider,
    .premium-card {
        display: none;
    }

    .topbar {
        gap: 14px;
    }

    .search-box {
        width: clamp(220px, 28vw, 300px);
    }

    .topbar-quality-label {
        display: none;
    }

    .topbar-quality-select {
        margin-left: 8px;
        padding-left: 10px;
    }

    .topbar-quality-option {
        min-width: 74px;
        padding: 6px 8px;
    }

    .bottom-bar {
        grid-template-columns: minmax(150px, 230px) minmax(220px, 1fr) auto;
        gap: 12px;
        padding-inline: 14px;
    }

    .vol-slider {
        width: 76px;
    }
}

@media (max-width: 1100px) {
    .app {
        grid-template-columns: 76px minmax(0, 1fr);
    }

    .right-panel {
        display: none;
    }

    .topbar {
        flex-wrap: wrap;
    }

    .search-box {
        flex: 1 1 280px;
        width: auto;
    }

    .nav-tabs {
        order: 3;
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .nav-tabs::-webkit-scrollbar {
        display: none;
    }

    .topbar-right {
        margin-left: auto;
    }

    .bottom-bar {
        grid-template-columns: minmax(180px, 260px) minmax(260px, 1fr) auto;
    }

    .bar-right {
        display: none;
    }

    .settings-card,
    .settings-actions {
        max-width: none;
    }
}

@media (max-width: 860px) {
    body {
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }

    .app {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr);
        background:
            radial-gradient(
                circle at 20% 0%,
                rgba(139, 92, 246, 0.16),
                transparent 34%
            ),
            radial-gradient(
                circle at 88% 12%,
                rgba(236, 72, 153, 0.12),
                transparent 30%
            ),
            var(--bg);
    }

    .center {
        width: 100%;
        min-height: 0;
    }

    .right-panel {
        display: none;
    }

    .sidebar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 900;
        height: calc(72px + env(safe-area-inset-bottom, 0px));
        padding: 7px 10px calc(7px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        border-right: none;
        background: rgba(7, 7, 13, 0.9);
        box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.45);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        overflow: hidden;
    }

    .sidebar .logo,
    .sidebar #localSidebarSection,
    .sidebar .nav-section,
    .sidebar .sidebar-divider {
        display: none !important;
    }

    .sidebar nav {
        display: grid;
        height: 100%;
        grid-auto-flow: column;
        grid-auto-columns: minmax(54px, 1fr);
        align-items: stretch;
        gap: 4px;
        padding: 0;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .sidebar nav::-webkit-scrollbar {
        display: none;
    }

    .sidebar #defaultNav .nav-item[data-nav="home"],
    .sidebar #defaultNav .nav-item[data-nav="artists"],
    .sidebar #defaultNav .nav-item[data-nav="history"] {
        display: none;
    }

    .sidebar .nav-item {
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        margin: 0;
        padding: 7px 5px;
        border: 1px solid transparent;
        border-radius: 16px;
        font-size: 10px;
        line-height: 1;
        text-align: center;
        white-space: nowrap;
    }

    .sidebar .nav-item svg {
        width: 20px;
        height: 20px;
    }

    .sidebar .nav-item.active {
        border-color: rgba(139, 92, 246, 0.35);
        background: rgba(139, 92, 246, 0.2);
        box-shadow: 0 0 18px rgba(139, 92, 246, 0.16);
    }

    .topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
        align-items: center;
        padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 12px;
        border-bottom-color: transparent;
        background: linear-gradient(
            180deg,
            rgba(13, 13, 20, 0.96),
            rgba(13, 13, 20, 0.88)
        );
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

    .search-box {
        grid-column: 1;
        grid-row: 1;
        width: 100%;
        min-width: 0;
        padding: 10px 13px;
        border-radius: 14px;
        background: rgba(30, 30, 53, 0.72);
    }

    .kbd {
        display: none;
    }

    .topbar-right {
        grid-column: 2;
        grid-row: 1;
        gap: 8px;
        margin-left: 0;
    }

    .icon-btn,
    .avatar {
        width: 38px;
        height: 38px;
    }

    .notification-panel,
    .profile-panel {
        position: fixed;
        top: calc(62px + env(safe-area-inset-top, 0px));
        right: 12px;
        left: 12px;
        width: auto;
        max-height: calc(100dvh - 156px);
    }

    .nav-tabs {
        grid-column: 1 / -1;
        grid-row: 2;
        order: initial;
        width: 100%;
        gap: 8px;
        padding: 2px 0 0;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .tab {
        flex: 0 0 auto;
        padding: 9px 12px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.04);
        font-size: 12px;
    }

    .tab.active {
        border: 1px solid rgba(139, 92, 246, 0.4);
        border-radius: 999px;
        background: rgba(139, 92, 246, 0.18);
    }

    .topbar-quality-select {
        flex: 0 0 auto;
        margin-left: 0;
        padding-left: 0;
        border-left: none;
    }

    .topbar-quality-options {
        gap: 7px;
    }

    .topbar-quality-option {
        min-width: 86px;
        padding: 8px 10px;
        border-radius: 10px;
    }

    #homeView,
    #searchView,
    #favoritesView,
    #playlistsView,
    #cloudView,
    #downloadsView,
    #settingsView {
        --mobile-content-bottom-space: calc(
            184px + env(safe-area-inset-bottom, 0px)
        );
        padding-bottom: var(--mobile-content-bottom-space);
        overflow-y: auto;
        scroll-padding-bottom: var(--mobile-content-bottom-space);
        scrollbar-width: none;
    }

    #searchView::-webkit-scrollbar,
    #favoritesView::-webkit-scrollbar,
    #downloadsView::-webkit-scrollbar {
        display: none;
    }

    .section-header {
        align-items: flex-start;
        gap: 12px;
        padding: 16px 14px 12px;
    }

    .section-title {
        font-size: 17px;
    }

    .result-list-container {
        flex: 0 0 auto;
        min-height: auto;
        padding: 0 8px;
        overflow: visible;
    }

    .pagination {
        margin-bottom: 8px;
    }

    .result-list {
        gap: 4px;
    }

    .result-item {
        grid-template-columns: 46px minmax(0, 1fr) auto auto auto;
        gap: 9px;
        margin: 0;
        padding: 9px 8px;
        border: 1px solid rgba(255, 255, 255, 0.045);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.025);
    }

    .result-item:hover,
    .result-item.active {
        background: rgba(139, 92, 246, 0.12);
    }

    .result-meta {
        display: none;
    }

    .result-title {
        font-size: 13.5px;
    }

    .result-subtitle {
        margin-top: 2px;
        font-size: 11.5px;
    }

    .result-more,
    .track-dl,
    .playlist-track-delete {
        width: 32px;
        height: 32px;
    }

    .cover {
        width: 46px;
        height: 46px;
        border-radius: 10px;
    }

    .search-suggestions {
        position: fixed;
        top: calc(58px + env(safe-area-inset-top, 0px));
        left: 12px;
        right: 12px;
        max-height: min(420px, calc(100dvh - 190px));
    }

    .search-album-tracks {
        margin: 4px 0 4px;
        padding: 8px;
    }

    .album-track-row {
        grid-template-columns: 24px minmax(0, 1fr) auto auto auto;
        gap: 6px;
        min-height: 40px;
    }

    .album-track-duration {
        display: none;
    }

    .playlist-page {
        padding: 0 14px 20px;
    }

    .playlist-page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-create-playlist,
    .playlist-download-cloud,
    .playlist-play-btn,
    .playlist-back,
    .playlist-delete {
        min-height: 40px;
    }

    .playlist-grid {
        grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
        gap: 10px;
    }

    .playlist-page-card {
        min-height: 160px;
        padding: 12px;
    }

    .delete-album-btn {
        opacity: 1;
    }

    .playlist-detail-actions {
        gap: 8px;
    }

    .playlist-detail-actions .playlist-delete {
        margin-left: 0;
    }

    .playlist-detail-card {
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 14px;
        padding: 14px;
    }

    .playlist-detail-cover {
        width: 96px;
        height: 96px;
        font-size: 42px;
    }

    .playlist-detail-title {
        font-size: 22px;
    }

    .playlist-track-row {
        grid-template-columns: 28px minmax(0, 1fr) auto;
        gap: 8px;
        padding: 10px 6px;
    }

    .playlist-track-quality {
        display: none;
    }

    .playlist-track-actions {
        gap: 5px;
    }

    .downloads-tabs {
        margin: 0 14px 18px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .downloads-tabs::-webkit-scrollbar {
        display: none;
    }

    .settings-content {
        padding: 0 14px 22px;
    }

    .settings-card {
        padding: 18px;
        border-radius: 14px;
    }

    .settings-card-header {
        gap: 12px;
        margin-bottom: 18px;
        padding-bottom: 16px;
    }

    .settings-card-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        font-size: 20px;
    }

    .toggle-group {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        column-gap: 14px;
    }

    .settings-toggle-info {
        min-width: 0;
        max-width: none;
    }

    .toggle-group .switch-container {
        flex: 0 0 44px;
        justify-self: end;
        align-self: center;
    }

    .settings-actions {
        flex-wrap: wrap;
    }

    .settings-btn {
        flex: 1 1 140px;
    }

    .bottom-bar {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(82px + env(safe-area-inset-bottom, 0px));
        z-index: 850;
        min-height: 70px;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
        padding: 10px 12px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 22px;
        background: rgba(7, 7, 13, 0.86);
        box-shadow:
            0 18px 55px rgba(0, 0, 0, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.04);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
    }

    .bar-track {
        gap: 9px;
    }

    .bar-thumb {
        width: 46px;
        height: 46px;
        border-radius: 12px;
    }

    .bar-track-name {
        font-size: 13px;
    }

    .bar-track-artist {
        font-size: 11px;
    }

    .bar-local-badge,
    .bar-progress,
    .bar-right {
        display: none;
    }

    .bar-controls {
        display: block;
    }

    .bar-btns {
        gap: 8px;
    }

    .bar-ctrl {
        width: 34px;
        height: 34px;
    }

    .bar-play {
        width: 44px;
        height: 44px;
    }

    .equalizer-popover {
        left: 10px;
        right: 10px;
        bottom: calc(158px + env(safe-area-inset-bottom, 0px));
        width: auto;
    }

    .equalizer-popover-arrow {
        display: none;
    }

    .global-download-widget {
        left: auto;
        right: 16px;
        bottom: calc(166px + env(safe-area-inset-bottom, 0px));
    }

    .global-download-popup {
        right: 0;
        left: auto;
        width: min(300px, calc(100vw - 32px));
    }

    .modal-backdrop {
        align-items: end;
        padding: 12px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .modal-card {
        width: 100%;
        max-height: calc(100dvh - 40px);
        overflow-y: auto;
        border-radius: 20px;
    }
}

@media (max-width: 520px) {
    .topbar {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
        padding-inline: 12px;
    }

    .topbar-right {
        gap: 6px;
    }

    .icon-btn,
    .avatar {
        width: 36px;
        height: 36px;
    }

    .nav-tabs {
        gap: 6px;
    }

    .tab {
        padding: 8px 10px;
        font-size: 11.5px;
    }

    .topbar-quality-option {
        min-width: 78px;
        padding: 7px 8px;
    }

    .topbar-quality-option .qname {
        font-size: 10.5px;
    }

    .topbar-quality-option .qbps {
        font-size: 8.5px;
    }

    .sidebar {
        height: calc(68px + env(safe-area-inset-bottom, 0px));
        padding-inline: 7px;
    }

    .sidebar nav {
        grid-auto-columns: minmax(50px, 1fr);
        gap: 2px;
    }

    .sidebar .nav-item {
        border-radius: 14px;
        font-size: 9.5px;
    }

    .sidebar .nav-item svg {
        width: 19px;
        height: 19px;
    }

    .section-header {
        padding-inline: 12px;
    }

    .result-list-container {
        padding-inline: 6px;
    }

    .result-item {
        grid-template-columns: 42px minmax(0, 1fr) auto auto auto;
        gap: 7px;
        padding: 8px 7px;
    }

    .cover {
        width: 42px;
        height: 42px;
    }

    .result-more,
    .track-dl,
    .playlist-track-delete {
        width: 30px;
        height: 30px;
    }

    .playlist-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .playlist-detail-card {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .playlist-detail-cover {
        width: 112px;
        height: 112px;
    }

    .playlist-cover-picker {
        grid-template-columns: 1fr;
    }

    .playlist-track-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .playlist-track-index,
    .playlist-track-artist {
        display: none;
    }

    .pagination {
        gap: 8px;
        padding-inline: 4px;
    }

    .page-button {
        min-width: 0;
        flex: 1 1 120px;
    }

    .page-numbers {
        order: -1;
        width: 100%;
    }

    .bottom-bar {
        left: 10px;
        right: 10px;
        bottom: calc(76px + env(safe-area-inset-bottom, 0px));
        border-radius: 20px;
    }

    .bar-thumb {
        width: 42px;
        height: 42px;
    }

    .bar-ctrl {
        width: 30px;
        height: 30px;
    }

    .bar-btns {
        gap: 6px;
    }

    .bar-play {
        width: 42px;
        height: 42px;
    }

    .settings-card {
        padding: 16px;
    }

    .settings-card-header,
    .settings-title-container {
        align-items: flex-start;
    }
}

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

    .topbar-right {
        position: absolute;
        top: calc(12px + env(safe-area-inset-top, 0px));
        right: 12px;
    }

    .search-box {
        padding-right: 86px;
    }

    .result-item {
        grid-template-columns: 40px minmax(0, 1fr) auto auto;
    }

    .cover {
        width: 40px;
        height: 40px;
    }

    .result-context,
    .track-context {
        display: none;
    }

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