.chat-call-shell {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1080;
}

.chat-call-window {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: min(92vw, 960px);
  max-width: 960px;
  background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
  color: #e2e8f0;
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(2, 6, 23, 0.45);
  overflow: hidden;
  pointer-events: auto;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.chat-call-window.is-video-layout {
  resize: both;
  min-width: 520px;
  min-height: 420px;
}

.chat-call-window.is-audio-layout {
  width: min(92vw, 420px) !important;
  max-width: 420px !important;
  min-width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  resize: none;
}

.chat-call-window.is-fullscreen {
  width: 100vw !important;
  max-width: none;
  height: 100vh !important;
  max-height: none;
  right: 0;
  bottom: 0;
  border-radius: 0;
  resize: none;
}

.chat-call-window.is-minimized {
  width: auto !important;
  min-width: 320px !important;
  max-width: 420px !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: 100vh !important;
}

.chat-call-window.is-minimized .chat-call-body,
.chat-call-window.is-minimized .chat-call-controls {
  display: none;
}

.chat-call-window.is-minimized .chat-call-bar {
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
}

.chat-call-screen-minimize {
  position: fixed;
  z-index: 1081;
  top: 16px;
  right: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  padding: 9px 13px;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.94);
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.36);
  font-size: 12px;
  font-weight: 700;
  pointer-events: auto;
}

.chat-call-screen-minimize svg {
  width: 16px;
  height: 16px;
}

.chat-call-window.is-minimized.is-screen-sharing {
  width: min(88vw, 360px) !important;
  min-width: 0 !important;
}

.chat-call-window.is-minimized.is-screen-sharing .chat-call-body {
  display: block;
  padding: 10px;
}

.chat-call-window.is-minimized.is-screen-sharing .chat-call-stage,
.chat-call-window.is-minimized.is-screen-sharing .chat-call-remote {
  min-height: 150px;
  height: 150px;
}

.chat-call-window.is-minimized.is-screen-sharing .chat-call-remote,
.chat-call-window.is-minimized.is-screen-sharing .chat-call-status-feed {
  display: none;
}

.chat-call-window.is-minimized.is-screen-sharing .chat-call-local {
  position: relative;
  inset: 0;
  width: 100%;
  height: 150px;
  aspect-ratio: auto;
  border-radius: 12px;
}

.chat-call-window.is-dragging {
  user-select: none;
}

.chat-call-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  cursor: move;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(12px);
}

.chat-call-minimized-actions {
  display: none;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 18px 18px;
}

.chat-call-window.is-minimized .chat-call-minimized-actions {
  display: flex;
}

.chat-call-incoming-btn-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  align-items: center;
  justify-content: center;
}

.chat-call-incoming-btn-icon svg {
  width: 18px;
  height: 18px;
}

.chat-call-bar-main {
  min-width: 0;
}

.chat-call-title {
  font-size: 15px;
  font-weight: 700;
}

.chat-call-subtitle {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

.chat-call-bar-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.chat-call-quality,
.chat-call-timer {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(15, 23, 42, 0.5);
}

.chat-call-bar-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.95);
  color: #e2e8f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.chat-call-bar-btn svg {
  width: 16px;
  height: 16px;
}

.chat-call-bar-btn.chat-call-end {
  background: #dc2626;
}

.chat-call-body {
  padding: 18px;
}

.chat-call-stage {
  position: relative;
  min-height: 420px;
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 35%),
    radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.22), transparent 35%),
    #020617;
}

.chat-call-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(6px);
  z-index: 12;
}

.chat-call-loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 24px 50px rgba(2, 6, 23, 0.35);
}

.chat-call-spinner {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(148, 163, 184, 0.25);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: chat-call-spin 1s linear infinite;
}

@keyframes chat-call-spin {
  to { transform: rotate(360deg); }
}

.chat-call-loading-text {
  font-size: 13px;
  color: #f8fafc;
  font-weight: 600;
  text-align: center;
}

.chat-call-window.is-audio-layout .chat-call-stage,
.chat-call-window.is-audio-layout .chat-call-remote {
  min-height: 210px;
}

.chat-call-window.is-audio-layout .chat-call-local {
  width: 110px;
  aspect-ratio: 1 / 1;
}

.chat-call-remote audio {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.chat-call-remote,
.chat-call-local {
  position: relative;
}

.chat-call-remote {
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-call-remote video,
.chat-call-local video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #020617;
}

.chat-call-avatar-stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.25), rgba(15, 23, 42, 0.6));
}

.chat-call-avatar-large,
.chat-call-local-fallback {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 800;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #eff6ff;
}

