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

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

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

:root {
  /** Нативные контролы (Chrome/Edge на Windows): читаемый выпадающий список `<select>`. */
  color-scheme: dark;
  /** Тёмный «почти чёрный» серый фон страницы (без градиента). */
  --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.device-tv .movie-card,
body.device-tv .watch-panel,
body.device-tv .player-dialog,
body.device-tv .app-header {
  box-shadow: none !important;
}

body.device-tv .movie-card,
body.device-tv .movie-card:hover {
  transform: none !important;
  transition: none !important;
}

body.device-tv .movie-card:hover .poster::after {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.04) 46%, rgba(0, 0, 0, 0.82) 100%) !important;
}

body.device-tv .screen-hero-scrim,
body.device-tv .screen-bottom-seam,
body.device-tv .screen-hero-stack::after {
  display: none !important;
}

body.device-tv .player-overlay,
body.device-tv .auth-overlay,
body.device-tv .admin-overlay {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.device-tv .player-overlay {
  padding: 0;
  background: rgba(0, 0, 0, 0.96);
}

body.device-tv .player-dialog {
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
}

body.device-tv .fkwatch-frame {
  min-height: min(72vh, 640px);
}

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;
  }
}

/* Final mobile v360 override: this block intentionally lives last. */
@media (max-width: 820px) {
  html.device-mobile,
  body.device-mobile {
    background: #08080b !important;
  }

  body.device-mobile {
    background:
      linear-gradient(180deg, #101014 0, #08080b 190px, #050506 100%) !important;
  }

  body.device-mobile .app-header {
    isolation: isolate;
    overflow: visible;
    min-height: 124px !important;
    padding:
      max(10px, env(safe-area-inset-top))
      14px
      14px !important;
    background: linear-gradient(180deg, #101014 0%, rgba(16, 16, 20, 0.99) 62%, rgba(12, 12, 15, 0.96) 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow:
      0 16px 34px rgba(0, 0, 0, 0.34),
      0 1px 0 rgba(255, 255, 255, 0.04) inset !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body.device-mobile .app-header::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -120px;
    height: calc(100% + 120px);
    z-index: -1;
    background: linear-gradient(180deg, #101014 0%, #101014 54%, rgba(16, 16, 20, 0.94) 100%);
    pointer-events: none;
  }

  body.device-mobile .brand-logo-img {
    height: 43px !important;
  }

  body.device-mobile .search {
    width: 100%;
    min-height: 48px !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: center;
    padding: 4px 16px !important;
    border-radius: 999px !important;
    background: #1f1f24 !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 10px 26px rgba(0, 0, 0, 0.26) !important;
  }

  body.device-mobile .search.has-query {
    grid-template-columns: minmax(0, 1fr) 34px 76px !important;
    padding: 4px !important;
  }

  body.device-mobile .search input {
    min-width: 0;
    width: 100%;
    height: 38px !important;
    padding: 0 !important;
    color: #f5f5f7;
    font-size: 15px !important;
    font-weight: 520 !important;
  }

  body.device-mobile .search input::placeholder {
    color: rgba(245, 245, 247, 0.58);
    opacity: 1;
  }

  body.device-mobile .search.has-query input {
    padding-left: 10px !important;
  }

  body.device-mobile .search:not(.has-query) .search-clear-btn,
  body.device-mobile .search:not(.has-query) button[type="submit"] {
    display: none !important;
  }

  body.device-mobile .search .search-clear-btn {
    width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    border-radius: 999px !important;
  }

  body.device-mobile .search button[type="submit"] {
    width: 76px !important;
    min-width: 76px !important;
    height: 34px !important;
    min-height: 34px !important;
    border-radius: 999px !important;
    font-size: 14px !important;
  }

  body.device-mobile .workspace {
    padding-top: 140px !important;
  }

  body.device-mobile .section-wall,
  body.device-mobile .workspace.has-card .section-wall {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 16px 10px !important;
  }

  html.device-mobile.mobile-menu-open,
  body.device-mobile.mobile-menu-open {
    overflow: hidden !important;
  }

  body.device-mobile.mobile-menu-open .app-shell::before {
    z-index: 88 !important;
    opacity: 1 !important;
    background: rgba(0, 0, 0, 0.64) !important;
    transition: opacity 280ms ease !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body.device-mobile .catalog,
  body.device-mobile .watch-panel {
    transition:
      transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
      opacity 280ms ease,
      filter 280ms ease !important;
  }

  body.device-mobile.mobile-menu-open .catalog,
  body.device-mobile.mobile-menu-open .watch-panel {
    transform: translateX(22px) scale(0.975) !important;
    opacity: 0.38 !important;
    filter: saturate(0.72) brightness(0.78) !important;
  }

  body.device-mobile .rail-stack {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    bottom: 0 !important;
    z-index: 96 !important;
    width: min(88vw, 360px) !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: column;
    gap: 0 !important;
    padding:
      calc(max(16px, env(safe-area-inset-top)) + 68px)
      14px
      calc(max(22px, env(safe-area-inset-bottom)) + 36px) !important;
    border-radius: 0 30px 30px 0 !important;
    border: 0 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: #121215 !important;
    box-shadow:
      34px 0 80px rgba(0, 0, 0, 0.58),
      inset -1px 0 0 rgba(255, 255, 255, 0.05) !important;
    opacity: 1 !important;
    overflow: hidden !important;
    pointer-events: none;
    transform: translate3d(calc(-100% - 18px), 0, 0) !important;
    transition: transform 520ms cubic-bezier(0.22, 1, 0.36, 1) !important;
    will-change: transform;
  }

  body.device-mobile.mobile-menu-open .rail-stack {
    transform: translate3d(0, 0, 0) !important;
    pointer-events: auto;
  }

  body.device-mobile .rail-stack::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 170px),
      linear-gradient(90deg, transparent calc(100% - 1px), rgba(255, 255, 255, 0.14));
    pointer-events: none;
  }

  body.device-mobile .rail-stack > .rail {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-height: 0;
    width: 100% !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding: 0 0 20px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  body.device-mobile .rail-stack > .rail::-webkit-scrollbar {
    display: none;
  }

  body.device-mobile .rail-stack > .rail::before {
    content: "Меню";
    display: block;
    margin: 0 4px 20px 58px !important;
    color: #f5f5f7 !important;
    font-size: 28px !important;
    line-height: 42px !important;
    font-weight: 850 !important;
    letter-spacing: -0.01em !important;
    opacity: 1 !important;
    transform: none !important;
  }

  body.device-mobile .rail-block,
  body.device-mobile .rail-catalog-filters,
  body.device-mobile .rail-stack > .site-footer {
    opacity: 1 !important;
    transform: none !important;
  }

  body.device-mobile.mobile-menu-open .rail-stack > .rail::before,
  body.device-mobile.mobile-menu-open .rail-block,
  body.device-mobile.mobile-menu-open .rail-catalog-filters,
  body.device-mobile.mobile-menu-open .rail-stack > .site-footer {
    animation: mobileDrawerSectionIn 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  body.device-mobile.mobile-menu-open .rail-stack > .rail::before {
    animation-delay: 80ms;
  }

  body.device-mobile.mobile-menu-open .rail-block:nth-of-type(1) {
    animation-delay: 125ms;
  }

  body.device-mobile.mobile-menu-open .rail-block:nth-of-type(2) {
    animation-delay: 175ms;
  }

  body.device-mobile.mobile-menu-open .rail-catalog-filters {
    animation-delay: 225ms;
  }

  body.device-mobile.mobile-menu-open .rail-block.rail-block--mobile-only {
    animation-delay: 255ms;
  }

  body.device-mobile.mobile-menu-open .rail-stack > .site-footer {
    animation-delay: 300ms;
  }

  body.device-mobile .rail-block,
  body.device-mobile .rail-catalog-filters {
    margin: 0 0 12px !important;
    padding: 12px !important;
    border-radius: 22px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: #1b1b1f !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  }

  body.device-mobile .rail .segment {
    min-height: 44px !important;
    padding: 0 14px !important;
    border-radius: 15px !important;
    font-size: 15px !important;
    font-weight: 760 !important;
  }

  body.device-mobile .rail-catalog-filters {
    gap: 10px !important;
    padding-bottom: 14px !important;
  }

  body.device-mobile .rail-catalog-filters select,
  body.device-mobile #resetFilters {
    min-height: 44px !important;
    border-radius: 15px !important;
  }

  body.device-mobile .rail-stack > .site-footer {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    margin: 10px 0 0 !important;
    padding: 0 4px !important;
  }

  body.device-mobile.mobile-menu-open .app-header {
    z-index: 120 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-bottom-color: transparent !important;
    pointer-events: none;
  }

  body.device-mobile.mobile-menu-open .app-header::before,
  body.device-mobile.mobile-menu-open .app-header .brand,
  body.device-mobile.mobile-menu-open .app-header .search {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  body.device-mobile.mobile-menu-open .mobile-menu-toggle {
    position: fixed !important;
    top: max(18px, env(safe-area-inset-top)) !important;
    left: 18px !important;
    z-index: 130 !important;
    pointer-events: auto;
  }

  body.device-mobile.mobile-menu-open .app-header .auth-bar {
    position: fixed !important;
    left: max(14px, env(safe-area-inset-left, 0px)) !important;
    bottom: max(16px, env(safe-area-inset-bottom)) !important;
    z-index: 125 !important;
    display: grid !important;
    box-sizing: border-box !important;
    width: calc(
      min(88vw, 360px) - max(14px, env(safe-area-inset-left, 0px)) - max(14px, env(safe-area-inset-right, 0px))
    ) !important;
    grid-template-columns: 1fr !important;
    gap: 9px !important;
    padding: 10px !important;
    border-radius: 22px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: #19191d !important;
    box-shadow:
      0 -16px 36px rgba(0, 0, 0, 0.44),
      inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto;
    animation: mobileDrawerActionIn 420ms cubic-bezier(0.22, 1, 0.36, 1) 300ms both !important;
  }

  body.device-mobile.mobile-menu-open .auth-header-btn {
    width: 100% !important;
    justify-self: stretch !important;
    min-height: 46px !important;
    border-radius: 16px !important;
    font-size: 15px !important;
    font-weight: 820 !important;
  }

  body.performance-lite.device-mobile .rail-stack,
  body.performance-lite.device-mobile .mobile-menu-toggle,
  body.performance-lite.device-mobile .mobile-menu-toggle span,
  body.performance-lite.device-mobile .catalog,
  body.performance-lite.device-mobile .watch-panel,
  body.performance-lite.device-mobile .app-shell::before {
    transition-duration: 420ms !important;
  }
}

/* Mobile v361: lock the header background to the physical top safe area. */
@media (max-width: 820px) {
  html.device-mobile,
  body.device-mobile {
    background: #101014 !important;
  }

  body.device-mobile .app-shell {
    background: #050506 !important;
  }

  body.device-mobile .app-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 90 !important;
    min-height: calc(124px + env(safe-area-inset-top, 0px)) !important;
    padding-top: max(12px, env(safe-area-inset-top, 0px)) !important;
    background: linear-gradient(180deg, #101014 0%, #101014 44%, rgba(16, 16, 20, 0.99) 74%, rgba(12, 12, 15, 0.97) 100%) !important;
    transform: translateZ(0);
  }

  body.device-mobile .app-header::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(124px + env(safe-area-inset-top, 0px));
    z-index: -1;
    background: #101014;
    pointer-events: none;
  }

  body.device-mobile .workspace {
    padding-top: calc(140px + env(safe-area-inset-top, 0px)) !important;
  }

  body.device-mobile.mobile-menu-open .app-header {
    background: transparent !important;
  }
}

/* Mobile v360: clean header, full search text, 6x3 first wall, rebuilt drawer geometry. */
@media (max-width: 820px) {
  html.device-mobile,
  body.device-mobile {
    background: #08080b !important;
  }

  body.device-mobile {
    background:
      linear-gradient(180deg, #101014 0, #08080b 190px, #050506 100%) !important;
  }

  body.device-mobile .app-header {
    isolation: isolate;
    overflow: visible;
    min-height: 124px !important;
    padding:
      max(10px, env(safe-area-inset-top))
      14px
      14px !important;
    background: linear-gradient(180deg, #101014 0%, rgba(16, 16, 20, 0.99) 62%, rgba(12, 12, 15, 0.96) 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow:
      0 16px 34px rgba(0, 0, 0, 0.34),
      0 1px 0 rgba(255, 255, 255, 0.04) inset !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body.device-mobile .app-header::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -120px;
    height: calc(100% + 120px);
    z-index: -1;
    background: linear-gradient(180deg, #101014 0%, #101014 54%, rgba(16, 16, 20, 0.94) 100%);
    pointer-events: none;
  }

  body.device-mobile .brand-logo-img {
    height: 43px !important;
  }

  body.device-mobile .mobile-menu-toggle {
    width: 42px !important;
    height: 42px !important;
    border-radius: 15px !important;
  }

  body.device-mobile .search {
    width: 100%;
    min-height: 48px !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: center;
    padding: 4px 16px !important;
    border-radius: 999px !important;
    background: #1f1f24 !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 10px 26px rgba(0, 0, 0, 0.26) !important;
  }

  body.device-mobile .search.has-query {
    grid-template-columns: minmax(0, 1fr) 34px 76px !important;
    padding: 4px !important;
  }

  body.device-mobile .search input {
    min-width: 0;
    width: 100%;
    height: 38px !important;
    padding: 0 !important;
    color: #f5f5f7;
    font-size: 15px !important;
    font-weight: 520 !important;
  }

  body.device-mobile .search input::placeholder {
    color: rgba(245, 245, 247, 0.58);
    opacity: 1;
  }

  body.device-mobile .search.has-query input {
    padding-left: 10px !important;
  }

  body.device-mobile .search:not(.has-query) .search-clear-btn,
  body.device-mobile .search:not(.has-query) button[type="submit"] {
    display: none !important;
  }

  body.device-mobile .search .search-clear-btn {
    width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    border-radius: 999px !important;
  }

  body.device-mobile .search button[type="submit"] {
    width: 76px !important;
    min-width: 76px !important;
    height: 34px !important;
    min-height: 34px !important;
    border-radius: 999px !important;
    font-size: 14px !important;
  }

  body.device-mobile .workspace {
    padding-top: 140px !important;
  }

  body.device-mobile .section-wall,
  body.device-mobile .workspace.has-card .section-wall {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 16px 10px !important;
  }

  body.device-mobile .movie-card,
  body.device-mobile .workspace.has-card .movie-card {
    min-width: 0 !important;
  }

  html.device-mobile.mobile-menu-open,
  body.device-mobile.mobile-menu-open {
    overflow: hidden !important;
  }

  body.device-mobile.mobile-menu-open .app-shell::before {
    z-index: 88 !important;
    opacity: 1 !important;
    background: rgba(0, 0, 0, 0.64) !important;
    transition: opacity 280ms ease !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body.device-mobile .catalog,
  body.device-mobile .watch-panel {
    transition:
      transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
      opacity 280ms ease,
      filter 280ms ease !important;
  }

  body.device-mobile.mobile-menu-open .catalog,
  body.device-mobile.mobile-menu-open .watch-panel {
    transform: translateX(22px) scale(0.975) !important;
    opacity: 0.38 !important;
    filter: saturate(0.72) brightness(0.78) !important;
  }

  body.device-mobile .rail-stack {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    bottom: 0 !important;
    z-index: 96 !important;
    width: min(88vw, 360px) !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: column;
    gap: 0 !important;
    padding:
      calc(max(16px, env(safe-area-inset-top)) + 68px)
      14px
      calc(max(22px, env(safe-area-inset-bottom)) + 36px) !important;
    border-radius: 0 30px 30px 0 !important;
    border: 0 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: #121215 !important;
    box-shadow:
      34px 0 80px rgba(0, 0, 0, 0.58),
      inset -1px 0 0 rgba(255, 255, 255, 0.05) !important;
    opacity: 1 !important;
    overflow: hidden !important;
    pointer-events: none;
    transform: translate3d(calc(-100% - 18px), 0, 0) !important;
    transition: transform 520ms cubic-bezier(0.22, 1, 0.36, 1) !important;
    will-change: transform;
  }

  body.device-mobile.mobile-menu-open .rail-stack {
    transform: translate3d(0, 0, 0) !important;
    pointer-events: auto;
  }

  body.device-mobile .rail-stack::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 170px),
      linear-gradient(90deg, transparent calc(100% - 1px), rgba(255, 255, 255, 0.14));
    pointer-events: none;
  }

  body.device-mobile .rail-stack > .rail {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-height: 0;
    width: 100% !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding: 0 0 20px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  body.device-mobile .rail-stack > .rail::-webkit-scrollbar {
    display: none;
  }

  body.device-mobile .rail-stack > .rail::before {
    content: "Меню";
    display: block;
    margin: 0 4px 20px 58px !important;
    color: #f5f5f7 !important;
    font-size: 28px !important;
    line-height: 42px !important;
    font-weight: 850 !important;
    letter-spacing: -0.01em !important;
    opacity: 1 !important;
    transform: none !important;
  }

  body.device-mobile .rail-block,
  body.device-mobile .rail-catalog-filters,
  body.device-mobile .rail-stack > .site-footer {
    opacity: 1 !important;
    transform: none !important;
  }

  body.device-mobile.mobile-menu-open .rail-stack > .rail::before,
  body.device-mobile.mobile-menu-open .rail-block,
  body.device-mobile.mobile-menu-open .rail-catalog-filters,
  body.device-mobile.mobile-menu-open .rail-stack > .site-footer {
    animation: mobileDrawerSectionIn 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  body.device-mobile.mobile-menu-open .rail-stack > .rail::before {
    animation-delay: 80ms;
  }

  body.device-mobile.mobile-menu-open .rail-block:nth-of-type(1) {
    animation-delay: 125ms;
  }

  body.device-mobile.mobile-menu-open .rail-block:nth-of-type(2) {
    animation-delay: 175ms;
  }

  body.device-mobile.mobile-menu-open .rail-catalog-filters {
    animation-delay: 225ms;
  }

  body.device-mobile.mobile-menu-open .rail-block.rail-block--mobile-only {
    animation-delay: 255ms;
  }

  body.device-mobile.mobile-menu-open .rail-stack > .site-footer {
    animation-delay: 300ms;
  }

  body.device-mobile .rail-block,
  body.device-mobile .rail-catalog-filters {
    margin: 0 0 12px !important;
    padding: 12px !important;
    border-radius: 22px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: #1b1b1f !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  }

  body.device-mobile .rail .segment {
    min-height: 44px !important;
    padding: 0 14px !important;
    border-radius: 15px !important;
    font-size: 15px !important;
    font-weight: 760 !important;
  }

  body.device-mobile .rail-catalog-filters {
    gap: 10px !important;
    padding-bottom: 14px !important;
  }

  body.device-mobile .rail-catalog-filters select,
  body.device-mobile #resetFilters {
    min-height: 44px !important;
    border-radius: 15px !important;
  }

  body.device-mobile .rail-stack > .site-footer {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    margin: 10px 0 0 !important;
    padding: 0 4px !important;
  }

  body.device-mobile.mobile-menu-open .app-header {
    z-index: 120 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-bottom-color: transparent !important;
    pointer-events: none;
  }

  body.device-mobile.mobile-menu-open .app-header::before,
  body.device-mobile.mobile-menu-open .app-header .brand,
  body.device-mobile.mobile-menu-open .app-header .search {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  body.device-mobile.mobile-menu-open .mobile-menu-toggle {
    position: fixed !important;
    top: max(18px, env(safe-area-inset-top)) !important;
    left: 18px !important;
    z-index: 130 !important;
    pointer-events: auto;
  }

  body.device-mobile.mobile-menu-open .app-header .auth-bar {
    position: fixed !important;
    left: max(14px, env(safe-area-inset-left, 0px)) !important;
    bottom: max(16px, env(safe-area-inset-bottom)) !important;
    z-index: 125 !important;
    display: grid !important;
    box-sizing: border-box !important;
    width: calc(
      min(88vw, 360px) - max(14px, env(safe-area-inset-left, 0px)) - max(14px, env(safe-area-inset-right, 0px))
    ) !important;
    grid-template-columns: 1fr !important;
    gap: 9px !important;
    padding: 10px !important;
    border-radius: 22px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: #19191d !important;
    box-shadow:
      0 -16px 36px rgba(0, 0, 0, 0.44),
      inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto;
    animation: mobileDrawerActionIn 420ms cubic-bezier(0.22, 1, 0.36, 1) 300ms both !important;
  }

  body.device-mobile.mobile-menu-open .auth-header-btn {
    width: 100% !important;
    justify-self: stretch !important;
    min-height: 46px !important;
    border-radius: 16px !important;
    font-size: 15px !important;
    font-weight: 820 !important;
  }

  body.performance-lite.device-mobile .rail-stack,
  body.performance-lite.device-mobile .mobile-menu-toggle,
  body.performance-lite.device-mobile .mobile-menu-toggle span,
  body.performance-lite.device-mobile .catalog,
  body.performance-lite.device-mobile .watch-panel,
  body.performance-lite.device-mobile .app-shell::before {
    transition-duration: 420ms !important;
  }
}

@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;
}

/** Без явных цветов опций native dropdown на Windows может показывать светлый блок без текста. */
select option {
  background-color: var(--panel-3);
  color: var(--text);
}

.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;
}

.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;
  }
}

/* Admin structure correction */
.admin-card,
.admin-card-head,
.admin-create-form,
.admin-password-form,
.admin-session-tools,
.admin-profile-details,
.admin-user-list {
  text-align: left;
}

.admin-card-head {
  display: block;
  width: 100%;
}

.admin-card-head .admin-section-kicker,
.admin-card-head .admin-card-title {
  display: block;
  width: 100%;
  text-align: left;
}

.admin-users-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  text-align: left;
}

.admin-users-head .admin-section-kicker,
.admin-users-head .admin-card-title {
  text-align: left;
}

.admin-card-title {
  margin-top: 0;
}

.admin-ops-column {
  align-items: start;
}

.admin-card {
  min-height: 0;
}

.admin-card--create {
  min-height: 174px;
}

.admin-card--security {
  min-height: 282px;
}

.admin-card--sessions {
  min-height: 174px;
}

.admin-card--maintenance {
  min-height: 174px;
}

.admin-maintenance-desc {
  margin: 0 0 14px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: rgba(230, 224, 255, 0.68);
}

.admin-maintenance-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  cursor: pointer;
  user-select: none;
}

.admin-maintenance-switch input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: rgba(155, 125, 255, 0.95);
}

.admin-card--sessions .admin-logout-others-btn {
  margin-top: 6px;
}

.admin-card--users {
  margin-top: 0;
}

/* Admin panel rebuild */
.admin-overlay {
  background:
    radial-gradient(circle at 18% 0%, rgba(150, 44, 94, 0.2), transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(72, 116, 190, 0.14), transparent 32%),
    rgba(0, 0, 0, 0.84);
}

.admin-dialog {
  width: min(1160px, calc(100vw - 30px));
  max-height: min(92vh, 860px);
  padding: 26px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(18, 18, 20, 0.98), rgba(8, 8, 9, 0.99)),
    #09090a;
}

.admin-close-btn {
  top: 22px;
  right: 22px;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  font-size: 32px;
}

.admin-hero {
  min-height: 86px;
  padding: 2px 74px 0 0;
}

.admin-dialog-title {
  font-size: clamp(34px, 4vw, 54px);
  letter-spacing: 0;
}

.admin-dialog-subtitle {
  max-width: 760px;
  font-size: 15px;
}

.admin-stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.admin-stat {
  min-height: 122px;
  padding: 18px;
  border-radius: 14px;
  border-color: rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
}

.admin-stat span {
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.12em;
}

.admin-stat strong {
  font-size: clamp(30px, 4vw, 48px);
}

.admin-stat small {
  color: rgba(255, 255, 255, 0.56);
  font-size: 12px;
}

.admin-stat--profiles {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 1px rgba(255, 107, 154, 0.06);
}

.admin-stat--cache {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.035)),
    radial-gradient(circle at 100% 0%, rgba(255, 199, 87, 0.14), transparent 42%);
}

