/* ── Cascade layer order: base < components < responsive (vault.css uses `responsive`).
   Layered styles lose to unlayered ones, so :root token blocks stay unlayered. ── */
@layer base, components, responsive;

/* ── Tokens (vault.audio dark + red accent) ── */
:root {
    --bg: #0c0d10;
    --bg-elev: #14161a;
    --bg-card: #181a1e;
    --bg-card-hover: #20232a;
    --bg-input: #1c1f24;
    --border: #25282f;
    --border-strong: #353944;
    --text-strong: #ffffff;
    --text: #e6e7ec;
    --text-mid: #b5b8c1;
    --text-dim: #777a85;
    --accent: #ef4444;            /* vault red */
    --accent-hover: #f15959;
    --accent-soft: rgba(239, 68, 68, 0.13);
    --accent-strong: #ff6f6f;
    --accent-dim: #c63a3a;
    --gold-grad: linear-gradient(135deg, #f15959 0%, #ef4444 50%, #c63a3a 100%);
    --gold-shadow: 0 4px 14px rgba(239, 68, 68, 0.28);
    --success: #21d07a;
    --warning: #f0b95e;
    --danger: #ef4444;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --sidebar-w: 240px;
    --topbar-h: 64px;
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-elev: 0 14px 44px rgba(0, 0, 0, 0.6);
}

/* ── All style.css rules (reset + base + components) live in the `components`
   layer. vault.css `responsive` is declared later → wins on equal specificity,
   removing <link>-order fragility. :root above stays unlayered. ── */
@layer components {

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

html, body { background: var(--bg); }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.hidden { display: none !important; }

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

button {
    font-family: inherit;
    cursor: pointer;
}

/* ── Scrollbar (subtle) ─────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #444450; }

/* ── Login ──────────────────────── */

/* (dead #login-screen rule removed — the app uses #auth-screen, styled in vault.css) */

.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 44px;
    width: min(400px, 100% - 2rem);
    text-align: center;
    box-shadow: var(--shadow-elev);
}

.login-box h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 6px;
    background: var(--gold-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-dim);
    margin-bottom: 36px;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.btn-oauth {
    width: 100%;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: var(--radius);
    background: var(--gold-grad);
    color: #1a1300;
    border: none;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: var(--gold-shadow);
}
.btn-oauth:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(201, 168, 94, 0.4); }
.btn-oauth:active { transform: translateY(0); }
.btn-oauth:disabled { opacity: 0.6; cursor: wait; transform: none; }

.login-hint {
    color: var(--text-dim);
    font-size: 12px;
    margin-top: 16px;
}

.error {
    color: var(--danger);
    font-size: 13px;
    margin-top: 12px;
}

/* ── Form controls ──────────────── */

input, select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: 10px 14px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
    font-family: inherit;
}

input::placeholder { color: var(--text-dim); }

input:focus, select:focus {
    border-color: var(--accent);
    background: #16161c;
}

select { cursor: pointer; }

/* Base button (default = subtle gold-bordered) */
button.btn,
.btn {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s;
}
.btn:hover { background: var(--bg-card-hover); border-color: var(--accent); color: var(--accent); }

.btn-primary {
    background: var(--gold-grad);
    color: #1a1300;
    border: none;
    box-shadow: var(--gold-shadow);
}
.btn-primary:hover { background: var(--gold-grad); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(201, 168, 94, 0.35); color: #1a1300; }

.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(227, 93, 106, 0.4);
}
.btn-danger:hover { background: rgba(227, 93, 106, 0.12); border-color: var(--danger); color: var(--danger); }

.btn-ghost {
    background: transparent;
    color: var(--text-mid);
    border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-card-hover); color: var(--text); border-color: var(--border-strong); }

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

/* ── App Layout ─────────────────── */

#app {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: var(--topbar-h) 1fr;
    grid-template-areas:
        "sidebar topbar"
        "sidebar content";
    min-height: 100vh;
    min-height: 100dvh;
}

/* ── Sidebar ───────────────────── */

.sidebar {
    grid-area: sidebar;
    background: var(--bg-elev);
    border-right: 1px solid var(--border);
    padding: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
}

.brand {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    gap: 10px;
}

.brand-mark {
    width: 28px; height: 28px;
    border-radius: 7px;
    background: var(--gold-grad);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: #1a1300;
    font-size: 14px;
    box-shadow: var(--gold-shadow);
}

.brand-name {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text-strong);
}

.brand-name span { color: var(--accent); }

.nav-section {
    padding: 16px 12px;
}

