@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/Inter-Regular.woff2") format("woff2");
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/Inter-Medium.woff2") format("woff2");
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/Inter-Bold.woff2") format("woff2");
}

:root {
  /** Тёмный «почти чёрный» серый фон страницы (без градиента). */
  --bg: #0c0c0c;
  --panel: #101010;
  --panel-2: #151515;
  --panel-3: #1a1a1a;
  --text: #f5f5f5;
  --muted: #9a9a9a;
  --line: rgba(255, 255, 255, 0.13);
  --line-strong: rgba(255, 255, 255, 0.28);
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
  /** Как у `.workspace`, чтобы лого+поиск и сетка постеров начинались на одной вертикали. */
  --page-pad-x: clamp(16px, 3vw, 34px);
  --layout-gap: 18px;
  /** Высота закреплённой шапки (до начала основного блока страницы) + rail/watch `top`. */
  --sticky-below-header: 108px;

  /** Уменьшение только отрисовки лого; размер блока лого не трогаем — см. `.brand-logo-img`. */
  --brand-logo-visual-scale: 0.72;
  /** Полное «капсульное» скругление для всех кнопок */
  --btn-radius: 9999px;
}

* {
  box-sizing: border-box;
}

html {
  background-color: var(--bg);
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.device-tv {
  --page-pad-x: clamp(14px, 1.8vw, 28px);
}

body.device-tv button,
body.device-tv .segment,
body.device-tv .primary-button,
body.device-tv .secondary-button,
body.device-tv .ghost-button {
  min-height: 44px;
}

body.device-tv :focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.95);
  outline-offset: 2px;
}

body.performance-lite *,
body.performance-lite *::before,
body.performance-lite *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

body.performance-lite .app-header,
body.performance-lite .catalog-load-overlay,
body.performance-lite .auth-dialog,
body.performance-lite .admin-dialog,
body.performance-lite .player-dialog,
body.performance-lite .legal-dialog {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.performance-lite .watch-panel,
body.performance-lite .movie-card,
body.performance-lite .auth-dialog,
body.performance-lite .admin-dialog,
body.performance-lite .player-dialog,
body.performance-lite .legal-dialog {
  box-shadow: none !important;
}


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

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  border-radius: var(--btn-radius);
}

.app-shell {
  position: relative;
  min-height: 100vh;
  background: var(--bg);
  /** Общая ширина рельса и первой колонки шапки (как у `.rail { width }`). */
  --sidebar-w: 250px;
}

@media (max-width: 1180px) {
  .app-shell {
    --sidebar-w: 230px;
  }
}

@media (min-width: 821px) and (max-width: 1024px) {
  body:has(#top.has-card) .app-shell {
    --sidebar-w: 220px;
  }
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  box-sizing: border-box;
  /* Выше панели карточки и сайдбара */
  z-index: 50;
  --card-width: clamp(148px, 10.2vw, 178px);
  --poster-gap: 18px;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) auto;
  gap: var(--layout-gap);
  align-items: center;
  padding: 6px var(--page-pad-x);
  border-bottom: 1px solid var(--line);
  background: rgba(12, 12, 12, 0.96);
  backdrop-filter: blur(20px);
}

.auth-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
}

.auth-header-btn {
  padding: 8px 12px !important;
  font-size: 12px !important;
  white-space: nowrap;
}

.admin-header-btn[hidden] {
  display: none !important;
}

body.auth-required {
  overflow: hidden;
}

body.auth-required .app-shell {
  min-height: 100vh;
  filter: blur(10px);
  opacity: 0.18;
  pointer-events: none;
  user-select: none;
}

.auth-user-zone {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.auth-user-label {
  font-size: 12px;
  font-weight: 850;
  color: var(--muted);
  max-width: min(140px, 22vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 1181px) {
  /* Одна и та же ширина с открытой карточкой и без — иначе поле поиска дергается при выборе фильма. */
  .app-header .search {
    justify-self: start;
    width: min(100%, calc((var(--card-width) * 7) + (var(--poster-gap) * 6)));
  }
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
  text-decoration: none;
  color: inherit;
}

/**
 * Параметры `width`/`height` задают место во вёрстке (не трогаем высоту/колонки шапки).
 * `--brand-logo-visual-scale` масштабирует только картинку (transform не меняет раскладку).
 */
.brand-logo-img {
  display: block;
  height: clamp(58px, 8.4vw, 86px);
  width: auto;
  max-width: 100%;
  object-fit: contain;
  transform-origin: center center;
  transform: scale(var(--brand-logo-visual-scale));
}

/**
 * Лого по центру колонки той же ширины, что и фиксированный `.rail` (`--sidebar-w`).
 */
@media (min-width: 821px) {
  .app-header .brand {
    justify-content: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

.overline,
.status-line,
.field,
.meta,
.watch-note {
  color: var(--muted);
}

.search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: stretch;
  gap: 0;
  min-width: 0;
  box-sizing: border-box;
  border-radius: var(--btn-radius);
  border: 1px solid var(--line);
  background: rgba(8, 8, 8, 0.98);
  overflow: hidden;
}

.search:focus-within {
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

input,
select {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #121212;
  color: var(--text);
  outline: none;
}

.search input {
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.search input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.search input:focus,
.search input:focus-visible {
  border-color: transparent;
  outline: none;
  box-shadow: none;
}

select,
.field input {
  margin-top: 8px;
  padding: 11px 12px;
}

input:focus,
select:focus {
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.search button,
.primary-button {
  display: inline-grid;
  min-height: 38px;
  place-items: center;
  border-radius: var(--btn-radius);
  background: #fff;
  color: #050505;
  font-weight: 900;
  padding: 0 16px;
}

.search:not(.has-query) .search-clear-btn {
  display: none;
}

.search:not(.has-query) button[type="submit"] {
  display: none;
}

.search button {
  min-height: 0;
  height: auto;
  min-width: auto;
  border-radius: 0;
  border: 0;
  padding: 0 18px;
  align-self: stretch;
}

.search .search-clear-btn {
  background: transparent;
  color: #a855f7;
  font-weight: 760;
  font-size: 14px;
  box-shadow: none;
  border-left: 0;
}

.search .search-clear-btn:hover {
  color: #c084fc;
  background: rgba(168, 85, 247, 0.08);
}

.search button:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(5, 5, 5, 0.35);
}

.ghost-button,
.segment,
.secondary-button {
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  background: rgba(255, 255, 255, 0.035);
  color: #e7e7e7;
  padding: 10px 12px;
  font-weight: 760;
}

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

.workspace {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: var(--layout-gap);
  padding: calc(28px + var(--sticky-below-header)) var(--page-pad-x) 34px;
}

.workspace#top {
  scroll-margin-top: calc(var(--sticky-below-header) + 10px);
}

.workspace.has-card {
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) minmax(320px, 430px);
}

.rail {
  position: sticky;
  top: var(--sticky-below-header);
  align-self: start;
}

.watch-panel {
  position: sticky;
  top: var(--sticky-below-header);
  align-self: start;
}

.watch-panel,
.movie-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 13, 13, 0.92);
  box-shadow: var(--shadow);
}

.rail {
  padding: 16px;
  border: none;
  box-shadow: none;
  border-radius: 0;
  background: transparent;
}

.rail-section-title {
  margin: 0 0 8px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.rail-catalog-filters[hidden],
.rail-catalog-filters.is-hidden {
  display: none;
}

.rail-block,
.field {
  display: block;
  margin-bottom: 18px;
}

.field-hint {
  display: block;
  margin-top: 6px;
  min-height: 2.8em;
  font-size: 11px;
  line-height: 1.38;
  color: var(--muted);
  font-weight: 560;
}

/* Сайдбар: фиксированная «полка» под подпись рейтинга и год — без сдвига при смене IMDb/КП и чисел */
.field:has(#ratingFilter) #ratingFieldPrefix {
  display: inline-block;
  min-width: 9.5ch;
  vertical-align: baseline;
}

.field:has(#ratingFilter) #ratingValue {
  display: inline-block;
  min-width: 3.2ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
  vertical-align: baseline;
}

.field:has(#yearFilter) #yearValue {
  display: inline-block;
  min-width: 4.5ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
  vertical-align: baseline;
}

.rail select {
  min-height: 42px;
}

.overline {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.segment.active {
  background: #fff;
  color: #050505;
}

.ghost-button {
  width: 100%;
}

.rail-footer {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.rail-footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  row-gap: 4px;
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 720;
  letter-spacing: 0.04em;
}

.rail-footer-link {
  color: rgba(255, 255, 255, 0.74);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition:
    color 0.14s ease,
    border-color 0.14s ease;
}

.rail-footer-link:hover {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.42);
}

.rail-footer-link:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.55);
  outline-offset: 3px;
  border-radius: 4px;
}

.rail-footer-sep {
  color: var(--muted);
  font-weight: 600;
  user-select: none;
}

.rail-footer-tagline {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 820;
  line-height: 1.42;
  color: rgba(255, 255, 255, 0.92);
}

.rail-footer-copy {
  margin: 0;
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.rail-footer-copy time {
  font-variant-numeric: tabular-nums;
}

.rail-footer-copy-sep {
  letter-spacing: 0.06em;
  margin-inline: 2px;
}

.rail-footer-cc {
  margin-right: 0.35em;
}

/** Якоря для ссылок в подписи сайдбара — без заметной прокрутки, пока нет блоков контента */
.legal-anchors {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: clip;
  clip-path: inset(50%);
}

.catalog {
  min-width: 0;
}

.catalog-context {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  margin: 0 0 16px;
  padding: 0 2px 2px;
}

.catalog-context-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.catalog-context-title {
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.08;
  font-weight: 850;
  letter-spacing: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-context-subtitle {
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-chip-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  min-width: min(420px, 52%);
}

.catalog-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 220px;
  min-height: 30px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  font-size: 12px;
  font-weight: 820;
  white-space: nowrap;
  overflow: hidden;
}

.catalog-chip:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.09);
}

.catalog-chip span {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.catalog-chip strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 880;
}

.catalog-chip--reset {
  background: #f5f5f5;
  color: #111;
  border-color: #f5f5f5;
}

@media (max-width: 820px) {
  .catalog-context {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .catalog-chip-row {
    justify-content: flex-start;
    min-width: 0;
  }
}

.workspace.has-card .catalog {
  width: calc((var(--card-width) * 5) + (18px * 4));
}

.movie-wall {
  display: grid;
  gap: 34px;
}

.content-section {
  display: grid;
  gap: 14px;
}

.section-wall {
  position: relative;
  display: grid;
  --card-width: clamp(148px, 10.2vw, 178px);
  grid-template-columns: repeat(7, var(--card-width));
  justify-content: start;
  gap: 18px;
}

.section-wall.section-wall--loading-skeleton {
  min-height: clamp(220px, 38vh, 520px);
  border-radius: clamp(12px, 2vw, 22px);
  overflow: hidden;
  isolation: isolate;
}

.movie-card--skeleton {
  pointer-events: none;
  cursor: default;
}

.movie-card--skeleton:hover {
  transform: none;
  border-color: var(--line);
  background: rgba(13, 13, 13, 0.92);
  box-shadow: var(--shadow);
}

@keyframes catalog-skeleton-shift {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

.skeleton-poster {
  background: linear-gradient(
    105deg,
    #101010 0%,
    #1a1a1a 38%,
    #242424 50%,
    #1a1a1a 62%,
    #101010 100%
  );
  background-size: 220% 100%;
  animation: catalog-skeleton-shift 1.2s ease-in-out infinite;
}

.skeleton-strip {
  height: 40px;
  border-top: 1px solid var(--line);
  background: linear-gradient(
    105deg,
    #121212 0%,
    #181818 38%,
    #222 50%,
    #181818 62%,
    #121212 100%
  );
  background-size: 220% 100%;
  animation: catalog-skeleton-shift 1.2s ease-in-out 0.08s infinite;
}

.catalog-load-overlay {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border-radius: inherit;
  pointer-events: all;
  /* Виньетка вместо ровной заливки — без «плашки» с резкими краями */
  background: radial-gradient(
    ellipse 96% 92% at 50% 48%,
    rgba(5, 5, 5, 0.62) 0%,
    rgba(5, 5, 5, 0.38) 52%,
    rgba(5, 5, 5, 0.12) 78%,
    transparent 100%
  );
  backdrop-filter: blur(20px) saturate(1.06);
  -webkit-backdrop-filter: blur(20px) saturate(1.06);
  /* Маска смягчает обрыв backdrop-filter по периметру прямоугольника */
  -webkit-mask-image: radial-gradient(
    ellipse 120% 118% at 50% 50%,
    #000 0%,
    #000 44%,
    transparent 100%
  );
  mask-image: radial-gradient(
    ellipse 120% 118% at 50% 50%,
    #000 0%,
    #000 44%,
    transparent 100%
  );
  mask-mode: alpha;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
}

.catalog-load-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  max-width: 22rem;
}

.catalog-load-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: rgba(255, 255, 255, 0.88);
  animation: catalog-spin 0.72s linear infinite;
}

