@media (max-width: 760px), (max-width: 960px) and (max-height: 520px) {
  .topbar {
    display: flex;
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
  }

  .topbar-copy {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: baseline;
    gap: 6px;
    overflow: hidden;
    white-space: nowrap;
  }

  .topbar .topbar-copy .eyebrow {
    flex: 0 0 auto;
    margin: 0;
    font-size: clamp(8px, 2.35vw, 10px);
    line-height: 1;
    letter-spacing: clamp(.7px, .24vw, 1px);
  }

  .topbar .topbar-copy h2 {
    min-width: 0;
    overflow: hidden;
    margin: 0;
    font-size: clamp(9px, 2.5vw, 12px);
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .top-actions {
    display: flex;
    width: 100%;
    min-width: 0;
    flex: 0 0 auto;
    gap: 8px;
  }

  .search {
    position: static;
    inset: auto;
    width: auto;
    min-width: 0;
    min-height: 40px;
    flex: 1 1 auto;
    padding: 9px 12px;
  }

  .top-actions .icon-button,
  .top-actions .profile,
  .top-actions .user-menu-shell {
    flex: 0 0 40px;
  }

  .top-actions .icon-button,
  .top-actions .profile {
    width: 40px;
    height: 40px;
  }

  .hero,
  .hero.home-dashboard,
  .live-breadcrumb {
    margin-top: 18px;
  }

  html,
  body {
    min-height: 100%;
    overscroll-behavior: none;
  }

  .main {
    padding-right: 14px;
    padding-left: 14px;
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }

  .sidebar {
    height: calc(70px + env(safe-area-inset-bottom));
    padding-bottom: calc(7px + env(safe-area-inset-bottom));
    background: #080d17f5;
    backdrop-filter: blur(18px);
  }

  .sidebar nav {
    scroll-snap-type: x proximity;
  }

  .nav-item {
    min-height: 52px;
    scroll-snap-align: center;
    touch-action: manipulation;
  }

  .content-card,
  .live-folder,
  button,
  select {
    touch-action: manipulation;
  }

  .detail-dialog,
  .detail-dialog.has-trailer[open] {
    position: fixed;
    inset: 6px;
    width: auto;
    max-width: none;
    height: auto;
    max-height: none;
    margin: 0;
    border-radius: 20px;
  }

  .detail-dialog.has-trailer[open] {
    display: block;
    overflow: hidden;
  }

  .detail-dialog.has-trailer .detail-poster {
    position: absolute;
    z-index: 4;
    top: 14px;
    left: 14px;
    display: block;
    width: 68px;
    height: 102px;
    min-height: 0;
    margin: 0;
    border: 1px solid #ffffff40;
    border-radius: 10px;
    box-shadow: 0 12px 30px #000c;
    pointer-events: none;
  }

  .detail-content.has-trailer {
    padding: 12px 16px 17px;
  }

  .detail-dialog.has-trailer .trailer-shell {
    width: calc(100% + 32px);
    height: auto;
    max-height: min(34dvh, 260px);
    aspect-ratio: 16 / 9;
    margin: -12px -16px 10px;
    border-radius: 20px 20px 0 0;
  }

  .detail-dialog.has-trailer .trailer-shell > span {
    top: 12px;
    left: 91px;
  }

  .detail-dialog.has-trailer .detail-content h2 {
    margin: 4px 0 7px;
    font-size: clamp(24px, 7vw, 30px);
    line-height: 1.02;
  }

  .detail-dialog.has-trailer .detail-content > p:not(.eyebrow) {
    margin: 7px 0;
    font-size: 11px;
    line-height: 1.35;
    -webkit-line-clamp: 3;
  }

  .detail-dialog.has-trailer .subtitle-control,
  .detail-dialog.has-trailer .series-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(118px, 42%);
    align-items: center;
    gap: 9px;
    margin: 9px 0 3px;
    padding: 8px 9px;
  }

  .detail-dialog.has-trailer .subtitle-control select,
  .detail-dialog.has-trailer .series-control select {
    width: 100%;
    min-width: 0;
    padding: 7px 27px 7px 9px;
  }

  .detail-dialog.has-trailer .series-control > small {
    grid-column: 1 / -1;
  }

  .detail-dialog.has-trailer #subtitleHint {
    display: none;
  }

  .detail-dialog.has-trailer .primary-button,
  .detail-dialog.has-trailer .ghost-button {
    min-height: 40px;
    padding: 9px 12px;
    font-size: 10px;
  }

  .dialog-close {
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    border-color: #ffffff30;
    background: #05080ed9;
  }

  .player-dialog[open] {
    display: flex;
    position: fixed;
    inset: 0;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    overflow: hidden;
    background: #000;
  }

  .player-dialog video {
    flex: 1 1 auto;
    width: 100%;
    height: 0;
    max-height: none;
    object-fit: contain;
    background: #000;
  }

  .player-bar {
    flex: 0 0 auto;
    min-height: calc(56px + env(safe-area-inset-bottom));
    padding: 8px 9px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid #ffffff17;
    background: #070a10;
  }

  .player-title {
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .channel-button {
    min-height: 39px;
    padding: 7px 9px;
    font-size: 9px;
  }
}

