/*
 * VW WATCH TOGETHER — ANDROID PLAYER + CHAT SHELL V3.2
 * Additive mobile-only room layout. Loaded after all legacy/responsive CSS.
 * Main room surface: video + essential controls + chat + one floating Room button.
 */

:root{
  --vw-android-visible-height:100dvh;
  --vw-android-safe-top:env(safe-area-inset-top,0px);
  --vw-android-safe-bottom:env(safe-area-inset-bottom,0px);
}

#vwAndroidSheetBackdrop,#vwAndroidSheet{display:none}

@media (max-width:980px){
  body.vw-android-room-shell{
    height:var(--vw-android-visible-height,100dvh);
    min-height:0;
    overflow:hidden!important;
    overscroll-behavior:none;
    background:#020304;
  }

  body.vw-android-room-shell .ambient,
  body.vw-android-room-shell .brandbar{display:none!important}

  body.vw-android-room-shell .shell{
    width:100%;
    max-width:none;
    height:var(--vw-android-visible-height,100dvh);
    min-height:0;
    margin:0;
    padding:0!important;
    overflow:hidden;
  }

  body.vw-android-room-shell #roomView{
    width:100%;
    height:100%;
    min-height:0;
    padding:0!important;
    overflow:hidden;
  }

  /* Keep the original Room button/event binding, but turn it into one compact FAB. */
  body.vw-android-room-shell .room-top{
    position:static!important;
    display:block!important;
    width:0;
    height:0;
    min-height:0;
    margin:0!important;
    padding:0!important;
  }
  body.vw-android-room-shell .title-wrap{display:none!important}
  body.vw-android-room-shell .room-actions{
    position:static!important;
    display:block!important;
    width:0!important;
    height:0!important;
    min-height:0!important;
    margin:0!important;
    padding:0!important;
  }
  body.vw-android-room-shell .room-actions>button:not(#roomHubBtn){display:none!important}
  body.vw-android-room-shell #roomHubBtn{
    position:static!important;
    z-index:auto;
    top:auto;
    right:auto;
    display:grid!important;
    place-items:center;
    width:42px!important;
    min-width:42px!important;
    height:40px!important;
    min-height:40px!important;
    margin:0!important;
    padding:0!important;
    border:1px solid rgba(255,255,255,.16)!important;
    border-radius:12px!important;
    background:rgba(8,12,18,.78)!important;
    color:#fff!important;
    font-size:0!important;
    line-height:1!important;
    box-shadow:0 12px 35px rgba(0,0,0,.38),inset 0 1px 0 rgba(255,255,255,.08)!important;
    backdrop-filter:blur(14px);
    -webkit-backdrop-filter:blur(14px);
  }
  body.vw-android-room-shell #roomHubBtn::before{content:"☰";font-size:20px;line-height:1}
  body.vw-android-room-shell.drawer-open #roomHubBtn,
  body.vw-android-room-shell.hub-drawer-open #roomHubBtn,
  body.vw-android-room-shell.vw-android-sheet-open #roomHubBtn,
  body.vw-android-room-shell.vw-room-fullscreen #roomHubBtn{display:none!important}

  body.vw-android-room-shell .room-grid{
    display:flex!important;
    flex-direction:column;
    width:100%;
    height:100%;
    min-height:0;
    gap:0!important;
    overflow:hidden;
  }

  body.vw-android-room-shell .stage{
    flex:0 0 auto;
    width:100%;
    min-width:0;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important;
    background:#020304!important;
  }

  body.vw-android-room-shell #videoWrap{
    width:100%;
    aspect-ratio:16/9;
    min-height:0;
    max-height:none;
    margin:0!important;
    border-radius:0!important;
    background:#000!important;
  }
  body.vw-android-room-shell #videoWrap video{width:100%!important;height:100%!important;object-fit:contain!important}

  /* Two-row essential player control bar. Everything secondary moves to Room menu/sheets. */
  body.vw-android-room-shell .stage .controls{
    display:grid!important;
    grid-template-columns:44px minmax(76px,1fr) minmax(72px,auto) 42px 42px!important;
    grid-template-areas:
      "play time sync mute fs"
      "seek seek seek seek seek"!important;
    align-items:center!important;
    gap:5px 7px!important;
    width:100%!important;
    min-width:0!important;
    margin:0!important;
    padding:7px 9px 8px!important;
    border:0!important;
    border-top:1px solid rgba(255,255,255,.055)!important;
    background:linear-gradient(180deg,#0a0e14,#070a0f)!important;
  }
  body.vw-android-room-shell .stage .control-row{display:contents!important}
  body.vw-android-room-shell .stage #playPause{
    grid-area:play!important;
    width:40px!important;
    height:40px!important;
    justify-self:start;
    font-size:14px!important;
  }
  body.vw-android-room-shell .stage .timeblock{
    grid-area:time!important;
    width:auto!important;
    min-width:0!important;
    margin:0!important;
    font-size:10.5px!important;
    white-space:nowrap;
  }
  body.vw-android-room-shell .stage .sync-status{
    grid-area:sync!important;
    display:flex!important;
    justify-self:end;
    min-width:0;
    max-width:100%;
    margin:0!important;
    padding:5px 7px;
    border:1px solid rgba(255,255,255,.055);
    border-radius:999px;
    background:rgba(255,255,255,.025);
    font-size:9px!important;
    white-space:nowrap;
    overflow:hidden;
  }
  body.vw-android-room-shell .stage .sync-status span{overflow:hidden;text-overflow:ellipsis}
  body.vw-android-room-shell .stage #muteBtn,
  body.vw-android-room-shell .stage #fullscreenBtn{
    display:grid!important;
    place-items:center;
    width:40px!important;
    height:38px!important;
    min-width:40px!important;
    margin:0!important;
    padding:0!important;
    border:1px solid rgba(255,255,255,.075)!important;
    border-radius:11px!important;
    background:rgba(255,255,255,.03)!important;
    font-size:15px!important;
  }
  body.vw-android-room-shell .stage #muteBtn{grid-area:mute!important}
  body.vw-android-room-shell .stage #fullscreenBtn{grid-area:fs!important}
  body.vw-android-room-shell .stage #seek{
    grid-area:seek!important;
    display:block!important;
    width:100%!important;
    min-width:0!important;
    height:18px!important;
    margin:0!important;
  }

  /* Secondary player controls remain mounted and are re-parented into Player settings on demand. */
  body.vw-android-room-shell .stage #rateSelect,
  body.vw-android-room-shell .stage #audioTrackPicker,
  body.vw-android-room-shell .stage #volume,
  body.vw-android-room-shell .stage .vw-audio-boost{display:none!important}

  /* Remove every secondary room block from the persistent Android flow. */
  body.vw-android-room-shell .stage #playlistNav,
  body.vw-android-room-shell .stage .playback-mode-strip,
  body.vw-android-room-shell .stage>.sound-mixer,
  body.vw-android-room-shell .stage #guestNote{display:none!important}

  /* V3.3 premium live presence bar — in normal flow, never over the movie. */
  body.vw-android-room-shell .vw-android-presence-bar{
    flex:0 0 auto;
    display:flex;
    align-items:center;
    gap:8px;
    width:100%;
    min-height:52px;
    padding:6px 9px;
    border-top:1px solid rgba(255,255,255,.055);
    border-bottom:1px solid rgba(255,255,255,.06);
    background:linear-gradient(180deg,rgba(13,18,27,.98),rgba(8,12,18,.98));
    box-shadow:0 8px 24px rgba(0,0,0,.18);
  }
  body.vw-android-room-shell .vw-android-presence-main{
    flex:1 1 auto;
    min-width:0;
    height:40px;
    display:flex;
    align-items:center;
    gap:7px;
    margin:0;
    padding:0 8px;
    border:0;
    border-radius:12px;
    background:transparent;
    color:#edf3ff;
    text-align:left;
  }
  body.vw-android-room-shell .vw-android-presence-main:active{background:rgba(255,255,255,.055)}
  body.vw-android-room-shell .vw-android-live-dot{
    flex:0 0 auto;
    width:8px;
    height:8px;
    border-radius:50%;
    background:#35dda0;
    box-shadow:0 0 0 4px rgba(53,221,160,.09),0 0 14px rgba(53,221,160,.22);
  }
  body.vw-android-room-shell .vw-android-presence-count{
    flex:0 0 auto;
    font-size:11px;
    font-weight:850;
    letter-spacing:.01em;
    white-space:nowrap;
  }
  body.vw-android-room-shell .vw-android-presence-avatars{
    flex:1 1 auto;
    min-width:0;
    display:flex;
    justify-content:flex-end;
    align-items:center;
    padding-right:3px;
  }
  body.vw-android-room-shell .vw-presence-avatar,
  body.vw-android-room-shell .vw-presence-more{
    display:grid;
    place-items:center;
    width:27px;
    height:27px;
    margin-left:-5px;
    border:2px solid #0b1018;
    border-radius:50%;
    background:linear-gradient(145deg,#7158ff,#9b72ff);
    color:#fff;
    font-size:10px;
    font-weight:900;
    box-shadow:0 3px 10px rgba(0,0,0,.24);
  }
  body.vw-android-room-shell .vw-presence-avatar.paused{box-shadow:inset 0 0 0 2px rgba(255,193,94,.75),0 3px 10px rgba(0,0,0,.24)}
  body.vw-android-room-shell .vw-presence-avatar.buffering{box-shadow:inset 0 0 0 2px rgba(90,188,255,.8),0 3px 10px rgba(0,0,0,.24)}
  body.vw-android-room-shell .vw-presence-more{background:#202938;color:#b9c4d7;font-size:9px}
  body.vw-android-room-shell .vw-android-presence-menu{
    flex:0 0 auto;
    display:flex;
    align-items:center;
  }
  body.vw-android-room-shell .vw-android-presence-menu #roomHubBtn{
    position:static!important;
    display:grid!important;
  }

  /* Join/leave events stay lightweight so chat remains about conversation. */
  body.vw-android-room-shell #chatMessages .room-presence-event{
    padding:0!important;
    border:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  body.vw-android-room-shell .room-presence-event-inner{
    display:flex;
    align-items:center;
    gap:7px;
    min-height:27px;
    padding:4px 7px;
    border-radius:9px;
    background:rgba(255,255,255,.025);
    color:#8996a8;
    font-size:10px;
    line-height:1.2;
  }
  body.vw-android-room-shell .room-presence-event-dot{
    width:6px;
    height:6px;
    flex:0 0 auto;
    border-radius:50%;
    background:#35dda0;
  }
  body.vw-android-room-shell .room-presence-leave .room-presence-event-dot{background:#657083}
  body.vw-android-room-shell .room-presence-self .room-presence-event-dot{background:#8a6cff}
  body.vw-android-room-shell .room-presence-event-text{
    flex:1 1 auto;
    min-width:0;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  body.vw-android-room-shell .room-presence-event time{
    flex:0 0 auto;
    color:#667387;
    font-size:9px;
  }

  body.vw-android-room-shell .sidebar{
    flex:1 1 auto;
    display:block!important;
    width:100%;
    min-width:0;
    min-height:0;
    margin:0!important;
    padding:0!important;
    overflow:hidden;
  }
  body.vw-android-room-shell .sidebar>.side-card:not(.chat){display:none!important}
  body.vw-android-room-shell .side-card.chat{
    display:flex!important;
    flex-direction:column;
    width:100%;
    height:100%!important;
    min-height:0!important;
    margin:0!important;
    padding:7px 9px calc(8px + var(--vw-android-safe-bottom))!important;
    border:0!important;
    border-top:1px solid rgba(255,255,255,.055)!important;
    border-radius:0!important;
    box-shadow:none!important;
    background:linear-gradient(180deg,#0a0e14,#070a0f)!important;
    overflow:hidden;
  }
  body.vw-android-room-shell .side-card.chat>.side-head{display:none!important}
  body.vw-android-room-shell #chatMessages{
    flex:1 1 auto!important;
    min-height:0!important;
    overflow:auto!important;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    margin:0 0 7px!important;
    padding:5px 2px!important;
    gap:7px!important;
    scroll-padding-bottom:12px;
  }
  body.vw-android-room-shell #chatMessages .msg{padding:8px 9px!important;border-radius:10px!important}
  body.vw-android-room-shell #chatMessages .msg p{font-size:12.5px!important;line-height:1.38!important}
  body.vw-android-room-shell #chatForm{
    flex:0 0 auto;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 44px;
    gap:7px!important;
    width:100%;
    margin:0!important;
    padding:0!important;
  }
  body.vw-android-room-shell #chatInput{
    width:100%!important;
    height:44px;
    min-width:0;
    margin:0!important;
    padding:0 13px!important;
    border-radius:13px!important;
    font-size:16px!important;
  }
  body.vw-android-room-shell #chatForm button{
    width:44px!important;
    height:44px!important;
    margin:0!important;
    border-radius:13px!important;
  }

  /* Existing Room Menu becomes a clean bottom sheet on Android. */
  body.vw-android-room-shell .room-hub-drawer{
    left:0!important;
    right:0!important;
    top:auto!important;
    bottom:0!important;
    width:100%!important;
    max-width:none!important;
    height:min(78dvh,720px)!important;
    max-height:calc(var(--vw-android-visible-height,100dvh) - 18px)!important;
    padding:16px 14px calc(14px + var(--vw-android-safe-bottom))!important;
    border:0!important;
    border-top:1px solid rgba(255,255,255,.11)!important;
    border-radius:24px 24px 0 0!important;
    box-shadow:0 -22px 70px rgba(0,0,0,.48)!important;
  }
  body.vw-android-room-shell .hub-head{position:sticky;top:-16px;z-index:4;margin:0 -14px 10px;padding:15px 14px 12px;background:rgba(13,20,32,.96);backdrop-filter:blur(14px)}
  body.vw-android-room-shell .hub-head .eyebrow{margin-bottom:4px!important}
  body.vw-android-room-shell .hub-head h2{margin:0!important;font-size:22px!important}
  body.vw-android-room-shell .hub-head p{display:none!important}

  .vw-android-hub-tools{
    display:grid!important;
    grid-template-columns:1fr 1fr;
    gap:8px;
    margin:12px 0 0;
    padding:12px 0 0;
    border-top:1px solid rgba(255,255,255,.065);
  }
  .vw-android-hub-tools button{
    min-height:46px;
    border:1px solid rgba(255,255,255,.09);
    border-radius:12px;
    background:rgba(255,255,255,.045);
    color:#edf2ff;
    padding:8px 10px;
    font:800 11px/1.15 inherit;
    text-align:left;
  }
  .vw-android-hub-tools button small{display:block;margin-top:3px;color:#8291a6;font-size:9px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .vw-android-hub-tools button:disabled{opacity:.42}

  /* Reusable sheet for participants, local player settings and sound mixer. */
  body.vw-android-room-shell #vwAndroidSheetBackdrop:not(.hidden){
    display:block!important;
    position:fixed;
    inset:0;
    z-index:1090;
    background:rgba(0,0,0,.64);
    backdrop-filter:blur(5px);
  }
  body.vw-android-room-shell #vwAndroidSheet:not(.hidden){
    display:flex!important;
    position:fixed;
    z-index:1100;
    left:0;
    right:0;
    bottom:0;
    flex-direction:column;
    width:100%;
    max-height:min(82dvh,calc(var(--vw-android-visible-height,100dvh) - 12px));
    padding:0 12px calc(12px + var(--vw-android-safe-bottom));
    border-top:1px solid rgba(255,255,255,.11);
    border-radius:24px 24px 0 0;
    background:linear-gradient(180deg,#111824,#090e15);
    box-shadow:0 -24px 75px rgba(0,0,0,.52);
    overflow:hidden;
  }
  .vw-android-sheet-head{
    flex:0 0 auto;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    min-height:62px;
    padding:10px 2px 8px;
    border-bottom:1px solid rgba(255,255,255,.065);
  }
  .vw-android-sheet-head span{display:block;color:#8998ac;font-size:9px;font-weight:800;letter-spacing:.12em}
  .vw-android-sheet-head b{display:block;margin-top:3px;font-size:18px}
  #vwAndroidSheetClose{width:38px;height:38px;border:1px solid rgba(255,255,255,.1);border-radius:12px;background:rgba(255,255,255,.05);color:#fff;font-size:22px}
  #vwAndroidSheetBody{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain;padding:11px 0 2px}

  /* Existing nodes are moved here without cloning IDs/event listeners. */
  #vwAndroidSheet .side-card{display:block!important;width:100%!important;margin:0!important;padding:12px!important;border-radius:15px!important;box-shadow:none!important}
  #vwAndroidSheet .side-card .members{max-height:none!important;overflow:visible!important}
  #vwAndroidSheet .sound-mixer{display:block!important;width:100%!important;margin:0!important;padding:12px!important;border-radius:15px!important}
  #vwAndroidSheet .mix-grid{grid-template-columns:1fr!important}
  #vwAndroidSheet .mix-presets{grid-column:auto!important}

  .vw-player-settings{display:grid;gap:10px}
  .vw-player-setting-row{display:grid;gap:7px;padding:12px;border:1px solid rgba(255,255,255,.075);border-radius:14px;background:rgba(255,255,255,.028)}
  .vw-player-setting-row>label{color:#8493a7;font-size:9px;font-weight:800;letter-spacing:.10em;text-transform:uppercase}
  .vw-player-setting-control{min-width:0}
  #vwAndroidSheet #rateSelect{display:block!important;width:100%!important;height:42px!important;font-size:13px!important}
  #vwAndroidSheet #volume{display:block!important;width:100%!important;max-width:none!important;margin:4px 0!important}
  #vwAndroidSheet #audioTrackPicker{display:flex!important;position:static!important;width:100%!important;z-index:auto!important}
  #vwAndroidSheet #audioTrackBtn{display:grid!important;width:100%!important;min-width:0!important;height:44px!important;grid-template-columns:24px minmax(0,1fr) 18px!important;padding:5px 9px!important}
  #vwAndroidSheet #audioTrackBtn .audio-track-button-copy{display:flex!important}
  #vwAndroidSheet #audioTrackBtn .audio-track-button-copy small{display:block!important}
  #vwAndroidSheet #audioTrackBtn .audio-track-button-copy b{display:block!important;max-width:none!important;font-size:12px!important}
  #vwAndroidSheet #audioTrackBtn .audio-track-caret{display:block!important}
  #vwAndroidSheet .vw-audio-boost{display:block!important;width:100%!important;margin:0!important}
  #vwAndroidSheet .vw-voice-btn{display:flex!important;width:100%!important;max-width:none!important;height:42px!important;justify-content:center!important}
  #vwAndroidSheet .vw-voice-panel{left:12px!important;right:12px!important;bottom:12px!important;width:auto!important;z-index:1210!important}

  /* Library drawers remain full-screen secondary surfaces; make safe-area padding explicit. */
  body.vw-android-room-shell #libraryDrawer,
  body.vw-android-room-shell #soundtrackDrawer{
    height:var(--vw-android-visible-height,100dvh)!important;
    max-height:none!important;
    padding-top:calc(14px + var(--vw-android-safe-top))!important;
    padding-bottom:calc(14px + var(--vw-android-safe-bottom))!important;
  }

  body.vw-android-room-shell .toast{bottom:calc(64px + var(--vw-android-safe-bottom));z-index:1300}
}

@media (max-width:380px){
  body.vw-android-room-shell .stage .controls{
    grid-template-columns:40px minmax(64px,1fr) minmax(62px,auto) 38px 38px!important;
    gap:5px!important;
    padding-inline:7px!important;
  }
  body.vw-android-room-shell .stage #playPause{width:38px!important;height:38px!important}
  body.vw-android-room-shell .stage #muteBtn,
  body.vw-android-room-shell .stage #fullscreenBtn{width:36px!important;min-width:36px!important;height:36px!important}
  body.vw-android-room-shell .stage .sync-status{font-size:8px!important;padding-inline:5px!important}
  .vw-android-hub-tools{grid-template-columns:1fr}
}

/* Phone landscape: cinema left, chat right. Still only player + chat on the persistent surface. */
@media (max-width:980px) and (orientation:landscape) and (max-height:620px){
  body.vw-android-room-shell .room-grid{
    display:grid!important;
    grid-template-columns:minmax(0,1.65fr) minmax(250px,.72fr)!important;
    grid-template-rows:minmax(0,1fr)!important;
  }
  body.vw-android-room-shell .stage{
    display:flex!important;
    flex-direction:column;
    height:100%!important;
    min-height:0!important;
    overflow:hidden!important;
    border-right:1px solid rgba(255,255,255,.055)!important;
  }
  body.vw-android-room-shell #videoWrap{
    flex:1 1 auto!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    aspect-ratio:auto!important;
  }
  body.vw-android-room-shell .stage .controls{flex:0 0 auto!important}
  body.vw-android-room-shell .sidebar{height:100%!important;min-height:0!important}
  body.vw-android-room-shell .side-card.chat{border-top:0!important}
  body.vw-android-room-shell.vw-android-keyboard-open #videoWrap{height:auto!important;min-height:0!important}
}

