/* Klyro — звонки (личные и групповые).
 * Подключается последним, поэтому перекрывает старые правила .call-* из style.css.
 * Всё привязано к #call-sheet и #call-incoming-banner, чтобы не задеть остальной сайт.
 */

#call-sheet {
  --call-accent: #8b5cf6;
  --call-accent-2: #6d28d9;
  --call-red: #ff3b4f;
  --call-green: #22c55e;
  --call-glass: rgba(24, 19, 38, .58);
  --call-line: rgba(255, 255, 255, .10);
  --call-hue: 265;
  position: fixed;
  inset: 0;
  z-index: 140;
  display: block;
  padding: 0;
  overflow: hidden;
  background: #07060d;
  color: #fff;
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
  animation: call-in .32s cubic-bezier(.2, .8, .2, 1);
}
#call-sheet[hidden] { display: none !important; }

@keyframes call-in {
  from { opacity: 0; transform: scale(1.03); }
  to { opacity: 1; transform: none; }
}

/* —— Фон: размытый аватар собеседника + мягкое сияние —— */
#call-sheet .call-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
#call-sheet .call-bg-img {
  position: absolute;
  inset: -12%;
  background:
    radial-gradient(60% 45% at 30% 20%, hsl(var(--call-hue) 75% 45% / .9), transparent 70%),
    radial-gradient(55% 50% at 80% 75%, hsl(calc(var(--call-hue) + 40) 70% 40% / .8), transparent 70%),
    #120d22;
  background-size: cover;
  background-position: center;
  filter: blur(54px) saturate(1.1) brightness(.5);
  transform: scale(1.1);
}
#call-sheet.has-bg-photo .call-bg-img { background-image: var(--call-bg-img); }
#call-sheet .call-bg-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 40% at 50% 38%, rgba(139, 92, 246, .22), transparent 70%),
    linear-gradient(180deg, rgba(7, 6, 13, .55) 0%, rgba(7, 6, 13, 0) 22%, rgba(7, 6, 13, 0) 62%, rgba(7, 6, 13, .78) 100%);
  animation: call-aurora 9s ease-in-out infinite alternate;
}
@keyframes call-aurora {
  from { opacity: .75; transform: translateY(-2%); }
  to { opacity: 1; transform: translateY(2%); }
}

/* —— Каркас —— */
#call-sheet .call-sheet-card {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: calc(12px + var(--safe-top, env(safe-area-inset-top, 0px))) 14px calc(14px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #fff;
  align-items: stretch;
}

#call-sheet .call-top {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "mode timer";
  align-items: center;
  column-gap: 10px;
  row-gap: 2px;
  min-height: 38px;
  color: rgba(255, 255, 255, .78);
  font-size: .82rem;
}
#call-sheet .call-mode {
  grid-area: mode;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 7px 12px 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid var(--call-line);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#call-sheet .call-mode::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a78bfa;
  box-shadow: 0 0 0 3px rgba(167, 139, 250, .25);
}
#call-sheet.active .call-mode::before { background: var(--call-green); box-shadow: 0 0 0 3px rgba(34, 197, 94, .25); }
#call-sheet .call-top-title {
  grid-area: title;
  display: none;
  justify-self: start;
  max-width: 100%;
  min-width: 0;
  text-align: left;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .4);
}
/* видео и группа: имя крупно, режим — подписью под ним */
#call-sheet.is-video .call-top,
#call-sheet.is-group .call-top {
  grid-template-areas: "title timer" "mode timer";
}
#call-sheet.is-video .call-top-title,
#call-sheet.is-group .call-top-title { display: block; }
#call-sheet.is-video .call-mode,
#call-sheet.is-group .call-mode {
  padding: 0;
  border: 0;
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  font-weight: 500;
  font-size: .78rem;
  color: rgba(255, 255, 255, .72);
}
#call-sheet .call-timer {
  grid-area: timer;
  justify-self: end;
  margin: 0;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .28);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
#call-sheet .call-timer[hidden] { display: none !important; }

#call-sheet .call-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0 12px;
}

