/* ==========================================================================
   График серий — 1:1 с макетом (ПК: таблица / моб: карточки)
   ========================================================================== */
section.pmovie__episodes-graph.ep-graph {
    --eg-green: rgb(var(--success-rgb));
    --eg-line: #e6e8ec;
    --eg-tab-bg: #f0f1f3;
    --eg-head-bg: #f3f4f6;
    --eg-text: #1a1a1a;
    --eg-muted: #9ca3af;
    --eg-radius: 10px;
}

section.pmovie__episodes-graph.ep-graph .ep-graph__title,
section.pmovie__episodes-graph.ep-graph > h2 {
    margin: 0 0 16px;
    padding: 0;
    color: var(--eg-text);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

section.pmovie__episodes-graph.ep-graph .ep-graph__title .text-wd,
section.pmovie__episodes-graph.ep-graph > h2 .text-wd {
    color: var(--eg-text);
}

section.pmovie__episodes-graph.ep-graph .ep-graph__title .title-bg::before,
section.pmovie__episodes-graph.ep-graph > h2 .title-bg::before {
    display: none;
}

section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-panels {
    display: block;
}

section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    width: 100%;
    margin: 0 0 14px;
    padding: 0;
    border: 1px solid var(--eg-line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--eg-tab-bg);
}

section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-tab {
    flex: 1 1 0;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 12px 8px;
    border: 0;
    border-right: 1px solid var(--eg-line);
    border-radius: 0;
    background: var(--eg-tab-bg);
    color: var(--eg-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    user-select: none;
    transition: background-color .15s ease, color .15s ease;
}

section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-tab:last-child {
    border-right: 0;
}

section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-tab.is-active {
    background: rgb(var(--danger-rgb));
    color: #fff;
}

section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-tab:hover {
    background: #e6e8eb;
}

section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-tab.is-active:hover {
    background: rgba(var(--danger-rgb), 0.88);
    color: #fff;
}

section.pmovie__episodes-graph.ep-graph .ep-graph-panel {
    display: none;
    width: 100%;
}

section.pmovie__episodes-graph.ep-graph .ep-graph-panel.is-active {
    display: block;
}

section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-panels:not([data-graph-ready]) .pmovie__episodes-graph-season:first-child .ep-graph-panel {
    display: block;
}

section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-panels:not([data-graph-ready]) .pmovie__episodes-graph-season:first-child .pmovie__episodes-graph-tab {
    background: rgb(var(--danger-rgb));
    color: #fff;
}

section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-season__link,
section.pmovie__episodes-graph.ep-graph .ep-graph-season-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: max-content;
    margin: 0 0 14px;
    padding: 15px 20px;
    border: 0;
    border-radius: var(--eg-radius);
    background: rgb(var(--danger-rgb));
    color: #fff !important;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: default;
    transition: background-color .2s ease;
}

section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-season__link.is-linked,
section.pmovie__episodes-graph.ep-graph .ep-graph-season-btn.is-linked {
    cursor: pointer;
}

section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-season__link.is-linked:hover,
section.pmovie__episodes-graph.ep-graph .ep-graph-season-btn.is-linked:hover {
    background: rgba(var(--danger-rgb), 0.88);
    color: #fff !important;
}

section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-season__link .text-wd,
section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-season__link .title-bg::before {
    color: #fff !important;
    text-decoration: none;
}

section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-season__link:not(:has(.ep-graph-season-btn__icon)) {
    font-size: 0;
}

section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-season__link:not(:has(.ep-graph-season-btn__icon))::after {
    content: "Смотреть " attr(data-season) " сезон";
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-season__link:not(:has(.ep-graph-season-btn__icon)) > * {
    display: none;
}

section.pmovie__episodes-graph.ep-graph .ep-graph-season-btn__icon {
    position: relative;
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid #fff;
    border-radius: 50%;
    flex-shrink: 0;
}

section.pmovie__episodes-graph.ep-graph .ep-graph-season-btn__icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%);
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 8px solid #fff;
}

section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-season__link:not(:has(.ep-graph-season-btn__icon))::before {
    content: "";
    display: inline-block;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' stroke='white' stroke-width='2'/%3E%3Cpath fill='white' d='M10 8.5v7l6-3.5z'/%3E%3C/svg%3E");
}

section.pmovie__episodes-graph.ep-graph .ep-graph-head,
section.pmovie__episodes-graph.ep-graph .ep-graph-row__date--desktop,
section.pmovie__episodes-graph.ep-graph .ep-graph-row__status--desktop,
section.pmovie__episodes-graph.ep-graph .ep-graph-row__foot--mobile {
    display: none;
}

section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-list > .pmovie__episodes-graph-row {
    display: block;
    color: inherit;
    text-decoration: none;
    cursor: default;
}

section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-list > .pmovie__episodes-graph-row.is-linked {
    cursor: pointer;
}

section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-date {
    min-width: 0;
}

section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-date__day,
section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-date__year {
    display: none;
}

section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-date__month {
    display: inline;
    font-size: inherit;
    font-weight: inherit;
    text-transform: none;
}