.chat-call-avatar-name {
  font-size: 15px;
  font-weight: 600;
}

.chat-call-avatar-stage.is-camera-off {
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.84), rgba(2, 6, 23, 0.98));
}

.chat-call-avatar-stage.is-camera-off .chat-call-avatar-large,
.chat-call-avatar-stage.is-camera-off .chat-call-avatar-name {
  display: none;
}

.chat-call-stage-label {
  position: absolute;
  left: 16px;
  bottom: 16px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.66);
  font-size: 12px;
}

.chat-call-local {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: min(24vw, 210px);
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.42);
}

.chat-call-local-fallback {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  border-radius: 0;
  font-size: 22px;
}

.chat-call-local-label {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.74);
  font-size: 11px;
}

.chat-call-status-feed {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.chat-call-status-item {
  font-size: 12px;
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(15, 23, 42, 0.5);
}

.chat-call-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 0 18px 18px;
}

.chat-call-control {
  position: relative;
  border: 0;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: rgba(30, 41, 59, 0.95);
  color: #f8fafc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.26);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.chat-call-control.is-busy .chat-call-control-icon {
  opacity: 0;
}

.chat-call-control.is-busy::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(248, 250, 252, 0.3);
  border-top-color: #f8fafc;
  animation: chat-call-spin 1s linear infinite;
}

.chat-call-control:hover:not(:disabled) {
  transform: translateY(-1px);
}

.chat-call-control:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none;
}

.chat-call-control-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-call-control-icon svg {
  width: 22px;
  height: 22px;
  display: block;
  stroke-width: 1.9;
}

.chat-call-control-secondary {
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.chat-call-control.active {
  background: #0ea5e9;
}

.chat-call-control-danger {
  background: #dc2626;
}

.chat-call-device-panel {
  margin: 0 18px 18px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.84);
  border: 1px solid rgba(148, 163, 184, 0.18);
  backdrop-filter: blur(12px);
}

.chat-call-device-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-call-device-panel-title {
  font-size: 13px;
  font-weight: 700;
}

.chat-call-device-panel-close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.95);
  color: #e2e8f0;
}

.chat-call-device-field {
  display: block;
  margin-top: 12px;
}

.chat-call-device-field span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: #cbd5e1;
}

.chat-call-device-field select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(2, 6, 23, 0.84);
  color: #f8fafc;
  padding: 10px 12px;
}

.chat-call-device-help {
  margin-top: 12px;
  font-size: 11px;
  color: #94a3b8;
}

.chat-call-incoming {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  pointer-events: auto;
  background: rgba(2, 6, 23, 0.42);
  backdrop-filter: blur(10px);
}

.chat-call-incoming-card {
  width: min(92vw, 360px);
  border-radius: 26px;
  background:
    radial-gradient(circle at top, rgba(59, 130, 246, 0.2), transparent 38%),
    linear-gradient(180deg, #10192f 0%, #050a16 100%);
  color: #e2e8f0;
  padding: 28px 24px 24px;
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.4);
  text-align: center;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.chat-call-incoming-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #93c5fd;
}

.chat-call-incoming-avatar {
  width: 92px;
  height: 92px;
  margin: 18px auto 0;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 800;
  color: #eff6ff;
  background: linear-gradient(135deg, #22c55e, #2563eb);
  box-shadow: 0 18px 32px rgba(37, 99, 235, 0.28);
}

.chat-call-incoming-name {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 800;
}

.chat-call-incoming-copy {
  margin-top: 8px;
  color: #94a3b8;
  font-size: 14px;
}

.chat-call-incoming-actions {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.chat-call-incoming-btn {
  min-width: 132px;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
}

.chat-call-incoming-btn-accept {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #f8fafc;
}

.chat-call-incoming-btn-reject {
  background: rgba(239, 68, 68, 0.14);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.3);
}

@media (max-width: 768px) {
  .chat-call-window {
    right: 10px;
    left: 10px;
    bottom: 10px;
    width: auto;
    resize: none;
  }

  .chat-call-stage,
  .chat-call-remote {
    min-height: 300px;
  }

  .chat-call-local {
    width: 138px;
  }

  .chat-call-controls {
    gap: 10px;
  }

  .chat-call-control {
    width: 54px;
    height: 54px;
  }

  .chat-call-screen-minimize {
    top: 8px;
    right: 10px;
  }
}
.chat-call-window-link {
  position: fixed;
  right: 24px;
  bottom: 80px;
  z-index: 1090;
  border: 1px solid #334155;
  border-radius: 24px;
  padding: 12px 20px;
  color: #fff;
  background: #0f172a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
  cursor: pointer;
}