/* —— Личный аудиозвонок —— */
#call-sheet .call-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  text-align: center;
  margin-top: -6vh;
}
#call-sheet .call-ava-wrap {
  position: relative;
  width: 148px;
  height: 148px;
  margin-bottom: 22px;
  display: grid;
  place-items: center;
}
#call-sheet .call-sheet-avatar {
  position: relative;
  z-index: 2;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 58px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, hsl(var(--call-hue) 80% 62%), hsl(calc(var(--call-hue) + 30) 70% 42%));
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .14) inset;
  animation: none;
}
#call-sheet .call-sheet-avatar[hidden] { display: grid !important; }
#call-sheet .call-sheet-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
#call-sheet .call-ava-pulse,
#call-sheet .call-ava-wave {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 50%;
  border: 0;
  background: rgba(167, 139, 250, .22);
  opacity: 0;
  animation: none;
  pointer-events: none;
}
/* Звоним / соединяем — волны от аватара */
#call-sheet.ringing .call-ava-pulse,
#call-sheet.connecting .call-ava-pulse,
#call-sheet.ringing .call-ava-wave,
#call-sheet.connecting .call-ava-wave {
  animation: call-wave 2.4s cubic-bezier(.2, .6, .3, 1) infinite;
}
#call-sheet.ringing .call-ava-wave,
#call-sheet.connecting .call-ava-wave { animation-delay: .8s; }
#call-sheet.ringing .call-ava-wave--2,
#call-sheet.connecting .call-ava-wave--2 { animation-delay: 1.6s; }
@keyframes call-wave {
  0% { opacity: .55; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.9); }
}
/* Собеседник говорит — мягкое кольцо */
#call-sheet.active.is-speaking .call-ava-pulse {
  opacity: 1;
  background: transparent;
  box-shadow: 0 0 0 5px rgba(167, 139, 250, .55), 0 0 40px 6px rgba(139, 92, 246, .45);
  animation: call-speak 1.1s ease-in-out infinite alternate;
}
@keyframes call-speak {
  from { transform: scale(1.02); }
  to { transform: scale(1.09); }
}

#call-sheet .call-hero h3,
#call-sheet h3#call-sheet-name {
  margin: 0;
  max-width: 86vw;
  font-size: 1.9rem;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .35);
}
#call-sheet .call-status {
  margin: 8px 0 0;
  font-size: 1rem;
  color: rgba(255, 255, 255, .72);
}
#call-sheet .call-hero-timer {
  margin: 8px 0 0;
  font-size: 1.05rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, .85);
}
#call-sheet .call-hero-timer:empty { display: none; }
#call-sheet.active .call-hero-timer:not(:empty) ~ .call-status { display: none; }
#call-sheet.active:not(.is-video):not(.is-group) .call-top .call-timer { visibility: hidden; }

/* —— Видео 1:1 —— */
#call-sheet .call-video-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: auto;
  height: auto;
  margin: 0;
  border-radius: 0;
  background: #000;
  overflow: hidden;
}
#call-sheet .call-video-stage[hidden] { display: none !important; }
#call-sheet .call-remote-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  background: #000;
}
#call-sheet .call-local-video {
  position: absolute;
  top: calc(64px + var(--safe-top, env(safe-area-inset-top, 0px)));
  right: 14px;
  left: auto;
  bottom: auto;
  z-index: 2;
  width: 108px;
  height: 156px;
  object-fit: cover;
  border-radius: 20px;
  border: 1.5px solid rgba(255, 255, 255, .28);
  background: #1a1528;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .5);
}
/* Камера только у себя — своё видео на весь экран */
#call-sheet.is-video:not(.has-remote-video) .call-remote-video { display: none; }
#call-sheet.is-video:not(.has-remote-video) .call-local-video {
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  border: 0;
  box-shadow: none;
}
#call-sheet.is-video .call-hero { display: none; }
#call-sheet.is-video .call-bg { display: none; }
#call-sheet .call-video-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, 0) 18%, rgba(0, 0, 0, 0) 72%, rgba(0, 0, 0, .55) 100%);
}

/* —— Групповой звонок: сетка плиток —— */
#call-sheet.is-group .call-hero { display: none; }
#call-sheet.is-group .call-video-stage { display: none !important; }
#call-sheet .call-grid {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
  grid-auto-rows: 1fr;
  justify-items: stretch;
  align-items: stretch;
  justify-content: stretch;
  width: auto;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