@keyframes catalog-spin {
  to {
    transform: rotate(360deg);
  }
}

.catalog-load-label {
  margin: 0;
  font-size: 14px;
  font-weight: 780;
  color: rgba(255, 255, 255, 0.82);
  letter-spacing: 0.02em;
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-poster,
  .skeleton-strip {
    animation-duration: 4s;
  }

  .catalog-load-spinner {
    animation-duration: 1.4s;
  }
}

.workspace.has-card .section-wall {
  grid-template-columns: repeat(5, var(--card-width));
}

/** Левая колонка (rail) зафиксирована в окне; основной поток только каталог (+ карточка). */
@media (min-width: 821px) {
  .workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: calc(28px + var(--sticky-below-header)) var(--page-pad-x) 34px;
    padding-left: calc(var(--page-pad-x) + var(--sidebar-w) + var(--layout-gap));
  }

  .workspace.has-card {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
    gap: var(--layout-gap);
    align-items: start;
  }

  .rail {
    position: fixed;
    left: var(--page-pad-x);
    top: var(--sticky-below-header);
    width: var(--sidebar-w);
    max-height: calc(100vh - var(--sticky-below-header) - 20px);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 40;
    box-sizing: border-box;
  }

  .catalog {
    grid-column: 1;
    width: 100%;
    min-width: 0;
  }

  .workspace.has-card .watch-panel {
    grid-column: 2;
    margin-left: 0;
  }
}

@media (min-width: 821px) and (max-width: 1180px) {
  .workspace.has-card {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  }
}

.movie-card {
  overflow: hidden;
  box-shadow: none;
  background: #101010;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.movie-card:hover {
  border-color: rgba(255, 255, 255, 0.42);
  background: #121212;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.46);
}

.movie-card.active {
  border-color: #fff;
  box-shadow: 0 0 0 1px #fff, 0 24px 70px rgba(0, 0, 0, 0.56);
}

.poster {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #000;
}

.poster-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-sizing: border-box;
  background: #000;
  color: rgba(255, 255, 255, 0.48);
  font-size: 13px;
  font-weight: 780;
  line-height: 1.35;
  text-align: center;
}

.poster-fallback--compact {
  padding: 6px;
  font-size: 10px;
  font-weight: 760;
}

.poster .poster-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  z-index: 1;
}

.poster .poster-img.poster-img--failed {
  display: none !important;
}

.movie-card:hover .poster::after {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.0) 34%, rgba(0, 0, 0, 0.9) 100%);
}

.poster::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.04) 46%, rgba(0, 0, 0, 0.82) 100%);
}

.poster-letter {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent 45%),
    #121212;
  font-size: 56px;
  font-weight: 950;
}

.poster-badges,
.poster-title {
  position: absolute;
  z-index: 3;
  left: 10px;
  right: 10px;
}

.poster-badges {
  top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}


.badge-ratings {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.badge.badge-subtle {
  background: rgba(0, 0, 0, 0.55);
  font-size: 11px;
  font-weight: 850;
}

.badge {
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.76);
  color: #fff;
  padding: 5px 7px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
}

.poster-badges .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 22px;
  padding: 0 7px;
  line-height: 1;
}

.poster-badges .badge:not(.badge-subtle) {
  font-size: 12px;
  font-weight: 900;
}

.poster-badges .badge.badge-subtle {
  font-size: 11px;
  font-weight: 850;
}

.watching-new-episodes-badge {
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 6px 14px rgba(239, 68, 68, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.section-wall--watching-horizontal {
  grid-template-columns: 1fr !important;
  gap: 12px !important;
}

.watching-row-card {
  display: grid !important;
  grid-template-columns: 92px minmax(0, 1fr) !important;
  gap: 12px !important;
  align-items: stretch !important;
  min-height: 96px !important;
  overflow: hidden;
}

.watching-row-poster {
  position: relative;
  min-height: 96px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.watching-row-poster .poster,
.watching-row-poster .poster-bg,
.watching-row-poster .poster-img,
.watching-row-poster .poster-fallback {
  height: 100% !important;
  min-height: 96px !important;
}

.watching-row-poster .poster-title,
.watching-row-poster .poster-badges {
  display: none !important;
}

.watching-row-body {
  min-width: 0;
  display: grid;
  grid-template-columns: 250px 145px 125px 175px minmax(170px, 1fr);
  align-items: center;
  justify-content: start;
  gap: 5px 4px;
  padding: 8px 10px 8px 6px;
}

.watching-row-titles {
  width: 250px;
  min-width: 250px;
  max-width: 250px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 44px;
  justify-content: center;
}

.watching-row-title-ru {
  font-size: 16px;
  line-height: 1.16;
  font-weight: 800;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.watching-row-title-en {
  font-size: 13px;
  line-height: 1.2;
  color: rgba(235, 235, 245, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.watching-row-meta {
  color: rgba(235, 235, 245, 0.82);
}

.watching-row-genre {
  color: rgba(235, 235, 245, 0.62);
}

.watching-row-ratings {
  color: rgba(235, 235, 245, 0.78);
}

.watching-row-info-block {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.watching-row-info-value {
  font-size: 13px;
  line-height: 1.2;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.watching-row-num {
  font-weight: 760;
}

.watching-row-notice {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 400;
  color: rgba(235, 235, 245, 0.62);
  white-space: normal;
  overflow-wrap: anywhere;
  min-width: 0;
}

.watching-row-notice.is-new {
  color: #ffd8d8;
  font-weight: 700;
}

.watching-row-notice .watching-new-episodes-badge {
  min-width: 22px;
  height: 22px;
  font-size: 11px;
}

.poster-title {
  bottom: 11px;
}

.poster-title strong {
  display: block;
  margin-bottom: 10px;
  font-size: 16px;
  line-height: 1.16;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.8);
}

.poster-title span {
  display: block;
  margin-bottom: 5px;
  color: #cfcfcf;
  font-size: 12px;
  font-weight: 800;
}

.card-strip {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.card-strip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--muted);
}

.watch-ratings-compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  margin: 22px 0 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.11);
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.watch-ratings-compact > span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  line-height: 1;
}

.watch-ratings-compact strong {
  margin-left: 4px;
  font-size: 12px;
  font-weight: 850;
  color: #e8e8e8;
}

.watch-status-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 110px;
  min-width: 110px;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 860;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
  box-sizing: border-box;
}

.watch-status-badge.watch-status-badge--placeholder {
  visibility: hidden;
}

.watch-status-badge.is-complete {
  color: #dff7e6;
  background: rgba(63, 176, 96, 0.18);
  border-color: rgba(99, 214, 133, 0.32);
}

.watch-status-badge.is-ongoing {
  color: #fff0b3;
  background: rgba(255, 194, 41, 0.16);
  border-color: rgba(255, 211, 92, 0.28);
}

.watch-panel {
  position: sticky;
  display: none;
  top: var(--sticky-below-header);
  right: auto;
  z-index: 30;
  width: 100%;
  max-height: calc(100vh - var(--sticky-below-header) - 20px);
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.workspace.has-card .watch-panel {
  display: flex;
  flex-direction: column;
  align-self: start;
  height: auto;
  max-height: calc(100vh - var(--sticky-below-header) - 20px);
  min-height: 0;
  overflow: hidden;
  top: var(--sticky-below-header);
  margin-left: 18px;
}

/* Постер и заголовок на герое не растягивают панель выше окна — скролл только у .watch-body */
.workspace.has-card .watch-panel > .screen {
  flex: 0 0 auto;
  max-height: min(440px, 54vh);
}

.workspace.has-card .watch-panel > .screen.playing {
  max-height: min(520px, 62vh);
}

.workspace.has-card .watch-panel > .watch-body {
  flex: 0 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.screen-hero-controls {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 24;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  pointer-events: none;
}

.screen-hero-controls .watch-tool-btn {
  pointer-events: auto;
}

.watch-hero-tools-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 42px;
  pointer-events: auto;
}

.bookmark-card-label {
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffd8e8;
  text-shadow:
    0 0 12px rgba(255, 110, 170, 0.36),
    0 2px 10px rgba(0, 0, 0, 0.85);
  user-select: none;
  white-space: nowrap;
  pointer-events: none;
}

.watching-card-label {
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #b8fff0;
  text-shadow:
    0 0 12px rgba(40, 200, 180, 0.55),
    0 2px 10px rgba(0, 0, 0, 0.85);
  user-select: none;
  white-space: nowrap;
  pointer-events: none;
}

.screen-hero-stack {
  position: relative;
  z-index: 1;
  min-height: 300px;
  display: grid;
  align-content: end;
  overflow: hidden;
  background: #020202;
}

.watch-tool-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--btn-radius);
  padding: 0;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.55));
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.12s ease,
    box-shadow 0.18s ease;
}

.watch-tool-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: scale(1.05);
}

.watch-tool-btn:active {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(0.96);
}

.watch-tool-btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px #050505,
    0 0 0 5px rgba(255, 255, 255, 0.85);
}

.watch-tool-svg {
  display: block;
  pointer-events: none;
}

.watch-tool-bookmark.is-saved {
  border-color: #ffb6cf;
  background: rgba(255, 92, 148, 0.28);
  box-shadow:
    0 0 0 1px rgba(255, 191, 214, 0.38),
    0 10px 28px rgba(0, 0, 0, 0.45);
  color: #fff;
}

.watch-tool-bookmark.is-saved:hover {
  background: rgba(255, 108, 160, 0.38);
  border-color: #ffd8e8;
}

.watch-tool-bookmark.is-saved .watch-heart-path {
  fill: rgba(255, 132, 176, 0.24);
  stroke: #fff;
  stroke-width: 1.8;
}

.watch-tool-watching.is-watching {
  border-color: #7ee8da;
  background: rgba(30, 160, 140, 0.35);
  box-shadow:
    0 0 0 1px rgba(120, 240, 220, 0.45),
    0 10px 28px rgba(0, 0, 0, 0.45);
  color: #fff;
}

.watch-tool-watching.is-watching:hover {
  background: rgba(35, 180, 160, 0.48);
  border-color: #b5fff4;
}

.watch-tool-watching.is-watching svg path,
.watch-tool-watching.is-watching svg circle {
  fill: rgba(126, 240, 220, 0.35);
  stroke: #fff;
  stroke-width: 1.5;
}

.watch-panel.player-open {
  border-color: rgba(255, 255, 255, 0.62);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.screen {
  position: relative;
  overflow: hidden;
  background: #020202;
  min-height: 300px;
}

.screen.playing {
  min-height: 380px;
}

.screen.playing .screen-hero-stack {
  min-height: 380px;
}

.screen-bg-img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0.84;
  pointer-events: none;
}

.screen-bg-img.screen-bg-img--failed {
  display: none !important;
}

.screen-bg-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  background:
    linear-gradient(145deg, #1a1a1a 0%, #0a0a0a 50%, #151515 100%);
  color: rgba(255, 255, 255, 0.42);
  text-align: center;
  pointer-events: none;
}

.screen-bg-img:not(.screen-bg-img--failed) ~ .screen-bg-fallback {
  display: none !important;
}

.screen-bg-fallback span {
  font-size: 18px;
  font-weight: 760;
  line-height: 1.3;
}

.screen-hero-stack::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.18) 0%,
      rgba(0, 0, 0, 0.58) 52%,
      rgba(5, 5, 5, 0.98) 84%,
      rgba(13, 13, 13, 1) 100%
    );
}

