:root {
  --bg-main: #080B14;
  --bg-sidebar: #060810;
  --bg-card: #101524;
  --bg-card-hover: #161E34;
  --accent-cyan: #7DD3FC; /* Frost Cyan */
  --accent-blue: #0A84FF;
  --accent-red: #FF5252;
  --accent-gold: #F5D485; /* Warm Champagne */
  --accent-clock: #EED699; /* Champagne */
  --text-main: #FFFFFF;
  --text-muted: #8F9BB3;
  --text-high-contrast: #E2E8F0;
  --border-subtle: #1E2842;
  --sidebar-w: 268px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  user-select: none;
}

/* ==============================================================
   LOGIN OVERLAY SCREEN
============================================================== */
#login-screen {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, #111A33 0%, #0C0D14 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-card {
  width: 90%;
  max-width: 440px;
  background: rgba(10, 16, 32, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(129, 131, 248, 0.25);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(129, 131, 248, 0.15);
  text-align: center;
}

.login-logo {
  height: 65px;
  object-fit: contain;
  margin-bottom: 20px;
}

.login-card h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.login-card p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.input-group {
  margin-bottom: 16px;
  text-align: left;
}

.input-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-field {
  width: 100%;
  padding: 13px 16px;
  background: #0E1528;
  border: 1.5px solid var(--border-subtle);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.input-field:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 14px rgba(129, 131, 248, 0.3);
  background: #141D35;
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-red));
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  margin-top: 10px;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 8px 24px rgba(229, 9, 20, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(229, 9, 20, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

.dns-status {
  margin-top: 18px;
  font-size: 11px;
  color: #00E676;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ==============================================================
   MAIN APP LAYOUT (SIDEBAR + MAIN CONTENT VIEWPORT)
============================================================== */
#app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  background: linear-gradient(135deg, #0B101D 0%, #0C0D14 100%);
}

/* Sidebar */
.sidebar {
  width: 275px;
  min-width: 275px;
  background: #080B14;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  padding: 24px 16px 16px 16px;
  flex-shrink: 0;
  z-index: 100;
}

.sidebar-logo-container {
  padding: 4px 12px 24px 12px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-logo {
  height: 64px;
  max-width: 220px;
  object-fit: contain;
  align-self: flex-start;
}

.top-status-bar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 24px 40px 12px 40px !important;
  background: transparent !important;
  flex-shrink: 0;
  z-index: 50;
  width: 100%;
  box-sizing: border-box;
}

.top-status-left {
  display: flex;
  align-items: center;
}

#view-title {
  font-size: 28px !important;
  font-weight: 800 !important;
  color: #FFFFFF !important;
  margin: 0 !important;
  letter-spacing: 0.2px !important;
  line-height: 1.2 !important;
}

.top-status-right {
  display: flex;
  align-items: center;
}

.top-clock-pill {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #EED699 !important;
  border-radius: 20px !important;
  padding: 7px 18px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  letter-spacing: 0.3px !important;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
  padding: 0 20px;
  border-radius: 14px;
  color: #8F9BB3;
  font-size: 16.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  border: 1px solid transparent;
}

.nav-item i {
  font-size: 20px;
  width: 26px;
  text-align: center;
}

.nav-item:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.06);
}

.nav-item:focus {
  outline: none !important;
  box-shadow: none !important;
}

.nav-item.active {
  background: #1B243D !important;
  border: 1.5px solid #2B3A62 !important;
  color: #FFFFFF !important;
  font-weight: 700;
  border-radius: 14px;
  outline: none !important;
  box-shadow: none !important;
}

.sidebar-version-footer {
  margin-top: auto;
  padding: 16px 20px 8px 20px;
  font-size: 13px;
  font-weight: 600;
  color: #5A6A85;
  letter-spacing: 0.3px;
}

.nav-logout {
  margin-top: auto;
  color: #ff5252;
}

.nav-logout:hover {
  background: rgba(255, 82, 82, 0.15);
  color: #ff7b7b;
}

/* Main Viewport Container */
.main-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* ==============================================================
   HOME SCREEN (FAVORITES -> QUICK LAUNCH -> PINNED BANNER)
============================================================== */
.home-container {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px;
  height: 100%;
  max-height: 100vh;
  padding: 12px 40px 16px 40px;
  overflow: hidden !important;
  box-sizing: border-box;
}

.home-favorites-section {
  flex-shrink: 0;
  margin-bottom: 2px;
}

.home-fav-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: #818cf8;
  margin-bottom: 6px;
}

.section-header {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}

.section-subtext {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Horizontal Channel Row */
.horizontal-channel-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.horizontal-channel-row::-webkit-scrollbar {
  display: none;
}

.channel-card {
  flex: 0 0 115px;
  width: 115px;
  height: 98px;
  background: #101524;
  border-radius: 12px;
  border: 1px solid #1E2842;
  padding: 8px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.channel-card:hover {
  transform: scale(1.03);
  border-color: var(--accent-cyan);
  background: #161E34;
}

.channel-card img {
  height: 48px;
  max-width: 80%;
  object-fit: contain;
  margin-bottom: 6px;
}

.channel-card .channel-name {
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.channel-card .fav-star {
  position: absolute;
  top: 6px;
  right: 6px;
  color: #F59E0B;
  font-size: 13px;
}

/* Empty Favorites Card */
.empty-favorites-box {
  background: #111A2E;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.empty-favorites-box:hover {
  border-color: var(--accent-cyan);
  background: #162544;
  box-shadow: 0 0 20px rgba(129, 131, 248, 0.25);
}

.empty-favorites-box i {
  font-size: 28px;
  color: #FFC107;
}

.empty-favorites-box .text h4 {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 2px;
}

.empty-favorites-box .text p {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Quick Launch Row */
.quick-launch-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.quick-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: #151828;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.quick-btn i {
  font-size: 15px;
}

.quick-btn:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(129, 131, 248, 0.35);
  transform: scale(1.03);
}

/* Promotional Slideshow Banner (Full-Image 4:1 TV Banner) */
.slideshow-banner {
  aspect-ratio: 1376 / 384;
  flex: 1;
  min-height: 250px;
  max-height: 380px;
  height: auto;
  width: 100%;
  background: #0A0814;
  border: 1px solid #1E2235;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  flex-shrink: 1;
  margin-top: 0 !important;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
  display: flex;
  align-items: center;
  background-color: #0A0814;
  background-size: 100% 100% !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}

.slide.active {
  opacity: 1;
  z-index: 1;
}

.slide-content {
  position: relative;
  z-index: 2;
  max-width: 82%;
}

.slide-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.slide-title {
  font-size: 23px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.slide-desc {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 16px;
  line-height: 1.4;
}

.slide-pills {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(14, 21, 40, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
}

.slide-indicators {
  position: absolute;
  bottom: 12px;
  right: 20px;
  display: flex;
  gap: 6px;
  z-index: 10;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.35);
  transition: all 0.3s;
}

.dot.active {
  width: 20px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-red));
}

/* ==============================================================
   GRID / CATEGORY VIEW (LIVE TV, MOVIES, KIDS)
============================================================== */
.content-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 10px 36px 20px 36px;
  overflow: hidden;
  min-height: 0;
}

.filter-bar {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 16px;
  flex-shrink: 0;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.filter-bar::-webkit-scrollbar {
  display: none !important;
  height: 0 !important;
  width: 0 !important;
}

.filter-btn {
  height: 42px;
  padding: 0 22px;
  border-radius: 22px;
  background: #121828;
  border: 1px solid #1E2842;
  color: #8F9BB3;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: none;
}

.filter-btn:hover {
  background: #1A2238;
  border-color: #2D3E68;
  color: #FFFFFF;
}

.filter-btn.active {
  background: #25355C !important;
  border: 1.5px solid #4D73BA !important;
  color: #FFFFFF !important;
  font-weight: 700 !important;
  box-shadow: none !important;
}

.channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  overflow-y: auto;
  flex: 1;
  padding-right: 6px;
  scrollbar-width: thin;
}

.channels-grid::-webkit-scrollbar {
  width: 6px;
}
.channels-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.grid-card {
  height: 125px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.grid-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-cyan);
  box-shadow: 0 8px 24px rgba(129, 131, 248, 0.3);
  background: var(--bg-card-hover);
}

.grid-card img {
  height: 60px;
  max-width: 85%;
  object-fit: contain;
  margin-bottom: 8px;
}

.grid-card .name {
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==============================================================
   VIDEO PLAYER MODAL
============================================================== */
#player-modal {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 10000;
  display: none;
  flex-direction: column;
}

.player-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
}

.player-title {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-badge {
  background: var(--accent-red);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.player-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

/* Volume Slider Group */
.player-volume-group,
.epg-volume-group {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 2px 8px 2px 2px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.25s ease;
}

.player-volume-group:hover,
.player-volume-group:focus-within,
.epg-volume-group:hover,
.epg-volume-group:focus-within {
  background: rgba(255, 255, 255, 0.22);
  border-color: var(--accent-cyan, #8183F8);
  box-shadow: 0 0 12px rgba(129, 131, 248, 0.3);
}

.player-volume-slider-wrap,
.epg-volume-slider-wrap {
  width: 80px;
  display: flex;
  align-items: center;
  margin-left: 6px;
  margin-right: 4px;
}

.player-volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
  outline: none;
  cursor: pointer;
  transition: background 0.2s;
}

.player-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-cyan, #8183F8);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(129, 131, 248, 0.8);
  transition: transform 0.15s ease;
}

.player-volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

.player-volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-cyan, #8183F8);
  border: none;
  cursor: pointer;
}

.player-close-btn:hover {
  background: var(--accent-red);
}

.video-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  position: relative;
}

video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.loading-spinner {
  position: absolute;
  width: 50px;
  height: 50px;
  border: 4px solid rgba(129, 131, 248, 0.2);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

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

/* ==============================================================
   LIVE TV LONGER CHANNEL BARS (HORIZONTAL ROWS WITH EPG RUNNING BAR)
============================================================== */
.channel-bars-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  flex: 1;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.channel-bars-list::-webkit-scrollbar {
  width: 6px;
}
.channel-bars-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.channel-bar-item {
  height: 66px;
  min-height: 66px;
  background: #101524;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 0 22px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.15s ease;
  gap: 16px;
  margin-bottom: 8px;
}

.channel-bar-item:hover, .channel-bar-item:focus {
  background: #161E34;
  border-color: #2D3E68;
  outline: none;
}

.channel-bar-item.active {
  background: #1C2642 !important;
  border: 1.5px solid #4A6FB5 !important;
}

.channel-row-brand-col {
  width: 245px;
  min-width: 245px;
  max-width: 245px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.channel-row-logo-frame,
.channel-bar-logo {
  width: 46px;
  height: 46px;
  min-width: 46px;
  background: #161D30;
  border: 1px solid #222C46;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.channel-row-logo-frame img,
.channel-bar-logo img {
  width: 36px;
  height: 36px;
  max-width: 36px;
  max-height: 36px;
  object-fit: contain;
}

.channel-row-name {
  font-size: 15px;
  font-weight: 800;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.channel-row-epg-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  gap: 3px;
}

.channel-row-now-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.channel-row-onair-dot {
  color: #FF4D4D;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.channel-row-prog-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.channel-row-time-range {
  font-size: 13.5px;
  font-weight: 600;
  color: #C4CBD8;
  white-space: nowrap;
  margin-left: auto;
  padding-left: 12px;
}

.channel-row-prog-track {
  width: 100%;
  height: 4px;
  background: #1C243B;
  border-radius: 2px;
  overflow: hidden;
  margin: 2px 0;
}

.channel-row-prog-fill {
  height: 100%;
  background: #5C6BC0;
  border-radius: 2px;
}

.channel-row-next-line {
  font-size: 14.5px !important;
  font-weight: 700 !important;
  color: #F5D485 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-row-next-line .next-title,
.channel-row-next-line .next-time,
.channel-row-next-line .next-prefix {
  color: #F5D485 !important;
  font-weight: 700 !important;
  font-size: 14.5px !important;
}

.now-time-mobile,
.next-sep {
  display: none;
}

.channel-row-fav-btn {
  display: none !important;
}
}

.channel-row-fav-btn:hover, .channel-row-fav-btn.active {
  color: var(--accent-gold);
}

.channel-bar-mobile-subtitle {
  display: none;
}

.channel-bar-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-dot-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9.5px;
  font-weight: 900;
  color: var(--accent-red);
  letter-spacing: 0.5px;
}

.pulsing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-red);
  box-shadow: 0 0 8px var(--accent-red);
  animation: pulse 1.4s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.channel-bar-fav {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: all 0.15s;
}

.channel-bar-fav:hover,
.channel-bar-fav.active {
  color: #FFC107;
}

/* RIGHT SIDE: EPG RUNNING TICKER BAR WITH AUTO-SCROLLING MARQUEE */
.channel-bar-epg {
  flex: 1;
  height: 40px;
  background: rgba(15, 20, 36, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  position: relative;
}

.epg-icon-badge {
  color: var(--accent-cyan);
  font-size: 13px;
  flex-shrink: 0;
}

.epg-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  overflow: hidden;
  position: relative;
}

.epg-ticker-marquee {
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  width: 100%;
}

.epg-ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  animation: epgTickerScroll 28s linear infinite 2s; /* 2-second initial pause matching app */
  will-change: transform;
}

.channel-bar-item:hover .epg-ticker-track,
.channel-bar-item:focus .epg-ticker-track {
  animation-play-state: paused;
}

@keyframes epgTickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.epg-item-span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #fff;
}

