/* ── Reset & Base ──────────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-root: #0e0e12;
    --bg-panel: #16161c;
    --bg-panel-header: #1c1c24;
    --bg-hover: #22222e;
    --bg-active: #2a2a3a;
    --bg-input: #1a1a24;
    --border: #2a2a36;
    --text-primary: #e4e4ea;
    --text-secondary: #8e8ea0;
    --text-muted: #5c5c6e;
    --accent: #7c6aef;
    --accent-hover: #9484f7;
    --accent-glow: rgba(124, 106, 239, 0.15);
    --spotify-green: #1db954;
    --spotify-green-hover: #1ed760;
    --bg-sidebar: #1e1e1e;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --transition-fast: 0.15s ease;
    --transition-med: 0.25s ease;
}

html {
    font-size: 15px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-root);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── App Shell (Main Content Only) ────────────────────────── */
#app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

#app-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* ── Header ────────────────────────────────────────────────── */
#app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-root);
}

.header-left {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

#app-header h1 {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.header-nav .nav-link {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.header-nav {
    display: flex;
    gap: 24px;
    align-items: center;
}

.header-nav .nav-link {
    text-decoration: none;
    transition: color var(--transition-fast);
}

.header-nav .nav-link:hover {
    color: var(--text-primary);
}

/* ── Mobile Nav Toggle ─────────────────────────────────────── */
.nav-toggle-checkbox {
    display: none;
}

.nav-toggle-label {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    cursor: pointer;
    z-index: 1000;
}

.hamburger-line {
    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

.nav-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

/* ── Global Search Bar ─────────────────────────────────────── */
.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0 24px;
}

#global-works-search {
    width: 100%;
    max-width: 450px;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    transition: all var(--transition-fast);
}

#global-works-search::placeholder {
    color: var(--text-muted);
}

#global-works-search:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--bg-hover);
}

/* ── Lifespan Timeline ─────────────────────────────────────── */
#lifespan-timeline-container {
    padding: 16px 24px 28px 24px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

#lifespan-timeline-container.hidden {
    display: none;
}

.lifespan-track {
    position: relative;
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    margin-top: 10px;
}

.lifespan-tick {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 1px;
    background: var(--border);
    z-index: 1;
}

.lifespan-tick span {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: var(--text-muted);
}

.lifespan-bar {
    position: absolute;
    top: -2px;
    height: 12px;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
    border-radius: 6px;
    z-index: 2;
    transition: all var(--transition-med);
}

.lifespan-labels {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: #fff;
    white-space: nowrap;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* ── Main Layout ───────────────────────────────────────────── */
#app-main {
    display: grid;
    grid-template-columns: 300px 1fr;
    flex: 1;
    overflow: hidden;
}

/* ── Panel ─────────────────────────────────────────────────── */
.panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--border);
    box-shadow: 0 0 35px var(--accent-glow);
    position: relative;
    z-index: 1;
}

.panel:last-child {
    border-right: none;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--bg-panel-header);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.panel-header h2 {
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.badge {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 100px;
    background: var(--accent-glow);
    color: var(--accent);
    letter-spacing: 0.02em;
}

.badge.hidden {
    display: none;
}

/* ── Works Panel Header & Controls ─────────────────────────── */
.works-panel-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
}

.panel-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.works-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#works-title {
    font-size: 1.8rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: -0.01em;
    color: #ffffff;
}

#works-subtitle {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent);
}

#works-subtitle.hidden {
    display: none;
}

.premium-hub-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 22px;
    margin-top: 14px;
    background: var(--bg-active);
    border: 1px solid var(--accent);
    color: #fff;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    width: fit-content;
    transition: all var(--transition-med);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.premium-hub-btn:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
    border-color: var(--accent-hover);
}

.works-header-content {
    display: flex;
    justify-content: space-between;
    gap: 24px;
}

#works-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 0 0 auto;
}

#works-controls.hidden {
    display: none;
}

#works-bio {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    max-height: 95px;
    overflow-y: auto;
    padding-right: 6px;
}

#works-bio.hidden {
    display: none;
}

#composer-bio {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.55;
    white-space: pre-line;
    text-align: left;
    max-width: 550px;
}

