/* Station Solaris — archivesolaris visual language */

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

:root {
    --bg-primary: #0d0f0e;
    --bg-secondary: #141816;
    --bg-tertiary: #1a1d1b;
    --bg-hover: rgba(176, 128, 80, 0.06);

    --text-primary: #a09a90;
    --text-secondary: #706b62;
    --text-muted: #4a4742;
    --text-faded: #2e2c28;

    --accent-primary: #b08050;
    --accent-muted: #8a6a48;
    --accent-faded: #5a4a38;
    --accent-red: #974e37;

    --border-primary: #252320;
    --border-subtle: #1c1a18;

    --font-main: 'IBM Plex Mono', 'Fira Code', 'SF Mono', monospace;
    --font-size: 15px;
    --font-size-sm: 14px;
    --font-size-xs: 12px;
    --font-size-lg: 17px;
    --line-height: 1.7;

    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 2rem;
    --space-xl: 4rem;

    --content-width: 920px;
    --page-padding: 2rem;
    --player-height: 56px;
}

html, body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: var(--font-size);
    line-height: var(--line-height);
    min-height: 100vh;
}

::selection {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}

a:hover { color: var(--accent-primary); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-main);
    font-weight: normal;
    color: var(--text-primary);
}

h1 { font-size: var(--font-size-lg); }
h2 { font-size: var(--font-size); color: var(--text-secondary); }
h3 { font-size: var(--font-size-sm); color: var(--text-muted); }

/* ============================================================================
   PAGE SHELL
   ============================================================================ */

.page-shell {
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ============================================================================
   TOP BAR
   ============================================================================ */

#topbar {
    max-width: var(--content-width);
    margin: 0 auto;
    width: 100%;
    padding: var(--space-lg) var(--page-padding) var(--space-md);
    display: flex;
    align-items: baseline;
    gap: var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
}

.brand {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    text-decoration: none;
    letter-spacing: 0.1em;
    flex-shrink: 0;
}

.brand:hover { color: var(--accent-primary); }

.search-wrapper {
    position: relative;
    width: 180px;
    flex-shrink: 0;
}

.search-wrapper input {
    width: 100%;
    background: var(--bg-primary);
    border: none;
    border-bottom: 1px solid var(--border-primary);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: var(--font-size-sm);
    padding: var(--space-xs) 0;
    outline: none;
}

.search-wrapper input:focus { border-color: var(--accent-primary); }
.search-wrapper input::placeholder { color: var(--text-faded); }

.topbar-user {
    margin-left: auto;
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.topbar-username {
    font-size: var(--font-size-xs);
    color: var(--text-faded);
    letter-spacing: 0.05em;
}

.topbar-logout {
    background: none;
    border: none;
    font-family: var(--font-main);
    font-size: var(--font-size-xs);
    color: var(--text-faded);
    cursor: pointer;
    letter-spacing: 0.05em;
    padding: 0;
}

.topbar-logout:hover { color: var(--accent-primary); }

/* ============================================================================
   NAV ROW
   ============================================================================ */

#nav-row {
    max-width: var(--content-width);
    margin: 0 auto;
    width: 100%;
    padding: var(--space-md) var(--page-padding);
    display: flex;
    justify-content: center;
    gap: var(--space-xl);
    font-size: var(--font-size-sm);
}

#nav-row a {
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

#nav-row a:hover { color: var(--accent-primary); }

.nav-marker { color: var(--text-faded); }

/* ============================================================================
   MAIN CONTENT
   ============================================================================ */

#main-content {
    max-width: var(--content-width);
    margin: 0 auto;
    width: 100%;
    padding: var(--space-lg) var(--page-padding) 6rem;
}

/* ============================================================================
   PLAYER ROW — persistent, plaintext, always visible
   ============================================================================ */

#player-row {
    position: fixed;
    bottom: 0;
    left: var(--player-height);
    right: 0;
    z-index: 100;
    height: var(--player-height);
    background: var(--bg-primary);
    border-top: 1px solid var(--border-primary);
    padding: var(--space-sm) var(--page-padding);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    font-size: var(--font-size-xs);
    letter-spacing: 0.04em;
}

.player-row-top {
    display: flex;
    align-items: baseline;
    gap: var(--space-lg);
    width: 100%;
}

.player-row-bottom {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
}

/* Info: marker + title + artist */
.player-row-info {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.player-row-marker {
    color: var(--text-faded);
    flex-shrink: 0;
}

.player-row-title {
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
    text-decoration: none;
}
.player-row-title:hover {
    color: var(--text-primary);
}

.player-row-artist {
    color: var(--text-faded);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 2;
    min-width: 0;
    text-decoration: none;
}
.player-row-artist:hover {
    color: var(--text-secondary);
}

.player-row-artist:not(:empty)::before {
    content: '— ';
}

/* Transport controls */
.player-row-controls {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-shrink: 0;
}

.player-row-btn {
    background: none;
    border: none;
    font-family: var(--font-main);
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    letter-spacing: 0.04em;
}

.player-row-btn:hover { color: var(--accent-primary); }

.player-row-btn--play {
    color: var(--text-secondary);
    min-width: 2.5rem;
    text-align: center;
}

.player-row-btn--play:hover { color: var(--accent-primary); }

.player-row-time {
    color: var(--text-faded);
    font-variant-numeric: tabular-nums;
    width: 2.8rem;
}

.player-row-time:last-child { text-align: right; }

/* Ambient background — color extracted from album art */
#player-ambient {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.5s ease, background 1.5s ease;
}

#player-ambient.visible {
    opacity: 1;
}

#player-ambient img {
    display: none;
}

