.tv-page {
  --d-mono: "IBM Plex Mono", monospace;
  --navy: #0b131e;
  --navy-2: #111b29;
  --navy-raised: #1b293b;
  --line: #304053;
  --line-soft: #243246;
  --steel: #b7c5d7;
  --steel-dim: #97a8bd;
  --granate: #a2273e;
  --live: #63d1a1;
  width: min(1740px, 100%);
  margin-inline: auto;
  padding: 12px clamp(16px, 2.2vw, 36px) 16px;
  color: #eef3fa;
}
.tv-page [hidden] { display: none !important; }
.asri-header .asri-idioma:has(.asri-idioma-select) { gap: 6px !important; }
.tv-title { margin: 0 0 10px; font: 900 1.9rem/1.05 "Saira Condensed", sans-serif; }
.tv-title em { font-style: normal; color: #e15a6d; }
.tv-layout { display: grid; gap: 14px; }
#tvCine { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
#tvCine:fullscreen { justify-content: center; background: #000; padding: 8px; }
#tvPantalla { min-width: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #060a10; }
.tv-emision-cab { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 9px 12px; background: var(--navy-2); }
.tv-emision-cab b { font-size: .93rem; overflow-wrap: anywhere; }
.tv-emision-cab .tv-enlace { margin-inline-start: auto; }
.tv-emision-meta { color: var(--steel); font-size: .78rem; }
.tv-emision-aviso { width: 100%; margin: 0; color: var(--steel); font-size: .8rem; }
.tv-insignia { flex: none; padding: 4px 7px; border-radius: 4px; background: #213147; color: #e0e9f6; font: 650 .67rem var(--d-mono); }
.tv-insignia.is-live { background: #782337; color: #ffe6eb; }
.tv-reproductor { position: relative; width: 100%; aspect-ratio: 16 / 9; }
.tv-reproductor > :is(div, iframe) { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tv-sin-emision { display: grid; place-content: center; justify-items: center; gap: 10px; min-height: clamp(164px, 26vw, 350px); margin: 0; padding: 16px; text-align: center; background: radial-gradient(ellipse at center, #142237, #0b131e); }
.tv-sin-emision:has(.tv-miniatura) { position: relative; isolation: isolate; }
.tv-miniatura { position: absolute; inset: 0; z-index: -2; display: block; width: 100%; height: 100%; object-fit: cover; }
.tv-sin-emision:has(.tv-miniatura)::after { content: ''; position: absolute; z-index: -1; inset: 0; background: #091322b3; }
.tv-sin-emision p { margin: 0; max-width: 42ch; color: var(--steel); }
.tv-sin-emision strong { font-size: 1.1rem; }
#tvAudio { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 7px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--navy-2); }
#tvAudio button, .tv-boton, .asri-idioma-select, #tvFiltro, #tvFecha {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid #40526a;
  border-radius: 6px;
  background: #182437;
  color: #f1f5fa;
  font: 650 .8rem/1.2 Inter, sans-serif;
  text-decoration: none;
  cursor: pointer;
}
#tvAudio input { flex: 1; min-width: 70px; accent-color: var(--live); }
#tvAudio button:disabled, .tv-boton:disabled { opacity: .45; cursor: default; }
#audEstado { color: var(--steel); font: .69rem var(--d-mono); }
.tv-enlace, .tv-contacto { color: #f3bdc5; font-size: .81rem; font-weight: 650; text-decoration: none; }
.tv-enlace:hover, .tv-contacto:hover { text-decoration: underline; }
.asri-idioma-select, #tvFiltro, #tvFecha { color-scheme: dark; }
.tv-page :focus-visible, .asri-idioma-select:focus-visible { outline: 2px solid #ff8296; outline-offset: -2px; }
.tv-side { min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: var(--navy); }
.tv-tabs { display: grid; grid-template-columns: 1fr .75fr 1.4fr; padding: 4px; gap: 4px; border-bottom: 1px solid var(--line-soft); }
.tv-tabs button {
  min-width: 0;
  min-height: 42px;
  padding: 6px 4px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--steel);
  font: 700 .83rem/1.2 Inter, sans-serif;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.tv-tabs button[aria-selected="true"] { border-color: #8e3348; color: #fff2f5; background: #4f2032; }
.tv-tabs button:hover:not([aria-selected="true"]) { background: var(--navy-2); color: #fff; }
.tv-panel { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.tv-filtro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 8px; padding: 10px 12px 8px; }
.tv-filtro label { color: var(--steel); font-size: .78rem; font-weight: 650; }
#tvFiltro { width: 100%; }
#tvVolver { align-self: flex-start; margin: 0 12px 6px; }
.tv-lista { min-height: 0; padding: 8px 12px 12px; overflow-y: auto; scrollbar-color: #40536c transparent; }
.tv-panel h2 { margin: 4px 0 7px; color: #edf2f8; font-size: .94rem; line-height: 1.25; }
.tv-rejilla { display: grid; gap: 5px; }
.tv-rejilla:not(:empty) { margin-bottom: 11px; }
.tv-celda {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 49px;
  padding: 6px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--navy-2);
  color: #ebf0f7;
  font: 650 .82rem/1.2 Inter, sans-serif;
  text-align: start;
  cursor: pointer;
}
.tv-celda[aria-pressed="true"] { border-color: #ec6981; background: #362233; }
.tv-celda:hover { border-color: #657b99; }
.tv-celda .n { display: grid; flex: 1; gap: 4px; min-width: 0; }
.tv-celda .nom, .tv-celda .s { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-celda .s { color: var(--steel); font: 400 .7rem/1.2 Inter, sans-serif; }
.tv-celda .et { flex: none; color: var(--steel); font: 650 .67rem var(--d-mono); }
.tv-celda .pt { color: #ff7388; font-size: .8rem; }
.tv-panel details { border-top: 1px solid var(--line-soft); margin-top: 10px; }
#tvFavoritos { margin: 0 0 8px; border-top: 0; border-bottom: 1px solid var(--line-soft); }
.tv-panel summary { padding: 11px 0; color: #dde7f2; font-size: .83rem; font-weight: 650; cursor: pointer; }
.tv-vacio { margin: 0; color: var(--steel); font-size: .84rem; line-height: 1.45; }
#tvChat .tv-vacio { padding: 16px; }
#tvChatExterno { margin: 16px; }
#tvChat iframe { display: block; width: 100%; flex: 1; min-height: 0; border: 0; border-radius: 0 0 12px 12px; }
.tv-guia-cab { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 8px; }
.tv-proximas { display: grid; gap: 5px; }
.tv-proxima { display: grid; gap: 3px; border: 1px solid var(--line-soft); border-left: 3px solid #953249; border-radius: 6px; padding: 7px 9px; background: var(--navy-2); }
.tv-proxima b { overflow-wrap: anywhere; font-size: .83rem; }
.tv-proxima-hora, .tv-dia { color: var(--steel); font: .73rem var(--d-mono); }
.tv-dia { margin: 8px 0 2px; }
.tv-fecha { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px; margin-bottom: 7px; }
#tvGuia table { width: 100%; border-collapse: collapse; font-size: .78rem; }
#tvGuia th { padding: 5px 7px; color: var(--steel); text-align: start; }
#tvGuia :is(th, td) { border-bottom: 1px solid var(--line-soft); }
#tvGuia tbody th { width: 54px; font-family: var(--d-mono); }
#tvGuia td > button { display: block; width: 100%; min-height: 32px; padding: 5px; border: 0; background: transparent; color: #f3f6fa; font: inherit; text-align: start; overflow-wrap: anywhere; cursor: pointer; }
#tvGuia .tv-franja-emitida { color: #f0a9b8; }
#tvGuia .tv-horario-ampliado { margin-bottom: 6px; }
#tvModal { width: min(420px, calc(100% - 24px)); margin: auto; padding: 0; border: 0; background: var(--navy-2); color: #f3f6fa; border-radius: 10px; }
#tvModal::backdrop { background: #060910cc; }
body:has(.tv-page) .asri-footer { padding-block: 12px; }
body:has(.tv-page) .asri-footer .institution-footer { padding-block: 4px 9px; }
body:has(.tv-page) .asri-footer .asri-footer-bottom { padding-top: 7px; }
@media (min-width: 960px) {
  .tv-page { min-height: calc(100dvh - 73px); }
  .tv-layout { grid-template-columns: minmax(0, 1fr) clamp(302px, 29vw, 460px); align-items: start; }
  .tv-side { height: min(760px, calc(100dvh - 139px)); min-height: 315px; }
  .tv-reproductor { max-height: min(700px, max(250px, calc(100dvh - 246px))); }
  .tv-reproductor--twitch { min-height: 300px; }
  #tvCine:fullscreen .tv-reproductor { max-height: calc(100dvh - 130px); }
}
@media (max-width: 959px) {
  .tv-reproductor--twitch { min-height: 300px; }
  .tv-lista { max-height: min(480px, 46dvh); }
  #tvChat iframe { flex: none; height: clamp(290px, 46dvh, 480px); }
}
@media (max-width: 460px) {
  body:has(.tv-page) .asri-header .asri-brand small { display: none; }
  .tv-page { padding-inline: 10px; }
  .tv-layout { gap: 10px; }
  .tv-title { font-size: 1.6rem; }
  .tv-emision-cab { gap: 6px 9px; padding: 8px 9px; }
  #tvAudio button { min-height: 37px; }
}
