:root {
  color-scheme: dark;
  --bg: #080807;
  --panel: #12110f;
  --panel-2: #191714;
  --panel-3: #201d18;
  --text: #f5f0e6;
  --muted: #aaa39a;
  --soft: #756f65;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --accent: #d8b15f;
  --accent-2: #2fb9a8;
  --danger: #d65a4f;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius: 8px;
  --sidebar-width: 236px;
  --detail-width: 356px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(216, 177, 95, 0.13), transparent 34rem),
    linear-gradient(180deg, #11100e 0%, var(--bg) 54%);
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

svg {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--detail-width);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: rgba(8, 8, 7, 0.78);
  backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark,
.avatar {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid rgba(216, 177, 95, 0.45);
  border-radius: 50%;
  color: #10100f;
  background: linear-gradient(135deg, #f2d37f, #b98037);
  font-weight: 900;
  letter-spacing: 0;
}

.brand strong,
.profile-card strong {
  display: block;
  font-size: 1rem;
}

.brand small,
.profile-card small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.75rem;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item,
.profile-card,
.icon-button,
.text-button,
.primary-button,
.secondary-button,
.clear-search,
.chip-button {
  border: 0;
  cursor: pointer;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
  text-align: left;
  transition:
    background 160ms ease,
    color 160ms ease;
}

.nav-item:hover,
.nav-item.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.nav-item.is-active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  color: var(--accent);
}

.source-card,
.profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  text-align: left;
}

.source-card {
  margin-top: 0;
  align-items: flex-start;
}

.source-card strong {
  display: block;
  font-size: 0.82rem;
}

.source-card span:not(.source-dot) {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.source-dot {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 5px rgba(47, 185, 168, 0.12);
}

.profile-card {
  margin-top: 0;
}

.profile-card:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
}

.main {
  min-width: 0;
  padding: 22px 28px 40px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  padding-bottom: 16px;
  background: linear-gradient(180deg, rgba(17, 16, 14, 0.96), rgba(17, 16, 14, 0.72) 70%, transparent);
  backdrop-filter: blur(18px);
}

.search-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  height: 46px;
  padding: 0 10px 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
}

.search-box:focus-within {
  border-color: rgba(216, 177, 95, 0.7);
  box-shadow: 0 0 0 4px rgba(216, 177, 95, 0.11);
}

.search-box input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.search-box input::placeholder {
  color: #888176;
}

.clear-search {
  display: none;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
}

.clear-search.is-visible {
  display: grid;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(54px, 1fr));
  gap: 4px;
  min-width: 210px;
  height: 42px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.segmented button {
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.segmented button.is-active {
  color: #11100e;
  background: var(--accent);
  font-weight: 800;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.11);
}

.quick-help {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 16px;
  color: var(--muted);
  font-size: 0.78rem;
}

.quick-help span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  white-space: nowrap;
}

.quick-help kbd {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border: 1px solid rgba(216, 177, 95, 0.38);
  border-radius: 5px;
  color: #f8df9c;
  background: rgba(216, 177, 95, 0.1);
  font: inherit;
  font-weight: 800;
}

