/* TV en vivo: tema oscuro sobrio. Negro neutro, sin color de acento: el rojo
   solo marca lo que está en vivo. Logos sobre placa clara, líneas finas en vez
   de tarjetas. Sin framework. */

:root {
  --bg: #0b0b0c;
  --surface: #121214;
  --surface-2: #161618;
  --raised: #1c1c1f;
  --chip: #232326;
  --line: #1e1e21;
  --line-2: #242427;
  --line-3: #2e2e32;
  --text: #ededef;
  --label: #c4c4c9;
  --muted: #9b9ba1;
  --dim: #8a8a90;
  --plate: #e9e9eb;
  --plate-ink: #111113;
  --live: #e5484d;
  --ok: #3fb950;
  --warn: #d29922;
  --bad: #e5484d;
  --gutter: 28px;
  --top-h: 56px;
  --guide-w: 380px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
::selection { background: rgb(237 237 239 / .25); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.grow { flex: 1; }

.ico {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

kbd {
  display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 3px;
  border: 1px solid var(--line-3); background: transparent;
  font: 500 11px/16px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--dim); text-align: center;
}

/* ---------- Marca ---------- */

.wordmark { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; letter-spacing: -.2px; white-space: nowrap; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); flex: none; }
.wordmark.big { font-size: 17px; }

/* ---------- Botones ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--line-2);
  background: transparent; color: var(--text); font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--raised); border-color: var(--line-3); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.primary { border-color: var(--text); background: var(--text); color: var(--bg); font-weight: 600; }
.btn.primary:hover { background: #fff; border-color: #fff; }
.btn.block { width: 100%; height: 40px; }
.btn .ico { width: 16px; height: 16px; }
.link-btn {
  background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px 0; font-size: 13px;
  justify-self: center; text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 3px;
}
.link-btn:hover { color: var(--text); text-decoration-color: currentColor; }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 6px;
  border: 1px solid var(--line-2); background: transparent; cursor: pointer; color: var(--text);
  transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: var(--raised); border-color: var(--line-3); }
.icon-btn.bare { border-color: transparent; }
.icon-btn.bare:hover { background: rgb(255 255 255 / .08); }
.icon-btn.attention { border-color: var(--warn); color: var(--warn); }

.back-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; max-width: 220px; padding: 0 10px;
  border-radius: 6px; border: 1px solid var(--line-2); background: transparent; color: var(--label);
  font-size: 13px; cursor: pointer; white-space: nowrap;
}
.back-btn span { overflow: hidden; text-overflow: ellipsis; }
.back-btn:hover { background: var(--raised); color: var(--text); }
.back-btn .ico { width: 15px; height: 15px; }

/* ---------- Formularios ---------- */

.field { display: grid; gap: 6px; font-size: 12px; color: var(--label); font-weight: 500; }
.field-row { display: flex; justify-content: space-between; align-items: baseline; }
.field-row .link-btn { font-size: 12px; font-weight: 400; }
.field input, .field select, .pin, .search input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 6px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-size: 14px;
  transition: border-color .15s;
}
.field input:focus, .field select:focus, .pin:focus, .search input:focus { outline: none; border-color: var(--muted); }
.form-error, .form-ok { margin: 0; padding: 9px 12px; border-radius: 6px; font-size: 13px; }
.form-error { color: #ffb3b5; background: rgb(229 72 77 / .1); border: 1px solid rgb(229 72 77 / .35); }
.form-ok { color: #a7e3b1; background: rgb(63 185 80 / .08); border: 1px solid rgb(63 185 80 / .3); }

/* ---------- Login ---------- */

.login {
  min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
  align-items: center; gap: 64px; padding: 48px max(28px, 8vw);
}
.login-side { max-width: 560px; }
.login-side .wordmark { margin-bottom: 56px; }
.login-pitch { margin: 0; font-size: clamp(30px, 3.6vw, 44px); line-height: 1.1; font-weight: 600; letter-spacing: -1.2px; }
.login-copy { margin: 16px 0 0; color: var(--muted); font-size: 15px; max-width: 440px; }
.login-cards { display: grid; }
.login-card {
  width: 100%; display: grid; gap: 16px; padding: 28px;
  border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface);
}
.login-card h1 { margin: 0 0 4px; font-size: 20px; font-weight: 600; letter-spacing: -.3px; }
.login-help { margin: 0; color: var(--muted); font-size: 13px; }
.login-help.small { font-size: 12px; text-align: center; color: var(--dim); }
.login-art { display: block; width: 100%; max-width: 540px; height: auto; margin: 40px 0 0 -6px; }
.login-art text { font-family: inherit; }
.la-badge { font-size: 9px; font-weight: 700; letter-spacing: .6px; fill: #fff; }
.la-pulse { transform-box: fill-box; transform-origin: center; animation: la-pulse 2.4s ease-in-out infinite; }
.la-float { animation: la-float 7s ease-in-out infinite; }
.la-float-b { animation-delay: -3.5s; }
.la-wave { opacity: .15; animation: la-wave 2.4s ease-in-out infinite; }
.la-wave-2 { animation-delay: .3s; }
.la-wave-3 { animation-delay: .6s; }
.login-devices { list-style: none; display: flex; gap: 8px; margin: 20px 0 0; padding: 0; }
.login-devices li {
  padding: 4px 10px; border: 1px solid var(--line-3); border-radius: 999px;
  color: var(--muted); font-size: 12px;
}
@keyframes la-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.4); opacity: .5; } }
@keyframes la-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes la-wave { 0%, 100% { opacity: .15; } 40% { opacity: 1; } }

