/* Линия 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; }