/* Реальный слой затемнения (не ::after): над постером, под текстом и кнопками — стабильный z-order во всех браузерах */
.screen-hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* Нижний fade к блоку описания: тот же градиент, что был у .screen::after — но здесь, чтобы лежал над постером/скримом и строго под .screen-content */
.screen-bottom-seam {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 172px;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(24, 24, 26, 0) 0%,
    rgba(24, 24, 26, 0.06) 18%,
    rgba(24, 24, 26, 0.18) 36%,
    rgba(24, 24, 26, 0.36) 54%,
    rgba(24, 24, 26, 0.62) 72%,
    rgba(24, 24, 26, 0.86) 88%,
    rgba(24, 24, 26, 1) 100%
  );
}

.screen-content {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 12px;
  padding: 22px;
  pointer-events: auto;
}

.play {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border-radius: var(--btn-radius);
  background: #fff;
  color: #050505;
  font-size: 25px;
  font-weight: 950;
  border: 0;
  cursor: pointer;
}

.screen h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.08;
}

.video-layer {
  position: relative;
  z-index: 1;
  min-height: 380px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 18px;
  background: rgba(0, 0, 0, 0.62);
}

.video-top,
.video-bottom {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: #e7e7e7;
  font-size: 13px;
  font-weight: 850;
}

.video-center {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 54px;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.8);
}

.watch-body {
  margin-top: -10px;
  padding: 6px 18px 18px;
  background: linear-gradient(180deg, rgba(13, 13, 13, 0.96) 0%, rgba(13, 13, 13, 1) 40px);
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  overflow-x: hidden;
  overflow-y: visible;
}

.watch-body h2 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.1;
}

.watch-body p {
  line-height: 1.55;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: auto;
  text-wrap: pretty;
}

.watch-body .watch-description {
  margin: 0;
}

.watch-description.collapsed {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
}

.description-toggle {
  margin-top: 2px;
  margin-bottom: 0;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  background: rgba(255, 255, 255, 0.035);
  color: #e7e7e7;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.people-block {
  margin-top: 26px;
}

.people-details {
  margin: 0 0 14px;
}

.people-details-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  cursor: pointer;
  list-style: none;
  font-weight: 800;
}

.people-details-summary::-webkit-details-marker {
  display: none;
}

.people-details-summary::marker {
  content: "";
}

.people-details-heading {
  margin: 0;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.people-details-end {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.people-details-count {
  font-size: 12px;
  font-weight: 750;
  color: #cfcfcf;
}

.people-details-chevron {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid rgba(255, 255, 255, 0.55);
  transition: transform 0.15s ease;
}

.people-details[open] .people-details-chevron {
  transform: rotate(180deg);
}

.people-details-body {
  padding: 0;
  margin-top: 10px;
}

.people-details-body .overline:first-of-type {
  margin-top: 0;
}

.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 10px;
}

.info-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--btn-radius);
  background: transparent;
  color: #fff;
  padding: 5px 12px;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
  white-space: nowrap;
}

.info-chip:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.chips-empty {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.watch-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}


.franchise-block {
  margin-top: 16px;
}

.franchise-status {
  border: 1px dashed var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
}

.franchise-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
}

.franchise-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 0;
  border-radius: 0;
  padding: 0;
  overflow: visible;
  background: transparent;
  color: #e9e9e9;
  text-align: left;
}

.franchise-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(235, 235, 245, 0.18);
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.franchise-thumb .poster-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.franchise-thumb .poster-img.poster-img--failed {
  display: none !important;
}

.franchise-item span {
  display: block;
  flex: 0 0 auto;
  padding: 0 4px;
  font-size: 12px;
  line-height: 1.28;
  font-weight: 620;
  color: rgba(235, 235, 245, 0.92);
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

.franchise-item.active {
  color: #fff;
}

.franchise-item.active .franchise-thumb {
  border-color: rgba(255, 255, 255, 0.96);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.88), 0 18px 38px rgba(0, 0, 0, 0.26);
}

.empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

.load-more {
  justify-self: center;
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  background: #fff;
  color: #050505;
  padding: 13px 18px;
  font-weight: 900;
}

.load-more:disabled {
  cursor: default;
  opacity: 0.48;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 3vw, 34px);
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(18px);
}

.auth-overlay.open {
  display: flex;
}

.auth-overlay--required .auth-close-btn {
  display: none;
}

.auth-dialog {
  position: relative;
  width: min(400px, 100%);
  max-height: min(92vh, 720px);
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(10, 10, 10, 0.98);
  padding: 22px 20px 20px;
  box-shadow: 0 38px 120px rgba(0, 0, 0, 0.75);
}

.auth-close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: var(--btn-radius);
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  color: #f2f2f2;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.auth-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.auth-dialog-title {
  margin: 0 42px 12px 0;
  font-size: 21px;
  font-weight: 900;
}

.auth-dialog-subtitle {
  margin: -4px 42px 14px 0;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 600;
  color: var(--muted);
}

.auth-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.auth-tab {
  flex: 1 1 auto;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--btn-radius);
  background: transparent;
  color: #dcdcdc;
  font-weight: 800;
  font-size: 12px;
  padding: 0 10px;
  cursor: pointer;
}

.auth-tab.active {
  background: #fff;
  color: #050505;
  border-color: #fff;
}

.auth-form.hidden,
.auth-form[hidden] {
  display: none !important;
}

.auth-field-full {
  display: block;
  width: 100%;
}

.auth-code-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(6, 48px);
  justify-content: center;
  gap: 8px;
}

.auth-code-cell {
  width: 48px;
  height: 56px;
  text-align: center;
  padding: 0 !important;
  border-radius: 14px !important;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.auth-submit {
  width: 100%;
  margin-top: 8px;
  min-height: 42px !important;
}

.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.auth-check input {
  margin-top: 3px;
  flex-shrink: 0;
}

.auth-error {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 750;
  color: #ffb3b9;
}

.auth-help {
  margin: 16px 0 0;
  font-size: 11px;
  line-height: 1.42;
  color: var(--muted);
}

.auth-help code {
  font-size: 10px;
  color: #d4d4d4;
}

.admin-overlay {
  position: fixed;
  inset: 0;
  z-index: 115;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 3vw, 34px);
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(16px);
}

.admin-overlay.open {
  display: flex;
}

.admin-dialog {
  position: relative;
  width: min(720px, 100%);
  max-height: min(92vh, 760px);
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(10, 10, 10, 0.98);
  padding: 28px 24px 24px;
  box-shadow: 0 38px 120px rgba(0, 0, 0, 0.75);
}

.admin-close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: var(--btn-radius);
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  color: #f2f2f2;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.admin-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.admin-dialog-title {
  margin: 0 56px 10px 0;
  font-size: 25px;
  font-weight: 900;
}

.admin-dialog-subtitle {
  margin: 0 56px 20px 0;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 600;
  color: var(--muted);
}

.admin-create-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: end;
  gap: 12px;
}

.admin-password-form {
  display: flex;
  flex-wrap: nowrap;
  align-items: end;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.admin-field {
  flex: 1 1 0;
  min-width: 0;
  font-size: 11px;
  letter-spacing: 0.13em;
}

.admin-field input {
  height: 44px !important;
  min-height: 44px !important;
  margin-top: 10px;
  border-radius: 10px;
}

.admin-create-submit {
  width: 100%;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 16px !important;
  border-radius: 10px;
  font-size: 13px !important;
  white-space: nowrap;
}

.admin-password-submit {
  width: 100%;
  flex: 0 0 230px;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 14px !important;
  border-radius: 10px;
  font-size: 13px !important;
  white-space: nowrap;
}

.admin-session-tools {
  margin: -6px 0 16px;
  padding: 12px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-logout-others-btn {
  display: block;
  width: min(100%, 420px);
}

.admin-created-password {
  margin: 14px 0 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 14px;
  font-weight: 850;
  color: #ffffff;
}

.admin-created-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
}

.admin-share-message {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  line-height: 1.5;
}

.admin-copy-message {
  width: 100%;
  margin-top: 10px;
  min-height: 38px;
}

.admin-password-status {
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(125, 211, 252, 0.28);
  border-radius: 8px;
  background: rgba(125, 211, 252, 0.08);
  font-size: 12px;
  font-weight: 850;
  color: #d6f3ff;
}

.admin-user-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.admin-user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.admin-user-stats,
.admin-user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-user-stats {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.admin-view-user,
.admin-delete-user {
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 10px !important;
  border-radius: 8px;
  font-size: 12px !important;
}

.admin-delete-user {
  color: #ffccd2;
  border-color: rgba(255, 179, 185, 0.28);
  white-space: nowrap;
}

.admin-delete-user:hover {
  background: rgba(255, 179, 185, 0.1);
  border-color: rgba(255, 179, 185, 0.5);
}

.admin-user-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.admin-user-main strong {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-main span,
.admin-empty {
  font-size: 12px;
  color: var(--muted);
}

.admin-profile-details {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
}

.admin-profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-section-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.admin-profile-head h3 {
  margin: 0;
  font-size: 18px;
}

.admin-profile-close {
  height: 34px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
}

.admin-profile-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.admin-profile-stats span {
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 12px;
}

.admin-profile-stats strong {
  color: #fff;
}

.admin-profile-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.admin-profile-columns h4 {
  margin: 0 0 8px;
  font-size: 13px;
}

.admin-profile-columns ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-profile-columns li {
  padding: 7px 8px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.22);
  color: #e8e8e8;
  font-size: 12px;
}

.admin-profile-columns .admin-profile-empty {
  color: var(--muted);
}

@media (max-width: 640px) {
  .admin-dialog {
    padding: 22px 18px 18px;
  }

  .admin-create-form,
  .admin-password-form {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .admin-create-submit,
  .admin-password-submit,
  .admin-delete-user {
    width: 100%;
    white-space: normal;
  }

  .admin-session-tools {
    margin-top: 2px;
  }

  .admin-user-row,
  .admin-profile-columns {
    grid-template-columns: 1fr;
  }

  .admin-user-stats,
  .admin-user-actions {
    justify-content: stretch;
  }

  .admin-view-user,
  .admin-delete-user {
    flex: 1;
  }
}

.player-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 3vw, 34px);
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(18px);
}

.player-overlay.open {
  display: flex;
}

.player-dialog {
  position: relative;
  width: min(1400px, calc(100vw - 32px));
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  overflow: hidden;
  background: #020202;
  box-shadow: 0 40px 140px rgba(0, 0, 0, 0.86);
}

.close-player {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 42px;
  height: 42px;
  border-radius: var(--btn-radius);
  background: rgba(255, 255, 255, 0.94);
  color: #050505;
  font-size: 28px;
  line-height: 1;
  font-weight: 600;
}

/* Крестик внутри модалки плеера скрыт по просьбе: закрытие остаётся по Esc и клику по фону. */
.player-dialog .close-player {
  display: none !important;
}

.overlay-screen {
  position: relative;
  min-height: 0;
  display: block;
  overflow: hidden;
  background: #050505;
}

.fkwatch-frame {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 390px;
  background: #050505;
  position: relative;
  overflow: hidden;
}

.fkwatch-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #050505;
}

.fkwatch-frame iframe::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.player-meta {
  display: grid;
  gap: 8px;
  padding: 16px 22px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(12, 12, 13, 0.96), rgba(9, 9, 10, 0.98));
}

.player-meta-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.player-meta-copy {
  min-width: 0;
  display: grid;
  gap: 8px;
  flex: 1 1 auto;
}

.player-meta-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}

.player-meta-title {
  font-size: 18px;
  line-height: 1.3;
  font-weight: 780;
  color: #f5f5f7;
}

.player-meta-year {
  font-size: 14px;
  line-height: 1.4;
  font-weight: 620;
  color: rgba(235, 235, 245, 0.6);
}

.player-meta-note {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(235, 235, 245, 0.78);
}

.player-meta-link {
  color: #d6b4ff;
  text-decoration: none;
  border-bottom: 1px solid rgba(214, 180, 255, 0.4);
}

.player-meta-link:hover {
  color: #eddcff;
  border-bottom-color: rgba(237, 220, 255, 0.72);
}

