/* Echo Midnight Glass — horizontal quick controls, compact participant frames.
   Styling only: existing noise suppression and diagnostics handlers are reused. */
body.in-room #screenCall.call-layout{
  grid-template-columns:minmax(0,1fr);
  gap:0;
  padding-block:20px 25px;
}
body.in-room #screenCall .call-main{
  min-width:0;width:100%;max-width:100%;
}
body.in-room #screenCall .room-quick-controls{
  display:flex;flex-wrap:wrap;align-items:center;
  gap:10px;
  margin:11px 0 2px;
  padding:0;
  width:100%;
  max-width:100%;
  box-sizing:border-box;
  border:none;background:none;box-shadow:none;
}
body.in-room #screenCall .room-quick-controls > *{
  box-sizing:border-box;
  min-width:0;
  height:49px;
  border-radius:15px;
  border:1px solid var(--eg-line,var(--border));
  box-shadow:inset 0 1px 0 var(--eg-toplight,transparent);
  background:linear-gradient(135deg,var(--eg-frost-soft),var(--eg-frost-heavy));
}
body.in-room #screenCall .room-quick-controls .quick-control-noise{
  display:flex;align-items:center;
  flex:0 1 260px;gap:10px;
  padding:6px 12px;
}
body.in-room #screenCall .room-quick-controls .quick-control-icon{
  flex:0 0 21px;
  width:21px;height:21px;
  color:var(--green);
  fill:none;stroke:currentColor;stroke-width:1.7;
  stroke-linecap:round;stroke-linejoin:round;
}
body.in-room #screenCall .room-quick-controls .enhanced-noise-row{
  margin:0;min-height:0;padding:0;
  display:flex;flex:1;min-width:0;align-items:center;
  border:0;background:transparent;box-shadow:none;
  border-radius:0;gap:8px;
}
body.in-room #screenCall .room-quick-controls .enhanced-noise-row > span:first-child{
  min-width:0;flex:1;display:grid;gap:3px;
}
body.in-room #screenCall .room-quick-controls .enhanced-noise-row strong{
  display:block;font-size:12px;line-height:1.2;
  color:var(--eg-text,var(--text));
  white-space:nowrap;
}
body.in-room #screenCall .room-quick-controls .enhanced-noise-row small{
  display:block;font-size:10px;line-height:1.3;
  color:var(--muted);white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis;
  min-height:0;
}
body.in-room #screenCall .room-quick-controls .enhanced-noise-row .switch{
  flex:0 0 42px;
}
body.in-room #screenCall .room-quick-controls .enhanced-noise-row:focus-within{
  outline:2px solid var(--green);outline-offset:3px;border-radius:8px;
}
body.in-room #screenCall .room-quick-controls .connection-status-card{
  display:flex;flex:0 1 280px;gap:9px;
  align-items:center;
  margin:0;
  padding:6px 12px;
  height:49px;min-height:0;
  color:var(--eg-text,var(--text));
  text-align:left;
  transition:border-color .16s,background-color .16s,transform .14s;
}
body.in-room #screenCall .room-quick-controls .connection-status-card:hover{
  border-color:color-mix(in srgb,var(--green) 50%,var(--eg-line));
}
body.in-room #screenCall .room-quick-controls .connection-status-card:active{
  transform:scale(.985);
}
body.in-room #screenCall .room-quick-controls .connection-status-card:focus-visible{
  outline:2px solid var(--green);outline-offset:3px;
}
body.in-room #screenCall .room-quick-controls .connection-status-icon{
  flex:0 0 28px;width:28px;height:28px;
  border-radius:9px;
  background:color-mix(in srgb,var(--green) 11%,transparent);
}
body.in-room #screenCall .room-quick-controls .connection-status-icon svg{
  width:17px;height:17px;
}
body.in-room #screenCall .room-quick-controls .connection-status-copy{
  display:grid;gap:2px;min-width:0;flex:1;
}
body.in-room #screenCall .room-quick-controls .connection-status-copy strong{
  font-size:12px;line-height:1.2;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
body.in-room #screenCall .room-quick-controls .connection-status-copy > span{
  display:none; /* Detailed description remains available in audio diagnostics. */
}
body.in-room #screenCall .room-quick-controls .connection-status-copy small{
  font-size:10px;line-height:1.3;
  color:var(--muted);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
