:root {
    --bg: #f6f7f4;
    --surface: #ffffff;
    --ink: #17211b;
    --muted: #647067;
    --line: #dfe5dd;
    --accent: #147a5c;
    --accent-dark: #0d533e;
    --warm: #d9902f;
    --danger: #aa3d2f;
    --header-bg: rgba(255, 255, 255, .96);
    --hero-bg: #17211b;
    --soft: #e6f1ec;
    --chip: #e8ede8;
    --poster-bg: #d8ded8;
    --sidebar-bg: #17211b;
    --sidebar-alt: #263447;
    --sidebar-ink: #d7e0d9;
    --sidebar-muted: #aebbb2;
}

:root[data-theme="dark"] {
    --bg: #0f1418;
    --surface: #1b242a;
    --ink: #f4f7f5;
    --muted: #c2ccc6;
    --line: #3b4740;
    --accent: #55b98e;
    --accent-dark: #a8e8c8;
    --warm: #f1bf6b;
    --header-bg: rgba(16, 20, 23, .96);
    --hero-bg: #0c1114;
    --soft: #223d32;
    --chip: #26342d;
    --poster-bg: #26323a;
    --sidebar-bg: #172026;
    --sidebar-alt: #1f2d36;
    --sidebar-ink: #edf3ee;
    --sidebar-muted: #c2ccc6;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    overflow-x: hidden;
    color: var(--ink);
    background: var(--bg);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 10px clamp(16px, 4vw, 44px);
    background: var(--header-bg);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.site-header-bar {
    width: min(1240px, calc(100% - 32px));
    margin: 12px auto 0;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(23, 33, 27, .08);
}

:root[data-theme="dark"] .site-header-bar {
    box-shadow: none;
}

.header-inner {
    display: grid;
    grid-template-columns: minmax(180px, auto) minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    width: min(1240px, 100%);
    margin: 0 auto;
}

.brand,
.main-nav,
.header-actions,
.site-footer nav {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand {
    min-width: 0;
    color: var(--ink);
    font-weight: 800;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    color: #fff;
    background: var(--accent);
    border-radius: 7px;
}

.brand-logo {
    width: auto;
    height: 42px;
    max-width: 170px;
    object-fit: contain;
}

.main-nav {
    justify-content: center;
}

.main-nav a,
.site-footer a,
.theme-toggle,
.header-icon-button {
    color: var(--muted);
    font-weight: 700;
}

.main-nav a:hover,
.site-footer a:hover,
.theme-toggle:hover,
.header-icon-button:hover {
    color: var(--accent-dark);
}

.header-actions {
    justify-content: end;
    min-width: 0;
}

.header-icon-button {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
}

.header-icon-button svg {
    display: block;
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.header-search-form {
    display: grid;
    grid-template-columns: 42px 0 0;
    gap: 0;
    align-items: center;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 9px;
    transition: grid-template-columns .18s ease, box-shadow .18s ease;
}

.header-search-form .header-icon-button {
    border: 0;
    border-radius: 0;
    background: transparent;
}

.header-search-form input {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0;
    color: var(--ink);
    background: transparent;
    border: 0;
    outline: 0;
    opacity: 0;
    transition: opacity .15s ease, padding .15s ease;
}

.header-search-form.is-open,
.header-search-form:focus-within {
    grid-template-columns: 42px minmax(150px, 230px) 74px;
    box-shadow: 0 12px 24px rgba(23, 33, 27, .1);
}

.header-search-form.is-open input,
.header-search-form:focus-within input {
    padding: 0 10px 0 0;
    opacity: 1;
}

.header-search-submit {
    height: 34px;
    margin-right: 4px;
    padding: 0 12px;
    color: #fff;
    background: var(--accent);
    border: 0;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 800;
    opacity: 0;
    pointer-events: none;
}

.header-search-form.is-open .header-search-submit,
.header-search-form:focus-within .header-search-submit {
    opacity: 1;
    pointer-events: auto;
}

.header-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    color: #fff;
    background: var(--accent);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 340px);
    gap: clamp(28px, 6vw, 80px);
    align-items: center;
    min-height: 520px;
    padding: clamp(38px, 7vw, 88px) clamp(16px, 4vw, 44px);
    background: var(--hero-bg);
    color: #fff;
}

.hero h1,
.page-header h1,
.detail-copy h1 {
    margin: 0;
    max-width: 820px;
    font-size: clamp(30px, 4.6vw, 54px);
    line-height: 1.06;
    letter-spacing: 0;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--warm);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hero-search,
.page-search {
    display: flex;
    gap: 10px;
    width: min(620px, 100%);
    margin-top: 28px;
}

.hero-search input,
.page-search input,
.hero-search button,
.page-search button {
    min-height: 50px;
    border: 1px solid transparent;
    border-radius: 7px;
    font: inherit;
}

.hero-search input,
.page-search input {
    flex: 1;
    min-width: 0;
    padding: 0 14px;
}

.hero-search button,
.page-search button,
.primary-action,
.secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 7px;
    font-weight: 800;
}

