/* ══════════════════════════════════════════════════════════════
   Freely — Dark theme (Spotify/YouTube Music inspired)
   ══════════════════════════════════════════════════════════════ */
:root {
    --bg:          #0d0d14;
    --sidebar-bg:  #111118;
    --surface:     #181820;
    --surface2:    #22222e;
    --surface3:    #2a2a38;
    --accent:      #7c5cfc;
    --accent2:     #a78bfa;
    --green:       #1db954;
    --red:         #ef4444;
    --text:        #e8e8f4;
    --text-mid:    #a8a8c0;
    --text-muted:  #636380;
    --border:      #2a2a3e;

    --sidebar-w:   230px;
    --bar-h:       88px;
    --radius:      10px;
}

*, *::before, *::after {
    margin: 0; padding: 0; box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    touch-action: pan-x pan-y;
}

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

/* ══════════════════════════════════════════════════════════════
   AUTH SCREEN — Sliding panels
   ══════════════════════════════════════════════════════════════ */
.auth-screen {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.auth-main {
    position: relative;
    width: 900px;
    min-width: 900px;
    height: 560px;
    min-height: 560px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

@media (max-width: 960px)  { .auth-main { transform: scale(.85); } }

/* ── Form containers ── */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    width: 550px;
    height: 100%;
    padding: 25px;
    background: var(--surface);
    transition: 1.25s;
}

.auth-form {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

.auth-form-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 2.4;
    letter-spacing: -0.3px;
}

.auth-social {
    display: flex;
    gap: 12px;
    margin-bottom: 4px;
}

.auth-social-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s, border-color .2s, transform .15s;
}
.auth-social-btn:hover {
    background: var(--surface3);
    border-color: var(--text-muted);
    transform: scale(1.05);
}
.auth-social-btn:active { transform: scale(.97); }

.auth-form-span {
    margin-top: 20px;
    margin-bottom: 14px;
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: .02em;
}

.auth-input {
    width: 300px;
    height: 42px;
    margin: 5px 0;
    padding-left: 20px;
    font-size: 13px;
    letter-spacing: .15px;
    border: none;
    outline: none;
    font-family: 'Inter', sans-serif;
    background: var(--surface2);
    color: var(--text);
    border-radius: 8px;
    transition: box-shadow .25s;
    box-shadow:
        inset 2px 2px 4px rgba(0,0,0,.4),
        inset -2px -2px 4px rgba(255,255,255,.03);
}
.auth-input::placeholder { color: var(--text-muted); }
.auth-input:focus {
    box-shadow:
        inset 3px 3px 6px rgba(0,0,0,.5),
        inset -3px -3px 6px rgba(255,255,255,.04);
}

/* Password wrapper + eye toggle */
.auth-pw-wrap {
    position: relative;
    width: 300px;
}
.auth-pw-wrap .auth-input {
    width: 100%;
    padding-right: 42px;
}
.auth-eye {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color .15s;
}
.auth-eye svg { width: 18px; height: 18px; fill: currentColor; }
.auth-eye:hover { color: var(--text); }

.auth-error {
    background: rgba(239, 68, 68, .12);
    border: 1px solid rgba(239, 68, 68, .25);
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 12px;
    color: #fca5a5;
    margin-top: 8px;
    width: 300px;
    text-align: center;
}

.auth-form-btn {
    width: 180px;
    height: 46px;
    border-radius: 25px;
    margin-top: 24px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1.15px;
    background: var(--accent);
    color: #fff;
    border: none;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: box-shadow .2s, transform .15s;
    box-shadow:
        4px 4px 10px rgba(0,0,0,.3),
        -4px -4px 10px rgba(255,255,255,.03);
}
.auth-form-btn:hover {
    box-shadow:
        3px 3px 8px rgba(0,0,0,.35),
        -3px -3px 8px rgba(255,255,255,.04);
    transform: scale(.985);
}
.auth-form-btn:active { transform: scale(.97); }
.auth-form-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ── Container positions ── */
.a-container {
    z-index: 0;
    left: calc(100% - 550px);
}
.b-container {
    left: calc(100% - 550px);
    z-index: 100;
}

/* ── Switch (overlay) panel ── */
.auth-switch {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 350px;
    padding: 50px;
    z-index: 200;
    transition: 1.25s;
    background: linear-gradient(135deg, var(--accent) 0%, #5b3fd4 50%, #3a1f9e 100%);
    overflow: hidden;
    box-shadow: 6px 0 20px rgba(0,0,0,.4);
}

.auth-switch-circle {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.06);
    bottom: -50%;
    left: -50%;
    transition: 1.25s;
}
.auth-switch-circle--t {
    top: -30%;
    left: 60%;
    width: 260px;
    height: 260px;
}

.auth-switch-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: absolute;
    width: 350px;
    padding: 50px 40px;
    transition: 1.25s;
}

.auth-switch-title {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    line-height: 1.3;
    margin-bottom: 12px;
    text-align: center;
}

.auth-switch-desc {
    font-size: 13px;
    color: rgba(255,255,255,.75);
    text-align: center;
    line-height: 1.6;
    letter-spacing: .2px;
    margin-bottom: 8px;
}

.auth-switch-btn {
    width: 160px;
    height: 44px;
    border-radius: 25px;
    margin-top: 30px;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 1.15px;
    background: rgba(255,255,255,.15);
    color: #fff;
    border: 2px solid rgba(255,255,255,.45);
    cursor: pointer;
    font-family: inherit;
    transition: background .2s, border-color .2s, transform .15s;
}
.auth-switch-btn:hover {
    background: rgba(255,255,255,.25);
    border-color: #fff;
    transform: scale(.985);
}
.auth-switch-btn:active { transform: scale(.97); }

/* ── Toggle classes ── */
.is-txr     { left: calc(100% - 350px); transition: 1.25s; }
.is-txl     { left: 0; transition: 1.25s; }
.is-z200    { z-index: 200; transition: 1.25s; }
.b-container.is-txl { z-index: 0; }
.is-hidden  { visibility: hidden; opacity: 0; position: absolute; transition: 1.25s; }

.is-gx { animation: is-gx 1.25s; }
@keyframes is-gx {
    0%, 10%, 100% { width: 350px; }
    30%, 50%      { width: 430px; }
}

/* ── Mobile toggle link ── */
.auth-mobile-toggle {
    display: none;
    margin-top: 24px;
    font-size: 13px;
    color: var(--text-muted);
    gap: 6px;
    align-items: center;
}
.auth-mobile-toggle button {
    background: none;
    border: none;
    color: var(--accent2);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    text-decoration: underline;
}

/* ── Mobile responsive ── */
@media (max-width: 768px) {
    .auth-screen {
        justify-content: flex-start;
        overflow-y: auto;
        padding: 32px 0 24px;
    }
    .auth-main {
        width: 100%;
        min-width: 0;
        height: auto;
        min-height: 0;
        max-width: 420px;
        border-radius: 16px;
        transform: none !important;
    }
    .auth-switch { display: none; }
    .auth-container {
        position: relative;
        width: 100%;
        left: 0 !important;
        z-index: auto !important;
        padding: 36px 28px;
        height: auto;
    }
    .a-container { display: none; }
    .a-container.is-txl { display: flex; }
    .b-container { display: flex; }
    .b-container.is-txl { display: none; }
    .auth-input { width: 100%; }
    .auth-pw-wrap { width: 100%; }
    .auth-error { width: 100%; }
    .auth-mobile-toggle { display: flex; }
    .auth-form-title { font-size: 22px; }
}

@media (max-width: 400px) {
    .auth-main { max-width: 100%; margin: 0 16px; border-radius: 12px; }
    .auth-container { padding: 28px 20px; }
    .auth-input { width: 100%; }
    .auth-pw-wrap { width: 100%; }
    .auth-error { width: 100%; }
}

/* ── Google fallback modal ───────────────────────────────────── */
.g-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: g-fade .2s ease;
}
@keyframes g-fade { from { opacity: 0; } to { opacity: 1; } }

.g-modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 36px 32px 32px;
    text-align: center;
    min-width: 300px;
    max-width: 340px;
    position: relative;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
    animation: g-slide .25s ease;
}
@keyframes g-slide { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }

