/* Линия 2.0 — оформление веб-клиента в стиле мобильного приложения (тёмная тема, мятный акцент). */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

/* ---------- Чаты: всегда тёмная тема ---------- */
/* --l2-* можно переопределить удалённым конфигом (/app-config.json → colors), см. linia2.js */
:root {
  color-scheme: dark;
  --l2-bg: #12121C;
  --l2-card: #1E1E2E;
  --l2-card2: #262638;
  --l2-line: rgba(255,255,255,.08);
  --l2-text: #F2F2F7;
  --l2-muted: #9A9AB0;
  --l2-accent: #7EE0C3;
  --l2-accent2: #2FA987;
  --l2-on-accent: #0B2A22;
  --l2-bubble-out: #2FA987;
  --l2-bubble-in: var(--l2-card2);
  --l2-on-bubble-out: #0B2A22;
  --l2-danger: #FF6B7A;
  --l2-accent-a15: color-mix(in srgb, var(--l2-accent) 15%, transparent);
  --l2-accent-a25: color-mix(in srgb, var(--l2-accent) 25%, transparent);

  --clr-body-background: var(--l2-bg);
  --clr-background-off-white: var(--l2-card);
  --clr-background-extra-light-gray: var(--l2-card);
  --clr-background-light-gray: var(--l2-card2);
  --clr-background-blue-gray-50: var(--l2-card);
  --clr-background-blue-gray-75: var(--l2-card2);
  --clr-background-blue-gray-100: var(--l2-card2);
  --clr-background-blue-gray-300: #34344A;
  --clr-header-stripe-bg: var(--l2-bg);
  --clr-text-primary: var(--l2-text);
  --clr-text-secondary: var(--l2-muted);
  --clr-border-light: var(--l2-line);
  --clr-border-muted: var(--l2-line);
  --clr-primary-accent: var(--l2-accent);
  --clr-primary-accent-hover: color-mix(in srgb, var(--l2-accent) 80%, white);
  --clr-primary-action: var(--l2-accent);
  --clr-primary-action-hover: color-mix(in srgb, var(--l2-accent) 85%, white);
  --clr-primary-accent-focus-shadow: var(--l2-accent-a25);
  --clr-primary-accent-transparent-medium: color-mix(in srgb, var(--l2-accent) 30%, transparent);
  --clr-primary-light-blue: color-mix(in srgb, var(--l2-accent) 45%, var(--l2-bg));
  --clr-primary-wash: color-mix(in srgb, var(--l2-accent) 16%, var(--l2-bg));
  --clr-indigo-50: color-mix(in srgb, var(--l2-accent) 16%, var(--l2-bg));
  --clr-light-blue-accent: var(--l2-accent);
  --clr-blue-wash-light: #1A1A2A;
  --clr-blue-wash-medium: color-mix(in srgb, var(--l2-accent) 16%, var(--l2-bg));
  --clr-button-primary-text: var(--l2-on-accent);
  /* Пузыри: свои (справа) — мятные с тёмным текстом, чужие (слева) — тёмные карточки */
  --clr-bubble-right-bg: var(--l2-bubble-out);
  --clr-bubble-right-bg-flash: color-mix(in srgb, var(--l2-bubble-out) 80%, white);
  --clr-bubble-left-bg: var(--l2-bubble-in);
  --clr-bubble-left-bg-flash: #34344A;
  --clr-bubble-text: var(--l2-text);
  --clr-bubble-timestamp-text: rgba(242,242,247,.6);
  --clr-bubble-meta-date-bg: rgba(30,30,46,.9);
  --clr-input-text: var(--l2-text);
  --clr-input-border: var(--l2-line);
  --clr-input-border-focus: var(--l2-accent);
  --clr-input-placeholder-text: var(--l2-muted);
}
body { color-scheme: dark; font-family: Inter, Roboto, system-ui, sans-serif; background: var(--l2-bg); }
#dummy-view p { display: none; }
#dummy-view h2 { color: var(--l2-accent); }
#dummy-view #logo { width: 150px; height: 150px; border-radius: 32px; }
/* Свои сообщения: тёмный текст на мятном пузыре */
.right .bubble, .right .bubble div.message-content { color: var(--l2-on-bubble-out); }
.right .bubble a, .right .bubble .timestamp, .right .bubble .timestamp * { color: var(--l2-on-bubble-out) !important; }
.right .bubble .timestamp { opacity: .7; }
.right .bubble .material-icons { color: var(--l2-on-bubble-out); }
.right .bubble .material-icons.blue { color: #0B4F3E; }

/* ---------- Баннер из удалённого конфига (над списком чатов) ---------- */
#l2-banner { display: flex; align-items: center; gap: 10px; margin: 8px 10px 4px; padding: 10px 8px 10px 14px; border-radius: 14px;
  background: var(--l2-banner, var(--l2-accent)); color: var(--l2-on-banner, var(--l2-on-accent)); font: 600 14px/1.35 Inter, system-ui, sans-serif; flex: none; }
#l2-banner .t { flex: 1; min-width: 0; word-wrap: break-word; }
#l2-banner a.t { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
#l2-banner button { flex: none; width: 30px; height: 30px; border: 0; border-radius: 10px; background: rgba(0,0,0,.12); color: inherit; cursor: pointer;
  display: flex; align-items: center; justify-content: center; }
#l2-banner button:hover { background: rgba(0,0,0,.22); }

/* ---------- Предупреждение (запрещённые слова и т.п.) ---------- */
#l2-toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 100001; max-width: min(92vw, 460px);
  background: #2A1E26; color: #FFD3D8; border: 1px solid rgba(255,107,122,.45); border-radius: 16px; padding: 14px 18px;
  font: 500 14.5px/1.45 Inter, system-ui, sans-serif; box-shadow: 0 18px 50px rgba(0,0,0,.5); display: flex; gap: 10px; align-items: flex-start;
  animation: l2in .25s ease; }
#l2-toast[hidden] { display: none; }
#l2-toast b { color: #fff; }

/* ---------- Экраны входа и регистрации ---------- */
#l2a { position: fixed; inset: 0; z-index: 100000; background: radial-gradient(1200px 600px at 50% -10%, #173A33 0%, var(--l2-bg) 55%);
  display: flex; align-items: center; justify-content: center; padding: 24px; font-family: Inter, system-ui, sans-serif; color: var(--l2-text);
  overflow-y: auto; animation: l2fade .25s ease; }
#l2a[hidden] { display: none !important; }
@keyframes l2fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes l2in { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: none } }
@keyframes l2shake { 0%,100% { transform: none } 20% { transform: translateX(-10px) } 40% { transform: translateX(10px) } 60% { transform: translateX(-6px) } 80% { transform: translateX(6px) } }
#l2a .card { width: 100%; max-width: 420px; background: var(--l2-card); border-radius: var(--l2-r-card, 24px); padding: 32px 28px 28px; box-shadow: 0 30px 80px rgba(0,0,0,.45), 0 0 0 1px var(--l2-line) inset;
  animation: l2in .35s cubic-bezier(.2,.8,.2,1); position: relative; }
#l2a .back { position: absolute; left: 16px; top: 16px; width: 40px; height: 40px; border-radius: 14px; border: 0; background: var(--l2-card2); color: var(--l2-text);
  display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .15s, transform .15s; }
#l2a .back:hover { background: #30304A; transform: translateX(-2px); }
#l2a .logo { display: flex; justify-content: center; margin: 6px 0 18px; }
#l2a .logo .tile { width: 96px; height: 96px; border-radius: 28px; background: linear-gradient(160deg, #1C3B34, #161A26); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 40px var(--l2-accent-a25), 0 0 0 1px var(--l2-accent-a25) inset; }
#l2a .logo.big .tile { width: 128px; height: 128px; border-radius: 36px; }
#l2a .word { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 20px; font-weight: 600; margin-bottom: 18px; }
#l2a h1 { white-space: pre-line; font-size: 28px; line-height: 1.2; font-weight: 800; text-align: center; margin: 0 0 10px; letter-spacing: -.01em; }
#l2a p.sub { color: var(--l2-muted); text-align: center; margin: 0 0 26px; font-size: 15px; line-height: 1.5; }
#l2a label.f { display: block; margin: 0 0 14px; }
#l2a label.f span.l { display: block; font-size: 13px; font-weight: 600; color: var(--l2-muted); margin: 0 0 6px 4px; }
#l2a .inp { display: flex; align-items: center; background: var(--l2-card2); border: 1.5px solid transparent; border-radius: var(--l2-r-input, 16px); height: 54px; padding: 0 6px 0 16px;
  transition: border-color .15s, box-shadow .15s; }
#l2a .inp:focus-within { border-color: var(--l2-accent); box-shadow: 0 0 0 4px var(--l2-accent-a15); }
#l2a .inp.bad { border-color: var(--l2-danger); box-shadow: 0 0 0 4px rgba(255,107,122,.12); }
#l2a .inp input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--l2-text); font: 500 16px Inter, system-ui, sans-serif; height: 100%; }
#l2a .inp input::placeholder { color: #6E6E86; }
#l2a .eye { width: 42px; height: 42px; border: 0; background: transparent; color: var(--l2-muted); border-radius: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
#l2a .eye:hover { color: var(--l2-text); background: rgba(255,255,255,.05); }
#l2a .hint { font-size: 12.5px; color: var(--l2-muted); margin: 6px 4px 0; line-height: 1.4; }
#l2a .err { background: rgba(255,107,122,.12); color: #FF8E99; border-radius: 14px; padding: 12px 14px; font-size: 14px; font-weight: 500; margin: 4px 0 14px; line-height: 1.4; }
#l2a .err[hidden] { display: none; }
#l2a .btn { width: 100%; height: 54px; border: 0; border-radius: var(--l2-r-button, 16px); font: 600 16px Inter, system-ui, sans-serif; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .12s, filter .15s, background .15s, box-shadow .15s; }
#l2a .btn + .btn { margin-top: 12px; }
#l2a .btn.primary { background: linear-gradient(135deg, var(--l2-accent), var(--l2-accent2)); color: var(--l2-on-accent); box-shadow: 0 10px 24px color-mix(in srgb, var(--l2-accent2) 35%, transparent); }
#l2a .btn.primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
#l2a .btn.outline { background: transparent; color: var(--l2-text); box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--l2-accent) 55%, transparent) inset; }
#l2a .btn.outline:hover { background: color-mix(in srgb, var(--l2-accent) 8%, transparent); }
#l2a .btn:active { transform: scale(.98); }
#l2a .btn:disabled { opacity: .55; cursor: default; transform: none; filter: none; }
#l2a .link { display: block; width: 100%; margin-top: 18px; border: 0; background: transparent; color: var(--l2-accent); font: 600 15px Inter, system-ui, sans-serif; cursor: pointer; text-align: center; }
#l2a .link:hover { text-decoration: underline; }
#l2a .cells { display: flex; gap: 10px; justify-content: space-between; margin: 0 0 16px; }
#l2a .cells input { width: 100%; min-width: 0; height: 62px; text-align: center; font: 700 26px Inter, system-ui, sans-serif; color: var(--l2-text); background: var(--l2-card2);
  border: 1.5px solid transparent; border-radius: 16px; outline: 0; caret-color: var(--l2-accent); transition: border-color .15s, box-shadow .15s, transform .15s; }
#l2a .cells input:focus { border-color: var(--l2-accent); box-shadow: 0 0 0 4px var(--l2-accent-a15); transform: translateY(-1px); }
#l2a .cells.bad input { border-color: var(--l2-danger); }
#l2a .shake { animation: l2shake .4s ease; }
#l2a .spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, currentColor 35%, transparent); border-top-color: currentColor; animation: l2rot .8s linear infinite; }
@keyframes l2rot { to { transform: rotate(360deg) } }
#l2a .foot { text-align: center; color: #5F5F78; font-size: 12px; margin-top: 22px; }
@media (max-width: 520px) {
  #l2a { padding: 0; align-items: stretch; background: var(--l2-card); }
  #l2a .card { max-width: none; min-height: 100%; border-radius: 0; box-shadow: none; padding: 72px 22px 28px; display: flex; flex-direction: column; justify-content: center; }
  #l2a .cells { gap: 7px; }
  #l2a .cells input { height: 56px; font-size: 24px; border-radius: 14px; }
}

#l2a .legal { text-align: center; color: var(--l2-muted); font-size: 12.5px; line-height: 1.5; margin: 14px 4px 0; }
#l2a .legal a { color: var(--l2-accent); text-decoration: none; }
#l2a .legal a:hover { text-decoration: underline; }
#l2a .logo .tile img { width: 70%; height: 70%; object-fit: contain; border-radius: 18px; }
#l2a .welcome-img { display: block; max-width: 100%; max-height: 180px; margin: 0 auto 18px; border-radius: 20px; object-fit: contain; }

/* =====================================================================================
   Оболочка после входа — как в приложении «Линия 2.0» (классы Tinode + наши #l2-*).
   body.l2-app — пользователь вошёл; l2-tab-* — активная вкладка; l2-view-list — список чатов.
   ===================================================================================== */
:root { --message-text-size: 14.5px; --l2-side: #161622; --l2-bubble-in: #292F42; --l2-online: #3DDC97; --l2-radius: 16px; --l2-side-w: 380px; }
html, body { height: 100%; }
body.l2-app, body.l2-app #mountPoint { background: var(--l2-bg); padding: 0 !important; }
body.l2-app #app-container { max-width: none !important; width: 100%; border-radius: 0; box-shadow: none; background: var(--l2-bg); font-family: Inter, system-ui, sans-serif; }
body.l2-app #app-container input, body.l2-app #app-container textarea, body.l2-app #app-container button, body.l2-app #app-container select { font-family: Inter, system-ui, sans-serif; }

/* Иконки: лигатуры Material Icons, помеченные data-l2i, рисуются масками (см. linia2.js) */
i.material-icons[data-l2i] { width: 1em; height: 1em; overflow: hidden; text-indent: 3em; white-space: nowrap; display: inline-block; vertical-align: middle;
  background-color: currentColor; -webkit-mask: no-repeat center / 88%; mask: no-repeat center / 88%; font-feature-settings: normal; }
svg.l2i { flex: none; display: block; }

/* ---------- Левая панель ---------- */
body.l2-app #sidepanel { width: var(--l2-side-w); min-width: 300px; max-width: 42vw; flex-shrink: 0; background: var(--l2-side); border-right: 1px solid var(--l2-line); color: var(--l2-text); }
#l2-head { display: flex; align-items: center; gap: 8px; padding: 18px 16px 10px 20px; flex: none; }
#l2-head .brand { display: flex; align-items: center; gap: 10px; font: 700 20px/1 Inter, system-ui, sans-serif; letter-spacing: -.01em; margin-right: auto; color: var(--l2-text); }
#l2-head .hb { width: 40px; min-width: 40px; height: 40px; padding: 0; margin: 0; line-height: 1; box-shadow: none; text-transform: none; border: 0; border-radius: 13px; background: var(--l2-card); color: var(--l2-accent); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background .15s, transform .15s; }
#l2-head .hb:hover { background: var(--l2-card2); transform: translateY(-1px); }
#l2-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 6px 14px 4px; padding: 5px; background: var(--l2-card); border-radius: 18px; flex: none; }
#l2-tabs button { height: auto; min-width: 0; margin: 0; line-height: 1.1; box-shadow: none !important; text-transform: none; white-space: nowrap; border: 0; background: transparent; color: var(--l2-muted); border-radius: 13px; padding: 7px 2px 6px; cursor: pointer; display: flex; flex-direction: column;
  align-items: center; gap: 3px; font: 600 11.5px/1.1 Inter, system-ui, sans-serif; transition: background .15s, color .15s; }
#l2-tabs button:hover { color: var(--l2-text); }
#l2-tabs button.on { color: var(--l2-accent); background: var(--l2-accent-a15); }
#l2-tools { display: none; padding: 8px 14px 6px; flex: none; }
body.l2-view-list.l2-tab-chats #l2-tools { display: block; }
#l2-tools .search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; background: var(--l2-card); border-radius: var(--l2-r-input, 14px); color: var(--l2-muted);
  border: 1.5px solid transparent; transition: border-color .15s; }
#l2-tools .search:focus-within { border-color: var(--l2-accent); }
#l2-tools .search input { flex: 1; min-width: 0; border: 0 !important; outline: 0; background: transparent !important; color: var(--l2-text); font: 500 15px Inter, system-ui, sans-serif; box-shadow: none !important; padding: 0; height: 100%; }
#l2-tools .search input::placeholder { color: var(--l2-muted); }
#l2-tools .chips { display: flex; gap: 8px; margin-top: 10px; }
#l2-tools .chip { height: auto; min-width: 0; margin: 0; line-height: 1.2; box-shadow: none !important; text-transform: none; border: 0; border-radius: 999px; padding: 7px 14px; background: var(--l2-card); color: var(--l2-muted); font: 600 13px Inter, system-ui, sans-serif; cursor: pointer; }
#l2-tools .chip.on { background: var(--l2-accent); color: var(--l2-on-accent); }
#l2-calls { display: none; }
body.l2-app.l2-tab-calls #l2-calls { display: block; flex: 1; }
body.l2-app.l2-tab-calls #sidepanel > .scrollable-panel:not(#l2-calls), body.l2-app.l2-tab-calls #sidepanel > .info-box { display: none !important; }

/* Шапка Tinode в боковой панели: на списке чатов скрыта (её заменяет #l2-head), в остальных разделах — «назад + заголовок» */
body.l2-app #side-caption-panel { background: transparent; color: var(--l2-text); box-shadow: none; height: 52px; padding: 4px 12px 4px 10px; border-bottom: 1px solid var(--l2-line); }
body.l2-app.l2-view-list #side-caption-panel { display: none; }
body.l2-app #side-caption-panel a { color: var(--l2-muted); padding-left: 6px; }
body.l2-app #side-caption-panel a:hover, body.l2-app #side-caption-panel :hover { color: var(--l2-accent); }
body.l2-app #side-caption-panel .panel-title { font: 700 18px Inter, system-ui, sans-serif; color: var(--l2-text); }
body.l2-app #side-caption-panel .material-icons { font-size: 22px; }
body.l2-app #side-caption-panel #self-avatar { width: 36px; min-width: 36px; height: 36px; font-size: 15px; }

