:root {
  --tv-bg: #07080c;
  --tv-bg-2: #10141c;
  --tv-card: #161c26;
  --tv-line: rgba(255, 255, 255, .08);
  --tv-text: #f4f7fb;
  --tv-muted: #8b95a7;
  --tv-accent: #3b9eff;
  --tv-accent-2: #1d6fd6;
  --tv-ok: #22c55e;
  --tv-focus: #7dd3fc;
  --tv-radius: 16px;
  --tv-safe-b: env(safe-area-inset-bottom, 0px);
  --tv-safe-t: env(safe-area-inset-top, 0px);
  --tv-scroll: rgba(255, 255, 255, .16);
  --tv-scroll-hover: rgba(59, 158, 255, .65);
}

/* Thin scrollbars matching the site; containers with scrollbar-width: none keep it hidden. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--tv-scroll) transparent;
}
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--tv-scroll); border-radius: 3px; }
*::-webkit-scrollbar-thumb:hover { background: var(--tv-scroll-hover); }
*::-webkit-scrollbar-corner { background: transparent; }

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  height: 100dvh;
  background: var(--tv-bg);
  color: var(--tv-text);
  font-family: "Nunito", "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
}
button, input { font-family: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }

.tv-app {
  height: 100%;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(59, 158, 255, .18), transparent 50%),
    radial-gradient(800px 400px at 100% 0%, rgba(99, 102, 241, .12), transparent 45%),
    var(--tv-bg);
}

#tvBrowse {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#tvBrowse[hidden] { display: none; }

.tv-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(10px + var(--tv-safe-t)) 16px 10px;
  border-bottom: 1px solid var(--tv-line);
  flex-shrink: 0;
}
.tv-top #tvSearchOpen { margin-left: auto; }
.tv-top .tv-brand { text-decoration: none; }
.tv-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 0;
}
.tv-brand img {
  display: block;
  height: 36px;
  width: auto;
  max-width: min(220px, 72vw);
}
/* App TapWordmark: "Tap" #1565C0 + "TV" #2196F3, ExtraBold. */
.tv-wordmark {
  display: inline-flex;
  border-radius: 6px;
  overflow: hidden;
  line-height: 1;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: .5px;
  color: #fff;
  user-select: none;
}
.tv-wordmark span { padding: 7px 10px; }
.tv-wordmark span:first-child { background: #1565c0; }
.tv-wordmark span:last-child { background: #2196f3; }
.tv-setup .tv-wordmark, .tv-paywall-card .tv-wordmark { font-size: 24px; border-radius: 8px; }
.tv-setup .tv-wordmark span, .tv-paywall-card .tv-wordmark span { padding: 10px 14px; }
body.is-tv .tv-setup .tv-wordmark { font-size: 30px; }

.tv-view { position: relative; }
.tv-view-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 170px;
  padding: 6px;
  background: var(--tv-bg-2);
  border: 1px solid var(--tv-line);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,.5);
}
.tv-view-menu[hidden] { display: none; }
.tv-view-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--tv-text);
  font-size: 15px;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 10px;
  text-align: left;
}
.tv-view-menu button i { font-size: 18px; color: var(--tv-muted); }
.tv-view-sep { height: 1px; margin: 6px 4px; background: var(--tv-line); }
.tv-view-sec {
  padding: 6px 12px 4px;
  color: var(--tv-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.tv-view-menu button.is-on { background: rgba(59,158,255,.2); }
.tv-view-menu button.is-on i { color: var(--tv-accent); }
.tv-search {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 1px solid var(--tv-line);
  background: rgba(255,255,255,.04);
  color: var(--tv-text);
  border-radius: 12px;
  padding: 0 14px 0 40px;
  font-size: 16px;
  outline: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238b95a7' viewBox='0 0 16 16'><path d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.656a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/></svg>");
  background-repeat: no-repeat;
  background-position: 14px 50%;
}
.tv-search-over {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  background: var(--tv-bg);
}
.tv-search-over[hidden] { display: none; }
.tv-search-over-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(10px + var(--tv-safe-t)) 12px 10px;
  border-bottom: 1px solid var(--tv-line);
  flex-shrink: 0;
}
.tv-search-over-body {
  flex: 1;
  overflow: auto;
  padding: 8px 12px calc(16px + var(--tv-safe-b));
}
.tv-search-hit {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: var(--tv-card);
  color: #fff;
  text-align: left;
  padding: 12px 12px;
  border-radius: 14px;
  margin-bottom: 8px;
}
.tv-search-hit b { display: block; }
.tv-search-hit span { color: var(--tv-muted); font-size: 13px; }
.tv-search:focus { border-color: var(--tv-accent); box-shadow: 0 0 0 3px rgba(59,158,255,.25); }
.tv-top .tv-wide-only { display: none; }
.tv-icon-btn {
  width: 44px; height: 44px;
  border: 1px solid var(--tv-line);
  background: rgba(255,255,255,.04);
  color: var(--tv-text);
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 18px;
}

.tv-groupbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  flex-shrink: 0;
}
.tv-groups {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 8px 12px;
  scrollbar-width: none;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
.tv-groups::-webkit-scrollbar { display: none; }
.tv-groupnav {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 1px solid var(--tv-line);
  border-radius: 50%;
  background: var(--tv-card);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 14px;
  transition: opacity .15s, background .15s;
}
.tv-groupnav:hover { background: rgba(59,158,255,.3); }
.tv-groupnav.is-off { opacity: .25; pointer-events: none; }
@media (hover: none) { .tv-groupnav { display: none; } }
body.is-tv .tv-groupnav { display: none; }
.tv-chip {
  flex: 0 0 auto;
  border: 1px solid var(--tv-line);
  background: var(--tv-card);
  color: var(--tv-text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.tv-chip.is-on, .tv-chip:focus-visible {
  background: linear-gradient(180deg, var(--tv-accent), var(--tv-accent-2));
  border-color: transparent;
  color: #fff;
}

.tv-main {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px 88px;
}
.tv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.tv-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--tv-card);
  border: 1px solid var(--tv-line);
  border-radius: var(--tv-radius);
  padding: 10px;
  text-align: left;
  color: inherit;
  min-height: 72px;
}
.tv-card.is-fav { box-shadow: inset 0 0 0 1px rgba(34,197,94,.35); }
.tv-logo {
  width: 52px; height: 52px; flex-shrink: 0;
  border-radius: 12px;
  background: transparent;
  object-fit: contain;
  display: grid; place-items: center;
  font-weight: 800; color: var(--tv-accent);
}
.tv-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.tv-meta { min-width: 0; flex: 1; }
.tv-name {
  display: block;
  font-weight: 800;
  font-size: 15px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tv-sub { color: var(--tv-muted); font-size: 12px; margin-top: 2px; }
.tv-star {
  border: 0; background: transparent; color: var(--tv-muted);
  font-size: 18px; padding: 4px;
}
.tv-star.is-on { color: #fbbf24; }

.tv-empty, .tv-boot {
  padding: 48px 16px;
  text-align: center;
  color: var(--tv-muted);
}
.tv-boot {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px;
}
.tv-boot[hidden] { display: none; }
.tv-boot .tv-wordmark { font-size: 18px; border-radius: 7px; }
.tv-boot .tv-wordmark span { padding: 7px 11px; }
.tv-boot-spin { width: 36px; height: 36px; animation: tv-spin-rot 1.4s linear infinite; }
.tv-boot-spin circle { fill: none; stroke-width: 3.5; }
.tv-boot-text { font-size: 14px; font-weight: 700; }
body.is-tv .tv-boot .tv-wordmark { font-size: 24px; }
body.is-tv .tv-boot-text { font-size: 20px; }

/* Categories: "flip" = chip strip on top (default), "list" = column (wide / TV) or full list (phone). */
.tv-body { flex: 1; min-height: 0; display: flex; }
.tv-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tv-cats { display: none; }
.tv-catback { display: none; }
body.cats-list .tv-groupbar { display: none; }
body.cats-list .tv-cats {
  display: block;
  width: 280px;
  flex-shrink: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 8px 88px 12px;
  border-right: 1px solid var(--tv-line);
  scrollbar-width: thin;
}
body.cats-list .tv-main { padding-top: 10px; }
.tv-cat {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--tv-text);
  font-size: 15px;
  font-weight: 700;
  text-align: left;
}
.tv-cat b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: inherit; }
.tv-cat span { flex-shrink: 0; color: var(--tv-muted); font-size: 13px; }
.tv-cat:hover { background: rgba(59,158,255,.12); }
.tv-cat:focus-visible { outline: 3px solid var(--tv-focus); outline-offset: -3px; }
.tv-cat.is-on { background: linear-gradient(180deg, var(--tv-accent), var(--tv-accent-2)); color: #fff; }
.tv-cat.is-on span { color: rgba(255,255,255,.8); }
.tv-catback {
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  flex-shrink: 0;
}
.tv-catback button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: var(--tv-accent);
  font-size: 15px;
  font-weight: 800;
  padding: 6px 4px;
}
.tv-catback-title { min-width: 0; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 899px) {
  body.cats-list:not(.is-tv) .tv-cats { width: 100%; border-right: 0; padding: 10px 12px 88px; }
  body.cats-list:not(.is-tv):not(.cats-open) .tv-pane { display: none; }
  body.cats-list.cats-open:not(.is-tv) .tv-cats { display: none; }
  body.cats-list.cats-open:not(.is-tv) .tv-catback { display: flex; }
  body.cats-list.cats-open:not(.is-tv) .tv-main { padding-top: 0; }
}
@media (min-width: 1100px) { body.cats-list .tv-cats { padding-bottom: 24px; } }
body.is-tv.cats-list .tv-cats { padding-bottom: 28px; }
body.is-tv .tv-cat { font-size: 17px; padding: 14px 16px; }

.tv-setup {
  align-self: center;
  width: min(460px, calc(100% - 24px));
  margin: max(24px, 8vh) auto 0;
  padding: 22px 16px 28px;
  background: rgba(16,20,28,.86);
  border: 1px solid var(--tv-line);
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(0,0,0,.45);
}
.tv-setup .tv-brand {
  display: flex;
  margin: 0 auto 14px;
}
.tv-setup .tv-brand img {
  height: 48px;
  max-width: min(260px, 100%);
}
.tv-setup-lead {
  color: var(--tv-muted);
  margin: 0 0 16px;
  text-align: center;
  font-size: 15px;
  line-height: 1.4;
}
.tv-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 2.4vw, 12px);
  width: 100%;
  margin: 0 0 16px;
}
.tv-pin input {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  max-width: 52px;
  aspect-ratio: 1;
  height: auto;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(59,158,255,.45);
  background: #0b0f16;
  color: var(--tv-text);
  font-size: clamp(18px, 5vw, 24px);
  font-weight: 800;
  text-align: center;
  caret-color: var(--tv-accent);
}
.tv-pin input:focus {
  outline: none;
  border-color: var(--tv-accent);
  box-shadow: 0 0 0 3px rgba(59,158,255,.28);
}
.tv-setup h1 { margin: 8px 0 6px; font-size: 28px; }
.tv-setup p { color: var(--tv-muted); margin: 0 0 18px; line-height: 1.45; }
.tv-setup .tv-sub { margin-top: 14px; text-align: center; }
.tv-setup .tv-sub a { color: #7dd3fc; }
.tv-btn {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--tv-accent), var(--tv-accent-2));
  color: #fff;
  font-weight: 800;
  font-size: 16px;
}
.tv-error { color: #fca5a5; min-height: 1.3em; margin: 8px 0 0; font-size: 14px; }
.tv-setup .tv-error { color: #f87171; }

.tv-player {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #000;
  color: #fff;
  display: none;
}
.tv-player.is-on { display: block; }
.tv-player video {
  width: 100%; height: 100%;
  object-fit: contain;
  background: #000;
}
.tv-osd {
  position: absolute;
  inset: 0;
  display: flex;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
  background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.72) 100%);
}
.tv-osd.is-on { opacity: 1; }
.tv-osd.is-list {
  background: linear-gradient(90deg, rgba(0,0,0,.82) 0%, rgba(0,0,0,.2) 42%, transparent 58%),
              linear-gradient(180deg, rgba(0,0,0,.45) 0%, transparent 22%, transparent 70%, rgba(0,0,0,.7) 100%);
}
.tv-osd-side {
  display: none;
  width: min(380px, 46vw);
  flex-direction: column;
  padding: calc(16px + var(--tv-safe-t)) 10px 20px 16px;
  min-height: 0;
  pointer-events: auto;
}
.tv-osd.is-list .tv-osd-side { display: flex; }
.tv-osd-catbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-bottom: 10px;
  flex-shrink: 0;
}
.tv-osd-catnav {
  flex-shrink: 0;
  width: 30px; height: 34px;
  border: 0;
  border-radius: 10px;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: opacity .15s, background .15s;
}
.tv-osd-catnav:hover { background: rgba(255,255,255,.22); }
.tv-osd-catnav.is-off { opacity: .25; pointer-events: none; }
.tv-osd-cats {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
.tv-osd-cats::-webkit-scrollbar { display: none; }
.tv-osd-cats .tv-chip {
  flex-shrink: 0;
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
}
.tv-osd-list {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 0;
  touch-action: pan-y;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.25) transparent;
}
.tv-osd-list::-webkit-scrollbar { width: 6px; }
.tv-osd-list::-webkit-scrollbar-track { background: transparent; }
.tv-osd-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border-radius: 3px; }
.tv-osd-text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.tv-osd-epg {
  display: block;
  font-size: 12px;
  line-height: 1.3;
  color: rgba(255,255,255,.62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tv-osd-epg b { color: var(--tv-accent); font-weight: 700; margin-right: 2px; }
.tv-osd-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: #fff;
  text-align: left;
  padding: 8px 10px;
  border-radius: 12px;
  margin-bottom: 4px;
}
.tv-osd-item.is-on { background: rgba(59,158,255,.28); }
.tv-osd-item .tv-logo { width: 40px; height: 40px; }
.tv-osd-foot {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(18px + var(--tv-safe-b));
  display: none;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  pointer-events: auto;
}
.tv-seek {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: 12px;
}
.tv-seek[hidden] { display: none; }
.tv-seek-t {
  flex-shrink: 0;
  min-width: 44px;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 6px #000;
}
/* App-style scrubber: rail / fill / knob are plain elements; the range input sits on top,
   invisible, and only handles mouse, touch and keys. Knob width = input thumb width (14px)
   so the drawn knob is exactly where the browser thinks the thumb is. */
.tv-seek-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 28px;
  cursor: pointer;
}
.tv-seek-rail {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(255, 255, 255, .25);
  overflow: hidden;
  transition: height .15s ease;
}
.tv-seek-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--tv-accent);
}
.tv-seek-knob {
  position: absolute;
  top: 50%;
  left: 7px;
  box-sizing: border-box;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--tv-accent);
  box-shadow: 0 1px 6px rgba(0, 0, 0, .5);
  pointer-events: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.tv-seek-wrap:hover .tv-seek-rail,