/* Fullscreen stays owned by #videoWrap; external Android chrome is intentionally absent. */
#videoWrap:fullscreen{background:#000!important}
#videoWrap:-webkit-full-screen{background:#000!important}

/* VW_WATCH_TOGETHER_ANDROID_PLAYER_CHAT_SHELL_V3_3 */

/* ==========================================================================
 * VW_WATCH_TOGETHER_ANDROID_STABLE_PARENT_IME_V3_6R4
 * VW_WATCH_TOGETHER_ANDROID_IME_VISUAL_SYNC_V3_6R4_3
 *
 * One authoritative keyboard layer.
 *
 * Invariant:
 * #chatForm remains under its original chat parent for the entire room session.
 * Keyboard open/close changes CSS geometry only — never DOM ownership.
 * ========================================================================== */

.vw-android-composer-slot{display:none}

@media (max-width:980px) and (orientation:portrait){

  /* Freeze the exact pre-keyboard shell/video throughout the IME session. */
  body.vw-android-room-shell.vw-android-ime-session,
  body.vw-android-room-shell.vw-android-ime-session .shell{
    height:var(--vw-android-layout-height,var(--vw-android-visible-height,100dvh))!important;
    min-height:0!important;
  }

  body.vw-android-room-shell.vw-android-ime-session #roomView,
  body.vw-android-room-shell.vw-android-ime-session .room-grid{
    height:100%!important;
    min-height:0!important;
  }

  body.vw-android-room-shell.vw-android-ime-session #videoWrap{
    flex:0 0 auto!important;
    width:100%!important;
    height:var(--vw-android-stable-video-height,auto)!important;
    min-height:0!important;
    max-height:none!important;
    aspect-ratio:auto!important;
  }

  body.vw-android-room-shell.vw-android-ime-session #videoWrap video{
    width:100%!important;
    height:100%!important;
    object-fit:contain!important;
  }

  body.vw-android-room-shell.vw-android-ime-session .stage .controls{
    padding:7px 9px 8px!important;
  }

  body.vw-android-room-shell.vw-android-ime-session .vw-android-presence-bar{
    min-height:52px!important;
    padding:6px 9px!important;
  }

  body.vw-android-room-shell.vw-android-ime-session .vw-android-presence-main{
    height:40px!important;
  }

  /*
   * Opening handshake:
   * until keyboardOpen is committed, the focused form stays exactly in normal
   * chat flow. No position switch occurs inside the initiating pointer gesture.
   */
  body.vw-android-room-shell.vw-android-ime-session:not(.vw-android-keyboard-open) .sidebar,
  body.vw-android-room-shell.vw-android-ime-session:not(.vw-android-keyboard-open) .side-card.chat{
    overflow:visible!important;
    clip:auto!important;
    clip-path:none!important;
    contain:none!important;
  }

  body.vw-android-room-shell.vw-android-ime-session:not(.vw-android-keyboard-open) #chatMessages{
    overflow-x:hidden!important;
    overflow-y:auto!important;
  }

  body.vw-android-room-shell.vw-android-ime-session:not(.vw-android-keyboard-open) #chatForm{
    position:relative!important;
    z-index:2147483000!important;
    inset:auto!important;

    /*
     * During the safety wait, only a compositor transform moves the actual
     * focused form. DOM parent/layout ownership/focus do not change.
     */
    transform:translate3d(0,var(--vw-android-ime-open-shift,0px),0)!important;
    transition:none!important;
    animation:none!important;
    will-change:transform!important;
    backface-visibility:hidden!important;
    -webkit-backface-visibility:hidden!important;
  }

  /* Keyboard-open chat gets only the physical space that remains above IME. */
  body.vw-android-room-shell.vw-android-keyboard-open .sidebar{
    flex:0 0 var(--vw-android-keyboard-chat-height,56px)!important;
    width:100%!important;
    height:var(--vw-android-keyboard-chat-height,56px)!important;
    min-height:0!important;
    max-height:var(--vw-android-keyboard-chat-height,56px)!important;

    /*
     * R3 portal was added because overflow:hidden could hide a same-parent fixed
     * composer. R4 keeps the parent stable and explicitly removes those clipping
     * boundaries only while typing.
     */
    overflow:visible!important;
    clip:auto!important;
    clip-path:none!important;
    contain:none!important;
  }

  body.vw-android-room-shell.vw-android-keyboard-open .side-card.chat{
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:100%!important;
    overflow:visible!important;
    clip:auto!important;
    clip-path:none!important;
    contain:none!important;
  }

  body.vw-android-room-shell.vw-android-keyboard-open #chatMessages{
    flex:1 1 auto!important;
    min-height:0!important;
    max-height:100%!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    scroll-padding-bottom:12px!important;
  }

  body.vw-android-room-shell.vw-android-keyboard-open.vw-android-keyboard-tight .vw-android-presence-bar{
    display:none!important;
  }

  /* Slot was pre-created while keyboard was closed; showing it mutates no DOM. */
  body.vw-android-room-shell.vw-android-keyboard-open .vw-android-composer-slot{
    box-sizing:border-box!important;
    display:block!important;
    flex:0 0 var(--vw-android-floating-composer-height,44px)!important;
    width:100%!important;
    height:var(--vw-android-floating-composer-height,44px)!important;
    min-height:var(--vw-android-floating-composer-height,44px)!important;
    max-height:var(--vw-android-floating-composer-height,44px)!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    background:transparent!important;
    opacity:0!important;
    pointer-events:none!important;
  }

  /*
   * The SAME in-chat form is fixed above Gboard. Since parent ownership never
   * changes, Chrome has no focus/IME reason to tear down and reopen the editor.
   */
  body.vw-android-room-shell.vw-android-keyboard-open #chatForm{
    box-sizing:border-box!important;
    display:flex!important;
    position:fixed!important;
    z-index:2147483000!important;

    left:var(--vw-android-floating-composer-left,9px)!important;
    right:auto!important;
    top:auto!important;
    bottom:var(--vw-android-live-composer-bottom,var(--vw-android-floating-composer-bottom,5px))!important;

    width:var(--vw-android-floating-composer-width,calc(100vw - 18px))!important;
    height:var(--vw-android-floating-composer-height,44px)!important;
    min-height:var(--vw-android-floating-composer-height,44px)!important;
    max-height:var(--vw-android-floating-composer-height,44px)!important;

    margin:0!important;
    padding:0!important;
    gap:7px!important;

    transform:none!important;
    transition:none!important;
    animation:none!important;

    overflow:visible!important;
    opacity:1!important;
    visibility:visible!important;
    pointer-events:auto!important;

    border:0!important;
    border-radius:14px!important;
    background:rgba(7,10,15,.99)!important;
    box-shadow:
      0 0 0 5px rgba(7,10,15,.96),
      0 -8px 24px rgba(0,0,0,.38)!important;

    isolation:isolate!important;
    will-change:auto!important;
    backface-visibility:hidden!important;
    -webkit-backface-visibility:hidden!important;
  }

  body.vw-android-room-shell.vw-android-keyboard-open #chatForm #chatInput{
    box-sizing:border-box!important;
    display:block!important;
    flex:1 1 auto!important;
    min-width:0!important;
    width:auto!important;

    height:44px!important;
    min-height:44px!important;
    max-height:44px!important;

    margin:0!important;
    padding:0 13px!important;

    opacity:1!important;
    visibility:visible!important;
    pointer-events:auto!important;

    border:1px solid rgba(131,98,255,.76)!important;
    border-radius:13px!important;
    outline:none!important;
    background:#0b1018!important;

    color:#f5f7fb!important;
    -webkit-text-fill-color:#f5f7fb!important;
    caret-color:#ad96ff!important;

    font-size:16px!important;
    line-height:1.2!important;

    transform:none!important;
    transition:none!important;
    animation:none!important;

    box-shadow:
      inset 0 0 0 1px rgba(124,85,255,.12),
      0 0 0 1px rgba(124,85,255,.08)!important;
  }

  body.vw-android-room-shell.vw-android-keyboard-open #chatForm>.gif-picker-btn,
  body.vw-android-room-shell.vw-android-keyboard-open #chatForm>button[type="submit"]{
    box-sizing:border-box!important;
    display:inline-flex!important;
    flex:0 0 44px!important;
    align-items:center!important;
    justify-content:center!important;

    width:44px!important;
    min-width:44px!important;
    max-width:44px!important;
    height:44px!important;
    min-height:44px!important;
    max-height:44px!important;

    margin:0!important;
    position:relative!important;
    z-index:2!important;
    visibility:visible!important;
    opacity:1!important;
    pointer-events:auto!important;
    transition:none!important;
    animation:none!important;
  }
}