/* Список чатов */
body.l2-app #sidepanel .scrollable-panel { margin-top: 4px; padding-bottom: 12px; }
body.l2-app .contact-box > li, body.l2-app .contact-box > li:last-child { background: transparent; margin: 1px 8px; padding: 10px 12px; min-height: 68px; border-radius: 16px; align-items: center; cursor: pointer; transition: background .12s; }
body.l2-app .contact-box > li:hover { background: var(--l2-card); }
body.l2-app .contact-box > li.selected { background: var(--l2-accent-a15); }
body.l2-app .contact-box > li.tpinned { border-right: 0; background: color-mix(in srgb, var(--l2-card) 60%, transparent); }
body.l2-app .contact-box > li[data-l2-hide] { display: none !important; }
body.l2-app .contact-box .avatar-box { width: 50px; min-width: 50px; height: 50px; min-height: 50px; margin-right: 12px; overflow: visible; font-size: 18px; }
body.l2-app .contact-box .avatar { width: 50px; height: 50px; }
body.l2-app .contact-box.small .avatar-box { width: 36px; min-width: 36px; height: 36px; min-height: 36px; font-size: 14px; }
body.l2-app .contact-box .text-box { flex: 1; min-width: 0; gap: 3px; padding-right: 54px; }
body.l2-app .contact-box .contact-title { font: 600 15.5px/1.25 Inter, system-ui, sans-serif; color: var(--l2-text); }
body.l2-app .contact-box .contact-comment { font: 400 13.5px/1.3 Inter, system-ui, sans-serif; color: var(--l2-muted); }
body.l2-app .contact-box .contact-comment .material-icons { color: var(--l2-muted); font-size: 15px; }
body.l2-app .contact-box > li[data-l2-time]::after { content: attr(data-l2-time); position: absolute; top: 14px; right: 14px; font: 500 12px Inter, system-ui, sans-serif; color: var(--l2-muted); }
body.l2-app .contact-box > li:has(.unread)[data-l2-time]::after { color: var(--l2-accent); }
body.l2-app .contact-box > li:hover::after { opacity: 0; }
body.l2-app .contact-box .unread { position: absolute; right: 14px; bottom: 14px; margin: 0; min-width: 22px; width: auto; height: 22px; padding: 0 7px; border-radius: 11px;
  background: var(--l2-accent); color: var(--l2-on-accent); font: 700 12px/22px Inter, system-ui, sans-serif; text-align: center; }
body.l2-app .contact-box .menuTrigger { top: 10px; right: 8px; background: transparent; }
body.l2-app .contact-box .menuTrigger a { color: var(--l2-muted); }
body.l2-app .contact-box .checkmark.material-icons, body.l2-app .contact-box .deleted.material-icons { background: var(--l2-side); border-radius: 50%; }
#l2-list-empty { color: var(--l2-muted); text-align: center; padding: 36px 24px; font: 500 14px/1.5 Inter, system-ui, sans-serif; }

