/* ── Page-specific styles for /tracks/ ───────────
   Base infrastructure (tokens, header, nav, footer,
   theme toggle, grain overlay) inherited from home.css */

/* Container */
.tracks-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 0 0;
}

/* Header border — match albums.css */
header {
    border-bottom: 1px solid var(--color-border);
}

/* ── Hero — mirrors albums.css pattern ────────── */
.hero {
    padding: 28px 0 6px;
}
.hero-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
}
.hero h1 {
    font-family: "Financier Display", Georgia, "Times New Roman", Times, serif;
    font-weight: var(--font-weight-heading);
    font-style: normal;
    font-size: clamp(18px, 1.3vw, 21px);
    line-height: 1.2;
    letter-spacing: 0.045em;
}
.hero .subtitle {
    color: var(--color-text-secondary);
    font-size: clamp(13px, 0.85vw, 15px);
    font-weight: var(--font-weight-body);
    margin-top: 6px;
}
.hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}
.hero-tagline {
    color: var(--color-text-muted);
    font-size: clamp(13px, 0.85vw, 15px);
    font-weight: var(--font-weight-body);
    letter-spacing: 0.03em;
    margin: 10px 0 0;
}

/* ── Search count — positioned below the box ──── */
.search-count {
    position: absolute;
    top: calc(100% + 1px);
    right: 0;
    display: block;
    font-size: clamp(11px, 0.78vw, 12px);
    color: var(--color-text-muted);
    padding: 0 6px;
    opacity: 0;
    transition: opacity 0.15s ease;
    white-space: nowrap;
    pointer-events: none;
}
.search-count.visible {
    opacity: 1;
}

/* ── Toolbar + filter pills ───────────────────── */
.toolbar {
    display: flex;
    padding: 16px 0 0;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.genre-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.genre-pill {
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 13px;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
}
.genre-pill:hover {
    border-color: var(--color-gold);
    color: var(--color-gold);
}
.genre-pill.active {
    background: var(--color-gold);
    border-color: var(--color-gold);
    color: #fff;
}
.genre-pill:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--color-focus-shadow);
}

/* ── Playlist links (inside hero) ──────────── */
.playlist-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}
.playlist-label {
    font-size: clamp(13px, 0.85vw, 15px);
    color: var(--color-text-secondary);
    letter-spacing: 0.03em;
}
.playlist-note {
    font-size: 9.5px;
    font-weight: var(--font-weight-body);
    color: var(--color-text-muted);
    line-height: 1.5;
    opacity: 0.6;
    letter-spacing: 0.02em;
}
.playlist-services {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}
.playlist-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 13px;
    padding: 4px 11px 4px 8px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    transition:
        border-color 0.15s ease,
        color 0.15s ease;
    white-space: nowrap;
}
.playlist-pill:hover {
    border-color: var(--color-gold);
    color: var(--color-gold);
}
.playlist-pill:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--color-focus-shadow);
}
.playlist-pill .si {
    width: 11px;
    height: 11px;
}

/* ── Subcategory filter pills ──────────────────── */
.subcategory-pills {
    display: none;
    gap: 6px;
    flex-wrap: wrap;
    padding: 6px 72px 12px 0;
    margin-top: 4px;
    align-items: center;
}
.subcategory-pills.visible {
    display: flex;
}
.subcategory-pill {
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    white-space: nowrap;
}
.subcategory-pill:hover {
    border-color: var(--color-gold);
    color: var(--color-gold);
}
.subcategory-pill.active {
    background: var(--color-gold);
    border-color: var(--color-gold);
    color: #fff;
}
.subcategory-pill .sub-count {
    font-size: 11px;
    opacity: 0.55;
    margin-left: 4px;
    font-weight: 400;
}
.subcategory-pill.active .sub-count {
    opacity: 0.75;
}
.subcategory-pill:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--color-focus-shadow);
}

/* ── Master-detail layout ────────────────────── */
.master-detail {
    display: flex;
    gap: 0;
    min-height: 0;
    height: calc(100vh - 260px);
    min-height: 400px;
    border-top: 1px solid var(--color-border);
    position: relative;
    overflow: hidden;
}
.master-detail.has-scroll-overflow::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 380px;
    height: 48px;
    background: linear-gradient(to bottom, transparent, var(--color-bg));
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.3s ease, width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.master-detail.scan-mode.has-scroll-overflow::after {
    width: 100%;
}
.master-detail.scrolled-end::after {
    opacity: 0;
}

