﻿:root {
  color-scheme: dark;
  --bg: #15121f;
  --surface: #211c33;
  --raised: #2c2543;
  --ink: #f4f1fb;
  --muted: #beb5d1;
  --accent: #ff6b92;
  --line: #45395e;
  --radius: 18px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: radial-gradient(ellipse at 10% 0, #332039 0, transparent 38rem) no-repeat, var(--bg);
  color: var(--ink);
  font: 1rem/1.5 Manrope, system-ui, sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wrap { width: min(90rem, calc(100% - clamp(2rem, 6vw, 5rem))); margin-inline: auto; }
header {
  position: sticky;
  top: 0;
  z-index: 3;
  border-bottom: 1px solid var(--line);
  background: #171322ed;
  backdrop-filter: blur(12px);
}
.top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  column-gap: clamp(.45rem, 1.6vw, 1.4rem);
  padding-block: .8rem;
}
.brand { display: inline-flex; align-items: center; }
.brand img { width: 156px; height: auto; display: block; }
.top > .brand { grid-area: 1 / 1; }
.top > .brand img { width: clamp(7.5rem, 12vw, 10.5rem); }
.site-search { display: contents; }
.nav-search-panel {
  grid-area: 2 / 1 / 3 / -1;
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 240ms cubic-bezier(.22,.8,.25,1), opacity 180ms ease;
}
.site-search.is-expanded .nav-search-panel {
  grid-template-rows: 1fr;
  opacity: 1;
}
.nav-search-clip { min-height: 0; overflow: hidden; }
.search-controls {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: min(100% - .5rem, 48rem);
  min-height: 3.375rem;
  margin: .65rem auto .4rem;
  padding-inline: clamp(.65rem, 2vw, 1rem);
  border: 1px solid var(--line);
  border-radius: 1.125rem;
  background: var(--surface);
}
.search-controls:focus-within { border-color: var(--accent); }
.search-controls:focus-within > .search-icon { border-color: var(--accent); }
.search-controls:focus-within > .search-icon::after { background: var(--accent); }
@media (prefers-reduced-motion: reduce) {
  .nav-search-panel { transition: none; }
}
.site-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  padding: .65rem .25rem .65rem 0;
  font-size: 1rem;
  font-weight: 500;
}
#search-clear, #search-close {
  flex: none;
  padding: 0;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: .5rem;
  background: transparent;
  color: var(--muted);
  font-size: 1.3rem;
}
#search-clear {
  width: auto;
  padding-inline: .5rem;
  font-size: .875rem;
}
#search-clear:hover, #search-close:hover { color: var(--ink); background: var(--raised); }
.site-search input::placeholder { color: var(--muted); }
.search-icon { width: 14px; height: 14px; border: 2px solid var(--muted); border-radius: 50%; position: relative; flex: 0 0 auto; margin-right: 3px; }
.search-icon::after { content: ""; position: absolute; width: 6px; height: 2px; right: -5px; bottom: -3px; transform: rotate(45deg); background: var(--muted); }
.hero-stage {
  --hero-gutter: max(calc((100% - 90rem) / 2), clamp(1rem, 3vw, 2.5rem));
  --hero-poster-width: min(28vw, 17.5rem);
  position: relative;
  isolation: isolate;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  cursor: grab;
  display: grid;
  grid-template: "art intro" minmax(0, 1fr) / var(--hero-poster-width) minmax(0, 1fr);
  block-size: clamp(32rem, 40vw, 35rem);
  align-items: center;
  gap: clamp(1.25rem, 3vw, 3rem);
  padding: clamp(1.25rem, 2.5vw, 2.5rem) max(var(--hero-gutter), 3.25rem);
  background: #1b1427;
}
.intro {
  grid-area: intro;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
}
.hero-summary { display: contents; }
.hero-art {
  position: relative;
  grid-area: art;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: .75rem;
  box-shadow: 0 .45rem 1.25rem #100a1860;
}
.hero-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: hero-art-in .32s ease-out both;
}
.hero-poster-unavailable {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: .5rem;
  background: #21182ed9;
  color: #e5dcf2;
  text-align: center;
  font-size: .875rem;
}
.hero-controls {
  z-index: 1;
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: 1rem;
  color: var(--ink);
  font-size: .875rem;
}
.hero-controls button { min-width: 40px; min-height: 40px; padding: 4px 11px; }
.hero-stage .hero-arrow {
  display: grid;
  place-items: center;
  inline-size: 40px;
  block-size: 40px;
  padding: 0;
}
.hero-arrow {
  position: absolute;
  z-index: 2;
  inset-block-start: 50%;
  translate: 0 -50%;
}
#hero-prev { inset-inline-start: .5rem; }
#hero-next { inset-inline-end: .5rem; }
.hero-arrow::before {
  content: "";
  width: .55rem;
  height: .55rem;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  rotate: -45deg;
}
#hero-prev::before { rotate: 135deg; }
#hero-position { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#hero-dots { display: flex; align-items: center; }
#hero-dots button { display: grid; place-items: center; padding: 0; width: 25px; min-width: 25px; border: 0; background: transparent; }
.hero-dot::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: #e6d9eba8; }
.hero-dot[aria-current=true]::before { background: var(--accent); }
.hero-stage.is-dragging { cursor: grabbing; }
.hero-image { translate: var(--drag-offset,0px) 0; transition: translate .18s ease-out; pointer-events: none; }
.hero-stage.is-dragging .hero-image { transition: none; }
#hero-save, .hero-controls .secondary, .hero-stage .hero-arrow { background: #21182ed9; }
@keyframes hero-art-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .hero-image { animation: none; } }
.tag { display: inline-block; margin: 0; color: #ffbad0; background: #2a1c38d9; border: 1px solid #a35479; border-radius: 999px; padding: 4px 11px; font-size: .875rem; font-weight: 750; }
.hero h1 { margin: 14px 0 9px; font-size: clamp(1.75rem, 3.2vw, 3rem); line-height: 1.05; letter-spacing: -.05em; text-shadow: 0 2px 20px #15121fc0; }
.hero h1, #hero-description {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
}
#hero-description { -webkit-line-clamp: 2; max-width: 470px; margin: 0 0 .65rem; color: #e5dcf2; }
.hero-synopsis-slot { inline-size: 100%; block-size: 4.5em; margin-bottom: 1rem; }
#hero-synopsis {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  overflow-wrap: anywhere;
  max-width: 65ch;
  margin: 0;
  color: #e5dcf2;
  line-height: 1.5;
}
@media (max-width: 700px) {
  .hero-stage {
    --hero-poster-width: min(34vw, 10rem);
    grid-template:
      "art summary" max(13rem, calc(var(--hero-poster-width) * 1.5))
      "synopsis synopsis" auto
      "actions actions" auto
      "controls controls" auto / var(--hero-poster-width) minmax(0, 1fr);
    block-size: auto;
    gap: .75rem 1rem;
    padding-inline: var(--hero-gutter);
  }
  .hero-stage .intro { display: contents; }
  .hero-summary { display: block; grid-area: summary; min-width: 0; }
  .hero #headline { font-size: clamp(1.125rem, 4.8vw, 1.8rem); margin-block: .5rem; }
  #hero-description { margin: 0; }
  .hero-synopsis-slot { grid-area: synopsis; block-size: 6em; margin: 0; }
  .hero-actions { grid-area: actions; }
  .hero-controls {
    grid-area: controls;
    justify-content: center;
    flex-wrap: wrap;
    margin: 0;
    padding-inline: 2.75rem;
  }
  .hero-arrow { grid-area: controls; }
  #hero-prev { inset-inline-start: 0; }
  #hero-next { inset-inline-end: 0; }
  #hero-dots button { width: 21px; min-width: 21px; }
  #hero-synopsis { -webkit-line-clamp: 4; }
}
@media (max-width: 380px) {
  .hero-controls { min-block-size: 5.5rem; }
}
.actions, .filters { display: flex; flex-wrap: wrap; gap: 9px; }
.primary, .secondary, .filters button {
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--raised);
  font-weight: 700;
}
.primary { background: var(--accent); color: #251320; border-color: transparent; }
.primary:hover, .secondary:hover, .filters button:hover { filter: brightness(1.17); }
.filters button { font-size: .875rem; padding: 7px 13px; }
.filters button[aria-pressed=true] { border-color: var(--accent); color: #ffd2e0; }
.today-panel, .airing-calendar { margin-top: clamp(1.25rem, 2.5vw, 2rem); }
.today-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-top: 12px; }
.today-choice {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: end;
  min-height: 7rem;
  aspect-ratio: 3 / 1;
  text-align: left;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.today-choice:hover, .today-choice[aria-expanded=true] { border-color: var(--accent); }
.today-choice img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.today-choice::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, #171020d9, transparent 77%); }
.today-choice span { padding: .7rem .9rem; font-size: clamp(1rem, 1.6vw, 1.3rem); font-weight: 750; }
#today-results { margin-top: 1.25rem; }
.today-results-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1rem;
  margin-bottom: .75rem;
}
#today-results h3 { margin: 0; }
#today-more:disabled { opacity: .65; cursor: default; }
#today-status { color: var(--muted); }
@media (max-width: 650px) {
  .today-options { grid-template-columns: 1fr; }
}
#catalog { margin-top: 34px; scroll-margin-top: 145px; }
h2 { margin: 0; font-size: clamp(1.3rem, 2.2vw, 1.75rem); letter-spacing: -.025em; }
.section-title { display: flex; align-items: baseline; gap: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); gap: 14px; }
.card { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.card:hover { border-color: #b36a92; }
.tile { color: inherit; text-decoration: none; display: block; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; }
.tile img { display: block; width: 100%; aspect-ratio: 3/4; object-fit: cover; object-position: center 24%; background: linear-gradient(135deg,#472e58,#2e2942); }
.tile strong, .tile span { display: block; padding-inline: 10px; overflow-wrap: anywhere; }
.tile strong { padding-top: 9px; font-size: .95rem; }
.tile span { padding-bottom: 11px; color: var(--muted); font-size: .875rem; }
.bookmark { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; background: #171322ec; border: 1px solid #ffffff53; border-radius: 50%; font-size: 1.2rem; }
.bookmark[aria-pressed=true] { color: #ffabc2; border-color: var(--accent); }
.catalog-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 18px; }
.catalog-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, 245px); gap: 20px; align-items: start; }
.catalog-layout:has(.browse[hidden]) { grid-template-columns: minmax(0,1fr); }
.catalog-results > .filters:not([hidden]) { margin-bottom: 14px; }
.browse { display: grid; gap: 12px; padding: 17px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.browse h3 { margin: 0; font-size: 1rem; }
.browse label { display: grid; gap: 5px; color: var(--muted); font-size: .875rem; }
.browse select { width: 100%; min-width: 0; padding: 8px 27px 8px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--raised); color: var(--ink); }
#results, #paging, .empty, #watch-meta, footer p { color: var(--muted); }
#catalog-status:empty { margin: 0; }
.empty { grid-column: 1/-1; }
footer { margin-top: 42px; padding-block: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 16px; }
footer .brand img { width: 125px; }
.related { border-top: 1px solid var(--line); margin-top: 18px; }
.missing { font-size: 0; color: transparent; }
@media (max-width: 760px) {
  .catalog-layout { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .browse { grid-row: 1; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 12px; }
  .browse h3 { grid-column: 1/-1; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); }
  .collection-grid, .collection-grid:has(.card:nth-child(3):last-child) { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(148px, 36%); overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 8px; }
  .collection-grid:has(.card:nth-child(3):last-child) { grid-auto-columns: minmax(190px, 67%); }
  .collection-grid .card { scroll-snap-align: start; }
  footer { flex-wrap: wrap; }
  footer p { margin: 0; }
}
@media (max-width: 400px) {
  .browse { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .browse label:first-of-type { grid-column: 1/-1; }
  .grid:not(.collection-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.top-actions {
  grid-area: 1 / 4;
  display: flex;
  gap: .45rem;
  align-items: center;
}
.nav-tool, .nav-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 44px;
  padding-inline: .75rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #d3c7db;
  font-size: .9rem;
  font-weight: 650;
  white-space: nowrap;
}
.nav-tool { border-color: #72617a70; background: #2a2236; }
.site-nav { display: contents; }
.nav-links {
  grid-area: 1 / 2;
  justify-self: center;
  display: flex;
  gap: .15rem;
  padding: .2rem;
  border: 1px solid #a68cad36;
  border-radius: 999px;
  background: #191420;
}
.nav-links a { min-height: 40px; }
.nav-links svg { width: 1.12rem; height: 1.12rem; flex: none; }
.nav-links .mobile-list, .nav-search-label, .dock-only { display: none; }
.search-toggle { grid-area: 1 / 3; width: 44px; padding: 0; }
.nav-tool:hover, .nav-links a:hover,
.search-toggle[aria-expanded=true], .nav-links a[aria-current=page],
.top-actions .list-link[aria-current=page] {
  border-color: #c182a9;
  color: #ffe0ee;
  background: #442740;
}
.nav-links a[aria-current=page] svg { color: #ffacc7; }
.list-icon {
  width: .9rem;
  height: 1.1rem;
  flex: none;
  background: currentColor;
  clip-path: polygon(0 0,100% 0,100% 100%,50% 73%,0 100%);
}
.saved-count:not(:empty) {
  min-width: 1.25rem;
  padding-inline: .25rem;
  border-radius: 999px;
  background: var(--accent);
  color: #251320;
  font-size: .75rem;
  text-align: center;
}
@media (max-width: 900px) {
  .top-actions .list-label { display: none; }
}
@media (651px <= width <= 760px) {
  .nav-links a { padding-inline: .55rem; }
  .nav-links svg { display: none; }
}
@media (max-width: 650px) {
  body { padding-bottom: calc(4.5rem + env(safe-area-inset-bottom)); }
  body:has(.site-search.is-expanded) { padding-bottom: calc(8.5rem + env(safe-area-inset-bottom)); }
  .top { grid-template-columns: 1fr auto; padding-block: .6rem; }
  .top-actions { grid-area: 1 / 2; }
  .top-actions > .list-link { display: none; }
  .site-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed;
    inset: auto .45rem max(.4rem, env(safe-area-inset-bottom));
    gap: .15rem;
    padding: .25rem;
    border: 1px solid #7d6086;
    border-radius: 1.25rem;
    box-shadow: 0 .4rem 1.5rem #100b19a8;
    background: #21192af7;
  }
  .nav-links { display: contents; }
  .nav-links a, .nav-links .mobile-list, .search-toggle {
    display: flex;
    flex-direction: column;
    grid-row: 2;
    gap: .3rem;
    width: auto;
    min-height: 47px;
    padding: .3rem .1rem;
    border-radius: .9rem;
    font-size: .72rem;
    background: transparent;
  }
  .nav-links a { position: relative; }
  .nav-links a:nth-child(4) { grid-column: 4; }
  .search-toggle { grid-area: 2 / 5; border-color: transparent; }
  .nav-search-label { display: inline; }
  .nav-search-panel { grid-area: 1 / 1 / 2 / -1; }
  .search-controls { margin: .25rem auto .4rem; }
  .search-controls > .search-icon { display: none; }
  .nav-links .saved-count:not(:empty) {
    position: absolute;
    top: .15rem;
    left: calc(50% + .35rem);
  }
  header { backdrop-filter: none; }
}
.catalog-results { container-type: inline-size; }
#paging, footer { overflow-anchor: none; }
#more[aria-disabled=true] { opacity: .65; cursor: wait; }

/* Search workspace and its independent filter panel. */
#catalog .catalog-layout { grid-template-columns: minmax(0, 1fr) clamp(245px, 22vw, 305px); align-items: start; }
#catalog .catalog-layout:has(.browse[hidden]) { grid-template-columns: minmax(0,1fr); }
.catalog-layout:has(.browse:not([hidden])) > .catalog-results {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #1b1729;
  padding: clamp(11px, 1.5vw, 21px);
}
.search-toolbar { display: flex; gap: 12px; align-items: stretch; margin-bottom: 20px; }
.sort-select { position: relative; min-width: 0; max-width: 100%; }
.sort-select select {
  appearance: none;
  width: 100%;
  min-height: 44px;
  padding: .5rem 2rem .5rem .85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #2a2239;
  color: var(--ink);
  font-size: .875rem;
  cursor: pointer;
  text-overflow: ellipsis;
}
.sort-select::after {
  content: "";
  position: absolute;
  top: calc(50% - 5px);
  right: .9rem;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  pointer-events: none;
}
.filter-choice summary > span {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 44px; padding: 8px 13px; border: 1px solid var(--line);
  border-radius: 999px; background: #2a2239; cursor: pointer; list-style: none;
  font-size: .875rem;
}
.filter-choice summary > span::after {
  content: ""; height: 7px; width: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); flex: 0 0 auto;
}
.filter-choice[open] summary > span::after { transform: rotate(225deg); }
.filter-choice[open] summary > span { border-color: #a37aab; }
.filter-choice summary::-webkit-details-marker, .filter-help summary::-webkit-details-marker { display:none; }
#browse { position: sticky; top: 145px; max-height: calc(100dvh - 163px); overflow: auto; padding: 15px; background: #211b2e; scrollbar-width: thin; }
.filter-main, #filter-options { display: grid; gap: 14px; min-width: 0; }
.filter-main h3 { font-size: 1.05rem; }
.filter-main fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.filter-main legend, .filter-choice strong { padding: 0; margin-bottom: 6px; font-size: .875rem; font-weight: 720; }
.range-fields { display: grid; align-items: center; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 7px; color: var(--muted); }
.range-fields input, #genre-search {
  width: 100%; min-width: 0; color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px; min-height: 37px;
  padding: 6px 11px; background: #2a2339; font-size: .875rem;
}
.filter-link, .filter-reset, .choice-grid button, .genre-options button {
  color: var(--ink); border: 1px solid var(--line); border-radius: 999px;
  background: #2a2239; min-height: 36px; padding: 6px 10px; font-size: .875rem;
}
.filter-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; font-weight: 700; }
.filter-link span:last-child:not(:first-child) { color: var(--muted); }
#close-genres { justify-content: flex-start; }
#close-genres span { font-size: 1.3rem; line-height: 1; }
.filter-reset { width: 100%; }
.filter-link:hover, .filter-reset:hover, .choice-grid button:hover, .genre-options button:hover { border-color: #ae7ca4; }
.switch-row { display: flex; gap: 6px; align-items: center; }
.switch-row label { display: flex; align-items: center; flex: 1; gap: 7px; color: var(--ink); cursor: pointer; }
.switch-row input {
  appearance: none; flex: 0 0 auto; position: relative; border: 1px solid #6c5a79;
  background: #41354f; width: 36px; height: 21px; border-radius: 20px; margin: 0;
}
.switch-row input::after { content: ""; position: absolute; width: 13px; height: 13px; border-radius: 50%; left: 3px; top: 3px; background: #f0dfeb; }
.switch-row input:checked { background: #a34678; }
.switch-row input:checked::after { left: 18px; }
.filter-help { position: relative; }
.filter-help summary { list-style: none; border: 1px solid #80678a; display: grid; place-items: center; border-radius: 50%; width: 21px; height: 21px; font-size: .8rem; cursor: pointer; }
.filter-help p { position: absolute; right: 0; z-index: 1; width: 178px; margin: 5px 0; padding: 8px; background:#392b45; border: 1px solid var(--line); border-radius: 9px; font-size: .875rem; }
.filter-choice summary { display: grid; gap: 4px; cursor: pointer; list-style: none; }
.filter-choice summary > span { min-height: 37px; color: var(--muted); }
.choice-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px;
  background: #242033; border: 1px solid var(--line); border-radius: 12px; margin-top: 6px; padding: 7px;
}
.choice-grid .filter-reset { grid-column: 1 / -1; margin-top: 4px; }
.choice-grid button[aria-pressed=true], .genre-options button[aria-pressed=true] { border-color: var(--accent); color: #ffd2e6; background: #4a2d49; }
.genre-options { display: grid; gap: 3px; max-height: min(51vh, 500px); overflow: auto; scrollbar-width: thin; padding: 2px; }
.genre-options button { background: transparent; border-color: transparent; text-align: left; }
#mobile-filters { flex: 0 0 auto; }
@media (max-width: 850px) {
  #catalog .catalog-layout { grid-template-columns: minmax(0,1fr); }
  #catalog .catalog-layout:has(.browse:not([hidden])) { display: flex; flex-direction: column-reverse; align-items: stretch; }
  #browse { position: static; max-height: none; }
  .search-toolbar { flex-wrap: wrap; }
}
.grid.poster-grid {
  --poster-radius: 14px;
  --poster-control-inset: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2rem 1.5rem;
  align-items: start;
}
@media (max-width: 1180px) {
  .grid.poster-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .grid.poster-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@container (width <= 1050px) {
  .catalog-results .grid.poster-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@container (width <= 780px) {
  .catalog-results .grid.poster-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@container (width <= 540px) {
  .catalog-results .grid.poster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.poster-grid .catalog-card {
  min-width: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.poster-grid .tile:focus-visible { outline-offset: 3px; }
.poster-grid .card-poster {
  position: relative;
  overflow: hidden;
  border-radius: var(--poster-radius);
}
.poster-grid .card-poster { background: linear-gradient(135deg,#472e58,#2e2942); }
.poster-grid .card-poster img { aspect-ratio: 2 / 3; }
.poster-grid .card-poster img.missing { visibility: hidden; }
.poster-grid .tile strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  padding: 0;
  margin-top: .625rem;
  min-height: 2.5em;
  line-height: 1.25;
}
.poster-grid .tile .catalog-card-meta {
  padding: 0;
  margin-top: .25rem;
  min-height: 1.375em;
  line-height: 1.375;
}
.poster-grid .tile .catalog-card-meta.has-status {
  display: flex;
  align-items: baseline;
  gap: .375rem;
}
.poster-grid .tile .catalog-card-summary,
.poster-grid .tile .catalog-card-status {
  padding: 0;
  white-space: nowrap;
}
.poster-grid .tile .catalog-card-summary {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.poster-grid .tile .catalog-card-status {
  flex: none;
  color: var(--muted);
}
.catalog-card-status::before {
  content: '';
  display: inline-block;
  width: .4em;
  height: .4em;
  margin-inline-end: .35em;
  border-radius: 50%;
  vertical-align: .1em;
  background: currentColor;
}
.poster-grid .tile .catalog-card-status[data-status="airing"] { color: #72d6a4; }
.poster-grid .tile .catalog-card-status[data-status="upcoming"] { color: #e5b86b; }
[data-theme="light"] .poster-grid .tile .catalog-card-status[data-status="airing"] { color: #217849; }
[data-theme="light"] .poster-grid .tile .catalog-card-status[data-status="upcoming"] { color: #895900; }
.poster-grid .tile .card-score {
  position: absolute;
  top: var(--poster-control-inset);
  left: var(--poster-control-inset);
  padding: .2rem .5rem;
  border: 1px solid #ffffff3d;
  border-radius: 999px;
  background: #191323e6;
  color: #ffcf65;
  font-weight: 750;
}
.poster-grid .bookmark {
  top: var(--poster-control-inset);
  right: var(--poster-control-inset);
}
.catalog-card-genres {
  display: flex;
  flex-wrap: wrap;
  gap: .375rem;
  margin-top: .5rem;
}
.catalog-card-genres .catalog-genre-chip {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 650px) {
  .grid.poster-grid, .catalog-results .grid.poster-grid {
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 1.5rem clamp(.75rem, 3vw, 1rem);
  }
  .poster-grid .tile strong { min-height: 0; }
  .poster-grid .catalog-card-meta:empty { display: none; }
}
.catalog-genre-chip, .catalog-genre-active {
  max-width: 100%;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: .3rem .6rem;
  color: #e5dcf2;
  background: var(--raised);
  font-size: .875rem;
  overflow-wrap: anywhere;
}
.catalog-genre-chip:focus-visible, .catalog-genre-active {
  color: #251320;
  background: var(--accent);
}
@media (hover: hover) {
  button.catalog-genre-chip:hover {
    color: #251320;
    background: var(--accent);
  }
}
#catalog-genre-active { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .65rem; }
@media (pointer: coarse) {
  .catalog-card-genres button { min-height: 36px; }
  .catalog-genre-active { min-height: 36px; }
}

.catalog-skeleton::before,
.catalog-skeleton::after {
  content: "";
  display: block;
  background: var(--raised);
}
.catalog-skeleton::before {
  aspect-ratio: 2 / 3;
  border-radius: 14px;
}
.catalog-skeleton::after {
  width: 70%;
  height: .85rem;
  margin-block: .75rem 2rem;
  border-radius: 999px;
}

.poster-grid .tile:focus-visible .card-poster,
.poster-grid .tile:active .card-poster {
  box-shadow: 0 0 0 1px var(--accent);
}
@media (hover: hover) and (pointer: fine) {
  .poster-grid .tile:hover .card-poster {
    box-shadow: 0 0 0 1px #ff8bb9, 0 5px 18px #aa5a9440;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .poster-grid .card-poster { transition: box-shadow 180ms ease-out; }
  .today-card-enter { animation: today-card-enter 230ms ease-out var(--entry-delay, 0ms) both; }
}
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  .poster-grid .card-poster img { transition: transform 230ms ease-out; }
  .poster-grid .tile:hover .card-poster img { transform: scale(1.045); }
}
@keyframes today-card-enter {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Winter holidays */
body { background: radial-gradient(ellipse at 10% 0,#223f40,transparent 42rem),var(--bg); }
.winter-header { background: linear-gradient(110deg,#14272bef,#211b2cf7 65%,#28202aef); border-color:#786447; }
.winter-header::before {
  content:""; display:block; height:27px; pointer-events:none;
  background:url("./winter-lights.svg") repeat-x center top;
}

.winter-greeting {
  display:inline-block; margin-bottom:.55rem; color:#ffe0a2;
  font-size:clamp(.85rem,1.3vw,1.05rem); font-weight:650;
}
.winter-greeting::before { content:"✧"; margin-right:.45rem; }
.hero-stage { background:radial-gradient(ellipse at 75% 4%,#eeb47126,transparent 58%),linear-gradient(125deg,#142b2e,#211a2c 60%); }
.snowfall {
  position:fixed; inset:0; z-index:4;
  overflow:hidden; pointer-events:none;
  opacity:0;
  visibility:hidden;
}
.snowfall.is-visible {
  opacity:.75;
  visibility:visible;
}
@media (prefers-reduced-motion:no-preference) {
  .snowfall {
    transition:opacity 380ms ease, visibility 0s linear 380ms;
  }
  .snowfall.is-visible { transition-delay:0s; }
  .snow-toggle { transition:color 220ms ease; }
  .snow-toggle span { transition:opacity 220ms ease; }
}
.snowfall::before, .snowfall::after {
  content:""; position:absolute; inset:-210px -40px 0;
  background:url("./snow-crystals.svg") repeat;
  opacity:.65;
}
.snowfall::before {
  background-size:182px 147px; background-position:54px 24px; opacity:.34;
}
@media (prefers-reduced-motion:no-preference) {
  .snowfall::after { animation:winter-fall 10s linear infinite; }
  .snowfall::before { animation:winter-drift 14s linear infinite; }
  .winter-header::before { animation:winter-glow 5s ease-in-out infinite alternate; }
}
@keyframes winter-fall {
  0% { transform:translate(0,0); }
  50% { transform:translate(14px,105px); }
  100% { transform:translate(0,210px); }
}
@keyframes winter-drift {
  0% { transform:translate(0,0); }
  50% { transform:translate(-9px,73.5px); }
  100% { transform:translate(0,147px); }
}
@keyframes winter-glow {
  from { opacity:.77; }
  to { opacity:1; }
}
@media (max-width:650px) {
  .winter-header::before {height:17px;background-size:160px 18px;}
  .winter-greeting {margin-bottom:.2rem;}
  .snowfall::before { display:none; }
}

.snow-toggle {
  width:44px;
  padding:0;
  border-radius:50%;
  font-size:1.4rem;
  background:var(--surface);
}
.snow-toggle[aria-pressed="true"] { color:#bce8ff; }
.snow-toggle[aria-pressed="false"] { color:var(--muted); }
.snow-toggle[aria-pressed="false"] span { opacity:.62; }

.bookmark-sync { margin-block: 0.75rem; }
.bookmark-sync summary { cursor: pointer; }
.bookmark-sync p { margin-block: 0.75rem; }
.bookmark-sync form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-block: .75rem; }
.bookmark-sync input { max-width: 100%; padding: .5rem; border-radius: .4rem; }
.bookmark-sync button { margin-block: .25rem; }
.sync-notice:empty { display: none; }
.sync-notice {
  position: fixed;
  z-index: 20;
  bottom: 1rem;
  left: 1rem;
  margin: 0;
  max-width: min(30rem, calc(100vw - 2rem));
  padding: .75rem 1rem;
  color: #fff;
  background: #441c32;
  border-radius: .5rem;
}

.catalog-head { flex-wrap: wrap; margin-bottom: clamp(1rem, 2vw, 1.6rem); }
.catalog-head .section-title { flex-wrap: wrap; gap: .25rem .9rem; }
.catalog-head .section-title h2 { font-size: clamp(1.45rem, 3vw, 2.25rem); }
.catalog-head .section-title #results { white-space: nowrap; }
.catalog-head .search-toolbar { margin: 0; gap: .65rem; }
.catalog-head .search-toolbar #mobile-filters,
.catalog-head .search-toolbar select { border-radius: 999px; }

.search-card mark { background: transparent; color: #ff9fbe; }
@media (max-width: 650px) {
  .catalog-head .search-toolbar { width: 100%; flex-wrap: nowrap; }
  .catalog-head .sort-select { flex: 1 1 0; }
}

.theme-toggle { width: 44px; padding: 0; color: #ffdab1; }
.theme-toggle svg { width: 1.25rem; height: 1.25rem; }
.theme-toggle .theme-moon,
.theme-toggle[aria-pressed=true] .theme-sun { display: none; }
.theme-toggle[aria-pressed=true] .theme-moon { display: block; }

:root[data-theme=light] {
  color-scheme: only light;
  background-color: #f7f9fc;
  --bg: #f7f9fc;
  --surface: #ffffff;
  --raised: #edf1f6;
  --ink: #202b39;
  --muted: #49596a;
  --accent: #2c608f;
  --line: #cbd6e1;
}
[data-theme=light] body {
  background: radial-gradient(ellipse at 10% 0,#e9f2fb,transparent 42rem),var(--bg);
}
[data-theme=light] .winter-header {
  background: linear-gradient(110deg,#f0f7fbf5,#ffffffF5 65%,#f5f8fcf5);
  border-color: var(--line);
}
[data-theme=light] .nav-links,
[data-theme=light] .search-controls { background: var(--surface); border-color: var(--line); }
[data-theme=light] .search-controls:focus-within { border-color: var(--accent); }
[data-theme=light] .nav-tool,
[data-theme=light] .nav-links a { color: var(--muted); }
[data-theme=light] .nav-tool { background: var(--raised); border-color: var(--line); }
[data-theme=light] .nav-tool:hover,
[data-theme=light] .nav-links a:hover,
[data-theme=light] .search-toggle[aria-expanded=true],
[data-theme=light] .nav-links a[aria-current=page],
[data-theme=light] .top-actions .list-link[aria-current=page] {
  color: #244c70;
  border-color: #94aec7;
  background: #e5eef7;
}
[data-theme=light] .nav-links a[aria-current=page] svg,
[data-theme=light] .theme-toggle { color: var(--accent); }
[data-theme=light] .snow-toggle[aria-pressed=true] { color: #32618a; }
[data-theme=light] .winter-header::before {
  background-image: url("./winter-lights-light.svg");
  animation: none;
}
[data-theme=light] .snowfall.is-visible { opacity: .8; }
[data-theme=light] .snowfall::before,
[data-theme=light] .snowfall::after {
  display: block;
  inset: -248px auto 0 0;
  width: min(8rem, max(1.25rem, 3vw, (100vw - 90rem) / 2));
  background: url("./snow-crystals-light.svg") repeat-y center 0 / 64px 248px;
  opacity: .9;
  animation: none;
}
[data-theme=light] .snowfall::after {
  inset-inline: auto 0;
  background-position-y: 118px;
}
@media (prefers-reduced-motion: no-preference) {
  [data-theme=light] .snowfall::before { animation: light-snow-fall 25s linear infinite; }
  [data-theme=light] .snowfall::after { animation: light-snow-fall 32s linear infinite; }
}
@keyframes light-snow-fall {
  to { transform: translateY(248px); }
}
@media (max-width: 650px) {
  [data-theme=light] .snowfall::before,
  [data-theme=light] .snowfall::after {
    width: 1rem;
    background-size: 32px 248px;
  }
}

[data-theme=light] #browse,
[data-theme=light] .catalog-layout:has(.browse:not([hidden])) > .catalog-results,
[data-theme=light] .choice-grid,
[data-theme=light] .filter-help p { background: var(--surface); }
[data-theme=light] .sort-select select,
[data-theme=light] .filter-choice summary > span,
[data-theme=light] .range-fields input,
[data-theme=light] #genre-search,
[data-theme=light] .filter-link,
[data-theme=light] .filter-reset,
[data-theme=light] .choice-grid button { background: var(--raised); }
[data-theme=light] .choice-grid button[aria-pressed=true],
[data-theme=light] .genre-options button[aria-pressed=true] {
  color: #244c70;
  background: #e5eef7;
}
[data-theme=light] .switch-row input { background: #93a2b3; border-color: #697e95; }
[data-theme=light] .switch-row input:checked { background: var(--accent); }
[data-theme=light] .catalog-genre-chip { color: var(--ink); }
[data-theme=light] .catalog-genre-chip:focus-visible,
[data-theme=light] button.catalog-genre-chip:hover,
[data-theme=light] .catalog-genre-active,
[data-theme=light] .primary,
[data-theme=light] .saved-count:not(:empty) { color: white; }

/* Artwork retains a dark scrim so captions stay readable in both themes. */
[data-theme=light] .hero-stage {
  color: #f5f8fc;
  --ink: #f5f8fc;
  --muted: #cedae6;
  --accent: #a9d8fc;
  --raised: #26384c;
  --line: #647b93;
}
[data-theme=light] .hero-stage .intro { color: #ffffff; }
[data-theme=light] #hero-description { color: #e7edf4; }
[data-theme=light] #hero-tag {
  color: #cae8ff;
  background: #1d344b;
  border-color: #6a8cac;
}
[data-theme=light] .search-card mark { color: #8d2665; }
[data-theme=light] .hero-stage .primary { color: #122334; }
[data-theme=light] #hero-save,
[data-theme=light] .hero-controls .secondary,
[data-theme=light] .hero-stage .hero-arrow {
  color: #ffffff;
  border-color: #9db2c9;
}
[data-theme=light] .today-choice { color: #f8fbff; }
[data-theme=light] .bookmark,
[data-theme=light] .sync-notice { color: #f5f8fc; }
[data-theme=light] .bookmark[aria-pressed=true] { color: #bde3ff; }
@media (max-width: 650px) {
  [data-theme=light] .site-nav {
    background: #fffffff7;
    border-color: var(--line);
    box-shadow: 0 .4rem 1.5rem #22354c34;
  }
}

/* Dock the existing search and section links at the homepage section threshold. */
@media (min-width: 1100px) and (min-height: 360px) {
  .winter-header { position: relative; backdrop-filter: none; }
  .top { grid-template-rows: minmax(calc(42px + .4rem), auto) auto; }
  main .wrap, footer.wrap { width: min(90rem, 100% - 8rem); }
  .hero-stage { --hero-gutter: max(calc((100% - 90rem) / 2), 4rem); }

  .nav-docked .site-nav {
    display: grid;
    grid-template-columns: 1fr;
    align-content: center;
    justify-items: center;
    position: fixed;
    inset: 0 auto 0 .4rem;
    width: 3.35rem;
    gap: .7rem;
    pointer-events: none;
  }
  .nav-docked :is(.nav-links,.dock-settings) {
    grid-area: auto;
    display: grid;
    gap: .25rem;
    padding: .25rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: var(--surface);
    pointer-events: auto;
  }
  .nav-docked .nav-links a, .nav-docked .nav-tool {
    display: flex;
    position: relative;
    width: 44px;
    min-height: 44px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: .7rem;
    background: transparent;
  }
  .nav-docked .nav-tool svg { width: 1.2rem; height: 1.2rem; }
  .nav-docked .nav-links a[aria-current=page] { color: var(--accent); }
  .nav-docked .nav-links a[aria-current=page] svg { color: currentColor; }
  .nav-docked [data-dock-label]::after {
    content: attr(data-dock-label);
    position: absolute;
    inset-inline-start: calc(100% + .6rem);
    inset-block-start: 50%;
    transform: translate(-4px,-50%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    border-radius: .5rem;
    padding: .35rem .65rem;
    font-size: .8rem;
    white-space: nowrap;
    z-index: 2;
  }
  .nav-docked [data-dock-label]:is(:hover,:focus-visible)::after {
    opacity: 1;
    visibility: visible;
    transform: translate(0,-50%);
  }
  @media (max-height: 520px) {
    .nav-docked .site-nav { gap: .35rem; }
    .nav-docked :is(.nav-links,.dock-settings) { gap: .05rem; padding: .15rem; }
    .nav-docked .nav-links a, .nav-docked .nav-tool { min-height: 36px; height: 36px; }
  }
  .nav-docked .nav-links a > span:not(.list-icon) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .nav-docked .nav-links .saved-count:not(:empty) {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 1rem;
    padding-inline: .15rem;
    font-size: .65rem;
  }
  .nav-docked .search-toggle {
    grid-area: auto;
    border-color: transparent;
    background: transparent;
  }
  .nav-docked .site-nav a:hover,
  .nav-docked .site-nav a[aria-current=page],
  .nav-docked .nav-tool:hover,
  .nav-docked .search-toggle[aria-expanded=true] {
    background: var(--raised);
    border-color: var(--line);
  }
  .nav-docked .nav-search-panel {
    position: fixed;
    grid-area: auto;
    inset-block-start: 0;
    inset-inline: max(calc((100% - 90rem) / 2), 4rem);
    pointer-events: none;
  }
  .nav-docked .site-search.is-expanded .search-controls { pointer-events: auto; }
  .nav-docked .search-controls { margin-block: .85rem .65rem; }

  @media (prefers-reduced-motion: no-preference) {
    .nav-docked :is(.nav-links,.dock-settings) { animation: nav-dock-in 240ms cubic-bezier(.2,.75,.25,1); }
    .nav-docked [data-dock-label]::after { transition: opacity 140ms ease, transform 140ms ease; }
  }
}
@keyframes nav-dock-in {
  from { transform: translateX(-110%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

[data-hide-bookmarks] :is(.list-link, .bookmark, #hero-save, #title-save),
[data-hide-bookmarks].nav-docked .nav-links .list-link {
  display: none;
}
@media (max-width: 650px) {
  [data-hide-bookmarks] .site-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  [data-hide-bookmarks] .search-toggle { grid-column: 4; }
}

.title-page { max-width: 76rem; padding-block: 1.5rem 2rem; }
.title-page:focus { outline: none; }
#title-back {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  margin-bottom: 1rem;
  padding-inline: .9rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: var(--surface);
}
#title-back:hover { background: var(--raised); }
.title-intro {
  display: grid;
  grid-template-columns: clamp(10rem, 22vw, 14rem) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  padding: clamp(1.25rem, 3vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: radial-gradient(ellipse at 0 0, color-mix(in srgb, var(--accent) 15%, transparent), transparent 60%), var(--surface);
}
.title-intro:has(#title-cover[hidden]) { grid-template-columns: minmax(0, 1fr); }
.title-intro:has(.long-title) { align-items: start; }
#title-cover {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: .85rem;
  background: var(--raised);
}
.title-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .65rem 1rem;
  align-items: start;
}
.title-heading:has(#watch-rating:not([hidden])) { grid-template-columns: minmax(0, 1fr) auto; }
#watch-rating {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  width: max-content;
  margin: 0;
  padding: .5rem .85rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: var(--raised);
  color: var(--accent);
  font-size: clamp(1.2rem, 2.2vw, 1.65rem);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
#watch-title {
  margin: 0;
  font-size: clamp(1.9rem, 4.2vw, 3.65rem);
  line-height: 1.06;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}
#watch-title.long-title {
  font-size: clamp(1.625rem, 3vw, 2.375rem);
  line-height: 1.16;
  text-wrap: balance;
}
#title-alias { color: var(--muted); }
#title-alias { margin-block: .45rem 0; overflow-wrap: anywhere; }
#title-alias:empty, #watch-meta:empty, #title-genres:empty, .title-actions:not(:has(button:not([hidden]))) { display: none; }
#watch-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .65rem;
  margin-block: .9rem 0;
}
#watch-meta > div {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
}
#watch-meta > div + div::before {
  content: "";
  width: .22rem;
  height: .22rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
}
#watch-meta dt, .title-data-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
#watch-meta dd { margin: 0; }
#title-genres, .title-actions { margin-top: 1.15rem; }
.title-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
[data-hide-bookmarks] .title-actions:not(:has(#title-play:not([hidden]))) { display: none; }
.title-actions button { min-height: 2.75rem; }
#title-save[aria-pressed=true] { border-color: var(--accent); }
.title-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 1.25rem;
  margin-top: 1.25rem;
}
.title-details { display: grid; gap: 1rem; min-width: 0; }
.title-details > section, #title-related {
  min-width: 0;
  padding: clamp(1rem, 2.4vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.title-details > section { scroll-margin-top: 8rem; }
.title-details h2, #title-related h2 { margin-bottom: .65rem; }
#watch-description { max-width: 72ch; white-space: pre-line; margin-block: .6rem; overflow-wrap: anywhere; }
#watch-description:not(.expanded) { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
#title-information-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: .75rem 1.25rem;
  margin: 0;
}
#title-information-list dt { color: var(--muted); font-size: .875rem; }
#title-information-list dd { margin: .15rem 0 0; overflow-wrap: anywhere; }
.episode-layout { display: grid; gap: .85rem; }
#episode-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
  align-content: start;
  gap: .5rem;
  min-width: 0;
  padding: .5rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: var(--bg);
}
#episode-links:empty { display: none; }
.episode-layout:has(iframe) #episode-links:has(> :nth-child(2)) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
#episode-links a, #episode-links button {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 2.75rem;
  padding: .6rem .75rem;
  border: 1px solid var(--line);
  border-radius: .6rem;
  background: var(--raised);
  font-weight: 700;
  overflow-wrap: anywhere;
  text-align: start;
}
#episode-links a:hover { border-color: var(--accent); }
#episode-links button[aria-pressed=true] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 22%, var(--raised));
}
#episode-links :focus-visible { outline-offset: -3px; }
#episode-screen { min-width: 0; }
#episode-screen:not(:has(iframe)) {
  padding: .75rem 1rem;
  border-radius: .65rem;
  background: var(--raised);
  color: var(--muted);
}
#episode-screen iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: #171322;
}
#episode-screen a { display: inline-block; margin-top: .65rem; text-decoration: underline; }
@media (min-width: 56rem) {
  .episode-layout:has(iframe) { grid-template-columns: minmax(0, 1fr) clamp(10rem, 22%, 15rem); align-items: start; }
  .episode-layout:has(iframe) #episode-links { max-height: 24rem; overflow-y: auto; }
  .episode-layout:has(iframe) #episode-links:has(> :nth-child(2)) { grid-template-columns: minmax(0, 1fr); }
}
#franchise-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: .65rem; }
#franchise-more { margin-top: .85rem; min-height: 2.75rem; }
#franchise-items > * {
  display: grid;
  grid-template-columns: 3.75rem minmax(0, 1fr);
  gap: .75rem;
  align-items: center;
  min-width: 0;
  padding: .6rem;
  border: 1px solid var(--line);
  border-radius: .85rem;
  background: var(--bg);
  overflow-wrap: anywhere;
}
#franchise-items a:hover, #related a:hover { background: var(--raised); }
.franchise-cover {
  aspect-ratio: 2/3;
  border-radius: .5rem;
  overflow: hidden;
  background: linear-gradient(145deg, var(--raised), var(--bg));
}
.franchise-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
#franchise-items small { display: block; color: var(--muted); }
#franchise-items [aria-current] { border-color: var(--accent); }
#franchise-items [aria-current] small { color: var(--accent); }
#related { display: grid; gap: .5rem; }
#related a {
  display: grid;
  grid-template-columns: clamp(4rem, 5vw, 5rem) minmax(0, 1fr);
  align-items: center;
  gap: .75rem;
  padding: .5rem;
  border-radius: .65rem;
}
.title-related-cover {
  aspect-ratio: 2/3;
  border-radius: .45rem;
  overflow: hidden;
  background: linear-gradient(145deg, var(--raised), var(--bg));
}
.title-related-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.title-related-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
@media (min-width: 56rem) {
  .title-body:has(#title-related:not([hidden])) {
    grid-template-columns: minmax(0, 1fr) clamp(15rem, 25vw, 19rem);
  }
}
@media (max-width: 650px) {
  .title-intro { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  #title-cover { width: min(10rem, 54%); justify-self: center; }
  #watch-title.long-title { font-size: clamp(1.5rem, 6.6vw, 1.625rem); hyphens: auto; }
}
@media (max-width: 29rem) {
  .title-heading:has(#watch-rating:not([hidden])) { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 650px) {
  body:has(#watch:not([hidden])) .site-nav {
    position: static;
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: .5rem;
  }
}

.home-collection { margin-top: clamp(2rem,4vw,3.25rem); }
.home-collection-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: .85rem; }
.home-collection-actions { display: flex; align-items: center; gap: .35rem; }
.home-collection-arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: var(--surface);
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.home-collection-arrow::before {
  content: "";
  width: .5rem;
  height: .5rem;
  border: solid currentColor;
  border-width: 2px 2px 0 0;
  transform: translateX(-1px) rotate(45deg);
}
.home-collection-arrow.previous::before { transform: translateX(1px) rotate(-135deg); }
.home-collection-arrow:hover:enabled { background: var(--raised); border-color: var(--accent); transform: translateY(-2px); }
.home-collection-arrow:active:enabled { transform: scale(.93); }
.home-collection-arrow:disabled { opacity: .4; cursor: default; }
.home-collection .home-collection-row {
  --collection-gap: 1rem;
  --collection-columns: 6;
  --fade-start: 0px;
  --fade-end: 0px;
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - var(--collection-gap) * (var(--collection-columns) - 1)) / var(--collection-columns));
  gap: var(--collection-gap);
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: .25rem;
  padding: .25rem .25rem .65rem;
  mask-image: linear-gradient(to right, transparent, #000 var(--fade-start), #000 calc(100% - var(--fade-end)), transparent);
}
.home-collection-row::-webkit-scrollbar { display: none; }
.home-collection .home-collection-row.has-before { --fade-start: 2.25rem; }
.home-collection .home-collection-row.has-after { --fade-end: 2.25rem; }
.home-collection .home-collection-row:has(:focus-visible) { mask-image: none; }
.home-collection-row > * { scroll-snap-align: start; }
@media (pointer: fine) {
  .home-collection-row .tile { cursor: grab; }
  .home-collection-row img { -webkit-user-drag: none; }
}
.home-collection .home-collection-row:is(.is-dragging,.is-settling) {
  scroll-snap-type: none;
  scroll-behavior: auto;
  cursor: grabbing;
  user-select: none;
}
.home-collection-row.is-dragging .tile { cursor: grabbing; }
@media (prefers-reduced-motion: reduce) {
  .home-collection-arrow { transition: none; }
}
@media (max-width: 1150px) {
  .home-collection .home-collection-row { --collection-columns: 5; }
}
@media (max-width: 830px) {
  .home-collection .home-collection-row { --collection-columns: 4; }
}
@media (max-width: 600px) {
  .home-collection .home-collection-row { --collection-columns: 2; --collection-gap: .75rem; }
}

/* Avoid expensive hover transitions while moving a collection with the mouse. */
.home-collection-row:is(.is-dragging,.is-settling) .tile .card-poster {
  transition: none;
  box-shadow: none;
}
.home-collection-row:is(.is-dragging,.is-settling) .tile .card-poster img {
  transition: none;
  transform: none;
}

/* Weekly airing schedule: existing theme tokens and compact, responsive rows. */
.airing-calendar { margin-bottom: clamp(1.5rem, 3vw, 2.5rem); }
.calendar-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; flex-wrap: wrap; }
.calendar-heading h2, .calendar-heading h3 { margin: 0; }
.calendar-heading > span, #calendar-status { color: var(--muted); font-size: .875rem; }
.calendar-days { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: clamp(.25rem,1vw,.75rem); margin-top: .9rem; }
.calendar-day { position: relative; display: grid; justify-items: center; gap: .15rem; min-width: 0; min-height: 5rem; padding: .5rem .2rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); }
.calendar-day strong { font-size: 1.2rem; color: var(--ink); }
.calendar-day[aria-pressed=true] { border-color: var(--accent); background: var(--raised); color: var(--ink); }
.calendar-day[aria-current=date] strong { color: var(--accent); }
.calendar-day.has-releases::after { content: ''; position: absolute; bottom: .4rem; width: .3rem; height: .3rem; border-radius: 50%; background: var(--accent); }
.calendar-day-heading { margin-block: 1.1rem .65rem; }
.calendar-releases { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .5rem; }
.calendar-release {
  --calendar-poster-width: 5.5rem;
  display: grid;
  grid-template-columns: 3.4rem var(--calendar-poster-width) minmax(0,1fr);
  align-items: center;
  gap: .75rem;
  padding: .5rem .75rem;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  min-width: 0;
}
.calendar-release time { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 600; }
.calendar-release img { width: 100%; aspect-ratio: 2 / 3; object-fit: contain; border-radius: 6px; }
.calendar-release > div { grid-column: 3; min-width: 0; }
.calendar-release strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; line-height: 1.3; }
.calendar-release > div > span { display: block; color: var(--muted); font-size: .875rem; }
@media (hover:hover) { .calendar-day:hover, .calendar-release:hover { border-color: var(--accent); } }
@media (max-width: 700px) {
  .calendar-releases { grid-template-columns: minmax(0,1fr); }
  .calendar-release { --calendar-poster-width: 4.5rem; }
  .calendar-release strong { -webkit-line-clamp: 3; }
}
@media (prefers-reduced-motion: no-preference) { .calendar-day, .calendar-release { transition: border-color 160ms ease, background-color 160ms ease; } }

#airing-calendar { scroll-margin-top: 1rem; }

/* Empty search state and matching mode reuse the site's theme tokens. */
.catalog-empty { text-align:center; padding:clamp(1.25rem,4vw,3rem) 1rem; color:var(--ink); }
.catalog-empty svg { width:2.7rem; height:2.7rem; color:var(--muted); margin:0 auto .8rem; }
.catalog-empty h3 { margin:0 0 .6rem; font-size:1.2rem; }
.catalog-empty p { color:var(--muted); max-width:28rem; margin:0 auto 1.2rem; }
.catalog-empty-actions { display:flex; flex-wrap:wrap; justify-content:center; gap:.65rem; }
.genre-mode { grid-template-columns:repeat(2,minmax(0,1fr)); }
.genre-mode button { white-space:normal; line-height:1.3; font-size:.8rem; padding:.5rem .3rem; }

/* Keep year-range feedback visible without altering existing card styling. */
.catalog-active-filters { display:flex; flex-wrap:wrap; align-items:center; gap:.35rem; margin-bottom:.65rem; }
.catalog-active-filters:has(> [hidden] + [hidden]) { margin-bottom:0; }
.catalog-active-filters #catalog-genre-active { margin-bottom:0; }
.year-range-hint { margin:.4rem .2rem 0; font-size:.75rem; line-height:1.4; color:var(--muted); }
.year-range-hint.has-error { color:var(--accent); }
.range-fields input[aria-invalid=true] { border-color:var(--accent); }