.epg-tag-now {
  color: var(--accent-cyan);
  font-weight: 900;
  font-size: 10px;
  background: rgba(129, 131, 248, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(129, 131, 248, 0.3);
  letter-spacing: 0.5px;
}

.epg-tag-next {
  color: #FFD54F;
  font-weight: 900;
  font-size: 10px;
  background: rgba(255, 213, 79, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 213, 79, 0.3);
  letter-spacing: 0.5px;
}

.epg-tag-later {
  color: #80D8FF;
  font-weight: 900;
  font-size: 10px;
  background: rgba(128, 216, 255, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(128, 216, 255, 0.25);
  letter-spacing: 0.5px;
}

.epg-time-badge-inline {
  color: rgba(255, 255, 255, 0.6);
  font-size: 10px;
  font-weight: 500;
}

/* EPG Progress Bar inside Row */
.epg-progress-track {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  margin-top: 3px;
  overflow: hidden;
}

.epg-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(129, 131, 248, 0.5);
  transition: width 0.3s;
}

.epg-time-text {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  flex-shrink: 0;
}

/* Player Prev / Next Channel Buttons */
.player-nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(129, 131, 248, 0.35);
  border-radius: 8px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 6px 12px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.18s ease;
}

.player-nav-btn:hover {
  background: rgba(129, 131, 248, 0.25);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(129, 131, 248, 0.4);
  transform: translateY(-1px);
}

/* Clean TV & Browser Focus Styles */
[tabindex="0"]:focus {
  outline: none !important;
}

.tv-focused {
  border-color: #4A6FB5 !important;
  background: #1C2640 !important;
  box-shadow: none !important;
  outline: none !important;
}

.channel-bar-item:focus {
  background: #182035 !important;
  border-color: #385185 !important;
  outline: none !important;
  box-shadow: none !important;
}

/* ==============================================================
   TODAY'S EVENTS GRID & CARDS (MATCHING ANDROID TV item_sports_card)
============================================================== */
.events-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding: 4px 8px 30px 4px;
  scrollbar-width: thin;
  scrollbar-color: #1E2842 #091022;
}

.events-grid::-webkit-scrollbar {
  width: 6px;
}
.events-grid::-webkit-scrollbar-track {
  background: #091022;
}
.events-grid::-webkit-scrollbar-thumb {
  background: #1E2842;
  border-radius: 4px;
}

/* Sports Row Item (Matching Firestick App media_1796043657527_370c1f47.jpg) */
.sports-row-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #101524;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 10px 18px;
  min-height: 66px;
  height: 66px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  margin-bottom: 9px;
}

.sports-row-item:hover,
.sports-row-item:focus {
  background: #182035;
  border-color: #385185;
  outline: none;
}

.sports-row-item:active {
  background: #1C2640;
  border-color: #4A6FB5;
}

.sports-diamond {
  color: #818CF8;
  font-size: 13px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: -4px;
}

.sports-row-watch-btn {
  display: none !important;
}

.sports-row-logo-frame {
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 10px;
  background: #161D30;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

.sports-row-logo-frame img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.sports-row-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sports-row-title {
  font-size: 15px;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.sports-row-subtext {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.team-feed-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: rgba(217, 119, 6, 0.22);
  border: 1px solid #F59E0B;
  color: #F59E0B;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sports-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #EF4444;
}

.sports-live-indicator .channel-row-onair-dot {
  color: #EF4444;
  font-size: 9px;
  display: inline-block;
}

.sports-raw-channel {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.5);
  margin-left: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.sports-row-watch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: #1A3B66;
  border: 1px solid var(--accent-cyan);
  border-radius: 8px;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.sports-row-watch-btn:hover {
  background: var(--accent-cyan);
  color: #060D1A;
}

/* Fallback event-card styling for backward compatibility */
.event-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  min-height: 140px;
  height: auto;
  box-sizing: border-box;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.event-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-cyan);
  box-shadow: 0 8px 24px rgba(125, 211, 252, 0.2);
  background: #19243d;
}

.event-card:focus {
  outline: 2.5px solid var(--accent-cyan);
  box-shadow: 0 0 20px rgba(125, 211, 252, 0.3);
  background: #1c2742;
}

.event-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.event-sport-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: #141C30;
  color: var(--accent-cyan);
  border: 1px solid #23304E;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.event-time-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent-gold);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.event-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  line-height: 1.45;
  margin-bottom: 12px;
  flex: 1 0 auto;
  min-height: 40px;
  display: block;
  word-break: break-word;
}

.event-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
  margin-top: auto;
}

.event-channel-name {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 170px;
}

.event-watch-btn {
  padding: 6px 14px;
  background: #1A3B66;
  border: 1px solid var(--accent-cyan);
  border-radius: 6px;
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.15s ease;
}

.event-watch-btn:hover {
  background: var(--accent-cyan);
  color: #060D1A;
}

/* ==============================================================
   IN-PLAYER / FULLSCREEN EPG OVERLAY BAR
============================================================== */
.player-epg-bar {
  position: absolute;
  bottom: 24px;
  left: 30px;
  right: 30px;
  background: rgba(8, 14, 28, 0.92);
  backdrop-filter: blur(16px);
  border: 1.5px solid rgba(129, 131, 248, 0.4);
  border-radius: 14px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 30;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(129, 131, 248, 0.2);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: auto;
}

.player-epg-bar.hidden {
  opacity: 0 !important;
  transform: translateY(15px) !important;
  pointer-events: none !important;
}

.player-topbar {
  transition: opacity 0.35s ease;
}

.player-topbar.hidden {
  opacity: 0 !important;
  pointer-events: none !important;
}

.player-unmute-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 12px 22px;
  border-radius: 30px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid var(--accent-cyan);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 35;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 0 25px rgba(129, 131, 248, 0.5);
}

.player-unmute-btn:hover,
.player-unmute-btn:active {
  background: var(--accent-cyan);
  color: #000;
  transform: translate(-50%, -50%) scale(1.05);
}

.player-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.player-epg-header-card {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.player-epg-logo-box {
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 2px;
}
.player-epg-logo-box img {
  max-width: 88%;
  max-height: 88%;
  object-fit: contain;
}

.player-epg-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  overflow: hidden;
}

.player-epg-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-epg-channel-name {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-epg-time-badge {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.player-epg-program-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: #E2E8F0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pulsing-dot-red {
  color: #FF5252;
  font-size: 8px;
  margin-right: 2px;
}

.epg-tag-now {
  color: #FF5252;
  font-weight: 800;
}

.info-sep {
  color: #64748B;
  margin: 0 4px;
}

.player-epg-next-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #94A3B8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.epg-tag-next {
  color: var(--accent-cyan);
  font-weight: 800;
}

/* Unified 8-Button Controls Toolbar (Matching Android Mobile App) */
.player-controls-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.player-ctrl-btn {
  height: 38px;
  min-width: 38px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.player-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--accent-cyan);
}

.player-ctrl-btn:active {
  transform: scale(0.95);
  background: var(--accent-cyan);
  color: #000;
}

.player-ctrl-aspect {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  min-width: 44px;
}

#player-btn-fav.active i {
  color: #FF5252 !important;
}

/* ==============================================================
   DESKTOP DEFAULT HIDING FOR MOBILE-SPECIFIC ELEMENTS (> 900px)
============================================================== */
.sidebar {
  display: flex !important;
  width: var(--sidebar-w) !important;
}

.search-box-container {
  display: none !important;
}

.mobile-bottom-nav {
  display: none !important;
}

.mobile-header-logo {
  display: none !important;
}

.mobile-search-btn {
  display: none !important;
}

