/*
 * Breakpoints are ordered from TV to small phone.
 * 1600+ : six posters, TV-scale controls
 * 1200-1599 : five posters (1440 desktop target)
 * 900-1199 : four posters (1024 tablet target)
 * 640-899 : three posters
 * below 640 : two posters
 */

/* Desktop, including the 1440 design target -------------------------- */
@media screen and (max-width: 1599px) {
  :root {
    --container-max: 1440px;
    --page-gutter: 36px;
    --header-height: 82px;
    --control-height: 56px;
    --card-width-desktop: 232px;
    --font-size-hero: 58px;
  }

  html,
  body {
    font-size: 18px;
  }

  .site-header,
  .header-inner {
    min-height: 82px;
    min-height: var(--header-height, 82px);
  }

  .header-inner,
  .container,
  .page-container,
  .container-narrow {
    padding-right: 36px;
    padding-right: var(--page-gutter, 36px);
    padding-left: 36px;
    padding-left: var(--page-gutter, 36px);
  }

  .brand,
  .site-logo {
    margin-right: 22px;
    font-size: 21px;
  }

  .primary-nav a,
  .header-nav a,
  .nav-link {
    min-height: 48px;
    padding: 13px 10px 11px;
    font-size: 15px;
    line-height: 22px;
  }

  .header-actions {
    margin-left: 10px;
  }

  .header-actions .btn-label,
  .header-actions .action-label {
    display: none;
  }

  .btn,
  .button {
    min-height: 56px;
    min-height: var(--control-height, 56px);
    padding: 14px 22px;
    font-size: 17px;
    line-height: 26px;
  }

  .icon-btn {
    width: 56px;
    min-width: 56px;
    height: 56px;
    min-height: 56px;
    line-height: 54px;
  }

  .poster-grid > .media-card,
  .poster-grid > .card {
    width: 20%;
    font-size: 18px;
  }

  .row-track > .media-card,
  .row-track > .card {
    width: 232px;
    min-width: 232px;
    -webkit-flex-basis: 232px;
    flex-basis: 232px;
  }

  .hero,
  .hero > .container,
  .hero-inner {
    min-height: 590px;
  }

  .hero-title,
  .hero-content > h1 {
    font-size: 58px;
    font-size: var(--font-size-hero, 58px);
  }

  .hero-description {
    font-size: 19px;
  }

  .detail-hero,
  .detail-hero > .container,
  .detail-content {
    min-height: 630px;
  }

  .detail-content {
    padding-top: 72px;
    padding-bottom: 76px;
  }

  .detail-poster {
    width: 290px;
    min-width: 290px;
    margin-right: 38px;
    -webkit-flex-basis: 290px;
    flex-basis: 290px;
  }

  .detail-title,
  .detail-info > h1 {
    font-size: 50px;
  }

  .keyboard-panel,
  #onscreenKeyboard {
    display: block;
  }

  .stats-grid > .stat-card {
    width: 25%;
  }

  .player-topbar {
    padding-right: 30px;
    padding-left: 30px;
  }

  .player-controls {
    padding-right: 30px;
    padding-left: 30px;
  }
}