/* Player thumbnail — fixed left of the player bar, same height */
.player-thumb {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 0;
    height: var(--player-height);
    object-fit: cover;
    display: block;
    border-right: 1px solid var(--accent-faded);
    opacity: 0.9;
    z-index: 100;
    transition: width 0.3s ease;
}

.player-thumb.visible {
    width: 56px;
}

/* Block-based seek and volume */
.player-blocks {
    display: flex;
    gap: 2px;
    align-items: center;
    cursor: pointer;
}

.player-blocks--seek { flex: 1; }
.player-blocks--vol  { width: 80px; flex-shrink: 0; }

.player-block {
    background: var(--border-primary);
    transition: background 0.05s;
}

.player-blocks--seek .player-block {
    height: 4px;
    flex: 1;
}

.player-block.filled       { background: var(--accent-primary); }
.player-block:hover        { background: var(--accent-faded); }
.player-block.filled:hover { background: var(--accent-primary); }

/* 3×3 volume grid */
.player-blocks--vol {
    display: grid !important;
    grid-template-columns: repeat(5, 8px);
    grid-template-rows: repeat(2, 8px);
    gap: 2px;
    width: auto;
    height: auto;
    flex-shrink: 0;
    align-self: center;
}

.player-blocks--vol .player-block {
    width: 8px;
    height: 8px;
}

.player-blocks--vol .player-block.filled { background: var(--accent-muted); }
.player-blocks--vol .player-block.filled:hover { background: var(--accent-primary); }


/* ============================================================================
   FEED COMPONENTS
   ============================================================================ */

/* ── Hero ── */

.feed-hero {
    position: relative;
    overflow: hidden;
    margin-bottom: var(--space-lg);
    height: 200px;
}

.feed-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.55;
    display: block;
}

.feed-hero-body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(transparent, rgba(13,15,14,0.95));
}

.feed-hero-label {
    font-size: var(--font-size-xs);
    color: var(--text-faded);
    letter-spacing: 0.08em;
    margin-bottom: var(--space-xs);
}

.feed-hero-title {
    display: block;
    font-size: var(--font-size-lg);
    color: var(--text-primary);
    text-decoration: none;
    margin-bottom: 2px;
}

.feed-hero-title:hover { color: var(--accent-primary); }

.feed-hero-meta {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* ── Two column layout ── */

/* ── Split: tracklist left, mixes right ── */
.feed-split {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
    align-items: start;
}

.feed-split-main,
.feed-split-side { min-width: 0; }

/* ── Mixes: stacked tall cards ── */
.feed-card-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.feed-card--wide {
    display: block;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.feed-card--wide .feed-card-cover,
.feed-card--wide .feed-card-cover--blank {
    height: 72px;
    width: 100%;
    object-fit: cover;
    opacity: 0.75;
    display: block;
}

.feed-card--wide:hover .card-body-title { color: var(--accent-primary); }

/* ── Mosaic: first item large, rest small ── */
.feed-mosaic {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: auto auto;
    gap: var(--space-xs);
}

.feed-mosaic-item {
    display: block;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.feed-mosaic-item .feed-card-cover,
.feed-mosaic-item .feed-card-cover--blank {
    height: 140px;
    width: 100%;
    object-fit: cover;
    opacity: 0.75;
    display: block;
}

.feed-mosaic-item--large {
    grid-row: 1 / 3;
}

.feed-mosaic-item--large .feed-card-cover,
.feed-mosaic-item--large .feed-card-cover--blank {
    height: 100%;
    min-height: 280px;
}

.feed-mosaic-item:hover .card-body-title { color: var(--accent-primary); }

/* ── Artist strip ── */
.feed-artist-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-xs);
}

.feed-artist-strip-item {
    display: block;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.feed-artist-strip-item .feed-card-cover,
.feed-artist-strip-item .feed-card-cover--blank {
    height: 140px;
    width: 100%;
    object-fit: cover;
    opacity: 0.75;
    display: block;
}

.feed-artist-strip-item:hover .card-body-title { color: var(--accent-primary); }

/* ── Carousel pair: two carousels side by side ── */
.feed-carousel-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

.feed-carousel-pair .carousel-track { overflow-x: hidden; }

/* ── Section ── */

.feed-section-title {
    font-size: var(--font-size-xs);
    color: var(--text-faded);
    letter-spacing: 0.08em;
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border-subtle);
    font-weight: normal;
}

.feed-marker { color: var(--text-faded); }

/* ── Card row (3-up grid inside a section) ── */

.feed-card-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--space-sm);
}

.feed-card-row .feed-card {
    margin: 0;
}

.feed-card-row .feed-card-cover,
.feed-card-row .feed-card-cover--blank {
    height: 120px;
}

/* ── Feed two-column row ── */

.feed-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.feed-row__main { margin-bottom: 0; }
.feed-row__side { margin-bottom: 0; }

/* ── Feed grid (card grids inside sections) ── */

.feed-grid {
    display: grid;
    gap: var(--space-sm);
}

.feed-grid--3 { grid-template-columns: repeat(3, 1fr); }
.feed-grid--5 { grid-template-columns: repeat(5, 1fr); }
.feed-grid--auto { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.feed-grid--col { grid-template-columns: 1fr; }

.feed-grid-card {
    display: block;
    text-decoration: none;
    overflow: hidden;
}

.feed-grid-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    opacity: 0.8;
    transition: opacity 0.15s;
}

.feed-grid-card:hover img { opacity: 1; }

.feed-grid-blank {
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-tertiary);
}

.feed-grid-card .card-body {
    padding: var(--space-xs) 0;
}