/* ==============================================================
   RESPONSIVE MOBILE & IPHONE / SAFARI OPTIMIZATIONS (<= 900px)
============================================================== */
@media screen and (max-width: 900px) {
  /* 1. Root App Layout */
  #app-layout {
    flex-direction: column !important;
    height: 100vh !important;
    height: 100dvh !important;
    width: 100vw !important;
    overflow: hidden !important;
  }

  /* 2. Hide Desktop Left Sidebar completely on phones & tablets */
  .sidebar {
    display: none !important;
    width: 0 !important;
  }

  /* 3. Main Viewport: Dynamic Safe Area (0px on Android Chrome, Notch-aware on iOS Safari) */
  .main-viewport {
    width: 100% !important;
    flex: 1 !important;
    height: 100% !important;
    padding-top: 0px !important;
    padding-top: env(safe-area-inset-top, 0px) !important;
    padding-bottom: calc(56px + max(env(safe-area-inset-bottom, 0px), 8px)) !important;
    overflow-y: hidden !important;
  }

  /* 4. Top Status Bar on Mobile (Compact & Clean) */
  .top-status-bar {
    padding-top: 8px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    padding-bottom: 8px !important;
    gap: 10px !important;
  }

  .mobile-header-logo {
    display: block !important;
    height: 26px !important;
    max-width: 95px !important;
    object-fit: contain !important;
  }

  #view-title {
    font-size: 16px !important;
    letter-spacing: 0px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 130px !important;
  }

  .mobile-search-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background: #0E1528 !important;
    border: 1px solid var(--border-subtle) !important;
    color: #fff !important;
    font-size: 14px !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
  }

  /* On mobile, search bar is collapsed into the search button by default */
  .search-box-container {
    display: none !important;
  }

  .search-box-container.mobile-expanded {
    display: flex !important;
    position: absolute !important;
    left: 12px !important;
    right: 12px !important;
    top: 10px !important;
    width: auto !important;
    z-index: 250 !important;
    box-shadow: 0 6px 25px rgba(0,0,0,0.9) !important;
    background: #090E1B !important;
    border-radius: 20px !important;
  }

  .search-box-container.mobile-expanded .mobile-search-close-btn {
    display: block !important;
  }

  #search-input {
    padding: 7px 34px 7px 34px !important;
    font-size: 16px !important; /* iOS Safari auto-zoom prevention */
    border-radius: 18px !important;
  }

  #user-info-pill {
    display: none !important;
  }

  .conn-pill {
    padding: 4px 10px !important;
    font-size: 11px !important;
    flex-shrink: 0 !important;
  }

  /* 5. Mobile Bottom Navigation Bar (Thumb-Friendly, Safe for Safari & Android) */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: calc(56px + max(env(safe-area-inset-bottom, 0px), 8px)) !important;
    padding-bottom: max(env(safe-area-inset-bottom, 0px), 8px) !important;
    background: rgba(7, 11, 20, 0.96) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    z-index: 200 !important;
    align-items: center !important;
    justify-content: space-around !important;
  }

  .mobile-nav-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    color: #8E9BAE !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    flex: 1 !important;
    height: 100% !important;
    min-width: 0 !important;
    transition: all 0.15s ease !important;
    -webkit-tap-highlight-color: transparent !important;
    user-select: none !important;
  }

  .mobile-nav-item i {
    font-size: 17px !important;
    transition: transform 0.15s ease !important;
  }

  .mobile-nav-item span {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
  }

  .mobile-nav-item.active {
    color: var(--accent-cyan) !important;
  }

  .mobile-nav-item.active i {
    transform: scale(1.15) !important;
    color: var(--accent-cyan) !important;
    filter: drop-shadow(0 0 6px rgba(129, 131, 248, 0.6)) !important;
  }

  .mobile-nav-item:active {
    transform: scale(0.92) !important;
  }

  /* 5. Mobile Tab View Isolation (Prevent Views from Bleeding into Each Other) */
  #view-home[style*="display: none"],
  #view-content[style*="display: none"],
  #view-epg[style*="display: none"],
  #view-events[style*="display: none"],
  #view-search[style*="display: none"],
  #view-settings[style*="display: none"] {
    display: none !important;
  }

  #view-home:not([style*="display: none"]) {
    display: flex !important;
  }

  #view-content:not([style*="display: none"]) {
    display: flex !important;
  }

  #view-epg:not([style*="display: none"]) {
    display: flex !important;
  }

  /* 6. Content Views & Filters */
  .content-view {
    padding: 6px 12px 6px 12px !important;
    min-height: 0 !important;
  }

  .settings-view {
    padding: 6px 12px 10px 12px !important;
    max-width: 100% !important;
  }

  /* Permanently hide iOS install banner */
  #ios-install-banner,
  .ios-install-banner {
    display: none !important;
  }

  .filter-bar {
    gap: 8px !important;
    margin-bottom: 12px !important;
    padding-bottom: 6px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .filter-btn {
    height: 38px !important;
    padding: 0 16px !important;
    font-size: 12px !important;
    border-radius: 10px !important;
    flex-shrink: 0 !important;
  }

  /* 7. Full-Width Channel Bars on Mobile with High Readability (No Horizontal Overflow) */
  .channel-bars-list {
    gap: 8px !important;
    padding-right: 0 !important;
  }

  .channel-bar-item {
    height: 68px !important;
    min-height: 68px !important;
    padding: 8px 12px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    border-radius: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .channel-row-brand-col {
    width: 105px !important;
    min-width: 105px !important;
    max-width: 105px !important;
    gap: 6px !important;
  }

  .channel-row-name {
    font-size: 12px !important;
  }

  .channel-row-now-line {
    display: flex !important;
    align-items: center !important;
    min-width: 0 !important;
    gap: 5px !important;
    width: 100% !important;
  }

  .channel-row-prog-title {
    font-size: 12.5px !important;
    font-weight: 700 !important;
    color: #FFFFFF !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    flex: 1 !important;
    min-width: 0 !important;
    display: block !important;
  }

  .channel-row-time-range,
  .channel-row-next-line .next-time {
    display: none !important;
  }

  .channel-row-next-line {
    font-size: 11px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
  }

  .channel-row-next-line .now-time-mobile {
    display: inline !important;
    color: var(--accent-gold) !important;
    font-weight: 700 !important;
    flex-shrink: 0 !important;
  }

  .channel-row-next-line .next-sep {
    display: inline !important;
    color: var(--text-muted) !important;
    margin: 0 2px !important;
    flex-shrink: 0 !important;
  }

  .channel-row-next-line .next-prefix {
    color: var(--accent-cyan) !important;
    font-weight: 700 !important;
    flex-shrink: 0 !important;
  }

  .channel-row-next-line .next-title {
    color: var(--text-muted) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    min-width: 0 !important;
  }

  .channel-bar-left {
    flex: 1 !important;
    min-width: 0 !important;
    width: auto !important;
    gap: 12px !important;
    display: flex !important;
    align-items: center !important;
  }

  .channel-bar-logo {
    width: 48px !important;
    height: 48px !important;
    border-radius: 10px !important;
    flex-shrink: 0 !important;
  }

  .channel-bar-logo img {
    max-width: 40px !important;
    max-height: 40px !important;
  }

  .channel-bar-details {
    flex: 1 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    overflow: hidden !important;
  }

  .channel-bar-title {
    font-size: 15px !important;
    font-weight: 800 !important;
    line-height: 1.3 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    color: #fff !important;
  }

  /* Rich mobile on-air EPG line */
  .channel-bar-mobile-subtitle {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 11.5px !important;
    color: var(--accent-cyan) !important;
    font-weight: 600 !important;
    margin-top: 3px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .channel-bar-mobile-prog-track {
    display: block !important;
    width: 100% !important;
    max-width: 220px !important;
    height: 3.5px !important;
    background: rgba(255, 255, 255, 0.12) !important;
    border-radius: 3px !important;
    margin-top: 4px !important;
    overflow: hidden !important;
  }

  .channel-bar-mobile-prog-fill {
    height: 100% !important;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan)) !important;
    border-radius: 3px !important;
  }

  /* HIDE desktop 2-box EPG deck on mobile to stop horizontal overflow and text collision */
  .channel-bar-epg-deck,
  .channel-bar-epg {
    display: none !important;
  }

  /* 8. Home Dashboard on Mobile (Clean Compact Stack, Zero Dead Space) */
  .home-favorites-section,
  #favorites-row,
  .home-pinned-section {
    display: none !important;
  }

  .home-container {
    padding: 6px 12px 8px 12px !important;
    gap: 6px !important;
    height: 100% !important;
    overflow-y: hidden !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
  }

  .home-dashboard-row {
    flex-direction: column !important;
    height: auto !important;
    gap: 6px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .dash-col {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
  }

  /* 1. Live & EPG Cards Grid */
  .dash-col-refresh {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    width: 100% !important;
    margin: 0 !important;
  }

  .dash-refresh-card {
    height: 76px !important;
    min-height: 76px !important;
    padding: 8px 10px !important;
    border-radius: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    margin: 0 !important;
  }

  .dash-card-header {
    margin-bottom: 2px !important;
  }

  .dash-card-label {
    font-size: 9px !important;
  }

  .dash-card-big-title {
    font-size: 13.5px !important;
    line-height: 1.15 !important;
  }

  .dash-card-subtext {
    font-size: 8px !important;
  }

  .dash-pill-btn {
    padding: 3px 7px !important;
    font-size: 8.5px !important;
  }

  /* 2. Account Card */
  .dash-col-account {
    margin: 0 !important;
    padding: 0 !important;
  }

  #dash-account-card,
  .dash-card-full {
    width: 100% !important;
    height: 74px !important;
    min-height: 74px !important;
    padding: 8px 12px !important;
    border-radius: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    margin: 0 !important;
  }

  .dash-account-details-grid {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    margin: 2px 0 !important;
  }

  .dash-account-row {
    font-size: 10px !important;
    gap: 4px !important;
  }

  .dash-account-row strong {
    font-size: 11px !important;
  }

  .dash-card-footer-row {
    margin-top: 1px !important;
  }

  .dash-conn-active-text {
    font-size: 11px !important;
  }

  /* 3. Speedtest Card */
  .dash-col-speed {
    margin: 0 !important;
    padding: 0 !important;
  }

  #dash-speed-card {
    width: 100% !important;
    height: 92px !important;
    min-height: 92px !important;
    padding: 8px 12px !important;
    border-radius: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    margin: 0 !important;
  }

  .dash-speed-number {
    font-size: 22px !important;
  }

  /* 4. Promo Banner (Edge-to-Edge Responsive 1376:384 Aspect Ratio - Never Crops) */
  .slideshow-banner {
    aspect-ratio: 1376 / 384 !important;
    height: auto !important;
    min-height: unset !important;
    max-height: unset !important;
    width: 100% !important;
    padding: 0 !important;
    border-radius: 12px !important;
    margin: 0 !important;
    overflow: hidden !important;
    display: block !important;
    position: relative !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
    border: 1px solid #1E2235 !important;
  }

  .slideshow-banner .slide {
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    inset: 0 !important;
    background-size: 100% 100% !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
  }

  .slide-indicators {
    bottom: 6px !important;
  }

  .slide-title {
    font-size: 12.5px !important;
    line-height: 1.15 !important;
    margin-bottom: 2px !important;
  }

  .slide-desc {
    font-size: 9.5px !important;
    line-height: 1.2 !important;
    max-width: 100% !important;
    margin-bottom: 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }

  .slide-pills {
    display: none !important;
  }

  /* 8b. EPG Guide on Mobile (Sticky Preview Under Categories + Freeze-Pane Timeline) */
  #view-epg {
    flex-direction: column !important;
    height: 100% !important;
    overflow: hidden !important;
    padding: 4px 8px 6px 8px !important;
  }

  #epg-category-filter-bar {
    margin-bottom: 4px !important;
    flex-shrink: 0 !important;
  }

  .epg-top-deck {
    display: flex !important;
    flex-direction: column !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
    background: #060B18 !important;
    padding: 0 0 4px 0 !important;
    margin-bottom: 2px !important;
    height: auto !important;
    min-height: 0 !important;
    border: none !important;
    flex-shrink: 0 !important;
  }

  /* Remove EPG info above preview player on mobile */
  .epg-hero-card,
  .epg-meta-panel,
  .epg-next-panel {
    display: none !important;
  }

  /* Preview video player sits directly under categories */
  .epg-preview-panel {
    display: block !important;
    width: 100% !important;
    height: 165px !important;
    min-height: 165px !important;
    border-radius: 12px !important;
    border: 1.5px solid var(--border-subtle) !important;
    position: relative !important;
    overflow: hidden !important;
    background: #000 !important;
    cursor: pointer !important;
  }

  #epg-preview-video {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
  }

  /* EPG 3-Day Navigation on Mobile */
  .epg-day-navigation {
    padding: 6px 10px !important;
    gap: 8px !important;
    background: #080E1C !important;
  }

  .epg-day-btn {
    padding: 5px 11px !important;
    font-size: 10px !important;
    border-radius: 16px !important;
  }

  .epg-timeline-indicator {
    font-size: 9.5px !important;
  }

  /* EPG Timeline Container & Freeze-Pane Sticky Channel Column */
  .epg-timeline-container {
    flex: 1 !important;
    overflow-y: auto !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 10px !important;
    border: 1px solid var(--border-subtle) !important;
    background: #0A1020 !important;
    position: relative !important;
  }

  .epg-timeline-header-row {
    height: 32px !important;
    display: flex !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 30 !important;
    background: #0B172E !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    min-width: max-content !important;
  }

  .epg-channel-col-header {
    width: 110px !important;
    min-width: 110px !important;
    position: sticky !important;
    left: 0 !important;
    z-index: 40 !important;
    background: #0B172E !important;
    padding: 0 8px !important;
    font-size: 10px !important;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.6) !important;
  }

  .epg-time-slots-header {
    display: flex !important;
    flex: 1 !important;
    align-items: center !important;
  }

  .epg-time-slot-item {
    width: 135px !important;
    min-width: 135px !important;
    padding: 0 8px !important;
    font-size: 10px !important;
  }

  .epg-timeline-body {
    overflow: visible !important;
    display: block !important;
    width: max-content !important;
    min-width: 100% !important;
  }

  .epg-timeline-row {
    height: 64px !important;
    min-height: 64px !important;
    display: flex !important;
    align-items: center !important;
    min-width: max-content !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
    position: relative !important;
    overflow: visible !important;
  }

  /* Freeze-pane channel cell: locked firmly on left while 72-hour timeline scrolls horizontally */
  .epg-channel-cell {
    width: 110px !important;
    min-width: 110px !important;
    position: sticky !important;
    left: 0 !important;
    z-index: 25 !important;
    background: #080E1C !important;
    padding: 0 6px !important;
    gap: 6px !important;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.6) !important;
  }

  .epg-channel-num {
    font-size: 10px !important;
    min-width: 14px !important;
  }

  .epg-channel-cell img {
    width: 28px !important;
    height: 28px !important;
    border-radius: 6px !important;
    padding: 2px !important;
  }

  .epg-channel-cell span {
    font-size: 11px !important;
  }

  .epg-programs-track {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    overflow: visible !important;
    flex: 1 !important;
  }

  .epg-program-block {
    width: 135px !important;
    min-width: 135px !important;
    height: 52px !important;
    padding: 4px 8px !important;
    border-radius: 8px !important;
    margin-right: 6px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
  }

  /* 9. Sports Center Mobile Card Layout (Matching Mobile App Image 5) */
  .sports-row-item {
    padding: 12px 14px !important;
    gap: 12px !important;
    align-items: flex-start !important;
    min-height: auto !important;
    cursor: pointer !important;
    position: relative !important;
  }

  .sports-row-item:active {
    background: #172238 !important;
    transform: scale(0.98) !important;
  }

  .sports-row-logo-frame {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    border-radius: 8px !important;
    margin-top: 2px !important;
    flex-shrink: 0 !important;
  }

  .sports-row-details {
    flex: 1 !important;
    min-width: 0 !important;
    gap: 6px !important;
  }

  .sports-row-title {
    font-size: 13.5px !important;
    font-weight: 700 !important;
    color: #FFFFFF !important;
    white-space: normal !important;
    word-break: break-word !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    line-height: 1.35 !important;
    max-height: none !important;
  }

  .sports-row-subtext {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 11px !important;
  }

  /* On mobile: Hide bulky watch button so title gets 100% width! Entire card is clickable */
  .sports-row-watch-btn {
    display: none !important;
  }

  /* On mobile: Hide raw channel name & category pill to match clean Mobile App layout (shows • LIVE) */
  .sports-raw-channel,
  .sports-badge-cat {
    display: none !important;
  }

  .sports-live-indicator {
    color: var(--accent-red) !important;
    font-weight: 800 !important;
    font-size: 11.5px !important;
  }

  .epg-program-block {
    padding: 4px 8px !important;
    border-radius: 8px !important;
    margin-right: 6px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .epg-program-block-title {
    font-size: 10.5px !important;
    font-weight: 800 !important;
    color: #fff !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.2 !important;
    margin: 1px 0 !important;
    display: block !important;
    flex-shrink: 0 !important;
  }

  .epg-program-block-time {
    font-size: 8.5px !important;
    color: var(--accent-gold) !important;
  }

  /* 9. Single-Column Responsive Today's Events Grid */
  .events-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding-right: 0 !important;
    padding-bottom: 20px !important;
  }

  .event-card {
    min-height: 125px !important;
    height: auto !important;
    padding: 14px 16px !important;
    border-radius: 14px !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .event-title {
    font-size: 14px !important;
    line-height: 1.45 !important;
    margin-bottom: 12px !important;
    flex: 1 0 auto !important;
    min-height: 40px !important;
    display: block !important;
    word-break: break-word !important;
    overflow: visible !important;
  }

  /* 10. DUAL-MODE MOBILE VIDEO PLAYER (Portrait Hybrid Split-View) */
  #player-modal {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    background: #060B18 !important;
    z-index: 99999 !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  #player-modal:not(.active) {
    display: none !important;
  }

  #player-modal.active {
    display: flex !important;
  }

  .nav-btn-text {
    display: none !important;
  }

  .player-topbar {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    background: #091224 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding-top: 10px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    padding-bottom: 10px !important;
    z-index: 30 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }

  .player-title {
    font-size: 13px !important;
    max-width: 130px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .player-nav-btn {
    padding: 0 !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    font-size: 12px !important;
  }

  .player-close-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: 13px !important;
  }

  .video-container {
    width: 100% !important;
    aspect-ratio: 16/9 !important;
    height: auto !important;
    max-height: 40vh !important;
    flex: none !important;
    background: #000 !important;
    position: relative !important;
  }

  video {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }

  .player-epg-bar {
    display: flex !important;
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    box-sizing: border-box !important;
    flex-direction: column !important;
    gap: 8px !important;
    background: #0B132B !important;
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 0 !important;
    padding: 10px 12px !important;
    box-shadow: none !important;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: 10 !important;
  }

  .player-epg-header-card {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .player-epg-logo-box {
    width: 44px !important;
    height: 44px !important;
    flex-shrink: 0 !important;
    border-radius: 8px !important;
    background: rgba(0, 0, 0, 0.5) !important;
    padding: 3px !important;
  }

  .player-epg-info {
    flex: 1 !important;
    min-width: 0 !important;
  }

  .player-epg-channel-name {
    font-size: 15px !important;
    font-weight: 800 !important;
    color: #FFFFFF !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .player-epg-program-row {
    font-size: 11px !important;
    color: #CBD5E1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin-top: 2px !important;
  }

  .player-epg-next-row {
    font-size: 11px !important;
    color: #94A3B8 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin-top: 1px !important;
  }

  .player-controls-toolbar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 4px !important;
    margin-top: 2px !important;
  }

  .player-ctrl-btn {
    flex: 1 !important;
    min-width: 0 !important;
    height: 36px !important;
    padding: 0 !important;
    font-size: 13px !important;
    border-radius: 6px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #FFFFFF !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .player-ctrl-aspect {
    font-size: 11px !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px !important;
  }

  .player-volume-slider-wrap {
    width: 60px !important;
  }

  .player-portrait-drawer {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    background: #070D1D !important;
    padding: 12px 14px !important;
    gap: 10px !important;
  }
}

