body.pb-tv-tab-active .pb-tv-hide {
  display: none !important;
}

body.pb-tv-tab-active #root .flex:has(.pb-tv-sidebar) {
  align-items: stretch;
  min-height: calc(100dvh - 8.5rem);
}

#root .pb-tv-tabs-section {
  background: linear-gradient(180deg, rgba(44, 5, 59, 0.95), rgba(36, 4, 48, 0.98)) !important;
  border-bottom: 1px solid var(--cwBodyBorder, #700a98) !important;
}

#root .pb-tv-tabs-row {
  --pb-tab-ind-x: 0px;
  --pb-tab-ind-w: 33.333%;
  gap: 0.25rem;
}

@media (min-width: 768px) {
  #root .pb-tv-tabs-row {
    max-width: none;
    margin: 0;
    padding-inline: 1rem;
    justify-content: flex-start;
  }

  #root .pb-tv-tabs-row > button {
    flex: 0 0 auto;
    width: auto;
  }
}

#root .pb-tv-tabs-row > div.absolute {
  height: 3px !important;
  bottom: 0 !important;
  left: 0 !important;
  width: var(--pb-tab-ind-w, 33.333%) !important;
  transform: translateX(var(--pb-tab-ind-x, 0px));
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, #dea90a, #f5c32b) !important;
  box-shadow: 0 0 12px rgba(222, 169, 10, 0.45);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, width;
}

#root .pb-tv-tabs-row > button {
  min-width: 0;
  padding: 0.95rem 0.75rem !important;
  font-size: 0.8125rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
  border-radius: 0.625rem 0.625rem 0 0;
  color: var(--cwBodyTxt3, #9d82a8) !important;
  transition: color 0.28s ease, background 0.28s ease;
}

#root .pb-tv-tabs-row > button:hover {
  color: var(--cwBodyTxt, #fff) !important;
  background: rgba(222, 169, 10, 0.06);
}

#root .pb-tv-tabs-row > button.text-foreground:not(.text-stream-muted),
body.pb-tv-tab-active #root .pb-tv-tabs-row > button.pb-tv-tab-btn {
  color: var(--cwBodyTxt, #fff) !important;
  background: rgba(222, 169, 10, 0.08);
}

.pb-tv-sidebar {
  display: none;
  order: 2;
  width: min(24rem, 40vw);
  flex-shrink: 0;
  flex-direction: column;
  background: linear-gradient(180deg, #2c053b 0%, #240430 100%);
  border-left: 1px solid var(--cwBodyBorder, #700a98);
  height: calc(100dvh - 8.5rem);
  max-height: calc(100dvh - 8.5rem);
  min-height: 0;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.22);
}

.pb-tv-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

body.pb-tv-tab-active .pb-tv-sidebar {
  display: flex;
}

body.pb-tv-tab-active #root .flex-1.min-w-0.bg-stream-surface {
  order: 1;
  min-width: 0;
}

body.pb-tv-tab-active #root .flex-1.min-w-0.bg-stream-surface > div > div.pb-8:has(.bg-card) {
  display: none !important;
}

