/* BTB Social mobile Pulse: one measured full-bleed player between header
   and navigation dock. Viewers can tap Fit to see the uncropped original;
   original media, license attribution and Home feed remain untouched. */
@media(max-width:780px){
 body.creator-pulse-open{overflow:hidden}
 #view-reels:not([hidden]){
   display:flex!important;flex-direction:column;
   position:fixed!important;
   top:var(--btb-pulse-top,70px)!important;
   bottom:var(--btb-pulse-bottom,74px)!important;
   left:0;right:0;width:100%;box-sizing:border-box;
   margin:0!important;padding:0!important;min-height:0;
   background:#020509;overflow:hidden;z-index:25;
 }
 #view-reels[hidden]{display:none!important}
 #view-reels>.social-head{display:none!important}
 #view-reels>.creator-reels-category{
   display:flex!important;flex:0 0 46px;min-height:46px;max-height:46px;
   align-items:center;justify-content:center;gap:10px;
   padding:4px 10px;margin:0!important;box-sizing:border-box;
   background:#0d1728;color:#f4f7fb;font-size:13px;border:0;
 }
 #view-reels>.creator-reels-category select{
   min-width:0;max-width:220px;flex:1;min-height:36px;
   font-size:14px;border-radius:10px;
 }
 #view-reels #creator-reels-list{
   display:flex!important;flex-direction:column;
   flex:1 1 0;min-height:0!important;height:auto!important;
   max-height:none!important;max-width:none!important;width:100%;
   border:0!important;border-radius:0!important;margin:0!important;
   gap:0!important;overflow-y:auto;overflow-x:hidden;
   background:#000;scroll-snap-type:y mandatory;
   -webkit-overflow-scrolling:touch;overscroll-behavior:contain;
 }
 #view-reels #creator-reels-list>.creator-reel{
   flex:0 0 100%!important;width:100%;height:100%!important;
   min-height:0!important;margin:0!important;border-radius:0!important;
   scroll-snap-align:start;scroll-snap-stop:always;
 }
 #view-reels #creator-reels-list>.creator-reel>.post{
   width:100%;height:100%;min-height:0;position:relative;
   padding:0!important;border-radius:0!important;overflow:hidden;
 }
 #view-reels #creator-reels-list .creator-reel .post-media.creator-reel-video,
 #view-reels #creator-reels-list .creator-reel.creator-reel-landscape .post-media.creator-reel-video,
 #view-reels #creator-reels-list .creator-reel.creator-reel-portrait .post-media.creator-reel-video{
   position:absolute!important;inset:0!important;
   width:100%!important;height:100%!important;max-height:none!important;
   object-fit:contain!important;object-position:center center!important;
   background:#000!important;display:block!important;
 }
 #view-reels #creator-reels-list .creator-reel.creator-reel-show-full .post-media.creator-reel-video,
 #view-reels #creator-reels-list .creator-reel.creator-reel-landscape.creator-reel-show-full .post-media.creator-reel-video,
 #view-reels #creator-reels-list .creator-reel.creator-reel-portrait.creator-reel-show-full .post-media.creator-reel-video{
   object-fit:cover!important;
 }
 /* Native post actions: right-side rail, separate from creator and captions. */
 #view-reels .creator-reel:not(.creator-licensed-reel) .post-actions{
   position:absolute!important;top:auto!important;
   right:7px!important;bottom:clamp(103px,19%,155px)!important;
   display:flex!important;flex-direction:column!important;
   align-items:center!important;justify-content:center!important;
   width:54px!important;max-width:54px!important;height:auto!important;
   gap:9px!important;padding:0!important;transform:none!important;
   z-index:9!important;overflow:visible!important;
 }
 #view-reels .creator-reel:not(.creator-licensed-reel) .post-actions>button,
 #view-reels .creator-reel:not(.creator-licensed-reel) .post-actions>.post-more>summary{
   display:flex!important;box-sizing:border-box;
   width:48px!important;min-width:48px!important;
   height:48px!important;min-height:48px!important;
   padding:5px!important;border-radius:50%!important;
   background:#111a2dc7!important;border:1px solid #e3ecff43;
 }
 #view-reels .creator-reel:not(.creator-licensed-reel) .post-actions .post-more{width:48px;min-width:48px}
 #view-reels .creator-reel:not(.creator-licensed-reel) .post-author{
   position:absolute!important;
   left:12px!important;right:74px!important;bottom:79px!important;
   max-width:none!important;min-height:36px;z-index:8!important;
 }
 #view-reels .creator-reel:not(.creator-licensed-reel) .post-text{
   position:absolute!important;
   left:12px!important;right:74px!important;bottom:16px!important;
   max-height:3em;z-index:8!important;
 }
 #view-reels .creator-reel:not(.creator-licensed-reel) .creator-reel-controls{
   top:10px!important;right:8px!important;bottom:auto!important;
   display:flex!important;width:auto!important;gap:7px!important;z-index:10!important;
 }
 /* Licensed public videos use the same vertical rail, no 3-column crowding. */
 #view-reels .creator-reel.creator-licensed-reel .creator-licensed-actions{
   position:absolute!important;top:auto!important;
   bottom:clamp(105px,20%,173px)!important;right:8px!important;
   transform:none!important;
   display:flex!important;flex-direction:column!important;
   align-items:center!important;justify-content:center!important;
   width:54px!important;max-height:none!important;gap:9px!important;
   padding:0!important;z-index:10!important;overflow:visible!important;
 }
 #view-reels .creator-reel.creator-licensed-reel .creator-licensed-actions>.creator-reel-action,
 #view-reels .creator-reel.creator-licensed-reel .creator-licensed-reaction-control{
   flex:0 0 auto!important;min-width:48px!important;width:48px!important;
   max-width:48px!important;min-height:48px!important;
   margin:0!important;padding:3px!important;box-sizing:border-box;
 }
 #view-reels .creator-reel.creator-licensed-reel .creator-licensed-about{
   position:absolute!important;left:12px!important;right:74px!important;
   bottom:16px!important;width:auto!important;z-index:8!important;
   max-height:33%;overflow:visible;
 }
 #view-reels .creator-reel.creator-licensed-reel .creator-licensed-head{
   top:10px!important;left:10px!important;right:10px!important;z-index:10!important;
 }
 /* No recurring pagination card over playing video. Only show manual retry on error. */
 #view-reels #creator-reels-more:not(.creator-pulse-retry){display:none!important}
 #view-reels #creator-reels-more.creator-pulse-retry:not([hidden]){
   position:absolute;bottom:14px;left:50%;transform:translateX(-50%);
   display:block!important;z-index:15;width:auto;max-width:90%;margin:0;
 }
}