.card-body-title {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feed-grid-card:hover .card-body-title { color: var(--accent-primary); }

.card-body-meta {
    font-size: var(--font-size-xs);
    color: var(--text-faded);
}

/* ── Carousel with nav arrows inline ── */

.feed-carousel {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.feed-carousel .carousel-track {
    flex: 1;
    min-width: 0;
}

/* ── Stats section ── */

.feed-section--stats {
    border-top: 1px solid var(--border-subtle);
    padding-top: var(--space-md);
}

/* ── Old hero (keep for compat) ── */
.feed-card--hero {
    column-span: all;
    position: relative;
    overflow: hidden;
    margin-bottom: var(--space-md);
    /*border: 1px solid var(--border-primary);*/
}

.hero-cover {
    display: block;
    width: 100%;
    height: 130px;
    object-fit: cover;
    opacity: 0.6;
}

.hero-body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-md);
    background: linear-gradient(transparent, rgba(13,15,14,0.92));
}

.feed-card--hero .feed-card-header {
    border: none;
    margin: 0;
    padding: 0;
}

.feed-card--hero .feed-card-title a {
    color: var(--text-primary);
    font-size: var(--font-size-lg);
}

.feed-card--hero .feed-card-title a:hover { color: var(--accent-primary); }

.feed-card--hero .feed-card-meta {
    margin: var(--space-xs) 0 0;
    color: var(--text-secondary);
}

/* ── Carousel ── */

.feed-card--carousel {
    column-span: all;
    margin-bottom: var(--space-md);
    border: 1px solid var(--border-primary);
    padding: var(--space-md);
}

.feed-card--carousel .feed-card-header {
    display: flex;
    align-items: baseline;
    gap: var(--space-xs);
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border-subtle);
}

.carousel-nav {
    margin-left: auto;
    display: flex;
    gap: var(--space-xs);
}

.carousel-btn {
    background: none;
    border: none;
    font-family: var(--font-main);
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 var(--space-xs);
}

.carousel-btn:hover { color: var(--accent-primary); }