.g-modal-logo {
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}
.g-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.g-modal-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.4;
}
.g-modal-btn {
    display: flex;
    justify-content: center;
}
.g-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: color .15s, background .15s;
}
.g-modal-close:hover { color: var(--text); background: var(--surface2); }

/* ══════════════════════════════════════════════════════════════
   APP SHELL (grid)
   ══════════════════════════════════════════════════════════════ */
#app {
    display: grid;
    height: 100vh;
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: 1fr auto;
    grid-template-areas:
        "sidebar main"
        "bar     bar";
}

/* ══════════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════════ */
.sidebar {
    grid-area: sidebar;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    height: 140px;
    flex-shrink: 0;
    overflow: visible;
}
.sidebar-logo svg { width: 22px; height: 22px; fill: currentColor; }
.sidebar-logo-img {
    width: 210px;
    height: 70px;
    object-fit: contain;
    transform: scale(2.2);
    animation: logo-pulse 3s ease-in-out infinite;
    -webkit-mask-image: radial-gradient(ellipse 70% 80% at center, black 50%, transparent 100%);
    mask-image: radial-gradient(ellipse 70% 80% at center, black 50%, transparent 100%);
}

@keyframes logo-pulse {
    0%, 100% { filter: brightness(1)   drop-shadow(0 0 4px #7c5cfc33); }
    50%       { filter: brightness(1.15) drop-shadow(0 0 8px #7c5cfc55); }
}

.sidebar-section { margin-top: 8px; padding: 0 8px; }

.sidebar-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    color: var(--text-muted);
    padding: 8px 10px 6px;
    text-transform: uppercase;
}

.sbl {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: none;
    border: none;
    border-radius: 8px;
    padding: 9px 10px;
    color: var(--text-mid);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background .15s, color .15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: inherit;
}
.sbl svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.sbl:hover  { background: var(--surface2); color: var(--text); }
.sbl.active { background: var(--surface2); color: var(--accent2); }
.sbl-empty  { display: block; font-size: 12px; color: var(--text-muted); padding: 6px 10px; }

.sbl-pl {
    padding: 7px 10px;
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 8px;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    transition: background .15s, color .15s;
    font-family: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sbl-pl:hover  { background: var(--surface2); color: var(--text); }
.sbl-pl.active { background: var(--surface2); color: var(--accent2); }

.sidebar-bottom {
    margin-top: auto;
    padding: 12px 8px 0;
    border-top: 1px solid var(--border);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.user-email {
    font-size: 12px;
    color: var(--text-mid);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: color .15s, background .15s;
}
.logout-btn svg { width: 18px; height: 18px; fill: currentColor; }
.logout-btn:hover { color: var(--text); background: var(--surface2); }

.user-chip-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-plan-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .3px;
    padding: 1px 8px;
    border-radius: 10px;
    width: fit-content;
}
.user-plan-badge.plan-trial   { background: rgba(124,92,252,.15); color: var(--accent); }
.user-plan-badge.plan-premium { background: rgba(168,85,247,.15); color: #a855f7; }
.user-plan-badge.plan-free    { background: rgba(136,136,136,.15); color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════
   PROFILE PAGE
   ══════════════════════════════════════════════════════════════ */
.profile-page { max-width: 520px; }

.prof-card {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 12px;
    backdrop-filter: blur(12px);
}
.prof-card-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 7px;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.prof-card-title svg { width: 14px; height: 14px; fill: #c0bfe0; flex-shrink: 0; opacity: .8; }

.prof-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255,255,255,.03);
}
.prof-row:last-child { border-bottom: none; }
.prof-label { font-size: 12px; color: #9898b0; }
.prof-value { font-size: 12px; font-weight: 500; color: #ddddf0; }

/* ── Plan card — translucent ── */
.prof-plan-card {
    background: rgba(124,92,252,.06);
    border: 1px solid rgba(124,92,252,.12);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 12px;
    backdrop-filter: blur(12px);
}
.prof-plan-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.prof-plan-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: .4px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.prof-plan-name svg { width: 14px; height: 14px; fill: #c0bfe0; opacity: .8; }
.prof-plan-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: .3px;
}
.prof-plan-badge.trial { background: rgba(255,255,255,.08); color: #e0dff0; }
.prof-plan-badge.premium { background: rgba(168,85,247,.15); color: #e0dff0; }
.prof-plan-badge.free { background: rgba(136,136,136,.12); color: #b0b0c0; }
.prof-plan-status {
    font-size: 12px;
    color: #9898b0;
    margin-bottom: 14px;
    line-height: 1.4;
}
.prof-plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
}
.prof-plan-features li {
    font-size: 11px;
    color: #9898b0;
    padding: 3px 0;
    display: flex;
    align-items: center;
    gap: 7px;
}
.prof-plan-features li::before {
    content: '✓';
    color: #c0bfe0;
    font-weight: 700;
    font-size: 11px;
}
.prof-plan-features li.disabled {
    opacity: .35;
    text-decoration: line-through;
}
.prof-plan-features li.disabled::before {
    content: '✕';
    color: var(--text-muted);
}

/* ── Upgrade CTA ── */
.prof-upgrade {
    background: linear-gradient(135deg, rgba(124,92,252,.10) 0%, rgba(168,85,247,.08) 100%);
    border: 1px solid rgba(124,92,252,.18);
    border-radius: 14px;
    padding: 20px 18px;
    margin-bottom: 12px;
    text-align: center;
    backdrop-filter: blur(12px);
}
.prof-upgrade-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.prof-upgrade-sub {
    font-size: 12px;
    color: #9898b0;
    margin-bottom: 16px;
    line-height: 1.4;
}
.prof-upgrade-plans {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
.prof-upgrade-option {
    flex: 1;
    min-width: 130px;
    max-width: 200px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: .2s;
}
.prof-upgrade-option:hover {
    border-color: var(--accent);
    background: rgba(124,92,252,.08);
}
.prof-upgrade-option.recommended {
    border-color: rgba(124,92,252,.35);
    background: rgba(124,92,252,.08);
}
.prof-upgrade-option .plan-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}
.prof-upgrade-option .plan-price {
    font-size: 20px;
    font-weight: 800;
    color: #e8e8f4;
    margin-bottom: 2px;
}
.prof-upgrade-option .plan-period {
    font-size: 10px;
    color: #8888a0;
    margin-bottom: 10px;
}
.prof-upgrade-option .plan-desc {
    font-size: 10px;
    color: #8888a0;
    line-height: 1.3;
}
.prof-recommend-tag {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #c0bfe0;
    margin-bottom: 6px;
}

.prof-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: .15s;
    width: 100%;
}
.prof-btn-primary {
    background: var(--accent);
    color: #fff;
}
.prof-btn-primary:hover { background: #6a4be0; }
.prof-btn-outline {
    background: transparent;
    border: 1px solid rgba(255,255,255,.08);
    color: var(--text-muted);
}
.prof-btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.prof-btn-danger {
    background: transparent;
    border: 1px solid rgba(229,62,62,.15);
    color: rgba(229,62,62,.7);
    font-size: 12px;
}
.prof-btn-danger:hover { background: rgba(229,62,62,.06); color: #e53e3e; }

/* ── Logout in profile ── */
.prof-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    margin-top: 8px;
    margin-bottom: 24px;
    border-radius: 10px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(12px);
    transition: .15s;
    font-family: inherit;
}
.prof-logout svg { width: 16px; height: 16px; fill: currentColor; }
.prof-logout:hover { color: #c0c0d0; background: rgba(255,255,255,.05); }

.prof-loading {
    display: flex;
    justify-content: center;
    padding: 60px 0;
}

/* ══════════════════════════════════════════════════════════════
   PWA INSTALL BANNER
   ══════════════════════════════════════════════════════════════ */
.pwa-banner {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(90deg, var(--accent) 0%, #6d4de8 100%);
    color: #fff;
    font-size: 12px;
    position: sticky;
    top: 0;
    z-index: 25;
}
.pwa-banner-icon { width: 18px; height: 18px; fill: #fff; flex-shrink: 0; }
.pwa-banner-text { flex: 1; line-height: 1.3; }
.pwa-banner-btn {
    background: rgba(255,255,255,.2);
    border: 1px solid rgba(255,255,255,.4);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}
.pwa-banner-btn:active { background: rgba(255,255,255,.35); }
.pwa-banner-close {
    background: none;
    border: none;
    color: rgba(255,255,255,.7);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    flex-shrink: 0;
}
.pwa-banner-close:hover { color: #fff; }
/* Never show in standalone mode */
@media (display-mode: standalone) { .pwa-banner { display: none !important; } }

/* ══════════════════════════════════════════════════════════════
   MOBILE TOPBAR
   ══════════════════════════════════════════════════════════════ */
.topbar-mobile {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}

.hamburger {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px;
    flex-shrink: 0;
}
.hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text-mid);
    border-radius: 2px;
    transition: background .15s;
}
.hamburger:hover span { background: var(--text); }

.topbar-title {
    flex: 1;
    font-size: 16px;
    font-weight: 700;
    color: var(--accent2);
    display: flex;
    align-items: center;
    gap: 8px;
}
.topbar-logo-img {
    width: 110px;
    height: 36px;
    object-fit: contain;
    transform: scale(1.8);
    display: none;
    -webkit-mask-image: radial-gradient(ellipse 70% 80% at center, black 50%, transparent 100%);
    mask-image: radial-gradient(ellipse 70% 80% at center, black 50%, transparent 100%);
}

.topbar-action {
    background: none;
    border: none;
    color: var(--text-mid);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    transition: color .15s, background .15s;
}
.topbar-action svg { width: 22px; height: 22px; fill: currentColor; }
.topbar-action:hover { color: var(--text); background: var(--surface2); }

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 90;
}
.sidebar-overlay.show { display: block; }

/* ══════════════════════════════════════════════════════════════
   MAIN WRAP
   ══════════════════════════════════════════════════════════════ */
.main-wrap {
    grid-area: main;
    overflow-y: auto;
    overflow-x: hidden;
    background: linear-gradient(180deg, #1a1528 0%, var(--bg) 300px);
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.view        { display: none; padding: 32px 28px 40px; }
.view.active { display: block; }

.view-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.view-header h1  { font-size: 26px; font-weight: 700; letter-spacing: -.5px; flex: 1; min-width: 0; }
.view-sub        { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ── Home view ─────────────────────────────────────────────── */
.home-section { margin-bottom: 32px; }
.home-section-title { font-size: 18px; font-weight: 700; margin-bottom: 14px; }
.home-scroll {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.12) transparent;
    -ms-overflow-style: none;
}
.home-scroll::-webkit-scrollbar { height: 4px; }
.home-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }
.home-card {
    flex: 0 0 140px;
    cursor: pointer;
    border-radius: 10px;
    overflow: hidden;
    background: var(--card-bg, rgba(255,255,255,.05));
    transition: background .2s;
}
.home-card:hover { background: rgba(255,255,255,.10); }
.home-card-img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    display: block;
    background: rgba(255,255,255,.06);
}
.home-card-body { padding: 8px 10px 10px; }
.home-card-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.home-card-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.home-empty {
    color: var(--text-muted);
    font-size: 13px;
    padding: 12px 0;
}

/* ── Genre cards ──────────────────────── */
.genre-grid {
    display: flex;
    gap: 12px;
    flex-wrap: nowrap;
}
.genre-card {
    flex: 0 0 150px;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
    background: var(--surface);
    transition: background .2s, transform .15s;
}
.genre-card:hover { background: var(--surface2); transform: translateY(-2px); }
.genre-card-cover {
    position: relative;
    width: 150px;
    height: 100px;
    overflow: hidden;
    background: var(--surface2);
}
.genre-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity .6s ease;
}
.genre-card-overlay {
    position: absolute;
    inset: 0;
    opacity: .45;
    pointer-events: none;
}
.genre-card-label {
    font-size: 13px;
    font-weight: 600;
    padding: 8px 10px 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.genre-card-count {
    font-size: 11px;
    color: var(--text-muted);
    padding: 0 10px 8px;
}

/* ── Genre detail search ──────────────── */
.genre-detail-search {
    position: relative;
    max-width: 340px;
    margin-bottom: 12px;
}
.genre-detail-search input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color .2s;
}
.genre-detail-search input:focus { border-color: var(--accent); }
.genre-detail-search input::placeholder { color: var(--text-muted); }
.gds-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    fill: var(--text-muted);
    pointer-events: none;
}

/* ── Genre detail header ──────────────── */
.home-genre-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.home-genre-back {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
}
.home-genre-back svg {
    fill: var(--text);
}

/* ── Discover cards ───────────────────── */
.discover-card { position: relative; }
.discover-card-cover { position: relative; overflow: hidden; }
.discover-rotating-img { transition: opacity .4s ease; }
.discover-card-play {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .2s, transform .2s;
    box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
.discover-card:hover .discover-card-play {
    opacity: 1;
    transform: translateY(0);
}

.btn-action {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    padding: 9px 18px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background .2s, transform .1s;
}
.btn-action svg   { width: 18px; height: 18px; fill: currentColor; }
.btn-action:hover { background: #6d4de8; }

.btn-icon-circle {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .2s, transform .12s, box-shadow .2s;
    box-shadow: 0 2px 8px rgba(124,92,252,.3);
}
.btn-icon-circle svg { width: 20px; height: 20px; fill: #fff; }
.btn-icon-circle:hover { background: #6d4de8; transform: scale(1.08); box-shadow: 0 4px 14px rgba(124,92,252,.45); }
.btn-icon-circle:active { transform: scale(.95); }

.back-btn {
    background: var(--surface);
    border: none;
    border-radius: 50%;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--text-mid);
    flex-shrink: 0;
    margin-top: 4px;
    transition: background .15s, color .15s;
}
.back-btn svg   { width: 20px; height: 20px; fill: currentColor; }
.back-btn:hover { background: var(--surface2); color: var(--text); }

.btn-icon-danger {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: color .15s, background .15s;
}
.btn-icon-danger svg { width: 20px; height: 20px; fill: currentColor; }
.btn-icon-danger:hover { color: var(--red); background: rgba(239,68,68,.1); }

/* ══════════════════════════════════════════════════════════════
   PLAYLISTS GRID
   ══════════════════════════════════════════════════════════════ */
.folders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.playlist-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color .2s, transform .12s, box-shadow .2s;
    position: relative;
    overflow: visible;
}
.playlist-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.4); }

.pc-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--surface2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: var(--radius) var(--radius) 0 0;
}
.pc-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.pc-thumb svg { width: 36px; height: 36px; fill: var(--text-muted); }

.pc-body { padding: 12px 14px 14px; }
.pc-body-row {
    display: flex;
    align-items: center;
    gap: 4px;
}
.pc-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    flex: 1;
    min-width: 0;
}
.pc-menu-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: color .15s, background .15s;
}
.pc-menu-btn svg { width: 18px; height: 18px; fill: currentColor; }
.pc-menu-btn:hover { color: var(--text); background: var(--surface2); }

.pc-menu {
    position: absolute;
    left: calc(100% + 6px);
    top: 0;
    min-width: 180px;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 12px;
    padding: 4px 0;
    box-shadow: 0 12px 36px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.03);
    z-index: 60;
    animation: pcmenu-in .15s ease;
}

@keyframes pcmenu-in {
    from { opacity: 0; transform: translateX(-6px) scale(.96); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
.pc-count { font-size: 11px; color: var(--text-muted); }

.pc-play-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 36px; height: 36px;
    background: var(--accent);
    border: none;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .2s, transform .2s;
    box-shadow: 0 4px 14px rgba(124,92,252,.5);
}
.pc-play-btn svg { width: 20px; height: 20px; fill: #fff; }
.playlist-card:hover .pc-play-btn { opacity: 1; transform: translateY(0); }

/* ══════════════════════════════════════════════════════════════
   ADD-TRACK BAR (inside playlist view)
   ══════════════════════════════════════════════════════════════ */
.add-track-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 20px;
}

.ati-wrap { display: flex; gap: 10px; }
.ati-wrap input {
    flex: 1;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color .2s;
}
.ati-wrap input:focus { border-color: var(--accent); }
.ati-wrap input::placeholder { color: var(--text-muted); }

.btn-add-track {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    padding: 0 16px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s;
}
.btn-add-track svg   { width: 16px; height: 16px; fill: currentColor; }
.btn-add-track:hover { background: #6d4de8; }

.add-track-status {
    font-size: 12px;
    margin-top: 8px;
    min-height: 18px;
    color: var(--text-muted);
}
.add-track-status.error   { color: #fca5a5; }
.add-track-status.success { color: var(--green); }

/* ══════════════════════════════════════════════════════════════
   SEARCH
   ══════════════════════════════════════════════════════════════ */
.search-hero { margin-bottom: 24px; }
.search-hero-row { display: flex; gap: 10px; }

/* ── Search history chips ──────────────────────────────────── */
.search-history { margin-bottom: 20px; }
.sh-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sh-title { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.sh-clear {
    background: none; border: none; color: var(--accent); font-size: 12px;
    font-weight: 600; font-family: inherit; cursor: pointer; padding: 2px 6px;
}
.sh-clear:hover { text-decoration: underline; }
.sh-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sh-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 20px; padding: 6px 14px 6px 10px;
    color: var(--text); font-size: 13px; font-family: inherit;
    cursor: pointer; transition: background .15s, border-color .15s;
}
.sh-chip svg { width: 14px; height: 14px; fill: var(--text-muted); flex-shrink: 0; }
.sh-chip:hover { background: rgba(255,255,255,.08); border-color: var(--accent); }

.search-hero-input-wrap {
    flex: 1;
    position: relative;
}
.shi-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px; height: 18px;
    fill: var(--text-muted);
    pointer-events: none;
}
#search-input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 40px 12px 44px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color .2s;
}
#search-input:focus  { border-color: var(--accent); }
#search-input::placeholder { color: var(--text-muted); }

.shi-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    transition: color .15s;
}
.shi-clear svg { width: 18px; height: 18px; fill: currentColor; }
.shi-clear:hover { color: var(--text); }

.resolve-status {
    margin-top: 10px;
    font-size: 13px;
    min-height: 18px;
    color: var(--text-muted);
}
.resolve-status.error   { color: #fca5a5; }
.resolve-status.success { color: var(--green); }
.resolve-status.loading {
    display: flex;
    align-items: center;
    gap: 10px;
}
.resolve-status.loading::before,
.resolve-status.loading::after {
    content: '';
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}
.resolve-status.loading::before { animation: dots-pulse 1.3s infinite ease-in-out 0s; }
.resolve-status.loading::after  { animation: dots-pulse 1.3s infinite ease-in-out .4s; }

/* ══════════════════════════════════════════════════════════════
   SEARCH TABS (Músicas / Playlists)
   ══════════════════════════════════════════════════════════════ */
.search-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}

.stab {
    display: flex;
    align-items: center;
    gap: 7px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 9px 16px 10px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: color .15s, border-color .15s;
    white-space: nowrap;
    margin-bottom: -1px;
    position: relative;
}
.stab svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }
.stab:hover { color: var(--text); }
.stab.active { color: var(--accent2); border-bottom-color: var(--accent2); }

.stab-badge {
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* ── YouTube Playlist search cards ──────────────────────────── */
.pl-search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-top: 4px;
}

.pl-search-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    overflow: hidden;
    transition: border-color .2s, transform .15s, box-shadow .2s;
    position: relative;
}
.pl-search-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
}

.psc-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--surface2);
    position: relative;
    overflow: hidden;
}
.psc-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.psc-thumb-ph {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
}
.psc-thumb-ph svg { width: 40px; height: 40px; fill: var(--text-muted); }

