/* Omni Mobile 157: one compact voice gallery, controls inside Mini Central.
   Desktop untouched. The server is authoritative for room/session ownership. */
@media(max-width:760px) {
  /* Ordinary call occupies the conversation's content area, not the
     entire phone. This is the single intended mobile voice layout. */
  body #appShell.app-shell.omni-mobile-rework153.omni-mobile-in-call153.omni-mobile-compact-call157:not(.omni-mobile-streaming153)
    > .chat-column {
    padding-bottom:calc(75px + env(safe-area-inset-bottom))!important;
  }
  body #appShell.app-shell.omni-mobile-rework153.omni-mobile-in-call153.omni-mobile-compact-call157:not(.omni-mobile-streaming153)
    #voiceStage:not([hidden]) {
    position:absolute!important;
    inset:auto!important;
    left:0!important;right:0!important;
    top:48px!important;
    bottom:calc(75px + env(safe-area-inset-bottom))!important;
    width:100%!important;
    height:calc(100% - 123px - env(safe-area-inset-bottom))!important;
    max-height:calc(100% - 123px - env(safe-area-inset-bottom))!important;
    display:flex!important;flex-direction:column!important;
    align-items:stretch!important;
    padding:10px!important;margin:0!important;
    background:rgba(15,22,31,.94)!important;
    z-index:14!important;
    border-radius:0!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }
  #appShell.omni-mobile-compact-call157:not(.omni-mobile-streaming153)
    #voiceStage #omniMobileCallBar153 {
    display:flex!important;flex:0 0 44px!important;
    min-height:44px!important;max-height:44px!important;
    padding:0 3px 8px!important;margin:0!important;
    background:transparent!important;backdrop-filter:none!important;
  }
  #appShell.omni-mobile-compact-call157:not(.omni-mobile-streaming153)
    #voiceStage #omniMobileCallBar153 > button {
    display:none!important;pointer-events:none!important;
  }
  #appShell.omni-mobile-compact-call157:not(.omni-mobile-streaming153)
    #voiceStage #omniMobileCallBar153 strong {
    font-size:13px!important;
  }
  #appShell.omni-mobile-compact-call157:not(.omni-mobile-streaming153)
    #voiceStage > .voice-stage-panel{
    display:flex!important;
    align-items:flex-start!important;justify-content:flex-start!important;
    flex:1 1 auto!important;min-height:0!important;max-height:none!important;
    width:100%!important;overflow-y:auto!important;
    padding:0!important;margin:0!important;
  }
  #appShell.omni-mobile-compact-call157: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:clamp(104px,31vw,134px)!important;
    align-content:start!important;
    justify-items:stretch!important;
    align-items:start!important;
    gap:9px!important;
    flex:1 1 auto!important;min-height:0!important;
    width:100%!important;height:100%!important;
    max-width:100%!important;max-height:none!important;
    overflow-x:hidden!important;overflow-y:auto!important;
    overscroll-behavior:contain!important;
    box-sizing:border-box!important;
    padding:0 0 10px!important;margin:0!important;
  }
  #appShell.omni-mobile-compact-call157:not(.omni-mobile-streaming153)
    #voiceStage #remoteMedia > .remote-tile:not(.is-screen-sharing) {
    display:flex!important;position:relative!important;
    width:100%!important;height:clamp(104px,31vw,134px)!important;
    min-width:0!important;min-height:0!important;
    max-width:none!important;max-height:clamp(104px,31vw,134px)!important;
    aspect-ratio:auto!important;
    margin:0!important;padding:0!important;
    border-radius:13px!important;
    overflow:hidden!important;
  }
  #appShell.omni-mobile-compact-call157:not(.omni-mobile-streaming153)
    #voiceStage #remoteMedia > .remote-tile.is-local-screen {
    max-height:clamp(104px,31vw,134px)!important;
    height:clamp(104px,31vw,134px)!important;
    min-width:0!important;
    grid-column:auto!important;
    border-radius:13px!important;
    overflow:hidden!important;
  }
  #appShell.omni-mobile-compact-call157:not(.omni-mobile-streaming153)
    #voiceStage #remoteMedia > .remote-tile.is-local-screen video {
    width:100%!important;height:100%!important;max-width:100%!important;
    object-fit:cover!important;object-position:center!important;
  }
  #appShell.omni-mobile-compact-call157:not(.omni-mobile-streaming153)
    #voiceStage #remoteMedia .remote-tile-name {
    font-size:12px!important;line-height:1.25!important;
    overflow:hidden!important;text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }

  /* In-call Mini Central is the ONLY normal mobile call controller.
     Existing microphone and speaker buttons are reused (not cloned). */
  body #appShell.app-shell.omni-mobile-rework153.omni-mobile-compact-call157:not(.omni-mobile-streaming153)
    > #miniCentral {
    position:fixed!important;display:flex!important;
    bottom:0!important;left:0!important;right:0!important;
    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;
    z-index:190!important;box-sizing:border-box!important;
    padding:5px 9px calc(5px + env(safe-area-inset-bottom))!important;
    /* No call-only background or border override: the user's selected
       Mini Central cover and base border remain unchanged in a call. */
  }
  body #appShell.app-shell.omni-mobile-rework153.omni-mobile-compact-call157:not(.omni-mobile-streaming153)
    > #miniCentral > .mini-central-content {
    display:flex!important;flex:1 1 auto!important;
    align-items:center!important;gap:5px!important;
    min-width:0!important;width:100%!important;
  }
  #appShell.omni-mobile-compact-call157 > #miniCentral .self-avatar{
    width:38px!important;min-width:38px!important;
    height:38px!important;min-height:38px!important;
    flex:0 0 38px!important;
  }
  #appShell.omni-mobile-compact-call157 > #miniCentral .mini-central-ident {
    flex:1 1 auto!important;min-width:35px!important;
    max-width:75px!important;overflow:hidden!important;
  }
  #appShell.omni-mobile-compact-call157 > #miniCentral .mini-central-ident .user-copy strong {
    font-size:11px!important;
    overflow:hidden!important;text-overflow:ellipsis!important;
    white-space:nowrap!important;
    max-width:100%!important;display:block!important;
  }
  #appShell.omni-mobile-compact-call157 > #miniCentral .mini-central-ident :is(small,#miniCentralGame) {
    display:none!important;
  }
  #appShell.omni-mobile-compact-call157 > #miniCentral .mini-central-buttons {
    display:flex!important;flex:0 0 auto!important;
    align-items:center!important;justify-content:flex-end!important;
    gap:4px!important;margin-left:auto!important;
    padding:0!important;min-width:0!important;
  }
  #appShell.omni-mobile-compact-call157 > #miniCentral .mini-central-buttons > button.user-control {
    display:grid!important;place-items:center!important;
    width:35px!important;min-width:35px!important;max-width:35px!important;
    height:39px!important;min-height:39px!important;
    flex:0 0 35px!important;
    margin:0!important;padding:8px!important;
    border-radius:10px!important;
    border:1px solid rgba(227,239,251,.12)!important;
    box-sizing:border-box!important;
  }
  #appShell.omni-mobile-compact-call157 > #miniCentral #settingsButton{
    display:none!important;
  }
  #appShell.omni-mobile-compact-call157 > #miniCentral .omni-mini-call-action157 svg {
    display:block!important;
    width:20px!important;height:20px!important;
    stroke:currentColor!important;stroke-width:1.85!important;
    fill:none!important;stroke-linecap:round!important;stroke-linejoin:round!important;
  }
  #appShell.omni-mobile-compact-call157 > #miniCentral .omni-mini-call-action157.is-active {
    color:#8ae6b1!important;background:rgba(56,162,105,.18)!important;
  }
  #appShell.omni-mobile-compact-call157 > #miniCentral .omni-mini-call-action157:disabled {
    opacity:.45!important;cursor:not-allowed!important;
  }
  #appShell.omni-mobile-compact-call157 > #miniCentral #omniMiniCallLeave157 {
    background:#a73241!important;color:#fff!important;
    border-color:rgba(255,186,190,.26)!important;
  }
  /* The old "open/expand" arrow near the microphone caused a second
     conflicting call layout. No duplicate floating toolbar or back arrow. */
  body #appShell.app-shell.omni-mobile-compact-call157:not(.omni-mobile-streaming153)
    #omniMobileCallControls153,
  body #appShell.app-shell.omni-mobile-compact-call157
    > #omniCompactVoiceDock,
  body #appShell.app-shell.omni-mobile-compact-call157
    > #omniNarrowVoiceToggle,
  #appShell.omni-mobile-compact-call157 #omniCompactVoiceReturn,
  #appShell.omni-mobile-compact-call157 #omniMobileMinimize153 {
    display:none!important;visibility:hidden!important;
    pointer-events:none!important;
  }
  /* Keep Mini Central available while browsing other channels mid-call. */
  body #appShell.app-shell.omni-mobile-compact-call157.omni-mobile-call-minimized153
    > .chat-column > .composer-wrap:not([hidden]){
    bottom:calc(86px + env(safe-area-inset-bottom))!important;
  }
}
@media (max-width:370px){
  #appShell.omni-mobile-compact-call157 > #miniCentral .mini-central-ident{max-width:49px!important;min-width:0!important;}
  #appShell.omni-mobile-compact-call157 > #miniCentral .mini-central-buttons {gap:3px!important;}
  #appShell.omni-mobile-compact-call157 > #miniCentral .mini-central-buttons > button.user-control{
    width:33px!important;min-width:33px!important;max-width:33px!important;flex-basis:33px!important;
  }
}

