:root {
  color-scheme: dark light;
  --radius: 8px;
}

:root[data-theme="dark"] {
  --bg: #0d0f12;
  --panel: #16191e;
  --panel-strong: #22262d;
  --accent: #4aa8ff;
  --accent-strong: #69d17d;
  --text: #f3f5f7;
  --muted: #9ba3ad;
  --line: #2c3139;
  --field: #101318;
  --danger: #ff6b6b;
  --panel-transparent: rgba(18, 21, 25, 0.74);
  --chip-selected-bg: #f3f5f7;
  --chip-selected-text: #111419;
}

:root[data-theme="light"] {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-strong: #e8edf2;
  --accent: #0b62b4;
  --accent-strong: #2e7d32;
  --text: #17202a;
  --muted: #52606d;
  --line: #d5dde5;
  --field: #ffffff;
  --danger: #b3261e;
  --panel-transparent: rgba(255, 255, 255, 0.72);
  --chip-selected-bg: #17202a;
  --chip-selected-text: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0;
}

.layout {
  display: flex;
  height: 100vh;
}

.drawer-handle {
  display: none;
}

.sidebar-column {
  width: 320px;
  display: flex;
  flex-direction: column;
}

#app {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

.sidebar {
  flex: 1;
  min-height: 0;
  width: 100%;
  background: var(--panel);
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
}

.app-menu {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.app-menu h1 {
  margin: 0.1rem 0 0.35rem;
  font-size: 1.05rem;
  line-height: 1.2;
}

.app-brand-logo {
  display: block;
  height: 34px;
  margin: 0.1rem 0 0.35rem;
  object-fit: cover;
  object-position: center;
  width: 174px;
}

.menu-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.version-pill {
  display: inline-block;
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 700;
}

.menu-panel-title {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding-bottom: 0.55rem;
}

.menu-panel-title h1 {
  margin: 0.1rem 0 0.35rem;
  font-size: 1rem;
  line-height: 1.2;
}

.menu-panel-title .app-brand-logo {
  height: 32px;
  width: 164px;
}

.menu-close-button {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  height: 40px;
  position: relative;
  width: 40px;
}

.menu-close-button::before,
.menu-close-button::after {
  background: currentColor;
  content: "";
  height: 2px;
  left: 9px;
  position: absolute;
  top: 18px;
  width: 20px;
}

.menu-close-button::before {
  transform: rotate(45deg);
}

.menu-close-button::after {
  transform: rotate(-45deg);
}

.overflow-menu {
  flex: 0 0 auto;
  position: relative;
}

.overflow-menu summary {
  list-style: none;
}

.overflow-menu summary::-webkit-details-marker {
  display: none;
}

.overflow-menu-button {
  align-items: center;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font-size: 1rem;
  font-weight: 800;
  height: 40px;
  justify-content: center;
  letter-spacing: 0;
  line-height: 1;
  padding: 0;
  width: 40px;
}

.hamburger-icon,
.hamburger-icon::before,
.hamburger-icon::after {
  background: currentColor;
  border-radius: 999px;
  content: "";
  display: block;
  height: 2px;
  width: 18px;
}

.hamburger-icon {
  position: relative;
}

.hamburger-icon::before,
.hamburger-icon::after {
  left: 0;
  position: absolute;
}

.hamburger-icon::before {
  top: -6px;
}

.hamburger-icon::after {
  top: 6px;
}

.overflow-menu[open] .overflow-menu-button,
.overflow-menu-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.overflow-menu-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
  display: grid;
  gap: 0.65rem;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding: 0.75rem;
  position: absolute;
  left: 0;
  top: calc(100% + 0.5rem);
  width: min(320px, calc(100vw - 2rem));
  z-index: 8;
}

.theme-control {
  color: var(--muted);
  display: grid;
  gap: 0.25rem;
  font-size: 0.8rem;
  min-width: 96px;
}

.overflow-menu-panel .theme-control {
  min-width: 0;
}

.menu-download-link {
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--bg);
  display: block;
  font-size: 0.85rem;
  font-weight: 800;
  min-height: 36px;
  padding: 0.5rem 0.65rem;
  text-align: center;
  text-decoration: none;
}

.menu-download-link:hover,
.menu-download-link:focus-visible {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.menu-update-control {
  display: grid;
  gap: 0.35rem;
}

.menu-update-button {
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  min-height: 36px;
  padding: 0.45rem 0.6rem;
  text-align: center;
}

.menu-update-button[hidden] {
  display: none;
}

.menu-update-button:hover {
  border-color: var(--accent);
}

.menu-update-status {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  margin: 0;
}

.menu-update-status[hidden] {
  display: none;
}

.sidebar input[type="search"],
.sidebar select {
  width: 100%;
  padding: 0.4rem;
  background: var(--field);
  color: var(--text);
  border: 1px solid var(--muted);
  border-radius: 4px;
}

.favorites-label,
.blocked-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.playlist-access {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.5rem;
}

.playlist-access summary {
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
}

.playlist-link-list,
.compatible-player-list {
  display: grid;
  gap: 0.5rem;
  padding-top: 0.5rem;
}

.playlist-link-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 0.5rem;
  padding: 0.5rem;
}