#works-bio::-webkit-scrollbar {
    width: 4px;
}

#works-bio::-webkit-scrollbar-track {
    background: transparent;
}

#works-bio::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.controls-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.controls-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-top: 6px;
    width: 45px;
    flex-shrink: 0;
}

.controls-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-btn,
.sort-btn {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 5px 12px;
    font-size: 0.78rem;
    font-family: inherit;
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn:hover,
.sort-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent-hover);
}

.filter-btn.active,
.sort-btn.active {
    background: var(--accent-glow);
    color: var(--accent);
    border-color: var(--accent);
    font-weight: 500;
}

.composer-filters-container {
    border-bottom: 1px solid var(--border);
    background: var(--bg-panel);
    flex-shrink: 0;
}

/* ── Composer Search ───────────────────────────────────────── */
#composer-search-wrapper {
    padding: 14px 14px 8px;
}

/* ── Composer Controls ─────────────────────────────────────── */
#composer-controls {
    padding: 4px 14px 14px;
}

#composer-controls.hidden {
    display: none;
}

#composer-search {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color var(--transition-fast);
}

#composer-search::placeholder {
    color: var(--text-muted);
}

#composer-search:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ── Item Lists ────────────────────────────────────────────── */
.item-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
    background: var(--bg-panel);
}

.item-list::-webkit-scrollbar {
    width: 6px;
}

.item-list::-webkit-scrollbar-track {
    background: transparent;
}

.item-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 100px;
}

.item-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ── Composer Items ────────────────────────────────────────── */
.composer-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition-fast), padding-left var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 12px;
}

.composer-item:hover {
    background: var(--bg-hover);
}

.composer-item.active {
    background: var(--bg-active);
    border-left: 3px solid var(--accent);
    padding-left: 17px;
}

.composer-item .composer-name {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1.4;
}

.composer-item .composer-era {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-left: auto;
    white-space: nowrap;
    text-transform: capitalize;
}

/* ── Works Items ───────────────────────────────────────────── */
.work-item {
    padding: 14px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: background var(--transition-fast);
    animation: fadeInUp 0.25s ease both;
}

.work-item:hover {
    background: var(--bg-hover);
}

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

.work-item .title-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.work-item .work-title {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 1.45;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.composed-year-badge {
    font-size: 0.70rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bg-hover);
    color: var(--text-secondary);
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.composed-year-badge:empty {
    display: none;
}

.work-item .work-genre {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.work-item .global-search-composer {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent);
    margin-top: 4px;
}

/* ── Work Actions Row ──────────────────────────────────────── */
.work-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.open-spotify-link,
.load-player-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.78rem;
    font-family: inherit;
    font-weight: 600;
    color: var(--text-primary);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 20px;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.open-spotify-link:hover,
.load-player-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 12px var(--accent-glow);
    transform: translateY(-1px);
}

.open-spotify-link:active,
.load-player-btn:active {
    background: var(--bg-active);
    transform: translateY(0);
}

/* ── Spotify Embed ─────────────────────────────────────────── */
.spotify-embed {
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-top: 10px;
}

.spotify-embed iframe {
    display: block;
    border: none;
    border-radius: var(--radius-md);
}

/* ── Placeholder Message ───────────────────────────────────── */
.placeholder-message {
    padding: 40px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

/* ── Error State ───────────────────────────────────────────── */
.error-message {
    padding: 24px;
    text-align: center;
    color: #e05a5a;
    font-size: 0.85rem;
}

/* ── Animation ─────────────────────────────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Responsive ────────────────────────────────────────────── */
.mobile-back-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    padding-bottom: 4px;
    text-align: left;
    transition: color var(--transition-fast);
}

.mobile-back-btn:hover {
    color: var(--text-primary);
}

