/* Messenger calls — header buttons, recent list, overlay.
 * tip LOCK 20260804-gomax2-fast1 · tipSteal=0
 * SW1 (2026-09-09, social-week): pre-join, tile grid, active speaker, pin,
 * draggable mini-tile, slide-confirm hangup, net quality, reconnect breathing,
 * ended summary, call cards in chat. Transport (WS/WebRTC) untouched. */

.thread-header__actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
  gap: 0;
}

.thread-header__actions[hidden] {
  display: none;
}

.thread-header__actions .btn-icon {
  -webkit-appearance: none;
  appearance: none;
  color: var(--text);
}

.view--calls {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
}

.view--calls .view-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.calls-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.calls-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40vh;
  padding: 32px 24px;
  text-align: center;
  color: var(--text-muted);
}

.calls-empty strong {
  font-size: 17px;
  font-weight: 650;
  color: var(--text);
}

.calls-empty span {
  font-size: 14px;
  line-height: 1.4;
  max-width: 16em;
}

.call-row.is-missed .chat-row__name,
.call-row.is-missed .chat-row__preview {
  color: var(--danger, #dc2626);
}

/* ══════════════════════════ OVERLAY SHELL ══════════════════════════ */

.call-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  background: #0b1220;
  color: #fff;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}

.call-overlay[hidden],
.call-overlay.hidden {
  display: none;
}

/* SW1: внутри оверлея атрибут [hidden] обязан побеждать display:flex/grid
   компонентов (плитки, чипы, заглушки, итоги, pre-join). */
.call-overlay [hidden] {
  display: none !important;
}

/* SW1: аватар-плейсхолдер звонка теперь рисуется нативно в плитке (#call-waiting);
   дубль из eco-max-ve в панели гасим, чтобы не было двух аватаров. */
#call-overlay .eco-ve-avatar {
  display: none !important;
}

.call-overlay__video {
  position: absolute;
  inset: 0;
  background: #070b14;
}

/* SW1: аудиозвонки тоже получают сцену — плитка с аватаром вместо пустого фона */
.call-overlay__panel {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  justify-items: center;
  align-content: stretch;
  gap: 4px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px calc(14px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.38) 0%,
    rgba(0, 0, 0, 0.08) 18%,
    transparent 32%,
    transparent 62%,
    rgba(0, 0, 0, 0.22) 100%
  );
  pointer-events: none;
}

.call-overlay:not(.call-overlay--video) .call-overlay__panel {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, transparent 22%, transparent 66%, rgba(0, 0, 0, 0.4) 100%);
}

.call-overlay__name {
  grid-row: 3;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.75);
  pointer-events: auto;
  margin-top: 2px;
}

.call-overlay__status {
  grid-row: 4;
  align-self: start;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.72);
  min-height: 1.2em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
  pointer-events: auto;
}

.call-overlay[data-state="inbound"] .call-overlay__status {
  color: #93c5fd;
}

.call-overlay__actions {
  grid-row: 5;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 18px;
  width: 100%;
  max-width: 420px;
  padding-inline: max(12px, env(safe-area-inset-left, 0px)) max(12px, env(safe-area-inset-right, 0px));
  pointer-events: auto;
}

/* ── topbar: таймер / участники / сеть ── */

.call-topbar {
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  pointer-events: auto;
  min-height: 26px;
}

.call-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(10, 16, 30, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.92);
}

.call-chip--net i {
  display: inline-block;
  width: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
  margin-right: 2px;
  vertical-align: bottom;
}

.call-chip--net i:nth-child(1) { height: 5px; }
.call-chip--net i:nth-child(2) { height: 8px; }
.call-chip--net i:nth-child(3) { height: 11px; }

