/* Icon controls share a hit area, not the glass surface of text actions.
   Load after component and mobile sheets so inherited button padding and
   background-image cannot shift an icon or draw a box on hover. */
body :is(
  #theme-toggle, #sidebar-toggle, #sync-close, .ui-dialog-close, .sc-close,
  .ss-choice-close, .ss-service-search-clear, .mobile-search-close, .dx-live-members-close,
  .favorite-toggle, .catalog-favorite-toggle, .hs-favorite-toggle, .dx-favorite-toggle, .dx-brand-favorite,
  .movie-seen-toggle:not(.movie-seen-labeled), .episode-seen-toggle,
  .ss-save, .ss-card-watched, .ss-hero-watched, .sg-save,
  .sj-seen-toggle, .sj-icon-action, .sj-compact-play,
  .hs-arrow, .cp-arrow, .sh-icon-button, .sh-agenda-control, .ntv-favorite,
  .sg-actor-choices > header > .sg-quiet
):not([hidden]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  flex-shrink: 0;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  line-height: 1;
  transform: none;
  transition: color 160ms ease, opacity 160ms ease;
}
body :is(
  #theme-toggle, #sidebar-toggle, #sync-close, .ui-dialog-close, .sc-close,
  .ss-choice-close, .ss-service-search-clear, .mobile-search-close, .dx-live-members-close,
  .favorite-toggle, .catalog-favorite-toggle, .hs-favorite-toggle, .dx-favorite-toggle, .dx-brand-favorite,
  .movie-seen-toggle:not(.movie-seen-labeled), .episode-seen-toggle,
  .ss-save, .ss-card-watched, .ss-hero-watched, .sg-save,
  .sj-seen-toggle, .sj-icon-action, .sj-compact-play,
  .hs-arrow, .cp-arrow, .sh-icon-button, .sh-agenda-control, .ntv-favorite,
  .sg-actor-choices > header > .sg-quiet
):not([hidden]):is(:hover:where(body[data-input-modality="mouse"] *), :active, :focus-visible) {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  filter: none;
  transform: none;
}
body :is(.favorite-toggle, .catalog-favorite-toggle)::after,
body #content-presentation .cp-save::after,
body .sg-actor-choices > header > .sg-quiet::after {
  content: none;
  animation: none;
}
body #app-sidebar #sidebar-toggle {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
body #app-sidebar #sidebar-toggle:is(:hover:where(body[data-input-modality="mouse"] *), :focus-visible, :active) {
  background: transparent;
  box-shadow: none;
}
body:not(.sagas-visible) #change-account:not([hidden]) {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
body:not(.sagas-visible) #change-account:not([hidden]):is(:hover:where(body[data-input-modality="mouse"] *), :active, :focus-visible) {
  background: transparent;
  box-shadow: none;
}
body #sync-close::before,
body #sync-close::after {
  transition: scale 160ms ease, translate 160ms ease;
}
@media (any-hover: hover) and (any-pointer: fine) {
  body #sync-close:not(:disabled):hover:where(body[data-input-modality="mouse"] *)::before,
  body #sync-close:not(:disabled):hover:where(body[data-input-modality="mouse"] *)::after {
    scale: 1.1;
    translate: 0 -1px;
  }
}

/* Every close icon uses the same strokes instead of font-specific × metrics. */
body :is(.ui-dialog-close, .sc-close, .ss-choice-close, .ss-service-search-clear, .mobile-search-close),
body .sg-actor-choices > header > .sg-quiet,
body #player-screen #saga-queue-close {
  font-size: 0;
}
body #streaming-services .ss-service-search-clear {
  font-size: 0;
}
body :is(.ui-dialog-close, .sc-close, .ss-choice-close, .ss-service-search-clear, .mobile-search-close)::before,
body .sg-actor-choices > header > .sg-quiet::before,
body #player-screen #saga-queue-close::before {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 6 12 12M6 18 18 6' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
body .dx-live-members-close:empty::before,
body .dx-live-members-close:empty::after {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
}
body .dx-live-members-close:empty::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* Toolbar controls must win over the saga toolbar's text-button rules.
   Keep native selects stretched over the icon, including keyboard focus. */
