/* Omni 0.2.41: production adaptation of the approved Open Design.
   Preserve existing live voice, screen WebRTC and all user personalization. */

/* The notification shortcuts remain in the original top position. */
html:not([data-nexo-theme="light"]) body {
  background:
    radial-gradient(ellipse 45% 62% at 95% -20%, rgba(202,222,218,.075),transparent 76%),
    linear-gradient(135deg,#13171a 0%,#1b1f22 45%,#13171a 100%);
}
html:not([data-nexo-theme="light"]) .app-shell {
  background:linear-gradient(132deg,rgba(22,26,30,.88),rgba(27,31,34,.79));
}
html:not([data-nexo-theme="light"]) .global-navigation {
  background:linear-gradient(115deg,rgba(63,72,73,.56),rgba(28,33,36,.67));
  border-color:rgba(234,251,245,.18);
  backdrop-filter:blur(25px) saturate(111%);
  -webkit-backdrop-filter:blur(25px) saturate(111%);
  box-shadow:inset 0 1px rgba(255,255,255,.12);
}
html:not([data-nexo-theme="light"]) .global-nav-button {
  color:#c8d3d5;
  border-radius:12px;
}
html:not([data-nexo-theme="light"]) .global-nav-button:hover,
html:not([data-nexo-theme="light"]) .global-nav-button[aria-expanded="true"],
html:not([data-nexo-theme="light"]) .global-nav-button[aria-pressed="true"] {
  background:linear-gradient(141deg,rgba(227,245,239,.19),rgba(92,113,110,.14));
  color:#f7fffc;
  border-color:rgba(234,248,245,.33);
}
html:not([data-nexo-theme="light"]) .global-navigation .global-nav-count {
  color:#33101d;
  background:linear-gradient(145deg,#ffb2be,#f47f96);
  border-color:#293034;
}
html:not([data-nexo-theme="light"]) .server-rail {
  background:linear-gradient(158deg,rgba(49,57,62,.48),rgba(17,21,25,.52));
}
html:not([data-nexo-theme="light"]) .channel-sidebar {
  background:linear-gradient(155deg,rgba(60,69,69,.35),rgba(24,28,32,.61));
}
html:not([data-nexo-theme="light"]) .chat-column {
  background:linear-gradient(149deg,rgba(27,31,34,.34),rgba(15,19,23,.34));
}
html:not([data-nexo-theme="light"]) .member-sidebar {
  background:linear-gradient(145deg,rgba(58,69,70,.35),rgba(21,26,29,.54));
}

/* Mini Central reaches the far left edge and remains aligned with the input.
   Do not replace the user's customizable cover image or background color. */
.app-shell {
  --nexo-rail-width:68px;
}
.app-shell > .server-rail {
  padding-bottom:102px;
}
.app-shell > .channel-sidebar {
  z-index:7;
}
.app-shell .user-panel.mini-central {
  left:calc(-1 * var(--nexo-rail-width)) !important;
  width:calc(100% + var(--nexo-rail-width)) !important;
  height:88px;
  min-height:88px;
  max-height:88px;
  z-index:12;
  border-top:1px solid rgba(244,254,248,.25);
  border-right:1px solid rgba(225,245,239,.19);
  backdrop-filter:blur(22px) saturate(116%);
  -webkit-backdrop-filter:blur(22px) saturate(116%);
  box-shadow:inset 0 1px rgba(255,255,255,.11),0 -7px 25px rgba(0,0,0,.14);
}
.app-shell .mini-central .mini-central-content {
  grid-template-columns:56px minmax(0,1fr);
}
.app-shell .mini-central .mini-central-buttons #settingsButton {
  display:none !important;
}
.app-shell > .server-rail #compactSettingsButton {
  flex:0 0 auto;
  display:grid;
  place-items:center;
  width:40px;
  height:40px;
  margin:0;
  border-radius:13px;
  border:1px solid rgba(215,238,232,.3);
  background:linear-gradient(140deg,rgba(236,252,244,.14),rgba(91,108,106,.13));
  box-shadow:inset 0 1px rgba(255,255,255,.13);
  color:#e6f0ef;
}
.app-shell > .server-rail #compactSettingsButton:hover {
  background:rgba(212,232,222,.21);
  border-color:rgba(244,255,248,.5);
}
@media(max-width:1150px) {
  .app-shell {--nexo-rail-width:62px;}
}
@media(max-width:760px) {
  .app-shell {--nexo-rail-width:54px;}
  .app-shell > .server-rail {padding-bottom:0;}
  .app-shell .user-panel.mini-central {
    left:0 !important;
    width:100% !important;
  }
}