.admin-system-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
  margin: 12px 0 16px;
  padding: 0;
  border: 0;
  background: transparent;
}

.admin-system-line span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.065);
  color: rgba(255, 255, 255, 0.58);
}

.admin-system-line strong {
  margin-left: 5px;
  color: #fff;
}

.admin-layout {
  grid-template-columns: 1fr;
  gap: 14px;
}

.admin-ops-column {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr) minmax(240px, 0.7fr);
  gap: 14px;
}

.admin-card {
  padding: 18px;
  border-radius: 14px;
  border-color: rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.028));
}

.admin-card--create,
.admin-card--security,
.admin-card--sessions,
.admin-card--users {
  grid-column: auto;
}

.admin-card--users {
  padding: 18px;
}

.admin-card-head,
.admin-users-head {
  align-items: center;
  margin-bottom: 16px;
}

.admin-card-head {
  flex-direction: column;
  align-items: flex-start;
}

.admin-users-head {
  flex-direction: row;
}

.admin-card-title {
  font-size: 20px;
}

.admin-create-form {
  grid-template-columns: minmax(0, 1fr) minmax(190px, 230px);
  grid-template-areas:
    "label label"
    "input button";
  gap: 12px;
}

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

.admin-create-label,
.admin-field {
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  letter-spacing: 0.14em;
}

.admin-create-input,
.admin-field input {
  height: 52px !important;
  min-height: 52px !important;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.34);
}

.admin-create-submit,
.admin-password-submit,
.admin-logout-others-btn {
  height: 52px !important;
  min-height: 52px !important;
  border-radius: 999px;
  font-size: 14px !important;
}

.admin-password-submit {
  width: 100%;
}

.admin-created-password {
  margin-top: 14px;
  padding: 14px;
}

.admin-share-message {
  margin: 10px 0 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.34);
  white-space: pre-wrap;
}

.admin-copy-message {
  min-height: 40px !important;
  border-radius: 999px;
}

.admin-refresh-btn,
.admin-profile-close,
.admin-view-user,
.admin-delete-user {
  border-radius: 999px;
}

.admin-user-list {
  gap: 10px;
}

.admin-user-table-head,
.admin-user-row {
  grid-template-columns: minmax(230px, 1.15fr) minmax(250px, 1fr) minmax(130px, 0.65fr) minmax(190px, auto);
  gap: 14px;
}

.admin-user-table-head {
  padding: 0 14px 4px;
}

.admin-user-row {
  min-height: 76px;
  padding: 12px 14px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.03));
}

.admin-user-row--admin {
  border-color: rgba(255, 173, 206, 0.24);
}

.admin-user-main {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.admin-user-avatar {
  display: inline-flex;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 900;
}

.admin-user-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.admin-user-copy strong,
.admin-user-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-user-stats span {
  border-radius: 999px;
  padding: 7px 10px;
}

.admin-user-actions {
  display: flex;
}

.admin-view-user,
.admin-delete-user {
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 14px !important;
}

.admin-profile-details {
  margin: 0 0 14px;
  padding: 16px;
  border-radius: 14px;
}

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

.admin-profile-head h3 {
  margin: 0;
  color: #fff;
  font-size: 24px;
}

.admin-profile-stats {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}

.admin-profile-stats span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

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

.admin-profile-columns h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.58);
}

.admin-profile-columns li {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
}

.admin-profile-columns li span {
  color: #fff;
  font-weight: 750;
}

.admin-profile-columns li small {
  color: rgba(255, 255, 255, 0.48);
}

/* Admin dashboard: two-column workbench override */
.admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr) !important;
  align-items: start;
  gap: 12px;
}

.admin-ops-column {
  display: grid;
  grid-template-columns: 1fr !important;
  align-items: start;
  gap: 12px;
}

.admin-card--create,
.admin-card--security,
.admin-card--sessions,
.admin-card--users {
  grid-column: auto !important;
}

.admin-card,
.admin-card-head,
.admin-users-head,
.admin-create-form,
.admin-password-form,
.admin-session-tools {
  text-align: left !important;
}

.admin-card-head {
  display: block;
}

.admin-users-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.admin-card-title,
.admin-section-kicker {
  text-align: left !important;
}

.admin-card--users {
  padding: 16px;
}

.admin-user-row {
  min-height: 64px;
  padding: 10px 12px;
}

@media (max-width: 1100px) {
  .admin-layout {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 1040px) {
  .admin-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-ops-column {
    grid-template-columns: 1fr;
  }

  .admin-create-form {
    grid-template-columns: minmax(0, 1fr) minmax(210px, 260px);
  }

  .admin-user-table-head {
    display: none;
  }

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

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

@media (max-width: 700px) {
  .admin-dialog {
    width: calc(100vw - 16px);
    padding: 18px;
    border-radius: 14px;
  }

  .admin-close-btn {
    width: 44px;
    height: 44px;
  }

  .admin-stats-grid,
  .admin-create-form,
  .admin-profile-columns {
    grid-template-columns: 1fr;
  }

  .admin-create-form {
    grid-template-areas:
      "label"
      "input"
      "button";
  }

  .admin-user-actions {
    flex-direction: column;
  }
}

/* Admin dashboard final structure */
.admin-dialog {
  width: min(1280px, calc(100vw - 64px));
  max-height: min(90vh, 820px);
  padding: 22px;
  border-radius: 16px;
}

.admin-close-btn {
  top: 18px;
  right: 18px;
  width: 48px;
  height: 48px;
  font-size: 30px;
}

.admin-hero {
  min-height: 0;
  padding-right: 64px;
}

.admin-kicker {
  margin-bottom: 8px;
}

.admin-dialog-title {
  font-size: clamp(32px, 3.2vw, 46px);
  line-height: 0.95;
}

.admin-dialog-subtitle {
  margin-top: 10px;
  font-size: 14px;
}

.admin-stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.admin-stat {
  min-height: 88px;
  padding: 14px 16px;
  border-radius: 12px;
  align-content: space-between;
}

.admin-stat strong {
  font-size: clamp(28px, 3vw, 42px);
}

.admin-stat small {
  font-size: 11px;
}

.admin-system-line {
  margin: 10px 0 14px;
}

.admin-system-line span {
  min-height: 30px;
  font-size: 12px;
}

.admin-layout {
  gap: 12px;
}

.admin-ops-column {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}

.admin-card {
  align-self: start;
  padding: 16px;
  border-radius: 12px;
}

.admin-card--create {
  grid-column: span 5;
}

.admin-card--security {
  grid-column: span 4;
}

.admin-card--sessions {
  grid-column: span 3;
}

.admin-card--users {
  grid-column: 1 / -1;
  padding: 16px;
}

.admin-card-head,
.admin-users-head {
  margin-bottom: 14px;
}

.admin-card-title {
  font-size: 18px;
}

.admin-section-kicker,
.admin-create-label,
.admin-field {
  font-size: 10px;
  letter-spacing: 0.15em;
}

.admin-create-form {
  grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
  grid-template-areas:
    "label label"
    "input button";
  align-items: end;
  gap: 10px 12px;
}

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

.admin-session-tools {
  grid-template-columns: 1fr;
  gap: 10px;
}

.admin-create-input,
.admin-field input,
.admin-create-submit,
.admin-password-submit,
.admin-logout-others-btn {
  height: 46px !important;
  min-height: 46px !important;
}

.admin-create-input,
.admin-field input {
  margin-top: 8px;
}

.admin-create-submit,
.admin-password-submit,
.admin-logout-others-btn {
  padding: 0 18px !important;
  font-size: 13px !important;
}

.admin-card--sessions .admin-session-tools {
  padding-top: 4px;
}

.admin-card--sessions .admin-logout-others-btn {
  white-space: normal;
}

.admin-user-table-head,
.admin-user-row {
  grid-template-columns: minmax(220px, 1.15fr) minmax(230px, 0.9fr) minmax(130px, 0.55fr) minmax(170px, auto);
}

.admin-user-table-head {
  padding: 0 12px 4px;
}

.admin-user-row {
  min-height: 64px;
  padding: 10px 12px;
  border-radius: 12px;
}

.admin-user-avatar {
  flex-basis: 38px;
  width: 38px;
  height: 38px;
}

.admin-user-stats span {
  padding: 6px 9px;
  font-size: 12px;
}

.admin-view-user,
.admin-delete-user,
.admin-refresh-btn {
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 13px !important;
  font-size: 12px !important;
}

.admin-profile-details {
  padding: 14px;
}

@media (max-width: 1180px) {
  .admin-card--create,
  .admin-card--security,
  .admin-card--sessions {
    grid-column: 1 / -1;
  }

  .admin-create-form {
    grid-template-columns: minmax(0, 1fr) minmax(190px, 240px);
  }
}

@media (max-width: 820px) {
  .admin-dialog {
    width: calc(100vw - 18px);
    padding: 18px;
  }

  .admin-stats-grid,
  .admin-create-form,
  .admin-user-row {
    grid-template-columns: 1fr;
  }

  .admin-create-form {
    grid-template-areas:
      "label"
      "input"
      "button";
  }
}

/* Admin dashboard: final layout pass */
.admin-dialog {
  width: min(1320px, calc(100vw - 56px));
  max-height: min(90vh, 840px);
  padding: 22px;
}

.admin-dialog-title {
  font-size: clamp(32px, 3vw, 44px);
}

.admin-stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.admin-stat {
  min-height: 88px;
  padding: 14px 16px;
}

.admin-stat strong {
  font-size: clamp(28px, 3vw, 40px);
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.admin-ops-column {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 12px;
}

.admin-card,
.admin-card-head,
.admin-create-form,
.admin-password-form,
.admin-session-tools,
.admin-profile-details,
.admin-user-list {
  text-align: left;
}

.admin-card {
  min-height: 0;
  padding: 16px;
  border-radius: 12px;
}

.admin-card--create,
.admin-card--security,
.admin-card--sessions,
.admin-card--users {
  grid-column: auto;
}

.admin-card-head {
  display: block;
  width: 100%;
  margin-bottom: 14px;
}

.admin-card-head .admin-section-kicker,
.admin-card-head .admin-card-title,
.admin-users-head .admin-section-kicker,
.admin-users-head .admin-card-title {
  display: block;
  width: 100%;
  text-align: left;
}

.admin-users-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.admin-card-title {
  margin: 0;
  font-size: 18px;
}

.admin-create-form {
  grid-template-columns: minmax(0, 1fr) minmax(170px, 220px);
  grid-template-areas:
    "label label"
    "input button";
  align-items: end;
  gap: 10px 12px;
}

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

.admin-create-input,
.admin-field input,
.admin-create-submit,
.admin-password-submit,
.admin-logout-others-btn {
  height: 46px !important;
  min-height: 46px !important;
}

.admin-create-input,
.admin-field input {
  margin-top: 8px;
}

.admin-create-submit,
.admin-password-submit,
.admin-logout-others-btn {
  padding: 0 18px !important;
  font-size: 13px !important;
}

.admin-card--users {
  grid-column: auto;
  padding: 16px;
}

.admin-user-table-head,
.admin-user-row {
  grid-template-columns: minmax(170px, 1.1fr) minmax(170px, 0.85fr) minmax(100px, 0.45fr) minmax(104px, auto) !important;
}

.admin-user-row {
  min-height: 64px;
  padding: 10px 12px;
}

.admin-user-avatar {
  flex-basis: 38px;
  width: 38px;
  height: 38px;
}

.admin-view-user,
.admin-delete-user,
.admin-refresh-btn {
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 13px !important;
  font-size: 12px !important;
}

@media (max-width: 1100px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .admin-dialog {
    width: calc(100vw - 18px);
  }

  .admin-stats-grid,
  .admin-create-form,
  .admin-user-row {
    grid-template-columns: 1fr;
  }

  .admin-create-form {
    grid-template-areas:
      "label"
      "input"
      "button";
  }
}

.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 {
  display: none !important;
  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 {
  display: none !important;
  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: 1px solid rgba(255, 255, 255, 0.85);
  background: linear-gradient(180deg, #ffffff 0%, #f2f3f7 100%);
  color: #12131a;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.32));
  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: linear-gradient(180deg, #ffffff 0%, #eceef5 100%);
  transform: scale(1.05);
}

.watch-tool-btn:active {
  background: linear-gradient(180deg, #f5f6fb 0%, #e6e8f0 100%);
  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: rgba(255, 195, 221, 0.96);
  background: linear-gradient(180deg, #ff79b0 0%, #ff4f98 100%);
  box-shadow:
    0 0 0 1px rgba(255, 190, 218, 0.44),
    0 0 20px rgba(255, 100, 164, 0.58),
    0 10px 28px rgba(0, 0, 0, 0.36);
  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: rgba(170, 255, 242, 0.9);
  background: linear-gradient(180deg, #2fe6ca 0%, #18c3ad 100%);
  box-shadow:
    0 0 0 1px rgba(152, 248, 233, 0.45),
    0 0 20px rgba(55, 230, 203, 0.48),
    0 10px 28px rgba(0, 0, 0, 0.36);
  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-tool-close {
  border-color: rgba(255, 255, 255, 0.88);
  background: linear-gradient(180deg, #ffffff 0%, #eff1f7 100%);
  color: #12131a;
}

.watch-hero-statusline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  flex: 1 1 auto;
  min-height: 44px;
  pointer-events: auto;
}

.watch-mobile-meta-status--top .watch-status-badge {
  margin-left: 0 !important;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border-width: 1px;
}

.watch-mobile-meta-status--top .watch-status-badge.is-complete {
  color: #ffffff;
  background: linear-gradient(180deg, #24a25e 0%, #1d8a4f 100%);
  border-color: #5fd18f;
  box-shadow:
    0 0 0 1px rgba(95, 209, 143, 0.3),
    0 0 18px rgba(42, 181, 105, 0.38);
}

.watch-mobile-meta-status--top .watch-status-badge.is-ongoing {
  color: #1d1500;
  background: linear-gradient(180deg, #ffd85a 0%, #f5bf1e 100%);
  border-color: #ffe48d;
  box-shadow:
    0 0 0 1px rgba(255, 223, 120, 0.34),
    0 0 18px rgba(255, 205, 73, 0.42);
}

.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-img.screen-bg-img--poster {
  object-fit: cover;
  object-position: center top;
}

.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(980px, 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) minmax(0, 1fr) minmax(220px, 240px);
  grid-template-areas:
    "label label ."
    "input input button";
  align-items: end;
  gap: 14px;
}

.admin-create-submit {
  grid-area: button;
}

.admin-create-label {
  grid-area: label;
  min-width: 0;
  font-size: 11px;
  letter-spacing: 0.13em;
  color: #b6b6b6;
  text-transform: uppercase;
}

.admin-create-input {
  grid-area: input;
  width: 100%;
  height: 44px !important;
  min-height: 44px !important;
  border-radius: 10px;
}

.admin-password-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(220px, 240px);
  align-items: start;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.admin-field {
  display: grid;
  align-content: end;
  min-width: 0;
  font-size: 11px;
  letter-spacing: 0.13em;
}

.admin-password-form .admin-field {
  grid-template-rows: 14px 44px;
  line-height: 14px;
}

.admin-password-form .admin-field input {
  margin-top: 0;
}

.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%;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 14px !important;
  border-radius: 10px;
  font-size: 13px !important;
  white-space: nowrap;
  align-self: start;
  margin-top: 24px;
}

.admin-session-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(220px, 240px);
  gap: 10px 14px;
  margin: -6px 0 16px;
  padding: 12px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-logout-others-btn {
  grid-column: 1 / -1;
  width: 100%;
}

.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) 180px 180px;
  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 {
  justify-self: end;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.admin-user-actions {
  justify-self: end;
  justify-content: flex-end;
}

.admin-view-user,
.admin-delete-user {
  height: 34px !important;
  min-height: 34px !important;
  min-width: 86px;
  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-form .admin-field,
  .admin-create-submit {
    grid-column: auto;
  }

  .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;
  }
}

@media (max-width: 900px) {
  .admin-password-form {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .admin-create-form {
    grid-template-columns: 1fr;
    grid-template-areas:
      "label"
      "input"
      "button";
  }

  .admin-create-submit {
    grid-column: auto;
  }

  .admin-session-tools {
    grid-template-columns: 1fr;
  }

  .admin-password-submit {
    width: 100%;
  }

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

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

.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;
}

/* Крестик закрытия в модалке плеера видим и доступен с пульта/мыши. */
.player-dialog .close-player {
  display: grid;
  place-items: center;
}

.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;
  justify-items: center;
  text-align: center;
}

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

.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);
  text-align: center;
  max-width: 42rem;
}

.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;
}

.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;
}

/* Только мобильный клиент: блок «Инструкции» в выезжающем меню. */
html:not(.device-mobile) .rail-block--mobile-only {
  display: none !important;
}

.rail .rail-instructions-btn {
  width: 100%;
  box-sizing: border-box;
}

.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 h4.legal-inline-subheading {
  margin: 14px 0 8px;
  font-size: 13px;
  line-height: 1.38;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: rgba(235, 235, 245, 0.9);
}

.legal-info-card h3 + .legal-inline-subheading {
  margin-top: 4px;
}

.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,
.watch-panel .screen-hero-stack .mobile-inline-player--poster-slot {
  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;
}

/* Adaptive compact mode for smaller screens: shrink UI proportionally. */
@media (max-width: 1440px), (max-height: 900px) {
  :root {
    --page-pad-x: clamp(12px, 1.6vw, 24px);
    --layout-gap: 14px;
    --sticky-below-header: 98px;
  }

  .app-shell {
    --sidebar-w: 224px !important;
  }

  .brand-logo-img {
    height: clamp(50px, 6.9vw, 74px) !important;
  }

  .rail {
    padding: 12px !important;
  }

  .rail .segment,
  .rail select,
  .rail .ghost-button {
    min-height: 38px !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    font-size: 13px !important;
  }

  .search input {
    height: 36px !important;
    font-size: 13px !important;
  }

  .section-wall {
    --card-width: clamp(132px, 9.2vw, 162px) !important;
    gap: 14px !important;
  }
}

@media (max-width: 1280px), (max-height: 780px) {
  :root {
    --page-pad-x: clamp(10px, 1.2vw, 18px);
    --layout-gap: 10px;
    --sticky-below-header: 90px;
  }

  .app-shell {
    --sidebar-w: 202px !important;
  }

  .app-header {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
  }

  .brand-logo-img {
    height: clamp(44px, 6.1vw, 64px) !important;
  }

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

  .rail-section-title {
    margin-bottom: 6px !important;
    font-size: 9px !important;
  }

  .rail-block,
  .field {
    margin-bottom: 12px !important;
  }

  .section-wall {
    --card-width: clamp(120px, 8.4vw, 148px) !important;
    gap: 12px !important;
  }
}

/* If left rail is taller than viewport, allow independent scrolling. */
.rail {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

@media (min-width: 821px) {
  .rail {
    max-height: calc(100vh - var(--sticky-below-header) - 12px) !important;
  }
}

@media (max-width: 820px) {
  .rail {
    max-height: calc(100vh - var(--sticky-below-header) - 8px) !important;
  }
}

/* Admin panel redesign: card-based layout and clearer flow. */
.admin-dialog {
  width: min(1040px, 100%);
  max-height: min(92vh, 820px);
}

.admin-dialog-subtitle {
  max-width: 760px;
}

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

.admin-card {
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 14px;
  min-width: 0;
}

.admin-card--security,
.admin-card--sessions {
  grid-column: span 6;
}

.admin-card--create,
.admin-card--users {
  grid-column: 1 / -1;
}

.admin-card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.admin-card-note {
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.admin-password-form {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.admin-password-submit {
  margin-top: 0;
  align-self: stretch;
}

.admin-session-tools {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.admin-logout-others-btn {
  grid-column: auto;
}

.admin-password-status {
  margin: 0;
}

.admin-create-form {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  grid-template-areas:
    "label label"
    "input button";
  align-items: end;
  gap: 10px 12px;
}

.admin-created-password {
  margin-top: 12px;
}

.admin-error {
  margin-top: 10px;
}

.admin-users-head {
  margin-bottom: 10px;
}

.admin-profile-details {
  margin-top: 0;
  margin-bottom: 10px;
}

.admin-user-list {
  margin-top: 0;
}

@media (max-width: 980px) {
  .admin-card--security,
  .admin-card--sessions {
    grid-column: 1 / -1;
  }

  .admin-create-form {
    grid-template-columns: 1fr;
    grid-template-areas:
      "label"
      "input"
      "button";
  }
}

/* Final admin control room */
.admin-overlay {
  background:
    radial-gradient(circle at 50% -20%, rgba(160, 22, 32, 0.18), transparent 34%),
    rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(22px) saturate(1.08);
  -webkit-backdrop-filter: blur(22px) saturate(1.08);
}

.admin-dialog {
  width: min(1180px, calc(100vw - 28px));
  max-height: min(92vh, 860px);
  padding: 24px;
  border-radius: 10px;
  border-color: rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(22, 22, 24, 0.98), rgba(9, 9, 10, 0.985)),
    #0b0b0c;
  box-shadow: 0 34px 130px rgba(0, 0, 0, 0.82);
}

.admin-close-btn {
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.admin-hero {
  padding-right: 56px;
}

.admin-kicker,
.admin-section-kicker {
  display: block;
  margin: 0 0 6px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.admin-dialog-title {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
}

.admin-dialog-subtitle {
  max-width: 720px;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.64);
  font-size: 13px;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.admin-stat {
  display: grid;
  gap: 5px;
  min-height: 96px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.admin-stat span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.admin-stat strong {
  color: #fff;
  font-size: clamp(23px, 3vw, 33px);
  line-height: 1;
}

.admin-stat small {
  align-self: end;
  color: rgba(255, 255, 255, 0.56);
  font-size: 11px;
  line-height: 1.35;
}

.admin-system-line {
  min-height: 36px;
  margin: 10px 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  line-height: 1.35;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 12px;
}

.admin-ops-column {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.admin-card {
  border-radius: 8px;
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.045);
  padding: 14px;
}

.admin-card--security,
.admin-card--sessions,
.admin-card--create,
.admin-card--users {
  grid-column: auto;
}

.admin-card--users {
  min-width: 0;
}

.admin-card-head,
.admin-users-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-card-title {
  margin: 0;
  color: #fff;
  font-size: 16px;
  line-height: 1.15;
}

.admin-create-form,
.admin-password-form,
.admin-session-tools {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas: none;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.admin-create-label,
.admin-field {
  color: rgba(255, 255, 255, 0.56);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.admin-create-input,
.admin-field input {
  width: 100%;
  height: 42px !important;
  min-height: 42px !important;
  margin-top: 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.34);
}

.admin-create-submit,
.admin-password-submit,
.admin-refresh-btn,
.admin-view-user,
.admin-delete-user,
.admin-profile-close,
.admin-copy-message {
  border-radius: 8px;
}

.admin-create-submit,
.admin-password-submit,
.admin-logout-others-btn {
  width: 100%;
  min-height: 42px !important;
  margin: 0;
  white-space: normal;
}

.admin-refresh-btn {
  min-height: 34px !important;
  padding: 0 12px !important;
  font-size: 12px !important;
}

.admin-created-password,
.admin-profile-details {
  border-radius: 8px;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.26);
}

.admin-password-status {
  margin: 0;
  border-radius: 8px;
}

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

.admin-user-table-head,
.admin-user-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.3fr) minmax(160px, 0.8fr) minmax(125px, 0.7fr) minmax(170px, auto);
  gap: 12px;
  align-items: center;
}

.admin-user-table-head {
  padding: 0 12px 2px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.admin-user-row {
  min-height: 62px;
  padding: 10px 12px;
  border-radius: 8px;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.035);
}

.admin-user-main strong {
  font-size: 14px;
}

.admin-user-main span,
.admin-user-activity,
.admin-empty {
  color: rgba(255, 255, 255, 0.56);
  font-size: 12px;
}

.admin-user-stats {
  justify-self: start;
  justify-content: flex-start;
  gap: 8px;
  white-space: normal;
}

.admin-user-stats span {
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.62);
}

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

.admin-user-activity {
  white-space: nowrap;
}

.admin-user-actions {
  justify-self: end;
  justify-content: flex-end;
  gap: 8px;
}

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

.admin-delete-user {
  color: #ffd7db;
  border-color: rgba(255, 120, 134, 0.26);
}

.admin-profile-details {
  margin: 0 0 10px;
  padding: 14px;
}

.admin-profile-head p {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, 0.56);
  font-size: 12px;
  line-height: 1.35;
}

.admin-profile-columns li {
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.045);
}

@media (max-width: 1040px) {
  .admin-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .admin-dialog {
    width: calc(100vw - 18px);
    padding: 18px;
  }

  .admin-stats-grid,
  .admin-ops-column {
    grid-template-columns: 1fr;
  }

  .admin-user-table-head {
    display: none;
  }

  .admin-user-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

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

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

/* Admin create profile input spacing. */
.admin-create-input,
.admin-field input {
  box-sizing: border-box;
  padding: 0 22px !important;
}

.admin-create-form {
  gap: 12px 18px;
}

/* Admin users list: spacious structured rows. */
.admin-user-row {
  grid-template-columns: minmax(320px, 1.1fr) minmax(260px, 0.8fr) minmax(140px, 0.45fr) minmax(250px, auto) !important;
  grid-template-areas: "main stats activity actions";
  gap: 20px;
  min-height: 112px;
  padding: 18px 22px;
}

.admin-user-main {
  align-self: center;
  gap: 18px;
}

.admin-user-avatar {
  flex-basis: 56px;
  width: 56px;
  height: 56px;
}

.admin-user-copy {
  gap: 7px;
}

.admin-user-copy strong {
  font-size: 20px;
}

.admin-user-password {
  margin-top: 2px;
}

.admin-user-stats {
  justify-content: flex-start;
  gap: 10px;
}

.admin-user-stats span {
  padding: 8px 12px;
}

.admin-user-activity {
  align-self: center;
  color: rgba(255, 255, 255, 0.58);
}

.admin-user-actions {
  align-self: center;
  gap: 8px;
}

.admin-view-user,
.admin-delete-user,
.admin-reset-password {
  height: 40px !important;
  min-height: 40px !important;
  min-width: 96px;
  padding: 0 14px !important;
  font-size: 13px !important;
}

@media (max-width: 1280px) {
  .admin-user-row {
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas:
      "main actions"
      "stats actions"
      "activity actions";
  }

  .admin-user-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 760px) {
  .admin-user-row {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "main"
      "stats"
      "activity"
      "actions";
    padding: 16px;
  }

  .admin-user-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

/* Admin panel alignment polish */
.admin-card--create {
  grid-column: 1 / -1;
}

.admin-card--security,
.admin-card--sessions {
  grid-column: span 6;
}

.admin-card--users {
  grid-column: 1 / -1;
}

.admin-layout {
  grid-template-columns: 1fr;
}

.admin-ops-column {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.admin-create-form {
  grid-template-columns: minmax(0, 1fr) minmax(270px, 360px);
  grid-template-areas:
    "label label"
    "input button";
  align-items: end;
  gap: 12px 24px;
}

.admin-password-form {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(210px, 250px);
  align-items: end;
  gap: 12px 24px;
}

.admin-create-label,
.admin-field {
  line-height: 1;
}

.admin-create-input,
.admin-field input {
  height: 58px !important;
  min-height: 58px !important;
  margin-top: 12px;
  border-radius: 999px;
}

.admin-create-submit,
.admin-password-submit,
.admin-logout-others-btn {
  height: 58px !important;
  min-height: 58px !important;
  margin: 0;
  border-radius: 999px;
  white-space: nowrap;
}

.admin-create-submit {
  grid-area: button;
  padding: 0 26px !important;
}

.admin-password-submit {
  align-self: end;
  padding: 0 24px !important;
}

.admin-session-tools {
  grid-template-columns: minmax(0, 1fr);
}

.admin-logout-others-btn {
  width: 100%;
}

@media (max-width: 1040px) {
  .admin-card--security,
  .admin-card--sessions {
    grid-column: 1 / -1;
  }

  .admin-ops-column {
    grid-template-columns: 1fr;
  }

  .admin-card--create {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .admin-create-form,
  .admin-password-form {
    grid-template-columns: 1fr;
    grid-template-areas:
      "label"
      "input"
      "button";
    gap: 12px;
  }

  .admin-create-submit,
  .admin-password-submit {
    width: 100%;
  }

  .admin-ops-column {
    grid-template-columns: 1fr;
  }
}

/* Final admin rebuild override */
.admin-overlay {
  background:
    radial-gradient(circle at 18% 0%, rgba(150, 44, 94, 0.2), transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(72, 116, 190, 0.14), transparent 32%),
    rgba(0, 0, 0, 0.84);
}

.admin-dialog {
  width: min(1160px, calc(100vw - 30px));
  max-height: min(92vh, 860px);
  padding: 26px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(18, 18, 20, 0.98), rgba(8, 8, 9, 0.99)),
    #09090a;
}

.admin-close-btn {
  top: 22px;
  right: 22px;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  font-size: 32px;
}

.admin-hero {
  min-height: 86px;
  padding: 2px 74px 0 0;
}

.admin-dialog-title {
  font-size: clamp(34px, 4vw, 54px);
}

.admin-dialog-subtitle {
  max-width: 760px;
  font-size: 15px;
}

.admin-stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.admin-stat {
  min-height: 122px;
  padding: 18px;
  border-radius: 14px;
  border-color: rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
}

.admin-stat strong {
  font-size: clamp(30px, 4vw, 48px);
}

.admin-stat--cache {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.035)),
    radial-gradient(circle at 100% 0%, rgba(255, 199, 87, 0.14), transparent 42%);
}

.admin-system-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
  margin: 12px 0 16px;
  padding: 0;
  border: 0;
  background: transparent;
}

.admin-system-line span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.065);
  color: rgba(255, 255, 255, 0.58);
}

.admin-system-line strong {
  margin-left: 5px;
  color: #fff;
}

.admin-layout {
  grid-template-columns: 1fr;
  gap: 14px;
}

.admin-ops-column {
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr) minmax(240px, 0.7fr);
  gap: 14px;
}

.admin-card {
  padding: 18px;
  border-radius: 14px;
  border-color: rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.028));
}

.admin-card--create,
.admin-card--security,
.admin-card--sessions,
.admin-card--users {
  grid-column: auto;
}

.admin-card--users {
  padding: 18px;
  grid-column: 1 / -1;
}

.admin-card-head,
.admin-users-head {
  align-items: center;
  margin-bottom: 16px;
}

.admin-card-title {
  font-size: 20px;
}

.admin-create-form {
  grid-template-columns: minmax(0, 1fr) minmax(210px, 250px);
  grid-template-areas:
    "label label"
    "input button";
  gap: 12px;
}

.admin-password-form,
.admin-session-tools {
  grid-template-columns: 1fr;
  gap: 12px;
}

.admin-create-input,
.admin-field input,
.admin-create-submit,
.admin-password-submit,
.admin-logout-others-btn {
  height: 52px !important;
  min-height: 52px !important;
  border-radius: 999px;
}

.admin-create-input,
.admin-field input {
  margin-top: 10px;
}

.admin-password-submit,
.admin-logout-others-btn {
  width: 100%;
}

.admin-created-password,
.admin-profile-details {
  border-radius: 14px;
}

.admin-share-message {
  margin: 10px 0 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.34);
  white-space: pre-wrap;
}