.psc-count-badge {
    position: absolute;
    bottom: 6px; right: 6px;
    background: rgba(0,0,0,.75);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
}

.psc-play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.4);
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    transition: opacity .2s;
}
.pl-search-card:hover .psc-play-overlay { opacity: 1; }
.psc-play-overlay svg { width: 44px; height: 44px; fill: #fff; filter: drop-shadow(0 2px 8px rgba(0,0,0,.5)); }

.psc-body { padding: 10px 12px 12px; }
.psc-title {
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 4px;
    line-height: 1.4;
}
.psc-channel { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* playlist loading overlay */
.pl-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    display: flex; align-items: center; justify-content: center;
    flex-direction: column;
    gap: 16px;
    z-index: 600;
    color: var(--text-mid);
    font-size: 14px;
}

/* ══════════════════════════════════════════════════════════════
   TRACKLIST
   ══════════════════════════════════════════════════════════════ */
.tracklist.flat { background: transparent; }

.track-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s;
    border-bottom: 1px solid rgba(255,255,255,.025);
}
.track-item:last-child { border-bottom: none; }
.track-item:hover { background: var(--surface2); }
.track-item.active { background: rgba(124,92,252,.12); }

.ti-num {
    font-size: 13px;
    color: var(--text-muted);
    min-width: 22px;
    text-align: right;
    flex-shrink: 0;
}
.track-item.active .ti-num { display: none; }

