/* «Чаты» (chats.js): две панели во всю высоту окна, как в ЛК1 — слева список, справа переписка; «ИИ-Рассылка» — чат
   сотрудников с карточками бота. Высоту страницы подгоняет chFit() — без прокрутки страницы, у списка и ленты свои. */
.ch-page { display: grid; grid-template-columns: 360px minmax(0, 1fr); height: calc(100vh - 58px); min-height: 460px;
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; }

/* ── список ── */
.ch-side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); background: #fbfcfe; }
.ch-side-head { padding: 14px 14px 10px; border-bottom: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: 10px; }
.ch-side-top { display: flex; align-items: center; gap: 8px; }
.ch-title { font-size: 18px; font-weight: 800; letter-spacing: -.3px; margin-right: auto; display: flex; align-items: center; gap: 8px; }
.ch-title-n { font-size: 11.5px; font-weight: 700; color: var(--muted); background: #eef0f4; border-radius: 999px; padding: 2px 8px; }
.ch-title-n:empty { display: none; }
.ch-icon-btn { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border); background: #fff; color: var(--text-2);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: all .12s; flex: 0 0 32px; }
.ch-icon-btn:hover { border-color: #cfd6e1; color: var(--accent); }
.ch-search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid var(--border); border-radius: 11px; padding: 0 8px 0 11px;
    color: var(--muted); transition: border-color .12s, box-shadow .12s; }
.ch-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3.5px rgba(59, 100, 244, .12); }
.ch-search input { border: none; outline: none; background: transparent; padding: 9px 0; flex: 1; min-width: 0; font: inherit; font-size: 13.5px; color: var(--text); box-shadow: none; }
.ch-search-x { border: none; background: #eef0f4; color: var(--muted); width: 20px; height: 20px; border-radius: 50%; display: inline-flex;
    align-items: center; justify-content: center; cursor: pointer; padding: 0; flex: 0 0 20px; }