.hero {
  position: relative;
  display: grid;
  min-height: clamp(360px, 46vw, 560px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #14120f;
  box-shadow: var(--shadow);
  isolation: isolate;
}

.hero::before,
.hero::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

.hero::before {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(8, 8, 7, 0.94) 0%, rgba(8, 8, 7, 0.76) 34%, rgba(8, 8, 7, 0.2) 70%),
    var(--hero-image, linear-gradient(135deg, #241a13, #342f28));
  background-position: center;
  background-size: cover;
  transform: scale(1.02);
}

.hero.is-poster-art::before {
  background:
    linear-gradient(90deg, rgba(8, 8, 7, 0.96) 0%, rgba(8, 8, 7, 0.8) 42%, rgba(8, 8, 7, 0.34) 100%),
    var(--hero-image, linear-gradient(135deg, #241a13, #342f28));
  background-color: #100f0d;
  background-position: center, right center;
  background-repeat: no-repeat;
  background-size: cover, contain;
  transform: none;
}

.hero::after {
  background:
    linear-gradient(180deg, transparent 52%, rgba(8, 8, 7, 0.78)),
    linear-gradient(90deg, rgba(216, 177, 95, 0.1), transparent 45%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: end;
  width: min(680px, 100%);
  padding: clamp(24px, 5vw, 56px);
}

.kicker,
#eyebrow,
.modal-head p {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.hero h2 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 5.4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero.is-search-mode {
  min-height: clamp(270px, 32vw, 390px);
}

.hero.is-search-mode h2 {
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.hero.is-search-mode .hero-inner {
  padding: clamp(22px, 4vw, 42px);
}

.hero-overview {
  width: min(58ch, 100%);
  margin: 18px 0 0;
  color: rgba(245, 240, 230, 0.82);
  font-size: 1rem;
  line-height: 1.65;
}

.meta-row,
.rating-row,
.panel-meta,
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.meta-row {
  margin-top: 18px;
}

.pill,
.rating-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: rgba(245, 240, 230, 0.86);
  background: rgba(0, 0, 0, 0.28);
  font-size: 0.78rem;
  font-weight: 700;
}

.rating-pill {
  border-color: rgba(216, 177, 95, 0.42);
  color: #f8df9c;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.primary-button,
.secondary-button,
.chip-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: var(--radius);
  font-weight: 800;
}

.primary-button {
  color: #11100e;
  background: var(--accent);
}

.primary-button:hover {
  filter: brightness(1.06);
}

.primary-button:disabled {
  cursor: not-allowed;
  color: rgba(245, 240, 230, 0.58);
  background: rgba(255, 255, 255, 0.12);
  filter: none;
}

.secondary-button,
.chip-button {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.secondary-button:hover,
.chip-button:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.12);
}

.content-area {
  padding-top: 28px;
}

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

.section-heading.compact {
  align-items: center;
  margin: 0 0 12px;
}

.section-heading h1,
.section-heading h2 {
  margin: 0;
  letter-spacing: 0;
}

.section-heading h1 {
  font-size: clamp(1.45rem, 2.5vw, 2.1rem);
}

.section-heading h2 {
  font-size: 1rem;
}

#resultCount {
  color: var(--muted);
  font-size: 0.86rem;
}

.continue-row {
  margin: 0 0 26px;
}

.mini-strip {
  display: grid;
  grid-auto-columns: minmax(220px, 280px);
  grid-auto-flow: column;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.mini-card {
  position: relative;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  min-height: 116px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
  cursor: pointer;
}

.mini-card img {
  width: 82px;
  height: 96px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--panel-3);
}

.mini-card strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.mini-card span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.8rem;
}

.text-button {
  padding: 0;
  color: var(--accent);
  background: transparent;
  font-size: 0.86rem;
}

.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  gap: 18px;
  align-items: start;
}

.poster-grid.search-results {
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
}

.poster-card {
  position: relative;
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.poster-card.is-selected .poster-art,
.poster-card.search-card.is-selected {
  border-color: rgba(216, 177, 95, 0.72);
  box-shadow: 0 0 0 3px rgba(216, 177, 95, 0.13);
}

.poster-card.search-card {
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  min-height: 146px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
}

.poster-card.search-card:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
}

.poster-card.search-card .poster-art {
  width: 96px;
  min-height: 126px;
  box-shadow: none;
}

.poster-art {
  position: relative;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(216, 177, 95, 0.18), transparent),
    var(--panel-3);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
}

.poster-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.poster-card:hover .poster-art {
  border-color: var(--line-strong);
}

.poster-art::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 48%, rgba(0, 0, 0, 0.8));
  content: "";
}

.poster-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 1;
  min-width: 44px;
  padding: 5px 8px;
  border-radius: 999px;
  color: #11100e;
  background: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  text-align: center;
}

.poster-card h3 {
  display: -webkit-box;
  overflow: hidden;
  min-height: 2.6em;
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.28;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-body {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
}

.card-meta {
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
}

.card-meta span {
  min-width: 0;
}

.result-status {
  justify-self: start;
  padding: 5px 8px;
  border: 1px solid rgba(214, 90, 79, 0.35);
  border-radius: 999px;
  color: #f0b2aa;
  background: rgba(214, 90, 79, 0.1);
  font-size: 0.72rem;
  font-weight: 800;
}

.result-status.is-ready {
  border-color: rgba(47, 185, 168, 0.35);
  color: #94e1d8;
  background: rgba(47, 185, 168, 0.1);
}

.card-overview {
  display: -webkit-box;
  overflow: hidden;
  color: rgba(245, 240, 230, 0.68);
  font-size: 0.8rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 260px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--text);
  font-size: 1.2rem;
}

.detail-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 22px 18px;
  border-left: 1px solid var(--line);
  background: rgba(13, 12, 10, 0.82);
  backdrop-filter: blur(20px);
}

.panel-empty {
  display: grid;
  place-items: center;
  min-height: 100%;
  color: var(--muted);
  text-align: center;
}

.panel-poster {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-3);
}

.panel-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.panel-poster.is-poster {
  width: min(100%, 320px);
  margin-inline: auto;
  aspect-ratio: 2 / 3;
  background: #100f0d;
}

.panel-poster.is-poster img {
  object-fit: contain;
}