/* ── Track list panel (left) ─────────────────── */
.track-list-panel {
    width: 380px;
    min-width: 320px;
    flex-shrink: 0;
    overflow-y: auto;
    border-right: 1px solid var(--color-border);
    scrollbar-width: thin;
    scrollbar-color: var(--color-scrollbar-thumb) transparent;
}
.track-list-panel::-webkit-scrollbar {
    width: 6px;
}
.track-list-panel::-webkit-scrollbar-track {
    background: transparent;
}
.track-list-panel::-webkit-scrollbar-thumb {
    background: var(--color-scrollbar-thumb);
    border-radius: 3px;
}
.track-list-panel::-webkit-scrollbar-thumb:hover {
    background: var(--color-scrollbar-thumb-hover);
}

/* ── Week sections (in list panel) ───────────── */
.list-week-section {
    padding: 0;
}
.list-week-title {
    font-size: 0.7rem;
    font-weight: 450;
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 12px 16px 6px;
    margin: 0;
    position: sticky;
    top: 0;
    background: var(--color-bg);
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}
.list-week-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--color-border);
}
.list-week-title.at-top::after {
    display: none;
}

/* ── Track item (compact list row) ───────────── */
.track-item {
    display: flex;
    align-items: center;
    column-gap: 30px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    border-left: 2px solid transparent;
    transition: background 0.15s ease;
    position: relative;
    outline: none;
    flex-wrap: wrap;
}
.track-item:last-child {
    border-bottom: none;
}
.track-item:hover {
    background: var(--color-hover-overlay);
}
.kb-nav .track-item:hover {
    background: transparent;
}
.track-item.active {
    background: linear-gradient(
        90deg,
        var(--color-active-gradient-start) 0%,
        var(--color-active-gradient-end) 70%,
        transparent 100%
    );
    border-left-color: var(--color-gold);
}
.track-item:focus-visible {
    box-shadow: inset 0 0 0 2px var(--color-focus-shadow);
}

/* Compact artwork in list */
.list-art {
    width: 80px;
    height: 80px;
    border-radius: 3px;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
    color: transparent;
    font-size: 0;
    background: var(--color-bg-hover);
    transition: filter 0.15s ease;
}
.track-item:hover .list-art {
    filter: brightness(1.12);
}
.list-art-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 3px;
    background: var(--color-bg-hover);
    flex-shrink: 0;
    position: relative;
}
.list-art-placeholder::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44%;
    height: 44%;
    border-radius: 50%;
    border: 1.5px solid var(--color-border);
}
.list-art-placeholder::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--color-border);
}