/* Landscape Phone Fullscreen Cinema Mode */
@media screen and (orientation: landscape) and (max-width: 1024px) {
  .sidebar {
    display: none !important;
  }
  .mobile-bottom-nav {
    display: none !important;
  }
  .main-viewport {
    padding-bottom: 0 !important;
  }
  #player-modal {
    flex-direction: row !important;
  }
  .player-portrait-drawer {
    display: none !important;
  }
  .video-container {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: none !important;
    flex: 1 !important;
  }
  .player-topbar {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 40 !important;
    background: linear-gradient(180deg, rgba(0,0,0,0.85) 0%, transparent 100%) !important;
    padding: max(8px, env(safe-area-inset-top, 8px)) 16px !important;
  }
  .player-epg-bar {
    display: flex !important;
    position: absolute !important;
    bottom: max(12px, env(safe-area-inset-bottom, 12px)) !important;
    left: max(14px, env(safe-area-inset-left, 14px)) !important;
    right: max(14px, env(safe-area-inset-right, 14px)) !important;
    width: auto !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    background: rgba(8, 14, 28, 0.90) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 12px !important;
    padding: 8px 14px !important;
    z-index: 40 !important;
  }
  .player-epg-header-card {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    flex: 1 !important;
    min-width: 0 !important;
    margin-right: 14px !important;
  }
  .player-controls-toolbar {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
    width: auto !important;
    margin-top: 0 !important;
  }
  .player-ctrl-btn {
    flex: none !important;
    min-width: 36px !important;
    height: 36px !important;
    padding: 0 10px !important;
  }
}

/* System Fullscreen API Styles (Mobile & Desktop) */
#player-modal:fullscreen,
#player-modal:-webkit-full-screen,
#player-modal.in-page-fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  background: #000 !important;
  flex-direction: row !important;
}

#player-modal:fullscreen .video-container,
#player-modal:-webkit-full-screen .video-container,
#player-modal.in-page-fullscreen .video-container,
.video-container:fullscreen,
.video-container:-webkit-full-screen {
  position: absolute !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  flex: 1 !important;
  background: #000 !important;
  z-index: 10 !important;
}

#player-modal:fullscreen video,
#player-modal:-webkit-full-screen video,
#player-modal.in-page-fullscreen video,
.video-container:fullscreen video,
.video-container:-webkit-full-screen video {
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  object-fit: contain;
}

#player-modal:fullscreen .player-topbar,
#player-modal:-webkit-full-screen .player-topbar,
#player-modal.in-page-fullscreen .player-topbar,
.video-container:fullscreen .player-topbar,
.video-container:-webkit-full-screen .player-topbar {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 40 !important;
  display: flex !important;
  background: linear-gradient(180deg, rgba(0,0,0,0.85) 0%, transparent 100%) !important;
  padding: max(12px, env(safe-area-inset-top, 24px)) 20px 12px 20px !important;
}

#player-modal:fullscreen .player-epg-bar,
#player-modal:-webkit-full-screen .player-epg-bar,
#player-modal.in-page-fullscreen .player-epg-bar,
.video-container:fullscreen .player-epg-bar,
.video-container:-webkit-full-screen .player-epg-bar {
  display: flex !important;
  position: absolute !important;
  bottom: max(16px, env(safe-area-inset-bottom, 16px)) !important;
  left: max(16px, env(safe-area-inset-left, 16px)) !important;
  right: max(16px, env(safe-area-inset-right, 16px)) !important;
  width: auto !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: rgba(8, 14, 28, 0.90) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 12px !important;
  padding: 10px 16px !important;
  z-index: 40 !important;
}

#player-modal:fullscreen .player-epg-header-card,
#player-modal:-webkit-full-screen .player-epg-header-card,
#player-modal.in-page-fullscreen .player-epg-header-card {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  flex: 1 !important;
  min-width: 0 !important;
  margin-right: 14px !important;
}

#player-modal:fullscreen .player-controls-toolbar,
#player-modal:-webkit-full-screen .player-controls-toolbar,
#player-modal.in-page-fullscreen .player-controls-toolbar {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
  width: auto !important;
  margin-top: 0 !important;
}

#player-modal:fullscreen .player-ctrl-btn,
#player-modal:-webkit-full-screen .player-ctrl-btn,
#player-modal.in-page-fullscreen .player-ctrl-btn {
  flex: none !important;
  min-width: 38px !important;
  height: 38px !important;
  padding: 0 12px !important;
}

#player-modal:fullscreen .player-portrait-drawer,
#player-modal:-webkit-full-screen .player-portrait-drawer,
#player-modal.in-page-fullscreen .player-portrait-drawer {
  display: none !important;
}