.player-provider-box {
  flex: 0 0 240px;
  display: grid;
  gap: 8px;
  justify-items: end;
}

.player-provider-label {
  font-size: 11px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(235, 235, 245, 0.54);
}

.player-provider-select {
  width: min(240px, 100%);
  min-height: 42px;
  padding: 0 40px 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #f5f5f7;
  font: 620 14px/1.2 Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, rgba(245, 245, 247, 0.82) 50%), linear-gradient(135deg, rgba(245, 245, 247, 0.82) 50%, transparent 50%);
  background-position: calc(100% - 21px) calc(50% - 3px), calc(100% - 15px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.player-provider-select:disabled {
  opacity: 0.56;
  cursor: default;
}

@media (max-width: 820px) {
  .player-meta-top {
    flex-direction: column;
  }

  .player-provider-box {
    width: 100%;
    flex-basis: auto;
    justify-items: start;
  }

  .player-provider-select {
    width: 100%;
  }
}

.overlay-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.76;
}

.overlay-top,
.overlay-bottom,
.overlay-play {
  position: relative;
  z-index: 1;
}

.overlay-top,
.overlay-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  color: #f4f4f4;
  font-weight: 850;
}

.overlay-play {
  display: grid;
  place-items: center;
}

.overlay-play span {
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: #050505;
  font-size: 42px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.overlay-bottom {
  align-items: end;
}

.overlay-title h2 {
  margin: 0;
  font-size: clamp(30px, 5vw, 64px);
  line-height: 0.98;
}

.overlay-title p {
  margin: 8px 0 0;
  color: #d0d0d0;
}

.overlay-meta {
  text-align: right;
  color: #dcdcdc;
}

@media (max-width: 1180px) {
  :root {
    --sticky-below-header: 124px;
  }

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

  .auth-bar {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .app-header .search {
    width: 100%;
    justify-self: stretch;
  }

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

@media (max-width: 1024px) {
  body:has(#top.has-card) .app-header {
    grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  }

  body:has(#top.has-card) .app-header .auth-bar {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .watch-panel {
    grid-column: 1 / -1;
    position: static;
    max-height: none;
    height: auto;
    overflow: visible;
    margin-top: 0;
    margin-left: 0;
  }

  .workspace.has-card .watch-panel > .screen,
  .workspace.has-card .watch-panel > .screen.playing {
    max-height: none;
  }

  .watch-body {
    overflow: visible;
    min-height: 0;
    max-height: none;
  }

  .workspace.has-card .watch-panel > .watch-body {
    flex: 0 0 auto;
    overflow: visible;
  }

  @media (min-width: 821px) {
    .workspace.has-card {
      grid-template-columns: minmax(0, 1fr);
    }

    .workspace.has-card .watch-panel {
      grid-column: 1;
      width: 100%;
    }
  }

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

@media (max-width: 720px) {
  .overlay-bottom,
  .overlay-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .overlay-meta {
    text-align: left;
  }
}

@media (max-width: 820px) {
  :root {
    /* Шапка в несколько рядов: лого, поиск, аккаунт */
    --sticky-below-header: 168px;
  }

  .app-header,
  .workspace {
    grid-template-columns: 1fr;
  }

  .workspace {
    padding-left: var(--page-pad-x);
  }

  .app-header {
    row-gap: 8px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .app-header .brand {
    justify-self: center;
    width: 100%;
    box-sizing: border-box;
  }

  .app-header .search {
    width: 100%;
    justify-self: stretch;
  }

  .app-header .auth-bar {
    justify-content: center;
  }

  .rail {
    position: static;
    left: auto;
    top: auto;
    width: auto;
    max-height: none;
    overflow: visible;
    z-index: auto;
  }

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

}

/* Apple-like visual system refresh */
:root {
  --bg: #050506;
  --panel: rgba(28, 28, 30, 0.74);
  --panel-2: rgba(36, 36, 38, 0.72);
  --panel-3: rgba(48, 48, 50, 0.72);
  --text: #f5f5f7;
  --muted: rgba(235, 235, 245, 0.58);
  --line: rgba(235, 235, 245, 0.12);
  --line-strong: rgba(235, 235, 245, 0.28);
  --accent: #0a84ff;
  --accent-soft: rgba(10, 132, 255, 0.18);
  --glass: rgba(28, 28, 30, 0.62);
  --glass-strong: rgba(38, 38, 40, 0.82);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 30px;
  --btn-radius: 9999px;
}

html {
  background: #050506;
}

body {
  background:
    radial-gradient(circle at 52% -10%, rgba(255, 255, 255, 0.08), transparent 34%),
    #050506;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, "Segoe UI", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app-shell {
  background: transparent;
}

.app-header {
  padding-top: 10px;
  padding-bottom: 10px;
  border-bottom-color: rgba(235, 235, 245, 0.08);
  background: rgba(10, 10, 12, 0.74);
  backdrop-filter: blur(28px) saturate(1.35);
  -webkit-backdrop-filter: blur(28px) saturate(1.35);
}

.brand-logo-img {
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.35));
}

.search,
input,
select {
  border-color: rgba(235, 235, 245, 0.12);
  background: rgba(118, 118, 128, 0.16);
  color: var(--text);
  border-radius: var(--radius-md);
}

.search {
  min-height: 44px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.search:focus-within,
input:focus,
select:focus {
  border-color: rgba(10, 132, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.18);
}

.search input {
  height: 44px;
  padding-inline: 16px;
}

select,
.field input {
  min-height: 44px;
  border-radius: var(--radius-md);
  background: rgba(118, 118, 128, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.search button:not(.search-clear-btn),
.primary-button,
.segment.active,
.catalog-chip--reset {
  background: #f5f5f7;
  color: #050506;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.search button:not(.search-clear-btn),
.primary-button {
  font-weight: 760;
}

.ghost-button,
.segment,
.secondary-button,
.description-toggle,
.info-chip,
.load-more,
.catalog-chip {
  border-color: rgba(235, 235, 245, 0.12);
  background: rgba(118, 118, 128, 0.14);
  color: rgba(245, 245, 247, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.ghost-button:hover,
.segment:hover,
.secondary-button:hover,
.description-toggle:hover,
.info-chip:hover,
.load-more:hover,
.catalog-chip:hover {
  border-color: rgba(235, 235, 245, 0.26);
  background: rgba(118, 118, 128, 0.22);
  transform: translateY(-1px);
}

.rail {
  padding: 14px;
  border: 1px solid rgba(235, 235, 245, 0.08);
  border-radius: var(--radius-xl);
  background: rgba(18, 18, 20, 0.34);
  backdrop-filter: blur(24px) saturate(1.18);
  -webkit-backdrop-filter: blur(24px) saturate(1.18);
}

.rail-section-title,
.overline,
.people-details-heading {
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 760;
  color: rgba(235, 235, 245, 0.48);
}

.segmented {
  gap: 8px;
}

.segment,
.ghost-button,
.secondary-button {
  min-height: 38px;
  padding: 9px 12px;
  font-weight: 680;
}

.field {
  color: rgba(235, 235, 245, 0.62);
  font-size: 13px;
  font-weight: 660;
}

.catalog-context {
  min-height: 64px;
  margin-bottom: 20px;
  padding: 4px 2px 8px;
}

.catalog-context-title {
  font-weight: 760;
  letter-spacing: 0;
}

.catalog-context-subtitle {
  font-weight: 560;
  color: rgba(235, 235, 245, 0.52);
}

.catalog-chip {
  min-height: 32px;
  border-radius: var(--btn-radius);
  font-weight: 650;
  background: rgba(118, 118, 128, 0.16);
}

.section-wall {
  gap: 20px;
}

.watch-panel,
.movie-card {
  border-color: rgba(235, 235, 245, 0.1);
  border-radius: var(--radius-lg);
  background: rgba(28, 28, 30, 0.68);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(20px) saturate(1.12);
  -webkit-backdrop-filter: blur(20px) saturate(1.12);
}

.movie-card {
  overflow: hidden;
  background: rgba(28, 28, 30, 0.58);
}

.movie-card:hover {
  border-color: rgba(235, 235, 245, 0.24);
  background: rgba(44, 44, 46, 0.76);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.34);
  transform: translateY(-3px) scale(1.012);
}

.movie-card.active {
  border-color: rgba(10, 132, 255, 0.82);
  box-shadow:
    0 0 0 1px rgba(10, 132, 255, 0.72),
    0 28px 78px rgba(0, 0, 0, 0.42);
}

.poster {
  background: #111113;
}

.poster::after {
  background: linear-gradient(180deg, transparent 42%, rgba(0, 0, 0, 0.74) 100%);
}

.movie-card:hover .poster::after {
  background: linear-gradient(180deg, transparent 28%, rgba(0, 0, 0, 0.86) 100%);
}

.poster-title strong {
  font-size: 15px;
  font-weight: 760;
  letter-spacing: 0;
}

.poster-title span,
.card-strip {
  color: rgba(235, 235, 245, 0.62);
  font-weight: 600;
}

.badge {
  height: 24px;
  border-radius: var(--btn-radius);
  background: rgba(28, 28, 30, 0.74);
  color: #f5f5f7;
  font-weight: 720;
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}

.badge.badge-subtle {
  background: rgba(28, 28, 30, 0.5);
  color: rgba(245, 245, 247, 0.78);
}

.card-strip {
  border-top-color: rgba(235, 235, 245, 0.08);
  background: rgba(28, 28, 30, 0.72);
}

.watch-panel {
  border-radius: var(--radius-xl);
}

.screen,
.screen-hero-stack {
  background: #050506;
}

.screen {
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.screen-hero-stack::after,
.screen-hero-scrim {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.03) 0%, rgba(0, 0, 0, 0.08) 18%, rgba(0, 0, 0, 0.18) 40%, rgba(0, 0, 0, 0.38) 62%, rgba(18, 18, 20, 0.74) 82%, rgba(24, 24, 26, 0.94) 93%, rgba(24, 24, 26, 1) 100%);
}

.play,
.watch-tool-btn {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.play {
  background: rgba(245, 245, 247, 0.95);
  color: #050506;
}

.watch-tool-btn {
  border: 1px solid rgba(235, 235, 245, 0.28);
  background: rgba(28, 28, 30, 0.42);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.watch-tool-btn:hover {
  background: rgba(118, 118, 128, 0.28);
}

.watch-body {
  background: linear-gradient(180deg, rgba(24, 24, 26, 0.92) 0%, rgba(24, 24, 26, 0.98) 38px, rgba(24, 24, 26, 1) 112px);
  padding: 10px 20px 22px;
}

.watch-ratings-compact,
.rail-footer,
.card-strip {
  border-color: rgba(235, 235, 245, 0.08);
}

.people-details-summary,
.franchise-item,
.auth-dialog,
.player-dialog {
  border-radius: var(--radius-lg);
}

.info-chip {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 620;
  border-color: rgba(235, 235, 245, 0.14);
}

.empty,
.franchise-status {
  border-radius: var(--radius-lg);
  background: rgba(118, 118, 128, 0.1);
  border-color: rgba(235, 235, 245, 0.1);
}

.load-more {
  min-height: 44px;
  padding-inline: 18px;
  font-weight: 720;
}

@media (max-width: 820px) {
  .rail {
    border-radius: var(--radius-lg);
    background: rgba(18, 18, 20, 0.48);
  }

  .movie-card,
  .watch-panel {
    border-radius: var(--radius-md);
  }
}

/* Apple TV-like global redesign pass */
:root {
  --sidebar-w: 224px;
  --sticky-below-header: 84px;
  --page-pad-x: clamp(18px, 3.2vw, 42px);
  --layout-gap: 28px;
}

body {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 180px),
    radial-gradient(circle at 78% 0%, rgba(10, 132, 255, 0.12), transparent 32%),
    #050506;
}

.app-header {
  grid-template-columns: var(--sidebar-w) minmax(420px, 980px) minmax(120px, auto);
  gap: 28px;
  min-height: 76px;
  padding: 10px var(--page-pad-x);
  background: rgba(5, 5, 6, 0.78);
}

.brand-logo-img {
  height: clamp(42px, 5.6vw, 58px);
  transform: none;
}

.search {
  min-height: 48px;
  border-radius: 24px;
  background: rgba(40, 40, 42, 0.72);
}

.search input {
  height: 48px;
  font-size: 17px;
}

.auth-header-btn,
.secondary-button {
  min-height: 36px;
  font-size: 13px !important;
}

.workspace {
  padding-top: calc(22px + var(--sticky-below-header));
}

.rail {
  padding: 18px 16px;
  border-radius: 28px;
  background: rgba(16, 16, 18, 0.58);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 24px 80px rgba(0, 0, 0, 0.18);
}

.rail-section-title {
  margin: 0 0 12px;
  padding-inline: 2px;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: rgba(235, 235, 245, 0.42);
}

.rail-block,
.field {
  margin-bottom: 22px;
}

.segmented {
  gap: 8px;
}

.rail .segment {
  min-height: 42px;
  justify-content: flex-start;
  padding: 0 15px;
  border-radius: 15px;
  border-color: transparent;
  background: transparent;
  color: rgba(245, 245, 247, 0.72);
  font-size: 15px;
  font-weight: 660;
  text-align: left;
  box-shadow: none;
}

.rail .segment:hover {
  background: rgba(118, 118, 128, 0.16);
  transform: none;
}

.rail .segment.active {
  background: rgba(245, 245, 247, 0.94);
  color: #050506;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.rail .segment-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.rail .segment-wrap .segment {
  width: 100%;
}

.segment-nav-badge {
  position: absolute;
  top: 5px;
  right: 10px;
  z-index: 2;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ff3b30;
  color: #fff;
  font-size: 11px;
  font-weight: 760;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.field {
  font-size: 12px;
  font-weight: 640;
  color: rgba(235, 235, 245, 0.5);
}

select,
.field input {
  min-height: 40px;
  margin-top: 8px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 620;
  background: rgba(58, 58, 60, 0.54);
}

.ghost-button {
  min-height: 40px;
  border-radius: 14px;
  font-size: 14px;
}

.rail-footer {
  margin-top: 24px;
  opacity: 0.72;
}

.catalog-context {
  min-height: 78px;
  align-items: center;
  margin-bottom: 26px;
}

.catalog-context-title {
  font-size: clamp(34px, 4.1vw, 56px);
  line-height: 0.98;
  font-weight: 760;
  max-width: 1040px;
}

.catalog-context-subtitle {
  margin-top: 8px;
  font-size: clamp(15px, 1.4vw, 19px);
  font-weight: 560;
}

.catalog-chip-row {
  align-self: flex-start;
  padding-top: 6px;
}

.catalog-chip {
  min-height: 34px;
  padding-inline: 12px;
  border-radius: 14px;
  background: rgba(58, 58, 60, 0.5);
}

.section-wall {
  --card-width: clamp(158px, 12vw, 214px);
  gap: 24px;
}

.workspace.has-card .section-wall {
  --card-width: clamp(150px, 10vw, 188px);
}

.movie-card {
  border-radius: 26px;
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(30, 30, 32, 0.42);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.movie-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-6px) scale(1.025);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.42);
}

.poster-title {
  left: 14px;
  right: 14px;
  bottom: 14px;
}

.poster-title strong {
  font-size: 17px;
  line-height: 1.12;
  font-weight: 740;
}

.poster-title span {
  font-size: 13px;
  font-weight: 620;
}

.poster-badges {
  left: 12px;
  right: 12px;
  top: 12px;
}

.badge {
  height: 28px;
  padding-inline: 10px !important;
  font-size: 13px !important;
}

.card-strip {
  min-height: 46px;
  padding: 13px 14px;
  font-size: 13px;
  background: rgba(30, 30, 32, 0.86);
}

.watch-panel {
  border-radius: 30px;
  background: rgba(28, 28, 30, 0.84);
}

.screen {
  border-radius: 30px 30px 0 0;
}

.screen-content {
  padding: 26px;
}

.screen h2 {
  font-size: clamp(28px, 2.8vw, 42px);
  font-weight: 760;
}

.watch-body {
  padding: 16px 24px 26px;
}

.empty {
  padding: 28px;
  border-radius: 24px;
  color: rgba(235, 235, 245, 0.62);
}

.catalog-load-overlay {
  background: rgba(5, 5, 6, 0.42);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
}

@media (max-width: 1180px) {
  :root {
    --sidebar-w: 204px;
  }

  .catalog-context-title {
    font-size: clamp(30px, 4vw, 42px);
  }
}

@media (max-width: 820px) {
  :root {
    --sticky-below-header: 148px;
  }

  .app-header {
    min-height: 0;
    gap: 10px;
  }

  .brand-logo-img {
    height: 44px;
  }

  .rail {
    padding: 14px;
  }

  .catalog-context-title {
    font-size: 30px;
    white-space: normal;
  }

  .section-wall {
    gap: 16px;
  }
}

/* Scale correction: keep Apple-like polish without oversized TV layout */
:root {
  --sidebar-w: 250px;
  --sticky-below-header: 108px;
  --page-pad-x: clamp(16px, 3vw, 34px);
  --layout-gap: 18px;
}

.app-header {
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) auto;
  gap: var(--layout-gap);
  min-height: 0;
  padding: 6px var(--page-pad-x);
}

.brand-logo-img {
  height: clamp(58px, 8.4vw, 86px);
  transform: scale(0.72);
}

.search {
  min-height: 42px;
  border-radius: 999px;
}

.search input {
  height: 42px;
  font-size: 15px;
}

.workspace {
  padding-top: calc(28px + var(--sticky-below-header));
}

.rail {
  padding: 16px;
  border-radius: 22px;
  background: rgba(16, 16, 18, 0.42);
}

.rail .segment {
  min-height: 40px;
  padding: 0 13px;
  border-radius: 999px;
  justify-content: center;
  font-size: 14px;
  text-align: center;
}

.rail .segment.active {
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
}

.rail-section-title {
  margin-bottom: 8px;
  font-size: 10px;
}

.rail-block,
.field {
  margin-bottom: 18px;
}

select,
.field input {
  min-height: 42px;
  border-radius: 14px;
  font-size: 13px;
}

.catalog-context {
  min-height: 52px;
  margin-bottom: 16px;
  padding: 0 2px 2px;
}

.catalog-context-title {
  font-size: clamp(22px, 2.2vw, 32px);
  line-height: 1.08;
  font-weight: 760;
  white-space: nowrap;
}

.catalog-context-subtitle {
  margin-top: 3px;
  font-size: 13px;
}

.catalog-chip-row {
  padding-top: 0;
}

.catalog-chip {
  min-height: 30px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.section-wall {
  --card-width: clamp(148px, 10.2vw, 178px);
  gap: 18px;
}

.workspace.has-card .section-wall {
  --card-width: clamp(148px, 10.2vw, 178px);
}

.movie-wall {
  gap: 34px;
}

.movie-card {
  border-radius: 16px;
  background: rgba(28, 28, 30, 0.52);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.18);
}

.movie-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.32);
}

.poster-title {
  left: 10px;
  right: 10px;
  bottom: 11px;
}

.poster-title strong {
  font-size: 15px;
  line-height: 1.14;
}

.poster-title span {
  font-size: 12px;
}

.poster-badges {
  left: 10px;
  right: 10px;
  top: 10px;
}

.badge {
  height: 22px;
  padding-inline: 7px !important;
  font-size: 12px !important;
}

.badge.badge-subtle {
  font-size: 11px !important;
}

.card-strip {
  min-height: 0;
  padding: 10px 11px;
  font-size: 12px;
}

.watch-panel {
  border-radius: 22px;
}

.screen {
  border-radius: 22px 22px 0 0;
}

.screen-content {
  padding: 22px;
}

.screen h2 {
  font-size: 30px;
}

.watch-body {
  padding: 8px 18px 18px;
}

.load-more {
  min-height: 40px;
}

@media (max-width: 1180px) {
  :root {
    --sidebar-w: 230px;
  }

  .catalog-context-title {
    font-size: clamp(22px, 2.5vw, 30px);
  }
}

@media (max-width: 820px) {
  :root {
    --sticky-below-header: 168px;
  }

  .brand-logo-img {
    height: clamp(58px, 8.4vw, 86px);
    transform: scale(0.72);
  }

  .catalog-context-title {
    font-size: 24px;
  }
}




/* =============================================================================
   Final visuals and desktop layout
   ============================================================================= */

.workspace,
.catalog,
.content-section,
.movie-wall,
.section-wall {
  min-width: 0;
}

body:not(.player-lock) {
  min-height: 100dvh !important;
}

html.player-lock,
body.player-lock {
  overflow: hidden !important;
  height: 100dvh;
}

body {
  color: #f5f5f7;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, "Segoe UI", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(circle at 74% -12%, rgba(168, 85, 247, 0.16), transparent 36%),
    radial-gradient(circle at 22% -18%, rgba(56, 189, 248, 0.11), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.032), transparent 220px),
    #050506;
}

.app-header {
  background: rgba(10, 10, 12, 0.9) !important;
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04), 0 18px 56px rgba(0,0,0,0.26) !important;
  pointer-events: none;
}

.app-header .brand,
.app-header .search,
.app-header .auth-bar,
.app-header a,
.app-header button,
.app-header input,
.app-header select,
.app-header label {
  pointer-events: auto;
}

.brand {
  position: relative;
  isolation: isolate;
}

.brand::before {
  content: "";
  position: absolute;
  inset: 2px -8px;
  border-radius: 999px;
  background: radial-gradient(
    ellipse at var(--brand-glow-x, 50%) var(--brand-glow-y, 50%),
    rgba(168, 85, 247, var(--brand-glow-core, 0.64)),
    rgba(168, 85, 247, 0.2) 40%,
    transparent 74%
  );
  filter: blur(17px);
  opacity: var(--brand-glow-opacity, 0);
  transform: scale(var(--brand-glow-scale, 0.94));
  transition: opacity 0.16s ease, transform 0.16s ease, background-position 0.06s linear;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: screen;
}

.brand:hover::before,
.brand:focus-visible::before {
  opacity: 0.95;
  transform: scale(1);
}

.brand-logo-img {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.32));
}