/* Player controls stay outside the video's native control layer. The close
   button always remains on the right, inside the lower information bar. */
.player-fullscreen-button.active {
  border-color: #d5b15b;
  color: #f0d584;
}

.player-dialog:fullscreen,
.player-dialog:-webkit-full-screen,
.player-dialog.is-player-fullscreen-fallback {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483000 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #000 !important;
}

@media (max-width: 760px), (orientation: landscape) and (max-width: 960px) and (max-height: 520px) {
  body.theme-blackeye .player-dialog[open] > #closePlayer {
    position: absolute !important;
    right: max(9px, env(safe-area-inset-right)) !important;
    bottom: max(9px, env(safe-area-inset-bottom)) !important;
    left: auto !important;
    top: auto !important;
    z-index: 10020 !important;
    width: 38px !important;
    height: 38px !important;
  }

  body.theme-blackeye .player-dialog[open] > .player-bar {
    padding-right: calc(58px + env(safe-area-inset-right)) !important;
  }

  .player-dialog .player-fullscreen-button,
  .player-dialog #castPlayer {
    min-width: 38px;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    padding: 0;
  }

  .player-dialog .player-fullscreen-button b,
  .player-dialog #castPlayer b {
    display: none;
  }
}

@media (orientation: landscape) and (max-width: 960px) and (max-height: 520px) {
  .search-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Final Black Eye mobile navigation contract.
   Bottom bar: icon over label. Landscape side bar: icon left, label right. */
.mobile-home-brand {
  display: none;
}

@media (orientation: portrait) and (max-width: 760px),
       (orientation: landscape) and (max-width: 680px) and (max-height: 610px) {
  body.theme-blackeye .app,
  body.theme-blackeye .app.sidebar-collapsed {
    display: block;
  }

  body.theme-blackeye .sidebar,
  body.theme-blackeye .app.sidebar-collapsed .sidebar {
    position: fixed;
    inset: auto 0 0;
    width: auto;
    height: calc(74px + env(safe-area-inset-bottom));
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    transform: none;
  }

  body.theme-blackeye .sidebar > .brand,
  body.theme-blackeye .provider-user,
  body.theme-blackeye .sync-card,
  body.theme-blackeye .validity-card {
    display: none;
  }

  body.theme-blackeye .sidebar nav {
    display: grid;
    height: 100%;
    grid-auto-flow: column;
    grid-auto-columns: minmax(66px, 1fr);
    grid-template-columns: none;
    gap: 3px;
    margin: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
  }

  body.theme-blackeye .sidebar .nav-item {
    display: grid;
    min-width: 0;
    min-height: 58px;
    grid-template-columns: 1fr;
    grid-template-rows: 36px minmax(12px, auto);
    place-items: center;
    gap: 2px;
    padding: 2px 4px;
    font-size: 7px;
    line-height: 1.05;
    text-align: center;
    white-space: normal;
  }

  body.theme-blackeye .sidebar .nav-item > span {
    grid-column: 1;
    grid-row: 1;
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    align-self: center;
    justify-self: center;
  }

  body.theme-blackeye .main {
    grid-column: auto;
    padding-bottom: calc(94px + env(safe-area-inset-bottom));
  }

  body.theme-blackeye .topbar {
    position: relative;
  }

  body.theme-blackeye .mobile-home-brand {
    position: absolute;
    z-index: 3;
    top: 0;
    left: 0;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    padding: 0;
    overflow: hidden;
    border: 1px solid #d5b15b3f;
    border-radius: 12px;
    background: #090a0b;
    box-shadow: 0 7px 20px #0008;
  }

  body.theme-blackeye .mobile-home-brand img {
    display: block;
    width: 37px;
    height: 37px;
    object-fit: contain;
  }

  body.theme-blackeye .topbar-copy {
    min-height: 42px;
    padding-left: 51px;
    align-items: center;
  }

  body.theme-blackeye .sidebar-toggle {
    display: none;
  }
}

@media (orientation: landscape) and (min-width: 681px) and (max-width: 960px) and (max-height: 610px) {
  body.theme-blackeye .app {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
  }

  body.theme-blackeye .app.sidebar-collapsed {
    display: grid;
    grid-template-columns: 0 minmax(0, 1fr);
  }

  body.theme-blackeye .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    width: 190px;
    height: auto;
    padding: 9px 11px;
    transform: none;
  }

  body.theme-blackeye .app.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
  }

  body.theme-blackeye .sidebar > .brand {
    display: flex;
    min-height: 45px;
  }

  body.theme-blackeye .sidebar > .brand img {
    width: 96px;
    max-height: 45px;
  }

  body.theme-blackeye .provider-user,
  body.theme-blackeye .sync-card,
  body.theme-blackeye .validity-card {
    display: none;
  }

  body.theme-blackeye .sidebar nav {
    display: grid;
    min-height: 0;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: 1fr;
    gap: 3px;
    margin-top: 7px;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.theme-blackeye .sidebar .nav-item {
    display: grid;
    min-height: 34px;
    grid-template-columns: 28px minmax(0, 1fr);
    grid-template-rows: 1fr;
    justify-items: start;
    align-items: center;
    gap: 8px;
    padding: 3px 6px;
    font-size: 9px;
    line-height: 1.1;
    text-align: left;
    white-space: normal;
  }

  body.theme-blackeye .sidebar .nav-item > span {
    grid-column: 1;
    grid-row: 1;
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    justify-self: start;
  }

  body.theme-blackeye .main,
  body.theme-blackeye .app.sidebar-collapsed .main {
    grid-column: 2;
    padding-bottom: 34px;
  }

  body.theme-blackeye .sidebar-toggle {
    display: grid;
  }

  body.theme-blackeye .mobile-home-brand {
    display: none;
  }
}