body.in-room #screenCall .room-quick-controls .connection-status-arrow{
  flex:none;font-size:19px;color:var(--muted);
}
body.in-room #screenCall .section-heading{margin-top:21px}
body.in-room #screenCall .room-banner{margin-top:13px}
/* Keep each actual avatar, name, speaking animation and microphone glyph at
   its previously shipped size. Tighten only the surrounding frame geometry. */
body.in-room #screenCall .participant-grid.is-solo{
  grid-template-columns:minmax(0,260px);
}
body.in-room #screenCall .participant-grid.is-duo{
  grid-template-columns:repeat(2,minmax(0,226px));
}
body.in-room #screenCall .participant-grid.is-small-group{
  grid-template-columns:repeat(4,minmax(0,174px));
  justify-content:center;
}
body.in-room #screenCall .participant-grid.is-crowded{
  grid-template-columns:repeat(4,minmax(0,158px));
  justify-content:center;
  gap:9px;
}
body.in-room #screenCall .participant-grid.is-solo .participant-card{
  min-height:183px;padding:10px 13px;
}
body.in-room #screenCall .participant-grid.is-duo .participant-card{
  min-height:173px;padding:10px 13px;
}
body.in-room #screenCall .participant-grid.is-small-group .participant-card{
  min-height:154px;padding:9px 11px;
}
body.in-room #screenCall .participant-grid.is-crowded .participant-card{
  min-height:132px;padding:8px 10px;
}
body.in-room #screenCall .participant-grid.is-solo .avatar-wrap{
  margin:3px auto 8px;
}
body.in-room #screenCall .participant-grid.is-duo .avatar-wrap{
  margin:1px auto 8px;
}
body.in-room #screenCall .participant-grid.is-small-group .avatar-wrap{
  margin:1px auto 6px;
}
body.in-room #screenCall .participant-grid.is-crowded .avatar-wrap{
  margin:0 auto 6px;
}
body.in-room #screenCall .participant-grid .tile-top,
body.in-room #screenCall .participant-grid .tile-bottom{
  min-width:0;gap:4px;
}
body.in-room #screenCall .participant-grid .tile-name{
  min-width:0;
}
body.in-room #screenCall .participant-grid .tile-name strong{
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
/* The microphone equalizer lives in the dedicated settings section, not in
   a permanent sidebar; no extra microphone captures are created. */