/* Pulse theatre v2: one measured clip per swipe. No adjacent card peeks. */
@media(max-width:780px){
 #view-reels:not([hidden]){isolation:isolate}
 #view-reels>.creator-reels-category{
   position:absolute!important;top:6px;left:8px;right:8px;
   z-index:21;display:flex!important;flex:0 0 auto!important;
   width:auto;height:44px!important;min-height:44px!important;
   max-height:44px!important;justify-content:flex-start!important;
   padding:0 6px!important;background:transparent!important;
   pointer-events:none;
 }
 #view-reels>.creator-reels-category select{
   pointer-events:auto;flex:0 1 180px!important;width:min(56vw,180px)!important;
   min-height:44px!important;border:1px solid rgba(237,245,255,.38)!important;
   background:rgba(9,18,33,.86)!important;color:#fff!important;
   box-shadow:0 8px 22px rgba(0,0,0,.22);
 }
 #view-reels #creator-reels-list{
   height:100%!important;min-height:0!important;scroll-padding-block:0;
   scroll-snap-type:y mandatory!important;scroll-behavior:auto!important;
   overscroll-behavior-y:contain;touch-action:pan-y;
 }
 #view-reels #creator-reels-list>.creator-reel{
   flex:0 0 var(--btb-pulse-frame-height,100%)!important;
   height:var(--btb-pulse-frame-height,100%)!important;
   min-height:var(--btb-pulse-frame-height,100%)!important;
   max-height:var(--btb-pulse-frame-height,100%)!important;
   scroll-margin:0!important;box-sizing:border-box;contain:layout paint;
 }
 #view-reels #creator-reels-list>.creator-reel>.post{
   display:block!important;box-sizing:border-box;height:100%!important;
   border:0!important;box-shadow:none!important;
 }
 #view-reels #creator-reels-list .creator-reel .post-media.creator-reel-video,
 #view-reels #creator-reels-list .creator-reel.creator-reel-landscape .post-media.creator-reel-video,
 #view-reels #creator-reels-list .creator-reel.creator-reel-portrait .post-media.creator-reel-video{
   object-fit:cover!important;object-position:center!important;
 }
 #view-reels #creator-reels-list .creator-reel.creator-reel-show-full .post-media.creator-reel-video,
 #view-reels #creator-reels-list .creator-reel.creator-reel-landscape.creator-reel-show-full .post-media.creator-reel-video,
 #view-reels #creator-reels-list .creator-reel.creator-reel-portrait.creator-reel-show-full .post-media.creator-reel-video{
   object-fit:contain!important;
 }
 #view-reels #creator-reels-list .creator-reel .creator-reel-ambient{
   position:absolute;inset:0;pointer-events:none;opacity:.18;
 }
 #view-reels .creator-reel.creator-licensed-reel .creator-reel-failure,
 #view-reels .creator-reel .creator-video-status{
   position:absolute;left:12px;right:74px;bottom:108px;
   z-index:11;max-width:none;padding:11px 12px;
   border-radius:12px;background:rgba(9,20,38,.88);
   border:1px solid rgba(189,216,245,.25);color:#fff;
   font-size:12px;line-height:1.45;text-align:left;
 }
 #view-reels .creator-reel .creator-video-status[hidden],
 #view-reels .creator-reel .creator-reel-failure[hidden]{display:none!important}
}

