/* 回収済み楽曲 統合ページ（Issue #306） */
/* サマリー・一覧・詳細の基本スタイルは collected_song.css / collected.css / appearance_detail.css を併用する */

.cs-union-container {
    width: 100%;
    margin: 0;
    padding: 14px 15px 30px;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .cs-union-container {
        padding: 20px 30px 40px;
    }
}

/* サマリー：スマホはスライダー、900px以上は3カード横並び */
.cs-union-container .cs-summary-grid {
    display: none;
}

.cs-slider-wrap {
    display: block;
}

@media (min-width: 900px) {
    .cs-union-container .cs-summary-grid {
        display: grid;
    }

    .cs-slider-wrap {
        display: none;
    }
}

.cs-slider {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 2px 2px 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.cs-slider::-webkit-scrollbar {
    display: none;
}

.cs-slider .cs-summary-card {
    flex: 0 0 100%;
    scroll-snap-align: start;
}

/* サマリーカード＝集計対象の切替（クリック／スライドで切替） */
.cs-union-container .cs-summary-card {
    cursor: pointer;
}

.cs-union-container .cs-summary-head {
    display: flex;
    align-items: center;
}

.cs-union-container .cs-summary-card.is-current {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 2px var(--theme-primary), 0 6px 18px rgba(61, 44, 46, .06);
}

.cs-current-badge {
    margin-left: auto;
    padding: 3px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--theme-btn-from), var(--theme-primary));
    color: #fff;
    font-size: 11px;
    font-weight: bold;
}

.cs-slider-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 2px;
}

.cs-slider-dots .dot {
    position: relative;
    width: 7px;
    height: 7px;
    border-radius: 99px;
    background: var(--theme-border);
    cursor: pointer;
}

.cs-slider-dots .dot::after {
    content: "";
    position: absolute;
    inset: -10px -6px;
}

.cs-slider-dots .dot.active {
    width: 18px;
    background: var(--theme-primary);
}

/* タブ */
.cs-union-tabs {
    display: flex;
    gap: 5px;
    margin: 16px 0 14px;
    padding: 5px;
    background: #fff;
    border: 1px solid var(--theme-border-soft);
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(61, 44, 46, .06);
}

.cs-union-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    border-radius: 999px;
    color: var(--theme-text-sub);
    font-size: 13.5px;
    font-weight: bold;
    text-decoration: none;
    white-space: nowrap;
}

.cs-union-tab .cnt {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--theme-blush);
    color: var(--theme-primary);
    font-size: 11.5px;
}

.cs-union-tab.active {
    background: linear-gradient(135deg, var(--theme-btn-from), var(--theme-primary));
    color: #fff;
}

.cs-union-tab.active .cnt {
    background: rgba(255, 255, 255, .25);
    color: #fff;
}

@media (min-width: 900px) {
    .cs-union-tab {
        min-height: 44px;
        font-size: 14.5px;
    }
}

/* リスト差し替え中の表示 */
#cs-list-area {
    transition: opacity .15s;
}

#cs-list-area.is-loading {
    opacity: .45;
    pointer-events: none;
}

/* 詳細オーバーレイ（.page-scrollの外に置き、開くときにJSでbody直下へ移す） */
.cs-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(61, 44, 46, .45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
    z-index: 1500;
}

.cs-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.cs-side-panel {
    display: none;
}

@media (min-width: 1100px) {
    .cs-side-panel {
        display: block;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 520px;
        max-width: 94vw;
        background: #fdf7f8;
        z-index: 1600;
        transform: translateX(105%);
        transition: transform .28s;
        overflow-y: auto;
        padding: 22px 22px 30px;
        box-sizing: border-box;
        box-shadow: -12px 0 32px rgba(61, 44, 46, .18);
    }

    .cs-side-panel.open {
        transform: none;
    }
}

.cs-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1600;
    background: #fdf7f8;
    border-radius: 24px 24px 0 0;
    max-height: 82dvh;
    overflow-y: auto;
    transform: translateY(105%);
    transition: transform .28s;
    padding: 8px 18px 26px;
    box-sizing: border-box;
    box-shadow: 0 -12px 32px rgba(61, 44, 46, .2);
}

.cs-sheet.open {
    transform: none;
}

@media (min-width: 1100px) {
    .cs-sheet {
        display: none;
    }
}

.cs-sheet-handle {
    width: 44px;
    height: 5px;
    border-radius: 99px;
    background: #e8cdd3;
    margin: 4px auto 10px;
}

/* 詳細パネル／シートの中身 */
.cs-detail-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.cs-detail-kicker {
    color: var(--theme-primary);
    font-size: 11px;
    font-weight: bold;
    letter-spacing: .14em;
}

.cs-detail-close {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: var(--theme-blush);
    color: var(--theme-primary);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.cs-side-panel .cs-song-card,
.cs-sheet .cs-song-card {
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.cs-side-panel .cs-events-head,
.cs-sheet .cs-events-head {
    margin-top: 22px;
}

.cs-side-panel .appearance-list,
.cs-sheet .appearance-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.cs-side-panel .appearance-card,
.cs-sheet .appearance-card {
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--theme-border-soft);
    border-radius: 18px;
    box-shadow: 0 6px 18px rgba(61, 44, 46, .06);
}

.cs-side-panel .appearance-card + .appearance-card,
.cs-sheet .appearance-card + .appearance-card {
    border-top: 1px solid var(--theme-border-soft);
}

.cs-detail-empty {
    padding: 30px 10px;
    color: var(--theme-text-sub);
    font-size: 14px;
    text-align: center;
}

/* 一覧の読み込み中表示（一覧エリア内だけ） */
.cs-list-wrap {
    position: relative;
    min-height: 120px;
}

.cs-list-loading {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .78);
    color: var(--theme-text-sub);
    font-size: 13.5px;
    font-weight: bold;
}

.cs-list-loading[hidden] {
    display: none;
}

.cs-spinner {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid var(--theme-border);
    border-top-color: var(--theme-primary);
    animation: cs-spin .8s linear infinite;
}

@keyframes cs-spin {
    to { transform: rotate(360deg); }
}

/* PCの詳細パネルも、スマホと同じイベント行レイアウトにそろえる */
.cs-side-panel .appearance-card {
    display: grid;
    grid-template-columns: 92px 1fr;
    grid-template-areas: "date name" "flag meta" ". btn";
    column-gap: 12px;
    row-gap: 6px;
    align-items: start;
}

.cs-side-panel .appearance-info,
.cs-side-panel .appearance-head {
    display: contents;
}

.cs-side-panel .appearance-date-chip {
    grid-area: date;
    width: auto;
    height: auto;
    min-height: 56px;
    padding: 6px 2px;
    border-radius: 14px;
}

.cs-side-panel .adc-year {
    display: block;
    font-size: 10px;
    font-weight: bold;
    line-height: 1.25;
}

.cs-side-panel .appearance-type {
    grid-area: flag;
    justify-self: center;
    margin-top: 2px;
}

.cs-side-panel .appearance-name {
    grid-area: name;
    align-self: center;
}

.cs-side-panel .appearance-meta {
    grid-area: meta;
    margin-top: 0;
}

.cs-side-panel .appearance-meta-date {
    display: none;
}

.cs-side-panel .detail-btn {
    grid-area: btn;
    justify-self: end;
    margin-top: 4px;
}