/* List item text */
.list-info {
    flex: 1;
    min-width: 0;
}
.list-track-name {
    font-size: 1.12rem;
    font-weight: 460;
    color: var(--color-text);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.list-artist {
    font-size: 0.92rem;
    font-weight: var(--font-weight-body);
    color: var(--color-text-muted);
    line-height: 1.3;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.list-source {
    font-size: 0.82rem;
    color: var(--color-gold);
    text-decoration: none;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.list-cats {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-end;
    margin-left: auto;
    flex-shrink: 0;
}
.list-cat {
    font-size: 0.78rem;
    font-weight: 450;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* ── Expand chevron indicator (scan mode only) ── */
.list-chevron {
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    opacity: 0.4;
    transition: opacity 0.15s ease, color 0.15s ease, transform 0.25s ease-out;
    flex-shrink: 0;
    margin-left: 8px;
}
.scan-mode .list-chevron {
    display: inline-flex;
    margin-left: auto;
}
.scan-mode .list-cats ~ .list-chevron {
    margin-left: 8px;
}
.track-item:hover .list-chevron,
.track-item.kb-focus .list-chevron {
    opacity: 0.7;
    color: var(--color-gold);
}
.track-item.active .list-chevron {
    opacity: 1;
    color: var(--color-gold);
    transform: rotate(180deg);
}

/* ── Keyboard focus highlight ────────────────── */
.track-item.kb-focus {
    background: linear-gradient(
        90deg,
        var(--color-active-gradient-start) 0%,
        var(--color-active-gradient-end) 70%,
        transparent 100%
    );
    border-left-color: var(--color-gold);
}

/* ── Detail panel (right) ────────────────────── */
.detail-panel {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    padding: 28px 32px 40px;
    min-width: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--color-scrollbar-thumb) transparent;
}
.detail-panel::-webkit-scrollbar {
    width: 6px;
}
.detail-panel::-webkit-scrollbar-track {
    background: transparent;
}
.detail-panel::-webkit-scrollbar-thumb {
    background: var(--color-scrollbar-thumb);
    border-radius: 3px;
}
.detail-panel::-webkit-scrollbar-thumb:hover {
    background: var(--color-scrollbar-thumb-hover);
}

/* ── Detail empty state ──────────────────────── */
.detail-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--color-text-secondary);
    padding: 40px 20px;
}
.detail-empty-icon {
    font-family: "Financier Display", Georgia, "Times New Roman", Times, serif;
    font-size: 1.6rem;
    color: var(--color-border);
    margin-bottom: 16px;
    letter-spacing: 0.2em;
}
.detail-empty-title {
    font-family: "Financier Display", Georgia, "Times New Roman", Times, serif;
    font-style: normal;
    font-weight: var(--font-weight-heading);
    font-size: clamp(18px, 1.3vw, 22px);
    letter-spacing: 0.02em;
    margin-bottom: 8px;
}
.detail-empty-hint {
    font-size: clamp(13px, 0.85vw, 14px);
    color: var(--color-text-muted);
}

/* ── Detail content (populated by JS) ────────── */
.detail-content {
    max-width: 620px;
}

/* Detail header: artwork + track meta */
.detail-header {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 28px;
}

/* Large artwork in detail panel */
.detail-art-wrap {
    width: 200px;
    height: 200px;
    border-radius: 6px;
    overflow: hidden;
    background:
        radial-gradient(circle at center, var(--color-border) 4px, transparent 5px),
        radial-gradient(circle at center, transparent 43px, var(--color-border) 43px, var(--color-border) 44.5px, transparent 44.5px),
        var(--color-bg-hover);
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}
.detail-art-wrap:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px var(--color-cover-shadow);
}
.detail-art-wrap::before {
    content: "";
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3Cline x1='11' y1='8' x2='11' y2='14'/%3E%3Cline x1='8' y1='11' x2='14' y2='11'/%3E%3C/svg%3E");
    background-size: 11px;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1;
    pointer-events: none;
}
.detail-art-wrap:hover::before {
    opacity: 1;
}
.detail-art-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}
.detail-art-wrap:hover .detail-art-img {
    transform: scale(1.03);
}
.detail-art-placeholder {
    width: 200px;
    height: 200px;
    border-radius: 6px;
    background: var(--color-bg-hover);
    flex-shrink: 0;
    position: relative;
}
.detail-art-placeholder::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44%;
    height: 44%;
    border-radius: 50%;
    border: 1.5px solid var(--color-border);
}
.detail-art-placeholder::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-border);
}

/* Detail meta text */
.detail-meta {
    flex: 1;
    min-width: 0;
    padding-top: 4px;
}
.detail-track-name {
    font-size: 1.6rem;
    font-weight: 460;
    color: var(--color-text);
    line-height: 1.2;
    margin-bottom: 4px;
}
.detail-artist {
    font-size: 0.88rem;
    font-weight: var(--font-weight-body);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.3;
}
.detail-album {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    font-style: italic;
    margin-top: 2px;
    opacity: 0.8;
}
.detail-source {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.82rem;
    color: var(--color-gold);
    text-decoration: none;
    transition: color 0.15s ease;
    line-height: 1.3;
}
.detail-source:hover {
    text-decoration: none;
}

/* Streaming service links in detail */
.detail-services {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    margin-top: 14px;
}
/* Icon sprite (hidden) */
.icon-sprite {
    display: none;
}
.si {
    width: 11px;
    height: 11px;
    fill: currentColor;
    flex-shrink: 0;
}
.service-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    text-decoration: none;
    transition:
        border-color 0.15s ease,
        color 0.15s ease;
    position: relative;
}
.service-link::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    background: var(--color-text);
    color: var(--color-bg);
    font-size: 10px;
    font-weight: 400;
    padding: 3px 7px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
}
.service-link::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 3px);
    left: 50%;
    transform: translateX(-50%);
    border: 3px solid transparent;
    border-top-color: var(--color-text);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}