/* Tablet / large-phone landscape: keep the Black Eye sidebar readable and collapsible. */
@media (orientation: landscape) and (max-width: 960px) and (max-height: 610px) {
  body.theme-blackeye .app {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  body.theme-blackeye .sidebar {
    width: 190px;
    padding: 14px 12px;
  }

  body.theme-blackeye .sidebar > .brand img {
    width: 112px;
    max-height: 64px;
  }

  body.theme-blackeye .sidebar nav {
    gap: 3px;
    margin-top: 12px;
  }

  body.theme-blackeye .sidebar .nav-item {
    min-height: 34px;
    padding: 4px 6px;
    font-size: 10px;
    grid-template-columns: 28px minmax(0, 1fr);
    column-gap: 7px;
  }

  body.theme-blackeye .sidebar .nav-item > span {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    border-radius: 7px;
  }

  body.theme-blackeye .provider-user {
    margin-top: 8px;
    padding: 7px 8px 7px 27px;
  }

  body.theme-blackeye .provider-user:before {
    left: 10px;
    top: 12px;
  }

  body.theme-blackeye .sync-card,
  body.theme-blackeye .validity-card {
    padding: 8px 9px;
    font-size: 8px;
  }

  body.theme-blackeye .main {
    padding: 12px 17px 34px;
  }

  body.theme-blackeye .sidebar-toggle {
    width: 35px;
    height: 35px;
    flex-basis: 35px;
  }

  body.theme-blackeye .content-grid.live-folders {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

  body.theme-blackeye .live-folder.has-blackeye-art .live-folder-art {
    height: auto;
    aspect-ratio: 1.52 / 1;
  }
}

@media (orientation: portrait) and (max-width: 760px) {
  #contentGrid.content-grid.view-all-grid:not(.search-results):not(.live-events-guide-mode):not(.movie-genre-carousels) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 13px 9px;
  }

  .content-grid.view-all-grid .content-card h4 {
    margin-top: 7px;
    font-size: 10px;
  }

  .content-grid.view-all-grid .content-card p {
    font-size: 8px;
  }
}

/* El tamaño real del viewport manda sobre reportes inconsistentes de orientación móvil. */
.multiview-grid.is-landscape.size-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: minmax(0, 1fr) !important;
}

.multiview-grid.is-landscape.size-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
}

@media (min-aspect-ratio: 4/3) {
  .multiview-grid.size-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: minmax(0, 1fr) !important;
  }

  .multiview-grid.size-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (orientation: portrait) and (max-width: 560px) {
  .multiview-grid.size-4 {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, minmax(0, 1fr));
  }

  .multiview-grid.size-4 .multiview-controls {
    grid-template-columns: minmax(0, 1fr) auto auto;
    padding: 3px 4px;
  }

  .multiview-grid.size-4 .multiview-controls select,
  .multiview-grid.size-4 .multiview-controls button {
    min-height: 28px;
    padding: 5px;
  }

  .multiview-grid.size-4 .multiview-tile-fullscreen {
    top: 5px;
    right: 5px;
    width: 29px;
    height: 29px;
  }
}

@media (orientation: landscape) and (max-height: 610px) {
  .multiview-grid.size-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }

  .multiview-grid.size-4 .multiview-controls {
    padding: 3px 4px;
  }

  .multiview-grid.size-4 .multiview-controls select,
  .multiview-grid.size-4 .multiview-controls button {
    min-height: 27px;
    padding: 4px 5px;
  }
}