@media(max-width:760px){
  /* Highly specific override for earlier Omni 153/voice-grid styles. */
  body #appShell.app-shell.omni-mobile-rework153.omni-mobile-in-call153.omni-mobile-compact-call157:not(.omni-mobile-streaming153)
    #voiceStage > .voice-stage-panel {
    display:flex!important;align-items:stretch!important;justify-content:flex-start!important;
    width:100%!important;max-width:100%!important;
    padding:0!important;margin:0!important;
    flex:1 1 auto!important;min-height:0!important;
  }
  body #appShell.app-shell.omni-mobile-rework153.omni-mobile-in-call153.omni-mobile-compact-call157: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:clamp(104px,31vw,134px)!important;
    align-items:start!important;justify-items:stretch!important;
    align-content:start!important;justify-content:start!important;
    flex:1 1 auto!important;
    position:relative!important;
    left:auto!important;top:auto!important;right:auto!important;bottom:auto!important;
    width:100%!important;max-width:100%!important;height:100%!important;min-width:0!important;
    gap:9px!important;padding:0 0 10px!important;margin:0!important;
    overflow-x:hidden!important;overflow-y:auto!important;
    border-radius:0!important;transform:none!important;
  }
  body #appShell.app-shell.omni-mobile-rework153.omni-mobile-in-call153.omni-mobile-compact-call157:not(.omni-mobile-streaming153)
    #voiceStage #remoteMedia > .remote-tile:not(.is-screen-sharing){
    grid-column:auto!important;grid-row:auto!important;
    position:relative!important;display:flex!important;flex:initial!important;
    width:100%!important;max-width:100%!important;
    height:clamp(104px,31vw,134px)!important;
    min-height:0!important;max-height:clamp(104px,31vw,134px)!important;
    min-width:0!important;box-sizing:border-box!important;
  }
}