.hero-search button,
.page-search button,
.primary-action {
    color: #fff;
    background: var(--accent);
    border: 0;
}

.secondary-action {
    color: var(--accent-dark);
    background: var(--soft);
}

.hero-poster {
    position: relative;
    justify-self: end;
    width: min(100%, 320px);
}

.hero-poster img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .34);
}

.hero-poster span {
    position: absolute;
    right: 14px;
    bottom: 14px;
    left: 14px;
    padding: 10px 12px;
    color: #fff;
    background: rgba(0, 0, 0, .66);
    border-radius: 6px;
    font-weight: 800;
}

.hero-compact {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-block: clamp(30px, 5vw, 56px);
}

.hero-compact .hero-copy {
    width: min(780px, 100%);
}

.studio-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(24px, 5vw, 58px);
    align-items: center;
    padding: clamp(30px, 5vw, 58px) clamp(16px, 4vw, 44px);
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.studio-hero-copy h1 {
    margin: 0;
    max-width: 760px;
    font-size: clamp(30px, 4.4vw, 52px);
    line-height: 1.06;
}

.studio-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.studio-feature-grid a {
    position: relative;
    overflow: hidden;
    min-height: 230px;
    background: var(--poster-bg);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.studio-feature-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.studio-feature-grid span {
    position: absolute;
    right: 10px;
    bottom: 10px;
    left: 10px;
    padding: 8px 10px;
    color: #fff;
    background: rgba(0, 0, 0, .68);
    border-radius: 6px;
    font-weight: 800;
}

.recent-searches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 16px;
    color: var(--muted);
    font-size: 14px;
}

.recent-searches span {
    font-weight: 800;
}

.recent-searches a {
    padding: 4px 7px;
    color: var(--accent-dark);
    background: var(--soft);
    border-radius: 6px;
    font-weight: 800;
}

.calendar-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    width: fit-content;
    margin-top: 14px;
    padding: 0 13px;
    color: #fff;
    background: var(--accent);
    border-radius: 7px;
    font-weight: 800;
}

.calendar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.calendar-sync-note {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.calendar-week {
    display: grid;
    gap: 14px;
}

.calendar-day {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.calendar-day.is-today {
    border-color: var(--accent);
    box-shadow: inset 4px 0 0 var(--accent);
}

.calendar-day > header {
    display: grid;
    align-content: start;
    gap: 2px;
}

.calendar-day > header span,
.calendar-day > header em {
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
    font-weight: 800;
}

.calendar-day > header strong {
    font-size: 20px;
}

.calendar-episode-list {
    display: grid;
    gap: 10px;
}

.calendar-episode-list > p {
    margin: 0;
    color: var(--muted);
}

.calendar-episode {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 8px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 7px;
}

.calendar-episode img {
    width: 54px;
    height: 72px;
    object-fit: cover;
    background: var(--poster-bg);
    border-radius: 5px;
}

.calendar-episode strong,
.calendar-episode small {
    display: block;
    min-width: 0;
}

.calendar-episode small {
    color: var(--muted);
}

.calendar-episode em {
    display: block;
    margin-top: 3px;
    color: var(--warm);
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
}

.featured-rail-section {
    width: min(1240px, calc(100% - 32px));
    margin: 24px auto 0;
}

.page-shell .featured-rail-section,
.detail-page .featured-rail-section {
    width: 100%;
    margin: 0 0 24px;
}

.featured-rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(126px, 156px);
    gap: 12px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding: 2px 2px 12px;
    scrollbar-width: thin;
}

.featured-rail-card {
    min-width: 0;
}

.featured-rail-card a {
    display: grid;
    gap: 6px;
}

.featured-rail-card img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    background: var(--poster-bg);
    border: 1px solid var(--line);
    border-radius: 7px;
}

