@charset "UTF-8";
/* Светлая тема «Клевер»: ФАЙЛ СГЕНЕРИРОВАН из statica/space/chat.css скриптом _tools/gen_klever.py — вручную не править. Ручные правки — в statica/space/klever.css. */
/*
 * chat.css — новое окно чата (v2.19, statica/js/chat.js). Тема «Глубокий космос».
 * Два вида одной разметки: .sp-chat--drawer — окно поверх страницы (справа, на телефоне — на весь экран),
 * .sp-chat--page — страница /ajaxchat (на всю ширину, справа колонка «Кто в чате»).
 */

.sp-chat { --ch-bg: #101a28; --ch-line: rgba(245, 218, 150, .18); --ch-mut: #e8c06f; --ch-in: rgba(255, 255, 255, .055);
  --ch-me: linear-gradient(135deg, #d5a855 0%, #e7bd67 55%, #d3a44e 100%);
  position: relative; display: flex; flex-direction: column; min-height: 0; color: #1e2522; font-size: 14px; line-height: 1.45;
  background: radial-gradient(120% 60% at 100% 0%, rgba(181, 236, 98, 0.2), transparent 60%), linear-gradient(180deg, #edf2e8 0%, var(--ch-bg) 100%); }
.sp-chat *, .sp-chat *::before, .sp-chat *::after { box-sizing: border-box; }
.sp-chat button { font: inherit; color: inherit; cursor: pointer; }
.sp-chat [hidden] { display: none !important; }

/* ---------- Окно поверх страницы ---------- */
.sp-chat--drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 99990; width: 420px; max-width: 100vw;
  border-left: 1px solid rgba(47, 122, 79, 0.27); box-shadow: -24px 0 70px rgba(32, 59, 42, 0.195);
  transform: translateX(104%); transition: transform .26s cubic-bezier(.22, .8, .3, 1); }
.sp-chat--drawer.is-open { transform: none; }
@media (max-width: 700px) {
  .sp-chat--drawer { width: 100vw; border-left: 0; }
  html.sp-chat-open, html.sp-chat-open body { overflow: hidden; }
}

/* ---------- Страница чата ---------- */
.sp-chat--page { height: min(74vh, 760px); min-height: 460px; border-radius: 18px; border: 1px solid var(--ch-line); overflow: hidden;
  box-shadow: 0 18px 50px rgba(32, 59, 42, 0.135), inset 0 1px 0 rgba(255, 255, 255, 0.036); }
.sp-chat--page .sp-chat__body { flex-direction: row; }
.sp-chat--page .sp-chat__people { position: static; width: 250px; flex: 0 0 250px; border-left: 1px solid var(--ch-line); box-shadow: none; animation: none; }
.sp-chat--page .sp-chat__people .sp-chat__ptitle button { display: none; }
@media (max-width: 900px) {
  .sp-chat--page { height: calc(100vh - 170px); min-height: 420px; border-radius: 14px; }
  .sp-chat--page .sp-chat__body { flex-direction: column; }
  .sp-chat--page .sp-chat__people { position: absolute; width: auto; flex: none; border-left: 0; }
  .sp-chat--page .sp-chat__people .sp-chat__ptitle button { display: grid; }
}

/* ---------- Шапка ---------- */
.sp-chat__head { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--ch-line);
  background: linear-gradient(180deg, rgba(25, 61, 45, 0.042), rgba(25, 61, 45, 0)); }
.sp-chat__title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; color: #101412; margin-right: auto; min-width: 0; }
.sp-chat__title > i { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-size: 14px; background: var(--ch-me); box-shadow: 0 6px 16px rgba(110, 170, 60, 0.158); flex: 0 0 auto; }
.sp-chat__online { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--ch-line);
  background: var(--ch-in); font-size: 12.5px; transition: background .15s, border-color .15s; }
