body {
    overflow: auto;
}

/* --------------------------------------------------
   Page layout
-------------------------------------------------- */

.pageMain--nextTunes {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.panel {
    border: 1px solid rgba(255, 255, 255, .10);
    background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .03));
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
    overflow: visible;
}

.panelHead {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.panelHead h2 {
    margin: 0;
    font-size: 18px;
}

.panelSub {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.panelBody {
    padding: 18px;
}

.panelBody--recommendations {
    padding-top: 12px;
}

.topGrid {
    display: grid;
    grid-template-columns: minmax(420px, 1.35fr) minmax(280px, 0.95fr);
    gap: 16px;
    align-items: start;
}

.searchPanel,
.summaryPanel,
.recommendationsPanel {
    min-width: 0;
}

/* --------------------------------------------------
   Member search
-------------------------------------------------- */

.memberAddRow {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.searchField {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 0 0 auto;
}

.searchField--wide {
    min-width: 320px;
    flex: 1 1 320px;
}

.searchWrap--field {
    width: 100%;
}

.searchActions {
    display: flex;
    gap: 10px;
    align-items: center;
}

#resetBtn {
    height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    font-weight: 600;
    border: 1px solid var(--stroke);
    cursor: pointer;
    background: rgba(255, 255, 255, .06);
    color: var(--text);
}

#resetBtn:hover {
    background: rgba(255, 255, 255, .12);
}

#memberSearchInput {
    width: 100%;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, .10);
    background: rgba(255, 255, 255, .05);
    color: var(--text);
    border-radius: 10px;
    padding: 0 12px;
    font-size: 14px;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

#memberSearchInput::placeholder {
    color: var(--muted);
}

#memberSearchInput:hover {
    background: rgba(255, 255, 255, .06);
}

#memberSearchInput:focus {
    outline: none;
    border-color: rgba(96, 165, 250, .75);
    background: rgba(255, 255, 255, .07);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, .16);
}

/* --------------------------------------------------
   Selected members
-------------------------------------------------- */

.selectedMembers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.memberChip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .06);
}

.memberChipName {
    font-weight: 700;
    color: var(--text);
}

.memberChipMeta {
    color: var(--muted);
    font-size: 12px;
}

.memberChipRemove {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.memberChipRemove:hover {
    color: #fca5a5;
}

/* --------------------------------------------------
   Summary cards
-------------------------------------------------- */

.summaryCards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.summaryCard {
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .04);
    border-radius: 14px;
    padding: 8px 14px;
}

.summaryCardLabel {
    font-size: 12px;
    color: var(--muted);
}

.summaryCardValue {
    margin-top: 4px;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.05;
}

/* --------------------------------------------------
   Filters
-------------------------------------------------- */

.filterBar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
    margin-bottom: 12px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 14px;
    background: rgba(255, 255, 255, .04);
}

.filterField {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 0 0 auto;
    min-width: 0;
}

.filterField--wide {
    flex: 0 1 320px;
    min-width: 220px;
}

.filterField label {
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
}

.filterField select,
.filterField input,
#clearFiltersBtn {
    height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, .10);
    background: rgba(255, 255, 255, .05);
    color: var(--text);
    font-size: 14px;
    -webkit-appearance: none;
    appearance: none;
}

.filterField input {
    padding: 0 12px;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.filterField input::placeholder {
    color: var(--muted);
}

.filterField input:hover {
    background: rgba(255, 255, 255, .06);
}

.filterField input:focus,
.filterField select:focus,
#clearFiltersBtn:focus {
    outline: none;
    border-color: rgba(96, 165, 250, .75);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, .16);
}

.filterField select {
    width: auto;
    min-width: 120px;
    max-width: 320px;
    padding: 0 32px 0 12px;
}

.filterField select option {
    background: #0f172a;
    color: var(--text);
}

.filterActions {
    display: flex;
    align-items: end;
    flex: 0 0 auto;
}

#clearFiltersBtn {
    padding: 0 14px;
    font-weight: 600;
    cursor: pointer;
}

#clearFiltersBtn:hover {
    background: rgba(255, 255, 255, .09);
}

.filterSummary {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(34, 197, 94, .20);
    background: rgba(34, 197, 94, .08);
    color: #dcfce7;
    font-size: 13px;
    line-height: 1.45;
}

/* --------------------------------------------------
   Table
-------------------------------------------------- */

.recommendationsWrap {
    overflow: auto;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .08);
}

.recommendationsTable {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    background: rgba(255, 255, 255, 0.02);
}

.recommendationsTable th,
.recommendationsTable td {
    padding: 7px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    vertical-align: middle;
    line-height: 1.2;
}

.recommendationsTable th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(11, 15, 20, .96);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.recommendationsTable th.tuneCol,
.recommendationsTable td.tuneColCell {
    text-align: left;
    min-width: 280px;
}