/* ==============================================================
   CONNECTION GUARD & LIMIT STYLES
============================================================== */
.conn-pill {
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.conn-pill:hover {
  background: rgba(99, 102, 241, 0.3) !important;
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 12px rgba(129, 131, 248, 0.4);
}
.conn-pill.at-limit {
  background: rgba(229, 9, 20, 0.2) !important;
  border-color: #ff5252 !important;
}
.conn-pill.at-limit i {
  color: #ff5252 !important;
}

/* Floating in-player toast banner */
.player-conn-alert {
  position: absolute;
  top: 75px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(14, 20, 36, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid #ff5252;
  border-radius: 30px;
  padding: 10px 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(229, 9, 20, 0.4);
  animation: slideDownToast 0.3s ease;
  pointer-events: none;
}

@keyframes slideDownToast {
  from { opacity: 0; transform: translate(-50%, -20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Pre-flight Connection Limit Modal */
.conn-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.conn-modal-card {
  background: #0E1528;
  border: 1.5px solid #ff5252;
  border-radius: 20px;
  padding: 32px 28px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 35px rgba(229, 9, 20, 0.25);
}

.settings-choice-card {
  max-width: 460px !important;
  border: 1px solid #1E2842 !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 25px rgba(10, 132, 255, 0.2) !important;
  text-align: left !important;
}

.settings-choice-card h3 {
  font-size: 19px !important;
  font-weight: 800 !important;
  color: #fff !important;
  margin-bottom: 16px !important;
  text-align: center;
}

.settings-choice-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}

.settings-choice-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #141B30;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
  color: #E2E8F0;
  font-size: 14.5px;
  font-weight: 600;
}

.settings-choice-row:hover, .settings-choice-row.selected {
  background: #1B2544;
  border-color: #0A84FF;
  color: #FFFFFF;
}

.settings-choice-radio {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  border: 2px solid #64748B;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.settings-choice-row.selected .settings-choice-radio {
  border-color: #0A84FF;
}

.settings-choice-row.selected .settings-choice-radio::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0A84FF;
}

.conn-modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(229, 9, 20, 0.15);
  border: 1.5px solid rgba(229, 9, 20, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff5252;
  font-size: 28px;
}

.conn-modal-card h3 {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}

.conn-modal-card p {
  font-size: 13.5px;
  color: #B0BEC5;
  line-height: 1.5;
  margin-bottom: 24px;
}

.conn-modal-btn-row {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.conn-modal-btn {
  flex: 1;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
  border: none;
}

.conn-modal-btn.secondary {
  background: #19243d;
  color: #fff;
  border: 1px solid var(--border-subtle);
}

.conn-modal-btn.secondary:hover {
  background: #243354;
  border-color: rgba(255, 255, 255, 0.3);
}

.conn-modal-btn.primary {
  background: linear-gradient(135deg, #FF5733, #B71C1C);
  color: #fff;
  box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
}

.conn-modal-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(229, 9, 20, 0.6);
}

/* ==============================================================
   TROUBLESHOOTING & SPEED TEST VIEW
============================================================== */
.troubleshoot-view {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  max-width: 980px;
  margin: 0 auto;
  width: 100%;
}

.ts-conn-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #0e1b38 0%, #091224 100%);
  border: 1.5px solid rgba(129, 131, 248, 0.35);
  border-radius: 16px;
  padding: 18px 22px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.ts-conn-card.over-limit {
  background: linear-gradient(135deg, #3B1010 0%, #1A0A0A 100%);
  border-color: #FF5733;
  box-shadow: 0 10px 30px rgba(229, 9, 20, 0.25);
}

.ts-conn-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ts-conn-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(129, 131, 248, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  font-size: 20px;
}

.ts-conn-card.over-limit .ts-conn-icon {
  background: rgba(229, 9, 20, 0.2);
  color: #ff5252;
}

.ts-status-badge {
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.ts-status-badge.healthy {
  background: #00E676;
  color: #0C0D14;
}

.ts-status-badge.over-limit {
  background: #FF5733;
  color: #fff;
}

.ts-refresh-btn {
  background: #14213D;
  border: 1px solid var(--border-subtle);
  color: var(--accent-cyan);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.2s ease;
}

.ts-refresh-btn:hover {
  background: var(--accent-blue);
  color: #fff;
  transform: rotate(90deg);
}

.ts-speed-card {
  background: #0E172C;
  border: 1.5px solid #1E2D4A;
  border-radius: 18px;
  padding: 22px 24px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.45);
}

.ts-speed-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 18px;
  margin-bottom: 20px;
}

.ts-gauge-box {
  background: #080F1E;
  border: 1.5px solid #1B2B48;
  border-radius: 14px;
  padding: 26px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.ts-speed-number {
  font-size: 52px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  font-family: 'Outfit', sans-serif;
}

.ts-speed-unit {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-top: 8px;
}

.ts-progress-bar-wrap {
  width: 80%;
  height: 6px;
  background: #1E293B;
  border-radius: 4px;
  margin-top: 14px;
  overflow: hidden;
}

.ts-progress-fill {
  height: 100%;
  background: var(--accent-cyan);
  transition: width 0.2s ease;
}

.ts-metrics-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
}

.ts-metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ts-metric-tile {
  background: #080F1E;
  border: 1.5px solid #1B2B48;
  border-radius: 12px;
  padding: 14px;
}

.ts-metric-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.ts-metric-value {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
}

.ts-verdict-box {
  background: rgba(129, 131, 248, 0.08);
  border: 1px solid rgba(129, 131, 248, 0.3);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ts-start-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  background: var(--accent-blue);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.ts-start-btn:hover {
  background: #0052cc;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
  transform: translateY(-1px);
}

.ts-start-btn.running {
  background: #FF5733;
  box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
}

.ts-start-btn.running:hover {
  background: #c60812;
}

.ts-guidance-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ts-guidance-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: #0D172B;
  border: 1.2px solid #1C2B49;
  border-radius: 14px;
  padding: 18px 20px;
}

.ts-guidance-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.ts-guidance-icon.warning {
  background: rgba(255, 145, 0, 0.15);
  color: #FF9100;
  border: 1px solid rgba(255, 145, 0, 0.3);
}

.ts-guidance-icon.info {
  background: rgba(129, 131, 248, 0.15);
  color: #8183F8;
  border: 1px solid rgba(129, 131, 248, 0.3);
}

.ts-guidance-icon.success {
  background: rgba(0, 230, 118, 0.15);
  color: #00E676;
  border: 1px solid rgba(0, 230, 118, 0.3);
}

.ts-guidance-body {
  flex: 1;
}

.ts-guidance-body h4 {
  font-size: 15.5px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.ts-quote-box {
  background: #080E1C;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  line-height: 1.45;
  margin-bottom: 8px;
}

.ts-quote-box.warning {
  border-left: 3px solid #FF9100;
}

.ts-quote-box.info {
  border-left: 3px solid #8183F8;
}

.ts-quote-box.success {
  border-left: 3px solid #00E676;
}

.ts-guidance-body p {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

@media screen and (max-width: 900px) {
  .ts-speed-grid {
    grid-template-columns: 1fr;
  }
  .ts-conn-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .ts-refresh-btn {
    align-self: flex-end;
  }
  .ts-guidance-card {
    flex-direction: column;
  }
}

/* ==============================================================
   SETTINGS & ACCOUNT MANAGEMENT VIEW
============================================================== */
.settings-view {
  max-width: 820px;
  margin: 0 auto;
  padding: 24px;
  overflow-y: auto;
  width: 100%;
}

.settings-card {
  background: #0E172C;
  border: 1.5px solid #1E2D4A;
  border-radius: 16px;
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
}

.settings-card.danger-zone {
  border-color: rgba(229, 9, 20, 0.4);
  background: linear-gradient(135deg, #1C0B12 0%, #0E172C 100%);
}

.settings-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

.settings-item {
  background: #080F1E;
  border: 1px solid #1B2B48;
  border-radius: 10px;
  padding: 12px 14px;
}

.settings-item label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.settings-val {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
}

.settings-row-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.settings-select {
  padding: 10px 14px;
  background: #080F1E;
  border: 1.5px solid #1B2B48;
  border-radius: 10px;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

.settings-action-btn {
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.settings-action-btn.secondary {
  background: #19253f;
  color: #fff;
  border: 1px solid var(--border-subtle);
}

.settings-action-btn.secondary:hover {
  background: #243559;
}

.settings-action-btn.danger {
  background: linear-gradient(135deg, #FF5733, #B71C1C);
  color: #fff;
  box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
}

.settings-action-btn.danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(229, 9, 20, 0.6);
}

/* ==============================================================
   MOBILE PORTRAIT CHANNEL & EPG DRAWER
============================================================== */
.player-portrait-drawer {
  display: none;
}

.drawer-now-card {
  background: #0D162B;
  border: 1.2px solid rgba(129, 131, 248, 0.25);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.drawer-now-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.drawer-channel-name {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
}

.drawer-time-badge {
  font-size: 11px;
  color: var(--text-muted);
}

.drawer-program-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-cyan);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-surf-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px 2px 2px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
}

.drawer-cat-badge {
  font-size: 10px;
  color: var(--accent-cyan);
  background: rgba(129, 131, 248, 0.15);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
}

.drawer-channels-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
  padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
}

.drawer-channel-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #091021;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.drawer-channel-row:active, .drawer-channel-row.active {
  background: rgba(99, 102, 241, 0.28);
  border-color: var(--accent-cyan);
}

.drawer-channel-row-logo {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.drawer-channel-row-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

@media (max-width: 600px) {
  .settings-row-option {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .settings-select {
    width: 100%;
  }
  .settings-action-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ==============================================================
   IN-PLAYER QUICK CHANNEL GUIDE SIDE DRAWER (Full-screen & Desktop)
============================================================== */
.player-quick-guide {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 320px;
  max-width: 85vw;
  background: rgba(6, 17, 37, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1.5px solid rgba(129, 131, 248, 0.35);
  box-shadow: 10px 0 35px rgba(0, 0, 0, 0.85);
  z-index: 60;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.player-quick-guide.active {
  transform: translateX(0);
  pointer-events: auto;
}

.quick-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 12px 18px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.quick-guide-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}

.quick-guide-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-guide-close-btn:hover {
  background: rgba(229, 9, 20, 0.25);
  color: #fff;
  border-color: rgba(229, 9, 20, 0.5);
}

.quick-guide-category-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-cyan);
  background: rgba(129, 131, 248, 0.15);
  padding: 5px 12px;
  margin: 10px 18px 6px 18px;
  border-radius: 6px;
  border: 1px solid rgba(129, 131, 248, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.quick-guide-channel-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 14px 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(129, 131, 248, 0.3) transparent;
}

.quick-guide-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(14, 21, 40, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.quick-guide-item:hover, .quick-guide-item:focus {
  background: rgba(99, 102, 241, 0.32);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 14px rgba(129, 131, 248, 0.4);
  outline: none;
  transform: translateX(4px);
}

.quick-guide-item.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.45) 0%, rgba(129, 131, 248, 0.25) 100%);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(129, 131, 248, 0.5);
}

.quick-guide-item-logo {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
}

.quick-guide-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quick-guide-item-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-guide-item-epg {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==============================================================
   IN-APP RESIZABLE & DRAGGABLE PICTURE-IN-PICTURE (PIP) WINDOW
============================================================== */
.pip-floating-window {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 360px;
  height: 230px;
  min-width: 240px;
  min-height: 160px;
  max-width: 90vw;
  max-height: 85vh;
  background: #000;
  border: 1.5px solid var(--accent-cyan);
  border-radius: 14px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.9), 0 0 25px rgba(129, 131, 248, 0.3);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  touch-action: none;
  transition: box-shadow 0.2s ease;
}

.pip-floating-window.dragging {
  opacity: 0.92;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 35px rgba(129, 131, 248, 0.5);
  cursor: grabbing;
}

.pip-header {
  height: 36px;
  background: rgba(6, 17, 37, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  cursor: grab;
  user-select: none;
  flex-shrink: 0;
}

.pip-header:active {
  cursor: grabbing;
}

.pip-title {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  margin-right: 8px;
}

.pip-stream-title {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pip-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pip-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.15s ease;
}

.pip-btn:hover {
  background: rgba(129, 131, 248, 0.3);
  color: var(--accent-cyan);
}

.pip-btn.close:hover {
  background: rgba(229, 9, 20, 0.3);
  color: #ff5252;
}

.pip-body {
  flex: 1;
  background: #000;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pip-body video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Resize Handles for PiP */
.pip-resize-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  z-index: 10;
}

.pip-resize-handle.nw {
  top: 0;
  left: 0;
  cursor: nw-resize;
}

.pip-resize-handle.ne {
  top: 0;
  right: 0;
  cursor: ne-resize;
}

.pip-resize-handle.sw {
  bottom: 0;
  left: 0;
  cursor: sw-resize;
}

.pip-resize-handle.se {
  bottom: 0;
  right: 0;
  cursor: se-resize;
  border-bottom: 2px solid var(--accent-cyan);
  border-right: 2px solid var(--accent-cyan);
  margin-right: 2px;
  margin-bottom: 2px;
}

/* ==============================================================
   HOME DASHBOARD 3-COLUMN WIDGETS (MATCHING ANDROID TV APP SCREENSHOT 2)
============================================================== */
.home-dashboard-row {
  display: flex;
  gap: 16px;
  align-items: stretch;
  width: 100%;
  height: 260px;
  min-height: 260px;
  flex-shrink: 0;
}

.dash-col {
  display: flex;
  flex-direction: column;
}

/* Column 1: Stacked Refresh Cards */
.dash-col-refresh {
  flex: 0 0 320px;
  width: 320px;
  min-width: 320px;
  height: 260px;
  gap: 14px;
}

.dash-action-card {
  height: 123px;
  background: #101524 !important;
  border: 1px solid #1E2842 !important;
  border-radius: 12px;
  display: flex;
  align-items: center;
  padding: 18px 22px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.dash-action-card:hover, .dash-action-card:focus {
  background: #161E34 !important;
  border-color: #2D3E68 !important;
  outline: none;
  transform: translateY(-1px);
}

.dash-action-icon-box {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 12px;
  background: #161D30;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 16px;
}

.dash-action-icon-box i {
  color: #7DD3FC;
  font-size: 18px;
}

#dash-epg-card .dash-action-icon-box i {
  color: #F5D485;
}

.dash-action-text-box {
  flex: 1;
  min-width: 0;
}

.dash-action-title {
  font-size: 16px;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-action-subtext {
  font-size: 13.5px;
  font-weight: 600;
  color: #F5D485;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-action-arrow {
  margin-left: 8px;
  font-size: 20px;
  font-weight: 700;
  color: #7DD3FC;
  flex-shrink: 0;
}

.dash-action-arrow.gold {
  color: #F5D485;
}

/* Column 2: Account Info Widget */
.dash-col-account {
  flex: 0 0 310px;
  width: 310px;
  min-width: 310px;
  height: 260px;
}

.dash-account-card {
  height: 260px;
  background: #101524 !important;
  border: 1px solid #1E2842 !important;
  border-radius: 12px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: all 0.2s ease;
}

.dash-account-card:hover {
  background: #161E34 !important;
  border-color: #2D3E68 !important;
}

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-card-header-title {
  font-size: 13px;
  font-weight: 800;
  color: #7DD3FC;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.dash-status-pill-active {
  background: rgba(46, 204, 113, 0.15);
  color: #2ECC71;
  border: 1px solid rgba(46, 204, 113, 0.35);
  border-radius: 12px;
  padding: 4px 14px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.dash-status-pill-active.expired {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.dash-account-body {
  margin-top: 4px;
}

.dash-account-user {
  font-size: 20px;
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 6px;
}

.dash-account-expiry-line {
  font-size: 14px;
  color: #8F9BB3;
}

.dash-account-expiry-line strong {
  color: #FFFFFF;
  font-weight: 700;
}

.dash-account-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 14px 0;
}

.dash-account-conns-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 700;
  color: #7DD3FC;
}

.dash-account-conns-val {
  font-weight: 700;
  color: #7DD3FC;
}

/* Column 3: Speed Test & Health Widget */
.dash-col-speed {
  flex: 1;
  min-width: 340px;
  height: 260px;
}

.dash-speed-card {
  height: 260px;
  background: #101524 !important;
  border: 1px solid #1E2842 !important;
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.dash-ping-badge {
  font-size: 14px;
  font-weight: 700;
  color: #A3E635;
}

.dash-speed-mid-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-speed-number-wrap {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.dash-speed-big-num {
  font-size: 46px;
  font-weight: 900;
  color: #10B981;
  line-height: 1;
}

.dash-speed-unit {
  font-size: 16px;
  font-weight: 700;
  color: #7DD3FC;
  margin-left: 6px;
}

.dash-run-speed-btn {
  background: #0A84FF !important;
  color: #FFFFFF !important;
  border: none;
  border-radius: 10px;
  height: 48px;
  padding: 0 28px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(10, 132, 255, 0.4) !important;
}

.dash-run-speed-btn:hover {
  background: #0077ED !important;
  transform: translateY(-1px);
}

.dash-speed-advice {
  font-size: 13.5px;
  font-weight: 600;
  color: #8F9BB3;
  line-height: 1.45;
}

.dash-speed-unit {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-muted);
}

.dash-latency-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.dash-latency-badge strong {
  color: #fff;
}

.dash-tip-card {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.dash-tip-icon {
  color: #FFB300;
  font-size: 14px;
  margin-top: 1px;
  flex-shrink: 0;
}

.dash-tip-text {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.4;
  margin: 0;
}

.dash-retest-btn {
  height: 44px;
  width: 100%;
  background: linear-gradient(135deg, #6366F1 0%, #8183F8 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  letter-spacing: 0.6px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.dash-retest-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(129, 131, 248, 0.5);
}

/* ==============================================================
   CLEAN 2-BOX EPG BADGES FOR CHANNEL BARS (MATCHING ANDROID TV APP)
============================================================== */
.channel-bar-epg-deck {
  display: flex;
  gap: 16px;
  align-items: center;
  flex: 1;
  overflow: hidden;
  height: 74px;
}

.epg-static-box {
  border-radius: 12px;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  height: 74px;
}

.epg-static-box.on-air {
  flex: 58;
  background: #140E1B;
  border: 1.2px solid rgba(255, 77, 79, 0.35);
  border-left: 4px solid #ff4d4f;
}

.epg-static-box.next {
  flex: 42;
  background: #09172E;
  border: 1.2px solid rgba(129, 131, 248, 0.25);
  border-left: 4px solid #8183F8;
}

.epg-badge-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  gap: 8px;
}

.epg-onair-tag {
  color: #ff4d4f;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.epg-next-tag {
  color: #8183F8;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.epg-box-time {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 600;
}

.epg-pct-badge {
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  font-weight: 700;
  margin-left: auto;
}

.epg-box-title {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.epg-static-progress-track {
  height: 4.5px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 5px;
}

.epg-static-progress-fill {
  height: 100%;
  background: #ff3333;
  box-shadow: 0 0 10px rgba(255, 51, 51, 0.85);
}

/* ==============================================================
   DEDICATED EPG GUIDE VIEW (TIMELINE & MINI PREVIEW)
============================================================== */
.epg-guide-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #070E1E;
}

.epg-top-deck {
  height: 345px;
  min-height: 345px;
  background: #091224;
  border-bottom: 1px solid #141C30;
  padding: 14px 18px;
  display: flex;
  gap: 16px;
  align-items: stretch;
  flex-shrink: 0;
}

/* Left Unified Hero Card (Contains On-Air 70% + Coming Next 30%) */
.epg-hero-card {
  flex: 52;
  background: #0E172C;
  border: 1px solid #1E2842;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  gap: 16px;
  align-items: stretch;
  min-width: 0;
}

/* Sub-panel A: Current Channel & On-Air Program */
.epg-meta-panel {
  flex: 74;
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.epg-card-divider {
  width: 1px;
  background: #1A2D4E;
  margin: 0 4px;
  align-self: stretch;
}

.epg-meta-logo-box {
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid #1E2842;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 4px;
}

.epg-meta-logo-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.epg-meta-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.epg-meta-badges-row {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.epg-meta-channel-name {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.epg-meta-fav-star {
  color: var(--accent-gold);
  font-size: 14px;
  margin-right: 2px;
}

.epg-meta-time-badge {
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.epg-meta-time-badge.on-air {
  color: #FF5733 !important;
}

.epg-badge-on-air {
  color: #FF5733 !important;
  font-weight: 700;
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.epg-badge-sep {
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
  margin: 0 3px;
}

.epg-badge-time {
  color: #EED699 !important; /* Exact Firestick Champagne Gold */
  font-weight: 700;
  font-size: 11.5px;
}

.epg-meta-show-title {
  font-size: 16px !important;
  font-weight: 800 !important;
  color: #EED699 !important; /* Exact Firestick Champagne Gold */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 3px;
  margin-bottom: 3px;
}

.epg-meta-synopsis {
  font-size: 13px;
  color: #8F9BB3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  margin-top: 4px;
}

.epg-meta-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.epg-meta-progress-track {
  width: 100%;
  max-width: 280px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.epg-meta-progress-fill {
  height: 100%;
  background: #6366F1 !important;
  box-shadow: none !important;
  border-radius: 2px;
}

.epg-meta-elapsed-text {
  font-size: 11px;
  font-weight: 700;
  color: #818CF8;
}

/* Sub-panel B: Compact COMING NEXT Card */
.epg-next-panel {
  flex: 26;
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 4px;
  min-width: 0;
}

.epg-next-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 2px;
}

.epg-next-tag {
  background: transparent !important;
  color: #38BDF8 !important;
  border: none !important;
  font-size: 11px;
  font-weight: 800;
  padding: 0;
  letter-spacing: 0.5px;
}

.epg-next-time {
  font-size: 11.5px !important;
  font-weight: 700 !important;
  color: #EED699 !important; /* Exact Firestick Champagne Gold */
  margin-top: 2px;
}

.epg-next-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #fff !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 2px;
  line-height: 1.3;
}

.epg-next-synopsis {
  display: none !important;
}

/* Expanded Live Video Preview Panel (16:9 Matching Firestick App) */
.epg-preview-panel {
  flex: none;
  width: 500px;
  max-width: 48%;
  height: 100%;
  aspect-ratio: 16 / 9;
  background: #000000 !important;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
}

.epg-preview-surface {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.epg-preview-surface:fullscreen,
.epg-preview-surface:-webkit-full-screen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: #000000 !important;
  z-index: 999999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.epg-preview-surface video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.epg-preview-surface:fullscreen video,
.epg-preview-surface:-webkit-full-screen video {
  width: 100vw !important;
  height: 100vh !important;
  object-fit: contain !important;
}

.epg-preview-surface:fullscreen .epg-preview-fs-exit-btn,
.epg-preview-surface:-webkit-full-screen .epg-preview-fs-exit-btn {
  display: flex !important;
  position: absolute;
  top: 24px;
  right: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 22px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000000;
  transition: all 0.2s ease;
}

.epg-preview-surface:fullscreen .epg-preview-fs-exit-btn:hover,
.epg-preview-surface:-webkit-full-screen .epg-preview-fs-exit-btn:hover {
  background: rgba(229, 9, 20, 0.9);
  transform: scale(1.08);
}

.epg-preview-idle {
  position: absolute;
  inset: 0;
  background: #000000 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 24px;
  cursor: pointer;
  overflow: hidden;
}

.epg-preview-watermark {
  display: none !important;
}

.epg-preview-play-icon {
  display: none !important;
}

.epg-preview-idle-text {
  font-size: 13px;
  font-weight: 700;
  color: #818CF8 !important;
  letter-spacing: 0.8px;
  z-index: 2;
  text-align: center;
}

.epg-preview-spinner {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--accent-cyan);
  font-size: 14px;
}

.epg-preview-live-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--accent-red);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.5px;
}

.epg-preview-banner {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.85);
  padding: 5px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  color: var(--accent-cyan);
  cursor: pointer;
  letter-spacing: 0.6px;
}

/* EPG 3-Day Quick Navigation Bar */
.epg-day-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px;
  background: #081020;
  border-bottom: 1px solid #141C30;
  gap: 10px;
  flex-shrink: 0;
  z-index: 10;
}

.epg-day-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.epg-day-chips::-webkit-scrollbar {
  display: none;
}

.epg-day-btn {
  background: #0F172A;
  border: 1px solid #1E2235;
  color: #fff;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.18s ease;
  user-select: none;
}

.epg-day-btn:hover {
  background: #172238;
  border-color: var(--accent-cyan);
}

.epg-day-btn.active {
  background: #1A3B66 !important;
  border: 2px solid var(--accent-cyan) !important;
  color: #fff !important;
  font-weight: 800 !important;
  box-shadow: 0 0 12px rgba(125, 211, 252, 0.25) !important;
}

.epg-timeline-indicator {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* Timeline Grid & Dark Scrollbars */
.epg-timeline-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: auto;
  position: relative;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #1E2842 #091022;
}

.epg-timeline-container::-webkit-scrollbar,
.epg-timeline-body::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.epg-timeline-container::-webkit-scrollbar-track,
.epg-timeline-body::-webkit-scrollbar-track {
  background: #091022;
}

.epg-timeline-container::-webkit-scrollbar-thumb,
.epg-timeline-body::-webkit-scrollbar-thumb {
  background: #1E2842;
  border-radius: 4px;
}

.epg-timeline-container::-webkit-scrollbar-thumb:hover,
.epg-timeline-body::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

.epg-timeline-header-row {
  height: 36px;
  background: #0B172E;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #1A2338;
  flex-shrink: 0;
  min-width: max-content;
  position: sticky;
  top: 0;
  z-index: 30;
}

.epg-channel-col-header {
  width: 240px;
  padding: 0 14px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--accent-cyan);
  letter-spacing: 0.8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  position: sticky;
  left: 0;
  z-index: 35;
  background: #0B172E;
  box-shadow: 3px 0 8px rgba(0, 0, 0, 0.4);
}

.epg-time-slots-header {
  flex: 1;
  display: flex;
  align-items: center;
  overflow: visible;
}

.epg-time-slot-item {
  width: 260px;
  min-width: 260px;
  padding: 0 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 700;
  color: #94A3B8;
  display: flex;
  align-items: center;
  gap: 6px;
  box-sizing: border-box;
}

.epg-time-slot-item.now {
  color: var(--accent-cyan);
  font-weight: 800;
}

.epg-time-slot-item.day-boundary {
  border-left: 2px solid var(--accent-cyan) !important;
  background: rgba(125, 211, 252, 0.06) !important;
  color: #fff !important;
  font-weight: 800 !important;
}

.epg-day-separator-tag {
  background: #141C30;
  color: var(--accent-cyan);
  border: 1px solid #23304E;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.epg-timeline-body {
  overflow: visible;
  display: block;
  min-width: max-content;
}

.epg-timeline-row {
  height: 80px;
  min-height: 80px;
  display: flex;
  align-items: center;
  border-bottom: none !important;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: max-content;
  margin-bottom: 11px;
}

.epg-timeline-row:hover,
.epg-timeline-row.active {
  background: transparent !important;
  border-left: none !important;
}

.epg-channel-cell {
  width: 220px;
  min-width: 220px;
  height: 80px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  position: sticky;
  left: 0;
  z-index: 20;
  background: #101524 !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  margin-right: 12px;
  transition: all 0.15s ease;
}

.epg-timeline-row:hover .epg-channel-cell,
.epg-timeline-row.active .epg-channel-cell {
  background: #182035 !important;
  border-color: #385185 !important;
}

.epg-channel-num {
  display: none !important;
}

.epg-channel-cell img {
  width: 44px;
  height: 44px;
  min-width: 44px;
  object-fit: contain;
  background: #161D30;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 3px;
}

.epg-channel-cell span {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #fff !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.epg-programs-track {
  flex: 1;
  display: flex;
  height: 100%;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  min-width: max-content;
}

.epg-programs-track::-webkit-scrollbar {
  display: none;
}

.epg-program-block {
  width: 220px !important;
  min-width: 220px !important;
  max-width: 220px !important;
  height: 80px !important;
  background: #101524 !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  border-radius: 12px !important;
  margin-right: 8px !important;
  padding: 8px 12px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 3px !important;
  transition: all 0.15s ease;
  cursor: pointer;
  flex-shrink: 0;
}

.epg-program-block:hover,
.epg-program-block:focus {
  background: #182035 !important;
  border-color: #385185 !important;
}

.epg-program-block.on-air {
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: #101524 !important;
  box-shadow: none !important;
}

.epg-prog-title-line {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #FFFFFF !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.epg-prog-dot {
  color: #FF5733 !important; /* Live Coral */
  font-size: 8px !important;
  flex-shrink: 0;
}

.epg-prog-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #FFFFFF !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

.epg-prog-progress-track {
  height: 3.5px !important;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin: 3px 0 2px 0 !important;
  width: 100%;
}

.epg-prog-progress-fill {
  height: 100%;
  background: #8183F8;
  border-radius: 2px;
}

.epg-prog-time-line {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  white-space: nowrap;
}

.epg-time-today {
  color: #7DD3FC !important; /* Frost Cyan matching Firestick App */
  font-weight: 700 !important;
  font-size: 11.5px !important;
}

.epg-time-tomorrow,
.epg-time-day {
  color: #EED699 !important; /* Champagne Gold matching Firestick App */
  font-weight: 700 !important;
  font-size: 11.5px !important;
}

.epg-time-sep {
  color: rgba(255, 255, 255, 0.4) !important;
  font-size: 11px !important;
  margin: 0 1px;
}

.epg-time-range {
  color: #EED699 !important; /* Exact Firestick Champagne Gold */
  font-weight: 700 !important;
  font-size: 11.5px !important;
}

/* ==============================================================
   SETTINGS SECTION (EXACT FIRESTICK PREFERENCES & SYSTEM 6-CARD LIST)
============================================================== */
.settings-section-heading {
  font-size: 18px;
  font-weight: 700;
  color: #818CF8;
  margin: 0 0 16px 0;
  letter-spacing: 0.3px;
}

.settings-cards-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 680px;
  width: 100%;
}

.settings-item-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #101524;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 10px 20px;
  min-height: 66px;
  height: 66px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.settings-item-card:hover,
.settings-item-card:focus {
  background: #182035;
  border-color: #385185;
  outline: none;
}

.settings-item-card:active {
  background: #1C2640;
  border-color: #4A6FB5;
}

.settings-item-icon-box {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 10px;
  background: #161D30;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #818CF8;
  font-size: 16px;
  flex-shrink: 0;
}

.settings-item-icon-box.logout-icon {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.25);
  color: #EF4444;
}

.settings-item-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.settings-item-title {
  font-size: 15px;
  font-weight: 700;
  color: #FFFFFF;
}

.settings-item-title.logout-text {
  color: #EF4444;
}

.settings-item-subtitle {
  font-size: 12.5px;
  font-weight: 500;
  color: #8F9BB3;
}

.settings-item-subtitle.cyan {
  color: #93A8FD;
}

.settings-item-arrow {
  color: #5B6B8A;
  font-size: 16px;
  margin-left: auto;
  font-weight: bold;
}

.settings-item-arrow.gold {
  color: #F59E0B;
}
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
}

.settings-tab-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.settings-tab-btn:hover {
  background: rgba(129, 131, 248, 0.15);
  border-color: var(--accent-cyan);
  color: #fff;
}

.settings-tab-btn.active {
  background: linear-gradient(90deg, var(--accent-blue) 0%, var(--accent-red) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 15px rgba(229, 9, 20, 0.35);
}

/* Toggle Switch */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-round {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: 0.3s;
  border-radius: 24px;
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider-round {
  background-color: var(--accent-cyan);
}

input:checked + .slider-round:before {
  transform: translateX(20px);
}

/* ==============================================================
   iOS SAFARI "ADD TO HOME SCREEN" INSTALL BANNER
============================================================== */
.ios-install-banner {
  display: none;
  position: fixed;
  bottom: 80px;
  left: 14px;
  right: 14px;
  background: rgba(14, 21, 38, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid var(--accent-cyan);
  border-radius: 14px;
  padding: 12px 14px;
  z-index: 9999;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 16px rgba(125, 211, 252, 0.25);
  animation: slideUp 0.35s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.ios-install-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ios-install-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: contain;
  background: #000;
  flex-shrink: 0;
}

.ios-install-text {
  flex: 1;
}

.ios-install-text strong {
  display: block;
  font-size: 13.5px;
  color: #fff;
  margin-bottom: 2px;
}

.ios-install-text p {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.35;
  margin: 0;
}

.ios-install-text i {
  color: var(--accent-cyan);
  margin: 0 2px;
}

.ios-install-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #94A3B8;
  font-size: 20px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ios-install-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

/* PWA Standalone Install & Fullscreen Buttons */
.install-app-nav-item {
  transition: all 0.2s ease;
  cursor: pointer;
}
.install-app-nav-item:hover, .install-app-nav-item:focus {
  background: rgba(0, 210, 255, 0.25) !important;
  border-color: #00d2ff !important;
  transform: translateY(-1px);
}
.install-pwa-top-btn {
  transition: all 0.2s ease;
}
.install-pwa-top-btn:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 16px rgba(0, 210, 255, 0.5) !important;
}
.fullscreen-toggle-btn {
  transition: all 0.2s ease;
}
.fullscreen-toggle-btn:hover {
  background: #1e2640 !important;
  color: var(--accent-cyan) !important;
  transform: scale(1.08);
}

/* ==============================================================
   TOUCH / MOUSE DRAG-SCROLL & EDGE-CLICK AUTO-PAGINATION
============================================================== */
.drag-scroll-container {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y pinch-zoom;
}
.drag-scroll-container.dragging {
  cursor: grabbing !important;
  scroll-behavior: auto !important;
}

/* ==============================================================
   EPG PROGRAM REMINDER BADGES & NOTIFICATIONS
============================================================== */
.epg-reminder-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(245, 158, 11, 0.2);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  margin-left: 6px;
}
.epg-reminder-icon {
  color: #F59E0B;
  margin-left: 6px;
  font-size: 11px;
}
.epg-prog-action-btn {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
}
.epg-prog-action-btn:hover {
  color: #F59E0B;
  background: rgba(245, 158, 11, 0.15);
}

/* ==============================================================
   VIDEO PLAYER ASPECT RATIO OVERRIDES
============================================================== */
#video-player.aspect-fit,
#player-modal #video-player.aspect-fit,
#player-modal:fullscreen #video-player.aspect-fit,
#player-modal:-webkit-full-screen #video-player.aspect-fit,
#player-modal.in-page-fullscreen #video-player.aspect-fit {
  object-fit: contain !important;
  width: 100% !important;
  height: 100% !important;
}
#video-player.aspect-16-9,
#player-modal #video-player.aspect-16-9,
#player-modal:fullscreen #video-player.aspect-16-9,
#player-modal:-webkit-full-screen #video-player.aspect-16-9,
#player-modal.in-page-fullscreen #video-player.aspect-16-9 {
  object-fit: fill !important;
  aspect-ratio: 16 / 9 !important;
  max-width: 100% !important;
  max-height: 100% !important;
  margin: auto !important;
}
#video-player.aspect-stretch,
#player-modal #video-player.aspect-stretch,
#player-modal:fullscreen #video-player.aspect-stretch,
#player-modal:-webkit-full-screen #video-player.aspect-stretch,
#player-modal.in-page-fullscreen #video-player.aspect-stretch {
  object-fit: fill !important;
  width: 100% !important;
  height: 100% !important;
}
#video-player.aspect-zoom,
#player-modal #video-player.aspect-zoom,
#player-modal:fullscreen #video-player.aspect-zoom,
#player-modal:-webkit-full-screen #video-player.aspect-zoom,
#player-modal.in-page-fullscreen #video-player.aspect-zoom {
  object-fit: cover !important;
  width: 100% !important;
  height: 100% !important;
}

/* ==============================================================
   IN-PLAYER QUICK CHANNEL GUIDE DRAWER & CATEGORY PICKER
============================================================== */
.quick-guide-cat-picker-wrap {
  padding: 10px 14px;
  background: #0B1222;
  border-bottom: 1px solid #1E2842;
  display: flex;
  align-items: center;
  gap: 8px;
}
.quick-guide-cat-select {
  flex: 1;
  background: #141C30;
  color: #FFFFFF;
  border: 1px solid #23304E;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.quick-guide-cat-select:focus, .quick-guide-cat-select:hover {
  border-color: var(--accent-cyan);
}
.quick-guide-cat-select option {
  background: #0D1527;
  color: #FFFFFF;
  padding: 6px;
}
.quick-guide-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: all 0.15s ease;
}
.quick-guide-item:hover, .quick-guide-item.active {
  background: rgba(56, 189, 248, 0.15);
  border-left: 3px solid var(--accent-cyan);
}
.quick-guide-item-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  padding: 2px;
  flex-shrink: 0;
}
.quick-guide-item-name {
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* ==============================================================
   HUD EPG BAR EXACT FIRESTICK PARITY
============================================================== */
.player-epg-bar {
  background: linear-gradient(180deg, rgba(6, 11, 24, 0.8) 0%, rgba(6, 11, 24, 0.96) 100%) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(14px) !important;
}
.player-epg-time-badge {
  color: #F5D485 !important; /* Gold */
  font-weight: 700 !important;
}
.player-epg-remaining-badge {
  color: #F5D485 !important;
  font-weight: 700 !important;
  margin-left: 8px;
}
.player-epg-next-title {
  color: #F5D485 !important; /* Champagne Gold matching Firestick app */
  font-weight: 700 !important;
}
.player-epg-progress-fill {
  background: #6366F1 !important; /* Indigo bar matching Firestick app */
}

/* ==============================================================
   IPAD & TABLET DASHBOARD RESPONSIVE OPTIMIZATION
   Strictly applies to viewport widths under 1200px (iPad Pro 11", Air, 10.2", Tablets).
   Desktop Windows Chrome at standard 1200px+ resolutions remains 100% UNTOUCHED.
============================================================== */
@media screen and (min-width: 768px) and (max-width: 1200px) {
  .home-container {
    padding: 16px 20px !important;
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .home-dashboard-row {
    gap: 12px !important;
    height: 230px !important;
    min-height: 230px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Make all 3 columns share the available width proportionally */
  .dash-col-refresh {
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
    height: 230px !important;
    gap: 10px !important;
    box-sizing: border-box !important;
  }

  .dash-action-card {
    height: 110px !important;
    padding: 12px 14px !important;
    box-sizing: border-box !important;
  }

  .dash-action-icon-box {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    margin-right: 10px !important;
  }

  .dash-action-title {
    font-size: 14.5px !important;
  }

  .dash-action-subtext {
    font-size: 12px !important;
  }

  .dash-col-account {
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
    height: 230px !important;
    box-sizing: border-box !important;
  }

  .dash-account-card {
    height: 230px !important;
    padding: 14px 16px !important;
    box-sizing: border-box !important;
  }

  .dash-account-user {
    font-size: 18px !important;
  }

  .dash-account-expiry-line {
    font-size: 12.5px !important;
  }

  .dash-account-conns-row {
    font-size: 13.5px !important;
  }

  .dash-col-speed {
    flex: 1.15 1 0 !important; /* Slightly more room for button & numbers */
    width: auto !important;
    min-width: 0 !important;
    height: 230px !important;
    box-sizing: border-box !important;
  }

  .dash-speed-card {
    height: 230px !important;
    padding: 14px 16px !important;
    box-sizing: border-box !important;
  }

  .dash-card-header-title {
    font-size: 12px !important;
  }

  .dash-ping-badge {
    font-size: 12.5px !important;
  }

  .dash-speed-big-num {
    font-size: 38px !important;
  }

  .dash-speed-unit {
    font-size: 14px !important;
  }

  .dash-run-speed-btn {
    font-size: 12px !important;
    padding: 0 16px !important;
    height: 40px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .dash-speed-advice {
    font-size: 11.5px !important;
    line-height: 1.35 !important;
  }

  /* Full edge-to-edge promo banner on iPad matching width of cards above */
  .slideshow-banner {
    width: 100% !important;
    max-width: 100% !important;
    aspect-ratio: 1376 / 384 !important;
    min-height: 175px !important;
    max-height: 235px !important;
    margin-top: 12px !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
  }

  .slideshow-banner .slide {
    background-size: cover !important;
    background-position: center !important;
    width: 100% !important;
    height: 100% !important;
  }
}

/* ==============================================================
   MOBILE PORTRAIT DEDICATED LAYOUT (STRICTLY PHONES IN PORTRAIT)
   Desktop Chrome, iPad, Tablets, and Landscape remain 100% UNTOUCHED.
============================================================== */
@media screen and (max-width: 767px) and (orientation: portrait) {

  /* --------------------------------------------------------------
     1. HOME SCREEN BLUEPRINT (Favorites -> EPG|Channels|Account -> Speed Test -> Ad Banner)
  -------------------------------------------------------------- */
  #view-home.home-container {
    padding: 8px 12px 14px 12px !important;
    gap: 8px !important;
    height: 100% !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    box-sizing: border-box !important;
  }

  /* Row 1: Favorites strip visible at top */
  #view-home .home-favorites-section {
    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important;
    width: 100% !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    padding: 7px 10px !important;
    background: #0D1323 !important;
    border: 1px solid #1E2842 !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
  }

  #view-home .home-fav-header {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 !important;
    font-size: 12.5px !important;
  }

  #view-home #favorites-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 2px 0 !important;
    min-height: 58px !important;
    scrollbar-width: none !important;
  }

  #view-home #favorites-row::-webkit-scrollbar {
    display: none !important;
  }

  #view-home #favorites-row > .fav-channel-card,
  #view-home #favorites-row > .channel-card,
  #view-home #favorites-row > .favorite-card,
  #view-home #favorites-row > div:not(.empty-favorites-box) {
    width: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
    height: 58px !important;
    padding: 5px !important;
    border-radius: 10px !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
  }

  #view-home #favorites-row > div:not(.empty-favorites-box) img {
    max-height: 36px !important;
    max-width: 56px !important;
    object-fit: contain !important;
  }

  #view-home #favorites-row .empty-favorites-box {
    width: 100% !important;
    min-height: 52px !important;
    padding: 8px 10px !important;
    flex-direction: row !important;
    gap: 10px !important;
    text-align: left !important;
  }

  #view-home #favorites-row .empty-favorites-box h4 {
    font-size: 12px !important;
    margin: 0 0 2px 0 !important;
  }

  #view-home #favorites-row .empty-favorites-box p {
    font-size: 10px !important;
    margin: 0 !important;
    line-height: 1.25 !important;
  }

  /* Row 2 (3 equal cards: EPG | Channels | Account) + Row 3 (Full-width Speed Test) */
  #view-home .home-dashboard-row {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
  }

  /* Flatten wrapper so EPG & Channels cards join Account in the 3-column row */
  #view-home .dash-col-refresh {
    display: contents !important;
  }

  #view-home #dash-epg-card {
    order: 1 !important;
    grid-column: 1 / 2 !important;
  }

  #view-home #dash-channels-card {
    order: 2 !important;
    grid-column: 2 / 3 !important;
  }

  #view-home .dash-col-account {
    order: 3 !important;
    grid-column: 3 / 4 !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 112px !important;
  }

  #view-home .dash-col-speed {
    order: 4 !important;
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
  }

  /* Compact uniform tile styling for EPG & Channels */
  #view-home #dash-epg-card,
  #view-home #dash-channels-card {
    height: 112px !important;
    min-height: 112px !important;
    padding: 10px 8px !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 6px !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
  }

  #view-home #dash-epg-card .dash-action-icon-box,
  #view-home #dash-channels-card .dash-action-icon-box {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    margin: 0 !important;
    border-radius: 10px !important;
  }

  #view-home #dash-epg-card .dash-action-icon-box i,
  #view-home #dash-channels-card .dash-action-icon-box i {
    font-size: 15px !important;
  }

  #view-home #dash-epg-card .dash-action-text-box,
  #view-home #dash-channels-card .dash-action-text-box {
    width: 100% !important;
    flex: none !important;
  }

  #view-home #dash-epg-card .dash-action-title,
  #view-home #dash-channels-card .dash-action-title {
    font-size: 11.5px !important;
    font-weight: 800 !important;
    margin-bottom: 2px !important;
    white-space: normal !important;
    line-height: 1.15 !important;
  }

  #view-home #dash-epg-card .dash-action-subtext,
  #view-home #dash-channels-card .dash-action-subtext {
    font-size: 9.5px !important;
    line-height: 1.15 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  #view-home #dash-epg-card .dash-action-arrow,
  #view-home #dash-channels-card .dash-action-arrow {
    display: none !important;
  }

  /* Compact uniform tile styling for Account (Column 3) */
  #view-home #dash-account-card {
    height: 112px !important;
    min-height: 112px !important;
    padding: 9px 8px !important;
    border-radius: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  #view-home #dash-account-card .dash-card-header {
    gap: 3px !important;
    margin-bottom: 0 !important;
    flex-wrap: nowrap !important;
  }

  #view-home #dash-account-card .dash-card-header-title {
    font-size: 7.5px !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  #view-home #dash-account-card .dash-status-pill-active {
    padding: 2px 5px !important;
    font-size: 8px !important;
    border-radius: 8px !important;
    flex-shrink: 0 !important;
  }

  #view-home #dash-account-card .dash-account-body {
    margin-top: 2px !important;
  }

  #view-home #dash-account-card .dash-account-user {
    font-size: 13px !important;
    margin-bottom: 2px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  #view-home #dash-account-card .dash-account-expiry-line {
    font-size: 9.5px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  #view-home #dash-account-card .dash-account-divider {
    margin: 4px 0 !important;
  }

  #view-home #dash-account-card .dash-account-conns-row {
    font-size: 10px !important;
    gap: 2px !important;
  }

  /* Full-width Speed Test Card (Row 3) */
  #view-home #dash-speed-card {
    height: auto !important;
    min-height: 112px !important;
    padding: 12px 14px !important;
    border-radius: 12px !important;
    gap: 8px !important;
    box-sizing: border-box !important;
  }

  #view-home #dash-speed-card .dash-card-header-title {
    font-size: 11px !important;
  }

  #view-home #dash-speed-card .dash-ping-badge {
    font-size: 11.5px !important;
  }

  #view-home #dash-speed-card .dash-speed-big-num {
    font-size: 32px !important;
  }

  #view-home #dash-speed-card .dash-speed-unit {
    font-size: 13px !important;
  }

  #view-home #dash-speed-card .dash-run-speed-btn {
    height: 36px !important;
    padding: 0 14px !important;
    font-size: 11.5px !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
  }

  #view-home #dash-speed-card .dash-speed-advice {
    font-size: 11px !important;
    line-height: 1.35 !important;
  }

  /* Row 4: Full-width Ad / Promo Banner */
  #view-home .slideshow-banner {
    width: 100% !important;
    aspect-ratio: 1376 / 384 !important;
    min-height: 108px !important;
    max-height: 155px !important;
    height: auto !important;
    flex: none !important;
    border-radius: 12px !important;
    margin: 0 !important;
  }

  #view-home .slideshow-banner .slide {
    background-size: 100% 100% !important;
    background-position: center !important;
  }

  /* --------------------------------------------------------------
     2. LIVE TV CHANNEL ROWS (Wider Name Area for Long Channel Names)
  -------------------------------------------------------------- */
  #view-content .channel-bar-item {
    padding: 10px 10px !important;
    gap: 10px !important;
    min-height: 68px !important;
    height: auto !important;
    align-items: center !important;
  }

  #view-content .channel-row-brand-col {
    flex: 0 1 50% !important;
    width: auto !important;
    min-width: 152px !important;
    max-width: 58% !important;
    gap: 8px !important;
    align-items: center !important;
  }

  #view-content .channel-row-logo-frame {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    border-radius: 8px !important;
    padding: 3px !important;
  }

  #view-content .channel-row-name {
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: break-word !important;
    color: #FFFFFF !important;
  }

  #view-content .channel-row-epg-stack {
    flex: 1 1 42% !important;
    min-width: 0 !important;
    gap: 3px !important;
  }

  #view-content .channel-row-prog-title {
    font-size: 11.5px !important;
  }

  #view-content .channel-row-next-line {
    font-size: 10px !important;
  }

  #view-content .channel-row-fav-btn {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    font-size: 13px !important;
  }

  /* --------------------------------------------------------------
     3. EPG GUIDE MENU BLUEPRINT (Left: ON AIR + COMING NEXT | Right: Bigger Preview -> Categories -> Timeline)
  -------------------------------------------------------------- */
  #view-epg {
    padding: 6px 8px 6px 8px !important;
    gap: 6px !important;
  }

  #view-epg .epg-top-deck {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
    height: 170px !important;
    min-height: 170px !important;
    max-height: 170px !important;
    padding: 0 !important;
    margin: 0 !important;
    position: relative !important;
    background: transparent !important;
  }

  /* Left Box: ON AIR & COMING NEXT details matching app colors */
  #view-epg .epg-hero-card {
    display: flex !important;
    flex-direction: column !important;
    flex: 0 0 39% !important;
    width: 39% !important;
    min-width: 0 !important;
    height: 100% !important;
    padding: 6px 8px !important;
    background: #101524 !important;
    border: 1px solid #1E2842 !important;
    border-radius: 10px !important;
    justify-content: space-between !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  #view-epg .epg-meta-panel {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    gap: 3px !important;
    padding: 0 !important;
  }

  #view-epg .epg-meta-logo-box,
  #view-epg .epg-meta-synopsis {
    display: none !important;
  }

  #view-epg .epg-meta-details {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    min-width: 0 !important;
  }

  #view-epg .epg-meta-badges-row {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 4px !important;
  }

  #view-epg .epg-meta-channel-name {
    font-size: 11.5px !important;
    font-weight: 800 !important;
    color: #FFFFFF !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
  }

  #view-epg .epg-meta-time-badge {
    font-size: 8.5px !important;
    font-weight: 800 !important;
    color: #FF5252 !important;
    white-space: normal !important;
    line-height: 1.2 !important;
  }

  #view-epg .epg-meta-show-title {
    font-size: 11.5px !important;
    font-weight: 800 !important;
    color: #F5D485 !important;
    line-height: 1.2 !important;
    margin: 1px 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }

  #view-epg .epg-meta-progress-row {
    margin: 2px 0 !important;
  }

  #view-epg .epg-meta-progress-track {
    height: 3px !important;
    width: 100% !important;
  }

  #view-epg .epg-card-divider {
    display: block !important;
    width: 100% !important;
    height: 1px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    margin: 2px 0 !important;
    flex-shrink: 0 !important;
  }

  #view-epg .epg-next-panel {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    flex: 0 0 auto !important;
    padding: 0 !important;
    gap: 1px !important;
  }

  #view-epg .epg-next-tag {
    font-size: 8.5px !important;
    font-weight: 800 !important;
    color: #38BDF8 !important;
    letter-spacing: 0.4px !important;
  }

  #view-epg .epg-next-title {
    font-size: 10.5px !important;
    font-weight: 700 !important;
    color: #FFFFFF !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  #view-epg .epg-next-time {
    font-size: 9.5px !important;
    font-weight: 700 !important;
    color: #F5D485 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Right Box: Bigger Preview Screen (fills full remaining width to right edge) */
  #view-epg .epg-preview-panel {
    display: flex !important;
    flex: 1 1 0% !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    aspect-ratio: auto !important;
    height: 100% !important;
    min-height: 170px !important;
    max-height: 170px !important;
    border-radius: 10px !important;
    border: 1.5px solid rgba(129, 131, 248, 0.4) !important;
    background: #000000 !important;
    overflow: hidden !important;
    position: relative !important;
  }

  #view-epg .epg-preview-surface,
  #view-epg #epg-preview-video {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
  }

  #view-epg #epg-preview-video {
    object-fit: contain !important;
  }

  #view-epg .epg-preview-idle-text {
    font-size: 10px !important;
    padding: 0 8px !important;
    text-align: center !important;
  }

  /* Categories directly below Top Deck */
  #view-epg #epg-category-filter-bar {
    margin: 2px 0 4px 0 !important;
    padding: 2px 0 !important;
    flex-shrink: 0 !important;
  }

  /* Mobile Portrait EPG Timeline: smooth GPU inertial scroll + readable full channel names */
  #view-epg .epg-timeline-container {
    overscroll-behavior: contain !important;
    touch-action: pan-x pan-y !important;
    -webkit-overflow-scrolling: touch !important;
  }

  #view-epg .epg-timeline-row {
    content-visibility: auto !important;
    contain-intrinsic-size: 64px !important;
    contain: layout style !important;
  }

  #view-epg .epg-channel-cell {
    width: 136px !important;
    min-width: 136px !important;
    max-width: 136px !important;
    padding: 4px 7px !important;
    gap: 6px !important;
    will-change: transform !important;
  }

  #view-epg .epg-channel-cell img {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    padding: 2px !important;
    border-radius: 6px !important;
  }

  #view-epg .epg-channel-cell span {
    font-size: 11.5px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    white-space: normal !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: break-word !important;
  }

  /* --------------------------------------------------------------
     4. PORTRAIT PLAYER: RICH EPG CARD & TOUCH CONTROLS BELOW VIDEO
        (CC & Aspect Ratio hidden; Side Channel/Category Guide active)
  -------------------------------------------------------------- */
  #player-modal:not(.in-page-fullscreen) {
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    background: #050812 !important;
    overflow: hidden !important;
  }

  #player-modal:not(.in-page-fullscreen) .player-topbar {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    background: #090E1F !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 10px 12px !important;
    flex-shrink: 0 !important;
  }

  #player-modal:not(.in-page-fullscreen) .player-topbar.hidden {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  #player-modal:not(.in-page-fullscreen) .video-container {
    width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    height: auto !important;
    max-height: 38vh !important;
    flex: none !important;
    background: #000000 !important;
    position: relative !important;
  }

  /* Docked spacious EPG + Controls Panel filling open space below video */
  #player-modal:not(.in-page-fullscreen) .player-epg-bar,
  #player-modal:not(.in-page-fullscreen) .player-epg-bar.hidden {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    flex: 1 1 auto !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
    background: linear-gradient(180deg, #080E1E 0%, #050812 100%) !important;
    border: none !important;
    border-top: 1px solid rgba(129, 131, 248, 0.25) !important;
    border-radius: 0 !important;
    padding: 16px 14px 20px 14px !important;
    gap: 16px !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
    z-index: 20 !important;
  }

  #player-modal:not(.in-page-fullscreen) .player-epg-header-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 14px !important;
    width: 100% !important;
    background: #0F162B !important;
    border: 1px solid rgba(129, 131, 248, 0.28) !important;
    border-radius: 14px !important;
    padding: 14px !important;
    box-sizing: border-box !important;
  }

  #player-modal:not(.in-page-fullscreen) .player-epg-logo-box {
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    border-radius: 12px !important;
    background: rgba(0, 0, 0, 0.55) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 5px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
  }

  #player-modal:not(.in-page-fullscreen) .player-epg-logo-box img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }

  #player-modal:not(.in-page-fullscreen) .player-epg-info {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
  }

  #player-modal:not(.in-page-fullscreen) .player-epg-channel-name {
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #FFFFFF !important;
    line-height: 1.2 !important;
    white-space: normal !important;
    overflow: visible !important;
  }

  #player-modal:not(.in-page-fullscreen) .player-epg-program-row {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 5px !important;
    white-space: normal !important;
    overflow: visible !important;
    font-size: 13.5px !important;
    line-height: 1.35 !important;
  }

  #player-modal:not(.in-page-fullscreen) .player-epg-current-title {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #FFFFFF !important;
  }

  #player-modal:not(.in-page-fullscreen) .player-epg-time-badge,
  #player-modal:not(.in-page-fullscreen) .player-epg-remaining-badge {
    font-size: 12.5px !important;
    color: #F5D485 !important;
    font-weight: 700 !important;
    margin-left: 0 !important;
  }

  #player-modal:not(.in-page-fullscreen) .player-epg-progress-wrap {
    width: 100% !important;
    max-width: 100% !important;
    height: 5px !important;
    background: rgba(255, 255, 255, 0.14) !important;
    border-radius: 4px !important;
    margin: 2px 0 4px 0 !important;
  }

  #player-modal:not(.in-page-fullscreen) .player-epg-progress-fill {
    background: #6366F1 !important;
    border-radius: 4px !important;
  }

  #player-modal:not(.in-page-fullscreen) .player-epg-next-row {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px !important;
    white-space: normal !important;
    overflow: visible !important;
    font-size: 13px !important;
    line-height: 1.3 !important;
    padding-top: 2px !important;
  }

  #player-modal:not(.in-page-fullscreen) .epg-tag-next {
    color: #38BDF8 !important;
    font-weight: 800 !important;
    font-size: 11.5px !important;
  }

  #player-modal:not(.in-page-fullscreen) .player-epg-next-title {
    color: #F5D485 !important;
    font-weight: 700 !important;
    font-size: 13px !important;
  }

  /* Spacious Touch Controls Row (Hide CC & Aspect Ratio on Mobile Portrait) */
  #player-modal:not(.in-page-fullscreen) .player-controls-toolbar {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 10px !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 4px 0 !important;
  }

  #player-modal:not(.in-page-fullscreen) #player-btn-aspect,
  #player-modal:not(.in-page-fullscreen) #player-btn-cc {
    display: none !important;
  }

  #player-modal:not(.in-page-fullscreen) .player-ctrl-btn {
    height: 50px !important;
    width: 100% !important;
    border-radius: 12px !important;
    background: #131B33 !important;
    border: 1px solid rgba(129, 131, 248, 0.28) !important;
    color: #FFFFFF !important;
    font-size: 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35) !important;
  }

  #player-modal:not(.in-page-fullscreen) #player-btn-guide {
    order: 1 !important;
  }
  #player-modal:not(.in-page-fullscreen) #player-btn-prev {
    order: 2 !important;
  }
  #player-modal:not(.in-page-fullscreen) #player-btn-playpause {
    order: 3 !important;
    background: linear-gradient(135deg, #4F46E5 0%, #6366F1 100%) !important;
    border-color: rgba(165, 180, 252, 0.5) !important;
  }
  #player-modal:not(.in-page-fullscreen) #player-btn-next {
    order: 4 !important;
  }
  #player-modal:not(.in-page-fullscreen) #player-btn-fav {
    order: 5 !important;
  }
  #player-modal:not(.in-page-fullscreen) #player-btn-fs {
    order: 6 !important;
  }

  /* Hide legacy duplicate portrait bottom drawer so controls & EPG bar own the clean space */
  #player-modal .player-portrait-drawer {
    display: none !important;
  }

  /* Side Quick Channel Guide & Category Picker overlays full phone height cleanly */
  #player-modal .player-quick-guide {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 82vw !important;
    max-width: 340px !important;
    height: 100dvh !important;
    z-index: 99999 !important;
    background: rgba(8, 13, 28, 0.97) !important;
    backdrop-filter: blur(18px) !important;
    border-right: 1px solid rgba(129, 131, 248, 0.35) !important;
    box-shadow: 12px 0 36px rgba(0, 0, 0, 0.85) !important;
  }

  /* Native Fullscreen Mode on Mobile Portrait (fills 100% edge-to-edge) */
  #player-modal:fullscreen,
  #player-modal:-webkit-full-screen,
  #player-modal.in-page-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    z-index: 99999 !important;
    background: #000000 !important;
  }

  #player-modal:fullscreen .video-container,
  #player-modal:-webkit-full-screen .video-container,
  #player-modal.in-page-fullscreen .video-container {
    width: 100vw !important;
    height: 100dvh !important;
    max-height: none !important;
    aspect-ratio: unset !important;
    flex: 1 !important;
  }

  #player-modal:fullscreen #player-btn-aspect,
  #player-modal:fullscreen #player-btn-cc,
  #player-modal:-webkit-full-screen #player-btn-aspect,
  #player-modal:-webkit-full-screen #player-btn-cc,
  #player-modal.in-page-fullscreen #player-btn-aspect,
  #player-modal.in-page-fullscreen #player-btn-cc {
    display: none !important;
  }

  .epg-preview-surface.in-page-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    z-index: 99999 !important;
    background: #000000 !important;
    border-radius: 0 !important;
  }

  .epg-preview-surface.in-page-fullscreen video {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }

  .epg-preview-surface.in-page-fullscreen .epg-preview-fs-exit-btn {
    position: fixed !important;
    top: 14px !important;
    right: 14px !important;
    z-index: 100000 !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    background: rgba(8, 13, 28, 0.82) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: #FFFFFF !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
  }
}

/* Mobile Touch GPU Performance: zero backdrop-filter blur over live video & instant half<->full snap (Desktop untouched) */
@media screen and (pointer: coarse) and (max-width: 1024px) {
  #player-modal,
  #player-modal .video-container,
  #player-modal #video-player {
    transition: none !important;
    transform: translateZ(0);
  }

  #player-modal .player-epg-bar,
  #player-modal:fullscreen .player-epg-bar,
  #player-modal:-webkit-full-screen .player-epg-bar,
  #player-modal.in-page-fullscreen .player-epg-bar,
  #player-modal .player-topbar,
  #player-modal .player-quick-guide {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(8, 12, 24, 0.92) !important;
  }
}