/* ---------- Barra superior ---------- */

.top {
  position: sticky; top: 0; z-index: 20; height: var(--top-h);
  display: flex; align-items: center; gap: 16px; padding: 0 var(--gutter);
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.top > .wordmark { margin-right: 8px; }
.search { position: relative; flex: 0 1 320px; margin-left: auto; display: flex; align-items: center; }
.search .ico { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--dim); pointer-events: none; }
.search input { height: 36px; padding: 0 36px 0 34px; font-size: 13px; }
.search input::-webkit-search-cancel-button { filter: invert(1) opacity(.5); }
.search-key { position: absolute; right: 8px; pointer-events: none; }
.search input:focus ~ .search-key, .search input:not(:placeholder-shown) ~ .search-key { display: none; }
.clock { color: var(--muted); font-variant-numeric: tabular-nums; }
.account-btn {
  height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 4px;
  border-radius: 6px; border: 1px solid var(--line-2); background: transparent; cursor: pointer; font-weight: 500;
}
.account-btn:hover { background: var(--raised); }
.account-btn .chev { width: 14px; height: 14px; color: var(--dim); }
.account-short { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 4px;
  background: var(--chip); color: var(--text); font-weight: 700; font-size: 11px;
}

/* ---------- Disposición ---------- */

.layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--guide-w); height: calc(100dvh - var(--top-h)); }
.stage {
  min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 20px;
  padding: 24px var(--gutter) 32px; overflow-y: auto; scrollbar-width: none;
}
.stage::-webkit-scrollbar { display: none; }

/* ---------- Reproductor ---------- */

.player {
  position: relative; flex: none; width: 100%; aspect-ratio: 16 / 9;
  max-height: calc(100dvh - var(--top-h) - 170px);
  border-radius: 6px; background: #000; overflow: hidden; isolation: isolate;
}
.player video { width: 100%; height: 100%; display: block; background: #000; object-fit: contain; }
.player:fullscreen { border-radius: 0; max-height: none; aspect-ratio: auto; }

.msg {
  position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 24px;
  pointer-events: none; background: rgb(11 11 12 / .86);
}
.msg-card { display: grid; justify-items: center; gap: 14px; max-width: 460px; text-align: center; }
.msg p { margin: 0; font-size: 16px; font-weight: 600; }
.msg .btn { pointer-events: auto; }
.msg-list { margin: 0; padding: 0; list-style: none; width: 100%; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--muted); text-align: left; }
.msg-list li { padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.spinner {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-3); border-top-color: var(--text);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Cartel de canal al cambiar: número grande + nombre */
.osd {
  position: absolute; z-index: 3; left: 24px; bottom: 64px; display: flex; align-items: stretch;
  border-radius: 6px; overflow: hidden; pointer-events: none;
  background: rgb(11 11 12 / .88); border: 1px solid rgb(255 255 255 / .08);
  animation: osd-in .25s ease-out;
}
@keyframes osd-in { from { opacity: 0; transform: translateY(6px); } }
.osd-num {
  min-width: 72px; display: grid; place-items: center; padding: 0 16px; background: var(--text); color: var(--bg);
  font-size: 34px; font-weight: 700; letter-spacing: -1.5px; font-variant-numeric: tabular-nums;
}
.osd-text { display: grid; align-content: center; gap: 2px; padding: 10px 18px; }
.osd-name { font-size: 18px; font-weight: 600; }
.osd-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.osd-live { display: inline-flex; align-items: center; gap: 5px; color: var(--text); font-size: 11px; font-weight: 700; letter-spacing: .6px; }
.osd-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--live); }
.osd.toast .osd-num { font-size: 20px; min-width: 52px; }
.osd.toast .osd-meta { display: none; }
.digits {
  position: absolute; z-index: 3; top: 20px; right: 20px; padding: 4px 16px; border-radius: 6px;
  background: rgb(11 11 12 / .88); border: 1px solid rgb(255 255 255 / .08);
  font-size: 40px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 2px; pointer-events: none;
}

