.nx-peer-call {
  margin-top: 0.85rem;
}

.nx-call {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(2, 6, 23, 0.72);
}

.nx-call.is-open {
  display: flex;
}

.nx-call-card,
.nx-call-stage {
  width: min(420px, 100%);
  border: 1px solid var(--tf-line);
  border-radius: 20px;
  background: var(--tf-bg-elevated, #0f172a);
  color: var(--tf-ink-strong);
  box-shadow: 0 24px 80px rgba(2, 6, 23, 0.45);
}

.nx-call-card {
  padding: 1.4rem 1.25rem 1.2rem;
  text-align: center;
}

.nx-call-preview {
  position: relative;
  width: 7.5rem;
  height: 7.5rem;
  margin: 0 auto 0.9rem;
}

.nx-call-preview video,
.nx-call-preview .tf-avatar {
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 50%;
  object-fit: cover;
}

.nx-call-preview video {
  display: none;
  transform: scaleX(-1);
  background: #020617;
}

.nx-call-card.has-preview video {
  display: block;
}

.nx-call-card.has-preview .tf-avatar {
  display: none;
}

.nx-call-card h2 {
  margin: 0;
  font-size: 1.25rem;
}

.nx-call-card p {
  margin: 0.35rem 0 0;
  color: var(--tf-ink-soft);
}

.nx-call-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.15rem;
}

.nx-call-actions button {
  min-width: 6.5rem;
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  font-weight: 700;
}

.nx-call-actions .is-accept {
  background: #16a34a;
  color: white;
}

.nx-call-actions .is-decline,
.nx-call-actions .is-end {
  background: var(--tf-danger, #ef4444);
  color: white;
}

.nx-call-actions .is-ghost {
  background: transparent;
  color: var(--tf-ink-strong);
  border: 1px solid var(--tf-line);
}

.nx-call-stage {
  position: relative;
  width: min(1040px, 100%);
  height: min(680px, calc(100vh - 2rem));
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 100%, rgba(37, 99, 235, 0.18), transparent 55%),
    #020617;
}

.nx-call-stage::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 1;
  height: 8rem;
  background: linear-gradient(transparent, rgba(2, 6, 23, 0.72));
  pointer-events: none;
}

.nx-call-stage > video#nxCallRemote {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #020617;
}

.nx-call-remote-avatar {
  position: absolute;
  top: 42%;
  left: 50%;
  width: 6.5rem;
  height: 6.5rem;
  font-size: 1.5rem;
  display: none;
  transform: translate(-50%, -50%);
}

.nx-call-stage:not(.has-remote-video) .nx-call-remote-avatar {
  display: inline-flex;
}

.nx-call-unmute {
  position: absolute;
  top: 46%;
  left: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  background: white;
  color: #0f172a;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.35);
}

.nx-call-top {
  position: absolute;
  top: 0.85rem;
  inset-inline: 0.85rem;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: white;
}

.nx-call-stage-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(14px);
}

.nx-call-stage-meta strong,
.nx-call-stage-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nx-call-stage-meta strong {
  font-size: 0.92rem;
}

.nx-call-stage-meta span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.nx-call-quality {
  width: 0.55rem;
  height: 0.55rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.18);
}

.nx-call-quality[data-level="good"] {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}

.nx-call-quality[data-level="fair"] {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18);
}

.nx-call-quality[data-level="poor"] {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.18);
}

.nx-call-top-actions {
  display: flex;
  gap: 0.4rem;
}

.nx-call-top-actions button,
.nx-call-swap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 0;
  border-radius: 50%;
  background: rgba(2, 6, 23, 0.62);
  color: white;
  backdrop-filter: blur(14px);
}

.nx-call-self {
  position: absolute;
  top: 4.1rem;
  inset-inline-end: 0.85rem;
  z-index: 3;
  width: 10.5rem;
  max-width: 34%;
}

.nx-call-local {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  object-fit: cover;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 40px rgba(2, 6, 23, 0.35);
}

.nx-call-local.is-mirrored {
  transform: scaleX(-1);
}

.nx-call-swap {
  position: absolute;
  right: auto;
  bottom: 0.4rem;
  inset-inline-start: 0.4rem;
  width: 1.8rem;
  height: 1.8rem;
  font-size: 0.8rem;
}

.nx-call-stage.is-swapped .nx-call-self {
  inset: 0;
  top: 0;
  width: auto;
  max-width: none;
}

.nx-call-stage.is-swapped .nx-call-local {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.nx-call-stage.is-swapped .nx-call-swap {
  top: auto;
  bottom: 6.2rem;
}

.nx-call-stage.is-swapped > video#nxCallRemote {
  position: absolute;
  top: 4.1rem;
  inset-inline-end: 0.85rem;
  z-index: 4;
  width: 10.5rem;
  max-width: 34%;
  height: auto;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 40px rgba(2, 6, 23, 0.35);
}

.nx-call-dock {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: max-content;
  max-width: calc(100% - 1.4rem);
  transform: translateX(-50%);
}

.nx-call-menu {
  width: min(18rem, 100%);
  margin-bottom: 0.55rem;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.94);
  color: white;
  box-shadow: 0 18px 50px rgba(2, 6, 23, 0.4);
}

.nx-call-menu[hidden] {
  display: none;
}

.nx-call-menu label {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin-bottom: 0.55rem;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.72);
}