@media(max-width:760px) {
  /* One single toolbar: the original stage buttons and its fullscreen
     toggle are not rendered above the fixed Mini Central. */
  body #appShell.app-shell.omni-mobile-rework153.omni-mobile-in-call153.omni-mobile-compact-call157:not(.omni-mobile-streaming153)
    #voiceStage > .voice-stage-controls,
  body #appShell.app-shell.omni-mobile-rework153.omni-mobile-in-call153.omni-mobile-compact-call157:not(.omni-mobile-streaming153)
    #voiceStage > .voice-stage-controls :is(#stageFullscreenButton,#stageMicButton,#stageDeafenButton,#voiceInviteButton,#stageLeaveButton) {
    display:none!important;visibility:hidden!important;pointer-events:none!important;
    height:0!important;min-height:0!important;max-height:0!important;
    padding:0!important;margin:0!important;
  }
}

@media(max-width:760px){
  /* A local camera's tile uses the same compact slot as the participant
     avatar. Older fullscreen screen-sharing styles had made it span both
     columns even with a native aspect-ratio video stream. */
  body #appShell.app-shell.omni-mobile-rework153.omni-mobile-in-call153.omni-mobile-compact-call157:not(.omni-mobile-streaming153)
    #voiceStage #remoteMedia > .remote-tile.is-local-screen.is-screen-sharing {
    display:flex!important;
    grid-column:auto!important;grid-row:auto!important;grid-area:auto!important;
    position:relative!important;
    left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;
    flex:initial!important;flex-basis:auto!important;
    width:100%!important;min-width:0!important;max-width:100%!important;
    height:clamp(104px,31vw,134px)!important;
    min-height:0!important;max-height:clamp(104px,31vw,134px)!important;
    margin:0!important;padding:0!important;
    box-sizing:border-box!important;
    border:1px solid rgba(238,247,255,.15)!important;
    border-radius:13px!important;
    overflow:hidden!important;
  }
  body #appShell.app-shell.omni-mobile-rework153.omni-mobile-in-call153.omni-mobile-compact-call157:not(.omni-mobile-streaming153)
    #voiceStage #remoteMedia > .remote-tile.is-local-screen.is-screen-sharing video {
    display:block!important;
    width:100%!important;height:100%!important;
    min-width:0!important;min-height:0!important;
    max-width:100%!important;max-height:100%!important;
    position:absolute!important;inset:0!important;
    object-fit:cover!important;object-position:center!important;
    border-radius:inherit!important;
  }
}

@media(max-width:760px){
  /* The small phone-camera tile must not inherit desktop broadcasting
     quality HUDs and control rows. Camera settings/stop remain available
     from the dedicated Mini Central camera button. */
  body #appShell.app-shell.omni-mobile-rework153.omni-mobile-in-call153.omni-mobile-compact-call157:not(.omni-mobile-streaming153)
    #voiceStage #remoteMedia > .remote-tile.is-local-screen.is-screen-sharing
    :is(.screen-quality-indicator,.screen-tile-toolbar,.screen-live-viewers,
        .screen-receiver-toolbar,.screen-reconnect-status,.participant-quick-controls){
    display:none!important;visibility:hidden!important;pointer-events:none!important;
  }
}
