/* === Брендирование AVALIN для Element Call === */

/* фон в фирменном градиенте AVALIN (голубой -> бирюза) */
body::before {
  background-image:
    radial-gradient(90rem 60rem at 12% 18%, rgba(122,143,245,.38), transparent 62%),
    radial-gradient(85rem 58rem at 88% 28%, rgba(110,214,190,.34), transparent 62%),
    linear-gradient(135deg, #10131f 0%, #0f1a1e 100%) !important;
}

/* логотипы Element на всех экранах -> текст AVALIN */
a[class*="_headerLogo"] svg, a[class*="_headerLogo"] img { display: none !important; }
a[class*="_headerLogo"]::after { content: "AVALIN"; color: #fff; font-weight: 700; font-size: 1.3rem; letter-spacing: .06em; }
[class*="_logo_"] { display: none !important; } /* логин (svg) + лобби/комната (нижний угол) */
[class*="_settingsLogoContainer"]::after { content: "AVALIN"; color: #fff; font-weight: 700; font-size: 1rem; letter-spacing: .06em; align-self: center; }
div[class*="_formContainer"]::before { content: "AVALIN"; display: block; text-align: center; color: #fff; font-weight: 700; font-size: 2rem; letter-spacing: .08em; }

/* убрать SSLA-текст Element и блок регистрации */
p:has(a[href*="element.io"]) { display: none !important; }
p:has(a[href="/register"]), div:has(> a[href="/register"]) { display: none !important; }
a[href="/register"] { display: none !important; }

/* === Инструменты звонка AVALIN (v3) === */

/* кнопка переключения языка (стиль перенесён из avalin.js) */
#avalin-lang {
  position: fixed; bottom: 70px; right: 14px; z-index: 9999;
  background: rgba(255,255,255,.12); color: #fff;
  border: 1px solid rgba(255,255,255,.3); border-radius: 8px;
  padding: 6px 12px; font-weight: 700; font-size: 13px; cursor: pointer;
  backdrop-filter: blur(4px);
}

/* панель кнопок: камеры / запись / конспект */
#avalin-tools {
  position: fixed; bottom: 70px; left: 14px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
#avalin-tools button {
  background: rgba(255,255,255,.12); color: #fff;
  border: 1px solid rgba(255,255,255,.3); border-radius: 8px;
  padding: 7px 12px; font-weight: 700; font-size: 13px; cursor: pointer;
  backdrop-filter: blur(4px); text-align: left; min-width: 118px;
  transition: background .15s;
}
#avalin-tools button:hover { background: rgba(255,255,255,.22); }
#avalin-tools button.on { background: rgba(110,214,190,.35); border-color: rgba(110,214,190,.7); }
#avalin-tools button.rec {
  background: rgba(232,63,63,.5); border-color: rgba(232,63,63,.9);
  animation: avalin-pulse 1.6s infinite;
}
@keyframes avalin-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232,63,63,.45); }
  50% { box-shadow: 0 0 0 7px rgba(232,63,63,0); }
}

/* всплывающее уведомление */
#avalin-toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  z-index: 10000; max-width: min(560px, 92vw);
  display: flex; align-items: center; gap: 12px;
  background: rgba(16,19,31,.92); color: #fff;
  border: 1px solid rgba(255,255,255,.25); border-radius: 12px;
  padding: 12px 16px; font-size: 14px; line-height: 1.35;
  backdrop-filter: blur(6px); box-shadow: 0 8px 30px rgba(0,0,0,.45);
}
#avalin-toast button {
  flex-shrink: 0; background: rgba(110,214,190,.35); color: #fff;
  border: 1px solid rgba(110,214,190,.7); border-radius: 8px;
  padding: 6px 14px; font-weight: 700; font-size: 13px; cursor: pointer;
}

/* бейдж непрочитанных сообщений */
.avalin-badge {
  display: inline-block; min-width: 18px; text-align: center;
  background: #e83f3f; color: #fff; border-radius: 9px;
  font-size: 11px; padding: 1px 5px; margin-left: 4px; vertical-align: 1px;
}