.preferences-dialog .preferences-live-meter{
  margin:12px 0 16px;
}
.preferences-dialog .preferences-live-meter .sound-card{
  padding:12px 13px;
  border:1px solid var(--eg-line,var(--border));
  border-radius:12px;
  box-shadow:none;
}
.preferences-dialog .preferences-live-meter .level-meter{margin-top:10px;height:22px}
.preferences-dialog .preferences-live-meter .level-meter i{min-width:0}
@media(min-width:840px) and (min-height:560px){
  /* The rail remains stationary while only the right-hand pane scrolls.
     All seven 42px buttons fit at this desktop breakpoint. */
  .preferences-dialog .preferences-navigation{
    position:relative;
    overflow:hidden;
  }
  /* Section headings intentionally scroll with their cards instead of
     sticking to the top and appearing to stretch over adjacent content. */
}
@media(max-width:780px){
  body.in-room #screenCall.call-layout{
    grid-template-columns:minmax(0,1fr);
    padding-block:15px 20px;
  }
  body.in-room #screenCall .room-quick-controls{
    margin:10px 0 0;
    gap:8px;
  }
  body.in-room #screenCall .room-quick-controls > *{
    height:46px;
  }
  body.in-room #screenCall .room-quick-controls .quick-control-noise{
    flex:1 1 185px;padding:6px 9px;gap:6px;
  }
  body.in-room #screenCall .room-quick-controls .connection-status-card{
    flex:1 1 165px;padding:6px 9px;height:46px;
  }
  body.in-room #screenCall .participant-grid.is-solo{
    grid-template-columns:minmax(0,1fr);
  }
  body.in-room #screenCall .participant-grid.is-duo{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  body.in-room #screenCall .participant-grid.is-small-group,
  body.in-room #screenCall .participant-grid.is-crowded{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  body.in-room #screenCall .participant-grid.is-duo .participant-card{
    min-height:160px;
  }
  body.in-room #screenCall .participant-grid.is-small-group .participant-card{
    min-height:148px;
  }
  body.in-room #screenCall .participant-grid.is-crowded .participant-card{
    min-height:134px;
  }
}
@media(max-width:520px){
  body.in-room #screenCall .room-banner{
    margin-top:10px;
  }
  body.in-room #screenCall .room-quick-controls{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    align-items:stretch;
    gap:7px;
  }
  body.in-room #screenCall .room-quick-controls > *{
    width:100%;height:46px;
  }
  body.in-room #screenCall .room-quick-controls .quick-control-noise,
  body.in-room #screenCall .room-quick-controls .connection-status-card{
    flex:none;width:100%;min-width:0;
    padding:6px 8px;gap:6px;
  }
  body.in-room #screenCall .room-quick-controls .quick-control-icon{display:none}
  body.in-room #screenCall .room-quick-controls .enhanced-noise-row strong{font-size:11px}
  body.in-room #screenCall .room-quick-controls .enhanced-noise-row small{font-size:9px}
  body.in-room #screenCall .room-quick-controls .connection-status-icon{
    width:22px;height:22px;flex-basis:22px;
  }
  body.in-room #screenCall .room-quick-controls .connection-status-icon svg{width:15px;height:15px}
  body.in-room #screenCall .room-quick-controls .connection-status-copy strong{font-size:11px}
  body.in-room #screenCall .room-quick-controls .connection-status-copy small{font-size:9px}
  body.in-room #screenCall .room-quick-controls .connection-status-arrow{display:none}
  body.in-room #screenCall .participant-grid.is-solo .participant-card{
    min-height:128px;padding:8px 10px;
  }
  body.in-room #screenCall .participant-grid.is-duo .participant-card{
    min-height:153px;padding:8px 10px;
  }
  body.in-room #screenCall .participant-grid.is-small-group .participant-card{
    min-height:142px;padding:8px 10px;
  }
  body.in-room #screenCall .participant-grid.is-crowded .participant-card{
    min-height:128px;padding:7px 9px;
  }
  body.in-room #screenCall .participant-grid.is-crowded .avatar-wrap{margin:0 auto 5px}
}
:root[data-reduce-motion="true"] body.in-room #screenCall .room-quick-controls .connection-status-card{transition:none!important}
@media(prefers-reduced-motion:reduce) {
  body.in-room #screenCall .room-quick-controls .connection-status-card{
    transition:none!important;
  }
}

/* Echo 1.8.4: one bottom control surface. The native WebRTC and RNNoise
   controls are unchanged; this only relocates their existing DOM elements. */