.admin-refresh-btn,
.admin-copy-message,
.admin-profile-close,
.admin-view-user,
.admin-delete-user {
  border-radius: 999px;
}

.admin-user-table-head,
.admin-user-row {
  grid-template-columns: minmax(230px, 1.15fr) minmax(250px, 1fr) minmax(130px, 0.65fr) minmax(190px, auto);
  gap: 14px;
}

.admin-user-row {
  min-height: 76px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.03));
}

.admin-user-row--admin {
  border-color: rgba(255, 173, 206, 0.24);
}

.admin-user-main {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.admin-user-avatar {
  display: inline-flex;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 900;
}

.admin-user-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.admin-user-copy strong,
.admin-user-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-user-stats span {
  border-radius: 999px;
  padding: 7px 10px;
}

.admin-view-user,
.admin-delete-user {
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 14px !important;
}

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

.admin-profile-head h3 {
  margin: 0;
  color: #fff;
  font-size: 24px;
}

.admin-profile-stats {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}

.admin-profile-stats span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

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

.admin-profile-columns li {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
}

.admin-profile-columns li span {
  color: #fff;
  font-weight: 750;
}

.admin-profile-columns li small {
  color: rgba(255, 255, 255, 0.48);
}

/* Unified text entry: pill + purple accent — НЕ трогаем `input` внутри `.search` (рамка только на обёртке). */
textarea,
select,
input:is([type="text"], [type="password"], [type="email"], [type="tel"], [type="url"], [type="number"]),
input:not([type]) {
  border-radius: var(--btn-radius) !important;
  background: rgba(8, 8, 8, 0.98) !important;
  color: var(--text) !important;
  border: 1px solid rgba(168, 85, 247, 0.32) !important;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.12) !important;
  outline: none !important;
}

.auth-code-cell {
  border-radius: 14px !important;
  background: rgba(8, 8, 8, 0.98) !important;
  color: var(--text) !important;
  border: 1px solid rgba(168, 85, 247, 0.32) !important;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.12) !important;
}

textarea:focus-visible,
select:focus-visible,
.auth-code-cell:focus-visible,
input:is([type="text"], [type="password"], [type="email"], [type="tel"], [type="url"], [type="number"]):focus-visible,
input:not([type]):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: 1040px) {
  .admin-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .admin-user-table-head {
    display: none;
  }
}

@media (max-width: 700px) {
  .admin-dialog {
    width: calc(100vw - 16px);
    padding: 18px;
    border-radius: 14px;
  }

  .admin-stats-grid,
  .admin-create-form,
  .admin-profile-columns {
    grid-template-columns: 1fr;
  }

  .admin-create-form {
    grid-template-areas:
      "label"
      "input"
      "button";
  }
}

/* Одна обводка у поиска: только `.search`, без второго кольца на внутреннем `input`. */
.search input,
.search input:focus,
.search input:focus-visible {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  border-radius: 0 !important;
}

/* Search focus: one stable ring, no doubled inner border. */
.search {
  border: 2px solid rgba(255, 255, 255, 0.14) !important;
  overflow: hidden;
}

.search:focus-within {
  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;
  box-shadow: 0 0 18px rgba(125, 165, 250, 0.28), 0 10px 30px rgba(0, 0, 0, 0.22) !important;
}

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

/* Admin users table: fixed non-overlapping columns. */
.admin-card--users {
  overflow: hidden;
}

.admin-user-table-head,
.admin-user-row {
  display: grid;
  grid-template-columns: minmax(300px, 1.15fr) minmax(310px, 0.95fr) minmax(150px, 0.55fr) minmax(250px, auto) !important;
  align-items: center;
  gap: 16px;
}

.admin-user-row {
  min-height: 78px;
  padding: 12px 16px;
}

.admin-user-main {
  min-width: 0;
}

.admin-user-copy {
  min-width: 0;
}

.admin-user-copy strong,
.admin-user-copy span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-password {
  color: rgba(255, 255, 255, 0.62) !important;
  font-size: 13px;
}

.admin-user-password b {
  color: #fff;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.admin-user-stats {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  gap: 8px;
}

.admin-user-stats span {
  flex: 0 0 auto;
  white-space: nowrap;
}

.admin-user-activity {
  justify-self: start;
  min-width: 0;
  white-space: nowrap;
}

.admin-user-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  justify-self: end;
  min-width: 0;
  gap: 10px;
}

.admin-view-user,
.admin-delete-user,
.admin-reset-password {
  flex: 0 0 auto;
  min-width: 104px;
}

@media (max-width: 1180px) {
  .admin-user-table-head {
    display: none;
  }

  .admin-user-row {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px;
  }

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

  .admin-user-actions {
    justify-content: flex-start;
  }
}

/* Admin users list: card rows that cannot overflow. */
.admin-card--users {
  overflow: hidden;
}

.admin-user-table-head {
  display: none !important;
}

.admin-user-list {
  gap: 10px;
}

.admin-user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto !important;
  grid-template-areas:
    "main actions"
    "stats actions"
    "activity actions";
  align-items: center;
  gap: 8px 16px;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.admin-user-main {
  grid-area: main;
}