.ti-playing {
    display: none;
    flex-shrink: 0;
    width: 22px;
    justify-content: center;
}
.track-item.active .ti-playing { display: flex; }

.bars { display: flex; align-items: flex-end; gap: 2px; height: 14px; }
.bar  { width: 3px; background: var(--accent2); border-radius: 2px; animation: bar-pulse .8s ease-in-out infinite alternate; }
.bar:nth-child(2) { animation-delay: .2s; animation-duration: .6s; }
.bar:nth-child(3) { animation-delay: .4s; animation-duration: 1s; }
@keyframes bar-pulse { from { height: 3px; } to { height: 13px; } }
.bars.paused .bar { animation-play-state: paused; }

.ti-thumb {
    width: 42px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
    background: var(--surface2);
    flex-shrink: 0;
    display: block;
}
.ti-thumb-ph {
    width: 42px;
    height: 32px;
    background: var(--surface2);
    border-radius: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ti-thumb-ph svg { width: 16px; height: 16px; fill: var(--text-muted); }

.ti-info { flex: 1; min-width: 0; }
.ti-title {
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.track-item.active .ti-title { color: var(--accent2); font-weight: 600; }
.ti-channel { font-size: 12px; color: var(--text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Source badges (SoundCloud, etc.) */
.ti-source-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1px 5px;
    border-radius: 3px;
    margin-top: 2px;
    color: #fff;
    background: var(--text-muted);
}
.ti-source-badge.badge-soundcloud {
    background: #ff5500;
}

.ti-dur {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.ti-status {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--surface2);
}
.ti-status.processing { color: var(--accent2); background: rgba(124,92,252,.15); }
.ti-status.failed     { color: #fca5a5; background: rgba(239,68,68,.12); }

.ti-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity .15s;
}
/* desktop hover */
.track-item:hover .ti-actions { opacity: 1; }
/* always visible on touch + playlist context (remove button) */
.track-item .ti-btn.danger { opacity: 1; }
@media (hover: none) {
    .ti-actions { opacity: 1; }
}

.ti-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: color .15s, background .15s;
}
.ti-btn svg { width: 15px; height: 15px; fill: currentColor; }
.ti-btn:hover { color: var(--text); background: var(--surface2); }
.ti-btn.danger:hover { color: var(--red); background: rgba(239,68,68,.1); }

/* load more */
.load-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-muted);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    margin-top: 8px;
    transition: border-color .2s, color .2s, background .2s;
}
.load-more-btn:hover { border-color: var(--accent); color: var(--text); background: var(--surface2); }

.hint-card {
    color: var(--text-muted);
    padding: 48px 0;
    text-align: center;
    line-height: 1.8;
    grid-column: 1 / -1;
}

/* ══════════════════════════════════════════════════════════════
   NOW-PLAYING BAR (bottom)
   ══════════════════════════════════════════════════════════════ */
.now-bar {
    grid-area: bar;
    background: var(--sidebar-bg);
    border-top: 1px solid var(--border);
    display: none;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    z-index: 50;
    position: relative;
}
.now-bar.visible {
    display: flex;
    height: var(--bar-h);
}

