/* Screen sharing uses the same semantic colors in all four Echo themes. */
.screen-audio-option{display:flex;align-items:center;gap:8px;padding:12px 0;color:var(--tone-edf4f1);font-size:13px}.screen-audio-option input{width:20px;height:20px;accent-color:var(--green)}
.screen-share-preview[hidden]{display:none!important}
.screen-share-preview{margin-top:20px;padding:15px;border:1px solid var(--border);border-radius:14px;background:var(--panel)}
.screen-share-preview-heading{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:12px}
.screen-share-preview-heading strong{display:block;font-size:14px;color:var(--tone-edf4f1)}
.screen-share-preview-heading p{font-size:12px;line-height:1.5;color:var(--muted);margin:5px 0 0}
.screen-share-preview-heading button{flex:none;min-height:38px;padding:8px 12px;border:1px solid var(--connection-bad,#ef9eab);border-radius:9px;background:var(--panel-soft);color:var(--connection-bad,#ef9eab);font:inherit;font-size:12px;cursor:pointer}
.screen-share-preview-heading button:focus-visible,#screenButton:focus-visible{outline:2px solid var(--green);outline-offset:3px}
#localScreenVideo,#remoteScreenVideo{display:block;width:100%;max-height:55vh;aspect-ratio:16/9;background:#0e141c;object-fit:contain;border-radius:10px}
#screenButton[aria-pressed="true"]{border-color:var(--green);color:var(--green);background:var(--panel-soft)}
#screenButton:disabled{opacity:.5;cursor:not-allowed}
@media(max-width:520px){.screen-share-preview{padding:12px}.screen-share-preview-heading{align-items:flex-start;flex-direction:column}.screen-share-preview-heading button{align-self:flex-start}}

#screenFullscreen{border-color:var(--border);color:var(--green)}
#localScreenVideo{max-width:500px;max-height:30vh}
#screenPeerNotice{max-width:52ch}
.screen-share-status{font-size:12px;color:var(--muted);line-height:1.5;min-height:1.5em;margin:12px 0 0}
.screen-share-status:empty{min-height:0;margin:0}
@media(max-width:520px){.screen-share-preview-heading button{min-height:42px}}

#startApplicationAudio{border-color:var(--green);color:var(--green)}

/* Immersive viewer for desktop/WebView2 and mobile. Fullscreen API elevates
   THIS PANEL to the browser top layer, not the room/document. The fixed layout
   also works without the API (e.g. iOS, denied fullscreen). The audio stream
   and room remain alive beneath the viewer. */
html.screen-view-expanded,html.screen-view-expanded body{
  overflow:hidden!important;overscroll-behavior:none
}
html.screen-view-expanded #remoteScreenPreview,
#remoteScreenPreview:fullscreen{
  position:fixed!important;inset:0!important;z-index:2000!important;
  display:flex!important;flex-direction:column;box-sizing:border-box;
  width:100vw!important;max-width:none!important;
  height:100dvh!important;max-height:none!important;min-height:0!important;
  margin:0!important;border:0!important;border-image:none!important;
  border-radius:0!important;clip-path:none!important;overflow:hidden!important;
  padding:max(8px,env(safe-area-inset-top))
    max(8px,env(safe-area-inset-right))
    max(8px,env(safe-area-inset-bottom))
    max(8px,env(safe-area-inset-left))!important;
  background:#0b1119!important;box-shadow:none!important;
  transition:none!important;animation:none!important
}
html.screen-view-expanded #remoteScreenPreview .screen-share-preview-heading,
#remoteScreenPreview:fullscreen .screen-share-preview-heading{
  display:flex;flex:0 0 auto;flex-direction:row;align-items:center;
  justify-content:space-between;gap:8px;margin:0 0 8px;min-width:0
}
html.screen-view-expanded #remoteScreenPreview .screen-share-preview-heading>div,
#remoteScreenPreview:fullscreen .screen-share-preview-heading>div{min-width:0}
html.screen-view-expanded #remoteScreenPreview .screen-share-preview-heading strong,
#remoteScreenPreview:fullscreen .screen-share-preview-heading strong{
  font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap
}
html.screen-view-expanded #remoteScreenPreview .screen-share-preview-heading p,
#remoteScreenPreview:fullscreen .screen-share-preview-heading p{
  font-size:11px;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap
}
html.screen-view-expanded #screenFullscreen,
#remoteScreenPreview:fullscreen #screenFullscreen{
  flex:none;min-height:40px;padding:7px 10px;font-size:12px
}
html.screen-view-expanded #remoteScreenVideo,
#remoteScreenPreview:fullscreen #remoteScreenVideo{
  display:block;flex:1 1 auto;align-self:stretch;box-sizing:border-box;
  width:100%!important;height:100%!important;min-height:0!important;
  max-height:none!important;aspect-ratio:auto!important;object-fit:contain;
  border-radius:5px;background:#070b10
}
/* iPhone can fill the web viewport, but the OS-owned browser bars remain. */

