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

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

/* Dark Mode (Default) */
:root {
    --primary: #87ae73;
    --primary-dark: #9fcf88;
    --primary-light: #a8c99a;
    --accent: #87ae73;
    --accent-dark: #9fcf88;

    --bg: #16181d;
    --bg-secondary: #20232c;
    --bg-tertiary: #3a3f4d;

    --fg: #e8e8e8;
    --text: #e8e8e8;
    --muted: #9aa0a6;
    --text-secondary: #9aa0a6;
    --text-tertiary: #767c85;

    --border: #20232c;
    --border-hover: #3a3f4d;

    --success: #6bbf7a;
    --error: #e0685f;
    --warning: #d9a441;

    --shadow-primary: rgba(135, 174, 115, 0.2);
    --shadow-sm: rgba(0, 0, 0, 0.2);
    --shadow-md: rgba(0, 0, 0, 0.35);

    --chart-bg: rgba(135, 174, 115, 0.1);
    --chart-bg-solid: rgba(135, 174, 115, 0.8);

    --overlay: rgba(0, 0, 0, 0.6);
}

/* Light Mode */
:root[data-theme="light"] {
    --primary: #3d6529;
    --primary-dark: #2d4f1c;
    --primary-light: #87ae73;
    --accent: #87ae73;
    --accent-dark: #3d6529;

    --bg: #fefefe;
    --bg-secondary: #eee;
    --bg-tertiary: #ccc;

    --fg: #0a0a0a;
    --text: #0a0a0a;
    --muted: #556270;
    --text-secondary: #556270;
    --text-tertiary: #707070;

    --border: #eee;
    --border-hover: #ccc;

    --success: #2f8a45;
    --error: #c23b32;
    --warning: #b3791f;

    --shadow-primary: rgba(61, 101, 41, 0.15);
    --shadow-sm: rgba(0, 0, 0, 0.05);
    --shadow-md: rgba(0, 0, 0, 0.1);

    --chart-bg: rgba(61, 101, 41, 0.1);
    --chart-bg-solid: rgba(61, 101, 41, 0.8);

    --overlay: rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

.site-logo {
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 1rem;
    text-decoration: none;
    display: inline-block;
}

.site-logo-small {
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace;
    font-size: 20px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

a.site-logo-small:hover {
    opacity: 0.7;
}

.logo-main {
    color: var(--text-secondary);
}

.logo-slash {
    color: var(--text-tertiary);
}

.logo-accent {
    color: #00A3FF;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* ── Persistent sticky header ─────────────────────────────────────── */
.site-header-sticky {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-secondary);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.site-header-sticky-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.search-open-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--fg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: color 0.12s;
}
.search-open-btn:hover { color: var(--accent-dark); }
.search-open-btn i[data-lucide] { width: 18px; height: 18px; }

/* ── View transition ──────────────────────────────────────────────── */
@keyframes viewFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Search modal ─────────────────────────────────────────────────── */
.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
}
.search-overlay[hidden] { display: none; }
.search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.search-modal {
    position: relative;
    z-index: 1;
    width: min(600px, calc(100vw - 2rem));
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,0.3);
    animation: searchSlideIn 0.15s ease;
}
@keyframes searchSlideIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0)  scale(1); }
}
.search-input-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}
.search-modal-icon { width: 18px; height: 18px; color: var(--text-tertiary); flex-shrink: 0; }
.search-modal-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-size: 1rem;
    color: var(--text);
    font-family: inherit;
}
.search-modal-input::placeholder { color: var(--text-tertiary); }
.search-esc-hint {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    font-family: inherit;
    flex-shrink: 0;
}
.search-modal-results { max-height: 420px; overflow-y: auto; }
.search-modal-results:empty { display: none; }
.search-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    padding: 0.6rem 1rem 0.25rem;
}
.search-result-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
    text-decoration: none;
    color: inherit;
}
.search-result-row:last-child { border-bottom: none; }
.search-result-row:hover,
.search-result-row.kb-focused { background: var(--bg-tertiary); }
.search-result-thumb {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-tertiary);
}
.search-result-thumb.round { border-radius: 50%; }
.search-result-text { flex: 1; min-width: 0; }
.search-result-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-result-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}
.search-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.year-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.year-link:hover {
    text-decoration: underline;
}

.year-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.year-nav-arrow {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    transition: color 0.2s;
}

.year-nav-arrow:hover:not(:disabled) {
    color: var(--primary);
}

.year-nav-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.year-select-hero {
    background: transparent;
    color: var(--text);
    border: none;
    font-size: 3rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
    text-align: center;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.year-select-hero:hover {
    color: var(--primary);
}

.year-select-hero:focus {
    outline: none;
    color: var(--primary);
}

@media (max-width: 768px) {
    .year-navigation {
        gap: 1rem;
    }

    .year-nav-arrow {
        font-size: 1.5rem;
        padding: 0.25rem 0.5rem;
    }

    .year-select-hero {
        font-size: 2rem;
    }
}

/* Genre tags */
.genre-list {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0.35rem 0 0.75rem;
    line-height: 1.6;
    text-align: left;
}

/* External service links (Spotify, MusicBrainz, AOTY) */
.release-links {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    margin: 0 0 0.75rem;
}

.release-link-icon {
    display: flex;
    align-items: center;
    opacity: 0.55;
    transition: opacity 0.15s ease;
}

.release-link-icon:hover {
    opacity: 1;
}

.release-link-icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
}

/* SVG icons via CSS mask — allows brand color on hover */
.link-icon-mask {
    display: block;
    width: 20px;
    height: 20px;
    background-color: var(--text);
    -webkit-mask: var(--icon-url) center / contain no-repeat;
    mask: var(--icon-url) center / contain no-repeat;
    transition: background-color 0.15s ease;
}

.release-link-icon[data-service="spotify"]:hover .link-icon-mask {
    background-color: #1ED760;
}

.release-link-icon[data-service="musicbrainz"]:hover .link-icon-mask {
    background-color: #BA478F;
}

.release-link-icon[data-service="wikipedia"]:hover .link-icon-mask {
    background-color: #000000;
}

.release-link-icon[data-service="applemusic"]:hover .link-icon-mask {
    background-color: #FA243C;
}

.release-link-icon[data-service="deezer"]:hover .link-icon-mask {
    background-color: #A238FF;
}

.release-link-icon[data-service="tidal"]:hover .link-icon-mask {
    background-color: #000000;
}

.release-link-icon[data-service="bandcamp"]:hover .link-icon-mask {
    background-color: #408294;
}

.release-link-icon[data-service="beatport"]:hover .link-icon-mask {
    background-color: #01FF95;
}

.release-link-icon[data-service="genius"]:hover .link-icon-mask {
    background-color: #FFFF64;
}
}

/* ── Release stats — nerds-list style ────────────────────────────── */
.release-stats-table {
    margin: 0.5rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}