.nav-section h4 {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    padding: 0 12px 8px;
    font-weight: 700;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    cursor: pointer;
    color: var(--text-mid);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: background 0.12s, color 0.12s;
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85; }
.nav-item:hover { color: var(--text-strong); background: var(--bg-card-hover); }
.nav-item.active {
    color: var(--accent);
    background: var(--accent-soft);
    font-weight: 600;
}
.nav-item.active svg { opacity: 1; }

.sidebar-spacer { flex: 1; }

.sidebar-footer {
    padding: 14px 16px;
    margin: 0 12px 12px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 11px;
}

.footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-dim);
}

.footer-row b { color: var(--text); font-weight: 600; }

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
}

.status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--text-dim);
}

.status-dot.connected { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.disconnected { background: var(--danger); }

.disk-mini-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.disk-mini-bar .fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.4s, background 0.4s;
}

.disk-mini-bar .fill.danger { background: var(--danger); }
.disk-mini-bar .fill.warn { background: var(--warning); }

/* ── Top Bar ─────────────────────── */

.topbar {
    grid-area: topbar;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-search {
    flex: 1;
    max-width: 640px;
    position: relative;
}

.topbar-search input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.topbar-search input:focus { border-color: var(--accent); }

.topbar-search::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px; height: 16px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23767886' stroke-width='2'><circle cx='11' cy='11' r='7'/><line x1='16.5' y1='16.5' x2='21' y2='21' stroke-linecap='round'/></svg>");
    background-repeat: no-repeat;
    pointer-events: none;
}

.topbar-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.user-chip .avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--gold-grad);
    color: #1a1300;
    font-weight: 800;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-chip .info { font-size: 12px; line-height: 1.2; }
.user-chip .info b { color: var(--text-strong); font-weight: 600; display: block; }
.user-chip .info span { color: var(--text-dim); }

/* ── Content ─────────────────── */

.content {
    grid-area: content;
    padding: 32px 40px 40px;   /* bottom: normal breathing; player reserve added via :has() below */
    overflow-x: clip;   /* clip (not hidden) — avoids promoting .content to a nested scroll container */
}

/* Cap page content width on large/ultrawide monitors so the layout doesn't
   stretch edge-to-edge (albums spreading too wide), LEFT-aligned (content
   starts at the left gutter; empty space goes on the right). The cap only
   takes effect when the content column is wider than it — on ≤1440px laptops
   the column is narrower, so nothing changes. Safe at all sizes. */
.page {
    max-width: 1400px;
    margin-left: 0;
    margin-right: auto;
}

.page-header {
    margin-bottom: 24px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.page-title {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-strong);
}

.page-subtitle {
    color: var(--text-dim);
    font-size: 13px;
    margin-top: 4px;
}

.page-actions { display: flex; gap: 8px; }

/* ── Home / Dashboard ────────────────────────── */

.hero {
    background:
        radial-gradient(circle at top right, rgba(201,168,94,0.18) 0%, transparent 60%),
        var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.hero-text { flex: 1; }

.hero h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-strong);
    margin-bottom: 6px;
}

.hero h1 .accent {
    background: var(--gold-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    color: var(--text-mid);
    font-size: 14px;
    max-width: 520px;
}

.hero-quick {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    transition: border-color 0.15s, transform 0.15s;
}

.stat-card:hover {
    border-color: var(--border-strong);
}

.stat-card .stat-label {
    color: var(--text-dim);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-strong);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.stat-card .stat-meta {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 4px;
}

.stat-card.accent .stat-value {
    background: var(--gold-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-card .stat-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 12px;
    overflow: hidden;
}
.stat-card .stat-bar .fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.4s, background 0.4s;
}
.stat-card .stat-bar .fill.warn { background: var(--warning); }
.stat-card .stat-bar .fill.danger { background: var(--danger); }

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-strong);
    margin: 24px 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-title a {
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
    cursor: pointer;
}
.section-title a:hover { color: var(--accent-hover); }

/* Home strip cards */
.strip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

