/* BTB Social iPhone playback stabilization, scoped to Pulse and home only.
   The original video is always displayed uncropped; controls cannot obscure
   captions in uploaded footage. No changes to desktop publishing/rewards. */
#creator-fresh-reels .creator-reel [data-reel-fit],
#view-reels .creator-reel [data-reel-fit],
#feed .creator-reel [data-reel-fit]{display:none!important}
@media(max-width:780px){
  /* Same-sized horizontal previews, not an accidental full-screen player. */
  #creator-fresh-reels.creator-home-reels{box-sizing:border-box;max-width:100%;min-width:0}
  #creator-fresh-reels .creator-fresh-cards{display:flex;gap:10px;align-items:stretch;padding:5px 7px 12px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory}
  #creator-fresh-reels .creator-reel{flex:0 0 min(84vw,350px)!important;width:min(84vw,350px)!important;max-width:350px;height:min(68dvh,520px)!important;min-height:390px!important;margin:0!important;box-sizing:border-box;scroll-snap-align:center;isolation:isolate;overflow:hidden}
  #creator-fresh-reels .creator-reel>.post{
    box-sizing:border-box;display:flex!important;flex-direction:column;min-width:0;
    position:relative!important;height:100%!important;padding:0!important;overflow:hidden;
    background:#0b1627!important;border-radius:13px
  }
  /* Video gets its own space; the author, caption, and reactions live below,
     never over the source video or original words in its frames. */
  #creator-fresh-reels .creator-reel .post-media.creator-reel-video{
    position:relative!important;inset:auto!important;display:block!important;
    flex:1 1 auto;order:0;width:100%!important;height:0!important;min-height:175px!important;
    max-height:none!important;margin:0!important;padding:0!important;
    object-fit:contain!important;object-position:center!important;
    background:linear-gradient(135deg,#152a47,#080f1f)!important;
    border-radius:0!important;z-index:1!important
  }
  #creator-fresh-reels .creator-reel .creator-reel-ambient{display:none!important}
  #creator-fresh-reels .creator-reel .post-author{
    order:1;flex:0 0 auto;position:relative!important;inset:auto!important;
    margin:0;padding:7px 9px 2px;min-height:0;max-width:100%;background:#101e33;
    font-size:12px!important;line-height:1.3;z-index:4
  }
  #creator-fresh-reels .creator-reel .post-author .btn{min-height:34px;padding:5px 7px;font-size:11px}
  #creator-fresh-reels .creator-reel .post-author .creator-avatar-link{flex:0 0 31px;max-width:31px}
  #creator-fresh-reels .creator-reel .post-text{
    order:2;flex:0 0 auto;position:relative!important;inset:auto!important;
    max-height:2.7em!important;overflow:hidden!important;margin:0!important;
    padding:3px 9px 7px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;
    font-size:12px!important;line-height:1.35;color:#e6efff;background:#101e33;
    z-index:4;text-shadow:none
  }
  #creator-fresh-reels .creator-reel:not(.creator-licensed-reel) .post-actions{
    order:3;flex:0 0 45px;position:relative!important;inset:auto!important;
    display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;
    width:100%!important;max-width:none!important;height:45px!important;min-height:45px!important;
    gap:4px!important;padding:4px 6px!important;margin:0!important;
    background:#0c182b!important;transform:none!important;z-index:5!important;overflow:visible!important
  }
  #creator-fresh-reels .creator-reel:not(.creator-licensed-reel) .post-actions>:is(button,.post-more){min-width:0!important;min-height:36px!important;max-height:38px}
  #creator-fresh-reels .creator-reel:not(.creator-licensed-reel) .post-actions>.post-reaction-open{grid-column:1;grid-row:1;justify-self:end;z-index:6;max-width:23px!important;min-width:23px!important;width:23px!important;min-height:36px!important}
  #creator-fresh-reels .creator-reel:not(.creator-licensed-reel) .post-actions>[data-like]{grid-column:1;grid-row:1;padding-right:24px!important}
  #creator-fresh-reels .creator-reel .creator-reel-controls{
    position:absolute!important;top:7px!important;right:7px!important;
    display:flex!important;gap:5px!important;z-index:7!important;width:auto!important
  }
  #creator-fresh-reels .creator-reel .creator-reel-controls button{
    min-width:35px!important;min-height:35px!important;max-width:75px;
    padding:5px 7px!important;background:#0e1b2dce;border-radius:22px
  }
  #creator-fresh-reels .creator-reel.creator-reel-awaiting-frame .creator-reel-video{
    background:linear-gradient(130deg,#142840,#223f5c,#0d1829)!important
  }
  #creator-fresh-reels .creator-reel.creator-reel-awaiting-frame:after{
    content:"Loading video preview…";position:absolute;top:34%;left:14%;right:14%;
    text-align:center;font-size:12px;font-weight:700;color:#dcecff;
    pointer-events:none;z-index:2;text-shadow:0 1px 5px #000a
  }
  /* Public licensed footage follows the identical layout as native posts. */
  #creator-fresh-reels .creator-licensed-reel .creator-reel-standby{pointer-events:none}
  #creator-fresh-reels .creator-licensed-reel .creator-licensed-head{
    position:absolute!important;top:7px!important;left:7px!important;right:7px!important;
    z-index:5!important;bottom:auto!important
  }
  #creator-fresh-reels .creator-licensed-reel .creator-licensed-about{
    order:1;flex:0 0 auto;display:block!important;position:relative!important;
    inset:auto!important;left:auto!important;right:auto!important;bottom:auto!important;
    max-height:75px!important;min-height:46px;padding:5px 10px 4px;
    background:#101e33!important;overflow:hidden!important;text-shadow:none
  }
  #creator-fresh-reels .creator-licensed-reel .creator-licensed-about strong{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:12px!important}
  #creator-fresh-reels .creator-licensed-reel .creator-licensed-about>small{font-size:10px!important}
  #creator-fresh-reels .creator-licensed-reel .creator-licensed-about-more{display:none}
  #creator-fresh-reels .creator-licensed-reel .creator-licensed-actions{
    order:2;flex:0 0 45px;display:flex!important;flex-direction:row!important;
    position:relative!important;inset:auto!important;transform:none!important;
    align-items:center!important;justify-content:space-around!important;gap:5px!important;
    width:100%!important;max-width:none!important;height:45px!important;max-height:45px!important;
    padding:3px 6px!important;margin:0!important;background:#0c182b!important
  }
  #creator-fresh-reels .creator-licensed-reel .creator-licensed-actions>.creator-reel-action,
  #creator-fresh-reels .creator-licensed-reel .creator-licensed-reaction-control{width:42px!important;min-width:42px!important;min-height:38px!important;max-height:42px;padding:1px!important}
  #creator-fresh-reels .creator-licensed-reel .creator-licensed-reaction-control>[data-licensed-react]{width:42px!important;min-height:36px!important}
  #creator-fresh-reels .creator-licensed-reel .creator-reel-play-center{top:33%!important}
  /* The immersive player fits the entire uploaded frame — never cuts off
     overlaid video words or unexpectedly flips to cover/fill. */
  #view-reels #creator-reels-list .creator-reel .post-media.creator-reel-video,
  #view-reels #creator-reels-list .creator-reel.creator-reel-portrait .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-show-full .post-media.creator-reel-video{
    object-fit:contain!important;object-position:center center!important
  }
  /* Limit the tap-and-hold palette to the phone; stay within safe edges. */
  body>.licensed-reel-reaction-picker:not([hidden]){
    display:grid!important;grid-template-columns:repeat(4,minmax(40px,1fr))!important;
    width:min(240px,calc(100vw - 24px))!important;max-width:calc(100vw - 24px)!important;
    gap:2px!important;padding:6px!important;box-sizing:border-box!important
  }
  body>.licensed-reel-reaction-picker>button{width:42px!important;min-width:40px!important;height:42px!important;min-height:42px!important}
  #view-explore .creator-home-refresh{display:none!important}
}