.carousel-track {
    display: flex;
    gap: var(--space-md);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

.carousel-item {
    flex: 0 0 140px;
    width: 140px;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    color: var(--text-secondary);
    text-decoration: none;
}

.carousel-item:hover { color: var(--accent-primary); }
.carousel-item:hover .carousel-item-title { color: var(--accent-primary); }

.carousel-cover {
    width: 140px;
    height: 140px;
    object-fit: cover;
    display: block;
    opacity: 0.85;
    flex-shrink: 0;
}

.carousel-cover--blank {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
}

.carousel-item-title {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.carousel-item-meta {
    font-size: var(--font-size-xs);
    color: var(--text-faded);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feed-card--carousel--wide .carousel-item {
    flex: 0 0 220px;
    width: 220px;
}

.feed-card--carousel--wide .carousel-cover {
    width: 220px;
    height: 220px;
}

/* ── Card ── */

.feed-card--playlist,
.feed-card--album,
.feed-card--artist {
    break-inside: avoid;
    position: relative;
    overflow: hidden;
    padding: 0;
}

a.feed-card--playlist,
a.feed-card--artist {
    display: block;
    position: relative;
    text-decoration: none;
}

.feed-card--playlist a,
.feed-card--artist a {
    display: block;
    position: relative;
    text-decoration: none;
}

a.feed-card--playlist:hover .card-body-title,
a.feed-card--artist:hover .card-body-title,
.feed-card--playlist a:hover .card-body-title,
.feed-card--artist a:hover .card-body-title {
    color: var(--accent-primary);
}

.feed-card--playlist .feed-card-cover,
.feed-card--album .feed-card-cover,
.feed-card--artist .feed-card-cover {
    display: block;
    width: 100%;
    height: 200px;
    object-fit: cover;
    opacity: 0.75;
    margin: 0;
}

.feed-card-cover--blank {
    width: 100%;
    height: 200px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
}

.feed-card--playlist .card-body,
.feed-card--album .card-body,
.feed-card--artist .card-body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-md);
    background: linear-gradient(transparent, rgba(13,15,14,0.95));
}

.card-body-marker {
    font-size: var(--font-size-xs);
    color: var(--text-faded);
    margin-bottom: 2px;
}

.card-body-title {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    transition: color 0.15s;
}

.card-body-meta {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    margin-top: 2px;
}

.feed-card--playlist .feed-card-header,
.feed-card--album .feed-card-header,
.feed-card--artist .feed-card-header {
    border: none;
    margin: 0;
    padding: 0;
}

.feed-card--playlist .feed-card-meta,
.feed-card--album .feed-card-meta,
.feed-card--artist .feed-card-meta {
    margin: 0;
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.feed-card--playlist .feed-card-footer,
.feed-card--album .feed-card-footer,
.feed-card--artist .feed-card-footer {
    margin: 0;
    font-size: var(--font-size-xs);
    color: var(--text-faded);
}


/* ── Tracklist ── */

.feed-card--tracklist {
    break-inside: avoid;
}

/* ============================================================================
   LOGIN PAGE
   ============================================================================ */

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-box {
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.login-box h1 {
    color: var(--accent-primary);
    font-size: var(--font-size-sm);
    letter-spacing: 0.1em;
    margin-bottom: var(--space-sm);
}

.login-box label {
    font-size: var(--font-size-xs);
    color: var(--text-faded);
    display: block;
    margin-bottom: var(--space-xs);
}

.login-box input {
    width: 100%;
    background: var(--bg-primary);
    border: none;
    border-bottom: 1px solid var(--border-primary);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: var(--font-size-sm);
    padding: var(--space-xs) 0;
    outline: none;
}

.login-box input:focus { border-color: var(--accent-primary); }

.login-box button {
    background: none;
    border: 1px solid var(--border-primary);
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: var(--font-size-xs);
    padding: var(--space-xs) var(--space-md);
    cursor: pointer;
    letter-spacing: 0.05em;
    transition: color 0.15s, border-color 0.15s;
    width: 100%;
    margin-top: var(--space-sm);
}

.login-box button:hover {
    color: var(--accent-primary);
    border-color: var(--accent-faded);
}

.login-box .error {
    font-size: var(--font-size-xs);
    color: var(--accent-primary);
}

/* ============================================================================
   MASONRY FEED
   ============================================================================ */

.feed-masonry {
    column-count: 3;
    column-gap: var(--space-md);
}

@media (max-width: 1200px) { .feed-masonry { column-count: 2; } }
@media (max-width: 600px) { .feed-masonry { column-count: 1; } }

.feed-card {
    break-inside: avoid;
    /*border: 1px solid var(--border-primary);*/
    /*padding: var(--space-md);*/
    margin-bottom: var(--space-md);
}

/* Size variants — height comes from content, these control cover image height */
.feed-card--album .feed-card-cover { height: 180px; }
.feed-card--album.feed-card--new .feed-card-cover { height: 120px; }
.feed-card--artist .feed-card-cover { height: 220px; }
.feed-card--tall { }  /* tall by content — recently played list */
.feed-card--player { } /* sized by art + controls */

.feed-card-header {
    display: flex;
    align-items: baseline;
    gap: var(--space-xs);
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border-subtle);
}

.feed-card-marker {
    color: var(--text-faded);
    font-size: var(--font-size-xs);
    flex-shrink: 0;
}

.feed-card-title {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: normal;
}

.feed-card-title a {
    color: var(--text-secondary);
}

.feed-card-title a:hover { color: var(--accent-primary); }

.feed-card-meta {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.feed-card-body {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.feed-card-footer {
    margin-top: var(--space-sm);
    font-size: var(--font-size-xs);
    color: var(--text-faded);
}

.feed-card-footer a {
    color: var(--text-faded);
}

.feed-card-footer a:hover { color: var(--accent-primary); }

/* Feed card cover art — height set per card type via variant classes */
.feed-card-cover {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    margin: var(--space-sm) 0;
    opacity: 0.85;
}

.feed-card-cover--portrait {
    object-position: top center;
}

/* Recently played list inside a card */
.feed-track-list {
    list-style: none;
    padding: 0;
}

.feed-track-item {
    display: flex;
    align-items: baseline;
    gap: var(--space-xs);
    padding: var(--space-xs) 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: var(--font-size-sm);
    min-width: 0;
}

.feed-track-item:last-child { border-bottom: none; }

.feed-track-title {
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
}

.feed-track-dots {
    flex: 1;
    border-bottom: 1px dotted var(--border-primary);
    align-self: center;
    min-width: var(--space-sm);
}

.feed-track-artist {
    color: var(--text-faded);
    font-size: var(--font-size-xs);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Stats bar */
.stats-bar {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
    color: var(--text-faded);
    font-size: var(--font-size-sm);
}
.stats-bar-num {
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}
.stats-bar-sep { color: var(--border-primary); }

/* Pill list (artists, genres) */
.pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}
.pill {
    display: inline-block;
    padding: 2px var(--space-sm);
    border: 1px solid var(--border-primary);
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s;
}
.pill:hover { border-color: var(--accent-primary); color: var(--accent-primary); }
.pill--genre { cursor: default; }
.pill--genre:hover { border-color: var(--border-primary); color: var(--text-muted); }

/* Song spotlight */
.spotlight-card {
    cursor: pointer;
    padding: var(--space-md);
    border: none;
    transition: border-color 0.15s;
}
.spotlight-card:hover { border-color: var(--border-primary); }
.spotlight-card.playing { border-color: var(--accent-primary); }
.spotlight-title {
    font-size: var(--font-size-lg, 1.1rem);
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}
.spotlight-meta {
    font-size: var(--font-size-sm);
    color: var(--text-faded);
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
}
.spotlight-sep { color: var(--border-primary); }

/* Stats card (legacy) */
.feed-stats-row {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-xs);
    padding: var(--space-xs) 0;
    border-bottom: 1px solid var(--border-subtle);
}

.feed-stats-row:last-child { border-bottom: none; }
.feed-stats-key { color: var(--text-faded); }
.feed-stats-value { color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ============================================================================
   ARTIST INDEX
   ============================================================================ */

.artist-index {
    padding-bottom: 20vh;
}

.artist-index__filter {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin-bottom: var(--space-md);
    font-size: var(--font-size-xs);
    color: var(--text-faded);
}

.artist-index__filter-label {
    color: var(--text-faded);
}

.artist-index__filter-sep {
    color: var(--text-faded);
}

.artist-index__filter-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: var(--font-size-xs);
    color: var(--text-faded);
    cursor: pointer;
}

.artist-index__filter-btn.is-active {
    color: var(--accent-primary);
}

.artist-index-layout {
    display: flex;
    gap: var(--space-md);
    align-items: flex-start;
}

.artist-index__jump {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: var(--space-lg);
    flex-shrink: 0;
    width: 2rem;
}

.artist-index__jump-letter {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-faded);
    text-decoration: none;
    line-height: 1;
    padding: 0.3rem 0;
    text-align: center;
    transition: color 0.1s;
}

.artist-index__jump-letter:hover,
.artist-index__jump-letter.is-active {
    color: var(--accent-primary);
}

.artist-index__sections {
    flex: 1;
    min-width: 0;
}

.artist-index__section {
    padding: var(--space-sm) 0;
    border-top: 2px solid var(--border-primary);
}

.artist-index__section:first-child {
    border-top: none;
}

.artist-index__list {
    list-style: none;
}

.artist-index__row {
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.artist-index__row:last-child {
    border-bottom: none;
}

.artist-index__row a {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: 0.4rem 0;
    color: var(--text-secondary);
    text-decoration: none;
    width: 100%;
}

.artist-index__row a:hover .artist-index__name {
    color: var(--accent-primary);
}

.artist-index__thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-secondary);
}

.artist-index__info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    flex: 1;
    min-width: 0;
}

