/* Echo 1.8.4 / Midnight Glass — final visual consistency pass.
   Intentional spacing and states; no audio, signaling or screen-capture changes. */

/* A lone user or a pair is a purposeful composition instead of two
   cards stuck to the left edge of a mostly empty room. */
@media (min-width:1001px){
  body.in-room #screenCall .participant-grid.is-solo,
  body.in-room #screenCall .participant-grid.is-duo{
    justify-content:center;
  }
  body.in-room #screenCall .participant-grid.is-solo + .empty-notice{
    max-width:300px;
    margin-inline:auto;
    text-align:center;
    justify-content:center;
    padding-top:16px;
  }
}
@media (min-width:781px) and (max-width:1000px){
  body.in-room #screenCall .participant-grid.is-solo{
    justify-content:center;
  }
  body.in-room #screenCall .participant-grid.is-solo + .empty-notice{
    max-width:300px;margin-inline:auto;text-align:center;justify-content:center;
  }
}
body.in-room #screenCall .participant-card{
  --echo-card-glow:color-mix(in srgb,var(--green) 7%,transparent);
  box-shadow:inset 0 1px 0 var(--eg-toplight),0 6px 24px rgba(0,9,12,.08);
  transition:border-color .18s ease,box-shadow .18s ease,background-color .18s ease;
}
body.in-room #screenCall .participant-card.speaking{
  box-shadow:0 0 0 1px color-mix(in srgb,var(--green) 19%,transparent),
             0 0 23px color-mix(in srgb,var(--green) 11%,transparent),
             inset 0 1px 0 var(--eg-toplight);
}
body.in-room #screenCall .participant-card .tile-top,
body.in-room #screenCall .participant-card .tile-bottom{
  min-width:0;
}
body.in-room #screenCall .participant-card .tile-name{
  min-width:0;
}
body.in-room #screenCall .participant-card .tile-name strong{
  max-width:100%;
  letter-spacing:-.18px;
  line-height:1.26;
}
body.in-room #screenCall .participant-card .tile-name .small-muted,
body.in-room #screenCall .participant-card .tile-top .small-muted{
  line-height:1.35;
}
body.in-room #screenCall .participant-card .tile-tag{
  letter-spacing:.3px;
  font-weight:700;
}
body.in-room #screenCall .participant-card .mic-icon{
  flex:0 0 auto;
}
body.in-room #screenCall .participant-grid.is-crowded .tile-top{
  gap:5px;
}
body.in-room #screenCall .participant-grid.is-crowded .tile-name strong{
  font-size:12px;
}
body.in-room #screenCall .participant-grid.is-crowded .tile-name .small-muted{
  font-size:10px;
}

/* A cohesive visual language for joining, reconnecting, and copying. */
body.in-room #screenCall .connection-pill{
  box-shadow:inset 0 1px 0 color-mix(in srgb,var(--green) 14%,transparent);
}
body.in-room #screenCall .connection-pill[data-connection-state="reconnecting"]{
  background:color-mix(in srgb,#c99555 14%,var(--eg-frost-heavy));
  border-color:color-mix(in srgb,#dbad6c 48%,var(--eg-line));
  color:#f2d5aa;
}
body.in-room #screenCall .connection-pill[data-connection-state="reconnecting"] .online-dot{
  background:#e1b36f;
  box-shadow:0 0 0 3px rgba(225,179,111,.13);
}
body.in-room #screenCall .copy-room-code,
body.in-room #screenCall .banner-button{
  transition:background-color .16s ease,box-shadow .16s ease,
             border-color .16s ease,transform .16s ease;
}
body.in-room #screenCall .copy-room-code.is-copied,
body.in-room #screenCall .banner-button.is-copied{
  box-shadow:0 0 0 2px color-mix(in srgb,var(--green) 19%,transparent),
             inset 0 1px 0 rgba(255,255,255,.22);
}
body.in-room #screenCall .copy-room-code:active:not(:disabled),
body.in-room #screenCall .banner-button:active:not(:disabled),
body.in-room #screenCall .dock-button:active:not(:disabled){
  transform:scale(.97);
}
body.in-room #screenCall .room-banner{
  box-shadow:inset 0 1px 0 var(--eg-toplight),0 8px 30px rgba(0,9,13,.07);
}

/* Consistent keyboard focus, especially for compact icon-only buttons.
   Focus is intentionally not shown on ordinary mouse/touch clicks. */
body.in-room #screenCall :is(
  .copy-room-code,.banner-button,.dock-button,.settings-mobile-toggle,
  .connection-status-card,.chat-toggle
):focus-visible,
.preferences-dialog :is(
  button,select,input,textarea
):focus-visible,
body.in-room #chatPanel :is(button,textarea):focus-visible{
  outline:2px solid var(--green);
  outline-offset:3px;
}
body.in-room #screenCall :is(
  .copy-room-code,.banner-button,.dock-button,.settings-mobile-toggle
):disabled{
  opacity:.58;
  cursor:not-allowed;
}

