:root {
    --bg-base: #000000;
    --bg-main: #000000;
    --bg-elevated: #16181c;
    --bg-card: #16181c;
    --bg-card-hover: #1d1f23;
    --bg-surface-2: #202327;
    --bg-hover: rgba(231,233,234,0.1);
    --border: #2f3336;
    --border-hover: #3e4144;
    --text-primary: #e7e9ea;
    --text-secondary: #71767b;
    --text-muted: #565a5e;
    --primary: #e7e9ea;
    --primary-hover: #ffffff;
    --primary-soft: rgba(231,233,234,0.10);
    --primary-glow: rgba(231,233,234,0.28);
    --danger: #f4212e;
    --success: #00ba7c;
    --white: #fff;

    --sidebar-w: 260px;
    --playerbar-h: 88px;

    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-xl: 18px;

    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-md: 0 12px 32px rgba(0,0,0,0.6);
    --shadow-lg: 0 24px 64px rgba(0,0,0,0.7);
}

* { box-sizing: border-box; }
*::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    position: relative;
    transition: background 0.4s ease, color 0.25s ease;
}

/* Per-theme overrides live in /assets/css/themes.css (loaded after this file). */
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { display: block; max-width: 100%; }

/* ===== X.COM STARFIELD + SHOOTING STARS ===== */
.stars {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background: #000;
}
.stars-layer {
    position: absolute;
    inset: 0;
    background-repeat: repeat;
}
.stars-1 {
    background-image:
        radial-gradient(2.5px 2.5px at 20% 30%, rgba(255,255,255,1), transparent),
        radial-gradient(2.5px 2.5px at 60% 70%, rgba(255,255,255,1), transparent),
        radial-gradient(3px 3px at 80% 10%, rgba(255,255,255,1), transparent),
        radial-gradient(2px 2px at 40% 90%, rgba(255,255,255,0.95), transparent),
        radial-gradient(2.5px 2.5px at 10% 50%, rgba(255,255,255,1), transparent),
        radial-gradient(2px 2px at 90% 60%, rgba(255,255,255,0.9), transparent),
        radial-gradient(2px 2px at 25% 65%, rgba(255,255,255,0.95), transparent),
        radial-gradient(2.5px 2.5px at 75% 35%, rgba(255,255,255,1), transparent);
    background-size: 280px 280px;
    animation: twinkle-near 4s ease-in-out infinite,
               drift-near 90s linear infinite;
    will-change: background-position, opacity;
    opacity: 1;
}
.stars-2 {
    background-image:
        radial-gradient(3px 3px at 35% 25%, rgba(255,255,255,1), transparent),
        radial-gradient(3px 3px at 70% 55%, rgba(255,255,255,1), transparent),
        radial-gradient(3px 3px at 15% 80%, rgba(255,255,255,1), transparent),
        radial-gradient(2.5px 2.5px at 50% 15%, rgba(255,255,255,0.95), transparent),
        radial-gradient(3px 3px at 85% 90%, rgba(255,255,255,1), transparent);
    background-size: 450px 450px;
    animation: twinkle-mid 6s ease-in-out infinite,
               drift-mid 160s linear infinite;
    will-change: background-position, opacity;
    opacity: 1;
}
.stars-3 {
    background-image:
        radial-gradient(1.5px 1.5px at 12% 18%, rgba(255,255,255,0.85), transparent),
        radial-gradient(1.5px 1.5px at 88% 42%, rgba(255,255,255,0.8), transparent),
        radial-gradient(1.5px 1.5px at 45% 75%, rgba(255,255,255,0.85), transparent),
        radial-gradient(1.5px 1.5px at 30% 88%, rgba(255,255,255,0.75), transparent);
    background-size: 200px 200px;
    animation: twinkle-far 8s ease-in-out infinite,
               drift-far 260s linear infinite;
    will-change: background-position, opacity;
    opacity: 0.9;
    display: block;
}

@keyframes drift-near {
    from { background-position: 0 0; }
    to   { background-position: -560px 560px; }
}
@keyframes drift-mid {
    from { background-position: 0 0; }
    to   { background-position: -900px -900px; }
}
@keyframes drift-far {
    from { background-position: 0 0; }
    to   { background-position: 400px -400px; }
}
.nebula { display: none; }

@keyframes twinkle-near {
    0%, 100% { opacity: 0.85; }
    50%      { opacity: 1; }
}
@keyframes twinkle-mid {
    0%, 100% { opacity: 0.85; }
    50%      { opacity: 1; }
}
@keyframes twinkle-far {
    0%, 100% { opacity: 0.75; }
    50%      { opacity: 0.95; }
}

/* ===== APP LAYOUT ===== */
.app {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: 1fr var(--playerbar-h);
    grid-template-areas: "sidebar main" "player player";
    height: 100vh;
    width: 100vw;
    gap: 10px;
    padding: 10px 10px 0;
}
.now-playing-panel {
    position: fixed;
    right: 10px;
    top: 10px;
    bottom: calc(var(--playerbar-h) + 10px);
    width: 360px;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateX(calc(100% + 16px));
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 40;
}
.app.now-playing-open .now-playing-panel { transform: translateX(0); }
.main-scroll { transition: padding-right 0.28s cubic-bezier(0.4, 0, 0.2, 1); }
.app.now-playing-open .main-scroll { padding-right: 380px; }
.np-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.np-head-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}
.np-head-actions { display: flex; gap: 4px; }
.np-icon-btn {
    width: 34px; height: 34px;
    background: transparent; border: 0; border-radius: 50%;
    color: var(--text-secondary); cursor: pointer; padding: 0;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.np-icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.np-edge-toggle {
    position: fixed;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 64px;
    background: var(--sidebar-bg, rgba(20,20,24,0.95));
    border: 1px solid var(--border);
    border-right: 0;
    border-radius: 8px 0 0 8px;
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 45;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: right 0.28s cubic-bezier(0.4, 0, 0.2, 1), color 0.15s;
}
.np-edge-toggle svg { transition: transform 0.2s; }
.np-edge-toggle:hover { color: var(--text-primary); }
body:has(.app.now-playing-open) .np-edge-toggle { opacity: 0; pointer-events: none; }
.np-overlay {
    position: absolute;
    inset: 0;
    background: var(--sidebar-bg, rgba(20,20,24,0.98));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--r-lg);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5;
}
.np-overlay.open { transform: translateX(0); }
.np-overlay-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.np-overlay-head h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--text-primary); }
.np-overlay-body { flex: 1; overflow-y: auto; padding: 16px; }
.np-view { flex: 1; overflow-y: auto; padding: 16px; scrollbar-width: thin; }
.np-view::-webkit-scrollbar { width: 6px; }
.np-view::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
.np-cover {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
    background: var(--bg-surface-2);
    object-fit: cover;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    margin-bottom: 20px;
}
.np-title { font-size: 20px; font-weight: 700; color: var(--text-primary); margin: 0 0 4px; line-height: 1.3; }
.np-artist { font-size: 14px; color: var(--text-secondary); margin: 0 0 24px; }
.np-section-head {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--text-muted); margin: 0 0 12px;
}
.np-up-next-link {
    width: 100%; min-height: 24px; display: flex; align-items: center; justify-content: space-between;
    padding: 0; border: 0; background: transparent; font: inherit; text-align: left; cursor: pointer;
    margin: 24px 0 12px;
}
.np-up-next-link:hover { color: var(--text-primary); }
.np-up-next-link:focus-visible {
    outline: 2px solid currentColor; outline-offset: 3px; border-radius: 4px;
}
.np-up-next-preview { cursor: default; }
.np-up-next-preview:hover { background: transparent; }
.np-artist-card {
    display: flex; align-items: center; gap: 12px;
    padding: 10px; border-radius: 8px; cursor: pointer; transition: background 0.15s;
    text-decoration: none; color: inherit;
}
.np-artist-card:hover { background: var(--bg-hover); }
.np-artist-avatar {
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--bg-surface-2); display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary); flex-shrink: 0;
}
.np-artist-name { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.np-artist-role { font-size: 12px; color: var(--text-secondary); }
.np-up-next {
    display: flex; align-items: center; gap: 12px;
    padding: 8px; border-radius: 6px; cursor: pointer;
    transition: background 0.15s;
}
.np-up-next:hover { background: var(--bg-hover); }
.np-up-next-cover {
    width: 40px; height: 40px; border-radius: 4px;
    background: var(--bg-surface-2);
    object-fit: cover; flex-shrink: 0;
}
.np-up-next-info { min-width: 0; }
.np-up-next-title { font-size: 13px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-up-next-artist { font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-lyrics {
    padding: 24px 8px 240px;
    font-family: var(--font);
}
.np-lyrics .np-lyric-line {
    font-size: 27px;
    line-height: 1.22;
    font-weight: 800;
    letter-spacing: -0.012em;
    color: rgba(255, 255, 255, 0.24);
    margin: 0 0 16px;
    padding: 4px 4px;
    transition: color 0.5s ease, transform 0.6s cubic-bezier(0.32, 0.72, 0, 1), filter 0.5s ease;
    transform-origin: left center;
    filter: blur(0px);
    cursor: pointer;
    border-radius: 6px;
    word-wrap: break-word;
}
.np-lyrics .np-lyric-line.past {
    color: rgba(255, 255, 255, 0.18);
    filter: blur(0.8px);
}
.np-lyrics .np-lyric-line.active {
    color: rgba(255, 255, 255, 0.6);
    transform: scale(1.03);
    filter: blur(0);
}
.np-lyrics .np-lyric-line.np-lyric-gap-after { margin-bottom: 44px; }
.np-lyrics .np-lyric-line:hover { color: rgba(255,255,255,0.5); }

.np-lyrics .np-word {
    display: inline-block;
    transition: color 0.25s ease, text-shadow 0.3s ease, transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    color: inherit;
    transform-origin: center bottom;
}
.np-lyrics .np-lyric-line.active .np-word.lit {
    color: #fff;
    text-shadow: 0 0 18px rgba(255,255,255,0.22);
}
.np-lyrics .np-lyric-line.active .np-word.now {
    transform: scale(1.05);
    text-shadow: 0 0 26px rgba(255,255,255,0.35);
}

.np-lyrics .np-lyric-inst {
    display: flex;
    gap: 10px;
    align-items: center;
    height: 32px;
    margin: 18px 0 18px;
    padding: 6px 6px;
}
.np-lyrics .np-inst-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.22);
    transition: background 0.3s ease, transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}
.np-lyrics .np-lyric-line.active .np-inst-dot { background: rgba(255,255,255,0.4); }
.np-lyrics .np-lyric-line.active .np-inst-dot.lit {
    background: #fff;
    transform: scale(1.25);
    box-shadow: 0 0 14px rgba(255,255,255,0.5);
}
.np-lyrics-empty {
    color: var(--text-muted); font-size: 14px; text-align: center; padding: 40px 12px;
}

/* Plain lyrics fallback (no LRC sync) */
.np-lyrics:not(:has(.np-lyric-line)) {
    font-size: 17px; line-height: 1.7; color: var(--text-primary); font-weight: 500;
    white-space: pre-wrap; padding: 12px 4px;
}
@media (max-width: 1100px) {
    .app.now-playing-open { grid-template-columns: var(--sidebar-w) 1fr 320px; }
}
@media (max-width: 900px) {
    .app.now-playing-open { grid-template-columns: var(--sidebar-w) 0 1fr; }
}

/* ===== SIDEBAR ===== */
.sidebar {
    grid-area: sidebar;
    background: var(--sidebar-bg, rgba(0,0,0,0.25));
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 4px 0;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 18px 22px 12px; }
.brand-logo {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 18px;
    color: #000;
}
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -0.02em; color: var(--text-primary); }

.sidebar-section { padding: 8px 0 12px; }
.sidebar-section + .sidebar-section { border-top: 1px solid var(--border); margin-top: 4px; }
.sidebar-section-label { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; padding: 8px 22px; }
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 11px 22px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    position: relative;
    border-radius: 0;
}
.sidebar-item:hover { background: var(--bg-hover); }
.sidebar-item.active { font-weight: 800; }
.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 4px; height: 22px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}
.sidebar-item svg { flex-shrink: 0; }
.sidebar-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-footer { margin-top: auto; padding: 12px; }
.user-menu { position: relative; }
.user-button {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 999px;
    width: 100%;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-primary);
    font-family: inherit;
}
.user-button:hover { background: var(--bg-hover); }
.user-button > svg { color: var(--text-secondary); transition: transform 0.2s ease; }
.user-button.open > svg { transform: rotate(180deg); }
.user-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 14px; color: #000;
    flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; text-align: left; }
.user-name { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 12px; color: var(--text-secondary); }

.user-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0; right: 0;
    background: #000;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    display: none;
    z-index: 100;
}
.user-dropdown.open { display: block; }
.user-dropdown-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--text-primary); font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.12s ease; }
.user-dropdown-item:hover { background: var(--bg-hover); }

/* ===== MAIN ===== */
.main {
    grid-area: main;
    background: var(--main-bg, rgba(0,0,0,0.2));
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    position: relative;
}
.main-scroll { height: 100%; overflow-y: auto; padding: 28px 36px 80px; transition: opacity 0.15s ease; }
.main-scroll::-webkit-scrollbar { width: 10px; }
.main-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
.main-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); background-clip: padding-box; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

/* ===== HEADER ===== */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; padding-top: 4px; }
.page-title { font-size: 44px; font-weight: 900; letter-spacing: -0.04em; margin: 0; line-height: 1; color: var(--text-primary); }
.page-subtitle { color: var(--text-secondary); font-size: 14px; margin-top: 12px; font-weight: 500; }

/* ===== TOOLBAR ===== */
.toolbar { display: flex; align-items: center; gap: 8px; }
.search-input {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px 18px;
    border-radius: 999px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    width: 380px;
    max-width: 100%;
    transition: all 0.18s ease;
    font-weight: 500;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--primary);
    color: #000;
    border: 0;
    padding: 11px 24px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn:hover { background: var(--primary-hover); }
.btn:active { transform: scale(0.97); }
.btn-secondary { background: transparent; border: 1px solid var(--border-hover); color: var(--text-primary); }
.btn-secondary:hover { background: var(--bg-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #d61f29; }
.btn-icon { width: 38px; height: 38px; padding: 0; background: transparent; border: 1px solid var(--border); color: var(--text-secondary); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.12s ease; }
.btn-icon:hover { color: var(--text-primary); background: var(--bg-hover); }

/* ===== ALBUM GRID ===== */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.album-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-md); cursor: pointer; transition: all 0.2s ease; padding: 16px; position: relative; }
.album-card:hover { background: var(--bg-card-hover); border-color: var(--border-hover); }
.album-cover { width: 100%; aspect-ratio: 1/1; background: var(--bg-surface-2); border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; color: var(--text-muted); overflow: hidden; margin-bottom: 14px; position: relative; box-shadow: var(--shadow-sm); }
.album-cover img { width: 100%; height: 100%; object-fit: cover; }

/* ===== SONG TABLE ===== */
.recent-chip { transition: background 0.15s, border-color 0.15s, transform 0.1s; }
.recent-chip:hover { background: rgba(255,255,255,0.1) !important; border-color: rgba(255,255,255,0.18) !important; }
.recent-chip:active { transform: scale(0.97); }