.now-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.now-disc {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    background: var(--surface2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.now-disc img { width: 100%; height: 100%; object-fit: cover; display: block; }
.now-disc svg { width: 26px; height: 26px; fill: var(--text-muted); }

.now-text { flex: 1; min-width: 0; }
.now-title {
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.now-sub {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.now-add-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: color .15s, background .15s;
}
.now-add-btn svg { width: 18px; height: 18px; fill: currentColor; }
.now-add-btn:hover { color: var(--accent2); background: var(--surface2); }

.now-center {
    flex: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 560px;
}

.now-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nc-btn {
    background: none;
    border: none;
    color: var(--text-mid);
    cursor: pointer;
    border-radius: 50%;
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    transition: color .15s, background .15s;
    position: relative;
}
.nc-btn svg { width: 22px; height: 22px; fill: currentColor; }
.nc-btn:hover { color: var(--text); background: var(--surface2); }
.nc-btn.sm svg { width: 18px; height: 18px; }
.nc-btn.active { color: var(--accent2); }
.nc-btn.active::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px; height: 4px;
    background: var(--accent2);
    border-radius: 50%;
}

.nc-btn.play {
    background: #fff;
    color: #0d0d14;
    width: 40px; height: 40px;
}
.nc-btn.play:hover { background: var(--text); transform: scale(1.05); }
.nc-btn.play svg { width: 20px; height: 20px; }

.spinner-play {
    width: 18px; height: 18px;
    border: 2px solid rgba(0,0,0,.3);
    border-top-color: #0d0d14;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.now-prog-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.pt {
    font-size: 11px;
    color: var(--text-muted);
    min-width: 36px;
    font-variant-numeric: tabular-nums;
}
.pt:last-child { text-align: right; }

/* Range inputs */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    background: var(--surface3);
    cursor: pointer;
    outline: none;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,.4);
    transition: transform .1s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.3); }
input[type="range"]::-moz-range-thumb {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #fff;
    border: none;
    cursor: pointer;
}

.prog-bar {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(
        to right,
        var(--accent) 0%,
        var(--accent) var(--progress, 0%),
        var(--surface3) var(--progress, 0%),
        var(--surface3) 100%
    );
    outline: none;
    cursor: pointer;
    transition: height .15s;
}
.prog-bar:hover {
    height: 6px;
}
.prog-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 4px rgba(0,0,0,.4);
    cursor: pointer;
    transition: transform .12s;
}
.prog-bar:hover::-webkit-slider-thumb {
    transform: scale(1.2);
}
.prog-bar::-moz-range-thumb {
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #fff;
    border: none;
    box-shadow: 0 0 4px rgba(0,0,0,.4);
    cursor: pointer;
}
.prog-bar::-moz-range-track {
    background: transparent;
    height: 4px;
}
.vol-bar  { width: 90px; }

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

.vol-icon { width: 18px; height: 18px; fill: var(--text-muted); flex-shrink: 0; }

/* ── Kebab menu ─────────────────────────────────────────────── */
.kebab-wrap { position: relative; }
.kebab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    transition: color .15s, background .15s;
}
.kebab-btn svg { width: 20px; height: 20px; fill: currentColor; }
.kebab-btn:hover { color: var(--text); background: var(--surface2); }

.kebab-menu {
    display: none;
    position: absolute;
    bottom: calc(100% + 30px);
    right: 0;
    min-width: 190px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px 0;
    box-shadow: 0 8px 32px rgba(0,0,0,.55);
    z-index: 300;
    animation: kebab-in .15s ease;
}
.kebab-menu.show { display: block; }

.km-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: none;
    border: none;
    padding: 10px 16px;
    color: var(--text-mid);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: background .12s, color .12s;
    white-space: nowrap;
}
.km-item svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }
.km-item:hover { background: var(--surface2); color: var(--text); }

/* Volume row inside kebab menu */
.km-vol-row {
    display: none; /* hidden on desktop (vol-bar is in the bar) */
    align-items: center;
    gap: 10px;
    padding: 10px 14px 8px;
    border-bottom: 1px solid var(--border);
}
.km-vol-icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: color .15s;
}
.km-vol-icon-btn:hover { color: var(--accent2); }
.km-vol-icon-btn svg { width: 18px; height: 18px; fill: currentColor; }
.km-vol-slider {
    flex: 1;
    height: 4px;
    accent-color: var(--accent);
    cursor: pointer;
    outline: none;
    border: none;
    background: transparent;
}
.km-vol-pct {
    font-size: 11px;
    color: var(--text-muted);
    min-width: 32px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.km-divider {
    height: 1px;
    background: var(--border);
    margin: 2px 0;
}

@keyframes kebab-in {
    from { opacity: 0; transform: translateY(6px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ══════════════════════════════════════════════════════════════
   EQUALIZER + SIDE PANELS
   ══════════════════════════════════════════════════════════════ */
.eq-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 300;
}
.eq-overlay.show { display: block; }

.eq-panel {
    display: none;
    position: fixed;
    bottom: calc(var(--bar-h) + 12px);
    right: 16px;
    width: min(640px, calc(100vw - 24px));
    background: rgba(30,30,42,.82);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px;
    padding: 0;
    z-index: 310;
    box-shadow: 0 16px 48px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.03);
    overflow: hidden;
    animation: panel-in .2s ease;
}
.eq-panel.show { display: block; }
.info-panel { width: min(360px, calc(100vw - 32px)); }
#atp-panel { width: min(320px, calc(100vw - 32px)); }

@keyframes panel-in {
    from { opacity: 0; transform: translateY(12px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.eq-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 14px;
    border-bottom: 1px solid rgba(255,255,255,.05);
    font-size: 14px;
    font-weight: 600;
}
.eq-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 2px 6px;
    border-radius: 6px;
    transition: color .15s;
    font-family: inherit;
}
.eq-close:hover { color: var(--text); }

.eq-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    gap: 12px;
}

.eq-toggle-wrap { display: flex; align-items: center; gap: 10px; }
.eq-switch { position: relative; display: inline-block; width: 38px; height: 20px; }
.eq-switch input { opacity: 0; width: 0; height: 0; }
.eq-slider-toggle {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--surface3);
    border-radius: 10px;
    transition: background .2s;
}
.eq-slider-toggle::before {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    left: 2px; bottom: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
}
.eq-switch input:checked + .eq-slider-toggle { background: var(--accent); }
.eq-switch input:checked + .eq-slider-toggle::before { transform: translateX(18px); }

.eq-toggle-label { font-size: 13px; color: var(--text-mid); }

.eq-preset-select {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 10px;
    color: var(--text);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
}
.eq-preset-select:focus { border-color: var(--accent); }

/* ── EQ Save Preset Dialog ── */
.eq-save-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 310;
    backdrop-filter: blur(4px);
}
.eq-save-overlay.show { display: block; }
.eq-save-dialog {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(.92);
    background: var(--surface);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 16px;
    padding: 28px 28px 22px;
    z-index: 311;
    width: min(340px, calc(100vw - 40px));
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
    opacity: 0;
    transition: opacity .2s, transform .2s;
}
.eq-save-dialog.show {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.eq-save-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
}
.eq-save-desc {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.5;
    margin: 0 0 16px;
}
.eq-save-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1.5px solid rgba(255,255,255,.12);
    background: var(--surface2);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color .15s;
    margin-bottom: 18px;
    box-sizing: border-box;
}
.eq-save-input:focus {
    border-color: var(--accent);
}
.eq-save-input::placeholder {
    color: var(--text-muted);
    opacity: .5;
}
.eq-save-btns {
    display: flex;
    gap: 10px;
    width: 100%;
}
.eq-save-btn {
    flex: 1;
    padding: 10px 0;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
}
.eq-save-btn:active { transform: scale(.97); }
.eq-save-confirm {
    background: var(--accent);
    color: #fff;
}
.eq-save-confirm:hover { opacity: .85; }
.eq-save-cancel {
    background: rgba(255,255,255,.08);
    color: var(--text-muted);
}
.eq-save-cancel:hover { background: rgba(255,255,255,.12); }

/* ── EQ preset select: user presets divider ── */
.eq-preset-select optgroup {
    font-style: normal;
    font-weight: 600;
    color: var(--text-muted);
}
.eq-preset-select optgroup option {
    color: var(--text);
    font-weight: 400;
}

/* ── EQ bands container (flex-column, built by JS) ── */
.eq-bands {
    display: flex;
    flex-direction: column;
    padding: 6px 14px 2px;
    gap: 0;
    background: linear-gradient(180deg, rgba(124,92,252,.04) 0%, transparent 100%);
}

/* Value label row */
.eq-val-row {
    display: flex;
    justify-content: space-between;
    padding: 0 4.78%;
    margin-bottom: 2px;
}
.eq-val-row span {
    font-size: 10px;
    color: var(--accent2);
    text-align: center;
    flex: 0 0 0;
    min-width: 0;
    overflow: visible;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    letter-spacing: -.2px;
}