/* Settings: well-separated surfaces and precise desktop active state. */
.preferences-dialog .preferences-content > section{
  border-color:var(--eg-line,var(--border));
  border-radius:15px;
  background:linear-gradient(
    150deg,
    var(--eg-frost-soft,var(--panel)),
    var(--eg-frost-heavy,var(--panel))
  );
  box-shadow:inset 0 1px 0 var(--eg-toplight,transparent);
}
.preferences-dialog .preferences-content > section > h3{
  font-size:16px;
  line-height:1.35;
  letter-spacing:-.35px;
  margin-bottom:15px;
}
.preferences-dialog .settings-subsection{
  background:color-mix(in srgb,var(--eg-frost-heavy,var(--panel-soft)) 80%,transparent);
  border:1px solid var(--eg-line,var(--border));
  border-radius:12px;
}
.preferences-dialog .preferences-nav-list button[aria-current="true"]{
  position:relative;
}
.preferences-dialog .preferences-nav-list button[aria-current="true"]::before{
  content:"";
  position:absolute;left:0;top:9px;bottom:9px;width:2px;
  border-radius:3px;background:var(--green);
}
.preferences-dialog .avatar-profile-preview{
  box-shadow:inset 0 1px 0 var(--eg-toplight,transparent);
}
.preferences-dialog .device-availability{
  margin:7px 0 12px;
  padding-left:15px;
  position:relative;
}
.preferences-dialog .device-availability::before{
  content:"";
  position:absolute;left:1px;top:.48em;
  width:6px;height:6px;border-radius:50%;
  background:color-mix(in srgb,var(--green) 72%,var(--muted));
}
.preferences-dialog .device-availability:empty::before{display:none}

/* Mobile: air between audio settings and link status, while preserving
   an expandable panel and the fixed in-call dock. */
@media (max-width:780px){
  body.in-room #screenCall .room-scroll > .settings-panel{
    border-radius:17px;
    overflow:hidden;
    box-shadow:inset 0 1px 0 var(--eg-toplight),0 9px 28px rgba(0,8,12,.08);
  }
  body.in-room #screenCall .settings-panel .settings-mobile-toggle{
    color:var(--eg-text,var(--text));
    font-size:13px;font-weight:700;
    letter-spacing:-.1px;
    padding-inline:16px;
    border-radius:0;
    min-height:48px;
  }
  body.in-room #screenCall .settings-panel .settings-mobile-toggle:hover{
    background:color-mix(in srgb,var(--eg-frost-soft) 65%,transparent);
  }
  body.in-room #screenCall .settings-panel .settings-mobile-toggle svg{
    width:17px;height:17px;
    color:var(--green);
  }
  body.in-room #screenCall .settings-panel .connection-status-card{
    width:calc(100% - 24px);
    margin:1px 12px 12px;
    min-height:58px;
    padding:9px 11px;
    border-radius:12px;
    background:var(--eg-frost-soft,var(--panel-soft));
  }
  body.in-room #screenCall .settings-panel.is-expanded .settings-inner{
    border-top:1px solid var(--eg-line,var(--border));
    padding-top:13px;
    padding-bottom:14px;
  }
  body.in-room #screenCall .settings-panel.is-expanded .connection-status-card{
    margin-top:4px;
  }
  body.in-room #screenCall .room-banner{
    gap:8px;
  }
}
@media (max-width:520px){
  /* The previous 34px clipboard targets were hard to tap. */
  body.in-room #screenCall .room-banner-code .copy-room-code,
  body.in-room #screenCall .room-banner-secondary .banner-button{
    min-width:40px;width:40px;min-height:40px;height:40px;
    padding:9px;border-radius:11px;
  }
  body.in-room #screenCall .room-banner-code-row strong{
    font-size:12px;
    letter-spacing:.1px;
  }
  body.in-room #screenCall .participant-grid.is-crowded .participant-card{
    min-height:141px;
  }
  body.in-room #screenCall .participant-grid.is-crowded .participant-card .tile-top .small-muted{
    max-width:84px;
    text-overflow:ellipsis;
    overflow:hidden;white-space:nowrap;
  }
  body.in-room #screenCall .connection-pill{
    white-space:nowrap;
    font-size:11px;
  }
  .preferences-dialog .preferences-content > section{padding:14px}
  .preferences-dialog .preferences-content > section > h3{font-size:15px}
}

/* Motion stays a quiet acknowledgement, not persistent decoration. */
:root[data-reduce-motion="true"] body.in-room #screenCall :is(
  .copy-room-code,.banner-button,.dock-button,.connection-pill
){
  transition:none!important;
}
@media(prefers-reduced-motion:reduce){
  body.in-room #screenCall :is(
    .copy-room-code,.banner-button,.dock-button,.connection-pill
  ){transition:none!important;}
}