.featured-rail-card span {
    color: var(--warm);
    font-size: 12px;
    font-weight: 800;
}

.featured-rail-card strong {
    display: -webkit-box;
    overflow: hidden;
    color: var(--ink);
    font-size: 13px;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.page-header,
.section-heading,
.panel-heading,
.poster-copy,
.featured-rail-card {
    min-width: 0;
}

.page-header p,
.section-heading,
.panel-heading {
    overflow-wrap: anywhere;
}

.genre-strip,
.content-section,
.page-shell,
.detail-page,
.site-footer {
    width: min(1240px, calc(100% - 32px));
    margin-inline: auto;
}

.genre-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 22px 0 4px;
}

.genre-strip a,
.genre-grid a {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 7px;
}

.genre-strip a {
    flex: 0 0 auto;
    padding: 10px 14px;
    color: var(--accent-dark);
    font-weight: 800;
}

.content-section,
.page-shell,
.detail-page {
    padding: 34px 0;
}

.breadcrumbs {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 14px;
}

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.breadcrumbs li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.breadcrumbs li + li::before {
    content: "/";
    color: var(--muted);
}

.breadcrumbs a {
    color: var(--accent-dark);
    font-weight: 800;
}

.breadcrumbs span {
    color: var(--muted);
}

.section-heading,
.panel-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.section-heading h2,
.latest-panel h2 {
    margin: 0;
    font-size: 21px;
    line-height: 1.2;
}

.section-heading a {
    color: var(--accent-dark);
    font-weight: 800;
}

.poster-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 22px 16px;
}

.archive-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compact-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px 14px;
}

.poster-card {
    min-width: 0;
}

.archive-grid .poster-card {
    display: grid;
    min-width: 0;
}

.poster-frame {
    position: relative;
    display: block;
    overflow: hidden;
    background: var(--poster-bg);
    border-radius: 8px;
    border: 1px solid var(--line);
}

.poster-frame img {
    display: block;
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    transition: transform .18s ease;
}

.poster-card:hover img {
    transform: scale(1.03);
}

.quality-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 7px;
    color: #fff;
    background: var(--accent-dark);
    border-radius: 5px;
    font-size: 12px;
    font-weight: 800;
}

.poster-copy h3 {
    margin: 9px 0 2px;
    font-size: 15px;
    line-height: 1.28;
}

.poster-copy h3 a,
.featured-rail-card strong {
    overflow-wrap: anywhere;
}

.poster-copy h3 a {
    display: -webkit-box;
    overflow: hidden;
    color: var(--ink);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.poster-copy p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.split-section {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 34px;
    align-items: start;
}

.content-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 28px;
    align-items: start;
}