.search,
select,
.field input,
.secondary-button,
.ghost-button,
.load-more,
.info-chip,
.catalog-chip,
.rail .segment {
  background: rgba(118, 118, 128, 0.18) !important;
  border-color: rgba(235, 235, 245, 0.14) !important;
  border-radius: 16px !important;
}

.search:focus-within,
select:focus,
.field input:focus,
input:focus {
  border-color: rgba(168, 85, 247, 0.64) !important;
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.14) !important;
}

.search button:not(.search-clear-btn),
.rail .segment.active,
.catalog-chip--reset {
  background: #f5f5f7 !important;
  color: #050506 !important;
  box-shadow: 0 10px 28px rgba(0,0,0,0.18), 0 0 0 1px rgba(168,85,247,0.16) !important;
}

.search .search-clear-btn {
  color: #a855f7 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.rail,
.watch-panel {
  background: rgba(24, 24, 26, 0.92) !important;
  border: 1px solid rgba(235,235,245,0.13) !important;
  border-radius: 24px !important;
  box-shadow: 0 22px 68px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.06) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.catalog-context-title {
  color: #f5f5f7 !important;
  font-weight: 760 !important;
  letter-spacing: 0 !important;
}

.catalog-context-subtitle,
.rail-section-title,
.overline,
.people-details-heading,
.meta,
.rail-footer-nav,
.rail-footer-copy {
  color: rgba(235, 235, 245, 0.62) !important;
}

.movie-card {
  background: rgba(28, 28, 30, 0.64) !important;
  border-radius: 18px !important;
  box-shadow: 0 12px 34px rgba(0,0,0,0.18) !important;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease !important;
}

.movie-card:hover {
  border-color: rgba(168, 85, 247, 0.42) !important;
  background: rgba(36, 36, 38, 0.76) !important;
  box-shadow: 0 18px 50px rgba(0,0,0,0.28) !important;
}

.movie-card.active {
  border-color: #a855f7 !important;
  box-shadow: 0 0 0 2px rgba(168,85,247,0.86) !important, 0 18px 58px rgba(0,0,0,0.32) !important;
}

.poster,
.poster .poster-img,
.poster::after,
.poster-fallback {
  border-radius: 18px 18px 0 0 !important;
}

.card-strip {
  border-radius: 0 0 18px 18px !important;
}

input[type="range"] {
  accent-color: #a855f7;
}

.rail-footer {
  margin-top: 20px !important;
  padding-top: 16px !important;
  border-top: 1px solid rgba(235,235,245,0.08) !important;
}

.rail-footer-nav {
  gap: 8px !important;
  margin-bottom: 12px !important;
  font-size: 11px !important;
  font-weight: 650 !important;
  letter-spacing: 0 !important;
}

.rail-footer-link {
  color: rgba(235,235,245,0.58) !important;
  border-bottom: 0 !important;
}

.rail-footer-link:hover {
  color: #fff !important;
}

.rail-footer-tagline {
  margin-bottom: 10px !important;
  font-size: 12px !important;
  font-weight: 720 !important;
  letter-spacing: 0 !important;
  color: rgba(245,245,247,0.8) !important;
}

.rail-footer-copy {
  font-size: 11px !important;
  font-weight: 650 !important;
  letter-spacing: 0.12em !important;
}


/* Sidebar type system */
.rail-section-title,
.field {
  font-family: inherit;
  font-size: 10px !important;
  font-weight: 760 !important;
  line-height: 1.18 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase;
  color: rgba(235, 235, 245, 0.62) !important;
}

.rail-section-title {
  margin: 0 0 8px !important;
}

.field {
  margin-bottom: 16px !important;
}

.field:has(select),
.field:has(input[type="range"]) {
  display: grid !important;
  gap: 8px !important;
}

.field #ratingFieldPrefix,
.field #ratingValue,
.field #yearValue {
  font-variant-numeric: tabular-nums;
}