.playlist-link-text {
  display: grid;
  gap: 0.15rem;
}

.playlist-link-text span,
.playlist-action-status {
  color: var(--muted);
  font-size: 0.78rem;
}

.playlist-actions {
  display: grid;
  gap: 0.35rem;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
}

.playlist-action {
  align-items: center;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  justify-content: center;
  min-height: 34px;
  padding: 0.35rem 0.45rem;
  text-align: center;
  text-decoration: none;
}

.playlist-action:hover,
.compatible-player-link:hover {
  border-color: var(--accent);
}

.playlist-action.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.playlist-action-status {
  min-height: 1rem;
  margin: 0.35rem 0 0;
}

.compatible-player-list {
  border-top: 1px solid var(--line);
  margin-top: 0.5rem;
  padding-top: 0.5rem;
}

.compatible-player-link {
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.8rem;
  padding: 0.4rem;
  text-decoration: none;
}

#channel-list {
  flex: 1 1 auto;
  list-style: none;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.channel-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}

.channel-select-button {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: flex;
  flex: 1 1 auto;
  font: inherit;
  justify-content: flex-start;
  min-width: 0;
  padding: 0.5rem;
  text-align: left;
}

.channel-name {
  overflow-wrap: anywhere;
}

.channel-meta {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.channel-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.channel-flag {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.05rem 0.35rem;
  text-transform: uppercase;
}

.channel-flag.warning {
  color: var(--danger);
}

.now-playing-badge {
  display: none;
  color: var(--accent-strong);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.channel-item.now-playing {
  background: var(--panel-strong);
  border-left: 4px solid var(--accent-strong);
}

.channel-item.now-playing .channel-select-button {
  padding-left: calc(0.5rem - 4px);
}

.channel-item.now-playing .channel-name {
  color: var(--accent-strong);
  font-weight: 700;
}

.channel-item.now-playing .now-playing-badge {
  display: inline;
}

.channel-item:hover {
  background: var(--panel-strong);
}

.favorite-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 1.1rem;
  min-height: 40px;
  min-width: 40px;
}

.empty-state {
  color: var(--muted);
  padding: 0.75rem 0.5rem;
}

#retry-button {
  margin: 1rem;
  padding: 0.5rem 1rem;
}

.player-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  gap: 0.75rem;
}

.landscape-channel-nav {
  display: block;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transition: opacity 160ms ease, visibility 160ms ease;
  visibility: hidden;
  z-index: 8;
}

.layout.channel-nav-visible .landscape-channel-nav,
.landscape-channel-nav:focus-within {
  opacity: 1;
  visibility: visible;
}

.layout.drawer-open .landscape-channel-nav,
.layout.settings-open .landscape-channel-nav {
  opacity: 0;
  visibility: hidden;
}

.channel-nav-button {
  align-items: center;
  background: rgba(13, 15, 18, 0.7);
  border: 0;
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  justify-content: center;
  letter-spacing: 0;
  line-height: 1;
  height: 60px;
  min-height: 60px;
  min-width: 72px;
  padding: 0;
  pointer-events: auto;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 72px;
}

.channel-nav-button:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  color: var(--accent);
  outline: none;
}

@media (hover: hover) and (pointer: fine) {
  .channel-nav-button:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--accent);
  }
}

.channel-nav-button::before,
.channel-nav-button::after {
  content: "";
  position: absolute;
  top: 50%;
}

.channel-nav-button::before {
  background: currentColor;
  border-radius: 2px;
  height: 32px;
  width: 5px;
}

#previous-channel-button::before {
  left: 20px;
  transform: translateY(-50%);
}

#previous-channel-button::after {
  border-bottom: 18px solid transparent;
  border-right: 28px solid currentColor;
  border-top: 18px solid transparent;
  left: 30px;
  transform: translateY(-50%);
}

#previous-channel-button {
  left: clamp(0.75rem, 7vw, 4rem);
}

#next-channel-button::before {
  right: 20px;
  transform: translateY(-50%);
}

#next-channel-button::after {
  border-bottom: 18px solid transparent;
  border-left: 28px solid currentColor;
  border-top: 18px solid transparent;
  right: 30px;
  transform: translateY(-50%);
}

#next-channel-button {
  right: clamp(0.75rem, 7vw, 4rem);
}

#play-pause-button {
  left: 50%;
  transform: translate(-50%, -50%);
}