#call-sheet .call-grid[hidden] { display: none !important; }
#call-sheet .call-grid[data-count="2"] { grid-template-rows: 1fr 1fr; }
#call-sheet .call-grid[data-count="3"],
#call-sheet .call-grid[data-count="4"] { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
#call-sheet .call-grid[data-count="3"] .call-tile:first-child { grid-column: 1 / -1; }
#call-sheet .call-grid[data-count="5"],
#call-sheet .call-grid[data-count="6"] { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(3, 1fr); }
#call-sheet .call-grid[data-count="5"] .call-tile:first-child { grid-column: 1 / -1; }
#call-sheet .call-grid[data-count="7"],
#call-sheet .call-grid[data-count="8"],
#call-sheet .call-grid[data-count="9"] { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); }
#call-sheet .call-grid.is-many {
  grid-template-rows: none;
  grid-auto-rows: minmax(150px, 30%);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#call-sheet .call-tile {
  --call-hue: 265;
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 24px;
  background: #171226;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .07) inset;
  isolation: isolate;
  animation: call-tile-in .35s cubic-bezier(.2, .8, .2, 1);
  transition: box-shadow .2s;
}
@keyframes call-tile-in {
  from { opacity: 0; transform: scale(.94); }
  to { opacity: 1; transform: none; }
}
#call-sheet .call-tile-bg {
  position: absolute;
  inset: -20%;
  z-index: 0;
  background-color: hsl(var(--call-hue) 45% 26%);
  background-image: none;
  background-size: cover;
  background-position: center;
  filter: blur(28px) saturate(1.3) brightness(.62);
}
#call-sheet .call-tile-bg[data-bg="none"] {
  background-image:
    radial-gradient(70% 60% at 30% 25%, hsl(var(--call-hue) 70% 48%), transparent 70%),
    radial-gradient(60% 60% at 80% 85%, hsl(calc(var(--call-hue) + 40) 60% 36%), transparent 70%) !important;
}
#call-sheet .call-tile-ava {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
}
#call-sheet .call-tile-pic,
#call-sheet .call-tile-ring {
  grid-area: 1 / 1;
  width: clamp(54px, 34%, 108px);
  aspect-ratio: 1;
  border-radius: 50%;
}
#call-sheet .call-tile-pic {
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: clamp(22px, 5.5vw, 40px);
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, hsl(var(--call-hue) 75% 60%), hsl(calc(var(--call-hue) + 30) 65% 40%));
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
#call-sheet .call-tile-pic img { width: 100%; height: 100%; object-fit: cover; }
#call-sheet .call-tile-ring { opacity: 0; box-shadow: 0 0 0 4px rgba(167, 139, 250, .7), 0 0 30px 4px rgba(139, 92, 246, .5); }
#call-sheet .call-tile.is-speaking .call-tile-ring { opacity: 1; animation: call-speak 1s ease-in-out infinite alternate; }
#call-sheet .call-tile.is-speaking { box-shadow: 0 0 0 3px #a78bfa inset, 0 0 0 1px rgba(255, 255, 255, .07) inset; }

#call-sheet .call-tile-video {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  display: none;
}
#call-sheet .call-tile.has-video .call-tile-video { display: block; }
#call-sheet .call-tile-video.is-mirror { transform: scaleX(-1); }
#call-sheet .call-tile.is-speaking.has-video::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  box-shadow: 0 0 0 3px #a78bfa inset;
  pointer-events: none;
}

#call-sheet .call-tile-meta {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 20px);
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .42);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.2;
}
#call-sheet .call-tile-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#call-sheet .call-tile-mic {
  display: none;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  place-items: center;
  background: var(--call-red);
  color: #fff;
}
#call-sheet .call-tile.is-muted .call-tile-mic { display: grid; }
#call-sheet .call-tile:not(.is-muted) .call-tile-meta { padding-left: 10px; }