.field #ratingValue,
.field #yearValue {
  letter-spacing: 0 !important;
  color: rgba(245, 245, 247, 0.78) !important;
}

.rail .segment,
.rail select,
.rail .ghost-button,
.rail .secondary-button,
.field input,
.field select {
  font-family: inherit;
  text-transform: none;
  letter-spacing: 0 !important;
}

.rail .segment {
  font-size: 15px !important;
  font-weight: 640 !important;
  line-height: 1.12 !important;
}

.rail .segment.active {
  font-weight: 690 !important;
}

.rail select,
.rail .ghost-button {
  min-height: 40px !important;
  font-size: 14px !important;
  font-weight: 640 !important;
  line-height: 1.18 !important;
}

.rail .segmented {
  gap: 6px !important;
}

.rail-block {
  margin-bottom: 14px !important;
}

.rail-footer {
  margin-top: 16px !important;
  padding-top: 14px !important;
}

.rail-footer-nav {
  font-size: 11px !important;
  font-weight: 620 !important;
  line-height: 1.32 !important;
  letter-spacing: 0 !important;
  margin-bottom: 10px !important;
}

.rail-footer-tagline {
  font-size: 12px !important;
  font-weight: 670 !important;
  line-height: 1.34 !important;
  letter-spacing: 0 !important;
  margin-bottom: 8px !important;
}

.rail-footer-copy {
  font-size: 10px !important;
  font-weight: 620 !important;
  line-height: 1.24 !important;
  letter-spacing: 0.12em !important;
}

@keyframes watch-panel-enter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes watch-panel-exit {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
}

@media (min-width: 1440px) {
  :root {
    --catalog-gap-x: 12px;
    --catalog-gap-open-x: 12px;
    --catalog-gap-y: 24px;
    --panel-col-gap: 3px;
    --catalog-card-w: clamp(
      146px,
      calc((100vw - (var(--page-pad-x) * 2) - var(--sidebar-w) - var(--layout-gap) - (var(--catalog-gap-x) * 6)) / 7),
      214px
    );
    --catalog-open-w: calc((var(--catalog-card-w) * 5) + (var(--catalog-gap-open-x) * 4));
    --watch-panel-w: clamp(
      320px,
      calc(100vw - (var(--page-pad-x) * 2) - var(--sidebar-w) - var(--layout-gap) - var(--panel-col-gap) - var(--catalog-open-w)),
      486px
    );
  }

  .workspace {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0 !important;
    padding: calc(28px + var(--sticky-below-header)) var(--page-pad-x) 34px !important;
    padding-left: calc(var(--page-pad-x) + var(--sidebar-w) + var(--layout-gap)) !important;
    align-items: start !important;
    justify-content: start !important;
  }

  .workspace.has-card {
    grid-template-columns: var(--catalog-open-w) minmax(320px, var(--watch-panel-w)) !important;
    gap: var(--panel-col-gap) !important;
  }

  .rail {
    position: fixed !important;
    left: var(--page-pad-x) !important;
    top: var(--sticky-below-header) !important;
    width: var(--sidebar-w) !important;
    max-height: none !important;
    z-index: 40;
    box-sizing: border-box;
  }

  .catalog {
    grid-column: 1;
    width: calc((var(--catalog-card-w) * 7) + (var(--catalog-gap-x) * 6)) !important;
    max-width: calc((var(--catalog-card-w) * 7) + (var(--catalog-gap-x) * 6)) !important;
    min-width: 0;
    margin: 0;
    justify-self: start;
    transition: width 280ms cubic-bezier(0.22, 1, 0.36, 1), max-width 280ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .workspace.has-card .catalog {
    width: var(--catalog-open-w) !important;
    max-width: var(--catalog-open-w) !important;
  }

  .section-wall {
    display: grid;
    grid-template-columns: repeat(7, var(--catalog-card-w)) !important;
    justify-content: start;
    gap: var(--catalog-gap-y) var(--catalog-gap-x) !important;
    width: 100%;
    max-width: 100%;
  }

  .workspace.has-card .section-wall {
    grid-template-columns: repeat(5, var(--catalog-card-w)) !important;
    gap: var(--catalog-gap-y) var(--catalog-gap-open-x) !important;
  }

  .movie-card,
  .workspace.has-card .movie-card {
    width: var(--catalog-card-w) !important;
    min-width: var(--catalog-card-w) !important;
    max-width: var(--catalog-card-w) !important;
  }

  .watch-panel {
    grid-column: 2;
    width: 100%;
    max-width: var(--watch-panel-w);
    min-width: 0;
    display: none;
    margin: 0;
    justify-self: start;
    opacity: 0;
    transform: translateY(12px) scale(0.985);
    transform-origin: top right;
    transition: opacity 280ms cubic-bezier(0.22, 1, 0.36, 1), transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .workspace:not(.has-card) .watch-panel {
    display: none !important;
    pointer-events: none;
  }

  .workspace.has-card .watch-panel {
    display: flex !important;
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: watch-panel-enter 280ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .watch-panel.card-closing,
  .workspace.has-card .watch-panel.card-closing {
    display: flex !important;
    animation: watch-panel-exit 180ms ease forwards !important;
  }
}

@media (min-width: 1280px) and (max-width: 1439px) {
  :root {
    --catalog-card-w: 138px;
    --catalog-gap-x: 12px;
    --catalog-gap-y: 22px;
    --watch-panel-w: 286px;
  }

  .workspace {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0 !important;
    padding: calc(28px + var(--sticky-below-header)) var(--page-pad-x) 34px !important;
    padding-left: calc(var(--page-pad-x) + var(--sidebar-w) + var(--layout-gap)) !important;
    align-items: start !important;
    justify-content: start !important;
  }

  .workspace.has-card {
    grid-template-columns: calc((var(--catalog-card-w) * 4) + (var(--catalog-gap-x) * 3)) minmax(264px, var(--watch-panel-w)) !important;
    gap: calc(var(--layout-gap) - 9px) !important;
  }

  .rail {
    position: fixed !important;
    left: var(--page-pad-x) !important;
    top: var(--sticky-below-header) !important;
    width: var(--sidebar-w) !important;
    max-height: none !important;
    z-index: 40;
    box-sizing: border-box;
  }

  .catalog {
    grid-column: 1;
    width: calc((var(--catalog-card-w) * 6) + (var(--catalog-gap-x) * 5)) !important;
    max-width: calc((var(--catalog-card-w) * 6) + (var(--catalog-gap-x) * 5)) !important;
    min-width: 0;
    margin: 0;
    justify-self: start;
    transition: width 280ms cubic-bezier(0.22, 1, 0.36, 1), max-width 280ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .workspace.has-card .catalog {
    width: calc((var(--catalog-card-w) * 4) + (var(--catalog-gap-x) * 3)) !important;
    max-width: calc((var(--catalog-card-w) * 4) + (var(--catalog-gap-x) * 3)) !important;
  }

  .section-wall {
    display: grid;
    grid-template-columns: repeat(6, var(--catalog-card-w)) !important;
    justify-content: start;
    gap: var(--catalog-gap-y) var(--catalog-gap-x) !important;
    width: 100%;
    max-width: 100%;
  }

  .workspace.has-card .section-wall {
    grid-template-columns: repeat(4, var(--catalog-card-w)) !important;
  }

  .movie-card,
  .workspace.has-card .movie-card {
    width: var(--catalog-card-w) !important;
    min-width: var(--catalog-card-w) !important;
    max-width: var(--catalog-card-w) !important;
  }

  .watch-panel {
    grid-column: 2;
    width: 100%;
    max-width: var(--watch-panel-w);
    min-width: 0;
    display: none;
    margin: 0;
    justify-self: start;
    opacity: 0;
    transform: translateY(12px) scale(0.985);
    transform-origin: top right;
    transition: opacity 280ms cubic-bezier(0.22, 1, 0.36, 1), transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .workspace:not(.has-card) .watch-panel {
    display: none !important;
    pointer-events: none;
  }

  .workspace.has-card .watch-panel {
    display: flex !important;
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: watch-panel-enter 280ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .watch-panel.card-closing,
  .workspace.has-card .watch-panel.card-closing {
    display: flex !important;
    animation: watch-panel-exit 180ms ease forwards !important;
  }
}

@media (min-width: 821px) and (max-width: 1279px) {
  :root {
    --catalog-card-w: 132px;
    --catalog-gap-x: 10px;
    --catalog-gap-y: 20px;
    --watch-panel-w: 268px;
  }

  .workspace {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0 !important;
    padding: calc(28px + var(--sticky-below-header)) var(--page-pad-x) 34px !important;
    padding-left: calc(var(--page-pad-x) + var(--sidebar-w) + var(--layout-gap)) !important;
    align-items: start !important;
    justify-content: start !important;
  }

  .workspace.has-card {
    grid-template-columns: calc((var(--catalog-card-w) * 3) + (var(--catalog-gap-x) * 2)) minmax(248px, var(--watch-panel-w)) !important;
    gap: var(--layout-gap) !important;
  }

  .rail {
    position: fixed !important;
    left: var(--page-pad-x) !important;
    top: var(--sticky-below-header) !important;
    width: var(--sidebar-w) !important;
    max-height: none !important;
    z-index: 40;
    box-sizing: border-box;
  }

  .catalog {
    grid-column: 1;
    width: calc((var(--catalog-card-w) * 5) + (var(--catalog-gap-x) * 4)) !important;
    max-width: calc((var(--catalog-card-w) * 5) + (var(--catalog-gap-x) * 4)) !important;
    min-width: 0;
    margin: 0;
    justify-self: start;
    transition: width 280ms cubic-bezier(0.22, 1, 0.36, 1), max-width 280ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .workspace.has-card .catalog {
    width: calc((var(--catalog-card-w) * 3) + (var(--catalog-gap-x) * 2)) !important;
    max-width: calc((var(--catalog-card-w) * 3) + (var(--catalog-gap-x) * 2)) !important;
  }

  .section-wall {
    display: grid;
    grid-template-columns: repeat(5, var(--catalog-card-w)) !important;
    justify-content: start;
    gap: var(--catalog-gap-y) var(--catalog-gap-x) !important;
    width: 100%;
    max-width: 100%;
  }

  .workspace.has-card .section-wall {
    grid-template-columns: repeat(3, var(--catalog-card-w)) !important;
  }

  .movie-card,
  .workspace.has-card .movie-card {
    width: var(--catalog-card-w) !important;
    min-width: var(--catalog-card-w) !important;
    max-width: var(--catalog-card-w) !important;
  }

  .watch-panel {
    grid-column: 2;
    width: 100%;
    max-width: var(--watch-panel-w);
    min-width: 0;
    display: none;
    margin: 0;
    justify-self: start;
    opacity: 0;
    transform: translateY(12px) scale(0.985);
    transform-origin: top right;
    transition: opacity 280ms cubic-bezier(0.22, 1, 0.36, 1), transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .workspace:not(.has-card) .watch-panel {
    display: none !important;
    pointer-events: none;
  }

  .workspace.has-card .watch-panel {
    display: flex !important;
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: watch-panel-enter 280ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .watch-panel.card-closing,
  .workspace.has-card .watch-panel.card-closing {
    display: flex !important;
    animation: watch-panel-exit 180ms ease forwards !important;
  }
}


/* Final hero/body seam polish */
.screen-hero-stack::after,
.screen-hero-scrim {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.02) 0%,
    rgba(0, 0, 0, 0.05) 14%,
    rgba(0, 0, 0, 0.1) 28%,
    rgba(0, 0, 0, 0.2) 44%,
    rgba(8, 8, 10, 0.42) 62%,
    rgba(14, 14, 16, 0.72) 78%,
    rgba(20, 20, 22, 0.94) 92%,
    rgba(24, 24, 26, 1) 100%
  ) !important;
}

.screen-content {
  padding: 22px 22px 38px !important;
}

.watch-body {
  margin-top: -28px !important;
  padding: 30px 20px 22px !important;
  background: linear-gradient(
    180deg,
    rgba(24, 24, 26, 0.18) 0%,
    rgba(24, 24, 26, 0.78) 30px,
    rgba(24, 24, 26, 0.96) 72px,
    rgba(24, 24, 26, 1) 118px
  ) !important;
  position: relative;
  z-index: 3;
}

.watch-body::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -58px;
  height: 74px;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(24, 24, 26, 0) 0%,
    rgba(24, 24, 26, 0.16) 18%,
    rgba(24, 24, 26, 0.48) 48%,
    rgba(24, 24, 26, 0.82) 76%,
    rgba(24, 24, 26, 1) 100%
  );
}


/* Final poster fade + seam cleanup */
.poster::after {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 42%,
    rgba(0, 0, 0, 0.16) 58%,
    rgba(0, 0, 0, 0.46) 76%,
    rgba(0, 0, 0, 0.82) 100%
  ) !important;
}

.movie-card:hover .poster::after {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 34%,
    rgba(0, 0, 0, 0.12) 52%,
    rgba(0, 0, 0, 0.42) 72%,
    rgba(0, 0, 0, 0.9) 100%
  ) !important;
}

.screen-hero-stack::after,
.screen-hero-scrim {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.02) 0%,
    rgba(0, 0, 0, 0.05) 14%,
    rgba(0, 0, 0, 0.1) 28%,
    rgba(0, 0, 0, 0.18) 42%,
    rgba(8, 8, 10, 0.34) 56%,
    rgba(14, 14, 16, 0.58) 72%,
    rgba(20, 20, 22, 0.84) 88%,
    rgba(24, 24, 26, 0.98) 100%
  ) !important;
}

.screen-content {
  padding: 22px 22px 46px !important;
}

.watch-body {
  margin-top: -40px !important;
  padding: 42px 20px 22px !important;
  background: rgba(24, 24, 26, 1) !important;
  position: relative;
  z-index: 3;
}

.watch-body::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -82px;
  height: 102px;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(24, 24, 26, 0) 0%,
    rgba(24, 24, 26, 0.08) 14%,
    rgba(24, 24, 26, 0.24) 30%,
    rgba(24, 24, 26, 0.48) 50%,
    rgba(24, 24, 26, 0.74) 72%,
    rgba(24, 24, 26, 0.92) 88%,
    rgba(24, 24, 26, 1) 100%
  );
}