.recommendationsTable th.centerCol,
.recommendationsTable td.centerColCell {
    text-align: center;
    white-space: nowrap;
}

.recommendationsTable td.detailsColCell {
    width: 54px;
    text-align: center;
}

.tuneRowMain {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.recommendationTuneName {
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
}

.recommendationTuneName:hover {
    color: #93c5fd;
    text-decoration: underline;
}

.sourceBadge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 22px;
    padding: 0 8px;
    margin-left: 4px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    vertical-align: middle;
}

.sourceBadge--recordings {
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fde68a;
}

.metricBadge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 12px;
    line-height: 1;
    border: 1px solid rgba(255, 255, 255, .12);
}

.metricBadge--unlocks {
    background: rgba(34, 197, 94, .14);
    border-color: rgba(34, 197, 94, .28);
    color: #bbf7d0;
}

.metricBadge--helps {
    background: rgba(96, 165, 250, .14);
    border-color: rgba(96, 165, 250, .24);
    color: #bfdbfe;
}

.metricBadge--score {
    background: rgba(167, 139, 250, .14);
    border-color: rgba(167, 139, 250, .28);
    color: #ddd6fe;
}

.knownByPill,
.typePill,
.modePill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    border: 1px solid rgba(255, 255, 255, .10);
    background: rgba(255, 255, 255, .05);
    color: var(--text);
}

.knownByPill {
    background: rgba(96, 165, 250, .14);
    border-color: rgba(96, 165, 250, .28);
    color: #bfdbfe;
}

.typePill {
    background: rgba(245, 158, 11, .14);
    border-color: rgba(245, 158, 11, .28);
    color: #fde68a;
}

.modePill {
    background: rgba(167, 139, 250, .14);
    border-color: rgba(167, 139, 250, .28);
    color: #ddd6fe;
}

.tableMuted {
    color: var(--muted);
    font-size: 12px;
}

.tableSortBtn {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

.tableSortBtn:hover {
    color: #93c5fd;
}

.expandBtn {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, .10);
    background: rgba(255, 255, 255, .05);
    color: var(--text);
    width: 30px;
    height: 30px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
}

.expandBtn:hover {
    background: rgba(255, 255, 255, .10);
}

.detailRow {
    display: none;
}

.detailRow.is-open {
    display: table-row;
}

.detailCell {
    padding: 0 !important;
    background: rgba(255, 255, 255, 0.015);
}

.detailPanel {
    padding: 14px;
}