/* Center the actual WebRTC voice participants, including 1-6 people.
   Stream video layouts (.has-video) retain their special hierarchy. */
#voiceStage .remote-media:not(.has-video),
#voiceStage .remote-media:not(.has-video):is([data-voice-count="1"],[data-voice-count="2"],[data-voice-count="3"],[data-voice-count="4"],[data-voice-count="5"],[data-voice-count="6"]) {
  display:flex;
  flex-direction:row;
  flex-wrap:wrap;
  justify-content:center;
  align-items:center;
  align-content:center;
  box-sizing:border-box;
  width:100%;
  height:100%;
  min-height:0;
  max-height:100%;
  padding:18px clamp(10px,2vw,26px);
  gap:clamp(12px,1.55vw,22px);
  overflow-x:hidden;
  overflow-y:auto;
}
#voiceStage .remote-media:not(.has-video) > .remote-tile.is-voice-participant:not(.has-video) {
  box-sizing:border-box;
  flex:0 0 clamp(152px,16vw,224px);
  width:clamp(152px,16vw,224px);
  height:auto;
  min-height:0;
  max-width:calc(100% - 10px);
  aspect-ratio:1 / 1;
  border-radius:17px;
  overflow:hidden;
}
@media(max-width:760px){
  #voiceStage .remote-media:not(.has-video){
    gap:10px;
    align-content:center;
  }
  #voiceStage .remote-media:not(.has-video) > .remote-tile.is-voice-participant:not(.has-video) {
    flex-basis:clamp(116px,30vw,168px);
    width:clamp(116px,30vw,168px);
  }
}
@media(max-height:620px){
  #voiceStage .remote-media:not(.has-video){
    align-content:safe center;
    gap:9px;
    padding:8px 10px;
  }
  #voiceStage .remote-media:not(.has-video) > .remote-tile.is-voice-participant:not(.has-video){
    flex-basis:clamp(100px,13vh,157px);
    width:clamp(100px,13vh,157px);
  }
}

/* Red telephone icon ends voice, broadcasting, or watching a stream.
   Existing click handlers and media lifecycle remain unchanged. */
button.nexo-hangup,
#voiceStage button.nexo-hangup,
.voice-stage .remote-tile .screen-tile-toolbar button.nexo-hangup,
.voice-stage .remote-tile .screen-receiver-toolbar button.nexo-hangup {
  display:grid;
  place-items:center;
  flex:0 0 auto;
  min-width:40px;
  height:42px;
  padding:0 10px;
  border:1px solid rgba(255,194,199,.64);
  border-radius:12px;
  color:white;
  background:linear-gradient(145deg,#ff6873,#ec3048 55%,#bd1934);
  box-shadow:inset 0 1px rgba(255,255,255,.31),0 6px 16px rgba(171,19,40,.30);
  font-size:0;
  text-indent:0;
  line-height:1;
  cursor:pointer;
}
button.nexo-hangup[hidden] {display:none !important;}
button.nexo-hangup:hover,
#voiceStage button.nexo-hangup:hover,
.voice-stage .remote-tile .screen-tile-toolbar button.nexo-hangup:hover {
  background:linear-gradient(145deg,#ff8091,#f1405c 57%,#d62240);
  box-shadow:inset 0 1px rgba(255,255,255,.32),0 8px 20px rgba(200,29,53,.42);
}
button.nexo-hangup:focus-visible {
  outline:2px solid white;
  outline-offset:3px;
}
.nexo-hangup-icon {
  display:block;
  width:22px;
  height:22px;
  stroke:none;
  fill:#fff;
  pointer-events:none;
}
#stageLeaveButton.nexo-hangup {
  width:49px;
  min-width:49px;
  height:43px;
  padding:0;
}
.voice-stage .remote-tile .screen-tile-toolbar button.nexo-hangup {
  width:43px;
  min-width:43px;
  height:37px;
  padding:0;
  border-radius:10px;
}
.voice-stage .remote-tile .screen-tile-toolbar .nexo-hangup-icon {
  width:20px;
  height:20px;
}
#stopScreenShare.nexo-hangup {
  width:34px;
  min-width:34px;
  height:32px;
  padding:0;
}
#stopScreenShare.nexo-hangup .nexo-hangup-icon {width:18px;height:18px;}
#disconnectVoice.nexo-hangup {
  width:38px;
  min-width:38px;
  height:36px;
  padding:0;
}
@media(prefers-reduced-motion:reduce) {
  button.nexo-hangup {transition:none;}
}