#play-pause-button::before,
#play-pause-button::after {
  background: currentColor;
  border: 0;
  height: 32px;
  transform: translateY(-50%);
  width: 8px;
}

#play-pause-button::before {
  left: 23px;
}

#play-pause-button::after {
  right: 23px;
}

#play-pause-button[data-playing="false"]::before {
  background: transparent;
  border-bottom: 18px solid transparent;
  border-left: 28px solid currentColor;
  border-top: 18px solid transparent;
  height: 0;
  left: 25px;
  width: 0;
}

#play-pause-button[data-playing="false"]::after {
  display: none;
}

.channel-nav-button:disabled {
  cursor: default;
  opacity: 0.42;
}

#video {
  width: 100%;
  max-width: 960px;
  background: black;
}

#player-status {
  color: var(--danger);
  font-size: 0.9rem;
  line-height: 1.3;
  margin: 0;
  max-width: 960px;
  width: 100%;
}

#player-status a {
  color: var(--accent);
  font-weight: 700;
}

@media (max-width: 780px) and (orientation: portrait) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .layout {
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .sidebar-column {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    overflow: hidden;
  }

  .sidebar {
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding: 0.75rem;
  }

  .app-menu {
    background: transparent;
    border: 0;
    left: max(0.5rem, env(safe-area-inset-left));
    padding: 0;
    position: fixed;
    top: max(0.5rem, env(safe-area-inset-top));
    z-index: 12;
  }

  .app-title {
    display: none;
  }

  .overflow-menu-button {
    background: rgba(16, 19, 26, 0.78);
    border-color: rgba(230, 230, 230, 0.34);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  }

  :root[data-theme="light"] .overflow-menu-button {
    background: rgba(255, 255, 255, 0.84);
  }

  .overflow-menu-panel {
    left: max(0.75rem, env(safe-area-inset-left));
    max-height: calc(100dvh - 4.5rem);
    position: fixed;
    right: max(0.75rem, env(safe-area-inset-right));
    top: calc(max(0.5rem, env(safe-area-inset-top)) + 3rem);
    width: auto;
  }

  .player-panel {
    order: -1;
    flex: 0 0 auto;
    gap: 0.35rem;
    min-height: 0;
    padding: 0.65rem;
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bg);
  }

  #video {
    aspect-ratio: 16 / 9;
    max-height: 32vh;
    object-fit: contain;
  }

  #player-status {
    font-size: 0.8rem;
    max-height: 2.4rem;
    overflow-y: auto;
  }
}

@media (max-height: 540px) and (orientation: landscape) {
  .layout {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    position: relative;
  }

  html:not(.tv-mode) .drawer-handle {
    align-items: center;
    background: var(--panel-transparent);
    border: 1px solid var(--line);
    border-left: 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text);
    cursor: pointer;
    display: flex;
    height: 72px;
    justify-content: center;
    left: 0;
    padding: 0;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    z-index: 4;
  }

  .drawer-handle::before {
    border-right: 2px solid currentColor;
    border-top: 2px solid currentColor;
    content: "";
    height: 10px;
    transform: rotate(45deg);
    width: 10px;
  }

  .layout.drawer-open .drawer-handle {
    left: min(38vw, 340px);
  }

  .layout.drawer-open .drawer-handle::before {
    transform: rotate(225deg);
  }

  html:not(.tv-mode) .sidebar-column {
    height: 100%;
    left: 0;
    position: absolute;
    transform: translateX(-100%);
    transition: transform 160ms ease;
    width: min(38vw, 340px);
    z-index: 3;
  }

  html:not(.tv-mode) .layout.drawer-open .sidebar-column {
    transform: translateX(0);
  }

  .sidebar {
    background: var(--panel-transparent);
    backdrop-filter: blur(10px);
  }

  .channel-item,
  .channel-item:hover,
  .channel-item.now-playing {
    background-color: transparent;
  }

  .player-panel {
    inset: 0;
    padding: 0.5rem;
    position: absolute;
  }

  .landscape-channel-nav {
    display: block;
    inset: 0;
    opacity: 0;
    position: absolute;
    pointer-events: none;
    transition: opacity 160ms ease, visibility 160ms ease;
    visibility: hidden;
    z-index: 5;
  }

  .layout.channel-nav-visible .landscape-channel-nav,
  .landscape-channel-nav:focus-within {
    opacity: 1;
    visibility: visible;
  }

  .layout.drawer-open .landscape-channel-nav {
    opacity: 0;
    visibility: hidden;
  }

  .channel-nav-button {
    color: #fff;
    pointer-events: auto;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
  }

  #previous-channel-button {
    left: 3rem;
  }

  #next-channel-button {
    right: 1rem;
  }

  #video {
    max-width: none;
    max-height: calc(100vh - 1rem);
  }
}

