/* Mobile settings, catalogue pagination and the shared search bookmark sheet. */
.watch-catpagination .pages > .watch-pagination-gap {display:none!important;}
@media (max-width:900px) {
  html body .watch-catpage .watch-catpagination .pages[data-watch-pagination-compact] > [data-watch-pagination-hidden="1"] {
    display:none!important;
  }
  .watch-catpage .watch-catpagination .pages[data-watch-pagination-compact] > :is(a,span):not(.nav_ext) {
    flex:0 0 40px;
    width:40px;
    min-width:40px;
  }
  .watch-catpage .watch-catpagination .pages[data-watch-pagination-compact] > .watch-pagination-gap:not([data-watch-pagination-hidden]) {
    display:inline-flex!important;
    flex:0 0 16px;
    width:16px;
    min-width:16px;
    height:40px;
    padding:0!important;
    background:transparent!important;
  }
  /* The desktop rail uses JS dragging with overflow hidden and pan-y.
     Mobile rails must scroll natively while individual posters stay inert. */
  html body .watch-home .rail {
    overflow-x:auto!important;
    overflow-y:hidden!important;
    touch-action:pan-x pan-y!important;
    overscroll-behavior-x:contain;
    -webkit-overflow-scrolling:touch;
  }
  html,html body {
    max-width:100%;
    overflow-x:hidden!important;
    overscroll-behavior:none!important;
  }
  /* Tab navigation imports home/library into fixed scrolling screens.
     Their background must never become a horizontal scroll container. */
  html body :is(#watchMobileHomeScreen,#watchMobileLibraryScreen) {
    max-width:100%;
    min-width:0;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior:none!important;
  }
  /* Clip the document without turning it into another horizontal scroller.
     The nested rails and settings tabs retain their own native scrolling. */
  @supports (overflow-x:clip) {
    html,html body {overflow-x:clip!important;}
  }
  html body :is(.mcard,.watch-rowCard) :is(a,img),
  html body .watch-searchmodal__thumb {
    -webkit-user-drag:none!important;
    -webkit-touch-callout:none!important;
    -webkit-user-select:none!important;
    user-select:none!important;
  }
  html body .mcard__link,
  html body .mcard__link * {
    -webkit-touch-callout:none!important;
    -webkit-user-select:none!important;
    user-select:none!important;
  }
  /* Let the link handle a normal tap; the image itself cannot be lifted. */
  html body :is(.mcard,.watch-rowCard) img,
  html body .watch-searchmodal__thumb img {
    pointer-events:none!important;
  }
  /* Poster zoom is disabled on touch screens, so its bookmark must not
     keep the old hover-outset compensation on hover/focus/open. */
  html body :is(.watch-home,.watch-catpage,.watch-catgrid) .mcard.mcard.mcard .mcard__bm:not(.mcard__bm--inlinepreview):not(.mcard__bm--library) {
    top:10px!important;
    right:10px!important;
    transform:none!important;
  }
  html body .mcard.mcard.mcard .mcard__bm:not(.mcard__bm--inlinepreview) .mcard__bmBtn {
    transform:none!important;
  }
  /* Touch focus and sticky :hover must never run desktop poster zoom. */
  html body .mcard.mcard.mcard,
  html body .mcard.mcard.mcard .mcard__link,
  html body .mcard.mcard.mcard .mcard__img,
  html body .mcard.mcard.mcard .mcard__img img,
  html body .mcard.mcard.mcard .mcard__textLayer {
    transform:none!important;
  }
  /* Keep an explicit clipping surface when the bookmark gets its own layer. */
  html body .mcard.mcard.mcard .mcard__link,
  html body .mcard.mcard.mcard .mcard__img {
    border-radius:18px!important;
    overflow:hidden!important;
  }
  html body .mcard.mcard.mcard .mcard__img img {
    border-radius:inherit!important;
  }
  /* The translucent trailer gradient exposes a bright last video row.
     Finish the clipped media edge with the page's exact theme colour. */
  .watch-hero__shade::after {
    content:"";
    position:absolute;
    left:0;
    right:0;
    bottom:0;
    height:64px;
    background:linear-gradient(to top,var(--w-bg,#050505),transparent);
    pointer-events:none;
  }
  .watch-settings .watch-settings__grid {grid-template-columns:minmax(0,1fr);}
  #watchSettingsModal .watch-settings__grid {
    flex-direction:column!important;
    min-height:0!important;
    min-width:0!important;
  }
  .watch-settings .watch-settings__tabs,
  #watchSettingsModal .watch-settings__tabs {
    display:flex!important;
    flex-direction:row!important;
    flex-wrap:nowrap!important;
    flex:0 0 auto!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    overscroll-behavior-x:contain;
    -webkit-overflow-scrolling:touch;
    scroll-padding-inline:12px;
    padding:10px 12px!important;
    gap:8px!important;
    border-right:0!important;
  }
  .watch-settings .watch-settings__tab,
  #watchSettingsModal .watch-settings__tab {
    flex:0 0 auto!important;
    width:auto!important;
    min-height:44px;
    white-space:nowrap;
    margin:0!important;
  }
  #watchSettingsModal .watch-settings__panes {
    min-height:0!important;
    min-width:0!important;
    flex:1 1 auto!important;
    overscroll-behavior-y:contain;
  }
  .watch-catpage .watch-catpagination {
    padding:0 12px 8px;
    overflow:visible;
  }
  .watch-catpage .watch-catpagination .navigation {
    width:100%;
    min-width:0;
    flex-wrap:nowrap;
    gap:8px;
  }
  .watch-catpage .watch-catpagination .pages {
    flex:0 1 auto;
    width:max-content;
    max-width:100%;
    min-width:0;
    flex-wrap:nowrap;
    justify-content:flex-start;
    overflow-x:auto;
    overflow-y:hidden;
    overscroll-behavior-x:contain;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
    gap:6px;
    order:0;
  }
  .watch-catpage .watch-catpagination .pages::-webkit-scrollbar {display:none;}
  .watch-catpage .watch-catpagination .pages > a,
  .watch-catpage .watch-catpagination .pages > span:not(.nav_ext) {
    flex:1 1 38px;
    width:38px;
    min-width:24px;
    height:40px;
    padding:0!important;
  }
  .watch-catpage .watch-catpagination .page_prev {order:1;}
  .watch-catpage .watch-catpagination .page_next {order:2;}
  .watch-catpage .watch-catpagination :is(.page_prev,.page_next) {
    display:none!important;
  }
  html body .watch-catpage .mcard .mcard__bm:not(.mcard__bm--inlinepreview):not(.mcard__bm--library):not([hidden]) {
    opacity:1!important;
    visibility:visible!important;
    pointer-events:auto!important;
    transform:none!important;
  }
  html body .watch-mobile-bookmark-sheet .watch-searchmark__sep {display:none!important;}
  html body .watch-mobile-bookmark-sheet .watch-searchmark__item {
    display:flex!important;
    align-items:center;
    width:100%;
    min-width:0;
    min-height:52px!important;
    gap:9px!important;
    padding:10px 12px!important;
    border:0!important;
    border-radius:13px!important;
    background:#ffffff05!important;
    color:#d4d4d9!important;
    font:400 13px/1.2 "Segoe UI",Tahoma,Arial,sans-serif!important;
    text-align:left;
    cursor:pointer;
  }
  html body .watch-mobile-bookmark-sheet .watch-searchmark__item[aria-checked="true"] {
    background:#ffffff14!important;
    color:#fff!important;
    box-shadow:inset 0 0 0 1px #ffffff15!important;
  }
  html body .watch-mobile-bookmark-sheet .watch-searchmark__itemIcon {
    display:block;
    flex:0 0 18px;
    width:18px;
    height:18px;
    background:currentColor;
    -webkit-mask:var(--watch-library-icon) center/contain no-repeat;
    mask:var(--watch-library-icon) center/contain no-repeat;
  }
}