@media (max-width: 768px) {
    #app-main {
        display: flex;
        flex-direction: column;
    }

    .panel {
        border-right: none;
        border-bottom: none;
    }

    #composers-panel {
        display: flex;
        flex: 1;
        width: 100%;
    }

    #works-panel {
        display: none;
        flex: 1;
        width: 100%;
    }

    #composers-panel.mobile-hidden {
        display: none !important;
    }

    #works-panel.mobile-active {
        display: flex !important;
    }

    .mobile-back-btn {
        display: inline-block;
    }

    .header-center {
        display: none; /* Hide global search on mobile for now to keep header clean */
    }

    #app-header {
        position: relative;
    }

    .nav-toggle-label {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-panel-header);
        flex-direction: column;
        padding: 20px;
        gap: 16px;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 10px 20px rgba(0,0,0,0.3);
        z-index: 999;
    }

    .nav-toggle-checkbox:checked ~ .nav-links {
        display: flex;
    }

    .nav-links .nav-link {
        width: 100%;
        text-align: center;
        padding: 10px 0;
    }

    .works-header-content {
        flex-direction: column;
        gap: 16px;
    }

    #works-controls {
        flex: 1 1 auto;
        width: 100%;
    }

    .controls-row {
        width: 100%;
    }

    .controls-group {
        flex: 1;
        min-width: 0;
    }
}

/* ── Static Pages ──────────────────────────────────────────── */
.page-container {
    max-width: 800px;
    margin: 60px auto;
    padding: 0 32px;
}

.page-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 32px;
    letter-spacing: -0.02em;
}

.page-content p {
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 24px;
    font-size: 1.05rem;
}

.page-content a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.page-content a:hover {
    color: var(--accent-hover);
}

/* ── Queue Nav Button ──────────────────────────────────────── */
.queue-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid transparent;
    font-size: 0.8rem;
    font-weight: 400;
    font-family: inherit;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: 20px;
    transition: all var(--transition-fast);
    position: relative;
}

.queue-nav-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    border-color: var(--border);
}

.queue-nav-btn.has-items {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-glow);
}

.queue-icon {
    font-size: 0.85rem;
    line-height: 1;
}

.queue-badge-nav {
    font-size: 0.6rem;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 100px;
    background: var(--accent);
    color: #fff;
    margin-left: 2px;
    line-height: 1;
}

.queue-badge-nav.hidden {
    display: none;
}

/* ── Queue Overlay ─────────────────────────────────────────── */
.queue-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-med), visibility var(--transition-med);
}

.queue-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ── Queue Slide-out Panel ─────────────────────────────────── */
.queue-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-panel);
    border-left: 1px solid var(--border);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.4), -2px 0 20px var(--accent-glow);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.queue-panel.open {
    transform: translateX(0);
}

/* ── Queue Panel Header ───────────────────────────────────── */
.queue-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: var(--bg-panel-header);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.queue-panel-header h2 {
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.queue-close-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.85rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.queue-close-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent);
}

/* ── Queue List ────────────────────────────────────────────── */
.queue-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
    padding: 8px 0;
}

.queue-list::-webkit-scrollbar {
    width: 5px;
}

.queue-list::-webkit-scrollbar-track {
    background: transparent;
}

.queue-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 100px;
}

.queue-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ── Queue Empty Message ───────────────────────────────────── */
.queue-empty-message {
    padding: 60px 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.queue-empty-message span {
    font-size: 0.78rem;
    color: var(--text-muted);
    opacity: 0.6;
}

/* ── Queue Item ────────────────────────────────────────────── */
.queue-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition-fast), box-shadow var(--transition-fast);
    animation: fadeInUp 0.2s ease both;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.queue-item:hover {
    background: var(--bg-hover);
}

/* Drag-and-drop states (SortableJS) */
.queue-item:active {
    cursor: grabbing;
}

.queue-item.sortable-chosen {
    background: var(--bg-active);
    box-shadow: 0 0 0 1px var(--accent), 0 4px 16px var(--accent-glow);
    border-radius: var(--radius-sm);
    cursor: grabbing;
}

.queue-item.sortable-ghost {
    opacity: 0.25;
    background: var(--bg-hover);
}

.queue-item.sortable-drag {
    background: var(--bg-panel);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px var(--accent-glow);
}