html.tv-mode,
html.tv-mode body {
  height: 100%;
  overflow: hidden;
}

html.tv-mode body {
  font-size: 18px;
}

html.tv-mode .layout {
  height: 100vh;
  overflow: hidden;
  position: relative;
}

html.tv-mode .sidebar-column {
  height: 100%;
  left: 0;
  overflow: visible;
  position: fixed;
  transform: none;
  width: 0;
  z-index: 20;
}

html.tv-mode #app {
  overflow: visible;
}

html.tv-mode .sidebar {
  backdrop-filter: none;
  background: rgba(18, 20, 26, 0.94);
  bottom: 0;
  gap: 0.75rem;
  left: 0;
  padding: 1.25rem;
  pointer-events: none;
  position: fixed;
  top: 0;
  visibility: hidden;
  width: min(42vw, 500px);
}

html.tv-mode[data-theme="light"] .sidebar {
  background: rgba(255, 255, 255, 0.94);
}

html.tv-mode .layout.drawer-open .sidebar {
  pointer-events: auto;
  visibility: visible;
}

html.tv-mode .app-menu {
  min-height: 74px;
  padding-bottom: 0.85rem;
}

html.tv-mode .app-menu h1 {
  font-size: 1.25rem;
}

html.tv-mode .menu-kicker,
html.tv-mode .version-pill {
  font-size: 0.85rem;
}

html.tv-mode .overflow-menu {
  pointer-events: auto;
  visibility: visible;
}

html.tv-mode .overflow-menu-button {
  display: none;
}

html.tv-mode .overflow-menu-panel {
  background: rgba(18, 20, 26, 0.97);
  border-radius: 0;
  bottom: 0;
  box-shadow: -18px 0 42px rgba(0, 0, 0, 0.42);
  gap: 0.85rem;
  left: auto;
  max-height: none;
  overflow-y: auto;
  padding: 1.25rem;
  pointer-events: auto;
  position: fixed;
  right: 0;
  top: 0;
  visibility: visible;
  width: min(44vw, 520px);
  z-index: 30;
}

html.tv-mode[data-theme="light"] .overflow-menu-panel {
  background: rgba(255, 255, 255, 0.97);
}

html.tv-mode .menu-close-button {
  height: 56px;
  width: 56px;
}

html.tv-mode .menu-close-button::before,
html.tv-mode .menu-close-button::after {
  left: 13px;
  top: 26px;
  width: 28px;
}

html.tv-mode .sidebar input[type="search"],
html.tv-mode .sidebar select,
html.tv-mode .blocked-label,
html.tv-mode .favorites-label,
html.tv-mode .theme-control,
html.tv-mode .official-services summary,
html.tv-mode .playlist-access summary,
html.tv-mode .playlist-action,
html.tv-mode .official-service-link,
html.tv-mode .compatible-player-link {
  font-size: 1rem;
  min-height: 52px;
}

html.tv-mode #channel-list {
  padding-bottom: 1rem;
}

html.tv-mode .channel-item {
  min-height: 68px;
}

html.tv-mode .channel-select-button {
  min-height: 68px;
  padding: 0.8rem 1rem;
}

html.tv-mode .channel-item.now-playing .channel-select-button {
  padding-left: calc(1rem - 4px);
}

html.tv-mode .channel-name {
  font-size: 1.05rem;
  line-height: 1.25;
}

html.tv-mode .favorite-btn {
  display: none;
}

html.tv-mode .channel-item:hover,
html.tv-mode .channel-item.now-playing {
  background: transparent;
}

html.tv-mode .channel-select-button:focus-visible,
html.tv-mode .overflow-menu-panel button:focus-visible,
html.tv-mode .overflow-menu-panel input:focus-visible,
html.tv-mode .overflow-menu-panel select:focus-visible,
html.tv-mode .overflow-menu-panel summary:focus-visible,
html.tv-mode .overflow-menu-panel a:focus-visible {
  background: var(--panel-strong);
  outline: 4px solid var(--accent);
  outline-offset: -4px;
}

html.android-app .browser-download-link,
html.tv-mode .browser-download-link {
  display: none;
}

html.tv-mode .overflow-menu-panel .playlist-action.primary:focus-visible {
  background: var(--accent);
  color: var(--bg);
  outline-color: var(--text);
}

html.tv-mode .channel-item.now-playing .channel-select-button:focus-visible {
  color: var(--accent-strong);
}

html.tv-mode .player-panel {
  gap: 0;
  inset: 0;
  justify-content: flex-start;
  padding: 0;
  position: absolute;
}

html.tv-mode .player-panel:focus,
html.tv-mode #video:focus {
  outline: none;
}

