/* V3_15R8R5_FOCUS_CSS_OPTS_OUT_IN_SINGLE_OWNER */
/* VW_WATCH_TOGETHER_PM_KEYBOARD_FOCUS_POLISH_V3_15R6R2R2
   Locked by V3.15A17R1 collision-safe runtime audit.

   Goals:
   - keyboard + video visible: keep SAME video, hide the large PM header,
     show one compact body-level "Hide video" chip;
   - keyboard + video hidden: show a collision-free one-strip PM header;
   - slimmer composer;
   - keep the latest message visible while typing and after sending;
   - keyboard close restores the existing R5R1/R6R1 normal geometry;
   - no video recreation/re-parenting.
*/

:root{
  --vw-r6r2-ease:cubic-bezier(.2,.82,.18,1);
}

@media(max-width:980px){
  /* ---------- keyboard focus mode ---------- */
  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode #chatForm{
    box-sizing:border-box!important;
    height:52px!important;
    min-height:52px!important;
    max-height:52px!important;
    padding:5px 7px!important;
    gap:5px!important;
    grid-template-columns:38px 42px minmax(0,1fr) 44px!important;
    border-radius:16px!important;
    transition:
      height .20s ease,
      min-height .20s ease,
      padding .20s ease,
      gap .20s ease!important;
  }

  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode #chatForm > button{
    box-sizing:border-box!important;
    min-width:0!important;
    min-height:40px!important;
    height:40px!important;
    max-height:40px!important;
    border-radius:13px!important;
  }

  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode #chatForm input[type="text"],
  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode #chatForm textarea{
    box-sizing:border-box!important;
    height:40px!important;
    min-height:40px!important;
    max-height:40px!important;
    margin:0!important;
    padding-top:0!important;
    padding-bottom:0!important;
    border-radius:13px!important;
    font-size:16px!important;
    line-height:40px!important;
  }

  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode .private-thread-messages{
    min-height:0!important;
    padding-bottom:16px!important;
    scroll-padding-bottom:16px!important;
  }

  /* Video is still visible: the full PM header is intentionally absent. */
  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode.vw-r6r2-video-visible .private-thread-head{
    display:none!important;
  }

  /* Video hidden: bring back one compact, collision-safe PM header strip. */
  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode.vw-r6r2-video-hidden .private-thread-head{
    box-sizing:border-box!important;
    display:grid!important;
    grid-template-columns:38px minmax(0,1fr) auto!important;
    align-items:center!important;
    gap:5px!important;
    min-height:48px!important;
    height:48px!important;
    max-height:48px!important;
    padding:4px 6px!important;
    overflow:hidden!important;
    border-bottom:1px solid rgba(255,255,255,.055)!important;
    background:linear-gradient(180deg,rgba(8,13,22,.99),rgba(6,10,17,.99))!important;
    box-shadow:0 7px 20px rgba(0,0,0,.16)!important;
  }

  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode.vw-r6r2-video-hidden .private-thread-avatar{
    display:none!important;
  }

  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode.vw-r6r2-video-hidden .private-surface-back{
    box-sizing:border-box!important;
    grid-column:1!important;
    grid-row:1!important;
    width:36px!important;
    min-width:36px!important;
    max-width:36px!important;
    height:36px!important;
    min-height:36px!important;
    max-height:36px!important;
    padding:0!important;
    margin:0!important;
    border-radius:11px!important;
  }

  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode.vw-r6r2-video-hidden .private-thread-title{
    grid-column:2!important;
    grid-row:1!important;
    min-width:0!important;
    overflow:hidden!important;
  }

  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode.vw-r6r2-video-hidden .private-thread-title > b,
  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode.vw-r6r2-video-hidden .private-thread-title > small{
    display:block!important;
    max-width:100%!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }

  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode.vw-r6r2-video-hidden .private-thread-title > b{
    font-size:15px!important;
    line-height:18px!important;
  }

  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode.vw-r6r2-video-hidden .private-thread-title > small{
    margin-top:1px!important;
    font-size:8px!important;
    line-height:12px!important;
    opacity:.78!important;
  }

  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode.vw-r6r2-video-hidden .vw-premium-pm-actions{
    box-sizing:border-box!important;
    grid-column:3!important;
    grid-row:1!important;
    display:flex!important;
    align-items:center!important;
    justify-self:end!important;
    gap:4px!important;
    min-width:0!important;
    max-width:100%!important;
    white-space:nowrap!important;
    overflow:hidden!important;
  }

  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode.vw-r6r2-video-hidden .vw-premium-pm-actions .vw-premium-pm-icon,
  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode.vw-r6r2-video-hidden .vw-premium-pm-actions .private-thread-close{
    box-sizing:border-box!important;
    height:34px!important;
    min-height:34px!important;
    max-height:34px!important;
    margin:0!important;
    border-radius:10px!important;
  }

  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode.vw-r6r2-video-hidden .vw-premium-pm-actions #vwPremiumPmPlayerBtn{
    width:32px!important;
    min-width:32px!important;
    max-width:32px!important;
    padding:0!important;
  }

  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode.vw-r6r2-video-hidden .vw-premium-pm-actions #vwPremiumPmVideoBtn{
    display:none!important;
  }

  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode.vw-r6r2-video-hidden .vw-premium-pm-actions .private-thread-close{
    width:auto!important;
    min-width:44px!important;
    max-width:52px!important;
    padding:0 6px!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    font-size:8.5px!important;
  }

  /* The dedicated compact Show button lives inside the real action group. */
  #vwR6R2HeaderShowVideo{
    box-sizing:border-box;
    display:none;
    width:44px;
    min-width:44px;
    max-width:44px;
    height:34px;
    min-height:34px;
    max-height:34px;
    padding:0 5px;
    border:1px solid rgba(145,132,255,.25);
    border-radius:10px;
    background:rgba(119,104,255,.11);
    color:#f1f3ff;
    font:800 8.5px/1 system-ui,sans-serif;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    -webkit-tap-highlight-color:transparent;
  }

  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode.vw-r6r2-video-hidden #vwR6R2HeaderShowVideo{
    display:grid!important;
    place-items:center!important;
  }

  /* Full hidden-player state: PM surface starts at viewport top. */
  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode.vw-r6r2-video-hidden .private-messages-surface{
    top:var(--vw-r6r2-surface-top,0px)!important;
    bottom:auto!important;
    height:var(--vw-r6r2-surface-height,calc(100dvh - 58px))!important;
    max-height:none!important;
    transition:
      top .28s var(--vw-r6r2-ease),
      height .28s var(--vw-r6r2-ease)!important;
  }

  /* Visible-player focus state: messages begin directly below the player. */
  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode.vw-r6r2-video-visible .private-messages-surface{
    top:var(--vw-r6r2-surface-top,170px)!important;
    bottom:auto!important;
    height:var(--vw-r6r2-surface-height,calc(100dvh - 228px))!important;
    max-height:none!important;
    transition:
      top .24s var(--vw-r6r2-ease),
      height .24s var(--vw-r6r2-ease)!important;
  }

  #vwR6R2HideVideoChip{
    box-sizing:border-box;
    position:fixed;
    z-index:2147482865;
    display:none;
    align-items:center;
    justify-content:center;
    height:32px;
    min-height:32px;
    padding:0 11px;
    border:1px solid rgba(145,132,255,.34);
    border-radius:999px;
    background:rgba(8,13,23,.94);
    color:#fff;
    box-shadow:0 8px 24px rgba(0,0,0,.28),inset 0 1px 0 rgba(255,255,255,.025);
    backdrop-filter:blur(14px);
    -webkit-backdrop-filter:blur(14px);
    font:800 11px/1 system-ui,sans-serif;
    white-space:nowrap;
    -webkit-tap-highlight-color:transparent;
    transition:transform .18s ease,opacity .18s ease;
  }

  #vwR6R2HideVideoChip:active{
    transform:scale(.94);
  }

  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode.vw-r6r2-video-visible #vwR6R2HideVideoChip{
    display:inline-flex!important;
    right:10px!important;
    top:var(--vw-r6r2-chip-top,8px)!important;
  }
}