@media (max-width: 760px), (max-width: 960px) and (max-height: 520px) {
  .live-events-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }

  .live-events-toolbar > div {
    justify-content: space-between;
  }

  .live-events-toolbar strong {
    max-width: 65%;
    font-size: 11px;
  }

  .live-events-toolbar button {
    flex: 1;
    min-height: 42px;
  }

  .multiview-dialog[open] {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .multiview-header {
    min-height: 62px;
    padding: 9px 52px 9px 10px;
  }

  .multiview-header h2 {
    font-size: 18px;
  }

  .multiview-size button {
    min-height: 38px;
    padding: 8px 9px;
    font-size: 8px;
  }

  .multiview-grid {
    gap: 4px;
    padding: 4px;
  }

  .multiview-grid.size-2 {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }

  .multiview-controls {
    gap: 4px;
    padding: 5px;
  }

  .multiview-controls select {
    padding: 8px 6px;
    font-size: 9px;
  }

  .multiview-controls button {
    padding: 7px;
    font-size: 8px;
  }

  .multiview-hint {
    padding-bottom: calc(7px + env(safe-area-inset-bottom));
    font-size: 8px;
  }
}

@media (orientation: landscape) and (max-height: 610px) {
  .multiview-grid.size-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: 1fr;
  }

  .multiview-header {
    min-height: 48px;
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .multiview-header .eyebrow,
  .multiview-hint {
    display: none;
  }
}

@media (max-width: 760px) and (max-height: 610px) {
  .detail-dialog.has-trailer .trailer-shell {
    height: auto;
    max-height: min(38dvh, 220px);
    aspect-ratio: 16 / 9;
  }

  .detail-dialog.has-trailer .detail-poster {
    width: 60px;
    height: 90px;
  }

  .detail-dialog.has-trailer .trailer-shell > span {
    left: 85px;
  }

  .detail-dialog.has-trailer .detail-content h2 {
    font-size: 22px;
  }

  .detail-dialog.has-trailer .detail-content > p:not(.eyebrow) {
    -webkit-line-clamp: 2;
  }
}