html.tv-mode #video {
  height: 100%;
  max-height: none;
  max-width: none;
  object-fit: contain;
  width: 100%;
}

html.tv-mode #video::-webkit-media-controls,
html.tv-mode #video::-webkit-media-controls-enclosure,
html.tv-mode #video::-webkit-media-controls-panel {
  display: none !important;
}

html.tv-mode .landscape-channel-nav {
  display: block;
}

html.tv-mode .drawer-handle {
  display: none;
}

html.tv-mode #player-status {
  background: rgba(18, 20, 26, 0.9);
  bottom: 1rem;
  left: 50%;
  max-width: min(80vw, 960px);
  padding: 0.75rem 1rem;
  position: absolute;
  transform: translateX(-50%);
  z-index: 8;
}

/* Player-first browsing shared by mobile, desktop, and TV. */
.player-frame {
  background: #000;
  max-width: 960px;
  overflow: hidden;
  position: relative;
  width: 100%;
}

.player-placeholder {
  align-items: center;
  background: #1d1d1d;
  color: #f3f5f7;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  inset: 0;
  justify-content: center;
  pointer-events: none;
  position: absolute;
  z-index: 4;
}

.player-placeholder[hidden] {
  display: none;
}

.player-placeholder-logo {
  display: block;
  height: clamp(64px, 20vw, 130px);
  object-fit: cover;
  object-position: center;
  width: min(78%, 520px);
}

#player-placeholder-label {
  color: #cbd1d8;
  font-size: 0.82rem;
  font-weight: 700;
}