/* панель чата */
#avalin-chat {
  position: fixed; bottom: 70px; left: 148px; z-index: 9998;
  width: min(320px, 80vw); height: min(46vh, 420px);
  display: flex; flex-direction: column;
  background: rgba(16,19,31,.92); color: #fff;
  border: 1px solid rgba(255,255,255,.25); border-radius: 12px;
  backdrop-filter: blur(6px); box-shadow: 0 8px 30px rgba(0,0,0,.45);
  font-size: 13px; overflow: hidden;
}
.avalin-chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,.15);
}
.avalin-chat-head b { letter-spacing: .04em; }
.avalin-chat-head button {
  background: rgba(255,255,255,.1); color: #fff;
  border: 1px solid rgba(255,255,255,.25); border-radius: 6px;
  padding: 3px 8px; font-size: 13px; cursor: pointer;
}
.avalin-chat-body { flex: 1; overflow-y: auto; padding: 8px 10px; }
.avalin-chat-body .msg { margin-bottom: 8px; line-height: 1.35; }
.avalin-chat-body .msg .who { font-weight: 700; color: rgba(122,143,245,1); margin-right: 6px; }
.avalin-chat-body .msg.own .who { color: rgba(110,214,190,1); }
.avalin-chat-body .msg .ts { color: rgba(255,255,255,.4); font-size: 11px; }
.avalin-chat-body .msg .txt { word-wrap: break-word; white-space: pre-wrap; }
.avalin-chat-body .msg.hint { color: rgba(255,255,255,.5); font-style: italic; }
.avalin-chat-input {
  display: flex; gap: 6px; padding: 8px;
  border-top: 1px solid rgba(255,255,255,.15);
}
.avalin-chat-input input {
  flex: 1; background: rgba(255,255,255,.08); color: #fff;
  border: 1px solid rgba(255,255,255,.25); border-radius: 8px;
  padding: 7px 10px; font-size: 13px; outline: none;
}
.avalin-chat-input input:focus { border-color: rgba(110,214,190,.7); }
.avalin-chat-input button {
  background: rgba(110,214,190,.35); color: #fff;
  border: 1px solid rgba(110,214,190,.7); border-radius: 8px;
  padding: 7px 12px; font-size: 13px; cursor: pointer;
}

/* панель конспекта */
#avalin-scribe {
  position: fixed; top: 70px; right: 14px; z-index: 9998;
  width: min(360px, 88vw); max-height: min(52vh, 480px);
  display: flex; flex-direction: column;
  background: rgba(16,19,31,.92); color: #fff;
  border: 1px solid rgba(255,255,255,.25); border-radius: 12px;
  backdrop-filter: blur(6px); box-shadow: 0 8px 30px rgba(0,0,0,.45);
  font-size: 13px; overflow: hidden;
}
.avalin-scribe-head {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,.15);
}
.avalin-scribe-head b { letter-spacing: .04em; }
.avalin-scribe-head .dot {
  width: 8px; height: 8px; border-radius: 50%; background: #e83f3f;
  margin-right: auto; animation: avalin-pulse 1.6s infinite;
}
.avalin-scribe-head button {
  background: rgba(255,255,255,.1); color: #fff;
  border: 1px solid rgba(255,255,255,.25); border-radius: 6px;
  padding: 3px 8px; font-size: 13px; cursor: pointer;
}
.avalin-scribe-head button:hover { background: rgba(255,255,255,.22); }
.avalin-scribe-body { overflow-y: auto; padding: 8px 10px; flex: 1; }
.avalin-scribe-body .ln { margin-bottom: 6px; line-height: 1.4; }
.avalin-scribe-body .ln .ts { color: rgba(110,214,190,.9); font-size: 11px; }
.avalin-scribe-body .ln.interim { color: rgba(255,255,255,.5); font-style: italic; }
.avalin-scribe-hint {
  padding: 6px 10px; font-size: 11px; color: rgba(255,255,255,.5);
  border-top: 1px solid rgba(255,255,255,.12);
}