/* Pantalla completa: barra superior + tira de canales encima del video */
.fs-bar, .strip { display: none; }
.player:fullscreen .fs-bar {
  position: absolute; z-index: 4; left: 0; right: 0; top: 0; height: 64px;
  display: flex; align-items: center; gap: 10px; padding: 0 24px;
  background: linear-gradient(rgb(0 0 0 / .72), transparent);
  transition: opacity .25s;
}
.player:fullscreen .fs-bar .back-btn { border-color: rgb(255 255 255 / .14); background: rgb(11 11 12 / .5); }
.player:fullscreen .strip {
  position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; display: block;
  background: rgb(11 11 12 / .94); border-top: 1px solid rgb(255 255 255 / .06);
  transition: opacity .25s, transform .25s;
}
.player:fullscreen.chrome-hidden .fs-bar { opacity: 0; pointer-events: none; }
.player:fullscreen.chrome-hidden .strip { opacity: 0; transform: translateY(16px); pointer-events: none; }
.player:fullscreen.chrome-hidden { cursor: none; }
.player:fullscreen:not(.chrome-hidden) .osd { bottom: 200px; }
.player:fullscreen video::-webkit-media-controls { display: none !important; }
.strip-head { height: 44px; display: flex; align-items: center; gap: 16px; padding: 0 24px; border-bottom: 1px solid var(--line); }
.strip-head .tabs { flex: 1; border: 0; padding: 0; }
.strip-hint { color: var(--dim); font-size: 12px; white-space: nowrap; }
.strip-popular { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; }
.strip-popular-label { color: var(--dim); font-size: 12px; white-space: nowrap; margin-right: 4px; display: inline-flex; align-items: center; gap: 6px; }
.strip-popular-label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--live); }
.strip-popular button {
  flex: none; height: 26px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: 4px;
  border: 1px solid var(--line-3); background: transparent; color: var(--label); font-size: 12px; cursor: pointer; white-space: nowrap;
}
.strip-popular button:hover { color: var(--text); border-color: var(--muted); }
.strip-popular button span { color: var(--dim); font-variant-numeric: tabular-nums; }
.strip-track { display: flex; gap: 8px; padding: 14px 24px 16px; overflow-x: auto; scrollbar-width: none; }
.strip-track::-webkit-scrollbar { display: none; }
.tile {
  flex: none; width: 116px; display: grid; gap: 7px; padding: 0; border: 0; background: none;
  color: var(--text); text-align: left; cursor: pointer;
}
.tile-box {
  position: relative; height: 72px; border-radius: 4px; display: grid; place-items: center;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2);
}
.tile:hover .tile-box { box-shadow: inset 0 0 0 1px var(--muted); }
.tile[aria-current="true"] .tile-box { box-shadow: inset 0 0 0 2px var(--text); }
.tile-num { position: absolute; left: 7px; top: 5px; color: var(--dim); font-size: 11px; font-variant-numeric: tabular-nums; }
.tile-box > .ico { position: absolute; right: 6px; top: 6px; width: 11px; height: 11px; }
.tile-box > .fav { fill: var(--muted); stroke: none; }
.tile-name { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile[aria-current="true"] .tile-name { font-weight: 600; }
.tile .tag { display: block; margin-top: 1px; }
.tile.is-offline { opacity: .5; }

/* ---------- Ahora viendo ---------- */

.now { display: flex; align-items: center; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.now-logo:empty { display: none; }
.now-info { min-width: 0; flex: 1 1 220px; }
.now-title { font-size: 22px; font-weight: 600; letter-spacing: -.4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-kicker { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; min-height: 20px; }
.now-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.segmented { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--line-2); border-radius: 6px; }
.segmented button {
  height: 30px; padding: 0 10px; border: 0; border-radius: 4px; background: transparent;
  color: var(--muted); font-size: 12px; cursor: pointer; font-variant-numeric: tabular-nums;
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] { background: var(--chip); color: var(--text); font-weight: 600; }
.fav-btn[aria-pressed="true"] .ico { fill: currentColor; }
.live-badge { display: inline-flex; align-items: center; gap: 5px; color: var(--text); font-size: 11px; font-weight: 700; letter-spacing: .6px; }
.live-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--live); }

