/* Кінопортал 3.3.1 — isolated season / episode presentation. */
body.title-detail-page .tv-episode-section{--tv-panel:#121d30;--tv-border:#34455d;--tv-copy:#edf3ff;--tv-muted:#b5c5de;--tv-action:#203d64;color:var(--tv-copy)}
html[data-theme="light"] body.title-detail-page .tv-episode-section{--tv-panel:#fff;--tv-border:#cbd8e8;--tv-copy:#1e304c;--tv-muted:#526681;--tv-action:#e4edff}
.tv-episode-progress,.tv-season,.tv-episode-empty,.tv-sync-box{border:1px solid var(--tv-border);background:var(--tv-panel);border-radius:15px;padding:16px;color:var(--tv-copy)}
.tv-episode-progress{margin-bottom:15px;display:grid;gap:9px}
.tv-episode-progress progress{display:block;width:100%;height:12px;accent-color:#3892f4}
.tv-season-list{display:grid;gap:12px}
.tv-season{padding:0;overflow:hidden}
.tv-season__heading{cursor:pointer;padding:16px 18px;display:flex;gap:10px;flex-wrap:wrap;align-items:center;justify-content:space-between;color:var(--tv-copy)}
.tv-season__heading:focus-visible,.tv-episode__toggle:focus-visible{outline:3px solid #60a5fa;outline-offset:3px}
.tv-season__name{font-size:1.1rem;font-weight:800}
.tv-season__meta,.tv-season__summary,.tv-episode__top span,.tv-episode__info p,.tv-episode__info small,.tv-episode-note{color:var(--tv-muted)}
.tv-season__content{padding:0 18px 16px}
.tv-season__summary{margin:4px 0 14px}
.tv-episode-list{list-style:none;margin:0;padding:0;display:grid;gap:12px}
.tv-episode{display:flex;align-items:center;gap:14px;min-width:0;padding:13px;border:1px solid var(--tv-border);border-radius:12px}
.tv-episode.is-watched{border-color:#218e73}
.tv-episode__still{width:150px;max-width:30%;aspect-ratio:16/9;object-fit:cover;border-radius:9px;flex-shrink:0}
.tv-episode__info{flex:1;min-width:0}.tv-episode__top{display:flex;gap:10px;flex-wrap:wrap;align-items:baseline}
.tv-episode__top strong{color:var(--tv-copy)}.tv-episode__info p{font-size:.95rem;line-height:1.55;margin:8px 0}.tv-episode__info small{display:block}
.tv-episode__form{margin:0;flex-shrink:0}.tv-episode__toggle{border:1px solid var(--tv-border);border-radius:9px;background:var(--tv-action);color:var(--tv-copy);font:inherit;font-weight:750;padding:10px 12px;cursor:pointer;min-height:44px}
.tv-episode__toggle:disabled{cursor:not-allowed;opacity:.65}
.tv-sync-box{margin-top:16px;display:grid;gap:12px}.tv-sync-box small{color:var(--tv-muted)}
.tv-sync-controls,.tv-sync-inline{display:flex;gap:12px;flex-wrap:wrap;align-items:center}.tv-sync-controls form{margin:0}.tv-sync-controls select{padding:10px;border-radius:8px;color:var(--tv-copy);background:var(--tv-action);border:1px solid var(--tv-border)}
.tv-episode-note a{color:#70b7ff}
.tv-sync-status{margin:0;padding:11px 13px;border:1px solid var(--tv-border);border-radius:10px;background:var(--tv-action);color:var(--tv-copy);font-size:.93rem;line-height:1.55}
.tv-sync-status strong{color:var(--tv-copy)}
html[data-theme="light"] body.title-detail-page .tv-episode-note a{color:#1558b0}
@media(max-width:680px){.tv-episode{flex-wrap:wrap}.tv-episode__still{width:100%;max-width:100%;aspect-ratio:16/9}.tv-episode__info{flex:1 1 100%}.tv-episode__form{width:100%}.tv-episode__toggle{width:100%}}

/* 3.8.4: Local feedback beside the action. Readable in dark and light theme. */
body.title-detail-page .tv-episode__form { max-width: 100%; }
body.title-detail-page .tv-episode__message { display: block; max-width: 21rem; margin-top: 6px; font-size: .82rem; line-height: 1.4; color: #a7f3d0; overflow-wrap: anywhere; }
body.title-detail-page .tv-episode__message:empty { display: none; }
body.title-detail-page .tv-episode__message.is-error { color: #fecaca; }
html[data-theme="light"] body.title-detail-page .tv-episode__message { color: #065f46; }
html[data-theme="light"] body.title-detail-page .tv-episode__message.is-error { color: #991b1b; }
@media(max-width:680px){ body.title-detail-page .tv-episode__message { max-width: 100%; } }

/* 4.0.2: inline TMDb admin sync feedback; scoped to the episodes section. */
body.title-detail-page .tv-sync-box .tv-episode-feedback { margin: 0; font-size: .93rem; line-height: 1.5; color: #a7f3d0; overflow-wrap: anywhere; }
body.title-detail-page .tv-sync-box .tv-episode-feedback:empty { display: none; }
body.title-detail-page .tv-sync-box .tv-episode-feedback.is-error { color: #fecaca; }
html[data-theme="light"] body.title-detail-page .tv-sync-box .tv-episode-feedback { color: #06634c; }
html[data-theme="light"] body.title-detail-page .tv-sync-box .tv-episode-feedback.is-error { color: #991b1b; }
body.title-detail-page .tv-sync-controls button:disabled { opacity: .65; cursor: progress; }

/* 4.1.0 — actions for complete season / series; adaptive to both themes. */
body.title-detail-page .tv-bulk{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:0 0 14px}
body.title-detail-page .tv-bulk--series{margin:0 0 8px}
body.title-detail-page .tv-bulk--season{padding:12px 0 14px;border-bottom:1px solid var(--tv-border);margin-bottom:14px}
body.title-detail-page .tv-bulk__button{border:1px solid #4474ad;border-radius:10px;padding:10px 15px;min-height:44px;background:#214e82;color:#fff;font:inherit;font-weight:700;cursor:pointer;max-width:100%;white-space:normal;text-align:center}
body.title-detail-page .tv-bulk--season .tv-bulk__button{background:var(--tv-action);color:var(--tv-copy);border-color:var(--tv-border)}
body.title-detail-page .tv-bulk__button:hover:not(:disabled){filter:brightness(1.13)}
body.title-detail-page .tv-bulk__button:focus-visible{outline:3px solid #60a5fa;outline-offset:3px}
body.title-detail-page .tv-bulk__button:disabled{opacity:.6;cursor:wait}
body.title-detail-page .tv-bulk__feedback{color:#a7f3d0;font-size:.9rem;line-height:1.4;overflow-wrap:anywhere}
body.title-detail-page .tv-bulk__feedback.is-error{color:#fecaca}
body.title-detail-page .tv-episode-note--bulk{margin:-1px 0 15px;font-size:.88rem}
html[data-theme="light"] body.title-detail-page .tv-bulk__feedback{color:#06634c}
html[data-theme="light"] body.title-detail-page .tv-bulk__feedback.is-error{color:#991b1b}
@media(max-width:680px){body.title-detail-page .tv-bulk{align-items:stretch;flex-direction:column}body.title-detail-page .tv-bulk__button{width:100%}}