.song-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.song-table thead th { text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.08em; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--bg-base); }
.song-table thead th.center { text-align: center; }
.song-table tbody tr { cursor: pointer; transition: background 0.12s ease; user-select: none; -webkit-user-select: none; }
.song-table tbody tr:hover { background: var(--bg-hover); }
.song-table tbody tr.playing .song-title { color: var(--primary); }
.song-table tbody td { padding: 8px 12px; vertical-align: middle; }
.song-table .col-idx { width: 50px; text-align: center; color: var(--text-muted); font-variant-numeric: tabular-nums; position: relative; }
.song-table .col-time { width: 80px; text-align: center; color: var(--text-secondary); font-variant-numeric: tabular-nums; font-weight: 500; }
.song-table .col-added { width: 110px; color: var(--text-secondary); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.song-table .col-fav { width: 40px; text-align: center; color: var(--text-muted); }
.song-table thead th.col-idx { text-align: center; color: var(--text-muted); }
.song-table thead th.col-time,
.song-table thead th.col-fav { text-align: center; color: var(--text-muted); }

/* ===== ACTIONS BAR (Spotify-style playlist) ===== */
.actions-bar { display: flex; align-items: center; gap: 20px; padding: 20px 0 24px; }
.action-play {
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--white); border: 0; color: #000; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.12s, background 0.12s; padding: 0; padding-left: 3px;
}
.action-play:hover { background: var(--white); transform: scale(1.06); }
.action-btn {
    width: 32px; height: 32px; padding: 0; background: transparent; border: 0;
    color: var(--text-secondary); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: color 0.12s, transform 0.12s;
}
.action-btn:hover { color: var(--text-primary); transform: scale(1.08); }
.action-shuffle.active { color: #e7e9ea; }
.action-more-wrap { position: relative; }
.action-more-menu {
    position: absolute; top: calc(100% + 6px); left: 0;
    background: var(--bg-elevated, #1a1a1f);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px;
    min-width: 220px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.5);
    display: none;
    z-index: 30;
}
.action-more-menu.open { display: block; }
.action-more-menu .ctx-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 6px; cursor: pointer;
    color: var(--text-primary); font-size: 14px;
    transition: background 0.12s;
}
.action-more-menu .ctx-item:hover { background: rgba(255,255,255,0.06); }