/* Each pair holds two stat cells side-by-side */
.rst-pair {
    display: flex;
    border-bottom: 1px solid var(--border);
}
.rst-pair:last-child { border-bottom: none; }
.rst-pair .rst-row {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.22rem 0.6rem;
    gap: 0.5rem;
    min-width: 0;
}
.rst-pair .rst-row:first-child { border-right: 1px solid var(--border); }
/* Odd-row-count: last lone cell fills full width */
.rst-pair .rst-row:only-child { border-right: none; }
/* Genre row spans full width */
.release-stats-table .rst-genres-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0.3rem 0.6rem;
    gap: 0.4rem;
    border-bottom: none;
}
.release-stats-table .rst-genres-row .rst-value {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    justify-content: flex-end;
    font-weight: normal;
}
.release-stats-table .rst-row:last-child { border-bottom: none; }
.release-stats-table .rst-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}
.release-stats-table .rst-value {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
    text-align: right;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Genre pills inside stats table — all-caps, snug, like release-type-badge */
.stat-genre-tag {
    display: inline-block;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    border-radius: 3px;
    padding: 0.08rem 0.3rem;
    white-space: nowrap;
    text-decoration: none;
    transition: color 0.12s, border-color 0.12s;
}
.stat-genre-tag:hover { color: var(--primary); }
.stat-genre-tag.is-primary {
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.stat-genre-tag.is-primary:hover { color: var(--primary); border-color: var(--primary); }

/* Hide standalone genre list when genres are shown inside the stats table.
   Uses !important to beat the higher-specificity #releaseHeader .genre-list rule. */
.release-header-grid #releaseGenres { display: none !important; }

/* ── External link pill stack ─────────────────────────────────────── */
.release-link-pills {
    display: flex;
    flex-direction: column;
    width: 152px;
    flex-shrink: 0;
    border-left: 1px solid var(--border);
}

/* Service colour tokens */
.pill-spotify     { --svc: #1ED760; }
.pill-apple       { --svc: #FA243C; }
.pill-deezer      { --svc: #A238FF; }
.pill-tidal       { --svc: #94a3b8; }
.pill-beatport    { --svc: #01FF95; }
.pill-bandcamp    { --svc: #408294; }
.pill-musicbrainz { --svc: #BA478F; }
.pill-wikipedia   { --svc: #94a3b8; }
.pill-aoty        { --svc: #f97316; }
.pill-genius      { --svc: #FFFF64; }

:root[data-theme="light"] .pill-beatport { --svc: #007a4a; }
:root[data-theme="light"] .pill-genius   { --svc: #7a6e00; }

.release-link-pill, button.release-link-pill {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0 0.75rem;
    min-height: 30px;
    text-decoration: none;
    border: none;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    width: 100%;
    cursor: pointer;
    text-align: left;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    transition: background 0.1s;
}
.release-link-pill:last-child,
.pill-variant-group:last-child + * { border-bottom: none; }
.release-link-pill::after {
    content: '';
    position: absolute; inset: 0;
    background: var(--svc, transparent);
    opacity: 0.05;
    pointer-events: none;
    transition: opacity 0.12s;
}
.release-link-pill:hover::after { opacity: 0.12; }
.release-link-pill::before {
    content: '';
    position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: var(--svc, transparent);
    opacity: 0; transition: opacity 0.12s; z-index: 1;
}
.release-link-pill:hover::before,
.release-link-pill.expanded::before { opacity: 1; }
.release-link-pill.expanded::after  { opacity: 0.08; }

.pill-icon {
    width: 18px; height: 18px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    position: relative; z-index: 1;
}
.pill-mask {
    display: block;
    width: 16px; height: 16px;
    background: var(--svc, var(--text-secondary));
    -webkit-mask-size: contain; mask-size: contain;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center; mask-position: center;
}
.pill-spotify     .pill-mask { -webkit-mask-image: url('images/links/spotify.svg');     mask-image: url('images/links/spotify.svg'); }
.pill-apple       .pill-mask { -webkit-mask-image: url('images/links/applemusic.svg');  mask-image: url('images/links/applemusic.svg'); }
.pill-deezer      .pill-mask { -webkit-mask-image: url('images/links/deezer.svg');      mask-image: url('images/links/deezer.svg'); }
.pill-tidal       .pill-mask { -webkit-mask-image: url('images/links/tidal.svg');       mask-image: url('images/links/tidal.svg'); }
.pill-beatport    .pill-mask { -webkit-mask-image: url('images/links/beatport.svg');    mask-image: url('images/links/beatport.svg'); }
.pill-bandcamp    .pill-mask { -webkit-mask-image: url('images/links/bandcamp.svg');    mask-image: url('images/links/bandcamp.svg'); }
.pill-musicbrainz .pill-mask { -webkit-mask-image: url('images/links/musicbrainz.svg');mask-image: url('images/links/musicbrainz.svg'); }
.pill-wikipedia   .pill-mask { -webkit-mask-image: url('images/links/wikipedia.svg');   mask-image: url('images/links/wikipedia.svg'); }
.pill-genius      .pill-mask { -webkit-mask-image: url('images/links/genius.svg');      mask-image: url('images/links/genius.svg'); }
.pill-aoty-img    { width: 16px; height: 16px; object-fit: contain; border-radius: 2px; position: relative; z-index: 1; }

.pill-text {
    display: flex; flex-direction: column; min-width: 0; flex: 1;
    position: relative; z-index: 1;
}
.pill-service-name {
    font-size: 0.72rem; font-weight: 600; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pill-sub {
    font-size: 0.62rem; color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin-top: 1px;
}
.pill-ext {
    width: 9px; height: 9px; flex-shrink: 0; opacity: 0.22;
    fill: none; stroke: currentColor; stroke-width: 2;
    margin-left: auto; position: relative; z-index: 1;
}
.pill-chevron {
    width: 10px; height: 10px; flex-shrink: 0; opacity: 0.4;
    fill: none; stroke: currentColor; stroke-width: 2.5;
    margin-left: auto; position: relative; z-index: 1;
    transition: transform 0.18s;
}
.release-link-pill.expanded .pill-chevron { transform: rotate(180deg); }

.pill-variant-group { display: none; flex-direction: column; }
.pill-variant-group.open { display: flex; }
.pill-variant-row {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0 0.75rem 0 2rem;
    min-height: 24px;
    text-decoration: none;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    position: relative; overflow: hidden;
    transition: background 0.1s;
}
.pill-variant-row::after {
    content: ''; position: absolute; inset: 0;
    background: var(--svc, transparent); opacity: 0.03; pointer-events: none;
    transition: opacity 0.12s;
}
.pill-variant-row:hover::after { opacity: 0.09; }
.pill-variant-name {
    font-size: 0.68rem; color: var(--text-secondary); flex: 1;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    position: relative; z-index: 1;
}
.pill-variant-ext {
    width: 8px; height: 8px; flex-shrink: 0; opacity: 0.2;
    fill: none; stroke: currentColor; stroke-width: 2;
    margin-left: auto; position: relative; z-index: 1;
}

/* ── Variant section: slim header ──────────────────────────────────── */
.variant-section-header {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.55rem 1.5rem 0.55rem 0;
}
.variant-section-title {
    font-size: 0.74rem; font-weight: 600; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.06em;
}
.variant-section-title a { color: inherit; text-decoration: none; }
.variant-section-title a:hover { color: var(--primary); }
.variant-section-service {
    margin-left: auto; display: flex; align-items: center; gap: 0.3rem;
    font-size: 0.68rem; color: var(--text-tertiary);
}
.variant-service-icon {
    display: block; width: 11px; height: 11px;
    -webkit-mask-size: contain; mask-size: contain;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center; mask-position: center;
    background: var(--text-tertiary); opacity: 0.55;
}
.vsi-spotify { -webkit-mask-image: url('images/links/spotify.svg'); mask-image: url('images/links/spotify.svg'); }

.genre-tag {
    color: var(--text-secondary);
    text-decoration: none;
}

.genre-tag:hover {
    color: var(--primary);
    text-decoration: underline;
}

.genre-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.125rem;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    margin: 0 0 0.5rem;
}

.genre-breadcrumb svg {
    width: 0.875rem;
    height: 0.875rem;
    flex-shrink: 0;
    vertical-align: middle;
}

.bc-sep {
    color: var(--text-tertiary);
    opacity: 0.5;
    margin: 0 0.15rem;
}

.bc-home {
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.bc-home:hover {
    opacity: 1;
}

.bc-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0 0.1rem;
    transition: color 0.15s;
}

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

.bc-dot {
    color: var(--text-tertiary);
    margin: 0 0.1rem;
}

.bc-current {
    color: var(--text-primary);
}

.genre-tag-secondary {
    color: var(--text-tertiary);
}

.genre-year-count {
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

/* Release page specific styles */
.release-artist {
    font-size: 1.15rem;
    color: var(--text);
    margin: 0.25rem 0 0.3rem 0;
    text-align: left;
}

.release-artist a,
.release-artist-link {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-style: dashed;
    text-underline-offset: 3px;
}

.release-artist a:hover,
.release-artist-link:hover {
    text-decoration-style: solid;
}

.release-aka {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 0.3rem 0;
    text-align: left;
}

.release-meta-line {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 0.3rem 0;
    text-align: left;
}

.release-listen-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 0.4rem 0;
    align-items: center;
}

.release-listen-stats .stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border: none;
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    white-space: nowrap;
}

.release-listen-stats .stat-chip i[data-lucide] {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.release-type-badge {
    display: inline-block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    margin-right: 0.3rem;
    vertical-align: middle;
}

.release-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.release-footer-row .genre-list,
.release-footer-row .release-links {
    margin: 0;
}

/* Genre chips — scoped to release header only */
#releaseHeader .genre-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0;
    line-height: normal;
}

#releaseHeader .genre-tag {
    display: inline-flex;
    padding: 0.15rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s;
}

#releaseHeader .genre-tag:hover {
    border-color: var(--primary);
    color: var(--primary);
    text-decoration: none;
}

#releaseHeader .genre-tag.genre-tag-secondary {
    color: var(--text-tertiary);
    border-color: var(--bg-tertiary);
}

.release-meta-footer .aoty-scores {
    margin-top: 0;
}

.aoty-scores {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.aoty-score-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    min-width: 60px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s;
}

a.aoty-score-block:hover {
    border-color: var(--primary);
}

.aoty-score-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    line-height: 1.2;
}

.aoty-score-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.aoty-score-count {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-top: 0.15rem;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    text-align: center;
    transition: all 0.2s;
}

a.stat-card {
    text-decoration: none;
    color: inherit;
    display: block;
}

a.stat-card .stat-label::after {
    content: ' ›';
    color: var(--text-tertiary);
    transition: color 0.2s;
}

a.stat-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-primary);
}

a.stat-card:hover .stat-label::after {
    color: var(--primary);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Artist Hero Banner */
.artist-hero {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    height: 520px;
    overflow: hidden;
    border-radius: 0;
    margin-bottom: -60px;
}

.artist-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    display: block;
}

.artist-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
        transparent 40%,
        var(--bg) 90%
    );
    pointer-events: none;
}

@media (max-width: 768px) {
    .artist-hero {
        height: 300px;
        margin-bottom: -40px;
    }
}

/* Artist Header Layout */
.artist-header-layout {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
}

/* Release pages have more content rows — anchor to top instead of centering */
#releaseHeader,
#artistHeader {
    align-items: flex-start;
}

#releaseHeader h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

/* Release header — 3-column grid: art | info | pills */
.release-header-grid {
    display: grid !important;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 0;
    padding: 0 !important;
    overflow: hidden;
}
.release-header-grid .artist-photo-container {
    width: auto;
    padding: 1.5rem;
    align-self: start;
}
.release-header-grid .artist-info-container {
    padding: 1.25rem 1.25rem 1.25rem 1rem;
    min-width: 0;
}

/* 256px album art on desktop */
.artist-photo-container {
    flex-shrink: 0;
    width: 256px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.artist-photo {
    width: 256px;
    height: 256px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg);
    border: 2px solid var(--border);
}

.artist-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.artist-photo svg {
    width: 100%;
    height: 100%;
}

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

.artist-name-row {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.artist-info-container h1 {
    font-size: 2.5rem;
    margin-bottom: 0;
    color: var(--text);
    text-align: left;
    background: none;
    -webkit-text-fill-color: inherit;
}

.artist-romanized {
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.artist-aka {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    margin: 0;
    font-style: italic;
}

.artist-members {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
}

.artist-members-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-right: 0.15rem;
}

.artist-member-chip {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s;
}

.artist-member-chip:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.release-via-artist {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-style: italic;
}

.artist-info-container .subtitle {
    text-align: left;
}

.artist-disambiguation {
    font-size: 0.95rem;
    font-style: italic;
    color: var(--text-tertiary);
    margin: -0.5rem 0 0.5rem 0;
    text-align: left;
}

.artist-meta-line {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 0.75rem 0;
    text-align: left;
}

.artist-meta-line span + span::before {
    content: ' · ';
    color: var(--text-tertiary);
}

.release-link-score {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.release-link-score svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.release-links-sep {
    color: var(--text-tertiary);
    user-select: none;
}

.artist-header-layout.has-hero {
    background: none;
    border-color: transparent;
    padding-left: 0;
    padding-right: 0;
}

.stats-compact {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.stat-item .stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary);
}

.stat-item .stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stats-compact .stat-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
}

.stats-compact .stat-item .stat-value {
    margin-bottom: 0;
}

/* Search */
.nerds-section { }
.nerds-list {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.nerds-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
}
.nerds-row:last-of-type { border-bottom: none; }
.nerds-row dt {
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.nerds-row dd {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.nerds-accordion {
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    padding: 0.5rem 0.75rem 0.5rem 1rem;
}
.nerds-accordion ul {
    margin: 0;
    padding: 0;
    list-style: none;
    columns: 2;
    column-gap: 1.5rem;
}
.nerds-accordion li { break-inside: avoid; }
.nerds-accordion a {
    display: block;
    padding: 0.15rem 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-decoration: none;
}
.nerds-accordion a:hover { color: var(--primary); }
.nerds-accordion-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.1rem 0.25rem;
    cursor: pointer;
    color: var(--text-tertiary);
    display: inline-flex;
    align-items: center;
    transition: border-color 0.15s, color 0.15s;
}
.nerds-accordion-btn svg { width: 13px; height: 13px; }
.nerds-accordion-btn:hover,
.nerds-accordion-btn.nerds-accordion-btn-open { border-color: var(--primary); color: var(--primary); }
.tooltip-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
    color: var(--text-tertiary);
}
.tooltip-wrap svg { width: 11px; height: 11px; }
.tooltip-wrap::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.72rem;
    line-height: 1.4;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.15s;
}
.tooltip-wrap:hover::after { opacity: 1; }

.search-section {
    margin-bottom: 3rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.search-col {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

@media (max-width: 768px) {
    .search-section {
        grid-template-columns: 1fr;
    }
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-top: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
    z-index: 10;
    display: none;
}

.search-results.active {
    display: block;
}

.search-result-item {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover,
.search-result-item.keyboard-focused {
    background: var(--bg);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-main {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
}

.search-result-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

.search-result-meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.15rem;
}

.search-result-alias {
    color: var(--text-tertiary);
    font-style: italic;
    font-weight: 400;
}


.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.section-header h2 {
    margin: 0;
}

.year-section {
    margin-top: 2.5rem;
}

.sort-controls {
    display: flex;
    gap: 0.25rem;
    background: var(--bg);
    padding: 0.25rem;
    border-radius: 6px;
}

.sort-btn {
    padding: 0.5rem 0.75rem;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    min-width: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.sort-btn svg {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
}

.sort-btn:hover {
    background: var(--bg-secondary);
}

.sort-btn.active {
    background: var(--primary);
    color: #1a2d13;
}

:root[data-theme="light"] .sort-btn.active {
    background: #87ae73;
    color: #1a2d13;
}

.year-filter-select {
    appearance: none;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: none;
    border-radius: 4px;
    padding: 0.45rem 1.8rem 0.45rem 0.65rem;
    font-size: 0.82rem;
    font-family: inherit;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    line-height: 1;
    transition: color 0.15s;
}
.year-filter-select:hover { color: var(--text-primary); }
.year-filter-select:focus { outline: none; box-shadow: 0 0 0 2px var(--primary); }

.controls-dimmed {
    opacity: 0.35;
    pointer-events: none;
    user-select: none;
}

/* Image Grid */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

/* Wide Grid (List mode) */
.wide-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.wide-grid .release-card {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .wide-grid {
        grid-template-columns: 1fr;
    }
}

/* Discography */
.disc-section {
    margin-top: 2rem;
}

/* ── Recommendations view ─────────────────────────────────────────── */
.rec-header { margin-bottom: 2rem; }
.rec-shelves { display: flex; flex-direction: column; }
.rec-shelf { padding: 2rem 0; border-top: 1px solid var(--border); }
.rec-shelf:first-child { border-top: none; padding-top: 0; }
.rec-shelf-header { margin-bottom: 0.75rem; }
.rec-shelf-header h2 { margin-bottom: 0.2rem; font-size: 1.25rem; }
.rec-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0 0 0.75rem;
    font-style: italic;
}
.home-see-all {
    font-size: 0.82rem;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
}
.home-see-all:hover { text-decoration: underline; }

/* ── Recommendations card streaming link (Option B, SHOW_STREAMING_LINKS) ── */
.disc-card-streaming {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    opacity: 0;
    transition: opacity 0.15s;
    text-decoration: none;
}
.disc-card:hover .disc-card-streaming { opacity: 1; }
.disc-card-streaming-icon {
    display: block;
    width: 14px;
    height: 14px;
    background: #1ED760;
    -webkit-mask-image: url('images/links/spotify.svg');
    mask-image: url('images/links/spotify.svg');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

/* ── Recommendations shelf counts ─────────────────────────────────────────── */
/* SHELF_MOBILE = 6 — hide cards beyond the 6th on small screens */
@media (max-width: 768px) {
    .disc-card-streaming { display: none; }
    .rec-shelf .disc-card:nth-child(n+7),
    #homeRecsSection .disc-card:nth-child(n+7) { display: none; }
}

.disc-group {
    margin-bottom: 2.5rem;
}

.disc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.disc-card {
    display: block;
    text-decoration: none;
    color: inherit;
    position: relative;
    transition: transform 0.3s;
    cursor: pointer;
}

.disc-card:hover {
    transform: scale(1.05);
    z-index: 10;
}

.disc-card-img {
    width: 100%;
    aspect-ratio: 1;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-secondary);
    border-radius: 4px;
}

.disc-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
}

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

.disc-card-title {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}

.disc-card-sub {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.15rem;
}

.disc-card.unplayed .disc-card-img {
    filter: grayscale(1) opacity(0.45);
    transition: filter 0.2s;
}

.disc-card.unplayed:hover .disc-card-img {
    filter: none;
}

/* Donut completion indicator */
.donut-wrap {
    position: relative;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    cursor: default;
}

.donut {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        var(--c, var(--primary)) calc(var(--p, 0) * 1%),
        var(--border) calc(var(--p, 0) * 1%)
    );
}

.donut::after {
    content: '';
    position: absolute;
    inset: 8px;
    background: var(--bg-secondary);
    border-radius: 50%;
}

.donut-wrap[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 10;
}

.donut-wrap:hover::before {
    opacity: 1;
}

.disc-sort-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 0.25rem;
}

/* Page Controls */
.page-controls {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.control-block {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.control-block-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    font-weight: 500;
    padding-left: 0.25rem;
}

/* Collage Grid */
.collage-grid {
    display: grid;
    gap: 0;
}

.collage-grid .image-card {
    border-radius: 0;
    border: none;
}

/* Captioned collage theme: a bold label bar pinned to the bottom of each
   cell, always visible (unlike .image-card-overlay's hover-only reveal
   used elsewhere on the site). */
.image-card-collage-label {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.35rem 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Topster collage theme: black background, a left column of step-pyramid
   tiers (largest tiles first) and a right column of monospace text lines
   grouped to match each tier — mirrors the Last.fm-community "Topster"
   chart format. */
.topster-layout {
    display: flex;
    gap: 2rem;
    background: #000;
    padding: 1.5rem;
    border-radius: 8px;
    align-items: flex-start;
}
.topster-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 0 0 auto;
}
.topster-tier {
    display: grid;
    gap: 0;
}
.topster-cell {
    border-radius: 0;
    border: none;
}
.topster-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    color: #fff;
    font-family: ui-monospace, 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 0.75rem;
    line-height: 1.6;
    min-width: 0;
}
.topster-list-block {
    display: flex;
    flex-direction: column;
}
.topster-list-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.track-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    min-width: 0;
}

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

.track-row-thumb {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    background-color: var(--bg-tertiary);
}

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

.track-row-name {
    font-weight: 600;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.track-row-artist {
    color: var(--text-secondary);
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.track-row-stats {
    color: var(--text-secondary);
    font-size: 0.8rem;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

/* BPM column shares all base styles with the plays column */
.tracklist-bpm,
.tracklist-plays {
    font-size: 0.8rem;
    color: var(--text-secondary);
    min-width: 2.5rem;
    text-align: right;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
}

.tracklist-col-header .tracklist-bpm,
.tracklist-col-header .tracklist-plays {
    color: var(--text-tertiary, var(--text-secondary));
}

.tracklist-col-header .tracklist-bpm svg,
.tracklist-col-header .tracklist-plays svg {
    width: 0.85rem;
    height: 0.85rem;
}

.af-bars {
    margin-top: 0.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.af-bar-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.af-bar-label {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    width: 2.8rem;
    flex-shrink: 0;
}

.af-bar-track {
    flex: 1;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
    min-width: 60px;
}

.af-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .track-two-col {
        grid-template-columns: 1fr;
    }
}

.tracklist {
    /* scrollable if needed: overflow-y: auto; max-height: 600px; */
}

.tracklist-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 1.5rem 0.45rem 0;
    border-bottom: 1px solid var(--border);
    min-width: 0;
}

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

.tracklist-num {
    min-width: 1.5rem;
    text-align: right;
    color: var(--text-secondary);
    font-size: 0.8rem;
    flex-shrink: 0;
}

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

.tracklist-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.tracklist-name {
    font-size: 0.875rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.tracklist-duration {
    font-size: 0.75rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.tracklist-col-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding-bottom: 0.3rem;
    padding-right: 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.1rem;
}

.tracklist-alias {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.1rem;
}

.tracklist-track-artists {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 0.1rem;
}

.tracklist-eti {
    color: var(--text-tertiary, var(--text-secondary));
}

.tracklist-artist-link {
    color: var(--text-secondary);
    text-decoration: underline;
    text-decoration-style: dashed;
    text-underline-offset: 3px;
}
.tracklist-artist-link:hover {
    color: var(--primary);
    text-decoration-style: solid;
}

.tracklist-feat {
    color: var(--text-tertiary, var(--text-secondary));
    font-style: italic;
}

.tracklist-row.has-track-artists {
    align-items: flex-start;
}
.tracklist-row.has-track-artists .tracklist-num,
.tracklist-row.has-track-artists .tracklist-bpm,
.tracklist-row.has-track-artists .tracklist-plays {
    padding-top: 0.15rem;
}

.tracklist-disc-header {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding: 0.75rem 0 0.25rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.1rem;
}

.image-card {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}

.image-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px var(--shadow-primary);
    z-index: 10;
}

.image-card-img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.image-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.7) 70%, transparent);
    padding: 1rem;
    color: white;
}

.image-card-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.image-card-artist {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-card-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
}

.image-card-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Release Card */
.release-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.release-card:hover {
    transform: translateX(4px);
    border-color: var(--primary);
}

.release-card-thumb {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
    background-color: var(--border);
    flex-shrink: 0;
}

.release-card-thumb.rounded {
    border-radius: 50%;
}

.release-card-body {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "name stats"
        "meta stats";
    row-gap: 0.3rem;
    column-gap: 0.75rem;
    flex: 1;
    min-width: 0;
    align-content: center;
}

.release-name {
    grid-area: name;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.release-meta {
    grid-area: meta;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
}

.release-year {
    color: var(--text-secondary);
    font-size: 0.8rem;
    white-space: nowrap;
}

.release-type-label {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    white-space: nowrap;
    text-transform: lowercase;
}

.release-type {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* === Badge System === */
.badge-cert,
.badge-medal,
.badge-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    cursor: default;
}

/* Shine sweep on hover — medals only */
.badge-medal::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 35%,
        rgba(255, 255, 255, 0.35) 50%,
        transparent 65%
    );
    transform: translateX(-150%);
    transition: none;
    pointer-events: none;
}
.badge-medal:hover::after {
    transform: translateX(150%);
    transition: transform 0.55s ease;
}