.player-website-link,
.fullscreen-toggle {
  align-items: center;
  background: rgba(13, 15, 18, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  min-height: 42px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 0.75rem;
  transition: opacity 160ms ease, visibility 160ms ease;
  visibility: hidden;
  z-index: 7;
}

.layout.channel-nav-visible .player-website-link,
.layout.channel-nav-visible .fullscreen-toggle,
.player-website-link:focus-visible,
.fullscreen-toggle:focus-visible {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.player-website-link {
  left: 0.75rem;
  padding: 0 0.9rem;
  text-decoration: none;
}

.fullscreen-toggle {
  cursor: pointer;
  font-size: 1.35rem;
  justify-content: center;
  padding: 0;
  right: 0.75rem;
  width: 42px;
}

.fullscreen-toggle img {
  filter: invert(1);
  height: 24px;
  pointer-events: none;
  width: 24px;
}

.fullscreen-toggle[hidden],
html.android-app .player-website-link,
html.tv-mode .player-website-link,
html.tv-mode .fullscreen-toggle {
  display: none;
}

.player-website-link:hover,
.player-website-link:focus-visible,
.fullscreen-toggle:hover,
.fullscreen-toggle:focus-visible {
  background: rgba(13, 15, 18, 0.96);
  border-color: var(--accent);
  color: #fff;
  outline: none;
}

.player-frame.is-fullscreen {
  height: 100%;
  max-width: none;
}

.player-frame.is-fullscreen #video {
  height: 100%;
  max-height: none;
  max-width: none;
  object-fit: contain;
}

.featured-service-list {
  align-items: center;
  background: rgba(13, 15, 18, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  bottom: 0;
  display: flex;
  gap: 0.55rem;
  left: 0;
  max-width: none;
  min-height: 52px;
  opacity: 0;
  overflow-x: auto;
  padding: 0.45rem 0.65rem;
  pointer-events: none;
  position: absolute;
  right: 0;
  scrollbar-width: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
  visibility: hidden;
  width: 100%;
  z-index: 9;
}

.layout.channel-nav-visible .featured-service-list,
.featured-service-list:focus-within {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

.featured-service-list::before {
  color: var(--muted);
  content: "Official";
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.featured-service-link {
  align-items: center;
  background: #111318;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #fff;
  display: inline-flex;
  flex: 1 1 0;
  font-size: 0.8rem;
  font-weight: 800;
  gap: 0.45rem;
  justify-content: center;
  min-height: 40px;
  min-width: 92px;
  padding: 0.35rem 0.65rem;
  text-decoration: none;
}

.featured-service-link:hover,
.featured-service-link:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.featured-service-logo {
  height: 28px;
  max-width: 68px;
  object-fit: contain;
  width: auto;
}

.featured-service-label {
  color: #fff;
  white-space: nowrap;
}

.now-playing-summary {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  max-width: 960px;
  padding: 0.75rem;
  width: 100%;
}

.now-playing-summary[hidden],
.player-hud[hidden] {
  display: none;
}

.now-playing-artwork,
.player-hud-artwork,
.channel-artwork {
  align-items: center;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.75rem;
  font-weight: 800;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.now-playing-artwork {
  height: 54px;
  width: 54px;
}

.now-playing-artwork img,
.player-hud-artwork img,
.channel-artwork img {
  background: var(--field);
  height: 100%;
  inset: 0;
  object-fit: contain;
  position: absolute;
  width: 100%;
}

.now-playing-copy,
.player-hud-copy {
  display: grid;
  min-width: 0;
}

.now-playing-state {
  color: var(--accent-strong);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

#now-playing-title {
  font-size: 1.05rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.now-playing-category {
  color: var(--muted);
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.now-playing-favorite {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  display: inline-flex;
  font-size: 1.65rem;
  height: 44px;
  justify-content: center;
  padding: 0;
  width: 44px;
}

.now-playing-favorite.selected {
  color: #f4c542;
}

.now-playing-actions {
  align-items: center;
  display: flex;
}

.settings-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--text);
  cursor: pointer;
  display: none;
  height: 44px;
  justify-content: center;
  padding: 0;
  width: 44px;
}

.orientation-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--text);
  cursor: pointer;
  display: none;
  height: 44px;
  justify-content: center;
  padding: 0;
  position: relative;
  width: 44px;
}

.orientation-glyph {
  display: block;
  height: 30px;
  position: relative;
  width: 30px;
}

.orientation-device {
  border: 2px solid currentColor;
  border-radius: 3px;
  height: 17px;
  left: 10px;
  position: absolute;
  top: 6px;
  transform: rotate(-34deg);
  width: 10px;
}

.orientation-arc {
  border-radius: 50%;
  height: 20px;
  position: absolute;
  width: 24px;
}

.orientation-arc::after {
  content: "";
  height: 0;
  position: absolute;
  width: 0;
}

.orientation-arc-top {
  border-right: 2px solid currentColor;
  border-top: 2px solid currentColor;
  left: 3px;
  top: 0;
  transform: rotate(-14deg);
}

.orientation-arc-top::after {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid currentColor;
  right: -5px;
  top: 12px;
  transform: rotate(-12deg);
}

.orientation-arc-bottom {
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  bottom: 0;
  left: 3px;
  transform: rotate(-14deg);
}

.orientation-arc-bottom::after {
  border-bottom: 6px solid currentColor;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  bottom: 12px;
  left: -5px;
  transform: rotate(-12deg);
}

html.android-app:not(.tv-mode) .orientation-toggle {
  display: inline-flex;
}

.player-orientation-toggle,
html.android-app:not(.tv-mode) .player-orientation-toggle {
  display: none;
}

#video::-webkit-media-controls-fullscreen-button {
  display: none !important;
}

html.android-app:not(.tv-mode) .player-orientation-toggle {
  background: rgba(13, 15, 18, 0.62);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.9);
  display: inline-flex;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  right: 1rem;
  top: 1rem;
  transition: opacity 160ms ease;
  z-index: 6;
}

html.android-app:not(.tv-mode) .layout.channel-nav-visible .player-orientation-toggle {
  opacity: 0.82;
  pointer-events: auto;
}

.player-hud {
  align-items: center;
  background: rgba(13, 15, 18, 0.9);
  border-left: 5px solid var(--accent-strong);
  bottom: 2rem;
  color: #fff;
  display: none;
  gap: 0.9rem;
  left: 2rem;
  max-width: min(58vw, 680px);
  opacity: 0;
  padding: 0.85rem 1.1rem;
  position: absolute;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 9;
}

.player-hud.visible {
  opacity: 1;
  transform: translateY(0);
}

.player-hud-artwork {
  height: 58px;
  width: 58px;
}

.player-hud-copy strong {
  font-size: 1.15rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-hud-copy span {
  color: #cbd1d8;
  font-size: 0.82rem;
}

.channel-browser-header {
  display: grid;
  gap: 0.65rem;
}

.channel-list-heading {
  align-items: end;
  display: flex;
  justify-content: space-between;
  padding: 0.1rem 0.25rem;
}

.channel-list-heading > div {
  display: grid;
  gap: 0.05rem;
}

.channel-search {
  position: relative;
}

.channel-search[hidden] {
  display: none;
}

.channel-tools {
  align-items: center;
  display: flex;
  gap: 0.4rem;
  min-width: 0;
}

.channel-featured-service-list {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  gap: 0.3rem;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

.channel-featured-service-list::-webkit-scrollbar {
  display: none;
}

.channel-featured-service-list .featured-service-link {
  flex: 1 0 46px;
  min-height: 44px;
  min-width: 46px;
  padding: 0.25rem;
}

.channel-featured-service-list .featured-service-label {
  display: none;
}

.channel-featured-service-list .featured-service-link.text-only .featured-service-label {
  display: inline;
  font-size: 0.62rem;
}

.channel-featured-service-list .featured-service-logo {
  height: 30px;
  max-width: 52px;
  object-fit: contain;
  width: auto;
}

.channel-search-toggle {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  flex: 0 0 44px;
  height: 44px;
  position: relative;
  width: 44px;
}

.channel-search-toggle::before {
  border: 3px solid var(--text);
  border-radius: 50%;
  content: "";
  height: 14px;
  left: 11px;
  position: absolute;
  top: 9px;
  width: 14px;
}

.channel-search-toggle::after {
  background: var(--text);
  content: "";
  height: 3px;
  left: 25px;
  position: absolute;
  top: 25px;
  transform: rotate(45deg);
  transform-origin: left center;
  width: 10px;
}

.channel-search-toggle:hover,
.channel-search-toggle:focus-visible,
.channel-search-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  outline: none;
}

.channel-search input[type="search"] {
  min-height: 42px;
  padding: 0.5rem 2.75rem 0.5rem 0.7rem;
}

.channel-search input[type="search"]::-webkit-search-cancel-button {
  display: none;
}

.channel-search-clear {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 1.35rem;
  height: 36px;
  justify-content: center;
  line-height: 1;
  position: absolute;
  right: 3px;
  top: 3px;
  width: 36px;
}

.channel-search-clear[hidden] {
  display: none;
}

.channel-search-clear:hover,
.channel-search-clear:focus-visible {
  background: var(--panel-strong);
  color: var(--text);
  outline: none;
}

.channel-list-kicker {
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 800;
  text-transform: uppercase;
}

#channel-list-title {
  font-size: 1rem;
}

.channel-count {
  align-items: center;
  background: var(--panel-strong);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 800;
  justify-content: center;
  min-height: 24px;
  min-width: 30px;
  padding: 0 0.45rem;
}

.category-strip {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 0.1rem 0.1rem 0.35rem;
  scrollbar-width: none;
}

.category-strip::-webkit-scrollbar {
  display: none;
}

.category-chip {
  background: transparent;
  border: 1px solid var(--muted);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  flex: 0 0 auto;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
  min-height: 38px;
  padding: 0.4rem 0.75rem;
}

.category-chip.selected {
  background: var(--chip-selected-bg);
  border-color: var(--chip-selected-bg);
  color: var(--chip-selected-text);
}

.channel-item {
  border: 1px solid transparent;
  border-radius: 6px;
  min-height: 66px;
  overflow: hidden;
}

.channel-item + .channel-item {
  margin-top: 0.35rem;
}

.channel-select-button {
  gap: 0.7rem;
  min-height: 66px;
}

.channel-artwork {
  height: 44px;
  width: 44px;
}

.channel-artwork-fallback {
  line-height: 1;
}

.channel-name {
  font-weight: 650;
  line-height: 1.25;
}

.channel-detail {
  color: var(--muted);
  font-size: 0.7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-item.now-playing {
  border-color: var(--accent-strong);
  border-left: 4px solid var(--accent-strong);
}

@media (max-width: 780px) and (orientation: portrait) {
  .app-menu {
    border: 0;
    height: 0;
    inset: 0 auto auto 0;
    padding: 0;
    position: fixed;
    width: 0;
    z-index: 12;
  }

  .app-title,
  .overflow-menu-button {
    display: none;
  }

  .settings-toggle {
    display: inline-flex;
  }

  html:not(.tv-mode) .overflow-menu-panel {
    border-radius: 0;
    bottom: 0;
    left: 0;
    max-height: none;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    right: 0;
    top: calc(env(safe-area-inset-top) + min(31vh, 56.25vw) + 116px);
    width: auto;
  }

  .player-panel {
    background: var(--bg);
    gap: 0;
    padding: env(safe-area-inset-top) 0 0;
  }

  .player-frame {
    border-radius: 0;
    max-width: none;
  }

  #video {
    display: block;
    max-height: 31vh;
  }

  .now-playing-summary {
    border-left: 0;
    border-radius: 0;
    border-right: 0;
    gap: 0.65rem;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    padding: 0.65rem 0.8rem;
  }

  .featured-service-list {
    border-left: 0;
    border-radius: 0;
    border-right: 0;
    gap: 0.3rem;
    justify-content: flex-start;
    padding: 0.4rem 0.35rem;
  }

  .featured-service-list::before {
    font-size: 0.62rem;
  }

  .featured-service-label {
    display: none;
  }

  .featured-service-link.text-only .featured-service-label {
    display: inline;
    font-size: 0.58rem;
  }

  .featured-service-link {
    min-width: 45px;
    padding-left: 0.2rem;
    padding-right: 0.2rem;
  }

  .featured-service-logo {
    max-width: 52px;
  }

  .now-playing-artwork {
    height: 48px;
    width: 48px;
  }

  #now-playing-title {
    font-size: 0.98rem;
  }

  #player-status {
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    max-height: 3.2rem;
    padding: 0.45rem 0.8rem;
  }

  .sidebar {
    gap: 0;
    padding: 0;
  }

  .channel-browser-header {
    background: var(--bg);
    padding: 0.7rem 0.75rem 0.35rem;
  }

  #channel-list {
    padding: 0.25rem 0.75rem max(1rem, env(safe-area-inset-bottom));
  }

  .channel-item {
    background: var(--panel);
    min-height: 62px;
  }

  .channel-item + .channel-item {
    margin-top: 0.35rem;
  }

  .channel-select-button {
    min-height: 62px;
    padding: 0.45rem 0.55rem;
  }

  .channel-item.now-playing .channel-select-button {
    padding-left: calc(0.55rem - 4px);
  }

  .channel-artwork {
    height: 42px;
    width: 42px;
  }

  .favorite-btn {
    margin-right: 0.25rem;
  }
}

