  :root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --surface2: #22263a;
    --accent: #e5a020;
    --accent2: #c06020;
    --text: #e8eaf0;
    --muted: #aeb6ce;
    --live: #ff6b6b;
    --live-bg: #b71c1c;
    --next: #6ea8ff;
    --next-bg: #185abc;
    --radius: 12px;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  }
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }
  body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    min-height: 100vh;
  }

  /* ── Page sub-heading ── */
  .page-header {
    border-bottom: 1px solid #2a2d3a;
    padding: 14px 16px 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
  }
  .page-header h1 {
    font-size: clamp(1rem, 3.5vw, 1.3rem);
    font-weight: 700;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
  }
  .page-header .subtitle {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    text-transform: none;
    letter-spacing: 0;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
    flex: 1;
    min-width: 0;
  }
  .page-header .subtitle-context {
    color: var(--muted);
    font-size: .85rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    text-align: right;
  }
  @media (max-width: 700px) {
    .page-header { flex-wrap: nowrap; }
    .page-header .subtitle { align-items: center; flex: 0 1 auto; max-width: 54%; font-size: 1.1rem; gap: 3px; }
    .page-header .subtitle-context { text-align: left; }
    .page-header .tvg-search-wrapper { flex: 1 1 0; min-width: 0; max-width: none; margin-left: 0; margin-top: 0; }
  }
  .page-header .date-badge {
    display: inline-block;
    background: var(--surface2);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: .8rem;
    color: var(--accent);
    margin-left: 6px;
    font-weight: 600;
  }

  /* ── Group separator ── */
  .group-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 20px 16px 8px;
    transition: color .2s, opacity .2s;
  }
  .group-label.search-match {
    color: var(--accent);
  }
  .group-label.search-match::after {
    content: attr(data-match-count);
    display: inline-block;
    margin-left: 8px;
    background: var(--accent);
    color: #fff;
    font-size: .65rem;
    border-radius: 20px;
    padding: 1px 7px;
    letter-spacing: 0;
    text-transform: none;
    font-weight: 600;
    vertical-align: middle;
  }
  .group-label.search-dim {
    opacity: .45;
  }

  /* ── View toggle ── */
  .search-box {
    position: relative;
    display: flex;
    align-items: center;
  }
  .search-box svg {
    position: absolute;
    left: 9px;
    color: var(--muted);
    pointer-events: none;
  }
  .search-box input {
    background: var(--surface2);
    border: 1px solid #3a3d5a;
    border-radius: 20px;
    color: var(--text);
    font-size: .8rem;
    padding: 5px 12px 5px 30px;
    width: 180px;
    outline: none;
    transition: border-color .2s, width .2s;
  }
  .search-box input:focus {
    border-color: var(--accent);
    width: 220px;
  }
  .search-box input::placeholder { color: var(--muted); }
  .card.search-hidden { opacity: .2; pointer-events: none; }
  .view-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #3a3d5a;
    background: transparent;
    color: var(--muted);
    border-radius: 6px;
    padding: 5px 12px;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
  }
  .view-btn.active {
    background: var(--surface2);
    color: var(--text);
    border-color: var(--accent);
  }
  .view-btn svg { flex-shrink: 0; }

  /* ── Channel cards — GRID mode ── */
  .cards {
    position: relative;
    padding: 0 12px 12px;
  }
  @media (min-width: 800px) {
    body:not(.view-list) .cards:not(.masonry-ready) { visibility: hidden; }
  }
  .card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid #2a2d3a;
    transition: border-color .15s;
    box-sizing: border-box;
    cursor: pointer;
  }
  .card:hover { border-color: #3a3d5a; }

  /* ── LIST mode ── */
  body.view-list .cards {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: auto !important;
  }
  body.view-list .card {
    position: static !important;
    width: 100% !important;
    left: auto !important;
    top: auto !important;
  }
  body.view-list .prog-row { align-items: center; }
  /* Enlace al blog en la misma línea que el título, a la derecha */
  body.view-list .prog-info {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 10px;
    align-items: center;
  }
  body.view-list .prog-title {
    grid-column: 1; grid-row: 1;
    font-size: 1rem;
    white-space: normal; overflow: visible; text-overflow: clip;
  }
  body.view-list .prog-desc {
    display: none !important;
  }
  body.view-list .prog-chips {
    display: flex !important;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    margin-top: 0;
    grid-column: 2; grid-row: 1;
  }
  body.view-list .prog-chips .blog-link { white-space: nowrap; }
  body.view-list .prog-info .prog-progress {
    grid-column: 1 / 3; grid-row: 2;
  }

  .franja-main-layout, .franja-grid-layout { display: block; min-width: 0; }
  .franja-programacion { min-width: 0; }
  .franja-side-col { display: none; }
  .franja-side-ad { display: none; }
  .franja-mobile-ad { display: none; }
  .franja-side-ad:has(.adsbygoogle[data-ad-status="unfilled"]),
  .franja-mobile-ad:has(.adsbygoogle[data-ad-status="unfilled"]),
  .franja-bottom-ad:has(.adsbygoogle[data-ad-status="unfilled"]),
  .franja-ad-empty {
    display: none !important;
    min-height: 0 !important;
    margin: 0 !important;
  }
  @media (min-width: 1024px) {
    .franja-layout-shell {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 160px;
      align-items: start;
      gap: 16px;
    }
    .franja-layout-content { min-width: 0; }
    .franja-side-col {
      display: block;
      width: 160px;
    }
    /* Cada banner vive en su propio carril (mitad superior/inferior de la
       lista/parrilla, altura fijada por JS en layoutSideAdSlots()): el 1º
       se queda pegado mientras se recorre su mitad y, al acabarse su
       carril, el 2º (que empieza justo ahí) toma el relevo — nunca aparecen
       ambos pegados a la vez uno bajo el otro. */
    .franja-side-slot { position: relative; }
    .franja-side-slot--first { margin-top: 0; }
    .franja-side-ad {
      display: block;
      width: 160px;
      height: 600px;
      overflow: hidden;
      position: sticky;
      top: 16px;
    }
    .franja-layout-shell:not(:has(.franja-side-ad:not(.franja-ad-empty))) {
      grid-template-columns: minmax(0, 1fr);
      gap: 0;
    }
  }
  @media (max-width: 799px) {
    .past-accordion,
    .prog-row.mobile-time-hidden {
      display: none !important;
    }
  }
  @media (max-width: 1023px) {
    .franja-mobile-ad {
      display: block;
      width: 300px;
      min-height: 250px;
      margin: 24px auto;
      overflow: hidden;
      text-align: center;
    }
    .franja-mobile-ad .adsbygoogle {
      width: 300px !important;
      min-height: 250px !important;
    }
  }
  @media (min-width: 500px) and (max-width: 1023px) {
    .franja-mobile-ad {
      width: 336px;
      min-height: 320px;
    }
    .franja-mobile-ad .adsbygoogle {
      width: 336px !important;
      min-height: 320px !important;
    }
  }

  .card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px 8px;
    border-bottom: 1px solid #2a2d3a;
    background: var(--surface2);
  }
  .ch-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
    flex-shrink: 0;
  }
  .ch-logo-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #2a2d3a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .65rem;
    color: var(--muted);
    flex-shrink: 0;
    text-align: center;
    line-height: 1.2;
    font-weight: 600;
  }
  .ch-name {
    font-size: .88rem;
    font-weight: 700;
    color: var(--text);
  }

  .prog-list { padding: 6px 0; }
  .prog-row {
    position: relative;
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 6px 12px;
    border-left: 3px solid transparent;
    transition: background .1s;
  }
  .prog-row:hover { background: rgba(255,255,255,.04); }
  .prog-row.is-live {
    border-left-color: var(--live);
    background: rgba(31,64,104,.4);
  }
  .prog-row.prog-past {
    padding-top: 3px;
    padding-bottom: 3px;
  }
  .past-accordion {
    margin-bottom: 6px;
  }
  .past-accordion summary {
    cursor: pointer;
    padding: 6px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: rgba(197,214,239,0.6);
    font-size: 0.82rem;
    font-weight: 600;
    list-style: none;
    user-select: none;
  }
  .past-accordion summary::-webkit-details-marker { display:none; }
  .past-accordion summary::before { content: '\25B6\00A0'; font-size:0.7rem; }
  .past-accordion[open] summary::before { content: '\25BC\00A0'; }
  .past-accordion summary:hover { background: rgba(255,255,255,0.08); color: #dbe8ff; }
  /* ── Nav entre páginas de franja horaria ── */
  .schedule-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #1a1a2e;
    border-bottom: 1px solid #2a2d3a;
    flex-wrap: wrap;
  }
  .schedule-nav-lbl {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    color: var(--muted);
    margin-right: 2px;
    text-transform: uppercase;
  }
  .schedule-nav-btn {
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    color: rgba(219,232,255,0.75);
    border-radius: 999px;
    padding: 5px 13px;
    font-size: .82rem;
    font-weight: 500;
    transition: background .15s, border-color .15s, color .15s;
  }
  .schedule-nav-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
  .schedule-nav-btn.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-color: rgba(255,255,255,0.4);
    font-weight: 700;
  }
  .schedule-nav-btn.hoy-nav {
    border-color: rgba(255,100,160,0.45);
    background: rgba(255,100,160,0.08);
    color: #ff6ba8;
    font-weight: 700;
  }
  .schedule-nav-btn.hoy-nav:hover { background: rgba(255,100,160,0.18); color: #ff8fc0; }
  /* ── Buscador en page-header ── */
  #prog-search {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    padding: 7px 14px 7px 34px;
    color: #dbe8ff;
    font-size: .88rem;
    outline: none;
    transition: border-color .18s ease, background .18s ease;
  }
  #prog-search::placeholder { color: rgba(219,232,255,0.35); }
  #prog-search:focus {
    border-color: rgba(87,233,255,0.55);
    background: rgba(255,255,255,0.1);
  }
  .channel-filters-wrapper .channel-filter-btn {
    margin-top: 0;
  }
  /* TDT/Autónomicos/De pago usan el estilo por defecto de .channel-filter-btn (desmarcado: borde grisáceo; marcado: borde azul via .active) */
  .prog-row.is-next {
    border-left-color: var(--next);
  }
  .prog-time {
    font-size: .78rem;
    font-weight: 700;
    color: var(--muted);
    min-width: 38px;
    padding-top: 1px;
    flex-shrink: 0;
  }
  .prog-row.is-live .prog-time { color: var(--muted); }
  .prog-row.is-next .prog-time { color: var(--next); }
  .prog-info { flex: 1; min-width: 0; }
  .prog-title {
    font-size: .84rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
  }
  .prog-row.is-live .prog-title { color: #fff; }
  .prog-row.is-rec .prog-title { color: #ffd54f; }
  .prog-desc {
    font-size: .73rem;
    color: var(--muted);
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
  }
  .prog-desc.prog-desc-deferred { display: none !important; }
  /* Chips expandibles */
  .prog-chips {
    display: none;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
  }
  .prog-chips:empty { display: none !important; margin-top: 0 !important; }
  .prog-row.is-open .prog-chips { display: flex; }
  .prog-row.is-open .prog-title { white-space: normal; }
  .prog-row.is-open .prog-desc {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
  }
  .chip {
    display: inline-block;
    font-size: .68rem;
    font-weight: 700;
    border-radius: 4px;
    padding: 2px 6px;
    line-height: 1.4;
  }
  .chip-cat   { background: #2a3a5a; color: #8ab4f8; }
  .chip-year  { background: #2a2d3a; color: var(--muted); }
  .chip-age   { background: #1a3a1a; color: #81c784; }
  .chip-age-tp  { background: #1a3a1a; color: #81c784; }
  .chip-age-7   { background: #0d2233; color: #4fc3f7; }
  .chip-age-12  { background: #2e2600; color: #ffd166; }
  .chip-age-16  { background: #2e1a00; color: #ff9800; }
  .chip-age-18  { background: #2e0a0a; color: #ef5350; }
  .chip-score      { background: #2a2d3a; color: var(--muted); }
  .chip-score.good { background: #3a2a00; color: #ffd54f; }
  .blog-link {
    display: inline-flex;
    align-items: center;
    font-size: .8rem;
    line-height: 1;
    text-decoration: none;
    opacity: .92;
  }
  .blog-link:hover { opacity: 1; }
  .badge {
    display: inline-block;
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .04em;
    border-radius: 4px;
    padding: 1px 5px;
    margin-left: 5px;
    vertical-align: middle;
    flex-shrink: 0;
    margin-top: 2px;
  }
  .badge-live { background: var(--live-bg); color: #fff; }
  .badge-next { background: var(--next-bg); color: #fff; }
  .badge-rec  { background: #f9a825; color: #000; }
  .prog-progress {
    display: block;
    height: 3px;
    max-width: 220px;
    background: rgba(255,255,255,.22);
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
  }
  .prog-progress > span {
    display: block;
    height: 100%;
    min-width: 4px;
    background: var(--live);
    border-radius: 2px;
  }
  .badge-done {
    background: transparent;
    border: 1px solid #2e3248;
    color: #4a5070;
    font-style: normal;
    letter-spacing: .04em;
  }

  /* ── En cuadrícula: ficha siempre desplegada ── */
  body:not(.view-list) .prog-row .prog-info {
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 8px;
    align-items: start;
  }
  body:not(.view-list) .prog-row .prog-title {
    grid-column: 1; grid-row: 1;
    white-space: normal;
  }
  body:not(.view-list) .prog-chips {
    grid-column: 2; grid-row: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 0;
  }
  body:not(.view-list) .prog-row .prog-progress {
    grid-column: 1 / 3; grid-row: 3;
  }
  body:not(.view-list) .prog-row .prog-desc {
    grid-column: 1 / 3; grid-row: 2;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    overflow: hidden;
  }
  body:not(.view-list) .prog-row.is-next .prog-desc,
  body:not(.view-list) .prog-row.is-live .prog-desc {
    -webkit-line-clamp: 2;
  }

  /* ── No data ── */
  .empty { color: var(--muted); font-size: .8rem; padding: 10px 12px; }

  /* ── Footer ── */


  @media (max-width: 700px) {
    .cards { padding: 0 8px 8px; }
    body.view-list .cards { padding: 0 8px 8px; }
  }
  /* Etiquetas alineadas verticalmente con los botones */
  .channel-filters-wrapper .recommended-label,
  .channel-filters-wrapper .filters-label { top: 0; align-self: center; }
  /* Botones ocupan solo el ancho que necesita su texto */
  .channel-filters-wrapper .recommended-now-container { flex: 1 1 auto; justify-content: flex-start; }
  .channel-filters-wrapper .recommended-now-container .channel-filter-btn { flex: 0 1 auto !important; text-align: center !important; align-items: center !important; justify-content: center !important; }
  .channel-filters-wrapper .channel-filters { flex: 0 1 auto; }
  .channel-filters-wrapper .channel-filters .channel-filter-btn { flex: 0 1 auto; }
  /* Chip sin fondo por defecto; el seleccionado se resalta en rosa */
  .channel-filters-wrapper .recommended-now-container .channel-filter-btn {
    background: transparent;
  }
  .channel-filters-wrapper .recommended-now-container .channel-filter-btn.active {
    background: transparent !important;
    color: #ff9ec2 !important;
    border-color: #e94560 !important;
    opacity: 1 !important;
  }
  /* Franja ya pasada hoy — aspecto apagado, sigue siendo clickable */
  .channel-filters-wrapper .recommended-now-container .channel-filter-btn.slot-past { opacity:.22 !important; filter:grayscale(80%) !important; box-shadow:none !important; background:rgba(255,255,255,0.07) !important; }
  .tvgd-band {
    min-height: 98px;
    padding: 10px 16px 12px;
    background: #141824;
    border-bottom: 1px solid #2a2d3a;
  }
  .tvgd-heading {
    margin: 0 0 8px;
    color: #f4f6fb;
    font-size: .82rem;
    font-weight: 750;
    letter-spacing: 0;
  }
  .tvgd-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
  }
  .tvgd-item {
    min-width: 0;
    min-height: 88px;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border: 1px solid #30364a;
    border-radius: 7px;
    background: #1d2230;
    cursor: pointer;
    overflow: hidden;
  }
  .tvgd-item.tvgd-item-hidden { display: none; }
  .tvgd-item.tvgd-item-live { border-color: var(--live); background: rgba(229,57,53,.10); }
  .tvgd-item.tvgd-item-next { border-color: var(--next); background: rgba(110,168,255,.10); }
  .tvgd-item:focus-visible { outline: 2px solid #ffd166; outline-offset: 2px; }
  .tvgd-logo,
  .tvgd-logo-fallback {
    width: 40px;
    height: 40px;
    border-radius: 5px;
    flex: 0 0 40px;
  }
  .tvgd-logo { display: block; object-fit: contain; background: #fff; }
  .tvgd-logo-fallback { display: grid; place-items: center; background: #30364a; color: #c8d0e3; font-size: .66rem; font-weight: 700; }
  .tvgd-poster { display: block; width: 54px; height: 72px; border-radius: 5px; object-fit: cover; background: #30364a; }
  .tvgd-copy { min-width: 0; }
  .tvgd-title { color: #fff; font-size: .82rem; font-weight: 700; line-height: 1.2; overflow-wrap: break-word; white-space: normal; }
  .tvgd-meta { overflow: hidden; margin-top: 4px; color: #b8c1d7; font-size: .7rem; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
  .tvgd-score { color: #ffd166; font-weight: 700; }
  .tvgd-soon { color: var(--next); font-size: .68rem; font-weight: 700; margin-top: 2px; }
  /* "En directo" usa el mismo rojo del borde/fondo de la tarjeta en vivo */
  .tvgd-item-live .tvgd-soon { color: var(--live); }
  .tvgd-online-link { color: #39d98a; font-weight: 800; text-decoration: none; }
  .tvgd-online-link:hover { color: #5bffa8; }
  .tvgd-online-pending { color: #39d98a; opacity: .72; font-weight: 600; }
  .tvgd-carousel-wrap { position: relative; }
  .tvgd-nav-btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 2px solid #fff; background: #fb055d; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(0,0,0,.5); }
  .tvgd-nav-btn svg { display: block; width: 18px; height: 18px; }
  .tvgd-nav-btn:hover { background: #ff2d78; transform: translateY(-50%) scale(1.08); }
  .tvgd-nav-btn:disabled { opacity: .25; cursor: default; }
  .tvgd-nav-prev { left: -18px; }
  .tvgd-nav-next { right: -18px; }
  @media (max-width: 700px) { .tvgd-nav-btn { display: none; } }
  @media (max-width: 700px) {
    .tvgd-band { min-height: 130px; padding: 10px 8px 12px; overflow: hidden; }
    .tvgd-list { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; overscroll-behavior-inline: contain; padding-bottom: 3px; }
    .tvgd-item { flex: 0 0 270px; scroll-snap-align: start; }
  }
  @media (min-width: 701px) and (max-width: 1023px) {
    .tvgd-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  }


  /* PROTOTIPO LOCAL: que la parrilla se vea como un simple cambio de vista de
     la lista (mismo fondo oscuro plano en todo, sin bloques de color; el
     destacado se hace con un borde de acento fino, igual que .prog-row.is-live). */
  #grid .time-header-scroll {
    background: #1a1a2e !important;
    border-radius: 0 !important;
  }
  #grid .time-header-track {
    background: transparent !important;
  }
  #grid .time-header-spacer {
    background: transparent !important;
    border-radius: 0 !important;
  }
  #grid .time-header-spacer::before {
    content: '' !important;
  }
  #grid .channel-info {
    background: transparent !important;
  }
  #grid .logo-fallback {
    background: #22263a !important;
  }
  #grid .logo-wrap {
    border: none !important;
    box-shadow: none !important;
  }
  #grid .now-marker-label {
    background: #1a1a2e !important;
  }
  #grid .time-header {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }
  #grid .time-header-scroll {
    border-left: none !important;
    border-bottom: 1px solid #2a2d3a !important;
    box-shadow: none !important;
  }
  #grid .time-header-scroll::-webkit-scrollbar {
    display: none !important;
  }
  #grid .time-header-scroll {
    scrollbar-width: none !important;
  }
  #grid .hour-tick {
    border-left-color: rgba(255,255,255,0.25) !important;
    background: transparent !important;
  }
  #grid .hour-tick.day-start {
    border-left: 2px solid #fff !important;
    background: transparent !important;
  }
  #grid .now-marker {
    background: var(--accent) !important;
    box-shadow: none !important;
  }
  #grid .now-marker-label {
    border: 1px solid var(--accent) !important;
    box-shadow: none !important;
  }
  #grid .program::before,
  #grid .program::after {
    background: none !important;
    animation: none !important;
    opacity: 0 !important;
  }
  #grid .program.current,
  #grid .program.gold,
  #grid .program.filter-match-pink,
  #grid .program.filter-match-gold,
  #grid .program.recommended-border,
  #grid .program.after-23-animate,
  #grid .program.upcoming-recommended-animate {
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
    animation: none !important;
    color: #e6e6e6 !important;
    border: 1px solid #1a1a2e !important;
  }
  #grid .program.current {
    background: rgba(31,64,104,0.55) !important;
  }
  #grid .program.current:hover {
    background: rgba(31,64,104,0.55) !important;
    opacity: 0.5;
  }
  /* Próximas: mismo apagado al pasar el ratón que las ya emitidas. */
  #grid .program:hover {
    opacity: 0.5;
  }
  /* Programas largos: el título queda pegado al borde izquierdo visible
     mientras cualquier parte del bloque siga en pantalla. */
  #grid .program .title {
    position: sticky;
    left: 12px;
  }
  #grid .program.gold .title,
  #grid .program.gold .time,
  #grid .program.gold .category,
  #grid .program.filter-match-gold .title,
  #grid .program.filter-match-gold .time,
  #grid .program.filter-match-gold .category,
  #grid .program.current.gold .title,
  #grid .program.current.gold .time,
  #grid .program.current.gold .category {
    color: #ffd166 !important;
  }
  /* Recomendado (score >= 7) pero no en emisión: solo texto dorado + badge, igual que en Lista. */
  #grid .program.recommended-border:not(.gold) .title-inner {
    color: #ffd54f !important;
  }
  /* El badge de puntuación va pegado a la hora: ajuste fino para que su línea
     base quede a la misma altura que el texto de la hora (más pequeño). */
  #grid .program .time .badge-rec {
    margin-top: 0;
    margin-left: 4px;
    padding: 0 4px;
    vertical-align: baseline;
  }
  /* Tablet: no mostrar la puntuación en el título de las emisiones */
  @media (min-width: 701px) and (max-width: 1023px) {
    .prog-title .badge-rec,
    #grid .program .time .badge-rec {
      display: none;
    }
  }
  #grid {
    padding-left: 32px;
    padding-right: 32px;
    background: transparent;
  }
  @media (max-width: 700px) {
    #grid {
      padding-left: 15px;
      padding-right: 15px;
    }
  }
  /* PROTOTIPO LOCAL: en móvil no se ofrece Parrilla, solo la vista Lista de siempre */
  @media (max-width: 799px) {
    #tvg-view-toggle, #tvg-view-label { display: none !important; }
    #grid { display: none !important; }
    .franja-main-layout { display: block !important; }
    .franja-grid-layout { display: none !important; }
  }