/* Active downloads compact list */
.active-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.active-row {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.active-row .ar-icon {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.active-row .ar-info { flex: 1; min-width: 0; }
.active-row .ar-info .t {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.active-row .ar-info .m { color: var(--text-dim); font-size: 11px; }

.active-row .ar-progress {
    width: 160px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
}
.active-row .ar-progress .pct { font-size: 11px; color: var(--text-dim); }

.empty-state {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-dim);
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.empty-state .ico { font-size: 32px; margin-bottom: 8px; opacity: 0.5; }
.empty-state h3 { font-size: 14px; color: var(--text-mid); font-weight: 600; margin-bottom: 4px; }
.empty-state p { font-size: 12px; color: var(--text-dim); }

/* ── Search controls (Search page) ───── */

.search-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.search-controls select { min-width: 150px; }

.url-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px;
}

.url-bar input {
    flex: 1;
    background: transparent;
    border: none;
    font-size: 13px;
}
.url-bar input:focus { background: transparent; border: none; }

/* ── Cards Grid (Qobuz-style) ────── */

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
}

.result-card {
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
}

.result-card:hover { transform: translateY(-3px); }

.result-card .cover-wrap {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: var(--shadow-card);
}

.result-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: var(--bg-hover);
    transition: transform 0.4s ease;
}

.result-card:hover img { transform: scale(1.04); }

.cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 50%);
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    align-items: flex-end;
    padding: 12px;
}

.result-card:hover .cover-overlay { opacity: 1; }

.cover-actions {
    display: flex;
    gap: 8px;
    width: 100%;
    justify-content: flex-end;
}

.icon-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: #1a1300;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    box-shadow: var(--gold-shadow);
    transition: transform 0.15s, background 0.15s;
}
.icon-btn:hover { background: var(--accent-hover); transform: scale(1.08); }
.icon-btn.ghost { background: rgba(0,0,0,0.55); color: white; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.icon-btn.ghost:hover { background: rgba(0,0,0,0.75); }

.badge-hires {
    position: absolute;
    top: 10px; right: 10px;
    background: var(--gold-grad);
    color: #1a1300;
    font-size: 9px;
    padding: 3px 7px;
    border-radius: 4px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.result-card .info {
    padding: 12px 4px 0;
}

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

.result-card .artist {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-card .meta {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 6px;
}

/* ── Downloads Page ───────────────── */

.downloads-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px;
}

.tab {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.12s;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--accent-soft); color: var(--accent); }
.tab .count { opacity: 0.7; margin-left: 4px; }

.downloads-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dl-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: border-color 0.15s, background 0.15s;
}

.dl-item:hover { border-color: var(--border-strong); background: var(--bg-card-hover); }

.dl-item img,
.dl-cover-ph {
    width: 56px; height: 56px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg-input);
    flex-shrink: 0;
}

.dl-cover-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
}

.dl-cover-ph::after { content: "♪"; font-size: 24px; }

.dl-item-clickable { cursor: pointer; }

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

.dl-info .title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dl-info .artist {
    color: var(--text-dim);
    font-size: 12px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dl-progress { width: 200px; flex-shrink: 0; }
.dl-progress .pct-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.progress-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar .fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s;
}

.dl-status {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
}

.dl-status.completed { color: var(--success); background: rgba(33,208,122,0.12); }
.dl-status.downloading { color: var(--accent); background: var(--accent-soft); }
.dl-status.queued { color: var(--warning); background: rgba(255,176,84,0.12); }
.dl-status.error { color: var(--danger); background: rgba(227,93,106,0.12); }
.dl-status.cancelled { color: var(--text-dim); background: rgba(118,120,134,0.12); }

.dl-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ── Library ──────────────────────── */

.breadcrumb {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    font-size: 13px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--text-mid);
    text-decoration: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.12s;
}

.breadcrumb a:first-child { color: var(--accent); }
.breadcrumb a:hover { background: var(--bg-card-hover); color: var(--text); }
.breadcrumb span { color: var(--text-dim); align-self: center; }

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

.lib-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.12s;
    border: 1px solid transparent;
}

.lib-item:hover { background: var(--bg-card-hover); border-color: var(--border); }

.lib-item .icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--accent);
    flex-shrink: 0;
}

.lib-item img {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--bg-card);
    flex-shrink: 0;
}

.lib-item .name {
    flex: 1;
    font-size: 14px;
    color: var(--text);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lib-item .detail {
    color: var(--text-dim);
    font-size: 12px;
}

.lib-item .lib-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* ── Playlist Detail ─────────────── */

.playlist-header {
    display: flex;
    gap: 24px;
    align-items: flex-end;
    margin-bottom: 28px;
    padding: 28px;
    background: linear-gradient(135deg, rgba(201,168,94,0.1) 0%, rgba(0,0,0,0) 60%), var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.playlist-header img {
    width: 180px; height: 180px;
    border-radius: var(--radius);
    object-fit: cover;
    box-shadow: var(--shadow-elev);
}

.playlist-header .meta-block .label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    font-weight: 700;
}
.playlist-header .meta-block h2 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 4px 0 6px;
    color: var(--text-strong);
}
.playlist-header .meta-block .sub {
    color: var(--text-dim);
    font-size: 13px;
    margin-bottom: 16px;
}
.playlist-header .meta-block .actions { display: flex; gap: 8px; }

