html.call-pip-document,
html.call-pip-document body {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.call-pip-body {
  margin: 0;
  background: #080c12;
}

html.is-desktop-device:not(.call-pip-document),
html.is-desktop-device:not(.call-pip-document) body:not(.call-pip-body),
html.is-desktop-device:not(.call-pip-document) body:not(.call-pip-body) .topbar,
html.is-desktop-device:not(.call-pip-document) body:not(.call-pip-body) .app-layout {
  min-width: 320px;
}

.call-pip-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 10px;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -35%, rgba(78, 161, 255, 0.16), transparent 55%),
    #080c12;
}

.call-pip-header {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.call-pip-header .brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}

.call-pip-heading {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.call-pip-heading strong,
.call-pip-heading span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-pip-heading strong {
  font-size: 14px;
  line-height: 1.15;
}

.call-pip-heading span {
  color: var(--muted);
  font-size: 11px;
}

.call-pip-video-shell {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #05080c;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.call-pip-video {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  background: #05080c;
}

.call-pip-video.is-screen-source {
  object-fit: contain;
}

.call-pip-video-label {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 7px;
  z-index: 2;
  overflow: hidden;
  padding: 5px 7px;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(8, 12, 18, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  font-size: 11px;
  backdrop-filter: blur(8px);
}

.call-pip-fallback {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  padding: 14px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.call-pip-fallback::before {
  content: "";
  width: 42px;
  height: 42px;
  background: url("/icons/icon.svg") center / contain no-repeat;
  border-radius: 12px;
}

.call-pip-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.call-pip-control.control-button {
  width: 46px;
  min-width: 46px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 9px;
}

.call-pip-control .control-icon {
  width: 22px;
  height: 22px;
}

.call-pip-control.call-pip-hangup {
  color: #fff3f3;
  background: rgba(255, 107, 107, 0.2);
  border-color: rgba(255, 107, 107, 0.72);
}

@media (max-width: 360px), (max-height: 270px) {
  .call-pip-shell {
    gap: 6px;
    padding: 7px;
  }

  .call-pip-header {
    gap: 7px;
  }

  .call-pip-header .brand-mark {
    width: 25px;
    height: 25px;
    border-radius: 7px;
  }

  .call-pip-heading strong {
    font-size: 12px;
  }

  .call-pip-heading span,
  .call-pip-video-label,
  .call-pip-fallback {
    font-size: 10px;
  }

  .call-pip-controls {
    gap: 6px;
  }

  .call-pip-control.control-button {
    width: 38px;
    min-width: 38px;
    height: 36px;
    min-height: 36px;
    border-radius: 8px;
  }

  .call-pip-control .control-icon {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 280px), (max-height: 210px) {
  .call-pip-shell {
    gap: 4px;
    padding: 5px;
  }

  .call-pip-header .brand-mark {
    width: 22px;
    height: 22px;
  }

  .call-pip-heading span,
  .call-pip-video-label {
    display: none;
  }

  .call-pip-controls {
    gap: 4px;
  }

  .call-pip-control.control-button {
    width: 32px;
    min-width: 32px;
    height: 30px;
    min-height: 30px;
    border-radius: 7px;
  }

  .call-pip-control .control-icon {
    width: 16px;
    height: 16px;
  }
}

/* Compact installed-app layout for narrow, short windows like the call window. */
@media (max-width: 420px) and (max-height: 680px) and (hover: hover) and (pointer: fine) {
  body:not(.call-pip-body) .topbar {
    min-height: 0;
    gap: 6px;
    padding: 6px 8px;
  }

  body:not(.call-pip-body) .brand {
    gap: 8px;
  }

  body:not(.call-pip-body) .brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }

  body:not(.call-pip-body) .brand strong {
    font-size: 14px;
  }

  body:not(.call-pip-body) .brand-copy {
    gap: 0;
  }

  body:not(.call-pip-body) #roomLabel {
    max-width: 68vw;
    font-size: 11px;
  }

  body:not(.call-pip-body) .top-actions {
    grid-template-columns: repeat(3, 38px) minmax(70px, 1fr);
    gap: 6px;
  }

  body:not(.call-pip-body) .top-actions .icon-text-button {
    width: 38px;
    min-width: 38px;
    height: 36px;
    min-height: 36px;
  }

  body:not(.call-pip-body) .top-actions .icon-text-button .button-icon {
    width: 19px;
    height: 19px;
  }

  body:not(.call-pip-body) #joinButton {
    grid-column: -2 / -1;
    min-height: 36px;
    padding: 0 9px;
    font-size: 12px;
  }

  body:not(.call-pip-body) #participantList {
    min-height: 50px;
    gap: 7px;
    padding: 4px 8px 6px 1px;
  }

  body:not(.call-pip-body) .participant-item {
    width: 52px;
    height: 44px;
    min-height: 44px;
  }

  body:not(.call-pip-body) .participant-avatar {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
  }

  body:not(.call-pip-body) .participant-status-dot {
    width: 15px;
    height: 15px;
  }

  body:not(.call-pip-body) .participant-status-dot .button-icon {
    width: 9px;
    height: 9px;
  }

  body:not(.call-pip-body) .stage {
    padding: 6px;
    padding-bottom: calc(58px + env(safe-area-inset-bottom));
  }

  body:not(.call-pip-body) .stage-controls,
  body:not(.call-pip-body) .stage-controls.has-camera-switch {
    bottom: calc(6px + env(safe-area-inset-bottom));
    gap: 4px;
    padding: 5px;
  }

  body:not(.call-pip-body) .stage-controls {
    grid-template-columns: repeat(4, 40px);
  }

  body:not(.call-pip-body) .stage-controls.has-camera-switch {
    grid-template-columns: repeat(5, 40px);
  }

  body:not(.call-pip-body) .stage-controls .control-button {
    width: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  body:not(.call-pip-body) .stage-controls .control-icon {
    width: 21px;
    height: 21px;
  }

  body:not(.call-pip-body) .tile-footer {
    min-height: 28px;
    margin: 5px;
    padding: 4px 6px;
    font-size: 10px;
  }
}
