body.tv-mode { overflow:hidden; }
body.tv-mode #app { display:none!important; }
#tv-space {
  --media-sidebar-background:#fff;
  --media-line:#e5e7eb;
  --media-highlight:#f3f4f6;
  --media-selected:#242832;
  --media-caption:#626a75;
  --media-brand-icon:#47505d;
  position:fixed;
  inset:0;
  z-index:100;
  display:grid;
  min-width:0;
  background:#fff;
  color:#20242b;
  font:14px/1.5 "Inter",system-ui,sans-serif;
}
#tv-space[hidden], #tv-space [hidden] { display:none!important; }
#tv-space .media-rail { background:#fff; border-color:var(--media-line); }
#tv-space .media-rail button { color:var(--media-caption); }
#tv-space .media-rail button:hover { background:var(--media-highlight); }
#tv-space .media-rail button.media-rail-server { background:#f3f4f6; color:var(--media-selected); }
#tv-space .media-rail button[aria-current], #tv-space .media-rail button.media-menu-toggle { color:var(--media-selected); }
#tv-space .media-rail button.media-menu-toggle:hover { background:transparent; }
#tv-space .media-rail-server .server-status-dot { border-color:#fff; }
#tv-space .media-sidebar::backdrop { background:#161a2338; }
#tv-space button {
  min-width:0;
  border:0;
  background:transparent;
  color:inherit;
  cursor:pointer;
  font:inherit;
}
#tv-space :focus-visible { outline:2px solid #697382; outline-offset:2px; }
#tv-space svg { width:18px; height:18px; flex:none; }
#tv-space h1, #tv-space h2, #tv-space p { margin:0; }
#tv-space .tv-content { min-width:0; overflow:auto; padding:clamp(14px,3vw,44px); }
#tv-space .tv-heading { margin-bottom:20px; }
#tv-space .tv-heading h1 { font-size:clamp(23px,3vw,36px); line-height:1.25; overflow-wrap:anywhere; }
#tv-space .tv-heading p { margin-top:6px; color:#626a75; }
#tv-space .tv-live-grid { display:grid; grid-template-columns:minmax(0,1.55fr) minmax(15rem,1fr); gap:24px; }
#tv-space .tv-live-grid > section { min-width:0; }
#tv-space .tv-player { overflow:hidden; border-radius:12px; background:#15171a; }
#tv-space video { display:block; width:100%; aspect-ratio:16/9; }
#tv-space .tv-playing { display:flex; gap:10px; flex-wrap:wrap; justify-content:space-between; align-items:center; margin-top:12px; }
#tv-space .tv-controls, #tv-space .tv-actions { display:flex; flex-wrap:wrap; align-items:end; gap:10px; margin-bottom:14px; }
#tv-space .tv-controls label, #tv-space label.tv-controls { display:grid; gap:4px; min-width:0; }
#tv-space .tv-query { flex:1 1 10rem; }
#tv-space .tv-source-control { display:grid; gap:4px; min-width:0; }
#tv-space .tv-source-trigger, #tv-space .tv-source-picker button {
  padding:7px 10px;
  border:1px solid #d0d5dc;
  border-radius:8px;
  background:white;
  text-align:left;
}
#tv-space .tv-source-picker {
  box-sizing:border-box;
  width:min(28rem, calc(100% - 24px));
  max-height:85dvh;
  padding:14px;
  border:1px solid #d0d5dc;
  border-radius:12px;
  background:#fff;
  color:#20242b;
}
#tv-space .tv-source-picker[open] { display:flex; flex-direction:column; gap:8px; }
#tv-space .tv-source-picker::backdrop { background:#161a2355; }
#tv-space .tv-picker-head { display:flex; justify-content:space-between; align-items:center; gap:8px; }
#tv-space .tv-source-options { display:grid; gap:4px; min-height:0; overflow:auto; overscroll-behavior:contain; }
#tv-space .tv-source-options button[aria-pressed="true"] { border-color:#697382; color:#242832; }
#tv-space .tv-search-group { margin:0 0 24px; }
#tv-space .tv-search-group h2 { font-size:16px; margin-bottom:8px; }
#tv-space input, #tv-space select {
  min-width:0;
  max-width:100%;
  height:36px;
  border:1px solid #d0d5dc;
  border-radius:8px;
  background:white;
  color:#20242b;
  padding:0 8px;
  font:inherit;
}
#tv-space .tv-actions > :is(button,a), #tv-space button.tv-primary {
  display:inline-flex;
  justify-content:center;
  align-items:center;
  gap:5px;
  padding:8px 12px;
  border:1px solid #d0d5dc;
  border-radius:8px;
  color:#242832;
  text-decoration:none;
}
#tv-space button.tv-primary { background:#303640; color:white; }
#tv-space .tv-actions button:disabled { opacity:.45; cursor:default; }
#tv-space .tv-actions button[aria-pressed="true"], #tv-space .tv-channel-list button[aria-pressed="true"] {
  border-color:#697382;
  color:#242832;
  font-weight:600;
}
#tv-space .tv-pager { align-items:center; margin-top:16px; }
#tv-space .tv-status { color:#626a75; margin:8px 0 14px; }
#tv-space .tv-status:empty { display:none; }
#tv-space .tv-channel-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,9rem),1fr)); gap:8px; }
#tv-space .tv-channel-list button {
  display:flex;
  align-items:center;
  gap:8px;
  min-height:52px;
  background:white;
  border:1px solid #e5e7eb;
  border-radius:8px;
  padding:7px;
  text-align:left;
  overflow-wrap:anywhere;
}
#tv-space .tv-channel-list small, #tv-space .tv-cards small { display:block; color:#626a75; }
#tv-space .tv-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,8.5rem),1fr)); gap:16px; }
#tv-space .tv-cards button { display:grid; align-content:start; padding:0; gap:4px; text-align:left; overflow-wrap:anywhere; }
#tv-space .tv-poster { position:relative; display:grid; place-items:center; aspect-ratio:2/3; background:#f3f4f6; border-radius:9px; overflow:hidden; color:#626a75; }
#tv-space .tv-poster img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
#tv-space .tv-detail-player, #tv-space .tv-description { max-width:960px; }
#tv-space .tv-episodes { margin-top:12px; }
#tv-space .tv-source-info, #tv-space .tv-description { display:grid; gap:8px; }
#tv-space .tv-source-info .tv-actions { margin-top:8px; }
@media(max-width:1100px) {
  #tv-space .tv-live-grid { grid-template-columns:minmax(0,1fr); }
}
@media(max-width:760px) {
  #tv-space .tv-cards { grid-template-columns:repeat(auto-fill,minmax(min(100%,6.5rem),1fr)); gap:10px; }
  #tv-space .tv-live-grid { gap:14px; }
}