.queue-item-index {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

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

.queue-item-title {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.queue-item-composer {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-item-remove {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    opacity: 0;
    font-family: inherit;
}

.queue-item:hover .queue-item-remove {
    opacity: 1;
}

.queue-item-remove:hover {
    background: rgba(224, 90, 90, 0.15);
    color: #e05a5a;
    border-color: rgba(224, 90, 90, 0.3);
}

/* ── Queue Panel Footer ───────────────────────────────────── */
.queue-panel-footer {
    padding: 20px 24px;
    background: var(--bg-panel-header);
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.queue-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    font-size: 0.82rem;
    font-family: inherit;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    letter-spacing: 0.02em;
}

.queue-btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    box-shadow: 0 4px 20px var(--accent-glow), 0 0 0 3px var(--accent-glow);
    transform: translateY(-1px);
}

.queue-btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.queue-btn-primary:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.queue-btn-icon {
    font-size: 1rem;
    line-height: 1;
}

.queue-btn-secondary {
    width: 100%;
    padding: 10px 20px;
    font-size: 0.78rem;
    font-family: inherit;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.queue-btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.queue-btn-secondary:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ── Add to Queue Button (on each work item) ───────────────── */
.add-to-queue-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.78rem;
    font-family: inherit;
    font-weight: 600;
    color: var(--text-primary);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.add-to-queue-btn:hover {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
    transform: translateY(-1px);
}

.add-to-queue-btn:active {
    transform: translateY(0);
}

.add-to-queue-btn.added {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
    pointer-events: none;
}

.add-to-queue-btn .queue-add-icon {
    font-size: 0.85rem;
    line-height: 1;
}

/* ── Wiki Info Button ──────────────────────────────────────── */
.wiki-info-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.78rem;
    font-family: inherit;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-glow);
    border: 1px solid var(--accent);
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    line-height: 1;
    white-space: nowrap;
}

.wiki-info-icon {
    font-size: 0.9rem;
    line-height: 1;
}

.wiki-info-btn:hover {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 16px var(--accent-glow), 0 4px 12px rgba(124, 106, 239, 0.25);
    transform: translateY(-1px);
}

.wiki-info-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent-hover);
    box-shadow: 0 0 12px var(--accent-glow);
}

/* ── Wiki Summary Accordion ────────────────────────────────── */
.wiki-summary-accordion {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.3s ease,
                padding 0.3s ease,
                margin 0.3s ease;
    margin: 0;
    padding: 0 16px;
    background: linear-gradient(135deg, rgba(124, 106, 239, 0.04), rgba(30, 30, 40, 0.6));
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.wiki-summary-accordion.expanded {
    max-height: 600px;
    opacity: 1;
    padding: 16px 20px;
    margin-top: 8px;
}

.wiki-summary-accordion p {
    font-size: 0.82rem;
    font-style: italic;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
    letter-spacing: 0.01em;
    white-space: normal;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* ── Queue Panel Responsive ────────────────────────────────── */
@media (max-width: 768px) {
    .queue-panel {
        width: 100%;
        max-width: 100vw;
    }

    .queue-nav-btn {
        font-size: 0;
        letter-spacing: 0;
        gap: 0;
        padding: 6px 10px;
    }

    .queue-nav-btn .queue-icon {
        font-size: 1rem;
    }

    .queue-nav-btn .queue-badge-nav {
        font-size: 0.55rem;
        min-width: 16px;
        height: 16px;
        margin-left: 4px;
    }
}

/* ── Masterpieces & Hub Extensions ────────────────────────── */
.see-all-masterpieces {
    display: block;
    margin-top: 24px;
    font-size: 0.88rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-fast);
    padding: 12px 16px;
    background: rgba(124, 106, 239, 0.05);
    border-radius: var(--radius-sm);
    text-align: center;
    border: 1px solid transparent;
}

.see-all-masterpieces:hover {
    background: rgba(124, 106, 239, 0.1);
    border-color: var(--accent-glow);
    transform: translateY(-2px);
    color: var(--accent-hover);
}

.genre-chips .essential-btn {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.genre-chips .essential-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

/* Masterpiece Table Styling in Spokes/Masterpiece Pages */
.masterpiece-table-container {
    margin-top: 40px;
}

.work-cell-title {
    font-weight: 600;
    color: #fff;
    font-size: 1.1rem;
}

.work-cell-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.year-cell {
    color: var(--accent);
    font-weight: 500;
}