.heatfm-mp3-library {
    --heatfm-accent: #f23846;
    --heatfm-dark: #111318;
    --heatfm-panel: #181b21;
    --heatfm-soft: #f5f6f8;
    --heatfm-border: #e4e7ec;
    display: grid;
    gap: 2rem;
    width: 100%;
}

.heatfm-show-group {
    border: 1px solid var(--heatfm-border);
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 16px 45px rgba(17, 19, 24, .10);
}

.heatfm-show-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.3rem 1.5rem;
    color: #fff;
    background: linear-gradient(120deg, var(--heatfm-dark), #252a33 62%, var(--heatfm-accent));
}

.heatfm-show-banner__eyebrow {
    display: block;
    margin-bottom: .2rem;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    opacity: .72;
}

.heatfm-show-banner__title {
    margin: 0 !important;
    color: #fff !important;
    font-size: clamp(1.35rem, 2.6vw, 2rem);
    line-height: 1.1;
}

.heatfm-show-banner__count {
    flex: 0 0 auto;
    padding: .55rem .8rem;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    font-size: .82rem;
    font-weight: 700;
}

.heatfm-show-description {
    padding: .85rem 1.5rem;
    border-bottom: 1px solid var(--heatfm-border);
    background: #fff;
}

.heatfm-show-description > :last-child { margin-bottom: 0; }

.heatfm-archive-table { width: 100%; }

.heatfm-archive-header,
.heatfm-archive-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) minmax(130px, .7fr) minmax(100px, .55fr) minmax(90px, .5fr) minmax(260px, 1.5fr);
    align-items: center;
}

.heatfm-archive-header {
    padding: .85rem 1rem;
    color: #fff;
    background: var(--heatfm-panel);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.heatfm-archive-header > div,
.heatfm-archive-cell { padding: .45rem .55rem; }

.heatfm-archive-row {
    padding: .55rem 1rem;
    border-bottom: 1px solid var(--heatfm-border);
    transition: background-color .18s ease, transform .18s ease;
}

.heatfm-archive-row:last-child { border-bottom: 0; }
.heatfm-archive-row:hover { background: #fafbfc; }

.heatfm-file-cell { min-width: 0; }
.heatfm-episode-title {
    display: block;
    margin-bottom: .15rem;
    color: var(--heatfm-dark);
    font-size: .98rem;
}
.heatfm-file-name {
    display: block;
    overflow: hidden;
    color: #69707d;
    font-size: .78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.heatfm-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .4rem .62rem;
    border-radius: 999px;
    background: var(--heatfm-soft);
    color: #303640;
    font-size: .82rem;
    font-weight: 700;
}

.heatfm-player-cell { min-width: 0; }
.heatfm-mp3-audio {
    display: block;
    width: 100%;
    height: 40px;
    margin: 0 0 .45rem;
}

.heatfm-mp3-download {
    display: inline-block;
    padding: .48rem .78rem;
    border-radius: 8px;
    background: var(--heatfm-accent);
    color: #fff !important;
    font-size: .8rem;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none !important;
    transition: transform .15s ease, opacity .15s ease;
}
.heatfm-mp3-download:hover { transform: translateY(-1px); opacity: .9; }
.heatfm-mp3-empty { padding: 1rem; }

@media (max-width: 900px) {
    .heatfm-archive-header { display: none; }
    .heatfm-archive-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: .3rem .8rem;
        padding: 1rem;
    }
    .heatfm-file-cell,
    .heatfm-player-cell { grid-column: 1 / -1; }
    .heatfm-archive-cell::before {
        content: attr(data-label);
        display: block;
        margin-bottom: .25rem;
        color: #858b96;
        font-size: .67rem;
        font-weight: 800;
        letter-spacing: .06em;
        text-transform: uppercase;
    }
    .heatfm-file-cell::before,
    .heatfm-player-cell::before { margin-top: .1rem; }
}

@media (max-width: 520px) {
    .heatfm-show-banner { align-items: flex-start; flex-direction: column; }
    .heatfm-archive-row { grid-template-columns: 1fr; }
    .heatfm-file-cell,
    .heatfm-player-cell { grid-column: auto; }
}

/* Heat FM 30-day archive notice */
.heatfm-retention-notice {
    margin: 0 0 24px;
    padding: 18px 22px;
    border: 1px solid rgba(255,255,255,.16);
    border-left: 5px solid #ffb000;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(24,24,28,.98), rgba(45,21,8,.96));
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
    color: #fff;
    font-size: 15px;
    line-height: 1.6;
}
.heatfm-retention-notice strong {
    display: inline-block;
    margin-right: 4px;
    font-weight: 800;
    letter-spacing: .01em;
}


/* Expiration date shown beside the public listen/download controls */
.heatfm-player-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    flex-wrap: wrap;
}
.heatfm-expiration-date {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .42rem .62rem;
    border: 1px solid #f0d3a0;
    border-radius: 8px;
    background: #fff7e6;
    color: #6d4800;
    font-size: .78rem;
    line-height: 1.2;
}
.heatfm-expiration-date strong {
    font-weight: 800;
}