/* SVG graph */
.eq-svg {
    width: 100%;
    display: block;
    overflow: visible;
    border-radius: 6px;
}
.eq-grid {
    stroke: rgba(255,255,255,.05);
    stroke-width: 1;
}
.eq-grid-zero {
    stroke: rgba(255,255,255,.12);
    stroke-width: 1;
    stroke-dasharray: 3 4;
}
.eq-fill { stroke: none; }
.eq-line {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 5px rgba(124,92,252,.55));
}
.eq-dash-line {
    stroke: rgba(124,92,252,.25);
    stroke-width: 1;
    stroke-dasharray: 3 3;
}
.eq-point-outer {
    fill: rgba(124,92,252,.12);
    cursor: grab;
    transition: fill .15s;
}
.eq-point-outer:hover { fill: rgba(124,92,252,.28); }
.eq-point {
    fill: var(--accent);
    stroke: var(--surface);
    stroke-width: 2;
    cursor: grab;
    filter: drop-shadow(0 0 5px rgba(124,92,252,.7));
    transition: r .12s;
}
.eq-point.active { cursor: grabbing; }

/* Frequency label row */
.eq-freq-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 4.78% 3px;
    border-top: 1px solid rgba(255,255,255,.05);
    margin-top: 2px;
}
.eq-freq-row span {
    font-size: 9px;
    color: var(--text-muted);
    text-align: center;
    flex: 0 0 0;
    min-width: 0;
    overflow: visible;
    white-space: nowrap;
    letter-spacing: -.1px;
}

/* Knob row */
.eq-knob-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 4.78% 10px;
}
.eq-knob-wrap {
    flex: 0 0 0;
    min-width: 0;
    overflow: visible;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
}
.eq-q-label {
    font-size: 9px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    opacity: .7;
}
.eq-knob2 {
    width: 38px; height: 38px;
    border-radius: 50%;
    position: relative;
    cursor: grab;
    user-select: none;
    background: conic-gradient(
        from -135deg,
        var(--accent) 0deg var(--knob-arc, 0deg),
        var(--surface3) var(--knob-arc, 0deg) 270deg,
        var(--bg) 270deg 360deg
    );
    box-shadow: 0 2px 8px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.06);
    transition: box-shadow .15s;
}
.eq-knob2:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,.6), 0 0 0 1px rgba(124,92,252,.4);
}
.eq-knob2.dragging { cursor: grabbing; }
.eq-knob-inner {
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background: var(--surface2);
    box-shadow: inset 0 1px 4px rgba(0,0,0,.5);
}
.eq-knob-ind-wrap {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    transform-origin: center center;
    transform: rotate(-135deg);
    pointer-events: none;
}
.eq-knob-ind-dot {
    position: absolute;
    width: 3px; height: 3px;
    background: var(--accent2);
    border-radius: 50%;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 5px var(--accent2);
}

.eq-reset-btn {
    display: block;
    width: calc(100% - 32px);
    margin: 4px 16px 14px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px;
    color: var(--text-mid);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color .2s, color .2s;
}
.eq-reset-btn:hover { border-color: var(--accent); color: var(--text); }

/* ── EQ Mobile Responsive ── */
@media (max-width: 480px) {
    .eq-panel { right: 8px; bottom: calc(var(--bar-h) + 8px); width: calc(100vw - 16px); border-radius: 14px; }
    .eq-knob-row { padding: 8px 2% 12px; gap: 0; }
    .eq-knob2 { width: 32px; height: 32px; }
    .eq-knob-inner { inset: 4px; }
    .eq-knob-ind-dot { width: 2.5px; height: 2.5px; top: 3px; }
    .eq-q-label { font-size: 7.5px; }
    .eq-freq-row { padding: 4px 2% 2px; }
    .eq-freq-row span { font-size: 7.5px; }
    .eq-val-row { padding: 0 2%; }
    .eq-val-row span { font-size: 8.5px; }
    .eq-bands { padding: 4px 8px 2px; }
}
@media (max-width: 380px) {
    .eq-knob2 { width: 28px; height: 28px; }
    .eq-knob-inner { inset: 3px; }
    .eq-knob-ind-dot { width: 2px; height: 2px; top: 2.5px; }
    .eq-q-label { font-size: 7px; }
}

/* Track Info panel */
.info-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 20px;
    border-bottom: 1px solid rgba(255,255,255,.04);
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-muted); font-size: 12px; }
.info-value { font-size: 12px; color: var(--text-mid); text-align: right; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#track-info-body { padding: 4px 0 8px; }

/* Add to Playlist panel */
#atp-list { padding: 8px 0; max-height: 260px; overflow-y: auto; }
.atp-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: none;
    border: none;
    padding: 12px 20px;
    color: var(--text-mid);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: background .12s, color .12s;
}
.atp-item:hover { background: var(--surface2); color: var(--text); }
.atp-item svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════
   MODAL
   ══════════════════════════════════════════════════════════════ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 400;
}
.modal-overlay.show { display: block; }

.modal-box {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(380px, calc(100vw - 40px));
    background: var(--surface);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 16px;
    z-index: 410;
    overflow: hidden;
    box-shadow: 0 16px 48px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.03);
    animation: modal-in .22s cubic-bezier(.4,0,.2,1);
}
.modal-box.show { display: block; }

@keyframes modal-in {
    from { opacity: 0; transform: translate(-50%, -48%) scale(.97); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 14px;
    border-bottom: 1px solid rgba(255,255,255,.05);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -.2px;
}

#modal-body { padding: 18px 22px; }
#modal-body input {
    width: 100%;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    padding: 11px 14px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color .2s, background .2s;
}
#modal-body input:focus { border-color: var(--accent); background: rgba(255,255,255,.06); }
#modal-body input::placeholder { color: var(--text-muted); }
#modal-body p { font-size: 13.5px; color: var(--text-mid); line-height: 1.5; }

.modal-footer {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 4px 22px 18px;
}

.modal-footer .btn-cancel {
    background: transparent;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    padding: 8px 18px;
    color: var(--text-mid);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.modal-footer .btn-cancel:hover { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); }

