/* ============================================
   ЧАТЫ 2.0 (18.10) — три колонки: список · переписка · панель собеседника
   ============================================
   Решения владельца 18.10 (наброски https://claude.ai/artifact/CKpqkenZSKviGh8y24anvz): раскладка А,
   свои сообщения «Графит», реакции 6 + «+», эмодзи Apple, смайлы 7TV.

   Новые классы — с префиксом ch-: в наброске короткий общий класс (.pop) достался и значку реакции,
   и всплывающему окну, и реакция улетала наверх растянутой. Старые классы ниже (chat-list-item,
   message-bubble…) остались только для вкладки «Telegram» (frontend/tg-chats.js) — перекрашены под новый вид.
   Никакого backdrop-filter: живое размытие тормозит на машине владельца. */

.ch-page {
    --ch-bg: #0F1110;
    --ch-card: #161817;
    --ch-card2: #1D201F;
    --ch-card3: #252928;
    --ch-line: rgba(255, 255, 255, 0.07);
    --ch-line2: rgba(255, 255, 255, 0.12);
    --ch-fg: #E8E8E8;
    --ch-fg2: #A3A8A6;
    --ch-fg3: #6E7471;
    --ch-acc: #00E599;
    --ch-acc-ink: #03140D;
    --ch-acc-soft: rgba(0, 229, 153, 0.12);
    --ch-own: #1E2A25;
    --ch-danger: #FF3355;
    --ch-warn: #F0B44E;
    height: calc(100dvh - 170px);
    min-height: 560px;
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    background: var(--ch-card);
    border: 1px solid var(--ch-line);
    border-radius: 18px;
    overflow: hidden;
    margin: 16px 0 24px;
    position: relative;
    color: var(--ch-fg);
}
body.ch-panel-open .ch-page { grid-template-columns: 320px minmax(0, 1fr) 312px; }
.ch-page.ch-drop::after {
    content: 'Отпустите, чтобы прикрепить картинку';
    position: absolute; inset: 10px; z-index: 50;
    display: flex; align-items: center; justify-content: center;
    border: 2px dashed rgba(0, 229, 153, 0.6); border-radius: 14px;
    background: rgba(10, 12, 11, 0.85); color: var(--ch-acc); font-weight: 700; font-size: 1rem;
    pointer-events: none;
}
.ch-page button { font-family: inherit; }
.ch-page :focus-visible { outline: 2px solid var(--ch-acc); outline-offset: 2px; }
.ch-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ch-card3); border-top-color: var(--ch-acc); display: inline-block; animation: chSpin 0.8s linear infinite; vertical-align: -3px; }
@keyframes chSpin { to { transform: rotate(360deg); } }

/* ----- ЛЕВАЯ КОЛОНКА ----- */
.ch-side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--ch-line); background: var(--ch-card); }
.ch-src { display: flex; gap: 4px; margin: 12px 12px 0; padding: 3px; background: var(--ch-bg); border-radius: 11px; }
.ch-src .chat-source-tab { flex: 1; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--ch-fg2); font-weight: 600; font-size: 0.82rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background 0.15s, color 0.15s; }
.ch-src .chat-source-tab:hover { color: var(--ch-fg); }
.ch-src .chat-source-tab.active { background: var(--ch-card3); color: var(--ch-fg); }
.ch-search { position: relative; display: block; margin: 10px 12px 0; padding: 0; }
.ch-search[hidden] { display: none; }
.ch-search svg { position: absolute; left: 11px; top: 10px; width: 16px; height: 16px; stroke: var(--ch-fg3); fill: none; stroke-width: 2; pointer-events: none; }
.ch-search input { width: 100%; height: 36px; border-radius: 11px; border: 1px solid var(--ch-line); background: var(--ch-bg); color: var(--ch-fg); padding: 0 12px 0 34px; font: inherit; font-size: 0.84rem; }
.ch-search input:focus { outline: none; border-color: rgba(0, 229, 153, 0.45); }
.ch-filters { display: flex; gap: 6px; padding: 10px 12px 6px; flex-wrap: wrap; }
.ch-filters[hidden] { display: none; }
.ch-chip { height: 28px; padding: 0 11px; border-radius: 99px; border: 0; background: var(--ch-card2); color: var(--ch-fg2); font-size: 0.78rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; transition: background 0.15s, color 0.15s, box-shadow 0.15s; }
.ch-chip:hover { color: var(--ch-fg); }
.ch-chip.on { background: var(--ch-fg); color: #0A0A0A; }
.ch-chip i { font-style: normal; font-size: 0.7rem; color: var(--ch-acc); }
.ch-chip.on i { color: var(--ch-acc-ink); background: var(--ch-acc); border-radius: 99px; padding: 0 5px; }
.ch-chip.ghost { background: none; box-shadow: inset 0 0 0 1px var(--ch-line2); color: var(--ch-fg3); }
.ch-items { flex: 1; overflow-y: auto; padding: 2px 8px 8px; scrollbar-width: thin; scrollbar-color: var(--ch-card3) transparent; }
.ch-items[hidden] { display: none; }

.ch-li { width: 100%; display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 11px; align-items: center; padding: 9px; border: 0; border-radius: 12px; background: none; color: inherit; text-align: left; cursor: pointer; transition: background 0.12s; }
.ch-li:hover { background: var(--ch-card2); }
.ch-li.on { background: var(--ch-card3); }
.ch-li-body { min-width: 0; display: grid; gap: 3px; }
.ch-li-top, .ch-li-bot { display: flex; align-items: center; gap: 6px; min-width: 0; }
/* Ник целиком, без многоточия (правило владельца 08.10): длинный переносится на вторую строку. */
.ch-li-name { font-weight: 600; font-size: 0.9rem; min-width: 0; overflow-wrap: anywhere; }
/* 14.11 (снимки обзора): «kirill.trade» рвался на «kirill.» и «trade»: значки и время сжимали ник до первой точки.
   Ник со значками теперь отдельный блок с переносом: ник держит свою ширину, а значки и «оффер» уходят на вторую строку.
   Сам ник переносится, только если не влезает в строку целиком. Время стоит на линии ника */
.ch-li-nm { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-left: -6px; }
/* у значка тарифа и обёртки ранга свой отступ слева 6 px (common.css .tier-badge, rank.js tierAndRankHtml): тот же отступ всем,
   а блоку -6 px, тогда перенесённый значок встаёт ровно под ником, а не со сдвигом */
.ch-li-nm > * { margin-left: 6px; }
.ch-li-nm, .ch-li-nm + .ch-li-time { align-self: baseline; }
.ch-li-time { margin-left: auto; font-size: 0.72rem; color: var(--ch-fg3); font-variant-numeric: tabular-nums; flex: none; }
.ch-li-time.unr { color: var(--ch-acc); }
.ch-li-pv { flex: 1; min-width: 0; font-size: 0.8rem; color: var(--ch-fg2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Строка MySkins: короткие строки карточек («Для пробного нужно от 200$ без трейд-бана», «Место освободилось: запустите
   пробный Prime») в колонку 300–340 px одной строкой не влезают — две строки вместо многоточия (05.11, проверка глазами).
   Длинный ответ владельца по-прежнему обрывается, но после второй строки. */
.ch-li.off .ch-li-pv { white-space: normal; overflow-wrap: anywhere; line-height: 1.35; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.ch-li-pv .ch-me { color: var(--ch-fg3); }
.ch-li-pv .ch-draft { color: var(--ch-danger); }
.ch-li-pv .ch-typing-txt { color: var(--ch-acc); }
.ch-li-pv .ch-pv-offer { color: var(--ch-acc); font-weight: 600; }
.ch-li-pv .ch-pv-sys { color: var(--ch-fg3); }
.ch-pv-ico svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; vertical-align: -2px; margin-right: 3px; }
.ch-li-ico svg { width: 14px; height: 14px; stroke: var(--ch-fg3); fill: none; stroke-width: 2; flex: none; display: block; }
.ch-badge { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--ch-acc); color: var(--ch-acc-ink); font-size: 0.7rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.ch-badge.muted { background: var(--ch-card3); color: var(--ch-fg2); }
.ch-tag { flex: none; font-size: 0.64rem; font-weight: 700; padding: 1px 6px; border-radius: 6px; }
.ch-tag.offer { color: var(--ch-acc); background: var(--ch-acc-soft); }
.ch-side-foot { border-top: 1px solid var(--ch-line); padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; }
.ch-foot-btn { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border: 0; border-radius: 9px; background: none; color: var(--ch-fg3); font-size: 0.76rem; cursor: pointer; text-align: left; }
.ch-foot-btn:hover { background: var(--ch-card2); color: var(--ch-fg); }
.ch-foot-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.ch-foot-btn.on svg { stroke: var(--ch-acc); }

/* аватар: буква на цветном круге, поверх — фото Steam (не загрузилось — остаётся буква) */
.ch-av { --h: 160; position: relative; width: 46px; height: 46px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1rem; color: rgba(255, 255, 255, 0.92); background: linear-gradient(145deg, hsl(var(--h) 50% 42%), hsl(calc(var(--h) + 40) 45% 22%)); }
.ch-av img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.ch-av.md { width: 40px; height: 40px; font-size: 0.9rem; }
.ch-av.lg { width: 76px; height: 76px; font-size: 1.6rem; }
.ch-av.on::after { content: ''; position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--ch-acc); box-shadow: 0 0 0 2.5px var(--ch-card); z-index: 1; }
.ch-av.lg.on::after { width: 16px; height: 16px; right: 3px; bottom: 3px; }

/* ----- ЦЕНТР ----- */
.ch-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; background: radial-gradient(rgba(255, 255, 255, 0.032) 1px, transparent 1.2px) 0 0 / 22px 22px, var(--ch-bg); }
.ch-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 40px; color: var(--ch-fg3); font-size: 0.88rem; }
.ch-empty b { color: var(--ch-fg); font-size: 1.05rem; }
.ch-empty span { max-width: 340px; }
.ch-empty-art .ch-emo { width: 52px; height: 52px; }
.ch-thread { display: flex; flex-direction: column; min-height: 0; height: 100%; position: relative; }
.ch-head { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 0 12px 0 14px; border-bottom: 1px solid var(--ch-line); background: var(--ch-card); flex: none; }
.ch-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 11px; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; padding: 6px 4px; border-radius: 10px; }
.ch-who-txt { min-width: 0; display: grid; gap: 1px; }
.ch-who-name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.98rem; min-width: 0; }
.ch-who-name > span:first-child { min-width: 0; overflow-wrap: anywhere; }
/* Строка статуса: «не администрация» у похожего на MySkins ника стоит здесь, а не у имени (05.11). */
.ch-who-st-row { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-width: 0; }
.ch-who-st { font-size: 0.78rem; color: var(--ch-fg3); }
.ch-who-st.on { color: var(--ch-acc); }
.ch-head-acts { display: flex; gap: 2px; flex: none; }
.ch-hb { width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; color: var(--ch-fg2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.ch-hb:hover { background: var(--ch-card2); color: var(--ch-fg); }
.ch-hb.on { color: var(--ch-acc); background: var(--ch-acc-soft); }
.ch-hb svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ch-find { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--ch-line); background: var(--ch-card); flex: none; }
.ch-find[hidden] { display: none; }
.ch-find-ico svg { width: 16px; height: 16px; stroke: var(--ch-fg3); fill: none; stroke-width: 2; display: block; }
.ch-find input { flex: 1; min-width: 0; height: 34px; border-radius: 10px; border: 1px solid var(--ch-line2); background: var(--ch-bg); color: var(--ch-fg); font: inherit; font-size: 0.86rem; padding: 0 12px; }
.ch-find input:focus { outline: none; border-color: rgba(0, 229, 153, 0.45); }
#chFindN { font-size: 0.78rem; color: var(--ch-fg2); font-variant-numeric: tabular-nums; min-width: 72px; text-align: right; }

.ch-feed { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 18px 8px; scrollbar-width: thin; scrollbar-color: var(--ch-card3) transparent; overscroll-behavior: contain; }
.ch-feed-in { display: flex; flex-direction: column; gap: 2px; min-height: 100%; justify-content: flex-end; }
.ch-feed-note { align-self: center; margin: auto; color: var(--ch-fg3); font-size: 0.84rem; }
.ch-feed-note button { border: 0; background: none; color: var(--ch-acc); font-weight: 600; cursor: pointer; }
.ch-older { align-self: center; display: flex; gap: 8px; align-items: center; color: var(--ch-fg3); font-size: 0.78rem; padding: 6px; }
.ch-older-gap { height: 30px; flex: none; }
.ch-day { position: sticky; top: 4px; z-index: 3; align-self: center; margin: 12px 0 8px; pointer-events: none; }
.ch-day span { display: inline-block; font-size: 0.74rem; font-weight: 600; color: var(--ch-fg2); background: rgba(22, 24, 23, 0.94); border: 1px solid var(--ch-line); padding: 4px 12px; border-radius: 99px; }
.ch-newmark { display: flex; align-items: center; gap: 10px; margin: 10px 0; color: var(--ch-acc); font-size: 0.74rem; font-weight: 700; }
.ch-newmark::before, .ch-newmark::after { content: ''; flex: 1; border-top: 1px solid rgba(0, 229, 153, 0.3); }
.ch-banner { margin: 6px auto 10px; max-width: 560px; border-radius: 14px; padding: 12px 14px; display: grid; grid-template-columns: 20px 1fr; gap: 10px; font-size: 0.82rem; color: var(--ch-fg2); }
.ch-banner.warn { background: rgba(240, 180, 78, 0.08); border: 1px solid rgba(240, 180, 78, 0.28); }
.ch-banner svg { width: 20px; height: 20px; stroke: var(--ch-warn); fill: none; stroke-width: 2; }
.ch-banner b { display: block; color: var(--ch-fg); margin-bottom: 2px; }
.ch-start { margin: auto; text-align: center; display: grid; gap: 6px; justify-items: center; color: var(--ch-fg3); font-size: 0.84rem; padding: 30px 10px; }
.ch-start b { color: var(--ch-fg); font-size: 1rem; }
.ch-start-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 4px; }