/* Аватары: мягкая палитра, инициалы (data-l2-ini), «в сети» — зелёная точка */
body.l2-app .lettertile { --l2-tile: #3B4A6B; background-color: var(--l2-tile) !important; }
body.l2-app .lettertile > div { color: #fff; font-family: Inter, system-ui, sans-serif; font-weight: 600; }
body.l2-app .lettertile > div[data-l2-ini] { font-size: 0 !important; }
body.l2-app .lettertile > div[data-l2-ini]::after { content: attr(data-l2-ini); font-size: 17px; letter-spacing: .02em; }
body.l2-app #topic-caption-panel .lettertile > div[data-l2-ini]::after, body.l2-app #self-avatar .lettertile > div[data-l2-ini]::after { font-size: 15px; }
body.l2-app .dk-bg-0, body.l2-app .dk-bg-8 { --l2-tile: #2FA987; } body.l2-app .dk-bg-1, body.l2-app .dk-bg-9 { --l2-tile: #5B7BD5; }
body.l2-app .dk-bg-2, body.l2-app .dk-bg-10 { --l2-tile: #C2577A; } body.l2-app .dk-bg-3, body.l2-app .dk-bg-11 { --l2-tile: #D28A3C; }
body.l2-app .dk-bg-4, body.l2-app .dk-bg-12 { --l2-tile: #7A62D3; } body.l2-app .dk-bg-5, body.l2-app .dk-bg-13 { --l2-tile: #2E9BB5; }
body.l2-app .dk-bg-6, body.l2-app .dk-bg-14 { --l2-tile: #B5544B; } body.l2-app .dk-bg-7, body.l2-app .dk-bg-15 { --l2-tile: #4F8F5B; }
body.l2-app .avatar-box .online { background: var(--l2-online); width: 14px; height: 14px; min-width: 14px; min-height: 14px; right: -1px; bottom: 0; border: 2.5px solid var(--l2-side); box-sizing: border-box; }
body.l2-app .avatar-box .offline { display: none; }

/* ---------- Звонки ---------- */
ul.l2-calls { list-style: none; margin: 4px 0; padding: 0; }
ul.l2-calls li { display: flex; align-items: center; gap: 12px; margin: 1px 8px; padding: 10px 12px; border-radius: 16px; cursor: pointer; }
ul.l2-calls li:hover { background: var(--l2-card); }
ul.l2-calls .ava { width: 46px; height: 46px; border-radius: 50%; background: #3B4A6B; color: #fff; display: flex; align-items: center; justify-content: center; font: 600 16px Inter, system-ui, sans-serif; flex: none; }
ul.l2-calls .mid { flex: 1; min-width: 0; }
ul.l2-calls b { display: block; font: 600 15px Inter, system-ui, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
ul.l2-calls small { display: flex; align-items: center; gap: 5px; color: var(--l2-muted); font-size: 13px; margin-top: 3px; }
ul.l2-calls small svg { color: var(--l2-accent); }
ul.l2-calls li.bad small, ul.l2-calls li.bad small svg { color: var(--l2-danger); }
ul.l2-calls time { color: var(--l2-muted); font-size: 12px; }
.l2-empty { text-align: center; padding: 48px 28px; color: var(--l2-muted); font-family: Inter, system-ui, sans-serif; }
.l2-empty .ic { width: 68px; height: 68px; border-radius: 22px; margin: 0 auto 16px; background: var(--l2-accent-a15); color: var(--l2-accent); display: flex; align-items: center; justify-content: center; }
.l2-empty b { display: block; color: var(--l2-text); font-size: 17px; margin-bottom: 8px; }
.l2-empty p { margin: 0; font-size: 14px; line-height: 1.5; }

/* ---------- Правая часть: пустой экран ---------- */
body.l2-app #dummy-view { background: var(--l2-bg); }
body.l2-app #dummy-view #logo { width: 112px; height: 112px; border-radius: 30px; box-shadow: 0 20px 60px var(--l2-accent-a15); }
body.l2-app #dummy-view h2 { color: var(--l2-text); font: 800 26px Inter, system-ui, sans-serif; margin: 18px 0 6px; }
body.l2-app #dummy-view p.l2-hint { display: block !important; color: var(--l2-muted); font: 500 15px Inter, system-ui, sans-serif; margin: 0; text-align: center; }

/* ---------- Экран чата ---------- */
body.l2-app #topic-view { background: var(--l2-bg); }
body.l2-app #topic-caption-panel { background: var(--l2-side); box-shadow: none; border-bottom: 1px solid var(--l2-line); height: 64px; padding: 8px 14px; }
body.l2-app #topic-caption-panel .avatar-box { width: 42px; min-width: 42px; height: 42px; margin-right: 12px; overflow: visible; }
body.l2-app #topic-title { font: 700 16.5px Inter, system-ui, sans-serif; color: var(--l2-text); }
body.l2-app #topic-last-seen { font: 500 12.5px Inter, system-ui, sans-serif; color: var(--l2-muted); }
body.l2-app #topic-last-seen[data-online="1"] { color: var(--l2-online); }
body.l2-app #topic-caption-panel a { color: var(--l2-muted); }
body.l2-app #topic-caption-panel a:hover { color: var(--l2-accent); }
body.l2-app #topic-caption-panel .material-icons { font-size: 22px; }
body.l2-app #messages-container::before { background-color: var(--l2-bg); background-image: none !important; filter: none !important; }
body.l2-app .chat-box { margin: 0 14px; }
body.l2-app .bubble { border-radius: var(--l2-r-bubble, 18px); padding: 8px 13px; font-family: Inter, system-ui, sans-serif; font-size: 14.5px; line-height: 1.42; filter: none; box-shadow: 0 1px 1px rgba(0,0,0,.18); }
body.l2-app .left .bubble { background: var(--l2-bubble-in); }
body.l2-app .left .bubble.tip { border-bottom-left-radius: 6px; }
body.l2-app .right .bubble.tip { border-bottom-right-radius: 6px; }
body.l2-app .bubble.tip::before { display: none; }
body.l2-app .chat-box .timestamp { font-size: 11px; }
body.l2-app .meta .bubble.date { background: var(--l2-card); color: var(--l2-muted); border-radius: 999px; padding: 5px 14px; font-size: 12px; font-weight: 600; text-transform: none; box-shadow: none; }
body.l2-app #go-to-latest { background: var(--l2-card2); color: var(--l2-accent); }
body.l2-app #send-message-wrapper { background: var(--l2-bg); padding: 8px 14px 12px; }
body.l2-app #send-message-panel { background: var(--l2-card); border-radius: var(--l2-r-input, 28px); min-height: 52px; padding: 5px 5px 5px 10px; gap: 2px; box-shadow: 0 0 0 1px var(--l2-line) inset; }
body.l2-app #send-message-panel .material-icons { color: var(--l2-muted); font-size: 22px; min-width: 0; }
body.l2-app #send-message-panel > a { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; flex: none; }
body.l2-app #send-message-panel > a:hover .material-icons { color: var(--l2-accent) !important; }
body.l2-app #send-message-panel > a:last-of-type { width: 42px; height: 42px; background: var(--l2-accent); margin-left: 6px; }
body.l2-app #send-message-panel > a:last-of-type .material-icons, body.l2-app #send-message-panel > a:last-of-type:hover .material-icons { color: var(--l2-on-accent) !important; font-size: 20px; }
body.l2-app #send-message-input { background: transparent !important; border: 0 !important; box-shadow: none !important; color: var(--l2-text); font: 400 15px/1.4 Inter, system-ui, sans-serif; padding: 10px 6px; min-height: 42px; resize: none; }
body.l2-app #send-message-input::placeholder { color: var(--l2-muted); }

/* ---------- Разделы (контакты, настройки, профиль, инфо) ---------- */
body.l2-app #info-view, body.l2-app #info-view .scrollable-panel { background: var(--l2-side); color: var(--l2-text); }
body.l2-app #info-view { border-left: 1px solid var(--l2-line); }
body.l2-app .panel-form-row, body.l2-app .panel-form-column { padding-left: 18px; padding-right: 18px; }
body.l2-app .hr { background: var(--l2-line); box-shadow: none; height: 1px; min-height: 1px; margin: 8px 0; }
body.l2-app label.small { color: var(--l2-muted); font: 600 12.5px Inter, system-ui, sans-serif; }
body.l2-app .flat-button { background: transparent; color: var(--l2-accent); text-transform: none; font: 600 14.5px Inter, system-ui, sans-serif; border-radius: 12px; padding: 0 10px; height: 40px; gap: 10px; }
body.l2-app .flat-button:hover { background: var(--l2-accent-a15); text-decoration: none; }
body.l2-app .flat-button .material-icons { font-size: 20px; }
body.l2-app button.primary, body.l2-app button.blue:not(.flat-button) { background: var(--l2-accent); color: var(--l2-on-accent); border-radius: 14px; font-weight: 700; text-transform: none; box-shadow: none; }
body.l2-app button.secondary { background: var(--l2-card2); color: var(--l2-text); border-radius: 14px; text-transform: none; box-shadow: none; }
body.l2-app input[type=text], body.l2-app input[type=search], body.l2-app input[type=email], body.l2-app input[type=tel], body.l2-app input[type=password], body.l2-app textarea {
  background: var(--l2-card); color: var(--l2-text); border: 1.5px solid transparent; border-radius: 12px; box-shadow: none; padding: 9px 12px; }
body.l2-app input:focus, body.l2-app textarea:focus { border-color: var(--l2-accent); outline: 0; box-shadow: none; }
body.l2-app input.search { text-indent: 1.6rem; }
body.l2-app i.search { left: 1.6rem; top: 50%; transform: translateY(-50%); color: var(--l2-muted); }
body.l2-app ul.tabbar { background: transparent; padding: 6px 14px; gap: 6px; box-shadow: none; }
body.l2-app ul.tabbar > li { box-shadow: none; height: auto; background: transparent; }
body.l2-app ul.tabbar li:after { display: none; }
body.l2-app ul.tabbar > li > a { display: block; line-height: 1; padding: 9px 14px; border-radius: 999px; background: var(--l2-card); color: var(--l2-muted); font: 600 13px Inter, system-ui, sans-serif; font-variant: normal; }
body.l2-app ul.tabbar li.active > a { background: var(--l2-accent); color: var(--l2-on-accent); }
body.l2-app .avatar-upload .lettertile > div { font-size: 52px; }
body.l2-app .info-box.error { background: rgba(255,107,122,.12); border-bottom: 0; color: #FF8E99; }
body.l2-app .info-box.warning, body.l2-app .info-box.info { background: var(--l2-card); border-bottom: 0; color: var(--l2-text); }
body.l2-app .menu, body.l2-app .menu ul, body.l2-app .context-menu, body.l2-app .alert, body.l2-app .alert-container > div { background: var(--l2-card); color: var(--l2-text); border-radius: 14px; }

/* ---------- Телефон: вкладки — нижнее меню (основа для будущего мобильного режима) ---------- */
@media (max-width: 767px) {
  body.l2-app #sidepanel { width: 100%; max-width: none; min-width: 0; border-right: 0; }
  body.l2-app #l2-tabs { order: 99; margin: auto 0 0; border-radius: 0; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--l2-card); border-top: 1px solid var(--l2-line); }
  body.l2-app #sidepanel > .scrollable-panel { flex: 1; }
  #l2-head { padding: 14px 14px 6px 18px; }
  body.l2-app .contact-box > li[data-l2-time]::after { right: 40px; }
  body.l2-app #topic-caption-panel { padding: 8px 8px 8px 4px; }
  body.l2-app #topic-caption-panel > a:first-child { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; }
  body.l2-app .chat-box { margin: 0 8px; }
  body.l2-app #send-message-wrapper { padding: 6px 8px 8px; }
}

#l2-tabs button:hover:not([disabled]) { color: var(--l2-text); }
#l2-tabs button.on:hover:not([disabled]) { color: var(--l2-accent); }
#l2-head .hb:hover:not([disabled]) { color: var(--l2-accent); }
#l2-tools .chip:hover:not([disabled]) { color: var(--l2-text); }
#l2-tools .chip.on:hover:not([disabled]) { color: var(--l2-on-accent); }

#l2-banner button { height: 30px; min-width: 0; padding: 0; margin: 0; line-height: 1; box-shadow: none; text-transform: none; }
#l2-banner button:hover:not([disabled]) { color: inherit; }
body.l2-app.l2-view-list.l2-tab-chats #sidepanel .center-medium-text { display: none; }
body.l2-app .center-medium-text { color: var(--l2-muted); font-family: Inter, system-ui, sans-serif; font-size: 14px; }
body.l2-app #app-container * { scrollbar-width: thin; scrollbar-color: #34344A transparent; }
body.l2-app #app-container ::-webkit-scrollbar { width: 8px; height: 8px; }
body.l2-app #app-container ::-webkit-scrollbar-thumb { background: #34344A; border-radius: 4px; }
body.l2-app #app-container ::-webkit-scrollbar-track { background: transparent; }
/* Экраны входа: сброс стилей кнопок Tinode (верхний регистр, ширина, отступы) */
#l2a button { text-transform: none; min-width: 0; letter-spacing: normal; margin: 0; font-family: Inter, system-ui, sans-serif; }
#l2a button:hover:not([disabled]) { color: inherit; }
#l2a .btn.primary:hover:not([disabled]) { color: var(--l2-on-accent); }
#l2a .back { padding: 0; line-height: 1; }
#l2a .eye { padding: 0; line-height: 1; height: 42px; }
#l2a .link { height: auto; line-height: 1.4; padding: 6px 0; }
#l2a .link:hover:not([disabled]) { color: var(--l2-accent); }
#l2a button { box-shadow: none; outline: none; }
#l2a .btn.primary { box-shadow: 0 10px 24px color-mix(in srgb, var(--l2-accent2) 35%, transparent); }
#l2a button:focus-visible { outline: 2px solid var(--l2-accent); outline-offset: 2px; }
#l2a .eye { background: transparent; }
body.l2-app #info-view .caption-panel { background: var(--l2-side); box-shadow: none; border-bottom: 1px solid var(--l2-line); color: var(--l2-text); height: 64px; }
body.l2-app #info-view .caption-panel .panel-title { font: 700 18px Inter, system-ui, sans-serif; }
body.l2-app #info-view .caption-panel a { color: var(--l2-muted); }
body.l2-app ul.tabbar > li > a::first-letter { text-transform: uppercase; }

/* ===================== Свои панели: Звонки, Контакты, Настройки ===================== */
body.l2-own #sidepanel > :not([id^="l2-"]) { display: none !important; }
body.l2-own #l2-tools { display: none !important; }
.l2-panel { display: none; flex: 1; min-height: 0; overflow-y: auto; padding: 4px 0 16px; font-family: Inter, system-ui, sans-serif; color: var(--l2-text); }
body.l2-own-calls #l2-calls, body.l2-own-contacts #l2-contacts, body.l2-own-settings #l2-settings { display: block; }
#l2-calls { display: none; } body.l2-own-calls #l2-calls { display: block; }
.l2-ptitle { display: flex; align-items: center; gap: 8px; padding: 10px 18px 6px; }
.l2-ptitle h2 { margin: 0; font: 800 22px Inter, system-ui, sans-serif; letter-spacing: -.01em; }
.l2-back, .l2-ib, .l2-x { border: 0; background: var(--l2-card); color: var(--l2-text); width: 36px; height: 36px; min-width: 0; padding: 0; margin: 0; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; line-height: 1; box-shadow: none; text-transform: none; flex: none; }
.l2-back:hover, .l2-ib:hover, .l2-x:hover { background: var(--l2-card2); color: var(--l2-accent) !important; }
.l2-panel .chips { display: flex; gap: 8px; padding: 6px 18px 8px; }
.l2-panel .chip, .l2-btn { border: 0; border-radius: 999px; padding: 7px 14px; background: var(--l2-card); color: var(--l2-muted); font: 600 13px Inter, system-ui, sans-serif;
  cursor: pointer; height: auto; min-width: 0; margin: 0; line-height: 1.2; box-shadow: none; text-transform: none; display: inline-flex; align-items: center; gap: 6px; }
.l2-panel .chip.on { background: var(--l2-accent); color: var(--l2-on-accent); }
.l2-panel .chip:hover:not([disabled]) { color: var(--l2-text); } .l2-panel .chip.on:hover:not([disabled]) { color: var(--l2-on-accent); }
.l2-btn.primary { background: var(--l2-accent); color: var(--l2-on-accent); border-radius: var(--l2-r-button, 12px); padding: 10px 16px; }
.l2-btn.primary.sm { padding: 8px 12px; }
.l2-btn.primary:hover:not([disabled]) { color: var(--l2-on-accent); filter: brightness(1.06); }
.l2-btn.ghost { background: var(--l2-card2); color: var(--l2-text); border-radius: var(--l2-r-button, 12px); padding: 11px 18px; }
.l2-btn.ghost:hover:not([disabled]) { color: var(--l2-text); }
.l2-btn.danger { background: var(--l2-danger); color: #fff; border-radius: var(--l2-r-button, 12px); padding: 11px 18px; }
.l2-btn.danger:hover:not([disabled]) { color: #fff; filter: brightness(1.05); }
ul.l2-list { list-style: none; margin: 0; padding: 0 0 6px; }
ul.l2-list li { display: flex; align-items: center; gap: 12px; margin: 1px 8px; padding: 9px 12px; border-radius: 16px; cursor: pointer; transition: background .12s; }
ul.l2-list li:hover { background: var(--l2-card); }
ul.l2-list .mid { flex: 1; min-width: 0; }
ul.l2-list b { display: block; font: 600 15px Inter, system-ui, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
ul.l2-list small { display: flex; align-items: center; gap: 5px; color: var(--l2-muted); font-size: 13px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
ul.l2-list small.on { color: var(--l2-online); }
ul.l2-list small svg { color: var(--l2-accent); }
ul.l2-list li.bad small, ul.l2-list li.bad small svg { color: var(--l2-danger); }
ul.l2-list .l2-ib { width: 34px; height: 34px; color: var(--l2-accent); }
.l2-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--l2-online); flex: none; }
.l2-ava { position: relative; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; flex: none; overflow: hidden; background: #3B4A6B; letter-spacing: .02em; }
.l2-ava img { width: 100%; height: 100%; object-fit: cover; }
.l2-ava.c0 { background: #2FA987; } .l2-ava.c1 { background: #5B7BD5; } .l2-ava.c2 { background: #C2577A; } .l2-ava.c3 { background: #D28A3C; }
.l2-ava.c4 { background: #7A62D3; } .l2-ava.c5 { background: #2E9BB5; } .l2-ava.c6 { background: #B5544B; } .l2-ava.c7 { background: #4F8F5B; }
.l2-search { display: flex; gap: 8px; padding: 6px 14px 8px; align-items: center; }
.l2-search .search { flex: 1; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; background: var(--l2-card); border-radius: 14px; color: var(--l2-muted); border: 1.5px solid transparent; }
.l2-search .search:focus-within { border-color: var(--l2-accent); }
.l2-search input { flex: 1; min-width: 0; border: 0 !important; outline: 0; background: transparent !important; color: var(--l2-text); font: 500 15px Inter, system-ui, sans-serif; box-shadow: none !important; padding: 0 !important; height: 100%; }
.l2-sec { padding: 14px 20px 6px; color: var(--l2-muted); font: 700 12px Inter, system-ui, sans-serif; text-transform: uppercase; letter-spacing: .05em; }
.l2-hint2 { padding: 14px 22px; color: var(--l2-muted); font-size: 14px; line-height: 1.5; }
.l2-note { padding: 4px 22px; color: var(--l2-muted); font-size: 13px; line-height: 1.5; }
.l2-profile { display: flex; align-items: center; gap: 14px; width: calc(100% - 28px); margin: 6px 14px 12px; padding: 14px; border: 0; border-radius: 18px; background: var(--l2-card);
  color: var(--l2-text); cursor: pointer; text-align: left; height: auto; min-width: 0; line-height: 1.3; box-shadow: none; text-transform: none; }
.l2-profile:hover:not([disabled]) { color: var(--l2-text); background: var(--l2-card2); }
.l2-profile .mid { min-width: 0; } .l2-profile b { display: block; font-size: 17px; } .l2-profile small { display: block; color: var(--l2-muted); font-size: 13px; margin-top: 3px; }
.l2-group { margin: 6px 14px 12px; background: var(--l2-card); border-radius: var(--l2-r-card, 18px); overflow: hidden; }
.l2-srow { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border: 0; background: transparent; color: var(--l2-text); cursor: pointer; text-align: left;
  font: 500 15px Inter, system-ui, sans-serif; height: auto; min-width: 0; margin: 0; line-height: 1.3; box-shadow: none; text-transform: none; border-bottom: 1px solid var(--l2-line); }
.l2-srow:last-child { border-bottom: 0; }
.l2-srow svg { color: var(--l2-accent); }
.l2-srow .t { flex: 1; } .l2-srow .v { color: var(--l2-muted); font-size: 13px; }
.l2-srow .chev svg { color: var(--l2-muted); transform: rotate(-90deg); }
.l2-srow:hover:not([disabled]) { background: var(--l2-card2); color: var(--l2-text); }
.l2-srow.danger, .l2-srow.danger svg, .l2-srow.danger:hover:not([disabled]) { color: var(--l2-danger); }
.l2-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 4px 14px; }
.l2-seg button, .l2-accents button { border: 2px solid transparent; background: var(--l2-card); color: var(--l2-text); border-radius: 16px; padding: 14px 6px; cursor: pointer; display: flex; flex-direction: column;
  align-items: center; gap: 8px; font: 600 13px Inter, system-ui, sans-serif; height: auto; min-width: 0; margin: 0; line-height: 1.2; box-shadow: none; text-transform: none; }
.l2-seg button.on, .l2-accents button.on { border-color: var(--l2-accent); color: var(--l2-accent); }
.l2-seg button:hover:not([disabled]), .l2-accents button:hover:not([disabled]) { color: var(--l2-accent); }
.l2-accents { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 4px 14px; }
.l2-accents button { padding: 12px 2px; font-size: 11.5px; }
.l2-accents .sw { width: 32px; height: 32px; border-radius: 50%; }
.l2-preview { margin: 14px; padding: 14px; border-radius: 18px; background: var(--l2-bg); display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--l2-line); }
.l2-preview div { max-width: 80%; padding: 9px 13px; border-radius: 18px; font-size: 14px; }
.l2-preview .in { background: var(--l2-bubble-in); color: var(--l2-text); align-self: flex-start; border-bottom-left-radius: 6px; }
.l2-preview .out { background: var(--l2-bubble-out); color: var(--l2-on-bubble-out); align-self: flex-end; border-bottom-right-radius: 6px; }
.l2-about { text-align: center; padding: 12px 20px 6px; }
.l2-about .tile { width: 96px; height: 96px; border-radius: 28px; margin: 0 auto 12px; background: linear-gradient(160deg, #1C3B34, #161A26); display: flex; align-items: center; justify-content: center; }
.l2-about b { display: block; font-size: 20px; } .l2-about small { color: var(--l2-muted); }
.l2-html { padding: 2px 22px 6px; font-size: 14px; line-height: 1.55; color: var(--l2-text); }
.l2-html a { color: var(--l2-accent); }

/* Кнопка-аватар в шапке и её меню */
#l2-head .hb.me { padding: 0; background: transparent; border-radius: 50%; width: 38px; min-width: 38px; height: 38px; overflow: hidden; }
#l2-head .hb.me .l2-ava { width: 38px !important; height: 38px !important; }
#l2-menu { position: fixed; z-index: 100002; min-width: 200px; background: var(--l2-card); border-radius: 16px; padding: 6px; box-shadow: 0 18px 50px rgba(0,0,0,.45); border: 1px solid var(--l2-line); }
#l2-menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; border-radius: 11px; background: transparent; color: var(--l2-text);
  font: 500 15px Inter, system-ui, sans-serif; cursor: pointer; height: auto; min-width: 0; margin: 0; line-height: 1.2; box-shadow: none; text-transform: none; }
#l2-menu button svg { color: var(--l2-accent); }
#l2-menu button:hover:not([disabled]) { background: var(--l2-card2); color: var(--l2-text); }
#l2-menu button.danger, #l2-menu button.danger svg, #l2-menu button.danger:hover:not([disabled]) { color: var(--l2-danger); }

/* Окна */
.l2-modal { position: fixed; inset: 0; z-index: 100003; background: rgba(5,8,16,.55); display: flex; align-items: center; justify-content: center; padding: 16px; animation: l2fade .15s ease; font-family: Inter, system-ui, sans-serif; }
.l2-sheet { position: relative; width: 100%; max-width: 380px; background: var(--l2-card); color: var(--l2-text); border-radius: var(--l2-r-card, 22px); padding: 24px 22px 20px; box-shadow: 0 30px 80px rgba(0,0,0,.5); animation: l2in .2s ease; }
.l2-sheet h3 { margin: 0 0 8px; font-size: 19px; font-weight: 800; }
.l2-sheet p { margin: 0 0 18px; color: var(--l2-muted); font-size: 14.5px; line-height: 1.5; }
.l2-sheet .l2-row { display: flex; gap: 10px; justify-content: flex-end; }
.l2-sheet .l2-row .l2-btn { flex: 1; justify-content: center; }
.l2-sheet .l2-x { position: absolute; right: 14px; top: 14px; }
.l2-card-head { text-align: center; padding: 8px 0 14px; }
.l2-card-head .l2-ava { margin: 0 auto 12px; }
.l2-card-head h3 { margin: 0 0 4px; }
.l2-card-head p { margin: 0 0 2px; font-size: 13.5px; } .l2-card-head p.on { color: var(--l2-online); }
.l2-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.l2-act { border: 0; border-radius: 16px; background: var(--l2-card2); color: var(--l2-accent); padding: 14px 4px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  font: 600 13px Inter, system-ui, sans-serif; cursor: pointer; height: auto; min-width: 0; margin: 0; line-height: 1.2; box-shadow: none; text-transform: none; }
.l2-act span { color: var(--l2-text); }
.l2-act:hover:not([disabled]) { color: var(--l2-accent); background: var(--l2-accent-a15); }

/* ===================== Чат как в Telegram (linia2.js: реакции, меню сообщения, свайп, закреплённые) ===================== */
body.l2-app ul.menu > li[data-l2-hide] { display: none !important; }
/* Скрытые сообщения ленты (реакции, истёкшие) — нулевой высоты, но не display:none: иначе Tinode
   неверно считает видимый диапазон и не догружает историю при прокрутке вверх. */
body.l2-app #scroller > li[data-l2-hide] { height: 0 !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; border: 0 !important;
  overflow: hidden !important; visibility: hidden !important; pointer-events: none !important; }
.l2-bwrap { position: relative; transition: none; }
/* Пилюли реакций под сообщением: эмодзи + счётчик, своя — подсвечена акцентом; эмодзи — системный шрифт */
.l2-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 2px 2px; max-width: min(420px, 100%); }
.right .l2-reacts { justify-content: flex-end; margin-left: auto; }
.l2-reacts.pop { animation: l2pop .32s ease; }
@keyframes l2pop { 0% { transform: scale(.85); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
.l2-pill { border: 1.5px solid transparent; background: var(--l2-card2); color: var(--l2-text); border-radius: 999px; padding: 2px 9px 2px 7px; line-height: 22px; cursor: pointer;
  height: auto; min-width: 0; margin: 0; box-shadow: none; text-transform: none; display: inline-flex; align-items: center; gap: 5px; transition: transform .12s, background .12s; }
.l2-pill .e { font: 17px/1 "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", system-ui, sans-serif; }
.l2-pill .n { font: 700 12.5px/1 Inter, system-ui, sans-serif; color: var(--l2-muted); }
.l2-pill.mine { border-color: #7EE0C3; border-color: var(--l2-accent); background: var(--l2-accent-a25); }
.l2-pill.mine .n { color: var(--l2-accent); }
.l2-pill:hover:not([disabled]) { color: var(--l2-text); transform: scale(1.05); }
.l2-pill:active { transform: scale(.94); }
/* Кнопка «реакции и действия» у сообщения (ПК, при наведении) */
.l2-react-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--l2-card); color: var(--l2-muted);
  display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: opacity .12s; padding: 0; min-width: 0; margin: 0; box-shadow: none; line-height: 1; }
.left .l2-react-btn { right: -38px; } .right .l2-react-btn { left: -38px; }
li:hover .l2-react-btn, .l2-react-btn:focus-visible { opacity: 1; }
.l2-react-btn:hover:not([disabled]) { color: var(--l2-accent); }
@media (hover: none) { .l2-react-btn { display: none; } body.l2-app #scroller .menuTrigger { display: none; } }
html.l2-no-reactions .l2-react-btn, html.l2-no-reactions .l2-reacts { display: none !important; }
/* Выбранное сообщение, пока открыто меню */
body.l2-app #scroller > li.l2-sel .bubble { box-shadow: 0 0 0 2px var(--l2-accent-a25), 0 8px 28px rgba(0,0,0,.35); }
@media (hover: none) { body.l2-app #scroller .bubble { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; } }

/* Меню сообщения */
#l2-mm { position: fixed; inset: 0; z-index: 100005; background: rgba(5,8,16,.18); animation: l2fade .12s ease; }
#l2-mm.out { opacity: 0; transition: opacity .12s; }
@keyframes l2fade { from { opacity: 0; } to { opacity: 1; } }
#l2-mm .box { position: fixed; width: max-content; max-width: calc(100vw - 16px); display: flex; flex-direction: column; align-items: flex-start; gap: 8px; animation: l2mmin .16s cubic-bezier(.2,.9,.3,1.2); transform-origin: top left; }
@keyframes l2mmin { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }
#l2-mm .rbar, #l2-mm .acts, #l2-mm .rpanel { background: rgba(30,34,48,.78); -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6);
  border: 1px solid rgba(255,255,255,.08); box-shadow: 0 16px 44px rgba(0,0,0,.45); color: #F2F2F7; }
#l2-mm .rbar { display: flex; align-items: center; gap: 0; padding: 4px 6px; border-radius: 999px; max-width: calc(100vw - 16px); overflow-x: auto; scrollbar-width: none; }
#l2-mm .rbar::-webkit-scrollbar { display: none; }
#l2-mm button.em { width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: transparent; padding: 0; margin: 0; min-width: 0; box-shadow: none; cursor: pointer; line-height: 1;
  font: 30px/44px "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", system-ui, sans-serif; transition: transform .14s cubic-bezier(.3,1.6,.5,1), background .12s; text-transform: none; color: inherit; }
#l2-mm button.em:hover, #l2-mm button.em:focus-visible { transform: scale(1.22); background: rgba(255,255,255,.08); outline: 0; }
#l2-mm button.em:active { transform: scale(.9); }
#l2-mm button.em.on { background: color-mix(in srgb, #7EE0C3 28%, transparent); box-shadow: inset 0 0 0 1.5px #7EE0C3; }
#l2-mm .rbar button.em { font-size: 30px; }
#l2-mm .plus { width: 36px; height: 36px; flex: none; margin: 0 2px 0 4px; border: 0; border-radius: 50%; background: rgba(255,255,255,.1); color: #F2F2F7; display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; min-width: 0; box-shadow: none; transition: transform .2s; }
#l2-mm .plus.on { transform: rotate(180deg); background: rgba(126,224,195,.25); color: #7EE0C3; }
#l2-mm .rpanel { border-radius: 22px; padding: 8px; width: min(372px, calc(100vw - 16px)); box-sizing: border-box; max-height: min(360px, 60vh); overflow-y: auto; }
#l2-mm .rpanel[hidden], #l2-mm .acts[hidden] { display: none; }
#l2-mm .grid { display: grid; grid-template-columns: repeat(auto-fill, 44px); justify-content: space-between; gap: 2px; }
#l2-mm .grid.all { margin-top: 6px; }
#l2-mm .grid.all button.em { font-size: 26px; }
#l2-mm .allbtn { display: block; width: 100%; margin: 8px 0 0; padding: 10px; border: 0; border-radius: 14px; background: rgba(255,255,255,.08); color: #7EE0C3; font: 600 14px Inter, system-ui, sans-serif;
  cursor: pointer; height: auto; min-width: 0; box-shadow: none; text-transform: none; }
#l2-mm .full .q { width: 100%; box-sizing: border-box; height: 38px; margin-top: 8px; padding: 0 12px; border: 0; border-radius: 12px; background: rgba(255,255,255,.08); color: #F2F2F7;
  font: 400 14.5px Inter, system-ui, sans-serif; outline: 0; }
#l2-mm .full .q::placeholder { color: #9AA0B4; }
#l2-mm .none { grid-column: 1 / -1; color: #9AA0B4; font: 500 13.5px Inter, system-ui, sans-serif; padding: 12px 4px; }
#l2-mm .acts { min-width: 230px; border-radius: 16px; padding: 6px; display: flex; flex-direction: column; }
#l2-mm .acts button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 14px; border: 0; border-radius: 11px; background: transparent; color: #F2F2F7; cursor: pointer; text-align: left;
  font: 500 15px Inter, system-ui, sans-serif; height: auto; min-width: 0; margin: 0; box-shadow: none; text-transform: none; line-height: 1.2; }
#l2-mm .acts button svg { color: #9AA0B4; }
#l2-mm .acts button:hover, #l2-mm .acts button:focus-visible { background: rgba(255,255,255,.08); outline: 0; }
#l2-mm .acts button.danger, #l2-mm .acts button.danger svg { color: #FF6B7A; }
@media (max-width: 767px) {
  #l2-mm { background: rgba(5,8,16,.35); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
  #l2-mm .acts { min-width: 250px; }
  #l2-mm .acts button { padding: 12px 14px; font-size: 16px; }
  #l2-mm .rbar button.em { width: 42px; height: 42px; font-size: 28px; line-height: 42px; }
}
/* Летящий эмодзи */
.l2-fly { position: fixed; z-index: 100006; width: 44px; height: 44px; pointer-events: none; text-align: center; will-change: transform, opacity;
  font: 32px/44px "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", system-ui, sans-serif; }
/* Свайп вправо — ответ */
body.l2-app #scroller > li { position: relative; }
.l2-swipe-ic { position: absolute; left: 4px; top: 50%; transform: translateY(-50%) scale(.8); width: 32px; height: 32px; border-radius: 50%; background: var(--l2-card2); color: var(--l2-muted);
  display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: transform .15s, background .15s, color .15s; }
.l2-swipe-ic.ready { transform: translateY(-50%) scale(1); background: var(--l2-accent); color: var(--l2-on-accent); }

/* Закреплённые сообщения: плашка под шапкой чата */
body.l2-app #topic-caption-panel { position: relative; overflow: visible; }
body.l2-app #pinned-wrapper { position: static; margin: 0; flex: 0 0 0; width: 0; min-width: 0; height: 0; }
body.l2-app #pinned-wrapper > :not(.l2-pin) { display: none !important; }
html.l2-no-pins body.l2-app #pinned-wrapper { display: none !important; }
.l2-pin { position: absolute; left: 0; right: 0; top: 100%; z-index: 6; display: flex; align-items: center; gap: 6px; height: 50px; padding: 0 8px 0 14px; box-sizing: border-box;
  background: color-mix(in srgb, var(--l2-card) 88%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-bottom: 1px solid var(--l2-line); }
.l2-pin .ln { display: flex; flex-direction: column; gap: 2px; width: 3px; height: 36px; flex: none; }
.l2-pin .ln i { flex: 1; border-radius: 2px; background: color-mix(in srgb, var(--l2-accent) 35%, transparent); }
.l2-pin .ln i.on { background: var(--l2-accent); }
.l2-pin .main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 4px 6px; border: 0; background: transparent; cursor: pointer; text-align: left;
  height: auto; margin: 0; box-shadow: none; text-transform: none; border-radius: 10px; color: var(--l2-text); }
.l2-pin .main:hover { background: var(--l2-accent-a15); }
.l2-pin .main b { font: 700 13px/1.2 Inter, system-ui, sans-serif; color: var(--l2-accent); }
.l2-pin .main span { font: 400 13.5px/1.25 Inter, system-ui, sans-serif; color: var(--l2-text); max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.l2-pin .ib { width: 36px; height: 36px; flex: none; border: 0; border-radius: 50%; background: transparent; color: var(--l2-muted); display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; margin: 0; min-width: 0; box-shadow: none; }
.l2-pin .ib:hover { background: var(--l2-card2); color: var(--l2-accent); }
body.l2-app #topic-view:has(.l2-pin) #scroller { padding-top: 54px; }
.l2-sheet.l2-pins .l2-list { max-height: 50vh; overflow-y: auto; margin: 6px -8px 12px; padding: 0; }
.l2-sheet.l2-pins .l2-list li { display: flex; align-items: center; gap: 10px; padding: 10px 10px; border-radius: 12px; cursor: pointer; }
.l2-sheet.l2-pins .l2-list li:hover { background: var(--l2-card2); }
.l2-sheet.l2-pins .l2-list .mid { flex: 1; min-width: 0; font: 400 14.5px/1.35 Inter, system-ui, sans-serif; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* Жалоба */
.l2-quote { border-left: 3px solid var(--l2-accent); padding: 4px 10px; color: var(--l2-muted); font-size: 14px; white-space: pre-wrap; word-break: break-word; max-height: 90px; overflow: hidden; }
.l2-reasons { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.l2-reasons button { text-align: left; padding: 11px 14px; border: 1.5px solid var(--l2-line); border-radius: 12px; background: transparent; color: var(--l2-text); font: 500 14.5px Inter, system-ui, sans-serif;
  cursor: pointer; height: auto; margin: 0; min-width: 0; box-shadow: none; text-transform: none; }
.l2-reasons button.on { border-color: var(--l2-accent); background: var(--l2-accent-a15); }
.l2-ta { width: 100%; box-sizing: border-box; margin: 0 0 14px; padding: 10px 12px; border: 1.5px solid var(--l2-line); border-radius: 12px; background: var(--l2-card2); color: var(--l2-text);
  font: 400 14.5px/1.4 Inter, system-ui, sans-serif; resize: vertical; outline: 0; }
.l2-ta:focus { border-color: var(--l2-accent); }

/* «печатает…» в шапке чата */
body.l2-app #topic-last-seen[data-l2-typing="1"] { font-size: 0 !important; }
body.l2-app #topic-last-seen[data-l2-typing="1"]::after { content: "печатает…"; font: 500 12.5px Inter, system-ui, sans-serif; color: var(--l2-accent); }
html.l2-no-typing .online.typing { animation: none !important; }
/* Отметки: ✓ серая — отправлено, ✓✓ серые — доставлено, ✓✓ КРАСНЫЕ — прочитано (цвет colors.readReceipt из app-config.json) */
body.l2-app .chat-box .timestamp .material-icons[data-l2i="done"],
body.l2-app .chat-box .timestamp .material-icons[data-l2i="done_all"]:not(.blue) { color: rgba(255,255,255,.62) !important; }
body.l2-app .chat-box .timestamp .material-icons[data-l2i="done_all"].blue,
body.l2-app .right .bubble .timestamp .material-icons[data-l2i="done_all"].blue { color: var(--l2-read, #FF1F3D) !important; filter: drop-shadow(0 0 1px rgba(0,0,0,.55)); font-weight: 700; }
/* Отметки крупнее и заметнее на зелёном пузыре */
body.l2-app .chat-box .timestamp .material-icons[data-l2i="done"],
body.l2-app .chat-box .timestamp .material-icons[data-l2i="done_all"] { font-size: 17px !important; width: 17px !important; height: 17px !important; vertical-align: -4px; }
body.l2-app .chat-box .timestamp .material-icons[data-l2i="done_all"].blue svg { stroke-width: 3 !important; }
body.l2-app .chat-box .timestamp .material-icons[data-l2i="done_all"].blue { filter: drop-shadow(0 0 1.5px rgba(0,0,0,.85)) !important; }
html.l2-no-readReceipts body.l2-app .timestamp .material-icons.blue { color: inherit !important; }

/* Флаги функций из конфига: скрываем соответствующие элементы */
html.l2-no-attachments body.l2-app #send-message-panel > a:has(> i[data-l2i="photo"]),
html.l2-no-attachments body.l2-app #send-message-panel > a:has(> i[data-l2i="attach_file"]),
html.l2-no-attachments body.l2-app #send-message-panel > a:has(> i[data-l2i="image"]),
html.l2-no-voiceMessages body.l2-app #send-message-panel > a:has(> i[data-l2i="mic"]),
html.l2-no-search #l2-tools .search { display: none !important; }

/* Уведомление «Скопировано» и т.п. (нейтральное) */
#l2-toast.ok { background: color-mix(in srgb, var(--l2-card) 92%, transparent); color: var(--l2-text); border-color: var(--l2-line); }
/* Свои иконки вкладок (tabs[].iconUrl): шаблонная картинка, окрашивается цветом вкладки */
#l2-tabs .l2-ticon { display: block; width: 22px; height: 22px; background: currentColor; -webkit-mask: no-repeat center / contain; mask: no-repeat center / contain; }
#l2-head .brand img.l2-logo { width: 34px; height: 34px; object-fit: contain; border-radius: 9px; }
/* Картинки приветствия (images.welcomeSlides) */
#l2a .l2-slides { position: relative; height: 200px; margin: 0 auto 16px; }
#l2a .l2-slides img { position: absolute; inset: 0 0 18px; width: 100%; height: calc(100% - 18px); object-fit: contain; border-radius: 20px; opacity: 0; transition: opacity .5s; }
#l2a .l2-slides img.on { opacity: 1; }
#l2a .l2-slides .dots { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 6px; }
#l2a .l2-slides .dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: var(--l2-line); cursor: pointer; min-width: 0; }
#l2a .l2-slides .dots button.on { background: var(--l2-accent); width: 18px; border-radius: 4px; }

/* ===================== Светлая тема (Настройки → Внешний вид) ===================== */
html[data-l2theme="light"] {
  --l2-bg: #F5F6FA; --l2-card: #FFFFFF; --l2-card2: #EEF0F6; --l2-side: #FFFFFF; --l2-line: rgba(20,30,60,.10);
  --l2-text: #1E2235; --l2-muted: #6B7287; --l2-bubble-in: #FFFFFF; --l2-danger: #E5484D;
  --clr-background-blue-gray-300: #E3E6EE; --clr-bubble-left-bg-flash: #E3E6EE; --clr-blue-wash-light: #F0F2F7;
  --clr-bubble-timestamp-text: rgba(30,34,53,.55); --clr-bubble-meta-date-bg: rgba(255,255,255,.9);
}
html[data-l2theme="light"] body { color-scheme: light; }
html[data-l2theme="light"] body.l2-app .bubble { box-shadow: 0 1px 2px rgba(20,30,60,.10); }
html[data-l2theme="light"] .avatar-box .online { border-color: #fff; }
html[data-l2theme="light"] #l2a { background: radial-gradient(1200px 600px at 50% -10%, #DDF5EE 0%, var(--l2-bg) 55%); }
html[data-l2theme="light"] #l2a .card { box-shadow: 0 30px 80px rgba(20,30,60,.12), 0 0 0 1px var(--l2-line) inset; }
html[data-l2theme="light"] #l2a .back:hover { background: #E3E6EE; }
html[data-l2theme="light"] #l2a .foot { color: var(--l2-muted); }
html[data-l2theme="light"] #l2a .logo .tile, html[data-l2theme="light"] .l2-about .tile { background: linear-gradient(160deg, #1C3B34, #161A26); }
html[data-l2theme="light"] #l2-toast { background: #FFF1F2; color: #9F1239; border-color: rgba(229,72,77,.35); }
html[data-l2theme="light"] #l2-toast b { color: #7F1D1D; }
html[data-l2theme="light"] body.l2-app #app-container * { scrollbar-color: #C9CEDA transparent; }
html[data-l2theme="light"] body.l2-app #app-container ::-webkit-scrollbar-thumb { background: #C9CEDA; }
html[data-l2theme="light"] .l2-modal { background: rgba(20,30,60,.35); }
html[data-l2theme="light"] #l2-menu, html[data-l2theme="light"] .l2-sheet { box-shadow: 0 18px 50px rgba(20,30,60,.18); }
html[data-l2theme="light"] body.l2-app .contact-box .checkmark.material-icons, html[data-l2theme="light"] body.l2-app .contact-box .deleted.material-icons { background: #fff; }
/* Классы Tinode button.danger не должны красить наши строки */
.l2-srow.danger, .l2-srow.danger:hover:not([disabled]), .l2-srow.danger:active:not([disabled]) { background-color: transparent; }
.l2-srow.danger:hover:not([disabled]) { background-color: color-mix(in srgb, var(--l2-danger) 10%, transparent); }
#l2-menu button.danger, #l2-menu button.danger:active:not([disabled]) { background-color: transparent; }
#l2-menu button.danger:hover:not([disabled]) { background-color: color-mix(in srgb, var(--l2-danger) 10%, transparent); }
.l2-btn:focus-visible, .l2-srow:focus-visible, .l2-act:focus-visible { outline: 2px solid var(--l2-accent); outline-offset: 2px; }
.l2-btn:focus:not(:focus-visible) { outline: none; }
.l2-sheet button { border: 0; }

/* ===================== Сворачиваемая панель (ПК и планшет) ===================== */
#l2-head .hb.col svg { transition: transform .2s; }
#l2-head .hb.col.flip svg { transform: scaleX(-1); }
@media (min-width: 768px) {
  body.l2-app.l2-collapsed #sidepanel { width: 84px !important; min-width: 84px !important; max-width: 84px !important; }
  body.l2-collapsed #l2-head { flex-direction: column; padding: 14px 0 6px; gap: 10px; }
  body.l2-collapsed #l2-head .brand span, body.l2-collapsed #l2-head .hb:not(.col):not(.me) { display: none; }
  body.l2-collapsed #l2-head .brand { margin: 0; }
  body.l2-collapsed #l2-tabs { grid-template-columns: 1fr; margin: 6px 10px; }
  body.l2-collapsed #l2-tabs button span { display: none; }
  body.l2-collapsed #l2-tabs button { padding: 10px 0; }
  body.l2-collapsed #l2-tools, body.l2-collapsed #l2-banner, body.l2-collapsed #sidepanel > .info-box { display: none !important; }
  body.l2-collapsed .contact-box > li { margin: 2px 8px !important; padding: 8px 0 !important; justify-content: center; min-height: 58px !important; }
  body.l2-collapsed .contact-box > li .text-box, body.l2-collapsed .contact-box > li .menuTrigger { display: none !important; }
  body.l2-collapsed .contact-box > li::after { display: none !important; }
  body.l2-collapsed .contact-box .avatar-box { margin: 0 !important; }
  body.l2-collapsed .contact-box > li .unread { position: absolute; top: 4px; right: 6px; bottom: auto; min-width: 20px; height: 20px; line-height: 20px; font-size: 11px; padding: 0 5px; }
  /* в свёрнутом виде видны только чаты: прочие вкладки разворачивают панель (см. linia2.js) */
  body.l2-collapsed.l2-own #sidepanel > .l2-panel { display: none !important; }
}
/* ===================== Планшет: две колонки ===================== */
@media (min-width: 768px) and (max-width: 1100px) {
  body.l2-app #sidepanel { width: 320px; min-width: 300px; max-width: 46vw; }
  body.l2-app #info-view { position: absolute; right: 0; top: 0; bottom: 0; width: 360px; z-index: 5; box-shadow: -10px 0 40px rgba(0,0,0,.35); }
}
/* ===================== Телефон (< 768): один экран, нижнее меню, крупные цели ===================== */
@media (max-width: 767px) {
  #l2-head .hb.col { display: none; }
  body.l2-app #app-container, body.l2-app #mountPoint { height: var(--l2-vvh, 100%); }
  body.l2-app #sidepanel, body.l2-app #topic-view, body.l2-app #info-view { width: 100% !important; max-width: none !important; min-width: 0 !important; }
  #l2-head .hb { width: 44px; min-width: 44px; height: 44px; }
  #l2-head .hb.me { width: 44px; min-width: 44px; height: 44px; }
  #l2-head .hb.me .l2-ava { width: 44px !important; height: 44px !important; }
  body.l2-app #l2-tabs button { min-height: 52px; font-size: 12px; }
  #l2-tools .search, .l2-search .search { height: 48px; }
  #l2-tools .chip, .l2-panel .chip { padding: 11px 16px; font-size: 14px; }
  body.l2-app .contact-box > li { min-height: 72px; }
  ul.l2-list li { min-height: 64px; }
  .l2-srow { min-height: 52px; }
  .l2-back, .l2-ib, .l2-x { width: 44px; height: 44px; }
  body.l2-app #send-message-panel { min-height: 56px; }
  body.l2-app #send-message-panel > a { width: 44px; height: 44px; }
  body.l2-app #send-message-panel > a:last-of-type { width: 46px; height: 46px; }
  body.l2-app #send-message-input { font-size: 16px; } /* iOS не масштабирует страницу при фокусе */
  body.l2-app #topic-caption-panel > a:first-child { width: 44px; height: 44px; }
  body.l2-app #topic-caption-panel .material-icons { font-size: 24px; }
  .l2-sheet { border-radius: 22px 22px 0 0; margin-top: auto; max-width: none; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .l2-modal { align-items: flex-end; padding: 0; }
  .l2-react-btn { width: 36px; height: 36px; }
}
/* Переключатель (Push-уведомления) */
.l2-srow.switch .v { margin-left: auto; }
.l2-switch { width: 46px; height: 28px; border-radius: 14px; background: var(--l2-card2); position: relative; flex: none; transition: background .15s; box-shadow: 0 0 0 1px var(--l2-line) inset; }
.l2-switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.l2-switch.on { background: var(--l2-accent2); } .l2-switch.on::after { transform: translateX(18px); }
.l2-switch.off { opacity: .45; }
/* iPhone в режиме приложения (статус-бар поверх, вырез): отступы безопасной зоны */
@media (max-width: 767px) {
  #l2-head { padding-top: calc(14px + env(safe-area-inset-top)); }
  body.l2-app #topic-caption-panel { padding-top: calc(8px + env(safe-area-inset-top)); height: calc(64px + env(safe-area-inset-top)); }
  body.l2-app #info-view .caption-panel { padding-top: env(safe-area-inset-top); height: calc(64px + env(safe-area-inset-top)); }
  body.l2-app #send-message-wrapper { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  #l2a .card { padding-top: calc(72px + env(safe-area-inset-top)); }
}
#l2-head .brand { white-space: nowrap; }
.l2-srow .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.l2-srow .v { white-space: nowrap; }
@media (min-width: 768px) and (max-width: 1100px) {
  #l2-head { padding: 14px 10px 8px 14px; gap: 6px; }
  #l2-head .brand { font-size: 18px; gap: 8px; }
  #l2-head .hb { width: 36px; min-width: 36px; height: 36px; }
  #l2-head .hb.me, #l2-head .hb.me .l2-ava { width: 36px !important; min-width: 36px; height: 36px !important; }
}
@media (min-width: 768px) and (max-width: 1100px) {
  #l2-head .brand span { font-size: 17px; }
  #l2-head .hb, #l2-head .hb.me, #l2-head .hb.me .l2-ava { width: 40px !important; min-width: 40px; height: 40px !important; }
  #l2-head { gap: 4px; padding-left: 12px; padding-right: 8px; }
  .l2-srow .v { display: none; }
}

/* ===================== Соединение, исчезающие сообщения, экономия трафика, слабая связь в звонке ===================== */
#l2-conn { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 14px 6px; padding: 7px 12px; border-radius: 12px; background: var(--l2-card); color: var(--l2-muted);
  font: 600 13px Inter, system-ui, sans-serif; flex: none; }
#l2-conn .spin { width: 13px; height: 13px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--l2-accent) 30%, transparent); border-top-color: var(--l2-accent); animation: l2rot .8s linear infinite; }
#l2-conn.off { color: var(--l2-danger); }
#l2-conn.off .spin { display: none; }
body.l2-app #topic-last-seen[data-l2-net]:not([data-l2-net=""]) { font-size: 0 !important; }
body.l2-app #topic-last-seen[data-l2-net]:not([data-l2-net=""])::after { content: attr(data-l2-net); font: 500 12.5px Inter, system-ui, sans-serif; color: var(--l2-muted); }
body.l2-app #topic-title[data-l2-ttl]:not([data-l2-ttl=""])::after { content: attr(data-l2-ttl); margin-left: 8px; font: 600 11.5px Inter, system-ui, sans-serif; color: var(--l2-accent); background: var(--l2-accent-a15); padding: 2px 7px; border-radius: 999px; vertical-align: middle; }
body.l2-app ul.menu > li.l2-ttl-item { cursor: pointer; }
img.inline-image.l2-held { cursor: pointer; background: var(--l2-card2) no-repeat center / 40px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239AA0B4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' x2='12' y1='15' y2='3'/%3E%3C/svg%3E"); border-radius: 12px; }
#l2-weak { position: fixed; top: calc(14px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 100010; padding: 9px 16px; border-radius: 999px;
  background: rgba(30,34,48,.88); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); color: #FFD27A; font: 600 14px Inter, system-ui, sans-serif; box-shadow: 0 10px 30px rgba(0,0,0,.4); }

/* ===================== Экран звонка в стиле Линии 2.0 (CallPanel Tinode + наши элементы, linia2.js decorateCall) ===================== */
#video-container.l2-call:not(.minimized) { position: relative; background: radial-gradient(900px 520px at 50% 0%, #173A33 0%, #0A0E1B 62%) !important; color: #F2F2F7; overflow: hidden; }
#video-container.l2-call:not(.minimized) #video-container-panel { background: transparent !important; }
#video-container.l2-call > button.full-screen { display: none !important; }
.l2-call-head { position: absolute; left: 0; right: 0; top: 0; z-index: 5; display: flex; align-items: flex-start; justify-content: center; padding: calc(18px + env(safe-area-inset-top)) 16px 10px;
  pointer-events: none; text-align: center; }
#video-container.minimized .l2-call-head { display: none; }
.l2-call-head .who { display: flex; flex-direction: column; gap: 4px; max-width: calc(100% - 140px); text-shadow: 0 1px 8px rgba(0,0,0,.5); }
.l2-call-head .who b { font: 700 22px/1.2 Inter, system-ui, sans-serif; color: #F2F2F7; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.l2-call-head .who .st { font: 600 14px/1.3 Inter, system-ui, sans-serif; color: #7EE0C3; font-variant-numeric: tabular-nums; }
.l2-call-head.weak .who .st { color: #FFD27A; }
.l2-call-back { position: absolute; left: 12px; top: calc(14px + env(safe-area-inset-top)); pointer-events: auto; display: flex; align-items: center; gap: 4px; height: 38px; padding: 0 12px 0 8px;
  border: 0; border-radius: 19px; background: rgba(255,255,255,.1); color: #F2F2F7; font: 600 14px Inter, system-ui, sans-serif; cursor: pointer; margin: 0; min-width: 0; box-shadow: none; }
.l2-call-back:hover { background: rgba(255,255,255,.18); }
/* Собеседник без видео: крупный аватар с «дыханием» */
#video-container.l2-call:not(.minimized) .caller-card { display: flex; flex-direction: column; align-items: center; gap: 16px; background: transparent !important; box-shadow: none !important; }
#video-container.l2-call:not(.minimized) .caller-card .avatar-box { width: 140px; height: 140px; border-radius: 50%; box-shadow: 0 0 0 10px rgba(126,224,195,.10), 0 0 0 22px rgba(126,224,195,.05); }
#video-container.l2-call:not(.minimized) .caller-card .avatar-box .avatar-box, #video-container.l2-call:not(.minimized) .caller-card .avatar-box img,
#video-container.l2-call:not(.minimized) .caller-card .avatar-box .lettertile { width: 140px !important; height: 140px !important; border-radius: 50%; font-size: 52px; }
#video-container.l2-call:not(.minimized) .caller-card.pulse .avatar-box { animation: l2ring 1.6s ease-in-out infinite; }
@keyframes l2ring { 50% { box-shadow: 0 0 0 16px rgba(126,224,195,.16), 0 0 0 34px rgba(126,224,195,.06); } }
#video-container.l2-call:not(.minimized) .caller-card .caller-name { display: none; }
#video-container.l2-call:not(.minimized) .caller-name.inactive { background: rgba(0,0,0,.35); border-radius: 10px; padding: 2px 8px; font: 600 12px Inter, system-ui, sans-serif; }
#video-container.l2-call:not(.minimized) .call-party.self:not([disabled]) { border-radius: 18px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
#video-container.l2-call:not(.minimized) .call-party.peer video { object-fit: cover; }
/* Кнопки: круглые, с подписями, как на iPhone */
#video-container.l2-call:not(.minimized) #controls { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start;
  gap: 14px 18px; padding: 16px 16px calc(26px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(5,8,16,.65)); }
#video-container.l2-call #controls > button { position: relative; width: 62px; height: 62px; min-width: 0; margin: 0 0 20px; padding: 0; border: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.14); color: #F2F2F7; cursor: pointer; box-shadow: none; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); transition: background .15s, transform .12s; }
#video-container.l2-call #controls > button:hover:not([disabled]) { background: rgba(255,255,255,.22); }
#video-container.l2-call #controls > button:active { transform: scale(.94); }
#video-container.l2-call #controls > button[disabled] { opacity: .45; }
#video-container.l2-call #controls > button .material-icons { color: #F2F2F7 !important; font-size: 26px; }
#video-container.l2-call #controls > button.off { background: #F2F2F7; }
#video-container.l2-call #controls > button.off .material-icons { color: #0A0E1B !important; }
#video-container.l2-call #controls > button[data-l2r="end"] { background: #FF3B30; }
#video-container.l2-call #controls > button[data-l2r="end"]:hover { background: #FF5A50; }
#video-container.l2-call #controls > button::after { content: attr(data-label); position: absolute; top: 68px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  font: 500 12px Inter, system-ui, sans-serif; color: rgba(242,242,247,.85); pointer-events: none; }
#video-container.minimized #controls > button::after { display: none; }
#video-container.minimized #controls > button.l2-cb { display: none; }
#video-container.l2-call #controls > button[data-l2r="mic"] { order: 1; }
#video-container.l2-call #controls > .l2-cb.spk { order: 2; }
#video-container.l2-call #controls > button[data-l2r="cam"] { order: 3; }
#video-container.l2-call #controls > .l2-cb.sw { order: 4; }
#video-container.l2-call #controls > .l2-cb.chat { order: 5; }
#video-container.l2-call #controls > button[data-l2r="end"] { order: 6; }
#video-container.l2-call.minimized { border-radius: 18px; overflow: hidden; box-shadow: 0 14px 40px rgba(0,0,0,.5); }
/* Плашка «Идёт звонок 01:23» сверху, когда звонок свёрнут или открыт другой раздел */
#l2-callbar { position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 100003; display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 16px; border: 0; border-radius: 18px; background: #2FA987; color: #fff; font: 700 14px Inter, system-ui, sans-serif; cursor: pointer;
  box-shadow: 0 8px 24px rgba(47,169,135,.45); font-variant-numeric: tabular-nums; max-width: calc(100vw - 24px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; min-width: 0; }
#l2-callbar.weak { background: #C9851F; }
#l2-callbar .t { overflow: hidden; text-overflow: ellipsis; }
#l2-callbar svg { animation: l2fade 1s ease-in-out infinite alternate; flex: none; }
/* Телефон: пока идёт звонок, окно чата звонка остаётся (скрыто), когда открыт список или другой раздел */
@media (max-width: 767px) {
  body.l2-app:not(.l2-topic-open) #app-container:has(#sidepanel) #topic-view { display: none !important; }
}

/* ===================== Паритет с iOS: «Звонки» и «Контакты» (Linia2Calls.swift, Linia2Contacts.swift) ===================== */
.l2-ptitle h2 { flex: 1; min-width: 0; }
.l2-ptitle.bare { padding-bottom: 0; }
.l2-cbtn { width: 42px; height: 42px; min-width: 0; margin: 0; padding: 0; border: 0; border-radius: 50%; background: var(--l2-card); color: var(--l2-accent); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; flex: none; box-shadow: none; transition: background .12s, transform .12s; }
.l2-cbtn:hover:not([disabled]) { background: var(--l2-card2); color: var(--l2-accent); transform: translateY(-1px); }
.l2-cbtn:focus-visible, .l2-info:focus-visible, ul.l2-list li:focus-visible, .l2-wbtn:focus-visible { outline: 2px solid var(--l2-accent); outline-offset: 2px; }
/* журнал звонков */
ul.l2-calllist li { gap: 14px; padding: 10px 6px 10px 12px; }
ul.l2-calllist li .mid b { font-size: 16px; }
ul.l2-calllist small.kind { gap: 7px; font-size: 14px; margin-top: 4px; }
ul.l2-calllist small.kind span { overflow: hidden; text-overflow: ellipsis; }
ul.l2-calllist li.out small.kind svg { color: #2FD1A2; }
ul.l2-calllist li.inc small.kind svg { color: var(--l2-accent); }
ul.l2-calllist li.vid small.kind svg { color: var(--l2-text); }
ul.l2-calllist li.missed small.kind, ul.l2-calllist li.missed small.kind svg, ul.l2-calllist li.declined small.kind svg { color: var(--l2-danger); }
ul.l2-calllist .tm { color: var(--l2-muted); font-size: 13.5px; white-space: nowrap; align-self: flex-start; margin-top: 6px; }
ul.l2-calllist .cacts { display: none; gap: 6px; }
.l2-info { width: 40px; height: 40px; min-width: 0; margin: 0; padding: 0; border: 0; border-radius: 12px; background: transparent; color: var(--l2-text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; flex: none; box-shadow: none; }
.l2-info:hover:not([disabled]) { background: var(--l2-card2); color: var(--l2-accent); }
@media (hover: hover) and (pointer: fine) {
  ul.l2-calllist li:hover .tm, ul.l2-calllist li:focus-within .tm { display: none; }
  ul.l2-calllist li:hover .cacts, ul.l2-calllist li:focus-within .cacts { display: inline-flex; }
}
#l2-calls-links:empty { display: none; }
/* «Новый звонок» */
.l2-sheet.l2-picker { max-width: 420px; }
.l2-sheet.l2-picker .l2-search { padding: 8px 0 4px; }
.l2-sheet.l2-picker ul.l2-list { max-height: min(52vh, 440px); overflow-y: auto; margin: 4px -12px 0; }
.l2-sheet.l2-picker ul.l2-list li { margin: 1px 4px; }
.l2-sheet.l2-picker ul.l2-list li:hover { background: var(--l2-card2); }
.l2-empty.sm { padding: 24px 12px 8px; }
.l2-empty .l2-btn.primary { margin-top: 18px; }
/* контакты: буквы-разделы, аватар с точкой «в сети» */
.l2-letter { padding: 12px 22px 4px; color: var(--l2-accent); font: 800 15px Inter, system-ui, sans-serif; }
ul.l2-people li { gap: 14px; }
ul.l2-people b { font-size: 16px; }
ul.l2-people small { font-size: 14px; }
.l2-avw { position: relative; display: inline-flex; flex: none; }
.l2-odot { position: absolute; right: 0; bottom: 0; width: 15px; height: 15px; border-radius: 50%; background: var(--l2-online); box-shadow: 0 0 0 2.5px var(--l2-side); }
.l2-panel .l2-found { min-height: 10px; }
/* карточка контакта */
.l2-ccard { padding: 4px 20px 24px; display: flex; flex-direction: column; gap: 28px; }
.l2-ccard .l2-card-head { padding: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.l2-ccard .l2-card-head .l2-avw { margin-bottom: 12px; }
.l2-ccard .l2-card-head .l2-ava { margin: 0; }
.l2-ccard .l2-odot { width: 26px; height: 26px; right: 4px; bottom: 4px; box-shadow: 0 0 0 4px var(--l2-side); }
.l2-ccard h3 { margin: 0; font: 800 26px/1.2 Inter, system-ui, sans-serif; text-align: center; overflow-wrap: anywhere; }
.l2-ccard .l2-card-head p { margin: 0; color: var(--l2-muted); font-size: 15px; }
.l2-ccard .l2-card-head p.login { color: var(--l2-accent); font-weight: 600; font-size: 16px; }
.l2-ccard .l2-card-head p.on { color: var(--l2-online); }
.l2-ccard .l2-actions { gap: 12px; }
.l2-ccard .l2-act { min-height: 76px; justify-content: center; font: 600 14px Inter, system-ui, sans-serif; cursor: pointer; background: var(--l2-card); }
.l2-ccard .l2-act:hover:not([disabled]) { background: var(--l2-accent-a15); }
.l2-mod { display: flex; flex-direction: column; gap: 12px; }
.l2-wbtn { width: 100%; height: 52px; margin: 0; border: 0; border-radius: var(--l2-r-button, 16px); display: flex; align-items: center; justify-content: center; gap: 10px;
  font: 600 16px Inter, system-ui, sans-serif; cursor: pointer; text-transform: none; box-shadow: none; }
.l2-wbtn.secondary { background: var(--l2-card); color: var(--l2-text); }
.l2-wbtn.secondary:hover:not([disabled]) { background: var(--l2-card2); color: var(--l2-text); }
.l2-wbtn.destructive { background: color-mix(in srgb, var(--l2-danger) 14%, transparent); color: var(--l2-danger); }
.l2-wbtn.destructive:hover:not([disabled]) { background: color-mix(in srgb, var(--l2-danger) 22%, transparent); color: var(--l2-danger); }
@media (max-width: 767px) {
  .l2-cbtn { width: 44px; height: 44px; }
  .l2-info { width: 44px; height: 44px; }
  ul.l2-calllist li, ul.l2-people li { min-height: 72px; margin: 0 4px; }
  .l2-ccard { gap: 24px; }
}
/* шапка чата: «Позвонить» */
#topic-caption-panel .l2-hcall { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: var(--l2-text); flex: none; margin-right: 2px; }
#topic-caption-panel .l2-hcall:hover { background: var(--l2-card2); color: var(--l2-accent); }
#app-container ul.menu li.l2-rep-item { color: var(--l2-danger); }
@media (max-width: 767px) { #topic-caption-panel .l2-hcall { width: 44px; height: 44px; } }
/* ===================== Входящий звонок в стиле Линии 2.0 ===================== */
body.l2-app .alert-container > div.incoming-call.l2-inc { width: min(360px, calc(100vw - 32px)); padding: 32px 24px 26px; border-radius: 28px; display: flex; flex-direction: column; align-items: center; gap: 0;
  background: radial-gradient(420px 260px at 50% 0%, color-mix(in srgb, var(--l2-accent) 16%, var(--l2-card)) 0%, var(--l2-card) 70%); box-shadow: 0 30px 80px rgba(0,0,0,.55); }
.incoming-call.l2-inc .caller-card { margin: 0 0 18px; }
.incoming-call.l2-inc .caller-name { display: none; }
.incoming-call.l2-inc .l2-inc-head { text-align: center; margin-bottom: 26px; font-family: Inter, system-ui, sans-serif; }
.incoming-call.l2-inc .l2-inc-head b { display: block; font: 800 22px/1.25 Inter, system-ui, sans-serif; color: var(--l2-text); overflow-wrap: anywhere; }
.incoming-call.l2-inc .l2-inc-head span { display: block; margin-top: 6px; font-size: 15px; color: var(--l2-accent); overflow-wrap: anywhere; }
.incoming-call.l2-inc #controls { display: flex; gap: 56px; justify-content: center; padding-bottom: 22px; }
.incoming-call.l2-inc #controls > button { position: relative; width: 68px; height: 68px; border-radius: 50%; border: 0; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.incoming-call.l2-inc #controls > button.danger { background: #FF3B30; color: #fff; }
.incoming-call.l2-inc #controls > button.positive { background: #34C759; color: #fff; animation: l2ring 1.4s ease-in-out infinite; }
.incoming-call.l2-inc #controls > button .material-icons { color: #fff; width: 30px; height: 30px; font-size: 30px; background-color: #fff; }
.incoming-call.l2-inc #controls > button::after { content: attr(data-label); position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  font: 600 13px Inter, system-ui, sans-serif; color: var(--l2-text); }
@keyframes l2ring { 0%, 100% { box-shadow: 0 0 0 0 rgba(52,199,89,.55); } 50% { box-shadow: 0 0 0 14px rgba(52,199,89,0); } }
@media (max-width: 767px) {
  body.l2-app .alert-container > div.incoming-call.l2-inc { width: 100vw; height: var(--l2-vvh, 100vh); max-width: none; border-radius: 0; justify-content: center; padding: 40px 24px calc(48px + env(safe-area-inset-bottom)); }
  .incoming-call.l2-inc .caller-card { margin-top: auto; }
  .incoming-call.l2-inc #controls { margin-top: auto; gap: 88px; }
  .incoming-call.l2-inc #controls > button { width: 76px; height: 76px; }
}
@media (prefers-reduced-motion: reduce) { .incoming-call.l2-inc #controls > button.positive { animation: none; } }
/* входящий: свои отступы вместо padding/absolute из base.css */
.incoming-call.l2-inc .caller-card { padding: 0 !important; height: auto !important; }
.incoming-call.l2-inc #controls { position: static !important; bottom: auto; }
.incoming-call.l2-inc #controls > button::after { text-transform: none; letter-spacing: 0; }
/* экран звонка: на всю область чата (как на телефоне), а не полосой под перепиской */
#video-container.l2-call:not(.minimized) { position: absolute !important; inset: 0 !important; width: auto !important; height: auto !important; z-index: 6; }
#video-container.l2-call #controls > button::after { text-transform: none; letter-spacing: 0; }
/* видео как на телефоне: собеседник на весь экран, своё — маленькое окно справа сверху */
#video-container.l2-call:not(.minimized) .call-party.peer { inset: 0 !important; border: 0 !important; border-radius: 0 !important; }
#video-container.l2-call:not(.minimized) .call-party.self { top: calc(88px + env(safe-area-inset-top)); right: 16px; bottom: auto; width: 132px; height: 176px; border: 2px solid rgba(255,255,255,.18); }
#video-container.l2-call:not(.minimized) .call-party.self video { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 767px) { #video-container.l2-call:not(.minimized) .call-party.self { width: 104px; height: 140px; right: 12px; } }
/* ===================== Удаление как в Telegram, автоудаление, строки звонков (CONTRACTS.md 2026-11-26) ===================== */
.l2-check { display: flex; align-items: center; gap: 12px; margin: 4px 0 18px; cursor: pointer; font: 500 15px/1.35 Inter, system-ui, sans-serif; color: var(--l2-text); user-select: none; }
.l2-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.l2-check .box { width: 22px; height: 22px; flex: none; border-radius: 7px; border: 2px solid var(--l2-muted); display: inline-flex; align-items: center; justify-content: center; color: transparent; transition: .12s; }
.l2-check input:checked + .box { background: var(--l2-accent); border-color: var(--l2-accent); color: var(--l2-on-accent); }
.l2-check input:focus-visible + .box { outline: 2px solid var(--l2-accent); outline-offset: 2px; }
.l2-sheet.l2-delsheet .l2-note { margin: -8px 0 16px; font-size: 13px; color: var(--l2-muted); }
/* системная строка (автоудаление) по центру */
body.l2-app #scroller > li[data-l2-sys] { display: flex !important; justify-content: center; }
body.l2-app #scroller > li[data-l2-sys] > :not(.l2-sysline) { display: none !important; }
.l2-sysline { margin: 8px auto; max-width: 86%; padding: 5px 12px; border-radius: 999px; background: var(--l2-card); color: var(--l2-muted); font: 500 12.5px/1.4 Inter, system-ui, sans-serif; text-align: center; }
/* значок ⏱ под именем в шапке */
body.l2-app #topic-last-seen[data-l2-ad]:not([data-l2-ad=""])::before { content: attr(data-l2-ad) " · "; color: var(--l2-accent); font-weight: 600; }
body.l2-app ul.menu > li[data-l2-gone] { display: none !important; }
/* выделение сообщений */
body.l2-selecting #scroller > li:not(.meta) { cursor: pointer; }
body.l2-selecting #scroller > li[data-l2-sel] { background: var(--l2-accent-a15); border-radius: 12px; }
body.l2-selecting #scroller > li[data-l2-sel] .bubble { box-shadow: 0 0 0 2px var(--l2-accent); }
body.l2-selecting #scroller .l2-react-btn, body.l2-selecting #scroller .menuTrigger { display: none !important; }
#l2-selbar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 7; display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--l2-side); border-top: 1px solid var(--l2-line); font: 600 15px Inter, system-ui, sans-serif; color: var(--l2-text); }
#l2-selbar .n { flex: 1; }
#l2-selbar .l2-btn.danger { display: inline-flex; align-items: center; gap: 8px; }
/* строки звонков: иконка 16 + 6 px + текст */
.l2-callrow, .l2-ccall { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; white-space: nowrap; }
.l2-callrow svg, .l2-ccall svg { width: 16px; height: 16px; flex: none; }
.l2-callrow span, .l2-ccall span { overflow: hidden; text-overflow: ellipsis; }
.l2-callrow.missed, .l2-ccall.missed { color: var(--l2-danger); }
.l2-callrow.out svg, .l2-ccall.out svg { color: #2FD1A2; } .l2-callrow.inc svg, .l2-ccall.inc svg, .l2-callrow.guest svg, .l2-ccall.guest svg { color: var(--l2-accent); }
.l2-callrow.declined svg, .l2-ccall.declined svg { color: var(--l2-danger); }
body.l2-app .call-message.l2-cm { display: flex !important; align-items: center; padding: 2px 0; }
body.l2-app .call-message.l2-cm > :not(.l2-callrow) { display: none !important; }
body.l2-app .call-message.l2-cm .l2-callrow { font: 500 14.5px/1.35 Inter, system-ui, sans-serif; }
.right .call-message.l2-cm .l2-callrow:not(.missed), .right .call-message.l2-cm .l2-callrow svg { color: var(--l2-on-bubble-out) !important; }
body.l2-app .contact-comment.l2-cc-call { display: flex; align-items: center; min-width: 0; }
body.l2-app .contact-comment.l2-cc-call > :not(.l2-ccall) { display: none !important; }
ul.l2-calllist small.kind svg { width: 16px; height: 16px; } ul.l2-calllist small.kind { gap: 6px; }

/* Контакты: глобальный поиск */
ul.l2-global li .gacts { display: inline-flex; gap: 6px; flex: none; }
ul.l2-global li .gacts .l2-ib { width: 36px; height: 36px; color: var(--l2-accent); }
@media (max-width: 767px) { ul.l2-global li .gacts .l2-ib { width: 40px; height: 40px; } ul.l2-global li .gacts { gap: 4px; } }

/* ===================== L2_MEDIA (2026-11-26): соединение, повтор отправки, вставка/перетаскивание ===================== */
/* «Подключение…» — жёлтая, «Нет соединения» (дольше 10 с) — красная */
#l2-conn { background: rgba(245, 196, 81, .14); color: #F5C451; }
#l2-conn .spin { border-color: rgba(245, 196, 81, .3); border-top-color: #F5C451; }
#l2-conn.off { background: color-mix(in srgb, var(--l2-danger) 16%, transparent); color: var(--l2-danger); }
body.l2-app #topic-last-seen[data-l2-net]:not([data-l2-net=""])::after { color: #F5C451; }
/* Неотправленное сообщение */
.l2-retry { display: block; margin: 4px 0 2px auto; padding: 4px 10px; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--l2-danger) 16%, transparent);
  color: var(--l2-danger); font: 600 12.5px Inter, system-ui, sans-serif; cursor: pointer; height: auto; min-width: 0; box-shadow: none; text-transform: none; }
.l2-retry:hover { background: color-mix(in srgb, var(--l2-danger) 26%, transparent); }
.l2-retry[disabled] { opacity: .5; cursor: default; }
/* Превью вставленных/перетащенных файлов над полем ввода */
#l2-paste { flex: none; margin: 0 10px 6px; padding: 10px; border-radius: var(--l2-r-card, 16px); background: var(--l2-card); box-shadow: 0 6px 24px rgba(0, 0, 0, .25); }
#l2-paste .items { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; }
#l2-paste .it { position: relative; flex: none; width: 96px; height: 96px; border-radius: 12px; overflow: hidden; background: var(--l2-card2); }
#l2-paste .it img, #l2-paste .it video { width: 100%; height: 100%; object-fit: cover; display: block; }
#l2-paste .it.file { width: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px; box-sizing: border-box; color: var(--l2-muted); }
#l2-paste .it.file .nm { font: 500 12px Inter, system-ui, sans-serif; color: var(--l2-text); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
#l2-paste .it .x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; min-width: 0; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: none; }
#l2-paste .row { display: flex; gap: 8px; align-items: center; }
#l2-paste .cap { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border: 1.5px solid var(--l2-line); border-radius: var(--l2-r-input, 18px); background: var(--l2-card2); color: var(--l2-text);
  font: 400 14.5px Inter, system-ui, sans-serif; outline: 0; box-sizing: border-box; }
#l2-paste .cap:focus { border-color: var(--l2-accent); }
#l2-paste .l2-btn { height: 38px; padding: 0 14px; }
#l2-paste .l2-btn.send { background: var(--l2-accent); color: var(--l2-on-accent); }
/* Быстрая отправка картинки: окно предпросмотра Tinode не показываем */
html.l2-qsend #image-preview { visibility: hidden !important; }

/* Время и отметки своего сообщения — на тёмной «пилюле», чтобы ✓✓ читались на зелёном пузыре */
body.l2-app .chat-box .right .bubble .timestamp { background: #00000040 !important; border-radius: 10px !important; padding: 1px 6px 1px 7px !important;
  display: inline-flex !important; align-items: center !important; gap: 3px !important; color: #EAF2EF !important; line-height: 16px !important; }
body.l2-app .chat-box .right .bubble .timestamp .material-icons[data-l2i="done"],
body.l2-app .chat-box .right .bubble .timestamp .material-icons[data-l2i="done_all"] { font-size: 17px !important; width: 17px !important; height: 17px !important; vertical-align: middle !important; }
body.l2-app .chat-box .right .bubble .timestamp .material-icons svg { width: 17px !important; height: 17px !important; stroke-width: 2.4 !important; }
body.l2-app .chat-box .right .bubble .timestamp .material-icons[data-l2i="done"],
body.l2-app .chat-box .right .bubble .timestamp .material-icons[data-l2i="done_all"]:not(.blue) { color: #D6DBE3 !important; filter: none !important; }
body.l2-app .chat-box .right .bubble .timestamp .material-icons[data-l2i="done_all"].blue { color: var(--l2-read, #FF1F3D) !important; filter: none !important; }

/* Пилюля времени: без общей прозрачности (иначе красный тускнеет); галочки толще — обводка тем же цветом */
body.l2-app .chat-box .right .bubble .timestamp { opacity: 1 !important; }
body.l2-app .chat-box .right .bubble .timestamp .material-icons[data-l2i="done"],
body.l2-app .chat-box .right .bubble .timestamp .material-icons[data-l2i="done_all"] {
  filter: drop-shadow(0.45px 0 0 currentColor) drop-shadow(-0.45px 0 0 currentColor) drop-shadow(0 0.45px 0 currentColor) !important; }

/* L2_RECEIPTS: подсказка «Отправлено · Доставлено · Прочитано» и окно «Информация» */
#scroller li.right .timestamp i.material-icons { cursor: help; }
#l2-rctip { position: fixed; z-index: 100006; min-width: min(240px, calc(100vw - 16px)); max-width: min(340px, calc(100vw - 16px)); max-height: 60vh; overflow-y: auto; padding: 8px 12px;
  background: var(--l2-card2); color: var(--l2-text); border: 1px solid var(--l2-line); border-radius: 12px; box-shadow: 0 12px 36px rgba(0,0,0,.35);
  font: 13px/1.4 Inter, system-ui, sans-serif; pointer-events: none; animation: l2fade .12s ease; }
.l2-rc .ln { white-space: normal; }
.l2-rc .ln.h { margin-top: 8px; color: var(--l2-muted); font-size: 12px; font-weight: 600; }
.l2-rc .ln.wait, .l2-rc .ln.more { color: var(--l2-muted); }
.l2-rc .who { display: flex; align-items: center; gap: 8px; margin-top: 4px; min-width: 0; }
.l2-rc .who .l2-ava { flex: none; }
.l2-rc .who .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.l2-rc .who .tm { flex: none; color: var(--l2-muted); font-variant-numeric: tabular-nums; }
.l2-rc-sheet { margin: 4px 0 16px; font-size: 14px; max-height: 55vh; overflow-y: auto; }
.l2-rc-sheet .l2-rc .who .l2-ava { width: 28px !important; height: 28px !important; }
/* L2_MIC_GATE: экран разрешения микрофона, индикатор уровня, плашка «Вас не слышно» */
.l2-sheet .l2-btn.l2-big { font-size: 16px; padding: 12px 22px; flex: 1; }
.l2-sheet .l2-meter { height: 12px; border-radius: 6px; background: rgba(255,255,255,.12); overflow: hidden; margin: 6px 0 14px; }
.l2-sheet .l2-meter i { display: block; height: 100%; width: 0; background: #7EE0C3; transition: width .06s linear; }
.l2-sheet .l2-micsel { width: 100%; margin: 0 0 14px; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.08); color: inherit; border: 1px solid rgba(255,255,255,.18); }
#video-container .l2-nomic { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); z-index: 5; max-width: 92%; padding: 10px 16px; border-radius: 12px; background: #8A1F2B; color: #fff; font: 600 14px Inter, system-ui, sans-serif; text-align: center; box-shadow: 0 4px 16px rgba(0,0,0,.35); }
#controls.l2-repaired > button[data-l2r="mic"] { display: none !important; }

/* ===== L2_NEXT (2026-11-26): шапка чата 📞 📹 ⏱ ⋮, кружочки, самоуничтожение, «‹ Назад» на телефоне ===== */
html.l2-hacts #topic-caption-panel .l2-hcall { display: none !important; }
#l2-hacts { display: inline-flex; align-items: center; gap: 2px; flex: none; margin-right: 2px; }
#l2-hacts .l2-hbtn { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: var(--l2-text); }
#l2-hacts .l2-hbtn[hidden] { display: none; }
#l2-hacts .l2-hbtn:hover { background: var(--l2-card2); color: var(--l2-accent); }
#l2-hacts #l2-hburn.on, #l2-hacts #l2-hburn.on:hover { color: var(--l2-danger, #FF5A5F); background: rgba(255, 90, 95, .14); }
@media (max-width: 767px) { #l2-hacts .l2-hbtn { width: 40px; height: 44px; } }
@media (max-width: 380px) { #l2-hacts .l2-hbtn { width: 36px; } }
/* Подпись «Исчезающие сообщения: 20 с после прочтения» над полем ввода */
#l2-burnbar { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0 auto 6px; padding: 3px 10px; color: var(--l2-danger, #FF5A5F); font: 600 12.5px/1.3 Inter, system-ui, sans-serif; }
#l2-burnbar svg { flex: none; }
/* Значок ⏱ и отсчёт 0:20 у исчезающих сообщений */
.l2-burnb { position: absolute; bottom: 4px; display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; color: var(--l2-danger, #FF5A5F); font: 600 11px/1 Inter, system-ui, sans-serif; }
body.l2-app #scroller li .l2-bwrap:has(> .l2-burnb), body.l2-app #scroller li .bubble:has(+ .l2-burnb) { position: relative; }
#scroller li.right .l2-burnb { right: calc(100% + 4px); }
#scroller li.left .l2-burnb { left: calc(100% + 4px); }
body.l2-app #scroller > li[data-l2-burned] { animation: l2burnOut .45s ease forwards; overflow: hidden; pointer-events: none; }
@keyframes l2burnOut { 0% { opacity: 1; max-height: 400px; } 60% { opacity: 0; max-height: 400px; filter: blur(2px); } 100% { opacity: 0; max-height: 0; margin: 0; padding: 0; } }
.l2-burnb { font-variant-numeric: tabular-nums; opacity: .75; }
.l2-burnb.run { opacity: 1; }
.l2-burn-secs { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.l2-burn-secs button { flex: 1 0 auto; min-width: 56px; padding: 9px 12px; border: 0; border-radius: 12px; background: var(--l2-card2); color: var(--l2-text); font: 600 14px Inter, system-ui, sans-serif; cursor: pointer; }
.l2-burn-secs button.on { background: var(--l2-danger, #FF5A5F); color: #fff; }
.l2-burnsheet .l2-burn-scope button.on { box-shadow: inset 0 0 0 2px var(--l2-danger, #FF5A5F); }
/* Системная строка переключателя самоуничтожения — как у автоудаления */
body.l2-app #scroller > li[data-l2-sys2] { display: flex !important; justify-content: center; }
body.l2-app #scroller > li[data-l2-sys2] > :not(.l2-sysline) { display: none !important; }
/* Кнопка 🎤/📹 в строке ввода (штатная кнопка Tinode прячется, но остаётся для голосовых) */
#send-message-panel > a[data-l2-rvhide] { display: none !important; }
#send-message-panel > .l2-rvbtn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%;
  background: var(--l2-accent); color: var(--l2-on); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: pointer; }
#send-message-panel > .l2-rvbtn .ic-vid, #send-message-panel > .l2-rvbtn[data-mode=video] .ic-mic { display: none; }
#send-message-panel > .l2-rvbtn[data-mode=video] .ic-vid { display: inline-flex; }
#send-message-panel > .l2-rvbtn span { display: inline-flex; animation: l2rvSwap .18s ease; }
@keyframes l2rvSwap { from { transform: scale(.6); opacity: .3; } to { transform: none; opacity: 1; } }
/* Окно записи кружка */
#l2-rvrec { position: fixed; inset: 0; z-index: 9000; background: rgba(6, 9, 18, .78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: #fff; font: 500 14px/1.4 Inter, system-ui, sans-serif; pointer-events: none; }
#l2-rvrec .ring { position: relative; width: min(72vw, 300px); height: min(72vw, 300px); }
#l2-rvrec .ring svg { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); transform: rotate(-90deg); }
#l2-rvrec .ring circle { fill: none; stroke-width: 2.4; }
#l2-rvrec .ring .bg { stroke: rgba(255, 255, 255, .18); }
#l2-rvrec .ring .pr { stroke: var(--l2-accent); stroke-dasharray: 100; stroke-dashoffset: 100; stroke-linecap: round; transition: stroke-dashoffset .2s linear; }
#l2-rvrec .cam { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; background: #000; }
#l2-rvrec .cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
#l2-rvrec .tm { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; font-weight: 600; }
#l2-rvrec .tm .dot { width: 9px; height: 9px; border-radius: 50%; background: #FF5A5F; animation: l2rvBlink 1s infinite; }
@keyframes l2rvBlink { 50% { opacity: .25; } }
#l2-rvrec .hint { color: rgba(255, 255, 255, .8); font-size: 13px; text-align: center; padding: 0 16px; }
#l2-rvrec .note:empty { display: none; }
#l2-rvrec .note { color: var(--l2-accent); font-size: 13px; }
#l2-rvrec.cancel .ring { opacity: .45; }
#l2-rvrec.cancel .hint { color: #FF8A8E; }
/* Кружок в ленте: без пузыря, круг ~220 px */
body.l2-app #scroller > li[data-l2-round] .bubble { background: transparent !important; box-shadow: none !important; padding: 0 !important; border: 0 !important; }
body.l2-app #scroller > li[data-l2-round] .bubble .message-content > :not(.l2-round) { display: none !important; }
body.l2-app #scroller > li[data-l2-round] .bubble > :not(.l2-round):not(.l2-reacts) { display: none !important; }
.l2-round { position: relative; width: min(220px, 58vw); height: min(220px, 58vw); border-radius: 50%; overflow: visible; cursor: pointer; flex: none; }
.l2-round video { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; background: #000; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.l2-round.sound video { box-shadow: 0 0 0 3px var(--l2-accent); }
.l2-round .snd { position: absolute; right: 12%; bottom: 6%; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .55); color: #fff; }
.l2-round.sound .snd { background: var(--l2-accent); color: var(--l2-on); }
.l2-round .dur, .l2-round .ttl { position: absolute; left: 50%; transform: translateX(-50%); padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff;
  font: 600 11px/1.4 Inter, system-ui, sans-serif; white-space: nowrap; pointer-events: none; }
.l2-round .dur { top: 6%; }
.l2-round .ttl { bottom: -22px; background: transparent; color: var(--l2-muted); font-weight: 500; }
.l2-round .dur:empty, .l2-round .ttl:empty { display: none; }
body.l2-app #scroller > li[data-l2-round] { padding-bottom: 18px; }
/* Телефон: «‹ Назад» вместо стрелки */
@media (max-width: 640px) {
  body.l2-app #topic-caption-panel > #hide-message-view { width: auto !important; min-width: 44px; padding: 0 6px 0 0; gap: 0; color: var(--l2-accent); flex: none; }
  body.l2-app #topic-caption-panel > #hide-message-view i.material-icons { width: 24px; height: 24px;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E"); }
  body.l2-app #topic-caption-panel > #hide-message-view::after { content: "Назад"; font: 500 16px/1 Inter, system-ui, sans-serif; margin-left: -2px; }
  body.l2-app #topic-caption-panel .avatar-box { width: 38px; min-width: 38px; height: 38px; margin-right: 10px; }
}
/* ===== /L2_NEXT ===== */
/* L2_CALL_CTRL: свои кнопки микрофона/камеры вместо кнопок Tinode (те неактивны до ответа) */
#controls.l2-own > button[data-l2r="mic"], #controls.l2-own > button[data-l2r="cam"] { display: none !important; }
#controls > button.l2-cb.off { background: #C62F3E !important; color: #fff !important; }
/* Подсказка вместо «Динамика» в мобильных браузерах без выбора вывода звука */
#video-container .l2-spkhint { position: absolute; left: 50%; bottom: 112px; transform: translateX(-50%); z-index: 5; width: max-content; max-width: 88%; padding: 8px 14px; border-radius: 12px; background: rgba(0,0,0,.55); color: #EAF2EF; font: 500 13px Inter, system-ui, sans-serif; text-align: center; }
#video-container.minimized .l2-spkhint { display: none; }

/* ===== L2_MOBMENU (2026-11-26): меню сообщения на телефоне — шторка снизу (реакции + действия), как в Telegram ===== */
@media (max-width: 640px), (hover: none) and (pointer: coarse) and (max-width: 900px) {
  #l2-mm { background: rgba(5,8,16,.45); touch-action: none; }
  #l2-mm .box { left: 8px !important; right: 8px !important; top: auto !important; bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    width: auto; max-width: none; align-items: stretch; transform-origin: bottom center; animation: l2mmup .2s cubic-bezier(.2,.9,.3,1); max-height: calc(100% - 24px); overflow-y: auto; }
  #l2-mm .rbar { align-self: center; max-width: 100%; }
  #l2-mm .rpanel { width: auto; }
  #l2-mm .acts { min-width: 0; width: auto; border-radius: 18px; }
  #l2-mm .acts button { padding: 13px 16px; font-size: 16px; min-height: 48px; }
}
@keyframes l2mmup { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
/* ===== /L2_MOBMENU ===== */

/* ===== L2_MOBFIX (2026-11-26): найдено мобильным e2e ===== */
@media (max-width: 767px) {
  #video-container .l2-spkhint { top: calc(env(safe-area-inset-top) + 96px); bottom: auto; }
}
#send-message-panel:has(> .audio) > .l2-rvbtn { order: 99; margin-left: 6px; }
/* ===== /L2_MOBFIX ===== */

/* ===== L2_WEB4 (2026-11-26): уведомление о сообщении в другом чате (как баннер iOS) ===== */
#l2-msgtoast { position: fixed; top: 16px; right: 16px; z-index: 100002; width: min(380px, calc(100vw - 32px)); box-sizing: border-box;
  display: flex; align-items: center; gap: 12px; padding: 12px 10px 12px 12px; border-radius: 18px; cursor: pointer;
  background: color-mix(in srgb, var(--l2-card) 94%, transparent); color: var(--l2-text); border: 1px solid var(--l2-line);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 18px 50px rgba(0,0,0,.45);
  font: 500 14px/1.35 Inter, system-ui, sans-serif; opacity: 0; transform: translateY(-12px); transition: opacity .2s ease, transform .22s cubic-bezier(.2,.9,.3,1); }
#l2-msgtoast.on { opacity: 1; transform: none; }
#l2-msgtoast[hidden] { display: none; }
#l2-msgtoast:focus-visible { outline: 2px solid var(--l2-accent); outline-offset: 2px; }
#l2-msgtoast .av { flex: none; display: flex; }
#l2-msgtoast .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#l2-msgtoast .tx b { font-weight: 700; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--l2-text); }
#l2-msgtoast .tx span { color: var(--l2-muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
#l2-msgtoast .x { flex: none; width: 30px; height: 30px; min-width: 0; padding: 0; margin: 0; border: 0; border-radius: 10px; background: transparent !important; box-shadow: none !important; color: var(--l2-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
#l2-msgtoast .x:hover { background: var(--l2-card2) !important; color: var(--l2-text); }
@media (max-width: 640px) {
  #l2-msgtoast { top: calc(8px + env(safe-area-inset-top)); left: 8px; right: 8px; width: auto; }
}
/* ===== /L2_WEB4 ===== */

/* ===== L2_CHATUI (2026-11-26): экран чата как в Telegram (паритет iOS next3 Linia2ChatChrome.swift) ===== */
.l2-glass { background: color-mix(in srgb, var(--l2-card) 80%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 2px 10px rgba(0,0,0,.28), inset 0 0 0 1px rgba(255,255,255,.06); border-radius: 999px; }
/* один фон: узор-пульс на всю высоту, шапка и строка ввода — прозрачные (без полос) */
html.l2-chatui body.l2-app #topic-view { background-color: var(--l2-bg); background-image: var(--l2-chat-pattern, none); background-repeat: repeat; background-size: 240px 150px; }
html.l2-chatui body.l2-app #messages-container::before { background: transparent !important; }
html.l2-chatui body.l2-app #topic-view { isolation: isolate; } /* пилюли (z-index) — не поверх окон Tinode (пересылка, меню) */
html.l2-chatui body.l2-app #messages-container, html.l2-chatui body.l2-app #messages-panel { background: transparent !important; }

/* --- шапка: плавающие пилюли --- */
html.l2-chatui-head body.l2-app #topic-caption-panel { position: absolute; top: 0; left: 0; right: 0; z-index: 7; background: transparent !important; border: 0 !important; box-shadow: none !important;
  height: auto !important; min-height: 0 !important; padding: 8px 10px !important; padding-top: calc(8px + env(safe-area-inset-top)) !important; display: flex; align-items: center; gap: 8px; pointer-events: none; }
html.l2-chatui-head body.l2-app #topic-caption-panel > * { pointer-events: auto; }
html.l2-chatui-head body.l2-app #topic-caption-panel > [data-l2-tmore], html.l2-chatui-head body.l2-app #topic-caption-panel > div[style*="margin-left"] { display: none !important; }
html.l2-chatui-head body.l2-app #topic-caption-panel > .l2-hcall { display: none !important; }
html.l2-chatui-head #l2-chat-back, html.l2-chatui-head body.l2-app #topic-caption-panel > #hide-message-view {
  display: inline-flex !important; align-items: center; justify-content: center; gap: 2px; height: 42px; width: auto !important; min-width: 42px; padding: 0 14px 0 8px !important; margin: 0;
  color: var(--l2-accent) !important; font: 500 16px/1 Inter, system-ui, sans-serif; flex: none; text-decoration: none; box-sizing: border-box;
  background: color-mix(in srgb, var(--l2-card) 80%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 2px 10px rgba(0,0,0,.28), inset 0 0 0 1px rgba(255,255,255,.06); border-radius: 999px; }
html.l2-chatui-head #l2-chat-back:hover { color: var(--l2-accent) !important; filter: brightness(1.12); }
html.l2-chatui-head body.l2-app #topic-caption-panel > #hide-message-view i.material-icons { width: 22px; height: 22px; background: var(--l2-accent) !important; }
html.l2-chatui-head body.l2-app #topic-caption-panel > #hide-message-view::after { content: attr(data-l2-back); font: 500 16px/1 Inter, system-ui, sans-serif; margin-left: 0; color: var(--l2-accent); }
/* по центру: аватар + имя + статус — одна пилюля из двух половинок (элементы Tinode не переносим) */
html.l2-chatui-head body.l2-app #topic-caption-panel .avatar-box { margin: 0 0 0 auto !important; width: 38px !important; min-width: 38px !important; height: 38px !important; position: relative; z-index: 1;
  left: 3px; cursor: pointer; flex: none; background: transparent !important; }
html.l2-chatui-head body.l2-app #topic-caption-panel .avatar-box .lettertile { width: 38px !important; height: 38px !important; }
html.l2-chatui-head body.l2-app #topic-caption-panel .avatar-box > span { right: -1px; bottom: 0; }
html.l2-chatui-head body.l2-app #topic-title-group { margin: 0 auto 0 -41px !important; height: 44px; box-sizing: border-box; padding: 0 16px 0 52px; display: flex; flex-direction: column; justify-content: center;
  border-radius: 22px; box-shadow: 0 2px 10px rgba(0,0,0,.28), inset 0 0 0 1px rgba(255,255,255,.06); min-width: 0; max-width: min(46vw, 420px); flex: 0 1 auto; overflow: hidden; cursor: pointer;
  background: color-mix(in srgb, var(--l2-card) 80%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); }
html.l2-chatui-head body.l2-app #topic-title { font: 700 15.5px/1.2 Inter, system-ui, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
html.l2-chatui-head body.l2-app #topic-last-seen { font: 500 12px/1.25 Inter, system-ui, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.l2-chatui-head body.l2-app #topic-last-seen:empty { display: none; }
/* «Избранное» в шапке: своё имя и закладка */
#topic-title[data-l2-name]:not([data-l2-name=""]) { font-size: 0 !important; }
#topic-title[data-l2-name]:not([data-l2-name=""]) > * { display: none !important; }
#topic-title[data-l2-name]:not([data-l2-name=""])::before { content: attr(data-l2-name); font: 700 15.5px/1.2 Inter, system-ui, sans-serif; color: var(--l2-text); }
#topic-last-seen[data-l2-sub]:not([data-l2-sub=""]) { font-size: 0 !important; }
#topic-last-seen[data-l2-sub]:not([data-l2-sub=""])::before { content: attr(data-l2-sub); font: 500 12px/1.25 Inter, system-ui, sans-serif; color: var(--l2-muted); }
#topic-caption-panel[data-l2-slf] .avatar-box .lettertile { background: var(--l2-accent) !important; border-radius: 50%; position: relative; }
#topic-caption-panel[data-l2-slf] .avatar-box .lettertile > * { visibility: hidden; }
#topic-caption-panel[data-l2-slf] .avatar-box .lettertile::after { content: ""; position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; background: var(--l2-on-accent, #0B2A22);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z'/%3E%3C/svg%3E") center/contain no-repeat; }
#topic-caption-panel[data-l2-slf] .avatar-box > span { display: none; }
#topic-caption-panel[data-l2-slf] .avatar-box img.avatar.self { width: 38px; height: 38px; box-sizing: border-box; padding: 9px; border-radius: 50%; background: var(--l2-accent); filter: none; }
#topic-caption-panel[data-l2-slf] .avatar-box img.avatar.self { -webkit-mask: none; content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%230B2A22' d='m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z'/%3E%3C/svg%3E"); }
/* справа: 📞 📹 ⏱ 🔍 (⋮) — одна пилюля */
#l2-hpill { display: inline-flex; align-items: center; gap: 0; flex: none; }
#l2-hpill.empty { display: none !important; }
#l2-hpill #l2-hacts { display: contents; }
#l2-hpill .l2-hbtn { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--l2-text); flex: none; }
#l2-hpill .l2-hbtn:hover { background: var(--l2-card2); color: var(--l2-accent); }
#l2-hpill .l2-hbtn[hidden], #l2-hpill [data-l2-off] { display: none !important; }
html.l2-chatui-head #l2-hpill { height: 44px; padding: 0 3px; box-sizing: border-box; }
html:not(.l2-chatui-head) #l2-hpill { background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
html:not(.l2-chatui-head) #l2-hpill .l2-hbtn { width: 40px; height: 40px; border-radius: 12px; }
/* плашка закреплённого — под шапкой, в том же стиле */
/* телефон: Tinode ставит плашку отдельным блоком после шапки — кладём её под пилюли */
html.l2-chatui-head body.l2-app #topic-view > #pinned-wrapper { position: absolute !important; left: 0; right: 0; top: var(--l2-caph, 60px); height: 0; width: auto; z-index: 7; }
html.l2-chatui-head body.l2-app #topic-view > #pinned-wrapper > .l2-pin { top: 0; }
html.l2-chatui body.l2-app #topic-view { overflow: hidden; }
html.l2-chatui-head .l2-pin { left: 10px; right: 10px; top: calc(100% - 2px); height: 46px; border: 0; border-radius: 14px; padding: 0 6px 0 12px;
  background: color-mix(in srgb, var(--l2-card) 80%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 2px 10px rgba(0,0,0,.28), inset 0 0 0 1px rgba(255,255,255,.06); }
/* лента под шапкой и строкой ввода */
html.l2-chatui-head body.l2-app #topic-view:has(> #topic-caption-panel) #scroller { padding-top: calc(var(--l2-hh, 60px) + 6px) !important; }
html.l2-chatui-input body.l2-app #topic-view:has(> #send-message-wrapper) #scroller { padding-bottom: calc(var(--l2-inh, 72px) + 10px) !important; }
html.l2-chatui-input body.l2-app #topic-view:has(> #send-message-wrapper) #go-to-latest { bottom: calc(var(--l2-inh, 72px) + 12px) !important; }
/* поиск по чату */
#l2-search { position: absolute; z-index: 9; top: calc(8px + env(safe-area-inset-top)); left: 10px; right: 10px; height: 44px; box-sizing: border-box; display: flex; align-items: center; gap: 2px; padding: 0 4px 0 14px;
  border-radius: 22px; animation: l2srch .18s ease; }
@keyframes l2srch { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
#l2-search .ic { color: var(--l2-muted); display: inline-flex; flex: none; }
#l2-search input { flex: 1; min-width: 0; height: 40px; margin: 0; padding: 0 6px; border: 0 !important; outline: 0; box-shadow: none !important; background: transparent !important; color: var(--l2-text); font: 400 16px Inter, system-ui, sans-serif; }
#l2-search input::placeholder { color: var(--l2-muted); }
#l2-search-counter { font: 500 13px Inter, system-ui, sans-serif; color: var(--l2-muted); white-space: nowrap; padding: 0 4px; }
#l2-search button { width: 36px; height: 36px; min-width: 0; flex: none; margin: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; box-shadow: none; color: var(--l2-text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
#l2-search button:hover:not(:disabled) { background: var(--l2-card2); color: var(--l2-accent); }
#l2-search button:disabled { opacity: .35; cursor: default; }
#topic-view.l2-searching #topic-caption-panel > :not(#pinned-wrapper) { visibility: hidden !important; }
body.l2-app #scroller > li.l2-found .bubble { box-shadow: 0 0 0 2px var(--l2-accent), 0 0 18px var(--l2-accent-a25, rgba(126,224,195,.25)) !important; transition: box-shadow .2s; }
/* --- плавающая строка ввода --- */
html.l2-chatui-input body.l2-app #topic-view > #send-message-wrapper { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; background: transparent !important; border: 0 !important; box-shadow: none !important; pointer-events: none;
  padding: 6px 10px calc(10px + env(safe-area-inset-bottom)) !important; }
html.l2-chatui-input body.l2-app #topic-view > #send-message-wrapper > * { pointer-events: auto; }
html.l2-chatui-input body.l2-app #send-message-panel { background: color-mix(in srgb, var(--l2-card) 70%, transparent) !important; -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 4px 18px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.07) !important; border-radius: 26px; }
/* --- «Избранное» сверху списка чатов и в пересылке --- */
.l2-saved { display: flex; align-items: center; gap: 12px; padding: 8px 12px; margin: 0 8px 2px; border-radius: 14px; cursor: pointer; color: var(--l2-text); }
.l2-saved[hidden] { display: none !important; }
.l2-saved:hover, .l2-saved.on { background: var(--l2-card); }
.l2-saved:focus-visible { outline: 2px solid var(--l2-accent); outline-offset: -2px; }
.l2-saved .ic { width: 50px; height: 50px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; background: var(--l2-accent); color: var(--l2-on-accent, #0B2A22); }
.l2-saved .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.l2-saved .tx b { font: 700 15.5px/1.25 Inter, system-ui, sans-serif; }
.l2-saved .tx span { font: 400 13.5px/1.3 Inter, system-ui, sans-serif; color: var(--l2-muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.l2-saved .pn { color: var(--l2-muted); display: inline-flex; flex: none; }
.forward-dialog .l2-saved { margin: 4px 0; }
.forward-dialog .l2-saved .ic { width: 40px; height: 40px; }
ul.contact-box > li[data-l2-slf] { display: none !important; }
@media (max-width: 767px) { .l2-saved { min-height: 72px; box-sizing: border-box; margin: 0 8px 2px; } }
/* --- лента: строки без фона и линий; 5 px в серии, 11 px при смене отправителя; поля 11 px; пузырь ≤ 78 % --- */
html.l2-chatui body.l2-app #messages-panel { padding: 0 !important; }
/* мало сообщений — прижаты к строке ввода, как в Telegram/iOS (перевёрнутая лента): появление/снятие плашки закреплённого
   (+52 px сверху) не сдвигает сообщения под пальцем; когда сообщений больше экрана — обычная прокрутка (margin-top: auto = 0) */
html.l2-chatui body.l2-app #messages-panel { display: flex; flex-direction: column; }
html.l2-chatui body.l2-app #messages-panel > #scroller.chat-box { margin-top: auto !important; flex: none; }
/* прокрутка к сообщению (scrollIntoView, поиск, ответы) — с учётом плавающих шапки и строки ввода */
html.l2-chatui-head body.l2-app #messages-panel { scroll-padding-top: calc(var(--l2-hh, 60px) + 6px); }
html.l2-chatui-input body.l2-app #messages-panel { scroll-padding-bottom: calc(var(--l2-inh, 76px) + 6px); }
html.l2-chatui body.l2-app .chat-box { margin: 0 !important; padding-left: 11px; padding-right: 11px; }
html.l2-chatui body.l2-app #scroller > li { background: transparent !important; border: 0 !important; box-shadow: none !important; }
html.l2-chatui body.l2-app #scroller > li.first, html.l2-chatui body.l2-app #scroller > li.middle { margin: 0 0 5px !important; }
html.l2-chatui body.l2-app #scroller > li.last, html.l2-chatui body.l2-app #scroller > li.single { margin: 0 0 11px !important; }
html.l2-chatui body.l2-app #scroller > li:not(.meta) > .l2-bwrap, html.l2-chatui body.l2-app #scroller > li:not(.meta) > .bubble { max-width: 78%; }
html.l2-chatui body.l2-app #scroller > li:not(.meta) > .l2-bwrap > .bubble { max-width: 100%; }
html.l2-chatui body.l2-app .left .bubble { margin-right: 0; } html.l2-chatui body.l2-app .right .bubble { margin-left: 0; }
/* системные строки — компактная серая плашка как «Сегодня» */
body.l2-app #scroller > li[data-l2-sys], body.l2-app #scroller > li[data-l2-sys2] { margin: 4px 0 10px !important; }
body.l2-app .l2-sysline { margin: 0 auto !important; max-width: 80%; width: auto; padding: 4px 12px !important; border-radius: 999px; background: var(--l2-card) !important; color: var(--l2-muted) !important;
  font: 600 12px/1.35 Inter, system-ui, sans-serif !important; text-align: center; box-shadow: none; }
/* --- кружки: превью + ▶, без автозапуска --- */
.l2-round .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 54px; height: 54px; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff;
  display: flex; align-items: center; justify-content: center; pointer-events: none; transition: opacity .15s; }
.l2-round .play svg { margin-left: 3px; }
.l2-round.playing .play { opacity: 0; }
.l2-round .snd { display: none; } .l2-round.playing .snd { display: inline-flex; }
/* телефон */
@media (max-width: 640px) {
  html.l2-chatui-head body.l2-app #topic-caption-panel { gap: 6px; padding-left: 8px !important; padding-right: 8px !important; }
  html.l2-chatui-head #l2-hpill .l2-hbtn { width: 36px; height: 44px; border-radius: 18px; } /* зоны нажатия 36×44 встык, без зазоров */
  html.l2-chatui-head #l2-hpill { padding: 0 2px; }
  html.l2-chatui-head body.l2-app #topic-caption-panel > #hide-message-view { height: 44px; }
  #l2-search button { height: 44px; width: 38px; border-radius: 19px; }
  html.l2-chatui-head body.l2-app #topic-caption-panel > #hide-message-view { padding: 0 12px 0 6px !important; }
  html.l2-chatui-head body.l2-app #topic-title-group { max-width: none; padding-right: 12px; }
  #l2-search { left: 8px; right: 8px; }
}
@media (max-width: 360px) {
  html.l2-chatui-head body.l2-app #topic-caption-panel > #hide-message-view::after { content: none; }
  html.l2-chatui-head body.l2-app #topic-caption-panel > #hide-message-view { padding: 0 !important; width: 42px !important; }
}
/* --- дизайн ленты как в Telegram (замечания владельца 26.11) --- */
/* пузыри: поля 8/13, скругление 18; в серии со стороны соседа — 6; хвостик (.tip) — только у последнего */
html.l2-chatui body.l2-app .chat-box .bubble { padding: 8px 13px; border-radius: 18px; }
html.l2-chatui body.l2-app .chat-box .bubble div.message-content { padding: 0 !important; }
html.l2-chatui body.l2-app .chat-box .bubble .content-meta > .message-content:has(.audio-player)::after { display: none; }
html.l2-chatui body.l2-app .chat-box .bubble .content-meta:has(.audio-player) > .timestamp { bottom: 0; }
html.l2-chatui body.l2-app .chat-box li.left.first .bubble { border-bottom-left-radius: 6px; }
html.l2-chatui body.l2-app .chat-box li.left.middle .bubble { border-top-left-radius: 6px; border-bottom-left-radius: 6px; }
html.l2-chatui body.l2-app .chat-box li.left.last .bubble { border-top-left-radius: 6px; }
html.l2-chatui body.l2-app .chat-box li.right.first .bubble { border-bottom-right-radius: 6px; }
html.l2-chatui body.l2-app .chat-box li.right.middle .bubble { border-top-right-radius: 6px; border-bottom-right-radius: 6px; }
html.l2-chatui body.l2-app .chat-box li.right.last .bubble { border-top-right-radius: 6px; }
@media (min-width: 641px) {
  html.l2-chatui body.l2-app #scroller > li:not(.meta) > .l2-bwrap, html.l2-chatui body.l2-app #scroller > li:not(.meta) > .bubble { max-width: min(78%, 560px); }
}
/* время и ✓✓ внутри пузыря справа внизу, в последней строке оставлено место (как Telegram) */
html.l2-chatui body.l2-app .chat-box .bubble .content-meta { position: relative; }
html.l2-chatui body.l2-app .chat-box .bubble .content-meta > .message-content::after { content: ""; display: inline-block; vertical-align: bottom; width: 38px; height: 1px; }
html.l2-chatui body.l2-app .chat-box li.right .bubble .content-meta > .message-content::after { width: 66px; }
html.l2-chatui body.l2-app .chat-box .bubble .content-meta > .timestamp { position: absolute !important; right: -5px; bottom: -4px; top: auto !important; float: none !important; margin: 0 !important; line-height: 16px; }
html.l2-chatui body.l2-app .chat-box li.left .bubble .content-meta > .timestamp { right: -4px; bottom: -3px; }
html.l2-chatui body.l2-app .chat-box .bubble.date .message-content::after, html.l2-chatui body.l2-app .chat-box li[data-l2-round] .message-content::after { display: none; }
/* разделители дат — плашка 12 px, с заглавной (JS) */
html.l2-chatui body.l2-app .meta .bubble.date { font: 600 12px/1.3 Inter, system-ui, sans-serif !important; padding: 4px 12px !important; min-width: 0; border-radius: 999px;
  background: color-mix(in srgb, var(--l2-card) 78%, transparent) !important; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: var(--l2-muted) !important; }
html.l2-chatui body.l2-app #scroller > li.meta { margin: 8px 0 10px !important; }
/* системные строки: маленькая монохромная иконка вместо эмодзи */
body.l2-app .l2-sysline[data-ic] { display: flex; align-items: center; justify-content: center; gap: 5px; width: fit-content; }
body.l2-app .l2-sysline[data-ic]::before { content: ""; flex: none; width: 12px; height: 12px; background: currentColor;
  -webkit-mask: var(--l2-ic-timer) center/contain no-repeat; mask: var(--l2-ic-timer) center/contain no-repeat; }
body.l2-app .l2-sysline[data-ic="shot"]::before { -webkit-mask-image: var(--l2-ic-shot); mask-image: var(--l2-ic-shot); }
:root { --l2-ic-timer: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cline x1='10' x2='14' y1='2' y2='2'/%3E%3Cline x1='12' x2='15' y1='14' y2='11'/%3E%3Ccircle cx='12' cy='14' r='8'/%3E%3C/svg%3E");
  --l2-ic-shot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3z'/%3E%3Ccircle cx='12' cy='13' r='3'/%3E%3C/svg%3E"); }
/* «Исчезающие сообщения: …» над полем ввода — мелко, приглушённо, маленький ⏱ */
#l2-burnbar { width: fit-content; margin: 0 auto 6px !important; padding: 3px 10px !important; border-radius: 999px; color: var(--l2-muted) !important; font: 500 12px/1.3 Inter, system-ui, sans-serif !important; gap: 5px !important;
  background: color-mix(in srgb, var(--l2-card) 72%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
#l2-burnbar svg { width: 13px; height: 13px; color: var(--l2-danger, #FF5A5F); }
/* запись о звонке — компактная карточка, нажатие — перезвонить */
html.l2-chatui body.l2-app #scroller > li[data-l2-call] .bubble { background: color-mix(in srgb, var(--l2-card) 88%, transparent) !important; color: var(--l2-text) !important; min-width: 0; padding: 8px 12px; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); }
html.l2-chatui body.l2-app #scroller > li[data-l2-call] .bubble:hover { background: var(--l2-card2) !important; }
html.l2-chatui body.l2-app #scroller > li[data-l2-call] .call-message.l2-cm .l2-callrow { font: 500 14px/1.3 Inter, system-ui, sans-serif; color: var(--l2-text) !important; }
html.l2-chatui body.l2-app #scroller > li[data-l2-call] .call-message.l2-cm .l2-callrow.missed, html.l2-chatui body.l2-app #scroller > li[data-l2-call] .call-message.l2-cm .l2-callrow.missed svg,
html.l2-chatui body.l2-app #scroller > li[data-l2-call] .call-message.l2-cm .l2-callrow.declined svg { color: var(--l2-danger, #FF5A5F) !important; }
html.l2-chatui body.l2-app #scroller > li[data-l2-call] .call-message.l2-cm .l2-callrow:not(.missed):not(.declined) svg { color: var(--l2-accent) !important; }
html.l2-chatui body.l2-app #scroller > li[data-l2-call] .bubble .timestamp, html.l2-chatui body.l2-app #scroller > li[data-l2-call] .bubble .timestamp * { color: var(--l2-muted) !important; background: transparent !important; }
/* лист «Исчезающие сообщения»: сроки — ровная сетка, без ЗАГЛАВНЫХ (стиль кнопок Tinode) */
.l2-burn-secs { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(56px, 1fr)); gap: 8px; }
.l2-burn-secs button, .l2-burnsheet button { text-transform: none !important; letter-spacing: 0; }
.l2-burn-secs button { min-height: 44px; padding: 0 6px; }
/* пока открыто меню сообщения / окно / пересылка — фон затемнён, размытие под ним не нужно (экономит отрисовку на слабых телефонах) */
body:has(#l2-mm, .l2-modal, .forward-dialog, .alert-container) #topic-view *, body:has(#l2-mm, .l2-modal, .forward-dialog, .alert-container) #topic-view { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
/* ===== /L2_CHATUI ===== */

/* ===== L2_PANIC: экран «Код паники» ===== */
.l2-panic { padding-bottom: 24px; }
.l2-panic-form.off { opacity: .5; }
.l2-pn-in { display: block; width: calc(100% - 28px); margin: 6px 14px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--l2-line); background: var(--l2-card); color: var(--l2-text); font-size: 16px; box-sizing: border-box; }
.l2-pn-in:focus { outline: 2px solid var(--l2-accent); outline-offset: 0; }
.l2-pn-lv { align-items: flex-start; }
.l2-pn-lv .t2 { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.l2-pn-lv .t2 b { font-weight: 600; } .l2-pn-lv .t2 small { color: var(--l2-muted); font-size: 13px; line-height: 1.4; white-space: normal; }
.l2-pn-radio { flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; box-shadow: 0 0 0 2px var(--l2-muted) inset; }
.l2-pn-lv.on .l2-pn-radio { box-shadow: 0 0 0 2px var(--l2-accent2) inset, 0 0 0 6px var(--l2-card) inset; background: var(--l2-accent2); }
.l2-pn-err { margin: 8px 14px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--l2-danger) 12%, transparent); color: var(--l2-danger); font-size: 14px; }
.l2-pn-save { display: block; width: calc(100% - 28px); margin: 12px 14px; padding: 13px; border: 0; border-radius: 12px; background: var(--l2-accent2); color: var(--l2-on-accent, #fff); font: 600 15px Inter, system-ui, sans-serif; cursor: pointer; }
.l2-pn-save[disabled] { opacity: .6; cursor: default; }
/* ===== /L2_PANIC ===== */

/* ===== L2_PANIC_UI (2026-11-27): экран «Код паники» — кнопка, поля, подписи переключателей ===== */
.l2-panic input.l2-pn-in { width: calc(100% - 28px); max-width: none; min-width: 0; height: 48px; margin: 6px 14px; padding: 0 14px; box-sizing: border-box; line-height: normal;
  border: 1px solid var(--l2-line); border-radius: 12px; background: var(--l2-card); color: var(--l2-text); }
.l2-panic input.l2-pn-in:focus { border-color: var(--l2-accent); outline: 0; box-shadow: 0 0 0 1px var(--l2-accent); }
html[data-l2theme="light"] .l2-panic input.l2-pn-in { background: var(--l2-card2); }
.l2-panic button.l2-pn-save { display: flex; align-items: center; justify-content: center; width: calc(100% - 28px); max-width: none; height: 48px; min-height: 48px; margin: 14px 14px 0; padding: 0 16px; box-sizing: border-box;
  border: 0; border-radius: var(--l2-r-button, 12px); background: var(--l2-accent2); color: var(--l2-on-accent, #fff); font: 600 16px/1.2 Inter, system-ui, sans-serif;
  text-transform: none; letter-spacing: normal; white-space: nowrap; overflow: visible; text-overflow: clip; cursor: pointer; }
.l2-panic button.l2-pn-save:hover:not([disabled]) { color: var(--l2-on-accent, #fff); filter: brightness(1.06); }
.l2-panic button.l2-pn-save[disabled] { opacity: .65; cursor: default; }
.l2-panic button.l2-pn-save.done, .l2-panic button.l2-pn-save.done[disabled] { opacity: 1; }
.l2-panic .l2-srow { height: auto; }
.l2-panic .l2-srow.switch .t, .l2-panic .l2-pn-lv .t2 b { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.3; min-width: 0; }
.l2-panic .l2-srow.switch .v { flex: none; }
.l2-panic .l2-srow.switch .l2-switch { flex: none; }
/* ===== /L2_PANIC_UI ===== */

/* L2_CALLFIX: экран звонка в своём фиксированном контейнере (переживает смену чата); свёрнут — только плашка сверху */
#l2-callhost { position: fixed; inset: 0; z-index: 99000; }
#l2-callhost.off { display: none; }
#l2-callhost.min { left: -10000px; top: 0; right: auto; bottom: auto; width: 2px; height: 2px; overflow: hidden; opacity: 0; pointer-events: none; }
#l2-callhost > #video-container { position: absolute; inset: 0; width: 100%; height: 100%; }

/* L2_MSGREFS_BAR: телефон — плашка «Идёт звонок» над шапкой, контент приложения ниже неё (не перекрывает кнопки и аватар) */
@media (max-width: 767px) {
  html.l2-cbar #l2-callbar { top: calc(4px + env(safe-area-inset-top)); }
  html.l2-cbar body.l2-app #app-container { margin-top: calc(44px + env(safe-area-inset-top)); height: calc(var(--l2-vvh, 100%) - 44px - env(safe-area-inset-top)) !important; }
}

/* L2_PANIC_DEV */
#l2-panic-dev { margin: 0 14px 12px; padding: 10px 12px; border-radius: 12px; background: var(--l2-card2); }
#l2-panic-dev.ok { color: var(--l2-accent); }
/* /L2_PANIC_DEV */

/* L2_PROFEDIT: форма профиля (#general) — поля Tinode «Имя / Псевдоним / Описание» скрыты, вместо них своя форма */
body.l2-app #l2-prof ~ .group { display: none !important; }
.l2-prof { display: flex; flex-direction: column; gap: 14px; margin: 18px 0 8px; }
.l2-pf { display: flex; flex-direction: column; gap: 6px; }
.l2-pf .lb { font-size: 13px; font-weight: 600; color: var(--l2-muted); }
.l2-pf input, .l2-pf textarea { width: 100%; box-sizing: border-box; padding: 11px 13px; border: 1.5px solid var(--l2-line); border-radius: 12px; background: var(--l2-card2); color: var(--l2-text);
  font: 400 16px/1.35 Inter, system-ui, sans-serif; outline: none; resize: vertical; }
.l2-pf input:focus, .l2-pf textarea:focus { border-color: var(--l2-accent); }
.l2-pf input.bad { border-color: var(--l2-danger); }
.l2-pf-al { position: relative; display: block; }
.l2-pf-al i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--l2-muted); font-size: 16px; pointer-events: none; }
.l2-pf-al input { padding-left: 30px; }
#l2-prof input, #l2-prof textarea { width: 100% !important; max-width: none !important; min-width: 0 !important; height: auto !important; margin: 0 !important; padding: 11px 13px !important;
  border: 1.5px solid var(--l2-line) !important; border-radius: 12px !important; background: var(--l2-card2) !important; box-shadow: none !important; font-size: 16px !important; }
#l2-prof textarea { min-height: 84px !important; }
#l2-prof .l2-pf, #l2-prof .l2-pf-al { display: flex !important; flex-direction: column; width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; }
#l2-prof .l2-pf-al { display: block !important; }
#l2-prof .l2-pf-al input { padding-left: 30px !important; }
#l2-prof input:focus, #l2-prof textarea:focus { border-color: var(--l2-accent) !important; }
#l2-prof input.bad { border-color: var(--l2-danger) !important; }
.l2-pf-hint { font-size: 12.5px; line-height: 1.4; color: var(--l2-muted); }
.l2-pf-hint.bad { color: var(--l2-danger); }
.l2-pf-hint.ok { color: var(--l2-accent); }
.l2-pf-bar { display: flex; align-items: center; gap: 12px; min-height: 42px; }
.l2-pf-bar .l2-btn[hidden], .l2-pf-done[hidden] { display: none; }
.l2-pf-bar .l2-btn { flex: 1; justify-content: center; }
.l2-pf-bar .l2-btn[disabled] { opacity: .55; }
.l2-pf-done { display: inline-flex; align-items: center; gap: 6px; color: var(--l2-accent); font-weight: 600; font-size: 14.5px; }

/* L2_CALLINFO: окно «О звонке» */
.l2-callinfo .ci-head { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 6px 0 16px; }
.l2-callinfo .ci-name { font-size: 19px; font-weight: 800; text-align: center; overflow-wrap: anywhere; }
.l2-callinfo .ci-rows { margin: 0 0 18px; padding: 4px 14px; border-radius: 14px; background: var(--l2-card2); }
.l2-callinfo .ci-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--l2-line); font-size: 14.5px; }
.l2-callinfo .ci-row:last-child { border-bottom: 0; }
.l2-callinfo .ci-row dt { color: var(--l2-muted); margin: 0; }
.l2-callinfo .ci-row dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.l2-callinfo .ci-row.missed dd { color: var(--l2-danger); }
.l2-callinfo .ci-note { text-align: center; }
.l2-callinfo .ci-acts { display: flex; gap: 10px; }
.l2-callinfo .ci-act { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 14px; background: var(--l2-card2); color: var(--l2-accent);
  font: 600 13px/1.2 Inter, system-ui, sans-serif; cursor: pointer; height: auto !important; min-height: 74px; min-width: 0; margin: 0; border: 0; text-transform: none !important; letter-spacing: 0; }
.l2-callinfo .ci-act span { color: var(--l2-text); }
.l2-callinfo .ci-act:hover { filter: brightness(1.12); }
.l2-callinfo .ci-act:focus-visible { outline: 2px solid var(--l2-accent); outline-offset: 2px; }

/* L2_CALLENC: «🔒 Зашифровано» под статусом звонка (только оформление) */
.l2-call-head .who::after { content: '\1F512\00A0 Зашифровано'; align-self: center; margin-top: 4px; padding: 3px 10px; border-radius: 999px;
  background: rgba(255,255,255,.10); color: #C9F2E5; font: 600 12px/1.3 Inter, system-ui, sans-serif; text-shadow: none; letter-spacing: .1px; }