.ch-search-x:hover { background: #e2e6ee; color: var(--text); }
.ch-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ch-chip { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12px; font-weight: 600;
    color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all .12s; }
.ch-chip b { font-size: 11px; font-weight: 800; color: var(--muted); }
.ch-chip:hover { border-color: #c6d2f5; color: var(--text); }
.ch-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.ch-chip.on b { color: rgba(255, 255, 255, .85); }
.ch-chip.hot:not(.on) b { color: #fff; background: var(--ok); border-radius: 999px; padding: 0 6px; line-height: 16px; }
.ch-list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 6px 12px; }
.ch-row { display: flex; gap: 11px; align-items: center; padding: 9px 10px; border-radius: 12px; cursor: pointer; transition: background .1s; position: relative; }
.ch-row + .ch-row { margin-top: 1px; }
.ch-row:hover { background: #f1f4fa; }
.ch-row.sel { background: var(--accent-soft); }
.ch-row.sel::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--accent); }
.ch-ava { width: 46px; height: 46px; border-radius: 50%; flex: 0 0 46px; display: flex; align-items: center; justify-content: center; color: #fff;
    font-weight: 800; font-size: 14px; position: relative; letter-spacing: -.2px; }
.ch-ava.lg { width: 42px; height: 42px; flex-basis: 42px; }
.ch-ava.ai { background: linear-gradient(135deg, #6d4cf5, #3b64f4); box-shadow: 0 4px 14px rgba(91, 76, 245, .28); }
.ch-ava-kind { position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; color: var(--ok-deep);
    display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px #fbfcfe; }
.ch-ava-kind.phone { color: var(--accent-2); }
.ch-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ch-row-top, .ch-row-bot { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ch-row-name { flex: 1; min-width: 0; font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.ch-row-time { font-size: 11.5px; color: var(--muted); flex: 0 0 auto; }
.ch-row-time.on { color: var(--ok-deep); font-weight: 700; }
.ch-row-prev { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-row-prev b { font-weight: 600; color: var(--text); }
.ch-row.unread .ch-row-prev { color: var(--text); }
.ch-out { color: var(--accent); margin-right: 3px; display: inline-flex; vertical-align: -2px; }
.ch-pv-ico { color: var(--muted); display: inline-flex; vertical-align: -2px; margin-right: 3px; }
.ch-muted { color: var(--faint); font-style: italic; }
.ch-staff { display: inline-block; font-size: 10.5px; font-weight: 700; color: #5b3fe0; background: #efebff; border-radius: 6px; padding: 1px 6px; margin-right: 6px; vertical-align: 1px; }
.ch-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #6d4cf5; color: #fff; font-size: 11px; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.ch-badge.ok { background: var(--ok); }
.ch-wait { font-size: 10.5px; font-weight: 700; color: var(--warn-deep); background: var(--warn-soft); border-radius: 6px; padding: 1px 6px; flex: 0 0 auto; white-space: nowrap; }
.ch-wait.hot { color: var(--err-deep); background: var(--err-soft); }
.ch-dot-wait { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); flex: 0 0 8px; }
.ch-list-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--muted); font-size: 12.5px; padding: 28px 18px; }
.ch-row.ai { background: linear-gradient(90deg, rgba(109, 76, 245, .07), rgba(59, 100, 244, .02)); border: 1px solid rgba(109, 76, 245, .14); margin-bottom: 6px; }
.ch-row.ai:hover { background: linear-gradient(90deg, rgba(109, 76, 245, .11), rgba(59, 100, 244, .04)); }
.ch-row.ai.sel { background: linear-gradient(90deg, rgba(109, 76, 245, .16), rgba(59, 100, 244, .07)); }
.ch-row.ai.sel::before { background: #6d4cf5; }
.skel-row-ch { cursor: default; }
.skel-row-ch:hover { background: none; }

/* ── правая панель ── */
.ch-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #f4f1eb; }
.ch-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--border); min-height: 64px; }
.ch-head-main { flex: 1; min-width: 0; }
.ch-head-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ch-head-title { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ch-head-tag { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 2px 7px;
    background: var(--ok-soft); color: var(--ok-deep); }
.ch-head-tag.phone { background: var(--accent-soft); color: var(--accent-2); }
.ch-head-tag.staff { background: #efebff; color: #5b3fe0; }
.ch-head-sub { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-head-acts { display: flex; gap: 6px; flex: 0 0 auto; }
.ch-head-acts .btn { text-decoration: none; }
.ch-back { display: none; }
.ch-feed-wrap { position: relative; flex: 1; min-height: 0; display: flex; }
.ch-feed { flex: 1; overflow-y: auto; padding: 14px max(18px, 6%) 18px; display: flex; flex-direction: column; gap: 6px;
    background: #f4f1eb url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%27220%27%20height=%27220%27%20viewBox=%270%200%20220%20220%27%3E%3Cg%20fill=%27none%27%20stroke=%27%23e2dbcf%27%20stroke-width=%271.4%27%20stroke-linecap=%27round%27%20stroke-linejoin=%27round%27%3E%3Ccircle%20cx=%2728%27%20cy=%2730%27%20r=%277%27/%3E%3Cpath%20transform=%27translate%28100%2028%29%27%20d=%27M0-8l2.4%205.2%205.6.6-4.2%203.8%201.2%205.6L0%204.4-5%207.2l1.2-5.6L-8-2.2l5.6-.6z%27/%3E%3Cpath%20transform=%27translate%28176%2044%29%27%20d=%27M0%206C-8%200-5-7%200-3c5-4%208%203%200%209z%27/%3E%3Cpath%20transform=%27translate%2848%20118%29%27%20d=%27M-7-5h11v7a4%204%200%200%201-4%204h-3a4%204%200%200%201-4-4zM4-3h2a3%203%200%200%201%200%206h-2%27/%3E%3Ccircle%20cx=%27132%27%20cy=%27108%27%20r=%274%27/%3E%3Cpath%20transform=%27translate%28188%20138%29%27%20d=%27M0-8l2.4%205.2%205.6.6-4.2%203.8%201.2%205.6L0%204.4-5%207.2l1.2-5.6L-8-2.2l5.6-.6z%27/%3E%3Cpath%20transform=%27translate%2892%20182%29%27%20d=%27M0%206C-8%200-5-7%200-3c5-4%208%203%200%209z%27/%3E%3Ccircle%20cx=%27160%27%20cy=%27192%27%20r=%276%27/%3E%3Cpath%20d=%27M14%20168c6-6%2012%206%2018%200s12%206%2018%200%27/%3E%3Cpath%20d=%27M120%20160c4-4%208%204%2012%200%27/%3E%3Cpath%20transform=%27translate%2870%2070%29%27%20d=%27M-6%200h12M0-6v12%27/%3E%3C/g%3E%3C/svg%3E") repeat; background-size: 220px 220px; }
.ch-feed.ai { background: #f1f4fb url("data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%27220%27%20height=%27220%27%20viewBox=%270%200%20220%20220%27%3E%3Cg%20fill=%27none%27%20stroke=%27%23dbe1ee%27%20stroke-width=%271.4%27%20stroke-linecap=%27round%27%20stroke-linejoin=%27round%27%3E%3Ccircle%20cx=%2728%27%20cy=%2730%27%20r=%277%27/%3E%3Cpath%20transform=%27translate%28100%2028%29%27%20d=%27M0-8l2.4%205.2%205.6.6-4.2%203.8%201.2%205.6L0%204.4-5%207.2l1.2-5.6L-8-2.2l5.6-.6z%27/%3E%3Cpath%20transform=%27translate%28176%2044%29%27%20d=%27M0%206C-8%200-5-7%200-3c5-4%208%203%200%209z%27/%3E%3Cpath%20transform=%27translate%2848%20118%29%27%20d=%27M-7-5h11v7a4%204%200%200%201-4%204h-3a4%204%200%200%201-4-4zM4-3h2a3%203%200%200%201%200%206h-2%27/%3E%3Ccircle%20cx=%27132%27%20cy=%27108%27%20r=%274%27/%3E%3Cpath%20transform=%27translate%28188%20138%29%27%20d=%27M0-8l2.4%205.2%205.6.6-4.2%203.8%201.2%205.6L0%204.4-5%207.2l1.2-5.6L-8-2.2l5.6-.6z%27/%3E%3Cpath%20transform=%27translate%2892%20182%29%27%20d=%27M0%206C-8%200-5-7%200-3c5-4%208%203%200%209z%27/%3E%3Ccircle%20cx=%27160%27%20cy=%27192%27%20r=%276%27/%3E%3Cpath%20d=%27M14%20168c6-6%2012%206%2018%200s12%206%2018%200%27/%3E%3Cpath%20d=%27M120%20160c4-4%208%204%2012%200%27/%3E%3Cpath%20transform=%27translate%2870%2070%29%27%20d=%27M-6%200h12M0-6v12%27/%3E%3C/g%3E%3C/svg%3E") repeat; background-size: 220px 220px; gap: 10px; }
.ch-feed .msg { max-width: min(74%, 640px); }
.ch-feed:not(.ai) .msg.out { background: #dcf5d0; border-color: #c9ebb8; }
.ch-feed .msg.in { background: #fff; }
.ch-feed .chat-day span { box-shadow: var(--shadow-1); }
.ch-feed-skel { display: flex; flex-direction: column; gap: 12px; padding-top: 10px; }
.ch-feed-err { margin: auto; color: var(--err-deep); background: var(--err-soft); border-radius: 10px; padding: 10px 14px; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.ch-older { display: flex; justify-content: center; margin: 2px 0 8px; }
.ch-older .btn { box-shadow: var(--shadow-1); }
.ch-new-div { display: flex; align-items: center; gap: 10px; margin: 8px 0 2px; color: #5b3fe0; font-size: 11.5px; font-weight: 700; }
.ch-new-div::before, .ch-new-div::after { content: ''; flex: 1; height: 1px; background: rgba(109, 76, 245, .3); }
.ch-down { position: absolute; right: 22px; bottom: 16px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: #fff;
    box-shadow: var(--shadow-2); color: var(--text-2); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform .12s; }
.ch-down:hover { transform: translateY(-1px); color: var(--accent); }
.ch-down span { position: absolute; top: -6px; right: -4px; min-width: 18px; height: 18px; border-radius: 999px; background: var(--ok); color: #fff;
    font-size: 10.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.ch-down span:empty { display: none; }
.ch-composer { display: flex; flex-direction: column; gap: 6px; padding: 10px 16px 9px; border-top: 1px solid var(--border); background: var(--panel); }
.ch-composer.disabled { opacity: .55; pointer-events: none; }
.ch-composer .composer-hint { display: flex; align-items: center; gap: 5px; }
#chNote .chat-note { border-top: 1px solid var(--border); }

/* ── пустая правая панель ── */
.ch-empty { margin: auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px; max-width: 560px; }
.ch-empty-ico { width: 64px; height: 64px; border-radius: 20px; background: #fff; border: 1px solid var(--border); display: flex; align-items: center;
    justify-content: center; color: var(--accent); box-shadow: var(--shadow-1); margin-bottom: 4px; }
.ch-empty-title { font-weight: 800; font-size: 16px; }
.ch-empty-sub { font-size: 13px; color: var(--muted); line-height: 1.5; }
.ch-empty-stats { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; justify-content: center; }
.ch-empty-stats button { border: 1px solid var(--border); background: #fff; border-radius: 12px; padding: 10px 14px; cursor: pointer; display: flex;
    flex-direction: column; align-items: center; gap: 2px; font: inherit; min-width: 130px; transition: all .12s; box-shadow: var(--shadow-1); }
.ch-empty-stats button:hover { border-color: #c6d2f5; transform: translateY(-1px); }
.ch-empty-stats b { font-size: 20px; font-weight: 800; color: var(--text); }
.ch-empty-stats span { font-size: 11.5px; color: var(--muted); }

/* ── «ИИ-Рассылка»: карточки бота ── */
.ch-bot { display: flex; gap: 11px; align-self: flex-start; width: min(100%, 780px); background: #fff; border: 1px solid var(--border);
    border-left: 3px solid #8c7cf7; border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow-1); animation: chIn .22s ease-out; }
.ch-bot.tone-attention { border-left-color: var(--accent); }
.ch-bot.tone-err { border-left-color: var(--err); }
.ch-bot.tone-ok { border-left-color: var(--ok); }
.ch-bot.tone-sandbox { border-left-color: var(--warn); }
.ch-bot-ico { width: 34px; height: 34px; border-radius: 10px; flex: 0 0 34px; display: flex; align-items: center; justify-content: center; background: #efebff; color: #5b3fe0; }
.ch-bot.tone-err .ch-bot-ico { background: var(--err-soft); color: var(--err-deep); }
.ch-bot.tone-attention .ch-bot-ico { background: var(--accent-soft); color: var(--accent-2); }
.ch-bot.tone-ok .ch-bot-ico { background: var(--ok-soft); color: var(--ok-deep); }
.ch-bot.tone-sandbox .ch-bot-ico { background: var(--warn-soft); color: var(--warn-deep); }
.ch-bot-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.ch-bot-top { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); min-width: 0; }
.ch-bot-kind { font-weight: 800; text-transform: uppercase; letter-spacing: .05em; font-size: 10.5px; color: #5b3fe0; flex: 0 0 auto; }
.ch-bot.tone-err .ch-bot-kind { color: var(--err-deep); }
.ch-bot.tone-sandbox .ch-bot-kind { color: var(--warn-deep); }
.ch-bot-client { color: var(--text-2); font-weight: 600; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ch-bot-client:hover { color: var(--accent); text-decoration: underline; }
.ch-bot-time { margin-left: auto; flex: 0 0 auto; }
.ch-bot-title { font-weight: 800; font-size: 14px; color: var(--text); line-height: 1.35; }
.ch-bot-lines { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--text-2); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.ch-bot-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ch-bot-quote summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--accent-2); display: inline-flex; align-items: center; gap: 6px; list-style: none; }
.ch-bot-quote summary::-webkit-details-marker { display: none; }
.ch-bot-quote[open] summary { margin-bottom: 6px; }
.ch-bot-wa { background: #dcf5d0; border: 1px solid #c9ebb8; border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.5; max-height: 360px;
    overflow: auto; overflow-wrap: anywhere; }
.ch-bot-items { display: flex; flex-direction: column; gap: 6px; }
.ch-bot-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: #fafbfd; border: 1px solid var(--border-soft); }
.ch-bot-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.ch-bot-item-main a, .ch-bot-item-main b { font-weight: 700; color: var(--text); text-decoration: none; }
.ch-bot-item-main a:hover { color: var(--accent); text-decoration: underline; }
.ch-bot-item-sub { color: var(--muted); font-size: 12px; }
.ch-bot-item-err { color: var(--err-deep); display: flex; align-items: flex-start; gap: 4px; overflow-wrap: anywhere; }
.ch-bot-item-retry { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; }
.ch-bot-item-retry.ok { color: var(--ok-deep); }
.ch-bot-item-retry.bad { color: var(--err-deep); }
.ch-bot-state { font-size: 12.5px; border-radius: 10px; padding: 7px 10px; display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.ch-bot-state.done { background: var(--ok-soft); color: var(--ok-deep); display: block; }
.ch-bot-state.warn { background: var(--warn-soft); color: var(--warn-deep); display: block; }
.ch-bot-state.run { background: var(--accent-soft); color: var(--accent-2); }
.ch-bot-bar { height: 6px; border-radius: 6px; background: rgba(59, 100, 244, .15); overflow: hidden; }
.ch-bot-bar span { display: block; height: 100%; background: var(--accent); border-radius: 6px; transition: width .4s; }
.ch-bot-state-errs { font-size: 12px; font-weight: 500; color: var(--err-deep); margin-top: 4px; }
.ch-feed.ai .msg { max-width: min(70%, 620px); }
.ch-feed.ai .msg.out { background: #ece7ff; border-color: #ddd5ff; }
.ch-feed.ai .msg.in .who { color: #5b3fe0; }
.ch-staff-msg .ch-del { border: none; background: none; color: var(--faint); cursor: pointer; padding: 0; display: inline-flex; opacity: 0; transition: opacity .12s; }
.ch-staff-msg:hover .ch-del { opacity: 1; }
.ch-staff-msg .ch-del:hover { color: var(--err-deep); }
.ch-ai-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 24px; max-width: 560px; }
.ch-ai-empty .ch-empty-ico { color: #5b3fe0; }
.ch-ai-list { display: flex; flex-direction: column; gap: 7px; text-align: left; margin: 8px 0; font-size: 13px; color: var(--text-2); width: 100%; }
.ch-ai-list div { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; }
.ch-ai-list svg { color: #5b3fe0; }

/* ── окна «Уведомления» и «Шаблоны» ── */
.ch-notify { display: flex; flex-direction: column; gap: 8px; }
.ch-notify-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; transition: border-color .12s; }
.ch-notify-row:hover { border-color: #c6d2f5; }
.ch-notify-row.locked { cursor: default; background: #fafbfd; }
.ch-notify-ico { width: 32px; height: 32px; border-radius: 9px; background: #efebff; color: #5b3fe0; display: flex; align-items: center; justify-content: center; flex: 0 0 32px; }
.ch-notify-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ch-notify-main b { font-size: 13.5px; }
.ch-notify-main span { font-size: 12px; color: var(--muted); line-height: 1.4; }
.ch-notify-row input { width: 18px; height: 18px; accent-color: var(--accent); flex: 0 0 18px; }
.ch-tpl-hint { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--text-2); background: var(--accent-soft); border-radius: 10px;
    padding: 9px 12px; margin-bottom: 12px; line-height: 1.45; }

/* ── карточка «Песочница» во вкладке «Рассылка → Автоматизация» (automation.js) ── */
.au-sb-team { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(109, 76, 245, .22);
    background: linear-gradient(90deg, rgba(109, 76, 245, .07), rgba(59, 100, 244, .02)); text-decoration: none; color: var(--text); margin: 6px 0 10px; transition: all .12s; }
.au-sb-team:hover { border-color: rgba(109, 76, 245, .45); transform: translateY(-1px); }
.au-sb-team-ico { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #6d4cf5, #3b64f4); color: #fff; display: flex;
    align-items: center; justify-content: center; flex: 0 0 34px; }
.au-sb-team-main { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.au-sb-team-main b { font-size: 13.5px; }
.au-sb-team-main span { font-size: 12px; color: var(--muted); }
.au-sb-team-go { font-size: 12.5px; font-weight: 700; color: #5b3fe0; display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.au-sb-tg summary { cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; list-style: none; padding: 4px 0; }
.au-sb-tg summary::-webkit-details-marker { display: none; }
.au-sb-tg[open] summary { margin-bottom: 6px; }

@keyframes chIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── средний экран: список уже ── */
@media (max-width: 1280px) {
    .ch-page { grid-template-columns: 320px minmax(0, 1fr); }
    .ch-head-acts .btn:not(.icon-btn) { padding: 6px 9px; }
}
/* ── узкий экран: одна панель, назад — к списку ── */
@media (max-width: 960px) {
    .ch-page { grid-template-columns: 1fr; }
    .ch-page.has-sel .ch-side { display: none; }
    .ch-page:not(.has-sel) .ch-main { display: none; }
    .ch-back { display: inline-flex; }
    .ch-head { flex-wrap: wrap; }
    .ch-feed .msg, .ch-feed.ai .msg { max-width: 88%; }
}

/* плашка «Песочница» в «Рассылке» — ссылка в чат «ИИ-Рассылка» */
a.bc-mode { text-decoration: none; cursor: pointer; }
a.bc-mode.sandbox:hover { border-color: #c4aef0; }
.sandbox-hint a { color: #6b3fc4; font-weight: 700; }