.artist-index__name {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    transition: color 0.1s;
}

.artist-index__heart {
    color: var(--accent-red);
    font-size: var(--font-size-xs);
    margin-left: auto;
    flex-shrink: 0;
}

.artist-index__meta {
    display: flex;
    gap: var(--space-sm);
    font-size: var(--font-size-xs);
    color: var(--text-faded);
    font-variant-numeric: tabular-nums;
}

/* ============================================================================
   DETAIL PAGE (album / playlist / artist — shared layout)
   ============================================================================ */

.detail {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: var(--space-xl);
    align-items: start;
}

.detail-sidebar {
    position: sticky;
    top: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.detail-cover {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border: 1px solid var(--border-primary);
    opacity: 0.9;
}

.detail-cover--blank {
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
}

.detail-meta {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.detail-title {
    color: var(--accent-primary);
    font-size: var(--font-size-lg);
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
}

.detail-link {
    color: inherit;
    text-decoration: none;
}

.detail-link:hover {
    color: var(--accent-primary);
}

.detail-subtitle {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.detail-rating__heart {
    font-size: var(--font-size); /*one level smaller than the header size*/
    color: var(--text-faded);
    font-family: var(--font-mono);
    flex-shrink: 0;
}

.detail-rating__heart--starred {
    color: var(--accent-red);
}

.detail-bio {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    max-height: 150px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-width: thin;
    scrollbar-color: var(--border-primary) var(--bg-primary);
}


.detail-bio::-webkit-scrollbar { width: 4px; }
.detail-bio::-webkit-scrollbar-track { background: var(--bg-primary); }
.detail-bio::-webkit-scrollbar-thumb { background: var(--border-primary); }

.detail-genres {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.detail-genre {
    font-size: var(--font-size-xs);
    color: var(--text-faded);
    border: 1px solid var(--border-primary);
    padding: 1px var(--space-xs);
    text-decoration: none;
    transition: color 0.1s, border-color 0.1s;
}

.detail-genre:hover {
    color: var(--accent-primary);
    border-color: var(--accent-faded);
}

.detail-link--ext {
    color: var(--text-faded);
    text-decoration: none;
}

.detail-link--ext:hover {
    color: var(--accent-primary);
}

.detail-stat {
    color: var(--text-faded);
    font-size: var(--font-size-xs);
}

.detail-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.detail-action-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: var(--font-size-xs);
    padding: var(--space-xs) var(--space-md);
    cursor: pointer;
    letter-spacing: 0.05em;
    text-align: left;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.detail-action-btn:hover {
    background: var(--bg-hover);
    color: var(--accent-primary);
    border-color: var(--accent-faded);
}

/* Track rows with per-track art (playlist view) */
.detail-tracks.track-list .track-row {
    align-items: center;
    padding: 2px 0;
}

.detail-tracks .track-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

.track-row-art {
    width: 24px;
    height: 24px;
    object-fit: cover;
    flex-shrink: 0;
    opacity: 0.8;
    align-self: center;
}

.track-row-art--blank {
    width: 24px;
    height: 24px;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

/* ============================================================================
   ALBUM GRID  (artist page — not used on home feed)
   ============================================================================ */

.album-group {
    margin-bottom: var(--space-lg);
    min-width: 0;
}

.appears-on-row {
    display: flex;
    gap: var(--space-md);
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: var(--space-md);
    min-width: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border-primary) var(--bg-primary);
}

.appears-on-row::-webkit-scrollbar { height: 4px; }
.appears-on-row::-webkit-scrollbar-track { background: var(--bg-primary); }
.appears-on-row::-webkit-scrollbar-thumb { background: var(--border-primary); }

.appears-on-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    text-decoration: none;
    flex-shrink: 0;
    width: 120px;
}

.appears-on-item__art {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border: 1px solid var(--border-subtle);
}

.appears-on-item__art--blank {
    width: 120px;
    height: 120px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
}

.appears-on-item__name {
    font-size: var(--font-size-xs);
    color: var(--text-faded);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.appears-on-item:hover .appears-on-item__name {
    color: var(--text-primary);
}

.album-group__label {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-faded);
    line-height: 1;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--border-primary);
}

.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-md);
}

.album-card a {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    color: var(--text-secondary);
}

.album-card a:hover { color: var(--accent-primary); }

.album-art {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    border: 1px solid var(--border-subtle);
    opacity: 85%;
}

.album-art:hover {
    opacity: 100%;
}

.album-card-info {
    display: flex;
    flex-direction: column;
    font-size: var(--font-size-xs);
}