.doc-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.doc-card {
    display: grid;
    gap: 12px;
    align-content: start;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.doc-card h2 {
    margin: 0;
    font-size: 20px;
    line-height: 1.2;
}

.doc-card p {
    margin: 0;
    color: var(--muted);
}

.doc-card .secondary-action {
    width: fit-content;
}

.doc-page-shell {
    max-width: 900px;
}

.doc-page {
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.doc-content {
    max-width: 760px;
}

.public-sidebar {
    position: sticky;
    top: 84px;
    display: grid;
    gap: 16px;
}

.sidebar-card {
    display: grid;
    gap: 13px;
    padding: 16px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 14px 32px rgba(23, 33, 27, .07);
}

.sidebar-card-feature,
.sidebar-card-dark {
    color: var(--sidebar-ink);
    background: linear-gradient(135deg, var(--sidebar-bg), var(--sidebar-alt));
    border-color: transparent;
}

.sidebar-heading {
    display: grid;
    gap: 2px;
}

.sidebar-heading span {
    color: var(--warm);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.sidebar-heading h2 {
    margin: 0;
    color: var(--ink);
    font-size: 18px;
    line-height: 1.15;
}

.sidebar-card-feature .sidebar-heading h2,
.sidebar-card-dark .sidebar-heading h2 {
    color: #fff;
}

.sidebar-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.sidebar-action-grid a {
    display: grid;
    place-items: center;
    min-height: 42px;
    padding: 0 8px;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 8px;
    font-weight: 800;
}

.sidebar-media-list {
    display: grid;
    gap: 10px;
}

.sidebar-media-item {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 4px 10px;
    align-items: center;
    min-width: 0;
    padding: 8px;
    color: var(--ink);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.sidebar-card-dark .sidebar-media-item {
    color: var(--sidebar-ink);
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .12);
}

.sidebar-media-item img {
    grid-row: span 2;
    width: 54px;
    height: 72px;
    object-fit: cover;
    background: var(--poster-bg);
    border-radius: 6px;
}

.sidebar-media-item strong,
.sidebar-media-item span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-media-item strong {
    align-self: end;
    font-size: 14px;
    line-height: 1.25;
}

.sidebar-media-item span {
    align-self: start;
    color: var(--muted);
    font-size: 12px;
}

.sidebar-card-dark .sidebar-media-item span {
    color: var(--sidebar-muted);
}

.sidebar-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sidebar-chip-list a {
    padding: 6px 9px;
    color: var(--accent-dark);
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
}

.sidebar-genre-cloud a:nth-child(3n) {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}

.latest-panel {
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.episode-row a {
    display: grid;
    grid-template-columns: 56px 74px minmax(0, 1fr);
    gap: 8px 12px;
    align-items: center;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
}

.episode-row img {
    grid-row: span 2;
    width: 56px;
    height: 76px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--poster-bg);
}

.episode-row span {
    color: var(--warm);
    font-size: 13px;
    font-weight: 800;
}

.episode-row strong,
.episode-row em {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.episode-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px 16px;
}

.episode-card {
    min-width: 0;
}

.episode-row em {
    grid-column: 3;
    color: var(--muted);
    font-style: normal;
    font-size: 13px;
}

.page-header {
    max-width: 820px;
    margin-bottom: 28px;
}

.page-header p {
    color: var(--muted);
}

.season-header {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 20px;
    max-width: none;
}

.season-header img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.detail-hero {
    display: grid;
    grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
    gap: clamp(24px, 5vw, 58px);
    align-items: start;
}

.detail-hero-centered {
    grid-template-columns: 1fr;
}

.detail-hero-centered .detail-poster {
    justify-self: center;
    width: min(100%, 360px);
}

.detail-hero-centered .detail-copy {
    justify-self: center;
    width: min(100%, 820px);
    text-align: center;
}

.detail-hero-centered .meta-row {
    justify-content: center;
}

.detail-poster img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
}

.ad-slot {
    max-width: 100%;
    margin: 16px 0;
    overflow: hidden;
    text-align: center;
}

.ad-slot iframe,
.ad-slot ins {
    max-width: 100%;
}

.image-ad-band {
    display: flex;
    justify-content: center;
    margin: 0 0 22px;
}

.image-ad-band:empty {
    display: none;
}

.image-ad-band-below {
    margin: 22px 0 0;
}

.image-ad-band .ad-slot {
    width: 100%;
    max-width: 970px;
    margin: 0;
}

.detail-copy {
    padding-top: 18px;
}

.meta-row,
.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.meta-row span {
    padding: 7px 10px;
    background: var(--chip);
    border-radius: 6px;
    color: var(--muted);
    font-weight: 700;
}

.description {
    max-width: 820px;
    color: var(--ink);
    font-size: 18px;
}

.description p,
.description ul,
.description ol,
.description blockquote {
    margin-top: 0;
}

.video-about {
    margin-top: 22px;
}

.video-about blockquote {
    margin: 0;
    padding: 14px 16px;
    color: var(--ink);
    background: var(--soft);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
}

.video-about b {
    color: var(--accent-dark);
}

.trailer-embed {
    overflow: hidden;
    max-width: 820px;
    margin: 24px 0 0;
    background: #000;
    border-radius: 8px;
    aspect-ratio: 16 / 9;
}

.trailer-embed iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.video-player-card {
    display: grid;
    gap: 12px;
    max-width: 820px;
    margin: 24px 0 0;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.video-player-card h2 {
    margin: 0;
    font-size: 20px;
}

.video-player-card p {
    margin: 0;
    color: var(--muted);
}

.stream-open-button {
    width: fit-content;
}

.stream-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.stream-modal.is-open {
    display: flex;
}

.stream-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .76);
}

.stream-modal-panel {
    position: relative;
    z-index: 1;
    width: min(100%, 980px);
    overflow: hidden;
    background: #050505;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 10px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, .46);
}

.stream-modal-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    min-height: 52px;
    padding: 0 14px;
    color: #fff;
    background: #111;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.stream-modal-header strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stream-modal-header button {
    min-height: 34px;
    padding: 0 10px;
    color: #fff;
    background: var(--accent);
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 800;
}

