
/* ================================================================
   TiviLux 3.2.3 — GUIDE GEOMETRY LOCK
   One authoritative height and timeline scale for the EPG.
   ================================================================ */

/* Never let the Program Descriptions preference resize EPG rows. */
.show-program-descriptions .guide-programs,
.show-program-descriptions .guide-program{
  height:auto!important;
}

/* Program cards are compact timeline cards. Full descriptions belong
   in the program detail view, not inside a 62–104px EPG row. */
.guide-program-description{
  display:none!important;
}

.guide-program{
  box-sizing:border-box!important;
  min-width:2px!important;
  max-height:calc(100% - 10px)!important;
  overflow:hidden!important;
}
.guide-program strong,
.guide-program span{
  max-width:100%!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
}
.guide-program strong{
  white-space:nowrap!important;
}
.guide-program span{
  white-space:nowrap!important;
}

/* Desktop/tablet: channel column and program timeline MUST be the
   exact same row height. */
@media(min-width:701px){
  .guide-v22-body .guide-row{
    display:flex!important;
    min-height:72px!important;
    height:72px!important;
    max-height:72px!important;
    overflow:hidden!important;
  }
  .guide-v22-body .guide-channel-shell,
  .guide-v22-body .guide-programs{
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    overflow:hidden!important;
    align-self:stretch!important;
  }
  .guide-v22-body .guide-channel{
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    box-sizing:border-box!important;
  }
  .guide-v22-body .guide-program{
    top:5px!important;
    bottom:5px!important;
    height:auto!important;
    max-height:none!important;
    justify-content:center!important;
    gap:3px!important;
  }

  .guide-v22-body .guide-density-compact .guide-row{
    min-height:62px!important;
    height:62px!important;
    max-height:62px!important;
  }
  .guide-v22-body .guide-density-large .guide-row{
    min-height:104px!important;
    height:104px!important;
    max-height:104px!important;
  }

  /* The JS timeline is 1200px on desktop. Keep CSS and time cells
     on the same exact 300px / 30-minute scale. */
  .guide-v22-body .guide-time>div,
  .guide-v22-body .guide-programs{
    width:1200px!important;
    flex:0 0 1200px!important;
  }
  .guide-v22-body .guide-time span{
    width:300px!important;
    flex:0 0 300px!important;
  }
  .guide-v22-body .guide-programs{
    background:repeating-linear-gradient(
      90deg,
      #0b1118 0,
      #0b1118 299px,
      #ffffff08 299px,
      #ffffff08 300px
    )!important;
  }

  /* max25.css makes the sticky channel column 300px. Lock header
     and rows to the same width so horizontal scrolling stays aligned. */
  .guide-v22-body .guide-time>strong,
  .guide-v22-body .guide-channel-shell{
    width:300px!important;
    min-width:300px!important;
    flex:0 0 300px!important;
  }
  .guide-v22-body .guide-grid{
    width:1500px!important;
    min-width:1500px!important;
  }
}

/* Phone layout intentionally stacks channel identity over its timeline.
   Lock the timeline to the same 840px scale used by EPG math. */
@media(max-width:700px){
  .guide-v22-body .guide-row{
    min-height:0!important;
    height:auto!important;
    max-height:none!important;
  }
  .guide-v22-body .guide-channel-shell{
    height:68px!important;
    min-height:68px!important;
    max-height:68px!important;
  }
  .guide-v22-body .guide-channel{
    height:68px!important;
    min-height:68px!important;
    max-height:68px!important;
  }
  .guide-v22-body .guide-programs{
    width:840px!important;
    height:64px!important;
    min-height:64px!important;
    max-height:64px!important;
    overflow:hidden!important;
    background:repeating-linear-gradient(
      90deg,
      #080b10 0,
      #080b10 279px,
      #ffffff08 279px,
      #ffffff08 280px
    )!important;
  }
  .guide-v22-body .guide-program{
    top:6px!important;
    bottom:auto!important;
    height:52px!important;
    max-height:52px!important;
    padding:7px 9px!important;
    gap:2px!important;
  }
}

/* On-air LIVE chip must not push title/meta outside the card. */
.guide-v22-body .guide-program.on-air:before{
  flex:none!important;
  line-height:1!important;
  margin:0 0 1px!important;
}


/* TiviLux 3.2.4 — sticky Guide corner cleanup.
   CHANNEL is the only label in the pinned upper-left Guide header. */
.guide-v22-body .guide-time>strong>small{
  display:none!important;
}
.guide-v22-body .guide-time>strong{
  justify-content:center!important;
}


/* 3.2.14.2 final Guide hit-testing safety */
.guide-v22-body .guide-time,
.guide-v22-body .guide-time *{
  pointer-events:none!important;
}
.guide-v22-body .guide-channel-favorite,
.guide-v22-body .guide-channel-more{
  pointer-events:auto!important;
}
@media(max-width:700px){
  .guide-v22-body .guide-channel-shell{
    position:relative!important;
    left:auto!important;
  }
}

/* ================================================================
   TiviLux 3.2.14.3 — WIDE VIEWPORT GUIDE + PLAYER GEOMETRY
   On a 1920x1080 display at 100% browser zoom, max25.css widened the
   preview to ~31vw while the Guide stage was still capped at 226px.
   That clipped the 16:9 player and let the Guide body overlap the
   Group / Favorites controls. Let the stage own its real preview height.
   ================================================================ */
@media(min-width:1181px){
  .guide-v22-stage{
    grid-template-columns:clamp(390px,31vw,595px) minmax(0,1fr)!important;
    min-height:220px!important;
    max-height:none!important;
    overflow:visible!important;
    position:relative!important;
  }
  .guide-v22-preview{
    min-width:0!important;
    min-height:0!important;
    aspect-ratio:16/9!important;
    align-self:start!important;
  }
  .guide-v22-stage .guide-v2-preview{
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    aspect-ratio:auto!important;
    position:relative!important;
    overflow:hidden!important;
  }
  .guide-v22-now{
    min-height:0!important;
    align-self:stretch!important;
  }
  .guide-v22-actions{
    position:relative!important;
    z-index:4!important;
    flex-wrap:wrap!important;
  }
  .guide-v22-actions .guide-group-select{
    min-width:240px!important;
  }
  .guide-v22-body{
    position:relative!important;
    margin-top:12px!important;
  }
  .guide-v22-body .guide-scroll{
    max-height:calc(100dvh - 470px)!important;
    min-height:300px!important;
  }
}

/* Between laptop and 1080p-desktop widths, keep the same no-overlap rule
   without changing the existing compact/tablet composition. */
@media(min-width:701px) and (max-width:1180px){
  .guide-v22-stage{
    max-height:none!important;
    overflow:visible!important;
    position:relative!important;
  }
  .guide-v22-actions{position:relative!important;z-index:4!important;}
  .guide-v22-body{position:relative!important;}
}
