.epg_page {
    box-sizing: border-box;
    width: min(100%, 1440px);
    margin: 0 auto;
    padding: 1.5rem clamp(1rem, 3vw, 2.5rem) 2.5rem;
}

.epg_page *,
.epg_page *::before,
.epg_page *::after {
    box-sizing: inherit;
}

.epg_header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.epg_heading {
    min-width: 0;
}

.epg_back {
    display: inline-flex;
    gap: .45rem;
    align-items: center;
    margin-bottom: .7rem;
    color: #365f91;
    font-size: .92rem;
    font-weight: 600;
    text-decoration: none;
}

.epg_back:hover,
.epg_back:focus {
    text-decoration: underline;
}

.epg_title {
    max-width: 980px;
    margin: 0;
    color: #202733;
    font-size: clamp(1.3rem, 2.3vw, 2rem);
    line-height: 1.25;
}

.epg_meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .65rem;
    margin-top: .75rem;
    color: #5d6673;
    font-size: .9rem;
}

.epg_badge {
    display: inline-flex;
    align-items: center;
    min-height: 1.8rem;
    padding: .2rem .65rem;
    border: 1px solid #d6dde6;
    border-radius: 999px;
    background: #f4f7fa;
    color: #314256;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.epg_actions {
    display: flex;
    flex: 0 0 auto;
    gap: .6rem;
}

.epg_button {
    min-height: 2.55rem;
    padding: .55rem .9rem;
    border: 1px solid #c9d2dd;
    border-radius: .45rem;
    background: #fff;
    color: #263546;
    cursor: pointer;
    font: inherit;
    font-size: .9rem;
    font-weight: 650;
}

.epg_button:hover,
.epg_button:focus {
    border-color: #7890aa;
    background: #f3f6f9;
}

.epg_button_primary {
    border-color: #365f91;
    background: #365f91;
    color: #fff;
}

.epg_button_primary:hover,
.epg_button_primary:focus {
    border-color: #294a72;
    background: #294a72;
}

.epg_viewer {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: min(var(--epg-viewer-height, 900px), calc(100vh - 9rem));
    min-height: 580px;
    border: 1px solid #cfd7e1;
    border-radius: .55rem;
    background: #e9edf2;
    box-shadow: 0 12px 35px rgba(23, 38, 54, .12);
}

.epg_frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

.epg_message,
.epg_help {
    margin: .85rem 0 0;
    color: #5d6673;
    font-size: .88rem;
}

.epg_viewer:fullscreen {
    width: 100vw;
    height: 100vh;
    min-height: 0;
    border: 0;
    border-radius: 0;
}

@media (max-width: 720px) {
    .epg_header {
        align-items: stretch;
        flex-direction: column;
    }

    .epg_actions {
        width: 100%;
    }

    .epg_button {
        flex: 1 1 50%;
    }

    .epg_viewer {
        height: calc(100vh - 5rem);
        min-height: 520px;
        border-radius: .35rem;
    }
}