/* Tablet landscape and compact laptops ------------------------------- */
@media screen and (max-width: 1199px) {
  :root {
    --page-gutter: 28px;
  }

  .header-inner,
  .container,
  .page-container,
  .container-narrow {
    padding-right: 28px;
    padding-right: var(--page-gutter, 28px);
    padding-left: 28px;
    padding-left: var(--page-gutter, 28px);
  }

  .primary-nav,
  .header-nav {
    display: none;
  }

  .header-inner {
    position: relative;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    justify-content: space-between;
  }

  .mobile-menu-toggle {
    display: inline-block;
  }

  #primaryNav.primary-nav.is-open,
  .primary-nav.is-open,
  .header-nav.is-open {
    display: block;
    position: absolute;
    top: 82px;
    right: 28px;
    left: 28px;
    z-index: 60;
    width: auto;
    max-height: 70vh;
    margin: 0;
    padding: 14px;
    overflow-y: auto;
    border: 1px solid #414855;
    border-radius: 14px;
    background: #181b21;
    background: var(--color-surface, #181b21);
    -webkit-box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
  }

  #primaryNav.primary-nav.is-open > a,
  .primary-nav.is-open > a,
  .header-nav.is-open > a,
  #primaryNav.primary-nav.is-open > ul > li > a,
  .primary-nav.is-open > ul > li > a,
  .header-nav.is-open > ul > li > a {
    display: block;
    width: 100%;
    min-height: 60px;
    margin: 2px 0;
    padding: 17px 18px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: #c5cad2;
    color: var(--color-text-soft, #c5cad2);
    font-size: 18px;
    line-height: 24px;
    text-align: left;
  }

  #primaryNav.primary-nav.is-open > ul,
  .primary-nav.is-open > ul,
  .header-nav.is-open > ul {
    display: block;
    margin: 0;
    padding: 0;
  }

  #primaryNav.primary-nav.is-open > ul > li,
  .primary-nav.is-open > ul > li,
  .header-nav.is-open > ul > li {
    display: block;
    margin: 0;
  }

  #primaryNav.primary-nav.is-open a:hover,
  #primaryNav.primary-nav.is-open a:focus,
  #primaryNav.primary-nav.is-open a[aria-current="page"],
  .primary-nav.is-open a:hover,
  .primary-nav.is-open a:focus,
  .primary-nav.is-open a[aria-current="page"],
  .header-nav.is-open a:hover,
  .header-nav.is-open a:focus,
  .header-nav.is-open a[aria-current="page"] {
    border-color: #7189d8;
    border-color: var(--color-accent, #7189d8);
    background: rgba(113, 137, 216, 0.18);
    background: var(--color-accent-soft, rgba(113, 137, 216, 0.18));
    color: #f1f3f6;
    color: var(--color-text, #f1f3f6);
  }

  .header-actions .header-optional,
  .header-actions .secondary-action,
  .header-actions .disk-action {
    display: none;
  }

  .poster-grid > .media-card,
  .poster-grid > .card {
    width: 25%;
  }

  .catalog-search {
    width: 100%;
  }

  .page-toolbar,
  .toolbar,
  .filter-bar {
    -webkit-box-align: stretch;
    -webkit-align-items: stretch;
    align-items: stretch;
  }

  .filter-group {
    min-width: 170px;
    -webkit-box-flex: 1;
    -webkit-flex: 1 1 28%;
    flex: 1 1 28%;
  }

  .hero-content {
    max-width: 74%;
  }

  .detail-poster {
    width: 250px;
    min-width: 250px;
    margin-right: 30px;
    -webkit-flex-basis: 250px;
    flex-basis: 250px;
  }

  .detail-title,
  .detail-info > h1 {
    font-size: 44px;
  }

  .detail-description,
  .synopsis {
    font-size: 18px;
  }

  .technical-grid > *,
  .info-grid > * {
    width: 33.333%;
  }

  .episode-item,
  .media-list-item {
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
  }

  .episode-info,
  .list-info {
    padding-right: 0;
  }

  .episode-actions,
  .list-actions {
    width: 100%;
    margin-top: 14px;
    padding-left: 330px;
    text-align: left;
  }

  .settings-nav {
    width: 240px;
    margin-right: 24px;
    -webkit-flex-basis: 240px;
    flex-basis: 240px;
  }

  .setting-info {
    max-width: 56%;
  }

  .setting-control {
    width: 320px;
    max-width: 44%;
  }

  .player-volume {
    width: auto;
  }

  .player-volume input[type="range"] {
    display: none;
  }

  .player-keyboard-help {
    display: none;
  }
}

/* Tablet portrait: three poster columns ------------------------------ */
@media screen and (max-width: 899px) {
  :root {
    --page-gutter: 22px;
  }

  .header-inner,
  .container,
  .page-container,
  .container-narrow {
    padding-right: 22px;
    padding-right: var(--page-gutter, 22px);
    padding-left: 22px;
    padding-left: var(--page-gutter, 22px);
  }

  h1 {
    font-size: 40px;
  }

  h2 {
    font-size: 31px;
  }

  .site-main {
    padding-top: 32px;
  }

  .poster-grid > .media-card,
  .poster-grid > .card {
    width: 33.333%;
  }

  .hero,
  .hero > .container,
  .hero-inner {
    min-height: 560px;
  }

  .hero-content {
    width: 100%;
    max-width: 88%;
  }

  .hero-title,
  .hero-content > h1 {
    font-size: 49px;
  }

  .hero-description {
    max-width: 680px;
  }

  .detail-content {
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
  }

  .detail-poster {
    width: 210px;
    min-width: 210px;
    margin-right: 26px;
    -webkit-flex-basis: 210px;
    flex-basis: 210px;
  }

  .detail-title,
  .detail-info > h1 {
    font-size: 39px;
  }

  .detail-description,
  .synopsis {
    overflow: hidden;
    max-height: 6.5em;
  }

  .episode-thumb,
  .list-thumb {
    width: 210px;
    min-width: 210px;
    height: 118px;
    -webkit-flex-basis: 210px;
    flex-basis: 210px;
  }

  .episode-number {
    width: 48px;
    margin-right: 8px;
    font-size: 23px;
    -webkit-flex-basis: 48px;
    flex-basis: 48px;
  }

  .episode-actions,
  .list-actions {
    padding-left: 266px;
  }

  .stats-grid > .stat-card {
    width: 33.333%;
  }

  .form-grid > .field,
  .form-grid > .form-field {
    width: 100%;
  }

  .pipeline-step {
    width: 33.333%;
  }

  .pipeline-step:after {
    display: none;
  }

  .queue-progress {
    width: 240px;
  }

  .settings-layout {
    display: block;
  }

  .settings-nav {
    position: relative;
    top: auto;
    width: 100%;
    margin: 0 0 20px;
    padding: 8px;
    overflow-x: auto;
    white-space: nowrap;
  }

  .settings-nav li {
    display: inline-block;
  }

  .settings-nav a,
  .settings-nav button {
    display: inline-block;
    width: auto;
    min-width: 142px;
    margin-right: 4px;
    text-align: center;
  }

  .player-time {
    min-width: 142px;
    margin-right: 8px;
    font-size: 15px;
  }

  .player-control {
    width: 54px;
    min-width: 54px;
    height: 54px;
    min-height: 54px;
    line-height: 52px;
  }

  .player-actions .player-optional {
    display: none;
  }
}

/* Phones and small tablets: two poster columns ----------------------- */
@media screen and (max-width: 639px) {
  :root {
    --page-gutter: 16px;
    --header-height: 70px;
    --control-height: 52px;
    --mobile-nav-height: 68px;
  }

  html,
  body {
    font-size: 16px;
  }

  body:not(.player-body):not(.player-page) {
    padding-bottom: 68px;
    padding-bottom: var(--mobile-nav-height, 68px);
  }

  h1 {
    font-size: 34px;
  }

  h2 {
    font-size: 28px;
  }

  h3 {
    font-size: 23px;
  }

  .site-header,
  .header-inner {
    min-height: 70px;
    min-height: var(--header-height, 70px);
  }

  .header-inner,
  .container,
  .page-container,
  .container-narrow {
    padding-right: 16px;
    padding-right: var(--page-gutter, 16px);
    padding-left: 16px;
    padding-left: var(--page-gutter, 16px);
  }

  .brand,
  .site-logo {
    margin-right: 10px;
    font-size: 18px;
    letter-spacing: 0.08em;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    margin-right: 7px;
    font-size: 10px;
    line-height: 32px;
  }

  .header-actions > * {
    display: none;
  }

  .header-actions > .mobile-menu-toggle,
  .header-actions > .profile-button,
  .header-actions > .always-visible {
    display: inline-block;
  }

  #primaryNav.primary-nav.is-open,
  .primary-nav.is-open,
  .header-nav.is-open {
    top: 70px;
    right: 16px;
    left: 16px;
  }

  .mobile-menu-toggle,
  .profile-button,
  .header-actions .icon-btn {
    width: 48px;
    min-width: 48px;
    height: 48px;
    min-height: 48px;
    line-height: 46px;
  }

  .mobile-nav {
    display: block;
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    z-index: 50;
    height: 68px;
    height: var(--mobile-nav-height, 68px);
    border-top: 1px solid #333945;
    border-top: 1px solid var(--color-border, #333945);
    background: #181b21;
    background: rgba(24, 27, 33, 0.98);
  }

  .mobile-nav ul {
    display: table;
    width: 100%;
    height: 100%;
    table-layout: fixed;
  }

  .mobile-nav > a,
  .mobile-nav > button {
    display: inline-block;
    width: 20%;
    height: 100%;
    vertical-align: middle;
  }

  .mobile-nav li {
    display: table-cell;
    height: 100%;
    vertical-align: middle;
  }

  .mobile-nav a,
  .mobile-nav button {
    display: block;
    width: 100%;
    min-height: 62px;
    padding: 8px 3px 6px;
    border: 0;
    background: transparent;
    color: #929aa7;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
  }

  .mobile-nav.mobile-nav > a,
  .mobile-nav.mobile-nav > button {
    display: inline-block;
    width: 20%;
    height: 100%;
    vertical-align: middle;
  }

  .mobile-nav .nav-icon {
    display: block;
    height: 27px;
    margin: 0 auto 3px;
    color: inherit;
    font-size: 24px;
    line-height: 27px;
  }

  .mobile-nav > a > span:first-child {
    display: block;
    height: 27px;
    margin: 0 auto 3px;
    color: inherit;
    font-size: 24px;
    line-height: 27px;
  }

  .mobile-nav a.active,
  .mobile-nav a[aria-current="page"],
  .mobile-nav button.active {
    color: #aab9f3;
    color: var(--color-focus, #aab9f3);
  }

  .site-main {
    padding-top: 26px;
    padding-bottom: 44px;
  }

  .page-heading {
    display: block;
    margin-bottom: 24px;
  }

  .page-heading > *:last-child {
    margin-top: 14px;
  }

  .page-heading h1 {
    margin-bottom: 6px;
  }

  .content-section,
  .content-row {
    margin-bottom: 42px;
  }

  .section-heading {
    min-height: 42px;
    margin-bottom: 14px;
  }

  .section-heading h2,
  .section-heading h3 {
    font-size: 23px;
  }

  .section-heading-actions .btn {
    min-height: 42px;
    padding: 8px 11px;
    font-size: 14px;
    line-height: 24px;
  }

  .row-navigation,
  .row-arrow {
    display: none;
  }

  .row-track > .media-card,
  .row-track > .card {
    width: 43vw;
    min-width: 168px;
    max-width: 210px;
    margin-right: 12px;
    -webkit-flex-basis: 43vw;
    flex-basis: 43vw;
  }

  .poster-grid {
    margin-right: -6px;
    margin-left: -6px;
  }

  .poster-grid > .media-card,
  .poster-grid > .card {
    width: 50%;
    margin-bottom: 22px;
    padding-right: 6px;
    padding-left: 6px;
    font-size: 16px;
  }

  .card-body {
    min-height: 82px;
    padding: 12px 10px 13px;
  }

  .card-overlay {
    bottom: 82px;
  }

  .card-title {
    font-size: 16px;
  }

  .card-meta,
  .card-subtitle {
    font-size: 13px;
  }

  .badge,
  .quality-badge,
  .status-pill {
    min-height: 26px;
    padding: 4px 7px;
    font-size: 11px;
    line-height: 16px;
  }

  .favorite-button,
  .card-favorite {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    line-height: 40px;
  }

  .btn,
  .button {
    min-height: 52px;
    min-height: var(--control-height, 52px);
    padding: 12px 17px;
    font-size: 16px;
    line-height: 26px;
  }

  .btn-large,
  .btn-lg {
    min-height: 56px;
    padding: 14px 20px;
    font-size: 17px;
  }

  .input,
  .select,
  .textarea,
  .form-control,
  input[type="text"],
  input[type="search"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="url"],
  input[type="file"],
  select,
  textarea {
    min-height: 52px;
    min-height: var(--control-height, 52px);
    padding: 12px 14px;
    font-size: 16px;
  }

  .page-toolbar,
  .toolbar,
  .filter-bar {
    display: block;
    margin-bottom: 24px;
  }

  .page-toolbar > *,
  .toolbar > *,
  .filter-bar > *,
  .filter-group,
  .catalog-search {
    display: block;
    width: 100%;
    margin-right: 0;
  }

  .segmented-control,
  .tabs,
  .season-tabs {
    display: inline-block;
    max-width: 100%;
    overflow-x: auto;
  }

  .hero,
  .hero > .container,
  .hero-inner {
    min-height: 560px;
  }

  .hero-overlay,
  .detail-overlay {
    background: rgba(7, 9, 12, 0.74);
    background: linear-gradient(to bottom, rgba(7, 9, 12, 0.25) 0%, rgba(7, 9, 12, 0.76) 42%, rgba(7, 9, 12, 0.98) 100%);
  }

  .hero > .container,
  .hero-inner {
    padding-top: 170px;
    padding-bottom: 54px;
  }

  .hero-content {
    width: 100%;
    max-width: 100%;
  }

  .hero-kicker,
  .eyebrow {
    margin-bottom: 10px;
    font-size: 13px;
  }

  .hero-title,
  .hero-content > h1 {
    margin-bottom: 12px;
    font-size: 40px;
  }

  .hero-meta {
    margin-bottom: 12px;
    font-size: 14px;
  }

  .hero-description {
    display: -webkit-box;
    overflow: hidden;
    max-height: 4.6em;
    margin-bottom: 22px;
    font-size: 16px;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .hero-actions,
  .detail-actions,
  .upload-actions {
    display: block;
    margin-right: 0;
  }

  .hero-actions > *,
  .detail-actions > *,
  .upload-actions > * {
    display: block;
    width: 100%;
    margin-right: 0;
    margin-bottom: 10px;
  }

  .hero-actions > .hero-tertiary,
  .hero-actions > .favorite-action {
    display: inline-block;
    width: auto;
  }

  .home-sections {
    padding-top: 36px;
  }

  .content-rows,
  .detail-lower {
    padding-top: 36px;
  }

  .detail-hero,
  .detail-hero > .container,
  .detail-content {
    min-height: 0;
  }

  .detail-hero {
    padding-top: 180px;
  }

  .detail-hero > .container {
    padding-bottom: 48px;
  }

  .detail-content {
    display: block;
    padding-top: 50px;
    padding-bottom: 48px;
  }

  .detail-poster {
    width: 168px;
    min-width: 168px;
    margin: 0 0 22px;
  }

  .detail-title,
  .detail-info > h1 {
    font-size: 36px;
  }

  .original-title {
    font-size: 17px;
  }

  .detail-description,
  .synopsis {
    max-height: none;
    font-size: 16px;
  }

  .detail-body {
    padding-top: 36px;
  }

  .technical-grid,
  .info-grid {
    margin-right: -6px;
    margin-left: -6px;
  }

  .technical-grid > *,
  .info-grid > * {
    width: 50%;
    padding-right: 6px;
    padding-left: 6px;
  }

  .technical-item,
  .info-item {
    min-height: 96px;
    margin-bottom: 12px;
    padding: 15px;
  }

  .episode-item,
  .media-list-item {
    display: block;
    padding: 13px;
  }

  .episode-number {
    display: inline-block;
    width: auto;
    margin: 0 0 9px;
    font-size: 16px;
    text-align: left;
  }

  .episode-thumb,
  .list-thumb {
    width: 100%;
    min-width: 0;
    height: 0;
    margin: 0 0 15px;
    padding-top: 56.25%;
  }

  .episode-thumb img,
  .list-thumb img {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
  }

  .episode-info,
  .list-info {
    padding: 0;
  }

  .episode-title,
  .list-title,
  .episode-info > h3,
  .episode-info > h4,
  .list-info > h3,
  .list-info > h4 {
    font-size: 20px;
    white-space: normal;
  }

  .episode-actions,
  .list-actions {
    width: 100%;
    min-width: 0;
    margin-top: 14px;
    padding-left: 0;
    text-align: left;
  }

  .episode-actions > *,
  .list-actions > * {
    margin: 4px 4px 4px 0;
  }

  .history-time {
    min-width: 0;
    margin-bottom: 8px;
  }

  .search-panel .search-input-wrap input,
  .search-panel .search-input {
    min-height: 60px;
    padding-left: 50px;
    font-size: 19px;
  }

  .search-panel .search-input-icon {
    left: 16px;
    font-size: 23px;
  }

  .keyboard-panel {
    display: none;
  }

  .tv-mode .keyboard-panel,
  .show-keyboard .keyboard-panel,
  .keyboard-panel.is-open {
    display: block;
    padding: 10px;
  }

  .keyboard-key {
    width: 19%;
    min-height: 54px;
    font-size: 17px;
  }

  .keyboard-key.key-wide { width: 39%; }
  .keyboard-key.key-space { width: 59%; }

  .stats-grid {
    margin-right: -6px;
    margin-left: -6px;
  }

  .stats-grid > .stat-card {
    width: 50%;
    min-height: 126px;
    padding: 15px;
  }

  .stat-value {
    font-size: 27px;
  }

  .upload-form,
  .upload-queue,
  .pipeline-panel,
  .settings-section {
    padding: 20px 16px;
  }

  .form-grid {
    margin-right: 0;
    margin-left: 0;
  }

  .form-grid > .field,
  .form-grid > .form-field {
    padding-right: 0;
    padding-left: 0;
  }

  .pipeline-step {
    width: 50%;
  }

  .upload-queue-item {
    display: block;
  }

  .queue-file,
  .queue-progress {
    width: 100%;
    max-width: none;
    margin: 0 0 14px;
  }

  .settings-section > h2 {
    font-size: 24px;
  }

  .setting-row {
    display: block;
  }

  .setting-info,
  .setting-control,
  .setting-row > .input,
  .setting-row > .select,
  .setting-row > input,
  .setting-row > select,
  .setting-meter {
    width: 100%;
    max-width: none;
    padding-right: 0;
    -webkit-flex-basis: auto;
    flex-basis: auto;
  }

  .setting-control {
    margin-top: 14px;
    text-align: left;
  }

  .color-swatch {
    margin-right: 8px;
    margin-left: 0;
  }

  .toast-stack {
    right: 12px;
    bottom: 82px;
    left: 12px;
    width: auto;
    max-width: none;
  }

  .modal-backdrop {
    padding: 16px;
  }

  .modal {
    margin: 2vh auto;
    padding: 20px 16px;
  }

  .player-topbar {
    min-height: 90px;
    padding: 16px 14px 24px;
  }

  .player-exit {
    margin-right: 10px;
  }

  .player-title,
  .player-heading h2 {
    font-size: 18px;
  }

  .player-subtitle,
  .player-heading p {
    font-size: 13px;
  }

  .player-controls {
    padding: 58px 12px 14px;
  }

  .player-bottom-panel {
    padding: 58px 12px 14px;
  }

  .player-control-row {
    min-height: 50px;
  }

  .player-control {
    width: 48px;
    min-width: 48px;
    height: 48px;
    min-height: 48px;
    margin-right: 3px;
    font-size: 21px;
    line-height: 46px;
  }

  .player-controls .icon-btn {
    width: 48px;
    min-width: 48px;
    height: 48px;
    min-height: 48px;
    margin-right: 3px;
    font-size: 20px;
    line-height: 46px;
  }

  .player-play-toggle {
    width: 52px;
    min-width: 52px;
    height: 52px;
    min-height: 52px;
    line-height: 50px;
  }

  .player-controls .player-main-control {
    width: 52px;
    min-width: 52px;
    height: 52px;
    min-height: 52px;
    line-height: 50px;
  }

  .player-main-controls .seek-control,
  .player-main-controls .player-skip,
  .player-volume,
  .volume-range,
  #rewindButton,
  #forwardButton,
  #audioButton,
  .player-actions .player-audio,
  .player-actions .player-optional {
    display: none;
  }

  .player-time {
    min-width: 120px;
    margin: 0 4px;
    font-size: 13px;
  }

  .player-actions {
    margin-left: auto;
  }

  .player-shortcuts {
    display: none;
  }

  .player-empty-state {
    padding: 24px 16px;
  }

  .player-empty-state h1 {
    font-size: 26px;
  }

  .player-menu {
    right: 12px;
    bottom: 82px;
    left: 12px;
    width: auto;
  }

  .player-placeholder {
    max-width: 88%;
  }
}

/* Narrow phones ------------------------------------------------------- */
@media screen and (max-width: 419px) {
  .poster-grid > .media-card,
  .poster-grid > .card {
    padding-right: 5px;
    padding-left: 5px;
  }

  .card-body {
    padding-right: 8px;
    padding-left: 8px;
  }

  .hero-title,
  .hero-content > h1 {
    font-size: 35px;
  }

  .hero-meta > *,
  .detail-meta > * {
    margin-right: 7px;
  }

  .hero-meta > *:after,
  .detail-meta > *:after {
    margin-left: 7px;
  }

  .technical-grid > *,
  .info-grid > * {
    width: 100%;
  }

  .stat-label {
    min-height: 40px;
    font-size: 13px;
  }

  .segmented-control > *,
  .tabs > *,
  .season-tabs > * {
    padding-right: 14px;
    padding-left: 14px;
  }

  .player-time {
    min-width: 98px;
    font-size: 11px;
  }

  .player-actions .player-subtitles {
    display: none;
  }
}

/* Tablets and phones use their native keyboard. This final breakpoint
 * guard intentionally wins over explicit TV/show-keyboard state classes. */
@media screen and (max-width: 1199px) {
  #onscreenKeyboard,
  .keyboard-panel.keyboard-panel,
  .tv-mode .keyboard-panel,
  .show-keyboard .keyboard-panel,
  .keyboard-panel.is-open {
    display: none;
  }
}

/* Short landscape screens keep player controls within the viewport. */
@media screen and (max-height: 560px) and (orientation: landscape) {
  .player-topbar {
    min-height: 72px;
    padding-top: 10px;
  }

  .player-controls {
    padding-top: 34px;
    padding-bottom: 8px;
  }

  .player-timeline-wrap {
    margin-bottom: 7px;
  }

  .player-control {
    width: 46px;
    min-width: 46px;
    height: 46px;
    min-height: 46px;
    line-height: 44px;
  }
}

/* Motion can be disabled from either OS preferences or app settings. */
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    scroll-behavior: auto !important;
    -webkit-animation-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    -webkit-animation-iteration-count: 1 !important;
    animation-iteration-count: 1 !important;
    -webkit-transition-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .media-card:hover .card-link,
  .media-card:focus .card-link,
  .media-card.is-focused .card-link,
  .card-link:hover,
  .card-link:focus,
  .keyboard-key:hover,
  .keyboard-key:focus {
    -webkit-transform: none;
    transform: none;
  }
}

.reduce-motion *,
.reduce-motion *:before,
.reduce-motion *:after,
.no-motion *,
.no-motion *:before,
.no-motion *:after {
  scroll-behavior: auto !important;
  -webkit-animation: none !important;
  animation: none !important;
  -webkit-transition: none !important;
  transition: none !important;
}

.reduce-motion .media-card:hover .card-link,
.reduce-motion .media-card:focus .card-link,
.reduce-motion .media-card.is-focused .card-link,
.reduce-motion .card-link:hover,
.reduce-motion .card-link:focus,
.no-motion .media-card:hover .card-link,
.no-motion .media-card:focus .card-link,
.no-motion .card-link:hover,
.no-motion .card-link:focus {
  -webkit-transform: none;
  transform: none;
}

/* Coarse pointers receive forgiving touch targets without hover reliance. */
@media (pointer: coarse) {
  .btn-small,
  .btn-sm,
  .chip,
  .segmented-control > *,
  .tabs > *,
  .season-tabs > * {
    min-height: 48px;
  }

  .row-viewport {
    overflow-x: auto;
  }
}

/* Basic high-contrast fallback. */
@media (forced-colors: active) {
  .card-link,
  .media-card-inner,
  .btn,
  .button,
  .input,
  .select,
  .textarea,
  .keyboard-key {
    border: 2px solid ButtonText;
  }

  .progress-bar > span,
  .card-progress > span,
  .disk-meter > span {
    background: Highlight;
  }
}

/* User-selected catalogue density. Keep TV/desktop breakpoints predictable;
   smaller layouts retain the requested 4/3/2-column responsive rules. */
@media screen and (min-width: 1200px) {
  .poster-size-medium .poster-grid > .media-card,
  .poster-size-medium .poster-grid > .card {
    width: 14.285%;
  }

  .poster-size-compact .poster-grid > .media-card,
  .poster-size-compact .poster-grid > .card {
    width: 12.5%;
  }

  .poster-size-medium .row-track > .media-card,
  .poster-size-medium .row-track > .card {
    width: 240px;
    min-width: 240px;
    -webkit-flex-basis: 240px;
    flex-basis: 240px;
  }

  .poster-size-compact .row-track > .media-card,
  .poster-size-compact .row-track > .card {
    width: 210px;
    min-width: 210px;
    -webkit-flex-basis: 210px;
    flex-basis: 210px;
  }
}

/* Polished custom player breakpoints. These selectors intentionally match
   the custom-ready gate so native fallback controls remain untouched. */
@media screen and (max-width: 1199px) {
  .player-stage.custom-ready .player-topbar {
    min-height: 108px;
    padding: 24px 30px 38px;
    padding-top: calc(24px + env(safe-area-inset-top));
    padding-right: calc(30px + env(safe-area-inset-right));
    padding-left: calc(30px + env(safe-area-inset-left));
  }

  .player-stage.custom-ready .player-bottom-panel {
    padding: 54px 30px 22px;
    padding-right: calc(30px + env(safe-area-inset-right));
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
    padding-left: calc(30px + env(safe-area-inset-left));
  }

  .player-stage.custom-ready .player-controls .icon-btn {
    width: 54px;
    min-width: 54px;
    height: 54px;
    min-height: 54px;
  }

  .player-stage.custom-ready .player-controls .player-main-control {
    width: 60px;
    min-width: 60px;
    height: 60px;
    min-height: 60px;
  }

  .player-stage.custom-ready .player-time {
    min-width: 150px;
    height: 54px;
    margin-right: 12px;
    font-size: 15px;
  }

  .player-stage.custom-ready input[type="range"].volume-range {
    width: 104px;
    margin-right: 12px;
    -webkit-flex-basis: 104px;
    flex-basis: 104px;
  }
}

@media screen and (max-width: 899px) {
  .player-stage.custom-ready .player-topbar {
    min-height: 100px;
    padding: 20px 22px 34px;
    padding-top: calc(20px + env(safe-area-inset-top));
    padding-right: calc(22px + env(safe-area-inset-right));
    padding-left: calc(22px + env(safe-area-inset-left));
  }

  .player-stage.custom-ready .player-bottom-panel {
    padding: 48px 22px 18px;
    padding-right: calc(22px + env(safe-area-inset-right));
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
    padding-left: calc(22px + env(safe-area-inset-left));
  }

  .player-stage.custom-ready input[type="range"].volume-range {
    display: none;
  }

  .player-stage.custom-ready .player-time {
    min-width: 142px;
    margin-right: 8px;
    font-size: 14px;
  }
}

@media screen and (max-width: 639px) {
  .player-stage.custom-ready .player-topbar {
    min-height: 86px;
    padding: 14px 16px 24px;
    padding-top: calc(14px + env(safe-area-inset-top));
    padding-right: calc(16px + env(safe-area-inset-right));
    padding-left: calc(16px + env(safe-area-inset-left));
  }

  .player-stage.custom-ready .player-exit {
    width: 48px;
    min-width: 48px;
    height: 48px;
    min-height: 48px;
    margin-right: 10px;
    padding: 0;
  }

  .player-stage.custom-ready .player-exit-icon {
    margin: 0;
  }

  .player-stage.custom-ready .player-exit-text,
  .player-stage.custom-ready .player-heading .player-brand,
  .player-stage.custom-ready #playerMeta {
    display: none;
  }

  .player-stage.custom-ready .player-heading {
    margin-right: 8px;
  }

  .player-stage.custom-ready .player-heading h2 {
    margin: 0;
    font-size: 19px;
  }

  .player-stage.custom-ready .player-topbar > .status-pill {
    max-width: 92px;
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .player-stage.custom-ready .player-bottom-panel {
    max-height: 40vh;
    padding: 42px 12px 12px;
    padding-right: calc(12px + env(safe-area-inset-right));
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    padding-left: calc(12px + env(safe-area-inset-left));
  }

  .player-stage.custom-ready .player-control-row {
    min-height: 52px;
  }

  .player-stage.custom-ready .player-controls .icon-btn {
    width: 48px;
    min-width: 48px;
    height: 48px;
    min-height: 48px;
    margin-right: 6px;
    border-radius: 10px;
  }

  .player-stage.custom-ready .player-controls .player-main-control {
    width: 52px;
    min-width: 52px;
    height: 52px;
    min-height: 52px;
  }

  .player-stage.custom-ready .player-quality-select {
    width: 92px;
    min-width: 92px;
    height: 48px;
    min-height: 48px;
    padding-right: 24px;
    font-size: 12px;
    -webkit-flex-basis: 92px;
    flex-basis: 92px;
  }

  .player-stage.custom-ready #rewindButton,
  .player-stage.custom-ready #forwardButton,
  .player-stage.custom-ready #audioButton,
  .player-stage.custom-ready input[type="range"].volume-range {
    display: none;
  }

  .player-stage.custom-ready .player-time {
    min-width: 112px;
    height: 48px;
    margin: 0;
    font-size: 12px;
  }

  .player-stage.custom-ready input[type="range"].player-timeline {
    margin-bottom: 12px;
  }

  .player-stage.custom-ready .player-shortcuts {
    display: none;
  }

  .player-stage.custom-ready > .player-empty-state {
    width: calc(100% - 28px);
    max-width: none;
    max-height: calc(100% - 150px);
    padding: 22px 18px;
  }

  .player-stage.custom-ready .player-empty-state h1 {
    font-size: 25px;
  }

  .player-stage.custom-ready .player-empty-actions {
    display: block;
    margin: 18px 0 8px;
  }

  .player-stage.custom-ready .player-empty-actions > * {
    display: block;
    width: 100%;
    margin: 0 0 9px;
  }
}

@media screen and (max-width: 419px) {
  .player-stage.custom-ready .player-time {
    min-width: 100px;
    font-size: 11px;
  }

  .player-stage.custom-ready .player-topbar > .status-pill {
    max-width: 78px;
  }
}

@media screen and (max-width: 359px) {
  .player-stage.custom-ready #subtitleButton {
    display: none;
  }
}

@media screen and (max-height: 560px) and (orientation: landscape) {
  .player-stage.custom-ready .player-topbar {
    min-height: 70px;
    padding: 10px 20px 18px;
    padding-top: calc(10px + env(safe-area-inset-top));
    padding-right: calc(20px + env(safe-area-inset-right));
    padding-left: calc(20px + env(safe-area-inset-left));
  }

  .player-stage.custom-ready .player-heading .player-brand,
  .player-stage.custom-ready #playerMeta {
    display: none;
  }

  .player-stage.custom-ready .player-heading h2 {
    margin: 0;
    font-size: 18px;
  }

  .player-stage.custom-ready .player-bottom-panel {
    max-height: 46vh;
    padding: 28px 20px 8px;
    padding-right: calc(20px + env(safe-area-inset-right));
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    padding-left: calc(20px + env(safe-area-inset-left));
  }

  .player-stage.custom-ready .player-controls .icon-btn {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .player-stage.custom-ready .player-controls .player-main-control {
    width: 48px;
    min-width: 48px;
    height: 48px;
    min-height: 48px;
  }

  .player-stage.custom-ready .player-time {
    min-width: 120px;
    height: 44px;
    font-size: 12px;
  }

  .player-stage.custom-ready input[type="range"].player-timeline {
    margin-bottom: 8px;
  }

  .player-stage.custom-ready input[type="range"].volume-range,
  .player-stage.custom-ready #audioButton,
  .player-stage.custom-ready .player-shortcuts {
    display: none;
  }

  .player-stage.custom-ready > .player-empty-state {
    top: 52%;
    max-height: calc(100% - 140px);
    padding: 18px;
  }

  .player-stage.custom-ready .player-empty-art {
    display: none;
  }
}
