.group-call-dialog {
  --group-call-audio-background: #202329;
  --group-call-audio-image: url('./call-background.svg');
  --group-call-video-background: #0b0d10;
  --group-call-control-surface: #20252bc7;
  --group-call-control-hover: #424a54e6;
  --group-call-control-active: #f2f4f5e6;
  --group-call-control-active-color: #171c23;
  --group-call-hangup-surface: #d63743eb;
  --group-call-answer-surface: #287746e6;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--group-call-audio-background);
  color: #f3f6f4;
  overflow: hidden;
  letter-spacing: 0;
}
.group-call-indicator { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; min-height: 36px; padding: 4px 8px; color: #0a6d60; background: #e2f4ea; border-radius: 6px; font-size: 12px; font-weight: 700; }
.group-call-indicator[hidden] { display: none; }
.group-call-indicator [data-icon] { width: 18px; height: 18px; }
@media (max-width: 767px) {
  .group-call-indicator { width: 34px; min-width: 34px; min-height: 34px; padding: 7px; justify-content: center; }
  .group-call-indicator span:last-child { display: none; }
}
.group-call-shell {
  position: relative;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  box-sizing: border-box;
  background: var(--group-call-audio-background) var(--group-call-audio-image) center / cover no-repeat;
}
.group-call-header {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  margin: 0;
}
.group-call-heading { flex: 1; min-width: 0; }
.group-call-camera-slot { width: 44px; height: 44px; flex-shrink: 0; }
.group-call-button.group-call-preview-flip { position: absolute; z-index: 2; right: 0; top: 0; width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 12px; border: 0; border-radius: 50%; background: var(--group-call-control-surface); }
.group-call-preview-flip .icon { width: 20px; height: 20px; padding: 0; background: transparent; }
.group-call-heading h2 { margin: 0; font-size: 19px; line-height: 1.3; overflow-wrap: anywhere; }
.group-call-heading p { margin: 4px 0 0; font-size: 13px; color: #c5cbd4; overflow-wrap: anywhere; }
.group-call-layouts { display: flex; gap: 4px; flex-shrink: 0; }
.group-call-layouts button { background: var(--group-call-control-surface); color: #fff; border-radius: 8px; padding: 8px 12px; font-size: 12px; }
.group-call-layouts .icon { display: none; }
.group-call-layouts button[aria-pressed="true"] { background: var(--group-call-control-active); color: var(--group-call-control-active-color); }
.group-call-grid { display: grid; gap: 8px; min-height: 0; min-width: 0; overflow: hidden; position: relative; }
.group-call-tile { position: relative; box-sizing: border-box; min-width: 0; min-height: 0; overflow: hidden; border-radius: 8px; background: #272d35b3; border: 2px solid transparent; }
.group-call-tile:nth-child(3n + 2) { background: #2b3038b3; }
.group-call-tile:nth-child(3n) { background: #242a31b3; }
.group-call-tile.is-speaking { border-color: #b5e89b; }
.group-call-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; background: var(--group-call-video-background); }
.group-call-tile.has-video video { opacity: 1; }
.group-call-grid.is-sharing { display: block; }
.group-call-grid.is-sharing .group-call-tile.is-screen { background: var(--group-call-video-background); }
.group-call-grid.is-sharing .group-call-tile:not(.is-screen) .group-call-label { display: none; }
.group-call-share-person { position: absolute; z-index: 2; display: grid; place-items: center; overflow: hidden; border: 2px solid #6b778a; border-radius: 8px; background: #272d35; box-sizing: border-box; }
.group-call-share-person[hidden] { display: none; }
.group-call-share-person .avatar { width: 70%; height: 70%; min-width: 0; max-width: 64px; max-height: 64px; font-size: 18px; }
.group-call-tile.is-local video { transform: scaleX(-1); }
.group-call-dialog.rear-camera .is-local video { transform: none; }
.group-call-fallback { position: absolute; inset: 0 0 28px; display: grid; place-items: center; overflow: hidden; }
.group-call-fallback .avatar { width: 64px; height: 64px; min-width: 0; max-width: 65%; max-height: 75%; font-size: 22px; aspect-ratio: 1; }
.has-video .group-call-fallback { display: none; }
.group-call-label { position: absolute; inset: auto 0 var(--group-label-offset, 0px); min-width: 0; display: flex; align-items: center; gap: 8px; padding: 6px 8px; color: #fff; background: #12161ca6; font-size: 12px; line-height: 1.35; }
.group-call-label strong { font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
.group-call-label span { color: #c5cbd4; font-size: 11px; flex-shrink: 0; }
.group-call-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; min-width: 0; background: transparent; border: 0; box-shadow: none; }
.group-call-button { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; min-width: 44px; height: 44px; padding: 10px; border: 1px solid #ffffff26; border-radius: 50%; background: var(--group-call-control-surface, #20252bc7); color: #fff; backdrop-filter: blur(12px); }
.group-call-button .icon { width: 22px; height: 22px; }
.group-call-button[aria-pressed="true"] { background: var(--group-call-control-active); color: var(--group-call-control-active-color); }
.group-call-button:hover:not(:disabled) { background: var(--group-call-control-hover, #424a54e6); }
.group-call-button[aria-pressed="true"]:hover:not(:disabled) { background: #fff; }
.group-call-button:focus-visible { outline: 3px solid #e1ebf8; outline-offset: 2px; }
.group-call-hangup { background: var(--group-call-hangup-surface); color: #fff; }
.group-call-hangup:hover:not(:disabled) { background: #ef4653; }
.group-call-dialog.recording-active .group-call-header::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #f05258; flex-shrink: 0; }
.group-call-button.recording-active[aria-pressed="true"] { border-color: #f05258; background: #8b2938; color: #fff; }
.group-call-button.recording-active[aria-pressed="true"]:hover:not(:disabled) { background: #a53042; }
.group-call-hangup .icon { transform: none; }
.group-call-answer { background: var(--group-call-answer-surface); }
.group-call-error { margin: 0; color: #ffc2c8; font-size: 13px; overflow-wrap: anywhere; max-height: 64px; overflow: auto; }
.group-call-picker { width: min(460px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); padding: 16px; border-radius: 8px; overflow: hidden; }
.group-call-picker[open] { display: flex; flex-direction: column; gap: 12px; }
.group-call-picker header { display: flex; align-items: center; gap: 12px; margin: 0; flex-shrink: 0; }
.group-call-picker h2 { flex: 1; font-size: 18px; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.group-call-picker > input { flex-shrink: 0; width: 100%; box-sizing: border-box; }
.group-call-choices { overflow: auto; overscroll-behavior: contain; min-height: 0; max-height: 54dvh; }
.group-call-contact { display: flex; align-items: center; gap: 12px; padding: 8px 0; margin: 0; border-bottom: 1px solid var(--line); }
.group-call-contact span:not(.avatar) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.group-call-contact input { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--accent); }
.group-call-contact small { flex-shrink: 0; color: var(--muted); }
.group-call-picker-footer { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-shrink: 0; }
.group-call-picker-footer > span { flex: 1; font-size: 13px; }
.group-call-picker .group-call-error { color: var(--danger); flex-shrink: 0; }
.group-call-picker .group-call-error:empty { display: none; }
/* CALL-13: video owns the full canvas; chrome and tile labels remain overlays. */
.group-call-dialog.with-video .group-call-shell { display: block; padding: 0; background: var(--group-call-video-background); }
.group-call-dialog.with-video .group-call-grid { position: absolute; inset: 0; }
.group-call-dialog.with-video .group-call-header {
  position: absolute; z-index: 4; inset: 0 0 auto;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
  background: transparent; text-shadow: 0 1px 4px #000c; pointer-events: none;
}
.group-call-dialog.with-video .group-call-header button { pointer-events: auto; }
.group-call-dialog.with-video .group-call-heading p { color: #fff; }
.group-call-dialog.with-video .group-call-controls {
  position: absolute; z-index: 4; inset: auto 0 0;
  padding: 12px max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  pointer-events: none;
}
.group-call-dialog.with-video .group-call-controls button { pointer-events: auto; }
.group-call-dialog.with-video .group-call-error {
  position: absolute; z-index: 5; top: var(--group-header-clearance, 80px); left: 12px; right: 12px;
  padding: 8px 12px; background: #20252be6; border-radius: 8px;
}
.group-call-dialog.controls-hidden .group-call-label { bottom: 0; }
.group-call-dialog .call-minimize { border-radius: 50%; background: var(--group-call-control-surface); backdrop-filter: blur(12px); }
.group-call-dialog .call-minimize:hover:not(:disabled) { background: var(--group-call-control-hover); }
.group-call-dialog .call-minimize:focus-visible { outline: 3px solid #e1ebf8; outline-offset: 2px; }
@media (max-height: 480px), (max-width: 1100px) {
  .group-call-layouts button { width: 36px; height: 36px; padding: 8px; }
  .group-call-layouts .icon { display: block; width: 20px; height: 20px; }
  .group-call-layouts span { display: none; }
}
@media (max-width: 700px), (pointer: coarse) and (max-width: 1000px) {
  .group-call-layouts { display: none; }
  .group-call-shell { gap: 8px; padding: calc(8px + env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
  .group-call-heading h2 { font-size: 16px; }
  .group-call-heading p { font-size: 12px; }
  .group-call-header { gap: 8px; }
  .group-call-controls { gap: 6px; flex-wrap: wrap; }
  .group-call-label { padding: 4px; gap: 4px; font-size: 11px; }
  .group-call-label span { font-size: 10px; }
  .group-call-fallback .avatar { width: 48px; height: 48px; font-size: 16px; }
}
