/* LAB · Large meetings: fixed Auto main tile and full-page grid.
   Visual-only CSS: does not alter camera streams or LiveKit subscriptions. */

/* Automatic mode: scroll ONLY inside the separate thumbnail rail. */
body.v67-fullscreen #stage.full.v102-auto:not(.v71-participant-focus):not(.v98-self-focus) #roomGallery{
  display:block!important;
  overflow:hidden!important;
  overscroll-behavior:contain!important;
  align-content:initial!important;
}
body.v67-fullscreen #stage.full.v102-auto:not(.v71-participant-focus):not(.v98-self-focus) #roomGallery > .media-tile.v102-featured{
  position:absolute!important;
  left:0!important;
  top:0!important;
  right:calc(var(--v102-side-width) + 9px)!important;
  bottom:0!important;
  width:auto!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
  z-index:2!important;
}
body.v67-fullscreen #stage.full.v102-auto:not(.v71-participant-focus):not(.v98-self-focus) #roomGallery > .v110-auto-strip {
  position:absolute!important;
  right:0!important;
  top:0!important;
  bottom:0!important;
  display:flex!important;
  flex-direction:column!important;
  flex-wrap:nowrap!important;
  align-items:stretch!important;
  justify-content:flex-start!important;
  box-sizing:border-box!important;
  width:var(--v102-side-width)!important;
  height:auto!important;
  min-height:0!important;
  max-height:100%!important;
  padding:0 2px 2px 0!important;
  gap:8px!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior-y:contain!important;
  scrollbar-width:thin;
  z-index:3!important;
}
body.v67-fullscreen #stage.full.v102-auto:not(.v71-participant-focus) #roomGallery > .v110-auto-strip > .media-tile {
  position:relative!important;
  flex:0 0 134px!important;
  width:100%!important;
  height:134px!important;
  min-height:134px!important;
  max-width:100%!important;
  max-height:134px!important;
  box-sizing:border-box!important;
}
/* No expanded featured tile should be able to move with scroll gestures. */
body.v67-fullscreen #stage.full.v102-auto:not(.v71-participant-focus) #roomGallery > .media-tile.v102-featured {
  touch-action:manipulation;
}

/* Participantes: all tiles of the current large-room page fit without
   clipped strips at the top. 1-8 displayed, never fake 26 video streams. */
body.v67-fullscreen #stage.full.v102-grid:not(.v71-participant-focus):not(.v98-self-focus) #roomGallery {
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  grid-template-rows:repeat(2,minmax(0,1fr))!important;
  grid-auto-rows:minmax(0,1fr)!important;
  grid-auto-flow:row!important;
  align-items:stretch!important;
  align-content:stretch!important;
  justify-items:stretch!important;
  overflow:hidden!important;
  overscroll-behavior:contain!important;
  scroll-behavior:auto!important;
}
body.v67-fullscreen #stage.full.v102-grid:not(.v71-participant-focus):not(.v98-self-focus) #roomGallery .media-tile {
  min-width:0!important;
  min-height:0!important;
  width:100%!important;
  height:100%!important;
}
body.v67-fullscreen #stage.full.v102-grid:not(.v71-participant-focus):not(.v98-self-focus) #roomGallery[data-v102-count="1"]{
  grid-template-columns:1fr!important;grid-template-rows:1fr!important;
}
body.v67-fullscreen #stage.full.v102-grid:not(.v71-participant-focus):not(.v98-self-focus) #roomGallery[data-v102-count="2"]{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-template-rows:1fr!important;
}
body.v67-fullscreen #stage.full.v102-grid:not(.v71-participant-focus):not(.v98-self-focus) #roomGallery:is([data-v102-count="3"],[data-v102-count="4"]){
  grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-template-rows:repeat(2,minmax(0,1fr))!important;
}
body.v67-fullscreen #stage.full.v102-grid:not(.v71-participant-focus):not(.v98-self-focus) #roomGallery:is([data-v102-count="5"],[data-v102-count="6"]){
  grid-template-columns:repeat(3,minmax(0,1fr))!important;grid-template-rows:repeat(2,minmax(0,1fr))!important;
}
/* Reserve a row for the pager so it cannot cover tile controls or videos. */
body.v67-fullscreen #stage.full{
  --v110-media-top:60px;
}
body.v67-fullscreen #stage.full:has(> #largeRoomPager:not([hidden])){
  --v110-media-top:106px;
}
body.v67-fullscreen #stage.full #largeRoomPager:not([hidden]){
  top:60px!important;
  right:14px!important;
}
body.v67-fullscreen #stage.full:is(.v102-auto,.v102-grid):not(.v71-participant-focus):not(.v98-self-focus) #roomGallery,
body.v67-fullscreen #stage.full.v71-participant-focus.cameras-only #roomGallery,
body.v67-fullscreen #stage.full.auto-screens #roomGallery,
body.v67-fullscreen #stage.full.auto-screens #screenGallery{
  top:var(--v110-media-top)!important;
}
body.v67-fullscreen #stage.full.auto-screens:not(.v72-screen-focus) #screenGallery[data-count="4"]{
  grid-template-columns:repeat(2,minmax(0,1fr));
  grid-template-rows:repeat(2,minmax(0,1fr));
}
body.v67-fullscreen #stage.full.auto-screens:not(.v72-screen-focus) #screenGallery video{
  min-height:0;
  max-height:100%;
}
@media(max-width:1050px){
  body.v67-fullscreen #stage.full.v102-grid:not(.v71-participant-focus):not(.v98-self-focus) #roomGallery:is([data-v102-count="5"],[data-v102-count="6"]){
    grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-template-rows:repeat(3,minmax(0,1fr))!important;
  }
  body.v67-fullscreen #stage.full.v102-grid:not(.v71-participant-focus):not(.v98-self-focus) #roomGallery:is([data-v102-count="7"],[data-v102-count="8"]){
    grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-template-rows:repeat(4,minmax(0,1fr))!important;
  }
}
@media(max-width:620px){
  body.v67-fullscreen #stage.full.v102-auto:not(.v71-participant-focus) #roomGallery > .v110-auto-strip > .media-tile{
    flex-basis:86px!important;height:86px!important;min-height:86px!important;max-height:86px!important;
  }
  body.v67-fullscreen #stage.full #largeRoomPager:not([hidden]){right:6px!important}
  body.v67-fullscreen #stage.full.auto-screens.has-cameras:not(.v72-screen-focus) #screenGallery{
    top:calc(var(--v110-media-top) + 74px)!important;
  }
  body.v67-fullscreen #stage.full.auto-screens:not(.v72-screen-focus) #screenGallery[data-count="4"]{
    grid-template-columns:1fr;
    grid-template-rows:repeat(4,minmax(0,1fr));
  }
}