@media (max-height: 540px) and (orientation: landscape) {
  .featured-service-list {
    display: flex;
    min-height: 46px;
    padding: 0.25rem 0.45rem;
  }

  html:not(.tv-mode) .drawer-handle {
    display: none;
  }

  html:not(.tv-mode) .sidebar-column {
    left: auto;
    right: 0;
    transform: translateX(100%);
    transition: transform 180ms ease;
    width: min(42vw, 380px);
  }

  html:not(.tv-mode) .layout.drawer-open .sidebar-column {
    transform: translateX(0);
  }

  html:not(.tv-mode) .app-menu {
    align-items: center;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: flex-end;
    left: auto;
    min-height: 54px;
    padding: 0.35rem 0.55rem;
    position: static;
    top: auto;
    width: 100%;
  }

  html:not(.tv-mode) .app-title {
    display: none;
  }

  html:not(.tv-mode) .overflow-menu-button {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
  }

  html:not(.tv-mode) .overflow-menu-panel {
    border-radius: 0;
    bottom: 0;
    left: auto;
    max-height: none;
    position: fixed;
    right: 0;
    top: 0;
    width: min(42vw, 380px);
  }

  html:not(.tv-mode) .player-panel {
    right: 0;
    transition: right 180ms ease;
  }

  html:not(.tv-mode) .layout.drawer-open .player-panel,
  html:not(.tv-mode) .layout.settings-open .player-panel {
    right: min(42vw, 380px);
  }

  .player-frame {
    height: 100%;
    max-width: none;
  }

  .now-playing-summary {
    display: none;
  }

  .channel-browser-header {
    padding-bottom: 0.4rem;
  }

  .channel-item {
    background: rgba(13, 15, 18, 0.55);
  }
}