.admin-user-stats {
  grid-area: stats;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.admin-user-activity {
  grid-area: activity;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-actions {
  grid-area: actions;
  align-self: center;
  justify-self: end;
  min-width: 0;
}

.admin-user-stats span {
  max-width: 9.5rem;
}

@media (max-width: 760px) {
  .admin-user-row {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "main"
      "stats"
      "activity"
      "actions";
  }

  .admin-user-actions {
    justify-self: stretch;
    justify-content: flex-start;
  }
}

/* Search actions: compact clear icon and rounded submit pill. */
.search {
  grid-template-columns: minmax(0, 1fr) 34px auto;
  gap: 6px;
  padding: 4px;
}

.search input {
  height: 34px;
  padding: 0 12px;
}

.search .search-clear-btn {
  width: 34px;
  height: 34px;
  min-height: 34px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  color: rgba(245, 245, 247, 0.78);
  font-size: 24px;
  font-weight: 520;
  line-height: 1;
}

.search .search-clear-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.search button[type="submit"] {
  height: 34px;
  min-height: 34px !important;
  align-self: center;
  border-radius: 999px !important;
  padding: 0 20px !important;
}

/* Footer is a standalone page element, not part of the filter rail. */
.rail-footer {
  display: none !important;
}

.site-footer {
  width: min(100%, calc((var(--card-width) * 7) + (var(--poster-gap) * 6)));
  margin: 20px auto 0;
  padding: 18px 0 28px;
  color: var(--muted);
}

.site-footer-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.site-footer-link {
  color: rgba(245, 245, 247, 0.62);
  text-decoration: none;
  font-size: 13px;
  font-weight: 760;
}

.site-footer-link:hover {
  color: #fff;
}

.site-footer-tagline {
  margin: 0 0 10px;
  color: rgba(245, 245, 247, 0.62);
  font-size: 12px;
  font-weight: 520;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.site-footer-copy {
  margin: 0;
  color: rgba(245, 245, 247, 0.46);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.14em;
}

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

.site-footer-copy-sep {
  margin-inline: 3px;
}

.site-footer-cc {
  margin-right: 0.45em;
}

/* Final search/footer geometry */
.search {
  border-radius: 999px !important;
}

.search input {
  border-radius: 999px 0 0 999px !important;
}

.search .search-clear-btn,
.search button[type="submit"] {
  align-self: center;
}

.site-footer {
  width: var(--sidebar-w);
  margin: 8px 0 0 var(--page-pad-x);
  padding: 14px 0 28px;
  box-sizing: border-box;
}

/* Fixed left column: filters and footer move as one block. */
.workspace > .rail-stack {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

/* На десктопе (фиксированный rail ≥821px) кнопки только в шапке; в узком drawer они — в .mobile-drawer-actions. */
@media (min-width: 821px) {
  .rail-stack > .mobile-drawer-actions {
    display: none !important;
  }
}

@media (min-width: 821px) {
  .rail-stack {
    position: fixed !important;
    left: var(--page-pad-x) !important;
    top: var(--sticky-below-header) !important;
    width: var(--sidebar-w) !important;
    max-height: calc(100vh - var(--sticky-below-header) - 12px) !important;
    display: flex !important;
    flex-direction: column;
    gap: 12px;
    z-index: 40;
    box-sizing: border-box;
  }

  .rail-stack > .rail {
    position: static !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    max-height: none !important;
    flex: 0 0 auto;
  }

  .rail-stack > .site-footer {
    position: static !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 2px 0 !important;
    box-sizing: border-box;
    flex: 0 0 auto;
  }
}

@media (max-width: 820px) {
  .workspace > .rail-stack,
  .workspace > .catalog,
  .workspace.has-card > .watch-panel {
    grid-column: 1;
    grid-row: auto;
  }

  .rail-stack > .rail {
    position: static !important;
  }

  .rail-stack > .site-footer {
    width: 100% !important;
    margin: 10px 0 0 !important;
  }
}

/* Mobile and TV adaptations: isolated final layer, desktop stays on the existing grid. */
.mobile-menu-toggle {
  display: none;
}

@media (max-width: 820px) {
  :root {
    --sticky-below-header: 138px;
    --page-pad-x: clamp(12px, 4vw, 18px);
    --layout-gap: 14px;
  }

  body.mobile-menu-open {
    overflow: hidden;
  }

  .app-header {
    grid-template-columns: minmax(0, 1fr) 48px !important;
    grid-template-areas:
      "brand menu"
      "search search"
      "auth auth";
    min-height: 0 !important;
    gap: 10px !important;
    padding: 10px var(--page-pad-x) 12px !important;
    background: rgba(5, 5, 6, 0.94) !important;
  }

  .app-header .brand {
    grid-area: brand;
    justify-self: start !important;
    width: auto !important;
  }

  .brand-logo-img {
    height: 42px !important;
  }

  .mobile-menu-toggle {
    grid-area: menu;
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
  }

  .mobile-menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 2px 0;
    border-radius: 999px;
    background: currentColor;
    transition: transform 180ms ease, opacity 180ms ease;
  }

  body.mobile-menu-open .mobile-menu-toggle span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  body.mobile-menu-open .mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  body.mobile-menu-open .mobile-menu-toggle span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .search {
    grid-area: search;
    width: 100% !important;
    min-height: 46px !important;
    grid-template-columns: minmax(0, 1fr) 38px auto !important;
  }

  .search input {
    min-width: 0;
    font-size: 15px !important;
  }

  .search button[type="submit"] {
    min-width: 86px;
    padding-inline: 18px !important;
  }

  .auth-bar {
    grid-area: auth;
    justify-content: flex-start !important;
    gap: 8px;
  }

  .auth-header-btn {
    min-height: 34px !important;
  }

  .app-shell::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 74;
    background: rgba(0, 0, 0, 0.58);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  body.mobile-menu-open .app-shell::before {
    opacity: 1;
    pointer-events: auto;
  }

  .rail-stack {
    position: fixed !important;
    left: 10px !important;
    top: calc(var(--sticky-below-header) + 8px) !important;
    bottom: 10px;
    z-index: 80;
    width: min(336px, calc(100vw - 20px)) !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: column;
    gap: 12px;
    transform: translateX(calc(-100% - 16px));
    opacity: 0;
    pointer-events: none;
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms ease;
  }

  body.mobile-menu-open .rail-stack {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .rail-stack > .rail {
    position: static !important;
    width: 100% !important;
    max-height: min(70vh, calc(100vh - var(--sticky-below-header) - 96px)) !important;
    overflow: auto;
    padding: 16px !important;
    border-radius: 24px !important;
    background: rgba(18, 18, 20, 0.98) !important;
  }

  .rail-stack > .site-footer {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 4px !important;
  }

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

  .catalog,
  .workspace.has-card .catalog {
    width: 100% !important;
    max-width: 100% !important;
    grid-column: 1 !important;
  }

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

  .catalog-context-title {
    font-size: clamp(28px, 9vw, 42px) !important;
    line-height: 1.02;
  }

  .section-wall,
  .workspace.has-card .section-wall {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px 12px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .movie-card,
  .workspace.has-card .movie-card {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    border-radius: 18px !important;
  }

  .poster-title strong {
    font-size: clamp(14px, 4vw, 17px) !important;
  }

  .card-strip {
    min-height: 42px !important;
    padding: 10px 12px !important;
  }

  /* Deprecated mobile watch-panel block removed — see FINAL MOBILE SHEET OVERRIDES at end of file */
  .deprecated-old-mobile-watch-panel-stub__c {
    display: none;
  }

  .workspace.has-card .catalog {
    grid-row: 2 !important;
  }

  .watch-panel > .screen,
  .workspace.has-card .watch-panel > .screen,
  .workspace.has-card .watch-panel > .screen.playing {
    min-height: min(68vh, 560px) !important;
    max-height: none !important;
    border-radius: 24px 24px 0 0 !important;
  }

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

  .screen h2 {
    font-size: clamp(34px, 10vw, 54px) !important;
  }

  .play {
    width: 86px !important;
    height: 86px !important;
  }

  .watch-body {
    padding: 16px 18px 22px !important;
    overflow: visible !important;
  }

  .player-overlay {
    padding: 8px !important;
  }

  .player-dialog {
    width: calc(100vw - 16px) !important;
    max-height: calc(100vh - 16px);
    border-radius: 22px !important;
  }

  .fkwatch-frame {
    min-height: 0 !important;
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 440px) {
  .section-wall,
  .workspace.has-card .section-wall {
    gap: 14px 10px !important;
  }

  .poster-badges {
    transform: scale(0.88);
    transform-origin: top left;
  }
}

body.device-tv {
  --sticky-below-header: 92px;
  --page-pad-x: clamp(24px, 3.2vw, 54px);
  --layout-gap: 30px;
}

body.device-tv .app-header {
  min-height: 86px;
  background: rgba(4, 4, 5, 0.9) !important;
}

body.device-tv .mobile-menu-toggle {
  display: none !important;
}

body.device-tv .movie-card,
body.device-tv .play,
body.device-tv button,
body.device-tv select {
  outline-offset: 5px;
}

body.device-tv .movie-card:focus-visible,
body.device-tv .play:focus-visible,
body.device-tv button:focus-visible,
body.device-tv select:focus-visible {
  outline: 4px solid rgba(255, 255, 255, 0.95) !important;
  box-shadow: 0 0 0 8px rgba(151, 96, 255, 0.42) !important;
}

body.device-tv .movie-card {
  transform: none !important;
}

body.device-tv .movie-card:focus-visible {
  transform: translateY(-4px) scale(1.025) !important;
  z-index: 3;
}

body.device-tv .poster-img {
  opacity: 1;
}

body.device-tv .watch-panel {
  max-height: calc(100vh - var(--sticky-below-header) - 18px);
}

body.device-tv .player-overlay {
  padding: clamp(34px, 4vw, 72px) !important;
  background: rgba(0, 0, 0, 0.88) !important;
}

body.device-tv .player-dialog {
  width: min(92vw, 1640px) !important;
  height: auto !important;
  max-height: 88vh;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: 28px !important;
  overflow: hidden;
}

body.device-tv .fkwatch-frame {
  min-height: min(68vh, 760px) !important;
  aspect-ratio: 16 / 9;
}

body.device-tv .close-player {
  top: 18px;
  right: 18px;
  width: 58px;
  height: 58px;
  font-size: 36px;
}

.player-loading-state {
  min-height: min(68vh, 620px);
  display: grid;
  place-items: center;
  gap: 14px;
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
  background: #050505;
}

/* Mobile polish pass: только .device-mobile; узкий десктоп сохраняет полную раскладку. */
@media (max-width: 820px) {
  html.device-mobile {
    --sticky-below-header: 124px;
  }

  body.device-mobile .app-header {
    grid-template-columns: 48px minmax(0, 1fr) 48px !important;
    grid-template-areas:
      "menu brand spacer"
      "search search search" !important;
    align-items: center;
    padding: 8px var(--page-pad-x) 10px !important;
  }

  body.device-mobile .app-header .brand {
    grid-area: brand;
    justify-self: center !important;
    width: auto !important;
    min-width: 0;
  }

  body.device-mobile .brand-logo-img {
    height: 46px !important;
  }

  body.device-mobile .mobile-menu-toggle {
    grid-area: menu;
    justify-self: start;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.075);
  }

  body.device-mobile .mobile-menu-toggle span {
    width: 18px;
    height: 2px;
  }

  body.device-mobile .app-header .auth-bar {
    display: none !important;
  }

  body.device-mobile.mobile-menu-open .app-header .auth-bar {
    position: fixed;
    left: 26px;
    bottom: 26px;
    z-index: 86;
    display: grid !important;
    width: min(304px, calc(100vw - 52px));
    grid-template-columns: 1fr;
    gap: 10px;
    justify-content: stretch !important;
    align-items: stretch;
  }

  body.device-mobile.mobile-menu-open .auth-header-btn {
    width: 100%;
    min-height: 46px !important;
    justify-content: center;
    font-size: 14px !important;
    border-radius: 999px !important;
  }

  body.device-mobile.mobile-menu-open #authHeaderBtn {
    color: #ffd6d6;
    border-color: rgba(255, 86, 86, 0.72);
    background: rgba(255, 55, 55, 0.08);
  }

  body.device-mobile.mobile-menu-open #authHeaderBtn:hover {
    border-color: rgba(255, 118, 118, 0.9);
    background: rgba(255, 65, 65, 0.13);
  }

  body.device-mobile .rail-stack {
    top: 0 !important;
    bottom: 0 !important;
  }

  body.device-mobile .rail-stack > .rail {
    max-height: none !important;
  }

  body.device-mobile .workspace {
    padding-top: calc(var(--sticky-below-header) + 14px) !important;
  }

  body.device-mobile .workspace.has-card .watch-panel {
    overflow: hidden !important;
    border-radius: 22px !important;
  }

  body.device-mobile .watch-panel > .screen,
  body.device-mobile .workspace.has-card .watch-panel > .screen,
  body.device-mobile .workspace.has-card .watch-panel > .screen.playing {
    min-height: 0 !important;
    max-height: none !important;
    height: auto !important;
  }

  body.device-mobile .screen,
  body.device-mobile .screen.playing,
  body.device-mobile .screen-hero-stack,
  body.device-mobile .screen.playing .screen-hero-stack {
    min-height: clamp(340px, 62vw, 500px) !important;
  }

  body.device-mobile .screen-content {
    align-self: end;
    gap: 10px !important;
    padding: 76px 18px 22px !important;
  }

  body.device-mobile .screen h2 {
    font-size: clamp(32px, 9vw, 58px) !important;
    line-height: 1.02 !important;
  }

  body.device-mobile .screen-content .meta {
    font-size: clamp(16px, 4.2vw, 22px) !important;
  }

  body.device-mobile .hero-overline {
    font-size: clamp(12px, 3.2vw, 16px) !important;
  }

  body.device-mobile .play {
    width: 74px !important;
    height: 74px !important;
  }

  body.device-mobile .screen-hero-controls {
    padding: 12px !important;
  }

  body.device-mobile .watch-tool-btn {
    width: 46px;
    height: 46px;
    border-width: 1px;
  }

  body.device-mobile .watch-body {
    margin-top: 0 !important;
    padding: 14px 18px 18px !important;
    background: rgba(20, 20, 22, 0.98) !important;
  }

  body.device-mobile .watch-ratings-compact {
    margin: 0 0 14px !important;
    padding-top: 12px !important;
    gap: 8px 18px;
  }

  body.device-mobile .watch-body p {
    font-size: clamp(16px, 4.4vw, 20px);
    line-height: 1.42;
  }

  body.device-mobile .watch-description.collapsed {
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }
}

/* iOS app-like mobile layer: liquid glass, sheet card, three-up posters. */
@media (max-width: 820px) {
  body.device-mobile,
  body.device-mobile button,
  body.device-mobile input,
  body.device-mobile select {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, sans-serif !important;
    letter-spacing: 0 !important;
  }

  body.device-mobile {
    --mobile-sheet-top: 132px;
    background:
      linear-gradient(180deg, #111216 0%, #0a0b10 46%, #050506 100%) fixed,
      #050506 !important;
  }

  body.device-mobile.mobile-watch-open,
  html.device-mobile.mobile-watch-open {
    overflow: hidden;
  }

  body.device-mobile .app-header {
    min-height: 110px !important;
    background: rgba(18, 18, 22, 0.64) !important;
    border-bottom-color: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(28px) saturate(1.85) !important;
    -webkit-backdrop-filter: blur(28px) saturate(1.85) !important;
    box-shadow: 0 12px 44px rgba(0, 0, 0, 0.34);
  }

  body.device-mobile .mobile-menu-toggle {
    width: 40px;
    height: 40px;
    border-color: rgba(255, 255, 255, 0.18);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.07));
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.18),
      0 10px 26px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(18px) saturate(1.5);
    -webkit-backdrop-filter: blur(18px) saturate(1.5);
  }

  body.device-mobile .brand-logo-img {
    height: 44px !important;
    filter: none !important;
  }

  body.device-mobile .brand::before,
  body.device-mobile .brand:hover::before,
  body.device-mobile .brand:focus-visible::before {
    display: none !important;
  }

  body.device-mobile .search {
    min-height: 44px !important;
    border-radius: 22px !important;
    background: rgba(118, 118, 128, 0.18) !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.11);
  }

  body.device-mobile .search input {
    height: 36px;
    font-size: 15px !important;
    font-weight: 480;
  }

  body.device-mobile .search button[type="submit"] {
    height: 34px;
    min-height: 34px !important;
    min-width: 76px;
    font-size: 14px !important;
    font-weight: 700;
  }

  body.device-mobile.mobile-menu-open .app-header .auth-bar {
    background:
      linear-gradient(180deg, rgba(42, 42, 48, 0.84), rgba(18, 18, 22, 0.78)) !important;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.16),
      0 28px 80px rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(34px) saturate(1.85);
    -webkit-backdrop-filter: blur(34px) saturate(1.85);
  }

  body.device-mobile .rail-stack > .rail {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body.device-mobile .workspace {
    padding-top: 132px !important;
  }

  body.device-mobile .catalog-context-title {
    font-size: 30px !important;
    font-weight: 800;
    letter-spacing: -0.01em !important;
  }

  body.device-mobile .catalog-context-subtitle {
    font-size: 13px !important;
    font-weight: 560;
  }

  body.device-mobile .section-wall,
  body.device-mobile .workspace.has-card .section-wall {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 16px 9px !important;
  }

  body.device-mobile .movie-card,
  body.device-mobile .workspace.has-card .movie-card {
    border-radius: 14px !important;
    background: rgba(32, 32, 36, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28) !important;
  }

  body.device-mobile .movie-card .poster {
    aspect-ratio: 2 / 3 !important;
  }

  body.device-mobile .poster-title {
    left: 8px;
    right: 8px;
    bottom: 8px;
  }

  body.device-mobile .poster-title strong {
    margin-bottom: 5px;
    font-size: clamp(11px, 3.05vw, 13px) !important;
    line-height: 1.08 !important;
    font-weight: 760;
  }

  body.device-mobile .poster-title span {
    margin-bottom: 0;
    font-size: 10px !important;
    line-height: 1.1;
    font-weight: 650;
  }

  body.device-mobile .poster-badges {
    left: 7px;
    top: 7px;
    right: 7px;
    gap: 3px;
    transform: scale(0.72);
    transform-origin: top left;
  }

  body.device-mobile .badge {
    height: 23px;
    padding-inline: 8px !important;
    font-size: 11px !important;
  }

  body.device-mobile .card-strip {
    min-height: 32px !important;
    padding: 8px 9px !important;
    font-size: 10.5px !important;
    font-weight: 620;
  }

  body.device-mobile::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 88;
    background: rgba(0, 0, 0, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }

  body.device-mobile.mobile-watch-open::before {
    opacity: 1;
    pointer-events: auto;
    top: 0;
    z-index: 95;
    background: rgba(6, 6, 10, 0.4);
    backdrop-filter: blur(10px) saturate(1.1);
    -webkit-backdrop-filter: blur(10px) saturate(1.1);
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
  }

  /* Гасим шапку под оверлей — блюр дотянется до самого верха */
  body.device-mobile.mobile-watch-open .app-header {
    z-index: 93 !important;
  }

  /* Кнопка меню всегда поверх всего — фиксируем отдельно */
  body.device-mobile.mobile-watch-open .mobile-menu-toggle {
    position: fixed !important;
    z-index: 99 !important;
    top: calc(env(safe-area-inset-top, 0px) + 10px) !important;
    right: clamp(12px, 4vw, 18px) !important;
    left: auto !important;
  }

  /* Нижний sheet: верх совпадает с отступом каталога под шапку+поиск (как --mobile-sheet-top). */
  body.device-mobile .workspace.has-card .watch-panel {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: calc(var(--mobile-sheet-top) - 8px) !important;
    bottom: calc(-12px - env(safe-area-inset-bottom, 0px)) !important;
    z-index: 97;
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    border-radius: 30px 30px 0 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    background:
      linear-gradient(180deg, rgba(40, 40, 46, 0.9), rgba(18, 18, 22, 0.94)) !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.18),
      0 -18px 72px rgba(0, 0, 0, 0.58) !important;
    backdrop-filter: blur(38px) saturate(1.9);
    -webkit-backdrop-filter: blur(38px) saturate(1.9);
    transform: translate3d(0, var(--mobile-sheet-drag-y, 0), 0);
    opacity: 1 !important;
    pointer-events: auto !important;
    will-change: transform;
    transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1), opacity 240ms ease;
    animation: mobile-sheet-enter 420ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  body.device-mobile .workspace.has-card .watch-panel .watch-sheet-drag-handle {
    display: none;
  }

  body.device-mobile .workspace.has-card .watch-panel .watch-sheet-drag-pill {
    margin-top: 8px;
    width: 42px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.34);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2);
  }

  body.device-mobile .workspace.has-card .watch-panel::before {
    display: block !important;
  }

  body.device-mobile .watch-panel {
    opacity: 0;
    pointer-events: none;
  }

  body.device-mobile .workspace.has-card .watch-panel > .screen,
  body.device-mobile .workspace.has-card .watch-panel > .screen.playing {
    flex: 0 0 auto;
    min-height: 0 !important;
    max-height: min(46vh, 380px) !important;
  }

  body.device-mobile .workspace.has-card .watch-panel > .watch-body {
    flex: 1 1 auto;
    max-height: 100%;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
  }

  body.device-mobile .watch-panel.is-touch-dragging {
    transition: none !important;
    touch-action: none !important;
  }

  body.device-mobile .workspace.has-card .watch-panel.card-closing {
    animation: mobile-sheet-exit 260ms ease forwards !important;
    pointer-events: none;
  }

  @keyframes mobile-sheet-enter {
    from {
      opacity: 0;
      transform: translate3d(0, calc(var(--mobile-sheet-drag-y, 0px) + 72px), 0);
    }
    to {
      opacity: 1;
      transform: translate3d(0, var(--mobile-sheet-drag-y, 0), 0);
    }
  }

  @keyframes mobile-sheet-exit {
    from {
      opacity: 1;
      transform: translate3d(0, var(--mobile-sheet-drag-y, 0), 0);
    }
    to {
      opacity: 0;
      transform: translate3d(0, calc(var(--mobile-sheet-drag-y, 0px) + 64px), 0);
    }
  }

  /* Свечение под карточкой — цвет доминирующего цвета постера */
  body.device-mobile.mobile-watch-open .workspace.has-card .watch-panel {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.18),
      0 -18px 72px rgba(0, 0, 0, 0.58),
      0 -10px 55px var(--poster-glow-color, rgba(200, 160, 50, 0)) !important;
  }

  body.device-mobile .watch-panel::before {
    content: "";
    position: sticky;
    top: 8px;
    z-index: 70;
    display: block;
    width: 42px;
    height: 5px;
    margin: 8px auto -13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.32);
    cursor: default;
    pointer-events: none;
  }

  body.device-mobile .workspace.has-card .catalog {
    grid-row: 1 !important;
  }

  body.device-mobile .watch-panel > .screen,
  body.device-mobile .workspace.has-card .watch-panel > .screen,
  body.device-mobile .workspace.has-card .watch-panel > .screen.playing {
    border-radius: 30px 30px 0 0 !important;
    overflow: hidden;
  }

  body.device-mobile .screen:not(:has(.mobile-inline-player--poster-slot)),
  body.device-mobile .screen.playing:not(:has(.mobile-inline-player--poster-slot)),
  body.device-mobile .screen-hero-stack:not(:has(.mobile-inline-player--poster-slot)),
  body.device-mobile .screen.playing .screen-hero-stack:not(:has(.mobile-inline-player--poster-slot)) {
    min-height: clamp(260px, 64vw, 360px) !important;
  }

  body.device-mobile .screen-content:not(.screen-content--mobile-film) {
    padding: 72px 18px 20px !important;
  }

  body.device-mobile .screen-hero-stack:has(.screen-content--mobile-film) > .watch-play-pill {
    position: absolute;
    left: 50%;
    top: clamp(120px, 36vw, 220px);
    /* Один transform: второй раз указывать нельзя — иначе сбивается translate(-50%,-50%). */
    transform: translate(-50%, -50%) translateZ(0);
    z-index: 35;
    margin: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding-block: 11px;
    padding-inline: 26px;
    border-radius: 999px;
    border: none;
    background: rgba(22, 22, 28, 0.38);
    backdrop-filter: blur(18px) saturate(1.25);
    -webkit-backdrop-filter: blur(18px) saturate(1.25);
    isolation: isolate;
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.28),
      0 12px 32px rgba(0, 0, 0, 0.32);
    color: rgba(248, 248, 252, 0.98);
    font-size: 14px;
    font-weight: 740;
    letter-spacing: 0.02em;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    font-variant-numeric: tabular-nums;
    box-sizing: border-box;
  }

  body.device-mobile .watch-play-pill-play-wrap {
    flex-shrink: 0;
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    margin: 0;
    opacity: 0.98;
  }

  body.device-mobile .watch-play-pill-play {
    display: block;
    width: 26px !important;
    height: 26px !important;
    margin: 0;
    transform: translateX(1px);
  }

  body.device-mobile .watch-play-pill-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    line-height: 1;
  }

  body.device-mobile .screen-hero-stack:has(.screen-content--mobile-film) > .watch-play-pill:active {
    transform: translate(-50%, -50%) scale(0.98) translateZ(0);
    background: rgba(30, 30, 38, 0.52);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.34),
      0 12px 32px rgba(0, 0, 0, 0.38);
  }

  body.device-mobile .screen-content--mobile-film {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px 18px 8px !important;
    gap: 0;
    width: 100%;
    box-sizing: border-box;
  }

  body.device-mobile .screen-copy--mobile-film {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    max-width: 100%;
  }

  body.device-mobile .hero-title-ru {
    margin: 4px 0 0 !important;
    text-align: center;
    max-width: 100%;
  }

  body.device-mobile .hero-title-original {
    margin: 0 !important;
    font-size: 15px !important;
    font-weight: 560;
    line-height: 1.3;
    color: rgba(245, 245, 247, 0.72) !important;
    text-align: center;
    max-width: 100%;
  }

  body.device-mobile .hero-meta-line {
    margin: 0 !important;
    font-size: 15px !important;
    font-weight: 560;
    line-height: 1.35;
    color: rgba(200, 200, 210, 0.78) !important;
    text-align: center;
  }

  body.device-mobile .hero-ratings-line {
    margin: 2px 0 0 !important;
    font-size: 16px !important;
    font-weight: 640;
    line-height: 1.35;
    color: rgba(245, 245, 247, 0.96) !important;
    text-align: center;
    font-variant-numeric: tabular-nums;
  }

  body.device-mobile .hero-ratings-line strong {
    font-weight: 820;
    color: #fff;
  }

  /* Рейтинги + статус серии одной строкой, те же pill-бейджи что на десктопе (.watch-ratings-compact). */
  body.device-mobile .watch-ratings-compact.watch-ratings-compact--mobile-hero {
    margin: 6px 0 0 !important;
    padding-top: 0 !important;
    border-top: none !important;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.02em;
    color: var(--muted);
  }

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

  body.device-mobile .watch-ratings-compact.watch-ratings-compact--mobile-hero .watch-status-badge {
    margin-left: 0;
    flex: 0 1 auto;
    min-width: 0;
  }

  body.device-mobile .hero-meta-line strong {
    font-weight: 760;
    color: rgba(245, 245, 247, 0.94);
  }

  body.device-mobile.mobile-watch-open .watch-panel .screen-hero-stack:has(.screen-content--mobile-film) {
    min-height: min(40vh, 300px) !important;
    max-height: min(46vh, 380px) !important;
  }

  body.device-mobile.mobile-watch-open .watch-panel .screen-hero-scrim--mobile-film {
    background: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.05) 0%,
      rgba(0, 0, 0, 0.04) 32%,
      rgba(0, 0, 0, 0.18) 52%,
      rgba(0, 0, 0, 0.42) 72%,
      rgba(11, 11, 14, 0.72) 90%,
      rgba(11, 11, 14, 0.88) 100%
    ) !important;
  }

  body.device-mobile.mobile-watch-open .watch-panel .screen-bottom-seam--mobile-film {
    bottom: -10px;
    height: clamp(260px, 62vw, min(460px, 58vh));
    background: linear-gradient(
      180deg,
      rgba(11, 11, 14, 0) 0%,
      rgba(11, 11, 14, 0) 36%,
      rgba(11, 11, 14, 0.18) 48%,
      rgba(11, 11, 14, 0.42) 58%,
      rgba(11, 11, 14, 0.62) 66%,
      rgba(11, 11, 14, 0.82) 76%,
      rgba(11, 11, 14, 0.94) 88%,
      #0b0b0e 100%
    ) !important;
  }

  body.device-mobile.mobile-watch-open .watch-panel .watch-mobile-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 14px;
  }

  body.device-mobile.mobile-watch-open .watch-panel .watch-mobile-meta-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 28px;
  }

  body.device-mobile.mobile-watch-open .watch-panel .watch-mobile-kind {
    margin: 0;
    font-size: 12px;
    font-weight: 760;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: rgba(228, 228, 236, 0.68);
  }

  body.device-mobile.mobile-watch-open .watch-panel .watch-mobile-meta-topline--solo {
    justify-content: center;
  }

  body.device-mobile.mobile-watch-open .watch-panel .watch-mobile-meta-status {
    display: inline-flex;
    align-items: center;
  }

  body.device-mobile.mobile-watch-open .watch-panel .watch-ratings-short {
    font-size: 15px;
    font-weight: 680;
    letter-spacing: 0.01em;
    color: rgba(250, 250, 252, 0.96);
    font-variant-numeric: tabular-nums;
  }

  body.device-mobile.mobile-watch-open .watch-panel .watch-ratings-short strong {
    font-weight: 820;
    color: #fff;
  }

  body.device-mobile.mobile-watch-open .watch-panel .watch-ratings-short--center {
    margin: 0;
    text-align: center;
  }

  body.device-mobile.mobile-watch-open .watch-panel .watch-mobile-meta-status .watch-status-badge {
    margin-left: 0;
    flex: 0 0 auto;
    min-width: 0;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 780;
  }

  body.device-mobile.mobile-watch-open .watch-panel .watch-body {
    margin-top: -26px !important;
    padding: 32px 18px calc(env(safe-area-inset-bottom, 0px) + 28px) !important;
    position: relative;
    z-index: 6 !important;
    background: linear-gradient(
      180deg,
      #0b0b0e 0%,
      #0b0b0e 22px,
      #08080b 100%
    ) !important;
  }

  body.device-mobile.mobile-watch-open .watch-panel .watch-description--details {
    margin: 0;
  }

  body.device-mobile.mobile-watch-open .watch-panel #movieDetails {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  body.device-mobile.mobile-watch-open .watch-panel .watch-mobile-bubble-stack {
    display: grid;
    gap: 8px;
    margin: 0 !important;
    align-self: stretch;
    width: 100%;
  }

  body.device-mobile.mobile-watch-open .watch-panel .watch-mobile-bubble-stack .people-details {
    margin: 0 !important;
    margin-block: 0 !important;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.065);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }

  body.device-mobile.mobile-watch-open .watch-panel .watch-mobile-bubble-stack .people-details-summary {
    min-height: 46px;
    padding: 0 13px;
    box-sizing: border-box;
    transition:
      background 0.18s ease,
      color 0.18s ease;
  }

  body.device-mobile.mobile-watch-open .watch-panel .watch-mobile-bubble-stack .people-details-summary:active {
    background: rgba(255, 255, 255, 0.04);
  }

  body.device-mobile.mobile-watch-open .watch-panel .watch-mobile-bubble-stack .people-details-heading {
    font-size: 10px !important;
    letter-spacing: 0.12em !important;
    font-weight: 850 !important;
  }

  body.device-mobile.mobile-watch-open .watch-panel .watch-mobile-bubble-stack .people-details-body {
    padding: 2px 14px 14px !important;
  }

  body.device-mobile .screen h2 {
    font-size: clamp(31px, 9.2vw, 48px) !important;
    font-weight: 820;
    letter-spacing: -0.02em !important;
  }

  body.device-mobile .screen-content .meta {
    font-size: 16px !important;
    line-height: 1.25;
    color: rgba(245, 245, 247, 0.76);
  }

  body.device-mobile .hero-overline {
    font-size: 11px !important;
    font-weight: 780;
    letter-spacing: 0.11em !important;
  }

  body.device-mobile .play {
    width: 68px !important;
    height: 68px !important;
    font-size: 26px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
  }

  body.device-mobile .screen-hero-controls {
    padding: 14px 14px 0 !important;
    align-items: center !important;
  }

  body.device-mobile.mobile-watch-open .watch-panel .screen-hero-controls .watch-tool-btn {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: none;
    background: rgba(22, 22, 28, 0.38);
    color: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(18px) saturate(1.25);
    -webkit-backdrop-filter: blur(18px) saturate(1.25);
    isolation: isolate;
    transform: translateZ(0);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.26),
      0 12px 32px rgba(0, 0, 0, 0.3);
    filter: none;
    transition:
      transform 120ms ease,
      background 180ms ease,
      box-shadow 180ms ease;
  }

  body.device-mobile.mobile-watch-open .watch-panel .screen-hero-controls .watch-tool-btn .watch-tool-svg {
    width: 18px;
    height: 18px;
  }

  body.device-mobile.mobile-watch-open .watch-panel .screen-hero-controls .watch-tool-btn[aria-pressed="true"] {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.85),
      0 12px 30px rgba(0, 0, 0, 0.28);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(236, 239, 247, 0.88) 100%);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
  }

  body.device-mobile.mobile-watch-open .watch-panel .screen-hero-controls .watch-tool-btn:active {
    transform: scale(0.94) translateZ(0);
    background: rgba(30, 30, 38, 0.48);
    backdrop-filter: blur(18px) saturate(1.25);
    -webkit-backdrop-filter: blur(18px) saturate(1.25);
  }

  body.device-mobile.mobile-watch-open .watch-panel .screen-hero-controls .watch-tool-bookmark {
    color: #ff4e98;
    box-shadow:
      0 0 0 1px rgba(255, 182, 213, 0.38),
      0 12px 32px rgba(0, 0, 0, 0.28),
      0 0 20px rgba(255, 103, 170, 0.24);
  }

  body.device-mobile.mobile-watch-open .watch-panel .screen-hero-controls .watch-tool-watching {
    color: #17bfa8;
    box-shadow:
      0 0 0 1px rgba(152, 248, 233, 0.36),
      0 12px 32px rgba(0, 0, 0, 0.28),
      0 0 20px rgba(55, 230, 203, 0.22);
  }

  body.device-mobile.mobile-watch-open .watch-panel .screen-hero-controls .watch-tool-bookmark.is-saved {
    color: #fff;
    background: linear-gradient(180deg, rgba(255, 121, 176, 0.88) 0%, rgba(255, 79, 152, 0.78) 100%);
    border: none;
    backdrop-filter: blur(14px) saturate(1.45);
    -webkit-backdrop-filter: blur(14px) saturate(1.45);
    box-shadow:
      0 0 0 1px rgba(255, 182, 213, 0.42),
      0 14px 36px rgba(0, 0, 0, 0.32),
      0 0 24px rgba(255, 103, 170, 0.45);
  }

  body.device-mobile.mobile-watch-open .watch-panel .screen-hero-controls .watch-tool-watching.is-watching {
    color: #fff;
    background: linear-gradient(180deg, rgba(47, 230, 202, 0.9) 0%, rgba(24, 195, 173, 0.82) 100%);
    border: none;
    backdrop-filter: blur(14px) saturate(1.4);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    box-shadow:
      0 0 0 1px rgba(152, 248, 233, 0.45),
      0 14px 36px rgba(0, 0, 0, 0.3),
      0 0 24px rgba(55, 230, 203, 0.4);
  }

  body.device-mobile.mobile-watch-open .watch-panel .screen-hero-controls .watch-tool-btn:focus-visible {
    outline: 0;
    box-shadow:
      0 0 0 2px rgba(141, 186, 255, 0.45),
      0 12px 30px rgba(0, 0, 0, 0.32);
  }

  body.device-mobile .watch-tool-btn {
    width: 44px;
    height: 44px;
    border: 0;
    background: rgba(118, 118, 128, 0.36);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    isolation: isolate;
  }

  body.device-mobile .watch-body {
    padding: 14px 18px 22px !important;
    background: transparent !important;
  }

  body.device-mobile .watch-ratings-compact {
    border-top-color: rgba(255, 255, 255, 0.12);
    font-size: 12px;
  }

  body.device-mobile .watch-body p {
    font-size: 16px;
    line-height: 1.42;
    color: rgba(245, 245, 247, 0.88);
  }

  body.device-mobile .people-details {
    border-radius: 18px;
    background: rgba(118, 118, 128, 0.12);
    border-color: rgba(255, 255, 255, 0.1);
  }
}

