:root {
  --bg: #0b0f14; --panel: #151b24; --panel2: #1d2632; --text: #eef3f9; --muted: #8fa1b5;
  --accent: #4da3ff; --good: #54d38a; --bad: #ff6b6b; --radius: 16px;
  --nav-w: 220px; --gap: 18px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 17px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden; }
button, a, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* focus ring - the thing that makes it usable from a TV remote */
.f { outline: none; transition: transform .12s, box-shadow .12s, background .12s; }
body.kb .f:focus { box-shadow: 0 0 0 4px var(--accent), 0 8px 28px rgba(0,0,0,.5); transform: scale(1.04); z-index: 2; position: relative; }

#app { display: flex; height: 100%; }
#nav { width: var(--nav-w); padding: 28px 14px; background: #0e131a; display: flex; flex-direction: column; gap: 6px; flex: none; }
#nav h2 { margin: 0 12px 18px; font-size: 22px; letter-spacing: .3px; }
#nav button { display: flex; gap: 14px; align-items: center; padding: 14px 16px; background: transparent; border: 0; border-radius: 12px; text-align: left; font-size: 19px; color: var(--muted); }
#nav button .ic { width: 26px; text-align: center; font-size: 22px; }
#nav button.on { color: var(--text); background: var(--panel); }
#nav .clock { margin-top: auto; padding: 12px 16px; color: var(--muted); font-size: 15px; }
#view { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 28px 36px 60px; scroll-behavior: smooth; outline: none; }