@media (max-width: 767px) {
  #root .pb-tv-tabs-row > button {
    flex: 1;
  }

  body.pb-tv-tab-active {
    overflow: hidden;
    height: 100dvh;
  }

  body.pb-tv-tab-active #root {
    width: 100%;
    max-width: 100%;
    height: 100%;
    overflow: hidden;
  }

  body.pb-tv-tab-active #root main,
  body.pb-tv-tab-active #root .min-h-screen {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  body.pb-tv-tab-active #root .flex:has(.pb-tv-sidebar) {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    flex: 1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    height: calc(100dvh - 8.5rem);
    max-height: calc(100dvh - 8.5rem);
    overflow: hidden;
  }

  body.pb-tv-tab-active #root .flex-1.min-w-0.bg-stream-surface {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
  }

  body.pb-tv-tab-active #root .flex-1.min-w-0.bg-stream-surface > div {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    box-sizing: border-box;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
  }

  body.pb-tv-tab-active #root .flex:has(> .pb-tv-sidebar) > .flex-1.min-w-0.bg-stream-surface {
    flex: 0 0 auto;
    max-height: none;
    min-height: 0;
    overflow: hidden;
  }

  body.pb-tv-tab-active #root .flex:has(> .pb-tv-sidebar) > .pb-tv-sidebar {
    flex: 1 1 0;
    min-height: 0;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  .pb-tv-player-dock {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    padding-bottom: 0 !important;
  }

  .pb-tv-player-dock > .px-3.pt-4 {
    flex-shrink: 0;
    padding: 0.5rem 0.75rem 0.25rem !important;
  }

  .pb-tv-player-dock > .px-3:has(.aspect-video) {
    flex-shrink: 0;
    padding: 0 0.625rem 0.5rem !important;
  }

  .pb-tv-player-dock .aspect-video,
  .pb-tv-player-dock .relative.aspect-video.bg-black,
  .pb-tv-player-dock .relative.aspect-video.bg-black.rounded-xl {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    border-radius: 0.75rem !important;
  }

  .pb-tv-player-dock > .pb-8,
  .pb-tv-player-dock > .px-3.pb-8 {
    display: none !important;
  }

  .pb-tv-sidebar {
    order: 2;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: none !important;
    flex: 1 1 0;
    min-height: 0;
    margin: 0;
    box-sizing: border-box;
    border-left: none;
    border-top: 1px solid rgba(112, 10, 152, 0.85);
    box-shadow: none;
    overflow: hidden;
  }

  body.pb-tv-tab-active .pb-tv-sidebar {
    display: flex !important;
  }

  .pb-tv-panel {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .pb-tv-sidebar .pb-tv-now-playing {
    display: none;
  }

  .pb-tv-search-wrap {
    width: 100%;
    box-sizing: border-box;
    padding: 0.625rem max(0.625rem, env(safe-area-inset-left, 0px)) 0.5rem
      max(0.625rem, env(safe-area-inset-right, 0px));
    border-bottom: 1px solid rgba(112, 10, 152, 0.55);
    flex-shrink: 0;
    background: rgba(36, 4, 48, 0.98);
  }

  .pb-tv-search {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-size: max(16px, 0.875rem);
  }

  .pb-tv-groups {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    touch-action: pan-y;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #dea90a rgba(112, 10, 152, 0.45);
    padding: 0.25rem 0.125rem max(0.75rem, env(safe-area-inset-bottom, 0px))
      max(0.5rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.25rem, env(safe-area-inset-right, 0px));
  }

  .pb-tv-groups::-webkit-scrollbar {
    width: 7px;
  }

  .pb-tv-groups::-webkit-scrollbar-track {
    background: rgba(112, 10, 152, 0.4);
    border-radius: 999px;
    margin: 6px 0;
  }

  .pb-tv-groups::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #f5c32b 0%, #c99208 100%);
    border: 1px solid rgba(36, 4, 48, 0.75);
    border-radius: 999px;
    min-height: 2.5rem;
  }

  .pb-tv-groups::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ffe066 0%, #dea90a 100%);
  }

  .pb-tv-group-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.625rem 0 0.375rem;
    padding: 0.5rem 0.625rem;
    font-size: clamp(0.625rem, 2.8vw, 0.6875rem);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cwAccentBg, #dea90a);
    background: rgba(222, 169, 10, 0.08);
    border: 1px solid rgba(222, 169, 10, 0.14);
    border-radius: 0.5rem;
  }

  .pb-tv-group-title:first-child {
    margin-top: 0.125rem;
  }

  .pb-tv-group-title::before {
    content: "";
    width: 0.1875rem;
    height: 0.875rem;
    border-radius: 999px;
    background: var(--cwAccentBg, #dea90a);
    flex-shrink: 0;
  }

  .pb-tv-channel-group {
    display: none;
  }

  .pb-tv-channel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    gap: clamp(0.5rem, 2.5vw, 0.625rem);
    margin-bottom: 0.125rem;
    padding: clamp(0.5rem, 2.5vw, 0.625rem) clamp(0.5rem, 2.5vw, 0.625rem);
  }

  .pb-tv-channel-body {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }

  .pb-tv-channel-logo,
  .pb-tv-channel-logo-fallback {
    width: clamp(1.75rem, 8vw, 2rem);
    height: clamp(1.75rem, 8vw, 2rem);
  }

  .pb-tv-channel-name {
    font-size: clamp(0.8125rem, 3.5vw, 0.875rem);
  }

  .pb-tv-channel-badge {
    font-size: clamp(0.5rem, 2.2vw, 0.5625rem);
    padding: 0.15rem clamp(0.3rem, 1.5vw, 0.45rem);
  }

  body.pb-tv-tab-active.pb-has-footer .pb-footer {
    display: none !important;
  }

  #root .pb-tv-tabs-row > button {
    padding: 0.8rem 0.5rem !important;
    font-size: 0.75rem !important;
  }
}

@media (max-width: 380px) {
  .pb-tv-groups {
    padding-inline: max(0.375rem, env(safe-area-inset-left, 0px)) max(0.375rem, env(safe-area-inset-right, 0px));
  }

  .pb-tv-search-wrap {
    padding-inline: max(0.5rem, env(safe-area-inset-left, 0px)) max(0.5rem, env(safe-area-inset-right, 0px));
  }

  .pb-tv-channel {
    padding-inline: 0.5rem;
  }

  .pb-tv-channel-badge {
    letter-spacing: 0.03em;
  }
}

.pb-tv-now-playing {
  flex-shrink: 0;
  padding: 0.75rem;
  border-bottom: 1px solid rgba(222, 169, 10, 0.22);
  background: rgba(222, 169, 10, 0.08);
}

.pb-tv-now-playing.is-empty {
  display: none;
}