@media (hover: hover) {
    .service-link:hover::after,
    .service-link:focus-visible::after {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
    .service-link:hover::before,
    .service-link:focus-visible::before {
        opacity: 1;
    }
}
.service-link:hover {
    border-color: var(--color-gold);
    color: var(--color-gold);
}
.service-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--color-focus-shadow);
}

/* ── Editorial section in detail ─────────────── */
.detail-editorial {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
}
.detail-editorial-label {
    font-size: 0.72rem;
    font-weight: 450;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-bottom: 10px;
}
.detail-editorial-attr {
    font-family: "Financier Text", Georgia, "Times New Roman", Times, serif;
    font-style: italic;
    font-weight: 380;
    text-transform: none;
    letter-spacing: normal;
    opacity: 0.6;
}
.detail-editorial-text {
    font-weight: var(--font-weight-body);
    line-height: 1.55;
    color: var(--color-text-body);
    font-size: 1rem;
    margin-top: 6px;
}

/* Subcategory groups in detail */
.detail-subcats {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
    margin-top: 16px;
    justify-content: space-between;
}
.detail-subcats:not(:has(> :nth-child(3))) {
    justify-content: flex-start;
    gap: 28px 80px;
}
/* Scan/mobile inline expand: always align left regardless of category count */
.detail-reveal .detail-subcats {
    justify-content: flex-start;
    gap: 28px 80px;
}
.detail-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 10px;
}
.detail-parent {
    font-size: 0.82rem;
    font-weight: 450;
    color: var(--color-text-muted);
    letter-spacing: 0.06em;
}
.detail-subs {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.detail-sub-tag {
    font-size: 0.85rem;
    font-weight: var(--font-weight-body);
    color: var(--color-text-secondary);
}

/* Empty / no-results state */
.tracks-empty {
    display: none;
    text-align: center;
    padding: 80px 20px 60px;
    color: var(--color-text-secondary);
}
.tracks-empty.visible {
    display: block;
}
.tracks-empty::before {
    content: "—";
    display: block;
    font-family: "Financier Display", Georgia, "Times New Roman", Times, serif;
    font-size: 1.6rem;
    color: var(--color-border);
    margin-bottom: 20px;
    letter-spacing: 0.2em;
}
.tracks-empty-title {
    font-family: "Financier Display", Georgia, "Times New Roman", Times, serif;
    font-style: normal;
    font-weight: var(--font-weight-heading);
    font-size: clamp(20px, 1.5vw, 24px);
    letter-spacing: 0.02em;
    color: var(--color-text-secondary);
    margin-bottom: 12px;
}
.tracks-empty-title span {
    color: var(--color-gold);
}
.tracks-empty-hint {
    font-family: "Untitled Sans", sans-serif;
    font-size: clamp(13px, 0.9vw, 14px);
    color: var(--color-text-muted);
    line-height: 1.6;
}
.tracks-empty-clear {
    color: var(--color-gold);
    cursor: pointer;
    text-decoration: none;
    background: none;
    border: none;
    font: inherit;
    border-bottom: 1px solid transparent;
    transition: border-color 200ms ease;
}
.tracks-empty-clear:hover {
    border-bottom-color: var(--color-gold);
}
.tracks-empty-clear:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--color-focus-shadow);
    border-radius: 2px;
}

/* ── Mobile inline expand (detail-reveal) ───── */
.detail-reveal {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s ease-out;
    width: 100%;
}
.detail-reveal.open {
    grid-template-rows: 1fr;
}
.detail-reveal > div {
    overflow: hidden;
    transform: translateY(8px);
    opacity: 0;
    transition: transform 0.35s ease-out, opacity 0.25s ease-out;
}
.detail-reveal.open > div {
    transform: translateY(0);
    opacity: 1;
}
.mobile-detail-content {
    margin-top: 12px;
    padding: 12px 16px 16px 95px;
    border-top: 1px solid var(--color-border);
}
.mobile-detail-editorial {
    font-weight: var(--font-weight-body);
    line-height: 1.55;
    color: var(--color-text-body);
    font-size: 1rem;
    margin-bottom: 10px;
    max-width: 65ch;
}
.mobile-detail-source {
    font-size: 0.82rem;
    color: var(--color-gold);
    text-decoration: none;
}
.mobile-detail-source:hover {
    text-decoration: none;
}
.mobile-detail-services {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.mobile-detail-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 10px;
}