body.in-room #screenCall .control-dock{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:6px;
  width:max-content;
  max-width:calc(100% - 12px);
  min-width:0;
  margin:0 auto;
  padding:10px 14px 9px;
  background:var(--eg-frost-heavy,var(--panel));
  border:1px solid var(--eg-line,var(--border));
  border-radius:24px;
  box-shadow:0 9px 26px rgba(0,0,0,.16),inset 0 1px 0 var(--eg-toplight,transparent);
}
body.in-room #screenCall .room-quick-controls{
  display:block;
  flex:none;
  width:auto;
  max-width:100%;
  min-width:0;
  height:auto;
  margin:0;
  padding:0;
  background:none;
  border:0;
  box-shadow:none;
}
body.in-room #screenCall .room-quick-controls > .dock-buttons{
  display:flex;
  justify-content:center;
  align-items:center;
  flex-wrap:nowrap;
  gap:7px;
  box-sizing:border-box;
  width:max-content;
  max-width:100%;
  height:auto;
  min-height:0;
  margin:0;
  padding:0;
  background:transparent;
  border:0;
  border-radius:0;
  box-shadow:none;
}
body.in-room #screenCall .dock-divider{
  flex:0 0 1px;
  width:1px;
  height:27px;
  background:var(--eg-line,var(--border));
  margin-inline:1px;
}
body.in-room #screenCall #noiseDockControl,
body.in-room #screenCall #openDiagnostics{
  --utility-tone:var(--muted);
  position:relative;
  display:grid;
  place-items:center;
  box-sizing:border-box;
  flex:0 0 40px;
  width:40px;
  height:40px;
  min-width:40px;
  min-height:40px;
  max-width:40px;
  max-height:40px;
  margin:0;
  padding:0;
  gap:0;
  color:var(--utility-tone);
  background:color-mix(in srgb,var(--utility-tone) 7%,var(--eg-frost-soft,var(--panel-soft)));
  border:1px solid var(--eg-line,var(--border));
  border-radius:50%;
  box-shadow:none;
  cursor:pointer;
  transition:color .16s,border-color .16s,background .16s;
}
body.in-room #screenCall #noiseDockControl{
  --utility-tone:var(--green);
}
body.in-room #screenCall #noiseDockControl[data-active="true"],
body.in-room #screenCall #noiseDockControl:has(input:checked){
  background:color-mix(in srgb,var(--green) 19%,var(--eg-frost-heavy,var(--panel)));
  border-color:color-mix(in srgb,var(--green) 58%,var(--eg-line,var(--border)));
}
body.in-room #screenCall #noiseDockControl .dock-utility-checkbox{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  margin:0;
  padding:0;
  opacity:0;
  cursor:pointer;
  z-index:1;
}
body.in-room #screenCall #noiseDockControl:has(input:disabled){
  opacity:.55;
  cursor:wait;
}
body.in-room #screenCall #noiseDockControl .quick-control-icon{
  flex:none;
  width:21px;
  height:21px;
  color:inherit;
  fill:none;
  stroke:currentColor;
  stroke-width:1.75;
  stroke-linecap:round;
  stroke-linejoin:round;
  pointer-events:none;
}
body.in-room #screenCall #noiseDockControl:focus-within,
body.in-room #screenCall #openDiagnostics:focus-visible{
  outline:2px solid var(--green);
  outline-offset:3px;
}
body.in-room #screenCall #openDiagnostics[data-quality="good"]{--utility-tone:var(--connection-good);}
body.in-room #screenCall #openDiagnostics[data-quality="warning"]{--utility-tone:var(--connection-warning);}
body.in-room #screenCall #openDiagnostics[data-quality="bad"]{--utility-tone:var(--connection-bad);}
body.in-room #screenCall #openDiagnostics[data-pending="true"]{--utility-tone:var(--connection-warning);}
body.in-room #screenCall #openDiagnostics .connection-status-icon{
  display:grid;
  place-items:center;
  flex:none;
  width:24px;
  height:24px;
  background:none;
  color:inherit;
  border-radius:0;
  padding:0;
}
body.in-room #screenCall #openDiagnostics .connection-status-icon svg{
  width:21px;
  height:21px;
  stroke:currentColor;
  stroke-width:1.8;
  fill:none;
}
body.in-room #screenCall #openDiagnostics::after{
  content:"";
  position:absolute;
  width:6px;
  height:6px;
  right:2px;
  bottom:3px;
  background:var(--utility-tone);
  border:2px solid var(--eg-frost-heavy,var(--panel));
  border-radius:50%;
}
body.in-room #screenCall :is(#noiseDockControl,#openDiagnostics):hover{
  background:color-mix(in srgb,var(--utility-tone) 14%,var(--eg-frost-heavy,var(--panel)));
  border-color:color-mix(in srgb,var(--utility-tone) 50%,var(--eg-line,var(--border)));
}
body.in-room #screenCall .room-scroll{
  padding-bottom:22px;
  scroll-padding-bottom:18px;
}
body.in-room #screenCall .section-heading{margin-top:17px}
body.in-room #screenCall .room-banner{margin-top:10px}
body.in-room #screenCall .control-dock .dock-label{
  flex:none;
  width:100%;
  justify-content:center;
  text-align:center;
  min-height:17px;
}
@media(max-width:440px){
  body.in-room #screenCall .control-dock{
    padding:8px 12px 7px;
    gap:5px;
    border-radius:21px;
  }
  body.in-room #screenCall .room-quick-controls > .dock-buttons{
    display:grid;
    grid-template-columns:repeat(5,44px);
    grid-template-rows:44px 40px;
    column-gap:6px;
    row-gap:7px;
    justify-items:center;
    align-items:center;
  }
  body.in-room #screenCall .dock-divider{display:none}
  body.in-room #screenCall :is(#micButton,#deafenButton,#screenButton,#leaveButton,#chatToggle){
    width:44px;height:44px;min-width:44px;min-height:44px;
    max-width:44px;max-height:44px;
    flex:none;
  }
  body.in-room #screenCall #micButton{grid-row:1;grid-column:1}
  body.in-room #screenCall #deafenButton{grid-row:1;grid-column:2}
  body.in-room #screenCall #chatToggle{grid-row:1;grid-column:3}
  body.in-room #screenCall #screenButton{grid-row:1;grid-column:4}
  body.in-room #screenCall #leaveButton{grid-row:1;grid-column:5}
  body.in-room #screenCall #noiseDockControl{grid-row:2;grid-column:2}
  body.in-room #screenCall #openDiagnostics{grid-row:2;grid-column:4}
  body.in-room #screenCall .section-heading{margin-top:15px}
}
:root[data-reduce-motion="true"] body.in-room #screenCall :is(#noiseDockControl,#openDiagnostics){transition:none!important}
@media(prefers-reduced-motion:reduce){
  body.in-room #screenCall :is(#noiseDockControl,#openDiagnostics){transition:none!important}
}

