  /* ── TOKENS ── */
  :root {
    --bg:        #0a0a0c;
    --surface:   #111116;
    --surface2:  #18181f;
    --border:    #ffffff0f;
    --border2:   #ffffff18;
    --text:      #e8e8f0;
    --muted:     #6b6b80;
    --accent:    #67a8e1;
    --accent2:   #2b90dd;
    --warn:      #f0c84a;
    --player-h:  80px;
    --sidebar-w: 220px;
    --radius:    10px;
    --font-head: 'Syne', sans-serif;
    --font-mono: 'DM Mono', monospace;
  }

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

  html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-head);
    overflow: hidden;
  }

  /* ── LAYOUT ── */
  .app {
    display: grid;
    grid-template-rows: 1fr var(--player-h);
    grid-template-columns: var(--sidebar-w) 1fr;
    height: 100vh;
    height: 100dvh;
  }

  /* ── SIDEBAR ── */
  .sidebar {
    grid-row: 1;
    grid-column: 1;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 28px 0 0;
    overflow: hidden;
  }

  .sidebar-logo {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    padding: 0 20px 24px;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 16px 10px;
  }

  .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--muted);
    transition: background 0.15s, color 0.15s;
    user-select: none;
  }
  .nav-item:hover { background: var(--surface2); color: var(--text); }
  .nav-item.active { background: var(--surface2); color: var(--text); }
  .nav-item svg { flex-shrink: 0; opacity: 0.7; }
  .nav-item.active svg { opacity: 1; }

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

  .sidebar-album-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 10px 16px;
  }
  .sidebar-album-list::-webkit-scrollbar { width: 4px; }
  .sidebar-album-list::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

  .sidebar-album-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    user-select: none;
  }
  .sidebar-album-item:hover { background: var(--surface2); }
  .sidebar-album-item.active { background: var(--surface2); }

  .sidebar-album-thumb {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    background: #000;
  }

  .sidebar-album-name {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
  }
  .sidebar-album-item.active .sidebar-album-name { color: var(--accent); }

  /* ── MAIN ── */
  .main {
    grid-row: 1;
    grid-column: 2;
    overflow-y: auto;
    padding: 40px 44px 32px;
  }
  .main::-webkit-scrollbar { width: 6px; }
  .main::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

  /* ── VIEWS ── */
  .view { display: none; }
  .view.active { display: block; }

  /* HOME */
  .home-header {
    margin-bottom: 32px;
  }
  .home-header h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
  }
  .home-header p {
    font-size: 13px;
    color: var(--muted);
    margin-top: 6px;
    font-family: var(--font-mono);
  }

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

  .album-card {
    cursor: pointer;
    group: true;
  }
  .album-card:hover .album-card-art { transform: scale(1.03); box-shadow: 0 16px 48px #0008; }
  .album-card:hover .album-card-title { color: var(--accent); }

  .album-card-art-wrap {
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface2);
    margin-bottom: 12px;
    position: relative;
  }
  .album-card-art-wrap.all-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .all-card-icon { opacity: 0.5; }

  .album-card-art {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: block;
  }

  .album-card-play-overlay {
    position: absolute;
    inset: 0;
    background: #00000060;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: var(--radius);
  }
  .album-card:hover .album-card-play-overlay { opacity: 1; }

  .album-card-play-btn {
    width: 44px;
    height: 44px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px #c8f05a40;
  }
  .album-card-play-btn svg { color: #0a0a0c; margin-left: 2px; }

  .album-card-title {
    font-size: 13px;
    font-weight: 700;
    transition: color 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .album-card-meta {
    font-size: 11px;
    color: var(--muted);
    font-family: var(--font-mono);
    margin-top: 3px;
  }

  /* ALBUM VIEW */
  .album-view-header {
    display: flex;
    gap: 28px;
    align-items: flex-end;
    margin-bottom: 36px;
  }
  .album-view-art {
    width: 180px;
    height: 180px;
    border-radius: var(--radius);
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 20px 60px #00000080;
  }
  .album-view-all-art {
    width: 180px;
    height: 180px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 20px 60px #00000080;
    opacity: 0.8;
  }
  .album-view-info { flex: 1; }
  .album-view-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    font-family: var(--font-mono);
    margin-bottom: 8px;
  }
  .album-view-title {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin-bottom: 8px;
  }
  .album-view-meta {
    font-size: 13px;
    color: var(--muted);
    font-family: var(--font-mono);
  }

  .album-view-controls {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
  }

  .btn-play-all {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: #0a0a0c;
    border: none;
    border-radius: 50px;
    padding: 11px 24px;
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
  }
  .btn-play-all:hover { opacity: 0.88; transform: scale(1.02); }

  .btn-shuffle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border2);
    border-radius: 50px;
    padding: 10px 20px;
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
  }
  .btn-shuffle:hover, .btn-shuffle.active {
    color: var(--accent);
    border-color: var(--accent);
    background: #c8f05a10;
  }

  /* TRACK LIST */
  .track-list-header {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 12px;
    padding: 0 16px 10px;
    border-bottom: 1px solid var(--border);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    font-family: var(--font-mono);
  }

  .track-row {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 10px 16px;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.12s;
    user-select: none;
  }
  .track-row:hover { background: var(--surface2); }
  .track-row.playing { background: #c8f05a0d; }
  .track-row.playing .track-title { color: var(--accent); }

  .track-num {
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    font-family: var(--font-mono);
    text-align: center;
  }
  .track-row.playing .track-num { color: var(--accent); }
  .playing-bars {
    display: none;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
    justify-content: center;
  }
  .track-row.playing .track-num-text { display: none; }
  .track-row.playing .playing-bars { display: flex; }

  .bar {
    width: 3px;
    background: var(--accent);
    border-radius: 2px;
    animation: bar-bounce 0.8s ease-in-out infinite alternate;
  }
  .bar:nth-child(1) { height: 60%; animation-delay: 0s; }
  .bar:nth-child(2) { height: 100%; animation-delay: 0.15s; }
  .bar:nth-child(3) { height: 40%; animation-delay: 0.3s; }
  @keyframes bar-bounce { from { transform: scaleY(0.4); } to { transform: scaleY(1); } }

  .track-title {
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s;
  }
  .track-duration {
    font-size: 12px;
    color: var(--muted);
    font-family: var(--font-mono);
  }

  /* ALL SONGS VIEW */
  .all-songs-header {
    margin-bottom: 32px;
  }
  .all-songs-header h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.02em;
  }
  .all-songs-header p {
    font-size: 13px;
    color: var(--muted);
    margin-top: 6px;
    font-family: var(--font-mono);
  }

  .all-songs-controls {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
  }

  .all-track-list-header {
    display: grid;
    grid-template-columns: 44px 1fr 140px auto;
    gap: 12px;
    padding: 0 16px 10px;
    border-bottom: 1px solid var(--border);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    font-family: var(--font-mono);
  }

  .all-track-row {
    display: grid;
    grid-template-columns: 44px 1fr 140px auto;
    gap: 12px;
    align-items: center;
    padding: 7px 16px;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.12s;
    user-select: none;
  }
  .all-track-row:hover { background: var(--surface2); }
  .all-track-row.playing { background: #c8f05a0d; }
  .all-track-row.playing .all-track-title { color: var(--accent); }

  .all-track-thumb {
    width: 36px;
    height: 36px;
    border-radius: 5px;
    object-fit: cover;
    display: block;
  }

  .all-track-title {
    font-size: 13.5px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s;
  }
  .all-track-album {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .all-track-duration {
    font-size: 12px;
    color: var(--muted);
    font-family: var(--font-mono);
    text-align: right;
  }

  /* ── PLAYER BAR ── */
  .player-bar {
    grid-row: 2;
    grid-column: 1 / -1;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 24px;
    gap: 24px;
    backdrop-filter: blur(20px);
  }

  .player-now-playing {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    cursor: pointer;
    border-radius: 7px;
    padding: 6px 8px;
    margin-left: -8px;
    transition: background 0.15s;
  }
  .player-now-playing:hover { background: var(--surface2); }
  .player-thumb {
    width: 46px;
    height: 46px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: #000;
  }
  .player-track-info { min-width: 0; }
  .player-track-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .player-album-name {
    font-size: 11px;
    color: var(--muted);
    font-family: var(--font-mono);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .player-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
  }

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

  .ctrl-btn-play {
    width: 40px;
    height: 40px;
    background: var(--text);
    border: none;
    border-radius: 50%;
    color: var(--bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, background 0.15s;
    flex-shrink: 0;
  }
  .ctrl-btn-play:hover { transform: scale(1.06); background: #fff; }

  .player-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 420px;
  }
  .progress-time {
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--muted);
    width: 32px;
    flex-shrink: 0;
  }
  .progress-time.right { text-align: right; }

  .progress-bar-wrap {
    flex: 1;
    height: 4px;
    background: var(--border2);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    width: 0%;
    pointer-events: none;
    transition: width 0.1s linear;
  }
  .progress-bar-wrap:hover .progress-bar-fill { background: var(--accent); }

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

  .volume-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .volume-bar-wrap {
    width: 80px;
    height: 4px;
    background: var(--border2);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .volume-bar-fill {
    height: 100%;
    background: var(--muted);
    border-radius: 4px;
    width: 80%;
    pointer-events: none;
  }

  /* ── BONUS TAG ── */
  .bonus-tag {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent2);
    background: #8b5cf618;
    border: 1px solid #8b5cf630;
    border-radius: 4px;
    padding: 2px 5px;
    margin-left: 8px;
    font-family: var(--font-mono);
    vertical-align: middle;
    flex-shrink: 0;
  }

  /* ── BLACK COVER FALLBACK ── */
  .cover-null {
    background: #000;
    border-radius: inherit;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  img.cover-img[data-null="true"] { display: none; }

  /* ── EMPTY STATE ── */
  .empty-player {
    display: flex;
    align-items: center;
    gap: 14px;
    opacity: 0.3;
  }
  .empty-thumb {
    width: 46px;
    height: 46px;
    border-radius: 6px;
    background: var(--surface2);
    flex-shrink: 0;
  }
  .empty-text { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }

  /* ── LOADING ── */
  .loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 13px;
    gap: 10px;
  }

  /* ── SCROLLBAR GLOBAL ── */
  * { scrollbar-width: thin; scrollbar-color: var(--border2) transparent; }

  /* ══════════════════════════════════════════════════════
     SELECT SHUFFLE — new CSS only, no layout overrides
  ══════════════════════════════════════════════════════ */

  /* Top stats + action bar */
  .ss-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    position: sticky;
    top: -40px; /* cancel .main padding so it sticks under the top edge */
    z-index: 10;
  }

  .ss-bar-info {
    flex: 1;
    min-width: 0;
  }
  .ss-bar-count {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
  }
  .ss-bar-count span {
    color: var(--accent);
  }
  .ss-bar-hint {
    font-size: 11px;
    color: var(--muted);
    font-family: var(--font-mono);
    margin-top: 2px;
  }

  .btn-ss-shuffle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: #0a0a0c;
    border: none;
    border-radius: 50px;
    padding: 11px 22px;
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
  }
  .btn-ss-shuffle:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
  }
  .btn-ss-shuffle:not(:disabled):hover { opacity: 0.88; transform: scale(1.02); }

  .btn-ss-clear {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border2);
    border-radius: 50px;
    padding: 10px 18px;
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
  }
  .btn-ss-clear:hover {
    color: var(--text);
    border-color: var(--border2);
    background: var(--surface2);
  }

  /* Select Shuffle header */
  .ss-header {
    margin-bottom: 20px;
  }
  .ss-header h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
  }
  .ss-header p {
    font-size: 13px;
    color: var(--muted);
    margin-top: 6px;
    font-family: var(--font-mono);
  }

  /* Selection state on album cards — ring + badge overlays only */
  .ss-card-wrap {
    position: relative;
    cursor: pointer;
  }

  /* Inset ring drawn via box-shadow on art-wrap — no layout changes */
  .ss-card-wrap .album-card-art-wrap {
    transition: box-shadow 0.18s, transform 0.18s;
  }
  .ss-card-wrap:hover .album-card-art-wrap {
    transform: scale(1.02);
  }
  .ss-card-wrap.ss-selected .album-card-art-wrap {
    box-shadow: 0 0 0 3px var(--accent), 0 8px 32px #c8f05a28;
  }
  .ss-card-wrap.ss-warn .album-card-art-wrap {
    box-shadow: 0 0 0 3px var(--warn), 0 8px 32px #f0c84a28;
  }

  /* Badge in corner of art wrap */
  .ss-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.18s, transform 0.18s;
  }
  .ss-card-wrap.ss-selected .ss-badge-check { opacity: 1; transform: scale(1); background: var(--accent); color: #0a0a0c; }
  .ss-card-wrap.ss-warn .ss-badge-check { opacity: 0; transform: scale(0.6); }
  .ss-card-wrap.ss-warn .ss-badge-warn { opacity: 1; transform: scale(1); background: var(--warn); color: #0a0a0c; }
  .ss-card-wrap:not(.ss-selected):not(.ss-warn) .ss-badge { opacity: 0; transform: scale(0.6); }

  /* Dim overlay when not selected (subtle) */
  .ss-card-wrap:not(.ss-selected):not(.ss-warn) .album-card-art-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: #0a0a0c55;
    border-radius: var(--radius);
    pointer-events: none;
    transition: background 0.18s;
  }
  .ss-card-wrap:hover:not(.ss-selected):not(.ss-warn) .album-card-art-wrap::after {
    background: #0a0a0c22;
  }

  /* Title dim */
  .ss-card-wrap:not(.ss-selected):not(.ss-warn) .album-card-title {
    color: var(--muted);
  }
  .ss-card-wrap.ss-selected .album-card-title { color: var(--accent); }
  .ss-card-wrap.ss-warn .album-card-title { color: var(--warn); }

  /* Suppress the home-card play overlay in select shuffle mode */
  .ss-card-wrap .album-card-play-overlay { display: none; }

  /* Nav accent for select shuffle */
  #nav-select-shuffle.active { color: var(--text); }
  #nav-select-shuffle.active svg { color: var(--accent); opacity: 1; }