/* ----- СООБЩЕНИЕ ----- */
.ch-m { display: flex; flex-direction: column; position: relative; max-width: min(76%, 620px); }
.ch-m.them { align-self: flex-start; align-items: flex-start; }
.ch-m.me { align-self: flex-end; align-items: flex-end; }
.ch-m.first { margin-top: 8px; }
.ch-bub { position: relative; max-width: 100%; border-radius: 18px; padding: 7px 12px; font-size: 0.92rem; line-height: 1.42; overflow-wrap: anywhere; }
.them .ch-bub { background: var(--ch-card2); border-radius: 6px 18px 18px 6px; }
.them.first .ch-bub { border-top-left-radius: 18px; }
.them.last .ch-bub { border-bottom-left-radius: 4px; }
.me .ch-bub { background: var(--ch-own); border-radius: 18px 6px 6px 18px; }
.me.first .ch-bub { border-top-right-radius: 18px; }
.me.last .ch-bub { border-bottom-right-radius: 4px; }
.ch-m.fresh { animation: chIn 0.22s cubic-bezier(.2, .8, .2, 1); }
@keyframes chIn { from { opacity: 0; transform: translateY(8px) scale(0.985); } to { opacity: 1; transform: none; } }
.ch-m.flash .ch-bub { animation: chFlash 1.2s ease; }
@keyframes chFlash { 0%, 60% { box-shadow: 0 0 0 3px rgba(0, 229, 153, 0.6); } 100% { box-shadow: 0 0 0 0 rgba(0, 229, 153, 0); } }
.ch-m.hit .ch-bub { box-shadow: 0 0 0 2px var(--ch-warn); }
.ch-text { display: flow-root; white-space: pre-wrap; }
.ch-text-meta { min-height: 14px; }
.ch-meta { float: right; position: relative; top: 7px; margin-left: 10px; display: inline-flex; align-items: center; gap: 3px; font-size: 0.68rem; color: var(--ch-fg3); line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; user-select: none; }
.me .ch-meta { color: rgba(232, 232, 232, 0.5); }
.ch-meta i { font-style: normal; }
.ch-st { display: inline-flex; }
.ch-st svg { width: 15px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ch-st.sending svg { width: 11px; height: 11px; }
.ch-st.read svg { stroke: var(--ch-acc); }
.ch-st.failed { color: var(--ch-danger); font-weight: 800; font-size: 0.8rem; }
.ch-emo { width: 20px; height: 20px; vertical-align: -4px; margin: 0 1px; }
.ch-emo.sm { width: 15px; height: 15px; vertical-align: -3px; }
.ch-7tv { height: 28px; width: auto; vertical-align: -8px; margin: -4px 1px; }
.ch-7tv.sm { height: 17px; vertical-align: -4px; margin: 0 1px; }
.ch-m.jumbo .ch-bub { background: none; padding: 2px 0; }
.ch-m.jumbo .ch-text .ch-emo { width: 46px; height: 46px; vertical-align: 0; }
.ch-m.jumbo .ch-text .ch-7tv { height: 64px; vertical-align: 0; margin: 0 2px; }
.ch-m.jumbo .ch-meta { float: none; display: flex; width: max-content; top: 0; margin: 3px 0 0 auto; padding: 3px 7px; border-radius: 99px; background: rgba(22, 24, 23, 0.85); color: var(--ch-fg2); }
.ch-m.them.jumbo .ch-meta { margin-left: 0; }
.ch-img { display: block; max-width: min(320px, 100%); max-height: 320px; border-radius: 12px; margin: 2px -6px 6px; cursor: zoom-in; object-fit: cover; background: var(--ch-card3); }
.ch-img:only-child, .ch-img + .ch-text-meta { margin-bottom: 0; }
.ch-quote { display: grid; gap: 1px; width: 100%; text-align: left; margin: 2px 0 6px; padding: 5px 10px; border: 0; border-left: 3px solid var(--ch-acc); border-radius: 10px; background: rgba(0, 0, 0, 0.2); color: inherit; font-size: 0.8rem; cursor: pointer; }
.ch-quote b { color: var(--ch-acc); font-weight: 700; }
.ch-quote span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0.85; }
.ch-quote svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; vertical-align: -2px; margin-right: 3px; }
.ch-link { color: #6CC3FF; text-decoration: underline; text-underline-offset: 2px; }
.ch-link.lookalike { color: var(--ch-danger); text-decoration-style: wavy; }
.ch-warn { margin-top: 6px; max-width: 440px; display: grid; grid-template-columns: 20px 1fr; gap: 9px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 51, 85, 0.1); border: 1px solid rgba(255, 51, 85, 0.35); font-size: 0.8rem; color: var(--ch-fg2); }
.ch-warn > svg { width: 20px; height: 20px; stroke: var(--ch-danger); fill: none; stroke-width: 2; }
.ch-warn b { display: block; color: var(--ch-fg); font-size: 0.84rem; margin-bottom: 2px; }
.ch-warn code { font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace; font-size: 0.78rem; color: var(--ch-fg); }
.ch-warn code u { text-decoration: none; color: var(--ch-danger); background: rgba(255, 51, 85, 0.25); border-radius: 3px; padding: 0 1px; }
.ch-warn-acts { display: flex; gap: 6px; margin-top: 8px; }
.ch-warn-acts button { height: 28px; padding: 0 10px; border: 0; border-radius: 8px; font-size: 0.76rem; font-weight: 700; background: var(--ch-card3); color: var(--ch-fg); cursor: pointer; }
.ch-warn-acts button.dng { background: var(--ch-danger); color: #fff; }
.ch-failed { margin-top: 4px; font-size: 0.74rem; color: var(--ch-danger); }
.ch-failed button { border: 0; background: none; padding: 0; color: var(--ch-fg); font-weight: 700; font-size: 0.74rem; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* реакции */
.ch-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ch-rc { height: 26px; padding: 0 7px 0 5px; border: 0; border-radius: 99px; background: var(--ch-card2); box-shadow: inset 0 0 0 1px var(--ch-line); display: inline-flex; align-items: center; gap: 4px; color: var(--ch-fg2); font-size: 0.78rem; cursor: pointer; transition: transform 0.12s; }
.ch-rc:hover { transform: translateY(-1px); }
.ch-rc .ch-emo { width: 18px; height: 18px; margin: 0; vertical-align: 0; }
.ch-rc .ch-7tv { height: 20px; margin: 0; vertical-align: 0; }
.ch-rc b { font-weight: 700; font-variant-numeric: tabular-nums; }
.ch-rc.mine { background: var(--ch-acc-soft); box-shadow: inset 0 0 0 1px rgba(0, 229, 153, 0.5); color: var(--ch-acc); }
.ch-rc.pop { animation: chRcPop 0.32s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes chRcPop { from { transform: scale(0.4); } to { transform: scale(1); } }

/* панель действий при наведении */
.ch-tools { position: absolute; top: -38px; z-index: 6; display: flex; align-items: center; gap: 1px; padding: 3px; background: var(--ch-card3); border: 1px solid var(--ch-line2); border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); opacity: 0; pointer-events: none; transform: translateY(4px); transition: opacity 0.12s, transform 0.12s; }
.them .ch-tools { left: 0; }
.me .ch-tools { right: 0; }
.ch-m:hover .ch-tools, .ch-m.tools-on .ch-tools, .ch-m:focus-within .ch-tools { opacity: 1; pointer-events: auto; transform: none; }
.ch-tools button { width: 32px; height: 32px; border: 0; border-radius: 9px; background: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: transform 0.1s, background 0.1s; }
.ch-tools button:hover { background: rgba(255, 255, 255, 0.08); transform: scale(1.12); }
.ch-tools .ch-emo { width: 22px; height: 22px; margin: 0; vertical-align: 0; }
.ch-tools svg { width: 18px; height: 18px; stroke: var(--ch-fg2); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ch-tools-sep { width: 1px; height: 20px; background: var(--ch-line2); margin: 0 3px; }
.ch-menu { position: absolute; top: 0; z-index: 8; min-width: 200px; padding: 5px; display: grid; background: var(--ch-card3); border: 1px solid var(--ch-line2); border-radius: 12px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5); }
.them .ch-menu { left: calc(100% + 8px); }
.me .ch-menu { right: calc(100% + 8px); }
.ch-menu button, .ch-sheet-acts button { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--ch-fg); font-size: 0.86rem; text-align: left; cursor: pointer; white-space: nowrap; }
.ch-menu button:hover { background: rgba(255, 255, 255, 0.06); }
.ch-menu svg, .ch-sheet-acts svg { width: 17px; height: 17px; stroke: var(--ch-fg2); fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ch-menu .dng, .ch-sheet-acts .dng { color: var(--ch-danger); }
.ch-menu .dng svg, .ch-sheet-acts .dng svg { stroke: var(--ch-danger); }

.ch-typing { align-self: flex-start; margin-top: 8px; background: var(--ch-card2); border-radius: 18px 18px 18px 4px; padding: 12px 14px; display: flex; gap: 4px; }
.ch-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ch-fg2); animation: chDot 1.2s infinite ease-in-out; }
.ch-typing i:nth-child(2) { animation-delay: 0.15s; }
.ch-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes chDot { 0%, 60%, 100% { opacity: 0.3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.ch-sys { align-self: center; display: flex; align-items: center; gap: 7px; max-width: 86%; margin: 10px 0 6px; padding: 6px 12px; border-radius: 12px; background: rgba(22, 24, 23, 0.92); border: 1px solid var(--ch-line); font-size: 0.8rem; color: var(--ch-fg2); text-align: center; }
.ch-sys a { color: var(--ch-acc); font-weight: 600; text-decoration: none; white-space: nowrap; }
.ch-sys a:hover { text-decoration: underline; }
.ch-sys time { font-size: 0.7rem; color: var(--ch-fg3); font-variant-numeric: tabular-nums; }
.ch-sys-ico svg { width: 14px; height: 14px; stroke: var(--ch-acc); fill: none; stroke-width: 2.4; display: block; }
.ch-down { position: absolute; right: 18px; bottom: 96px; z-index: 7; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--ch-line2); background: var(--ch-card3); color: var(--ch-fg); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); }
.ch-down[hidden] { display: none; }
.ch-down svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }
.ch-down b { position: absolute; top: -6px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--ch-acc); color: var(--ch-acc-ink); font-size: 0.68rem; display: inline-flex; align-items: center; justify-content: center; }
.ch-down b[hidden] { display: none; }