.modal-footer .btn-confirm {
    background: var(--accent);
    border: none;
    border-radius: 10px;
    padding: 8px 22px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .2s, transform .1s;
}
.modal-footer .btn-confirm:hover { background: #6d4de8; }
.modal-footer .btn-confirm:active { transform: scale(.97); }
.modal-footer .btn-confirm.danger { background: var(--red); }
.modal-footer .btn-confirm.danger:hover { background: #dc2626; }

/* ══════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ══════════════════════════════════════════════════════════════ */
.toast-container {
    position: fixed;
    bottom: calc(var(--bar-h) + 16px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 500;
    pointer-events: none;
}

.toast {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 13px;
    color: var(--text);
    box-shadow: 0 8px 24px rgba(0,0,0,.5);
    animation: toast-in .25s ease;
    pointer-events: auto;
    max-width: 360px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.toast.success { border-color: rgba(29,185,84,.4); color: #6ee7b7; }
.toast.error   { border-color: rgba(239,68,68,.4);  color: #fca5a5; }
.toast.warning { border-color: rgba(251,191,36,.4); color: #fde68a; }
.toast.out     { animation: toast-out .25s ease forwards; }

@keyframes toast-in  { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { from { opacity: 1; } to { opacity: 0; transform: translateY(-8px); } }

/* ── Load-more spinner (infinite scroll) ──────────────────── */
.load-more-spinner {
    display: flex;
    justify-content: center;
    padding: 20px 0 12px;
}

/* ══════════════════════════════════════════════════════════════
   SPINNERS & DOTS PULSE
   ══════════════════════════════════════════════════════════════ */
@keyframes spin { to { transform: rotate(360deg); } }

@keyframes dots-pulse {
    0%, 80%, 100% { transform: scale(.45); opacity: .25; }
    40%           { transform: scale(1);   opacity: 1;   }
}

/* Auth button spinner (stays as ring) */
.spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

/* Dots Pulse — 3-dot loading indicator */
.dots-pulse {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.dots-pulse span {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: dots-pulse 1.3s infinite ease-in-out;
    display: inline-block;
}
.dots-pulse span:nth-child(1) { animation-delay: 0s; }
.dots-pulse span:nth-child(2) { animation-delay: .2s; }
.dots-pulse span:nth-child(3) { animation-delay: .4s; }

/* spinner-md → Dots Pulse via pseudo-elements (works as empty <span>) */
.spinner-md {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: auto; height: auto;
    border: none; border-radius: 0;
    background: none; animation: none;
    vertical-align: middle;
}
.spinner-md::before,
.spinner-md::after {
    content: '';
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}
.spinner-md::before { animation: dots-pulse 1.3s infinite ease-in-out 0s; }
.spinner-md::after  { animation: dots-pulse 1.3s infinite ease-in-out .4s; }

/* ══════════════════════════════════════════════════════════════
   NOW PLAYING — Full-screen immersive view
   ══════════════════════════════════════════════════════════════ */
.np-screen {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform .4s cubic-bezier(.32, .72, 0, 1);
    will-change: transform;
    overflow: hidden;
}
.np-screen.open {
    transform: translateY(0);
}

/* Blurred background artwork */
.np-bg {
    position: absolute;
    inset: -40px;
    background-size: cover;
    background-position: center;
    filter: blur(60px) saturate(1.6) brightness(.35);
    z-index: 0;
    pointer-events: auto;
    cursor: default;
}
.np-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(13,13,20,.5) 0%,
        rgba(13,13,20,.75) 50%,
        rgba(13,13,20,.92) 100%
    );
}

.np-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0 24px;
    padding-top: env(safe-area-inset-top, 12px);
    padding-bottom: env(safe-area-inset-bottom, 16px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.np-inner::-webkit-scrollbar { display: none; }

/* ── Top bar ── */
.np-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0 8px;
    flex-shrink: 0;
}
.np-close, .np-opts {
    background: none;
    border: none;
    color: var(--text-mid);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .2s, background .2s;
}
.np-close:hover, .np-opts:hover {
    color: var(--text);
    background: rgba(255,255,255,.08);
}
.np-close svg, .np-opts svg {
    width: 24px; height: 24px; fill: currentColor;
}
.np-topbar-source {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
}

/* ── Hero (fills viewport so queue is below fold) ── */
.np-hero {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    flex-shrink: 0;
}

/* ── Artwork ── */
.np-art-wrap {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 0;
    min-height: 120px;
    overflow: hidden;
}
.np-art {
    width: 100%;
    max-width: 380px;
    aspect-ratio: 1;
    border-radius: 16px;
    overflow: hidden;
    background: var(--surface2);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 8px 40px rgba(0,0,0,.5),
        0 2px 12px rgba(0,0,0,.3);
    animation: np-art-in .5s cubic-bezier(.32,.72,0,1) both;
    animation-delay: .15s;
}
@keyframes np-art-in {
    from { transform: scale(.88); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.np-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.np-art svg {
    width: 80px;
    height: 80px;
    fill: var(--text-muted);
}

/* ── Track info ── */
.np-info {
    text-align: center;
    padding: 8px 0 4px;
    flex-shrink: 0;
}
.np-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.np-artist {
    font-size: 14px;
    color: var(--text-mid);
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Progress bar ── */
.np-progress {
    padding: 12px 0 4px;
    flex-shrink: 0;
    overflow: hidden;
}
.np-seek {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: linear-gradient(
        to right,
        var(--accent2) 0%,
        var(--accent2) var(--progress, 0%),
        rgba(255,255,255,.15) var(--progress, 0%),
        rgba(255,255,255,.15) 100%
    );
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    position: relative;
}
.np-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text);
    border: none;
    box-shadow: 0 1px 6px rgba(0,0,0,.4);
    cursor: pointer;
    transition: transform .15s;
}
.np-seek::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}
.np-seek::-moz-range-thumb {
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--text); border: none; cursor: pointer;
}
.np-seek::-webkit-slider-runnable-track {
    background: transparent;
}
.np-times {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
    font-variant-numeric: tabular-nums;
}

/* ── Controls ── */
.np-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 0;
    flex-shrink: 0;
}
.np-btn {
    background: none;
    border: none;
    color: var(--text-mid);
    cursor: pointer;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color .15s, background .15s, transform .15s;
}
.np-btn svg { width: 26px; height: 26px; fill: currentColor; }
.np-btn:hover { color: var(--text); background: rgba(255,255,255,.06); }
.np-btn:active { transform: scale(.9); }
.np-btn.sm { width: 42px; height: 42px; }
.np-btn.sm svg { width: 22px; height: 22px; }
.np-btn.play {
    width: 64px;
    height: 64px;
    background: var(--text);
    color: var(--bg);
    border-radius: 50%;
    transition: transform .2s, box-shadow .2s;
}
.np-btn.play svg { width: 30px; height: 30px; fill: var(--bg); }
.np-btn.play:hover {
    transform: scale(1.06);
    box-shadow: 0 4px 20px rgba(255,255,255,.15);
}
.np-btn.play:active { transform: scale(.95); }

.np-btn.active { color: var(--accent2); }

/* ── Volume row (desktop only, below controls) ── */
.np-vol-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 40px 8px;
    flex-shrink: 0;
}
.np-vol-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color .15s;
    flex-shrink: 0;
    padding: 0;
}
.np-vol-btn:hover { color: var(--text); }
.np-vol-btn svg { width: 16px; height: 16px; fill: currentColor; }

.np-vol-slider {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 3px;
    background: linear-gradient(
        to right,
        var(--accent2) 0%,
        var(--accent2) var(--vol, 100%),
        rgba(255,255,255,.15) var(--vol, 100%),
        rgba(255,255,255,.15) 100%
    );
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    max-width: 100%;
}
.np-vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text);
    border: none;
    box-shadow: 0 1px 4px rgba(0,0,0,.4);
    cursor: pointer;
}
.np-vol-slider::-moz-range-thumb {
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--text); border: none; cursor: pointer;
}

/* Spinner in NP */
.np-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(13,13,20,.2);
    border-top-color: var(--bg);
}

/* ── 3-dot menu in NP ── */
.np-opts-wrap { position: relative; }
.np-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: rgba(30,30,42,.82);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    padding: 6px 0;
    z-index: 210;
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
    animation: np-menu-in .15s ease-out;
}
@keyframes np-menu-in {
    from { opacity: 0; transform: translateY(-6px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.np-menu.show { display: block; }
.np-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    transition: background .15s;
    text-align: left;
}
.np-menu-item:hover { background: rgba(255,255,255,.06); }
.np-menu-item svg { width: 20px; height: 20px; fill: currentColor; flex-shrink: 0; }

/* ── Queue divider/header ── */
.np-queue-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 0 12px;
    flex-shrink: 0;
}
.np-queue-divider-line {
    flex: 1;
    height: 1px;
    background: var(--border);
}
.np-queue-divider span {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    white-space: nowrap;
}
.np-queue-count {
    font-weight: 400;
    font-size: 11px;
    color: var(--text-muted);
}
.np-queue-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-bottom: 24px;
}

/* Queue items fade-slide animation */
.np-q-item {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .35s ease-out, transform .35s ease-out;
}
.np-q-item.np-visible {
    opacity: 1;
    transform: translateY(0);
}
.np-q-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s;
}
.np-q-item:hover { background: rgba(255,255,255,.06); }
.np-q-item.active { background: rgba(124,92,252,.12); }
.np-q-item.active .np-q-title { color: var(--accent2); }
.np-q-num {
    width: 24px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}