@media(max-width:360px){
  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode #chatForm{
    grid-template-columns:36px 40px minmax(0,1fr) 42px!important;
  }

  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode.vw-r6r2-video-hidden .private-thread-head{
    grid-template-columns:36px minmax(0,1fr) auto!important;
    gap:4px!important;
    padding-left:5px!important;
    padding-right:5px!important;
  }

  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode.vw-r6r2-video-hidden .vw-premium-pm-actions{
    gap:3px!important;
  }

  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode.vw-r6r2-video-hidden .vw-premium-pm-actions #vwPremiumPmPlayerBtn{
    width:30px!important;
    min-width:30px!important;
    max-width:30px!important;
    height:32px!important;
    min-height:32px!important;
    max-height:32px!important;
  }

  #vwR6R2HeaderShowVideo{
    width:42px!important;
    min-width:42px!important;
    max-width:42px!important;
    height:32px!important;
    min-height:32px!important;
    max-height:32px!important;
    font-size:8px!important;
  }

  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode.vw-r6r2-video-hidden .vw-premium-pm-actions .private-thread-close{
    min-width:40px!important;
    max-width:46px!important;
    height:32px!important;
    min-height:32px!important;
    max-height:32px!important;
    padding:0 5px!important;
    font-size:8px!important;
  }
}

@media(prefers-reduced-motion:reduce){
  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode .stage,
  body:not(.vw-pm-single-owner-ready).vw-r6r2-focus-ready.vw-r6r2-focus-mode .private-messages-surface,
  #vwR6R2HideVideoChip{
    transition:none!important;
  }
}