h1.title { margin: 0 0 4px; font-size: 34px; }
.sub { color: var(--muted); margin: 0 0 22px; }
.row-title { margin: 26px 0 12px; font-size: 22px; display: flex; align-items: baseline; gap: 12px; }
.row-title small { color: var(--muted); font-size: 15px; font-weight: 400; }
.row { display: flex; gap: var(--gap); overflow-x: auto; padding: 10px 8px 18px; margin: 0 -8px; scrollbar-width: none; }
.row::-webkit-scrollbar { display: none; }
.grid { display: grid; gap: var(--gap); padding: 8px; margin: 0 -8px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

/* app tiles */
.tile { flex: none; width: 190px; height: 120px; border: 0; border-radius: var(--radius); display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; padding: 14px; font-weight: 700; font-size: 20px; color: #fff; text-align: left; background: var(--c, #333); position: relative; overflow: hidden; text-shadow: 0 1px 4px rgba(0,0,0,.4); }
.tile::before { content: attr(data-letter); position: absolute; top: -6px; right: 8px; font-size: 76px; opacity: .22; font-weight: 800; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 18px; }
.grid .tile { width: auto; }

/* video cards */
.card { flex: none; width: 280px; background: var(--panel); border: 0; border-radius: var(--radius); padding: 0; text-align: left; overflow: hidden; display: block; }
.grid .card { width: auto; }
.card .th { aspect-ratio: 16/9; background: #222 center/cover; display: block; }
.card .th.ph { display: flex; align-items: center; justify-content: center; font-size: 42px; background: linear-gradient(135deg, #2b3b55, #151c28); }
.card .tx { padding: 10px 12px 12px; display: block; }
.card .t { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.card .m { color: var(--muted); font-size: 14px; margin-top: 4px; display: block; }

/* buttons & chips */
button.primary, a.primary { background: var(--accent); color: #05101d; border: 0; border-radius: 12px; padding: 12px 20px; font-weight: 700; }
.chip { background: var(--panel); border: 0; border-radius: 999px; padding: 9px 16px; color: var(--muted); }
.chip.on { background: var(--accent); color: #05101d; font-weight: 700; }
.chips { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; padding: 6px 4px; }
.btn { background: var(--panel2); border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 600; }
.btn.small { padding: 7px 12px; font-size: .85em; border-radius: 9px; }
.empty { background: var(--panel); border-radius: var(--radius); padding: 22px; color: var(--muted); max-width: 640px; }
.empty b { color: var(--text); }
.empty code { background: #0b0f14; padding: 2px 6px; border-radius: 6px; color: #cfe3ff; }

/* sports fixtures */
.day { margin: 18px 0 8px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: .8em; }
.fxgrid { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.fx { background: var(--panel); border: 0; border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; text-align: left; min-width: 0; }
.row .fx { flex: none; width: 300px; }
.fx.live { background: linear-gradient(135deg, #3a1a1d, #1d2632); }
.fx.final { opacity: .8; }
.fx-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.fx-comp { color: var(--muted); font-size: .82em; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; min-width: 0; }
.fx-top { flex-wrap: wrap; }
.fx-state { display: flex; align-items: center; gap: 8px; flex: none; font-size: .88em; }
.fd { color: var(--muted); }
.fx-team { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fx-team img, .fx-team i { width: 30px; height: 30px; object-fit: contain; flex: none; }
.fx-team .n { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-team .sc { font-size: 1.35em; font-variant-numeric: tabular-nums; }
.fx-foot { color: var(--muted); font-size: .85em; min-height: 1.2em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.cd.soon { color: #ffb454; }
.badge { font-size: .72em; font-weight: 800; letter-spacing: .06em; padding: 3px 8px; border-radius: 6px; background: #2b3b4d; color: var(--text); }
.badge.live { background: var(--bad); color: #fff; animation: pulse 1.6s ease-in-out infinite; }
.badge.off { background: #5a4a1d; color: #ffd98a; }
@keyframes pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .badge.live { animation: none; } }

/* posters, search, title detail */
.muted { color: var(--muted); }
.small { font-size: .85em; }
.search { display: flex; gap: 12px; margin: 22px 0 6px; max-width: 640px; }
.search input { flex: 1; min-width: 0; padding: 13px 16px; border-radius: 12px; border: 2px solid var(--panel2); background: var(--panel); }
.poster { flex: none; width: 160px; background: none; border: 0; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.grid.posters { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.grid.posters .poster { width: auto; }
.poster .pi { aspect-ratio: 2/3; border-radius: 12px; background: var(--panel2) center/cover; position: relative; display: flex; align-items: center; justify-content: center; text-align: center; padding: 10px; overflow: hidden; }
.poster .pn { color: var(--muted); font-weight: 600; }
.poster .rate { position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,.78); color: #ffd166; font-weight: 800; font-size: .85em; padding: 3px 8px; border-radius: 8px; }
.poster .pt { font-weight: 600; font-size: .95em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.poster .pm { color: var(--muted); font-size: .85em; }
.detail { flex: 1; overflow-y: auto; background: var(--bg); }
.hero { background: var(--panel) center/cover; padding: 28px 36px 18px; }
.hin { display: flex; gap: 24px; align-items: flex-end; max-width: 1100px; margin: 0 auto; }
.hposter { width: 170px; aspect-ratio: 2/3; border-radius: 14px; background: var(--panel2) center/cover; flex: none; box-shadow: 0 8px 28px rgba(0,0,0,.5); }
.htxt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.htxt h2 { margin: 0; font-size: 2em; line-height: 1.1; }
.meta { color: var(--muted); }
.score { color: #ffd166; font-size: 1.15em; }
.cert { border: 1px solid var(--muted); border-radius: 6px; padding: 0 6px; font-size: .85em; }
.when { background: rgba(0,0,0,.45); padding: 8px 12px; border-radius: 10px; }
.ov { margin: 0; max-width: 70ch; line-height: 1.5; }
.dbody { padding: 0 36px 40px; max-width: 1172px; margin: 0 auto; }
.wbtns { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 6px 4px; }
.wbtns .primary { display: inline-flex; align-items: center; gap: 8px; }
#overlayBody .detail img { flex: none; width: 24px; height: 24px; object-fit: contain; border-radius: 5px; background: none; }
.prov { display: inline-flex; align-items: center; gap: 8px; background: var(--panel); padding: 9px 14px; border-radius: 12px; }
@media (max-width: 760px) {
  .hero { padding: 18px 16px 14px; } .hin { flex-direction: column; align-items: flex-start; } .hposter { width: 110px; }
  .htxt h2 { font-size: 1.5em; } .dbody { padding: 0 16px 30px; } .poster { width: 130px; }
}

/* services, live tv, watch progress */
.svcs { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 16px; }
.svc { background: var(--panel); border-radius: var(--radius); padding: 12px 16px; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.svc.off { opacity: .6; }
.svc .dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.svc-main { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; }
.svc-act { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.svcform { display: flex; flex-direction: column; gap: 10px; max-width: 520px; }
.svcform input, .svcform select { padding: 12px 14px; border-radius: 12px; border: 2px solid var(--panel2); background: var(--panel); }
.svcform input[type=color] { height: 46px; padding: 4px; }
.addsrc { margin: 10px 0 30px; }
.addsrc summary, .seas summary { cursor: pointer; padding: 10px 14px; border-radius: 12px; background: var(--panel); display: inline-block; }
/* tiles you can edit, logos, cast */
.pickgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-height: 46vh; overflow-y: auto; padding: 4px; }
#sheetBox .pick { padding: 12px 10px; font-size: 16px; text-align: left; }
#sheetBox .pick.on { background: var(--accent); color: #05101d; font-weight: 700; }
.tile .tn { position: relative; }
.tile.hasicon { background: var(--panel2); box-shadow: inset 0 5px 0 var(--c); }
.tile.hasicon::before { display: none; }
.tile.hasicon img { height: calc(100% - 30px); padding: 14px 14px 4px; }
.tile.hasicon .tn { font-size: .85em; text-shadow: none; }
.tile small { font-weight: 500; opacity: .75; font-size: .65em; position: relative; }
.tile.addtile { background: transparent; border: 2px dashed var(--muted); color: var(--muted); align-items: center; justify-content: center; text-shadow: none; }
.tile.addtile::before { display: none; }
.tilewrap { position: relative; flex: none; }
.grid .tilewrap { flex: initial; }
.xbtn { position: absolute; top: -8px; right: -8px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: #c0392b; color: #fff; font-weight: 800; z-index: 3; padding: 0; }
.sicon { width: 32px; height: 32px; object-fit: contain; border-radius: 6px; background: #fff; flex: none; }
.tabic { font-size: 1.4em; width: 34px; text-align: center; flex: none; }
.tabname { width: 150px; padding: 8px 10px; border-radius: 10px; border: 2px solid var(--panel2); background: var(--panel); }
.tabicon { width: 64px; text-align: center; padding: 8px 6px; border-radius: 10px; border: 2px solid var(--panel2); background: var(--panel); }
#overlayCast { padding: 10px 14px; border-radius: 10px; background: var(--panel2); border: 0; color: var(--text); flex: none; }
.addsrc summary.primary { background: var(--accent); color: #05101d; font-weight: 700; }
.chcard { position: relative; }
.row .chcard { flex: none; width: 250px; }
.ch-edit-bar { display: flex; gap: 6px; padding: 8px; background: var(--panel2); border-radius: 0 0 var(--radius) var(--radius); margin-top: -8px; }
.ch-edit-bar button { flex: 1; }
.btn.warn { background: #5a1d1d; color: #ffb4b4; }
.chcard .card { width: 100%; }
.star { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #ffd166; font-size: 1.3em; line-height: 1; padding: 0; }
.star.on { background: rgba(0,0,0,.85); }
.seas { margin: 10px 0; }
.eps { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 12px; }
.ep { display: flex; gap: 12px; align-items: center; background: var(--panel); border-radius: 12px; padding: 8px 12px; flex-wrap: wrap; }
.epn { color: var(--muted); font-weight: 700; width: 42px; flex: none; }
.ept { flex: 1 1 160px; min-width: 0; }
.epa { display: flex; gap: 8px; flex-wrap: wrap; }
.ep .btn { padding: 8px 12px; font-size: .9em; }

/* lights */
.light { background: var(--panel); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.light.on { background: linear-gradient(135deg, #3a3012, #1d2632); }
.light .top { display: flex; align-items: center; gap: 12px; }
.light .bulb { font-size: 30px; filter: grayscale(1) opacity(.5); }
.light.on .bulb { filter: none; }
.light .nm { font-weight: 700; font-size: 19px; flex: 1; }
.light .st { color: var(--muted); font-size: 14px; }
.tgl { background: var(--panel2); border: 0; border-radius: 12px; padding: 10px 18px; font-weight: 700; min-width: 76px; }
.light.on .tgl { background: #f5c451; color: #1c1500; }
.dim { display: flex; align-items: center; gap: 10px; }
.dim .btn { padding: 8px 16px; font-size: 20px; line-height: 1; }
.dim .bar { flex: 1; height: 10px; border-radius: 6px; background: #0b0f14; overflow: hidden; }
.dim .bar i { display: block; height: 100%; background: #f5c451; }

/* cameras */
.cam { background: var(--panel); border: 0; border-radius: var(--radius); padding: 0; overflow: hidden; display: block; text-align: left; }
.cam img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; background: #000; }
.cam .nm { padding: 10px 14px; font-weight: 600; display: flex; justify-content: space-between; }
.cam .live { color: var(--good); font-size: 13px; font-weight: 700; }

/* remote */
.remote { max-width: 420px; margin: 0 auto; }
.seg { display: flex; background: var(--panel); border-radius: 14px; padding: 4px; margin-bottom: 22px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 12px; border-radius: 10px; color: var(--muted); font-weight: 600; }
.seg button.on { background: var(--accent); color: #05101d; }
.dpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 10px 0 22px; }
.dpad button, .rbtns button { height: 78px; border: 0; border-radius: 18px; background: var(--panel2); font-size: 28px; }
.dpad .ok { background: var(--accent); color: #05101d; font-weight: 800; font-size: 22px; }
.rbtns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.rbtns button { height: 64px; font-size: 20px; }
.rbtns span { display: block; font-size: 12px; color: var(--muted); }
.tvmode { margin-top: 30px; color: var(--muted); font-size: 15px; background: var(--panel); border-radius: var(--radius); padding: 16px; }

/* overlay player */
#overlay { position: fixed; inset: 0; background: #000; z-index: 50; display: flex; flex-direction: column; }
#overlayBar { display: flex; gap: 16px; align-items: center; padding: 12px 16px; background: #0b0f14; }
#overlayTitle { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#overlayLink { color: var(--muted); padding: 10px 14px; border-radius: 10px; }
#overlayBody { flex: 1; min-height: 0; display: flex; }
#overlayBody iframe, #overlayBody video, #overlayBody img { flex: 1; width: 100%; height: 100%; border: 0; background: #000; object-fit: contain; }

/* sheet (choose where to open an app) */
#sheet { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
#sheetBox { background: var(--panel); width: min(480px, 100%); border-radius: 22px 22px 0 0; padding: 22px; display: flex; flex-direction: column; gap: 12px; }
#sheetBox h3 { margin: 0 0 6px; }
#sheetBox button { padding: 16px; font-size: 18px; border: 0; border-radius: 14px; background: var(--panel2); }
#sheetBox button.primary { background: var(--accent); color: #05101d; font-weight: 700; }

#toast { position: fixed; left: 50%; bottom: 36px; transform: translate(-50%, 20px); background: #fff; color: #0b0f14; padding: 12px 20px; border-radius: 999px; font-weight: 600; opacity: 0; pointer-events: none; transition: .25s; z-index: 99; max-width: 90vw; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

#login { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--bg); z-index: 100; }
#loginForm { display: flex; flex-direction: column; gap: 14px; width: min(340px, 90vw); text-align: center; }
#loginForm input { padding: 16px; border-radius: 12px; border: 2px solid var(--panel2); background: var(--panel); text-align: center; font-size: 24px; letter-spacing: 6px; }
.err { color: var(--bad); min-height: 1.3em; margin: 0; }

/* ---------- phones: bottom tab bar ---------- */
@media (max-width: 760px) {
  html, body { font-size: 16px; }
  #app { flex-direction: column-reverse; }
  #nav { width: 100%; flex-direction: row; padding: 4px 4px max(4px, env(safe-area-inset-bottom)); gap: 0; justify-content: space-around; }
  #nav { overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
  #nav h2, #nav .clock { display: none; }
  #nav button { flex-direction: column; gap: 2px; padding: 8px 6px; font-size: 11px; flex: 0 0 auto; min-width: 66px; align-items: center; justify-content: center; }
  #nav button .ic { font-size: 22px; }
  #view { padding: 18px 16px 24px; }
  h1.title { font-size: 26px; }
  .tile { width: 140px; height: 92px; font-size: 16px; }
  .card { width: 230px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .grid.fxgrid { grid-template-columns: 1fr; }
  .row .fx { width: 270px; }
  body.kb .f:focus { transform: none; }
}
/* big TVs: scale everything up */
@media (min-width: 1700px) { html, body { font-size: 22px; } :root { --nav-w: 280px; } .tile { width: 250px; height: 150px; } .card { width: 360px; } }

/* Android phone tab */
.and-wrap { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.and-screenbox { flex: none; max-width: 100%; }
.and-screen { display: block; height: 74vh; max-height: 900px; width: auto; max-width: 100%; object-fit: contain; border-radius: 22px; background: #000; border: 6px solid #222; touch-action: none; cursor: pointer; user-select: none; }
.and-side { flex: 1; min-width: 260px; }
.and-keys, .and-apps { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.and-pad { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 12px 0; width: max-content; }
.and-pad > div { display: flex; gap: 6px; }
.and-pad .f { min-width: 64px; }
.and-note { margin-top: 14px; font-size: 0.85em; }
@media (max-width: 700px) { .and-screen { height: auto; width: 100%; } }


/* ---------- TV 10-foot screen mode (/tv) ---------- */
body.tv-mode { font-size: 20px; --nav-w: 260px; --gap: 24px; }
body.tv-mode #nav { padding: 34px 18px; gap: 10px; border-right: 1px solid rgba(255,255,255,.06); }
body.tv-mode #nav h2 { font-size: 26px; margin-bottom: 22px; }
body.tv-mode #nav button { padding: 16px 20px; font-size: 21px; border-radius: 14px; }
body.tv-mode #view { padding: 34px 48px 80px; scroll-padding: 60px; }
body.tv-mode h1.title { font-size: 40px; }
body.tv-mode .row-title { font-size: 25px; margin: 32px 0 14px; }
body.tv-mode .row { padding: 14px 12px 24px; margin: 0 -12px; scroll-snap-type: x proximity; }
body.tv-mode .row > * { scroll-snap-align: start; }
body.tv-mode .tile { width: 235px; height: 142px; font-size: 22px; border-radius: 18px; }
body.tv-mode .card { width: 330px; border-radius: 18px; }
body.tv-mode .poster { width: 195px; }
body.tv-mode .row .fx { width: 350px; }
body.tv-mode .row .chcard { width: 290px; }
body.tv-mode .chip { padding: 11px 20px; font-size: 18px; }
body.tv-mode .btn, body.tv-mode button.primary { padding: 14px 24px; font-size: 19px; }
body.tv-mode .f:focus { box-shadow: 0 0 0 5px var(--accent), 0 12px 34px rgba(0,0,0,.75); transform: scale(1.06); }
body.tv-mode .tv-hide { display: none !important; }

/* Sports channels: "on now" line and the channel guide panel */
.np { display: block; font-size: 12px; margin-top: 2px; opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np:empty { display: none; }
#sheetBox .gnow { text-align: left; margin: 10px 0 4px; }
#sheetBox .gscroll { max-height: 46vh; overflow-y: auto; text-align: left; margin: 8px 0; padding-right: 4px; }
#sheetBox .gi { display: flex; gap: 12px; padding: 5px 0; border-bottom: 1px solid rgba(128,128,128,.2); }
#sheetBox .gi.on { font-weight: 600; }
#sheetBox .gt { flex: 0 0 76px; opacity: .8; font-variant-numeric: tabular-nums; }
#sheetBox .gn { min-width: 0; overflow-wrap: anywhere; }

/* ---------- phones: compact sizes (loaded last so it wins) ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (max-width: 760px) {
  html, body { font-size: 14px; line-height: 1.3; }
  #view { padding: 14px 14px 20px; }
  h1.title { font-size: 21px; }
  .sub { font-size: 13px; margin: 0 0 12px; }
  .row-title { font-size: 16px; margin: 16px 0 8px; gap: 8px; flex-wrap: wrap; align-items: center; }
  .row-title small { font-size: 12px; }
  .row-title .chip, .row-title .btn, .row-title .badge { font-size: 12px; }
  .chip { padding: 6px 11px; font-size: 13px; }
  .chips { gap: 6px; margin: 0 0 10px; padding: 2px 0; }
  .btn { padding: 9px 13px; font-size: 14px; }
  button.primary, a.primary { padding: 10px 16px; font-size: 14px; }
  .tile { width: 112px; height: 72px; font-size: 13px; padding: 9px; border-radius: 12px; }
  .tile::before { font-size: 48px; top: -4px; right: 6px; }
  .row { gap: 10px; padding: 6px 6px 12px; margin: 0 -6px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .card { width: 176px; border-radius: 12px; }
  .card .t { font-size: 13px; min-height: 2.6em; }
  .card .m { font-size: 11.5px; }
  .card .tx { padding: 8px 10px 10px; }
  .card .th.ph { font-size: 30px; }
  .poster { width: 112px; }
  .row .fx { width: 240px; }
  .empty { padding: 14px; font-size: 13px; }
  .day { margin: 12px 0 6px; font-size: .75em; }
  #nav button { font-size: 10px; min-width: 56px; padding: 6px 4px; }
  #nav button .ic { font-size: 19px; }
  #sheetBox button { padding: 12px; font-size: 15px; }
  .star { width: 34px; height: 34px; top: 6px; right: 6px; }
}

/* Channel browser: scrolling chip rows, search, health marks */
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chips.scroll .chip { flex: none; white-space: nowrap; }
.chip small { opacity: .7; margin-left: 3px; font-size: .85em; }
.cbtools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 10px; }
.cbq { flex: 1 1 180px; min-width: 0; padding: 9px 12px; border-radius: 12px; border: 2px solid var(--panel2); background: var(--panel); color: var(--text); }
.hs { display: block; font-size: 11.5px; margin-top: 2px; }
.hs:empty { display: none; }
.hs.ok { color: var(--good); }
.hs.bad { color: var(--bad); }
.chcard.hidebad { display: none; }
#sheetBox .warnline { color: var(--bad); font-size: .9em; }
.hs.idle { color: var(--muted); }
@media (max-width: 760px) {
  .chcard .th { aspect-ratio: 2.6 / 1; background-size: contain; }
  .chcard .card .tx { padding: 7px 9px 9px; }
  .chcard .card .t { min-height: 2.5em; }
  .hs, .np { font-size: 11px; }
}

/* Sports guide: event cards */
.ev { background: var(--panel); border-radius: 14px; padding: 12px 14px; margin: 0 0 10px; display: grid; gap: 6px; }
.ev.now { background: linear-gradient(135deg, #2a1c22, var(--panel) 70%); box-shadow: inset 3px 0 0 var(--bad); }
.ev-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: .85em; }
.ev-when { font-variant-numeric: tabular-nums; }
.ev-sport { margin-left: auto; text-transform: uppercase; letter-spacing: .05em; font-size: .8em; }
.ev-title { font-weight: 700; font-size: 1.05em; line-height: 1.25; overflow-wrap: anywhere; }
.ev-desc { color: var(--muted); font-size: .85em; }
.ev-opts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 2px; }
.chip.opt { font-size: .9em; padding: 7px 12px; }
.chip.opt.feed { background: #1d3a5c; color: #fff; }
.chip.opt.app { background: #2b3b2b; color: #dff5df; }
.chip.opt.off { background: transparent; border: 1px dashed var(--panel2); color: var(--muted); }
.badge.on { background: #2b4a3a; }
details.fxwrap { margin: 18px 0 8px; background: var(--panel); border-radius: 14px; padding: 4px 14px 10px; }
details.fxwrap > summary { padding: 10px 0; font-weight: 600; cursor: pointer; list-style: none; }
details.fxwrap > summary::-webkit-details-marker { display: none; }
details.fxwrap > summary::after { content: ' \25BE'; color: var(--muted); }
@media (max-width: 760px) { .ev { padding: 10px 12px; } .chip.opt { font-size: 13px; padding: 6px 10px; } }
.ev-go { width: 100%; padding: 14px 16px; font-size: 1.02em; text-align: left; border-radius: 12px; margin-top: 4px; }
.ev-go small { opacity: .75; font-weight: 500; }
.ev-or { color: var(--muted); font-size: .8em; align-self: center; }

/* Home: sports run sideways like the other rows, so more categories fit on one screen */
.row.evrow { align-items: stretch; }
.evrow .ev { flex: none; width: 300px; margin: 0; align-content: start; }
.evrow .ev-desc { display: none; }
.evrow .ev-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 1em; }
.evrow .ev-go { padding: 11px 14px; }
@media (max-width: 760px) { .evrow .ev { width: 272px; } }
.evrow .ev { gap: 5px; padding: 10px 12px; }
.evrow .ev-opts { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-top: 0; padding-bottom: 2px; }
.evrow .ev-opts::-webkit-scrollbar { display: none; }
.evrow .ev-or { display: none; }
.evrow .chip.opt { flex: none; white-space: nowrap; font-size: 12.5px; padding: 6px 10px; }
.evrow .ev-go { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .95em; padding: 10px 12px; }
.evrow .ev-top { font-size: .8em; }

/* =====================================================================================================================
   Design system v2 (loaded last so it wins). One accent colour, red only for LIVE, one type scale, one card style,
   section headers that are a title and a quiet "See all" link, rows that swipe sideways.
   ===================================================================================================================== */
:root {
  --bg: #0a0d12; --panel: #11161d; --panel2: #19202a; --line: rgba(255,255,255,.07); --line2: rgba(255,255,255,.14);
  --text: #f2f5f9; --muted: #8b98a9; --accent: #4f9dff; --accent-ink: #04101f; --live: #ff5a64; --good: #43d199; --bad: #ff6b6b;
  --radius: 14px; --gap: 12px;
}
html, body { background: var(--bg); font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
#nav { background: #0c1016; }
h1.title { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 2px 0 4px; }
.sub { color: var(--muted); font-size: 13.5px; }
.note { color: var(--muted); font-size: 13px; margin: 24px 0 8px; }

/* section headers: a title, a quiet note, and a link on the right */
.sec-h, .row-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 28px 0 10px; }
.sec-h h2 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.row-title { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.sec-sub, .row-title small { color: var(--muted); font-size: 13px; font-weight: 400; }
.sec-actions { display: flex; gap: 14px; margin-left: auto; }
.sec-h > .link { margin-left: auto; }
.link, .sec-h .chip, .row-title .chip { background: none !important; border: 0 !important; padding: 0 !important; color: var(--accent) !important; font-size: 13px; font-weight: 600; box-shadow: none; }
.row-title .chip { margin-left: auto; }

/* rows swipe sideways and snap */
.row { display: flex; gap: 10px; overflow-x: auto; padding: 2px 16px 8px; margin: 0 -16px; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.row::-webkit-scrollbar { display: none; }
.row > * { scroll-snap-align: start; }
@media (min-width: 761px) { .row { padding-left: 8px; padding-right: 8px; margin: 0 -8px; } }

/* chips: neutral, accent only when selected */
.chip { background: var(--panel2); border: 1px solid var(--line); color: rgba(242,245,249,.88); border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 500; line-height: 1.2; }
.chip small { opacity: .6; margin-left: 3px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 650; }
.chip.on small { opacity: .75; }
.chips { gap: 8px; margin: 0 0 12px; padding: 0; }
.chips.scroll { margin-left: -16px; margin-right: -16px; padding: 0 16px 4px; }

.btn { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 16px; font-weight: 600; font-size: 14px; }
button.primary, a.primary { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 12px; font-weight: 650; padding: 12px 18px; }
.empty { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; font-size: 13.5px; }

/* app tiles: calm dark cards with a small coloured mark instead of big coloured blocks */
.tile { width: 112px; height: 86px; padding: 11px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); color: var(--text); text-shadow: none; justify-content: flex-end; font-size: 13px; font-weight: 600; line-height: 1.2; }
.tile::before { content: attr(data-letter); position: absolute; top: 11px; left: 11px; right: auto; width: 28px; height: 28px; border-radius: 8px; background: var(--c); color: #fff; opacity: 1; font-size: 14px; font-weight: 700; display: grid; place-items: center; }
.tile small { font-size: 11px; color: var(--muted); opacity: 1; font-weight: 400; }
.tile.hasicon::before { display: none; }
.tile.hasicon img { position: absolute; inset: auto; top: 9px; left: 9px; width: 30px; height: 30px; padding: 0; object-fit: contain; }
.tile.addtile { background: transparent; border: 1px dashed var(--line2); color: var(--muted); align-items: center; justify-content: center; text-align: center; font-weight: 500; }
.tile.addtile::before { display: none; }

/* "on now" programme card: channel logo, what is on, until when */
.pc { flex: none; width: 172px; min-height: 112px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-align: left; display: flex; flex-direction: column; gap: 7px; color: var(--text); }
.pc-top { display: flex; align-items: center; gap: 7px; min-height: 22px; }
.pc-logo { width: 22px; height: 22px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px; flex: none; }
.pc-ch { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-t { font-weight: 600; font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pc-m { font-size: 12px; color: var(--muted); margin-top: auto; }

/* sports event cards */
.ev { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: none; }
.ev.now { background: var(--panel); border-color: rgba(255,90,100,.38); box-shadow: none; }
.badge { border-radius: 6px; padding: 2px 7px; font-size: .68em; letter-spacing: .08em; background: var(--panel2); color: var(--muted); }
.badge.live { background: var(--live); color: #fff; }
.badge.on { background: rgba(67,209,153,.16); color: var(--good); }
.ev-go { background: var(--accent); color: var(--accent-ink); border-radius: 11px; font-weight: 650; }
.chip.opt, .chip.opt.feed, .chip.opt.app { background: var(--panel2); border: 1px solid var(--line); color: rgba(242,245,249,.92); }
.chip.opt.off { background: transparent; border: 1px dashed var(--line2); color: var(--muted); }
.chip.opt small { color: var(--muted); opacity: 1; }

/* other cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.card .th.ph { background: linear-gradient(135deg, #1b2431, #10151c); }
details.fxwrap { background: var(--panel); border: 1px solid var(--line); }

/* bottom bar on phones */
@media (max-width: 760px) {
  #view { padding: 14px 16px 24px; }
  #nav { background: rgba(10,13,18,.95); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding-top: 2px; }
  #nav button { position: relative; min-width: 62px; gap: 3px; font-size: 10.5px; color: var(--muted); padding: 8px 4px 6px; background: none; }
  #nav button .ic { font-size: 20px; filter: grayscale(1) brightness(1.15); opacity: .78; }
  #nav button.on { color: var(--text); background: none; }
  #nav button.on .ic { filter: none; opacity: 1; }
  #nav button.on::before { content: ''; position: absolute; top: -2px; left: 24%; right: 24%; height: 2px; border-radius: 0 0 2px 2px; background: var(--accent); }
  .tile { width: 108px; height: 82px; }
  .pc { width: 164px; }
}


/* v2 fixes: rows start at the page margin, programme cards use a letter mark (channel logos were mostly blank) */
.row { scroll-padding-left: 16px; }
@media (min-width: 761px) { .row { scroll-padding-left: 8px; } }
.pc-dot { width: 22px; height: 22px; border-radius: 7px; background: var(--panel2); border: 1px solid var(--line2); color: var(--text); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.pc-m { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; white-space: nowrap; }
.pc-m b { color: var(--accent); font-weight: 600; font-size: 11.5px; }
.ev-go { text-align: left; }


/* v2 sports: "Or watch on" options swipe sideways in one line (shorter cards) */
@media (max-width: 760px) {
  .ev-opts { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 2px -14px 0; padding: 0 14px 2px; }
  .ev-opts::-webkit-scrollbar { display: none; }
  .ev-opts > * { flex: none; white-space: nowrap; }
}

/* v2 channels: compact row cards - logo (or letter) on the left, name and what's on to the right */
.grid .chcard .card.chan, .chcard .card.chan { display: flex; align-items: center; gap: 12px; padding: 10px 12px; width: 100%; min-height: 72px; }
.chcard .card.chan .th { position: relative; flex: none; width: 54px; height: 54px; aspect-ratio: 1; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; font-size: 20px; }
.chcard .card.chan .th b { font-size: 20px; font-weight: 700; color: var(--muted); }
.chcard .card.chan .th img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 5px; }
.chcard .card.chan .tx { padding: 0; min-width: 0; flex: 1; }
.chcard .card.chan .t { min-height: 0; font-size: 14.5px; -webkit-line-clamp: 1; padding-right: 30px; }
.chcard .card.chan .m { font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.chcard .card.chan .np { display: block; font-size: 12.5px; color: var(--text); margin-top: 3px; line-height: 1.25; }
.chcard .star { top: 8px; right: 8px; }
.row .chcard { width: 280px; }
@media (max-width: 760px) { .grid { grid-template-columns: 1fr; gap: 8px; } }
/* many channel logos are white on transparent: sit them on a mid slate, not white */
.chcard .card.chan .th img { background: #3b4554; padding: 6px; }

/* v2 live tv: feeds and tidy-up tucked into one closed panel so the channels come first */
.feedwrap { margin: 10px 0 14px; padding: 0; border-radius: 14px; }
.feedwrap > summary { padding: 12px 14px; cursor: pointer; list-style: none; font-size: 14px; }
.feedwrap > summary::-webkit-details-marker { display: none; }
.feedwrap > summary::after { content: "\25BE"; float: right; color: var(--muted); }
.feedwrap[open] > summary::after { content: "\25B4"; }
.feedwrap > :not(summary) { margin-left: 14px; margin-right: 14px; }
.feedwrap > .wbtns { margin-bottom: 14px; }
.feedwrap > .svcs { margin-top: 2px; }
/* live tv category chips swipe sideways instead of making a tall wall */
#liveChips .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px 4px; align-items: center; }
#liveChips .chips::-webkit-scrollbar { display: none; }
#liveChips .chips > * { flex: none; white-space: nowrap; }

/* v2 live player: picture on top, status over it, what is on / what is next underneath */
#overlayBar { background: rgba(10,13,18,.96); border-bottom: 1px solid var(--line); }
#overlayClose { background: var(--panel2) !important; color: var(--text) !important; border: 1px solid var(--line2) !important; }
.lp { display: flex; flex-direction: column; width: 100%; min-height: 0; background: var(--bg); }
.lp-vid { position: relative; flex: 1; min-height: 0; background: #000; display: flex; }
.lp-st { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: rgba(0,0,0,.72); color: #fff; text-align: center; padding: 20px; pointer-events: none; }
.lp-st[hidden] { display: none; }
.lp-st button { pointer-events: auto; margin-top: 8px; }
.lp-st b { font-size: 17px; }
.lp-st small { color: var(--muted); font-size: 13px; }
.lp-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.18); border-top-color: var(--accent); animation: lpspin .9s linear infinite; margin-bottom: 6px; }
@keyframes lpspin { to { transform: rotate(360deg); } }
.lp-info { flex: none; padding: 14px 16px 18px; display: grid; gap: 10px; max-height: 46vh; overflow: auto; }
.lp-h { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.lp-cur { display: grid; gap: 3px; }
.lp-cur b { font-size: 16px; line-height: 1.25; }
.lp-k { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--live); font-weight: 700; }
.lp-bar { height: 4px; border-radius: 4px; background: var(--panel2); overflow: hidden; margin-top: 4px; }
.lp-bar i { display: block; height: 100%; background: var(--accent); }
.lp-up { display: grid; gap: 4px; font-size: 13.5px; margin-top: 6px; }
.lp-up .muted { display: inline-block; min-width: 62px; font-variant-numeric: tabular-nums; }
.lp-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.lp-btns .btn { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; padding: 10px 12px; }
@media (max-width: 760px) and (orientation: portrait) { .lp-vid { flex: none; aspect-ratio: 16 / 9; } .lp-info { flex: 1; max-height: none; } }
@media (orientation: landscape) and (max-height: 520px) { .lp { flex-direction: row; } .lp-info { width: 34%; max-height: none; } }
.lp { height: 100%; }
.lp-info { align-content: start; grid-auto-rows: min-content; }
.lp-btns .btn { flex: 1 1 30%; }

/* v2 search + result rows */
.find { margin: 6px 0 4px; }
.find input { width: 100%; box-sizing: border-box; padding: 13px 16px; border-radius: 14px; border: 1px solid var(--line2); background: var(--panel); color: var(--text); font-size: 15px; }
.find input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.svc.fr { flex-direction: column; align-items: flex-start; gap: 8px; }
.fr-btns { display: flex; flex-wrap: wrap; gap: 7px; }

/* v2 catalogue: poster rows and grid, title sheet */
.cp { flex: none; width: 128px; display: flex; flex-direction: column; gap: 4px; text-align: left; background: none; border: 0; padding: 0; color: var(--text); }
.cp-i { position: relative; display: grid; place-items: center; aspect-ratio: 2 / 3; border-radius: 12px; overflow: hidden; background: var(--panel2); border: 1px solid var(--line); }
.cp-i b { font-size: 34px; color: var(--muted); }
.cp-i img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cp .rate { position: absolute; left: 6px; bottom: 6px; z-index: 1; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: rgba(0,0,0,.7); color: #ffd36b; }
.cp-t { font-size: 13.5px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cp-m { font-size: 12px; color: var(--muted); }
.cp-a { font-size: 11.5px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-sk { aspect-ratio: 2 / 3; border-radius: 12px; background: linear-gradient(90deg, var(--panel) 0%, var(--panel2) 50%, var(--panel) 100%); background-size: 200% 100%; animation: cpsk 1.4s linear infinite; }
@keyframes cpsk { to { background-position: -200% 0; } }
.cgrid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
.cgrid .cp { width: auto; }
.ct-h { display: flex; gap: 14px; align-items: flex-start; }
.ct-p { width: 86px; border-radius: 10px; flex: none; }
.ct-h h3 { margin: 0 0 4px; font-size: 19px; }
.ct-d { color: var(--muted); font-size: 14px; line-height: 1.45; margin: 10px 0 6px; max-height: 7.2em; overflow: auto; }
.crail .sec-h { margin-top: 20px; }

.mine { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 10px 0 14px; }
.mine-i { display: flex; align-items: center; gap: 8px; font-size: 14.5px; }
.mine-i input { width: 18px; height: 18px; accent-color: var(--accent); }

.pc-m { flex-wrap: wrap; row-gap: 3px; white-space: normal; }

.chips.jump { margin-top: 6px; }

/* v2 touch sizes and overflow fixes: tap targets at least ~36px on phones; grid items may shrink so long names never push the page wide */
.grid > *, .chcard, .chcard .card.chan { min-width: 0; }
@media (max-width: 760px) {
  .chip { min-height: 36px; display: inline-flex; align-items: center; }
  .chip.opt { min-height: 40px; }
  .link, .sec-h .link { padding: 10px 4px !important; min-height: 36px; display: inline-flex; align-items: center; }
  .ev-go { min-height: 48px; }
  .btn { min-height: 42px; }
}
.chcard .card.chan .np { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* v2 Home loading placeholders */
.sk-wide, .sk-card { flex: none; border-radius: 14px; background: linear-gradient(90deg, var(--panel) 0%, var(--panel2) 50%, var(--panel) 100%); background-size: 200% 100%; animation: cpsk 1.4s linear infinite; }
.sk-wide { width: 300px; height: 170px; }
.sk-card { width: 172px; height: 112px; }

/* your library (movies and series from your TV feed) */
.vod-eps .vod-poster{float:right;width:120px;max-width:30%;border-radius:10px;margin:0 0 8px 12px}
.vod-list{display:flex;flex-direction:column;gap:8px;clear:both;margin-top:10px}
.vod-list .btn{text-align:left;justify-content:flex-start;min-height:48px}
.vod-list .btn b{display:inline-block;min-width:2em;opacity:.7}

/* "Casting now" bar: above the player, below the menus */
#castBar{position:fixed;left:10px;right:10px;bottom:12px;z-index:55;display:flex;align-items:center;gap:8px;padding:10px 12px;border-radius:16px;background:#14202e;border:1px solid #2f4a68;box-shadow:0 8px 28px rgba(0,0,0,.5)}
#castBar[hidden]{display:none}
#castBar .cb-t{flex:1;min-width:0;display:flex;flex-direction:column}
#castBar .cb-t b{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#castBar .cb-t small{opacity:.7;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#castBar .btn{min-height:44px;padding:0 14px}
#castBar .btn.warn{background:#b42318;color:#fff;border-color:#b42318}
#toast{z-index:70}
body:has(#castBar:not([hidden])) #view{padding-bottom:90px}

/* where to watch: which feed each option is from */
.src{display:inline-block;margin:0 6px;padding:2px 8px;border-radius:999px;background:#1d4ed8;color:#fff;font-size:12px;font-weight:700;vertical-align:middle}
.src.alt{background:#6d28d9}
.gw{flex-direction:column;align-items:stretch}
.gw .f{text-align:left;min-height:48px}

/* multiview: up to 4 screens, sound on the one tapped */
#mvBox{height:calc(100vh - 64px);padding:6px;box-sizing:border-box}
.mv{display:grid;gap:6px;height:100%;grid-template-columns:1fr;grid-auto-rows:1fr}
.mv.m3,.mv.m4{grid-template-columns:1fr 1fr}
@media (min-width:700px){.mv.m2{grid-template-columns:1fr 1fr}}
.mv-t{position:relative;background:#000;border:2px solid #2a3442;border-radius:12px;overflow:hidden;min-height:0}
.mv-t.on{border-color:#3b82f6}
.mv-t video{width:100%;height:100%;object-fit:contain;background:#000}
.mv-bar{position:absolute;left:0;right:0;top:0;display:flex;align-items:center;gap:6px;padding:4px 6px;background:linear-gradient(#000c,#0000);font-size:12px}
.mv-bar b{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mv-x{min-height:30px;padding:0 10px}
.mv-st{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;text-align:center;padding:10px;background:#000a;font-size:13px}
.mv-st[hidden]{display:none}
.mv-add{border:2px dashed #3b4a5f;border-radius:12px;background:#0d1520;font-size:16px;min-height:0}
.mvbtn{font-size:13px;opacity:.9}
/* multiview on a phone: screens stacked, each a proper widescreen box; on a big screen: 2 x 2 */
@media (max-width:699px){
  #mvBox{height:auto;min-height:calc(100vh - 64px);overflow:auto}
  .mv,.mv.m3,.mv.m4{grid-template-columns:1fr;grid-auto-rows:auto;height:auto}
  .mv-t{aspect-ratio:16/9}
  .mv-add{min-height:64px}
}
@media (min-width:700px){
  .mv.m2,.mv.m3,.mv.m4{grid-template-columns:1fr 1fr}
  .mv-t{aspect-ratio:auto}
}

/* ---- layout tidy-up: section headers on one line, no empty gaps in cards, compact finished list ---- */
.sec-h{flex-wrap:nowrap;align-items:baseline;gap:8px;margin:22px 0 8px}
.sec-h h2{flex:none;white-space:nowrap}
.sec-sub{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sec-h > .link,.sec-h .sec-actions{flex:none;margin-left:auto;white-space:nowrap}
.pc{min-height:0}
.pc-m{margin-top:6px}
.fins{display:flex;flex-direction:column;gap:8px;margin:8px 0 14px}
.fin{display:flex;align-items:center;gap:10px;background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:10px 12px}
.fin-main{flex:1;min-width:0}
.fin-main b{font-size:14px;line-height:1.25;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.fin-main span{display:block;font-size:12px;color:var(--muted);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fin .btn{flex:none;min-height:38px;padding:0 14px;font-size:13px}

/* filter chips: smaller on a phone so the page is not all buttons */
@media (max-width:760px){
  .chips .chip{padding:6px 12px;font-size:13.5px;min-height:34px}
  .chips.scroll{gap:6px;margin:6px 0}
  .chips .chip small{font-size:11px}
}

/* live scores and followed teams */
.score{display:block;font-size:13px;margin-top:4px;color:var(--text);font-variant-numeric:tabular-nums}
.score small{color:var(--muted);margin-left:4px}
.score.live b{color:#fff}
.score.live small{color:#ff7b86;font-weight:700}
.score-big{margin:2px 0 8px}
.score-big .score{font-size:17px}

/* reminder banner */
#remBar{position:fixed;left:10px;right:10px;top:10px;z-index:75;display:flex;align-items:center;gap:8px;padding:10px 12px;border-radius:14px;background:#2a1520;border:1px solid #ff5a64;box-shadow:0 8px 28px rgba(0,0,0,.55)}
#remBar[hidden]{display:none}
#remBar .rb-t{flex:1;min-width:0;display:flex;flex-direction:column}
#remBar .rb-t b{font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#remBar .rb-t small{opacity:.75}
#remBar .btn{min-height:40px;padding:0 14px}

/* TV Guide grid */
.gscrollx{overflow:auto;border:1px solid var(--line);border-radius:12px;background:var(--panel);max-height:calc(100vh - 230px);position:relative}
.gin{position:relative}
.grow{display:flex;align-items:stretch;border-bottom:1px solid var(--line);min-height:54px}
.gch{position:sticky;left:0;z-index:3;width:132px;flex:none;background:#0f151d;border-right:1px solid var(--line);display:flex;align-items:center;gap:2px;padding:2px 2px 2px 4px}
.gname{flex:1;min-width:0;display:flex;align-items:center;gap:6px;background:none;border:0;color:var(--text);text-align:left;padding:4px;min-height:46px}
.gl{width:28px;height:28px;flex:none;border-radius:7px;background:#1b2634;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;overflow:hidden}
.gl img{width:100%;height:100%;object-fit:contain;background:#fff}
.gn{font-size:12px;line-height:1.2;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.gn small{display:block;color:var(--muted);font-size:10.5px}
.gdots{flex:none;min-width:30px;min-height:40px;background:none;border:0;color:var(--muted);font-size:20px;padding:0 4px}
.gline{position:relative;flex:none;height:54px}
.gb{position:absolute;top:3px;height:48px;box-sizing:border-box;background:#182231;border:1px solid #263449;border-radius:8px;color:var(--text);text-align:left;padding:4px 7px;overflow:hidden;display:flex;flex-direction:column;justify-content:center;min-height:0}
.gb b{font-size:12px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:600}
.gb small{font-size:10.5px;color:var(--muted)}
.gb.now{background:#1d3557;border-color:#3b82f6}
.gb.none{background:transparent;border-style:dashed;color:var(--muted);font-size:12px;justify-content:center;display:flex}
.ghead{position:sticky;top:0;z-index:4;background:#0c1118;min-height:32px}
.ghead .gch{background:#0c1118;min-height:32px}
.ghead .gline{height:32px}
.gt{position:absolute;top:8px;font-size:11px;color:var(--muted);transform:translateX(-50%)}
.gnow{position:absolute;top:0;bottom:0;width:2px;background:#ff5a64;z-index:2;pointer-events:none}
.gch{width:150px}
@media (max-width:760px){ .gl{display:none} .gn{font-size:12.5px;-webkit-line-clamp:3} .gname{padding-left:6px} }

/* empty lists take one line, not a big box */
#catWl .empty,#homeWl .empty,#myCh .empty{padding:10px 14px;font-size:13px}

.ordrow{display:flex;align-items:center;gap:8px;width:100%}
.ordrow span{flex:1;font-size:14px}
.ordrow .btn{min-height:38px;padding:0 12px;font-size:13px}

/* What's on list */
.won{display:flex;flex-direction:column;gap:6px;margin:6px 0 12px}
.wrow{display:flex;align-items:stretch;gap:4px;background:var(--panel);border:1px solid var(--line);border-radius:12px}
.wmain{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;background:none;border:0;color:var(--text);text-align:left;padding:9px 6px 9px 12px;min-height:56px}
.wn{font-weight:650;font-size:14px;line-height:1.2}
.wn small{display:block;color:var(--muted);font-size:11px;font-weight:400;margin-top:1px}
.wnow{font-size:13px;line-height:1.25;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.wnow i{color:var(--muted);font-style:normal;font-size:12px}
.wnow.none{color:var(--muted);font-size:12px}
.wnext{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wrow .gdots{align-self:center;min-height:44px}

/* channel strip under the player */
.lp-sw{margin-top:10px;border-top:1px solid var(--line);padding-top:8px}
.lp-row{padding:4px 0 8px;margin:0;gap:8px}
.lpc{flex:none;width:132px;display:flex;flex-direction:column;gap:4px;background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:8px;text-align:left;color:var(--text);min-height:0}
.lpc-l{width:30px;height:30px;border-radius:8px;background:#1b2634;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:13px;overflow:hidden}
.lpc-l img{width:100%;height:100%;object-fit:contain;background:#fff}
.lpc-n{font-size:12.5px;font-weight:650;line-height:1.2;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.lpc-np{font-size:11px;color:var(--muted);line-height:1.2;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.lp-btns{flex-wrap:wrap}

/* the strip must not make the player page wider than the screen */
.lp,.lp-info,.lp-sw,.lp-now{min-width:0;max-width:100%;box-sizing:border-box}
.lp-row{max-width:100%;overflow-x:auto}
.lp-btns .btn{flex:1 1 auto}

.wn small{white-space:normal}
/* nothing on the guide page may be wider than the phone (larger phone text sizes used to push rows off the right edge) */
#view{overflow-x:hidden}
.won,.wrow,.wmain{min-width:0;max-width:100%;box-sizing:border-box}
.wmain{overflow:hidden}
.wn,.wnow,.wnext{max-width:100%;overflow-wrap:anywhere}
.wnext{white-space:normal;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical}

/* ---------- look polish ---------- */
.rowx { position: relative; }
.rowarr { position: absolute; top: calc(50% - 22px); z-index: 5; width: 38px; height: 44px; border: 1px solid var(--line2); background: rgba(10,13,18,.86); color: var(--text); font-size: 26px; line-height: 1; border-radius: 12px; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s, background .15s; backdrop-filter: blur(6px); padding: 0 0 3px; }
.rowarr.l { left: -6px; } .rowarr.r { right: -6px; }
.rowx:hover .rowarr { opacity: 1; } .rowarr:hover { background: var(--accent); color: var(--accent-ink); }
@media (hover: none) { .rowarr { display: none; } }
.sub.skel { color: transparent; height: 14px; width: min(320px, 60%); border-radius: 7px; overflow: hidden; background: linear-gradient(90deg, var(--panel) 25%, var(--panel2) 50%, var(--panel) 75%); background-size: 200% 100%; animation: shim 1.2s infinite linear; margin: 14px 0; }
@keyframes shim { from { background-position: 200% 0; } to { background-position: -200% 0; } }
html.calm *, html.calm *::before, html.calm *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
.swatches { display: flex; flex-wrap: wrap; gap: 12px; }
.swatch { width: 38px; height: 38px; border-radius: 50%; border: 3px solid transparent; padding: 0; }
.swatch.on { border-color: #fff; box-shadow: 0 0 0 2px var(--bg) inset; }
#ytLive .card.chan { width: 232px; }
#ytLive .card .th { position: relative; overflow: hidden; }
#ytLive .card .th img { width: 100%; height: 100%; object-fit: cover; display: block; }
#ytLive .card .t { min-height: 0; -webkit-line-clamp: 1; }
#ytLive .card .m { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }

#view #ytLive .row .card.chan { width: 216px !important; flex: none; }
#ytLive .card .th { aspect-ratio: 16/9; background: #1b222d; }

/* ---------- profiles ---------- */
#profPick { position: fixed; inset: 0; z-index: 400; background: var(--bg); display: flex; align-items: center; justify-content: center; overflow-y: auto; padding: 24px; text-align: center; }
#profPick[hidden] { display: none !important; }
.pp-box { width: min(760px, 100%); margin: auto; }
.pp-box h1 { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 26px; }
.pp-grid { display: flex; flex-wrap: wrap; gap: 22px; justify-content: center; }
.pp { background: transparent; border: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; width: 130px; color: var(--muted); }
.pp:hover, .pp:focus { color: var(--text); background: var(--panel); }
.pp-av { display: inline-flex; align-items: center; justify-content: center; width: 96px; height: 96px; border-radius: 22px; font-size: 40px; font-weight: 700; color: #04101f; flex: none; }
.pp-av.sm { width: 32px; height: 32px; border-radius: 10px; font-size: 16px; border: 0; padding: 0; }
.pp-av.lg { width: 110px; height: 110px; font-size: 48px; margin-bottom: 14px; }
.pp-plus { background: var(--panel2); color: var(--muted); font-weight: 300; font-size: 54px; }
.pp-n { font-size: 17px; font-weight: 600; color: inherit; }
.pp-lock { font-size: 12px; color: var(--muted); }
.pp-box input { width: min(300px, 100%); text-align: center; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line2); background: var(--panel); font-size: 17px; }
.pp-box .err { color: var(--bad); min-height: 1.3em; }
.homehead { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.profchip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; font-size: 14px; flex: none; }
.profchip-n { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#nav .navprof { display: flex; flex-direction: row; align-items: center; gap: 10px; padding: 8px 12px; margin: -6px 0 10px; font-size: 15px; background: var(--panel); border: 1px solid var(--line); }
#nav .navprof .navprof-sw { margin-left: auto; font-size: 12px; color: var(--muted); }
#nav .navprof span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) { #nav .navprof { display: none; } .pp { width: 104px; } .pp-av { width: 80px; height: 80px; font-size: 32px; } }
.pm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pm-btns { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }

.pp-kid { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: #04101f; background: var(--good); border-radius: 6px; padding: 1px 7px; }
.pp-kids { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 12px 0 0; font-size: 14px; text-align: left; }
.pp-kids input { width: 20px; height: 20px; }

.qrbox { width: 132px; height: 132px; background: #fff; border-radius: 10px; padding: 4px; display: flex; align-items: center; justify-content: center; }
.qrbox svg { width: 100%; height: 100%; display: block; }

/* ---------- my week ---------- */
.wkteams { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 10px; }
.wkq { flex: 1; min-width: 180px; max-width: 320px; padding: 9px 12px; border-radius: 999px; border: 1px solid var(--line2); background: var(--panel); font-size: 14px; }
.wk-day { margin: 14px 0 6px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.wk { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 6px; }
.wk-t { flex: none; width: 74px; font-weight: 700; font-size: 14px; }
.wk-m { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wk-m b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
.wk-m small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-sc { color: var(--live); }
.wk .btn { flex: none; padding: 8px 12px; font-size: 13.5px; }
@media (max-width: 700px) { .wk { flex-wrap: wrap; } .wk-t { width: auto; } .wk .btn { margin-left: auto; } }