section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-num span {
    color: var(--eg-green) !important;
    font-size: 14px;
    font-weight: 600;
}

section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-foot {
    display: contents;
}

@media (min-width: 992px) {
    section.pmovie__episodes-graph.ep-graph .ep-graph-head {
        display: grid;
        grid-template-columns: 48px minmax(0, 1fr) 120px 92px 118px;
        gap: 16px;
        align-items: center;
        padding: 12px 18px;
        border: 1px solid var(--eg-line);
        border-bottom: 0;
        border-radius: 8px 8px 0 0;
        background: var(--eg-head-bg);
        color: var(--eg-muted);
        font-size: 13px;
        font-weight: 600;
    }

    section.pmovie__episodes-graph.ep-graph .ep-graph-head__cell--num {
        text-align: center;
    }

    section.pmovie__episodes-graph.ep-graph .ep-graph-head__cell--action {
        text-align: right;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-list {
        display: flex;
        flex-direction: column;
        border: 1px solid var(--eg-line);
        border-top: 0;
        border-radius: 0 0 8px 8px;
        overflow: hidden;
        background: #fff;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-list > .pmovie__episodes-graph-row {
        display: grid;
        grid-template-columns: 48px minmax(0, 1fr) 120px 92px 118px;
        grid-template-areas: "num info date status action";
        gap: 16px;
        align-items: center;
        padding: 16px 18px;
        border-bottom: 1px solid var(--eg-line);
        background: #fff;
        transition: background-color .15s ease;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-list > .pmovie__episodes-graph-row:last-child {
        border-bottom: 0;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-list > .pmovie__episodes-graph-row:hover {
        background: #fafafa;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-list > .pmovie__episodes-graph-row::before {
        content: attr(data-episode);
        grid-area: num;
        color: var(--eg-text);
        font-size: 15px;
        font-weight: 600;
        text-align: center;
        line-height: 1;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-info {
        grid-area: info;
        min-width: 0;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-title {
        margin-bottom: 4px;
        color: var(--eg-text);
        font-size: 14px;
        font-weight: 500;
        line-height: 1.4;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-meta {
        color: var(--eg-muted);
        font-size: 13px;
        line-height: 1.3;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-date {
        grid-area: date;
        width: auto;
        min-height: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: #6b7280;
        font-size: 14px;
        white-space: nowrap;
        text-align: left;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-num {
        grid-area: status;
        color: var(--eg-green);
        font-size: 14px;
        font-weight: 600;
        white-space: nowrap;
        text-align: left;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-list > .pmovie__episodes-graph-row::after {
        content: "Смотреть";
        grid-area: action;
        justify-self: end;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 104px;
        padding: 8px 14px 8px 30px;
        border: 1px solid rgb(var(--danger-rgb));
        border-radius: 8px;
        background-color: #fff;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 10'%3E%3Cpath fill='%23ee335e' d='M0 0v10l8-5z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: 12px center;
        background-size: 7px 10px;
        color: rgb(var(--danger-rgb));
        font-size: 13px;
        font-weight: 600;
        line-height: 1;
        white-space: nowrap;
        pointer-events: none;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-list > .pmovie__episodes-graph-row.is-linked:hover::after {
        background-color: rgb(var(--danger-rgb));
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 10'%3E%3Cpath fill='%23ffffff' d='M0 0v10l8-5z'/%3E%3C/svg%3E");
        color: #fff;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-list > .pmovie__episodes-graph-row.is-linked:hover .pmovie__episodes-graph-title {
        color: rgb(var(--danger-rgb));
    }
}

@media (max-width: 991.98px) {
    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-tabs {
        flex-wrap: wrap;
        gap: 8px;
        border: 0;
        border-radius: 0;
        overflow: visible;
        background: transparent;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-tabs--scroll {
        flex-wrap: nowrap;
        gap: 8px;
        margin-right: -4px;
        margin-left: -4px;
        padding: 2px 4px 6px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-tabs--scroll::-webkit-scrollbar {
        display: none;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-tabs--scroll .pmovie__episodes-graph-tab {
        flex: 0 0 auto;
        min-width: max-content;
        white-space: nowrap;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-tab {
        flex: 0 0 auto;
        min-width: auto;
        padding: 8px 16px;
        border: 1px solid var(--eg-line);
        border-radius: 999px;
        background: #fff;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-tab.is-active {
        border-color: rgb(var(--danger-rgb));
        background: rgb(var(--danger-rgb));
        color: #fff;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-tab:hover {
        background: #fff;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-tab.is-active:hover {
        background: rgb(var(--danger-rgb));
        color: #fff;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-season__link,
    section.pmovie__episodes-graph.ep-graph .ep-graph-season-btn {
        width: 100%;
        max-width: none;
    }

    section.pmovie__episodes-graph.ep-graph .ep-graph-head {
        display: none;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-date__month,
    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-date__year,
    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-date__day {
        display: inline;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-list > .pmovie__episodes-graph-row {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-rows: auto auto;
        column-gap: 14px;
        row-gap: 0;
        align-items: center;
        padding: 12px 14px;
        border: 1px solid var(--eg-line);
        border-radius: var(--eg-radius);
        background: #fff;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-list > .pmovie__episodes-graph-row::before {
        grid-column: 1;
        grid-row: 1 / -1;
        align-self: center;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        padding-right: 14px;
        border-right: 1px solid var(--eg-line);
        content: attr(data-episode);
        color: rgb(var(--danger-rgb));
        font-size: 30px;
        font-weight: 700;
        font-variant-numeric: tabular-nums;
        line-height: 1;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-info {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-foot {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px 12px;
        grid-column: 2;
        grid-row: 2;
        min-width: 0;
        margin-top: 6px;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-list > .pmovie__episodes-graph-row:not(:has(.pmovie__episodes-graph-foot)) {
        grid-template-rows: auto auto auto;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-list > .pmovie__episodes-graph-row:not(:has(.pmovie__episodes-graph-foot)) .pmovie__episodes-graph-info {
        display: contents;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-list > .pmovie__episodes-graph-row:not(:has(.pmovie__episodes-graph-foot)) .pmovie__episodes-graph-title {
        grid-column: 2;
        grid-row: 1;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-list > .pmovie__episodes-graph-row:not(:has(.pmovie__episodes-graph-foot)) .pmovie__episodes-graph-meta {
        grid-column: 2;
        grid-row: 2;
        margin-top: 2px;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-list > .pmovie__episodes-graph-row:not(:has(.pmovie__episodes-graph-foot)) .pmovie__episodes-graph-date {
        grid-column: 2;
        grid-row: 3;
        margin-top: 6px;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-list > .pmovie__episodes-graph-row:not(:has(.pmovie__episodes-graph-foot)) .pmovie__episodes-graph-num {
        grid-column: 2;
        grid-row: 3;
        margin-top: 6px;
        margin-left: 12px;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-title {
        margin: 0;
        color: var(--eg-text);
        font-size: 14px;
        font-weight: 700;
        line-height: 1.35;
        white-space: normal;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-meta {
        margin: 2px 0 0;
        color: var(--eg-muted);
        font-size: 13px;
        line-height: 1.3;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-list > .pmovie__episodes-graph-row::after {
        grid-column: 3;
        grid-row: 1 / -1;
        align-self: center;
        content: "Смотреть";
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        min-width: auto;
        margin-left: 8px;
        padding: 7px 12px 7px 26px;
        border: 1px solid rgb(var(--danger-rgb));
        border-radius: 8px;
        background-color: #fff;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 10'%3E%3Cpath fill='%23ee335e' d='M0 0v10l8-5z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: 10px center;
        background-size: 7px 10px;
        color: rgb(var(--danger-rgb));
        font-size: 13px;
        font-weight: 600;
        line-height: 1;
        white-space: nowrap;
        pointer-events: none;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-date {
        display: inline-flex;
        align-items: center;
        width: auto;
        min-height: 0;
        margin: 0;
        padding: 0;
        border: 0;
        background: transparent;
        color: var(--eg-muted);
        font-size: 13px;
        white-space: nowrap;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-date::before {
        content: "";
        flex-shrink: 0;
        display: inline-block;
        width: 14px;
        height: 14px;
        margin-right: 6px;
        background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2z'/%3E%3C/svg%3E");
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-num {
        display: inline-flex;
        align-items: center;
        margin: 0;
        font-size: 13px;
        white-space: nowrap;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-foot:has(.pmovie__episodes-graph-date:empty):has(.pmovie__episodes-graph-num:empty),
    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-foot:not(:has(.pmovie__episodes-graph-date span)):not(:has(.pmovie__episodes-graph-num span)) {
        display: none;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-num:empty {
        display: none;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-num span {
        font-size: 13px;
        font-weight: 600;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-num span::before {
        content: "";
        display: inline-block;
        width: 7px;
        height: 7px;
        margin-right: 6px;
        border-radius: 50%;
        background: var(--eg-green);
        vertical-align: middle;
    }

    section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-list > .pmovie__episodes-graph-row.is-linked:hover::after {
        background-color: rgb(var(--danger-rgb));
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 10'%3E%3Cpath fill='%23ffffff' d='M0 0v10l8-5z'/%3E%3C/svg%3E");
        color: #fff;
    }
}

section.pmovie__episodes-graph.ep-graph .pmovie__episodes-more__summary {
    margin-top: 14px;
}

[data-theme-mode="dark"] section.pmovie__episodes-graph.ep-graph {
    --eg-line: rgba(255, 255, 255, 0.12);
    --eg-tab-bg: rgba(255, 255, 255, 0.06);
    --eg-head-bg: rgba(255, 255, 255, 0.06);
    --eg-text: var(--default-text-color);
}

[data-theme-mode="dark"] section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-list > .pmovie__episodes-graph-row,
[data-theme-mode="dark"] section.pmovie__episodes-graph.ep-graph .pmovie__episodes-graph-list {
    background: rgb(48 52 64);
}