@media (max-width: 760px), (max-width: 960px) and (max-height: 520px) {
  .hero.is-live-event {
    min-height: 500px;
    padding: 27px 23px 158px;
  }

  .hero.is-live-event .hero-copy {
    max-width: 100%;
  }

  .hero.is-live-event .hero-copy h3 {
    font-size: clamp(31px, 9vw, 40px);
  }

  .hero.is-live-event .hero-copy p {
    font-size: 13px;
    line-height: 1.45;
  }

  .hero.is-live-event .hero-visual {
    position: absolute;
    right: 22px;
    bottom: 18px;
    left: 22px;
    top: auto;
    transform: none;
  }

  .hero-event-panel {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    width: 100%;
    padding: 14px 16px;
    transform: none;
  }

  .hero-event-panel span,
  .hero-event-panel small,
  .hero-event-panel em,
  .hero-event-panel p {
    grid-column: 2;
    margin-left: 15px;
  }

  .hero-event-panel strong {
    grid-column: 1;
    grid-row: 1 / 5;
    align-self: center;
    margin: 0;
    font-size: 43px;
  }

  .hero-event-panel em {
    margin-top: 5px;
  }

  .hero-event-panel p {
    margin-top: 3px;
  }

  .live-events-epg-header {
    display: none;
  }

  .live-event-row {
    grid-template-columns: 72px minmax(0, 1fr) 34px;
    gap: 10px;
    min-height: 102px;
    padding: 12px 10px;
  }

  .live-event-time {
    grid-column: 1;
    grid-row: 1 / 3;
  }

  .live-event-time strong {
    font-size: 21px;
  }

  .live-event-info {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .live-event-info strong {
    font-size: 13px;
  }

  .live-event-status {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    padding: 6px 8px;
  }

  .live-event-play {
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: center;
    width: 32px;
    height: 32px;
  }

  .live-events-actions {
    width: 100%;
  }
}

@media (max-width: 760px), (max-width: 960px) and (max-height: 520px) {
  .hero,
  .hero.is-live-event {
    min-height: 330px;
    padding: 21px 19px 103px;
    border-radius: 20px;
  }

  .hero .pill {
    padding: 5px 8px;
    font-size: 8px;
  }

  .hero h3,
  .hero.is-live-event .hero-copy h3 {
    max-width: calc(100% - 8px);
    margin: 10px 0 7px;
    font-size: clamp(27px, 8vw, 34px);
    letter-spacing: -1.5px;
  }

  .hero p,
  .hero.is-live-event .hero-copy p {
    display: -webkit-box;
    overflow: hidden;
    max-width: 100%;
    font-size: 11px;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .hero .primary-button,
  .hero .ghost-button {
    margin: 10px 5px 0 0;
    padding: 9px 11px;
    font-size: 9px;
  }

  .hero.is-live-event .hero-visual {
    right: 19px;
    bottom: 48px;
    left: 19px;
  }

  .hero-event-panel {
    padding: 9px 12px;
    border-radius: 13px;
  }

  .hero-event-panel strong {
    font-size: 31px;
  }

  .hero-event-panel span {
    font-size: 8px;
  }

  .hero-event-panel small {
    font-size: 7px;
  }

  .hero-event-panel em {
    overflow: hidden;
    margin-top: 2px;
    font-size: 9px;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .hero-event-panel p {
    margin-top: 2px;
    font-size: 8px;
  }

  .hero-carousel-controls {
    right: 12px;
    bottom: 10px;
    left: 12px;
    justify-content:center;
    min-height: 34px;
    padding: 3px 5px;
  }

  .hero-carousel-arrow {
    width: 28px;
    height: 28px;
  }

  .hero-carousel-dots {
    max-width: 132px;
    overflow: hidden;
  }

  .hero-carousel-count {
    font-size: 8px;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .hero,
  .hero.is-live-event {
    min-height: 245px;
    margin-top: 58px;
    padding: 16px 190px 44px 18px;
  }

  .hero.is-live-event .hero-copy {
    max-width: 100%;
  }

  .hero.is-live-event .hero-visual {
    right: 14px;
    bottom: 48px;
    left: auto;
    width: 160px;
  }

  .hero-event-panel {
    display: block;
    width: 160px;
  }

  .hero-event-panel span,
  .hero-event-panel small,
  .hero-event-panel em,
  .hero-event-panel p {
    margin-left: 0;
  }

  .hero-event-panel strong {
    display: block;
    margin-top: 3px;
    font-size: 29px;
  }
}

@media (max-width: 760px), (max-width: 960px) and (max-height: 520px) {
  .hero.is-carousel-changing .hero-visual {
    animation: hero-carousel-mobile-enter .28s ease both;
  }
}

@keyframes hero-carousel-mobile-enter {
  from { opacity: .35; }
  to { opacity: 1; }
}

@media (orientation: landscape) and (max-width: 960px) and (max-height: 520px) {
  .content-section {
    margin-top: 18px;
  }

  .section-heading {
    margin-bottom: 9px;
  }

  .section-heading h3,
  .search-group-heading h3 {
    font-size: 15px;
  }

  .section-heading span,
  .search-group-heading span {
    font-size: 8px;
  }

  #contentGrid.content-grid:not(.live-folders):not(.live-events-guide-mode):not(.search-results):not(.movie-genre-carousels),
  .search-group-grid {
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 11px 8px;
  }

  .search-group + .search-group {
    margin-top: 22px;
  }

  .search-group-heading {
    margin-bottom: 9px;
  }

  .content-card .poster {
    border-radius: 10px;
    box-shadow: 0 8px 19px #0005;
  }

  .content-card:hover .poster,
  .content-card:focus .poster {
    transform: translateY(-2px);
  }

  .content-card h4 {
    margin: 6px 1px 0;
    font-size: 10px;
    line-height: 1.2;
  }

  .content-card p {
    display: none;
  }

  .poster-fallback {
    padding: 9px;
  }

  .poster-fallback:before {
    top: 9px;
    left: 9px;
    width: 27px;
    height: 27px;
    border-radius: 8px;
    font-size: 10px;
  }

  .poster-fallback span {
    margin-bottom: 4px;
    font-size: 6px;
  }

  .poster-fallback strong {
    font-size: 11px;
    -webkit-line-clamp: 3;
  }

  .poster:after {
    right: 7px;
    bottom: 7px;
    width: 26px;
    height: 26px;
    font-size: 8px;
  }

  .favorite-mark {
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    font-size: 12px;
  }
}

@media (max-width: 760px), (max-width: 960px) and (max-height: 520px) {
  .series-continue {
    grid-template-columns: 35px minmax(0, 1fr) auto;
    gap: 9px;
    margin: 11px 0 4px;
    padding: 9px 10px;
    border-radius: 12px;
  }

  .series-continue-icon {
    width: 34px;
    height: 34px;
    font-size: 10px;
  }

  .series-continue-copy strong {
    font-size: 11px;
  }

  .series-continue-action {
    font-size: 7px;
  }

  .search-group-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .search-result-card {
    grid-template-columns: 52px minmax(0, 1fr);
    min-height: 76px;
  }

  .search-result-card .poster {
    width: 52px;
    height: 60px;
  }

  .request-dialog[open],
  .access-dialog[open] {
    width: calc(100vw - 16px);
    max-width: none;
    max-height: calc(100dvh - 16px);
    margin: 8px;
    border-radius: 18px;
  }

  .request-form,
  .access-form {
    padding: 28px 19px 22px;
  }

  .request-form h2,
  .access-form h2 {
    font-size: 25px;
  }

  .request-fields {
    grid-template-columns: 1fr;
    gap: 11px;
  }

  .request-fields label:nth-child(2),
  .captcha-field {
    grid-column: auto;
  }

  .captcha-field {
    grid-template-columns: minmax(125px, .45fr) minmax(0, 1fr);
  }
}

@media (orientation: landscape) and (max-width: 960px) and (max-height: 520px) {
  .search-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Must remain last: mobile nav layout overrides every legacy breakpoint above. */
@media (orientation: portrait) and (max-width: 760px),
       (orientation: landscape) and (max-width: 680px) and (max-height: 610px) {
  body.theme-blackeye .app,
  body.theme-blackeye .app.sidebar-collapsed{display:block;grid-template-columns:none}
  body.theme-blackeye .sidebar,
  body.theme-blackeye .app.sidebar-collapsed .sidebar{position:fixed;inset:auto 0 0;width:auto;height:calc(74px + env(safe-area-inset-bottom));padding:6px 8px calc(6px + env(safe-area-inset-bottom));transform:none}
  body.theme-blackeye .sidebar>.brand,
  body.theme-blackeye .provider-user,
  body.theme-blackeye .sync-card,
  body.theme-blackeye .validity-card{display:none}
  body.theme-blackeye .sidebar nav{display:grid;height:100%;grid-auto-flow:column;grid-auto-columns:minmax(66px,1fr);grid-template-columns:none;gap:3px;margin:0;overflow-x:auto;overflow-y:hidden}
  body.theme-blackeye .sidebar .nav-item{display:grid;min-width:0;min-height:58px;grid-template-columns:1fr;grid-template-rows:36px minmax(12px,auto);place-items:center;gap:2px;padding:2px 4px;font-size:7px;line-height:1.05;text-align:center;white-space:normal}
  body.theme-blackeye .sidebar .nav-item>span{grid-column:1;grid-row:1;width:34px;height:34px;flex-basis:34px;align-self:center;justify-self:center}
  body.theme-blackeye .main{grid-column:auto;padding-bottom:calc(94px + env(safe-area-inset-bottom))}
  body.theme-blackeye .topbar{position:relative}
  body.theme-blackeye .mobile-home-brand{position:absolute;z-index:3;top:0;left:0;display:grid;width:42px;height:42px;place-items:center;padding:0;overflow:hidden;border:1px solid #d5b15b3f;border-radius:12px;background:#090a0b;box-shadow:0 7px 20px #0008}
  body.theme-blackeye .mobile-home-brand img{display:block;width:37px;height:37px;object-fit:contain}
  body.theme-blackeye .topbar-copy{min-height:42px;padding-left:51px;align-items:center}
  body.theme-blackeye .sidebar-toggle{display:none}
}

@media (orientation: landscape) and (min-width: 681px) and (max-width: 960px) and (max-height: 610px) {
  body.theme-blackeye .app{display:grid;grid-template-columns:190px minmax(0,1fr)}
  body.theme-blackeye .app.sidebar-collapsed{display:grid;grid-template-columns:0 minmax(0,1fr)}
  body.theme-blackeye .sidebar{position:fixed;inset:0 auto 0 0;display:flex;width:190px;height:auto;padding:9px 11px;transform:none}
  body.theme-blackeye .app.sidebar-collapsed .sidebar{transform:translateX(-100%)}
  body.theme-blackeye .sidebar>.brand{display:flex;min-height:45px}
  body.theme-blackeye .sidebar>.brand img{width:96px;max-height:45px}
  body.theme-blackeye .provider-user,
  body.theme-blackeye .sync-card,
  body.theme-blackeye .validity-card{display:none}
  body.theme-blackeye .sidebar nav{display:grid;min-height:0;grid-auto-flow:row;grid-auto-columns:auto;grid-template-columns:1fr;gap:3px;margin-top:7px;overflow-x:hidden;overflow-y:auto}
  body.theme-blackeye .sidebar .nav-item{display:grid;min-height:34px;grid-template-columns:28px minmax(0,1fr);grid-template-rows:1fr;justify-items:start;align-items:center;gap:8px;padding:3px 6px;font-size:9px;line-height:1.1;text-align:left;white-space:normal}
  body.theme-blackeye .sidebar .nav-item>span{grid-column:1;grid-row:1;width:28px;height:28px;flex-basis:28px;justify-self:start}
  body.theme-blackeye .main,
  body.theme-blackeye .app.sidebar-collapsed .main{grid-column:2;padding-bottom:34px}
  body.theme-blackeye .sidebar-toggle{display:grid}
  body.theme-blackeye .mobile-home-brand{display:none}
}

/* Black Eye navigation v8.
   Desktop: the fixed control lives inside the sidebar and becomes an edge tab.
   Landscape phones/tablets: collapsed mode keeps a fixed icon rail for navigation. */
body.theme-blackeye .sidebar {
  overflow: visible;
}

body.theme-blackeye .sidebar-toggle {
  position: absolute;
  z-index: 14;
  top: 24px;
  right: -18px;
  display: grid;
  width: 36px;
  height: 42px;
  flex: 0 0 36px;
  place-items: center;
  padding: 0;
  border-color: #d5b15b66;
  border-radius: 0 12px 12px 0;
  background: linear-gradient(145deg, #211b10, #090909);
  color: #e4c878;
  box-shadow: 0 9px 26px #000b;
  transition: right .24s ease, border-radius .24s ease, background .24s ease;
}

body.theme-blackeye .sidebar-toggle:hover,
body.theme-blackeye .sidebar-toggle:focus-visible {
  border-color: #ead58f;
  outline: none;
  background: linear-gradient(145deg, #322714, #111);
  color: #fff4c8;
}

body.theme-blackeye .sidebar-toggle span {
  font-size: 25px;
  line-height: 1;
}

body.theme-blackeye .app.sidebar-collapsed .sidebar-toggle {
  right: -38px;
  border-left-color: #d5b15b33;
  border-radius: 0 12px 12px 0;
}

@media (orientation: landscape) and (min-width: 681px) and (max-width: 1180px) and (max-height: 820px) {
  body.theme-blackeye .app,
  body.theme-blackeye .app.sidebar-collapsed {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
  }

  body.theme-blackeye .app.sidebar-collapsed {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  body.theme-blackeye .sidebar,
  body.theme-blackeye .app.sidebar-collapsed .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    width: 190px;
    height: auto;
    padding: 9px 11px;
    transform: none;
    transition: width .24s ease, padding .24s ease;
  }

  body.theme-blackeye .app.sidebar-collapsed .sidebar {
    width: 58px;
    padding: 8px 7px;
  }

  body.theme-blackeye .sidebar > .brand,
  body.theme-blackeye .app.sidebar-collapsed .sidebar > .brand {
    display: flex;
    width: 100%;
    min-height: 43px;
    justify-content: flex-start;
  }

  body.theme-blackeye .sidebar > .brand img {
    width: 94px;
    max-height: 43px;
    object-fit: contain;
    object-position: left center;
  }

  body.theme-blackeye .app.sidebar-collapsed .sidebar > .brand {
    min-height: 38px;
    justify-content: center;
  }

  body.theme-blackeye .app.sidebar-collapsed .sidebar > .brand img {
    width: 38px;
    height: 38px;
    object-position: center;
  }

  body.theme-blackeye .provider-user,
  body.theme-blackeye .sync-card,
  body.theme-blackeye .validity-card {
    display: none;
  }

  body.theme-blackeye .sidebar nav,
  body.theme-blackeye .app.sidebar-collapsed .sidebar nav {
    display: grid;
    min-height: 0;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: 1fr;
    align-content: start;
    gap: 3px;
    margin-top: 8px;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.theme-blackeye .sidebar .nav-item {
    display: grid;
    min-height: 34px;
    grid-template-columns: 28px minmax(0, 1fr);
    grid-template-rows: 1fr;
    justify-items: start;
    align-items: center;
    gap: 8px;
    padding: 3px 6px;
    font-size: 9px;
    line-height: 1.1;
    text-align: left;
    white-space: normal;
  }

  body.theme-blackeye .sidebar .nav-item > span {
    grid-column: 1;
    grid-row: 1;
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    justify-self: start;
  }

  body.theme-blackeye .app.sidebar-collapsed .sidebar .nav-item {
    width: 44px;
    min-height: 38px;
    grid-template-columns: 1fr;
    place-items: center;
    gap: 0;
    padding: 3px;
    overflow: hidden;
    font-size: 0;
    white-space: nowrap;
  }

  body.theme-blackeye .app.sidebar-collapsed .sidebar .nav-item > span {
    width: 31px;
    height: 31px;
    flex-basis: 31px;
    justify-self: center;
    font-size: 10px;
  }

  body.theme-blackeye .main,
  body.theme-blackeye .app.sidebar-collapsed .main {
    grid-column: 2;
    min-width: 0;
    padding-bottom: 34px;
  }

  body.theme-blackeye .sidebar-toggle,
  body.theme-blackeye .app.sidebar-collapsed .sidebar-toggle {
    top: 12px;
    right: -18px;
    display: grid;
    width: 34px;
    height: 42px;
    border-radius: 0 12px 12px 0;
  }

  body.theme-blackeye .mobile-home-brand {
    display: none;
  }
}

/* Apple PWA: el contenido interactivo nunca invade la isla dinámica, la barra
   de estado, el recorte lateral ni el indicador inferior. */
@media (display-mode: standalone) {
  body.theme-blackeye .detail-dialog[open],
  body.theme-blackeye .detail-dialog.has-trailer[open] {
    inset: max(8px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left)) !important;
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
  }

  body.theme-blackeye .detail-dialog .detail-content,
  body.theme-blackeye .detail-dialog .detail-content.has-trailer {
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px);
  }

  body.theme-blackeye .player-dialog[open],
  body.theme-blackeye .multiview-dialog[open] {
    inset: env(safe-area-inset-top)
      env(safe-area-inset-right)
      env(safe-area-inset-bottom)
      env(safe-area-inset-left) !important;
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
  }

  body.theme-blackeye .player-dialog[open] video {
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;
  }
}

/* PWA iPhone/iPad: conserva los iconos aun con caché antigua y respeta las zonas seguras. */
body.theme-blackeye .sidebar .nav-item > span {
  background-image: url("/blackeye/menu-icons.png?v=20260806-2") !important;
  background-repeat: no-repeat !important;
  background-size: 300% 300% !important;
  opacity: 1;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

@media (display-mode: standalone) {
  html, body {
    min-height: 100dvh;
    background: #050505;
  }

  body.theme-blackeye .providerChooser,
  body.theme-blackeye #providerChooser,
  body.theme-blackeye #accountAccess,
  body.theme-blackeye #activation {
    box-sizing: border-box;
    padding-top: calc(18px + env(safe-area-inset-top));
    padding-left: max(18px, env(safe-area-inset-left));
    padding-right: max(18px, env(safe-area-inset-right));
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }

  body.theme-blackeye .main {
    padding-top: calc(18px + env(safe-area-inset-top));
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }
}

@media (display-mode: standalone) and (orientation: portrait) and (max-width: 760px) {
  body.theme-blackeye .main {
    padding-top: calc(14px + env(safe-area-inset-top));
  }

  body.theme-blackeye .sidebar,
  body.theme-blackeye .app.sidebar-collapsed .sidebar {
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: max(8px, env(safe-area-inset-right));
  }

  body.theme-blackeye dialog[open] > .dialog-close,
  body.theme-blackeye .detail-dialog[open] > .dialog-close,
  body.theme-blackeye .player-dialog[open] > .dialog-close,
  body.theme-blackeye .multiview-dialog[open] > .dialog-close {
    position: fixed !important;
    top: calc(env(safe-area-inset-top) + 10px) !important;
    right: max(10px, env(safe-area-inset-right)) !important;
    z-index: 10020 !important;
  }
}

@media (display-mode: standalone) and (orientation: landscape) {
  body.theme-blackeye .sidebar,
  body.theme-blackeye .app.sidebar-collapsed .sidebar {
    padding-left: max(7px, env(safe-area-inset-left));
  }
}

@media (orientation: portrait) and (max-width: 760px),
       (orientation: landscape) and (max-width: 680px) and (max-height: 610px) {
  body.theme-blackeye .sidebar-toggle,
  body.theme-blackeye .app.sidebar-collapsed .sidebar-toggle {
    display: none;
  }
}

/* Black Eye navigation v9: compact landscape rail without collisions. */
@media (orientation: landscape) and (min-width: 681px) and (max-width: 1180px) and (max-height: 820px) {
  body.theme-blackeye .app.sidebar-collapsed {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  body.theme-blackeye .app.sidebar-collapsed .sidebar {
    width: 52px;
    padding: 7px 6px;
  }

  body.theme-blackeye .app.sidebar-collapsed .sidebar > .brand {
    min-height: 34px;
  }

  body.theme-blackeye .app.sidebar-collapsed .sidebar > .brand img {
    width: 32px;
    height: 32px;
  }

  body.theme-blackeye .app.sidebar-collapsed .sidebar nav {
    gap: 1px;
    margin-top: 6px;
    padding: 0;
    scrollbar-width: none;
  }

  body.theme-blackeye .app.sidebar-collapsed .sidebar nav::-webkit-scrollbar {
    display: none;
  }

  body.theme-blackeye .app.sidebar-collapsed .sidebar .nav-item {
    width: 40px;
    min-height: 34px;
    padding: 2px;
    border-radius: 9px;
  }

  body.theme-blackeye .app.sidebar-collapsed .sidebar .nav-item > span {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    border-radius: 7px;
  }

  body.theme-blackeye .sidebar-toggle,
  body.theme-blackeye .app.sidebar-collapsed .sidebar-toggle {
    top: 50%;
    right: -21px;
    width: 22px;
    height: 48px;
    transform: translateY(-50%);
    border-width: 1px;
    border-left-color: #d5b15b24;
    border-radius: 0 10px 10px 0;
    background: linear-gradient(180deg, #17140ef2, #080808f2);
    color: #cdb16a;
    box-shadow: 4px 8px 20px #0009;
    opacity: .82;
  }

  body.theme-blackeye .sidebar-toggle:hover,
  body.theme-blackeye .sidebar-toggle:focus-visible {
    right: -23px;
    opacity: 1;
  }

  body.theme-blackeye .sidebar-toggle span {
    font-size: 18px;
  }
}

/* v10: la navegación inferior pertenece al viewport, no al documento que
   desplaza. El área segura se absorbe dentro de la barra para que nunca flote. */
@media (orientation: portrait) and (max-width: 760px),
       (orientation: landscape) and (max-width: 680px) and (max-height: 610px) {
  body.theme-blackeye .sidebar,
  body.theme-blackeye .app.sidebar-collapsed .sidebar {
    position: fixed !important;
    z-index: 10000 !important;
    top: auto !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: calc(74px + env(safe-area-inset-bottom)) !important;
    min-height: calc(74px + env(safe-area-inset-bottom)) !important;
    margin: 0 !important;
    padding: 6px max(8px, env(safe-area-inset-right))
      calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)) !important;
    transform: translate3d(0, 0, 0) !important;
    -webkit-transform: translate3d(0, 0, 0) !important;
    contain: layout paint;
    isolation: isolate;
  }

  body.theme-blackeye .main,
  body.theme-blackeye .app.sidebar-collapsed .main {
    padding-bottom: calc(98px + env(safe-area-inset-bottom)) !important;
  }
}