/* ── View mode toggle ────────────────────────── */
.view-toggle {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    margin-top: 28px;
    margin-bottom: -10px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 0 0 1px var(--color-border);
}
.view-btn {
    position: relative;
    background: none;
    border: none;
    padding: 5px 7px;
    cursor: pointer;
    color: var(--color-text-muted);
    transition: background 0.15s ease, color 0.15s ease;
    font-family: inherit;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.view-btn + .view-btn {
    border-left: 1px solid var(--color-border);
}
.view-btn:hover {
    color: var(--color-gold);
}
.view-btn.active {
    background: var(--color-gold);
    border-color: transparent;
    color: #fff;
}
.view-btn:focus-visible {
    outline: 2px solid var(--color-focus-shadow);
    outline-offset: -2px;
}
.view-btn svg {
    display: block;
}
.view-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    background: var(--color-text);
    color: var(--color-bg);
    font-size: 10px;
    font-weight: 400;
    padding: 3px 7px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
}
.view-btn::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 3px);
    left: 50%;
    transform: translateX(-50%);
    border: 3px solid transparent;
    border-top-color: var(--color-text);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}
@media (hover: hover) {
    .view-btn:hover::after,
    .view-btn:focus-visible::after {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
    .view-btn:hover::before,
    .view-btn:focus-visible::before {
        opacity: 1;
    }
}

/* ── Detail mode: hide categories (shown in detail panel) ── */
.master-detail:not(.scan-mode) .list-cats {
    display: none;
}

/* ── Scan mode ───────────────────────────────── */
.master-detail.scan-mode .detail-panel {
    opacity: 0;
    transform: translateX(24px);
    pointer-events: none;
    flex: 0;
    width: 0;
    min-width: 0;
    padding: 0;
    overflow: hidden;
}
.master-detail.scan-mode .track-list-panel {
    width: 100%;
    border-right-color: transparent;
}
.master-detail.scan-mode .mobile-detail-content {
    padding-left: 110px;
}

/* ── View mode transition (Scan ↔ Detail) ──── */
@media (min-width: 681px) {
    .track-list-panel {
        transition:
            width 0.45s cubic-bezier(0.4, 0, 0.2, 1),
            border-color 0.22s ease 0.09s;
    }
    /* Reveal: scan → detail (slower, elegant) */
    .master-detail:not(.scan-mode) .detail-panel {
        transition:
            opacity 0.45s ease-out 0.08s,
            transform 0.45s ease-out 0.08s;
    }
    /* Collapse: detail → scan (faster, decisive) */
    .master-detail.scan-mode .detail-panel {
        transition:
            opacity 0.2s ease,
            transform 0.2s ease;
    }
}

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

@media (max-width: 767px) {
    .site-nav {
        gap: 14px;
    }
}

@media (max-width: 700px) {
    .hero-top {
        flex-direction: column;
        gap: 8px;
    }
    .playlist-right {
        align-items: flex-start;
    }
}

/* ── Mobile: full-width list, no detail panel ── */
@media (max-width: 680px) {
    .view-toggle {
        display: none;
    }

    .tracks-container {
        padding: 1rem 0 0;
    }

    .master-detail {
        height: auto;
        min-height: 0;
        display: block;
        border-top: 1px solid var(--color-border);
    }
    .master-detail.has-scroll-overflow::after {
        display: none;
    }

    .track-list-panel {
        width: 100%;
        min-width: 0;
        border-right: none;
        overflow-y: visible;
    }

    .detail-panel {
        display: none;
    }

    .track-item {
        padding: 10px 12px;
    }

    .list-art {
        width: 48px;
        height: 48px;
    }
    .list-art-placeholder {
        width: 48px;
        height: 48px;
    }

    .mobile-detail-content {
        padding-left: 75px;
    }
}

@media (max-width: 480px) {
    .mobile-detail-content {
        padding-left: 12px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .detail-art-wrap:hover .detail-art-img {
        transform: none;
    }
    .detail-reveal,
    .detail-reveal > div {
        transition: none;
    }
    .detail-reveal > div {
        transform: none;
        opacity: 1;
    }
    .track-item,
    .track-list-panel,
    .detail-panel {
        transition: none;
    }
}

/* Source colors use --color-gold token directly; no dark-mode override needed */