/* Final true poster-to-panel fade */
.poster::after {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 36%,
    rgba(0, 0, 0, 0.1) 52%,
    rgba(0, 0, 0, 0.34) 68%,
    rgba(0, 0, 0, 0.62) 82%,
    rgba(0, 0, 0, 0.88) 100%
  ) !important;
}

.movie-card:hover .poster::after {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 28%,
    rgba(0, 0, 0, 0.08) 46%,
    rgba(0, 0, 0, 0.28) 64%,
    rgba(0, 0, 0, 0.56) 80%,
    rgba(0, 0, 0, 0.92) 100%
  ) !important;
}

.screen {
  background: rgba(24, 24, 26, 1) !important;
}

.screen::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 136px;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(24, 24, 26, 0) 0%,
    rgba(24, 24, 26, 0.08) 16%,
    rgba(24, 24, 26, 0.22) 34%,
    rgba(24, 24, 26, 0.44) 54%,
    rgba(24, 24, 26, 0.72) 74%,
    rgba(24, 24, 26, 0.92) 90%,
    rgba(24, 24, 26, 1) 100%
  ) !important;
}

.screen-hero-stack::after,
.screen-hero-scrim {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.02) 0%,
    rgba(0, 0, 0, 0.04) 18%,
    rgba(0, 0, 0, 0.08) 34%,
    rgba(0, 0, 0, 0.16) 50%,
    rgba(0, 0, 0, 0.28) 66%,
    rgba(8, 8, 10, 0.44) 82%,
    rgba(24, 24, 26, 0.72) 100%
  ) !important;
}

.screen-content {
  position: relative;
  z-index: 4 !important;
  padding: 22px 22px 24px !important;
}

.watch-body {
  margin-top: -52px !important;
  padding: 52px 20px 22px !important;
  background: linear-gradient(
    180deg,
    rgba(24, 24, 26, 0) 0%,
    rgba(24, 24, 26, 0.18) 18px,
    rgba(24, 24, 26, 0.52) 46px,
    rgba(24, 24, 26, 0.84) 84px,
    rgba(24, 24, 26, 1) 132px
  ) !important;
  position: relative;
  z-index: 4;
}

.watch-body::before {
  content: none !important;
}


/* Final watch-body scroll boundary fix */
.screen::after {
  height: 172px !important;
  background: linear-gradient(
    180deg,
    rgba(24, 24, 26, 0) 0%,
    rgba(24, 24, 26, 0.06) 18%,
    rgba(24, 24, 26, 0.18) 36%,
    rgba(24, 24, 26, 0.36) 54%,
    rgba(24, 24, 26, 0.62) 72%,
    rgba(24, 24, 26, 0.86) 88%,
    rgba(24, 24, 26, 1) 100%
  ) !important;
}

.screen-content {
  padding: 22px 22px 30px !important;
}

.watch-body {
  margin-top: 0 !important;
  padding: 18px 20px 22px !important;
  background: rgba(24, 24, 26, 1) !important;
  position: relative;
  z-index: 2 !important;
}

.watch-body::before {
  content: none !important;
}


/* Final selected-card glow */
@keyframes selected-card-glow {
  0%, 100% {
    box-shadow:
      0 0 0 3px rgba(192, 132, 252, 0.94),
      0 0 0 7px rgba(168, 85, 247, 0.12),
      0 16px 46px rgba(0, 0, 0, 0.28);
  }
  50% {
    box-shadow:
      0 0 0 3px rgba(216, 180, 254, 0.98),
      0 0 0 9px rgba(168, 85, 247, 0.18),
      0 0 24px rgba(168, 85, 247, 0.18),
      0 20px 56px rgba(0, 0, 0, 0.34);
  }
}

.movie-card.active {
  border-color: rgba(192, 132, 252, 0.98) !important;
  box-shadow:
    0 0 0 3px rgba(192, 132, 252, 0.94),
    0 0 0 7px rgba(168, 85, 247, 0.12),
    0 16px 46px rgba(0, 0, 0, 0.28) !important;
  animation: selected-card-glow 2.6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .movie-card.active {
    animation: none !important;
  }
}


/* Final hero vertical align + softer active glow */
.screen-content {
  padding: 22px 22px 12px !important;
}

@keyframes selected-card-glow-soft {
  0%, 100% {
    box-shadow:
      0 0 0 2px rgba(196, 139, 255, 0.9),
      0 0 0 4px rgba(168, 85, 247, 0.08),
      0 0 12px rgba(168, 85, 247, 0.08),
      0 16px 44px rgba(0, 0, 0, 0.26);
  }
  50% {
    box-shadow:
      0 0 0 2px rgba(216, 180, 254, 0.96),
      0 0 0 4px rgba(168, 85, 247, 0.14),
      0 0 22px rgba(168, 85, 247, 0.2),
      0 18px 52px rgba(0, 0, 0, 0.3);
  }
}

.movie-card.active {
  border: 1px solid rgba(196, 139, 255, 0.18) !important;
  background: rgba(28, 28, 30, 0.64) !important;
  box-shadow:
    0 0 18px rgba(125, 165, 250, 0.24),
    0 16px 44px rgba(0, 0, 0, 0.26) !important;
  animation: selected-card-glow-soft 2.4s ease-in-out infinite !important;
  will-change: box-shadow;
}

.movie-card.active .card-strip {
  border-top-color: transparent !important;
}


/* Final hero meta placement + scroll boundary */
.screen-content {
  padding: 34px 22px 16px !important;
}

.screen-copy {
  display: grid;
  gap: 8px;
}

.screen-content .meta {
  margin: 6px 0 0 !important;
  color: rgba(235, 235, 245, 0.72) !important;
}

.watch-body {
  padding: 0 20px 22px !important;
}

.watch-panel .watch-ratings-compact {
  margin: 0 0 16px !important;
  padding-top: 16px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.11) !important;
}




/* Final long-title hero offset */
.screen-content.screen-content--long {
  padding-top: 76px !important;
}

.screen-content.screen-content--xlong {
  padding-top: 108px !important;
}


/* Final mini-card corner polish */
.movie-card {
  border-radius: 18px !important;
  overflow: hidden !important;
}

.poster,
.poster .poster-img,
.poster::after,
.poster-fallback,
.card-strip {
  border-radius: 0 !important;
}


/* Final selected outline static */
.movie-card.active {
  animation: none !important;
}


.legal-overlay {
  position: fixed;
  inset: 0;
  z-index: 108;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 3vw, 34px);
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(18px);
}

.legal-overlay.open {
  display: flex;
}

.legal-dialog {
  position: relative;
  width: min(640px, 100%);
  max-height: min(86vh, 820px);
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(18, 18, 20, 0.98);
  padding: 24px 22px 22px;
  box-shadow: 0 42px 140px rgba(0, 0, 0, 0.76);
}

.legal-close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: var(--btn-radius);
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #f2f2f2;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.legal-close-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.legal-kicker {
  margin: 0 52px 10px 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(235, 235, 245, 0.54);
}

.legal-dialog-title {
  margin: 0 52px 10px 0;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.04;
  font-weight: 860;
}

.legal-dialog-subtitle {
  margin: 0 52px 18px 0;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(235, 235, 245, 0.66);
}

.legal-dialog-body {
  display: grid;
  gap: 18px;
}

.legal-copy-stack,
.legal-faq-list {
  display: grid;
  gap: 16px;
}

.legal-dialog-body p,
.legal-dialog-body li {
  font-size: 14px;
  line-height: 1.62;
  color: rgba(245, 245, 247, 0.9);
}

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

.legal-info-card,
.legal-faq-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  padding: 15px 16px;
}

.legal-info-card--single {
  width: 100%;
}

.legal-info-card h3,
.legal-faq-item h3 {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.28;
  font-weight: 760;
  color: #fff;
}

.legal-info-card ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.legal-faq-item p {
  margin: 0;
}

.legal-support-contact {
  border: 1px solid rgba(168, 85, 247, 0.16);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.08), rgba(255, 255, 255, 0.03));
  padding: 16px;
}

.legal-support-label {
  margin: 0 0 8px;
  font-size: 12px !important;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(235, 235, 245, 0.56) !important;
}

.legal-support-link {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: 760;
  color: #fff;
  text-decoration: none;
}

.legal-support-link:hover {
  color: #d9c2ff;
}

.legal-inline-link {
  color: #e7d8ff;
  text-decoration: none;
  border-bottom: 1px solid rgba(231, 216, 255, 0.38);
  transition: color 160ms ease, border-color 160ms ease;
}