.album-title { color: var(--text-secondary); display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.album-year { color: var(--text-faded); }
.album-card-heart { font-size: 0.75em; color: var(--accent-red); }
.album-card-meta {
    display: flex;
    gap: 0.75rem;
    color: var(--text-faded);
    font-size: 0.75rem;
}


/* ============================================================================
   TRACK LIST — manifest style
   ============================================================================ */

.track-list {
    list-style: none;
    padding: 0;
}

.track-row {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
    padding: var(--space-xs) 0;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    font-size: var(--font-size-sm);
}

.track-row:last-child { border-bottom: none; }

.track-row:hover { color: var(--accent-primary); }

.track-row.playing { color: var(--accent-primary); }

.track-num {
    color: var(--text-faded);
    font-size: var(--font-size-xs);
    width: 1.5rem;
    text-align: left;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.track-title { color: var(--text-secondary); flex: 1; }
.track-row:hover .track-title,
.track-row.playing .track-title { color: var(--accent-primary); }

/* dotted leader */
.track-dots {
    flex: 1;
    border-bottom: 1px dotted var(--border-primary);
    margin: 0 var(--space-xs);
    align-self: center;
    min-width: var(--space-md);
}

.track-heart {
    font-size: var(--font-size-xs);
    color: var(--accent-red);
    font-family: var(--font-mono);
    flex-shrink: 0;
    width: 2.5rem;
    text-align: right;
}

.track-duration {
    color: var(--text-faded);
    font-size: var(--font-size-xs);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
    min-width: 5rem;
    text-align: right;
}

/* ============================================================================
   CONTEXT MENU
   ============================================================================ */

.ctx-menu {
    position: fixed;
    z-index: 1000;
    list-style: none;
    margin: 0;
    padding: 4px 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    min-width: 160px;
    font-size: var(--font-size-xs);
    font-family: var(--font-mono);
}

.ctx-menu__item {
    padding: 7px 14px;
    cursor: pointer;
    color: var(--text-secondary);
    white-space: nowrap;
}

.ctx-menu__item:hover {
    background: var(--bg-hover);
    color: var(--accent-primary);
}

/* ============================================================================
   QUEUE PAGE
   ============================================================================ */

.queue-now-card {
    display: flex;
    gap: var(--space-md);
    align-items: center;
    padding: var(--space-sm) 0;
}

.queue-now-card__art {
    width: 80px;
    height: 80px;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
    border: 1px solid var(--border-subtle);
    margin-left: auto;
    order: 2;
}

.queue-now-card__art--blank {
    width: 160px;
    height: 160px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    flex-shrink: 0;
    margin-left: auto;
    order: 2;
}

.queue-now-card__info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
    order: 1;
}

.queue-now-card__title {
    font-size: var(--font-size-md, 1rem);
    color: var(--accent-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-now-card__artist {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-now-card__album {
    font-size: var(--font-size-xs);
    color: var(--text-faded);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-now-card__link {
    color: inherit;
    text-decoration: none;
}
.queue-now-card__link:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

.queue-now-card__art { cursor: pointer; }

.queue-now-card__index {
    font-size: var(--font-size-xs);
    color: var(--text-faded);
    font-variant-numeric: tabular-nums;
}

.queue-section-label {
    font-size: var(--font-size-xs);
    color: var(--text-faded);
    letter-spacing: 0.08em;
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border-subtle);
}

.queue-section-label--now {
    color: var(--accent-muted);
    margin-top: var(--space-sm);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.queue-section-label__index {
    color: var(--text-faded);
    font-variant-numeric: tabular-nums;
}

.queue-list {
    list-style: none;
    padding: 0;
}

.queue-list--history .queue-row {
    opacity: 0.4;
}

.queue-list--history .queue-row:hover {
    opacity: 0.7;
}

.queue-row {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
    padding: var(--space-xs) 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: var(--font-size-sm);
}

.queue-row:last-child { border-bottom: none; }
.queue-row { cursor: pointer; }
.queue-row:hover { background: var(--bg-hover); }
.queue-row:hover .queue-title { color: var(--accent-primary); }
.queue-row.playing { color: var(--accent-primary); }

.queue-index {
    color: var(--text-faded);
    font-size: var(--font-size-xs);
    width: 2rem;
    text-align: right;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.queue-title { color: var(--text-secondary); }
.queue-row.playing .queue-title { color: var(--accent-primary); }
.queue-artist { color: var(--text-faded); font-size: var(--font-size-xs); flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30%; }
.queue-heart { color: var(--accent-red); font-size: var(--font-size-xs); flex-shrink: 0; width: 2rem; text-align: right; }
.queue-dots {
    flex: 1;
    border-bottom: 1px dotted var(--border-primary);
    align-self: center;
    min-width: var(--space-md);
}
.queue-duration {
    color: var(--text-faded);
    font-size: var(--font-size-xs);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* ============================================================================
   SEARCH
   ============================================================================ */

.search-results {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.search-results h2 {
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border-subtle);
}

.search-results h3 {
    margin-bottom: var(--space-sm);
    font-size: var(--font-size-xs);
    color: var(--text-faded);
    letter-spacing: 0.08em;
}

.result-list {
    list-style: none;
}

.result-list li {
    padding: var(--space-xs) 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: var(--font-size-sm);
}

.result-list li:last-child { border-bottom: none; }

.search-hint, .no-results {
    color: var(--text-faded);
    font-size: var(--font-size-sm);
}

/* ============================================================================
   PLAYLIST GRID (list page)
   ============================================================================ */

.playlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-md);
}

.playlist-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    color: var(--text-secondary);
    text-decoration: none;
}

.playlist-card:hover .playlist-card-name { color: var(--accent-primary); }

.playlist-card-art {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
}

.playlist-card-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
    transition: opacity 0.15s;
}

.playlist-card:hover .playlist-card-art img { opacity: 1; }

.playlist-card-art--blank {
    width: 100%;
    height: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
}

.playlist-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.playlist-card-name {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s;
}

.playlist-card-count {
    font-size: var(--font-size-xs);
    color: var(--text-faded);
}

.pl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-md);
}

.pl-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    text-decoration: none;
}