.pb-tv-now-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cwAccentBg, #dea90a);
  margin-bottom: 0.375rem;
}

.pb-tv-now-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
}

.pb-tv-now-logo {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.pb-tv-now-logo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--cwAccentBg, #dea90a);
}

.pb-tv-now-meta {
  min-width: 0;
  flex: 1;
}

.pb-tv-now-name {
  display: block;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--cwBodyTxt, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pb-tv-now-group {
  display: block;
  font-size: 0.75rem;
  color: var(--cwBodyTxt3, #9d82a8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pb-tv-now-live {
  flex-shrink: 0;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: #dea90a;
  color: #140f03;
}

.pb-tv-search-wrap {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--cwBodyBorder, #700a98);
  flex-shrink: 0;
}

.pb-tv-search {
  width: 100%;
  box-sizing: border-box;
  padding: 0.625rem 0.875rem 0.625rem 2.25rem;
  border-radius: 0.625rem;
  border: 1px solid var(--cwBodyBorder, #700a98);
  background: var(--cwBodyBg, #240430) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239d82a8' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242 1.156a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") 0.75rem center no-repeat;
  color: var(--cwBodyTxt, #fff);
  font-size: 0.875rem;
}

.pb-tv-search:focus {
  outline: none;
  border-color: rgba(222, 169, 10, 0.55);
  box-shadow: 0 0 0 2px rgba(222, 169, 10, 0.15);
}

.pb-tv-search::placeholder {
  color: var(--cwBodyTxt3, #9d82a8);
}

.pb-tv-groups {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0.375rem 0.125rem 0.375rem 0.375rem;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #dea90a rgba(112, 10, 152, 0.45);
}

.pb-tv-groups::-webkit-scrollbar {
  width: 7px;
}

.pb-tv-groups::-webkit-scrollbar-track {
  background: rgba(112, 10, 152, 0.4);
  border-radius: 999px;
  margin: 6px 0;
}

.pb-tv-groups::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #f5c32b 0%, #c99208 100%);
  border: 1px solid rgba(36, 4, 48, 0.75);
  border-radius: 999px;
  min-height: 2.5rem;
}

.pb-tv-groups::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #ffe066 0%, #dea90a 100%);
}

.pb-tv-group-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.625rem 0.5rem;
  margin: 0.75rem 0.375rem 0.375rem;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--cwAccentBg, #dea90a);
  background: rgba(222, 169, 10, 0.08);
  border: 1px solid rgba(222, 169, 10, 0.14);
  border-radius: 0.5rem;
}

.pb-tv-group-title::before {
  content: "";
  width: 0.1875rem;
  height: 0.875rem;
  border-radius: 999px;
  background: var(--cwAccentBg, #dea90a);
  flex-shrink: 0;
}

.pb-tv-group-title:first-child {
  margin-top: 0.25rem;
}

.pb-tv-channel {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.625rem;
  margin-bottom: 0.2rem;
  border: 1px solid transparent;
  border-radius: 0.625rem;
  background: transparent;
  color: var(--cwBodyTxt, #fff);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.pb-tv-channel:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}

.pb-tv-channel.is-active {
  background: linear-gradient(90deg, rgba(222, 169, 10, 0.22), rgba(222, 169, 10, 0.08));
  border-color: rgba(222, 169, 10, 0.55);
  box-shadow: inset 3px 0 0 #dea90a, 0 0 0 1px rgba(222, 169, 10, 0.12);
}

.pb-tv-channel-logo {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.28);
  flex-shrink: 0;
}

.pb-tv-channel-logo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.28);
  color: var(--cwAccentBg, #dea90a);
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
}

.pb-tv-channel-body {
  min-width: 0;
  flex: 1;
}

.pb-tv-channel-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pb-tv-channel.is-active .pb-tv-channel-name {
  color: #fff;
  font-weight: 700;
}

.pb-tv-channel-group {
  display: block;
  font-size: 0.6875rem;
  color: var(--cwBodyTxt3, #9d82a8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pb-tv-channel.is-active .pb-tv-channel-group {
  color: rgba(255, 255, 255, 0.72);
}

.pb-tv-channel-badge {
  display: none;
  flex-shrink: 0;
  font-size: 0.5625rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: #dea90a;
  color: #140f03;
}

.pb-tv-channel.is-active .pb-tv-channel-badge {
  display: inline-flex;
}

.pb-tv-empty,
.pb-tv-loading,
.pb-tv-end {
  padding: 1.25rem 1rem;
  text-align: center;
  color: var(--cwBodyTxt3, #9d82a8);
  font-size: 0.875rem;
}

.pb-tv-loading .pb-tv-spinner {
  margin: 0 auto 0.5rem;
}

.pb-tv-spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--cwAccentBg, #dea90a);
  border-radius: 50%;
  animation: pb-tv-spin 0.8s linear infinite;
}

@keyframes pb-tv-spin {
  to {
    transform: rotate(360deg);
  }
}