/* —— Кнопки управления: стеклянная панель —— */
#call-sheet .call-sheet-actions {
  position: relative;
  z-index: 3;
  display: block;
  align-self: center;
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 14px 8px 10px;
  border-radius: 30px;
  background: var(--call-glass);
  border: 1px solid var(--call-line);
  -webkit-backdrop-filter: blur(26px) saturate(1.5);
  backdrop-filter: blur(26px) saturate(1.5);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
}
#call-sheet .call-actions-row {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-evenly;
  align-items: flex-start;
  gap: 4px;
}
#call-sheet .call-btn {
  flex: 1 1 0;
  max-width: 78px;
  padding: 0 3px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  box-sizing: border-box;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: none;
}
#call-sheet .call-btn[hidden] { display: none !important; }
#call-sheet .call-btn-ico {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .06) inset;
  transition: transform .15s, background .2s, color .2s;
}
#call-sheet .call-btn-ico svg { width: 24px; height: 24px; }
#call-sheet .call-btn:hover .call-btn-ico { background: rgba(255, 255, 255, .22); }
#call-sheet .call-btn:active .call-btn-ico { transform: scale(.92); }
#call-sheet .call-btn:focus-visible .call-btn-ico { outline: 2px solid #c4b5fd; outline-offset: 3px; }
/* Выключено (микрофон, камера) и включено (громкая связь) — светлая кнопка, как в iOS */
#call-sheet .call-btn.is-off .call-btn-ico,
#call-sheet .call-btn.is-on .call-btn-ico { background: #fff; color: #17121f; }
#call-sheet .call-btn-lab {
  max-width: 100%;
  font-size: .66rem;
  font-weight: 500;
  line-height: 1.15;
  color: rgba(255, 255, 255, .8);
  text-align: center;
  white-space: normal;
  overflow-wrap: normal;
  hyphens: auto;
}
#call-sheet .call-btn.is-end .call-btn-ico {
  background: var(--call-red);
  color: #fff;
  box-shadow: 0 10px 26px rgba(255, 59, 79, .45);
}
#call-sheet .call-btn.is-end:hover .call-btn-ico { background: #ff5566; }
#call-sheet .call-btn.is-end .call-btn-ico svg { transform: rotate(135deg); }
#call-sheet .call-btn.is-end .call-btn-lab { color: #fff; font-weight: 600; }

/* —— Логи звонка (только при ошибке) —— */
#call-sheet .call-debug-box {
  position: relative;
  z-index: 3;
  max-height: 22vh;
  overflow: auto;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(0, 0, 0, .45);
  font-size: .72rem;
}
#call-sheet .call-debug-box[hidden] { display: none !important; }

/* —— Пригласить в звонок —— */
#call-sheet .call-invite {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(0, 0, 0, .5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
#call-sheet .call-invite[hidden] { display: none !important; }
#call-sheet .call-invite-card {
  width: min(100%, 480px);
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 16px calc(16px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
  border-radius: 28px 28px 0 0;
  background: #17121f;
  border: 1px solid var(--call-line);
  color: #fff;
  animation: call-sheet-up .28s cubic-bezier(.2, .8, .2, 1);
}
@keyframes call-sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
#call-sheet .call-invite-head { display: flex; align-items: center; justify-content: space-between; font-size: 1.05rem; }
#call-sheet .call-invite-x {
  width: 34px; height: 34px; border-radius: 50%; border: 0;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .1); color: #fff; cursor: pointer;
}
#call-sheet .call-invite-search {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--call-line);
  background: rgba(255, 255, 255, .07);
  color: #fff;
  font-size: 1rem;
}
#call-sheet .call-invite-list { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
#call-sheet .call-invite-row { display: flex; align-items: center; gap: 12px; padding: 8px 4px; }
#call-sheet .call-invite-row img,
#call-sheet .call-invite-letter {
  width: 42px; height: 42px; flex: none; border-radius: 50%; object-fit: cover;
  display: grid; place-items: center; font-weight: 700;
  background: linear-gradient(145deg, #8b5cf6, #5b21b6);
}
#call-sheet .call-invite-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#call-sheet .call-invite-t b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#call-sheet .call-invite-t small { color: rgba(255, 255, 255, .5); }
#call-sheet .call-invite-add {
  flex: none; padding: 8px 14px; border-radius: 999px; border: 0;
  background: var(--call-accent); color: #fff; font-weight: 600; cursor: pointer;
}
#call-sheet .call-invite-add:disabled { opacity: .6; }
#call-sheet .call-invite-empty { padding: 18px 4px; color: rgba(255, 255, 255, .5); text-align: center; }