.np-q-thumb {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--surface2);
}
.np-q-info {
    flex: 1;
    min-width: 0;
}
.np-q-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.np-q-artist {
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.np-q-dur {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* ── Hide now-bar when NP is open (via JS class on body) ── */
body.np-active .now-bar { display: none !important; }
body.np-active .eq-panel {
    bottom: auto;
    right: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: panel-center-in .25s ease;
}
@keyframes panel-center-in {
    from { opacity: 0; transform: translate(-50%, -50%) scale(.95); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ── Desktop: limit width and center ── */
@media (min-width: 701px) {
    .np-inner {
        max-width: 480px;
        margin: 0 auto;
    }
    .np-hero {
        max-width: 480px;
        margin: 0 auto;
    }
    .np-art {
        max-width: 360px;
    }
}
/* ── Mobile: hide volume, it's not needed ── */
@media (max-width: 700px) {
    .np-vol-row { display: none; }
    .eq-panel {
        bottom: auto !important;
        right: auto !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        animation: panel-center-in .25s ease !important;
        width: min(640px, calc(100vw - 24px)) !important;
    }
    #atp-panel {
        width: min(320px, calc(100vw - 40px)) !important;
    }
}

/* ══════════════════════════════════════════════════════════════
   TOUCH — always show action buttons (no hover on mobile)
   ══════════════════════════════════════════════════════════════ */
@media (hover: none) {
    .ti-actions { opacity: 1; }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE  (≤ 700px)
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 700px) {

    /* ── Grid ─────────────────────────────────────────────────── */
    :root {
        --sidebar-w: 0px;
        --bar-h: 66px;
    }

    #app {
        display: flex;
        flex-direction: column;
        height: 100vh;
        height: 100dvh;
    }

    .main-wrap {
        flex: 1 1 0;
        min-height: 0;
        overflow-y: auto;
        padding-bottom: var(--bar-h);
    }

    /* ── Topbar ───────────────────────────────────────────────── */
    .topbar-mobile { display: flex; }

    /* ── Sidebar drawer ──────────────────────────────────────── */
    .sidebar {
        position: fixed;
        left: 0; top: 0; bottom: 0;
        width: 270px;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform .28s cubic-bezier(.4,0,.2,1);
    }
    .sidebar.open { transform: translateX(0); }

    /* ── Views ────────────────────────────────────────────────── */
    .view { padding: 16px 14px 28px; }
    .view-header { margin-bottom: 18px; }
    .view-header h1 { font-size: 22px; }

    /* ── Search ───────────────────────────────────────────────── */
    .pl-search-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
    .search-tabs { gap: 2px; }
    .stab { padding: 8px 12px 9px; font-size: 12px; }
    .search-hero { margin-bottom: 16px; }
    .search-hero-row { flex-direction: row; gap: 6px; }
    #search-input { font-size: 14px; padding: 9px 36px 9px 38px; border-radius: 8px; }
    .shi-icon { left: 12px; width: 16px; height: 16px; }
    .shi-clear { right: 8px; }
    .shi-clear svg { width: 16px; height: 16px; }
    #btn-search-go { padding: 0 12px; font-size: 12px; border-radius: 8px; gap: 4px; }
    #btn-search-go svg { width: 14px; height: 14px; }
    .view-header + .search-hero .search-hero-sub { font-size: 12px; }

    /* ── Track items ─────────────────────────────────────────── */
    .track-item { padding: 9px 8px; gap: 8px; }
    .ti-thumb   { width: 38px; height: 28px; }
    .ti-thumb-ph { width: 38px; height: 28px; }
    .ti-title   { font-size: 13px; }
    .ti-dur     { font-size: 11px; }
    .ti-actions { opacity: 1; } /* always visible on mobile */

    /* ── Playlist grid ───────────────────────────────────────── */
    .folders-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }

    /* ── Genre cards mobile ──────────────────────────────────── */
    .genre-card { flex: 0 0 120px; }
    .genre-card-cover { width: 120px; height: 80px; }

    /* ── Add-track bar ───────────────────────────────────────── */
    .ati-wrap { flex-wrap: wrap; }
    .ati-wrap input { font-size: 16px; } /* prevent iOS zoom */
    .btn-add-track { width: 100%; justify-content: center; padding: 10px; }

    /* ── Buttons ─────────────────────────────────────────────── */
    .btn-action { padding: 9px 14px; font-size: 12px; }
    .btn-icon-danger { padding: 6px; }

    /* ── EQ / Panels ─────────────────────────────────────────── */
    .eq-panel {
        bottom: calc(var(--bar-h) + 8px);
        right: 8px;
        left: 8px;
        width: auto;
    }

    /* ══════════════════════════════════════════════════════════
       NOW-PLAYING BAR — Spotify mini-player style
       ══════════════════════════════════════════════════════════ */
    .now-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: var(--bar-h);
        padding: 0 10px 0 6px;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-sizing: content-box;
        gap: 8px;
        flex-direction: row;
        overflow: visible; /* must NOT clip the kebab menu */
        z-index: 50;
    }

    /* Thin accent progress line at the very top of the bar */
    .now-bar::before {
        content: '';
        position: absolute;
        top: 0; left: 0;
        height: 2px;
        width: var(--progress, 0%);
        background: var(--accent2);
        transition: width .4s linear;
        z-index: 1;
        pointer-events: none;
    }

    /* kebab menu opens upward above the bar, never clipped */
    .kebab-menu {
        z-index: 500;
        bottom: calc(100% + 20px);
        right: 0;
        left: auto;
    }

    /* Hide the full inline progress row */
    .now-prog-row { display: none; }

    /* Disc / thumbnail: slightly smaller */
    .now-disc {
        width: 44px;
        height: 44px;
        border-radius: 6px;
        flex-shrink: 0;
    }

    /* Info takes all remaining space */
    .now-info {
        flex: 1;
        min-width: 0;
        gap: 8px;
    }

    /* Scrolling marquee for long titles */
    .now-title {
        font-size: 13px;
        font-weight: 600;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .now-sub {
        font-size: 11px;
    }

    /* Compact + button */
    .now-add-btn {
        padding: 5px;
        flex-shrink: 0;
    }
    .now-add-btn svg { width: 20px; height: 20px; }

    /* Now-center: only controls, horizontal, no gap */
    .now-center {
        flex: 0 0 auto;
        flex-direction: row;
        align-items: center;
        gap: 2px;
        max-width: none;
        min-width: 0;
    }
    .now-controls { gap: 2px; }

    /* Hide shuffle & repeat in mini-player */
    #btn-shuffle, #btn-repeat { display: none; }

    /* Compact control buttons */
    .nc-btn {
        width: 36px;
        height: 36px;
    }
    .nc-btn svg { width: 20px; height: 20px; }

    /* Play button */
    .nc-btn.play {
        width: 38px;
        height: 38px;
    }
    .nc-btn.play svg { width: 18px; height: 18px; }

    /* Right panel: only kebab on mobile, hide volume */
    .now-right {
        flex: 0 0 auto;
        gap: 4px;
    }
    .vol-icon { display: none; }
    .vol-bar  { display: none; }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — SMALL MOBILE (≤ 400px)
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 400px) {
    .view-header h1 { font-size: 19px; }
    .folders-grid   { grid-template-columns: repeat(2, 1fr); }
    .now-disc       { width: 38px; height: 38px; }
    .nc-btn         { width: 32px; height: 32px; }
    .nc-btn.play    { width: 36px; height: 36px; }
    .nc-btn svg     { width: 18px; height: 18px; }
}

/* ── Autocomplete suggest dropdown ─────────────────────────── */
#suggest-box {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 900;
    margin-top: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-height: 480px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
    opacity: 1;
    transition: opacity 120ms;
}
.sg-section { padding: 4px 0; }
.sg-section + .sg-section { border-top: 1px solid var(--border); }
.sg-label {
    padding: 6px 14px 2px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
}
.sg-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 80ms;
}
.sg-item:hover, .sg-item.sg-active {
    background: var(--surface2);
}
.sg-icon {
    width: 16px; height: 16px;
    fill: var(--text-muted);
    flex-shrink: 0;
}
.sg-thumb {
    width: 42px; height: 32px;
    max-width: 42px; max-height: 32px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--surface2);
}
#suggest-box img {
    max-width: 42px; max-height: 32px;
}
.sg-thumb-placeholder {
    width: 42px; height: 32px;
    border-radius: 4px;
    background: var(--surface2);
    flex-shrink: 0;
}
.sg-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 1px;
}
.sg-text {
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sg-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Suggest dropdown — mobile ─────────────────────────────── */
@media (max-width: 768px) {
    #suggest-box {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        margin-top: 0;
        border-radius: 12px 12px 0 0;
        max-height: calc(100vh - 160px);
        width: 100vw !important;
        border: none;
        border-top: 1px solid var(--border);
        border-top: 1px solid var(--border);
        box-shadow: 0 8px 32px rgba(0,0,0,.6);
    }
    .sg-label {
        padding: 10px 16px 4px;
        font-size: 11px;
    }
    .sg-item {
        padding: 10px 16px;
        gap: 12px;
    }
    .sg-text {
        font-size: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: calc(100vw - 100px);
    }
    .sg-sub {
        font-size: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: calc(100vw - 100px);
    }
    .sg-info {
        gap: 2px;
    }
}