.nx-call-menu select,
.nx-call-menu button {
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.nx-call-menu select {
  padding: 0.45rem 0.55rem;
}

.nx-call-menu button {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.5rem 0.65rem;
  text-align: start;
}

.nx-call-menu button.is-on {
  background: white;
  color: #0f172a;
}

.nx-call-controls {
  display: flex;
  gap: 0.35rem;
  padding: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(16px);
}

.nx-call-controls button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  min-width: 4.6rem;
  height: 3.35rem;
  padding: 0.3rem 0.55rem;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: white;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.1;
}

.nx-call-controls button i {
  font-size: 1.15rem;
}

.nx-call-controls button span {
  max-width: 5.4rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nx-call-controls button.is-off,
.nx-call-controls button.is-on {
  background: white;
  color: #0f172a;
}

.nx-call-controls button.is-live {
  background: #2563eb;
  color: white;
}

.nx-call-controls button.is-end {
  background: #ef4444;
  color: white;
}

.nx-call-controls button:disabled {
  opacity: 0.38;
}

.nx-call.is-min {
  inset: auto;
  top: auto;
  bottom: 1rem;
  inset-inline: auto 1rem;
  width: min(22rem, calc(100vw - 1.5rem));
  height: 12.5rem;
  padding: 0;
  background: transparent;
  align-items: stretch;
}

.nx-call.is-min .nx-call-stage {
  width: 100%;
  height: 100%;
}

.nx-call.is-min .nx-call-dock,
.nx-call.is-min .nx-call-self,
.nx-call.is-min #nxCallFullscreen,
.nx-call.is-min::after,
.nx-call.is-min .nx-call-stage::after {
  display: none;
}

.nx-call.is-min .nx-call-top {
  top: 0.45rem;
  inset-inline: 0.45rem;
}

body.page-calls .tf-main.dash-main-wrap {
  position: relative;
}

.calls-page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 2rem;
}

.calls-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.15rem 0.1rem 0.2rem;
}

.calls-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tf-hud);
}

.calls-hero h1 {
  margin: 0.2rem 0 0.35rem;
  font-size: 1.85rem;
  letter-spacing: -0.04em;
  color: var(--tf-ink-strong);
}

.calls-hero p {
  margin: 0;
  max-width: 40rem;
  color: var(--tf-ink-soft);
}

.calls-hint {
  margin: 0;
  max-width: 40rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--tf-line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--tf-fill) 70%, transparent);
  color: var(--tf-ink-soft);
  font-size: 0.82rem;
}

.calls-board,
.calls-page:not(:has(.calls-board)) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 1rem;
  align-items: start;
}

.calls-page:not(:has(.calls-board)) > :not(.calls-panel) {
  grid-column: 1 / -1;
}

.calls-panel {
  min-width: 0;
  border: 1px solid var(--tf-line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--tf-fill) 80%, transparent);
  padding: 0.85rem;
}

.calls-panel h2 {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  font-weight: 750;
}

.calls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.65rem;
}

.calls-history {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.calls-person,
.calls-recent {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
  min-height: 4.25rem;
  text-align: start;
  border: 1px solid var(--tf-line);
  border-radius: 14px;
  padding: 0.65rem 0.75rem;
  background: var(--tf-bg-elevated);
  color: inherit;
  overflow: hidden;
}

.calls-recent {
  min-height: 3.6rem;
  background: transparent;
}

.calls-person:hover,
.calls-recent:hover {
  border-color: color-mix(in srgb, var(--tf-accent) 45%, var(--tf-line));
  background: var(--tf-fill-hover);
}

.calls-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-flex;
}

.calls-recent .calls-avatar {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
}

.calls-person > .tf-avatar,
.calls-recent > .tf-avatar,
.calls-avatar .tf-avatar {
  width: 44px;
  height: 44px;
  min-width: 44px;
  max-width: 44px;
  flex: 0 0 44px;
  overflow: hidden;
  font-size: 0.85rem;
}

.calls-recent > .tf-avatar,
.calls-recent .calls-avatar .tf-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  max-width: 36px;
  flex-basis: 36px;
}

.calls-page .tf-avatar img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  display: block;
}

.calls-person-copy,
.calls-recent-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  gap: 0.1rem;
}

.calls-person-copy strong,
.calls-recent-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.95rem;
}

.calls-person-copy span,
.calls-recent-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--tf-ink-soft);
  font-size: 0.78rem;
}

.calls-person-copy .is-on {
  color: #22c55e;
}

.calls-dial {
  width: 2.15rem;
  height: 2.15rem;
  flex: 0 0 2.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--tf-accent) 16%, transparent);
  color: var(--tf-accent);
  font-size: 1rem;
}

.calls-empty {
  margin: 0;
  color: var(--tf-ink-soft);
}

.calls-recent.is-missed .calls-recent-copy span,
.calls-recent.is-declined .calls-recent-copy span {
  color: var(--tf-danger);
}

@media (max-width: 980px) {
  .calls-board,
  .calls-page:not(:has(.calls-board)) {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .nx-call-self,
  .nx-call-stage.is-swapped > video#nxCallRemote {
    width: 6.6rem;
  }

  .nx-call-controls button {
    min-width: 2.7rem;
    width: 2.7rem;
    height: 2.7rem;
    border-radius: 50%;
  }

  .nx-call-controls button span {
    display: none;
  }
}