@media (max-width:380px) and (orientation:portrait){
  body.vw-android-room-shell.vw-android-keyboard-open #chatForm{
    left:var(--vw-android-floating-composer-left,7px)!important;
    width:var(--vw-android-floating-composer-width,calc(100vw - 14px))!important;
    gap:6px!important;
  }
}

/* Landscape keeps its existing side-by-side player layout. */
@media (max-width:980px) and (orientation:landscape){
  body.vw-android-room-shell.vw-android-ime-session #videoWrap{
    height:auto!important;
    min-height:0!important;
    aspect-ratio:auto!important;
  }

  body.vw-android-room-shell #chatForm{
    position:static!important;
    inset:auto!important;
    transform:none!important;
  }
}

:root{--vw-android-stable-parent-ime-v3-6r4:1;--vw-android-ime-visual-sync-v3-6r4-3:1}


/* VW_WATCH_TOGETHER_PRESENCE_COMPOSER_GUARD_V3_9R1
   Applied only for ~900ms after the runtime guard proves that the composer is
   unhealthy. Intentional GIF/full-preview modes are explicitly excluded. */
@media (max-width:980px){
  body.vw-android-room-shell.vw-composer-presence-recover:not(.vw-gif-tray-open):not(.vw-gif-preview-open):not(.vw-room-fullscreen):not(.vw-private-messages-list) #chatForm{
    display:flex!important;
    visibility:visible!important;
    opacity:1!important;
    pointer-events:auto!important;
    clip:auto!important;
    clip-path:none!important;
  }
}