.detail-panel h2 {
  margin: 18px 0 8px;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.panel-meta {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.82rem;
}

.overview {
  margin: 0 0 18px;
  color: rgba(245, 240, 230, 0.78);
  font-size: 0.9rem;
  line-height: 1.65;
}

.panel-section {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.panel-section h3 {
  margin: 0;
  font-size: 0.92rem;
}

.panel-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-section-head span {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid rgba(216, 177, 95, 0.35);
  border-radius: 999px;
  color: #f8df9c;
  background: rgba(216, 177, 95, 0.09);
  font-size: 0.74rem;
  font-weight: 800;
}

.episode-summary {
  margin: -2px 0 2px;
  color: rgba(245, 240, 230, 0.74);
  font-size: 0.82rem;
  line-height: 1.45;
}

.episode-summary.is-refreshing {
  color: var(--accent);
}

.episode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.episode-grid label {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 0.76rem;
}

.episode-grid label > span {
  color: #f8df9c;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

select,
.manual-id input,
.form-grid input {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  outline: 0;
}

select {
  padding: 0 10px;
  border-color: rgba(216, 177, 95, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.055)),
    var(--panel-2);
  font-weight: 800;
}

select option {
  color: #11100e;
  background: #f5f0e6;
}

.manual-id {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.manual-id input,
.form-grid input {
  padding: 0 12px;
}

.manual-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

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

.cast-list span {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.78rem;
}

.player-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #000;
}

.player-overlay[hidden] {
  display: none;
}

.player-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  min-height: 62px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.72);
}

.player-title {
  min-width: 0;
}

.player-title strong,
.player-title span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-title span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8rem;
}

.player-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.player-controls select {
  width: 112px;
  height: 38px;
  background: rgba(255, 255, 255, 0.11);
}

#playerFrame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.modal {
  width: min(680px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  background: transparent;
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
}

.modal-card {
  padding: 22px;
  background: linear-gradient(180deg, #171512, #0f0e0c);
}

.modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.modal-head h2 {
  margin: 0;
  font-size: 1.45rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.8rem;
}

.form-grid input[type="color"] {
  padding: 3px;
}

.check-row {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.api-note {
  display: grid;
  gap: 6px;
  margin-top: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.api-note strong {
  color: var(--text);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-top: 20px;
}

.is-loading {
  opacity: 0.72;
  pointer-events: none;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 88px minmax(0, 1fr) 330px;
  }

  .sidebar {
    align-items: center;
    padding: 18px 12px;
  }

  .brand span:not(.brand-mark),
  .nav-item:not(.is-active),
  .nav-item,
  .source-card,
  .profile-card span:not(.avatar) {
    font-size: 0;
  }

  .nav-item {
    justify-content: center;
    width: 48px;
    padding: 0;
  }

  .source-card {
    display: none;
  }

  .profile-card {
    justify-content: center;
    padding: 8px;
  }

  .profile-card > span:not(.avatar) {
    display: none;
  }
}

@media (max-width: 940px) {
  .app-shell {
    display: block;
    padding-bottom: 68px;
  }

  .sidebar {
    position: fixed;
    inset: auto 12px 12px;
    z-index: 50;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    height: 56px;
    padding: 6px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: rgba(8, 8, 7, 0.86);
  }

  .brand {
    display: none;
  }

  .nav-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
  }

  .nav-item {
    width: auto;
    min-height: 44px;
  }

  .profile-card {
    width: 48px;
    height: 44px;
  }

  .main {
    padding: 16px;
  }

  .detail-panel {
    position: relative;
    height: auto;
    max-height: none;
    padding: 16px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .segmented {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .quick-help {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }
}

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

  .hero::before {
    background:
      linear-gradient(180deg, rgba(8, 8, 7, 0.2), rgba(8, 8, 7, 0.94) 68%),
      var(--hero-image, linear-gradient(135deg, #241a13, #342f28));
    background-position: center top;
    background-size: cover;
  }

  .hero.is-poster-art::before {
    background:
      linear-gradient(180deg, rgba(8, 8, 7, 0.12), rgba(8, 8, 7, 0.96) 76%),
      var(--hero-image, linear-gradient(135deg, #241a13, #342f28));
    background-color: #100f0d;
    background-position: center, center top;
    background-repeat: no-repeat;
    background-size: cover, contain;
    transform: none;
  }

  .hero-inner {
    padding: 22px;
  }

  .hero h2 {
    font-size: 2.35rem;
  }

  .poster-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .poster-grid.search-results {
    grid-template-columns: 1fr;
  }

  .poster-card.search-card {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .poster-card.search-card .poster-art {
    width: 82px;
    min-height: 112px;
  }

  .topbar {
    gap: 10px;
  }

  .search-box {
    height: 44px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 6px;
  }

  .form-grid,
  .episode-grid {
    grid-template-columns: 1fr;
  }

  .player-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .player-controls {
    grid-column: 1 / -1;
    order: 2;
    overflow-x: auto;
  }

  .player-controls select {
    min-width: 118px;
  }
}