.call-chip--net[data-level="good"] i { background: #34d399; }
.call-chip--net[data-level="mid"] i:nth-child(1),
.call-chip--net[data-level="mid"] i:nth-child(2) { background: #fbbf24; }
.call-chip--net[data-level="poor"] i:nth-child(1) { background: #f87171; }

/* ══════════════════════════ TILE GRID ══════════════════════════ */

.call-grid {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 8px;
  padding: 8px;
  box-sizing: border-box;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.call-grid[data-tiles="2"] {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
}

.call-grid[data-tiles="3"],
.call-grid[data-tiles="4"] {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.call-grid[data-tiles="5"],
.call-grid[data-tiles="6"],
.call-grid[data-tiles="7"],
.call-grid[data-tiles="8"],
.call-grid[data-tiles="9"] {
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
}

.call-tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #101828;
  isolation: isolate;
}

.call-tile__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #070b14;
}

.call-tile--main {
  grid-area: 1 / 1 / -1 / -1;
}

#call-local-video {
  transform: scaleX(-1); /* селфи-зеркало своего превью */
}

.call-tile--mini {
  position: absolute;
  z-index: 4;
  width: 108px;
  height: 152px;
  right: max(12px, env(safe-area-inset-right, 0px));
  top: max(56px, calc(env(safe-area-inset-top, 0px) + 52px));
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.14);
  cursor: grab;
  touch-action: none;
}

.call-tile--mini:active {
  cursor: grabbing;
}

.call-tile--mini.is-dragging {
  transition: none;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
}

.call-tile--mini:not(.is-dragging) {
  transition: left 0.18s ease, top 0.18s ease, width 0.18s ease, height 0.18s ease;
}

.call-tile__name {
  position: absolute;
  left: 8px;
  bottom: 6px;
  z-index: 2;
  max-width: calc(100% - 44px);
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.call-tile--mini .call-tile__name {
  left: 6px;
  bottom: 4px;
  font-size: 11px;
}

/* ожидание / аудиозвонок: аватар с мягкой пульсацией */

.call-tile__ph {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: radial-gradient(120% 100% at 50% 0%, #16213c 0%, #0b1220 70%);
}

.call-tile__ava {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  animation: call-ava-pulse 2.8s ease-in-out infinite;
}

.call-tile__ph.is-calm .call-tile__ava {
  animation: none; /* разговор идёт — без пульсации, кольцо говорящего отдельно */
}

.call-tile__ph-text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.66);
}

@keyframes call-ava-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.32); }
  50% { box-shadow: 0 0 0 14px rgba(96, 165, 250, 0); }
}

/* активный говорящий: спокойное мягкое кольцо (не мигание) */

.call-tile.is-speaking {
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.85);
  animation: call-speak 2.4s ease-in-out infinite;
}

@keyframes call-speak {
  0%, 100% { box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.85), 0 0 0 6px rgba(96, 165, 250, 0.18); }
  50% { box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.6), 0 0 0 12px rgba(96, 165, 250, 0.06); }
}

.call-tile__pin {
  position: absolute;
  right: 8px;
  bottom: 6px;
  z-index: 3;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 10px;
  background: rgba(10, 16, 30, 0.55);
  color: #fff;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.call-tile__pin svg {
  display: block;
}

.call-tile__pin:active {
  transform: scale(0.94);
}

/* ══════════════════════════ RECONNECT (мягкое дыхание) ══════════════════════════ */

.call-reconnect {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(7, 11, 20, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.call-reconnect__orb {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #7aa7ff 0%, #2f5fd0 70%);
  animation: call-breathe 2.6s ease-in-out infinite;
}

@keyframes call-breathe {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.14); opacity: 1; }
}

.call-reconnect__text {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
  padding: 0 20px;
  text-align: center;
}

/* ══════════════════════════ CONTROLS ══════════════════════════ */

.call-ctrl {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 72px;
  min-height: 72px;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.call-ctrl svg {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  padding: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  box-sizing: border-box;
}

.call-ctrl.is-off svg {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.45);
}

.call-ctrl--accept svg {
  background: #0ea86a;
}

.call-ctrl--reject svg,
.call-ctrl--end svg {
  background: #dc2626;
}

.call-ctrl:active {
  transform: scale(0.96);
}

/* slide-confirm завершения: спокоен, случайный тап не рвёт звонок */

.call-endcap {
  grid-row: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 420px;
  pointer-events: auto;
  padding-inline: max(12px, env(safe-area-inset-left, 0px)) max(12px, env(safe-area-inset-right, 0px));
}

.call-endcap__hint {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}

.call-endcap__track {
  position: relative;
  width: 100%;
  height: 52px;
  border-radius: 26px;
  background: rgba(220, 38, 38, 0.32);
  border: 1px solid rgba(220, 38, 38, 0.45);
  touch-action: none;
  cursor: pointer;
  overflow: hidden;
}