/* VW_WATCH_TOGETHER_PRIVATE_MESSAGES_LIST_GUARD_V3_10R4 */


/* VW_PRIVATE_COMPOSER_FIRST_FIXED_V3_15R8R5 */
@media (max-width:980px){
  body.vw-android-room-shell.vw-private-thread-open.vw-private-composer-focus-lock #chatForm{
    box-sizing:border-box!important;
    display:grid!important;
    position:fixed!important;
    z-index:2147483500!important;
    left:var(--vw-android-floating-composer-left,9px)!important;
    right:auto!important;
    top:var(--vw-private-focus-composer-top,calc(100dvh - 49px))!important;
    bottom:auto!important;
    width:var(--vw-android-floating-composer-width,calc(100vw - 18px))!important;
    height:var(--vw-private-focus-composer-height,var(--vw-android-floating-composer-height,44px))!important;
    min-height:var(--vw-private-focus-composer-height,var(--vw-android-floating-composer-height,44px))!important;
    max-height:var(--vw-private-focus-composer-height,var(--vw-android-floating-composer-height,44px))!important;
    margin:0!important;
    padding:0!important;
    gap:6px!important;
    transform:none!important;
    transition:none!important;
    animation:none!important;
    will-change:top!important;
    overflow:visible!important;
    opacity:1!important;
    visibility:visible!important;
    pointer-events:auto!important;
  }
  body.vw-android-room-shell.vw-private-thread-open.vw-private-composer-focus-lock #chatInput{
    height:44px!important;
    min-height:44px!important;
    max-height:44px!important;
  }
}


/* V3.15R8R9 — PRIVATE NATIVE KEYBOARD INSET AUTHORITY
   overlaysContent=true keeps the player stable.
   Chrome's keyboard-inset-height is in the correct fixed-position coordinate
   system. JS boundingRect height is fallback only. */
@media (max-width:980px){
  body.vw-android-room-shell.vw-private-thread-open.vw-private-composer-focus-lock #chatForm{
    position:fixed!important;
    z-index:2147483600!important;

    top:auto!important;
    bottom:calc(
      max(
        env(keyboard-inset-height, 0px),
        var(--vw-private-keyboard-fallback-inset, 0px),
        var(--vw-android-keyboard-inset, 0px)
      )
      + 5px
    )!important;

    transform:none!important;
    transition:none!important;
    animation:none!important;
    will-change:bottom!important;

    visibility:visible!important;
    opacity:1!important;
    pointer-events:auto!important;
  }
}