/* Reserve the overlay's first row so filters never cover mute/fit actions. */
@media(max-width:780px){
 #view-reels .creator-reel.creator-licensed-reel .creator-licensed-head{
   top:58px!important;
 }
 #view-reels .creator-reel:not(.creator-licensed-reel) .creator-reel-controls{
   top:58px!important;
 }
}

/* iPhone Pulse: categories belong in their own header, not on top of the movie.
   Existing category values, source credits, media player and actions are retained. */
@media(max-width:780px){
  #view-reels:not([hidden]){overscroll-behavior:contain;}
  #view-reels>.creator-reels-category{
    position:relative!important;top:auto!important;left:auto!important;right:auto!important;
    z-index:21;display:flex!important;flex:0 0 40px!important;
    height:40px!important;min-height:40px!important;max-height:40px!important;
    width:100%!important;justify-content:flex-start!important;align-items:center!important;
    margin:0!important;padding:3px 10px!important;
    background:#0d1728!important;border-bottom:1px solid #283c58!important;
    pointer-events:auto!important;
  }
  #view-reels>.creator-reels-category .creator-pulse-filter-name{display:none!important}
  #view-reels>.creator-reels-category select{
    flex:0 1 182px!important;width:min(52vw,182px)!important;
    min-height:34px!important;height:34px!important;
    font-size:12px!important;box-shadow:none!important;
  }
  /* Video controls now start inside the video frame, under the separate category row. */
  #view-reels .creator-reel.creator-licensed-reel .creator-licensed-head,
  #view-reels .creator-reel:not(.creator-licensed-reel) .creator-reel-controls{top:9px!important}
  #view-reels .creator-reel.creator-licensed-reel .creator-licensed-about{
    bottom:13px!important;max-height:20%!important;overflow:visible!important;
  }
  #view-reels .creator-reel.creator-licensed-reel .creator-licensed-about>strong{
    display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;
    overflow:hidden;overflow-wrap:break-word;font-size:clamp(13px,3.5vw,16px);
    line-height:1.35;text-shadow:0 1px 4px #000;
  }
  #view-reels .creator-reel:not(.creator-licensed-reel) .post-text{
    display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;
    overflow:hidden;max-height:2.8em!important;line-height:1.4;
  }
  #view-reels #creator-reels-list{
    overscroll-behavior-y:contain!important;-webkit-overflow-scrolling:touch;
  }
  /* Loading and retry messages must stay below the video actions, not cover the center. */
  #view-reels .creator-reel .creator-video-status,
  #view-reels .creator-reel.creator-licensed-reel .creator-reel-failure{
    max-height:72px;overflow:auto;bottom:96px!important;
    left:12px!important;right:76px!important;
  }
  #view-reels .creator-reel .creator-video-retry{min-height:42px}
}

/* Fit remains available for the uncropped original; the video itself is never altered. */
@media(max-width:780px){
 #view-reels #creator-reels-list .creator-reel.creator-reel-show-full .post-media.creator-reel-video{
  object-fit:contain!important;background:#000!important;
 }
}