.sp-chat__online:hover { background: rgba(25, 61, 45, 0.084); border-color: rgba(47, 122, 79, 0.36); }
.sp-chat__online i { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.18); animation: sp-chat-pulse 2.2s ease-out infinite; }
.sp-chat__online b { font-weight: 600; color: #101412; }
.sp-chat__tabs { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: rgba(255, 255, 255, 0.25); }
.sp-chat__tabs button { position: relative; border: 0; background: none; padding: 5px 10px; border-radius: 8px; font-size: 12.5px; color: var(--ch-mut); }
.sp-chat__tabs button.is-on { background: rgba(25, 61, 45, 0.084); color: #101412; }
/* v2.21: в окне поверх страницы у модератора шапка не помещалась — вкладки наезжали на счётчик «в сети».
   Счётчик и кнопки не сжимаются; в окне слово «Чат» при вкладках скрыто (остаётся значок), а на телефоне вкладки уходят на вторую строку. */
.sp-chat__title { flex: 0 0 auto; }
.sp-chat__online, .sp-chat__tools { flex: 0 0 auto; }
.sp-chat__tabs { flex: 0 1 auto; min-width: 0; }
.sp-chat__tabs button { white-space: nowrap; }
.sp-chat--drawer .sp-chat__head--tabs .sp-chat__title > span { display: none; }
@media (max-width: 700px) {
  .sp-chat--drawer .sp-chat__head--tabs { flex-wrap: wrap; }
  .sp-chat--drawer .sp-chat__head--tabs .sp-chat__title > span { display: inline; }
  .sp-chat--drawer .sp-chat__head--tabs .sp-chat__tabs { order: 3; flex: 1 0 100%; }
  .sp-chat--drawer .sp-chat__head--tabs .sp-chat__tabs button { flex: 1 1 0; }
}
.sp-chat__dot { position: absolute; top: 3px; right: 3px; width: 7px; height: 7px; border-radius: 50%; background: #f43f5e; }
.sp-chat__tools { display: flex; align-items: center; gap: 2px; }
.sp-chat__tools > * { width: 32px; height: 32px; border: 0; border-radius: 9px; background: none; display: grid; place-items: center; color: var(--ch-mut) !important; font-size: 14px; text-decoration: none;
  transition: background .15s, color .15s; }
.sp-chat__tools > *:hover { background: rgba(25, 61, 45, 0.07); color: #101412 !important; }
.sp-chat__tools [data-act="close"] { font-size: 22px; line-height: 1; }
.sp-chat__tools .is-off { color: #ba2c2c !important; }

/* ---------- Рекламная строка ---------- */
.sp-chat__ad { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-bottom: 1px solid var(--ch-line); font-size: 12.5px; background: rgba(255, 255, 255, 0.18); }
.sp-chat__ad > i { color: #2f7a4f; flex: 0 0 auto; }
.sp-chat__ad a, .sp-chat__ad span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #2e3833; text-decoration: none; }
.sp-chat__ad a:hover { color: #101412; text-decoration: underline; }
.sp-chat__ad.is-hot a { color: #2f7a4f; font-weight: 600; }
.sp-chat__ad button { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--ch-line); background: var(--ch-in); display: grid; place-items: center; font-size: 11px; color: var(--ch-mut); }
.sp-chat__ad button:hover { color: #101412; border-color: rgba(47, 122, 79, 0.405); }

/* ---------- Лента ---------- */
.sp-chat__body { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.sp-chat__list { flex: 1 1 auto; min-height: 0; min-width: 0; overflow-y: auto; overscroll-behavior: contain; padding: 10px 12px 14px; scrollbar-width: thin; scrollbar-color: rgba(47, 122, 79, 0.27) transparent; }
.sp-chat__list::-webkit-scrollbar { width: 6px; }
.sp-chat__list::-webkit-scrollbar-thumb { background: rgba(206, 242, 153, 0.28); border-radius: 6px; }
.sp-chat__hello { height: 100%; min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; color: var(--ch-mut); padding: 20px; }
.sp-chat__hello > i { font-size: 34px; color: #2f7a4f; margin-bottom: 4px; }
.sp-chat__hello b { color: #101412; font-size: 15px; }
.sp-chat__hello--ban > i { color: #ba2c2c; }
.sp-chat__day { display: flex; justify-content: center; margin: 14px 0 8px; position: sticky; top: 0; z-index: 2; pointer-events: none; }
.sp-chat__day span { padding: 3px 12px; border-radius: 999px; font-size: 11.5px; color: #2e3833; background: rgba(237, 242, 232, 0.92); border: 1px solid var(--ch-line); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

.sp-msg { position: relative; display: flex; align-items: flex-end; gap: 8px; margin-top: 10px; padding-right: 30px; animation: sp-chat-in .22s ease both; }
.sp-msg.is-cont { margin-top: 3px; }
.sp-msg__ava { flex: 0 0 36px; width: 36px; height: 36px; align-self: flex-start; margin-top: 18px; }
.sp-msg.is-cont .sp-msg__ava { visibility: hidden; height: 0; margin-top: 0; }
.sp-msg__ava img { width: 36px; height: 36px; border-radius: 12px; object-fit: cover; display: block; background: #286247; border: 1px solid var(--ch-line); }
.sp-msg__col { min-width: 0; max-width: 100%; display: flex; flex-direction: column; align-items: flex-start; }
.sp-msg__meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 6px; margin: 0 0 3px 4px; font-size: 12.5px; }
.sp-msg__name { color: #2f7a4f; font-weight: 700; cursor: pointer; }
.sp-msg__name:hover { text-decoration: underline; }
.sp-msg__st { font-size: 10.5px; padding: 0 6px; border-radius: 999px; color: var(--ch-mut); background: rgba(25, 61, 45, 0.042); border: 1px solid rgba(47, 122, 79, 0.126); line-height: 16px; }
.sp-msg__mod { font-size: 10.5px; padding: 0 7px; border-radius: 999px; line-height: 16px; color: #0b2518; background: #34d399; font-weight: 700; }
.sp-msg__bub { position: relative; max-width: 100%; padding: 8px 12px 7px; border-radius: 4px 16px 16px 16px; background: rgba(25, 61, 45, 0.052); border: 1px solid rgba(47, 122, 79, 0.117);
  color: #1b211e; word-break: break-word; overflow-wrap: anywhere; }
.sp-msg.is-cont .sp-msg__bub { border-radius: 16px; }
.sp-msg__bub time { float: right; margin: 5px 0 -2px 10px; font-size: 10.5px; color: var(--ch-mut); line-height: 1; }
.sp-msg__text a { color: #2f7a4f; }
.sp-msg__text img.sp-smile { width: 24px; height: 24px; vertical-align: -6px; }
.sp-msg__to { color: #2f7a4f; font-weight: 600; }
.sp-chat__at { color: #2f7a4f; font-weight: 600; cursor: pointer; }
.sp-msg__re { margin: 0 0 5px; padding: 4px 9px; border-left: 3px solid #2f7a4f; border-radius: 0 8px 8px 0; background: rgba(255, 255, 255, 0.22); font-size: 12.5px; color: #3a4740; cursor: pointer;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp-msg__re b { display: block; color: #2f7a4f; font-size: 12px; }
/* свои сообщения — справа */
.sp-msg.is-me { justify-content: flex-end; padding-right: 0; padding-left: 30px; }
.sp-msg.is-me .sp-msg__col { align-items: flex-end; }
.sp-msg.is-me .sp-msg__bub { background: var(--ch-me); border-color: transparent; color: #101412; border-radius: 16px 4px 16px 16px; box-shadow: 0 6px 18px rgba(110, 170, 60, 0.105); }
.sp-msg.is-me.is-cont .sp-msg__bub { border-radius: 16px; }
.sp-msg.is-me .sp-msg__bub time { color: rgba(16, 20, 18, 0.72); }
.sp-msg.is-me .sp-msg__re { background: rgba(255, 255, 255, 0.2); border-left-color: rgba(25, 61, 45, 0.22); color: rgba(16, 20, 18, 0.85); }
.sp-msg.is-me .sp-msg__re b, .sp-msg.is-me .sp-msg__to, .sp-msg.is-me .sp-chat__at, .sp-msg.is-me .sp-msg__text a { color: #101412; }
.sp-msg.is-me .sp-msg__more { right: auto; left: 0; }
/* обратились ко мне */
.sp-msg.is-tome .sp-msg__bub { border-color: rgba(47, 122, 79, 0.45); background: rgba(173, 234, 83, 0.1); box-shadow: 0 0 0 1px rgba(110, 170, 60, 0.052), 0 0 22px rgba(110, 170, 60, 0.049); }
.sp-msg.is-flash .sp-msg__bub { animation: sp-chat-flash 1.2s ease; }
/* системные */
.sp-msg.is-sys { justify-content: center; padding: 0; margin-top: 12px; }
.sp-msg__sys { max-width: 92%; padding: 6px 12px; border-radius: 12px; font-size: 12.5px; text-align: center; color: #ba2c2c; background: rgba(244, 63, 94, 0.12); border: 1px solid rgba(244, 63, 94, 0.3); }
.sp-msg__sys time { margin-left: 8px; font-size: 10.5px; color: var(--ch-mut); }
/* кнопка действий */
.sp-msg__more { position: absolute; right: 0; top: 50%; width: 26px; height: 26px; margin-top: -13px; border: 0; border-radius: 8px; background: none; color: var(--ch-mut); display: grid; place-items: center; font-size: 13px;
  opacity: 0; transition: opacity .15s, background .15s; }
.sp-msg:hover .sp-msg__more, .sp-msg__more:focus-visible, .sp-chat__p .sp-msg__more { opacity: 1; }
.sp-msg__more:hover { background: rgba(25, 61, 45, 0.07); color: #101412; }
@media (hover: none) { .sp-msg__more { opacity: .55; } }

.sp-chat__down { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 3; display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px; border-radius: 999px;
  border: 1px solid rgba(47, 122, 79, 0.315); background: rgba(237, 242, 232, 0.95); color: #1e2522; font-size: 12.5px; box-shadow: 0 8px 22px rgba(32, 59, 42, 0.165); animation: sp-chat-in .2s ease both; }
.sp-chat__down span { display: none; }
.sp-chat__down.has-new { background: var(--ch-me); border-color: transparent; color: #101412; }
.sp-chat__down.has-new span { display: inline; }
.sp-chat__down b:empty { display: none; }
.sp-chat__down b { min-width: 18px; padding: 0 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.3); font-size: 11.5px; line-height: 18px; text-align: center; }
.sp-chat__toast { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 6; padding: 9px 12px; border-radius: 12px; font-size: 13px; text-align: center; color: #101412;
  background: rgba(190, 40, 70, 0.95); box-shadow: 0 10px 26px rgba(32, 59, 42, 0.18); animation: sp-chat-in .2s ease both; transition: opacity .3s; }
.sp-chat__toast.is-out { opacity: 0; }

/* ---------- Кто в чате ---------- */
.sp-chat__people { position: absolute; inset: 0 0 0 auto; z-index: 4; width: min(280px, 86%); display: flex; flex-direction: column; background: #eff4eb; border-left: 1px solid var(--ch-line);
  box-shadow: -14px 0 34px rgba(32, 59, 42, 0.15); animation: sp-chat-side .2s ease both; }
.sp-chat__ptitle { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-weight: 700; color: #101412; border-bottom: 1px solid var(--ch-line); }
.sp-chat__ptitle b { padding: 0 8px; border-radius: 999px; background: rgba(52, 211, 153, 0.16); color: #298e66; font-size: 12px; line-height: 20px; }
.sp-chat__ptitle button { margin-left: auto; width: 28px; height: 28px; border: 0; border-radius: 8px; background: var(--ch-in); display: grid; place-items: center; font-size: 18px; color: var(--ch-mut); }
.sp-chat__plist { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 6px; scrollbar-width: thin; }
.sp-chat__p { position: relative; display: flex; align-items: center; gap: 9px; padding: 6px 32px 6px 6px; border-radius: 10px; }
.sp-chat__p:hover { background: rgba(25, 61, 45, 0.042); }
.sp-chat__p img { width: 34px; height: 34px; border-radius: 11px; object-fit: cover; background: #286247; flex: 0 0 auto; }
.sp-chat__p > div { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.sp-chat__pname { color: #1e2522; cursor: pointer; overflow: hidden; text-overflow: ellipsis; }
.sp-chat__pname.s2 { color: #2f7a4f; }
.sp-chat__pname.s1 { color: #2f7a4f; }
.sp-chat__p small { flex-basis: 100%; color: var(--ch-mut); font-size: 11.5px; }
.sp-chat__p.is-ban .sp-chat__pname { text-decoration: line-through; color: #ba2c2c; }
.sp-chat__p .sp-msg__more { right: 4px; }
.sp-chat__pempty { padding: 24px 10px; text-align: center; color: var(--ch-mut); font-size: 13px; }

/* ---------- Правила, листы (бан, цвет ника) ---------- */
.sp-chat__tos, .sp-chat__sheet { position: absolute; inset: 0; z-index: 7; display: flex; flex-direction: column; background: rgba(246, 249, 244, 0.96); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sp-chat__tos { padding: 14px; gap: 12px; }
.sp-chat__tostext { flex: 1 1 auto; min-height: 0; overflow-y: auto; font-size: 13px; line-height: 1.55; color: #2e3833; padding-right: 4px; scrollbar-width: thin; }
.sp-chat__tos > .sp-b { flex: 0 0 auto; align-self: center; }
.sp-chat__sheet { justify-content: flex-end; background: rgba(249, 251, 248, 0.7); }
.sp-chat__sheetbox { padding: 16px 14px; border-radius: 18px 18px 0 0; background: #e9eff6; border-top: 1px solid rgba(47, 122, 79, 0.27); display: flex; flex-direction: column; gap: 12px; animation: sp-chat-up .22s ease both; }
.sp-chat__sheettitle { font-size: 15px; color: #101412; }
.sp-chat__sheetnote { margin: 0; font-size: 12.5px; color: var(--ch-mut); }
.sp-chat__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-chat__chips button { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--ch-line); background: var(--ch-in); font-size: 12.5px; }
.sp-chat__chips button.is-on { background: var(--ch-me); border-color: transparent; color: #101412; }
.sp-chat .sp-chat__field { width: 100%; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--ch-line); background: rgba(255, 255, 255, 0.3); color: #101412; font-size: 14px; outline: 0; }
.sp-chat .sp-chat__field:focus { border-color: #2f7a4f; }
.sp-chat__sheetacts { display: flex; justify-content: flex-end; gap: 8px; }
.sp-chat__colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); gap: 6px; max-height: 190px; overflow-y: auto; }
.sp-chat__colors button { aspect-ratio: 1; border-radius: 9px; border: 2px solid rgba(25, 61, 45, 0.162); transition: transform .12s, border-color .12s; }
.sp-chat__colors button:hover { transform: scale(1.12); border-color: #dde2d9; }

/* ---------- Всплывающее меню ---------- */
.sp-chat__menu { position: absolute; z-index: 9; min-width: 210px; max-width: calc(100% - 16px); padding: 6px; border-radius: 14px; background: #e9eff6; border: 1px solid rgba(47, 122, 79, 0.27);
  box-shadow: 0 18px 44px rgba(32, 59, 42, 0.21); animation: sp-chat-pop .14s ease both; }
.sp-chat__menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 9px; background: none; text-align: left; font-size: 13.5px; color: #1e2522; }
.sp-chat__menu button:hover { background: rgba(25, 61, 45, 0.063); }
/* пояснение в меню (не кнопка): почему у модератора нет пункта «Забанить» (v2.22) */
.sp-chat__note { display: flex; align-items: flex-start; gap: 10px; max-width: 250px; padding: 7px 10px; font-size: 12px; line-height: 1.35; color: var(--ch-mut); }
.sp-chat__note > i { width: 16px; margin-top: 2px; text-align: center; flex: 0 0 auto; }
.sp-chat__menu button > i { width: 16px; text-align: center; color: var(--ch-mut); flex: 0 0 auto; }
.sp-chat__menu button.is-danger, .sp-chat__menu button.is-danger > i { color: #ba2c2c; }
.sp-chat__menu button.is-on > i { color: #298e69; }
.sp-chat__menu button.is-on::after { content: "вкл"; margin-left: auto; font-size: 11px; color: #298e69; }
.sp-chat__sep { display: block; height: 1px; margin: 5px 6px; background: var(--ch-line); }

/* ---------- Ввод ---------- */
.sp-chat__foot { flex: 0 0 auto; border-top: 1px solid var(--ch-line); background: rgba(255, 255, 255, 0.22); padding-bottom: env(safe-area-inset-bottom, 0); }
.sp-chat__reply { display: flex; align-items: center; gap: 9px; padding: 7px 12px; border-bottom: 1px solid var(--ch-line); font-size: 12.5px; color: #3a4740; }
.sp-chat__reply > i { color: #2f7a4f; }
.sp-chat__reply > div { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-chat__reply b { color: #2f7a4f; margin-right: 6px; }
.sp-chat__reply button { flex: 0 0 auto; width: 24px; height: 24px; border: 0; border-radius: 7px; background: var(--ch-in); font-size: 16px; line-height: 1; color: var(--ch-mut); }
.sp-chat__state { padding: 14px 16px; text-align: center; font-size: 13px; color: #2e3833; }
.sp-chat__state a { color: #2f7a4f; }
.sp-chat__input { display: flex; align-items: flex-end; gap: 6px; padding: 9px 10px; }
.sp-chat__input > button { flex: 0 0 auto; width: 38px; height: 38px; border: 0; border-radius: 12px; background: var(--ch-in); display: grid; place-items: center; font-size: 17px; color: #3a4740; transition: background .15s, transform .15s, color .15s; }
.sp-chat__input > button:hover { background: rgba(25, 61, 45, 0.084); color: #101412; }
.sp-chat .sp-chat__input textarea { flex: 1 1 auto; min-width: 0; min-height: 38px; max-height: 120px; resize: none; padding: 9px 12px; border-radius: 14px; border: 1px solid var(--ch-line);
  background: rgba(255, 255, 255, 0.28); color: #101412; font: inherit; line-height: 1.4; outline: 0; box-shadow: none; overflow-y: auto; scrollbar-width: thin; }
.sp-chat .sp-chat__input textarea:focus { border-color: #2f7a4f; box-shadow: 0 0 0 3px rgba(110, 170, 60, 0.063); }
.sp-chat .sp-chat__input textarea::placeholder { color: #556881; }
.sp-chat__len { flex: 0 0 auto; align-self: center; min-width: 0; font-size: 11.5px; color: var(--ch-mut); font-variant-numeric: tabular-nums; }
.sp-chat__len.is-low { color: #ba2c2c; }
.sp-chat__input > .sp-chat__send { background: var(--ch-me); color: #101412; box-shadow: 0 6px 18px rgba(110, 170, 60, 0.158); }
.sp-chat__input > .sp-chat__send:hover { background: var(--ch-me); filter: brightness(1.12); transform: translateY(-1px); }
.sp-chat.is-sending .sp-chat__send { opacity: .6; pointer-events: none; }
.sp-chat__smiles { border-bottom: 1px solid var(--ch-line); padding: 8px 10px; animation: sp-chat-up .18s ease both; }
.sp-chat__fmt { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.sp-chat__fmt button { min-width: 32px; height: 28px; padding: 0 9px; border-radius: 8px; border: 1px solid var(--ch-line); background: var(--ch-in); font-size: 12.5px; }
.sp-chat__fmt button:hover { border-color: rgba(47, 122, 79, 0.405); }
.sp-chat__smgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 2px; max-height: 164px; overflow-y: auto; scrollbar-width: thin; }
.sp-chat__sm { height: 38px; border: 0; border-radius: 9px; background: none; display: grid; place-items: center; transition: background .12s, transform .12s; }
.sp-chat__sm:hover { background: rgba(25, 61, 45, 0.07); transform: scale(1.15); }
.sp-chat__sm img { width: 28px; height: 28px; display: block; }

/* ---------- Кнопка «ЧАТ»: счётчик непрочитанных ---------- */
.sp-chat-badge { display: inline-block; min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px; border-radius: 999px; background: #f43f5e; color: #101412; font: 700 11px/18px Arial, sans-serif;
  text-align: center; letter-spacing: 0; box-shadow: 0 0 0 2px rgba(32, 59, 42, 0.27); animation: sp-chat-pop .2s ease both; }
.sp-chat-badge.is-me { background: #40964f; box-shadow: 0 0 0 2px rgba(32, 59, 42, 0.27), 0 0 12px rgba(110, 170, 60, 0.28); }
.sp-chat-badge[hidden] { display: none; }
html.sp-chat-open .go2_ajaxchat { opacity: .35; }

/* Страница чата: вводная строка */
.sp-chatpage__lead { margin: 4px 0 12px; font-size: 13px; line-height: 1.5; color: #47564e; text-align: center; }
.sp-chatpage__lead span { color: #2f7a4f; border-bottom: 1px dotted #2f7a4f; cursor: pointer; }

@keyframes sp-chat-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes sp-chat-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes sp-chat-pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes sp-chat-side { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes sp-chat-pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.165); } 70%, 100% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); } }
@keyframes sp-chat-flash { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 3px rgba(110, 170, 60, 0.245), 0 0 26px rgba(110, 170, 60, 0.21); } }
@media (prefers-reduced-motion: reduce) {
  .sp-chat--drawer { transition: none; }
  .sp-msg, .sp-chat__down, .sp-chat__menu, .sp-chat__sheetbox, .sp-chat__smiles, .sp-chat__people, .sp-chat__toast, .sp-chat-badge { animation: none; }
  .sp-chat__online i { animation: none; }
}