html.tv-mode .player-frame {
  flex: 1 1 auto;
  height: auto;
  max-width: none;
  min-height: 0;
}

html.tv-mode .featured-service-list {
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
  border-right: 0;
  display: flex;
  max-width: none;
  min-height: 70px;
  padding: 0.55rem 0.75rem;
}

html.tv-mode .featured-service-link {
  min-height: 52px;
}

html.tv-mode .featured-service-link:focus-visible {
  background: var(--panel-strong);
  outline: 4px solid var(--accent);
  outline-offset: -4px;
}

html.tv-mode .channel-search {
  display: none;
}

html.tv-mode .channel-search-toggle {
  display: none;
}

html.tv-mode .now-playing-summary {
  display: none;
}

html.tv-mode .player-hud {
  display: flex;
}

html.tv-mode .player-hud[hidden] {
  display: none;
}

html.tv-mode .channel-browser-header {
  padding-bottom: 0.35rem;
}

html.tv-mode .category-strip {
  padding-bottom: 0.45rem;
}

html.tv-mode .category-chip:focus-visible {
  background: var(--panel-strong);
  border-color: var(--accent);
  color: var(--text);
  outline: 4px solid var(--accent);
  outline-offset: -4px;
}

html.tv-mode .category-chip.selected:focus-visible {
  background: var(--chip-selected-bg);
  color: var(--chip-selected-text);
}

html.tv-mode .channel-list-heading {
  padding: 0.2rem 0;
}

html.tv-mode .channel-item {
  border-color: transparent;
  min-height: 76px;
}

html.tv-mode .channel-select-button {
  gap: 0.85rem;
  min-height: 76px;
}

html.tv-mode .channel-artwork {
  height: 52px;
  width: 52px;
}

html.tv-mode .channel-detail {
  font-size: 0.78rem;
}

html.tv-mode .channel-item.now-playing {
  border-left: 5px solid var(--accent-strong);
}

html.tv-mode .layout.drawer-open .player-hud {
  opacity: 0;
}

html.tv-mode .layout.drawer-open .player-panel {
  left: min(42vw, 500px);
}

html.tv-mode .layout.settings-open .player-panel {
  right: min(44vw, 520px);
}