/* —— Входящий звонок —— */
#call-incoming-banner.call-banner {
  position: fixed;
  top: calc(10px + var(--safe-top, env(safe-area-inset-top, 0px)));
  left: 50%;
  right: auto;
  bottom: auto;
  z-index: 150;
  width: min(calc(100% - 16px), 420px);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  padding: 14px;
  border-radius: 28px;
  background: rgba(22, 17, 34, .86);
  border: 1px solid rgba(255, 255, 255, .1);
  -webkit-backdrop-filter: blur(30px) saturate(1.6);
  backdrop-filter: blur(30px) saturate(1.6);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  color: #fff;
  animation: call-banner-in .42s cubic-bezier(.2, .9, .25, 1.1);
}
#call-incoming-banner.call-banner[hidden] { display: none !important; }
@keyframes call-banner-in {
  from { opacity: 0; transform: translate(-50%, -24px) scale(.96); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
#call-incoming-banner .call-banner-main { display: flex; align-items: center; gap: 13px; min-width: 0; }
#call-incoming-banner .call-banner-ava {
  position: relative;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: visible;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, #8b5cf6, #5b21b6);
}
#call-incoming-banner .call-banner-ava img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
#call-incoming-banner .call-banner-ava::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(34, 197, 94, .7);
  animation: call-ring-pulse 1.6s ease-out infinite;
}
@keyframes call-ring-pulse {
  0% { opacity: .9; transform: scale(.95); }
  100% { opacity: 0; transform: scale(1.35); }
}
#call-incoming-banner .call-banner-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#call-incoming-banner .call-banner-kicker {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: rgba(255, 255, 255, .5);
}
#call-incoming-banner .call-banner-txt strong {
  font-size: 1.08rem;
  line-height: 1.25;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}
#call-incoming-banner .call-banner-txt .muted { font-size: .85rem; color: rgba(255, 255, 255, .62); }
#call-incoming-banner .call-banner-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#call-incoming-banner .call-reject-pill,
#call-incoming-banner .call-round.is-accept {
  width: auto;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: .95rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s, filter .15s;
}
#call-incoming-banner .call-reject-pill { background: var(--call-red, #ff3b4f); box-shadow: 0 8px 22px rgba(255, 59, 79, .35); }
#call-incoming-banner .call-round.is-accept { background: var(--call-green, #22c55e); box-shadow: 0 8px 22px rgba(34, 197, 94, .35); }
#call-incoming-banner .call-reject-pill:hover,
#call-incoming-banner .call-round.is-accept:hover { filter: brightness(1.08); }
#call-incoming-banner .call-reject-pill:active,
#call-incoming-banner .call-round.is-accept:active { transform: scale(.97); }
#call-incoming-banner .call-reject-pill .call-end-ico { display: inline-flex; }
#call-incoming-banner .call-reject-pill .call-end-ico svg { transform: rotate(135deg); }
#call-incoming-banner .call-accept-ico { display: inline-flex; animation: call-shake 1.6s ease-in-out infinite; }
#call-incoming-banner .call-accept-lab { display: inline; }
@keyframes call-shake {
  0%, 50%, 100% { transform: rotate(0); }
  10%, 30% { transform: rotate(-14deg); }
  20%, 40% { transform: rotate(14deg); }
}

/* —— Компьютер —— */
@media (min-width: 900px) {
  #call-sheet .call-sheet-card { padding: 18px 24px 22px; }
  #call-sheet .call-stage { margin: 16px auto 18px; width: 100%; max-width: 1280px; }
  #call-sheet .call-grid { gap: 12px; }
  #call-sheet .call-grid[data-count="2"] { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
  #call-sheet .call-grid[data-count="3"] { grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr; }
  #call-sheet .call-grid[data-count="3"] .call-tile:first-child { grid-column: auto; }
  #call-sheet .call-grid[data-count="5"],
  #call-sheet .call-grid[data-count="6"] { grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr 1fr; }
  #call-sheet .call-grid[data-count="5"] .call-tile:first-child { grid-column: auto; }
  #call-sheet .call-grid[data-count="7"],
  #call-sheet .call-grid[data-count="8"] { grid-template-columns: repeat(4, 1fr); grid-template-rows: 1fr 1fr; }
  #call-sheet .call-local-video { width: 220px; height: 140px; top: 76px; right: 24px; }
  #call-sheet .call-sheet-actions { width: auto; padding: 12px 18px 10px; }
  #call-sheet .call-btn { flex: 0 0 84px; max-width: 84px; }
  #call-sheet .call-top-title { font-size: 1.15rem; }
}

@media (max-height: 640px) {
  #call-sheet .call-ava-wrap,
  #call-sheet .call-sheet-avatar { width: 112px; height: 112px; }
  #call-sheet .call-sheet-avatar { font-size: 44px; }
  #call-sheet .call-btn-ico { width: 50px; height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  #call-sheet,
  #call-sheet *,
  #call-incoming-banner,
  #call-incoming-banner * { animation: none !important; transition: none !important; }
}

/* Группа с включённой камерой: фон группы остаётся, своё видео — в своей плитке */
#call-sheet.is-group.is-video .call-bg { display: block; }