/* Узкая ширина + только мобильный клиент: не переопределяем десктоп при узком окне. */
@media (max-width: 820px) {
  body.device-mobile,
  body.device-mobile button,
  body.device-mobile input,
  body.device-mobile select {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, sans-serif !important;
    letter-spacing: 0 !important;
  }

  body.device-mobile {
    --movie-card-radius: 16px;
    background:
      linear-gradient(180deg, #111216 0%, #0a0b10 46%, #050506 100%) fixed,
      #050506 !important;
  }

  body.device-mobile.mobile-watch-open,
  html.device-mobile.mobile-watch-open {
    overflow: hidden;
  }

  body.device-mobile .app-header {
    min-height: 110px !important;
    background: rgba(18, 18, 22, 0.64) !important;
    border-bottom-color: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(28px) saturate(1.85) !important;
    -webkit-backdrop-filter: blur(28px) saturate(1.85) !important;
    box-shadow: 0 12px 44px rgba(0, 0, 0, 0.34);
  }

  body.device-mobile .mobile-menu-toggle {
    width: 40px;
    height: 40px;
    border-color: rgba(255, 255, 255, 0.18);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.07));
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.18),
      0 10px 26px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(18px) saturate(1.5);
    -webkit-backdrop-filter: blur(18px) saturate(1.5);
  }

  body.device-mobile .brand-logo-img {
    height: 44px !important;
  }

  body.device-mobile .search {
    min-height: 44px !important;
    border-radius: 22px !important;
    background: rgba(118, 118, 128, 0.18) !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.11);
  }

  body.device-mobile .search input {
    height: 36px;
    font-size: 15px !important;
    font-weight: 480;
  }

  body.device-mobile .search button[type="submit"] {
    height: 34px;
    min-height: 34px !important;
    min-width: 76px;
    font-size: 14px !important;
    font-weight: 700;
  }

  body.device-mobile.mobile-menu-open .app-header .auth-bar {
    background:
      linear-gradient(180deg, rgba(42, 42, 48, 0.84), rgba(18, 18, 22, 0.78)) !important;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.16),
      0 28px 80px rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(34px) saturate(1.85);
    -webkit-backdrop-filter: blur(34px) saturate(1.85);
  }

  body.device-mobile .rail-stack > .rail {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body.device-mobile .workspace {
    padding-top: 132px !important;
  }

  body.device-mobile .catalog-context-title {
    font-size: 30px !important;
    font-weight: 800;
    letter-spacing: -0.01em !important;
  }

  body.device-mobile .catalog-context-subtitle {
    font-size: 13px !important;
    font-weight: 560;
  }

  body.device-mobile .section-wall,
  body.device-mobile .workspace.has-card .section-wall {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 16px 9px !important;
  }

  body.device-mobile .movie-card,
  body.device-mobile .workspace.has-card .movie-card {
    border-radius: 14px !important;
    background: rgba(32, 32, 36, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28) !important;
  }

  body.device-mobile .movie-card .poster {
    aspect-ratio: 2 / 3 !important;
  }

  body.device-mobile .poster-title {
    left: 8px;
    right: 8px;
    bottom: 8px;
  }

  body.device-mobile .poster-title strong {
    margin-bottom: 5px;
    font-size: clamp(11px, 3.05vw, 13px) !important;
    line-height: 1.08 !important;
    font-weight: 760;
  }

  body.device-mobile .poster-title span {
    margin-bottom: 0;
    font-size: 10px !important;
    line-height: 1.1;
    font-weight: 650;
  }

  body.device-mobile .poster-badges {
    left: 7px;
    top: 7px;
    right: 7px;
    gap: 3px;
    transform: scale(0.72);
    transform-origin: top left;
  }

  body.device-mobile .badge {
    height: 23px;
    padding-inline: 8px !important;
    font-size: 11px !important;
  }

  body.device-mobile .card-strip {
    min-height: 32px !important;
    padding: 8px 9px !important;
    font-size: 10.5px !important;
    font-weight: 620;
  }

  body.device-mobile::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 88;
    background: rgba(0, 0, 0, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }

  body.device-mobile.mobile-watch-open::before {
    opacity: 1;
    pointer-events: auto;
  }

  /* Deprecated mobile watch-panel block removed — see FINAL MOBILE SHEET OVERRIDES at end of file */
  body.device-mobile .deprecated-old-mobile-watch-panel-stub__a {
    display: none;
  }

  body.device-mobile .watch-panel.is-touch-dragging {
    transition: none !important;
  }

  body.device-mobile .watch-panel::before {
    content: "";
    position: sticky;
    top: 8px;
    z-index: 70;
    display: block;
    width: 42px;
    height: 5px;
    margin: 8px auto -13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.32);
  }

  body.device-mobile .workspace.has-card .catalog {
    grid-row: 1 !important;
  }

  body.device-mobile .watch-panel > .screen,
  body.device-mobile .workspace.has-card .watch-panel > .screen,
  body.device-mobile .workspace.has-card .watch-panel > .screen.playing {
    border-radius: 30px 30px 0 0 !important;
    overflow: hidden;
  }

  body.device-mobile .screen,
  body.device-mobile .screen.playing,
  body.device-mobile .screen-hero-stack,
  body.device-mobile .screen.playing .screen-hero-stack {
    min-height: clamp(320px, 78vw, 460px) !important;
  }

  body.device-mobile .screen-content {
    padding: 72px 18px 20px !important;
  }

  body.device-mobile .screen h2 {
    font-size: clamp(31px, 9.2vw, 48px) !important;
    font-weight: 820;
    letter-spacing: -0.02em !important;
  }

  body.device-mobile .screen-content .meta {
    font-size: 16px !important;
    line-height: 1.25;
    color: rgba(245, 245, 247, 0.76);
  }

  body.device-mobile .hero-overline {
    font-size: 11px !important;
    font-weight: 780;
    letter-spacing: 0.11em !important;
  }

  body.device-mobile .play {
    width: 68px !important;
    height: 68px !important;
    font-size: 26px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
  }

  body.device-mobile .screen-hero-controls {
    padding: 18px 14px 0 !important;
  }

  body.device-mobile .watch-tool-btn {
    width: 44px;
    height: 44px;
    border: 0;
    background: rgba(118, 118, 128, 0.36);
    backdrop-filter: blur(20px) saturate(1.6);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
  }

  body.device-mobile .watch-body {
    padding: 14px 18px 22px !important;
    background: transparent !important;
  }

  body.device-mobile .watch-ratings-compact {
    border-top-color: rgba(255, 255, 255, 0.12);
    font-size: 12px;
  }

  body.device-mobile .watch-body p {
    font-size: 16px;
    line-height: 1.42;
    color: rgba(245, 245, 247, 0.88);
  }

  body.device-mobile .people-details {
    border-radius: 18px;
    background: rgba(118, 118, 128, 0.12);
    border-color: rgba(255, 255, 255, 0.1);
  }
}

/* Mobile app refinement: clean drawer, inline player, calmer details. */
@media (max-width: 820px) {
  html.device-mobile{
    --sticky-below-header: 116px;
    --page-pad-x: 14px;
  }

  body.device-mobile .app-header{
    min-height: 108px !important;
    padding: max(8px, env(safe-area-inset-top)) 14px 10px !important;
    border-bottom: 0 !important;
  }

  body.device-mobile .mobile-menu-toggle{
    width: 38px !important;
    height: 38px !important;
  }

  body.device-mobile .mobile-menu-toggle span{
    width: 17px !important;
  }

  body.device-mobile .search{
    min-height: 42px !important;
    padding: 3px !important;
    grid-template-columns: minmax(0, 1fr) 32px 72px !important;
  }

  body.device-mobile .search .search-clear-btn{
    width: 32px;
    height: 32px;
    min-height: 32px !important;
    font-size: 23px;
  }

  body.device-mobile .search button[type="submit"]{
    height: 32px;
    min-height: 32px !important;
    min-width: 72px;
    padding-inline: 14px !important;
  }

  body.device-mobile .site-footer{
    padding: 0 6px 4px !important;
  }

  body.device-mobile .workspace{
    padding-top: 126px !important;
  }

  body.device-mobile .catalog-context{
    margin-bottom: 14px !important;
  }

  body.device-mobile .catalog-context-title{
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(28px, 8.2vw, 36px) !important;
    line-height: 1.04 !important;
  }

  body.device-mobile .section-wall,
  body.device-mobile .workspace.has-card .section-wall{
    gap: 14px 8px !important;
  }

  body.device-mobile .movie-card,
  body.device-mobile .workspace.has-card .movie-card {
    border-radius: 16px !important;
    overflow: hidden !important;
    isolation: isolate;
  }

  /* Градиентная рамка выбранной карты (::after с inset:-2px) — как на десктопе. */
  body.device-mobile .movie-card.active,
  body.device-mobile .workspace.has-card .movie-card.active {
    overflow: visible !important;
    z-index: 1;
  }

  body.device-mobile .movie-card .poster,
  body.device-mobile .workspace.has-card .movie-card .poster,
  body.device-mobile .movie-card .poster .poster-img,
  body.device-mobile .movie-card .poster::after,
  body.device-mobile .movie-card .poster-fallback {
    border-radius: 16px !important;
  }

  body.device-mobile .poster-title strong{
    display: -webkit-box;
    min-height: 2.16em;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  body.device-mobile .card-strip{
    display: none !important;
  }

  body.device-mobile.mobile-watch-open::before{
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(10px) saturate(1.2);
    -webkit-backdrop-filter: blur(10px) saturate(1.2);
  }

  /* Deprecated mobile watch-panel block removed — see FINAL MOBILE SHEET OVERRIDES at end of file */
  body.device-mobile .deprecated-old-mobile-watch-panel-stub__b{
    display: none;
  }

  body.device-mobile .watch-panel::before{
    cursor: default;
    pointer-events: none;
  }

  body.device-mobile .watch-panel > .screen,
  body.device-mobile .workspace.has-card .watch-panel > .screen,
  body.device-mobile .workspace.has-card .watch-panel > .screen.playing{
    border-radius: 30px 30px 0 0 !important;
  }

  body.device-mobile .screen:not(:has(.mobile-inline-player--poster-slot)),
  body.device-mobile .screen.playing:not(:has(.mobile-inline-player--poster-slot)),
  body.device-mobile .screen-hero-stack:not(:has(.mobile-inline-player--poster-slot)),
  body.device-mobile .screen.playing .screen-hero-stack:not(:has(.mobile-inline-player--poster-slot)) {
    min-height: clamp(292px, 72vw, 430px) !important;
  }

  body.device-mobile .screen.playing .screen-hero-stack:not(:has(.mobile-inline-player--poster-slot)) {
    min-height: 0 !important;
  }

  body.device-mobile .watch-panel .screen-hero-stack .mobile-inline-player--poster-slot {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    background: #000;
    pointer-events: auto;
  }

  body.device-mobile .watch-panel .screen-hero-stack .mobile-inline-player--poster-slot .mobile-player-fullscreen-open {
    position: absolute;
    top: max(8px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    left: auto;
    z-index: 72;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(14, 14, 18, 0.82);
    color: rgba(252, 252, 255, 0.96);
    font-size: 13px;
    font-weight: 650;
    letter-spacing: 0.02em;
    text-decoration: none;
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    backdrop-filter: blur(14px) saturate(1.2);
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.38);
  }

  body.device-mobile .watch-panel .screen-hero-stack .mobile-inline-player--poster-slot .mobile-player-fullscreen-open:active {
    opacity: 0.92;
  }

  body.device-mobile .watch-panel .screen-hero-stack .mobile-inline-player--poster-slot .fkwatch-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    border-radius: 0;
    aspect-ratio: unset;
    overflow: hidden;
    background: #000;
  }

  body.device-mobile .watch-panel .screen-hero-stack .mobile-inline-player--poster-slot .fkwatch-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #000;
  }

  body.device-mobile .watch-panel .screen-hero-stack .mobile-inline-player--poster-slot .mobile-kinobox-host,
  body.device-mobile .watch-panel .screen-hero-stack .mobile-inline-player--poster-slot .kinobox_section,
  body.device-mobile .watch-panel .screen-hero-stack .mobile-inline-player--poster-slot .kinobox_container,
  body.device-mobile .watch-panel .screen-hero-stack .mobile-inline-player--poster-slot .kinobox_iframe_container {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
  }

  body.device-mobile .watch-panel .screen-hero-stack .mobile-inline-player--poster-slot .kinobox_container {
    aspect-ratio: unset !important;
  }

  body.device-mobile .watch-panel .screen-hero-stack .mobile-inline-player--poster-slot .mobile-kinobox-host iframe {
    position: static !important;
    inset: auto !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    z-index: 9999 !important;
    border: 0 !important;
    background: #000 !important;
  }

  body.device-mobile .mobile-inline-player:not(.mobile-inline-player--poster-slot) {
    position: relative;
    width: 100%;
    padding: 18px 10px 0;
    background: #050505;
  }

  body.device-mobile .mobile-inline-player-chrome{
    position: absolute;
    top: 18px;
    left: 10px;
    right: 10px;
    z-index: 8;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    pointer-events: none;
  }

  body.device-mobile .mobile-inline-player-chrome button{
    pointer-events: auto;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(18, 18, 22, 0.82);
    color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(14px) saturate(1.4);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    touch-action: manipulation;
  }

  body.device-mobile .mobile-inline-player-chrome button:active{
    transform: scale(0.96);
  }

  body.device-mobile .mobile-player-expand-close{
    display: none;
  }

  html.device-mobile.mobile-player-expand-ui .mobile-player-expand-close,
  body.device-mobile .mobile-inline-player:fullscreen .mobile-player-expand-close,
  body.device-mobile .mobile-inline-player:-webkit-full-screen .mobile-player-expand-close{
    display: grid;
  }

  html.device-mobile.mobile-player-expand-ui .mobile-player-expand-btn,
  body.device-mobile .mobile-inline-player:fullscreen .mobile-player-expand-btn,
  body.device-mobile .mobile-inline-player:-webkit-full-screen .mobile-player-expand-btn{
    display: none;
  }

  body.device-mobile .mobile-inline-player .fkwatch-frame{
    min-height: 0 !important;
    aspect-ratio: 16 / 9;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #050505;
  }

  body.device-mobile .screen-content{
    padding: 74px 18px 20px !important;
  }

  body.device-mobile .screen h2{
    font-size: clamp(30px, 8.6vw, 46px) !important;
    line-height: 1.02 !important;
  }

  body.device-mobile .screen-content .meta{
    font-size: 15px !important;
  }

  body.device-mobile .play{
    width: 64px !important;
    height: 64px !important;
    font-size: 24px;
  }

  body.device-mobile .screen-hero-controls{
    padding: 18px 14px 0 !important;
  }

  body.device-mobile .watch-tool-close{
    background: rgba(28, 28, 30, 0.62) !important;
  }

  body.device-mobile .watch-body{
    display: grid;
    gap: 12px;
    padding: 14px 16px max(22px, env(safe-area-inset-bottom)) !important;
  }

  body.device-mobile .watch-ratings-compact{
    order: 1;
    margin: 0 !important;
    padding: 12px 0 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  body.device-mobile .watch-description{
    order: 2;
    margin: 0 !important;
    font-size: 15.5px !important;
    line-height: 1.42 !important;
  }

  body.device-mobile .description-toggle{
    order: 3;
    justify-self: start;
    min-height: 34px;
    padding: 0 !important;
    color: #b987ff;
    background: transparent !important;
    font-size: 14px !important;
    font-weight: 760;
  }

  body.device-mobile .people-block{
    order: 4;
    display: grid;
    gap: 8px;
  }

  body.device-mobile .franchise-block{
    display: none !important;
  }

  body.device-mobile .people-details{
    margin: 0 !important;
    border-radius: 18px !important;
    background: rgba(118, 118, 128, 0.12) !important;
  }

  body.device-mobile .people-details-summary{
    min-height: 46px;
    padding: 0 14px !important;
  }

  body.device-mobile .people-details-heading{
    font-size: 13px !important;
    letter-spacing: 0.08em !important;
  }

  body.device-mobile .people-details-body{
    padding: 0 14px 14px !important;
  }

  body.device-mobile .chips-row{
    gap: 7px;
  }

  body.device-mobile .info-chip{
    min-height: 30px;
    padding: 0 10px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
  }
}

