
.dc-leaf { min-width: 0; }
.dc-leaf .dc-leaf-plot { margin: calc(var(--dc-detail-section-space) / 2) 0 0; padding-top: calc(var(--dc-detail-section-space) / 2); border-top: 1px solid var(--border); }
.dc-leaf .dc-leaf-plot .title-plot__title { margin-bottom: var(--dc-detail-heading-gap); font-size: 18px; }
.dc-leaf .title-info__desc { max-width: 80ch; font-size: var(--dc-detail-copy-size); line-height: var(--dc-detail-copy-leading); overflow-wrap: anywhere; }
.dc-leaf .dc-rating .title-rate__meta { flex-wrap: wrap; white-space: normal; }
.dc-leaf .dc-rating .title-rate__meta strong { font: inherit; color: var(--green); font-weight: 600; }
.dc-leaf--episode .dc-leaf-header .title-layout { grid-template-columns: 300px minmax(0, 1fr); }
.dc-leaf--episode .dc-leaf-header .title-aside { max-width: 300px; }
.dc-leaf--episode .dc-leaf-header .title-poster { aspect-ratio: 16 / 9; }
.dc-leaf--episode .dc-leaf-header .title-poster img { object-fit: contain; }
.dc-leaf--episode .dc-leaf-header .dc-rating { max-width: none; }
.dc-leaf .dc-leaf-player { margin-top: var(--dc-detail-section-space); }
.dc-leaf .dc-leaf-player > .dc-watch-title { margin-bottom: var(--dc-detail-heading-gap); font-size: var(--dc-detail-section-size); line-height: 1.4; overflow-wrap: anywhere; }
.dc-leaf-player .videos.players-ui { gap: 0; }
.dc-leaf-player .videos.players-ui > label {
 display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
 margin: 12px 0 0; padding: 12px 24px; border: 1px solid var(--border);
 border-radius: 6px; background: var(--surface-2); color: var(--text-soft);
 font: inherit; font-size: var(--dc-detail-secondary-size); font-weight: 600; line-height: 1.5; cursor: pointer;
}
.dc-leaf-player .videos.players-ui:not(.players-ui--stack) > label { order: 1; }
.dc-leaf-player .videos.players-ui:not(.players-ui--stack) > .video-block { order: 2; }
.dc-leaf-player .videos.players-ui[data-dc-leaf-tabs] > .title-player__tabs { order: 1; }
.dc-leaf-player .videos.players-ui[data-dc-leaf-tabs] > .video-block { display: block; }
.dc-leaf-player .videos.players-ui[data-dc-leaf-tabs] > .video-block[hidden] { display: none !important; }
.dc-leaf-player .videos.players-ui > input[type="radio"]:checked + label { border-color: var(--green); color: var(--green); background: var(--hover-soft); }
.dc-leaf-player .videos.players-ui > input[type="radio"]:focus-visible + label { outline: 2px solid var(--green); outline-offset: 3px; }
.dc-leaf-player .videos.players-ui > label:hover { color: var(--green); border-color: var(--green); }
.dc-leaf-player .videos.players-ui > .video-block { border-radius: 6px; background: var(--poster-bg, var(--surface-2)); }
.dc-leaf-player .videos.players-ui.players-ui--stack { display: block; }
.dc-leaf-player .videos.players-ui.players-ui--stack > label { justify-content: flex-start; width: auto; padding: 0; border: 0; background: none; cursor: default; }
.dc-leaf-player .videos.players-ui.players-ui--stack > input[type="radio"]:checked + label { background: none; }
.dc-leaf-player .title-player__placeholder { padding: 32px 20px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); color: var(--text-soft); text-align: center; }
.dc-leaf-player .dc-player-links:empty { display: none; }
.dc-leaf .dc-leaf-editorial .ms-watch-bar { padding-top: var(--dc-detail-section-space); }