/* Certification — colored outline, no fill */
.badge-cert {
    padding: 0.15rem 0.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1.5px solid;
    background: transparent;
    width: 100%;
}
.badge-cert-gold     { border-color: #c9a227; color: #c9a227; }
.badge-cert-platinum { border-color: #aab4be; color: #aab4be; }
.badge-cert-diamond  { border-color: #67a1fd; color: #67a1fd; }

/* Type badge (Solo / Band / Supergroup) */
.badge-type {
    gap: 0.3rem;
    padding: 0.15rem 0.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1.5px solid;
    background: transparent;
}
.badge-type svg { width: 12px; height: 12px; flex-shrink: 0; }
.badge-type-solo       { border-color: var(--text-secondary); color: var(--text-secondary); }
.badge-type-band       { border-color: var(--text-secondary); color: var(--text-secondary); }
.badge-type-supergroup { border-color: var(--primary);        color: var(--primary); }

/* Medal — solid fill, two-line (#rank / year) */
.badge-medal {
    flex-direction: column;
    gap: 0;
    padding: 0.2rem 0.45rem;
    min-width: 2rem;
    line-height: 1.15;
}
.badge-medal .medal-rank { font-size: 0.625rem; font-weight: 700; }
.badge-medal .medal-year { font-size: 0.5rem;   font-weight: 400; opacity: 0.85; }
.badge-medal-gold   { background: #c9a227; color: #3d2a00; }
.badge-medal-silver { background: #aab4be; color: #1a2020; }
.badge-medal-bronze { background: #cd7f32; color: #2d1500; }

/* Slim year pills for "Peak years" stats row */
.peak-year-pill {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    border-radius: 3px;
    padding: 0.05rem 0.28rem;
    white-space: nowrap;
    line-height: 1.4;
}
.peak-year-gold   { background: #c9a227; color: #3d2a00; }
.peak-year-silver { background: #aab4be; color: #1a2020; }
.peak-year-bronze { background: #cd7f32; color: #2d1500; }
.badge-streak {
    display: inline-flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 0.15rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 4px;
    letter-spacing: 0.03em;
    background: transparent;
    border: 1.5px solid var(--primary-light);
    color: var(--primary-light);
    cursor: default;
}

/* Badge row on artist page */
.artist-badges {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

/* Release cert dot on thumbnail */
.release-cert-dot {
    position: absolute;
    bottom: 3px;
    right: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid rgba(0,0,0,0.35);
}
.release-cert-dot-gold     { background: #c9a227; }
.release-cert-dot-platinum { background: #aab4be; }
.release-cert-dot-diamond  { background: #67a1fd; }

/* === Pulse Section === */
.pulse-section h2 {
    margin-bottom: 0.75rem;
}
.tracks-section h2 {
    margin-bottom: 0;
}
.pulse-rows {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.pulse-row {
    display: grid;
    grid-template-columns: 2.5rem 3rem 1fr 1rem;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 4px;
    padding: 0.15rem 0.25rem;
    transition: background 0.15s;
}
.pulse-row:hover { background: var(--bg-secondary); }
.pulse-row.expanded { background: var(--bg-secondary); }
.pulse-year  { color: var(--text-secondary); font-weight: 600; }
.pulse-count { color: var(--text-secondary); text-align: right; font-variant-numeric: tabular-nums; }
.pulse-chevron {
    color: var(--text-tertiary);
    font-size: 0.6rem;
    transition: transform 0.2s;
    text-align: center;
    user-select: none;
}
.pulse-row.expanded .pulse-chevron { transform: rotate(90deg); }
.pulse-bar-track {
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
}
.pulse-row.expanded .pulse-bar-track { background: var(--border); }
.pulse-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.4s ease;
    min-width: 2px;
}

/* Monthly expansion rows */
.pulse-monthly {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.3rem 0 0.4rem 1.5rem;
}
.pulse-month-row {
    display: grid;
    grid-template-columns: 2.5rem 2.5rem 1fr;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.72rem;
}
.pulse-month-name  { color: var(--text-tertiary); }
.pulse-month-count { color: var(--text-tertiary); text-align: right; font-variant-numeric: tabular-nums; }
.pulse-month-bar-track {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}
.pulse-month-bar-fill {
    height: 100%;
    background: var(--primary);
    opacity: 0.55;
    border-radius: 2px;
    min-width: 1px;
}

/* === Genre Commit Graph === */
#genreCommitsSection {
    margin-bottom: 2.5rem;
}
.commits-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.commits-header h2 { margin-bottom: 0; }
.commits-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    padding: 3px 9px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
    line-height: 1;
}
.commits-mode-btn svg { width: 11px; height: 11px; }
.commits-mode-btn:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}
.commits-grid {
    /* grid-template-columns set dynamically in JS */
    display: grid;
    --commit-cell-w: 24px;
    gap: 3px;
    user-select: none;
}
.commit-year-label {
    font-size: 0.6rem;
    color: var(--text-tertiary);
    text-align: center;
    padding-bottom: 2px;
    line-height: 1;
}
.commit-month-label {
    font-size: 0.6rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 4px;
    line-height: 1;
}
.commit-cell {
    width: var(--commit-cell-w, 24px);
    height: 16px;
    border-radius: 2px;
}
.commit-has-data {
    cursor: default;
    transition: opacity 0.1s;
}
.commit-has-data:hover {
    opacity: 0.75;
    outline: 1.5px solid var(--text-secondary);
    outline-offset: 1px;
}
.commit-empty {
    background: var(--border);
    opacity: 0.35;
}
.commit-future {
    background: transparent;
}

/* Floating tooltip */
.commit-tooltip {
    position: fixed;
    display: none;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 13px;
    font-size: 0.8125rem;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    min-width: 160px;
    max-width: 220px;
}
.ctt-header {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.ctt-count {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    margin-bottom: 7px;
}
.ctt-genres {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.ctt-genre {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.ctt-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.ctt-name {
    flex: 1;
    color: var(--text-primary);
}
.ctt-pct {
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
}

/* === Stats Row (Pulse + Recent Plays side-by-side) === */
.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
    align-items: start;
}
.stats-row > section { min-width: 0; }
.stats-row > section[hidden] {
    display: none;
}
.stats-row > section:only-child,
.stats-row > section:first-child:last-of-type,
.stats-row > section:not([hidden]):first-child:has(~ section[hidden]),
.stats-row > section[hidden] ~ section:not([hidden]):last-child {
    grid-column: 1 / -1;
}
@media (max-width: 700px) {
    .stats-row { grid-template-columns: 1fr; }
    .commits-grid { --commit-cell-w: 18px; gap: 2px; }
    .nerds-accordion ul { columns: 1; }
}

/* Insights groups (Stats page) — a cluster of related stat-section cards.
   Two grid variants: halves (2-up, for sections with many rows — language,
   era, country, recency) and thirds (3-up, for compact sections — bar
   charts, stat cards, segmented bars). Both auto-wrap extra items onto new
   rows and collapse to one column on narrow screens. */
.insights-group { margin: 2.5rem 0; }
.insights-grid { display: grid; gap: 2rem; align-items: start; }
.insights-grid > .stat-section { min-width: 0; margin-bottom: 0; }
.insights-grid--halves { grid-template-columns: 1fr 1fr; }
.insights-grid--thirds { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) {
    .insights-grid--thirds { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .insights-grid--halves,
    .insights-grid--thirds { grid-template-columns: 1fr; }
}

/* === Recent Plays === */
/* ── Shared virtual-scroll container ──────────────────────────────────────── */
.list-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 1.5rem;
    align-items: start;
}
.view-sidebar {
    position: sticky;
    top: 4rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.sidebar-section {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}
.sidebar-section:last-child { border-bottom: none; }
.sidebar-heading {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-tertiary);
    margin: 0 0 0.5rem;
}
.sidebar-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.18rem 0;
    font-size: 0.78rem;
}
.sidebar-row-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    text-decoration: none;
}
a.sidebar-row-name:hover { color: var(--primary); text-decoration: underline; }
.sidebar-row-count {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    flex-shrink: 0;
}
@media (max-width: 768px) {
    .list-with-sidebar { grid-template-columns: 1fr; }
    .view-sidebar { display: none; }
}
.list-scroll {
    overflow-y: auto;
    overflow-x: hidden;
}
.list-scroll::-webkit-scrollbar       { width: 4px; }
.list-scroll::-webkit-scrollbar-track { background: var(--bg); }
.list-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Track rank (top-tracks) ──────────────────────────────────────────────── */
.track-rank {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    min-width: 1.8rem;
    text-align: right;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* ── History rows ─────────────────────────────────────────────────────────── */
.history-unmatched .recent-play-name,
.history-unmatched .recent-play-album { color: var(--text-tertiary); }
.history-thumb-empty {
    width: 32px; height: 32px; border-radius: 3px;
    background: var(--bg-tertiary); flex-shrink: 0;
}
.history-source {
    font-size: 0.58rem; font-weight: 700; letter-spacing: 0.04em;
    padding: 0.1rem 0.3rem; border-radius: 3px; flex-shrink: 0;
    text-transform: uppercase;
}
.history-source-lastfm  { background: rgba(210,0,80,0.15); color: #d20050; }
.history-source-spotify { background: rgba(30,215,96,0.15); color: #1db954; }

/* ── Stats view ───────────────────────────────────────────────────────────── */
.stat-section { margin-bottom: 3rem; }
.stat-section h3 { font-size: 1.15rem; margin-bottom: 0.2rem; }

/* Language breakdown */
.lang-list {
    display: grid;
    grid-template-columns: max-content 1fr max-content max-content max-content;
    column-gap: 0.5rem;
    row-gap: 0.4rem;
    align-items: center;
    margin-top: 0.75rem;
    max-width: 480px;
}
.lang-list.has-drilldown { max-width: 100%; }
.lang-row { display: contents; }
.lang-code { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.lang-bar-track { height: 6px; background: var(--bg-tertiary); border-radius: 3px; overflow: hidden; }
.lang-bar-fill  { height: 100%; min-width: 3px; border-radius: 3px; transition: width 0.3s ease; }
.lang-count { font-size: 0.7rem; color: var(--text-secondary); text-align: right; font-variant-numeric: tabular-nums; }
.lang-pct   { font-size: 0.7rem; color: var(--text-tertiary); text-align: right; font-variant-numeric: tabular-nums; }

/* Drill-down chevron + expand panel, reusing artist.js's pulse-chevron rotate */
.lang-chevron {
    color: var(--text-tertiary);
    font-size: 0.6rem;
    text-align: center;
    transition: transform 0.2s;
    user-select: none;
    cursor: pointer;
}
.lang-row-clickable { cursor: pointer; }
.lang-row-clickable:hover .lang-code,
.lang-row-clickable:hover .lang-chevron { color: var(--primary); }
.lang-chevron.expanded { transform: rotate(90deg); }
.lang-chevron.disabled { opacity: 0.25; cursor: default; }
.lang-expand {
    grid-column: 1 / -1;
    display: none;
    gap: 0.6rem;
    flex-wrap: wrap;
    padding: 0.3rem 0 0.6rem 0;
}
.lang-expand.open { display: flex; }
.lang-expand-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    width: 84px;
    text-decoration: none;
    color: inherit;
}
.lang-expand-thumb {
    width: 72px;
    height: 72px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-tertiary);
    flex-shrink: 0;
}
.lang-expand-thumb.rounded { border-radius: 50%; }
.lang-expand-name {
    font-size: 0.68rem;
    text-align: center;
    line-height: 1.25;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.lang-expand-card:hover .lang-expand-name { color: var(--primary); }
.lang-expand-count { font-size: 0.62rem; color: var(--text-tertiary); }

/* Static (non-accordion) lang rows — Album Completion links each row title */
.lang-row-static { cursor: default; }
.lang-code-link { text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.lang-row-static:hover .lang-code-link { color: var(--primary); }

/* Always-visible card grid (Most Relistened Tracks) reuses the expand panel
   look but is shown inline rather than toggled open by a chevron. */
.lang-expand-static { display: flex; margin-top: 0.75rem; }
.lang-expand-card-wide { width: 96px; }

/* Color dot used by _coloredRows() to tie a lang-row to a distinct category color */
.segbar-legend-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 0.4rem;
    flex-shrink: 0;
}

/* Diversity stub */
.diversity-stub {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-top: 0.75rem;
}

.recent-plays-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.recent-play-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.3rem 0.25rem;
    border-radius: 4px;
    transition: background 0.15s;
}
.recent-play-row:hover {
    background: var(--bg-secondary);
}
.recent-play-thumb {
    width: 32px;
    height: 32px;
    border-radius: 3px;
    background-size: cover;
    background-position: center;
    background-color: var(--border);
    flex-shrink: 0;
}
.recent-play-info {
    flex: 1;
    min-width: 0;
}
.recent-play-name {
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}
.recent-play-album {
    display: flex;
    align-items: center;
    gap: 0.25em;
    font-size: 0.7rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.recent-play-date {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    flex-shrink: 0;
    white-space: nowrap;
}

.release-stats {
    grid-area: stats;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    align-self: center;
    gap: 0.15rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.release-stats .stat-item {
    align-items: center;
    gap: 0.35rem;
}

/* Chart Container */
.chart-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.chart-container canvas {
    max-height: 300px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.chart-title {
    font-size: 1.2rem;
    margin: 0;
}

.chart-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    gap: 0.5rem;
    background: var(--bg);
    padding: 0.25rem;
    border-radius: 6px;
}

.control-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.control-btn:hover {
    background: var(--bg-secondary);
    color: var(--text);
}

.control-btn.active {
    background: var(--primary);
    color: white;
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Back Button */
.back-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    color: var(--text);
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.back-button:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* === Release Variants === */
.variant-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.variant-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.variant-art {
    width: 56px;
    height: 56px;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-tertiary);
    flex-shrink: 0;
}

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

.variant-header-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.variant-header-info h3 a {
    color: var(--text);
    text-decoration: none;
}

.variant-header-info h3 a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.variant-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.variant-type-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.variant-year {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.variant-tracklist {
    margin-top: 0.5rem;
}

.variant-backlink {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0.25rem 0 0.5rem;
}

.variant-backlink a {
    color: var(--primary);
    text-decoration: none;
}

.variant-backlink a:hover {
    text-decoration: underline;
}

.tracklist-empty {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    padding: 0.5rem 0;
    font-style: italic;
}

/* Footer */
footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-secondary);
}

footer a {
    color: var(--primary);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .site-logo {
        font-size: 24px;
    }

    .site-logo-small {
        font-size: 18px;
    }

    .site-header {
        flex-direction: row;
    }

    .back-button {
        padding: 0;
        background: none;
        border: none;
        font-size: 0.875rem;
        color: var(--text-secondary);
    }

    .back-button:hover {
        background: none;
        border-color: transparent;
        color: var(--text);
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .artist-header-layout {
        padding: 1.25rem;
    }

    /* Release header: collapse pills to bottom row, shrink art */
    /* ── Release header: Option B mobile layout ──────────────────────
       Art centered above, title/artist centered below, stats single-column,
       pills as a full-width horizontal wrapping row at the bottom.         */
    .release-header-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        text-align: center;
    }
    .release-header-grid .artist-photo-container {
        grid-row: 1;
        grid-column: 1;
        width: 100%;
        padding: 1.25rem 1.25rem 0.75rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        align-self: auto;
    }
    .release-header-grid .artist-photo {
        width: 180px;
        height: 180px;
    }
    /* Artist portraits feel more anchored slightly wider */
    #artistHeader.release-header-grid .artist-photo {
        width: 220px;
        height: 220px;
    }
    .release-header-grid .artist-info-container {
        grid-row: 2;
        grid-column: 1;
        padding: 0 1.25rem 0.75rem;
        text-align: center;
    }
    /* Title and artist centred */
    .release-header-grid h1,
    .release-header-grid .release-artist {
        text-align: center;
    }
    /* Stats table: collapse pairs to single column */
    .release-header-grid .rst-pair {
        flex-direction: column;
    }
    .release-header-grid .rst-pair .rst-row:first-child {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    /* Genre pills: left-align on narrow screens (wrapping right-align gets messy) */
    .release-header-grid .rst-genres-row .rst-value {
        justify-content: flex-start;
    }
    /* Pills: full-width horizontal row */
    .release-header-grid .release-link-pills {
        grid-row: 3;
        grid-column: 1;
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border);
    }
    .release-header-grid .release-link-pill {
        flex: 1 1 auto;
        min-width: 110px;
        border-right: 1px solid var(--border);
        justify-content: center;
    }
    .release-header-grid .pill-variant-group {
        position: absolute;
        z-index: 10;
        background: var(--bg-secondary);
        border: 1px solid var(--border);
        border-radius: 6px;
        min-width: 160px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }
    .artist-photo {
        width: 88px;
        height: 88px;
    }

    .artist-name-row {
        gap: 0.15rem;
    }

    .artist-members {
        justify-content: flex-start;
    }

    .artist-info-container h1 {
        font-size: 1.8rem;
    }

    .artist-info-container .subtitle {
        text-align: center;
    }

    .artist-aka {
        text-align: center;
    }

    .release-artist {
        text-align: center;
    }

    .stats-compact {
        justify-content: center;
        gap: 1.5rem;
    }

    .stat-item .stat-value {
        font-size: 1.5rem;
    }

    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .chart-controls {
        width: 100%;
    }

    .control-group {
        flex: 1;
    }

    .control-btn {
        flex: 1;
        padding: 0.6rem;
        font-size: 0.85rem;
    }

    .artist-grid {
        grid-template-columns: 1fr;
    }

    .disc-grid {
        grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .sort-controls {
        width: 100%;
        justify-content: flex-end;
    }

    /* Page controls: wrap onto multiple rows and left-align on mobile
       so all control groups remain visible without horizontal overflow */
    .page-controls {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 0.75rem 1.25rem;
    }
    .control-block {
        flex: 0 0 auto;
    }

    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.75rem;
    }
}

/* ── Admin view ───────────────────────────────────────────────── */

.admin-wrap {
    display: flex;
    flex-direction: column;
}

.admin-wrap--listens {
    height: 100vh;
    overflow: hidden;
}

.admin-toolbar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.42rem 1rem 2rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    flex-shrink: 0;
    z-index: 10;
    min-width: 0;
    overflow: hidden;
}

.admin-filter-group {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    flex: 1;
    min-width: 0;
    max-width: 320px;
}

.admin-filter-group-label {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

@media (max-width: 700px) {
    .admin-filter-group,
    .admin-filter-sep { display: none; }
}

.admin-toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Admin tabs + save injected into the site sticky header */
.admin-header-slot {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    flex: 1;
    padding: 0 0.75rem;
}

.admin-toggle-group {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.admin-toggle-btn {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-right: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.admin-toggle-btn:last-child { border-right: none; }

.admin-toggle-btn.is-active {
    background: var(--primary);
    color: #fff;
}

.admin-toggle-btn:hover:not(.is-active) {
    background: var(--bg-tertiary);
    color: var(--text);
}

.admin-row-count {
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

.admin-save-btn {
    padding: 0.35rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.admin-save-btn.is-dirty {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.admin-save-btn:hover:not(.is-dirty) {
    background: var(--bg);
    color: var(--text);
}

.admin-filter-bar { display: none; } /* merged into toolbar */

.admin-filter-sep {
    width: 1px;
    height: 1rem;
    background: var(--border);
    flex-shrink: 0;
    margin: 0 0.35rem;
}

.admin-filter-uline {
    flex: 1;
    min-width: 40px;
    background: transparent;
    border: none;
    border-bottom: 1px dashed var(--border);
    padding: 0.12rem 0.1rem;
    font-size: 0.75rem;
    color: var(--text);
    font-family: inherit;
    outline: none;
}
.admin-filter-uline:focus { border-bottom-style: solid; border-bottom-color: var(--primary); }
.admin-filter-uline::placeholder { color: var(--text-tertiary); opacity: 0.45; }

.admin-filter-input {
    flex: 1;
    min-width: 0;
    padding: 0.3rem 0.5rem;
    font-size: 0.78rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    outline: none;
}

.admin-filter-input:focus {
    border-color: var(--primary);
}

.admin-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    min-width: 0;
}

.admin-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    font-size: 0.8rem;
    table-layout: fixed;
}

.admin-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bg-secondary);
}

.admin-table th {
    padding: 0.4rem 0.5rem;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    overflow: hidden;
}

/* column widths */
.admin-table th:nth-child(1) { width: 90px; }   /* date */
.admin-table th:nth-child(2) { width: 60px; }   /* source */
.admin-table th:nth-child(3) { min-width: 200px; } /* raw metadata */
.admin-table th:nth-child(4) { width: 46px; }   /* dur */
.admin-table th:nth-child(5) { width: 28px; }   /* skipped */
.admin-table th:nth-child(6) { min-width: 200px; } /* matched metadata */
.admin-table th:nth-child(7),
.admin-table th:nth-child(8) { width: 32px; }   /* actions */
.admin-table th:nth-child(9) { width: 32px; }   /* re-match button */

.admin-row {
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}

.admin-row:hover { background: var(--bg-secondary); }

.admin-row--unmatched { opacity: 0.65; }

.admin-row--hidden .admin-cell { opacity: 0.35; }

.admin-cell {
    padding: 0 0.5rem;
    vertical-align: middle;
    height: 52px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.admin-cell--ts    { color: var(--text-tertiary); font-size: 0.76rem; }
.admin-cell--raw   { color: var(--text-secondary); }
.admin-cell--num   { color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.admin-cell--center { text-align: center; }

.admin-cell--meta {
    white-space: normal;
    overflow: visible;
}
.admin-meta-name {
    font-size: 0.83rem;
    color: var(--text);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 36vw;
}
.admin-cell--raw .admin-meta-name { color: var(--text-secondary); }
.admin-meta-sub {
    font-size: 0.74rem;
    color: var(--text-tertiary);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 36vw;
    margin-top: 2px;
}

.admin-cell--lang { width: 36px; text-align: center; }

.admin-lang {
    display: inline-block;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
}

.admin-match-prompt {
    color: var(--primary);
    font-style: italic;
    font-size: 0.75rem;
}

.admin-cell--action {
    padding: 0 0.25rem;
    text-align: center;
}

.admin-source {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-source--lastfm  { background: #d4183822; color: #f04e4e; }
.admin-source--spotify { background: #1db95422; color: #1db954; }

.admin-skip { color: var(--text-tertiary); }

.admin-empty { color: var(--text-tertiary); }

.admin-link {
    color: var(--text-secondary);
    text-decoration: none;
}

.admin-link:hover { color: var(--primary); text-decoration: underline; }

.admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.admin-btn svg { width: 14px; height: 14px; }

.admin-btn:hover:not([disabled]) {
    background: var(--bg-tertiary);
    color: var(--text);
}

.admin-btn[disabled] { opacity: 0.25; cursor: default; }

.admin-btn--hide.is-active { color: var(--primary); }

/* Admin tabs */
.admin-tabs { display: flex; gap: 0.25rem; margin: 0 0.5rem; }
.admin-tab {
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
}
.admin-tab.is-active, .admin-tab:hover { color: var(--text); background: var(--bg-secondary); }

/* Admin search type badges */
.admin-search-type {
    display: inline-block;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 0.35rem;
}
.admin-search-type--artist  { background: #7c3aed22; color: #7c3aed; }
.admin-search-type--release { background: #0369a122; color: #0369a1; }

/* Edit link (pencil next to track name) */
.admin-edit-link {
    display: inline-flex;
    align-items: center;
    margin-left: 5px;
    color: var(--text-tertiary);
    text-decoration: none;
    vertical-align: middle;
}
.admin-edit-link i { width: 11px; height: 11px; }
.admin-edit-link:hover { color: var(--primary); }

/* Search button in toolbar — removed (button no longer in admin toolbar) */
.admin-search-btn i { width: 14px; height: 14px; }

/* Track match modal */
.admin-match-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-match-modal-inner {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    width: 420px;
    max-width: calc(100vw - 2rem);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}

.admin-match-modal-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

.admin-match-modal-raw {
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-match-modal-artist {
    font-weight: 400;
    color: var(--text-secondary);
}

.admin-match-modal-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 4px;
    border-radius: 3px;
}

.admin-match-modal-close:hover { color: var(--text); background: var(--bg-tertiary); }

.admin-match-modal-hint {
    font-size: 0.72rem;
    color: var(--text-tertiary);
}

.admin-match-modal-bulk {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.admin-match-modal-bulk input[type="checkbox"] {
    accent-color: var(--primary);
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    cursor: pointer;
}

/* Tom Select inside modal */
.admin-match-modal-inner .ts-control {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.85rem;
    padding: 6px 10px;
    box-shadow: none;
}

.admin-match-modal-inner .ts-control:focus-within {
    border-color: var(--primary);
}

.admin-match-modal-inner .ts-dropdown {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    font-size: 0.82rem;
    margin-top: 4px;
    position: static;
    width: 100%;
}

.admin-match-modal-inner .ts-dropdown-content { max-height: 260px; }

.admin-ts-option {
    display: flex;
    flex-direction: column;
    padding: 6px 10px;
    gap: 2px;
}

.admin-ts-option-title { color: var(--text); }

.admin-ts-option-sub {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

.ts-dropdown .option.active,
.ts-dropdown .option:hover {
    background: var(--bg-tertiary);
}

/* Tom Select — underline style (editor fields) */
.ts-uline .ts-control {
    background: transparent !important;
    border: none !important;
    border-bottom: 1.5px dashed var(--border) !important;
    border-radius: 0 !important;
    padding: 0.1rem 0 !important;
    box-shadow: none !important;
    min-height: unset !important;
    cursor: pointer;
    display: flex;
    align-items: baseline;
    flex-wrap: nowrap;
    gap: 0;
}
.ts-uline.focus .ts-control,
.ts-uline .ts-control:focus-within {
    border-bottom-style: solid !important;
    border-bottom-color: var(--primary) !important;
}
.ts-uline .ts-control .item {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-family: ui-monospace, monospace;
    padding: 0;
    margin: 0;
    background: none !important;
    border: none !important;
    line-height: 1.4;
}
.ts-uline .ts-control input {
    color: var(--text);
    font-size: 0.78rem;
    font-family: inherit;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 0 !important;
    width: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    line-height: 1.4;
}
.ts-uline.focus .ts-control input { width: 2rem !important; }
.ts-uline .ts-control::after,
.ts-uline .ts-control .ts-arrow { display: none !important; }

/* Tom Select — compact pill/tag style (track LANG column) */
.ts-lang-tag .ts-control {
    background: var(--bg-tertiary) !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 0.12rem 0.4rem !important;
    box-shadow: none !important;
    min-height: unset !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ts-lang-tag.focus .ts-control,
.ts-lang-tag .ts-control:focus-within {
    outline: 1px solid var(--primary) !important;
    outline-offset: 1px;
}
.ts-lang-tag .ts-control .item {
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-family: ui-monospace, monospace;
    padding: 0;
    margin: 0;
    background: none !important;
    border: none !important;
}
.ts-lang-tag .ts-control input {
    padding: 0 !important;
    margin: 0 !important;
    min-width: 0 !important;
    width: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 0.72rem;
    font-family: ui-monospace, monospace;
    color: var(--text);
}
.ts-lang-tag.focus .ts-control input { width: 2.5rem !important; }
.ts-lang-tag .ts-control::after,
.ts-lang-tag .ts-control .ts-arrow { display: none !important; }

/* Shared dropdown style for both ts-uline and ts-lang-tag */
.ts-uline .ts-dropdown,
.ts-lang-tag .ts-dropdown {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    font-size: 0.82rem;
    margin-top: 4px;
    z-index: 50;
}
.ts-uline .ts-dropdown-content,
.ts-lang-tag .ts-dropdown-content { max-height: 240px; }


/* Auth screen */
.admin-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.admin-auth-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem 2.5rem;
    width: 320px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-auth-card h2 {
    font-size: 1.2rem;
    color: var(--text);
}

.admin-auth-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.admin-auth-hint code {
    display: inline-block;
    margin-top: 0.4rem;
    padding: 0.2rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text);
}

#pinForm {
    display: flex;
    gap: 0.5rem;
}

.admin-pin-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
}

.admin-pin-input:focus { border-color: var(--primary); }

.admin-pin-submit {
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.admin-auth-error {
    font-size: 0.8rem;
    color: var(--error, #f04e4e);
}

/* Admin editor */
.admin-editor { max-width: 1000px; padding: 1.5rem 1.5rem 3rem; }
.admin-editor-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }
.admin-editor-section { margin-bottom: 1.75rem; }
.admin-editor-section h3 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-tertiary); margin-bottom: 0.6rem; font-weight: 700; border-bottom: 1px solid var(--border); padding-bottom: 0.3rem; }
.admin-editor-empty { padding: 3rem 1.5rem; color: var(--text-tertiary); font-size: 0.875rem; }
.admin-field-row { display: grid; grid-template-columns: 130px 1fr; align-items: start; gap: 0.5rem; margin-bottom: 0.4rem; }
.admin-field-label { font-size: 0.78rem; color: var(--text-secondary); padding-top: 0.35rem; }
.admin-field-input { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 4px; padding: 0.28rem 0.5rem; color: var(--text); font-size: 0.82rem; width: 100%; font-family: inherit; }
.admin-field-input:focus { outline: none; border-color: var(--primary); }
.admin-field-textarea { min-height: 70px; resize: vertical; }
.admin-add-btn { font-size: 0.72rem; color: var(--primary); background: none; border: none; cursor: pointer; margin-left: 0.5rem; padding: 0.1rem 0.3rem; }
.admin-add-btn:hover { text-decoration: underline; }
.admin-alias-row { display: flex; gap: 0.4rem; align-items: center; margin-bottom: 0.35rem; }
.admin-alias-input { flex: 2; }
.admin-alias-type { flex: 1.2; }
.admin-alias-lang { flex: 0.6; }
.admin-alias-text { font-size: 0.82rem; flex: 2; }
.admin-alias-type-badge, .admin-alias-lang-badge {
    font-size: 0.7rem; color: var(--text-tertiary);
    background: var(--bg-tertiary); border-radius: 3px;
    padding: 0.1rem 0.3rem; flex-shrink: 0;
}
.admin-remove-btn { background: none; border: none; cursor: pointer; color: var(--text-tertiary); font-size: 1rem; padding: 0 0.25rem; line-height: 1; }
.admin-remove-btn:hover { color: var(--error, #f04e4e); }
.admin-chip-list { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.admin-chip { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.2rem 0.5rem 0.2rem 0.6rem; background: var(--bg-tertiary); border-radius: 999px; font-size: 0.78rem; white-space: nowrap; max-width: 140px; overflow: hidden; }
.admin-chip > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.admin-chip-remove { cursor: pointer; color: var(--text-tertiary); line-height: 1; font-size: 0.9rem; }
.admin-chip-remove:hover { color: var(--error, #f04e4e); }
.admin-track-row { display: flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.admin-track-num { color: var(--text-tertiary); width: 24px; text-align: right; font-size: 0.78rem; flex-shrink: 0; }
.admin-track-title { flex: 1; min-width: 140px; display: flex; flex-direction: column; gap: 0.2rem; }
.admin-track-mix { font-size: 0.74rem; }
.admin-track-dur { width: 56px; flex-shrink: 0; font-size: 0.8rem; }
.admin-track-bpm { width: 52px; flex-shrink: 0; font-size: 0.8rem; }
.admin-track-artists { display: flex; flex-wrap: wrap; gap: 0.2rem; align-items: center; flex: 1; min-width: 120px; }
.admin-track-hidden { flex-shrink: 0; }
.admin-chip-role { font-size: 0.65rem; color: var(--text-tertiary); margin-left: 0.2rem; font-style: italic; }
.admin-variant-group { margin-top: 0.75rem; }
.admin-variant-group summary { font-size: 0.72rem; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; cursor: pointer; padding: 0.35rem 0; user-select: none; }

/* ── Underline input style ── */
.admin-uline {
    background: transparent;
    border: none;
    border-bottom: 1.5px dashed var(--border);
    border-radius: 0;
    padding: 0.22rem 0.1rem;
    color: var(--text);
    font-size: 0.85rem;
    font-family: inherit;
    width: 100%;
    transition: border-color 0.12s;
}
.admin-uline:focus { outline: none; border-bottom-style: solid; border-bottom-color: var(--primary); }
.admin-uline::placeholder { color: var(--text-tertiary); opacity: 0.55; }
.admin-uline.warn { border-bottom-style: solid; border-bottom-color: var(--warning); }
select.admin-uline {
    appearance: none; -webkit-appearance: none; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.2rem center;
    padding-right: 1.2rem;
}
select.admin-uline option { background: var(--bg-secondary); }
.admin-uline-textarea { min-height: 52px; resize: vertical; }

/* ── Art & Links grid ── */
.admin-art-links-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-bottom: 0; }
.admin-art-block { display: flex; gap: 1rem; align-items: flex-start; }
.admin-art-preview {
    width: 80px; height: 80px; flex-shrink: 0;
    border-radius: 6px; background: var(--bg-tertiary);
    border: 1px solid var(--border);
    overflow: hidden; display: flex; align-items: center; justify-content: center;
    flex-direction: column; gap: 0.3rem;
}
.admin-art-preview img { width: 100%; height: 100%; object-fit: cover; }
.admin-art-preview-empty svg { width: 20px; height: 20px; opacity: 0.3; }
.admin-art-preview-empty span { font-size: 0.6rem; color: var(--text-tertiary); }
.admin-art-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.admin-art-field-row { display: flex; flex-direction: column; gap: 0.08rem; }
.admin-art-field-label { font-size: 0.62rem; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; }
.admin-art-source { font-size: 0.62rem; color: var(--text-tertiary); }
.admin-art-pull-row { display: flex; gap: 0.35rem; margin-top: 0.2rem; flex-wrap: wrap; }
.admin-pull-btn {
    font-size: 0.7rem; padding: 0.18rem 0.5rem;
    border-radius: 4px; cursor: pointer; font-family: inherit;
    background: none; border: 1px solid var(--border); color: var(--text-secondary);
    transition: border-color 0.1s, color 0.1s;
}
.admin-pull-btn:hover { border-color: var(--text-tertiary); color: var(--text); }
.admin-links-block { display: flex; flex-direction: column; gap: 0.32rem; }
.admin-link-row { display: grid; grid-template-columns: 100px 1fr; align-items: baseline; gap: 0.4rem; }
.admin-link-label { font-size: 0.72rem; color: var(--text-tertiary); display: flex; align-items: center; gap: 0.3rem; }
.admin-link-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.dot-spotify  { background: #1db954; }
.dot-mb       { background: #ba478f; }
.dot-apple    { background: #fc3c44; }
.dot-deezer   { background: #ef5466; }
.dot-aoty     { background: #f59e0b; }
.admin-link-input {
    background: transparent; border: none;
    border-bottom: 1.5px dashed var(--border);
    padding: 0.12rem 0.1rem; color: var(--text-secondary);
    font-size: 0.75rem; font-family: ui-monospace, monospace; width: 100%;
}
.admin-link-input:focus { outline: none; border-bottom-style: solid; border-bottom-color: var(--primary); color: var(--text); }
.admin-link-input::placeholder { font-size: 0.7rem; color: var(--text-tertiary); opacity: 0.4; }

/* ── Track table grid ── */
/* 8 columns: # | Title+ETI | Dur | BPM | Lang | Artists | Aliases | Eye */
.admin-track-col-headers {
    display: grid;
    grid-template-columns: 28px 1fr 60px 56px 64px 1fr 56px 26px;
    gap: 0 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--border);
    align-items: end;
}
.admin-col-hdr {
    font-size: 0.6rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.07em;
    color: var(--text-tertiary); white-space: nowrap;
}
.admin-col-hdr.center { text-align: center; }
.admin-col-hdr.right  { text-align: right; }

/* New track row — grid layout */
.admin-track-row-grid {
    display: grid;
    grid-template-columns: 28px 1fr 60px 56px 64px 1fr 56px 26px;
    gap: 0 0.5rem;
    align-items: start;
    border-bottom: 1px solid var(--border);
    padding: 0.65rem 0;
    transition: opacity 0.15s;
}
.admin-track-row-grid.track-hidden { opacity: 0.35; }

.admin-track-num-grid { color: var(--text-tertiary); font-size: 0.78rem; text-align: right; padding-top: 0.32rem; }

.admin-track-title-cell { display: flex; flex-direction: column; gap: 0.18rem; min-width: 0; }
.admin-track-title-input {
    background: transparent; border: none;
    border-bottom: 1.5px dashed var(--border);
    font-size: 0.87rem; font-weight: 500; color: var(--text);
    font-family: inherit; padding: 0.1rem 0; width: 100%;
}
.admin-track-title-input:focus { outline: none; border-bottom-style: solid; border-bottom-color: var(--primary); }
.admin-track-eti-input {
    background: transparent; border: none;
    border-bottom: 1.5px dashed transparent;
    font-size: 0.73rem; color: var(--text-tertiary);
    font-family: inherit; font-style: italic;
    padding: 0.1rem 0; width: 100%;
}
.admin-track-eti-input:focus { outline: none; border-bottom: 1.5px solid var(--primary); }
.admin-track-eti-input::placeholder { opacity: 0.4; }

.admin-track-dur-input, .admin-track-bpm-input {
    background: transparent; border: none;
    border-bottom: 1.5px dashed var(--border);
    font-size: 0.8rem; color: var(--text-secondary);
    font-family: ui-monospace, monospace;
    padding: 0.16rem 0; width: 100%; text-align: center;
}
.admin-track-dur-input:focus, .admin-track-bpm-input:focus { outline: none; border-bottom-style: solid; border-bottom-color: var(--primary); }
.admin-track-dur-input.warn, .admin-track-bpm-input.warn { border-bottom-style: solid; border-bottom-color: var(--warning); }
.admin-track-dur-input::placeholder, .admin-track-bpm-input::placeholder { font-size: 0.65rem; opacity: 0.35; }

/* .admin-track-lang-select is replaced by TomSelect at runtime */
/* do NOT set display:none here — TomSelect reads it before hiding it itself */

/* Role-grouped artists inside grid */
.admin-track-artists-grid { display: flex; flex-direction: column; gap: 0.14rem; min-width: 0; }
.admin-track-role-row { display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; min-height: 19px; }
.admin-role-label { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; width: 34px; flex-shrink: 0; text-align: right; }
.admin-role-label.role-main  { color: var(--text-secondary); }
.admin-role-label.role-feat  { color: #a78bfa; }
.admin-role-label.role-remix { color: #38bdf8; }
.admin-chip.chip-main  { background: rgba(255,255,255,0.06); color: var(--text); }
.admin-chip.chip-feat  { background: rgba(167,139,250,0.12); color: #c4b5fd; }
.admin-chip.chip-remix { background: rgba(56,189,248,0.1);   color: #7dd3fc; }

/* Aliases count button */
.admin-aliases-btn {
    font-size: 0.68rem; color: var(--text-tertiary);
    background: none; border: 1px dashed var(--border);
    border-radius: 4px; cursor: pointer;
    padding: 0.1rem 0.4rem; margin-top: 0.28rem;
    transition: color 0.1s, border-color 0.1s;
}
.admin-aliases-btn:hover { color: var(--text-secondary); border-color: var(--text-tertiary); }
.admin-aliases-btn.has-aliases { color: var(--text-secondary); border-color: var(--text-tertiary); }

/* Eye toggle button */
.admin-eye-btn {
    background: none; border: none; cursor: pointer;
    color: var(--text-tertiary); padding: 0.1rem;
    border-radius: 3px; display: flex; align-items: center;
    margin-top: 0.3rem;
    transition: color 0.1s, opacity 0.1s;
}
.admin-eye-btn:hover { color: var(--text-secondary); }
.admin-eye-btn.eye-off { opacity: 0.3; }
.admin-eye-btn svg { width: 14px; height: 14px; }

/* Variant group — editable name header */
.admin-variant-group-new { margin-top: 1rem; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.admin-variant-summary {
    background: var(--bg-secondary); padding: 0.38rem 0.75rem;
    display: flex; align-items: center; gap: 0.5rem; cursor: pointer; user-select: none;
}
.admin-variant-arrow { font-size: 0.62rem; color: var(--text-tertiary); flex-shrink: 0; transition: transform 0.15s; display: inline-block; }
.admin-variant-arrow.open { transform: rotate(90deg); }
.admin-variant-name-input {
    background: transparent; border: none;
    border-bottom: 1.5px dashed transparent;
    font-size: 0.68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.07em;
    color: var(--text-tertiary); font-family: inherit;
    cursor: text; padding: 0.05rem 0.1rem; flex: 1;
    transition: border-color 0.12s;
}
.admin-variant-name-input:focus { outline: none; border-bottom-style: solid; border-bottom-color: var(--primary); color: var(--text-secondary); text-transform: none; letter-spacing: 0; }
.admin-variant-count { font-size: 0.65rem; color: var(--text-tertiary); flex-shrink: 0; }
.admin-variant-body { padding: 0 0.75rem; }

/* Track alias modal */
.admin-alias-modal-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.38rem 0.6rem; background: var(--bg); border-radius: 6px; }
.admin-alias-modal-text { flex: 1; font-size: 0.83rem; }
.admin-alias-modal-type { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.1rem 0.38rem; border-radius: 999px; flex-shrink: 0; }
.alias-type-common          { background: rgba(255,255,255,0.07); color: var(--text-tertiary); }
.alias-type-native_script   { background: rgba(167,139,250,0.12); color: #c4b5fd; }
.alias-type-transliteration { background: rgba(56,189,248,0.1);   color: #7dd3fc; }
.alias-type-past_name       { background: rgba(245,158,11,0.1);   color: #fbbf24; }
.admin-alias-modal-lang { font-size: 0.7rem; color: var(--text-tertiary); min-width: 22px; text-align: center; font-family: ui-monospace, monospace; }
.admin-alias-modal-remove { background: none; border: none; cursor: pointer; color: var(--text-tertiary); opacity: 0.5; font-size: 0.85rem; padding: 0 0.2rem; }
.admin-alias-modal-remove:hover { opacity: 1; color: var(--error); }
.admin-alias-add-form { border-top: 1px solid var(--border); padding-top: 0.7rem; display: flex; flex-direction: column; gap: 0.42rem; }
.admin-alias-add-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); }
.admin-alias-add-fields { display: grid; grid-template-columns: 1fr 148px 44px; gap: 0.4rem; align-items: end; }
.admin-alias-add-input { background: var(--bg); border: 1px solid var(--border); border-radius: 5px; padding: 0.28rem 0.5rem; color: var(--text); font-size: 0.83rem; font-family: inherit; width: 100%; }
.admin-alias-add-input:focus { outline: none; border-color: var(--primary); }
.admin-alias-add-input::placeholder { color: var(--text-tertiary); }
.admin-alias-add-select { background: var(--bg); border: 1px solid var(--border); border-radius: 5px; padding: 0.28rem 1.2rem 0.28rem 0.5rem; color: var(--text); font-size: 0.83rem; font-family: inherit; width: 100%; appearance: none; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.4rem center; }
.admin-alias-add-select:focus { outline: none; border-color: var(--primary); }
.admin-alias-add-select option { background: var(--bg-secondary); }
.admin-alias-add-btn { background: var(--primary); border: none; border-radius: 5px; color: #fff; font-size: 0.82rem; font-weight: 600; padding: 0.28rem 0.65rem; cursor: pointer; white-space: nowrap; }
.admin-alias-add-btn:hover { opacity: 0.9; }
.admin-alias-add-footer { display: flex; justify-content: space-between; align-items: center; }
.admin-alias-add-hint { font-size: 0.7rem; color: var(--text-tertiary); }

/* Art lightbox modal */
.art-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.art-modal-inner {
    max-width: min(90vw, 90vh);
    max-height: min(90vw, 90vh);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}

.art-modal-inner img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.has-art {
    cursor: zoom-in;
}

@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 0.8s linear infinite; }