/* Final mobile drawer: opaque left panel, clean scale, account actions pinned bottom. */
@media (max-width: 820px) {
  body.device-mobile .mobile-menu-toggle{
    position: relative;
    display: inline-grid !important;
    place-items: center;
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    border-radius: 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    background: #1d1d21 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body.device-mobile .mobile-menu-toggle span{
    position: absolute;
    width: 18px !important;
    height: 2px !important;
    margin: 0 !important;
    border-radius: 999px;
    background: rgba(245, 245, 247, 0.92);
    transform-origin: center;
  }

  body.device-mobile .mobile-menu-toggle span:nth-child(1){
    transform: translateY(-5px);
  }

  body.device-mobile .mobile-menu-toggle span:nth-child(2){
    transform: translateY(0);
  }

  body.device-mobile .mobile-menu-toggle span:nth-child(3){
    transform: translateY(5px);
  }

  body.device-mobile.mobile-menu-open .mobile-menu-toggle{
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    left: 18px;
    z-index: 101;
    background: #2b2b30 !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
  }

  body.device-mobile.mobile-menu-open .mobile-menu-toggle span:nth-child(1){
    transform: rotate(45deg);
  }

  body.device-mobile.mobile-menu-open .mobile-menu-toggle span:nth-child(2){
    opacity: 0;
  }

  body.device-mobile.mobile-menu-open .mobile-menu-toggle span:nth-child(3){
    transform: rotate(-45deg);
  }

  body.device-mobile.mobile-menu-open .app-shell::before{
    z-index: 78;
    opacity: 1;
    background: rgba(0, 0, 0, 0.46);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* Keep drawer controls above the opaque panel without showing the full header. */
@media (max-width: 820px) {
  body.mobile-menu-open .app-header {
    z-index: 110 !important;
    pointer-events: none;
    border-bottom-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body.mobile-menu-open .app-header .brand,
  body.mobile-menu-open .app-header .search {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  body.mobile-menu-open .mobile-menu-toggle,
  body.mobile-menu-open .app-header .auth-bar,
  body.mobile-menu-open .app-header .auth-bar * {
    pointer-events: auto;
  }
}

/* Polished mobile menu glyph: lighter two-line burger that turns into a close icon. */
@media (max-width: 820px) {
  .mobile-menu-toggle span:nth-child(1) {
    transform: translateY(-4px) !important;
  }

  .mobile-menu-toggle span:nth-child(2) {
    display: none !important;
  }

  .mobile-menu-toggle span:nth-child(3) {
    transform: translateY(4px) !important;
  }

  body.mobile-menu-open .mobile-menu-toggle span:nth-child(1) {
    transform: rotate(45deg) !important;
  }

  body.mobile-menu-open .mobile-menu-toggle span:nth-child(3) {
    transform: rotate(-45deg) !important;
  }
}

/* Premium mobile drawer: solid panel, soft motion, staged sections. */
@media (max-width: 820px) {
  @keyframes mobileDrawerSectionIn {
    from {
      opacity: 0;
      transform: translateX(-14px) scale(0.985);
    }
    to {
      opacity: 1;
      transform: translateX(0) scale(1);
    }
  }

  @keyframes mobileDrawerActionIn {
    from {
      opacity: 0;
      transform: translateY(12px) scale(0.98);
    }
    to {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  .mobile-menu-toggle {
    width: 42px !important;
    height: 42px !important;
    border-radius: 15px !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    background: #202024 !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 10px 28px rgba(0, 0, 0, 0.28) !important;
    transition:
      transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1),
      background 180ms ease,
      border-color 180ms ease,
      box-shadow 180ms ease !important;
  }

  .mobile-menu-toggle:active {
    transform: scale(0.94);
  }

  .mobile-menu-toggle span {
    width: 17px !important;
    height: 2px !important;
    background: #f4f4f6 !important;
    transition:
      transform 260ms cubic-bezier(0.2, 0.9, 0.18, 1),
      opacity 160ms ease,
      width 180ms ease !important;
  }

  body.mobile-menu-open .mobile-menu-toggle {
    top: max(15px, env(safe-area-inset-top)) !important;
    left: 17px !important;
    border-radius: 15px !important;
    background: #2a2a2f !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.09),
      0 12px 32px rgba(0, 0, 0, 0.34) !important;
  }

  body.mobile-menu-open .app-shell::before {
    opacity: 1 !important;
    background: rgba(0, 0, 0, 0.62) !important;
    transition: opacity 280ms ease !important;
  }

  .catalog,
  .watch-panel {
    transition:
      transform 300ms cubic-bezier(0.22, 1, 0.36, 1),
      opacity 240ms ease,
      filter 240ms ease;
  }

  body.mobile-menu-open .catalog,
  body.mobile-menu-open .watch-panel {
    transform: translateX(18px) scale(0.985);
    opacity: 0.5;
    filter: saturate(0.82);
  }

  @media (prefers-reduced-motion: reduce) {
    .mobile-menu-toggle,
    .mobile-menu-toggle span,
    .rail-stack,
    .catalog,
    .watch-panel,
    body.mobile-menu-open .rail-stack > .rail::before,
    body.mobile-menu-open .rail-block,
    body.mobile-menu-open .rail-catalog-filters,
    body.mobile-menu-open .rail-stack > .site-footer,
    body.mobile-menu-open .app-header .auth-bar {
      animation: none !important;
      transition: none !important;
    }
  }
}

/* Final mobile v360 override: this block intentionally lives last. */
@media (max-width: 820px) {
  html.device-mobile,
  body.device-mobile {
    background: #08080b !important;
  }

  body.device-mobile {
    background:
      linear-gradient(180deg, #101014 0, #08080b 190px, #050506 100%) !important;
  }

  body.device-mobile .app-header {
    isolation: isolate;
    overflow: visible;
    min-height: 124px !important;
    padding:
      max(10px, env(safe-area-inset-top))
      14px
      14px !important;
    background: linear-gradient(180deg, #101014 0%, rgba(16, 16, 20, 0.99) 62%, rgba(12, 12, 15, 0.96) 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow:
      0 16px 34px rgba(0, 0, 0, 0.34),
      0 1px 0 rgba(255, 255, 255, 0.04) inset !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body.device-mobile .app-header::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -120px;
    height: calc(100% + 120px);
    z-index: -1;
    background: linear-gradient(180deg, #101014 0%, #101014 54%, rgba(16, 16, 20, 0.94) 100%);
    pointer-events: none;
  }

  body.device-mobile .brand-logo-img {
    height: 43px !important;
  }

  body.device-mobile .search {
    width: 100%;
    min-height: 48px !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: center;
    padding: 4px 16px !important;
    border-radius: 999px !important;
    background: #1f1f24 !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 10px 26px rgba(0, 0, 0, 0.26) !important;
  }

  body.device-mobile .search.has-query {
    grid-template-columns: minmax(0, 1fr) 34px 76px !important;
    padding: 4px !important;
  }

  body.device-mobile .search input {
    min-width: 0;
    width: 100%;
    height: 38px !important;
    padding: 0 !important;
    color: #f5f5f7;
    font-size: 15px !important;
    font-weight: 520 !important;
  }

  body.device-mobile .search input::placeholder {
    color: rgba(245, 245, 247, 0.58);
    opacity: 1;
  }

  body.device-mobile .search.has-query input {
    padding-left: 10px !important;
  }

  body.device-mobile .search:not(.has-query) .search-clear-btn,
  body.device-mobile .search:not(.has-query) button[type="submit"] {
    display: none !important;
  }

  body.device-mobile .search .search-clear-btn {
    width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    border-radius: 999px !important;
  }

  body.device-mobile .search button[type="submit"] {
    width: 76px !important;
    min-width: 76px !important;
    height: 34px !important;
    min-height: 34px !important;
    border-radius: 999px !important;
    font-size: 14px !important;
  }

  body.device-mobile .workspace {
    padding-top: 140px !important;
  }

  body.device-mobile .section-wall,
  body.device-mobile .workspace.has-card .section-wall {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 16px 10px !important;
  }

  html.device-mobile.mobile-menu-open,
  body.device-mobile.mobile-menu-open {
    overflow: hidden !important;
  }

  body.device-mobile.mobile-menu-open .app-shell::before {
    z-index: 88 !important;
    opacity: 1 !important;
    background: rgba(0, 0, 0, 0.64) !important;
    transition: opacity 280ms ease !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body.device-mobile .catalog,
  body.device-mobile .watch-panel {
    transition:
      transform 420ms cubic-bezier(0.22, 1, 0.36, 1),
      opacity 280ms ease,
      filter 280ms ease !important;
  }

  body.device-mobile.mobile-menu-open .catalog,
  body.device-mobile.mobile-menu-open .watch-panel {
    transform: translateX(22px) scale(0.975) !important;
    opacity: 0.38 !important;
    filter: saturate(0.72) brightness(0.78) !important;
  }

  body.device-mobile .rail-stack {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    bottom: 0 !important;
    z-index: 96 !important;
    width: min(88vw, 360px) !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: column;
    gap: 0 !important;
    padding:
      calc(max(16px, env(safe-area-inset-top)) + 68px)
      14px
      calc(max(22px, env(safe-area-inset-bottom)) + 36px) !important;
    border-radius: 0 30px 30px 0 !important;
    border: 0 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: #121215 !important;
    box-shadow:
      34px 0 80px rgba(0, 0, 0, 0.58),
      inset -1px 0 0 rgba(255, 255, 255, 0.05) !important;
    opacity: 1 !important;
    overflow: hidden !important;
    pointer-events: none;
    transform: translate3d(calc(-100% - 18px), 0, 0) !important;
    transition: transform 520ms cubic-bezier(0.22, 1, 0.36, 1) !important;
    will-change: transform;
  }

  body.device-mobile.mobile-menu-open .rail-stack {
    transform: translate3d(0, 0, 0) !important;
    pointer-events: auto;
  }

  body.device-mobile .rail-stack::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 170px),
      linear-gradient(90deg, transparent calc(100% - 1px), rgba(255, 255, 255, 0.14));
    pointer-events: none;
  }

  body.device-mobile .rail-stack > .rail {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-height: 0;
    width: 100% !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding: 0 0 20px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  body.device-mobile .rail-stack > .rail::-webkit-scrollbar {
    display: none;
  }

  body.device-mobile .rail-stack > .rail::before {
    content: "Меню";
    display: block;
    margin: 0 4px 20px 58px !important;
    color: #f5f5f7 !important;
    font-size: 28px !important;
    line-height: 42px !important;
    font-weight: 850 !important;
    letter-spacing: -0.01em !important;
    opacity: 1 !important;
    transform: none !important;
  }

  body.device-mobile .rail-block,
  body.device-mobile .rail-catalog-filters,
  body.device-mobile .rail-stack > .site-footer {
    opacity: 1 !important;
    transform: none !important;
  }

  body.device-mobile.mobile-menu-open .rail-stack > .rail::before,
  body.device-mobile.mobile-menu-open .rail-block,
  body.device-mobile.mobile-menu-open .rail-catalog-filters,
  body.device-mobile.mobile-menu-open .rail-stack > .site-footer {
    animation: mobileDrawerSectionIn 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  body.device-mobile.mobile-menu-open .rail-stack > .rail::before {
    animation-delay: 80ms;
  }

  body.device-mobile.mobile-menu-open .rail-block:nth-of-type(1) {
    animation-delay: 125ms;
  }

  body.device-mobile.mobile-menu-open .rail-block:nth-of-type(2) {
    animation-delay: 175ms;
  }

  body.device-mobile.mobile-menu-open .rail-catalog-filters {
    animation-delay: 225ms;
  }

  body.device-mobile.mobile-menu-open .rail-block.rail-block--mobile-only {
    animation-delay: 255ms;
  }

  body.device-mobile.mobile-menu-open .rail-stack > .site-footer {
    animation-delay: 300ms;
  }

  body.device-mobile .rail-block,
  body.device-mobile .rail-catalog-filters {
    margin: 0 0 12px !important;
    padding: 12px !important;
    border-radius: 22px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: #1b1b1f !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  }

  body.device-mobile .rail .segment {
    min-height: 44px !important;
    padding: 0 14px !important;
    border-radius: 15px !important;
    font-size: 15px !important;
    font-weight: 760 !important;
  }

  body.device-mobile .rail-catalog-filters {
    gap: 10px !important;
    padding-bottom: 14px !important;
  }

  body.device-mobile .rail-catalog-filters select,
  body.device-mobile #resetFilters {
    min-height: 44px !important;
    border-radius: 15px !important;
  }

  body.device-mobile .rail-stack > .site-footer {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    margin: 10px 0 0 !important;
    padding: 0 4px !important;
  }

  body.device-mobile.mobile-menu-open .app-header {
    z-index: 120 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-bottom-color: transparent !important;
    pointer-events: none;
  }

  body.device-mobile.mobile-menu-open .app-header::before,
  body.device-mobile.mobile-menu-open .app-header .brand,
  body.device-mobile.mobile-menu-open .app-header .search {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  body.device-mobile.mobile-menu-open .mobile-menu-toggle {
    position: fixed !important;
    top: max(18px, env(safe-area-inset-top)) !important;
    left: 18px !important;
    z-index: 130 !important;
    pointer-events: auto;
  }

  body.device-mobile.mobile-menu-open .app-header .auth-bar {
    position: fixed !important;
    left: max(14px, env(safe-area-inset-left, 0px)) !important;
    bottom: max(16px, env(safe-area-inset-bottom)) !important;
    z-index: 125 !important;
    display: grid !important;
    box-sizing: border-box !important;
    width: calc(
      min(88vw, 360px) - max(14px, env(safe-area-inset-left, 0px)) - max(14px, env(safe-area-inset-right, 0px))
    ) !important;
    grid-template-columns: 1fr !important;
    gap: 9px !important;
    padding: 10px !important;
    border-radius: 22px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: #19191d !important;
    box-shadow:
      0 -16px 36px rgba(0, 0, 0, 0.44),
      inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto;
    animation: mobileDrawerActionIn 420ms cubic-bezier(0.22, 1, 0.36, 1) 300ms both !important;
  }

  body.device-mobile.mobile-menu-open .auth-header-btn {
    width: 100% !important;
    justify-self: stretch !important;
    min-height: 46px !important;
    border-radius: 16px !important;
    font-size: 15px !important;
    font-weight: 820 !important;
  }

  body.performance-lite.device-mobile .rail-stack,
  body.performance-lite.device-mobile .mobile-menu-toggle,
  body.performance-lite.device-mobile .mobile-menu-toggle span,
  body.performance-lite.device-mobile .catalog,
  body.performance-lite.device-mobile .watch-panel,
  body.performance-lite.device-mobile .app-shell::before {
    transition-duration: 420ms !important;
  }
}

/* Final mobile v361 safe-area header override. */
@media (max-width: 820px) {
  html.device-mobile,
  body.device-mobile {
    background: #101014 !important;
  }

  body.device-mobile .app-shell {
    background: #050506 !important;
  }

  body.device-mobile .app-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 90 !important;
    min-height: calc(124px + env(safe-area-inset-top, 0px)) !important;
    padding-top: max(12px, env(safe-area-inset-top, 0px)) !important;
    background: linear-gradient(180deg, #101014 0%, #101014 44%, rgba(16, 16, 20, 0.99) 74%, rgba(12, 12, 15, 0.97) 100%) !important;
    transform: translateZ(0);
  }

  body.device-mobile .app-header::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(124px + env(safe-area-inset-top, 0px));
    z-index: -1;
    background: #101014;
    pointer-events: none;
  }

  body.device-mobile .workspace {
    padding-top: calc(140px + env(safe-area-inset-top, 0px)) !important;
  }

  body.device-mobile.mobile-menu-open .app-header {
    background: transparent !important;
  }
}


/* Final mobile v368 footer cleanup: must stay last. */
@media (max-width: 820px) {
  body.device-mobile .rail-stack > .site-footer {
    flex: 0 0 auto !important;
    margin: 2px 0 0 !important;
    padding: 4px 8px 2px !important;
    text-align: center !important;
  }

  body.device-mobile .site-footer-nav {
    display: flex !important;
    justify-content: center !important;
  }

  body.device-mobile .site-footer-tagline,
  body.device-mobile .site-footer-copy {
    display: none !important;
  }

  body.device-mobile .site-footer-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 34px !important;
    padding: 0 14px !important;
    border-radius: 999px !important;
    color: rgba(245, 245, 247, 0.72) !important;
    font-size: 12px !important;
    font-weight: 760 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-align: center !important;
  }
}

/* Мобильный плеер: полноэкран через API + запасной слой (iOS не даёт полноэкранить глубоко вложенный iframe). */
html.mobile-player-expand-ui,
html.mobile-player-expand-ui body {
  overflow: hidden !important;
}

html.mobile-player-expand-ui body.device-mobile.mobile-watch-open::before {
  opacity: 0 !important;
  pointer-events: none !important;
}

html.mobile-player-expand-ui .mobile-inline-player {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483000 !important;
  box-sizing: border-box !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: var(--mobile-player-vh, 100vh) !important;
  max-height: var(--mobile-player-vh, 100vh) !important;
  margin: 0 !important;
  padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right))
    max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)) !important;
  background: #000 !important;
  display: flex !important;
  flex-direction: column !important;
}

html.mobile-player-expand-ui .mobile-inline-player-chrome {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  flex: 0 0 auto !important;
  width: 100% !important;
  padding: 0 0 10px !important;
}

html.mobile-player-expand-ui .mobile-inline-player .fkwatch-frame {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  width: 100% !important;
  aspect-ratio: unset !important;
  border-radius: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
}

html.mobile-player-expand-ui .mobile-inline-player .fkwatch-frame iframe {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
}

.mobile-fullscreen-player-layer {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  z-index: 2147483000 !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  overflow: hidden !important;
  background: #000 !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  margin: 0 !important;
  transform: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.mobile-fullscreen-player-layer .fkwatch-frame {
  flex: 1 1 auto !important;
  aspect-ratio: unset !important;
  border-radius: 0 !important;
  overflow: hidden !important;
}

.mobile-fullscreen-player-layer .fkwatch-frame iframe {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
}

.mobile-fullscreen-player-close {
  position: fixed !important;
  top: max(12px, env(safe-area-inset-top)) !important;
  right: max(12px, env(safe-area-inset-right)) !important;
  z-index: 2147483001 !important;
  display: grid !important;
  place-items: center !important;
  width: 46px !important;
  height: 46px !important;
  padding: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: 999px !important;
  background: rgba(10, 10, 14, 0.72) !important;
  color: rgba(255, 255, 255, 0.94) !important;
  font: 400 28px / 1 var(--font-display, system-ui, sans-serif) !important;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45) !important;
  backdrop-filter: blur(14px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.2) !important;
  touch-action: manipulation !important;
}

.mobile-inline-player:-webkit-full-screen,
.mobile-inline-player:fullscreen {
  z-index: 2147483000 !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  width: 100% !important;
  height: 100vh !important;
  height: 100% !important;
  max-height: 100% !important;
  padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right))
    max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)) !important;
  background: #000 !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
}

.mobile-inline-player:-webkit-full-screen .mobile-inline-player-chrome,
.mobile-inline-player:fullscreen .mobile-inline-player-chrome {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  flex: 0 0 auto !important;
  width: 100% !important;
  padding: 0 0 10px !important;
}

.mobile-inline-player:-webkit-full-screen .fkwatch-frame,
.mobile-inline-player:fullscreen .fkwatch-frame {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  aspect-ratio: unset !important;
  border-radius: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
}

.mobile-inline-player:-webkit-full-screen .fkwatch-frame iframe,
.mobile-inline-player:fullscreen .fkwatch-frame iframe {
  width: 100% !important;
  height: 100% !important;
}

/* =====================================================================
   FINAL MOBILE SHEET OVERRIDES (last in cascade, highest specificity)
   Эти правила обязаны быть последними в файле.
   ===================================================================== */