/* ===== ALBUM MINI BAR (discography 3-button overlay) ===== */
.album-card-wrap:hover .album-mini-bar { opacity: 1; transform: translateY(0); }
.album-mini-bar {
    position: absolute; right: 18px; bottom: 78px;
    display: flex; gap: 4px;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    border-radius: 999px;
    padding: 6px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.15s, transform 0.15s;
}
.album-mini-btn {
    width: 28px; height: 28px; border-radius: 50%; border: 0;
    background: transparent; color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    padding: 0; transition: background 0.12s;
}
.album-mini-btn:hover { background: rgba(255,255,255,0.15); }
.album-mini-play { background: #1db954; color: #000; }
.album-mini-play:hover { background: #1ed760; }
.song-table thead th.sortable { cursor: pointer; user-select: none; transition: color 0.12s; }
.song-table thead th.sortable:hover { color: var(--text-primary); }
.song-table thead th.sortable.active { color: var(--text-primary); }
.song-table thead th.sortable .sort-arrow { display: inline-block; width: 8px; opacity: 0; transition: opacity 0.12s; }
.song-table thead th.sortable.active .sort-arrow { opacity: 1; }
.song-table thead th.sortable.asc .sort-arrow::after { content: '▲'; font-size: 9px; }
.song-table thead th.sortable.desc .sort-arrow::after { content: '▼'; font-size: 9px; }
@media (max-width: 1024px) {
    .song-table thead th:nth-child(5),
    .song-table tbody td:nth-child(5) { display: none; }
}
@media (max-width: 820px) {
    .song-table thead th:nth-child(4),
    .song-table tbody td:nth-child(4) { display: none; }
}
@media (max-width: 720px) {
    .app {
        grid-template-columns: 1fr !important;
        grid-template-areas: "main" "player" !important;
        grid-template-rows: 1fr auto !important;
        padding: 0 !important;
        gap: 0 !important;
    }
    .main {
        border: 0;
        border-radius: 0;
        background: transparent;
    }
    .sidebar {
        display: none !important;
    }
    body.sidebar-open .sidebar {
        display: flex !important;
        flex-direction: column !important;
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        z-index: 100 !important;
        width: 82% !important;
        max-width: 320px !important;
        box-shadow: 8px 0 32px rgba(0,0,0,0.7) !important;
        background: #0a0a0d !important;
        overflow-y: auto !important;
        padding: 16px 12px !important;
    }
    body.sidebar-open::before {
        content: "" !important;
        position: fixed !important;
        inset: 0 !important;
        background: rgba(0,0,0,0.6) !important;
        z-index: 99 !important;
    }
    body.sidebar-open .mobile-menu-btn { display: none !important; }
    body.sidebar-open .sidebar .sidebar-item,
    body.sidebar-open .sidebar a {
        display: flex !important;
        align-items: center !important;
        gap: 14px !important;
        padding: 12px 14px !important;
        border-radius: 10px !important;
        font-size: 15px !important;
        color: var(--text-secondary, #b3b3b3) !important;
        text-decoration: none !important;
        width: 100% !important;
        box-sizing: border-box !important;
        min-height: 44px !important;
    }
    body.sidebar-open .sidebar .sidebar-item svg,
    body.sidebar-open .sidebar a svg { width: 22px !important; height: 22px !important; flex-shrink: 0 !important; }
    body.sidebar-open .sidebar .sidebar-item.active,
    body.sidebar-open .sidebar a.active { background: rgba(255,255,255,0.08) !important; color: #fff !important; }
    body.sidebar-open .sidebar h2,
    body.sidebar-open .sidebar .sidebar-section-title {
        font-size: 11px !important;
        text-transform: uppercase !important;
        letter-spacing: 0.08em !important;
        color: var(--text-muted, #888) !important;
        margin: 18px 14px 8px !important;
        font-weight: 700 !important;
    }
    body.sidebar-open .sidebar .playlists,
    body.sidebar-open .sidebar .sidebar-playlists,
    body.sidebar-open .sidebar ul {
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    body.sidebar-open .sidebar .playlist-item {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        padding: 10px 14px !important;
        border-radius: 8px !important;
        font-size: 14px !important;
        color: var(--text-secondary, #b3b3b3) !important;
        text-decoration: none !important;
        min-height: 40px !important;
    }
    body.sidebar-open .sidebar .playlist-item:hover,
    body.sidebar-open .sidebar .sidebar-item:hover { background: rgba(255,255,255,0.04) !important; color: #fff !important; }
    body.sidebar-open .sidebar > * + * { margin-top: 2px !important; }
    body.sidebar-open .sidebar .sidebar-footer,
    body.sidebar-open .sidebar .settings-link {
        margin-top: auto !important;
        border-top: 1px solid rgba(255,255,255,0.08) !important;
        padding-top: 12px !important;
    }
    body.sidebar-open::after {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 89;
    }
    .main { width: 100%; }
    .main-scroll { padding: 70px 16px 120px !important; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
    .page-title { font-size: 28px !important; font-weight: 700; }
    .page-subtitle { font-size: 12px; }
    .mobile-menu-btn {
        display: inline-flex !important;
        position: fixed;
        top: 12px;
        left: 12px;
        z-index: 95;
        width: 40px;
        height: 40px;
        border-radius: 10px;
        background: rgba(20,20,24,0.92);
        backdrop-filter: blur(8px);
        border: 1px solid rgba(255,255,255,0.08);
        color: var(--text-primary);
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }
    .song-table thead th:nth-child(3),
    .song-table tbody td:nth-child(3) { display: none; }
    .song-table .col-idx { width: 36px; }
    .song-table .col-time { width: 56px; }
    .song-table thead th { padding: 8px 6px; font-size: 10px; }
    .song-table tbody td { padding: 8px 6px; }
    .song-cell { gap: 10px; }
    .song-cover { width: 40px; height: 40px; }
    .song-title { font-size: 14px; }
    .song-info::after {
        content: attr(data-mobile-meta);
        display: block;
        color: var(--text-muted);
        font-size: 11px;
        margin-top: 2px;
    }
    .actions-bar { flex-wrap: wrap; gap: 8px; }
    .action-play { width: 48px; height: 48px; }
    .playlist-filter { min-width: 0; width: 100%; }
    .radio-header { flex-direction: column; gap: 12px; padding-top: 8px; }
    .radio-header-cover { width: 120px; height: 120px; }
    .radio-header-title { font-size: 28px !important; }
    .pending-track-progress { width: 60px; }
    .pending-track-meta { min-width: 0; }
    .album-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important; gap: 12px !important; }
    .row-fav-btn, .row-play-btn { width: 36px; height: 36px; }

    .player-bar {
        position: fixed;
        bottom: calc(var(--tabbar-h, 60px) + 8px + env(safe-area-inset-bottom, 0px));
        left: 8px;
        right: 8px;
        z-index: 80;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 12px;
        height: 64px;
        background: #2a2a30;
        border-radius: 12px;
        border: 1px solid rgba(255,255,255,0.06);
        box-shadow: 0 8px 24px rgba(0,0,0,0.5);
        cursor: pointer;
    }
    .pb-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
    .pb-cover { width: 44px; height: 44px; border-radius: 6px; overflow: hidden; flex-shrink: 0; }
    .pb-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .pb-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; overflow: hidden; }
    .pb-title { display: block; font-size: 13px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
    .pb-artist { display: block; font-size: 11px; color: #b3b3b3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; margin-top: 2px; }
    #pb-favorite, .pb-btn-mini { display: none !important; }
    .pb-center { display: flex; align-items: center; flex-shrink: 0; }
    .pb-controls { display: flex; align-items: center; gap: 6px; }
    #pb-shuffle, #pb-prev, #pb-repeat { display: none !important; }
    #pb-play { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: #fff; color: #000; border-radius: 50%; border: 0; padding: 0; }
    #pb-play svg { color: #000; fill: #000; width: 18px; height: 18px; }
    #pb-next { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; background: transparent; color: #fff; border: 0; padding: 0; }
    #pb-next svg { color: #fff; stroke: #fff; width: 18px; height: 18px; }
    .pb-seek { display: none; }
    .pb-right { display: none !important; }
    .now-playing-panel { display: none !important; }
    .np-edge-toggle { display: none !important; }

    .ctx-menu {
        min-width: 240px !important;
        font-size: 15px;
    }
    .ctx-item {
        padding: 14px 16px !important;
        font-size: 15px !important;
    }

    /* removed global button override that broke settings pills */

    .dialog-content, .modal-content {
        max-width: 92vw !important;
        max-height: 80vh !important;
    }
}
.mobile-menu-btn { display: none; }
.mobile-bottom-nav { display: none; }

/* liked songs item: zwykły sidebar-item bez różowych tiles */

@media (max-width: 720px) {
    :root {
        --safe-bottom: env(safe-area-inset-bottom, 0px);
        --safe-top: env(safe-area-inset-top, 0px);
        --tabbar-h: 60px;
        --mini-player-h: 64px;
    }
    html, body { overflow-x: hidden; }
    body { padding-bottom: calc(var(--tabbar-h) + var(--mini-player-h) + var(--safe-bottom)) !important; }

    .app, .layout {
        display: block !important;
        grid-template-columns: none !important;
        grid-template-areas: none !important;
        gap: 0 !important;
        padding: 0 !important;
        height: auto !important;
        min-height: 100vh;
        border: 0 !important;
    }
    .sidebar, .mobile-menu-btn, .now-playing-panel, .np-edge-toggle {
        display: none !important;
    }
    .main {
        display: block !important;
        width: 100% !important;
        max-width: 100vw !important;
        background: transparent !important;
        border: 0 !important;
        border-radius: 0 !important;
        height: auto !important;
        padding: 0 !important;
        overflow: visible !important;
    }
    .main-scroll {
        height: auto !important;
        min-height: calc(100vh - var(--tabbar-h) - var(--mini-player-h));
        overflow: visible !important;
        padding: 20px 14px 24px !important;
    }

    /* mobile player overrides — wyłączone, używamy desktop CSS */
    .player-bar.player-bar-disabled {
        position: fixed !important;
        bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 8px) !important;
        left: 8px !important;
        right: 8px !important;
        z-index: 80 !important;
        height: 72px !important;
        padding: 10px 12px !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 12px !important;
        background: linear-gradient(180deg, #2a2a30, #1f1f24) !important;
        border-radius: 12px !important;
        border: 1px solid rgba(255,255,255,0.06) !important;
        box-shadow: 0 8px 24px rgba(0,0,0,0.5) !important;
        cursor: pointer !important;
    }
    .player-bar .pb-left {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 12px !important;
        flex: 1 1 0 !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }
    .player-bar .pb-cover { width: 52px !important; height: 52px !important; border-radius: 6px !important; overflow: hidden !important; flex-shrink: 0 !important; }
    .player-bar .pb-cover img { width: 100% !important; height: 100% !important; object-fit: cover !important; display: block !important; }
    .player-bar .pb-meta {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        overflow: hidden !important;
    }
    .player-bar .pb-title, .player-bar #pb-title, .player-bar a.pb-title {
        display: block !important;
        font-size: 13px !important; font-weight: 700 !important;
        color: #fff !important; text-decoration: none !important;
        white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important;
        line-height: 1.2 !important;
    }
    .player-bar .pb-artist, .player-bar #pb-artist, .player-bar a.pb-artist {
        display: block !important;
        font-size: 11px !important;
        color: #b3b3b3 !important; text-decoration: none !important;
        white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important;
        margin-top: 2px !important;
    }
    .player-bar #pb-favorite, .player-bar .pb-btn-mini { display: none !important; }
    .player-bar .pb-center {
        flex: 0 0 auto !important;
        display: flex !important; align-items: center !important; justify-content: flex-end !important;
        gap: 6px !important;
    }
    .player-bar .pb-controls { display: flex !important; align-items: center !important; gap: 6px !important; }
    .player-bar #pb-shuffle, .player-bar #pb-prev, .player-bar #pb-repeat, .player-bar .pb-seek { display: none !important; }
    .player-bar #pb-play {
        display: inline-flex !important; align-items: center !important; justify-content: center !important;
        width: 44px !important; height: 44px !important;
        background: #fff !important; color: #000 !important;
        border: 0 !important; border-radius: 50% !important; padding: 0 !important;
    }
    .player-bar #pb-play svg { width: 18px !important; height: 18px !important; color: #000 !important; fill: #000 !important; }
    .player-bar #pb-next {
        display: inline-flex !important; align-items: center !important; justify-content: center !important;
        width: 36px !important; height: 36px !important;
        background: transparent !important; color: #fff !important; border: 0 !important; padding: 0 !important;
    }
    .player-bar #pb-next svg { width: 18px !important; height: 18px !important; color: #fff !important; stroke: #fff !important; }
    .player-bar .pb-right { display: none !important; }

    .player-bar {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 10px !important;
        padding: 8px 10px !important;
        cursor: pointer !important;
        height: 64px !important;
        min-height: 64px !important;
    }
    .player-bar .pb-left {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 10px !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        overflow: hidden !important;
        height: 100% !important;
    }
    .player-bar .pb-left > * { flex-shrink: 0 !important; }
    .player-bar .pb-left .pb-meta { flex: 1 1 auto !important; }
    .player-bar .pb-cover { width: 40px !important; height: 40px !important; border-radius: 5px !important; flex-shrink: 0 !important; }
    .player-bar .pb-cover img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
    .player-bar .pb-meta {
        min-width: 0 !important;
        flex: 1 1 auto !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
    }
    .player-bar a.pb-title, .player-bar .pb-title {
        display: block !important;
        width: 100% !important;
        font-size: 14px !important;
        line-height: 1.25 !important;
        font-weight: 600 !important;
        color: #fff !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        text-decoration: none !important;
    }
    .player-bar a.pb-artist, .player-bar .pb-artist {
        display: block !important;
        width: 100% !important;
        font-size: 12px !important;
        line-height: 1.3 !important;
        color: var(--text-muted,#aaa) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        text-decoration: none !important;
        margin-top: 2px !important;
    }
    .player-bar .pb-left .pb-btn-mini { display: none !important; }
    .player-bar .pb-center { display: flex !important; align-items: center !important; gap: 4px !important; }
    .player-bar .pb-center .pb-controls { display: flex !important; align-items: center !important; gap: 4px !important; }
    .player-bar #pb-shuffle,
    .player-bar #pb-prev,
    .player-bar #pb-repeat,
    .player-bar button#pb-prev,
    .player-bar .pb-center #pb-prev,
    .player-bar #pb-favorite,
    .player-bar .pb-btn-mini { display: none !important; visibility: hidden !important; }

    .player-bar .pb-left,
    .player-bar > .pb-left {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        flex: 1 1 0 !important;
        min-width: 0 !important;
        gap: 10px !important;
        overflow: hidden !important;
    }
    .player-bar .pb-meta,
    .player-bar .pb-left .pb-meta {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        flex: 1 1 0 !important;
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: hidden !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    .player-bar #pb-title,
    .player-bar a#pb-title,
    .player-bar .pb-meta a,
    .player-bar .pb-meta .pb-title {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: #ffffff !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        text-decoration: none !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    .player-bar #pb-artist,
    .player-bar a#pb-artist,
    .player-bar .pb-meta .pb-artist {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: #b3b3b3 !important;
        font-size: 11px !important;
        line-height: 1.3 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        text-decoration: none !important;
        max-width: 100% !important;
        width: 100% !important;
        margin-top: 2px !important;
    }
    .player-bar #pb-play, .player-bar .pb-play {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 44px !important; height: 44px !important;
        background: #fff !important; color: #000 !important;
        border-radius: 50% !important; border: 0 !important; padding: 0 !important;
    }
    .player-bar #pb-play svg { width: 20px !important; height: 20px !important; color: #000 !important; }
    .player-bar #pb-next {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 36px !important; height: 36px !important;
        background: transparent !important; color: #fff !important; border: 0 !important; padding: 0 !important;
    }
    .player-bar #pb-next svg { width: 18px !important; height: 18px !important; color: #fff !important; }
    .player-bar .pb-center .pb-controls,
    .player-bar .pb-center { gap: 4px !important; }
    .player-bar .pb-title, .player-bar a#pb-title { font-size: 13px !important; }
    .player-bar .pb-artist, .player-bar a#pb-artist { font-size: 11px !important; }
    .player-bar .pb-meta { width: 100% !important; }
    .player-bar .pb-meta .pb-title-marquee {
        display: inline-block;
        animation: pbMarquee 12s linear infinite;
        padding-left: 100%;
    }
    @keyframes pbMarquee {
        0% { transform: translateX(0); }
        100% { transform: translateX(-100%); }
    }

    .player-bar .pb-meta { flex: 1 1 auto !important; min-width: 0 !important; display: block !important; }
    .player-bar a#pb-title,
    .player-bar #pb-title,
    .player-bar .pb-title {
        display: block !important;
        max-width: 100% !important;
        font-size: 14px !important;
        font-weight: 700 !important;
        color: #ffffff !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        text-decoration: none !important;
        line-height: 1.2 !important;
    }
    .player-bar a#pb-artist,
    .player-bar #pb-artist,
    .player-bar .pb-artist {
        display: block !important;
        max-width: 100% !important;
        font-size: 12px !important;
        color: #b3b3b3 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        text-decoration: none !important;
        line-height: 1.3 !important;
        margin-top: 2px !important;
    }

    .now-playing-fullscreen {
        position: fixed;
        inset: 0;
        z-index: 200;
        background: linear-gradient(180deg, #2a2a30 0%, #0a0a0d 60%);
        padding: calc(20px + var(--safe-top)) 20px calc(24px + var(--safe-bottom));
        display: none;
        flex-direction: column;
        overflow-y: auto;
    }
    body.now-playing-open .now-playing-fullscreen { display: flex; }
    body.now-playing-open { overflow: hidden; }
    .np-fs-seek { display: flex; align-items: center; gap: 10px; margin: 18px 6px 8px; }
    .np-fs-seek span { font-size: 11px; color: rgba(255,255,255,0.55); font-family: 'JetBrains Mono', monospace; min-width: 36px; text-align: center; }
    .np-fs-seek-bar { flex: 1; height: 4px; background: rgba(255,255,255,0.14); border-radius: 999px; cursor: pointer; overflow: hidden; }
    .np-fs-seek-fill { height: 100%; background: #fff; border-radius: 999px; width: 0; transition: width 0.15s linear; }
    .now-playing-fullscreen .np-close {
        align-self: flex-start;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: rgba(0,0,0,0.4);
        border: 0;
        color: #fff;
        cursor: pointer;
        margin-bottom: 18px;
    }
    .now-playing-fullscreen .np-cover {
        width: min(85vw, 360px);
        aspect-ratio: 1;
        margin: 12vh auto 36px;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 24px 60px rgba(0,0,0,0.6);
        background: rgba(255,255,255,0.05);
    }
    .now-playing-fullscreen .np-cover img { width: 100%; height: 100%; object-fit: cover; }
    .now-playing-fullscreen .np-title { font-size: 22px; font-weight: 800; color: #fff; text-align: center; margin-bottom: 6px; }
    .now-playing-fullscreen .np-artist { font-size: 14px; color: var(--text-muted, #888); text-align: center; margin-bottom: 28px; }
    .now-playing-fullscreen .np-controls { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 20px; }
    .now-playing-fullscreen .np-controls .np-ctrl { background: transparent; border: 0; color: #fff; cursor: pointer; width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; }
    .now-playing-fullscreen .np-controls .np-play {
        width: 64px; height: 64px;
        border-radius: 50%;
        background: #fff;
        color: #000;
    }
    .player-bar .pb-left { display: flex !important; align-items: center !important; gap: 10px !important; min-width: 0 !important; }
    .player-bar .pb-left .pb-btn-mini { display: none !important; }
    .player-bar .pb-cover { width: 40px !important; height: 40px !important; border-radius: 5px !important; flex-shrink: 0 !important; }
    .player-bar .pb-meta { min-width: 0 !important; overflow: hidden !important; flex: 1 !important; }
    .player-bar .pb-title { display: block !important; font-size: 13px !important; font-weight: 600 !important; color: #fff !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
    .player-bar .pb-artist { display: block !important; font-size: 11px !important; color: var(--text-muted,#888) !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
    .player-bar .pb-center { display: flex !important; align-items: center !important; }
    .player-bar .pb-center .pb-controls { display: flex !important; align-items: center !important; gap: 4px !important; }
    .player-bar .pb-center .pb-controls .pb-btn { width: 36px !important; height: 36px !important; padding: 0 !important; }
    .player-bar .pb-center .pb-controls .pb-btn svg { width: 16px !important; height: 16px !important; }
    .player-bar .pb-center .pb-play { width: 44px !important; height: 44px !important; }
    .player-bar .pb-center #pb-prev { display: inline-flex !important; }
    .player-bar .pb-seek { display: none !important; }
    .player-bar .pb-right { display: none !important; }
    .player-bar .pb-right > * { display: none !important; }
    .player-bar #pb-devices { display: none !important; visibility: hidden !important; }

    .player-bar {
        position: relative !important;
        overflow: visible !important;
    }
    .player-bar::after {
        content: '';
        position: absolute;
        left: 8px;
        right: 8px;
        bottom: 2px;
        height: 2px;
        border-radius: 1px;
        background: rgba(255,255,255,0.18);
        pointer-events: none;
    }
    .player-bar::before {
        content: '';
        position: absolute;
        left: 8px;
        bottom: 2px;
        height: 2px;
        width: var(--pb-progress, 0%);
        max-width: calc(100% - 16px);
        border-radius: 1px;
        background: #ffffff;
        pointer-events: none;
        z-index: 1;
        transition: width 0.15s linear;
    }
    .player-bar #pb-favorite,
    .player-bar .pb-left #pb-favorite {
        display: inline-flex !important;
        visibility: visible !important;
        align-items: center !important;
        justify-content: center !important;
        width: 36px !important;
        height: 36px !important;
        background: transparent !important;
        border: 0 !important;
        color: rgba(255,255,255,0.85) !important;
        padding: 0 !important;
        margin: 0 4px 0 auto !important;
        order: 97;
        flex-shrink: 0;
    }
    .player-bar #pb-favorite svg { width: 20px !important; height: 20px !important; }
    .player-bar #pb-favorite.liked,
    .player-bar #pb-favorite.active { color: #1ed760 !important; }
    .player-bar #pb-favorite.liked svg,
    .player-bar #pb-favorite.active svg { fill: currentColor !important; stroke: currentColor !important; }
    .player-bar .pb-left {
        flex: 1 1 auto !important;
        gap: 8px !important;
        padding-right: 0 !important;
    }
    .player-bar .pb-title { font-size: 13px !important; font-weight: 600 !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
    .player-bar .pb-artist { font-size: 11px !important; color: var(--text-muted,#888) !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
    .player-bar .pb-progress { display: none !important; }
    .player-bar .pb-center { display: flex !important; align-items: center !important; justify-content: center !important; }
    .player-bar .pb-center .pb-play, .player-bar .pb-play {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 44px !important;
        height: 44px !important;
        background: #fff !important;
        color: #000 !important;
        border-radius: 50% !important;
        border: 0 !important;
    }
    .player-bar .pb-play svg { width: 20px !important; height: 20px !important; }

    .mobile-bottom-nav {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 90 !important;
        display: flex !important;
        justify-content: space-around !important;
        align-items: center !important;
        height: calc(var(--tabbar-h) + var(--safe-bottom)) !important;
        padding-bottom: var(--safe-bottom) !important;
        background: rgba(10,10,13,0.94) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        border-top: 1px solid rgba(255,255,255,0.08) !important;
    }
    .mobile-bottom-nav a {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        flex: 1 !important;
        height: 100% !important;
        color: var(--text-muted, #888) !important;
        text-decoration: none !important;
        font-size: 10px !important;
        font-weight: 500 !important;
        letter-spacing: 0.02em !important;
    }
    .mobile-bottom-nav a svg { width: 24px !important; height: 24px !important; }
    .mobile-bottom-nav a.active { color: #fff !important; }
    .mobile-bottom-nav a.active svg { stroke-width: 2.5 !important; }

    .page-header { flex-direction: column !important; align-items: flex-start !important; gap: 10px !important; margin-bottom: 16px !important; padding-top: 0 !important; }
    .page-title { font-size: 28px !important; font-weight: 800 !important; letter-spacing: -0.02em !important; margin: 0 !important; }
    .page-subtitle { font-size: 13px !important; color: var(--text-muted, #888) !important; }

    .song-table { width: 100%; border-collapse: collapse; }
    .song-table thead { display: none; }
    .song-table tbody tr { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px solid rgba(255,255,255,0.04); }
    .song-table tbody td { display: none; padding: 0; border: 0; }
    .song-table tbody td:nth-child(2) { display: flex; flex: 1; min-width: 0; }
    .song-table tbody td.col-time { display: flex; justify-content: flex-end; font-size: 12px; color: var(--text-muted, #888); flex-shrink: 0; }
    .song-table .song-cell { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
    .song-table .song-cover { width: 48px; height: 48px; border-radius: 6px; flex-shrink: 0; }
    .song-table .song-info { min-width: 0; flex: 1; }
    .song-table .song-title { font-size: 15px; font-weight: 500; color: var(--text-primary, #fff); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
    .song-table .song-info::after { content: attr(data-artist-text); display: block; font-size: 12px; color: var(--text-muted, #888); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

    .actions-bar { gap: 12px !important; padding: 12px 0 !important; }
    .action-play { width: 56px !important; height: 56px !important; }

    .album-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important; gap: 14px !important; }
    .pagination { gap: 4px !important; }
    .pagination-btn { min-width: 32px !important; height: 32px !important; font-size: 12px !important; padding: 0 8px !important; }

    .radio-header { flex-direction: column !important; align-items: center !important; text-align: center !important; gap: 16px !important; padding: 20px 0 !important; }
    .radio-header-cover { width: 200px !important; height: 200px !important; box-shadow: 0 20px 60px rgba(0,0,0,0.6) !important; }
    .radio-header-title { font-size: 32px !important; }

    .pending-track { padding: 8px 4px !important; gap: 12px !important; }
    .pending-track-progress { width: 50px !important; }
    .pending-track-spinner { width: 24px !important; height: 24px !important; }

    .playlist-filter { width: 100% !important; min-width: 0 !important; padding: 10px 14px !important; }
    .ctx-menu { min-width: 240px !important; max-width: 90vw !important; }
    .ctx-item { padding: 14px 16px !important; font-size: 15px !important; min-height: 48px !important; }

    #recent-chips, .recent-searches > div:last-child {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scrollbar-width: none !important;
        padding-bottom: 6px !important;
    }
    #recent-chips::-webkit-scrollbar { display: none !important; }
    #recent-chips .recent-chip-wrap, #recent-chips > * { flex-shrink: 0 !important; }

    #spotify-search-form input[type="search"], #spotify-search-form input[type="text"],
    .search-input, input[name="q"] {
        width: 100% !important;
        padding: 12px 16px !important;
        background: rgba(255,255,255,0.06) !important;
        border: 1px solid rgba(255,255,255,0.08) !important;
        border-radius: 999px !important;
        color: #fff !important;
        font-size: 14px !important;
    }

    .mobile-back-btn {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 40px !important;
        height: 40px !important;
        border-radius: 50% !important;
        background: rgba(0,0,0,0.5) !important;
        border: 0 !important;
        color: #fff !important;
        cursor: pointer !important;
        margin-bottom: 12px !important;
    }

    .settings-layout {
        display: block !important;
        grid-template-columns: none !important;
        gap: 0 !important;
    }
    .settings-nav {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        gap: 8px !important;
        padding: 8px 0 14px !important;
        margin-bottom: 14px !important;
        border-bottom: 1px solid rgba(255,255,255,0.06) !important;
        scrollbar-width: none !important;
    }
    .settings-nav::-webkit-scrollbar { display: none; }
    .settings-nav-item {
        flex-shrink: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 10px 14px !important;
        border-radius: 999px !important;
        background: rgba(255,255,255,0.04) !important;
        border: 1px solid rgba(255,255,255,0.06) !important;
        color: var(--text-secondary,#b3b3b3) !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        cursor: pointer !important;
        white-space: nowrap !important;
    }
    .settings-nav-item.active {
        background: var(--primary, #1db954) !important;
        color: #fff !important;
        border-color: transparent !important;
    }
    .settings-nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
    .settings-content { width: 100% !important; }
    .settings-card { padding: 16px !important; margin-bottom: 14px !important; border-radius: 12px !important; }
    .settings-card h2 { font-size: 17px !important; }
    .stat-row { grid-template-columns: 1fr !important; gap: 10px !important; }
    .stat-row-accent { display: flex !important; flex-direction: column !important; }
    .theme-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
    .users-list .user-row { flex-direction: column !important; align-items: stretch !important; gap: 10px !important; }
    .user-row-actions { flex-wrap: wrap !important; gap: 6px !important; }

    .mobile-bottom-nav {
        background: rgba(15,15,18,0.97) !important;
        padding: 6px 8px calc(6px + var(--safe-bottom)) !important;
    }
    .mobile-bottom-nav a {
        color: rgba(255,255,255,0.55) !important;
        padding: 6px 8px !important;
        border-radius: 12px !important;
        transition: background 0.18s ease, color 0.18s ease !important;
        position: relative !important;
    }
    .mobile-bottom-nav a.active {
        color: #fff !important;
        background: rgba(255,255,255,0.10) !important;
    }
    .mobile-bottom-nav a.active svg {
        stroke: #fff !important;
        stroke-width: 2.4 !important;
    }
    .mobile-bottom-nav a:active {
        background: rgba(255,255,255,0.06) !important;
    }
}

@media (max-width: 720px) {
    html, body { overflow-x: hidden !important; width: 100% !important; max-width: 100vw !important; }
    body * { max-width: 100vw; }
    .app, .layout, main, .main { width: 100% !important; max-width: 100vw !important; box-sizing: border-box !important; }
    .main-scroll > * { max-width: 100% !important; box-sizing: border-box !important; }
    .page-header, .actions-bar, .song-table, .empty-state, .pending-tracks-section { width: 100% !important; box-sizing: border-box !important; }
    .song-table { table-layout: fixed !important; }
    table.song-table { display: table !important; width: 100% !important; }
    section[style*="grid"], div[style*="grid"] { grid-template-columns: 1fr !important; }
    section[style*="display:flex"], div[style*="display:flex"] { flex-wrap: wrap !important; }
    h1[style*="font-size"] { font-size: 26px !important; }
    button[style*="padding"], a[style*="padding"] { min-height: 40px !important; }
}
.row-play-btn { width: 32px; height: 32px; background: transparent; border: 0; color: var(--text-primary); border-radius: 50%; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; opacity: 0; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none; }
.song-table tbody tr:hover .col-idx > .idx-num { opacity: 0; }
.song-table tbody tr:hover .row-play-btn { opacity: 1; pointer-events: auto; }
.song-table tbody tr.playing .row-play-btn { opacity: 1; pointer-events: auto; color: var(--primary); }
.song-table tbody tr.playing .idx-num { opacity: 0; }
.song-cell { display: flex; align-items: center; gap: 14px; min-width: 0; }
.song-cover { width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--bg-surface-2); flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--text-muted); overflow: hidden; }
.song-cover img { width: 100%; height: 100%; object-fit: cover; }
.song-info { min-width: 0; flex: 1; }
[data-playlist-view="1"] .song-table tbody tr.selected { background: transparent; outline: 1px solid rgba(255,255,255,0.45); outline-offset: -1px; border-radius: 4px; }
[data-playlist-view="1"] .song-table tbody tr { cursor: default; }
[data-playlist-view="1"] .song-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.artist-link { color: var(--text-secondary); text-decoration: none; transition: color 0.12s ease; }
.artist-link:hover { color: var(--text-primary); text-decoration: underline; }
@keyframes dl-spin { to { transform: rotate(360deg); } }
.dl-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.78); display: flex; align-items: center; justify-content: center; z-index: 20000; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 24px; }
.dl-overlay-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 18px; padding: 32px 28px; max-width: 420px; width: 100%; text-align: center; box-shadow: var(--shadow-lg, 0 20px 60px rgba(0,0,0,0.5)); }
.dl-spinner { width: 56px; height: 56px; border: 4px solid rgba(255,255,255,0.12); border-top-color: var(--primary); border-radius: 50%; animation: dl-spin 0.85s linear infinite; margin: 0 auto 18px; }
.dl-overlay-title { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.dl-overlay-sub { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; }
.dl-overlay-progress { font-size: 13px; color: var(--primary); font-weight: 600; font-family: var(--font-mono); margin-bottom: 12px; }
.dl-overlay-hint { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.song-cover { background: var(--bg-surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M9 18V5l12-2v13'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Ccircle cx='18' cy='16' r='3'/%3E%3C/svg%3E") center/40% no-repeat; }
.song-cover img { width: 100%; height: 100%; object-fit: cover; }
.song-title { font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; min-width: 0; }
.song-artist { font-size: 13px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-fav-btn { width: 26px; height: 26px; background: transparent; border: 0; color: var(--text-secondary); border-radius: 50%; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; opacity: 0; transition: all 0.12s ease; flex-shrink: 0; padding: 0; }
.song-table tbody tr:hover .row-fav-btn { opacity: 1; }
.row-fav-btn:hover { color: var(--danger); transform: scale(1.1); }
.row-fav-btn.active { opacity: 1; color: var(--danger); }
.row-fav-btn.active svg { fill: var(--danger); }

/* ===== EMPTY STATE ===== */
.empty-state { text-align: center; padding: 80px 20px; color: var(--text-secondary); }
.empty-state .icon { width: 80px; height: 80px; margin: 0 auto 24px; color: var(--text-secondary); background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.empty-state h2 { font-size: 24px; font-weight: 800; color: var(--text-primary); margin: 0 0 8px; letter-spacing: -0.02em; }
.empty-state p { font-size: 15px; color: var(--text-secondary); margin: 0 0 24px; max-width: 480px; margin-inline: auto; }

/* ===== STAT CARDS ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-md); padding: 20px; transition: all 0.18s ease; }
.stat-card:hover { background: var(--bg-card-hover); }
.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; margin-bottom: 6px; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; }

/* ===== CARD ===== */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-md); padding: 24px; margin-bottom: 16px; }
.card h2 { margin: 0 0 4px; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.card .subtitle { margin: 0 0 18px; color: var(--text-secondary); font-size: 14px; }

/* ===== FORM ===== */
label { display: block; font-size: 12px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.field { margin-bottom: 14px; }
input[type=text], input[type=password], input[type=email], select, textarea {
    width: 100%; background: #000; border: 1px solid var(--border); color: var(--text-primary);
    padding: 12px 14px; border-radius: var(--r-sm); font-size: 14px; font-family: inherit; outline: none; transition: all 0.15s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.flash-ok { background: rgba(0,186,124,0.1); border: 1px solid rgba(0,186,124,0.3); color: var(--success); padding: 12px 16px; border-radius: var(--r-sm); margin-bottom: 16px; font-size: 14px; font-weight: 500; }
.flash-error { background: rgba(244,33,46,0.1); border: 1px solid rgba(244,33,46,0.3); color: var(--danger); padding: 12px 16px; border-radius: var(--r-sm); margin-bottom: 16px; font-size: 14px; font-weight: 500; }

/* ===== TABS ===== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tab { padding: 14px 18px; background: transparent; border: 0; color: var(--text-secondary); font-size: 15px; font-weight: 700; cursor: pointer; border-bottom: 4px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 8px; transition: all 0.15s ease; font-family: inherit; }
.tab:hover { color: var(--text-primary); background: var(--bg-hover); border-radius: 8px 8px 0 0; }
.tab.active { color: var(--text-primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== DATA TABLE ===== */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table thead th { text-align: left; padding: 12px; border-bottom: 1px solid var(--border); font-weight: 700; color: var(--text-muted); text-transform: uppercase; font-size: 11px; letter-spacing: 0.05em; }
.data-table tbody td { padding: 14px 12px; border-bottom: 1px solid var(--border); }
.data-table tbody tr:hover { background: var(--bg-hover); }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.badge-admin { background: var(--primary-soft); color: var(--primary); }
.badge-user { background: var(--bg-hover); color: var(--text-secondary); }
code { font-family: var(--font-mono); background: #000; border: 1px solid var(--border); padding: 3px 8px; border-radius: var(--r-sm); color: var(--text-primary); font-size: 12px; }

/* ===== SPOTIFY-STYLE PLAYER BAR ===== */
.player-bar {
    grid-area: player;
    background: var(--player-bg, transparent);
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    padding: 0 16px;
    z-index: 50;
    gap: 18px;
    position: sticky;
    bottom: 0;
    height: var(--playerbar-h);
}

/* LEFT */
.pb-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pb-left .pb-btn-mini { flex-shrink: 0; margin-right: auto; }
.pb-cover { width: 56px; height: 56px; border-radius: var(--r-sm); flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--text-muted); overflow: hidden; background: var(--bg-surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M9 18V5l12-2v13'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Ccircle cx='18' cy='16' r='3'/%3E%3C/svg%3E") center/40% no-repeat; }
.pb-cover img { width: 100%; height: 100%; object-fit: cover; }
.pb-meta { min-width: 0; flex: 0 1 auto; max-width: calc(100% - 120px); }
.pb-title { font-size: 14px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.pb-title:hover { text-decoration: underline; }
.pb-artist { font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-artist:hover { text-decoration: underline; }

/* CENTER */
.pb-center { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; max-width: 620px; margin: 0 auto; }
.pb-controls { display: flex; align-items: center; gap: 18px; }
.pb-btn { width: 32px; height: 32px; background: transparent; border: 0; color: var(--text-secondary); border-radius: 50%; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all 0.12s ease; padding: 0; }
.pb-btn:hover { color: var(--text-primary); transform: scale(1.06); }
.pb-btn.active { color: var(--primary); }
.pb-btn.active::after { content: ''; position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--primary); }
.pb-btn { position: relative; }
.pb-btn-play { width: 38px; height: 38px; background: var(--white); color: #000; }
.pb-btn-play:hover { background: var(--white); color: #000; transform: scale(1.08); }

.pb-seek { display: flex; align-items: center; gap: 10px; width: 100%; }
.pb-time { font-size: 11px; color: var(--text-secondary); font-variant-numeric: tabular-nums; min-width: 40px; text-align: center; font-weight: 500; }
.pb-seek-bar { flex: 1; height: 4px; background: rgba(255,255,255,0.2); border-radius: 2px; cursor: pointer; position: relative; transition: height 0.12s ease; }
.pb-seek-bar:hover { height: 6px; }
.pb-seek-fill { height: 100%; width: 0%; background: var(--text-primary); border-radius: 2px; position: relative; }
.pb-seek-bar:hover .pb-seek-fill { background: var(--primary); }
.pb-seek-handle { position: absolute; right: -6px; top: 50%; transform: translateY(-50%); width: 12px; height: 12px; border-radius: 50%; background: #fff; opacity: 0; transition: opacity 0.12s ease; }
.pb-seek-bar:hover .pb-seek-handle { opacity: 1; }

/* RIGHT */
.pb-right { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.pb-volume-bar { width: 90px; height: 4px; background: rgba(255,255,255,0.2); border-radius: 2px; cursor: pointer; position: relative; transition: height 0.12s ease; }
.pb-volume-bar:hover { height: 6px; }
.pb-volume-fill { height: 100%; background: var(--text-primary); border-radius: 2px; position: relative; }
.pb-volume-bar:hover .pb-volume-fill { background: var(--primary); }
.pb-volume-handle { position: absolute; right: -6px; top: 50%; transform: translateY(-50%); width: 12px; height: 12px; border-radius: 50%; background: #fff; opacity: 0; }
.pb-volume-bar:hover .pb-volume-handle { opacity: 1; }

audio { display: none; }

/* ===== CONTEXT MENU ===== */
.ctx-menu {
    position: fixed;
    z-index: 9999;
    background: #16181c;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-md);
    min-width: 220px;
    padding: 6px;
    display: none;
}
.ctx-menu.open { display: block; }
.ctx-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--r-sm);
    transition: background 0.1s ease;
    position: relative;
}
.ctx-item:hover { background: var(--bg-hover); }
.ctx-item svg { flex-shrink: 0; color: var(--text-secondary); }
.ctx-divider { height: 1px; background: var(--border); margin: 6px 4px; }
.ctx-submenu { position: relative; }
.ctx-submenu-arrow { margin-left: auto; color: var(--text-muted); }
.ctx-submenu-panel {
    position: absolute;
    left: 100%; top: 0;
    background: #16181c;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-md);
    min-width: 200px;
    padding: 6px;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}
.ctx-submenu:hover .ctx-submenu-panel { display: block; }
.ctx-empty { padding: 10px 12px; color: var(--text-muted); font-size: 13px; }

.ctx-backdrop {
    position: fixed; inset: 0; z-index: 9990;
    background: rgba(0, 0, 0, 0);
    transition: background 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}
.ctx-backdrop.open { background: rgba(0, 0, 0, 0.55); }
body.ctx-sheet-open { overflow: hidden; touch-action: none; }

.ctx-menu.mobile-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border-radius: 18px 18px 0 0;
    border: none;
    border-top: 1px solid rgba(255,255,255,0.06);
    background: #1c1c1e;
    padding: 6px 8px 28px;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
    display: block;
    max-height: 82vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
}
.ctx-menu.mobile-sheet.open { transform: translateY(0); }
.ctx-menu.mobile-sheet .ctx-sheet-grip {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.25);
    margin: 8px auto 14px;
}
.ctx-menu.mobile-sheet .ctx-sheet-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 12px 16px;
    margin: 0 -4px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.ctx-menu.mobile-sheet .ctx-sheet-cover {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    background: #2a2a2c;
    flex-shrink: 0;
}
.ctx-menu.mobile-sheet .ctx-sheet-meta { min-width: 0; flex: 1; }
.ctx-menu.mobile-sheet .ctx-sheet-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ctx-menu.mobile-sheet .ctx-sheet-artist {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 2px;
}
.ctx-menu.mobile-sheet .ctx-item {
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    min-height: 52px;
    border-radius: 8px;
    gap: 18px;
}
.ctx-menu.mobile-sheet .ctx-item:hover,
.ctx-menu.mobile-sheet .ctx-item:active { background: rgba(255,255,255,0.06); }
.ctx-menu.mobile-sheet .ctx-item svg { color: rgba(255,255,255,0.75); width: 20px; height: 20px; }
.ctx-menu.mobile-sheet .ctx-divider { background: rgba(255,255,255,0.06); margin: 4px 8px; }
.ctx-menu.mobile-sheet .ctx-submenu-arrow {
    font-size: 22px;
    color: rgba(255,255,255,0.45);
    transform: translateY(-1px);
}
.ctx-menu.mobile-sheet .ctx-submenu-panel {
    position: static;
    display: none;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 6px 0 0;
    max-height: none;
    margin-left: 38px;
}
.ctx-menu.mobile-sheet .ctx-submenu.open-sub .ctx-submenu-panel { display: block; }
.ctx-menu.mobile-sheet .ctx-submenu:hover .ctx-submenu-panel { display: none; }
.ctx-menu.mobile-sheet .ctx-submenu.open-sub .ctx-submenu-panel { display: block; }

/* ===== LOGIN ===== */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; overflow: hidden; }
.login-card { position: relative; z-index: 2; background: rgba(0,0,0,0.7); backdrop-filter: blur(20px); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 44px; width: 100%; max-width: 440px; box-shadow: var(--shadow-lg); }
.login-brand { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 28px; }
.login-card h1 { font-size: 28px; font-weight: 900; text-align: center; margin: 0 0 8px; letter-spacing: -0.02em; }
.login-card .subtitle { text-align: center; color: var(--text-secondary); font-size: 14px; margin-bottom: 32px; }
.login-card .btn-block { display: block; width: 100%; padding: 14px; margin-top: 8px; }

.muted { color: var(--text-muted); }
.spacer { flex: 1; }

/* ===== SIDE PANEL (kolejka / urządzenia / lyrics) ===== */
.side-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: var(--playerbar-h);
    width: 380px;
    max-width: 90vw;
    background: #000;
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    transform: translateX(100%);
    transition: transform 0.24s ease;
    z-index: 50;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    isolation: isolate;
}
.side-panel-stars {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background: #000;
}
.side-panel-stars .stars-layer {
    position: absolute;
    inset: 0;
    background-repeat: repeat;
}
.side-panel > *:not(.side-panel-stars) {
    position: relative;
    z-index: 1;
}
.side-panel.open { transform: translateX(0); }
.side-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.side-panel-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.01em;
}
.side-panel-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: 0;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s ease;
}
.side-panel-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.side-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px 24px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 12%, black 88%, transparent);
    mask-image: linear-gradient(to bottom, transparent, black 12%, black 88%, transparent);
}
.side-panel-body::-webkit-scrollbar { display: none; width: 0; height: 0; }
.empty-panel {
    text-align: center;
    color: var(--text-secondary);
    padding: 56px 20px;
    font-size: 14px;
    line-height: 1.6;
}
.empty-panel.skeleton { color: var(--text-muted); }
.panel-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 16px 12px 8px;
}

/* Queue */
.queue-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.12s ease;
}
.queue-item:hover { background: var(--bg-card-hover); border-color: var(--border-hover); }
.queue-item.active { background: var(--primary-soft); border-color: var(--primary); }
.queue-item.active .queue-title { color: var(--primary); }
.queue-cover {
    width: 44px;
    height: 44px;
    border-radius: var(--r-sm);
    background: var(--bg-surface-2);
    overflow: hidden;
    flex-shrink: 0;
}
.queue-cover img { width: 100%; height: 100%; object-fit: cover; }
.queue-meta { min-width: 0; flex: 1; }

/* Neutral loading shimmer for cover art (no colored placeholders) */
@keyframes cover-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
img.cover-loading {
    background-color: var(--bg-surface-2, #1a1a1f);
    background-image: linear-gradient(100deg, transparent 25%, rgba(255, 255, 255, 0.07) 50%, transparent 75%);
    background-size: 200% 100%;
    background-repeat: no-repeat;
    animation: cover-shimmer 1.3s linear infinite;
}
@media (prefers-reduced-motion: reduce) { img.cover-loading { animation: none; } }
.queue-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-artist { font-size: 12px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-radio-badge { display: inline-flex; margin-left: 7px; padding: 1px 6px; border-radius: 999px; background: rgba(var(--accent-rgb), .14); color: var(--accent-color); font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; vertical-align: 1px; }
.queue-actions { display: flex; align-items: center; gap: 4px; }
.queue-actions button {
    min-width: 44px;
    min-height: 44px;
    padding: 0 8px;
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}
.queue-actions button:hover { background: var(--bg-hover); color: var(--text-primary); }
.queue-item[role="option"]:focus-visible,
.mq-item[role="option"]:focus-visible,
.np-up-next-preview:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.np-up-next-preview { width: 100%; min-height: 56px; border: 0; background: transparent; color: inherit; text-align: left; }
@media (prefers-reduced-motion: reduce) {
    .queue-item, .mq-item, .np-up-next { transition: none; transform: none !important; }
.queue-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 16px 12px 8px;
}

/* Devices */
.device-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 12px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    margin-bottom: 8px;
    background: var(--bg-card);
    transition: all 0.12s ease;
}
.device-item:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }
.device-item.this {
    border-color: var(--primary);
    background: var(--primary-soft);
}
.device-item.playing .device-status { color: var(--primary); }
.device-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--r-sm);
    background: var(--bg-surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.device-item.this .device-icon { background: var(--primary); color: #000; }
.device-meta { min-width: 0; flex: 1; }
.device-name { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; color: var(--text-primary); }
.device-this { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--primary); padding: 2px 7px; border-radius: 999px; background: var(--primary-soft); }
.device-status { font-size: 12px; color: var(--text-secondary); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-transfer {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    padding: 7px 12px;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: all 0.12s ease;
    flex-shrink: 0;
}
.device-transfer:hover { border-color: var(--primary); color: var(--primary); }
.device-transfer:disabled { opacity: 0.5; cursor: not-allowed; }

/* Lyrics — beautiful-lyrics style (Apple Music inspired) */
.lyrics-body {
    font-size: 22px;
    line-height: 1.4;
    color: var(--text-primary);
    padding: 40vh 8px 40vh;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.lyrics-body.plain {
    font-size: 16px;
    line-height: 1.85;
    padding: 20px 8px;
    font-weight: 500;
    white-space: pre-wrap;
    color: var(--text-secondary);
}
.lyrics-line {
    padding: 14px 4px;
    transition: filter 0.5s cubic-bezier(0.32, 0.72, 0, 1),
                opacity 0.5s cubic-bezier(0.32, 0.72, 0, 1),
                color 0.4s ease,
                transform 0.5s cubic-bezier(0.32, 0.72, 0, 1);
    color: rgba(231,233,234,0.55);
    filter: blur(4px);
    opacity: 0.45;
    cursor: pointer;
    border-radius: 8px;
    animation: lyrics-line-in 0.6s cubic-bezier(0.32, 0.72, 0, 1) both;
}
@keyframes lyrics-line-in {
    from { opacity: 0; }
    to   { opacity: 0.45; }
}
.lyrics-line:hover {
    filter: blur(0);
    opacity: 0.85;
}
.lyrics-line.played {
    filter: blur(6px);
    opacity: 0.25;
}
.lyrics-line.prev,
.lyrics-line.next {
    filter: blur(2px);
    opacity: 0.6;
}
.lyrics-line.active {
    color: var(--text-primary);
    filter: blur(0);
    opacity: 1;
    text-shadow: 0 0 24px rgba(255,255,255,0.18);
    transform: scale(1.02);
    transform-origin: left center;
}
.lyrics-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 48px 16px;
    font-size: 14px;
}

/* ===== MODAL ===== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%);
    background: var(--bg-elevated, #0d0e10);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    width: 440px;
    max-width: calc(100vw - 32px);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.modal.open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: 0;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal-body { padding: 24px; }

/* Jam */
.jam-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.jam-btn {
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--r-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.12s ease;
}
.jam-btn:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.jam-btn.primary { background: var(--primary); border-color: var(--primary); color: #000; }
.jam-btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.jam-divider { text-align: center; color: var(--text-muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; margin: 8px 0; }
.jam-code-display {
    text-align: center;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    margin-bottom: 12px;
}
.jam-code {
    font-family: var(--font-mono);
    font-size: 36px;
    font-weight: 800;
    letter-spacing: 0.2em;
    color: var(--primary);
    margin: 8px 0;
}
.jam-code-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--r-sm);
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.12s ease;
}
.jam-code-copy:hover { color: var(--text-primary); border-color: var(--border-hover); }
.jam-participants { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.jam-participant {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-card);
    border-radius: var(--r-sm);
    font-size: 14px;
}
.jam-participant.host { border-left: 3px solid var(--primary); }
.jam-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    flex-shrink: 0;
}
.jam-status { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.jam-input {
    width: 100%;
    text-align: center;
    text-transform: uppercase;
    font-family: var(--font-mono);
    font-size: 22px;
    letter-spacing: 0.15em;
    padding: 14px;
    background: #000;
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--r-md);
    margin-bottom: 12px;
}
.jam-input:focus { border-color: var(--primary); outline: none; }
.jam-error { color: var(--danger); font-size: 13px; text-align: center; margin-top: 8px; }
.jam-active-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--primary-soft);
    border: 1px solid rgba(231,233,234,0.18);
    border-radius: var(--r-sm);
    font-size: 13px;
    color: var(--primary);
    margin-bottom: 16px;
    font-weight: 600;
}

/* Jam listeners stack in player bar */
.jam-listeners {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 6px 0 14px;
    border-left: 1px solid var(--border);
    margin-left: 8px;
    flex-shrink: 0;
}
.jam-listeners-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.jam-listener-stack { display: flex; }
.jam-listener {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f5f5f5, #8a8a8a);
    color: #000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 11px;
    border: 2px solid var(--bg-base);
    transition: opacity 0.2s ease, transform 0.18s ease;
    flex-shrink: 0;
    cursor: default;
}
.jam-listener:hover { transform: translateY(-2px); }
.jam-listener.offline { opacity: 0.4; }
.jam-listener.host { box-shadow: 0 0 0 2px var(--primary), 0 0 12px rgba(255,255,255,0.25); }
.jam-listener-stack .jam-listener + .jam-listener { margin-left: -10px; }
@media (max-width: 900px) {
    .jam-listeners { display: none; }
}

/* ===== SETTINGS PAGE ===== */
.settings-page { max-width: 1100px; margin: 0 auto; }
.settings-header {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 24px 0 32px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}
.settings-header-meta { min-width: 0; }
.settings-name {
    margin: 0 0 6px;
    font-size: 44px;
    font-weight: 900;
    letter-spacing: -0.025em;
    line-height: 1;
}
.settings-sub { color: var(--text-secondary); font-size: 14px; }

.settings-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    align-items: flex-start;
}
.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: sticky;
    top: 16px;
}
.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: border-color 0.12s ease, color 0.12s ease;
}
.settings-nav-item:hover { border-color: rgba(255,255,255,0.12); color: var(--text-primary); }
.settings-nav-item.active {
    background: transparent;
    border-color: rgba(255,255,255,0.22);
    color: var(--text-primary);
}
.settings-nav-item.active svg { color: var(--primary); }
.settings-nav-item svg { flex-shrink: 0; }

.settings-content { min-width: 0; }
.settings-section { display: none; }
.settings-section.active { display: block; animation: fade-in 0.2s ease; }
@keyframes fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.settings-card {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 24px;
    margin-bottom: 14px;
    transition: border-color 0.12s ease;
}
.settings-card:hover { border-color: var(--border-hover, rgba(255,255,255,0.18)); }

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}
.theme-card {
    position: relative;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-primary);
    border-radius: var(--r-md);
    padding: 12px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    overflow: hidden;
}
.theme-card.active { border-color: var(--primary); }
.theme-card[data-theme] { background: var(--bg-card); }
.theme-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px -16px rgba(0,0,0,0.7);
}
.theme-card.active {
    box-shadow: 0 16px 40px -16px rgba(0,0,0,0.6), 0 0 0 2px currentColor inset;
}
.theme-card-preview {
    display: flex;
    gap: 12px;
    padding: 14px;
    margin-bottom: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
}
.theme-card-preview-cover {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: var(--r-sm);
}
.theme-card-preview-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-width: 0;
}
.theme-card-preview-lines > div:not(.theme-card-preview-btn) {
    height: 6px;
    border-radius: 3px;
    background: var(--text-primary);
    opacity: 0.9;
}
.theme-card-preview-btn {
    margin-top: 6px;
    align-self: flex-start;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 999px;
}
.theme-card-meta { padding: 0 4px 2px; }
.theme-card-name {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.01em;
}
.theme-card-author {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 4px;
    opacity: 0.75;
}
.theme-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 3px 9px;
    border-radius: 999px;
}
.settings-card-head { margin-bottom: 20px; }
.settings-card-head h2 {
    margin: 0 0 4px;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
}
.settings-card-head p { margin: 0; color: var(--text-secondary); font-size: 14px; }
.head-counter {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 13px;
    font-weight: 700;
}

.settings-form { display: flex; flex-direction: column; gap: 14px; max-width: 440px; }
.settings-field { display: flex; flex-direction: column; gap: 6px; }
.settings-field label {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.settings-field input {
    background: #000;
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px 14px;
    border-radius: var(--r-sm);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.15s ease;
}
.settings-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.settings-form-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.stat-row-accent {
    grid-template-columns: 1.6fr 1fr 1fr;
}
@media (max-width: 720px) {
    .stat-row-accent { grid-template-columns: 1fr; }
}
.stat-tile {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 18px;
    transition: border-color 0.12s ease;
}
.stat-tile:hover { border-color: rgba(255,255,255,0.18); }
.stat-tile-accent {
    background: transparent;
    border-color: var(--border);
    padding: 22px 22px 20px;
}
.stat-tile-accent:hover { border-color: var(--border-hover, rgba(255,255,255,0.18)); }
.stat-tile-accent .stat-tile-label { color: var(--text-secondary); }
.stat-tile-accent .stat-tile-value { font-size: 38px; }
.stat-tile-sub {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}
.stat-tile-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.stat-tile-value {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.kv-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    gap: 16px;
}
.kv-row:last-child { border-bottom: 0; }
.kv-key { color: var(--text-secondary); font-size: 14px; font-weight: 500; flex-shrink: 0; }
.kv-val { color: var(--text-primary); font-size: 14px; font-weight: 600; text-align: right; min-width: 0; word-break: break-all; }
.kv-val.mono { font-family: var(--font-mono); font-size: 13px; }
.kv-val.muted { color: var(--text-muted); font-weight: 500; }

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: var(--bg-elevated);
    color: var(--text-secondary);
}
.status-pill.ok { background: rgba(0,186,124,0.12); color: var(--success); }
.status-pill.err { background: rgba(244,33,46,0.12); color: var(--danger); }
.status-pill.warn { background: rgba(255,161,22,0.12); color: #ffa116; }

.error-pre {
    background: rgba(244,33,46,0.08);
    border: 1px solid rgba(244,33,46,0.25);
    color: #ff8b8b;
    padding: 12px;
    border-radius: var(--r-sm);
    font-size: 12px;
    font-family: var(--font-mono);
    white-space: pre-wrap;
    margin: 16px 0 0;
}

/* User add form */
.user-add-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    gap: 14px;
    align-items: end;
}
.checkbox-field {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 12px 0;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
}
.checkbox-field input { width: auto; margin: 0; }

/* Users list */
.users-list { display: flex; flex-direction: column; gap: 8px; }
.user-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: var(--r-md);
    background: transparent;
    transition: border-color 0.12s ease;
}
.user-row:hover { border-color: rgba(255,255,255,0.18); }
.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f5f5f5, #8a8a8a);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
}
.user-row-meta { flex: 1; min-width: 0; }
.user-row-name {
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.user-row-sub { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.user-row-actions { display: flex; gap: 6px; flex-wrap: wrap; flex-shrink: 0; }

.badge-you { background: var(--primary-soft); color: var(--primary); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: all 0.12s ease;
    font-family: inherit;
}
.btn-ghost:hover { color: var(--text-primary); border-color: var(--border-hover); background: var(--bg-hover); }
.btn-ghost.danger:hover { color: var(--danger); border-color: var(--danger); }

/* ===== PLAYLIST SIDEBAR — IMPORT ===== */
.sidebar-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px 8px;
}
.sidebar-section-head .sidebar-section-label { padding: 0; margin: 0; }
.sidebar-section-actions { display: inline-flex; align-items: center; gap: 2px; }
.sidebar-add-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: transparent;
    border: 0;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s ease;
}
.sidebar-add-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.import-source-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    margin-bottom: 22px;
}
.import-source-title { font-weight: 800; font-size: 15px; color: var(--text-primary); }
.import-source-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.import-form { display: flex; flex-direction: column; }
.field-label {
    display: block;
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}
.field-input {
    width: 100%;
    background: #000;
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px 14px;
    border-radius: var(--r-sm);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.15s ease;
}
.field-input:focus { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }

.import-status {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 14px;
    min-height: 18px;
}
.import-status.error { color: var(--danger); }
.import-status.success { color: var(--success); }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}
.modal-actions .btn { padding: 10px 20px; font-size: 14px; }
.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.btn-ghost:hover { border-color: var(--border-hover); color: var(--text-primary); }

.import-tracks-list {
    margin-top: 18px;
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
}
.import-tracks-list .import-track {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.import-tracks-list .import-track:last-child { border-bottom: 0; }
.import-track-status {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.import-track-status.have { background: rgba(0,186,124,0.16); color: var(--success); }
.import-track-status.missing { background: rgba(255,161,22,0.16); color: #ffa116; }
.import-track-status.downloading { background: var(--primary-soft); color: var(--primary); }
.import-track-meta { flex: 1; min-width: 0; }
.import-track-title { color: var(--text-primary); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-track-artist { font-size: 11px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Import banner & pending tracks */
.import-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(231,233,234,0.08), rgba(231,233,234,0.02));
    border: 1px solid rgba(231,233,234,0.15);
    border-radius: var(--r-md);
    margin-bottom: 24px;
}
.import-banner-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255,255,255,0.12);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: dl-spin 0.85s linear infinite;
    flex-shrink: 0;
}
.import-banner-text { min-width: 0; flex: 1; }
.import-banner-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.import-banner-sub {
    font-size: 12px;
    color: var(--text-secondary);
}

.pending-tracks-section {
    margin-top: 24px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}
.pending-tracks-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0 12px 12px;
}
.pending-track {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border-radius: var(--r-sm);
    transition: background 0.12s ease;
    opacity: 0.7;
}
.pending-track:hover { background: var(--bg-hover); opacity: 0.9; }
.pending-track-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.12);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: dl-spin 0.85s linear infinite;
    flex-shrink: 0;
}
.pending-track-meta { min-width: 0; flex: 1; }
.pending-track-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pending-track-artist {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pending-track-stage {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    text-transform: lowercase;
    letter-spacing: 0.02em;
}
.pending-track-progress {
    width: 120px;
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 999px;
    overflow: hidden;
    flex-shrink: 0;
}
.pending-track-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #1ed760);
    transition: width 0.3s ease;
}
.pending-track--failed { opacity: 0.4; }
.pending-track--failed .pending-track-stage { color: #ef4444; }
.pending-track--failed .pending-track-spinner {
    animation: none;
    border-top-color: #ef4444;
}

.playlist-filter-wrap { display: flex; align-items: center; }
.playlist-filter {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 999px;
    color: var(--text-primary);
    font-size: 13px;
    padding: 8px 14px;
    min-width: 220px;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.playlist-filter:focus {
    border-color: var(--primary);
    background: rgba(255,255,255,0.08);
}
.playlist-filter::placeholder { color: var(--text-muted); }

.radio-header {
    display: flex;
    gap: 24px;
    align-items: flex-end;
    margin-bottom: 24px;
    padding: 24px 0 8px;
}
.radio-header-cover {
    width: 192px;
    height: 192px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-surface-2);
    box-shadow: 0 16px 48px rgba(0,0,0,0.45);
    flex-shrink: 0;
}
.radio-header-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.radio-cover-grid { display: grid; grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); }
.radio-cover-grid img { min-width: 0; min-height: 0; }
.radio-header-text { min-width: 0; flex: 1; padding-bottom: 8px; }
.radio-header-eyebrow {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.radio-header-title {
    font-size: clamp(32px, 6vw, 64px);
    font-weight: 800;
    line-height: 1;
    margin: 0 0 12px;
    letter-spacing: -0.04em;
}
.radio-header-meta { font-size: 13px; line-height: 1.5; color: var(--text-secondary); }
.radio-header-meta .artist-link { color: var(--text-primary); font-weight: 600; }

.pagination {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    margin: 32px 0 16px;
    flex-wrap: wrap;
}
.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.pagination-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.pagination-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination-btn.disabled { opacity: 0.4; pointer-events: none; }
.pagination-gap { color: var(--text-muted); padding: 0 4px; }

/* Toast */
.toast {
    position: fixed;
    bottom: calc(var(--playerbar-h) + 24px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-elevated, #16181c);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 13px;
    z-index: 200;
    box-shadow: var(--shadow-md);
    animation: toast-in 0.25s ease;
}
@keyframes toast-in {
    from { opacity: 0; transform: translate(-50%, 8px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 900px) {
    .app { grid-template-columns: 72px 1fr; padding: 8px 8px 0; }
    .sidebar-section-label, .sidebar-item span, .brand-name, .user-info { display: none; }
    .sidebar-brand { justify-content: center; padding: 16px 8px; }
    .sidebar-item { justify-content: center; padding: 12px 0; }
    .user-button { justify-content: center; padding: 10px; }
    .user-button > svg:last-child { display: none; }
    .main-scroll { padding: 16px 20px 80px; }
    .page-title { font-size: 32px; }
}
@media (max-width: 700px) {
    .player-bar { grid-template-columns: 1fr auto; padding: 0 12px; }
    .pb-right, .pb-seek { display: none; }
    .search-input { width: 100%; }
    .album-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
}

/* ===== CUSTOM DIALOG (replaces alert/confirm/prompt) ===== */
.dlg-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.18s cubic-bezier(0.32, 0.72, 0, 1);
}
.dlg-backdrop.open { opacity: 1; }
.dlg-card {
    background: #161719;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 32px 80px -16px rgba(0,0,0,0.8);
    transform: scale(0.94) translateY(8px);
    opacity: 0;
    transition: all 0.22s cubic-bezier(0.32, 0.72, 0, 1);
}
.dlg-backdrop.open .dlg-card { transform: scale(1) translateY(0); opacity: 1; }
.dlg-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}
.dlg-msg {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 18px;
}
.dlg-input {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
    color: var(--text-primary);
    font-family: inherit;
    margin-bottom: 18px;
    transition: border-color 0.15s ease;
}
.dlg-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255,255,255,0.06);
}
.dlg-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.dlg-actions .btn {
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
}
.dlg-danger {
    background: #d72646 !important;
    color: #fff !important;
}
.dlg-danger:hover { background: #b91d3a !important; }

@media (max-width: 720px) {
    body .player-bar {
        position: fixed !important;
        bottom: 70px !important;
        left: 8px !important;
        right: 8px !important;
        z-index: 80 !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 12px !important;
        padding: 10px 12px !important;
        height: 64px !important;
        min-height: 64px !important;
        background: #2a2a30 !important;
        border-radius: 12px !important;
        border: 1px solid rgba(255,255,255,0.08) !important;
        box-shadow: 0 8px 24px rgba(0,0,0,0.5) !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    body .player-bar .pb-left { display: flex !important; flex-direction: row !important; align-items: center !important; gap: 10px !important; flex: 1 1 0 !important; min-width: 0 !important; overflow: hidden !important; visibility: visible !important; }
    body .player-bar .pb-cover { display: block !important; width: 44px !important; height: 44px !important; border-radius: 6px !important; overflow: hidden !important; flex: 0 0 44px !important; visibility: visible !important; }
    body .player-bar .pb-cover img { display: block !important; width: 44px !important; height: 44px !important; object-fit: cover !important; visibility: visible !important; opacity: 1 !important; }
    body .player-bar .pb-meta { display: flex !important; flex-direction: column !important; justify-content: center !important; flex: 1 1 0 !important; min-width: 0 !important; overflow: hidden !important; visibility: visible !important; }
    body .player-bar #pb-title, body .player-bar a.pb-title, body .player-bar .pb-title { display: block !important; font-size: 13px !important; font-weight: 700 !important; color: #ffffff !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; text-decoration: none !important; visibility: visible !important; opacity: 1 !important; line-height: 1.2 !important; max-width: 100% !important; }
    body .player-bar #pb-artist, body .player-bar a.pb-artist, body .player-bar .pb-artist { display: block !important; font-size: 11px !important; color: #b3b3b3 !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; text-decoration: none !important; visibility: visible !important; opacity: 1 !important; margin-top: 2px !important; max-width: 100% !important; }
    body .player-bar #pb-favorite, body .player-bar .pb-btn-mini { display: none !important; }
    body .player-bar .pb-center { display: flex !important; align-items: center !important; flex: 0 0 auto !important; }
    body .player-bar .pb-controls { display: flex !important; align-items: center !important; gap: 8px !important; }
    body .player-bar #pb-shuffle, body .player-bar #pb-prev, body .player-bar #pb-repeat { display: none !important; }
    body .player-bar #pb-play { display: inline-flex !important; align-items: center !important; justify-content: center !important; width: 40px !important; height: 40px !important; background: #ffffff !important; color: #000000 !important; border-radius: 50% !important; border: 0 !important; padding: 0 !important; visibility: visible !important; opacity: 1 !important; }
    body .player-bar #pb-play svg { color: #000000 !important; fill: #000000 !important; width: 18px !important; height: 18px !important; }
    body .player-bar #pb-next { display: inline-flex !important; align-items: center !important; justify-content: center !important; width: 34px !important; height: 34px !important; background: transparent !important; color: #ffffff !important; border: 0 !important; padding: 0 !important; visibility: visible !important; opacity: 1 !important; }
    body .player-bar #pb-next svg { color: #ffffff !important; stroke: #ffffff !important; width: 18px !important; height: 18px !important; }
    body .player-bar .pb-seek, body .player-bar .pb-right { display: none !important; }
}

/* === SAMSUNG S20 FINAL PLAYER FIX === */
@media (max-width: 720px) {
    html body .player-bar.player-bar {
        all: unset !important;
        position: fixed !important;
        bottom: 70px !important;
        left: 8px !important;
        right: 8px !important;
        z-index: 100 !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 12px !important;
        padding: 10px 12px !important;
        height: 64px !important;
        background: #2a2a30 !important;
        border-radius: 12px !important;
        box-shadow: 0 8px 24px rgba(0,0,0,0.6) !important;
        box-sizing: border-box !important;
    }
    html body .player-bar .pb-left {
        all: unset !important;
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        flex: 1 1 0 !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }
    html body .player-bar .pb-cover {
        all: unset !important;
        display: block !important;
        width: 44px !important;
        height: 44px !important;
        border-radius: 6px !important;
        overflow: hidden !important;
        flex-shrink: 0 !important;
    }
    html body .player-bar .pb-cover img {
        all: unset !important;
        display: block !important;
        width: 44px !important;
        height: 44px !important;
        object-fit: cover !important;
    }
    html body .player-bar .pb-meta {
        all: unset !important;
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 0 !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }
    html body .player-bar #pb-title {
        all: unset !important;
        display: block !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        color: #fff !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
        cursor: pointer !important;
    }
    html body .player-bar #pb-artist {
        all: unset !important;
        display: block !important;
        font-size: 11px !important;
        color: #b3b3b3 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
        margin-top: 2px !important;
        cursor: pointer !important;
    }
    html body .player-bar #pb-favorite,
    html body .player-bar .pb-btn-mini,
    html body .player-bar #pb-shuffle,
    html body .player-bar #pb-prev,
    html body .player-bar #pb-repeat,
    html body .player-bar .pb-seek,
    html body .player-bar .pb-right { display: none !important; }
    html body .player-bar .pb-center {
        all: unset !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        flex-shrink: 0 !important;
    }
    html body .player-bar .pb-controls {
        all: unset !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
    }
    html body .player-bar #pb-play {
        all: unset !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 40px !important;
        height: 40px !important;
        background: #fff !important;
        color: #000 !important;
        border-radius: 50% !important;
        cursor: pointer !important;
        flex-shrink: 0 !important;
    }
    html body .player-bar #pb-play svg { color: #000 !important; fill: #000 !important; width: 18px !important; height: 18px !important; }
    html body .player-bar #pb-next {
        all: unset !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 34px !important;
        height: 34px !important;
        background: transparent !important;
        color: #fff !important;
        cursor: pointer !important;
        flex-shrink: 0 !important;
    }
    html body .player-bar #pb-next svg { color: #fff !important; stroke: #fff !important; fill: none !important; width: 18px !important; height: 18px !important; }
}

/* === SAMSUNG S20 NOW PLAYING FULLSCREEN === */
@media (max-width: 720px) {
    html body .now-playing-fullscreen {
        all: unset !important;
        position: fixed !important;
        inset: 0 !important;
        z-index: 1000 !important;
        background: linear-gradient(180deg, #3a2a4f 0%, #1a1a22 50%, #0a0a0d 100%) !important;
        display: none !important;
        flex-direction: column !important;
        padding: 16px 20px 32px !important;
        box-sizing: border-box !important;
        overflow-y: auto !important;
    }
    html body.now-playing-open { overflow: hidden !important; }
    html body.now-playing-open .now-playing-fullscreen { display: flex !important; }

    html body .now-playing-fullscreen .np-close {
        all: unset !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 40px !important;
        height: 40px !important;
        border-radius: 50% !important;
        background: rgba(0,0,0,0.4) !important;
        color: #fff !important;
        cursor: pointer !important;
        margin-bottom: 24px !important;
        flex-shrink: 0 !important;
        align-self: flex-start !important;
    }
    html body .now-playing-fullscreen .np-close svg { color: #fff !important; stroke: #fff !important; width: 24px !important; height: 24px !important; }

    html body .now-playing-fullscreen .np-cover {
        all: unset !important;
        display: block !important;
        width: min(82vw, 360px) !important;
        height: min(82vw, 360px) !important;
        margin: 5vh auto 32px !important;
        border-radius: 12px !important;
        overflow: hidden !important;
        box-shadow: 0 24px 60px rgba(0,0,0,0.7) !important;
        background: rgba(255,255,255,0.05) !important;
        flex-shrink: 0 !important;
    }
    html body .now-playing-fullscreen .np-cover img {
        all: unset !important;
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    html body .now-playing-fullscreen .np-title {
        all: unset !important;
        display: block !important;
        font-size: 22px !important;
        font-weight: 800 !important;
        color: #fff !important;
        text-align: center !important;
        margin: 0 12px 6px !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    html body .now-playing-fullscreen .np-artist {
        all: unset !important;
        display: block !important;
        font-size: 14px !important;
        color: #b3b3b3 !important;
        text-align: center !important;
        margin: 0 12px 32px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    html body .now-playing-fullscreen .np-controls {
        all: unset !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 20px !important;
        margin-top: auto !important;
        padding: 24px 0 !important;
    }
    html body .now-playing-fullscreen .np-controls .np-ctrl {
        all: unset !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 48px !important;
        height: 48px !important;
        color: #fff !important;
        cursor: pointer !important;
        background: transparent !important;
        flex-shrink: 0 !important;
    }
    html body .now-playing-fullscreen .np-controls .np-ctrl svg { color: #fff !important; stroke: #fff !important; fill: currentColor !important; width: 26px !important; height: 26px !important; }
    html body .now-playing-fullscreen .np-controls .np-play {
        all: unset !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 70px !important;
        height: 70px !important;
        background: #fff !important;
        color: #000 !important;
        border-radius: 50% !important;
        cursor: pointer !important;
        flex-shrink: 0 !important;
    }
    html body .now-playing-fullscreen .np-controls .np-play svg { color: #000 !important; fill: #000 !important; stroke: #000 !important; width: 30px !important; height: 30px !important; }
}

/* === NP FINAL FIX: controls up, lyrics down === */
@media (max-width: 720px) {
    html body .now-playing-fullscreen .np-cover { margin: 2vh auto 24px !important; width: min(70vw, 280px) !important; height: min(70vw, 280px) !important; }
    html body .now-playing-fullscreen .np-controls { margin-top: 16px !important; order: 1 !important; }
    html body .now-playing-fullscreen .np-lyrics {
        all: unset !important;
        display: block !important;
        margin-top: 28px !important;
        padding: 20px !important;
        background: rgba(255,255,255,0.04) !important;
        border-radius: 12px !important;
        color: #d8d8d8 !important;
        font-size: 15px !important;
        line-height: 1.7 !important;
        white-space: pre-wrap !important;
        text-align: center !important;
        max-height: 40vh !important;
        overflow-y: auto !important;
        order: 2 !important;
    }
    html body .now-playing-fullscreen .np-lyrics-title {
        all: unset !important;
        display: block !important;
        text-align: center !important;
        color: #b3b3b3 !important;
        font-size: 12px !important;
        text-transform: uppercase !important;
        letter-spacing: 0.08em !important;
        margin-top: 24px !important;
        margin-bottom: 8px !important;
        order: 2 !important;
    }
}

@media (max-width: 720px) {
    html body .now-playing-fullscreen .np-ctrl.active { color: #fff !important; }
    html body .now-playing-fullscreen .np-ctrl.active svg { color: #fff !important; stroke: #fff !important; fill: currentColor !important; }
    html body .now-playing-fullscreen .np-ctrl:active { transform: scale(0.92); transition: transform 0.1s; }
}

@media (max-width: 720px) {
    html body .now-playing-fullscreen .np-lyrics {
        all: unset !important;
        display: block !important;
        margin-top: 20px !important;
        padding: 18px 16px !important;
        background: rgba(255,255,255,0.03) !important;
        border-radius: 14px !important;
        max-height: 38vh !important;
        overflow-y: auto !important;
        scroll-behavior: smooth !important;
        order: 2 !important;
    }
    html body .now-playing-fullscreen .np-lyric-line {
        display: block !important;
        font-size: 17px !important;
        font-weight: 700 !important;
        line-height: 1.45 !important;
        color: rgba(255,255,255,0.30) !important;
        padding: 4px 2px !important;
        transition: color 0.25s ease, transform 0.25s ease, opacity 0.25s ease !important;
        text-align: left !important;
    }
    html body .now-playing-fullscreen .np-lyric-line.active {
        color: #fff !important;
        transform: scale(1.04) !important;
        transform-origin: left center !important;
    }
}

/* NP: transparent background pokazuje gwiazdki canvas + lepszy sync hook */
@media (max-width: 720px) {
    html body .now-playing-fullscreen {
        background: rgba(8, 8, 12, 0.78) !important;
        backdrop-filter: blur(24px) saturate(140%) !important;
        -webkit-backdrop-filter: blur(24px) saturate(140%) !important;
    }
    html body .now-playing-fullscreen .np-lyrics {
        background: rgba(0,0,0,0.35) !important;
        backdrop-filter: blur(8px) !important;
    }
}

/* Lock body scroll when NP open */
@media (max-width: 720px) {
    html body.now-playing-open { overflow: hidden !important; position: fixed !important; width: 100% !important; }
    html body.now-playing-open .main-scroll { overflow: hidden !important; }
}

/* NP: solid dark + własne gwiazdy + force title visible */
@media (max-width: 720px) {
    html body .now-playing-fullscreen {
        background: radial-gradient(ellipse at center, #1a0a2e 0%, #08080c 70%) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
    html body .now-playing-fullscreen::before {
        content: "" !important;
        position: absolute !important;
        inset: 0 !important;
        pointer-events: none !important;
        background-image:
            radial-gradient(1px 1px at 20% 30%, #fff, transparent),
            radial-gradient(1px 1px at 40% 70%, #fff, transparent),
            radial-gradient(1.5px 1.5px at 60% 20%, #fff, transparent),
            radial-gradient(1px 1px at 80% 80%, #fff, transparent),
            radial-gradient(1px 1px at 10% 60%, #fff, transparent),
            radial-gradient(2px 2px at 50% 50%, #fff, transparent),
            radial-gradient(1px 1px at 90% 40%, #fff, transparent),
            radial-gradient(1.5px 1.5px at 30% 90%, #fff, transparent),
            radial-gradient(1px 1px at 70% 10%, #fff, transparent),
            radial-gradient(1px 1px at 15% 80%, #fff, transparent),
            radial-gradient(1.5px 1.5px at 85% 65%, #fff, transparent),
            radial-gradient(1px 1px at 55% 40%, #fff, transparent),
            radial-gradient(1px 1px at 25% 15%, #fff, transparent),
            radial-gradient(2px 2px at 65% 75%, #fff, transparent),
            radial-gradient(1px 1px at 45% 25%, #fff, transparent) !important;
        background-size: 100% 100% !important;
        opacity: 0.5 !important;
        animation: npStars 60s linear infinite !important;
        z-index: 0 !important;
    }
    @keyframes npStars {
        0% { transform: translateY(0); }
        100% { transform: translateY(-20px); }
    }
    html body .now-playing-fullscreen > * { position: relative !important; z-index: 1 !important; }
    html body .now-playing-fullscreen #np-title,
    html body .now-playing-fullscreen .np-title {
        all: unset !important;
        display: block !important;
        font-size: 22px !important;
        font-weight: 800 !important;
        color: #ffffff !important;
        text-align: center !important;
        margin: 0 16px 6px !important;
        line-height: 1.2 !important;
        z-index: 2 !important;
        position: relative !important;
        visibility: visible !important;
        opacity: 1 !important;
        word-break: break-word !important;
    }
    html body .now-playing-fullscreen #np-artist,
    html body .now-playing-fullscreen .np-artist {
        all: unset !important;
        display: block !important;
        font-size: 14px !important;
        color: #c0c0c0 !important;
        text-align: center !important;
        margin: 0 16px 24px !important;
        z-index: 2 !important;
        position: relative !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* NP final: transparent over app stars + reuse existing lyrics */
@media (max-width: 720px) {
    html body .now-playing-fullscreen {
        background: rgba(10,10,15,0.86) !important;
        backdrop-filter: blur(40px) saturate(160%) !important;
        -webkit-backdrop-filter: blur(40px) saturate(160%) !important;
    }
    html body .now-playing-fullscreen::before { display: none !important; }
    html body .now-playing-fullscreen #np-lyrics #np-lyrics-text {
        display: block !important;
        font-size: 17px !important;
    }
    html body .now-playing-fullscreen .np-lyric-line {
        display: block !important;
        font-size: 17px !important;
        font-weight: 700 !important;
        color: rgba(255,255,255,0.30) !important;
        padding: 4px 0 !important;
        transition: color 0.2s ease, transform 0.2s ease !important;
        text-align: left !important;
    }
    html body .now-playing-fullscreen .np-lyric-line.active {
        color: #fff !important;
        transform: scale(1.04) !important;
        transform-origin: left center !important;
    }
    html body .now-playing-fullscreen .np-word.lit { color: #fff !important; }
    html body .now-playing-fullscreen .np-word.now { color: #fff !important; }
}

/* NP: pełna transparencja, widać gwiazdki canvas body */
@media (max-width: 720px) {
    html body .now-playing-fullscreen {
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
    html body .now-playing-fullscreen::after {
        content: "" !important;
        position: absolute !important;
        inset: 0 !important;
        background: rgba(8,8,12,0.55) !important;
        backdrop-filter: blur(2px) !important;
        pointer-events: none !important;
        z-index: -1 !important;
    }
    html body.now-playing-open .main-scroll,
    html body.now-playing-open .sidebar,
    html body.now-playing-open .mobile-bottom-nav {
        opacity: 0 !important;
        pointer-events: none !important;
    }
    html body.now-playing-open .player-bar { display: none !important; }
}

/* Match search-input style — frosted glass colors */
@media (max-width: 720px) {
    html body .player-bar.player-bar {
        background: rgba(255,255,255,0.04) !important;
        border: 1px solid rgba(255,255,255,0.08) !important;
        backdrop-filter: blur(20px) saturate(140%) !important;
        -webkit-backdrop-filter: blur(20px) saturate(140%) !important;
    }
    html body .mobile-bottom-nav {
        background: rgba(255,255,255,0.04) !important;
        border-top: 1px solid rgba(255,255,255,0.08) !important;
        backdrop-filter: blur(20px) saturate(140%) !important;
        -webkit-backdrop-filter: blur(20px) saturate(140%) !important;
    }
    html body .mobile-bottom-nav a {
        color: rgba(255,255,255,0.55) !important;
        background: transparent !important;
    }
    html body .mobile-bottom-nav a.active {
        color: #fff !important;
        background: rgba(255,255,255,0.06) !important;
    }
    html body .mobile-bottom-nav a.active svg { stroke: #fff !important; }
}

/* === PAGE TRANSITIONS + SKELETON === */
.main-scroll { transition: opacity 0.12s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.page-header, .song-table, .album-grid, .empty-state, .pending-tracks-section, .settings-card {
    animation: fadeIn 0.25s ease-out;
}
img[loading="lazy"] { transition: opacity 0.3s ease; }
img[loading="lazy"]:not([src]), img[loading="lazy"][src=""] { opacity: 0; }

/* skeleton dla loading */
.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 100%);
    background-size: 200% 100%;
    animation: skel 1.4s ease-in-out infinite;
    border-radius: 6px;
}
@keyframes skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* === SPLASH SCREEN === */
.doniix-splash {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #000;
    transition: opacity 0.45s ease, visibility 0.45s ease;
    overflow: hidden;
}
.doniix-splash.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.doniix-splash-stars { position: absolute; inset: 0; z-index: 0; }
.doniix-splash-star-layer { position: absolute; inset: 0; background-repeat: repeat; }
.doniix-splash-star-1 {
    background-image:
        radial-gradient(2.5px 2.5px at 20% 30%, rgba(255,255,255,1), transparent),
        radial-gradient(2.5px 2.5px at 60% 70%, rgba(255,255,255,1), transparent),
        radial-gradient(3px 3px at 80% 10%, rgba(255,255,255,1), transparent),
        radial-gradient(2px 2px at 40% 90%, rgba(255,255,255,0.95), transparent),
        radial-gradient(2.5px 2.5px at 10% 50%, rgba(255,255,255,1), transparent),
        radial-gradient(2px 2px at 90% 60%, rgba(255,255,255,0.9), transparent);
    background-size: 280px 280px;
    animation: drift-near 90s linear infinite, twinkle-near 4s ease-in-out infinite;
}
.doniix-splash-star-2 {
    background-image:
        radial-gradient(3px 3px at 35% 25%, rgba(255,255,255,1), transparent),
        radial-gradient(3px 3px at 70% 55%, rgba(255,255,255,1), transparent),
        radial-gradient(2.5px 2.5px at 50% 15%, rgba(255,255,255,0.95), transparent);
    background-size: 450px 450px;
    animation: drift-mid 160s linear infinite, twinkle-mid 6s ease-in-out infinite;
}
.doniix-splash-star-3 {
    background-image:
        radial-gradient(1.5px 1.5px at 12% 18%, rgba(255,255,255,0.85), transparent),
        radial-gradient(1.5px 1.5px at 88% 42%, rgba(255,255,255,0.8), transparent);
    background-size: 200px 200px;
    animation: drift-far 260s linear infinite;
}
.doniix-splash-logo {
    position: relative;
    z-index: 2;
    width: 110px;
    height: 110px;
    border-radius: 26px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6), 0 0 40px rgba(255,255,255,0.12);
    animation: splashPulse 2s ease-in-out infinite;
}
.doniix-splash-logo svg { width: 100%; height: 100%; display: block; }
.doniix-splash-name, .doniix-splash-bar { position: relative; z-index: 2; }
.doniix-splash-name {
    margin-top: 22px;
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.02em;
    opacity: 0.95;
    animation: splashFade 1.6s ease-in-out infinite alternate;
}
.doniix-splash-bar {
    margin-top: 28px;
    width: 140px;
    height: 3px;
    background: rgba(255,255,255,0.08);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
.doniix-splash-bar::after {
    content: "";
    position: absolute;
    top: 0; left: -40%;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #ffffff, transparent);
    animation: splashBar 1.1s ease-in-out infinite;
}
@keyframes splashPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 24px 64px rgba(0,0,0,0.6), 0 0 40px rgba(255,255,255,0.12); }
    50% { transform: scale(1.05); box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 60px rgba(255,255,255,0.22); }
}
@keyframes splashFade { 0% { opacity: 0.6; } 100% { opacity: 1; } }
@keyframes splashBar {
    0% { left: -40%; }
    100% { left: 100%; }
}

/* SPA preload smooth swap */
.main-scroll { will-change: opacity; }

/* Cover lazy fade in */
.song-cover img, .pb-cover img, .album-card img {
    transition: opacity 0.35s ease;
}
.song-cover img:not([src]),
.song-cover img[src=""] { opacity: 0; }

/* ===== SCREENSAVER (Winamp-style visualizer) ===== */
#doniix-screensaver {
    position: fixed; inset: 0; z-index: 100000;
    background: #000;
    opacity: 0; pointer-events: none;
    transition: opacity 0.5s ease;
    overflow: hidden;
}
#doniix-screensaver.active { opacity: 1; pointer-events: auto; cursor: none; }
#screensaver-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ===== LYRICS FULL MODE (Shift+L or Shift+click lyrics btn) ===== */
#lyrics-fullscreen {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.92);
    backdrop-filter: blur(40px) saturate(140%);
    -webkit-backdrop-filter: blur(40px) saturate(140%);
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
}
#lyrics-fullscreen.open { opacity: 1; pointer-events: auto; }
#lyrics-fullscreen .lf-close {
    position: absolute; top: 22px; right: 26px;
    background: transparent; border: 1px solid var(--border);
    color: var(--text-primary); width: 40px; height: 40px;
    border-radius: 999px; font-size: 22px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    z-index: 2;
}
#lyrics-fullscreen .lf-close:hover { background: rgba(255,255,255,0.08); }
#lyrics-fullscreen .lf-grid {
    display: grid; grid-template-columns: 1fr 380px;
    gap: 48px; height: 100vh;
    padding: 60px 80px;
    align-items: center;
}
#lyrics-fullscreen .lf-lyrics-col {
    overflow-y: auto; max-height: calc(100vh - 120px);
    padding-right: 24px;
}
#lyrics-fullscreen .lf-lyrics-col::-webkit-scrollbar { width: 6px; }
#lyrics-fullscreen .lf-lyrics-col::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 3px; }
#lyrics-fullscreen .lf-lyrics {
    white-space: pre-wrap; word-break: break-word;
    color: var(--text-primary);
    font-size: clamp(20px, 2.4vw, 32px);
    line-height: 1.55;
    font-weight: 500;
    letter-spacing: -0.01em;
}
#lyrics-fullscreen .lf-cover-col {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 18px;
    position: sticky; top: 0;
}
#lyrics-fullscreen .lf-cover-wrap {
    width: 100%; aspect-ratio: 1;
    border-radius: 16px; overflow: hidden;
    box-shadow: 0 32px 80px rgba(0,0,0,0.7);
}
#lyrics-fullscreen .lf-cover-wrap img { width: 100%; height: 100%; object-fit: cover; }
#lyrics-fullscreen .lf-title {
    font-size: 22px; font-weight: 700; text-align: center;
    color: var(--text-primary); letter-spacing: -0.02em;
}
#lyrics-fullscreen .lf-artist {
    font-size: 15px; color: var(--text-secondary); text-align: center;
}
@media (max-width: 880px) {
    #lyrics-fullscreen .lf-grid {
        grid-template-columns: 1fr; gap: 24px; padding: 60px 24px 24px;
    }
    #lyrics-fullscreen .lf-cover-col { order: -1; }
    #lyrics-fullscreen .lf-cover-wrap { max-width: 200px; }
    #lyrics-fullscreen .lf-lyrics { font-size: 18px; }
}

/* ===== LYRICS FULL MODE — controls + synced lines + hidden scrollbar ===== */
#lyrics-fullscreen .lf-lyrics-col { scrollbar-width: none; -ms-overflow-style: none; }
#lyrics-fullscreen .lf-lyrics-col::-webkit-scrollbar { display: none !important; width: 0 !important; }
#lyrics-fullscreen .lf-lyrics { display: flex; flex-direction: column; gap: 14px; padding-bottom: 40vh; }
#lyrics-fullscreen .lf-lyric-line {
    font-size: clamp(24px, 3vw, 36px);
    line-height: 1.22;
    font-weight: 800;
    letter-spacing: -0.012em;
    color: rgba(255,255,255,0.24);
    margin: 0 0 16px;
    padding: 4px 4px;
    transition: color 0.5s ease, transform 0.6s cubic-bezier(0.32,0.72,0,1), filter 0.5s ease;
    transform-origin: left center;
    filter: blur(0px);
    cursor: pointer;
    border-radius: 6px;
    word-wrap: break-word;
}
#lyrics-fullscreen .lf-lyric-line.past { color: rgba(255,255,255,0.18); filter: blur(0.8px); }
#lyrics-fullscreen .lf-lyric-line.active {
    color: rgba(255,255,255,0.6);
    transform: scale(1.03);
    filter: blur(0);
}
#lyrics-fullscreen .lf-lyric-line:hover { color: rgba(255,255,255,0.5); }
#lyrics-fullscreen .lf-lyric-placeholder { color: var(--text-muted); font-size: 18px; font-weight: 500; }
#lyrics-fullscreen .lf-lyric-plain { white-space: pre-wrap; font-family: inherit; color: var(--text-primary); font-size: clamp(18px,2vw,24px); line-height: 1.6; margin: 0; }
#lyrics-fullscreen .lf-seek { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 8px; }
#lyrics-fullscreen .lf-seek span { font-size: 11px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; min-width: 36px; }
#lyrics-fullscreen .lf-seek-bar { flex: 1; height: 4px; background: rgba(255,255,255,0.12); border-radius: 999px; cursor: pointer; overflow: hidden; }
#lyrics-fullscreen .lf-seek-fill { height: 100%; background: var(--text-primary); border-radius: 999px; width: 0; transition: width 0.1s linear; }
#lyrics-fullscreen .lf-controls { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 6px; }
#lyrics-fullscreen .lf-ctrl {
    background: transparent; border: 0; color: var(--text-secondary);
    width: 44px; height: 44px; border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: color 0.15s ease, background 0.15s ease;
}
#lyrics-fullscreen .lf-ctrl:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }
#lyrics-fullscreen .lf-ctrl.lf-play {
    background: var(--text-primary); color: #000;
    width: 58px; height: 58px;
}
#lyrics-fullscreen .lf-ctrl.lf-play:hover { background: #fff; }
.side-panel-lyrics-fullscreen-btn {
    background: transparent; border: 1px solid var(--border);
    color: var(--text-secondary); padding: 6px 12px; border-radius: 999px;
    font-size: 12px; font-weight: 600; cursor: pointer; margin-left: 8px;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.side-panel-lyrics-fullscreen-btn:hover { color: var(--text-primary); border-color: var(--text-secondary); }

#lyrics-fullscreen .lf-word {
    display: inline-block;
    color: inherit;
    transition: color 0.25s ease, text-shadow 0.3s ease, transform 0.35s cubic-bezier(0.32,0.72,0,1);
    transform-origin: center bottom;
}
#lyrics-fullscreen .lf-lyric-line.active .lf-word.lit {
    color: #fff;
    text-shadow: 0 0 18px rgba(255,255,255,0.22);
}
#lyrics-fullscreen .lf-lyric-line.active .lf-word.now {
    transform: scale(1.05);
    text-shadow: 0 0 26px rgba(255,255,255,0.35);
}
#lyrics-fullscreen .lf-instr {
    display: flex; gap: 10px; align-items: center;
    height: 32px; margin: 18px 0;
    padding: 6px 6px;
}
#lyrics-fullscreen .lf-inst-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.22);
    transition: background 0.3s ease, transform 0.4s cubic-bezier(0.32,0.72,0,1);
}
#lyrics-fullscreen .lf-lyric-line.active .lf-inst-dot { background: rgba(255,255,255,0.4); }
#lyrics-fullscreen .lf-lyric-line.active .lf-inst-dot.lit {
    background: #fff;
    transform: scale(1.25);
    box-shadow: 0 0 14px rgba(255,255,255,0.5);
}

/* === MOBILE PLAYER BAR HEART + DEVICES + SYNC PROGRESS === */
@media (max-width: 720px) {
    html body .player-bar .pb-right {
        display: none !important;
    }
    html body .player-bar .pb-right > * { display: none !important; }
    html body .player-bar #pb-devices {
        display: none !important;
        visibility: hidden !important;
    }
    html body .player-bar #pb-devices_disabled {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        align-items: center !important;
        justify-content: center !important;
        width: 36px !important;
        height: 36px !important;
        background: transparent !important;
        border: 0 !important;
        color: rgba(255,255,255,0.85) !important;
        padding: 0 !important;
        margin: 0 4px 0 0 !important;
        order: 99;
        flex-shrink: 0;
    }
    html body .player-bar #pb-devices svg { width: 20px !important; height: 20px !important; color: rgba(255,255,255,0.85) !important; stroke: rgba(255,255,255,0.85) !important; }
    html body .player-bar #pb-favorite,
    html body .player-bar .pb-left #pb-favorite {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        align-items: center !important;
        justify-content: center !important;
        width: 36px !important;
        height: 36px !important;
        background: transparent !important;
        border: 0 !important;
        color: rgba(255,255,255,0.85) !important;
        padding: 0 !important;
        margin: 0 4px 0 auto !important;
        order: 97;
        flex-shrink: 0;
    }
    html body .player-bar #pb-favorite svg { width: 20px !important; height: 20px !important; }
    html body .player-bar #pb-favorite.liked { color: #1ed760 !important; }
    html body .player-bar #pb-favorite.liked svg { fill: currentColor !important; stroke: currentColor !important; }
    html body .player-bar { position: relative !important; overflow: visible !important; }
    html body .player-bar::after {
        content: '';
        position: absolute;
        left: 8px; right: 8px; bottom: 2px;
        height: 2px; border-radius: 1px;
        background: rgba(255,255,255,0.18);
        pointer-events: none;
    }
    html body .player-bar::before {
        content: '';
        position: absolute;
        left: 8px; bottom: 2px;
        height: 2px; width: var(--pb-progress, 0%);
        max-width: calc(100% - 16px);
        border-radius: 1px;
        background: #ffffff;
        pointer-events: none;
        z-index: 1;
        transition: width 0.15s linear;
    }
}


/* === NP FULLSCREEN MOBILE: lyrics expand button + larger lyrics box === */
@media (max-width: 720px) {
    html body .now-playing-fullscreen .np-lyrics-title {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 0 6px !important;
    }
    html body .now-playing-fullscreen .np-fs-expand {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 30px !important;
        height: 30px !important;
        background: rgba(255,255,255,0.08) !important;
        border: 0 !important;
        border-radius: 50% !important;
        color: rgba(255,255,255,0.85) !important;
        cursor: pointer !important;
        padding: 0 !important;
    }
    html body .now-playing-fullscreen .np-fs-expand:active { transform: scale(0.9); transition: transform 0.1s; }
    html body .now-playing-fullscreen .np-lyric-line {
        cursor: pointer !important;
    }
    html body .now-playing-fullscreen .np-lyric-line.past {
        color: rgba(255,255,255,0.18) !important;
    }
    html body .now-playing-fullscreen #np-fs-lyrics {
        max-height: 42vh !important;
        scroll-behavior: smooth !important;
        -webkit-overflow-scrolling: touch !important;
    }
}


/* ===== VIEW TRANSITIONS ===== */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) {
    animation-duration: 0.22s;
    animation-timing-function: cubic-bezier(0.32, 0.72, 0, 1);
}
::view-transition-old(root) { animation-name: doniixFadeOut; }
::view-transition-new(root) { animation-name: doniixFadeIn; }
@keyframes doniixFadeOut { to { opacity: 0; } }
@keyframes doniixFadeIn { from { opacity: 0; } }
.pb-cover img { view-transition-name: pb-cover-hero; }

/* ===== DYNAMIC ACCENT COLOR (extracted from cover) ===== */
:root {
    --accent-r: 30;
    --accent-g: 215;
    --accent-b: 96;
    --accent-rgb: 30,215,96;
    --accent-color: rgb(30,215,96);
}
@media (max-width: 720px) {
    html body.now-playing-open .now-playing-fullscreen {
        background: radial-gradient(ellipse at top, rgba(var(--accent-rgb), 0.35) 0%, rgba(var(--accent-rgb), 0.12) 35%, #08080c 75%) !important;
        transition: background 0.6s ease !important;
    }
}

/* ===== HERO BACKGROUND BLUR FROM COVER (mobile NP) ===== */
@media (max-width: 720px) {
    html body.now-playing-open .now-playing-fullscreen::before {
        content: '';
        position: absolute;
        inset: -10%;
        background-image: var(--np-cover-bg, none);
        background-size: cover;
        background-position: center;
        filter: blur(60px) saturate(180%);
        opacity: 0.35;
        z-index: -1;
        pointer-events: none;
        transition: background-image 0.5s ease, opacity 0.5s ease;
    }
}

/* ===== LOADING SKELETONS ===== */
.skel {
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.10) 50%, rgba(255,255,255,0.04) 100%);
    background-size: 200% 100%;
    animation: skelShimmer 1.4s ease-in-out infinite;
    border-radius: 4px;
}
@keyframes skelShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skel-row { display: flex; gap: 12px; align-items: center; padding: 8px 4px; }
.skel-cover { width: 40px; height: 40px; border-radius: 6px; flex-shrink: 0; }
.skel-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.skel-line { height: 12px; }
.skel-line.short { width: 40%; }
.skel-line.long { width: 70%; }

/* ===== TOUCH RIPPLE ===== */
.btn, .ctx-item, .sidebar-item, .pb-btn, .np-ctrl { position: relative; overflow: hidden; }
.ripple-burst {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0);
    animation: rippleExpand 0.6s ease-out forwards;
}
@keyframes rippleExpand {
    to {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* ===== QUEUE DRAG REORDER ===== */
.queue-item { transition: background 0.15s ease, transform 0.18s ease; cursor: grab; }
.queue-item:active { cursor: grabbing; }
.queue-item.drag-over { background: rgba(30, 215, 96, 0.12); transform: translateX(4px); border-left: 3px solid rgba(30, 215, 96, 0.7); }

/* ===== TOAST STACK ===== */
@keyframes toastSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== CONCERT MODE (TV cast / huge fullscreen) ===== */
body.concert-mode .sidebar,
body.concert-mode .player-bar,
body.concert-mode .mobile-bottom-nav,
body.concert-mode .main-scroll,
body.concert-mode .side-panel,
body.concert-mode #mobile-search-fab,
body.concert-mode #sleep-badge,
body.concert-mode #doniix-update-banner,
body.concert-mode .ctx-menu,
body.concert-mode .ctx-backdrop { display: none !important; }
body.concert-mode {
    background: radial-gradient(ellipse at top, rgba(var(--accent-rgb), 0.4) 0%, #000 70%) !important;
    background-image: var(--np-cover-bg, none), radial-gradient(ellipse at top, rgba(var(--accent-rgb), 0.4) 0%, #000 70%);
    background-size: cover, auto;
    background-position: center;
}
body.concert-mode::before {
    content: '';
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(50px);
    z-index: 1;
}
body.concert-mode::after {
    content: '';
    position: fixed; inset: 0;
    display: flex;
    z-index: 2;
}
body.concert-mode .now-playing-fullscreen {
    display: flex !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 10 !important;
    background: transparent !important;
    padding: 5vh 8vw !important;
}
body.concert-mode .now-playing-fullscreen .np-cover {
    width: 38vh !important;
    height: 38vh !important;
    max-width: 35vw !important;
    max-height: 35vw !important;
}
body.concert-mode .now-playing-fullscreen .np-title { font-size: clamp(28px, 5vw, 56px) !important; }
body.concert-mode .now-playing-fullscreen .np-artist { font-size: clamp(18px, 2.5vw, 28px) !important; }

/* ===== LIGHT THEME OVERRIDE ===== */
:root[data-theme="light"] {
    --bg-page: #f7f7f8;
    --bg-card: #ffffff;
    --bg-hover: rgba(0,0,0,0.04);
    --text-primary: #0a0a0d;
    --text-secondary: #4a4a52;
    --text-muted: #8a8a92;
    --border: rgba(0,0,0,0.08);
    --shadow-md: 0 4px 14px rgba(0,0,0,0.08);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.12);
}
:root[data-theme="light"] body {
    background: var(--bg-page);
    color: var(--text-primary);
}

/* ===== DROP SHAKE ANIMATION ===== */
@keyframes dropShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-12px); }
    40% { transform: translateX(12px); }
    60% { transform: translateX(-8px); }
    80% { transform: translateX(8px); }
}

/* ===== PLAYLIST DRAG REORDER ===== */
[data-playlist-view="1"] tr[data-song-id] { cursor: grab; transition: background 0.15s ease, transform 0.15s ease; }
[data-playlist-view="1"] tr[data-song-id]:active { cursor: grabbing; }
[data-playlist-view="1"] tr.drag-over-row {
    background: rgba(var(--accent-rgb, 30,215,96), 0.10) !important;
    box-shadow: inset 3px 0 0 rgba(var(--accent-rgb, 30,215,96), 0.7);
}

/* ===== SLEEP PULSE ===== */
@keyframes sleepPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.06); opacity: 0.85; }
}

/* ===== DRIVE MODE (huge UI, no distraction) ===== */
body.drive-mode .sidebar,
body.drive-mode .main-scroll,
body.drive-mode .side-panel,
body.drive-mode .mobile-bottom-nav,
body.drive-mode #mobile-search-fab,
body.drive-mode #sleep-badge,
body.drive-mode #doniix-update-banner { display: none !important; }
body.drive-mode .player-bar {
    position: fixed !important;
    inset: 0 !important;
    height: 100vh !important;
    padding: 40px !important;
    background: radial-gradient(ellipse at center, rgba(var(--accent-rgb, 30,215,96), 0.3), #000 70%) !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 24px !important;
}
body.drive-mode .pb-cover {
    width: 30vh !important;
    height: 30vh !important;
    max-width: 380px !important;
    max-height: 380px !important;
    border-radius: 16px !important;
    box-shadow: 0 24px 60px rgba(0,0,0,0.6) !important;
}
body.drive-mode .pb-meta { text-align: center !important; }
body.drive-mode .pb-title, body.drive-mode a#pb-title {
    font-size: clamp(28px, 6vw, 60px) !important;
    font-weight: 800 !important;
    white-space: normal !important;
    text-overflow: clip !important;
}
body.drive-mode .pb-artist, body.drive-mode a#pb-artist {
    font-size: clamp(18px, 3vw, 32px) !important;
    margin-top: 8px !important;
}
body.drive-mode #pb-favorite, body.drive-mode #pb-devices { display: none !important; }
body.drive-mode .pb-center { transform: scale(1.5) !important; }
body.drive-mode .pb-right { display: none !important; }

/* ===== A11Y: lyrics font scale + high contrast + dyslexic font ===== */
:root { --lyrics-font-scale: 1; }
.np-lyric-line, .lf-lyric-line, .np-fs-lyrics .np-lyric-line {
    font-size: calc(var(--np-lyrics-base-size, 27px) * var(--lyrics-font-scale)) !important;
}
.lf-lyric-line { --np-lyrics-base-size: 36px; }
html.high-contrast {
    --text-primary: #fff;
    --text-secondary: #fff;
    --text-muted: #ddd;
    --bg-page: #000;
    --bg-card: #000;
    --border: #fff;
}
html.high-contrast body { background: #000 !important; color: #fff !important; }
html.high-contrast .btn { border-width: 2px !important; }
html.high-contrast .np-lyric-line, html.high-contrast .lf-lyric-line { color: #fff !important; text-shadow: 0 0 4px #000 !important; }
html.dyslexic-font, html.dyslexic-font body, html.dyslexic-font input, html.dyslexic-font button, html.dyslexic-font textarea {
    font-family: 'OpenDyslexic', 'Atkinson Hyperlegible', 'Comic Sans MS', sans-serif !important;
    letter-spacing: 0.04em !important;
    word-spacing: 0.16em !important;
}

@media (max-width: 768px) {
    .page-header { padding: 12px 0 !important; }
    .page-title { font-size: 22px !important; }
    #mobile-search-fab { display: none !important; }
}

.hscroll-row { scroll-padding-left: 4px; display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; overflow-x: auto !important; overflow-y: hidden !important; }
.hscroll-row > a { flex: 0 0 160px !important; width: 160px !important; min-width: 160px !important; max-width: 160px !important; scroll-snap-align: start; overflow: hidden; display: block !important; }
.hscroll-row > a > div { max-width: 100%; min-width: 0; }
.hscroll-row::-webkit-scrollbar { height: 6px; }
.hscroll-row::-webkit-scrollbar-track { background: transparent; }
.hscroll-row::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
.hscroll-row::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
@media (max-width: 768px) {
    .hscroll-row > a { flex: 0 0 130px !important; width: 130px !important; min-width: 130px !important; max-width: 130px !important; }
}

.hscroll-row { scrollbar-width: none !important; }
.hscroll-row::-webkit-scrollbar { display: none !important; height: 0 !important; }

@keyframes doniixSlide {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .hscroll-row {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
    }
    .hscroll-row > a {
        flex: 0 0 130px !important;
        width: 130px !important;
        min-width: 130px !important;
        max-width: 130px !important;
        display: block !important;
    }
    #recently-played-widget, #top-week-widget, #for-you-widget,
    #new-in-lib-widget, #random-mix-widget, #discover-widget {
        margin-bottom: 24px;
    }
    .settings-layout { flex-direction: column; }
    .settings-nav {
        display: flex !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        white-space: nowrap;
        padding: 8px 0;
        gap: 6px;
        scrollbar-width: none;
    }
    .settings-nav::-webkit-scrollbar { display: none; }
    .settings-nav-item {
        flex: 0 0 auto;
        padding: 8px 14px;
        font-size: 13px;
    }
    .settings-content { padding: 12px 0 80px !important; }
    .settings-card { padding: 14px !important; margin-bottom: 12px; }
}