.call-endcap__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: 26px 0 0 26px;
  background: rgba(220, 38, 38, 0.5);
}

.call-endcap__knob {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 60px;
  height: 44px;
  border-radius: 22px;
  background: #dc2626;
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.45);
}

.call-endcap__knob svg {
  display: block;
}

.call-endcap.is-done .call-endcap__knob {
  background: #b91c1c;
}

/* ══════════════════════════ PRE-JOIN ══════════════════════════ */

.call-prejoin {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  background: #0b1220;
  color: #fff;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}

.call-prejoin[hidden],
.call-prejoin.hidden {
  display: none;
}

.call-prejoin__media {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 46vh;
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  background: #070b14;
  flex-shrink: 0;
}

@media (min-width: 720px) {
  .call-prejoin__media {
    aspect-ratio: 16 / 9;
    max-height: 52vh;
  }
}

#prejoin-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  display: block;
}

#prejoin-video.cam-off {
  opacity: 0;
}

.call-prejoin__ava-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.call-prejoin__ava {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
}

.call-prejoin__meter {
  width: 132px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.call-prejoin__meter i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: #60a5fa;
  transition: width 0.12s linear;
}

.call-prejoin__badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  max-width: calc(100% - 20px);
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(10, 16, 30, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-prejoin__badge.is-err {
  background: rgba(120, 20, 20, 0.72);
}

.call-prejoin__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 420px;
  margin: 14px auto 0;
  padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
}

.call-prejoin__title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: center;
}

.call-prejoin__peer {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.66);
  text-align: center;
  margin-top: -6px;
}

.call-prejoin__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.call-prejoin__label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.call-prejoin__name {
  font-size: 15px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-prejoin__conn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.66);
  padding: 0 4px;
}

.call-prejoin__conn::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  flex-shrink: 0;
}

.call-prejoin__conn.is-off::before {
  background: #f87171;
}

.call-prejoin__toggles {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.call-tgl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 88px;
  justify-content: center;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.call-tgl svg {
  display: block;
}

.call-tgl[aria-pressed="false"] {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.45);
  border-color: rgba(255, 255, 255, 0.08);
}

.call-tgl:active {
  transform: scale(0.97);
}

.call-prejoin__err {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(120, 20, 20, 0.5);
  font-size: 13px;
  line-height: 1.4;
}

.call-prejoin__join {
  margin-top: 6px;
  min-height: 54px;
  border: none;
  border-radius: 18px;
  background: linear-gradient(180deg, #2f6bea 0%, #2456c8 100%);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(47, 107, 234, 0.35);
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.call-prejoin__join:disabled {
  opacity: 0.55;
  box-shadow: none;
  cursor: default;
}

.call-prejoin__join:not(:disabled):active {
  transform: scale(0.985);
}

.call-prejoin__cancel {
  min-height: 44px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.66);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

/* ══════════════════════════ ИТОГИ ЗВОНКА ══════════════════════════ */

.call-summary {
  grid-row: 2 / 6;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(88vw, 340px);
  padding: 22px 20px 18px;
  border-radius: 22px;
  background: rgba(13, 20, 36, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  animation: call-summary-in 0.3s ease;
}

.call-summary[hidden],
.call-summary.hidden {
  display: none;
}

@keyframes call-summary-in {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.call-summary__icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.1);
}

.call-summary__icon.is-missed {
  background: rgba(220, 38, 38, 0.22);
  color: #fca5a5;
}

.call-summary__title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.call-summary__meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.call-summary__row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.72);
}

.call-summary__row strong {
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.call-summary__actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  width: 100%;
}