/* When the video has its real poster, never veil it with the standby layer. */
.creator-home-reels .creator-licensed-reel video[poster]~.creator-reel-standby,
#view-reels .creator-licensed-reel video[poster]~.creator-reel-standby{opacity:0!important}
@media(max-width:780px){
 /* Keep non-error playback hints out of the carousel; its play control
    remains tappable and actual player errors/retry remain visible. */
 #creator-fresh-reels .creator-reel .creator-video-status:not(.creator-native-video-error){display:none!important}
 #creator-fresh-reels .creator-licensed-reel .creator-reel-failure[hidden]{display:none!important}
 #creator-fresh-reels .creator-reel .post>.comments[hidden]{display:none!important}
 #creator-fresh-reels .creator-reel .post>.creator-reel-controls{pointer-events:auto}
}


/* Final iPhone source-first layout. A video is never force-filled, cropped,
   or covered by its creator info. This layer loads after historical Pulse CSS. */
@media(max-width:780px){
 #view-explore .section-head.social-head{
   display:flex;flex-direction:column;align-items:stretch;gap:8px;margin:5px 0 12px;
 }
 #view-explore .section-head.social-head>div:first-child{
   display:flex;flex-wrap:wrap;gap:7px;align-items:center;
 }
 #view-explore .section-head.social-head h2{font-size:20px;line-height:1.2;margin:0}
 #view-explore .section-head.social-head .feed-view-controls{
   display:flex;align-items:center;flex-wrap:wrap;gap:8px;min-width:0
 }
 #view-explore .creator-feed-choice{min-width:0;max-width:100%;width:100%;box-sizing:border-box}
 #view-explore .feed-interest-label{
   box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;
   gap:9px;flex:1 1 100%;min-width:0;font-size:12px
 }
 #view-explore .feed-interest-label select{flex:1 1 auto;min-width:0;max-width:70%;height:42px}
 #creator-fresh-reels.creator-home-reels{margin:10px 0 15px;padding:10px 9px 12px}
 #creator-fresh-reels .creator-fresh-cards{
   align-items:stretch;gap:9px;scroll-padding-inline:4px
 }
 #creator-fresh-reels .creator-reel{
   flex:0 0 min(85vw,345px)!important;
   width:min(85vw,345px)!important;
   height:clamp(340px,65dvh,485px)!important;
   min-height:340px!important;
   max-height:485px!important;
   background:#10213a!important
 }
 #creator-fresh-reels .creator-reel>.post{
   display:flex!important;flex-flow:column nowrap!important;
   min-height:0!important;width:100%;height:100%!important
 }
 #creator-fresh-reels .creator-reel .post-media.creator-reel-video{
   box-sizing:border-box;
   position:relative!important;left:auto!important;top:auto!important;
   right:auto!important;bottom:auto!important;inset:auto!important;
   flex:1 1 0%!important;align-self:stretch!important;
   width:100%!important;height:auto!important;min-height:0!important;
   max-height:none!important;
   object-fit:contain!important;object-position:center center!important;
   background:#122944!important
 }
 #creator-fresh-reels .creator-reel .post-author{
   flex:0 0 auto!important;max-height:66px;overflow:hidden
 }
 #creator-fresh-reels .creator-reel .post-text{flex:0 0 auto!important;max-height:47px!important}
 #creator-fresh-reels .creator-reel .post-actions{
   flex:0 0 45px!important;max-height:45px;box-sizing:border-box;
   align-self:stretch
 }
 #creator-fresh-reels .creator-reel .creator-licensed-about{
   flex:0 0 auto!important;position:relative!important;
   max-height:68px!important;min-height:42px!important;
   overflow:hidden!important
 }
 #creator-fresh-reels .creator-reel .creator-licensed-actions{
   position:relative!important;inset:auto!important;transform:none!important;
   flex:0 0 45px!important;
   min-height:45px!important;max-height:45px!important;
   align-self:stretch;justify-content:space-around!important
 }
 #creator-fresh-reels .creator-reel .creator-licensed-reaction-control{
   display:flex!important;flex-direction:row!important;width:auto!important;
   min-width:44px!important;max-width:82px!important;min-height:37px!important;
   height:37px!important;margin:0!important;border-radius:10px!important;
   padding:0!important
 }
 #creator-fresh-reels .creator-reel .creator-licensed-reaction-control
   >[data-licensed-quick-laugh]{display:none!important}
 #creator-fresh-reels .creator-reel .creator-licensed-reaction-control
   >[data-licensed-react]{width:43px!important;height:37px!important;min-height:37px!important}
 #creator-fresh-reels .creator-reel .creator-reel-controls{
   right:7px!important;top:7px!important;bottom:auto!important
 }
 #creator-fresh-reels .creator-reel .creator-reel-controls button{
   min-width:35px!important;min-height:35px!important
 }
 #creator-fresh-reels .creator-reel .creator-reel-ambient{display:none!important}
 #creator-fresh-reels .creator-reel .creator-reel-standby{pointer-events:none}
 #creator-fresh-reels .creator-reel.creator-reel-awaiting-frame::after{
   content:"Preparing video…";position:absolute;left:20%;right:20%;
   top:30%;padding:7px;color:#e0f0ff;text-align:center;font-size:12px;
   pointer-events:none;z-index:2;text-shadow:0 1px 4px #000
 }
 /* Full-screen Pulse keeps the entire real footage framed inside a
    dedicated picture area; authors and action buttons never sit over it. */
 #view-reels #creator-reels-list>.creator-reel>.post{background:#0b1425!important}
 #view-reels #creator-reels-list .creator-reel .post-media.creator-reel-video,
 #view-reels #creator-reels-list .creator-reel.creator-reel-portrait .post-media.creator-reel-video,
 #view-reels #creator-reels-list .creator-reel.creator-reel-landscape .post-media.creator-reel-video{
   position:absolute!important;top:0!important;bottom:auto!important;
   left:0!important;right:auto!important;
   width:calc(100% - 56px)!important;height:calc(100% - 124px)!important;
   min-height:0!important;max-height:none!important;
   object-fit:contain!important;object-position:center center!important;
   background:#101c2e!important
 }
 #view-reels #creator-reels-list .creator-reel .creator-reel-ambient{
   display:none!important
 }
 #view-reels #creator-reels-list .creator-reel .post::before{
   background:none!important;pointer-events:none!important
 }
 #view-reels .creator-reel:not(.creator-licensed-reel) .post-author{
   left:12px!important;right:12px!important;bottom:69px!important;
   color:#f4f8ff;background:#102038;border-radius:9px 9px 0 0;
   padding:5px 7px!important;box-sizing:border-box
 }
 #view-reels .creator-reel:not(.creator-licensed-reel) .post-text{
   left:12px!important;right:12px!important;bottom:12px!important;
   background:#102038;border-radius:0 0 9px 9px;
   padding:3px 8px 6px!important
 }
 #view-reels .creator-reel:not(.creator-licensed-reel) .post-actions{
   right:3px!important;top:74px!important;bottom:auto!important;
   gap:6px!important;max-height:calc(100% - 210px)!important;
   justify-content:flex-start!important
 }
 #view-reels .creator-reel.creator-licensed-reel .creator-licensed-about{
   left:12px!important;right:12px!important;bottom:13px!important;
   position:absolute!important;padding:6px 9px!important;max-height:107px!important;
   background:#102038;border-radius:9px;overflow:hidden!important
 }
 #view-reels .creator-reel.creator-licensed-reel .creator-licensed-actions{
   right:3px!important;top:74px!important;bottom:auto!important;
   transform:none!important;max-height:calc(100% - 210px)!important;
   justify-content:flex-start!important;gap:6px!important
 }
 #view-reels .creator-reel .creator-reel-controls,
 #view-reels .creator-reel.creator-licensed-reel .creator-licensed-head{
   top:7px!important;right:6px!important;z-index:12!important
 }
 #view-reels .creator-reel .creator-video-status,
 #view-reels .creator-reel .creator-reel-failure{
   left:10px!important;right:64px!important;bottom:140px!important;
   max-height:90px!important
 }
 #view-reels .creator-reel [data-reel-fit],
 #creator-fresh-reels .creator-reel [data-reel-fit]{display:none!important}
}
