/* Call UI — Aurora dark surface (charter §19.8). Loaded after aurora.css; reuses
   the --sc-* tokens so the call chrome matches the rest of the client. WCAG AA:
   text on glass keeps ≥ 4.5:1 contrast against the dark panel. */

/* ── header call buttons ─────────────────────────────────────────────────── */
#call-header-btns {
  display: inline-flex; align-items: center; gap: 8px; margin-left: auto;
}
.call-hbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0; border-radius: 50%;
  background: var(--sc-soft); border: 1px solid var(--sc-border);
  color: var(--sc-accent); cursor: pointer;
  transition: background .12s ease, color .12s ease, transform .12s ease;
}
.call-hbtn:hover { background: rgba(168, 230, 200, .18); color: #fff; }
.call-hbtn:focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 2px; }
.call-hbtn:active { transform: scale(.94); }

/* ── layer (banner + panel + picker live here) ───────────────────────────── */
.call-layer { position: fixed; z-index: 1100; }

/* ── incoming banner ─────────────────────────────────────────────────────── */
.call-banner {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; max-width: min(92vw, 520px);
  padding: 12px 16px; border-radius: 22px;
  background: var(--sc-panel2); border: 1px solid var(--sc-border);
  box-shadow: 0 22px 60px rgba(0, 0, 0, .42);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  color: #edf6f2; z-index: 1101;
}
.call-banner-text { flex: 1 1 auto; font-size: 14px; font-weight: 600; }
.call-banner-btn {
  border: 0; border-radius: 999px; padding: 7px 16px; font-weight: 650;
  font-size: 13px; cursor: pointer; white-space: nowrap;
}
.call-accept { background: var(--sc-accent); color: var(--sc-accent-ink); }
.call-accept:hover { background: #b9efd5; }
.call-decline { background: rgba(255, 120, 120, .16); color: #ffb4b4; }
.call-decline:hover { background: rgba(255, 120, 120, .28); color: #ffd7d7; }

/* ── active / outgoing panel ─────────────────────────────────────────────── */
.call-panel {
  position: fixed; right: 18px; bottom: 18px; width: min(92vw, 340px);
  border-radius: 22px; overflow: hidden;
  background: var(--sc-panel2); border: 1px solid var(--sc-border);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  color: #edf6f2; z-index: 1101;
}
.call-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; font-size: 14px; font-weight: 650;
  background: rgba(7, 12, 17, .55); border-bottom: 1px solid var(--sc-border);
}
.call-peer-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-timer { color: var(--sc-accent); font-variant-numeric: tabular-nums; font-size: 13px; }

.call-remote { display: block; width: 100%; aspect-ratio: 4 / 3; background: #05080d; object-fit: cover; }
.call-local-preview { display: block; width: 100%; aspect-ratio: 4 / 3; background: #05080d; object-fit: cover; }
.call-local-pip {
  position: absolute; right: 12px; bottom: 76px; width: 96px; height: 72px;
  border-radius: 12px; object-fit: cover; border: 1px solid var(--sc-border);
  background: #05080d; box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}
.call-panel-active { position: relative; }

.call-avatar {
  display: flex; align-items: center; justify-content: center;
  width: 100%; aspect-ratio: 4 / 3; font-size: 56px; font-weight: 700;
  color: var(--sc-accent); background:
    radial-gradient(300px 220px at 50% 30%, rgba(92, 207, 169, .18), transparent 70%),
    #0a1118;
}

.call-controls {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 12px 16px; background: rgba(7, 12, 17, .55);
  border-top: 1px solid var(--sc-border);
}
.call-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; padding: 0; border-radius: 50%;
  background: var(--sc-soft); border: 1px solid var(--sc-border);
  color: var(--sc-accent); cursor: pointer;
  transition: background .12s ease, color .12s ease, transform .12s ease;
}
.call-btn:hover { background: rgba(168, 230, 200, .18); color: #fff; }
.call-btn:focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 2px; }
.call-btn:active { transform: scale(.94); }
.call-btn.call-hangup { background: rgba(255, 90, 90, .18); border-color: rgba(255, 140, 140, .4); color: #ffb4b4; }
.call-btn.call-hangup:hover { background: rgba(255, 90, 90, .32); color: #ffd7d7; }
/* The outgoing "Cancel" carries an icon plus a word: it must be a pill wide
   enough for the label. A round 46px button pushed the text outside the oval. */
.call-panel .call-cancel {
  display: flex; width: max-content; height: auto; min-height: 46px;
  padding: 0 20px; gap: 8px; border-radius: 999px;
  font-size: 14px; font-weight: 650; white-space: nowrap;
  margin: 12px 16px 16px auto;
}
.call-panel .call-cancel svg { flex: 0 0 auto; }

/* ── device picker ───────────────────────────────────────────────────────── */
.call-picker-backdrop {
  position: fixed; inset: 0; z-index: 1102;
  background: rgba(0, 0, 0, .62);
  display: flex; align-items: center; justify-content: center; padding: 8px;
}
.call-picker {
  width: min(92vw, 360px); padding: 18px; border-radius: 22px;
  background: var(--sc-panel2); border: 1px solid var(--sc-border);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5); color: #edf6f2;
}
.call-picker-title { font-size: 15px; font-weight: 650; margin-bottom: 12px; }
.call-picker-label { display: block; font-size: 12px; color: var(--sc-muted); margin: 10px 0 4px; }
.call-picker-select {
  width: 100%; padding: 8px 10px; border-radius: 13px;
  background: var(--sc-field); border: 1px solid var(--sc-border); color: #edf6f2;
}
.call-picker-select:focus { border-color: var(--sc-accent); outline: none; box-shadow: 0 0 0 3px var(--sc-soft); }
.call-picker-actions { display: flex; gap: 10px; margin-top: 16px; justify-content: flex-end; }
.call-picker-actions .call-btn { width: auto; height: auto; padding: 8px 18px; border-radius: 999px; font-size: 13px; font-weight: 650; }
.call-picker-actions .call-accept { background: var(--sc-accent); color: var(--sc-accent-ink); border-color: var(--sc-accent); }

/* ── chat bubble ─────────────────────────────────────────────────────────── */
.call-bubble { display: flex; align-items: center; gap: 8px; }
.call-bubble-icon { display: inline-flex; color: var(--sc-accent); flex: 0 0 auto; }
.call-bubble-text { font-size: 14px; }

@media (max-width: 620px) {
  .call-panel { right: 10px; bottom: 10px; }
  .call-banner { top: 10px; }
}