/* Logo de canal: placa clara, como se ven los logos reales */
.logo-tile {
  display: grid; place-items: center; flex: none; overflow: hidden;
  width: 52px; height: 28px; border-radius: 3px; background: var(--plate); color: var(--plate-ink);
  font-weight: 800; font-size: 10px; letter-spacing: -.2px; line-height: 1;
}
.logo-tile img { max-width: 84%; max-height: 76%; object-fit: contain; }
.now .logo-tile { width: 72px; height: 40px; border-radius: 4px; font-size: 13px; }
.tile .logo-tile { width: 62px; height: 34px; font-size: 11px; }
.rail-card .logo-tile { width: 64px; height: 36px; font-size: 12px; }

/* ---------- Recientes ---------- */

.rail-head { display: flex; justify-content: space-between; align-items: baseline; }
.rail-head h2 { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.rail-head span { color: var(--dim); font-size: 12px; }
.rail-track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(140px, 180px); gap: 12px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
.rail-track::-webkit-scrollbar { display: none; }
.rail-card { display: grid; gap: 8px; padding: 0; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; }
.rail-box {
  position: relative; height: 88px; border-radius: 4px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line);
}
.rail-card:hover .rail-box { border-color: var(--line-3); }
.rail-card[aria-current="true"] .rail-box { border-color: #3a3a3f; }
.rail-box .tile-num { left: 8px; top: 6px; }
.rail-card b { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-watch { margin-top: -6px; color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.rail-watch::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--live); }

.hint { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--dim); font-size: 12px; }
.hint kbd { margin-right: 3px; }

/* ---------- Guía ---------- */

.guide { min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.guide-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 20px 20px 0; }
.guide-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.guide-count { color: var(--muted); font-size: 12px; }
.tabs {
  display: flex; gap: 18px; padding: 0 20px; margin-top: 12px; border-bottom: 1px solid var(--line);
  overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; height: 38px; display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0;
  background: none; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 500; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab[aria-pressed="true"] { color: var(--text); font-weight: 600; box-shadow: inset 0 -2px 0 var(--text); }
.tab .n { color: var(--dim); font-weight: 400; font-variant-numeric: tabular-nums; }
.strip .tab { height: 44px; }

.list { list-style: none; margin: 0; padding: 0 0 8px; overflow-y: auto; flex: 1; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--line-3) transparent; }
.list-head {
  display: flex; justify-content: space-between; padding: 16px 20px 6px;
  color: var(--dim); font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase;
}
.ch {
  width: 100%; height: 52px; display: grid; grid-template-columns: 28px 52px minmax(0, 1fr) auto;
  align-items: center; gap: 12px; padding: 0 20px; border: 0; background: none; color: var(--text);
  text-align: left; cursor: pointer;
}
.ch:hover { background: var(--surface); }
.ch:focus-visible { outline-offset: -2px; }
.ch[aria-current="true"] { background: var(--raised); }
.ch-num { color: var(--dim); font-variant-numeric: tabular-nums; text-align: right; font-size: 12px; }
.ch[aria-current="true"] .ch-num { color: var(--text); }
.ch-name { min-width: 0; display: flex; align-items: center; gap: 6px; }
.ch-name > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch[aria-current="true"] .ch-name { font-weight: 600; }
.ch-name .fav { width: 11px; height: 11px; fill: var(--muted); stroke: none; }
.ch-side { display: flex; align-items: center; gap: 6px; color: var(--dim); }
.ch-side .ico { width: 14px; height: 14px; }
.tag { font-size: 11px; font-weight: 600; letter-spacing: .3px; color: var(--dim); }
.tag.on { color: var(--live); }
.tag.warn { color: var(--warn); }
.ch.is-offline { opacity: .5; }