.pl-card__art {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border: 1px solid var(--border-subtle);
}

.pl-card__art--blank {
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
}

.pl-card__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pl-card__name {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s;
}

.pl-card:hover .pl-card__name { color: var(--accent-primary); }

.pl-card__meta {
    font-size: var(--font-size-xs);
    color: var(--text-faded);
}



.track-artist {
    color: var(--text-faded);
    font-size: var(--font-size-xs);
    margin-left: var(--space-xs);
}

/* ============================================================================
   PAGE HEADER (artist/album/playlist)
   ============================================================================ */

.page-section-header {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-subtle);
}

.page-section-header h2 {
    font-size: var(--font-size-xs);
    color: var(--text-faded);
    letter-spacing: 0.08em;
    margin-bottom: var(--space-sm);
}

/* ============================================================================
   GENERIC COMPONENT HEADER  .c-header
   ============================================================================ */

.c-header {
    display: flex;
    align-items: baseline;
    gap: var(--space-xs);
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid var(--border-subtle);
}

.c-header__marker {
    color: var(--text-faded);
    font-size: var(--font-size-xs);
    flex-shrink: 0;
}

.c-header__label {
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    letter-spacing: 0.07em;
}

.c-header__nav {
    margin-left: auto;
    display: flex;
    gap: var(--space-xs);
}

/* ============================================================================
   HOME FEED ZONES
   ============================================================================ */

.feed-zone {
    margin-bottom: var(--space-xl);
}

/* ============================================================================
   TRACKLIST — extended for home feed thumbnails
   ============================================================================ */

.tracklist--with-art .track-row {
    align-items: center;
    padding: 3px 0;
}

.track-thumb {
    width: 28px;
    height: 28px;
    object-fit: cover;
    flex-shrink: 0;
    opacity: 0.8;
}

.track-thumb--blank {
    width: 28px;
    height: 28px;
    background: var(--bg-tertiary);
    flex-shrink: 0;
    display: inline-block;
}

/* ============================================================================
   PLAYLIST MOSAIC
   Five playlists: first is a tall hero (spans 2 grid rows),
   remaining four fill a 2×2 grid beside it.
   ============================================================================ */

.playlist-mosaic {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 140px 140px;
    gap: 3px;
}

.playlist-mosaic__item {
    position: relative;
    overflow: hidden;
    display: block;
    text-decoration: none;
}

.playlist-mosaic__item--hero {
    grid-row: 1 / 3;
}

.playlist-mosaic__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.72;
    transition: opacity 0.2s;
}

.playlist-mosaic__img--blank {
    width: 100%;
    height: 100%;
    background: var(--bg-tertiary);
}

.playlist-mosaic__item:hover .playlist-mosaic__img { opacity: 0.9; }

.playlist-mosaic__body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-sm) var(--space-md);
    background: linear-gradient(transparent, rgba(13,15,14,0.92));
}

.playlist-mosaic__title {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    transition: color 0.15s;
}

.playlist-mosaic__item:hover .playlist-mosaic__title { color: var(--accent-primary); }

.playlist-mosaic__item--hero .playlist-mosaic__title {
    font-size: var(--font-size-lg);
}

.playlist-mosaic__meta {
    font-size: var(--font-size-xs);
    color: var(--text-faded);
    margin-top: 2px;
}

/* ============================================================================
   BODY GRID
   Asymmetric 12-column CSS grid. Named areas declared here; cells place
   themselves by referencing area names via grid-area.
   ============================================================================ */

.feed-body {
    display: flex;
    gap: var(--space-lg);
    margin-top: var(--space-xl);
    align-items: flex-start;
}