.tv-seek-wrap:focus-within .tv-seek-rail { height: 6px; }
.tv-seek-wrap:hover .tv-seek-knob,
.tv-seek-wrap:focus-within .tv-seek-knob { transform: scale(1.3); }
.tv-seek-wrap:focus-within .tv-seek-knob { box-shadow: 0 0 0 3px var(--tv-focus), 0 1px 6px rgba(0, 0, 0, .5); }
.tv-seek-wrap .tv-seek-bar {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
}
.tv-seek-wrap .tv-seek-bar::-webkit-slider-runnable-track { height: 28px; background: transparent; border: 0; }
.tv-seek-wrap .tv-seek-bar::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 28px; border: 0; }
.tv-seek-wrap .tv-seek-bar::-moz-range-track { height: 28px; background: transparent; border: 0; }
.tv-seek-wrap .tv-seek-bar::-moz-range-thumb { width: 14px; height: 28px; border: 0; border-radius: 0; background: transparent; }
.tv-osd.is-on .tv-osd-foot { display: flex; }
.tv-osd.is-list .tv-osd-foot { left: min(380px, 46vw); }
.tv-now-name { font-size: 28px; font-weight: 800; text-shadow: 0 2px 12px #000; }
.tv-now-epg { color: #fff; margin-top: 6px; font-size: 16px; font-weight: 700; text-shadow: 0 2px 10px #000; }
.tv-now-epg span { color: var(--tv-accent); margin-right: 8px; }
.tv-now-sub { color: #cbd5e1; margin-top: 4px; }
.tv-card .tv-epg { display: block; color: var(--tv-accent); font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.tv-info {
  position: fixed;
  inset: 0;
  z-index: 56;
  background: rgba(7, 11, 20, .6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 16px;
}
.tv-info[hidden] { display: none; }
.tv-info-box {
  width: min(560px, 100%);
  max-height: min(86vh, 720px);
  overflow: auto;
  background: var(--tv-bg-2);
  border: 1px solid var(--tv-line);
  border-radius: 28px;
  color: #fff;
}
.tv-info-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 8px;
}
.tv-info-title {
  font-weight: 800;
  font-size: 18px;
  line-height: 1.3;
}
.tv-info-top button {
  flex-shrink: 0;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--tv-line);
  background: rgba(255,255,255,.06);
  color: #fff;
  font-weight: 700;
}
.tv-info-top button:focus-visible {
  outline: 3px solid var(--tv-focus);
  outline-offset: 2px;
}
.tv-info-kicker {
  padding: 4px 18px 6px;
  color: var(--tv-accent);
  font-size: 13px;
  font-weight: 800;
}
.tv-info-body { padding: 0 8px 8px; }
.tv-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: calc(100% - 16px);
  margin: 2px 8px;
  padding: 10px 12px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.tv-info-row span { color: var(--tv-muted); }
.tv-info-row b { font-weight: 700; text-align: right; }
.tv-info-row:hover,
.tv-info-row:focus,
.tv-info-row:focus-visible {
  outline: none;
  background: rgba(59, 158, 255, .16);
  box-shadow: inset 0 0 0 2px var(--tv-focus);
}
.tv-info-wait { padding: 4px 18px 12px; color: var(--tv-muted); font-size: 14px; }
.tv-info-desc {
  padding: 4px 18px 18px;
  color: #fff;
  font-size: 14px;
  line-height: 1.45;
}
.tv-info-desc i {
  display: block;
  margin-bottom: 4px;
  color: var(--tv-accent);
  font-style: normal;
  font-size: 13px;
  font-weight: 800;
}
.tv-osd-tools .tv-osd-ctrl #tvInfoPlay {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}
.tv-osd-tools .tv-osd-ctrl #tvSubs {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .02em;
}
.tv-osd-tools .tv-osd-ctrl #tvSubs.is-on {
  background: var(--tv-accent);
  color: #fff;
}
#tvVideo::cue {
  background-color: rgba(0, 0, 0, .72);
  color: #fff;
}
html.theme-light .tv-info-box { color: var(--tv-text, #0f172a); }
html.theme-light .tv-info-top button { color: inherit; background: rgba(15, 23, 42, .04); }
.tv-arch {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.tv-arch[hidden] { display: none; }
.tv-arch-box {
  width: min(560px, 100%);
  max-height: min(78vh, 720px);
  background: var(--tv-bg-2);
  border: 1px solid var(--tv-line);
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.tv-arch-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--tv-line);
}
.tv-arch-title { font-weight: 800; font-size: 18px; }
.tv-arch-top button {
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--tv-line);
  background: rgba(255,255,255,.06);
  color: #fff;
  font-weight: 700;
}
.tv-arch-hours {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 16px;
}
.tv-arch-hours button {
  flex-shrink: 0;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--tv-line);
  background: rgba(255,255,255,.05);
  color: #fff;
  font-weight: 700;
}
.tv-arch-hours button.is-on { background: rgba(59,158,255,.28); border-color: var(--tv-accent); }
.tv-arch-list { overflow: auto; padding: 8px 12px 20px; }
.tv-arch-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  border: 0;
  background: transparent;
  color: #fff;
  text-align: left;
  padding: 12px 10px;
  border-radius: 12px;
}
.tv-arch-item:hover, .tv-arch-item:focus-visible { background: rgba(59,158,255,.22); }
.tv-arch-item.is-now,
.tv-arch-item.is-now:hover,
.tv-arch-item.is-now:focus-visible {
  background: var(--tv-accent);
  color: #fff;
  border-radius: 14px;
}
.tv-arch-item.is-now:focus-visible { outline: 3px solid var(--tv-focus); outline-offset: 2px; }
.tv-arch-item b { font-size: 15px; }
.tv-arch-item b em { font-style: normal; color: var(--tv-accent); font-size: 12px; margin-left: 6px; }
.tv-arch-item.is-now b,
.tv-arch-item.is-now b em,
.tv-arch-item.is-now span { color: #fff; }
.tv-arch-day {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 10px 6px;
  background: var(--tv-bg-2);
  color: var(--tv-muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: capitalize;
}
.tv-osd-tools button[hidden] { display: none; }

/* Buffering ring — app PlayStatusHint: 48dp, accent, 22% track, 3dp stroke. */
.tv-spin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  pointer-events: none;
  z-index: 2;
}
.tv-spin[hidden] { display: none; }
.tv-spin svg { width: 100%; height: 100%; animation: tv-spin-rot 1.4s linear infinite; }
.tv-spin circle { fill: none; stroke-width: 3.5; }
.tv-spin-track { stroke: rgba(59,158,255,.22); }
.tv-spin-arc {
  stroke: var(--tv-accent);
  stroke-linecap: round;
  stroke-dasharray: 1 132;
  stroke-dashoffset: 0;
  transform-origin: 24px 24px;
  animation: tv-spin-dash 1.4s ease-in-out infinite;
}
@keyframes tv-spin-rot { to { transform: rotate(360deg); } }
@keyframes tv-spin-dash {
  0% { stroke-dasharray: 1 132; stroke-dashoffset: 0; }
  50% { stroke-dasharray: 90 132; stroke-dashoffset: -30; }
  100% { stroke-dasharray: 90 132; stroke-dashoffset: -131; }
}
body.is-tv .tv-spin { width: 72px; height: 72px; margin: -36px 0 0 -36px; }
.tv-arch-item span { color: var(--tv-muted); font-size: 13px; }
.tv-osd-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}
.tv-osd-tools button {
  height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.45);
  color: #fff;
  font-weight: 700;
}
.tv-osd-tools button:hover { background: rgba(59,158,255,.3); }
.tv-osd-ctrl { display: flex; gap: 8px; }
.tv-osd-tools .tv-osd-ctrl button {
  width: 48px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 22px;
}
.tv-osd-tools .tv-osd-ctrl button[hidden] { display: none; }
.tv-osd-tools .tv-osd-ctrl button.is-main {
  width: 56px;
  font-size: 26px;
  border-color: transparent;
  background: linear-gradient(180deg, var(--tv-accent), var(--tv-accent-2));
}