.empty { color: var(--muted); padding: 24px; margin: 0; text-align: center; }
.guide-foot { display: flex; justify-content: flex-end; padding: 0 12px; }
.guide-foot:has(.link:not([hidden])) { padding: 10px 12px; border-top: 1px solid var(--line); }
.link { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; font-size: 13px; }
.link:hover { color: var(--text); }
.link .ico { width: 15px; height: 15px; }

/* ---------- Diálogos ---------- */

dialog {
  width: min(400px, calc(100vw - 32px)); padding: 24px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  box-shadow: 0 24px 64px rgb(0 0 0 / .5);
}
dialog::backdrop { background: rgb(0 0 0 / .6); }
dialog.wide-dialog { width: min(520px, calc(100vw - 32px)); }
dialog h2 { margin: 0 0 6px; font-size: 18px; font-weight: 600; letter-spacing: -.2px; }
dialog p { margin: 0 0 14px; color: var(--muted); }
dialog form { display: grid; gap: 4px; }
.pin { height: 52px; text-align: center; font-size: 24px; letter-spacing: 12px; margin-bottom: 8px; }
.dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 18px; }

.facts { margin: 8px 0 18px; border-top: 1px solid var(--line-2); }
.facts > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; word-break: break-word; }
dialog h3 { margin: 4px 0 6px; font-size: 13px; font-weight: 600; }
.count { color: var(--dim); font-weight: 400; }
.streams { list-style: none; margin: 0 0 18px; padding: 0; border-top: 1px solid var(--line-2); }
.streams li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.streams small { color: var(--muted); }
.streams .this { flex: none; color: var(--muted); font-size: 12px; }
.pw { padding-top: 4px; }
.pw summary { cursor: pointer; font-weight: 500; color: var(--label); list-style: none; display: flex; align-items: center; gap: 6px; }
.pw summary::-webkit-details-marker { display: none; }
.pw summary::before { content: "›"; display: inline-block; transition: transform .15s; }
.pw[open] summary::before { transform: rotate(90deg); }
.pw[open] { display: grid; gap: 12px; }
.pw .btn { justify-self: start; }
.hint-small { margin: 0 !important; font-size: 12px; color: var(--dim) !important; }

.choose { display: grid; gap: 8px; margin-bottom: 4px; }

/* ---------- Modo TV ---------- */
/* Vista aparte para la tele: el reproductor ocupa la pantalla entera y la
   guía se abre a la izquierda, con letra grande y foco bien visible para
   manejarla a distancia con flechas y OK. */

.tv-btn { height: 36px; }
.tv-top, .tv-tip, .tv-guide { display: none; }
body.tv-mode { overflow: hidden; --tv-guide-w: min(760px, 62vw); }
body.tv-mode .top, body.tv-mode .guide, body.tv-mode .now, body.tv-mode .rail, body.tv-mode .hint,
body.tv-mode .fs-bar, body.tv-mode .strip { display: none !important; }
body.tv-mode .layout { display: block; height: 100dvh; padding: 0; }
body.tv-mode .stage { padding: 0; height: 100%; overflow: hidden; }
body.tv-mode .player {
  position: fixed; inset: 0; z-index: 30; width: 100vw; height: 100dvh;
  max-height: none; aspect-ratio: auto; border-radius: 0;
}
body.tv-mode.tv-idle .player { cursor: none; }
body.tv-mode .tv-top {
  position: absolute; z-index: 5; left: 0; right: 0; top: 0; height: 80px;
  display: flex; align-items: center; gap: 16px; padding: 0 clamp(24px, 3vw, 48px);
  background: linear-gradient(rgb(0 0 0 / .7), transparent); transition: opacity .3s;
}
body.tv-mode .tv-top .wordmark { font-size: 16px; }
.tv-clock { font-size: clamp(18px, 1.6vw, 26px); font-weight: 600; font-variant-numeric: tabular-nums; }
body.tv-mode .tv-tip {
  position: absolute; z-index: 5; right: clamp(24px, 3vw, 48px); bottom: clamp(20px, 3vh, 40px); margin: 0;
  display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 6px;
  background: rgb(11 11 12 / .8); color: var(--muted); font-size: 14px; transition: opacity .3s;
}
body.tv-mode.tv-idle .tv-top, body.tv-mode.tv-idle .tv-tip { opacity: 0; pointer-events: none; }
body.tv-mode .player:has(.tv-guide:not([hidden])) .tv-tip { display: none; }
body.tv-mode .player:has(.tv-guide:not([hidden])) .tv-top .wordmark { visibility: hidden; }
body.tv-mode .osd { left: clamp(24px, 3vw, 48px); bottom: clamp(40px, 7vh, 80px); }
body.tv-mode .osd-num { font-size: 48px; min-width: 96px; }
body.tv-mode .osd-name { font-size: 24px; }
body.tv-mode .player:has(.tv-guide:not([hidden])) .osd { left: calc(var(--tv-guide-w) + 32px); }