.feed-body__main {
    flex: 2;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.feed-body__side {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

/* ============================================================================
   GENERIC CARD  .card
   Square art with text body below. Used in card grids.
   ============================================================================ */

.card {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    text-decoration: none;
    min-width: 0;
}

.card__art {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
}

.card__art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.82;
    transition: opacity 0.15s;
}

.card:hover .card__art img { opacity: 1; }

.card__art--blank {
    width: 100%;
    height: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
}

.card__body {
    padding: 0;
}

.card__marker {
    font-size: var(--font-size-xs);
    color: var(--text-faded);
    line-height: 1;
    margin-bottom: 2px;
}

.card__title {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s;
}

.card:hover .card__title { color: var(--accent-primary); }

.card__meta {
    font-size: var(--font-size-xs);
    color: var(--text-faded);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Size modifiers */
.card--lg .card__title { font-size: var(--font-size-sm); }

/* Artist modifier — portrait crop, name overlaid at bottom */
.card--artist .card__art {
    aspect-ratio: 3 / 4;
}

.card__art-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-md) var(--space-xs) var(--space-xs);
    background: linear-gradient(to top, var(--bg-primary) 0%, color-mix(in srgb, var(--bg-primary) 60%, transparent) 60%, transparent 100%);
    font-size: var(--font-size-xs);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================================
   CARD GRIDS
   ============================================================================ */

.card-grid {
    display: grid;
    gap: var(--space-sm);
}

/* Dense: exactly 5 columns */
.card-grid--dense {
    grid-template-columns: repeat(5, 1fr);
}

/* Artists: exactly 4 columns */
.card-grid--artists {
    grid-template-columns: repeat(4, 1fr);
}

/* Two-column fixed */
.card-grid--2col {
    grid-template-columns: repeat(2, 1fr);
}

/* ============================================================================
   MIX STACK — tall cards with wide art, stacked vertically
   ============================================================================ */

.mix-stack {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.mix-card {
    display: flex;
    align-items: stretch;
    gap: 0;
    text-decoration: none;
    overflow: hidden;
    position: relative;
}

.mix-card__img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    flex-shrink: 0;
    opacity: 0.8;
    transition: opacity 0.15s;
    display: block;
}

.mix-card__img--blank {
    width: 72px;
    height: 72px;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.mix-card:hover .mix-card__img { opacity: 1; }

.mix-card__body {
    padding: var(--space-xs) var(--space-sm);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.mix-card__title {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s;
}

.mix-card:hover .mix-card__title { color: var(--accent-primary); }

.mix-card__meta {
    font-size: var(--font-size-xs);
    color: var(--text-faded);
}

/* ============================================================================
   C-CAROUSEL — generic carousel component wrapper
   ============================================================================ */

.c-carousel {
    min-width: 0;
    overflow: hidden;
}

.c-tracklist {
    min-width: 0;
}

/* ============================================================================
   WIDGET PAIR — two side-by-side columns within the main feed column
   ============================================================================ */

.widget-pair {
    display: flex;
    gap: var(--space-xl);
    align-items: start;
    min-width: 0;
}

.widget-pair__left {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    flex: 0 0 auto;
    width: 220px;
}

.widget-pair__right {
    flex: 1;
    min-width: 0;
}

/* ============================================================================
   STREAK WIDGET
   ============================================================================ */

.streak-widget {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.streak-widget__number {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    color: var(--accent-primary);
    letter-spacing: -0.02em;
}

.streak-widget__unit {
    font-size: var(--font-size-xs);
    color: var(--text-faded);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.streak-widget__bar {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: var(--space-xs);
}

.streak-widget__pip {
    width: 8px;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 1px;
    flex-shrink: 0;
}

.streak-widget__pip--on {
    background: var(--accent-primary);
    opacity: 0.85;
}

/* ============================================================================
   ALBUM OF THE DAY
   ============================================================================ */

.album-of-day {
    display: flex;
    gap: var(--space-sm);
    align-items: flex-start;
    text-decoration: none;
    transition: opacity 0.15s;
}

.album-of-day:hover { opacity: 0.8; }

.album-of-day__art {
    width: 72px;
    height: 72px;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

.album-of-day__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-width: 0;
}

.album-of-day__title {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s;
}

.album-of-day:hover .album-of-day__title { color: var(--accent-primary); }

.album-of-day__artist {
    font-size: var(--font-size-xs);
    color: var(--text-faded);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.album-of-day__year {
    font-size: var(--font-size-xs);
    color: var(--border-primary);
}

/* ============================================================================
   GENRE BARS — horizontal bar chart
   ============================================================================ */

.genre-bars {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.genre-bar {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto 6px;
    column-gap: var(--space-sm);
    align-items: center;
}

.genre-bar__name {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    grid-column: 1;
    grid-row: 1;
}

.genre-bar__count {
    font-size: var(--font-size-xs);
    color: var(--text-faded);
    text-align: right;
    grid-column: 2;
    grid-row: 1;
    white-space: nowrap;
}

.genre-bar__track {
    grid-column: 1 / -1;
    grid-row: 2;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.genre-bar__fill {
    height: 100%;
    background: var(--accent-primary);
    opacity: 0.7;
    border-radius: 2px;
    min-width: 2px;
}

/* ============================================================================
   GENRE CLOUD — weighted tag cloud
   ============================================================================ */

.genre-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    align-items: baseline;
}

.genre-cloud__tag {
    color: var(--text-faded);
    line-height: 1.2;
    transition: color 0.15s;
    cursor: default;
}

.genre-cloud__tag:hover { color: var(--accent-primary); }

.genre-cloud__tag--1 { font-size: 0.65rem; opacity: 0.55; }
.genre-cloud__tag--2 { font-size: 0.75rem; opacity: 0.65; }
.genre-cloud__tag--3 { font-size: 0.85rem; opacity: 0.75; }
.genre-cloud__tag--4 { font-size: 0.95rem; opacity: 0.88; color: var(--text-secondary); }
.genre-cloud__tag--5 { font-size: 1.05rem; opacity: 1;    color: var(--text-primary); }

/* ============================================================================
   GENRE INDEX PAGE
   ============================================================================ */

.genre-index {
    padding-bottom: 20vh;
}

.genre-index-layout {
    display: flex;
    gap: var(--space-md);
    align-items: flex-start;
}

.genre-index__sections {
    flex: 1;
    min-width: 0;
}

.genre-index__sections {
    flex: 1;
    min-width: 0;
}

.genre-index__section {
    padding: var(--space-sm) 0;
    border-top: 2px solid var(--border-primary);
}

.genre-index__section:first-child {
    border-top: none;
}

.genre-row {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
    padding: 3px 0;
    border-bottom: 1px solid var(--border-subtle);
    text-decoration: none;
    transition: color 0.1s;
}

.genre-row:last-child {
    border-bottom: none;
}

.genre-row__name {
    color: var(--text-secondary);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.1s;
}

.genre-row:hover .genre-row__name {
    color: var(--accent-primary);
}

.genre-row__count {
    color: var(--text-faded);
    font-size: var(--font-size-xs);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* ============================================================================
   GENRE DETAIL PAGE
   ============================================================================ */

.genre-detail {
    padding-bottom: 20vh;
}

.genre-detail__header {
    display: flex;
    align-items: baseline;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--border-primary);
}

.genre-detail__title {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
    line-height: 1;
}

.genre-detail__count {
    font-size: var(--font-size-xs);
    color: var(--text-faded);
}