/* v1.3.0 archive controls, lifetime totals, unique listeners and sharing */
.heatfm-library-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: .65rem;
    margin: -8px 0 0;
    font-size: .86rem;
    font-weight: 700;
}
.heatfm-sort-order {
    min-width: 190px;
    padding: .55rem .75rem;
    border: 1px solid var(--heatfm-border);
    border-radius: 9px;
    background: #fff;
    color: var(--heatfm-dark);
}
.heatfm-show-banner__stats {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}
.heatfm-show-lifetime-stat {
    flex: 0 0 auto;
    padding: .55rem .8rem;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    font-size: .76rem;
    font-weight: 700;
}
.heatfm-share-button,
.heatfm-copy-button {
    appearance: none;
    display: inline-block;
    padding: .48rem .7rem;
    border: 1px solid var(--heatfm-border);
    border-radius: 8px;
    background: #fff;
    color: var(--heatfm-dark);
    cursor: pointer;
    font-size: .78rem;
    font-weight: 800;
    line-height: 1.2;
}
.heatfm-share-button:hover,
.heatfm-copy-button:hover { background: var(--heatfm-soft); }

/* Six public archive columns in v1.3.0 */
.heatfm-archive-header,
.heatfm-archive-row {
    grid-template-columns: minmax(170px, 1.25fr) minmax(120px, .7fr) minmax(95px, .5fr) minmax(85px, .45fr) minmax(115px, .58fr) minmax(290px, 1.55fr);
}

@media (max-width: 900px) {
    .heatfm-library-toolbar { justify-content: flex-start; flex-wrap: wrap; }
    .heatfm-show-banner__stats { justify-content: flex-start; }
}

/* v1.3.1 mobile layout hardening */
.heatfm-mp3-library,
.heatfm-mp3-library *,
.heatfm-mp3-library *::before,
.heatfm-mp3-library *::after {
    box-sizing: border-box;
}

.heatfm-mp3-library,
.heatfm-show-group,
.heatfm-archive-table,
.heatfm-archive-row,
.heatfm-archive-cell,
.heatfm-player-cell {
    max-width: 100%;
    min-width: 0;
}

.heatfm-show-group,
.heatfm-archive-table {
    overflow: hidden;
}

.heatfm-mp3-audio {
    max-width: 100%;
    min-width: 0;
}

.heatfm-file-name,
.heatfm-episode-title,
.heatfm-show-banner__title {
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 900px) {
    .heatfm-archive-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        width: 100%;
    }

    .heatfm-file-cell,
    .heatfm-player-cell {
        grid-column: 1 / -1;
    }

    .heatfm-player-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .heatfm-library-toolbar {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .heatfm-mp3-library {
        gap: 1.25rem;
        width: 100%;
        max-width: 100%;
    }

    .heatfm-retention-notice {
        margin-bottom: 16px;
        padding: 14px 16px;
        font-size: 14px;
    }

    .heatfm-library-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: .4rem;
    }

    .heatfm-sort-order {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .heatfm-show-banner {
        align-items: flex-start;
        flex-direction: column;
        padding: 1.05rem;
    }

    .heatfm-show-banner__stats {
        justify-content: flex-start;
        width: 100%;
    }

    .heatfm-show-banner__count,
    .heatfm-show-lifetime-stat {
        max-width: 100%;
        white-space: normal;
    }

    .heatfm-show-description {
        padding: .8rem 1rem;
    }

    .heatfm-archive-row {
        grid-template-columns: minmax(0, 1fr);
        gap: .55rem;
        padding: .9rem;
    }

    .heatfm-file-cell,
    .heatfm-player-cell {
        grid-column: auto;
    }

    .heatfm-archive-cell {
        width: 100%;
        min-width: 0;
        padding: .35rem .1rem;
    }

    .heatfm-file-name {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }

    .heatfm-stat-pill {
        max-width: 100%;
    }

    .heatfm-mp3-audio {
        width: 100%;
        max-width: 100%;
        height: 42px;
    }

    .heatfm-player-actions {
        align-items: stretch;
        flex-direction: column;
        gap: .5rem;
    }

    .heatfm-mp3-download,
    .heatfm-share-button,
    .heatfm-copy-button,
    .heatfm-expiration-date {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: 100%;
        min-height: 42px;
        text-align: center;
        white-space: normal;
    }
}

@media (max-width: 380px) {
    .heatfm-show-banner,
    .heatfm-archive-row {
        padding-left: .75rem;
        padding-right: .75rem;
    }
}