.stream-modal-frame {
    background: #000;
    aspect-ratio: 16 / 9;
}

.stream-modal-frame video,
.stream-modal-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.stream-modal-frame video {
    aspect-ratio: 16 / 9;
    background: #000;
}

body.stream-modal-open {
    overflow: hidden;
}

.download-detail-card {
    display: grid;
    gap: 16px;
}

.download-title-card,
.download-info-card,
.download-section-card,
.download-action-card {
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.download-title-card h1 {
    margin: 0;
    font-size: clamp(25px, 3.6vw, 38px);
    line-height: 1.08;
}

.download-media-row {
    display: grid;
    grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.download-media-centered {
    grid-template-columns: 1fr;
}

.download-media-centered .download-poster-card {
    justify-self: center;
    width: min(100%, 280px);
}

.download-poster-card {
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.download-poster-card img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 6px;
    background: var(--poster-bg);
}

.download-info-card h2,
.download-section-card h2,
.download-action-card h2 {
    margin: 0 0 12px;
    font-size: 20px;
}

.download-action-card .action-row,
.detail-copy > .action-row {
    justify-content: center;
}

.download-action-card {
    text-align: center;
}

.detail-data-list {
    display: grid;
    gap: 8px;
    margin: 0;
}

.detail-data-list div {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.detail-data-list dt {
    color: var(--muted);
    font-weight: 800;
}

.detail-data-list dd {
    margin: 0;
}

.season-header-centered {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
}

.season-header-centered img {
    width: min(100%, 220px);
}

.season-list,
.episode-list,
.genre-grid {
    display: grid;
    gap: 10px;
}

.season-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.season-list a,
.genre-grid a {
    display: grid;
    gap: 4px;
    padding: 16px;
}

.season-list .season-card {
    grid-template-columns: 56px minmax(0, 1fr);
    align-items: center;
}

.season-card img {
    grid-row: span 2;
    width: 56px;
    height: 76px;
    object-fit: cover;
    border-radius: 6px;
}

.season-list span,
.genre-grid span,
.empty-state {
    color: var(--muted);
}

.genre-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 28px;
}

.pagination a {
    display: grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.pagination .is-active {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}

.site-footer {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 20px;
    padding: 34px 0;
    color: var(--muted);
    border-top: 1px solid var(--line);
}

.footer-column {
    display: grid;
    align-content: start;
    gap: 8px;
    min-width: 0;
}

.footer-column strong {
    color: var(--ink);
}

.site-style-directory {
    --bg: #c9c9c9;
    --surface: #ffffff;
    --ink: #222;
    --muted: #5f6368;
    --line: #d2d2d2;
    --accent: #116d2f;
    --accent-dark: #085522;
    --warm: #1c67c7;
    --header-bg: #151515;
    --hero-bg: #0f0f0f;
    --soft: #edf2f7;
    --chip: #f1f3f4;
    --poster-bg: #dedede;
    --sidebar-bg: #242424;
    --sidebar-alt: #343434;
    --sidebar-ink: #f2f2f2;
    --sidebar-muted: #b9b9b9;
}

:root[data-theme="dark"] .site-style-directory {
    --bg: #101010;
    --surface: #1c1c1c;
    --ink: #f3f3f3;
    --muted: #c8c8c8;
    --line: #343434;
    --accent: #2da052;
    --accent-dark: #77d994;
    --warm: #8bbcff;
    --header-bg: #080808;
    --hero-bg: #050505;
    --soft: #242a30;
    --chip: #282828;
    --poster-bg: #282828;
}

.site-style-directory .site-header {
    position: sticky;
    padding-block: 0;
    background: var(--header-bg);
    border-bottom: 3px solid var(--accent);
}

.site-style-directory .site-header-bar {
    width: 100%;
    margin: 0;
    padding-inline: clamp(16px, 4vw, 44px);
    background: var(--header-bg);
    border: 0;
    border-bottom: 3px solid var(--accent);
    border-radius: 0;
    box-shadow: none;
}

.site-style-directory .header-inner {
    min-height: 76px;
}

.site-style-directory .brand {
    color: #fff;
}

.site-style-directory .brand-mark {
    background: var(--accent);
    border-radius: 0;
}

.site-style-directory .main-nav {
    gap: 0;
}

.site-style-directory .main-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 76px;
    padding: 0 14px;
    color: #fff;
    text-transform: uppercase;
    font-size: 13px;
}

.site-style-directory .main-nav a:hover {
    color: #fff;
    background: rgba(255, 255, 255, .1);
}

.site-style-directory .header-icon-button,
.site-style-directory .header-search-form,
.site-style-directory .theme-toggle {
    min-height: 42px;
    width: 42px;
    padding: 0;
    color: #fff;
    background: #242424;
    border-color: #444;
}

.site-style-directory .header-search-form.is-open,
.site-style-directory .header-search-form:focus-within {
    width: auto;
}

.site-style-directory .header-search-form input {
    color: #fff;
}

.site-style-directory .header-cta {
    border-radius: 0;
}

.site-style-directory .hero,
.site-style-directory .studio-hero {
    width: min(1240px, calc(100% - 32px));
    min-height: auto;
    margin: 16px auto 0;
    padding: clamp(24px, 5vw, 46px);
    background: #0b0b0b;
    border: 1px solid #222;
}

.site-style-directory .hero h1,
.site-style-directory .page-header h1,
.site-style-directory .detail-copy h1 {
    font-size: clamp(28px, 4vw, 44px);
}

.site-style-directory .featured-rail-section,
.site-style-directory .genre-strip,
.site-style-directory .content-section,
.site-style-directory .page-shell,
.site-style-directory .detail-page {
    background: var(--surface);
    border: 1px solid var(--line);
}

.site-style-directory .featured-rail-section,
.site-style-directory .genre-strip {
    padding: 14px;
}

.site-style-directory .content-section,
.site-style-directory .page-shell,
.site-style-directory .detail-page {
    margin-top: 16px;
    padding: 18px;
}

.site-style-directory .section-heading,
.site-style-directory .panel-heading,
.site-style-directory .page-header {
    padding-bottom: 10px;
    border-bottom: 3px solid var(--accent);
}

.site-style-directory .section-heading h2,
.site-style-directory .latest-panel h2,
.site-style-directory .sidebar-heading h2,
.site-style-directory .download-info-card h2,
.site-style-directory .download-section-card h2,
.site-style-directory .download-action-card h2 {
    font-size: 18px;
}

.site-style-directory .poster-grid {
    gap: 16px 12px;
}

.site-style-directory .poster-frame,
.site-style-directory .featured-rail-card img,
.site-style-directory .detail-poster img,
.site-style-directory .download-poster-card,
.site-style-directory .season-header img {
    border-radius: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
}

.site-style-directory .poster-copy h3 {
    color: var(--accent-dark);
    font-size: 14px;
}

.site-style-directory .quality-badge,
.site-style-directory .primary-action,
.site-style-directory .calendar-link-button {
    border-radius: 0;
}

.site-style-directory .secondary-action,
.site-style-directory .meta-row span,
.site-style-directory .genre-strip a,
.site-style-directory .genre-grid a,
.site-style-directory .pagination a,
.site-style-directory .video-player-card,
.site-style-directory .stream-modal-panel,
.site-style-directory .stream-modal-header button,
.site-style-directory .download-title-card,
.site-style-directory .download-info-card,
.site-style-directory .download-section-card,
.site-style-directory .download-action-card,
.site-style-directory .latest-panel,
.site-style-directory .calendar-day,
.site-style-directory .calendar-episode {
    border-radius: 0;
}

.site-style-directory .detail-hero,
.site-style-directory .download-media-row {
    gap: 22px;
}

.site-style-directory .description {
    font-size: 16px;
}

.site-style-directory .sidebar-card,
.site-style-directory .sidebar-action-grid a,
.site-style-directory .sidebar-media-item,
.site-style-directory .sidebar-media-item img,
.site-style-directory .sidebar-chip-list a {
    border-radius: 0;
}

.site-style-directory .site-footer {
    width: 100%;
    max-width: none;
    margin-top: 24px;
    padding: 28px max(16px, calc((100vw - 1240px) / 2));
    color: #bdbdbd;
    background: #333;
    border-top: 4px solid #111;
}

.site-style-directory .footer-column {
    padding-left: 12px;
    border-left: 2px solid #777;
}

.site-style-directory .footer-column strong {
    color: #fff;
    padding-bottom: 7px;
    border-bottom: 2px solid #777;
}

@media (max-width: 1120px) {
    .poster-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .archive-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .split-section {
        grid-template-columns: 1fr;
    }

    .content-with-sidebar {
        grid-template-columns: 1fr;
    }

    .public-sidebar {
        position: static;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .episode-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .site-footer,
    .hero,
    .studio-hero,
    .detail-hero,
    .download-media-row {
        grid-template-columns: 1fr;
    }

    .header-inner {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .site-header,
    .site-footer {
        align-items: flex-start;
    }

    .site-footer,
    .main-nav,
    .header-actions {
        flex-wrap: wrap;
    }

    .main-nav {
        justify-content: flex-start;
    }

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

    .header-search-form.is-open,
    .header-search-form:focus-within {
        grid-template-columns: 42px minmax(110px, 1fr) 72px;
        width: min(100%, 360px);
    }

    .poster-grid,
    .compact-grid,
    .genre-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .season-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .site-footer,
    .public-sidebar {
        grid-template-columns: 1fr;
    }

    .site-header-bar {
        margin-top: 0;
        width: 100%;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    .site-style-directory .header-inner {
        min-height: 0;
    }

    .site-style-directory .main-nav a {
        padding: 0 10px;
        min-height: 48px;
    }

    .studio-feature-grid {
        max-width: 520px;
    }

    .download-poster-card {
        width: min(100%, 280px);
    }
}

@media (max-width: 640px) {
    .site-style-directory .site-header,
    .site-style-directory .site-header-bar {
        max-width: 100vw;
        overflow: hidden;
    }

    .site-style-directory .site-header {
        position: static;
    }

    .site-style-directory .site-header-bar {
        padding-inline: 10px;
    }

    .site-style-directory .header-inner {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        min-height: 0;
        padding-block: 12px;
    }

    .site-style-directory .brand {
        gap: 10px;
        font-size: 20px;
    }

    .site-style-directory .brand-mark {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

    .site-style-directory .main-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .site-style-directory .main-nav a {
        justify-content: center;
        min-height: 42px;
        padding: 0 8px;
        background: #202020;
        border: 1px solid #333;
        font-size: 12px;
    }

    .site-style-directory .header-actions {
        display: grid;
        grid-template-columns: 44px 44px minmax(0, 1fr);
        gap: 8px;
        width: 100%;
    }

    .site-style-directory .header-icon-button,
    .site-style-directory .header-search-form,
    .site-style-directory .theme-toggle {
        width: 44px;
        min-height: 44px;
    }

    .site-style-directory .header-cta {
        min-width: 0;
        min-height: 44px;
        padding: 0 10px;
        font-size: 13px;
        white-space: normal;
        text-align: center;
    }

    .site-style-directory .header-search-form.is-open,
    .site-style-directory .header-search-form:focus-within {
        grid-column: 1 / -1;
        grid-template-columns: 42px minmax(0, 1fr) 72px;
        width: 100%;
    }

    .genre-strip,
    .content-section,
    .page-shell,
    .detail-page,
    .site-footer,
    .site-style-directory .featured-rail-section,
    .site-style-directory .genre-strip,
    .site-style-directory .content-section,
    .site-style-directory .page-shell,
    .site-style-directory .detail-page {
        width: calc(100% - 16px);
        max-width: calc(100vw - 16px);
    }

    .site-style-directory .content-section,
    .site-style-directory .page-shell,
    .site-style-directory .detail-page {
        margin-top: 8px;
        padding: 12px;
    }

    .content-with-sidebar > div {
        min-width: 0;
        overflow: hidden;
    }

    .page-header {
        min-width: 0;
        overflow: hidden;
    }

    .page-header p {
        max-width: 100%;
        font-size: 15px;
        line-height: 1.45;
    }

    .site-style-directory .featured-rail-section {
        padding: 10px;
        overflow: hidden;
    }

    .site-style-directory .page-shell .featured-rail-section {
        width: 100%;
        max-width: 100%;
    }

    .featured-rail {
        max-width: 100%;
        grid-auto-columns: minmax(92px, 30vw);
        gap: 10px;
        overflow-x: auto;
    }

    .featured-rail-card img {
        min-height: 0;
    }

    .poster-grid,
    .compact-grid,
    .episode-grid,
    .doc-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .archive-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        width: 100%;
        max-width: 100%;
        margin-inline: auto;
    }

    .archive-grid .poster-card {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 10px;
        align-items: center;
        min-height: 110px;
        padding: 8px;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 8px;
    }

    .archive-grid .poster-frame {
        width: 72px;
        border-radius: 6px;
    }

    .archive-grid .quality-badge {
        top: 5px;
        right: 5px;
        max-width: calc(100% - 10px);
        padding: 3px 5px;
        overflow: hidden;
        font-size: 10px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .archive-grid .poster-copy {
        min-width: 0;
    }

    .archive-grid .poster-copy h3 {
        margin-top: 0;
        font-size: 13px;
    }

    .archive-grid .poster-copy p {
        font-size: 12px;
    }

    .episode-grid .episode-card,
    .season-list .season-card {
        display: grid;
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 10px;
        align-items: center;
        min-height: 110px;
        padding: 8px;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 8px;
    }

    .episode-grid .poster-frame {
        width: 72px;
        border-radius: 6px;
    }

    .episode-grid .quality-badge {
        top: 5px;
        right: 5px;
        max-width: calc(100% - 10px);
        padding: 3px 5px;
        overflow: hidden;
        font-size: 10px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .episode-grid .poster-copy {
        min-width: 0;
    }

    .episode-grid .poster-copy h3 {
        margin-top: 0;
        font-size: 13px;
    }

    .episode-grid .poster-copy p {
        font-size: 12px;
    }

    .season-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .season-card img {
        width: 72px;
        height: 108px;
    }

    .season-list .season-card strong,
    .season-list .season-card span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .season-list .season-card strong {
        font-size: 13px;
    }

    .season-list .season-card span {
        font-size: 12px;
    }
}

@media (max-width: 560px) {
    .hero {
        min-height: auto;
    }

    .hero h1,
    .page-header h1,
    .detail-copy h1 {
        font-size: 28px;
        line-height: 1.08;
    }

    .hero-search,
    .page-search {
        flex-direction: column;
    }

    .featured-rail-section,
    .page-shell .featured-rail-section,
    .detail-page .featured-rail-section {
        margin-bottom: 18px;
    }

    .featured-rail {
        grid-auto-columns: 108px;
        gap: 10px;
        padding-bottom: 10px;
    }

    .featured-rail-card strong {
        font-size: 12px;
    }

    .section-heading,
    .panel-heading {
        align-items: flex-start;
        gap: 10px;
    }

    .section-heading h2,
    .latest-panel h2 {
        font-size: 18px;
    }

    .poster-grid,
    .compact-grid,
    .episode-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .genre-grid,
    .season-header,
    .season-list,
    .calendar-day {
        grid-template-columns: 1fr;
    }

    .studio-feature-grid {
        grid-template-columns: 1fr;
    }

    .studio-feature-grid a {
        min-height: 260px;
    }

    .detail-data-list div {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .doc-page {
        padding: 16px;
    }
}