/* Native cast HTML has two contracts: season chars and episode people. Both are static grids. */
.dc-leaf .dc-leaf-people { min-width: 0; }
.dc-leaf .dc-leaf-header > .dc-leaf-people { margin: calc(var(--dc-detail-section-space) / 2) 0 0; padding: calc(var(--dc-detail-section-space) / 2) 0 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: none; box-shadow: none; }
.dc-leaf .dc-leaf-people .section__head { margin-bottom: var(--dc-detail-heading-gap); }
.dc-leaf .dc-leaf-header .dc-leaf-people .section__title { font-size: 18px; }
.dc-leaf .dc-leaf-people .tmdb-extra { margin: 0; padding: 0; border: 0; background: none; }
.dc-leaf .dc-leaf-people .tmdb-extra > .ep-block-title,
.dc-leaf .dc-leaf-people .chars-rail__btn { display: none; }
.dc-leaf .dc-leaf-people :is(.chars-grid, .tmdb-cast-grid) {
 display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-flow: row;
 grid-auto-columns: auto; gap: 24px; min-width: 0; width: 100%;
 margin: 0; padding: 0; overflow: visible; scroll-snap-type: none;
}
.dc-leaf .dc-leaf-people :is(.char, .tmdb-cast-item) {
 display: grid; grid-template-columns: 68px minmax(0, 1fr); grid-template-rows: auto auto;
 align-content: center; align-items: center; gap: 4px 12px; width: 100%; min-width: 0;
 max-width: 290px; min-height: 102px; margin: 0; padding: 0;
 border: 0; border-radius: 0; background: none; box-shadow: none; text-align: left;
}
.dc-leaf .dc-leaf-people :is(.char__photo, .tmdb-cast-item > img, .tmdb-cast-ph) {
 display: block; grid-column: 1; grid-row: 1 / 3; position: relative;
 width: 68px; height: 102px; max-width: 100%; margin: 0; aspect-ratio: 2 / 3;
 overflow: hidden; object-fit: contain; object-position: center; border-radius: 3px; background: var(--surface-2);
}
.dc-leaf .dc-leaf-people .char__photo img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.dc-leaf .dc-leaf-people .char__body { display: flex; grid-column: 2; grid-row: 1 / 3; flex-direction: column; gap: 8px; min-width: 0; }
.dc-leaf .dc-leaf-people .char__role { order: -1; margin: 0; }
.dc-leaf .dc-leaf-people .char__role-label { display: none; }
.dc-leaf .dc-leaf-people :is(.char__role-name, .tmdb-cast-name),
.dc-leaf .dc-leaf-people .char__body:not(:has(.char__role-name)) .char__name { display: block; margin: 0; color: var(--text); font-size: var(--dc-detail-cast-name-size); font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.dc-leaf .dc-leaf-people .char__body:has(.char__role-name) .char__name,
.dc-leaf .dc-leaf-people .tmdb-cast-role { display: block; margin: 0; color: var(--text-soft); font-size: var(--dc-detail-cast-role-size); line-height: 1.6; overflow-wrap: anywhere; }
.dc-leaf .dc-leaf-people .tmdb-cast-name { grid-column: 2; grid-row: 1; align-self: end; }
.dc-leaf .dc-leaf-people .tmdb-cast-role { grid-column: 2; grid-row: 2; align-self: start; }
.dc-leaf .dc-leaf-people:not(:has(.char, .tmdb-cast-item)),
.dc-leaf .dc-leaf-people:not(.is-people-expanded) :is(.chars-grid, .tmdb-cast-grid) > :nth-child(n + 11) { display: none; }
.dc-leaf .dc-leaf-more[type="button"] {
 display: none; align-items: center; justify-content: center; min-height: 44px;
 margin: var(--dc-detail-heading-gap) 0 0; padding: 12px 16px; border: 1px solid var(--border);
 border-radius: 6px; background: var(--surface-2); color: var(--green); font: inherit; font-size: var(--dc-detail-secondary-size); cursor: pointer;
}
.dc-leaf .dc-leaf-people:has(:is(.chars-grid, .tmdb-cast-grid) > :nth-child(11)) > .dc-leaf-more { display: inline-flex; }
.dc-leaf .dc-leaf-more:hover { border-color: var(--green); background: var(--hover-soft); }
.dc-leaf .dc-leaf-more:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.dc-leaf .dc-leaf-more__close, .dc-leaf .is-people-expanded .dc-leaf-more__open { display: none; }
.dc-leaf .is-people-expanded .dc-leaf-more__close { display: inline; }

/* Keep the current episode discoverable even when it follows the first ten rows. */
.dc-editorial .dc-season-tabs__panel:not(.is-episodes-expanded) .dc-season-tabs__episodes > .se-ep-current:nth-child(n + 11) { display: block; }
.dc-editorial .dc-season-tabs__episodes .se-ep-current .dc-episode-row { outline: 1px solid var(--green); outline-offset: -1px; }
.dc-editorial .se-ep-current .dc-episode-row__number { color: var(--green); }
.dc-editorial .se-ep-current .dc-episode-row__title::after { content: "Вы смотрите"; display: inline-block; margin-left: 12px; color: var(--green); font-size: var(--dc-detail-secondary-size); font-weight: 600; }

/* The inert gallery bootstrap mounts only the first six image sources. */
.dc-leaf .dc-leaf-gallery .tmdb-gallery { margin: 0; }
.dc-leaf .dc-leaf-gallery .tmdb-gallery > .ep-block-title { display: none; }
.dc-leaf .dc-leaf-gallery .tmdb-stills {
 display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: none;
 grid-auto-flow: row; grid-auto-columns: auto; gap: 12px; width: 100%; min-width: 0;
 margin: 0; padding: 0; max-height: none; overflow: visible; scroll-snap-type: none;
}
.dc-leaf .dc-leaf-gallery.ms-tmdb-posters .tmdb-stills { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.dc-leaf .dc-leaf-gallery .tmdb-stills > .still {
 display: block; position: relative; width: 100%; min-width: 0; height: auto; min-height: 0;
 margin: 0; padding: 0; grid-column: auto; grid-row: auto; aspect-ratio: 8 / 5;
 overflow: hidden; border: 0; border-radius: 4px; background: var(--surface-2); box-shadow: none; cursor: pointer;
}
.dc-leaf .dc-leaf-gallery.ms-tmdb-posters .tmdb-stills > .still { aspect-ratio: 2 / 3; }
.dc-leaf .dc-leaf-gallery .still img { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.dc-leaf .dc-leaf-gallery .still:hover { outline: 2px solid var(--green); outline-offset: 3px; }
.dc-leaf .dc-leaf-gallery .still:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.dc-leaf .dc-leaf-gallery .tmdb-stills > [hidden] { display: none !important; }
.dc-leaf .dc-leaf-gallery:has(.still:nth-child(7)) .tmdb-stills { grid-template-rows: repeat(2, minmax(0, 1fr)); }
.dc-leaf .dc-leaf-gallery.ms-tmdb-posters:has(.still:nth-child(7)) .tmdb-stills { grid-template-rows: minmax(0, 1fr); }
.dc-leaf .dc-leaf-gallery:has(.still:nth-child(7)) > .dc-media-pager:not([hidden]) { display: flex; }
.dc-leaf .dc-leaf-gallery:not(:has(.still)) { display: none; }

@media (max-width: 1200px) {
 .dc-leaf .dc-leaf-people :is(.chars-grid, .tmdb-cast-grid) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 850px) {
 .dc-leaf .dc-leaf-people :is(.chars-grid, .tmdb-cast-grid) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
 .dc-leaf--episode .dc-leaf-header .title-layout { grid-template-columns: minmax(0, 1fr); }
 .dc-leaf--episode .dc-leaf-header .title-aside { max-width: none; grid-template-columns: 220px minmax(0, 1fr); }
 .dc-leaf--episode .dc-leaf-header .title-poster { width: 220px; }
 .dc-leaf .dc-leaf-gallery .tmdb-stills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
 .dc-leaf .dc-leaf-gallery:has(.still:nth-child(7)) .tmdb-stills { grid-template-rows: repeat(3, minmax(0, 1fr)); }
 .dc-leaf .dc-leaf-gallery.ms-tmdb-posters:has(.still:nth-child(7)) .tmdb-stills { grid-template-rows: repeat(2, minmax(0, 1fr)); }
 .dc-leaf .dc-leaf-gallery.ms-tmdb-posters .tmdb-stills { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
 .dc-leaf--episode .dc-leaf-header .title-layout { grid-template-columns: minmax(0, 1fr); }
 .dc-leaf--episode .dc-leaf-header .title-aside { max-width: none; grid-template-columns: minmax(0, 1fr); width: min(360px, 100%); }
 .dc-leaf--episode .dc-leaf-header .title-poster { width: 100%; }
 .dc-leaf--episode .dc-leaf-header .dc-rating { max-width: 240px; }
 .dc-leaf .dc-leaf-people :is(.chars-grid, .tmdb-cast-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
 .dc-leaf .dc-leaf-people :is(.char, .tmdb-cast-item) { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; align-content: start; min-height: 0; gap: 8px; }
 .dc-leaf .dc-leaf-people :is(.char__photo, .tmdb-cast-item > img, .tmdb-cast-ph) { grid-column: 1; grid-row: 1; width: 88px; height: auto; aspect-ratio: 2 / 3; margin-bottom: 8px; }
 .dc-leaf .dc-leaf-people .char__body { grid-column: 1; grid-row: 2 / 4; }
 .dc-leaf .dc-leaf-people .tmdb-cast-name { grid-column: 1; grid-row: 2; align-self: start; }
 .dc-leaf .dc-leaf-people .tmdb-cast-role { grid-column: 1; grid-row: 3; }
 .dc-leaf-player .videos.players-ui > label { flex: 1 1 auto; padding: 10px 12px; }
 .dc-leaf .dc-leaf-gallery .tmdb-stills { gap: 10px; }
 .dc-leaf .dc-leaf-gallery.ms-tmdb-posters .tmdb-stills { grid-template-columns: repeat(3, minmax(0, 1fr)); }
 .dc-leaf .dc-leaf-gallery > .dc-media-pager { justify-content: space-between; }
}
