/* Omni Mobile 158
 * Fixed mini central always visible; call-only icons, readable username,
 * centered voice portrait, stacked on-demand screen shares, and aligned
 * community/channel dialog close controls. Desktop voice layout preserved. */

/* Both creation wizards must anchor the X in the true upper-right corner,
   independent of the width of the title or the private-community badge. */
#nexoCommunityWizard > .nexo-cw-header,
#nexoChannelWizard > .nexo-cw-header {
  position:relative!important;
  box-sizing:border-box!important;
  padding-right:62px!important;
  min-width:0!important;
}
#nexoCommunityWizard > .nexo-cw-header > .nexo-cw-title-group,
#nexoChannelWizard > .nexo-cw-header > .nexo-cw-title-group {
  min-width:0!important;
  flex:1 1 auto!important;
}
#nexoCommunityWizard > .nexo-cw-header > #nexoCwClose,
#nexoChannelWizard > .nexo-cw-header > #nexoChClose {
  position:absolute!important;
  right:15px!important;
  top:50%!important;
  left:auto!important;
  bottom:auto!important;
  transform:translateY(-50%)!important;
  margin:0!important;
  padding:0!important;
  box-sizing:border-box!important;
  display:grid!important;
  place-items:center!important;
  width:38px!important;
  height:38px!important;
  min-width:38px!important;
  min-height:38px!important;
  border-radius:10px!important;
  z-index:10!important;
  font-size:24px!important;
  line-height:1!important;
}
@media(max-width:520px){
  #nexoCommunityWizard > .nexo-cw-header,
  #nexoChannelWizard > .nexo-cw-header {
    padding-right:58px!important;
  }
  #nexoCommunityWizard > .nexo-cw-header > #nexoCwClose,
  #nexoChannelWizard > .nexo-cw-header > #nexoChClose {
    right:12px!important;
  }
}
@media(max-width:760px){
  /* Fix the visibility regression: old mobile in-call CSS forced
     display:grid on every user-control, even with the hidden attribute. */
  body #appShell.app-shell.omni-mobile-rework153
    #miniCentral .mini-central-buttons > button[hidden] {
    display:none!important;
    visibility:hidden!important;
    pointer-events:none!important;
  }
  body #appShell.app-shell.omni-mobile-rework153
    #miniCentral #settingsButton {
    display:none!important;
    visibility:hidden!important;
    pointer-events:none!important;
  }
  /* The Mini Central is the bottom anchor in every view, not a conditional
     call player. Only its five in-call action buttons come and go. */
  body #appShell.app-shell.omni-mobile-rework153 > #miniCentral {
    display:flex!important;
    position:fixed!important;
    left:0!important;right:0!important;bottom:0!important;top:auto!important;
    width:100vw!important;max-width:100vw!important;
    min-height:calc(75px + env(safe-area-inset-bottom))!important;
    height:calc(75px + env(safe-area-inset-bottom))!important;
    max-height:calc(75px + env(safe-area-inset-bottom))!important;
    transform:none!important;
    z-index:191!important;
    box-sizing:border-box!important;
    padding:5px 9px calc(5px + env(safe-area-inset-bottom))!important;
  }
  body #appShell.app-shell.omni-mobile-rework153 > #miniCentral > .mini-central-content {
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    width:100%!important;
    min-width:0!important;
    flex:1 1 auto!important;
    gap:5px!important;
  }
  body #appShell.app-shell.omni-mobile-rework153 > #miniCentral .mini-central-ident {
    display:flex!important;
    flex:1 1 auto!important;
    min-width:0!important;
    max-width:none!important;
    overflow:hidden!important;
  }
  body #appShell.app-shell.omni-mobile-rework153 > #miniCentral .mini-central-ident .user-copy {
    display:flex!important;
    flex-direction:column!important;
    align-items:flex-start!important;
    justify-content:center!important;
    min-width:0!important;
    max-width:100%!important;
    padding:0!important;
  }
  body #appShell.app-shell.omni-mobile-rework153 > #miniCentral .mini-central-ident .user-copy strong {
    display:block!important;
    visibility:visible!important;
    font-size:12px!important;
    line-height:1.35!important;
    font-weight:700!important;
    max-width:100%!important;
    white-space:nowrap!important;
    text-overflow:ellipsis!important;
    overflow:hidden!important;
  }
  body #appShell.app-shell.omni-mobile-rework153 > #miniCentral .mini-central-buttons {
    display:flex!important;
    align-items:center!important;
    flex:0 0 auto!important;
    gap:2px!important; /* millimetric tightening without reducing hit area */
    min-width:0!important;
    margin-left:auto!important;
  }
  body #appShell.app-shell.omni-mobile-rework153
    > #miniCentral .mini-central-buttons > button.user-control:not([hidden]) {
    display:grid!important;
    width:32px!important;height:38px!important;
    min-width:32px!important;min-height:38px!important;
    max-width:32px!important;
    flex:0 0 32px!important;
    padding:6px!important;
    margin:0!important;
    place-items:center!important;
    border-radius:9px!important;
  }
  body #appShell.app-shell.omni-mobile-rework153
    > #miniCentral .mini-central-buttons > button.user-control:not([hidden]) svg {
    width:18px!important;height:18px!important;
  }
  body #appShell.app-shell.omni-mobile-rework153
    > #miniCentral .self-avatar {
    width:40px!important;height:40px!important;
    min-width:40px!important;max-width:40px!important;
    flex:0 0 40px!important;
  }
  body #appShell.app-shell.omni-mobile-rework153.omni-mobile-compact-call157
    > #miniCentral .mini-central-ident :is(.user-copy small,#miniCentralGame) {
    display:none!important;
  }
  /* Stage uses a predictable two-column flow, never oversized solo cards. */
  body #appShell.app-shell.omni-mobile-rework153.omni-mobile-in-call153.omni-mobile-compact-call157:not(.nexo-video-fullscreen):not(.omni-mobile-streaming153)
    #voiceStage #remoteMedia:not([hidden]){
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-template-rows:none!important;
    grid-auto-rows:max-content!important;
    grid-auto-flow:row!important;
    justify-content:center!important;
    justify-items:stretch!important;
    align-items:start!important;
    align-content:start!important;
    gap:9px!important;
    padding:12px 8px 14px!important;
    width:100%!important;
    height:100%!important;
    max-height:100%!important;
    box-sizing:border-box!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
  }
  /* Center the lone user directly in the middle of the page horizontally. */
  body #appShell.app-shell.omni-mobile-rework153.omni-mobile-in-call153.omni-mobile-compact-call157:not(.nexo-video-fullscreen)
    #voiceStage #remoteMedia:not(:has(> .remote-tile.is-screen-sharing:not(.is-local-screen)))
      > .remote-tile:only-child {
    grid-column:1 / -1!important;
    width:min(215px,78%)!important;
    max-width:min(215px,78%)!important;
    height:min(185px,48vw)!important;
    min-height:0!important;
    max-height:min(185px,48vw)!important;
    justify-self:center!important;
    margin:12px auto 0!important;
    border-radius:14px!important;
  }
  body #appShell.app-shell.omni-mobile-rework153.omni-mobile-in-call153.omni-mobile-compact-call157:not(.nexo-video-fullscreen)
    #voiceStage #remoteMedia:not(:has(> .remote-tile.is-screen-sharing:not(.is-local-screen)))
      > .remote-tile:only-child .remote-tile-avatar {
    width:100%!important;
    height:100%!important;
    max-width:none!important;
  }
  /* A stream never autoselects or makes the gallery immersive.
     Screen previews (▶ Assistir) occupy full-width rows above people.
     For multiple screens, each gets a separate row, in source order. */
  body #appShell.app-shell.omni-mobile-rework153.omni-mobile-in-call153.omni-mobile-compact-call157:not(.nexo-video-fullscreen):not(.omni-mobile-streaming153)
    #voiceStage #remoteMedia:has(> .remote-tile.is-screen-sharing:not(.is-local-screen))
      > .remote-tile.is-screen-sharing:not(.is-local-screen) {
    grid-column:1 / -1!important;
    grid-row:auto!important;
    order:0!important;
    align-self:start!important;
    justify-self:stretch!important;
    width:100%!important;max-width:100%!important;min-width:0!important;
    height:clamp(175px,37dvh,315px)!important;
    max-height:clamp(175px,37dvh,315px)!important;
    min-height:0!important;
    margin:0!important;padding:0!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
    border-radius:12px!important;
    background:#030608!important;
  }
  body #appShell.app-shell.omni-mobile-rework153.omni-mobile-in-call153.omni-mobile-compact-call157:not(.nexo-video-fullscreen):not(.omni-mobile-streaming153)
    #voiceStage #remoteMedia:has(> .remote-tile.is-screen-sharing:not(.is-local-screen))
      > .remote-tile.is-screen-sharing:not(.is-local-screen):not(.is-stream-watching) {
    height:118px!important;max-height:118px!important;
  }
  body #appShell.app-shell.omni-mobile-rework153.omni-mobile-in-call153.omni-mobile-compact-call157:not(.nexo-video-fullscreen):not(.omni-mobile-streaming153)
    #voiceStage #remoteMedia:has(> .remote-tile.is-screen-sharing:not(.is-local-screen))
      > .remote-tile.is-screen-sharing:not(.is-local-screen) video {
    width:100%!important;
    height:100%!important;
    max-width:100%!important;
    max-height:100%!important;
    object-fit:contain!important;
    object-position:center!important;
  }
  body #appShell.app-shell.omni-mobile-rework153.omni-mobile-in-call153.omni-mobile-compact-call157:not(.nexo-video-fullscreen):not(.omni-mobile-streaming153)
    #voiceStage #remoteMedia:has(> .remote-tile.is-screen-sharing:not(.is-local-screen))
      > .remote-tile.is-screen-sharing:not(.is-local-screen):not(.is-stream-watching) video {
    visibility:hidden!important;
  }
  body #appShell.app-shell.omni-mobile-rework153.omni-mobile-in-call153.omni-mobile-compact-call157:not(.nexo-video-fullscreen):not(.omni-mobile-streaming153)
    #voiceStage #remoteMedia:has(> .remote-tile.is-screen-sharing:not(.is-local-screen))
      > .remote-tile:is(.is-voice-participant,.is-local-screen):not(.is-stream-primary):not(.is-stream-secondary){
    grid-column:auto!important;
    grid-row:auto!important;
    order:5!important;
    width:100%!important;min-width:0!important;max-width:100%!important;
    height:clamp(100px,26vw,128px)!important;
    max-height:clamp(100px,26vw,128px)!important;
    min-height:0!important;
    margin:0!important;
    border-radius:12px!important;
    overflow:hidden!important;
  }
  /* The receiver action buttons are visible on touch screens; a user can
     enter fullscreen or stop watching without relying on hover. */
  body #appShell.app-shell.omni-mobile-rework153.omni-mobile-in-call153.omni-mobile-compact-call157:not(.nexo-video-fullscreen)
    #voiceStage .remote-tile.is-stream-watching .screen-receiver-toolbar {
    display:flex!important;
    visibility:visible!important;
    opacity:1!important;
    pointer-events:auto!important;
    position:absolute!important;
    bottom:6px!important;
    right:6px!important;
    top:auto!important;left:auto!important;
    max-width:calc(100% - 12px)!important;
    box-sizing:border-box!important;
    flex-wrap:wrap!important;
    justify-content:flex-end!important;
    gap:4px!important;
    z-index:10!important;
  }
  body #appShell.app-shell.omni-mobile-rework153.omni-mobile-in-call153.omni-mobile-compact-call157:not(.nexo-video-fullscreen)
    #voiceStage .remote-tile.is-stream-watching .screen-receiver-toolbar button {
    display:grid!important;place-items:center!important;
    min-height:34px!important;
    padding:5px 8px!important;
    font-size:10px!important;
    line-height:1.25!important;
    white-space:normal!important;
  }
  /* Keep the fullscreen video and its leave/fullscreen controls accessible,
     without dragging the fixed Mini Central over the picture. */
  body #appShell.app-shell.nexo-video-fullscreen > #miniCentral {
    display:none!important;
  }
  body #appShell.app-shell.nexo-video-fullscreen #omniMobileRailToggle156 {
    display:none!important;
  }
}
@media(max-width:370px){
  body #appShell.app-shell.omni-mobile-rework153 > #miniCentral .mini-central-buttons {
    gap:1px!important;
  }
  body #appShell.app-shell.omni-mobile-rework153 > #miniCentral .mini-central-buttons > button.user-control:not([hidden]) {
    width:31px!important;min-width:31px!important;max-width:31px!important;
    flex:0 0 31px!important;
  }
}
@media(prefers-reduced-motion:reduce){
  #nexoCommunityWizard .nexo-cw-close,
  #nexoChannelWizard .nexo-cw-close{
    transition:none!important;
  }
}
@media(max-width:760px){
  /* Fullscreen must retain an always-visible Exit/Stop Watching toolbar.
     Some legacy equal-grid rules hide toolbars even after requesting
     fullscreen. Native fullscreen has no hover on touchscreens. */
  body #appShell.app-shell.nexo-video-fullscreen
    #voiceStage .remote-tile.nexo-fullscreen-target.has-video
    > .screen-receiver-toolbar,
  body #voiceStage .remote-tile.nexo-fullscreen-target:fullscreen
    > .screen-receiver-toolbar {
    display:flex!important;
    visibility:visible!important;
    opacity:1!important;
    pointer-events:auto!important;
    position:absolute!important;
    top:calc(15px + env(safe-area-inset-top))!important;
    right:12px!important;
    bottom:auto!important;
    left:auto!important;
    width:auto!important;
    height:auto!important;
    max-width:calc(100vw - 24px)!important;
    min-height:44px!important;
    flex-direction:row!important;
    flex-wrap:wrap!important;
    justify-content:flex-end!important;
    align-items:center!important;
    gap:6px!important;
    transform:none!important;
    z-index:200002!important;
    padding:5px!important;
    box-sizing:border-box!important;
    border:1px solid rgba(230,243,250,.26)!important;
    border-radius:12px!important;
    background:rgba(8,13,21,.92)!important;
    box-shadow:0 7px 24px rgba(0,0,0,.38)!important;
  }
  body #appShell.app-shell.nexo-video-fullscreen
    #voiceStage .remote-tile.nexo-fullscreen-target.has-video
    > .screen-receiver-toolbar button,
  body #voiceStage .remote-tile.nexo-fullscreen-target:fullscreen
    > .screen-receiver-toolbar button {
    display:grid!important;
    place-items:center!important;
    visibility:visible!important;
    opacity:1!important;
    pointer-events:auto!important;
    min-height:38px!important;
    padding:6px 8px!important;
    font-size:11px!important;
    color:#e9f5fc!important;
    border-radius:9px!important;
  }
}

@media(max-width:760px){
  /* ID-specific override: legacy streaming153 uses three IDs and
     display:none!important. The fullscreen receiver toolbar must win it. */
  body #appShell.app-shell.nexo-video-fullscreen.omni-mobile-streaming153
    #voiceStage #remoteMedia
    > .remote-tile.nexo-fullscreen-target.has-video > .screen-receiver-toolbar,
  body #appShell.app-shell.nexo-video-fullscreen
    #voiceStage #remoteMedia
    > .remote-tile.nexo-fullscreen-target.has-video > .screen-receiver-toolbar {
    display:flex!important;
    visibility:visible!important;
    opacity:1!important;
    pointer-events:auto!important;
  }
}