.detailTop {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.detailTitle {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
}

.detailMeta {
    font-size: 13px;
    color: var(--muted);
}

.detailGroups {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.detailGroup {
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .03);
    border-radius: 14px;
    padding: 12px;
}

.detailGroup h4 {
    margin: 0 0 10px;
    font-size: 14px;
}

.detailSetList {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detailSetItem {
    border: 1px solid rgba(255, 255, 255, .05);
    background: rgba(255, 255, 255, .025);
    border-radius: 10px;
    padding: 10px 12px;
}

.detailSetMeta {
    font-size: 12px;
    color: #94a3b8;
    gap: 8px;
}

.detailTuneLine {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.detailTunePill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    border: 1px solid rgba(255, 255, 255, .10);
    background: rgba(255, 255, 255, .05);
    color: var(--text);
    cursor: pointer;
    text-decoration: none;

}

.detailTunePill:hover,
.detailTunePill:focus,
.detailTunePill:active {
    transform: translateY(-1px);
    text-decoration: none;
}

.detailTunePill--known {
    background: rgba(34, 197, 94, .14);
    border-color: rgba(34, 197, 94, .28);
    color: #bbf7d0;
}

.detailTunePill--missing {
    background: rgba(239, 68, 68, .12);
    border-color: rgba(239, 68, 68, .24);
    color: #fecaca;
}

.detailTunePill--target {
    background: rgba(245, 158, 11, .18);
    border-color: rgba(245, 158, 11, .30);
    color: #fde68a;
}

.emptyMini {
    color: var(--muted);
    font-size: 13px;
}

/* --------------------------------------------------
   Links / icons
-------------------------------------------------- */

.sessionIconLink {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    transition: all 0.15s ease;
    flex: 0 0 auto;
    opacity: 0.85;
}

.sessionIconLink:hover {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.3);
    transform: translateY(-1px);
    opacity: 1;
}

.sessionIconLink img {
    width: 22px;
    height: 22px;
    display: block;
    object-fit: contain;
}

.trackOverviewLink {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
    flex: 0 0 auto;
}

.trackOverviewDot {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, #fde68a, #f59e0b);
    box-shadow:
        0 0 0 1px rgba(245, 158, 11, 0.5),
        0 0 6px rgba(245, 158, 11, 0.6);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.trackOverviewLink:hover .trackOverviewDot {
    transform: scale(1.2);
    box-shadow:
        0 0 0 1px rgba(245, 158, 11, 0.7),
        0 0 10px rgba(245, 158, 11, 0.9);
}

/* --------------------------------------------------
   Stars
-------------------------------------------------- */

.popCol {
    width: 90px;
    text-align: center;
}

.popColCell {
    text-align: center;
    font-size: 28px;
}

.starRating {
    display: inline-block;
    color: #f5c518;
}

.star {
    letter-spacing: 1px;
}

.star--filled {
    color: #f5c518;
}

.star--empty {
    color: rgba(255, 255, 255, 0.2);
}

.starRating--unknown {
    color: rgba(255, 255, 255, 0.3);
}

/* --------------------------------------------------
   States
-------------------------------------------------- */

.emptyState,
.errorState,
.loadingState {
    padding: 10px 0;
}

/* --------------------------------------------------
   Responsive
-------------------------------------------------- */

@media (max-width: 1100px) {
    .topGrid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px),
(max-height: 520px) {
    .summaryPanel {
        display: none;
    }

    .recommendationsTable th.popCol,
    .recommendationsTable td.popColCell,
    .recommendationsTable th.typeCol,
    .recommendationsTable td.typeColCell,
    .recommendationsTable th.modeCol,
    .recommendationsTable td.modeColCell,
    .recommendationsTable th.scoreCol,
    .recommendationsTable td.scoreColCell,
    .recommendationsTable th.appearancesCol,
    .recommendationsTable td.appearancesColCell {
        display: none;
    }

    .recommendationsTable th.tuneCol,
    .recommendationsTable td.tuneColCell {
        min-width: 220px;
    }

    .detailGroups {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .summaryCards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .memberAddRow {
        align-items: stretch;
    }

    .searchActions {
        margin-left: 0;
    }
}

@media (max-width: 700px) {
    .sourceBadge--recordings {
        display: none;
    }

    .searchField--wide {
        min-width: 100%;
        flex: 1 1 100%;
    }

    .searchActions {
        flex: 1 1 100%;
    }

    .summaryCards {
        grid-template-columns: 1fr;
    }

    .filterBar {
        flex-direction: column;
        align-items: stretch;
    }

    .filterField,
    .filterField--wide,
    .filterActions {
        flex: 1 1 100%;
    }

    .filterField select,
    #clearFiltersBtn {
        width: 100%;
        max-width: none;
    }

    .panelHead {
        padding-left: 14px;
        padding-right: 14px;
    }

    .panelBody {
        padding-left: 14px;
        padding-right: 14px;
    }
}

.recommendationsWrap,
.recommendationsTable,
.recommendationsTable td,
.recommendationsTable th {
    overflow: visible;
}

.tuneColCell,
.tuneRowMain {
    overflow: visible;
}

.tteIncipitTooltip,
.incipitTooltip,
.abcTooltip {
    max-width: min(420px, calc(100vw - 24px));
    box-sizing: border-box;
}

.detailSetMeta {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.detailMemberLink {
    color: #7dd3fc;
    font-weight: 700;
    text-decoration: none;
}

.detailMemberLink:hover {
    color: #bae6fd;
    text-decoration: none;
}

.detailSetId,
.detailSetDate,
.detailSetRepeat {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    line-height: 1;
    border: 1px solid rgba(255, 255, 255, .10);
    background: rgba(255, 255, 255, .05);
}

.detailSetId {
    color: #cbd5e1;
}

.detailSetDate {
    color: #94a3b8;
}

.detailSetRepeat {
    color: #94a3b8;
}

.infoIcon {
    margin-left: 4px;
    font-size: 11px;
    opacity: 0.6;
    cursor: help;
}

.infoIcon:hover {
    opacity: 1;
}

.filterLabelText {
    display: inline-block;
    cursor: help;
    border-bottom: 1px dotted rgba(255, 255, 255, .15);
}

.filterLabelText:hover {
    border-bottom-color: rgba(255, 255, 255, .35);
}

.filterInfoIcon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    color: #cbd5e1;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    cursor: help;
    user-select: none;
    opacity: .82;
}

.filterInfoIcon:hover,
.filterInfoIcon:focus {
    opacity: 1;
    background: rgba(96, 165, 250, .16);
    border-color: rgba(96, 165, 250, .28);
    color: #dbeafe;
    outline: none;
}

.simpleTooltip {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1.4;
    color: #cbd5e1;
    max-width: 260px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .12s ease, transform .12s ease;
}

.simpleTooltip.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.detailSetLink {
    color: #93c5fd;
    text-decoration: none;
    margin-left: 6px;
}

.detailSetLink:hover {
    text-decoration: none;
    color: #bfdbfe;
}

.detailTunePillWrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 6px;
}

.detailTuneSessionLink img {
    width: 14px;
    height: 14px;
    opacity: 0.85;
}

.detailTuneSessionLink:hover img {
    opacity: 1;
}