@media (max-width: 820px) {
  html body.device-mobile {
    --mobile-sheet-top: 132px;
  }

  /* Карточка во всю ширину, выезжает снизу, верх перекрывает шапку */
  html body.device-mobile .workspace.has-card .watch-panel,
  html body.device-mobile.mobile-watch-open .workspace.has-card .watch-panel {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: calc(var(--mobile-sheet-top, 132px) - 8px) !important;
    bottom: auto !important;
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    /* fallback для старых iOS Safari */
    height: calc(100vh - var(--mobile-sheet-top, 132px) + 20px) !important;
    /* dvh = dynamic viewport, корректно учитывает Safari toolbar */
    height: calc(100dvh - var(--mobile-sheet-top, 132px) + 20px) !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    z-index: 97 !important;
    border-radius: 30px 30px 0 0 !important;
    border: 0 !important;
    background:
      linear-gradient(180deg, #1c1c20 0%, #0b0b0e 100%) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow:
      0 -18px 72px rgba(0, 0, 0, 0.58),
      0 -10px 55px var(--poster-glow-color, rgba(0, 0, 0, 0)) !important;
  }

  /*
   Инлайн-видео в том же блоке высоты, что и постер; шторка и колонка описания — как без плеера.
  */
  html body.device-mobile .workspace.has-card .watch-panel > .screen,
  html body.device-mobile .workspace.has-card .watch-panel > .screen.playing {
    border-radius: 30px 30px 0 0 !important;
    overflow: hidden !important;
    flex: 0 0 auto !important;
    min-height: 0 !important;
    max-height: min(46vh, 380px) !important;
  }

  html body.device-mobile.mobile-watch-open .workspace.has-card .watch-panel > .screen:has(.mobile-inline-player--poster-slot),
  html body.device-mobile.mobile-watch-open .workspace.has-card .watch-panel > .screen.playing:has(.mobile-inline-player--poster-slot),
  html body.device-mobile .workspace.has-card .watch-panel > .screen:has(.mobile-inline-player--poster-slot),
  html body.device-mobile .workspace.has-card .watch-panel > .screen.playing:has(.mobile-inline-player--poster-slot) {
    max-height: min(46vh, 380px) !important;
    min-height: 0 !important;
  }

  html body.device-mobile .workspace.has-card .watch-panel > .watch-body {
    flex: 1 1 0 !important;
    height: 0 !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
    touch-action: pan-y !important;
    padding: 22px 18px calc(env(safe-area-inset-bottom, 0px) + 64px) !important;
    background: linear-gradient(180deg, #0b0b0e 0%, #08080b 100%) !important;
  }

  html.mobile-inline-player-native-fs body.device-mobile .workspace.has-card .watch-panel:has(.mobile-inline-player) > .watch-body {
    visibility: hidden !important;
    max-height: 0 !important;
    min-height: 0 !important;
    flex: 0 0 0 !important;
    opacity: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    border: none !important;
    background: transparent !important;
  }

  /* Inline-плеер: верхняя панель отдельным рядом — не наезжает на видео */
  html body.device-mobile.mobile-watch-open .workspace.has-card .watch-panel > .screen:has(.mobile-inline-player--poster-slot),
  html body.device-mobile .workspace.has-card .watch-panel > .screen:has(.mobile-inline-player--poster-slot) {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  html body.device-mobile.mobile-watch-open .workspace.has-card .watch-panel > .screen:has(.mobile-inline-player--poster-slot):has(#mobileInlinePlayerMeta:not([hidden])),
  html body.device-mobile .workspace.has-card .watch-panel > .screen:has(.mobile-inline-player--poster-slot):has(#mobileInlinePlayerMeta:not([hidden])) {
    max-height: min(56vh, 460px) !important;
  }

  html body.device-mobile.mobile-watch-open .workspace.has-card .watch-panel > .screen:has(.mobile-inline-player--poster-slot) .screen-hero-controls,
  html body.device-mobile .workspace.has-card .watch-panel > .screen:has(.mobile-inline-player--poster-slot) .screen-hero-controls {
    position: relative !important;
    inset: auto !important;
    flex: 0 0 auto !important;
    align-self: stretch !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 12px 14px 10px !important;
    z-index: 6 !important;
    min-height: 54px !important;
    align-items: center !important;
  }

  html body.device-mobile.mobile-watch-open .workspace.has-card .watch-panel > .screen:has(.mobile-inline-player--poster-slot) .watch-hero-tools-left,
  html body.device-mobile .workspace.has-card .watch-panel > .screen:has(.mobile-inline-player--poster-slot) .watch-hero-tools-left {
    flex-wrap: nowrap !important;
    align-items: center !important;
    min-height: 42px !important;
    min-width: calc(42px + 10px + 42px) !important;
  }

  html body.device-mobile.mobile-watch-open .workspace.has-card .watch-panel > .screen:has(.mobile-inline-player--poster-slot) .screen-hero-stack,
  html body.device-mobile .workspace.has-card .watch-panel > .screen:has(.mobile-inline-player--poster-slot) .screen-hero-stack {
    flex: 1 1 auto !important;
    align-self: stretch !important;
    width: 100% !important;
    position: relative !important;
    overflow: hidden !important;
    aspect-ratio: 16 / 9 !important;
    height: auto !important;
    max-height: min(40vh, 280px) !important;
    min-height: 0 !important;
  }

  html body.device-mobile.mobile-watch-open .workspace.has-card .watch-panel > .screen .mobile-inline-player-meta:not([hidden]),
  html body.device-mobile .workspace.has-card .watch-panel > .screen .mobile-inline-player-meta:not([hidden]) {
    flex: 0 0 auto !important;
    align-self: stretch !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 10px 14px 12px !important;
    background: linear-gradient(180deg, rgba(14, 14, 18, 0.98) 0%, #070709 100%) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
    z-index: 5 !important;
  }

  html body.device-mobile .workspace.has-card .watch-panel .mobile-inline-player-meta-inner {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "meta-head"
      "meta-ratings"
      "meta-note";
    gap: 8px !important;
    max-width: 100% !important;
    justify-items: center !important;
    text-align: center !important;
  }

  html body.device-mobile .workspace.has-card .watch-panel .watch-ratings-compact.watch-ratings-compact--inline-meta {
    grid-area: meta-ratings !important;
    margin: 0 !important;
    padding-top: 0 !important;
    border-top: none !important;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.02em;
    color: var(--muted);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  html body.device-mobile .workspace.has-card .watch-panel .watch-ratings-compact.watch-ratings-compact--inline-meta strong {
    margin-left: 4px;
    font-size: 12px;
    font-weight: 850;
    color: #e8e8e8;
  }

  html body.device-mobile .workspace.has-card .watch-panel .watch-ratings-compact.watch-ratings-compact--inline-meta .watch-status-badge {
    margin-left: 0;
    flex: 0 1 auto;
    min-width: 0;
  }

  html body.device-mobile .workspace.has-card .watch-panel .mobile-inline-player-meta-head {
    grid-area: meta-head !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: baseline !important;
    gap: 8px 10px !important;
    justify-content: center !important;
  }

  html body.device-mobile .workspace.has-card .watch-panel .mobile-inline-player-meta-title {
    font-size: 17px !important;
    font-weight: 780 !important;
    letter-spacing: -0.02em !important;
    line-height: 1.22 !important;
    color: rgba(255, 255, 255, 0.96) !important;
  }

  html body.device-mobile .workspace.has-card .watch-panel .mobile-inline-player-meta-year {
    font-size: 14px !important;
    font-weight: 650 !important;
    color: rgba(255, 255, 255, 0.45) !important;
    letter-spacing: 0.02em !important;
    white-space: nowrap !important;
  }

  html body.device-mobile .workspace.has-card .watch-panel .mobile-inline-player-meta-note {
    grid-area: meta-note !important;
    margin: 0 !important;
    font-size: 13px !important;
    line-height: 1.38 !important;
    color: rgba(255, 255, 255, 0.52) !important;
    text-align: center !important;
    max-width: 22rem !important;
  }

  html body.device-mobile .workspace.has-card .watch-panel .mobile-inline-player-meta-note .player-meta-link {
    color: rgba(196, 139, 255, 0.96) !important;
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
  }

  html body.device-mobile.mobile-watch-open.mobile-sheet-overlay-suppressed::before {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 50ms ease-out !important;
  }

  /* Полноэкранное затемнение под карточкой (без блюра). */
  html body.device-mobile.mobile-watch-open::before {
    content: "" !important;
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    z-index: 95 !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    background: rgba(6, 6, 10, 0.72) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
  }

  /* Шапка под оверлей. Убираем её собственный blur, чтобы под карточкой было
     просто затемнение, а не размытие. */
  html body.device-mobile.mobile-watch-open .app-header {
    z-index: 93 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #111218 !important;
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04), 0 12px 26px rgba(0, 0, 0, 0.34) !important;
  }
  html body.device-mobile.mobile-watch-open .app-header::before {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #111218 !important;
    display: block !important;
    opacity: 1 !important;
  }

  /* Кнопка меню — без inset/backdrop-blur и без border+dual-edge: только ровное 1px-кольцо (Safari режет края иначе). */
  html body.device-mobile .mobile-menu-toggle,
  html body.device-mobile.mobile-watch-open .mobile-menu-toggle {
    position: fixed !important;
    z-index: 126 !important;
    top: calc(env(safe-area-inset-top, 0px) + 12px) !important;
    left: clamp(12px, 4vw, 18px) !important;
    right: auto !important;
    display: inline-grid !important;
    place-items: center !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 999px !important;
    border: none !important;
    background: rgba(36, 36, 41, 0.96) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    color: #fff !important;
    isolation: isolate !important;
    transform: translateZ(0);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.22),
      0 10px 24px rgba(0, 0, 0, 0.3) !important;
  }

  /* Боковое меню: полная левая панель, градиент на shell — как в базовой вёрстке (скролл только на .rail). */
  html body.device-mobile .rail-stack::after {
    display: none !important;
    content: none !important;
  }

  html body.device-mobile .rail-stack::before {
    /* Убираем верхний светлый градиент — на тёмном фоне давал заметную «полосу» над карточками. */
    content: none !important;
    display: none !important;
  }

  html body.device-mobile .rail-stack > .rail::before {
    content: none !important;
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    animation: none !important;
  }

  html body.device-mobile .rail-stack > .rail::after {
    display: none !important;
    content: none !important;
  }

  html body.device-mobile .rail-stack {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    bottom: 0 !important;
    z-index: 96 !important;
    width: min(88vw, 360px) !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
    padding:
      calc(env(safe-area-inset-top, 0px) + 58px)
      14px
      calc(max(18px, env(safe-area-inset-bottom)) + 12px) !important;
    border-radius: 0 30px 30px 0 !important;
    border: 0 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
    outline: none !important;
    /* Тот же тон, что карточки меню (#1b1b1f) — между safe-area и «Каталог» не торчит другой чёрный. */
    background: #1b1b1f !important;
    transform: translate3d(calc(-100% - 18px), 0, 0) !important;
    transition: transform 520ms cubic-bezier(0.22, 1, 0.36, 1) !important;
    pointer-events: none !important;
    opacity: 1 !important;
  }

  html body.device-mobile .rail-stack::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
  }

  html body.device-mobile.mobile-menu-open .rail-stack {
    transform: translate3d(0, 0, 0) !important;
    pointer-events: auto !important;
    /* Иначе .app-header (z-index ~110) рисуется над панелью: сверху «пустая» тёмная полоса через прозрачную шапку. */
    z-index: 118 !important;
  }

  html body.device-mobile .rail-block,
  html body.device-mobile .rail-catalog-filters {
    margin: 0 0 12px !important;
    padding: 12px !important;
    border-radius: 22px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: #1b1b1f !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
    outline: none !important;
  }

  html body.device-mobile .rail-section-title {
    margin: 0 0 12px !important;
    padding: 2px !important;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 10px !important;
    font-weight: 650 !important;
    letter-spacing: 0.14em !important;
    text-transform: uppercase !important;
    line-height: 1.25 !important;
    color: rgba(235, 235, 245, 0.42) !important;
  }

  html body.device-mobile .rail-block:first-of-type .rail-section-title {
    margin-top: 0 !important;
  }

  html body.device-mobile .rail .segmented,
  html body.device-mobile .rail .rail-segment-catalog,
  html body.device-mobile .rail .rail-segment-account {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 0 !important;
    border-radius: 0 !important;
    overflow: visible !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
  }

  html body.device-mobile .rail .segment-wrap {
    display: block !important;
    width: 100% !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
  }

  html body.device-mobile .rail .segment,
  html body.device-mobile .rail .segment-wrap .segment {
    appearance: none !important;
    -webkit-appearance: none !important;
    cursor: pointer !important;
    width: 100% !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 0 14px !important;
    border: none !important;
    outline: none !important;
    border-radius: 15px !important;
    background: transparent !important;
    box-shadow: none !important;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 15px !important;
    font-weight: 760 !important;
    line-height: 1.25 !important;
    letter-spacing: normal !important;
    color: rgba(245, 245, 247, 0.72) !important;
    text-align: left !important;
    justify-content: flex-start !important;
    align-items: center !important;
    box-sizing: border-box !important;
  }

  html body.device-mobile .rail .segment:hover,
  html body.device-mobile .rail .segment-wrap .segment:hover {
    background: rgba(118, 118, 128, 0.16) !important;
    color: rgba(245, 245, 247, 0.9) !important;
  }

  html body.device-mobile .rail .segment:active,
  html body.device-mobile .rail .segment-wrap .segment:active {
    background: rgba(118, 118, 128, 0.22) !important;
  }

  html body.device-mobile .rail .segment.active,
  html body.device-mobile .rail .segment-wrap .segment.active {
    background: rgba(245, 245, 247, 0.94) !important;
    color: #050506 !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18) !important;
  }

  html body.device-mobile .rail .segment.active::after {
    display: none !important;
    content: none !important;
  }

  html body.device-mobile .segment-nav-badge {
    top: 50% !important;
    right: 10px !important;
    transform: translateY(-50%) !important;
  }

  html body.device-mobile .rail-catalog-filters {
    gap: 10px !important;
    display: grid !important;
    padding-bottom: 14px !important;
    overflow: visible !important;
  }

  html body.device-mobile .rail-catalog-filters .field {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    display: grid !important;
    gap: 8px !important;
    align-content: start !important;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 10px !important;
    font-weight: 650 !important;
    letter-spacing: 0.14em !important;
    text-transform: uppercase !important;
    line-height: 1.25 !important;
    color: rgba(235, 235, 245, 0.42) !important;
  }

  html body.device-mobile .rail-catalog-filters .field + .field {
    border-top: none !important;
    margin-top: 2px !important;
    padding-top: 10px !important;
  }

  html body.device-mobile .rail-catalog-filters select {
    width: 100% !important;
    margin-top: 0 !important;
    min-height: 44px !important;
    padding: 0 36px 0 14px !important;
    border: none !important;
    outline: none !important;
    border-radius: 15px !important;
    background-color: rgba(58, 58, 60, 0.54) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23c7c7ce' d='M3 4.2L6 7.8l3-3.6'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    color: rgba(245, 245, 247, 0.96) !important;
    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: 620 !important;
    line-height: 1.2 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    box-shadow: none !important;
  }

  html body.device-mobile .rail-catalog-filters input[type="range"] {
    width: 100% !important;
    margin: 4px 0 0 !important;
    height: 28px !important;
    accent-color: #0a84ff !important;
  }

  html body.device-mobile #resetFilters {
    margin-top: 4px !important;
    width: 100% !important;
    min-height: 44px !important;
    padding: 0 14px !important;
    border: none !important;
    outline: none !important;
    border-radius: 14px !important;
    border-top: none !important;
    background: rgba(118, 118, 128, 0.16) !important;
    box-shadow: none !important;
    color: rgba(245, 245, 247, 0.92) !important;
    font-family: Inter, system-ui, sans-serif !important;
    font-size: 14px !important;
    font-weight: 640 !important;
  }

  html body.device-mobile #resetFilters:active {
    background: rgba(118, 118, 128, 0.24) !important;
  }

  html body.device-mobile .mobile-drawer-actions {
    display: flex !important;
    flex: 0 0 auto !important;
    flex-direction: column !important;
    gap: 10px !important;
    padding: 0 !important;
    margin: 10px 0 0 !important;
    align-self: stretch !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  html body.device-mobile .mobile-drawer-action {
    margin: 0 !important;
    width: 100% !important;
    min-height: 44px !important;
    padding: 0 14px !important;
    border: none !important;
    outline: none !important;
    border-radius: 15px !important;
    background: rgba(118, 118, 128, 0.16) !important;
    box-shadow: none !important;
    color: rgba(245, 245, 247, 0.92) !important;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 15px !important;
    font-weight: 620 !important;
  }

  html body.device-mobile .mobile-drawer-action + .mobile-drawer-action {
    border-top: none !important;
  }

  html body.device-mobile .mobile-drawer-action:active {
    background: rgba(118, 118, 128, 0.24) !important;
  }

  html body.device-mobile .mobile-drawer-auth {
    color: #ff453a !important;
    border: none !important;
    background: rgba(244, 68, 68, 0.1) !important;
  }

  html body.device-mobile.mobile-watch-open .watch-panel .screen-hero-scrim--mobile-film {
    background: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.06) 0%,
      rgba(0, 0, 0, 0.05) 30%,
      rgba(0, 0, 0, 0.2) 48%,
      rgba(0, 0, 0, 0.48) 68%,
      rgba(11, 11, 14, 0.58) 86%,
      rgba(11, 11, 14, 0.78) 100%
    ) !important;
    border-radius: inherit !important;
  }

  /* Нижний seam — ВНУТРИ .screen (обрезается overflow:hidden, но идёт от 0 до конца).
     Заканчивается ровно в #0b0b0e — тот же цвет, что у watch-body, => бесшовно. */
  html body.device-mobile.mobile-watch-open .watch-panel .screen-bottom-seam--mobile-film {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: clamp(280px, 68vw, min(480px, 62vh)) !important;
    background: linear-gradient(
      180deg,
      rgba(11, 11, 14, 0) 0%,
      rgba(11, 11, 14, 0) 38%,
      rgba(11, 11, 14, 0.22) 50%,
      rgba(11, 11, 14, 0.48) 60%,
      rgba(11, 11, 14, 0.7) 70%,
      rgba(11, 11, 14, 0.88) 82%,
      rgba(11, 11, 14, 0.98) 92%,
      #0b0b0e 100%
    ) !important;
    z-index: 4 !important;
    pointer-events: none !important;
  }

  /* Watch-body с тем же фоном, что нижний seam у постера — без резкого стыка. */
  html body.device-mobile.mobile-watch-open .watch-panel .watch-body {
    margin-top: 0 !important;
    padding-top: 4px !important;
    background: #0b0b0e !important;
    position: relative !important;
    z-index: 5 !important;
  }

  /* Опускаем заголовок фильма ниже — ближе к нижнему краю постера. */
  html body.device-mobile.mobile-watch-open .watch-panel .screen-content--mobile-film {
    justify-content: flex-end !important;
    padding-top: clamp(180px, 50vw, 280px) !important;
    padding-bottom: 18px !important;
  }

  /* Статусный бабл строго по центру верхней линии (между кнопками и X). */
  html body.device-mobile.mobile-watch-open .watch-panel .screen-hero-controls {
    position: absolute !important;
    align-items: center !important;
  }

  html body.device-mobile.mobile-watch-open .watch-panel .watch-hero-statusline {
    position: absolute !important;
    left: 50% !important;
    top: 14px !important;
    transform: translateX(-50%) !important;
    min-height: 44px !important;
    margin: 0 !important;
    pointer-events: none !important;
  }

  html body.device-mobile.mobile-watch-open .watch-panel .watch-hero-statusline .watch-status-badge {
    margin: 0 !important;
  }

  /* Meta-блок (status + ratings) — по центру, без типа (тип теперь в hero-meta-line) */
  html body.device-mobile.mobile-watch-open .watch-panel .watch-mobile-meta {
    align-items: center !important;
    gap: 4px !important;
    margin: -10px 0 12px !important;
  }

  html body.device-mobile.mobile-watch-open .watch-panel .watch-mobile-meta-status--center {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
  }

  html body.device-mobile.mobile-watch-open .watch-panel .watch-mobile-meta-status--center .watch-status-badge {
    margin-left: 0 !important;
    padding: 4px 10px !important;
    font-size: 11px !important;
    letter-spacing: 0.04em !important;
    border-radius: 999px !important;
  }

  html body.device-mobile.mobile-watch-open .watch-panel #movieDetails {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
  }

  html body.device-mobile.mobile-watch-open .watch-panel .watch-mobile-bubble-stack {
    display: grid !important;
    margin-top: 4px !important;
    gap: 8px !important;
    row-gap: 8px !important;
    margin-bottom: 8px !important;
    align-self: stretch !important;
    width: 100% !important;
  }

  /* Хедер #101014, ровные 1px-обводки, заголовки каталога слева; баблы описания/создатели/жанры. */
  html body.device-mobile {
    background-color: #101014 !important;
    background-image: none !important;
  }

  html.device-mobile,
  html.device-mobile body {
    touch-action: manipulation;
  }

  html body.device-mobile .app-shell {
    background: #101014 !important;
  }

  html body.device-mobile .app-header {
    background: #101014 !important;
    background-image: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.26) !important;
  }

  html body.device-mobile form.search {
    border: none !important;
    outline: none !important;
    border-radius: 16px !important;
    box-sizing: border-box !important;
    isolation: isolate !important;
    transform: translateZ(0);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.2),
      0 8px 22px rgba(0, 0, 0, 0.28) !important;
    background: rgba(34, 34, 38, 0.97) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  html body.device-mobile .search .search-clear-btn,
  html body.device-mobile .search button[type="submit"] {
    box-sizing: border-box !important;
    border: none !important;
    outline: none !important;
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.18) !important;
  }

  html body.device-mobile .mobile-menu-toggle {
    border-radius: 999px !important;
    border: none !important;
    outline: none !important;
    box-sizing: border-box !important;
    background: rgba(36, 36, 41, 0.96) !important;
    isolation: isolate !important;
    transform: translateZ(0);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.22),
      0 8px 22px rgba(0, 0, 0, 0.28) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  html body.device-mobile.mobile-watch-open .watch-panel .screen-hero-controls .watch-tool-close {
    border: none !important;
    filter: none !important;
    background: rgba(22, 22, 28, 0.38) !important;
    backdrop-filter: blur(18px) saturate(1.25) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.25) !important;
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.26),
      0 12px 32px rgba(0, 0, 0, 0.3) !important;
    color: #f5f5f7 !important;
  }

  html body.device-mobile .rail .segment:not(.active),
  html body.device-mobile .rail-catalog-filters select,
  html body.device-mobile #resetFilters {
    box-sizing: border-box !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: none !important;
  }

  html body.device-mobile .catalog-context {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    align-items: flex-start !important;
    text-align: left !important;
  }

  html body.device-mobile .catalog-context-main {
    width: 100% !important;
    text-align: left !important;
    justify-items: start !important;
  }

  html body.device-mobile .catalog-chip-row {
    width: 100% !important;
    justify-content: flex-start !important;
    padding-inline: 0 !important;
  }

  /* Фиксируем минимальные размеры bubble-карточек (Описание, Создатели, Жанры и страны). */
  html body.device-mobile.mobile-watch-open .watch-panel .watch-mobile-bubble-stack .people-details {
    margin: 0 !important;
    margin-block: 0 !important;
    min-height: 46px !important;
    border-radius: 14px !important;
    overflow: hidden !important;
  }

  html body.device-mobile.mobile-watch-open .watch-panel .watch-mobile-bubble-stack .people-details-summary {
    min-height: 46px !important;
    padding: 0 14px !important;
    align-items: center !important;
  }

  html body.device-mobile.mobile-watch-open .watch-panel .watch-mobile-bubble-stack .people-details:not([open]) {
    height: 46px !important;
    min-height: 46px !important;
    max-height: 46px !important;
  }

  html body.device-mobile.mobile-watch-open .watch-panel .watch-mobile-bubble-stack .people-details-chevron {
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid rgba(255, 255, 255, 0.5);
    opacity: 0.92;
    transition:
      opacity 0.15s ease,
      transform 0.15s ease;
  }

  html body.device-mobile.mobile-watch-open .watch-panel .watch-mobile-bubble-stack .people-details[open] .people-details-chevron {
    opacity: 1;
  }

  /* Шапка не должна перекрывать drawer: у неё z-index выше .rail-stack, поэтому фон только
     прозрачный — иначе #101014 даёт «полосу», которая режет верх меню (см. z-index 120 vs 118). */
  html body.device-mobile.mobile-menu-open .app-header {
    background: transparent !important;
    background-image: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
  }

  html body.device-mobile.mobile-menu-open .app-header::before {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  html body.device-mobile.mobile-menu-open {
    background: #101014 !important;
  }

  /* Один общий скролл всего drawer: контент под кнопкой закрытия, админ/выйти и футер в потоке. */
  html body.device-mobile .rail-stack > .rail {
    position: relative !important;
    z-index: 1 !important;
    flex: 0 0 auto !important;
    min-height: auto !important;
    width: 100% !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
    margin: 0 !important;
    padding: 0 0 4px !important;
    border: none !important;
    outline: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
  }

  html body.device-mobile .rail-stack > .rail::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }

  html body.device-mobile .rail-stack > .mobile-drawer-actions,
  html body.device-mobile .rail-stack > .site-footer {
    flex: 0 0 auto !important;
  }

  /*
   * Аккаунт/админ в drawer (.mobile-drawer-actions над футером).
   * На мобилке не показываем .auth-bar из шапки: раньше при открытом меню её выносили
   * в фиксированный «док», но у .app-header transform → position:fixed цеплялся не к viewport,
   * блок обрезался сверху и дублировал те же действия что в drawer.
   */
  html body.device-mobile.mobile-menu-open .app-header .auth-bar,
  html body.device-mobile .app-header .auth-bar {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

}