body #player-screen #player-surface .player-toolbar :is(button.player-icon-button, .player-select-icon) {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #bec4cc;
  box-shadow: none;
  font-size: 0;
  line-height: 1;
  transform: none;
}
body #player-screen #player-surface .player-toolbar :is(button.player-icon-button, .player-select-icon)::before {
  position: static;
  display: block;
  width: 20px;
  height: 20px;
  margin: 0;
  flex: none;
  transition: scale 160ms ease, translate 160ms ease;
}
body #player-screen #player-surface .player-toolbar :is(button.player-icon-button, .player-select-icon):is(:hover:where(body[data-input-modality="mouse"] *), :focus-visible, :focus-within, :active) {
  border: 0;
  background: transparent;
  color: #fff;
  box-shadow: none;
  transform: none;
}
body #player-screen #player-surface .player-toolbar #player-favorite[aria-pressed='true'] {
  background: transparent;
  color: var(--accent-bright, #ff304c);
}
body #player-screen #player-surface .player-select-icon select {
  min-height: 44px;
  padding: 0;
  border: 0;
}
body #player-screen #player-surface .player-select-icon:focus-within {
  outline: 2px solid var(--accent-bright, #ff304c);
  outline-offset: 3px;
}
body #player-screen #saga-queue-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  line-height: 1;
}
body #player-screen #saga-queue-close:is(:hover:where(body[data-input-modality="mouse"] *), :focus-visible) {
  background: transparent;
  box-shadow: none;
}

/* Previews retain video fullscreen and sound; their icons get the same center. */
body .ntv .ntv-preview-bottom button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}
body .ntv .ntv-preview-bottom button:not(:disabled):is(:hover:where(body[data-input-modality="mouse"] *), :focus-visible, :active) {
  background: transparent;
  box-shadow: none;
  transform: none;
}
body .ntv .ntv-preview-bottom .ntv-icon {
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 1px 3px #000b);
}
body #content-presentation .cp-save {
  justify-content: center;
  padding: 0;
  background: transparent;
  background-image: none;
  box-shadow: none;
}
body #content-presentation .cp-save:is(:hover:where(body[data-input-modality="mouse"] *), :focus-visible) {
  background: transparent;
  box-shadow: none;
}
body #content-presentation .cp-save .cp-save-icon,
body #content-presentation .cp-save:is(:hover:where(body[data-input-modality="mouse"] *), :focus-visible) .cp-save-icon {
  border: 0;
  background: transparent;
  box-shadow: none;
}

/* Version choices are readable rows. Their text is centered vertically and
   aligned left, with one quiet selected state rather than a glossy gradient. */