/* Compact local sharing panel. Audio consent and WebRTC flow are unchanged. */
#screenSharePreview .screen-share-preview-heading{
  display:flex;flex-direction:row;align-items:flex-start;justify-content:space-between;
  gap:12px 18px;flex-wrap:wrap
}
#screenSharePreview .screen-share-heading-text{min-width:180px;flex:1 1 220px}
#screenSharePreview .screen-share-actions{
  display:flex;align-items:center;justify-content:flex-end;gap:8px;
  flex:0 1 auto;flex-wrap:wrap;margin-left:auto;min-width:0
}
#screenSharePreview .screen-share-actions button{
  flex:none;min-height:40px;padding:8px 12px;white-space:nowrap
}
#screenSharePreview .screen-share-actions button[hidden]{display:none!important}
#screenSharePreview #stopScreenAudio{
  border-color:var(--border);color:var(--tone-edf4f1);background:var(--panel-soft)
}
#screenSharePreview #stopScreenPreview{
  border-color:var(--connection-bad,#ef9eab);color:var(--connection-bad,#ef9eab)
}
#screenSharePreview .screen-audio-controls{
  display:block;min-width:0;padding:11px 0;margin:0 0 12px;
  border:0;border-top:1px solid var(--border);border-bottom:1px solid var(--border);
  background:transparent
}
#screenSharePreview .screen-audio-controls[hidden],#screenAudioSettings[hidden]{display:none!important}
#screenSharePreview .screen-audio-summary{display:flex;align-items:center;gap:11px;min-width:0}
#screenSharePreview .screen-audio-summary-icon{
  display:grid;place-items:center;flex:0 0 36px;width:36px;height:36px;
  border:1px solid var(--border);border-radius:10px;background:var(--panel-soft);color:var(--green)
}
#screenSharePreview .screen-audio-summary-icon svg{width:18px;height:18px}
#screenSharePreview .screen-audio-summary-text{min-width:0;flex:1 1 auto}
#screenSharePreview .screen-audio-summary-text strong{
  display:block;font-size:13px;font-weight:650;color:var(--tone-edf4f1)
}
#screenSharePreview .screen-audio-summary-text span{
  display:block;color:var(--muted);font-size:12px;line-height:1.4;
  overflow:hidden;white-space:nowrap;text-overflow:ellipsis
}
#screenSharePreview #screenAudioSettingsToggle{
  flex:0 0 auto;min-height:36px;padding:6px 12px;
  border:1px solid var(--border);border-radius:8px;color:var(--tone-edf4f1);
  background:var(--panel-soft);font:inherit;font-size:12px;cursor:pointer
}
#screenSharePreview #screenAudioSettingsToggle:focus-visible{
  outline:2px solid var(--green);outline-offset:3px
}
#screenSharePreview .screen-audio-settings{
  display:grid;gap:8px;min-width:0;padding:12px 0 1px
}
#screenSharePreview .screen-audio-settings select{
  width:100%;max-width:100%;min-width:0;box-sizing:border-box
}
#screenSharePreview .screen-audio-mode-hint{max-width:100%;overflow-wrap:anywhere}
#screenSharePreview #localScreenVideo{
  width:100%;max-width:min(100%,840px);max-height:min(42vh,470px);
  margin:0 auto;object-fit:contain
}
@media(max-width:900px){
  #screenSharePreview .screen-share-preview-heading{flex-direction:column;align-items:stretch}
  #screenSharePreview .screen-share-heading-text{flex:1 1 auto;min-width:0}
  #screenSharePreview .screen-share-actions{justify-content:flex-start;margin-left:0;width:100%}
}
@media(max-width:520px){
  #screenSharePreview .screen-share-actions{gap:7px}
  #screenSharePreview .screen-share-actions button{min-height:42px;white-space:normal}
  #screenSharePreview .screen-audio-summary-icon{flex-basis:32px;width:32px;height:32px}
  #screenSharePreview .screen-audio-summary{gap:8px}
}

/* Isolated experimental native source dialog. Hidden in ordinary clients. */
#windowCaptureQADialog{width:min(430px,calc(100vw - 32px));padding:20px;border:1px solid var(--border);border-radius:16px;background:var(--panel);color:var(--tone-edf4f1);box-sizing:border-box}
#windowCaptureQADialog[open]{display:grid;gap:12px}
#windowCaptureQADialog::backdrop{background:#081017bb}
#windowCaptureQADialog label{display:flex;align-items:center;justify-content:space-between;gap:14px}
#windowCaptureQADialog button,#windowCaptureQADialog select{font:inherit;color:inherit;background:var(--panel-soft);border:1px solid var(--border);border-radius:8px;padding:10px}
#windowCaptureQAStart{border-color:var(--green)!important;color:var(--green)!important}

.screen-quality-stat{font-variant-numeric:tabular-nums}.screen-quality-stat[hidden]{display:none!important}

.screen-preview-toggle{align-self:flex-start;margin:8px 0;padding:6px 12px;border:1px solid var(--border, #52616d);border-radius:8px;background:transparent;color:inherit;font:inherit;cursor:pointer}.screen-preview-toggle[hidden],#localScreenVideo[hidden]{display:none!important}
