/* One interaction policy, applied after component styles. Collections keep their
   scroll/keyboard handlers; only the actual card or action receives focus ink. */
:root {
  --shell-chrome-duration: 280ms;
  --shell-chrome-ease: cubic-bezier(.22,.7,.2,1);
  --shell-chrome-opacity-duration: 220ms;
}
body :is(.hs-row,.channel-row,.cp-stage,.cp-hero,.sg-opening-cards,.sg-discovery-row,.sg-actor-row,.sg-actor-film-row,.dx-row,.ss-shelf-row):is(:focus,:focus-visible,:focus-within) {
  outline: none !important;
  box-shadow: none !important;
}
body :is(.hs-card,.channel-button,.cp-cover,.dx-title-card,.sg-route-card,.sg-universe,.sg-actor-card,.sg-actor-film,.ss-card-open,.ntv-program):focus-visible {
  outline: 2px solid var(--text, #f2efe8) !important;
  outline-offset: 3px;
}
/* Animated red perimeter rings are retired on every device, including TV.
   Playback/status/selection markers and form validation are separate elements. */
body :is(.cp-action,.cp-save,.cp-cover,.dx-title-card,.service-nav-button,#catalog-connect,.sh-channel-button,.dx-live-brand-row,.dx-live-member,.hs-poster,.dx-poster,.sj-film-art,.sg-glass,.sg-quiet,.hs-see-all,.sh-button,.catalog-favorite-toggle,.favorite-toggle,#sync-create,#sync-connect)::after,
body :is(.channel-artwork,.sd-film-art:not([data-image='loading']),.ntv-art,.ntv-glass,.ntv-watch)::after,
body #app-sidebar :is(.sidebar-action,.sidebar-family,.sidebar-sport-item,.sagas-nav-button)::after,
body .sg-card-ring {
  display: none !important;
  animation: none !important;
}
body :is(.hs-cell,.dx-title-cell,.sj-film-art,.sg-route-card,.sg-universe,.sg-actor-card,.sg-actor-film,.dx-live-brand-row,.dx-live-member),
body .channel-item[data-kind='live'], body #content-presentation .cp-cover,
body .ntv .ntv-program-cell .ntv-program {
  translate: none !important;
}
/* Cards do not grow, lift, orbit or glow under a finger or mouse. The coverflow
   transform is its layout, so its existing inline 3D geometry is left intact. */
body :is(.hs-poster,.dx-poster,.sj-film-art,.sd-film-art,.sg-card-art,.channel-artwork,.ss-card-visual,.ntv-art) {
  box-shadow: none !important;
  border-color: var(--line-soft, #ffffff0b) !important;
  translate: none !important;
  scale: 1 !important;
}
body :is(.hs-poster-image,.dx-poster-image,.sg-art,.ss-card-image), body .ntv .ntv-visual > img {
  transform: none !important;
  scale: 1 !important;
  filter: none;
}
body #content-presentation .cp-cover { box-shadow: none !important; border-color: var(--line-soft, #ffffff0b) !important; }
body :is(.cp-action,.cp-save,.hs-see-all,.sg-glass,.sg-quiet,.catalog-favorite-toggle,.favorite-toggle):is(:hover,:focus-visible),
body #content-presentation .cp-save .cp-save-icon { box-shadow: none !important; }
body :is(.catalog-favorite-icon,.cp-save-icon)::after { filter: none !important; }

/* The artwork is a gesture surface; the useful copy is still selectable. */
body :is(#content-presentation,#home-shelves,#catalog-discovery,#streaming-services,#sagas-hub,.sj-page,.sd-page,.ntv) img {
  -webkit-user-drag: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
#content-presentation .cp-hero.is-banner-dragging,
#content-presentation .cp-hero.is-banner-dragging * { -webkit-user-select: none; user-select: none; }
body :is(.cp-plot,.cp-meta,.cp-episode-state,.hs-card-title,.hs-card-meta,.hs-shelf-description) {
  -webkit-user-select: text;
  user-select: text;
}
/* Clear legacy hover reveals when touch/pen is the current input, including
   hybrids whose media query still reports an attached mouse. */
body:not([data-input-modality='mouse']) .home-shelves .hs-hover-play { opacity: 0; }
body:not([data-input-modality='mouse']) :is(.hs-cell,.dx-title-cell) > .movie-seen-toggle,
body:not([data-input-modality='mouse']) #streaming-services :is(.ss-card-save,.ss-card-watched) { opacity: .9; }
body[data-input-modality='touch'] :is(.movie-seen-toggle,.episode-seen-toggle,.catalog-favorite-toggle,.ss-save,.sj-seen-toggle) .episode-seen-tooltip {
  opacity: 0; visibility: hidden;
}
body:not([data-input-modality='mouse']) :is(.cp-action,.cp-save,.hs-card,.dx-title-card,.sg-route-card,.sg-universe,.ss-card-open,.ss-button,.hs-see-all,.dx-live-brand-row,.dx-live-member):hover {
  transform: none;
}
body:not([data-input-modality='mouse']) :is(.movie-seen-toggle,.catalog-favorite-toggle,.cp-save,.hs-arrow,.icon-button,.sidebar-action,.sidebar-family,.sidebar-sport-item):hover :is(svg,.catalog-favorite-icon,.episode-seen-icon,.sidebar-icon,.sidebar-context-icon,.hs-arrow-icon),
body:not([data-input-modality='mouse']) #content-presentation .cp-save:hover .cp-save-icon::after {
  animation: none !important; transform: none !important; filter: none !important;
}
body[data-input-modality='touch'] .ntv :is(.ntv-glass,.ntv-watch,.ntv-favorite,.ntv-filter-items > button):hover {
  transform: none !important; translate: none !important; scale: 1 !important; box-shadow: none !important;
}
body[data-input-modality='touch'] #app-sidebar .service-nav-button:not([aria-pressed='true'])::before { opacity: 0; }
body :is(#content-presentation,#content-progress) img[data-image] { transition: opacity 160ms ease; }
/* Opening the surface never delays the media request or fullscreen gesture. */
#player-screen[open] #player-surface { animation: ui-player-arrive 160ms ease-out; }
@keyframes ui-player-arrive { from { opacity: 0; } to { opacity: 1; } }
@media (any-hover: hover) and (any-pointer: fine) {
  body[data-input-modality='mouse'] .home-shelves .hs-card:hover .hs-hover-play { opacity: 1; }
  body[data-input-modality='mouse'] :is(.catalog-favorite-toggle,.movie-seen-toggle,.cp-save,.hs-arrow):hover {
    color: var(--text, #f2efe8);
    opacity: 1;
  }
  body[data-input-modality='mouse'] :is(.catalog-favorite-toggle,.movie-seen-toggle,.cp-save,.hs-arrow):hover > :is(svg,.catalog-favorite-icon,.episode-seen-icon,.hs-arrow-icon) {
    filter: brightness(1.12);
  }
}
/* Press feedback never scales the hit box, moves a route or delays its action. */
body :is(button,a,[role='button']) { --ui-press-time: 110ms; }
body :is(button,a,[role='button']).ui-pressed { opacity: .8; --ui-press-time: 70ms; }
body :is(button,a,[role='button']) > :is(svg,.catalog-favorite-icon,.episode-seen-icon,.hs-arrow-icon,.mobile-nav-icon,.ms-action-icon,.profile-account-avatar) {
  transition: scale var(--ui-press-time) ease, opacity var(--ui-press-time) ease;
}
body :is(button,a,[role='button']).ui-pressed > :is(svg,.catalog-favorite-icon,.episode-seen-icon,.hs-arrow-icon,.mobile-nav-icon,.ms-action-icon,.profile-account-avatar) { scale: .96; }
body :is(button,a,[role='button']).ui-pressed::before,
body #content-presentation .cp-save.ui-pressed .cp-save-icon::after { scale: .96 !important; translate: none !important; }
@media (prefers-reduced-motion: reduce) {
  body :is(button,a,[role='button']) > :is(svg,.catalog-favorite-icon,.episode-seen-icon,.hs-arrow-icon,.mobile-nav-icon,.ms-action-icon,.profile-account-avatar) { transition: none; scale: 1 !important; }
  body :is(.hs-poster-image,.hs-poster-fallback,.cp-hero-art,.cp-hero-poster) { transition: none !important; animation: none !important; }
  #player-screen[open] #player-surface { animation: none; }
  body :is(button,a,[role='button']).ui-pressed::before,
  body #content-presentation .cp-save.ui-pressed .cp-save-icon::after { scale: 1 !important; }
}
@media (forced-colors: active) {
  body :is(.hs-card,.channel-button,.cp-cover,.dx-title-card,.sg-route-card,.sg-universe,.sg-actor-card,.ss-card-open,.ntv-program):focus-visible { outline-color: Highlight !important; }
}

/* A route may be superseded from either navigation strip. These icons never
   turn into a progress indicator or disappear while the page is preparing. */
body .topbar button[data-pending='true']::before,
body.mobile-shell-active #mobile-action-dock :is(button, #tab-favorites)[data-pending='true']::before { content: none !important; animation: none !important; }
body .topbar button[data-pending='true'] :is(svg, .mobile-nav-icon),
body.mobile-shell-active #mobile-action-dock button[data-pending='true'] :is(.mobile-dock-icon, .mobile-nav-icon, .profile-account-avatar) { visibility: visible !important; }
body.content-is-loading .topbar { transform: none !important; opacity: 1 !important; pointer-events: auto !important; }
body.content-is-loading #app-sidebar { visibility: hidden; pointer-events: none; }

/* Favorite work starts in the click task; only its icon becomes a spinner.
   Keep the button, focus and touch target in place throughout the update. */
body #series-favorite[aria-busy='true']::before,
body #player-favorite[aria-busy='true']::before,
body .favorite-toggle[aria-busy='true']::before,
body .ntv .ntv-favorite[aria-busy='true']::before,
body .catalog-favorite-toggle[aria-busy='true'] .catalog-favorite-icon,
body #streaming-services .ss-save[aria-busy='true'] .ss-save-icon,
body #content-presentation .cp-save[aria-busy='true'] .cp-save-icon::after,
body:not([data-input-modality='mouse']) #content-presentation .cp-save[aria-busy='true']:hover .cp-save-icon::after {
  content: ''; display: block; flex: none; box-sizing: border-box;
  width: 18px; height: 18px; min-width: 18px; min-height: 18px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; background: transparent !important;
  -webkit-mask: none !important; mask: none !important;
  opacity: 1; transform: none; scale: 1 !important;
  animation: ui-control-pending 700ms linear infinite !important;
}
@keyframes ui-control-pending { to { rotate: 1turn; } }
@media (prefers-reduced-motion: reduce) {
  body #series-favorite[aria-busy='true']::before,
  body #player-favorite[aria-busy='true']::before,
  body .favorite-toggle[aria-busy='true']::before,
  body .ntv .ntv-favorite[aria-busy='true']::before,
  body .catalog-favorite-toggle[aria-busy='true'] .catalog-favorite-icon,
  body #streaming-services .ss-save[aria-busy='true'] .ss-save-icon,
  body #content-presentation .cp-save[aria-busy='true'] .cp-save-icon::after,
  body:not([data-input-modality='mouse']) #content-presentation .cp-save[aria-busy='true']:hover .cp-save-icon::after {
    animation: none !important;
  }
}

/* The same scroll policy works at every width. Transforming a fixed header
   leaves content geometry untouched; reversing scroll smoothly reveals it. */
body .topbar, body.mobile-shell-active .topbar {
  transition: transform var(--shell-chrome-duration) var(--shell-chrome-ease),
    opacity var(--shell-chrome-opacity-duration) var(--shell-chrome-ease);
}
body.app-header-hidden .topbar { transform: translateY(-105%); opacity: 0; pointer-events: none; }
body.mobile-shell-active #mobile-action-dock {
  transform: translateY(0); opacity: 1;
  transition: transform var(--shell-chrome-duration) var(--shell-chrome-ease),
    opacity var(--shell-chrome-opacity-duration) var(--shell-chrome-ease);
}
body.mobile-shell-active.mobile-header-hidden #mobile-action-dock {
  transform: translateY(calc(100% + max(16px, env(safe-area-inset-bottom, 0px))));
  opacity: 0; pointer-events: none;
}
body .topbar button[data-nav-requested='true'],
body.mobile-shell-active #mobile-action-dock button[data-nav-requested='true'] { color: var(--text, #f2efe8); }
body.mobile-shell-active #mobile-action-dock button[data-nav-requested='true']::after {
  content: ''; position: absolute; bottom: 2px; left: calc(50% - 3px);
  width: 6px; height: 3px; border-radius: 2px; background: var(--accent-bright, #ff304c);
}
body.mobile-shell-active #mobile-action-dock button > :is(.mobile-dock-icon,.mobile-nav-icon,.profile-account-avatar) {
  transition: scale 100ms ease, opacity 100ms ease;
}
body.mobile-shell-active #mobile-action-dock button.ui-pressed > :is(.mobile-dock-icon,.mobile-nav-icon,.profile-account-avatar) {
  scale: .86; opacity: .7;
}
@media (prefers-reduced-motion: reduce) {
  :root { --shell-chrome-duration: 0ms; --shell-chrome-opacity-duration: 0ms; }
  body .topbar, body.mobile-shell-active .topbar, body.mobile-shell-active #mobile-action-dock,
  body.mobile-shell-active #mobile-action-dock button > :is(.mobile-dock-icon,.mobile-nav-icon,.profile-account-avatar) { transition: none; }
  body.mobile-shell-active #mobile-action-dock button.ui-pressed > :is(.mobile-dock-icon,.mobile-nav-icon,.profile-account-avatar) { scale: 1; }
}