/* Restore the shield glyph hidden by the legacy narrow-room rule. */
body.in-room #screenCall #noiseDockControl .quick-control-icon{display:block}

/* Keep the mobile chat above the taller two-row dock, never on top of calls. */
@media(max-width:780px){
  body.in-room #chatPanel,body.in-room #chatPanel.chat-large{
    inset:auto 12px var(--room-chat-bottom,120px) 12px!important;
    height:min(65dvh,520px,var(--room-chat-height,430px))!important;
    max-height:var(--room-chat-height,430px);
  }
}

/* Desktop room invitation: keep the code/actions together instead of
   stretching a mint block across an ultrawide screen. Phone layout stays
   untouched; the bar remains fluid inside compact Windows windows. */
@media(min-width:781px){
  body.in-room #screenCall .room-banner{
    width:100%;
    max-width:940px;
    box-sizing:border-box;
    margin-inline:auto;
  }
  body.in-room #screenCall .room-banner-code{
    background:color-mix(in srgb,var(--eg-frost-heavy) 88%,var(--green) 12%);
  }
}

/* Desktop room hierarchy: align headings, invite and roster to one content rail.
   The 940px invitation width stays unchanged.  Compact windows and phones
   deliberately retain the established responsive layout.  Media is untouched. */
@media (min-width:1100px){
  body.in-room #screenCall .room-scroll{
    width:100%;
    /* 940px invitation + 13px scroll-area padding; no phantom scrollbar. */
    max-width:953px;
    margin-inline:auto;
    box-sizing:border-box;
  }
  body.in-room #screenCall .room-banner{
    margin-inline:0;
  }
  /* One or two people should not look lost in the desktop room. */
  body.in-room #screenCall .participant-grid.is-solo{
    grid-template-columns:minmax(0,320px);
    justify-content:center;
  }
  body.in-room #screenCall .participant-grid.is-solo .participant-card{
    min-height:220px;
    padding:14px 17px;
  }
  body.in-room #screenCall .participant-grid.is-duo{
    grid-template-columns:repeat(2,minmax(0,280px));
    justify-content:center;
  }
  body.in-room #screenCall .participant-grid.is-duo .participant-card{
    min-height:192px;
  }
  body.in-room #screenCall .participant-grid.is-small-group{
    grid-template-columns:repeat(4,minmax(0,202px));
    justify-content:center;
  }
  body.in-room #screenCall .participant-grid.is-crowded{
    grid-template-columns:repeat(4,minmax(0,172px));
    justify-content:center;
  }
}

/* Browser zoom (e.g. 125%) reduces the available CSS viewport height.
   Keep the full-size participant tile, but drop nonessential bottom spacing
   before scrolling becomes necessary. Real overflow keeps overflow:auto. */
@media (min-width:1100px) and (max-height:780px){
  body.in-room #screenCall .room-scroll{padding-bottom:0}
  body.in-room #screenCall .section-heading{margin-top:11px}
}

/* Redundant connected-chat subtitle is empty; connection warnings remain visible. */
body.in-room #chatPanel #chatConnection:empty{display:none}
