/* Guía TV — estilos (sin dependencias externas) */
:root {
  --bg: #f5f6fa; --surface: #ffffff; --surface2: #eef0f6; --text: #0f172a; --muted: #586174; --border: #e2e5ee;
  --accent: #4f46e5; --accent-2: #7c3aed; --accent-ink: #ffffff; --accent-soft: #eceafe; --ok: #0f9d58; --warn: #b45309; --danger: #c62828;
  --now: #e11d48; --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06); --radius: 14px; --radius-sm: 9px;
  --g-cine: #fde2e4; --g-series: #e0e7ff; --g-deportes: #dcfce7; --g-infantil: #fef3c7; --g-documentales: #e0f2fe; --g-noticias: #f1f5f9; --g-entretenimiento: #f3e8ff; --g-musica: #fce7f3;
  --g-cine-i: #9f1239; --g-series-i: #3730a3; --g-deportes-i: #166534; --g-infantil-i: #92400e; --g-documentales-i: #075985; --g-noticias-i: #334155; --g-entretenimiento-i: #6b21a8; --g-musica-i: #9d174d;
  --fs: 16px; --tabs-h: 64px; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0f1c; --surface: #111827; --surface2: #182033; --text: #e7ebf3; --muted: #9aa3b5; --border: #232e45;
    --accent: #8b8dff; --accent-2: #b18cff; --accent-ink: #0a0f1c; --accent-soft: #1f2347; --now: #fb7185; --shadow: 0 1px 2px rgba(0,0,0,.4);
    --g-cine: #3b1720; --g-series: #1e2350; --g-deportes: #12301f; --g-infantil: #3a2a0d; --g-documentales: #0c2a3d; --g-noticias: #1c2433; --g-entretenimiento: #2b1840; --g-musica: #3a1530;
    --g-cine-i: #fecdd3; --g-series-i: #c7d2fe; --g-deportes-i: #bbf7d0; --g-infantil-i: #fde68a; --g-documentales-i: #bae6fd; --g-noticias-i: #cbd5e1; --g-entretenimiento-i: #e9d5ff; --g-musica-i: #fbcfe8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0f1c; --surface: #111827; --surface2: #182033; --text: #e7ebf3; --muted: #9aa3b5; --border: #232e45;
  --accent: #8b8dff; --accent-2: #b18cff; --accent-ink: #0a0f1c; --accent-soft: #1f2347; --now: #fb7185; --shadow: 0 1px 2px rgba(0,0,0,.4);
  --g-cine: #3b1720; --g-series: #1e2350; --g-deportes: #12301f; --g-infantil: #3a2a0d; --g-documentales: #0c2a3d; --g-noticias: #1c2433; --g-entretenimiento: #2b1840; --g-musica: #3a1530;
  --g-cine-i: #fecdd3; --g-series-i: #c7d2fe; --g-deportes-i: #bbf7d0; --g-infantil-i: #fde68a; --g-documentales-i: #bae6fd; --g-noticias-i: #cbd5e1; --g-entretenimiento-i: #e9d5ff; --g-musica-i: #fbcfe8;
  color-scheme: dark;
}
:root { font-size: 100%; }
:root[data-size="l"] { font-size: 112.5%; --fs: 1rem; }
:root[data-size="xl"] { font-size: 125%; --fs: 1rem; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom)); overflow-x: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1 { font-size: 1.55rem; line-height: 1.2; margin: 0 0 .25rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 0 0 .6rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Cabecera */
.top { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
@supports not (background: color-mix(in srgb, red 50%, blue)) { .top { background: var(--surface); } }
.top-in { display: flex; align-items: center; gap: 16px; height: 58px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-ic { width: 30px; height: 30px; stroke: none; }
.mainnav { display: flex; gap: 2px; }
.mainnav a { padding: 8px 11px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: .93rem; white-space: nowrap; }
.mainnav a:hover { background: var(--surface2); color: var(--text); text-decoration: none; }
.mainnav a[aria-current] { background: var(--accent-soft); color: var(--accent); }
.topsearch { margin-left: auto; position: relative; display: flex; align-items: center; }
.topsearch input { width: 230px; height: 38px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); border-radius: 999px; padding: 0 38px 0 14px; font: inherit; font-size: .92rem; }
.topsearch button { position: absolute; right: 4px; width: 32px; height: 32px; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.suggest { position: absolute; top: 44px; right: 0; width: min(380px, 92vw); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); list-style: none; margin: 0; padding: 6px; z-index: 40; }
.suggest a { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.suggest a:hover, .suggest a.on { background: var(--surface2); text-decoration: none; }
.suggest small { color: var(--muted); white-space: nowrap; }
@media (max-width: 960px) { .mainnav { display: none; } }
@media (max-width: 560px) { .topsearch input { width: 150px; } .topsearch input:focus { width: 200px; } .brand span { font-size: 1.05rem; } }

/* Barra inferior (móvil) */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around; height: calc(var(--tabs-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--border); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: .72rem; font-weight: 600; }
.tabs a:hover { text-decoration: none; }
.tabs a[aria-current] { color: var(--accent); }
.tabs svg { width: 22px; height: 22px; }
@media (min-width: 961px) { .tabs { display: none; } body { padding-bottom: 0; } }

.offline { background: var(--warn); color: #fff; text-align: center; font-size: .88rem; padding: 6px 12px; }
.update-toast, .install { position: fixed; left: 12px; right: 12px; margin: 0 auto; width: auto; max-width: 460px; bottom: calc(var(--tabs-h) + 12px + env(safe-area-inset-bottom)); z-index: 50; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 14px; padding: 12px 12px 12px 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; box-shadow: 0 10px 30px rgba(0,0,0,.3); font-size: .93rem; line-height: 1.35; }
.update-toast[hidden], .install[hidden] { display: none; }
.update-toast span, .install span { flex: 1; min-width: 0; }
.update-toast button, .install button { flex: none; border: 0; border-radius: 10px; padding: 9px 14px; font: inherit; font-weight: 700; cursor: pointer; background: var(--accent); color: var(--accent-ink); }
.install .x, .update-toast .x { background: transparent; color: var(--muted); padding: 6px; display: grid; place-items: center; }
@media (min-width: 961px) { .update-toast, .install { bottom: 20px; left: auto; right: 20px; margin: 0; } }

/* Cabeceras de página */
main { padding-top: 18px; padding-bottom: 28px; min-height: 60vh; }
.head { margin: 4px 0 14px; }
.sub { color: var(--muted); margin: 0; font-size: .95rem; }
.crumbs { font-size: .82rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.answer { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius-sm); padding: 12px 14px; margin: 0 0 16px; font-size: .97rem; }
.chead { display: flex; align-items: center; gap: 14px; }
.chead h1 { font-size: 1.4rem; }
.chead .fav { margin-left: auto; }

/* Chips y pestañas */
.chips, .days { max-width: 100%; display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; margin-bottom: 6px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.chips a, .days a { flex: none; padding: 7px 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: .88rem; font-weight: 600; white-space: nowrap; }
.chips a:hover, .days a:hover { text-decoration: none; border-color: var(--accent); }
.chips a[aria-current], .days a[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.days a { border-radius: 10px; }

/* Logos */
.logo { position: relative; width: 40px; height: 40px; border-radius: 10px; background: #fff; border: 1px solid var(--border); display: inline-grid; place-items: center; overflow: hidden; flex: none; }
/* La imagen ocupa exactamente el recuadro: así los logos verticales (La 1, La 2) no se salen por abajo. */
.logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.logo.dk { background: #1f2937; border-color: #1f2937; }
.logo.ph { background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: .8rem; }
.logo.sm { width: 28px; height: 28px; border-radius: 7px; font-size: .65rem; }
.logo.lg { width: 64px; height: 64px; border-radius: 14px; }

/* «Ahora» */
.nowlist, .proglist, .emis, .results, .chgrid { list-style: none; margin: 0; padding: 0; }
.nowlist { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.nowrow { display: grid; grid-template-columns: 170px 1fr 40px; gap: 12px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--border); }
.nowrow:first-child { border-top: 0; }
.chn { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; font-size: .93rem; min-width: 0; }
.chn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chn:hover { text-decoration: none; color: var(--accent); }
.nowp { min-width: 0; }
.nt { display: block; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nm { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--muted); font-size: .84rem; margin-top: 2px; }
.after { margin: 4px 0 0; color: var(--muted); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.after span { font-weight: 700; color: var(--text); }
.pd { margin: 4px 0 0; color: var(--muted); font-size: .86rem; }
.bar { height: 4px; background: var(--surface2); border-radius: 4px; margin-top: 7px; overflow: hidden; max-width: 340px; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 4px; }
.adrow { padding: 10px 14px; border-top: 1px solid var(--border); }
@media (max-width: 640px) {
  .nowrow { grid-template-columns: 54px 1fr 36px; gap: 10px; padding: 11px 12px; }
  .chn { flex-direction: column; gap: 3px; font-size: .66rem; text-align: center; }
  .chn span { max-width: 58px; }
}

.fav { width: 38px; height: 38px; border-radius: 50%; border: 1px solid transparent; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.fav:hover { background: var(--surface2); }
.fav[aria-pressed="true"] { color: #f59e0b; }
.fav[aria-pressed="true"] svg { fill: #f59e0b; }

.chip { display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.chip.g-cine { background: var(--g-cine); color: var(--g-cine-i); } .chip.g-series { background: var(--g-series); color: var(--g-series-i); }
.chip.g-deportes { background: var(--g-deportes); color: var(--g-deportes-i); } .chip.g-infantil { background: var(--g-infantil); color: var(--g-infantil-i); }
.chip.g-documentales { background: var(--g-documentales); color: var(--g-documentales-i); } .chip.g-noticias { background: var(--g-noticias); color: var(--g-noticias-i); }
.chip.g-entretenimiento { background: var(--g-entretenimiento); color: var(--g-entretenimiento-i); } .chip.g-musica { background: var(--g-musica); color: var(--g-musica-i); }
.age { display: inline-grid; place-items: center; min-width: 22px; height: 18px; padding: 0 4px; border-radius: 5px; font-size: .68rem; font-weight: 800; border: 1.5px solid currentColor; color: var(--muted); }
.age12, .age13 { color: #c2410c; } .age16 { color: #be123c; } .age18 { color: #b91c1c; } .ageTP { color: #15803d; } .age7 { color: #0369a1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .age12, :root:not([data-theme="light"]) .age13 { color: #fdba74; } :root:not([data-theme="light"]) .age16 { color: #fda4af; } :root:not([data-theme="light"]) .age18 { color: #fca5a5; } :root:not([data-theme="light"]) .ageTP { color: #86efac; } :root:not([data-theme="light"]) .age7 { color: #7dd3fc; } }
:root[data-theme="dark"] .age12, :root[data-theme="dark"] .age13 { color: #fdba74; } :root[data-theme="dark"] .age16 { color: #fda4af; } :root[data-theme="dark"] .age18 { color: #fca5a5; } :root[data-theme="dark"] .ageTP { color: #86efac; } :root[data-theme="dark"] .age7 { color: #7dd3fc; }

/* Programación de un canal */
.proglist { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.prog { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--border); position: relative; }
.prog:first-child { border-top: 0; }
.ph { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); }
.pday { display: block; font-weight: 600; font-size: .72rem; color: var(--muted); }
.pb { min-width: 0; }
.pt { font-weight: 700; color: var(--text); }
a.pt:hover { color: var(--accent); }
.ep { display: block; color: var(--muted); font-size: .86rem; }
.pm { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.pch { display: flex; width: fit-content; max-width: 100%; align-items: center; gap: 6px; color: var(--muted); font-size: .82rem; font-weight: 600; margin-bottom: 2px; }
.prog.past .ph, .prog.past .pt, .prog.past .ep { color: var(--muted); }
.prog.past .pd { display: none; }
.prog.is-now { background: var(--accent-soft); }
.prog.is-now::before { content: "AHORA"; position: absolute; right: 12px; top: 12px; font-size: .64rem; font-weight: 800; letter-spacing: .06em; color: var(--now); }
.prog.is-now .bar { display: block; }
.prog.hide { display: none; }
.showpast { display: block; width: 100%; padding: 10px; border: 0; border-bottom: 1px solid var(--border); background: var(--surface2); color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* Botones */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); padding: 9px 16px; border-radius: 999px; font: inherit; font-weight: 700; font-size: .93rem; cursor: pointer; text-decoration: none; }
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn svg { width: 18px; height: 18px; }
.btn[aria-pressed="true"] svg { fill: currentColor; }
.more { font-weight: 700; }

/* Programa */
.show-top { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 14px; }
.zoom { flex: none; border: 0; padding: 0; background: none; cursor: zoom-in; max-width: 42%; border-radius: var(--radius); }
.show-img { display: block; width: auto; height: auto; max-width: 100%; max-height: 340px; object-fit: contain; border-radius: var(--radius); background: var(--surface2); }
dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: 94vw; max-height: 90vh; overflow: visible; }
dialog.lightbox::backdrop { background: rgba(5, 8, 16, .85); }
dialog.lightbox img { display: block; max-width: 94vw; max-height: 86vh; width: auto; height: auto; object-fit: contain; border-radius: 12px; }
dialog.lightbox .modal-x { position: fixed; right: 12px; top: 12px; background: rgba(0,0,0,.55); color: #fff; }
.show-meta { flex: 1; min-width: 0; }
.facts { color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.show-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.synopsis { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; white-space: normal; }
.emis { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.emi { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.emi:first-child { border-top: 0; }
.emi.past { display: none; }
.emi-when { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; min-width: 0; }
.emi-when time { display: flex; flex-direction: column; min-width: 150px; }
.emi-when .d { font-weight: 700; } .emi-when .h { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .9rem; }
.emi-act { display: flex; gap: 6px; flex-wrap: wrap; }
.act { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 6px 11px; border-radius: 999px; font: inherit; font-size: .84rem; font-weight: 650; cursor: pointer; }
.act:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.act svg { width: 16px; height: 16px; }
.act.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.act.subtle { color: var(--muted); }
@media (max-width: 640px) { .show-top { flex-direction: column; } .zoom { max-width: 100%; align-self: center; } .show-img { max-height: 55vh; } }

/* Bloques y listas */
.block { margin: 22px 0; }
.block h2 small { color: var(--muted); font-weight: 600; font-size: .8rem; }
.empty { text-align: center; color: var(--muted); padding: 32px 12px; }
.chgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); gap: 8px; }
.chgrid li { min-width: 0; }
.chgrid li { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding-right: 2px; }
.chgrid li > a { flex: 1; display: flex; align-items: center; gap: 10px; padding: 9px 10px; color: var(--text); font-weight: 600; font-size: .9rem; min-width: 0; }
.chgrid li > a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 420px) { .chgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .chgrid li > a { font-size: .8rem; gap: 6px; padding: 8px 6px; } .chgrid .fav { width: 30px; height: 30px; } }
.results li a { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; color: var(--text); }
.results li a span { width: 100%; color: var(--muted); font-size: .86rem; }
.bigsearch { display: flex; gap: 8px; margin-bottom: 18px; }
.bigsearch input { flex: 1; min-width: 0; height: 46px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 0 14px; font: inherit; }
.hint { color: var(--muted); font-size: .85rem; margin: 0 0 8px; }

/* Parrilla */
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; font-size: .75rem; }
.legend span { padding: 2px 8px; border-radius: 999px; }
.grid { position: relative; overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
.ghours, .grow { display: flex; width: max-content; min-width: 100%; }
.gcorner, .gch { position: sticky; left: 0; z-index: 3; flex: none; width: 132px; background: var(--surface); border-right: 1px solid var(--border); }
.gh { position: relative; height: 30px; flex: none; }
.gh span { position: absolute; top: 6px; font-size: .74rem; color: var(--muted); font-weight: 700; padding-left: 4px; border-left: 1px solid var(--border); }
.grow { border-top: 1px solid var(--border); }
.gch { display: flex; align-items: center; gap: 8px; padding: 6px 8px; color: var(--text); font-size: .8rem; font-weight: 650; }
.gch span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gline { position: relative; height: 58px; flex: none; }
.gc { position: absolute; top: 4px; bottom: 4px; border-radius: 8px; padding: 5px 7px; font-size: .78rem; line-height: 1.25; color: var(--text); overflow: hidden; border: 1px solid rgba(0,0,0,.04); background: var(--surface2); }
.gc b { font-variant-numeric: tabular-nums; }
.gc:hover { text-decoration: none; outline: 2px solid var(--accent); z-index: 2; }
.gc.past { color: var(--muted); filter: saturate(.6); }
.gc.is-now { box-shadow: inset 0 0 0 2px var(--now); }
.g-cine { background: var(--g-cine); } .g-series { background: var(--g-series); } .g-deportes { background: var(--g-deportes); } .g-infantil { background: var(--g-infantil); }
.g-documentales { background: var(--g-documentales); } .g-noticias { background: var(--g-noticias); } .g-entretenimiento { background: var(--g-entretenimiento); } .g-musica { background: var(--g-musica); }
.gnow { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--now); z-index: 2; pointer-events: none; }
@media (max-width: 640px) { .gcorner, .gch { width: 78px; } .gch { flex-direction: column; justify-content: center; gap: 2px; font-size: .62rem; text-align: center; } .gch span { max-width: 70px; } }

/* Publicidad propia */
.ad { margin: 12px 0; border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 8px 12px 10px; background: var(--surface); }
.adrow .ad { margin: 0; }
.ad-lbl { display: block; font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }
.ad a { color: var(--text); display: block; }
.ad a:hover { text-decoration: none; }
.ad-link a strong { color: var(--accent); }
.ad-link a span { display: block; color: var(--muted); font-size: .88rem; }
.ad-banner img { display: block; margin: 0 auto; border-radius: 6px; height: auto; }

/* Formularios y modales */
.form { display: grid; gap: 12px; max-width: 560px; }
.form.inline { max-width: 320px; margin-bottom: 14px; }
.form label { display: grid; gap: 5px; font-weight: 600; font-size: .92rem; }
.form input, .form textarea, .form select, .code textarea { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); width: 100%; }
.form .check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }
.form .check input { width: auto; margin-top: 4px; }
.hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }
.formmsg { margin: 0; font-weight: 600; }
.formmsg.ok { color: var(--ok); } .formmsg.err { color: var(--danger); }
.code { display: grid; gap: 6px; font-weight: 600; max-width: 640px; }
.code textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; }
.widget-demo iframe { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
dialog.modal { border: 0; border-radius: 18px; padding: 0; width: min(440px, calc(100vw - 24px)); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog.modal::backdrop { background: rgba(10, 15, 28, .55); }
.modal-in { padding: 18px 18px 16px; display: grid; gap: 12px; }
.modal-in h2 { margin: 0; font-size: 1.1rem; padding-right: 30px; }
.modal-in p { margin: 0; color: var(--muted); font-size: .92rem; }
.modal-x { position: absolute; right: 10px; top: 10px; border: 0; background: transparent; color: var(--muted); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opts label { position: relative; }
.opts input { position: absolute; opacity: 0; }
.opts span { display: inline-block; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); font-weight: 600; font-size: .88rem; cursor: pointer; }
.opts input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.opts input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.modal-btns { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* Mi TV */
.mitv { display: grid; gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.card h2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card .row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); }
.card .row:first-of-type { border-top: 0; }
.row .grow1, .grow1 { flex: 1; min-width: 0; }
.grow1 .t, .grow1 .s { overflow-wrap: anywhere; }
.row .t { font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .s { color: var(--muted); font-size: .84rem; display: block; }
.iconbtn { border: 0; background: transparent; color: var(--muted); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.iconbtn:hover { background: var(--surface2); color: var(--danger); }
.pick { display: grid; gap: 8px; }
.pick input { font: inherit; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); }
.pick ul { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow: auto; }
.pick li button { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: none; color: var(--text); padding: 7px 4px; font: inherit; cursor: pointer; text-align: left; border-radius: 8px; }
.pick li button:hover { background: var(--surface2); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 2px; }
.seg button { border: 0; background: transparent; color: var(--text); padding: 6px 12px; border-radius: 999px; font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.settings { display: grid; gap: 12px; }
.settings > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.mini { list-style: none; margin: 6px 0 0; padding: 0; }
.mini li { display: flex; gap: 8px; font-size: .88rem; padding: 3px 0; }
.mini li b { font-variant-numeric: tabular-nums; min-width: 44px; }
.mini li.now { color: var(--now); font-weight: 700; }
.mini li.past { display: none; }

/* Textos */
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.4rem; }
.prose ul { padding-left: 1.2rem; }

/* Pie */
.foot { border-top: 1px solid var(--border); background: var(--surface); padding: 22px 0 26px; color: var(--muted); font-size: .88rem; }
.foot-brand { color: var(--text); margin-bottom: 4px; }
.foot-txt p { margin: 0 0 10px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.foot-links a { color: var(--muted); }
.foot-domain { margin: 14px 0 0; font-weight: 800; color: var(--text); letter-spacing: .02em; }
.domain { font-weight: 800; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
@media print { .top, .tabs, .ad, .tools, .fav, .emi-act, .foot-links { display: none !important; } body { padding: 0; } }
.nob { border: 0; padding: 0; margin: 0; }

/* 1.1.0: navegación de la parrilla */
.gnav { display: flex; gap: 6px; align-items: center; margin: 0 0 10px; flex-wrap: wrap; }
.gbtn { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; min-width: 40px; height: 38px; font: inherit; font-size: 1.3rem; font-weight: 700; cursor: pointer; display: inline-grid; place-items: center; padding: 0 10px; }
.gbtn.txt { font-size: .86rem; }
.gbtn:hover { border-color: var(--accent); color: var(--accent); }
.grid { scroll-behavior: smooth; }
.grid.drag { cursor: grabbing; scroll-behavior: auto; user-select: none; }
@media (max-width: 640px) { .gnav .gbtn.txt[data-gto] { display: none; } }

/* 1.1.0: Mi TV — menú completo, paletas y estado sin conexión */
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.menu-grid a { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); font-weight: 600; font-size: .9rem; background: var(--surface); }
.menu-grid a:hover { border-color: var(--accent); text-decoration: none; }
.menu-grid svg { color: var(--accent); }
.menu-links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: .86rem; }
.menu-links a { color: var(--muted); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border); cursor: pointer; padding: 0; }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--text); }
.sw-indigo { background: linear-gradient(135deg, #4f46e5, #7c3aed); } .sw-azul { background: linear-gradient(135deg, #2563eb, #0891b2); }
.sw-verde { background: linear-gradient(135deg, #15803d, #0d9488); } .sw-naranja { background: linear-gradient(135deg, #c2410c, #d97706); }
.sw-rosa { background: linear-gradient(135deg, #be185d, #9333ea); } .sw-rojo { background: linear-gradient(135deg, #b91c1c, #e11d48); }
.sw-turquesa { background: linear-gradient(135deg, #0e7490, #0891b2); } .sw-grafito { background: linear-gradient(135deg, #334155, #64748b); }
.offstate { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); margin: 8px 0 12px; font-size: .9rem; }
.offstate b { display: block; }
.offstate .ok { color: var(--ok); }
.chstate { font-size: .74rem; color: var(--ok); font-weight: 700; display: block; }
.ver { font-weight: 600; color: var(--muted); font-size: .8rem; margin-left: 6px; }
.install.ios { border-radius: 16px; align-items: flex-start; }
.install.ios span { line-height: 1.35; }

/* Paletas: el color de acento de cada usuario (se guardan en el dispositivo) */
:root[data-palette="azul"] { --accent: #1d4ed8; --accent-2: #0891b2; --accent-soft: #e3edff; }
:root[data-palette="verde"] { --accent: #166534; --accent-2: #0d9488; --accent-soft: #dcf5e6; }
:root[data-palette="naranja"] { --accent: #c2410c; --accent-2: #d97706; --accent-soft: #ffedd5; }
:root[data-palette="rosa"] { --accent: #be185d; --accent-2: #9333ea; --accent-soft: #fce7f3; }
:root[data-palette="rojo"] { --accent: #b91c1c; --accent-2: #e11d48; --accent-soft: #fee2e2; }
:root[data-palette="turquesa"] { --accent: #0e7490; --accent-2: #0891b2; --accent-soft: #dff5fa; }
:root[data-palette="grafito"] { --accent: #334155; --accent-2: #64748b; --accent-soft: #e8ecf2; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"])[data-palette="azul"] { --accent: #60a5fa; --accent-2: #38bdf8; --accent-soft: #14243f; }
  :root:not([data-theme="light"])[data-palette="verde"] { --accent: #4ade80; --accent-2: #2dd4bf; --accent-soft: #10291c; }
  :root:not([data-theme="light"])[data-palette="naranja"] { --accent: #fb923c; --accent-2: #fbbf24; --accent-soft: #33200f; }
  :root:not([data-theme="light"])[data-palette="rosa"] { --accent: #f472b6; --accent-2: #c084fc; --accent-soft: #33152a; }
  :root:not([data-theme="light"])[data-palette="rojo"] { --accent: #f87171; --accent-2: #fb7185; --accent-soft: #351518; }
  :root:not([data-theme="light"])[data-palette="turquesa"] { --accent: #22d3ee; --accent-2: #67e8f9; --accent-soft: #0b2a33; }
  :root:not([data-theme="light"])[data-palette="grafito"] { --accent: #cbd5e1; --accent-2: #94a3b8; --accent-soft: #1f2836; }
}
:root[data-theme="dark"][data-palette="azul"] { --accent: #60a5fa; --accent-2: #38bdf8; --accent-soft: #14243f; }
:root[data-theme="dark"][data-palette="verde"] { --accent: #4ade80; --accent-2: #2dd4bf; --accent-soft: #10291c; }
:root[data-theme="dark"][data-palette="naranja"] { --accent: #fb923c; --accent-2: #fbbf24; --accent-soft: #33200f; }
:root[data-theme="dark"][data-palette="rosa"] { --accent: #f472b6; --accent-2: #c084fc; --accent-soft: #33152a; }
:root[data-theme="dark"][data-palette="rojo"] { --accent: #f87171; --accent-2: #fb7185; --accent-soft: #351518; }
:root[data-theme="dark"][data-palette="turquesa"] { --accent: #22d3ee; --accent-2: #67e8f9; --accent-soft: #0b2a33; }
:root[data-theme="dark"][data-palette="grafito"] { --accent: #cbd5e1; --accent-2: #94a3b8; --accent-soft: #1f2836; }

/* Mi TV: canales plegables */
.mt-tools { margin: 8px 0 4px; font-size: .86rem; color: var(--muted); }
.linkish { border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
.linkish.danger { color: var(--danger); }
details.chd { border-top: 1px solid var(--border); }
details.chd:first-of-type { border-top: 0; }
details.chd > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 10px 2px; cursor: pointer; }
details.chd > summary::-webkit-details-marker { display: none; }
details.chd > summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: 0 6px 4px auto; flex: none; transition: transform .15s; }
details.chd[open] > summary::after { transform: rotate(-135deg); margin-bottom: -4px; }
details.chd .t { font-weight: 700; display: block; }
details.chd .s { color: var(--muted); font-size: .84rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chd-body { padding: 0 2px 10px 40px; }
.chd-foot { display: flex; justify-content: space-between; gap: 10px; font-size: .86rem; margin: 6px 0 0; flex-wrap: wrap; }
.mitv > * { min-width: 0; }
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button { flex: none; white-space: nowrap; }

/* Pie: enlaces internos */
.foot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 6px 24px; margin: 6px 0 12px; }
.foot-h { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text); margin: 6px 0 4px; }
.foot-cols p { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.foot-cols a { color: var(--muted); }

/* Directo en la web oficial del canal */
.livebox { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 0; }
.btn.live { display: inline-flex; align-items: center; gap: 8px; background: #dc2626; border-color: #dc2626; color: #fff; }
.btn.live:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn.live svg { width: 16px; height: 16px; }

/* Reproductor del directo oficial (YouTube) */
.player { margin: 12px 0 16px; scroll-margin-top: 80px; }
.pl-box { position: relative; aspect-ratio: 16 / 9; width: 100%; border-radius: 14px; overflow: hidden; background: #0b1020; color: #e5e7eb; border: 1px solid var(--border); }
.player.compact { max-width: 640px; }
.pl-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pl-facade { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; text-align: center; }
.pl-facade .btn.pl-go { background: #dc2626; border-color: #dc2626; color: #fff; }
.pl-facade .btn.pl-go svg { width: 16px; height: 16px; }
.pl-note { margin: 0; max-width: 34rem; font-size: .78rem; line-height: 1.4; color: #cbd5e1; }
.pl-note a { color: #fff; text-decoration: underline; }
.pl-off { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 16px; text-align: center; }
.pl-help { margin: 6px 2px 0; }
@media (max-width: 420px) { .pl-facade .logo.lg { display: none; } .pl-facade { gap: 8px; } .pl-note { font-size: .72rem; } }
.plist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 8px; }
.plist a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; color: var(--text); min-width: 0; }
.plist a:hover { text-decoration: none; border-color: var(--accent); }
.plist a[aria-current] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.plist a > span:not(.logo) { display: flex; flex-direction: column; min-width: 0; }
.plist small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 961px) {
  .live-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
  .live-main .player { margin-top: 0; }
  .live-side { margin-top: 0; }
  .live-side h2 { margin-top: 0; }
  .live-side .plist { grid-template-columns: minmax(0, 1fr); max-height: 72vh; overflow: auto; padding: 2px 4px 2px 2px; }
}
.live-side h3 { margin: 14px 0 8px; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.live-side h3:first-of-type { margin-top: 4px; }
.plist small.ev { color: var(--accent); font-weight: 600; }
@media (min-width: 961px) { .live-side { max-height: 80vh; overflow: auto; padding-right: 4px; } .live-side .plist { max-height: none; overflow: visible; } }
.pfind { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 2px 0 8px; }
.pfind input { width: 100%; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.pfind input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.plist small.onair { color: #dc2626; font-weight: 700; }
.plist small.offair { color: var(--muted); font-style: italic; }
[hidden] { display: none !important; }

/* Fútbol y deportes */
.match .mt { margin: 0; font-weight: 700; font-size: 1.02rem; }
.match .mt a { color: var(--text); }
.match .pm { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.sb { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); background: var(--surface); }
.sb.live { background: #dc2626; border-color: #dc2626; color: #fff; }
.sb.fem { color: #be185d; border-color: currentColor; }
.sb.comp { color: var(--accent); border-color: var(--accent-soft); background: var(--accent-soft); }
.sb.comp:hover { text-decoration: none; filter: brightness(.97); }
.mchs { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 6px; }
.mchs .pch { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; color: var(--muted); }
.dayh { margin: 18px 0 8px; font-size: .9rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
details.block > summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
:root[data-theme="dark"] .sb.fem { color: #f472b6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sb.fem { color: #f472b6; } }

/* Pasar a otro dispositivo y calendario */
.btns2 { display: flex; flex-wrap: wrap; gap: 8px; }
.qrbox { display: grid; place-items: center; margin: 12px 0; min-height: 120px; }
.qrbox img { width: min(260px, 70vw); height: auto; image-rendering: pixelated; background: #fff; padding: 8px; border-radius: 12px; }
.shl { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); font: inherit; font-size: .82rem; margin: 6px 0; }
textarea.shl { resize: vertical; }