.tv-sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.tv-sheet[hidden] { display: none; }
.tv-sheet-box {
  width: min(520px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  background: var(--tv-bg-2);
  border: 1px solid var(--tv-line);
  border-radius: 18px 18px 0 0;
  padding-bottom: calc(12px + var(--tv-safe-b));
}
.tv-sheet-sec {
  padding: 14px 16px 8px;
  color: var(--tv-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.tv-set-views {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 16px 6px;
}
.tv-set-views button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 4px;
  border: 1px solid var(--tv-line);
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.tv-set-views button i { font-size: 20px; color: var(--tv-muted); }
.tv-set-views button.is-on { background: rgba(59,158,255,.2); border-color: var(--tv-accent); }
.tv-set-views button.is-on i { color: var(--tv-accent); }
.tv-set-clock,
.tv-set-edge {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 0 16px 12px;
}
.tv-set-clock button,
.tv-set-edge button {
  width: auto;
  margin: 0;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 12px;
  line-height: 1.2;
  padding: 12px 4px;
}
.tv-set-edge .tv-edge-flag,
.tv-set-edge svg.tv-edge-flag {
  display: block;
  width: 22px;
  height: 16px;
  border-radius: 2px;
}
.tv-set-edge .tv-edge-name { display: block; }
.tv-set-edge .tv-edge-ping { display: block; margin-top: 2px; }
.tv-set-clock button:focus-visible,
.tv-set-edge button:focus-visible { outline: 3px solid var(--tv-focus); outline-offset: 2px; }
.tv-set-edge.is-busy button { cursor: wait; }
.tv-set-edge.is-busy button:not(.is-busy) { opacity: .55; }
.tv-set-edge button.is-busy i { animation: tv-edge-spin 1s linear infinite; }
.tv-set-edge .tv-edge-ping { color: var(--tv-muted); font-size: 11px; font-weight: 600; min-height: 13px; }
.tv-set-edge .tv-edge-ping.is-good { color: #22c55e; }
.tv-set-edge .tv-edge-ping.is-mid { color: #f59e0b; }
.tv-set-edge .tv-edge-ping.is-bad { color: #ef4444; }
.tv-set-note { padding: 2px 16px 8px; color: var(--tv-muted); font-size: 12px; }
.tv-set-note.is-ok { color: #22c55e; }
.tv-set-note.is-err { color: #ef4444; }
@keyframes tv-edge-spin { to { transform: rotate(360deg); } }

/* Player "В избранное": outline star → filled yellow star (same as the card star). */
#tvFavPlay .tv-fav-ico { display: inline-block; margin-right: 4px; }
#tvFavPlay.is-fav .tv-fav-ico { color: #fbbf24; }
#tvFavPlay .tv-fav-ico.is-pop { animation: tv-fav-pop .3s ease; }
@keyframes tv-fav-pop {
  0% { transform: scale(.6); }
  60% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* Big play mark in the centre while the user has paused (app PauseMark). */
.tv-pausemark {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  width: 96px;
  height: 96px;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .5);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .28), 0 6px 24px rgba(0, 0, 0, .45);
  color: #fff;
  font-size: 58px;
  cursor: pointer;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: tv-pm-in .2s ease;
  transition: background .15s ease, transform .15s ease;
}
.tv-pausemark[hidden] { display: none; }
.tv-pausemark i { margin-left: 6px; line-height: 1; }
.tv-pausemark:hover { background: var(--tv-accent); transform: translate(-50%, -50%) scale(1.06); }
@keyframes tv-pm-in {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.8); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
body.is-tv .tv-pausemark { width: 128px; height: 128px; font-size: 76px; }
@media (max-width: 520px) {
  .tv-pausemark { width: 72px; height: 72px; font-size: 44px; }
}

/* On-air clock over the video (Настройки → Часы на эфире). */
.tv-clock {
  position: absolute;
  z-index: 4;
  padding: 4px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .38);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .7);
  pointer-events: none;
  transition: opacity .2s ease;
}
.tv-clock[hidden] { display: none; }
.tv-clock.is-tl { top: calc(16px + var(--tv-safe-t)); left: 16px; }
.tv-clock.is-tr { top: calc(16px + var(--tv-safe-t)); right: 16px; }
.tv-clock.is-bl { bottom: calc(16px + var(--tv-safe-b)); left: 16px; }
.tv-clock.is-br { bottom: calc(16px + var(--tv-safe-b)); right: 16px; }
body.is-tv .tv-clock { font-size: 28px; padding: 6px 16px; }
body.is-tv .tv-clock.is-tl, body.is-tv .tv-clock.is-bl { left: 32px; }
body.is-tv .tv-clock.is-tr, body.is-tv .tv-clock.is-br { right: 32px; }
body.is-tv .tv-clock.is-tl, body.is-tv .tv-clock.is-tr { top: 24px; }
body.is-tv .tv-clock.is-bl, body.is-tv .tv-clock.is-br { bottom: 24px; }
/* Do not sit on top of the OSD footer (bottom) or the channel list (left). */
.tv-player:has(.tv-osd.is-on) .tv-clock.is-bl,
.tv-player:has(.tv-osd.is-on) .tv-clock.is-br,
.tv-player:has(.tv-osd.is-list) .tv-clock.is-tl { opacity: 0; }
@media (max-width: 520px) {
  .tv-clock { font-size: 18px; padding: 3px 10px; }
}

.tv-set-row {
  width: calc(100% - 32px);
  margin: 0 16px 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 0;
  border-radius: 12px;
  background: var(--tv-card);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
}
.tv-set-row i { font-size: 18px; color: var(--tv-accent); }
.tv-set-row span { margin-left: auto; color: var(--tv-muted); font-size: 13px; font-weight: 600; }
.tv-set-row:hover { background: rgba(59,158,255,.2); }
@media (min-width: 700px) {
  .tv-sheet { align-items: center; }
  .tv-sheet-box { border-radius: 18px; }
}

.tv-dock {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  justify-content: space-around;
  padding: 8px 8px calc(8px + var(--tv-safe-b));
  background: rgba(7,8,12,.92);
  border-top: 1px solid var(--tv-line);
  backdrop-filter: blur(16px);
  z-index: 20;
}
.tv-dock button {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--tv-muted);
  padding: 6px 4px;
  font-size: 11px;
  font-weight: 700;
}
.tv-dock button i { display: block; font-size: 20px; margin-bottom: 2px; }
.tv-dock button.is-on { color: var(--tv-accent); }

.tv-chno-toast {
  position: fixed;
  right: 24px;
  top: 24px;
  font-size: 56px;
  font-weight: 800;
  text-shadow: 0 4px 18px #000;
  z-index: 50;
  display: none;
}

.tv-nav:focus-visible, .tv-card:focus-visible, .tv-chip:focus-visible, .tv-icon-btn:focus-visible, .tv-osd-item:focus-visible, .tv-btn:focus-visible {
  outline: 3px solid var(--tv-focus);
  outline-offset: 2px;
}

@media (min-width: 700px) {
  .tv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .tv-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tv-dock { display: none; }
  .tv-main { padding-bottom: 24px; }
  .tv-top .tv-wide-only { display: grid; }
}
body.is-tv .tv-top .tv-wide-only { display: grid; }
body.is-tv .tv-chip, body.is-tv .tv-card, body.is-tv .tv-icon-btn, body.is-tv .tv-search {
  min-height: 52px;
}
body.is-tv .tv-card { min-height: 84px; }
body.is-tv .tv-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
body.is-tv .tv-dock { display: none; }
body.is-tv .tv-main { padding-bottom: 28px; }

/* View modes (app: Список / Плитка / Сетка / Постер). */
.tv-card { position: relative; overflow: hidden; }
.tv-grid.v-list, body.is-tv .tv-grid.v-list { grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 900px) { .tv-grid.v-list, body.is-tv .tv-grid.v-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1500px) { .tv-grid.v-list, body.is-tv .tv-grid.v-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.tv-grid.v-tile, body.is-tv .tv-grid.v-tile { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tv-grid.v-grid, body.is-tv .tv-grid.v-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.tv-grid.v-poster, body.is-tv .tv-grid.v-poster { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
@media (max-width: 420px) {
  .tv-grid.v-tile, .tv-grid.v-poster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tv-grid.v-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.v-tile .tv-card, .v-grid .tv-card, .v-poster .tv-card {
  flex-direction: column;
  justify-content: center;
  text-align: center;
  gap: 6px;
}
.v-tile .tv-card { height: 148px; min-height: 0; padding: 10px 8px; }
.v-grid .tv-card { height: 128px; min-height: 0; padding: 8px 6px; border-radius: 12px; gap: 4px; }
.v-poster .tv-card {
  aspect-ratio: .72;
  min-height: 0;
  padding: 14px 10px;
  border-radius: 18px;
  background: #0b1018;
  justify-content: flex-end;
}
.v-tile .tv-meta, .v-grid .tv-meta, .v-poster .tv-meta { width: 100%; flex: 0 0 auto; position: relative; }
.v-tile .tv-sub, .v-grid .tv-sub, .v-poster .tv-sub { display: none; }
.v-tile .tv-logo { width: 48px; height: 48px; }
.v-grid .tv-logo { width: 36px; height: 36px; border-radius: 9px; }
.v-poster .tv-logo {
  width: 96px;
  height: 96px;
  margin: auto auto 6px;
  background: transparent;
  position: relative;
  font-size: 36px;
}
.v-tile .tv-name { font-size: 13px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.v-grid .tv-name { font-size: 11px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.v-poster .tv-name { font-size: 14px; position: relative; }
.v-tile .tv-card .tv-epg { font-size: 11px; }
.v-grid .tv-card .tv-epg { font-size: 10px; }
.v-poster .tv-card .tv-epg {
  font-size: 11px;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  position: relative;
}
.v-tile .tv-star, .v-grid .tv-star, .v-poster .tv-star {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 1;
}
/* App ArchiveCornerRibbon: accent triangle in the top-right corner when the channel has catchup. */
.tv-arch-mark {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  width: 28px;
  height: 28px;
  background: var(--tv-accent);
  clip-path: polygon(28% 0, 100% 0, 100% 72%);
  pointer-events: none;
}
.v-grid .tv-arch-mark { width: 24px; height: 24px; }
body.is-tv .tv-arch-mark { width: 34px; height: 34px; }
body.is-tv .v-poster .tv-arch-mark { width: 40px; height: 40px; }
.tv-osd-item { position: relative; overflow: hidden; }
.tv-osd-item .tv-arch-mark { width: 20px; height: 20px; }
.v-grid .tv-star { font-size: 14px; }
.tv-poster-bg {
  position: absolute;
  inset: -20%;
  background-size: cover;
  background-position: center;
  filter: blur(22px) saturate(1.4);
  opacity: .55;
  pointer-events: none;
}
.v-poster .tv-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(0,0,0,.7) 100%);
  pointer-events: none;
}
.v-poster .tv-meta, .v-poster .tv-logo, .v-poster .tv-star { z-index: 1; }
body.is-tv .tv-grid.v-tile { grid-template-columns: repeat(4, minmax(0, 1fr)); }
body.is-tv .tv-grid.v-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
body.is-tv .tv-grid.v-poster { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body.is-tv .v-poster .tv-card { aspect-ratio: auto; height: 218px; }
body.is-tv .v-tile .tv-card { height: 152px; min-height: 0; }
body.is-tv .v-grid .tv-card { height: 132px; min-height: 0; }

.tv-paywall {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background:
    radial-gradient(900px 420px at 50% 0%, rgba(59,158,255,.2), transparent 55%),
    var(--tv-bg);
}
.tv-paywall[hidden] { display: none; }
.tv-paywall-card {
  width: min(440px, 100%);
  background: rgba(16,20,28,.92);
  border: 1px solid var(--tv-line);
  border-radius: 24px;
  padding: 22px 16px 26px;
  text-align: center;
}
.tv-paywall-card .tv-brand { margin: 0 auto 12px; }
.tv-paywall-video {
  display: block;
  width: 100%;
  max-height: 220px;
  margin: 0 0 14px;
  border-radius: 14px;
  background: #000;
  object-fit: contain;
}
.tv-paywall-card h1 {
  margin: 0 0 8px;
  font-size: 24px;
}
.tv-paywall-card p {
  color: var(--tv-muted);
  margin: 0 0 16px;
  line-height: 1.45;
}
.tv-paywall-card .tv-btn { text-decoration: none; display: grid; place-items: center; }
.tv-paywall-card .tv-sub a { color: #7dd3fc; }

@media (max-width: 699px) {
  .tv-setup {
    margin: max(12px, env(safe-area-inset-top)) auto 0;
    padding: 18px 12px 22px;
  }
  .tv-setup .tv-brand img { height: 40px; }
  .tv-pin { gap: 6px; }
  .tv-pin input { max-width: 48px; }
  .tv-osd.is-list .tv-osd-side {
    width: min(340px, 86vw);
    max-width: none;
    padding-right: 12px;
    background: rgba(7, 8, 12, .94);
  }
  .tv-osd.is-list .tv-osd-foot { display: none; }
  .tv-osd-foot {
    left: 12px;
    right: 12px;
    flex-direction: column;
    align-items: stretch;
  }
  .tv-now-name { font-size: 20px; }
  .tv-osd-tools { width: 100%; order: 2; }
  .tv-osd-tools button { flex: 1; height: 44px; }
  .tv-osd-ctrl { flex: 1 1 100%; }
  .tv-seek { order: 1; flex: 0 0 auto; }
  .tv-grid { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .tv-pin input { max-width: 42px; font-size: 18px; }
}
body.is-tv .tv-setup {
  width: min(560px, calc(100% - 48px));
  padding: 32px 28px 36px;
}
body.is-tv .tv-setup .tv-brand img { height: 56px; }
body.is-tv .tv-setup-lead { font-size: 20px; }
body.is-tv .tv-pin { gap: 14px; }
body.is-tv .tv-pin input {
  max-width: 72px;
  font-size: 32px;
  border-width: 3px;
}
body.is-tv .tv-btn { height: 64px; font-size: 22px; }
body.is-tv .tv-paywall-card { width: min(640px, 90vw); padding: 32px; }
body.is-tv .tv-paywall-card h1 { font-size: 32px; }

/* Light theme: browse screens only, the player stays dark over video. */
html.theme-light {
  --tv-bg: #eef2f8;
  --tv-bg-2: #ffffff;
  --tv-card: #ffffff;
  --tv-line: rgba(15, 23, 42, .1);
  --tv-text: #0f172a;
  --tv-muted: #64748b;
  --tv-focus: #1d6fd6;
  --tv-scroll: rgba(15, 23, 42, .2);
  --tv-scroll-hover: rgba(29, 111, 214, .6);
  color-scheme: light;
}
html.theme-light .tv-app {
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(59, 158, 255, .14), transparent 50%),
    radial-gradient(800px 400px at 100% 0%, rgba(99, 102, 241, .08), transparent 45%),
    var(--tv-bg);
}
html.theme-light .tv-icon-btn,
html.theme-light .tv-search,
html.theme-light .tv-set-views button,
html.theme-light .tv-arch-top button,
html.theme-light .tv-arch-hours button { background-color: rgba(15, 23, 42, .04); }
html.theme-light .tv-card { box-shadow: 0 1px 3px rgba(15, 23, 42, .06); }
html.theme-light .tv-dock { background: rgba(255, 255, 255, .94); }
html.theme-light .tv-setup,
html.theme-light .tv-paywall-card { background: rgba(255, 255, 255, .95); box-shadow: 0 24px 80px rgba(15, 23, 42, .12); }
html.theme-light .tv-pin input { background: #fff; }
html.theme-light .tv-setup .tv-sub a,
html.theme-light .tv-paywall-card .tv-sub a { color: var(--tv-accent-2); }
html.theme-light .tv-search-hit,
html.theme-light .tv-set-row,
html.theme-light .tv-set-views button,
html.theme-light .tv-arch-item,
html.theme-light .tv-arch-top button,
html.theme-light .tv-arch-hours button,
html.theme-light .tv-groupnav { color: var(--tv-text); }
html.theme-light .tv-arch-item.is-now,
html.theme-light .tv-arch-item.is-now b,
html.theme-light .tv-arch-item.is-now b em,
html.theme-light .tv-arch-item.is-now span { color: #fff; }
html.theme-light .tv-sheet,
html.theme-light .tv-arch { background: rgba(15, 23, 42, .35); }
html.theme-light .v-poster .tv-card { color: #fff; }
html.theme-light .v-poster .tv-card .tv-epg { color: #7dd3fc; }
html.theme-light .tv-osd .tv-chip:not(.is-on) {
  background: rgba(20, 24, 32, .85);
  border-color: rgba(255, 255, 255, .1);
  color: #fff;
}