/* ----- КАРТОЧКА ПРЕДМЕТА ----- */
.ch-item { --rc: #8E9BA8; width: 300px; max-width: 100%; margin: 3px -6px 6px; border-radius: 14px; background: var(--ch-card); box-shadow: inset 0 0 0 1px var(--ch-line); overflow: hidden; color: var(--ch-fg); }
.ch-item-img { position: relative; height: 128px; display: flex; align-items: center; justify-content: center; background: radial-gradient(60% 75% at 50% 58%, color-mix(in srgb, var(--rc) 30%, transparent), transparent 70%), var(--ch-bg); }
.ch-item-img img { max-height: 112px; max-width: 86%; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5)); }
.ch-item-rare { position: absolute; left: 8px; top: 8px; }
.ch-item-body { padding: 10px 12px 4px; display: grid; gap: 2px; }
.ch-item-name { font-weight: 700; font-size: 0.9rem; }
.ch-item-sub { font-size: 0.8rem; color: var(--ch-fg2); }
.ch-item-fl { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 0.76rem; color: var(--ch-fg2); }
.ch-item-fl code { font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace; color: var(--ch-fg); font-size: 0.76rem; }
.ch-item-pat { color: var(--ch-fg3); }
.ch-item .fbar { margin: 6px 0 2px; }
.ch-item-st { display: flex; gap: 4px; margin-top: 4px; }
.ch-item-st img { width: 30px; height: 23px; object-fit: contain; }
.ch-item-price { display: flex; align-items: baseline; gap: 6px; padding: 4px 0 2px; }
.ch-item-price strong { font-size: 1.05rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ch-item-price span { font-size: 0.74rem; color: var(--ch-fg3); }
.ch-item-act { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; padding: 8px 12px 12px; }
.ch-item-act a { height: 32px; border-radius: 9px; background: var(--ch-card3); color: var(--ch-fg); font-size: 0.8rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.ch-item-act a:hover { background: #2D3231; }
.ch-linkitem { --rc: #8E9BA8; display: flex; align-items: center; gap: 10px; margin: 6px -4px 2px; padding: 6px 10px 6px 6px; border-radius: 12px; background: var(--ch-card); box-shadow: inset 0 0 0 1px var(--ch-line); color: var(--ch-fg); text-decoration: none; max-width: 320px; }
.ch-linkitem img { width: 54px; height: 42px; object-fit: contain; border-radius: 8px; background: radial-gradient(60% 75% at 50% 58%, color-mix(in srgb, var(--rc) 30%, transparent), transparent 70%), var(--ch-bg); }
.ch-linkitem span { display: grid; min-width: 0; }
.ch-linkitem b { font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-linkitem em { font-style: normal; font-size: 0.72rem; color: var(--ch-fg3); }

/* ----- КАРТОЧКА ОФФЕРА ----- */
.ch-m.offer .ch-bub { background: none; padding: 0; }
.ch-oc { width: 400px; max-width: 100%; display: grid; gap: 10px; padding: 12px; border-radius: 16px; background: var(--ch-card); box-shadow: inset 0 0 0 1px var(--ch-line2); }
.ch-oc-head { display: flex; align-items: center; gap: 8px; }
.ch-oc-tag { font-size: 0.64rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ch-acc-ink); background: var(--ch-acc); padding: 2px 8px; border-radius: 6px; }
.ch-oc-st { font-size: 0.8rem; font-weight: 600; color: var(--ch-fg2); }
.ch-oc-st.accepted, .ch-oc-st.sent { color: var(--ch-acc); }
.ch-oc-st.declined, .ch-oc-st.withdrawn, .ch-oc-st.closed { color: var(--ch-fg3); }
.ch-oc-head time { margin-left: auto; font-size: 0.7rem; color: var(--ch-fg3); font-variant-numeric: tabular-nums; }
.ch-oc-cols { display: grid; grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr); gap: 6px; align-items: stretch; }
.ch-oc-side { display: grid; gap: 6px; align-content: start; min-width: 0; padding: 8px 9px; border-radius: 12px; background: var(--ch-bg); }
.ch-oc-side strong { font-size: 0.95rem; font-weight: 800; font-variant-numeric: tabular-nums; align-self: end; }
.ch-oc-lbl { font-size: 0.7rem; color: var(--ch-fg3); font-weight: 600; }
.ch-oc-items { display: flex; flex-wrap: wrap; gap: 4px; }
.ch-oc-th { --rc: #8E9BA8; width: 46px; height: 36px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: radial-gradient(60% 70% at 50% 55%, color-mix(in srgb, var(--rc) 32%, transparent), transparent 75%), var(--ch-card2); }
.ch-oc-th img { max-height: 31px; max-width: 42px; }
.ch-oc-th.more { font-size: 0.76rem; font-weight: 700; color: var(--ch-fg2); }
.ch-oc-arrow { display: flex; align-items: center; justify-content: center; }
.ch-oc-arrow svg { width: 18px; height: 18px; stroke: var(--ch-fg3); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ch-oc-diff { font-size: 0.8rem; font-weight: 600; }
.ch-oc-diff.good { color: var(--ch-acc); }
.ch-oc-diff.bad { color: var(--ch-warn); }
.ch-oc-conf { font-size: 0.8rem; color: var(--ch-fg2); background: var(--ch-bg); border-radius: 10px; padding: 8px 10px; }
.ch-oc-acts { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 6px; }
.ch-oc-acts.two { grid-template-columns: 1fr 1.5fr; }
.ch-oc-acts.one { grid-template-columns: 1fr; }
.ch-oc-acts button, .ch-oc-acts a { height: 34px; border: 0; border-radius: 10px; background: var(--ch-card3); color: var(--ch-fg); font-size: 0.82rem; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.ch-oc-acts button:hover, .ch-oc-acts a:hover { background: #2D3231; }
.ch-oc-acts .pri { background: var(--ch-acc); color: var(--ch-acc-ink); }
.ch-oc-acts .pri:hover { background: #00cc82; }

/* ----- ПОЛЕ ВВОДА ----- */
.ch-compose { flex: none; position: relative; padding: 8px 14px 14px; }
.ch-pop-host { position: absolute; left: 0; right: 0; bottom: 100%; height: 0; z-index: 20; }
.ch-row { display: flex; align-items: flex-end; gap: 4px; padding: 6px; background: var(--ch-card); border: 1px solid var(--ch-line2); border-radius: 18px; transition: border-color 0.15s; }
.ch-row:focus-within { border-color: rgba(0, 229, 153, 0.4); }
.ch-row textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: transparent; color: var(--ch-fg); font: inherit; font-size: 0.92rem; line-height: 1.4; padding: 8px 4px; max-height: 160px; }
.ch-row textarea::placeholder { color: var(--ch-fg3); }
.ch-ib { width: 36px; height: 36px; border: 0; border-radius: 11px; background: none; color: var(--ch-fg2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.ch-ib:hover, .ch-ib.on { background: var(--ch-card2); color: var(--ch-fg); }
.ch-ib.on { color: var(--ch-acc); }
.ch-ib svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ch-send { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--ch-card3); color: var(--ch-fg3); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; transition: background 0.15s, color 0.15s, transform 0.1s; }
.ch-send.ready { background: var(--ch-acc); color: var(--ch-acc-ink); }
.ch-send.ready:active { transform: scale(0.92); }
.ch-send svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ch-bar { display: grid; grid-template-columns: 3px minmax(0, 1fr) 36px; gap: 10px; align-items: center; margin: 0 2px; padding: 6px 4px 6px 12px; background: var(--ch-card); border: 1px solid var(--ch-line); border-bottom: 0; border-radius: 14px 14px 0 0; font-size: 0.8rem; }
.ch-bar-line { height: 30px; background: var(--ch-acc); border-radius: 2px; }
.ch-bar b { display: block; color: var(--ch-acc); font-size: 0.76rem; }
.ch-bar span { display: block; color: var(--ch-fg2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 2px 8px; }
.ch-quick .ch-chip { background: var(--ch-card); box-shadow: inset 0 0 0 1px var(--ch-line2); color: var(--ch-fg); height: 30px; }
.ch-quick .ch-chip:hover { box-shadow: inset 0 0 0 1px rgba(0, 229, 153, 0.5); }
.ch-attach { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 2px 8px; }
.ch-att { position: relative; width: 64px; height: 64px; border-radius: 12px; overflow: hidden; background: var(--ch-card3); }
.ch-att img { width: 100%; height: 100%; object-fit: cover; }
.ch-att.uploading img { opacity: 0.45; }
.ch-att .ch-spin { position: absolute; left: 24px; top: 24px; }
.ch-att em { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-style: normal; font-weight: 800; color: #fff; background: rgba(255, 51, 85, 0.55); }
.ch-att button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.7); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.ch-att button svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.6; }
.ch-blocked { padding: 14px; border-radius: 14px; background: var(--ch-card); text-align: center; color: var(--ch-fg2); font-size: 0.86rem; }
.ch-blocked button { border: 0; background: none; color: var(--ch-acc); font-weight: 700; cursor: pointer; }

/* всплывающие окна над полем: выбор смайлов, инвентарь, шаблоны, подсказка 7TV */
.ch-pop { position: absolute; right: 14px; bottom: 6px; width: 380px; max-width: calc(100% - 28px); display: flex; flex-direction: column; background: var(--ch-card3); border: 1px solid var(--ch-line2); border-radius: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); overflow: hidden; animation: chPopIn 0.16s cubic-bezier(.2, .8, .2, 1); }
.ch-pop.left { left: 14px; right: auto; }
@keyframes chPopIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ch-pk-head { padding: 10px 12px 0; display: grid; gap: 8px; }
.ch-pk-title { font-size: 0.8rem; color: var(--ch-fg2); }
.ch-pk-title b { color: var(--ch-fg); margin-right: 4px; }
.ch-pk-tabs { display: flex; gap: 4px; padding: 3px; background: var(--ch-bg); border-radius: 10px; }
.ch-pk-tabs button { flex: 1; height: 30px; border: 0; border-radius: 7px; background: none; color: var(--ch-fg2); font-weight: 700; font-size: 0.82rem; cursor: pointer; }
.ch-pk-tabs button.on { background: var(--ch-card3); color: var(--ch-fg); box-shadow: inset 0 0 0 1px var(--ch-line2); }
.ch-pk-tabs small { font-size: 0.64rem; color: #29B6F6; font-weight: 800; }
.ch-pk-search { height: 34px; border-radius: 10px; border: 1px solid var(--ch-line); background: var(--ch-bg); color: var(--ch-fg); padding: 0 12px; font: inherit; font-size: 0.84rem; }
.ch-pk-search:focus { outline: none; border-color: rgba(0, 229, 153, 0.45); }
.ch-pk-cats { display: flex; gap: 2px; justify-content: space-between; }
.ch-pk-cats button { flex: 1; height: 30px; border: 0; border-radius: 8px; background: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0.75; }
.ch-pk-cats button:hover { background: rgba(255, 255, 255, 0.06); opacity: 1; }
.ch-pk-cats svg { width: 16px; height: 16px; stroke: var(--ch-fg2); fill: none; stroke-width: 2; }
.ch-pk-cats .ch-emo { margin: 0; vertical-align: 0; }
.ch-pk-body { height: 290px; overflow-y: auto; padding: 4px 8px 10px; scrollbar-width: thin; scrollbar-color: var(--ch-card) transparent; position: relative; }
.ch-pk-sec { padding: 8px 4px 4px; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ch-fg3); }
.ch-pk-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.ch-pk-grid button { aspect-ratio: 1; border: 0; border-radius: 9px; background: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background 0.1s, transform 0.1s; }
.ch-pk-grid button:hover { background: rgba(255, 255, 255, 0.08); transform: scale(1.12); }
.ch-pk-grid .ch-emo { width: 30px; height: 30px; margin: 0; vertical-align: 0; }
.ch-pk-grid.t7 { grid-template-columns: repeat(5, 1fr); gap: 4px; }
.ch-pk-grid.t7 button { aspect-ratio: auto; height: 62px; flex-direction: column; gap: 3px; }
.ch-pk-grid.t7 .ch-7tv { height: 36px; max-width: 58px; object-fit: contain; margin: 0; vertical-align: 0; }
.ch-pk-grid.t7 span { font-size: 0.6rem; color: var(--ch-fg3); max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-pk-empty { padding: 34px 10px; text-align: center; color: var(--ch-fg3); font-size: 0.82rem; display: grid; gap: 8px; justify-items: center; }
.ch-ac { position: absolute; left: 14px; bottom: 6px; min-width: 240px; display: grid; padding: 5px; background: var(--ch-card3); border: 1px solid var(--ch-line2); border-radius: 12px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5); }
.ch-ac-h { padding: 3px 8px 5px; font-size: 0.64rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ch-fg3); }
.ch-ac button { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 8px; border: 0; border-radius: 8px; background: none; color: var(--ch-fg); font-size: 0.86rem; font-weight: 600; cursor: pointer; }
.ch-ac button.on, .ch-ac button:hover { background: rgba(255, 255, 255, 0.07); }
.ch-ac .ch-7tv { height: 28px; max-width: 40px; object-fit: contain; margin: 0; vertical-align: 0; }
.ch-ac kbd { margin-left: auto; font: inherit; font-size: 0.66rem; color: var(--ch-fg3); border: 1px solid var(--ch-line2); border-radius: 5px; padding: 0 5px; }
.ch-items-pop { width: 440px; }
.ch-inv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding-top: 6px; }
.ch-inv-it { --rc: #8E9BA8; display: grid; gap: 1px; padding: 6px; border: 0; border-radius: 12px; background: var(--ch-card); box-shadow: inset 0 0 0 1px var(--ch-line); color: var(--ch-fg); text-align: left; cursor: pointer; min-width: 0; transition: box-shadow 0.12s; }
.ch-inv-it:hover { box-shadow: inset 0 0 0 1px rgba(0, 229, 153, 0.5); }
.ch-inv-img { height: 64px; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; background: radial-gradient(60% 70% at 50% 55%, color-mix(in srgb, var(--rc) 28%, transparent), transparent 70%), var(--ch-bg); }
.ch-inv-img img { max-height: 56px; max-width: 90%; }
.ch-inv-it b, .ch-inv-it > span { font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-inv-it > span { color: var(--ch-fg2); }
.ch-inv-it em { font-style: normal; display: flex; justify-content: space-between; gap: 4px; font-size: 0.7rem; margin-top: 2px; }
.ch-inv-it code { font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace; color: var(--ch-fg3); font-size: 0.66rem; }
.ch-inv-it strong { font-variant-numeric: tabular-nums; }
.ch-tpl-pop { padding-bottom: 12px; }
.ch-tpl-pop textarea { margin: 8px 12px 0; height: 150px; resize: vertical; border-radius: 10px; border: 1px solid var(--ch-line); background: var(--ch-bg); color: var(--ch-fg); font: inherit; font-size: 0.86rem; padding: 8px 10px; }
.ch-tpl-acts { display: flex; justify-content: flex-end; gap: 6px; padding: 8px 12px 0; }
.ch-tpl-acts button { height: 32px; padding: 0 14px; border: 0; border-radius: 9px; background: var(--ch-card2); color: var(--ch-fg); font-weight: 700; font-size: 0.82rem; cursor: pointer; }
.ch-tpl-acts .pri { background: var(--ch-acc); color: var(--ch-acc-ink); }

/* ----- ПАНЕЛЬ СОБЕСЕДНИКА ----- */
.ch-panel { border-left: 1px solid var(--ch-line); background: var(--ch-card); overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--ch-card3) transparent; }
.ch-panel[hidden] { display: none; }
.ch-pn { position: relative; padding: 22px 16px 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.ch-pn > * { min-width: 0; }
.ch-pn-x { position: absolute; top: 8px; right: 8px; }
.ch-pn-empty { padding: 40px; text-align: center; color: var(--ch-fg3); }
.ch-pn-top { display: grid; justify-items: center; gap: 4px; text-align: center; }
.ch-pn-name { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 1.05rem; font-weight: 800; overflow-wrap: anywhere; }
.ch-pn-rank { font-size: 0.8rem; color: var(--ch-fg2); }
/* 14.11 (репутация): ступень надёжности и оценка собеседника (frontend/chat.js repHTML, общие .ms-trust и .ms-rating) */
.ch-pn-rep { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; font-size: 0.8rem; }
.ch-pn-st { font-size: 0.78rem; color: var(--ch-fg3); }
.ch-pn-st.on { color: var(--ch-acc); }
.ch-pn-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.ch-pn-grid > div { display: grid; gap: 2px; padding: 10px 11px; border-radius: 12px; background: var(--ch-card2); min-width: 0; }
.ch-pn-grid > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
.ch-oc-note { padding: 8px 10px; border-radius: 10px; background: var(--ch-card2); font-size: 0.82rem; line-height: 1.4; overflow-wrap: anywhere; }
.ch-pn-grid strong { display: flex; align-items: center; gap: 4px; font-size: 1rem; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ch-pn-grid strong svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2.6; flex: none; }
.ch-pn-grid span { font-size: 0.7rem; color: var(--ch-fg3); line-height: 1.3; }
.ch-pn-grid .ok strong { color: var(--ch-acc); }
.ch-pn-grid .warn strong, .ch-pn-grid .bad strong { color: var(--ch-warn); }
.ch-pn-acts { display: grid; gap: 6px; }
.ch-pn-acts .row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.ch-pn-acts a { height: 38px; border-radius: 11px; background: var(--ch-card2); color: var(--ch-fg); font-size: 0.82rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; }
.ch-pn-acts a:hover { background: var(--ch-card3); }
.ch-pn-acts a.pri { height: 42px; background: var(--ch-acc); color: var(--ch-acc-ink); font-size: 0.88rem; }
.ch-pn-acts a.pri:hover { background: #00cc82; }
.ch-pn-acts svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ch-pn-sec { display: grid; gap: 8px; }
.ch-pn-sec h4 { margin: 0; display: flex; justify-content: space-between; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ch-fg3); }
.ch-pn-deal { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; color: inherit; text-decoration: none; font-size: 0.78rem; border-radius: 10px; padding: 2px; }
.ch-pn-deal:hover { background: var(--ch-card2); }
.ch-pn-deal .ii { width: 40px; height: 32px; border-radius: 8px; background: var(--ch-bg); display: flex; align-items: center; justify-content: center; }
.ch-pn-deal .ii img { max-height: 28px; max-width: 36px; }
/* 14.11 (снимки обзора): название сделки целиком, без многоточия, переносом; состояние справа в две строки, чтобы не отнимать место */
.ch-pn-deal b { display: block; font-weight: 600; overflow-wrap: break-word; line-height: 1.3; }
.ch-pn-deal span span { color: var(--ch-fg3); }
.ch-pn-deal em { font-style: normal; font-size: 0.7rem; font-weight: 700; color: var(--ch-fg2); max-width: 80px; text-align: right; line-height: 1.25; }
.ch-pn-deal em.confirmed { color: var(--ch-acc); }
.ch-pn-deal em.cancelled { color: var(--ch-fg3); }
.ch-pn-media { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ch-pn-media button { aspect-ratio: 1.2; border: 0; border-radius: 10px; background: var(--ch-bg); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ch-pn-media img { max-height: 70%; max-width: 86%; }
.ch-pn-row { display: flex; align-items: center; justify-content: space-between; font-size: 0.86rem; padding: 3px 0; }
.ch-sw { width: 38px; height: 22px; border: 0; border-radius: 99px; background: var(--ch-card3); position: relative; cursor: pointer; flex: none; transition: background 0.15s; }
.ch-sw::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--ch-fg2); transition: transform 0.15s, background 0.15s; }
.ch-sw.on { background: var(--ch-acc); }
.ch-sw.on::after { transform: translateX(16px); background: var(--ch-acc-ink); }
.ch-pn-link { border: 0; background: none; padding: 4px 0; text-align: left; font-size: 0.84rem; font-weight: 600; color: var(--ch-fg2); cursor: pointer; }
.ch-pn-link.dng { color: var(--ch-danger); }

/* ----- ЛИСТ ДЕЙСТВИЙ (телефон) ----- */
.ch-sheet-dim { position: fixed; inset: 0; z-index: 1500; background: rgba(0, 0, 0, 0.55); display: flex; flex-direction: column; justify-content: flex-end; animation: chFade 0.15s ease; }
@keyframes chFade { from { opacity: 0; } to { opacity: 1; } }
.ch-sheet { --ch-card: #161817; --ch-card2: #1D201F; --ch-card3: #252928; --ch-bg: #0F1110; --ch-line: rgba(255,255,255,.07); --ch-line2: rgba(255,255,255,.12); --ch-fg: #E8E8E8; --ch-fg2: #A3A8A6; --ch-fg3: #6E7471; --ch-acc: #00E599; --ch-acc-ink: #03140D; --ch-acc-soft: rgba(0,229,153,.12); --ch-danger: #FF3355; --ch-warn: #F0B44E;
    max-height: 88dvh; overflow-y: auto; display: grid; gap: 10px; padding: 10px 12px calc(16px + env(safe-area-inset-bottom, 0px)); border-radius: 22px 22px 0 0; background: var(--ch-card2); color: var(--ch-fg); animation: chSheetIn 0.2s cubic-bezier(.2, .8, .2, 1); }
@keyframes chSheetIn { from { transform: translateY(40px); } to { transform: none; } }
.ch-sheet::before { content: ''; justify-self: center; width: 38px; height: 5px; border-radius: 3px; background: var(--ch-card3); }
.ch-sheet-title { font-weight: 700; text-align: center; }
.ch-sheet-reacts { display: flex; justify-content: space-between; padding: 6px 8px; border-radius: 99px; background: var(--ch-card); }
.ch-sheet-reacts button { width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; display: inline-flex; align-items: center; justify-content: center; }
.ch-sheet-reacts button.mine { background: var(--ch-acc-soft); }
.ch-sheet-reacts .ch-emo { width: 30px; height: 30px; margin: 0; vertical-align: 0; }
.ch-sheet-reacts svg { width: 24px; height: 24px; stroke: var(--ch-fg2); fill: none; stroke-width: 2; }
.ch-sheet-acts { display: grid; padding: 4px; border-radius: 14px; background: var(--ch-card); }
.ch-sheet-acts button { height: 46px; font-size: 0.95rem; }
.ch-sheet .ch-pn { padding-top: 6px; }
.ch-sheet .ch-pn-x { display: none; }

/* ----- ЛАЙТБОКС ----- */
.chat-lightbox { display: none; position: fixed; inset: 0; z-index: 2000; background: rgba(0, 0, 0, 0.92); align-items: center; justify-content: center; cursor: zoom-out; }
.chat-lightbox.show { display: flex; }
.chat-lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 10px; transition: transform 0.2s ease; cursor: zoom-in; }
.chat-lightbox img.zoom { transform: scale(2.2); cursor: zoom-out; }
.ch-lb-nav { position: fixed; left: 0; right: 0; bottom: 18px; display: flex; justify-content: center; align-items: center; gap: 14px; color: #ccc; font-size: 0.86rem; }
.ch-lb-nav button { width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.12); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.ch-lb-nav button[hidden] { display: none; }
.ch-lb-nav svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }
.ch-lb-nav .prev svg { transform: rotate(-90deg); }
.ch-lb-nav .next svg { transform: rotate(90deg); }
.ch-lb-nav .close { position: fixed; top: 16px; right: 16px; }

/* ----- КОНТЕКСТНОЕ МЕНЮ СПИСКА ----- */
.context-menu { display: none; position: fixed; z-index: 1000; min-width: 190px; padding: 5px; background: #252928; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 12px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55); }
.context-menu.show { display: grid; }
.context-menu .ctx-item { padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 0.84rem; color: #E8E8E8; }
.context-menu .ctx-item:hover { background: rgba(255, 255, 255, 0.06); }
.context-menu .ctx-item.danger { color: #FF3355; }

/* ============================================
   ВКЛАДКА «TELEGRAM» (frontend/tg-chats.js): старая разметка, новый вид
   ============================================ */
.ch-page .chat-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 40px; text-align: center; color: var(--ch-fg3); font-size: 0.88rem; }
.ch-page .chat-list-empty, .ch-page .chat-list-loading { padding: 34px 16px; text-align: center; color: var(--ch-fg3); font-size: 0.82rem; }
.ch-page .chat-list-item { display: flex; align-items: center; gap: 11px; padding: 9px; margin: 0; border-radius: 12px; cursor: pointer; transition: background 0.12s; }
.ch-page .chat-list-item:hover { background: var(--ch-card2); }
.ch-page .chat-list-item.active { background: var(--ch-card3); }
.ch-page .avatar-small { width: 46px; height: 46px; border-radius: 50%; background: var(--ch-card3); overflow: hidden; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.ch-page .avatar-small img { width: 100%; height: 100%; object-fit: cover; }
.ch-page .chat-item-body { flex: 1; min-width: 0; }
.ch-page .chat-item-top, .ch-page .chat-item-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ch-page .chat-item-bottom { margin-top: 3px; }
.ch-page .chat-item-name { display: flex; align-items: center; gap: 4px; font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ch-page .chat-item-name .pin-icon { font-size: 0.72rem; }
.ch-page .chat-item-time { font-size: 0.72rem; color: var(--ch-fg3); flex-shrink: 0; }
.ch-page .chat-item-preview { font-size: 0.8rem; color: var(--ch-fg2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ch-page .chat-item-preview.unread { color: var(--ch-fg); font-weight: 500; }
.ch-page .chat-unread-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--ch-acc); color: var(--ch-acc-ink); font-size: 0.7rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ch-page .chat-main-header { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 0 14px; border-bottom: 1px solid var(--ch-line); background: var(--ch-card); flex-shrink: 0; }
.ch-page .chat-main-header .avatar-small { width: 40px; height: 40px; }
.ch-page .chat-header-info { flex: 1; min-width: 0; }
.ch-page .chat-header-name { font-weight: 700; font-size: 0.98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-page .chat-menu-wrapper { position: relative; }
.ch-page .chat-menu-btn { width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; color: var(--ch-fg2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.ch-page .chat-menu-btn:hover { background: var(--ch-card2); color: var(--ch-fg); }
.ch-page .chat-header-dropdown { position: absolute; top: 42px; right: 0; z-index: 100; display: none; min-width: 200px; padding: 5px; background: var(--ch-card3); border: 1px solid var(--ch-line2); border-radius: 12px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5); }
.ch-page .chat-header-dropdown.show { display: grid; }
.ch-page .chat-header-dropdown button { padding: 9px 12px; border: 0; border-radius: 8px; background: none; color: var(--ch-fg); font-size: 0.84rem; text-align: left; cursor: pointer; }
.ch-page .chat-header-dropdown button:hover { background: rgba(255, 255, 255, 0.06); }
.ch-page .chat-header-dropdown button.danger { color: var(--ch-danger); }
.ch-page .chat-messages { flex: 1; overflow-y: auto; padding: 12px 18px; display: flex; flex-direction: column; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--ch-card3) transparent; }
.ch-page .chat-history-loading { align-self: center; color: var(--ch-fg3); font-size: 0.78rem; padding: 8px; cursor: pointer; }
.ch-page .msg-group { display: flex; flex-direction: column; gap: 2px; max-width: min(76%, 620px); margin-bottom: 8px; }
.ch-page .msg-group.own { align-self: flex-end; align-items: flex-end; }
.ch-page .msg-group.other { align-self: flex-start; align-items: flex-start; }
.ch-page .message-bubble { padding: 7px 12px; border-radius: 18px; background: var(--ch-card2); font-size: 0.92rem; line-height: 1.42; overflow-wrap: anywhere; animation: chIn 0.2s ease; }
.ch-page .msg-group.own .message-bubble { background: var(--ch-own); border-bottom-right-radius: 4px; }
.ch-page .msg-group.other .message-bubble { border-bottom-left-radius: 4px; }
.ch-page .msg-text { white-space: pre-wrap; }
.ch-page .message-image { display: block; max-width: min(300px, 100%); max-height: 300px; border-radius: 12px; cursor: zoom-in; object-fit: cover; }
.ch-page .message-image + .msg-text { margin-top: 6px; }
.ch-page .msg-meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin-top: 3px; font-size: 0.68rem; color: var(--ch-fg3); }
.ch-page .chat-input-bar { display: flex; align-items: flex-end; gap: 6px; margin: 8px 14px 14px; padding: 6px; background: var(--ch-card); border: 1px solid var(--ch-line2); border-radius: 18px; flex-shrink: 0; }
.ch-page .chat-input-bar:focus-within { border-color: rgba(0, 229, 153, 0.4); }
.ch-page .chat-input-col { flex: 1; min-width: 0; display: flex; }
.ch-page .chat-input-col textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: transparent; color: var(--ch-fg); font: inherit; font-size: 0.92rem; line-height: 1.4; padding: 8px 6px; max-height: 160px; }
.ch-page .chat-send-btn { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--ch-acc); color: var(--ch-acc-ink); font-weight: 800; cursor: pointer; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.ch-page .chat-send-btn:disabled { background: var(--ch-card3); color: var(--ch-fg3); cursor: not-allowed; }

/* ============================================
   ТЕЛЕФОН И УЗКИЕ ЭКРАНЫ
   ============================================ */
/* Узкий ПК: панель собеседника выезжает поверх переписки, а не отнимает у неё ширину. */
@media (max-width: 1279px) {
    body.ch-panel-open .ch-page { grid-template-columns: 300px minmax(0, 1fr); }
    .ch-page { grid-template-columns: 300px minmax(0, 1fr); }
    .ch-panel { position: absolute; top: 0; right: 0; bottom: 0; width: 320px; z-index: 30; box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5); animation: chDrawer 0.2s cubic-bezier(.2, .8, .2, 1); }
    @keyframes chDrawer { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* Телефон: одна панель вместо двух (живой отзыв 2026-09-21: «на чат нажимаю и ничего» — список
   забирал 320px и переписке оставалось двадцать). Класс is-open ставит chat.js, наблюдая #chatMain:
   так один механизм обслуживает и чаты MySkins, и диалоги Telegram. */
@media (max-width: 900px) {
    .ch-page, body.ch-panel-open .ch-page { display: flex; flex-direction: column; height: calc(100dvh - 150px); min-height: 440px; border-radius: 16px; margin-top: 10px; }
    .ch-side { flex: 1; min-height: 0; border-right: 0; }
    .ch-main { display: none; }
    .ch-panel { display: none !important; }
    .ch-page.is-open .ch-side { display: none; }
    .ch-page.is-open .ch-main { display: flex; flex: 1; min-height: 0; }
    .ch-page.is-open .chat-back { display: flex; }
    .ch-feed { padding: 8px 10px; }
    .ch-m, .ch-page .msg-group { max-width: 86%; }
    .ch-tools, .ch-menu { display: none; }
    .ch-head { min-height: 56px; padding: 0 8px; }
    .ch-head-acts .ch-hb[data-act="find"] { display: none; }
    .ch-compose { padding: 6px 8px 10px; }
    .ch-row .ch-ib-attach { display: none; }
    .ch-pop, .ch-pop.left, .ch-items-pop { left: 8px; right: 8px; width: auto; max-width: none; }
    .ch-pk-grid { grid-template-columns: repeat(7, 1fr); }
    .ch-inv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ch-oc { width: 300px; }
    .ch-oc-acts { grid-template-columns: 1fr 1fr; }
    .ch-oc-acts .pri { grid-column: 1 / -1; }
    .ch-down { bottom: 84px; right: 10px; }
    .ch-bub { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
}

/* Возврат к списку. Живёт ВНЕ #chatMain намеренно: внутрь пишут два разных модуля, каждый
   своим innerHTML, и статичная кнопка там не пережила бы первую же перерисовку. */
.chat-back { display: none; align-items: center; gap: 8px; flex-shrink: 0; width: 100%; padding: 12px 14px; background: none; border: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.07); color: #C9CCC9; font-family: inherit; font-size: 0.88rem; font-weight: 600; text-align: left; cursor: pointer; }
.chat-back:hover { color: #00E599; }
.chat-back svg { width: 16px; height: 16px; flex-shrink: 0; }

@media (prefers-reduced-motion: reduce) {
    .ch-page *, .ch-sheet, .ch-sheet-dim { animation: none !important; transition: none !important; }
}

/* ===== ОФИЦИАЛЬНЫЙ ЧАТ MySkins (30.10, наброски FEFHrZt9…) ===== */
.ch-av.ch-av-off { border-radius: 13px; background: var(--ch-acc); }
.ch-av.ch-av-off svg { width: 56%; height: 56%; }
.ch-av.lg.ch-av-off { border-radius: 20px; }
.ch-offbadge { flex: none; margin-left: 4px; vertical-align: -2px; }
.ch-tag.fake { color: #FF8A8E; background: rgba(229, 72, 77, 0.14); margin-left: 4px; }
/* В списке, шапке и панели личных чатов пометка — своей строкой, отступ от имени не нужен. */
.ch-li-bot .ch-tag.fake, .ch-who-st-row .ch-tag.fake, .ch-pn-fake .ch-tag.fake { margin-left: 0; }
.ch-pn-fake { display: flex; justify-content: center; }

.ch-m.ch-m-off { max-width: min(560px, 92%); }
.ch-bub.ch-off { padding: 14px 16px 10px; border-radius: 6px 16px 16px 16px; background: #0F1F18; border: 1px solid rgba(0, 229, 153, 0.28); color: #D5DCD8; display: flex; flex-direction: column; gap: 10px; }
.ch-off p { margin: 0; line-height: 1.5; }
.ch-off a:not(.ch-off-btn) { color: var(--ch-acc); text-decoration: none; }
.ch-off a:not(.ch-off-btn):hover { text-decoration: underline; }
.ch-off-h { font-weight: 700; color: #E9EEEB; margin-top: 2px; }
.ch-off-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1rem; color: #E9EEEB; }
.ch-off-title::before { content: ''; width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--ch-acc); }
.ch-off-title.wait::before { background: #7CC8FF; }
.ch-off-title.warn::before, .ch-off-title.lock::before { background: #F2B25A; }
.ch-off-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.ch-off-list li { line-height: 1.5; }
.ch-off-list b { color: #E9EEEB; }
/* Тарифы в приветствии (05.11): START, PRIME, ELITE, BOSS бейджами сайта (.tier-badge, common.css). Два столбца, если плашка
   помещается целиком, иначе один: строка внутри плашки не переносится и не режется. */
.ch-off-tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(184px, 1fr)); gap: 8px; }
.ch-off-tier { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); font-size: 0.84rem; white-space: nowrap; }
/* Бейджи одной ширины (START самый широкий, 52 px), чтобы числа ботов стояли ровным столбцом. */
.ch-off-tier .tier-badge { margin-left: 0; flex: none; box-sizing: border-box; min-width: 54px; text-align: center; }
.ch-off-tier > b { color: var(--ch-acc); font-size: 0.72rem; letter-spacing: 0.06em; }
.ch-off-more { align-self: flex-start; font-size: 0.86rem; }
.ch-off-trial { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; background: rgba(0, 229, 153, 0.07); border: 1px solid rgba(0, 229, 153, 0.22); }
.ch-off-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ch-off-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; border-radius: 12px; border: 0; background: var(--ch-acc); color: #0A0A0A; font: inherit; font-size: 0.9rem; font-weight: 700; text-decoration: none; cursor: pointer; }
.ch-off-btn:hover { filter: brightness(1.06); }
.ch-off-btn:disabled { opacity: 0.6; cursor: progress; }
.ch-off-btn.ghost { background: transparent; color: #E9EEEB; border: 1px solid rgba(255, 255, 255, 0.16); font-weight: 600; }
.ch-off-note { font-size: 0.8rem; color: var(--ch-fg3); }
.ch-off .ch-meta { align-self: flex-end; }
.ch-pn-off { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 28px 20px; color: var(--ch-fg2); }
.ch-pn-off b { color: #E9EEEB; font-size: 1.05rem; display: inline-flex; align-items: center; }
.ch-pn-off p { margin: 4px 0 0; line-height: 1.5; font-size: 0.88rem; }

/* ===== ОБЩИЙ ЧАТ (30.10, вариант Б, наброски FEFHrZt9… «Общий чат: в списке и модерация») ===== */
.ch-sec { padding: 12px 10px 6px; font-size: 0.74rem; font-weight: 700; color: var(--ch-fg3); letter-spacing: 0.02em; }
.ch-sec:first-child { padding-top: 6px; }
.ch-av.gc-av { border-radius: 13px; background: #13201B; color: var(--ch-acc); }
.ch-av.gc-av svg { width: 50%; height: 50%; }
.gc-online { flex: none; font-size: 0.72rem; font-weight: 600; color: var(--ch-acc); white-space: nowrap; }
.gc-pv-who { color: var(--ch-fg); }
/* 05.11: значок настоящего MySkins у имени в строке «Общий чат» — чуть меньше, чем в шапке, по высоте строки превью */
.gc-pv-who .ch-offbadge { width: 13px; height: 13px; margin-left: 3px; vertical-align: -2px; }
.ch-av.sm { width: 36px; height: 36px; font-size: 0.82rem; }
.ch-av.sm.ch-av-off { border-radius: 11px; }

.gc-who { cursor: default; }
.gc-rules[hidden] { display: none; }
.gc-rules { display: flex; align-items: flex-start; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--ch-line); background: #111513; font-size: 0.8rem; line-height: 1.45; color: var(--ch-fg2); flex: none; }
.gc-rules svg { width: 14px; height: 14px; flex: none; margin-top: 2px; stroke: var(--ch-acc); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gc-rules b { color: var(--ch-fg); }
.gc-rules > span { flex: 1; min-width: 0; }
.gc-rules-ok { flex: none; align-self: center; height: 28px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--ch-line2); background: none; color: var(--ch-fg); font: inherit; font-size: 0.76rem; font-weight: 600; cursor: pointer; }
.gc-rules-ok:hover { background: rgba(255, 255, 255, 0.06); }
.gc-feed .ch-day { position: static; }

.gc-feed .ch-feed-in { gap: 0; }
.gc-m { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding: 6px 10px; margin-top: 6px; border-radius: 12px; transition: background 0.12s; }
.gc-m:hover, .gc-m.menu-on { background: rgba(255, 255, 255, 0.025); }
.gc-m.cont { margin-top: 0; padding-top: 1px; padding-bottom: 3px; }
.gc-m.off { background: #0F1F18; border: 1px solid rgba(0, 229, 153, 0.28); margin: 8px 0 4px; padding: 10px 12px; }
.gc-m.mention { background: rgba(240, 180, 78, 0.07); box-shadow: inset 3px 0 0 var(--ch-warn); }
.gc-m.pending { opacity: 0.55; }
.gc-m.fresh { animation: chIn 0.22s cubic-bezier(.2, .8, .2, 1); }
.gc-av-btn { padding: 0; border: 0; background: none; cursor: pointer; align-self: start; border-radius: 50%; }
.gc-mini { align-self: center; justify-self: end; font-size: 0.64rem; color: var(--ch-fg3); font-variant-numeric: tabular-nums; opacity: 0; transition: opacity 0.12s; }
.gc-m.cont:hover .gc-mini { opacity: 1; }
.gc-body { min-width: 0; }
.gc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-width: 0; margin-bottom: 1px; }
.gc-name { min-width: 0; padding: 0; border: 0; background: none; color: var(--ch-fg); font: inherit; font-size: 0.86rem; font-weight: 700; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.gc-name:hover { text-decoration: underline; text-underline-offset: 2px; }
.gc-m.own .gc-name { color: var(--ch-acc); }
.gc-head time { flex: none; font-size: 0.7rem; color: var(--ch-fg3); font-variant-numeric: tabular-nums; margin-left: 2px; }
.gc-text { font-size: 0.92rem; line-height: 1.45; color: #D5DCD8; white-space: pre-wrap; overflow-wrap: anywhere; }
.gc-link-off { display: inline-block; padding: 0 8px; border-radius: 6px; background: #1E2422; color: var(--ch-fg2); font-size: 0.8rem; line-height: 1.6; white-space: nowrap; }
.gc-hidden { display: inline-flex; align-items: center; gap: 8px; margin-top: 2px; padding: 8px 12px; border-radius: 10px; border: 1px dashed rgba(255, 255, 255, 0.14); background: #111513; color: var(--ch-fg2); font-size: 0.84rem; }
.gc-hidden svg, .gc-modnote svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.gc-modnote { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 0.74rem; color: var(--ch-warn); }

.gc-tools { position: absolute; top: -14px; right: 10px; z-index: 6; display: flex; gap: 2px; padding: 3px; background: var(--ch-card3); border: 1px solid var(--ch-line2); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); opacity: 0; pointer-events: none; transition: opacity 0.12s; }
.gc-m:hover .gc-tools, .gc-m.menu-on .gc-tools, .gc-tools:focus-within { opacity: 1; pointer-events: auto; }
.gc-tools button { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border: 0; border-radius: 7px; background: none; color: var(--ch-fg2); font: inherit; font-size: 0.76rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.gc-tools button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.07); color: var(--ch-fg); }
.gc-tools button:disabled { cursor: default; opacity: 0.6; }
.gc-tools svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gc-menu { top: 18px; right: 10px; left: auto; }
.gc-menu.up { top: auto; bottom: calc(100% + 18px); }
.gc-menu button { white-space: normal; height: auto; min-height: 36px; padding: 6px 10px; }

.gc-note { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 6px 6px 0; font-size: 0.74rem; color: var(--ch-fg3); }
.gc-note > * { white-space: nowrap; }
/* Подсказка у поля — целиком: на телефоне она шире строки и срезалась справа на «скрыв» (05.11, проверка глазами).
   Галочка «От MySkins» и счётчик знаков по-прежнему не рвутся и при нехватке места уходят на следующую строку. */
.gc-note #gcNoteMain { white-space: normal; min-width: 0; }
/* Кнопка «вниз» — над полем ввода общего чата, какой бы высоты оно ни было (подсказка в две строки, «От MySkins»):
   высоту даёт frontend/global-chat.js (--gc-compose-h). Раньше на телефоне у владельца она лежала на «Отправить». */
.ch-thread.gc .ch-down { bottom: calc(var(--gc-compose-h, 86px) + 10px); }
#gcNoteMain { font-variant-numeric: tabular-nums; }
.gc-note #gcNoteMain.cool { color: var(--ch-warn); }
.gc-note #gcNoteMain.shake { animation: gcShake 0.35s; }
@keyframes gcShake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.gc-asoff { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--ch-fg2); cursor: pointer; }
.gc-asoff input { accent-color: var(--ch-acc); width: 15px; height: 15px; margin: 0; }
.gc-count { margin-left: auto; font-variant-numeric: tabular-nums; }
.gc-asoff + .gc-count { margin-left: 0; }

/* жалоба: снизу на телефоне, по центру на ПК */
@media (min-width: 901px) {
    .gc-dim { justify-content: center; align-items: center; }
    .gc-sheet { width: min(420px, calc(100vw - 32px)); border-radius: 18px; padding: 18px; }
    .gc-sheet::before { display: none; }
}
.gc-report { display: grid; gap: 12px; }
.gc-report .ch-sheet-title { text-align: left; font-size: 1.02rem; }
.gc-report-quote { max-height: 120px; overflow-y: auto; padding: 8px 12px; border-radius: 10px; background: var(--ch-card); color: var(--ch-fg2); font-size: 0.84rem; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; }
.gc-report-quote b { color: var(--ch-fg); }
.gc-report fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 2px; }
.gc-report legend { padding: 0; margin-bottom: 4px; font-size: 0.78rem; font-weight: 700; color: var(--ch-fg3); }
.gc-radio { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 8px; border-radius: 10px; font-size: 0.92rem; color: var(--ch-fg); cursor: pointer; }
.gc-radio:hover { background: rgba(255, 255, 255, 0.04); }
.gc-radio input { accent-color: var(--ch-acc); width: 18px; height: 18px; margin: 0; }
.gc-report-acts { display: flex; gap: 10px; }
.gc-btn { min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--ch-line2); background: transparent; color: var(--ch-fg); font: inherit; font-size: 0.92rem; font-weight: 600; cursor: pointer; }
.gc-btn.pri { border: 0; background: var(--ch-acc); color: #0A0A0A; font-weight: 700; }
.gc-btn:disabled { opacity: 0.6; cursor: progress; }
.gc-report-note { margin: 0; font-size: 0.76rem; color: var(--ch-fg3); line-height: 1.45; }
.ch-sheet-acts button:disabled { opacity: 0.55; }

@media (max-width: 900px) {
    .gc-brand { display: none; }
    .gc-tools, .gc-menu { display: none; }
    .gc-rules { padding: 8px 12px; font-size: 0.76rem; }
    .gc-m { padding: 6px 4px; }
    .gc-m.off { padding: 10px; }
}