.legal-inline-link:hover {
  color: #ffffff;
  border-bottom-color: rgba(255, 255, 255, 0.66);
}

.legal-support-note {
  margin: 0;
  color: rgba(235, 235, 245, 0.66) !important;
}

@media (max-width: 720px) {
  .legal-dialog {
    padding: 20px 18px 18px;
    border-radius: 16px;
  }

  .legal-info-grid {
    grid-template-columns: 1fr;
  }
}


/* Final description toggle polish */
.description-toggle {
  margin-top: 10px !important;
  margin-bottom: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  min-height: 0 !important;
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  font-size: 13px !important;
  font-weight: 760 !important;
  line-height: 1.3 !important;
  color: rgba(235, 235, 245, 0.82) !important;
  transform: none !important;
}

.description-toggle::after {
  content: "›";
  display: inline-block;
  font-size: 18px;
  line-height: 1;
  color: rgba(168, 85, 247, 0.92);
  transform: rotate(90deg);
  transform-origin: 50% 50%;
  transition: transform 160ms ease, color 160ms ease;
}

.description-toggle[aria-expanded="true"]::after {
  transform: rotate(-90deg);
}

.description-toggle:hover {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  color: #ffffff !important;
  transform: none !important;
}

.description-toggle:hover::after {
  color: rgba(196, 139, 255, 0.98);
}


/* Final legal content typography */
.legal-info-card p {
  margin: 0 0 12px;
}

.legal-info-card p:last-child {
  margin-bottom: 0;
}

.legal-info-card ol,
.legal-info-card ul {
  margin: 0 0 12px;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.legal-support-contact p:not(.legal-support-label):not(.legal-support-note) {
  margin: 0 0 12px;
}


/* Final hero Kinopoisk link */
.hero-overline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-kp-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  color: rgba(235, 235, 245, 0.72);
  text-decoration: none;
  transition: color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.hero-kp-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}


/* Final bookmark drag reorder */
html.bookmark-drag-active {
  --bm-ease: cubic-bezier(0.32, 0.72, 0, 1);
  --bm-ease-soft: cubic-bezier(0.25, 0.1, 0.25, 1);
  /* Чуть короче — без «тяжеловесного» после ощущения */
  --bm-duration: 0.28s;
  --bm-duration-short: 0.16s;
}

.movie-card--bookmark-draggable,
.movie-card--bookmark-draggable * {
  -webkit-user-drag: none;
}

.movie-card--bookmark-draggable {
  cursor: grab !important;
  user-select: none;
}

.bookmark-drag-active .movie-card--bookmark-draggable {
  cursor: grabbing !important;
  margin-left: 0;
  margin-right: 0;
  transition:
    margin-left var(--bm-duration) var(--bm-ease),
    margin-right var(--bm-duration) var(--bm-ease),
    opacity var(--bm-duration-short) var(--bm-ease-soft),
    box-shadow var(--bm-duration-short) var(--bm-ease-soft),
    border-color var(--bm-duration-short) var(--bm-ease-soft),
    transform var(--bm-duration-short) var(--bm-ease-soft) !important;
}

.bookmark-drag-active .movie-card--bookmark-draggable:not(.is-dragging):not(.bookmark-drop-target):not(.bookmark-drop-neighbor) {
  opacity: 0.82;
}

.movie-card--bookmark-draggable.is-dragging {
  opacity: 0.1 !important;
  transform: none !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 0 0 1px rgba(255, 255, 255, 0.03) !important;
  background: rgba(18, 18, 22, 0.18) !important;
}

/* Разъём только у пары вокруг слота: margin (не translate) — верные границы для hit-test. */
.movie-card--bookmark-draggable.bookmark-drop-neighbor {
  opacity: 0.99 !important;
  margin-right: 16px !important;
}

.movie-card--bookmark-draggable.bookmark-drop-target {
  opacity: 1 !important;
  margin-left: 16px !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(255, 255, 255, 0.06) !important;
}

/* Позиция без анимации — сразу показывает «сюда встанет карточка». */
.bookmark-drop-slot {
  position: fixed;
  z-index: 249;
  width: 1px;
  border-radius: 999px;
  pointer-events: none;
  transition: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.015), 0 0 8px rgba(255, 255, 255, 0.04);
}

@keyframes bookmark-ghost-mount {
  from {
    opacity: 0;
    transform: scale(0.78);
  }
  to {
    opacity: 0.97;
    transform: scale(0.82);
  }
}

.bookmark-drag-ghost {
  position: fixed;
  z-index: 250;
  margin: 0 !important;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.97;
  transform: scale(0.82);
  transform-origin: left top;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.1);
  will-change: left, top;
  animation: bookmark-ghost-mount 0.14s var(--bm-ease) both;
}

@media (prefers-reduced-motion: reduce) {
  html.bookmark-drag-active {
    --bm-duration: 0.01ms;
    --bm-duration-short: 0.01ms;
  }

  .bookmark-drag-ghost {
    animation: none;
  }

  .movie-card--bookmark-draggable.bookmark-drop-neighbor,
  .movie-card--bookmark-draggable.bookmark-drop-target {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* Кнопки в шапке героя: у .watch-body был z-index выше .screen и отриц. margin — перекрывал область героя */
.watch-panel > .screen {
  position: relative;
  z-index: 2;
  /* Без isolate: в WebKit псевдо .screen::after (нижний fade) иногда композится поверх героя. Слой с watch-body удерживает z-index:0 внизу. */
}

/*
 * Герой выше .screen::after (z-index 1 у fade снизу экрана — см. .screen::after выше по файлу),
 * иначе псевдоэлемент рисуется поверх постера. Не занижать .screen::after до 0 — пропадает плавный переход к блоку описания.
 */
.watch-panel > .screen-hero-stack {
  position: relative;
  z-index: 3;
}

.watch-panel .screen-hero-stack .screen-bg-img,
.watch-panel .screen-hero-stack .screen-bg-fallback {
  z-index: 0 !important;
}

.watch-panel .screen-hero-stack .screen-hero-scrim {
  z-index: 1 !important;
}

.watch-panel .screen-hero-stack .screen-bottom-seam {
  z-index: 2 !important;
}

.screen-hero-controls {
  z-index: 50;
}

.watch-panel > .watch-body {
  z-index: 0 !important;
}

.watch-panel .screen-hero-stack .screen-content {
  position: relative;
  z-index: 30 !important;
  isolation: isolate;
}

#watchingCardBtn[hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Затемнение перенесено в .screen-hero-scrim — отключаем псевдо, чтобы не было двойного градиента и багов порядка слоёв */
.screen-hero-stack::after {
  content: none !important;
}

/* Тот же fade, что у .screen::after, вынесен в .screen-bottom-seam внутри героя — псевдо на .screen оставляем пустым, иначе в WebKit он снова ложится поверх текста. */
.watch-panel > .screen::after {
  content: none !important;
}

/* Final override: horizontal cards only for "Я смотрю" */
.content-section[data-section="watching"] .section-wall--watching-horizontal {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
}

.content-section[data-section="watching"] .watching-row-card {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  aspect-ratio: auto !important;
  display: grid !important;
  grid-template-columns: 92px minmax(0, 1fr) !important;
  align-items: stretch !important;
  border-radius: var(--movie-card-radius) !important;
  overflow: hidden !important;
  position: relative;
}

.content-section[data-section="watching"] .watching-row-card.active {
  overflow: visible !important; /* gradient outline is outside */
}

.content-section[data-section="watching"] .watching-row-card.active::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--movie-card-radius) + 2px);
  padding: 2px;
  background: linear-gradient(120deg, rgba(196, 139, 255, 0.98), rgba(96, 165, 250, 0.92));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 60;
}

.content-section[data-section="watching"] .watching-row-poster,
.content-section[data-section="watching"] .watching-row-poster .poster,
.content-section[data-section="watching"] .watching-row-poster .poster-bg,
.content-section[data-section="watching"] .watching-row-poster .poster-img,
.content-section[data-section="watching"] .watching-row-poster .poster-fallback {
  width: 92px !important;
  min-width: 92px !important;
  max-width: 92px !important;
  height: 96px !important;
  min-height: 96px !important;
  max-height: 96px !important;
}

.content-section[data-section="watching"] .watching-row-poster {
  border-radius: calc(var(--movie-card-radius) - 2px) 0 0 calc(var(--movie-card-radius) - 2px) !important;
  overflow: hidden !important;
}

.content-section[data-section="watching"] .watching-row-card .watching-row-poster .poster,
.content-section[data-section="watching"] .watching-row-card .watching-row-poster .poster .poster-img,
.content-section[data-section="watching"] .watching-row-card .watching-row-poster .poster::after,
.content-section[data-section="watching"] .watching-row-card .watching-row-poster .poster-fallback {
  border-radius: calc(var(--movie-card-radius) - 2px) 0 0 calc(var(--movie-card-radius) - 2px) !important;
}

.content-section[data-section="watching"] .watching-row-card > * {
  position: relative;
  z-index: 1;
}

/* Search highlight: same gradient + glow style */
.search {
  position: relative;
}

.search:focus-within {
  border: 2px solid transparent !important;
  border-color: transparent !important;
  background:
    linear-gradient(rgba(8, 8, 8, 0.98), rgba(8, 8, 8, 0.98)) padding-box,
    linear-gradient(120deg, rgba(196, 139, 255, 0.98), rgba(96, 165, 250, 0.92)) border-box !important;
  background-clip: padding-box, border-box !important;
  box-shadow: 0 0 18px rgba(125, 165, 250, 0.28), 0 10px 30px rgba(0, 0, 0, 0.22) !important;
}

.search:focus-within::after {
  content: none !important;
}

/* Inputs/selects highlight: same as search focus */
.field input:focus,
.field input:focus-visible,
.field select:focus,
.field select:focus-visible,
.auth-form input:focus,
.auth-form input:focus-visible,
.player-provider-select:focus,
.player-provider-select:focus-visible {
  border: 2px solid transparent !important;
  border-color: transparent !important;
  background:
    linear-gradient(rgba(8, 8, 8, 0.98), rgba(8, 8, 8, 0.98)) padding-box,
    linear-gradient(120deg, rgba(196, 139, 255, 0.98), rgba(96, 165, 250, 0.92)) border-box !important;
  background-clip: padding-box, border-box !important;
  box-shadow: 0 0 18px rgba(125, 165, 250, 0.28), 0 10px 30px rgba(0, 0, 0, 0.22) !important;
  outline: none !important;
}

@media (max-width: 1180px) {
  .watching-row-body {
    grid-template-columns: 220px 130px 120px 150px minmax(130px, 1fr);
    gap: 5px 5px;
  }

  .watching-row-titles {
    width: 220px;
    min-width: 220px;
    max-width: 220px;
  }
}

/* Final hard-fix: unified Apple-like card rounding */
:root {
  --movie-card-radius: 18px;
}

.movie-card,
.movie-card:hover {
  border-radius: var(--movie-card-radius) !important;
  overflow: hidden !important;
  position: relative;
}

.movie-card.active {
  border-radius: var(--movie-card-radius) !important;
  overflow: visible !important;
  position: relative;
}

.movie-card .poster {
  border-radius: 0 !important;
}

.movie-card .poster .poster-img,
.movie-card .poster::after,
.movie-card .poster-fallback {
  border-radius: 0 !important;
}

.movie-card .card-strip {
  border-radius: 0 !important;
}

.movie-card.active {
  border-color: rgba(235, 235, 245, 0.14) !important;
  background: rgba(28, 28, 30, 0.64) !important;
  background-clip: padding-box !important;
}

.movie-card.active .card-strip {
  border-top: 1px solid rgba(235, 235, 245, 0.08) !important;
  box-shadow: none !important;
}

.movie-card.active::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--movie-card-radius) + 2px);
  padding: 2px;
  background: linear-gradient(120deg, rgba(196, 139, 255, 0.98), rgba(96, 165, 250, 0.92));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.movie-card.active .poster {
  border-radius: var(--movie-card-radius) var(--movie-card-radius) 0 0 !important;
  overflow: hidden !important;
}

.movie-card.active .card-strip {
  border-radius: 0 0 var(--movie-card-radius) var(--movie-card-radius) !important;
  overflow: hidden !important;
}