.playlist-tracks {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 0;
}

.pl-track {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 16px;
    transition: background 0.12s;
}
.pl-track:hover { background: var(--bg-card-hover); }

.pl-num {
    width: 28px;
    text-align: right;
    color: var(--text-dim);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}
.pl-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pl-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pl-artist {
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pl-dur {
    color: var(--text-dim);
    font-size: 12px;
    width: 42px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ── Settings ─────────────────────── */

.settings-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
}

.settings-section h3 {
    font-size: 14px;
    margin-bottom: 16px;
    color: var(--text-strong);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-mid);
}
.settings-row:last-child { border-bottom: none; }
.settings-row b { color: var(--text); font-weight: 600; }
.settings-row code {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 3px 8px;
    font-size: 12px;
    color: var(--accent);
    border: 1px solid var(--border);
    font-family: 'SF Mono', Menlo, monospace;
}

.retention-notice {
    background: linear-gradient(135deg, rgba(201,168,94,0.1) 0%, rgba(201,168,94,0.04) 100%);
    border: 1px solid rgba(201,168,94,0.35);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 16px;
    color: var(--accent-strong);
    font-size: 13px;
    line-height: 1.55;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.retention-notice .ico {
    flex-shrink: 0;
    font-size: 18px;
    line-height: 1;
}

.retention-notice b { color: var(--accent-strong); font-weight: 700; }

/* ── Disk warning banner ─────────── */

#disk-warning {
    background: var(--danger);
    color: white;
    padding: 10px 20px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* ── ZIP Modal ───────────────── */

.zip-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    z-index: 999;
}

.zip-modal-content {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: min(480px, 100% - 2rem);
    max-width: 90vw;
    z-index: 1000;
    box-shadow: var(--shadow-elev);
}

.zip-modal-content h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Music Player Modal ───────── */

.mp-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    z-index: 999;
}

.mp-modal {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: min(520px, 100% - 2rem);
    max-width: 94vw;
    z-index: 1000;
    overflow: hidden;
    box-shadow: var(--shadow-elev);
}

.mp-cover-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    max-height: 320px;
    overflow: hidden;
    background: var(--bg-hover);
}
.mp-cover-wrap img { width: 100%; height: 100%; object-fit: cover; }
.mp-cover-gradient {
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 120px;
    background: linear-gradient(transparent, var(--bg-card));
}

.mp-body { padding: 20px 24px 24px; }
.mp-track-title {
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-strong);
}
.mp-track-meta {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 4px;
}
.mp-seek-row { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.mp-seek {
    flex: 1;
    -webkit-appearance: none;
    height: 5px;
    background: var(--border);
    border-radius: 3px;
    border: none;
    cursor: pointer;
}
.mp-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px; height: 14px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
}
.mp-time {
    font-size: 11px;
    color: var(--text-dim);
    width: 42px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.mp-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 14px;
}
.mp-btn {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.15s;
}
.mp-btn:hover { color: var(--accent); }
.mp-btn-play {
    width: 56px; height: 56px;
    background: var(--gold-grad);
    color: #1a1300;
    border-radius: 50%;
    font-size: 20px;
    box-shadow: var(--gold-shadow);
}
.mp-btn-play:hover { color: #1a1300; transform: scale(1.05); }
.mp-playlist { max-height: 200px; overflow-y: auto; border-top: 1px solid var(--border); }
.mp-pl-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 24px;
    cursor: pointer;
    font-size: 13px;
}
.mp-pl-item:hover { background: var(--bg-card-hover); }
.mp-pl-item.active { color: var(--accent); background: var(--accent-soft); }
.mp-pl-num { width: 24px; text-align: right; color: var(--text-dim); font-size: 12px; }
.mp-pl-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mp-close, .mp-toggle-pl {
    position: absolute;
    top: 12px;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    z-index: 2;
}
.mp-close { right: 12px; font-size: 18px; }
.mp-toggle-pl { left: 12px; font-size: 14px; }

/* ── Notifications ─────────────── */

@keyframes slideInRight {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ── Responsive ────────────────── */

/* (legacy @media max-width:900px block removed — superseded by vault.css
   tablet band 768–1023 + phone band ≤767. See responsive-unification-plan T2.2) */
} /* ── end @layer components ── */