.call-summary__btn {
  flex: 1;
  min-height: 46px;
  border-radius: 14px;
  border: none;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.call-summary__btn--again {
  background: linear-gradient(180deg, #2f6bea 0%, #2456c8 100%);
  color: #fff;
}

.call-summary__btn--close {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
}

.call-summary__btn:active {
  transform: scale(0.98);
}

/* ══════════════════════════ КАРТОЧКИ ЗВОНКОВ В ЧАТЕ ══════════════════════════ */

.msg.msg--callcard {
  max-width: min(84%, 360px);
}

.callcard {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.callcard__ic {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--accent-soft, rgba(26, 86, 219, 0.1));
  color: var(--accent, #1a56db);
}

.callcard__ic--in {
  background: rgba(14, 168, 106, 0.14);
  color: #0ea86a;
}

.callcard__ic--miss {
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger, #dc2626);
}

.callcard__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.callcard__title {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
}

.callcard__sub {
  font-size: 12.5px;
  color: var(--text-muted, #64748b);
  display: flex;
  align-items: center;
  gap: 5px;
}

.callcard__sub--miss {
  color: var(--danger, #dc2626);
}

.callcard__sub .callcard__dur {
  font-variant-numeric: tabular-nums;
}

/* живая карточка активного звонка в ленте */

.msg--call-live {
  align-self: stretch;
  max-width: min(100%, 380px);
  width: 100%;
  margin: 2px 0;
}

.call-live {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: var(--shadow, 0 1px 3px rgba(15, 23, 42, 0.08));
  box-sizing: border-box;
  animation: call-live-in 0.28s ease;
}

@keyframes call-live-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.call-live__ava {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  animation: call-ava-pulse 2.8s ease-in-out infinite;
}

.call-live__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.call-live__title {
  font-size: 14.5px;
  font-weight: 650;
  color: var(--text, #0f172a);
}

.call-live__sub {
  font-size: 12.5px;
  color: var(--text-muted, #64748b);
  font-variant-numeric: tabular-nums;
}

.call-live__acts {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.call-live__btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  display: grid;
  place-items: center;
  color: #fff;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.call-live__btn--accept {
  background: #0ea86a;
  animation: call-live-accept 1.8s ease-in-out infinite;
}

@keyframes call-live-accept {
  0%, 100% { box-shadow: 0 0 0 0 rgba(14, 168, 106, 0.35); }
  50% { box-shadow: 0 0 0 9px rgba(14, 168, 106, 0); }
}

.call-live__btn--decline {
  background: #dc2626;
}

.call-live__btn:active {
  transform: scale(0.93);
}

.call-live__btn svg {
  display: block;
}

/* ══════════════════════════ 390px / темы / reduced-motion ══════════════════════════ */

@media (max-width: 480px) {
  .call-overlay__name {
    font-size: 19px;
  }

  .call-tile--mini {
    width: 96px;
    height: 132px;
  }

  .call-ctrl svg {
    width: 54px;
    height: 54px;
  }

  .call-overlay__actions {
    gap: 14px;
    padding-bottom: max(4px, env(safe-area-inset-bottom, 0px));
  }

  .call-prejoin {
    padding-inline: 14px;
  }

  .call-prejoin__join {
    min-height: 56px; /* большая спокойная кнопка в зоне большого пальца */
  }
}

@media (prefers-reduced-motion: reduce) {
  .call-ctrl:active,
  .call-tgl:active,
  .call-live__btn:active,
  .call-tile__pin:active {
    transform: none;
  }

  .call-overlay[data-state="inbound"] .call-overlay__status {
    color: #fff;
  }

  .call-tile.is-speaking {
    animation: none; /* спокойное статичное кольцо */
  }

  .call-tile__ava,
  .call-live__ava,
  .call-reconnect__orb,
  .call-live__btn--accept {
    animation: none;
  }

  .call-tile--mini:not(.is-dragging) {
    transition: none;
  }

  .call-summary {
    animation: none;
  }

  .call-live {
    animation: none;
  }

  .call-prejoin__meter i {
    transition: none;
  }
}

html[data-theme="dark"] .call-overlay {
  background: #05070c;
}

html[data-theme="dark"] .call-prejoin {
  background: #05070c;
}

html[data-theme="dark"] .call-tile {
  background: #0a0f1c;
}

/* Separate native actions: open the conversation or explicitly call back. */
.call-row__open {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.call-row__open .chat-row__body { flex: 1 1 auto; min-width: 0; }
.call-row__open:focus-visible {
  outline: 2px solid var(--accent, #7164ed);
  outline-offset: 3px;
  border-radius: 6px;
}
.call-row > .eco-ve-callbtn { border: 0; font: inherit; }