body.tv-mode .tv-guide {
  position: absolute; z-index: 6; left: 0; top: 0; bottom: 0; width: var(--tv-guide-w);
  display: grid; grid-template-columns: minmax(180px, 30%) minmax(0, 1fr);
  background: rgb(11 11 12 / .96); border-right: 1px solid var(--line-2);
  animation: tv-in .2s ease-out;
}
@keyframes tv-in { from { opacity: 0; transform: translateX(-12px); } }
.tv-cats {
  display: flex; flex-direction: column; gap: 2px; padding: clamp(28px, 5vh, 56px) 12px;
  border-right: 1px solid var(--line); overflow-y: auto; scrollbar-width: none;
}
.tv-cat {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; height: 48px; padding: 0 14px;
  border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 17px; font-weight: 500;
  text-align: left; cursor: pointer;
}
.tv-cat .n { color: var(--dim); font-size: 14px; font-weight: 400; font-variant-numeric: tabular-nums; }
.tv-cat[aria-pressed="true"] { color: var(--text); font-weight: 600; background: var(--raised); }
.tv-main { min-height: 0; display: flex; flex-direction: column; padding: clamp(28px, 5vh, 56px) 0 0; }
.tv-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 24px 12px; }
.tv-head span:first-child { font-size: 22px; font-weight: 600; letter-spacing: -.3px; }
.tv-count { color: var(--dim); font-size: 14px; }
.tv-list { list-style: none; margin: 0; padding: 0 12px 12px; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.tv-list::-webkit-scrollbar, .tv-cats::-webkit-scrollbar { display: none; }
.tv-row {
  width: 100%; height: 76px; display: grid; grid-template-columns: 48px 96px minmax(0, 1fr) auto;
  align-items: center; gap: 16px; padding: 0 14px; border: 0; border-radius: 6px;
  background: none; color: var(--text); text-align: left; cursor: pointer;
}
.tv-row .logo-tile { width: 96px; height: 52px; font-size: 15px; border-radius: 4px; }
.tv-num { color: var(--dim); font-size: 18px; font-variant-numeric: tabular-nums; text-align: right; }
.tv-name { min-width: 0; display: grid; gap: 2px; }
.tv-name b { font-size: 20px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-name small { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-side { display: flex; align-items: center; gap: 8px; }
.tv-side .ico { width: 16px; height: 16px; }
.tv-side .fav { fill: var(--muted); stroke: none; }
.tv-side .tag { font-size: 13px; }
.tv-row[aria-current="true"] { box-shadow: inset 3px 0 0 var(--live); }
.tv-row.is-offline { opacity: .5; }
/* Foco grande y claro: placa blanca, como el botón principal. */
.tv-row:focus, .tv-cat:focus { outline: none; background: var(--text); color: var(--bg); }
.tv-row:focus .tv-num, .tv-row:focus .tv-name small, .tv-row:focus .tag, .tv-cat:focus .n { color: #3f3f46; }
.tv-row:focus .tag.on { color: #b4232a; }
.tv-row:focus.is-offline { opacity: 1; }
.tv-keys {
  margin: 0; padding: 14px 24px 18px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--dim); font-size: 14px;
}
.tv-keys kbd, .tv-tip kbd { font-size: 12px; }

/* ---------- Responsivo ---------- */

@media (max-width: 1100px) {
  :root { --guide-w: 340px; --gutter: 20px; }
  .clock { display: none; }
  .account-short { display: none; }
  .tv-btn span { display: none; }
  .tv-btn { width: 36px; padding: 0; justify-content: center; }
}

@media (max-width: 860px) {
  :root { --gutter: 16px; --top-h: 52px; }
  .top { gap: 8px; padding-right: 8px; }
  .top > .wordmark { margin-right: auto; }
  .search { position: absolute; left: 0; right: 0; top: var(--top-h); padding: 8px 16px; background: var(--bg); border-bottom: 1px solid var(--line); flex: none; margin: 0; }
  .search .ico { left: 27px; }
  .search-key, .account-btn .chev { display: none; }
  .account-btn { border: 0; padding: 0 4px; }
  .back-btn span { max-width: 90px; }
  .layout { display: flex; flex-direction: column; height: auto; padding-top: 52px; }
  .stage { overflow: visible; padding: 0 0 16px; gap: 12px; }
  .player { position: sticky; top: calc(var(--top-h) + 52px); z-index: 10; max-height: none; border-radius: 0; }
  .osd { left: 10px; top: 10px; bottom: auto; }
  .osd-num { min-width: 0; padding: 2px 10px; font-size: 18px; letter-spacing: 0; }
  .osd-text { padding: 4px 10px; }
  .osd-name { font-size: 13px; }
  .osd-meta { display: none; }
  .now, .rail { padding-left: 16px; padding-right: 16px; }
  .now { gap: 12px; padding-bottom: 12px; }
  .now .logo-tile { display: none; }
  .now-title { font-size: 17px; }
  .now-actions { width: 100%; }
  .now-actions .segmented { margin-right: auto; }
  .fav-btn span { display: none; }
  .fav-btn { width: 36px; padding: 0; }
  .hint { display: none; }
  .guide { border-left: 0; border-top: 1px solid var(--line); min-height: 70vh; }
  .ch, .list-head { padding-left: 16px; padding-right: 16px; }
  .tabs, .guide-head { padding-left: 16px; padding-right: 16px; }
  .login { grid-template-columns: 1fr; gap: 28px; padding: 32px 16px; align-content: center; }
  .login-side .wordmark { margin-bottom: 28px; }
  .login-pitch { font-size: 26px; letter-spacing: -.6px; }
  .login-copy { font-size: 14px; }
  .login-card { padding: 20px; }
  .login-art, .login-devices { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Ayuda ---------- */

.help-btn { width: 36px; height: 36px; padding: 0; justify-content: center; }
.login-helpbtn { justify-self: center; font-size: 13px; }
.help-dialog { max-height: min(720px, calc(100dvh - 48px)); }
.help-body { display: grid; gap: 6px; margin-bottom: 12px; overflow: auto; }
.help-body details { border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface-2); }
.help-body summary {
  padding: 11px 14px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--text);
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.help-body summary::-webkit-details-marker { display: none; }
.help-body summary::after { content: "+"; color: var(--dim); font-weight: 400; font-size: 18px; line-height: 1; }
.help-body details[open] summary::after { content: "−"; }
.help-body details[open] summary { border-bottom: 1px solid var(--line-2); }
.help-body details > p { margin: 10px 14px; font-size: 14px; color: var(--label); line-height: 1.55; }
.help-body details > p:last-child { margin-bottom: 14px; }
.help-body strong { color: var(--text); font-weight: 600; }
.help-keys { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px 16px; margin: 12px 14px 14px; }
.help-keys > div { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--label); }
.help-keys dt { display: flex; gap: 3px; min-width: 44px; }
.help-keys dd { margin: 0; }

/* ---------- App instalable ---------- */

.install-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin: 4px 0 14px; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface-2);
}
.install-row strong { font-size: 14px; }
.install-row .hint-small { margin: 2px 0 0; }
.install-row .btn { flex: none; }

/* Página sin conexión (offline.html). */
.offline { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; text-align: center; }
.offline h1 { margin: 8px 0 0; font-size: 22px; font-weight: 600; letter-spacing: -.3px; }
.offline p { margin: 0 0 8px; color: var(--muted); max-width: 340px; }
.offline .btn { text-decoration: none; }
.offline-art { width: 72px; height: 72px; fill: none; stroke: var(--dim); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Crear cuenta ---------- */

.login-alt { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }
.login-alt .link-btn { font-size: 13px; }