/*
  Ширина >820 на device-mobile (планшеты и т.п.): стили инлайн-плеера и подписей под видео
  здесь же не задавались из-за FINAL MOBILE SHEET только под max-width:820 — блок «расползался».
  Порядок: название → «Если в плеере реклама…» → строка рейтингов.
*/
@media (min-width: 821px) {
  html body.device-mobile.mobile-watch-open .workspace.has-card .watch-panel > .screen:has(.mobile-inline-player--poster-slot),
  html body.device-mobile .workspace.has-card .watch-panel > .screen:has(.mobile-inline-player--poster-slot) {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  html body.device-mobile.mobile-watch-open .workspace.has-card .watch-panel > .screen:has(.mobile-inline-player--poster-slot):has(#mobileInlinePlayerMeta:not([hidden])),
  html body.device-mobile .workspace.has-card .watch-panel > .screen:has(.mobile-inline-player--poster-slot):has(#mobileInlinePlayerMeta:not([hidden])) {
    max-height: min(56vh, 460px) !important;
  }

  html body.device-mobile.mobile-watch-open .workspace.has-card .watch-panel > .screen:has(.mobile-inline-player--poster-slot) .screen-hero-controls,
  html body.device-mobile .workspace.has-card .watch-panel > .screen:has(.mobile-inline-player--poster-slot) .screen-hero-controls {
    position: relative !important;
    inset: auto !important;
    flex: 0 0 auto !important;
    align-self: stretch !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 12px 14px 10px !important;
    z-index: 6 !important;
    min-height: 54px !important;
    align-items: center !important;
  }

  html body.device-mobile.mobile-watch-open .workspace.has-card .watch-panel > .screen:has(.mobile-inline-player--poster-slot) .watch-hero-tools-left,
  html body.device-mobile .workspace.has-card .watch-panel > .screen:has(.mobile-inline-player--poster-slot) .watch-hero-tools-left {
    flex-wrap: nowrap !important;
    align-items: center !important;
    min-height: 42px !important;
    min-width: calc(42px + 10px + 42px) !important;
  }

  html body.device-mobile.mobile-watch-open .workspace.has-card .watch-panel > .screen:has(.mobile-inline-player--poster-slot) .screen-hero-stack,
  html body.device-mobile .workspace.has-card .watch-panel > .screen:has(.mobile-inline-player--poster-slot) .screen-hero-stack {
    flex: 1 1 auto !important;
    align-self: stretch !important;
    width: 100% !important;
    position: relative !important;
    overflow: hidden !important;
    aspect-ratio: 16 / 9 !important;
    height: auto !important;
    max-height: min(40vh, 280px) !important;
    min-height: 0 !important;
  }

  html body.device-mobile.mobile-watch-open .workspace.has-card .watch-panel > .screen .mobile-inline-player-meta:not([hidden]),
  html body.device-mobile .workspace.has-card .watch-panel > .screen .mobile-inline-player-meta:not([hidden]) {
    flex: 0 0 auto !important;
    align-self: stretch !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 10px 18px 14px !important;
    background: linear-gradient(180deg, rgba(14, 14, 18, 0.98) 0%, #070709 100%) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
    z-index: 5 !important;
  }

  html body.device-mobile .workspace.has-card .watch-panel .mobile-inline-player-meta-inner {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas:
      "meta-head"
      "meta-ratings"
      "meta-note";
    gap: 8px !important;
    max-width: 100% !important;
    justify-items: center !important;
    text-align: center !important;
  }

  html body.device-mobile .workspace.has-card .watch-panel .watch-ratings-compact.watch-ratings-compact--inline-meta {
    grid-area: meta-ratings !important;
    margin: 2px 0 0 !important;
    padding-top: 0 !important;
    border-top: none !important;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.02em;
    color: var(--muted);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  html body.device-mobile .workspace.has-card .watch-panel .watch-ratings-compact.watch-ratings-compact--inline-meta strong {
    margin-left: 4px;
    font-size: 12px;
    font-weight: 850;
    color: #e8e8e8;
  }

  html body.device-mobile .workspace.has-card .watch-panel .watch-ratings-compact.watch-ratings-compact--inline-meta .watch-status-badge {
    margin-left: 0;
    flex: 0 1 auto;
    min-width: 0;
  }

  html body.device-mobile .workspace.has-card .watch-panel .mobile-inline-player-meta-head {
    grid-area: meta-head !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: baseline !important;
    gap: 8px 10px !important;
    justify-content: center !important;
  }

  html body.device-mobile .workspace.has-card .watch-panel .mobile-inline-player-meta-title {
    font-size: 17px !important;
    font-weight: 780 !important;
    letter-spacing: -0.02em !important;
    line-height: 1.22 !important;
    color: rgba(255, 255, 255, 0.96) !important;
  }

  html body.device-mobile .workspace.has-card .watch-panel .mobile-inline-player-meta-year {
    font-size: 14px !important;
    font-weight: 650 !important;
    color: rgba(255, 255, 255, 0.45) !important;
    letter-spacing: 0.02em !important;
    white-space: nowrap !important;
  }

  html body.device-mobile .workspace.has-card .watch-panel .mobile-inline-player-meta-note {
    grid-area: meta-note !important;
    margin: 0 !important;
    font-size: 13px !important;
    line-height: 1.38 !important;
    color: rgba(255, 255, 255, 0.52) !important;
    text-align: center !important;
    max-width: 28rem !important;
  }

  html body.device-mobile .workspace.has-card .watch-panel .mobile-inline-player-meta-note .player-meta-link {
    color: rgba(196, 139, 255, 0.96) !important;
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
  }
}

/*
  Инлайн-плеер: FAB меню имеет z-index:99 выше шторки (97) — попадало на видео. Во время воспроизведения
  (player-lock) прячем кнопку: закрыть карточку — из шторки; меню снова появится после выхода из плеера.
*/
html.player-lock body.device-mobile.mobile-watch-open:not(.mobile-menu-open) .mobile-menu-toggle,
body.player-lock.device-mobile.mobile-watch-open:not(.mobile-menu-open) .mobile-menu-toggle {
  visibility: hidden !important;
  pointer-events: none !important;
}

/* =====================================================================
   LANDSCAPE LOCK — на мобильных горизонтальный режим отключён,
   кроме случаев когда открыт полноэкранный/инлайн-плеер.
   ===================================================================== */
@media (orientation: landscape) and (max-width: 1024px) and (max-height: 600px) {
  body:not(.player-lock):not(.mobile-inline-player-open)::after {
    content: "Поверните устройство";
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, sans-serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #f5f5f7;
    background:
      radial-gradient(120% 80% at 50% 50%, rgba(28, 28, 32, 0.96), rgba(6, 6, 10, 0.99));
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    pointer-events: auto;
  }

  body:not(.player-lock):not(.mobile-inline-player-open) {
    overflow: hidden !important;
  }
}

/* =====================================================================
   UNIVERSAL FULLSCREEN PLAYER
   Плеер всегда занимает весь экран независимо от устройства/ориентации.
   ===================================================================== */
.player-overlay {
  z-index: 2147483200 !important;
  padding: 0 !important;
  background: #000 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.player-dialog {
  width: 100vw !important;
  max-width: none !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  box-shadow: none !important;
  background: #000 !important;
}

.overlay-screen {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
}

.player-dialog .fkwatch-frame {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  aspect-ratio: auto !important;
}

.player-dialog .fkwatch-frame iframe {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
}

/* Для true fullscreen видео скрываем нижний metadata-блок, чтобы ничего не отнимало высоту. */
.player-dialog .player-meta {
  display: none !important;
}

.player-dialog .close-player {
  top: calc(env(safe-area-inset-top, 0px) + 12px) !important;
  right: calc(env(safe-area-inset-right, 0px) + 12px) !important;
  z-index: 20 !important;
}

/* Видеомодалка на смартфоне = как на десктопе: сетка над видео, выбор провайдера виден под кадром. */
html body.device-mobile .player-overlay.open .player-dialog .player-meta {
  display: grid !important;
  flex: 0 0 auto !important;
  width: 100% !important;
  max-height: min(42vh, 300px) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

html body.device-mobile .player-overlay.open .player-dialog .overlay-screen {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
}

html body.device-mobile .player-overlay.open .player-dialog .fkwatch-frame {
  flex: 0 1 auto !important;
  align-self: center !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: min(58dvh, calc(100vw * 9 / 16)) !important;
  aspect-ratio: 16 / 9 !important;
}

/* Desktop restore: в полной версии плеер открывается окном (не fullscreen),
   с нижним блоком инструкций и выбором плеера. */
html body:not(.device-mobile) .player-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 100 !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 3vw, 34px) !important;
  /* Без backdrop-filter на самом overlay: Chromium часто ломает PiP у видео во вложенных iframe под размытием предка. Фон выносится в слой ниже модалки. */
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html body:not(.device-mobile) .player-overlay.open {
  display: flex !important;
}

html body:not(.device-mobile) .player-overlay.open::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(18px) saturate(1.06);
  -webkit-backdrop-filter: blur(18px) saturate(1.06);
}

html body:not(.device-mobile) .player-dialog {
  position: relative;
  z-index: 1;
  width: min(1400px, calc(100vw - 32px)) !important;
  max-width: min(1400px, calc(100vw - 32px)) !important;
  height: auto !important;
  max-height: none !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 10px !important;
  overflow: hidden;
  background: #020202 !important;
  box-shadow: 0 40px 140px rgba(0, 0, 0, 0.86) !important;
  display: block !important;
}

html body:not(.device-mobile) .player-dialog .overlay-screen {
  height: auto !important;
  min-height: 0 !important;
}

html body:not(.device-mobile) .player-dialog .fkwatch-frame {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9 !important;
  min-height: 390px !important;
  height: auto !important;
}

html body:not(.device-mobile) .player-dialog .fkwatch-frame iframe {
  width: 100% !important;
  height: 100% !important;
  min-height: 390px !important;
}

html body:not(.device-mobile) .player-dialog .player-meta {
  display: grid !important;
}

/* Десктоп: название и строка про инструкцию слева — как в прежнем макете; мобила остаётся по базовым центрированным правилам. */
html body:not(.device-mobile) .player-dialog .player-meta-copy {
  justify-items: start !important;
  text-align: left !important;
}

html body:not(.device-mobile) .player-dialog .player-meta-head {
  justify-content: flex-start !important;
}

html body:not(.device-mobile) .player-dialog .player-meta-note {
  text-align: left !important;
}

html body:not(.device-mobile) .player-dialog .close-player {
  top: 14px !important;
  right: 14px !important;
}

/*
 * Карточка фильма на десктопе/TV — отдельно от «iOS-слоя» мобильного профиля.
 * Восстанавливаем тёмный матовый тулбар героя; яркие градиенты остаются только на .device-mobile.
 */
body:not(.device-mobile) .screen-hero-controls .watch-tool-btn {
  filter: none !important;
  border-radius: var(--btn-radius) !important;
  border: 1px solid rgba(235, 235, 245, 0.28) !important;
  background: rgba(28, 28, 30, 0.42) !important;
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  color: rgba(245, 245, 247, 0.95) !important;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

body:not(.device-mobile) .screen-hero-controls .watch-tool-btn:hover {
  transform: translateY(-1px);
  background: rgba(118, 118, 128, 0.28) !important;
}

body:not(.device-mobile) .screen-hero-controls .watch-tool-btn:active {
  transform: translateY(0);
  background: rgba(118, 118, 128, 0.22) !important;
}

body:not(.device-mobile) .screen-hero-controls .watch-tool-btn:focus-visible {
  box-shadow:
    0 0 0 2px #050505,
    0 0 0 5px rgba(10, 132, 255, 0.45);
}

body:not(.device-mobile) .screen-hero-controls .watch-tool-close {
  border-color: rgba(235, 235, 245, 0.28) !important;
  background: rgba(28, 28, 30, 0.52) !important;
  color: #f5f5f7 !important;
}

body:not(.device-mobile) .screen-hero-controls .watch-tool-bookmark.is-saved {
  border-color: rgba(255, 159, 200, 0.55) !important;
  background: rgba(255, 118, 160, 0.26) !important;
  box-shadow:
    0 0 0 1px rgba(255, 140, 180, 0.22),
    0 14px 36px rgba(0, 0, 0, 0.32) !important;
  color: #fff !important;
}

body:not(.device-mobile) .screen-hero-controls .watch-tool-bookmark.is-saved:hover {
  background: rgba(255, 118, 160, 0.36) !important;
}

body:not(.device-mobile) .screen-hero-controls .watch-tool-bookmark.is-saved .watch-heart-path {
  fill: none !important;
  stroke: rgba(255, 255, 255, 0.92) !important;
  stroke-width: 2 !important;
}

body:not(.device-mobile) .screen-hero-controls .watch-tool-watching.is-watching {
  border-color: rgba(134, 250, 230, 0.45) !important;
  background: rgba(72, 200, 180, 0.24) !important;
  box-shadow:
    0 0 0 1px rgba(120, 240, 220, 0.2),
    0 14px 36px rgba(0, 0, 0, 0.32) !important;
  color: #fff !important;
}

body:not(.device-mobile) .screen-hero-controls .watch-tool-watching.is-watching:hover {
  background: rgba(72, 200, 180, 0.34) !important;
}

body:not(.device-mobile) .screen-hero-controls .watch-tool-watching.is-watching svg path,
body:not(.device-mobile) .screen-hero-controls .watch-tool-watching.is-watching svg circle {
  fill: none !important;
  stroke: rgba(255, 255, 255, 0.92) !important;
  stroke-width: 1.5 !important;
}

/* login.html standalone: переопределяем глобальные `.field input` (выше специфичность, чем у `.auth-code-cell`). */
html body.auth-required:not(.device-tv) .auth-overlay .auth-form input:not([type="hidden"]):not(.auth-pass-autofill-proxy),
html body.auth-required:not(.device-tv) .auth-overlay .auth-form textarea {
  font-size: 16px !important;
  line-height: 1.35 !important;
  -webkit-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
}

html body.auth-required:not(.device-tv) .auth-overlay .auth-form input.auth-code-cell {
  font-size: 22px !important;
  line-height: 1.1 !important;
  border-radius: 10px !important;
}

/* Pull-to-refresh: кольцевой индикатор в стиле iOS под safe-area */
.mobile-ptr-hud {
  --mobile-ptr-drift: 0px;
  position: fixed;
  left: 50%;
  top: 0;
  z-index: 240;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-50%, calc(env(safe-area-inset-top, 0px) + var(--mobile-ptr-drift) - 8px), 0);
  transition: opacity 0.14s ease;
}

.mobile-ptr-hud.mobile-ptr-hud--shown {
  opacity: 1;
}

.mobile-ptr-hud-svg {
  display: block;
  width: 40px;
  height: 40px;
  transform-origin: 20px 20px;
}

.mobile-ptr-hud-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 2.75;
}

.mobile-ptr-hud-arc {
  fill: none;
  stroke: rgba(255, 255, 255, 0.86);
  stroke-width: 2.75;
  stroke-linecap: round;
  transform-origin: 20px 20px;
}

.mobile-ptr-hud.mobile-ptr-hud--spinning .mobile-ptr-hud-svg {
  animation: mobile-ptr-hud-spin 0.7s linear infinite;
}

@keyframes mobile-ptr-hud-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-ptr-hud.mobile-ptr-hud--spinning .mobile-ptr-hud-svg {
    animation-duration: 1.35s;
  }
}

/* Тень мобильного drawer только когда меню открыто — без полосы затемнения на главной. */
@media (max-width: 820px) {
  html body.device-mobile:not(.mobile-menu-open) .rail-stack {
    box-shadow: none !important;
  }

  html body.device-mobile.mobile-menu-open .rail-stack {
    box-shadow:
      34px 0 80px rgba(0, 0, 0, 0.58),
      inset -1px 0 0 rgba(255, 255, 255, 0.05) !important;
  }
}

/* Inline-плеер: держим шторку position:fixed как без воспроизведения — absolute якорился к документу и часть карточки уезжала за верх экрана. */
html body.device-mobile .workspace.has-card .watch-panel.is-mobile-playing,
html body.device-mobile.mobile-watch-open .workspace.has-card .watch-panel.is-mobile-playing {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  top: calc(var(--mobile-sheet-top, 132px) - 8px) !important;
  bottom: auto !important;
  height: calc(100vh - var(--mobile-sheet-top, 132px) + 20px) !important;
  height: calc(100dvh - var(--mobile-sheet-top, 132px) + 20px) !important;
  z-index: 97 !important;
  transform: none !important;
  -webkit-transform: none !important;
  will-change: auto !important;
  animation: none !important;
  contain: none !important;
  /* backdrop-filter на предке иногда ломает нативный fullscreen/video-layer на части iOS. */
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transition-property: opacity !important;
  overflow: visible !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
}

/* Цепочка предков с transform/filter ломает video/fullscreen на части iOS. */
html body.device-mobile.mobile-watch-open .app-shell:has(.watch-panel.is-mobile-playing),
html body.device-mobile.mobile-watch-open .workspace.has-card:has(.watch-panel.is-mobile-playing),
html body.device-mobile.mobile-watch-open .workspace.has-card:has(.watch-panel.is-mobile-playing) .catalog {
  transform: none !important;
  -webkit-transform: none !important;
  filter: none !important;
  -webkit-filter: none !important;
}

html body.device-mobile .workspace.has-card .watch-panel > .screen:has(.mobile-inline-player--poster-slot),
html body.device-mobile .workspace.has-card .watch-panel > .screen.playing:has(.mobile-inline-player--poster-slot),
html body.device-mobile.mobile-watch-open .workspace.has-card .watch-panel > .screen:has(.mobile-inline-player--poster-slot),
html body.device-mobile.mobile-watch-open .workspace.has-card .watch-panel > .screen.playing:has(.mobile-inline-player--poster-slot),
html body.device-mobile .workspace.has-card .watch-panel .screen-hero-stack:has(.mobile-inline-player--poster-slot),
html body.device-mobile.mobile-watch-open .workspace.has-card .watch-panel .screen-hero-stack:has(.mobile-inline-player--poster-slot) {
  transform: none !important;
  -webkit-transform: none !important;
  will-change: auto !important;
  contain: none !important;
}

html body.device-mobile .workspace.has-card .watch-panel.is-mobile-playing,
html body.device-mobile.mobile-watch-open .workspace.has-card .watch-panel.is-mobile-playing,
html body.device-mobile .workspace.has-card .watch-panel.is-mobile-playing > .screen:has(.mobile-inline-player--poster-slot),
html body.device-mobile .workspace.has-card .watch-panel.is-mobile-playing > .screen.playing:has(.mobile-inline-player--poster-slot),
html body.device-mobile .workspace.has-card .watch-panel.is-mobile-playing .screen-hero-stack:has(.mobile-inline-player--poster-slot),
html body.device-mobile.mobile-watch-open .workspace.has-card .watch-panel.is-mobile-playing > .screen:has(.mobile-inline-player--poster-slot) .screen-hero-stack:has(.mobile-inline-player--poster-slot),
html body.device-mobile.mobile-watch-open .workspace.has-card .watch-panel.is-mobile-playing > .screen.playing:has(.mobile-inline-player--poster-slot) .screen-hero-stack:has(.mobile-inline-player--poster-slot),
html body.device-mobile .workspace.has-card .watch-panel.is-mobile-playing .mobile-inline-player--poster-slot,
html body.device-mobile .workspace.has-card .watch-panel.is-mobile-playing .mobile-inline-player--poster-slot .fkwatch-frame {
  overflow: visible !important;
  clip-path: none !important;
  -webkit-mask-image: none !important;
  mask-image: none !important;
}

/*
 * Родительская .screen в FINAL SHEET ограничена ~380px — обрезает stack и провоцирует «low/mobile» качество (~480p).
 * Для `.is-mobile-playing` поднимаем лимиты (без этого __quality:2160 мало помогает).
 */
html body.device-mobile .workspace.has-card .watch-panel.is-mobile-playing > .screen:has(.mobile-inline-player--poster-slot),
html body.device-mobile.mobile-watch-open .workspace.has-card .watch-panel.is-mobile-playing > .screen:has(.mobile-inline-player--poster-slot),
html body.device-mobile .workspace.has-card .watch-panel.is-mobile-playing > .screen.playing:has(.mobile-inline-player--poster-slot),
html body.device-mobile.mobile-watch-open .workspace.has-card .watch-panel.is-mobile-playing > .screen.playing:has(.mobile-inline-player--poster-slot) {
  max-height: min(90dvh, 980px) !important;
}

html body.device-mobile .workspace.has-card .watch-panel.is-mobile-playing > .screen:has(.mobile-inline-player--poster-slot):has(#mobileInlinePlayerMeta:not([hidden])),
html body.device-mobile.mobile-watch-open .workspace.has-card .watch-panel.is-mobile-playing > .screen:has(.mobile-inline-player--poster-slot):has(#mobileInlinePlayerMeta:not([hidden])) {
  max-height: min(92dvh, 1024px) !important;
}

/* При воспроизведении даём iframe большую видимую высоту. */
html body.device-mobile .workspace.has-card .watch-panel.is-mobile-playing .screen-hero-stack:has(.mobile-inline-player--poster-slot),
html body.device-mobile.mobile-watch-open .workspace.has-card .watch-panel.is-mobile-playing .screen-hero-stack:has(.mobile-inline-player--poster-slot) {
  max-height: min(78dvh, 840px) !important;
}

html body.device-mobile .workspace.has-card .watch-panel.is-mobile-playing .mobile-inline-player--poster-slot .fkwatch-frame,
html body.device-mobile.mobile-watch-open .workspace.has-card .watch-panel.is-mobile-playing .mobile-inline-player--poster-slot .fkwatch-frame {
  min-height: min(46vw, 320px) !important;
}

/*
 * Кнопка меню ↔ крестик: при открытом drawer ниже по файлу стояли другие top/left — кнопка прыгала.
 * Совпадает с html body.device-mobile .mobile-menu-toggle (calc safe-area + 12px, clamp left, 44×44).
 */
@media (max-width: 820px) {
  html body.device-mobile.mobile-menu-open .mobile-menu-toggle {
    top: calc(env(safe-area-inset-top, 0px) + 12px) !important;
    left: clamp(12px, 4vw, 18px) !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    border-radius: 999px !important;
    z-index: 130 !important;
  }
}

/*
 * Очень широкие окна (ультраширокие / 4K): колонка контента по центру, rail и шапка совпадают с ней.
 * Порог 2200px — ниже не трогаем: иначе на обычных 1440p/1080p «плывёт» привычная вёрстка.
 * Только десктоп/TV (не body.device-mobile — иначе сломает выезд drawer и привязку клавиш).
 */
@media (min-width: 2200px) {
  body:not(.device-mobile) {
    --app-frame-max: min(2280px, calc(100vw - 48px));
    /** Совпадает с `margin: auto` у `.workspace`: отступ до левого края центрированной колонки. */
    --app-frame-inset: max(0px, calc((100vw - var(--app-frame-max)) / 2));
  }

  /**
   * Тёмная подложка шапки на всю ширину viewport; сетка лого/поиска совпадает
   * с горизонтальным краем контента `.workspace` (как при узкой шапке).
   */
  body:not(.device-mobile) .app-header {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    padding-left: calc(var(--app-frame-inset) + var(--page-pad-x));
    padding-right: calc(var(--app-frame-inset) + var(--page-pad-x));
  }

  body:not(.device-mobile) .workspace {
    max-width: var(--app-frame-max);
    margin-left: auto;
    margin-right: auto;
  }

  /** Иначе rail остаётся у левого края экрана, а сетка постеров — в центре. */
  body:not(.device-mobile) .rail-stack {
    left: calc(var(--app-frame-inset) + var(--page-pad-x)) !important;
  }
}

/* Final Smart TV layer: isolated from stable desktop/mobile modes. */
@media (min-width: 821px) {
  html.device-tv,
  body.device-tv {
    overflow-x: hidden;
    background: #050505;
  }

  body.device-tv {
    --sticky-below-header: 104px;
    --page-pad-x: clamp(28px, 3vw, 58px);
    --layout-gap: clamp(24px, 2vw, 38px);
    --sidebar-w: clamp(246px, 14vw, 306px);
    --catalog-gap-x: clamp(14px, 1vw, 20px);
    --catalog-gap-y: clamp(24px, 1.5vw, 34px);
    --catalog-gap-open-x: clamp(12px, 0.9vw, 18px);
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
  }

  body.device-tv .app-header {
    min-height: 96px !important;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr) auto !important;
    align-items: center !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    background: rgba(5, 5, 6, 0.96) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body.device-tv .brand-logo-img {
    height: clamp(68px, 5.6vw, 92px) !important;
  }

  body.device-tv .search {
    min-height: 58px !important;
    border-radius: 999px !important;
    background: #161619 !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
  }

  body.device-tv .search input {
    min-height: 48px !important;
    font-size: 18px !important;
  }

  body.device-tv .search button,
  body.device-tv .auth-header-btn {
    min-height: 48px !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
    font-size: 16px !important;
    font-weight: 760 !important;
  }

  body.device-tv .rail {
    padding: 18px !important;
    border-radius: 22px !important;
    background: #0e0e10 !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
  }

  body.device-tv .rail-section-title {
    font-size: 14px !important;
    line-height: 1.25 !important;
  }

  body.device-tv .rail .segment,
  body.device-tv .rail-catalog-filters select,
  body.device-tv #resetFilters {
    min-height: 54px !important;
    font-size: 16px !important;
    border-radius: 17px !important;
  }

  body.device-tv .movie-card,
  body.device-tv .workspace.has-card .movie-card {
    border-radius: 18px !important;
    background: #101012 !important;
    outline-offset: 6px !important;
    contain: layout paint;
  }

  body.device-tv .movie-card .poster {
    height: calc(var(--card-width, 170px) * 1.5) !important;
    min-height: calc(var(--card-width, 170px) * 1.5) !important;
    aspect-ratio: auto !important;
  }

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

  body.device-tv .poster .poster-img {
    opacity: 1 !important;
    image-rendering: auto;
    transform: translateZ(0);
  }

  body.device-tv .poster-title {
    padding: 0 12px 12px !important;
  }

  body.device-tv .poster-title strong {
    font-size: clamp(15px, 1vw, 18px) !important;
    line-height: 1.16 !important;
  }

  body.device-tv .poster-title span,
  body.device-tv .card-strip {
    font-size: clamp(12px, 0.82vw, 14px) !important;
  }

  body.device-tv .movie-card:focus-visible {
    transform: translateY(-6px) scale(1.035) !important;
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.18), 0 18px 48px rgba(0, 0, 0, 0.55) !important;
  }

  body.device-tv .watch-panel {
    border-radius: 24px !important;
    background: #0b0b0d !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
    max-height: calc(100vh - var(--sticky-below-header) - 22px) !important;
  }

  body.device-tv .screen,
  body.device-tv .workspace.has-card .watch-panel > .screen,
  body.device-tv .workspace.has-card .watch-panel > .screen.playing {
    min-height: clamp(260px, 28vh, 390px) !important;
  }

  body.device-tv .screen-content h2 {
    font-size: clamp(26px, 2.1vw, 44px) !important;
    line-height: 1.08 !important;
  }

  body.device-tv .screen-content .meta,
  body.device-tv .hero-overline,
  body.device-tv .watch-body {
    font-size: clamp(14px, 0.9vw, 17px) !important;
  }

  body.device-tv .play {
    width: clamp(78px, 5.6vw, 108px) !important;
    height: clamp(78px, 5.6vw, 108px) !important;
    font-size: clamp(32px, 2.6vw, 46px) !important;
  }

  body.device-tv .player-overlay,
  body.device-tv .player-overlay.open {
    padding: 0 !important;
    background: #000 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body.device-tv .player-dialog {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: column !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #000 !important;
  }

  body.device-tv .overlay-screen {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body.device-tv .fkwatch-frame {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
    background: #000 !important;
  }

  body.device-tv .fkwatch-frame iframe {
    background: #000 !important;
  }

  body.device-tv .player-meta {
    flex: 0 0 auto !important;
    min-height: 82px !important;
    padding: 14px 104px 16px 28px !important;
    background: #080809 !important;
    border-top-color: rgba(255, 255, 255, 0.12) !important;
  }

  body.device-tv .player-meta-title {
    font-size: clamp(18px, 1.35vw, 25px) !important;
  }

  body.device-tv .player-provider-select {
    min-height: 48px !important;
    min-width: 260px !important;
    font-size: 16px !important;
  }

  body.device-tv .close-player {
    top: 16px !important;
    right: 20px !important;
    width: 64px !important;
    height: 64px !important;
    font-size: 40px !important;
    z-index: 5 !important;
  }
}