body #channel-quality-dialog .quality-options button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 52px;
  padding: 13px 16px;
  border: 1px solid var(--line, #ffffff19);
  border-radius: 10px;
  background: var(--surface-elevated, #191a1d);
  color: var(--text-muted, #a9abb1);
  box-shadow: none;
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
  overflow-wrap: anywhere;
  transform: none;
}
@media (any-hover: hover) and (any-pointer: fine) {
  body #channel-quality-dialog .quality-options button:not(:disabled):hover:where(body[data-input-modality="mouse"] *) {
    border-color: color-mix(in srgb, var(--text-muted) 48%, transparent);
    background: color-mix(in srgb, var(--surface-elevated) 94%, var(--text) 6%);
    color: var(--text);
    box-shadow: none;
  }
}
body #channel-quality-dialog .quality-options button[aria-pressed='true'] {
  border-color: var(--accent, #e31332);
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  color: var(--text);
  box-shadow: none;
}

/* Move the glyph, never its invisible hit target or the row around it. */
body :is(
  #theme-toggle, #sidebar-toggle, .mobile-search-toggle, #change-account,
  .ui-dialog-close, .sc-close, .ss-choice-close, .ss-service-search-clear, .mobile-search-close,
  .favorite-toggle, .sg-save, .ntv-favorite, .dx-brand-favorite,
  .sg-actor-choices > header > .sg-quiet
)::before,
body :is(
  .catalog-favorite-toggle, .hs-favorite-toggle, .dx-favorite-toggle, .dx-brand-favorite, .movie-seen-toggle,
  .episode-seen-toggle, .ss-save, .ss-card-watched, .ss-hero-watched,
  .sj-seen-toggle, .sj-icon-action, .sj-compact-play, .hs-arrow, .cp-arrow,
  .sh-icon-button, .sh-agenda-control, .ntv-preview-bottom button
) > :is(svg, .catalog-favorite-icon, .episode-seen-icon, .ss-save-icon, .sj-seen-icon, .sj-action-icon, .sg-play-icon, .hs-arrow-icon, .cp-arrow-icon, .sh-icon, .ntv-icon),
body #content-presentation .cp-save-icon::after,
body #player-screen #saga-queue-close::before {
  transition: scale 160ms ease, translate 160ms ease;
}
@media (any-hover: hover) and (any-pointer: fine) {
  body :is(
    #theme-toggle, #sidebar-toggle, .mobile-search-toggle, #change-account,
    .ui-dialog-close, .sc-close, .ss-choice-close, .ss-service-search-clear, .mobile-search-close,
    .favorite-toggle, .sg-save, .ntv-favorite, .dx-brand-favorite,
    .sg-actor-choices > header > .sg-quiet
  ):not(:disabled):hover:where(body[data-input-modality="mouse"] *)::before,
  body :is(
    .catalog-favorite-toggle, .hs-favorite-toggle, .dx-favorite-toggle, .dx-brand-favorite, .movie-seen-toggle,
    .episode-seen-toggle, .ss-save, .ss-card-watched, .ss-hero-watched,
    .sj-seen-toggle, .sj-icon-action, .sj-compact-play, .hs-arrow, .cp-arrow,
    .sh-icon-button, .sh-agenda-control, .ntv-preview-bottom button
  ):not(:disabled):hover:where(body[data-input-modality="mouse"] *) > :is(svg, .catalog-favorite-icon, .episode-seen-icon, .ss-save-icon, .sj-seen-icon, .sj-action-icon, .sg-play-icon, .hs-arrow-icon, .cp-arrow-icon, .sh-icon, .ntv-icon),
  body #player-screen #player-surface .player-toolbar :is(button.player-icon-button, .player-select-icon):not(:disabled):hover:where(body[data-input-modality="mouse"] *)::before,
  body #content-presentation .cp-save:not(:disabled):hover:where(body[data-input-modality="mouse"] *) .cp-save-icon::after,
  body #player-screen #saga-queue-close:not(:disabled):hover:where(body[data-input-modality="mouse"] *)::before {
    scale: 1.1;
    translate: 0 -1px;
  }
}

/* Do not turn a labelled drawer item into a centered icon-only button. */
@media (max-width: 720px), (max-width: 900px) and (max-height: 500px) and (pointer: coarse) {
  body .topbar :is(#mobile-menu, .mobile-search-toggle, #change-account) {
    display: grid;
    place-items: center;
    width: 44px;
    min-width: 44px;
    height: 48px;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  body #app-sidebar .mobile-menu-settings #theme-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: auto;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 12px;
    line-height: 1.4;
  }
}

@media (prefers-reduced-motion: reduce) {
  body :is(button, .player-select-icon)::before,
  body :is(button, .player-select-icon)::after,
  body button > :is(svg, .catalog-favorite-icon, .episode-seen-icon, .ss-save-icon, .sj-seen-icon, .sj-action-icon, .sg-play-icon, .hs-arrow-icon, .cp-arrow-icon, .sh-icon, .ntv-icon),
  body #content-presentation .cp-save-icon::after {
    transition: none;
    scale: none !important;
    translate: none !important;
  }
}
