/* Редактор ИИ-агента (#/agents/<id>, префикс ag-ed / ag-c / ag-sk / ag-pn) — как у respond.io: полоса сверху,
   слева прокручиваются карточки, справа стоит панель «Тест · Проверка». Экран во всю высоту (layout 'full').
   Узкое окно (редактор уже 1000 px — 1100×560 с меню) — панель уходит в кнопки на полосе и открывается шторкой. */

.view-full.view-agents > .screen-agents { max-width: none; }
/* прокрутка к карточке (scrollIntoView, focus) не сдвигает весь экран: прокручивается только колонка */
.view-full.view-agents { overflow: clip; }
.ag-ed { container: aged / inline-size; position: relative; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; min-width: 0; }

/* ── Полоса сверху (r12): два яруса — кто это и кнопки; ниже дорожки «Настройка · Статистика» и «Форма · Схема» ── */
.ag-ed-bar { display: flex; flex-direction: column; flex: 0 0 auto; min-width: 0; background: var(--l1); border-bottom: 1px solid var(--line); }
.ag-ed-row { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 58px; padding: 8px 14px 4px 8px; }
.ag-ed-row2 { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 44px; padding: 2px 14px 8px 46px; }
.ag-ed-back { width: 30px; color: var(--mut); }
.ag-ed-face { display: inline-flex; flex: 0 0 auto; margin: 0 4px 0 2px; padding: 0; border: 0; border-radius: 12px; background: none; cursor: pointer; transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
.ag-ed-face:hover { transform: translateY(-1px) rotate(-3deg); }
.ag-ed-face:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--acc-soft); }
.ag-ed-face.is-ro { cursor: default; }
.ag-ed-face.is-ro:hover { transform: none; }
.ag-ed-nm { display: flex; flex-direction: column; gap: 1px; flex: 0 1 auto; min-width: 118px; max-width: 420px; }
.ag-ed-nm b { font-size: 15.5px; line-height: 20px; font-weight: 650; letter-spacing: -.01em; color: var(--ink); }
.ag-ed-nm span { font-size: 12.5px; line-height: 16px; color: var(--mut2); }
.ag-ed-row > .ag-st { height: 28px; gap: 6px; padding: 0 8px 0 10px; }
.ag-ed-seg, .ag-ed-vw { flex: 0 0 auto; flex-wrap: nowrap; }
.ag-ed-seg button, .ag-ed-vw button { height: 28px; padding: 0 11px; gap: 6px; font-size: 12.5px; white-space: nowrap; }
.ag-ed-vw { margin-left: 4px; }
.ag-ed-row .btn { padding: 0 12px; }
.ag-ed-att { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; height: 28px; padding: 0 8px; border: 0; border-radius: 8px; background: none;
  color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.ag-ed-att > i { flex: 0 0 auto; width: 6.5px; height: 6.5px; border-radius: 1.5px; transform: rotate(45deg); background: var(--sig-wait); }
.ag-ed-att:hover { background: var(--l2); }
.ag-ed-when { display: inline-flex; align-items: center; flex: 0 0 auto; margin: 0 4px; font-size: 12px; color: var(--mut2); white-space: nowrap; }
.ag-ed-pnb { display: none; align-items: center; gap: 6px; flex: 0 0 auto; }
.ag-ed-pnb .btn { position: relative; height: 30px; padding: 0 10px; gap: 6px; font-size: 12.5px; }
.ag-ed-pnb .btn.is-on { color: var(--acc); border-color: var(--acc-soft-brd); background: var(--acc-soft); }
.ag-ed-pnb-dot { position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 1.5px; transform: rotate(45deg); background: var(--sig-wait); box-shadow: 0 0 0 2px var(--l1); }
.ag-ed-cancel { color: var(--ink); }
.ag-ed-row .btn[disabled] { opacity: .45; }
[data-theme="light"] .ag-ed-bar { background: rgba(255, 255, 255, .72); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); border-bottom-color: #ece6f8; }
[data-theme="light"] .ag-ed-row > .ag-st { background: var(--pl-glass); border-color: var(--pl-glass-brd); box-shadow: var(--pl-glass-sh); }
[data-theme="light"] .ag-ed-row > .ag-st:hover { border-color: #cdb9f8; }
[data-theme="light"] .ag-ed-att:hover { background: rgba(255, 255, 255, .92); box-shadow: inset 0 0 0 1px #ece5fa; }
[data-theme="light"] .ag-ed-pnb .btn.is-on { background: var(--pl-sel-bg); border-color: var(--pl-sel-brd); box-shadow: var(--pl-sel-sh); }

/* ── Тело: колонка карточек + панель ────────────────────────────────────────── */
.ag-ed-body { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) min(500px, 42%); flex: 1 1 auto; min-height: 0; }
.ag-ed[data-mode="stats"] .ag-ed-body, .ag-ed.is-arch .ag-ed-body { grid-template-columns: minmax(0, 1fr); }
.ag-ed-lw { position: relative; min-width: 0; min-height: 0; }
.ag-ed-l, .ag-ed-st { height: 100%; overflow-y: auto; overscroll-behavior: contain; }
.ag-ed-l { padding: 20px 24px 40px 34px; }
.ag-ed-cards { display: flex; flex-direction: column; gap: 20px; max-width: 860px; margin: 0 auto; }
.ag-ed-st { padding: 20px 24px 40px; }
.ag-ed-stw { max-width: 1240px; margin: 0 auto; }
/* точки-навигатор по разделам у левого края (как у respond.io) */
.ag-ed-dots { position: absolute; left: 12px; top: 50%; z-index: 2; display: flex; flex-direction: column; gap: 8px; transform: translateY(-50%); }
.ag-ed-dots button { width: 5px; height: 12px; padding: 0; border: 0; border-radius: 3px; background: var(--line-2); cursor: pointer; transition: background .15s, height .15s; }
.ag-ed-dots button:hover { background: var(--line-3); }
.ag-ed-dots button.is-on { height: 18px; background: var(--acc); }

/* карточка раздела: заголовок, серое описание, содержимое — много воздуха, бледная рамка */
.ag-c { padding: 20px 20px 18px; gap: 14px; scroll-margin-top: 12px; transition: box-shadow .3s, border-color .3s; }
.ag-c.is-new, .ag-sk.is-new { border-color: var(--acc-soft-brd); box-shadow: 0 0 0 3px var(--acc-soft); }
.ag-c-h { display: flex; align-items: flex-start; gap: 16px; }
.ag-c-ht { display: flex; flex-direction: column; gap: 3px; flex: 1 1 auto; min-width: 0; }
.ag-c-ht h2 { font-size: 15.5px; line-height: 21px; font-weight: 650; letter-spacing: -.01em; }
.ag-c-ht p { font-size: 12.5px; line-height: 18px; color: var(--mut); }
.ag-c-hr { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.ag-arch { padding: 14px; }

/* поле с панелью внизу: @ · {} … Шаблоны ⌄ · Улучшить */
.ag-fld { display: flex; flex-direction: column; min-width: 0; border-radius: 12px; border: 1px solid var(--line-2); background: var(--l1); transition: border-color .15s, box-shadow .15s; }
.ag-fld:focus-within { border-color: var(--acc-soft-brd); box-shadow: 0 0 0 3px var(--acc-soft); }
.ag-fld-ta { display: block; width: 100%; min-width: 0; min-height: 64px; padding: 11px 14px 6px; border: 0; outline: 0; resize: vertical; background: transparent; color: var(--ink);
  font: inherit; font-size: 13.5px; line-height: 21px; }
.ag-fld-ta::placeholder { color: var(--ink-off); }
.ag-fld-l .ag-fld-ta { height: 232px; min-height: 120px; }
/* правило навыка — в рост текста (как у respond.io: правило видно целиком), длинное — с прокруткой */
.ag-sk .ag-fld-ta { field-sizing: content; min-height: 64px; max-height: 240px; resize: none; }
.ag-fld.is-ro { background: var(--l2); }
.ag-fld.is-ro .ag-fld-ta { resize: none; color: var(--mut); }
.ag-fld-f { display: flex; align-items: center; gap: 4px; padding: 4px 6px 6px; min-width: 0; }
.ag-fld-f .ib { color: var(--mut); }
.ag-fld-tpl { flex: 0 0 auto; }
.ag-ai-b { color: var(--ai); border-color: var(--ai-brd); background: var(--l1); }
.ag-ai-b:hover { color: var(--ai); border-color: var(--ai); background: var(--ai-soft); }
.ag-ai-b[disabled] { opacity: .5; }
.ag-count { flex: 0 0 auto; margin-right: 6px; font-size: 12px; color: var(--mut2); white-space: nowrap; }
.ag-count.is-over { color: var(--zav); font-weight: 620; }
.ag-howto { align-self: flex-start; margin: -4px 0 0 -7px; font-size: 13px; }

/* источники знаний — строки: значок вида · название и суть · состояние (только отклонение) · ⋯ */
.ag-krs { display: flex; flex-direction: column; }
.ag-kr { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 9px 0; border-top: 1px solid var(--line); }
.ag-krs > .ag-kr:first-child { border-top: 0; padding-top: 0; }
.ag-kr .kb-ic { width: 34px; height: 34px; border-radius: 10px; }
.ag-kr-t { display: flex; flex-direction: column; gap: 1px; flex: 1 1 auto; min-width: 0; padding: 0; border: 0; background: none; text-align: left; color: var(--ink); cursor: pointer; }
button.ag-kr-t:hover b { color: var(--acc); }
.ag-kr-t b { font-size: 13.5px; line-height: 19px; font-weight: 620; }
.ag-kr-t em { font-style: normal; font-size: 12px; line-height: 16px; color: var(--mut2); }
.ag-kr-st { display: inline-flex; flex: 0 0 auto; }
.ag-kb-more { align-self: flex-start; margin: -4px 0 -4px -7px; font-size: 13px; }
.ag-kb-none { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; padding: 12px 14px; border-radius: 12px; background: var(--l2); border: 1px solid var(--line); }
.ag-kb-none .sig-line { flex: 1 1 260px; font-size: 13px; line-height: 19px; }

/* навыки — карточка навыка: значок · имя · что умеет · ✕; настройка; «Когда и как выполнять» */
.ag-sks { display: flex; flex-direction: column; gap: 14px; }
.ag-sk { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--l1); scroll-margin-top: 12px; transition: box-shadow .3s, border-color .3s; }
.ag-sk-h { display: flex; align-items: flex-start; gap: 12px; }
.ag-sk-ic { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 32px; height: 32px; border-radius: 10px; background: var(--l2); border: 1px solid var(--line); color: var(--ink); }
.ag-sk-t { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.ag-sk-t b { font-size: 14px; line-height: 20px; font-weight: 640; }
.ag-sk-t span { font-size: 12.5px; line-height: 18px; color: var(--mut); }
.ag-sk-lock { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 30px; height: 30px; color: var(--mut2); }
.ag-sk-q { display: flex; align-items: center; gap: 6px; margin-bottom: -4px; font-size: 12.5px; font-weight: 620; color: var(--ink); }
.ag-tip { display: inline-flex; color: var(--mut2); cursor: help; }
/* настройка навыка — бледная рамка, как «Lifecycle stages» у respond.io */
.ag-cfg { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--l3); border: 1px solid var(--line); min-width: 0; }
.ag-cfg-h { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; }
.ag-cfg-h b { font-size: 12.5px; font-weight: 640; color: var(--ink); }
.ag-cfg-h > span { flex: 1 1 auto; font-size: 12px; color: var(--mut2); }
.ag-cfg-f { margin-top: 2px; padding-top: 8px; border-top: 1px solid var(--line); }
.ag-cfg-f .ag-r { padding: 0; border-top: 0; }
.ag-cfg-none { font-size: 12.5px; color: var(--mut2); }
.ag-cfg-l { font-size: 12px; font-weight: 600; color: var(--mut); }
.ag-cfg-note { gap: 6px; }
.ag-cfg .ag-r-c .seg { flex-wrap: nowrap; }
.ag-cfg .ag-r-c .seg button { height: 28px; padding: 0 10px; font-size: 12.5px; white-space: nowrap; }
.ag-stg { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.ag-stg .stage { height: 22px; }
.ag-cfg-h .btn-s { gap: 5px; }
/* «Нужно больше навыков?» / «Предлагаемые навыки» */
.ag-more { display: flex; align-items: center; gap: 12px; margin-top: 4px; font-size: 13px; color: var(--mut); }
.ag-more > i { flex: 1 1 auto; height: 1px; background: var(--line); }
.ag-more-l { display: flex; flex-wrap: wrap; gap: 8px; }
.ag-more-c { height: 32px; gap: 7px; font-size: 13px; color: var(--ink); }
.ag-more-c > svg:first-child { color: var(--mut); }
.ag-more-c > svg:last-child { color: var(--mut2); }
.ag-sk-first { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 18px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--l3); text-align: center; }
.ag-sk-first > b { font-size: 16px; font-weight: 650; }
.ag-sk-first > span { max-width: 460px; font-size: 13px; line-height: 19px; color: var(--mut); }
.ag-sk-first > .btn { margin: 6px 0 10px; }
.ag-sk-first .ag-more { align-self: stretch; }
.ag-sk-first .ag-more-l { justify-content: flex-start; }

/* ── Панель справа: Тест · Проверка ─────────────────────────────────────────── */
.ag-ed-r { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; padding: 14px 16px 8px; background: var(--l1); border-left: 1px solid var(--line); }
.ag-pn-top { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.ag-pn-tabs button { height: 30px; gap: 6px; }
.ag-pn-top > .ib { display: none; }
.ag-pn { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; border-radius: 14px; border: 1px solid var(--line); background: var(--l1); overflow: hidden; }
.ag-pn-cap { flex: 0 0 auto; padding: 0 6px 2px; font-size: 11.5px; line-height: 16px; color: var(--mut2); text-align: center; }
.ag-pn-h { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; min-height: 48px; padding: 8px 10px 8px 12px; border-bottom: 1px solid var(--line); }
.ag-pn-sub { display: inline-flex; gap: 4px; }
.ag-pn-sub button { height: 28px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--mut); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ag-pn-sub button:hover { color: var(--ink); }
.ag-pn-sub button[aria-pressed="true"] { background: var(--acc-soft); color: var(--acc); }
.ag-pn-reset { flex: 0 0 auto; font-size: 12.5px; color: var(--mut); white-space: nowrap; }
.ag-pn-reset:hover { color: var(--ink); background: var(--l2); }
.ag-pn-h .dd-ghost { flex: 0 0 auto; }

/* чат «Теста» — r31 (16.11, круг 3): язык экрана «Ассистент» (App.chatThread, css/chat-thread.css). Кирилл: «не вот это розовое
   оформление чата… а чтобы красиво было сделано в рамках того, как мы делаем сейчас чаты». Без карточки с рамкой и сетки:
   лента прямо в колонке, реплика агента — лицо и имя, текст без пузыря; ваши — мягкий пузырь; поле — App.promptInput */
.ag-pn[data-pn="test"] { border: 0; border-radius: 0; background: none; box-shadow: none; overflow: visible; }
.ag-pn[data-pn="test"] > .ag-pn-h { min-height: 0; padding: 0 0 4px; border-bottom: 0; }
.ag-pn[data-pn="test"] > .ag-cf { margin-top: 6px; border-radius: 16px; border: 1px solid var(--line); background: var(--l1); }
.ag-msgs { --cth-gap: 18px; flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 14px 4px 18px; scrollbar-gutter: stable;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14px); mask-image: linear-gradient(to bottom, transparent 0, #000 14px); }
.ag-pg-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 300px; padding: 12px 0; text-align: center; color: var(--mut); font-size: 13px; line-height: 19px; text-wrap: pretty; }
.ag-pg-empty b { font-size: 16px; line-height: 22px; color: var(--ink); font-weight: 650; letter-spacing: -.01em; }
/* служебная строка (ответ «молча») и её события — по центру */
.ag-m-sys { align-items: center; }
.ag-m-sys > .ag-evs { align-items: center; }
/* события навыков — тихие строки под ответом: значок чернилами, без рамки и плашки */
.ag-ev { display: flex; align-items: flex-start; gap: 7px; margin: 0; font-size: 12px; line-height: 17px; color: var(--mut); }
.ag-ev > svg { flex: 0 0 auto; margin-top: 2px; color: var(--mut2); }
.ag-ev.is-off { color: var(--mut2); }
.ag-ev.is-off > span { text-decoration: none; }
/* «N источника ›» — раскрытие: откуда цифры, знания, правила — тихая карточка белого стекла */
.ag-why-x { display: flex; flex-direction: column; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--cth-fill, var(--l1)); border: 1px solid var(--cth-line, var(--line)); }
.ag-why-s { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ag-why-l { font-size: 11.5px; font-weight: 640; color: var(--mut); }
.ag-basis { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; line-height: 18px; }
.ag-basis-r { display: block; min-width: 0; color: var(--ink); font-weight: 500; overflow-wrap: break-word; }
a.ag-basis-r { cursor: pointer; text-decoration: none; }
a.ag-basis-r:hover, a.ag-basis-r:focus-visible { color: var(--acc); text-decoration: underline; }
.ag-src { display: flex; align-items: center; gap: 9px; width: 100%; min-width: 0; padding: 7px 9px; border-radius: 10px; border: 1px solid var(--line); background: var(--l1); color: var(--ink); text-align: left; font: inherit; }
button.ag-src { cursor: pointer; transition: border-color .14s, background .14s; }
button.ag-src:hover { border-color: var(--acc-soft-brd); background: var(--acc-row); }
.ag-src .kb-ic { width: 26px; height: 26px; border-radius: 8px; }
.ag-src-t { display: flex; flex-direction: column; gap: 1px; flex: 1 1 auto; min-width: 0; }
.ag-src-t b { font-size: 12.5px; line-height: 17px; font-weight: 620; overflow-wrap: anywhere; }
.ag-src-t em { font-style: normal; font-size: 11.5px; line-height: 16px; color: var(--mut2); overflow-wrap: anywhere; }
.ag-src.is-miss { background: var(--l1); }
.ag-src-ic { display: inline-flex; flex: 0 0 auto; color: var(--sig-wait); }
.ag-why-r { display: flex; flex-direction: column; gap: 7px; margin: 0; padding: 0; list-style: none; }
.ag-why-r li { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; line-height: 18px; color: var(--ink); }
.ag-why-r li > .pill, .ag-why-r li > .sig { flex: 0 0 auto; }
.ag-why-r li > span:last-child { min-width: 0; overflow-wrap: anywhere; }
/* низ чата: примеры вопросов «пилюлями» (не больше двух рядов, длинный — с многоточием) и поле App.promptInput */
.ag-pn-f { display: flex; flex-direction: column; gap: 10px; flex: 0 0 auto; padding: 2px 0 2px; }
.ag-pg-pills:empty { display: none; }
.ag-pg-pills .cth-pills { max-height: 76px; overflow: hidden; padding: 2px; margin: -2px; }
.ag-pg-pills .cth-pill { max-width: 100%; white-space: nowrap; }
.ag-pg-pills .cth-pill > span { min-width: 0; white-space: nowrap; }
.ag-pg-pills .cth-pills > .cth-pill { animation: ag-fade .3s ease both; }
.ag-pg-pi { min-width: 0; }
/* знак помощника стоит в правом нижнем углу экрана — поле в колонке справа не уходит под него (как «Отправить» во «Входящих») */
body:has(.launcher) .ag-ed-body > .ag-ed-r .ag-pg-pi { margin-right: 58px; }
/* поля контакта */
.ag-cf { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 14px; }
.ag-cf-g { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.ag-cf-r { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ag-cf-l { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 620; color: var(--mut); }
.ag-cf-ch { display: inline-flex; align-items: center; gap: 4px; font-style: normal; font-weight: 600; color: var(--ai); }
.ag-cf-v { display: flex; align-items: center; min-width: 0; min-height: 22px; font-size: 13.5px; line-height: 20px; color: var(--ink); overflow-wrap: anywhere; }
.ag-cf-v.is-none { color: var(--ink-off); }
.ag-cf-dd { align-self: flex-start; max-width: 100%; }
.ag-cf-dd > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-cf-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ag-cf-note { font-size: 12.5px; line-height: 18px; color: var(--mut2); }
/* проверка */
.ag-rv-n { font-size: 13.5px; font-weight: 650; color: var(--ink); }
.ag-rv { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 12px; }
.ag-rv-g { display: flex; flex-direction: column; gap: 8px; }
.ag-rv-gl { font-size: 12px; font-weight: 620; color: var(--mut); }
.ag-rv-i { display: flex; align-items: flex-start; gap: 10px; padding: 11px 10px 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--l1); transition: border-color .14s, background .14s; }
.ag-rv-i.is-on { border-color: var(--acc-soft-brd); background: var(--acc-row); }
.ag-rv-cb { margin-top: 1px; flex: 0 0 auto; }
.ag-rv-gl2 { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; }
.ag-rv-gl2 > i { width: 6.5px; height: 6.5px; border-radius: 1.5px; transform: rotate(45deg); background: var(--sig-wait); }
.ag-rv-t { display: flex; flex-direction: column; gap: 3px; flex: 1 1 auto; min-width: 0; font-size: 13px; line-height: 19px; color: var(--ink); }
.ag-rv-t em { font-style: normal; font-size: 12px; line-height: 17px; color: var(--mut2); }
.ag-rv-go { align-self: flex-start; margin-left: -7px; padding-top: 1px; padding-bottom: 1px; font-size: 12.5px; }
.ag-rv-i > .ib { flex: 0 0 auto; margin: -2px -4px 0 0; }
.ag-rv-f { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; padding: 10px 12px; border-top: 1px solid var(--line); }
.ag-rv-all { align-items: center; gap: 8px; }
.ag-rv-all em { font-style: normal; font-size: 13px; color: var(--ink); }
.ag-rv-ok { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; flex: 1 1 auto; padding: 28px 18px; text-align: center; color: var(--mut); font-size: 13px; line-height: 19px; }
.ag-rv-ok svg { color: var(--vyg); margin-bottom: 4px; }
.ag-rv-ok b { font-size: 15.5px; color: var(--ink); font-weight: 650; }
.ag-imp-ok { padding: 10px 6px 4px; }

/* ── Всплывающие: шаблоны, навыки ───────────────────────────────────────────── */
.pop.ag-tpop, .pop.ag-spop { display: flex; flex-direction: column; padding: 6px; }
.ag-pop-t { flex: 0 0 auto; padding: 6px 10px 8px; font-size: 13px; font-weight: 650; color: var(--ink); }
.ag-tpop .menu-search { flex: 0 0 auto; }
.ag-tp-l { flex: 1 1 auto; min-height: 0; max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.ag-tp-i { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 8px 10px; border: 0; border-radius: 9px; background: none; text-align: left; color: var(--ink); font: inherit; cursor: pointer; }
.ag-tp-i:hover, .ag-tp-i:focus-visible { background: var(--l2); outline: none; }
.ag-tp-i b { font-size: 13px; line-height: 18px; font-weight: 620; }
.ag-tp-i em { font-style: normal; font-size: 12px; line-height: 17px; color: var(--mut2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ag-spop { max-height: min(460px, calc(100vh - 80px)); overflow-y: auto; }
.ag-sp-i { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 9px; background: none; text-align: left; color: var(--ink); font: inherit; cursor: pointer; }
.ag-sp-i:hover, .ag-sp-i:focus-visible { background: var(--l2); outline: none; }
.ag-sp-i .ag-sk-ic { width: 28px; height: 28px; border-radius: 8px; }
.ag-sp-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ag-sp-t b { font-size: 13px; line-height: 18px; font-weight: 620; }
.ag-sp-t em { font-style: normal; font-size: 12px; line-height: 17px; color: var(--mut2); }

/* ── Окна: «Предлагаем так», «Как писать», библиотека ──────────────────────── */
.ag-imp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; min-height: 0; }
.ag-imp-c { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 0; }
.ag-imp-l { font-size: 12px; font-weight: 640; color: var(--mut); }
.ag-imp-c pre { margin: 0; max-height: min(420px, calc(100vh - 300px)); overflow: auto; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--l2);
  font: inherit; font-size: 13px; line-height: 20px; color: var(--mut); white-space: pre-wrap; overflow-wrap: anywhere; }
.ag-imp-c.is-new pre { background: var(--l1); border-color: var(--ai-brd); color: var(--ink); }
.ag-howto-l { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0 0 0 20px; }
.ag-howto-l li { display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 19px; color: var(--mut); }
.ag-howto-l li::marker { color: var(--mut2); font-weight: 600; }
.ag-howto-l b { color: var(--ink); font-weight: 640; }
.ag-lib-q { width: 100%; min-width: 0; flex: 0 0 auto; }
.ag-lib { display: flex; flex-direction: column; min-height: 0; }
.ag-lib-r { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 9px 2px; border-top: 1px solid var(--line); cursor: pointer; }
.ag-lib > .ag-lib-r:first-child { border-top: 0; }
.ag-lib-r .kb-ic { width: 28px; height: 28px; border-radius: 8px; }
.ag-lib-t { display: flex; flex-direction: column; gap: 1px; flex: 1 1 auto; min-width: 0; }
.ag-lib-t b { font-size: 13px; line-height: 18px; font-weight: 600; }
.ag-lib-t em { font-style: normal; font-size: 12px; line-height: 16px; color: var(--mut2); }
.ag-lib-st { flex: 0 0 auto; }
.ag-lib-sheet .sb { gap: 12px; }

/* ── ⚙ «Дополнительно» — шторка справа во всю высоту (как Advanced settings у respond.io) ── */
.sheet-wrap:has(> .ag-drawer) { justify-content: flex-end; align-items: stretch; padding: 0; }
/* шторка выезжает от правого края целиком и так же уезжает */
.sheet.ag-drawer { width: min(520px, 100vw); max-height: none; height: 100vh; border-radius: 0; border-width: 0 0 0 1px; transform: translateX(100%); opacity: 1;
  transition: transform .34s cubic-bezier(.2, .8, .2, 1); box-shadow: -28px 0 60px -20px rgba(16, 24, 40, .28); }
.sheet-wrap.is-in .sheet.ag-drawer { transform: none; }
.sheet-wrap.is-out .sheet.ag-drawer { transform: translateX(100%); transition-duration: .22s; }
.ag-drawer .sh { padding: 16px 16px 14px 20px; background: var(--l1); }
.ag-drawer .sh::before { display: none; }
.ag-drawer .sh-title { font-size: 17px; }
.ag-drawer .sb { padding: 14px 20px 20px; }
.ag-dw { display: flex; flex-direction: column; gap: 14px; }
.ag-dw-sec { font-size: 13px; font-weight: 650; color: var(--ink); }
.ag-dw-b { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--l1); scroll-margin-top: 8px; }
.ag-dw-bh { display: flex; flex-direction: column; gap: 3px; }
.ag-dw-bh b { font-size: 13.5px; font-weight: 650; }
.ag-dw-bh p { font-size: 12.5px; line-height: 18px; color: var(--mut); }
.ag-dw-wait { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.ag-dw-l { font-size: 12.5px; font-weight: 620; color: var(--ink); }
.ag-dw-wait .dd { justify-content: space-between; height: 40px; border-radius: 11px; }
.ag-dw-all { align-self: flex-start; margin-left: -7px; font-size: 13px; }

/* ── Узкий редактор (1100×560 с меню): панель — шторкой по кнопкам «Тест · Проверка» во втором ярусе ── */
@container aged (max-width: 999px) {
  .ag-ed-body { grid-template-columns: minmax(0, 1fr); }
  .ag-ed-row { gap: 5px; padding: 6px 10px 2px 6px; min-height: 52px; }
  .ag-ed-row2 { gap: 6px; padding: 0 10px 6px 12px; min-height: 40px; }
  .ag-ed-nm { min-width: 96px; max-width: 220px; }
  .ag-ed-nm span, .ag-ed-when, .ag-ed-row > .ag-st > svg { display: none; }
  .ag-ed-row > .ag-st { padding: 0 9px; }
  .ag-ed-att span { display: none; }
  .ag-ed-pnb { display: inline-flex; }
  .ag-ed-row .btn { height: 32px; padding: 0 9px; font-size: 12.5px; }
  .ag-ed-l { padding: 14px 16px 32px 28px; }
  .ag-ed-dots { left: 9px; }
  .ag-ed-body > .ag-ed-r { display: none; }
  .ag-rule { grid-template-columns: 24px minmax(0, 1fr) auto; row-gap: 6px; }
  .ag-rule-ar { display: none; }
  .ag-rule .ag-whobtn, .ag-rule.is-locked .ag-rule-lw { grid-column: 2 / 3; grid-row: 2; }
  .ag-rule-a { grid-column: 3; grid-row: 1 / 3; align-self: center; }
  .ag-imp { grid-template-columns: minmax(0, 1fr); }
  .ag-kr-st { display: none; }
}
@container aged (max-width: 760px) {
  .ag-ed-seg button > span, .ag-ed-vw button > span { display: none; }
  .ag-ed-pnb .btn > span { display: none; }
}
/* панель окном-шторкой (узкое окно): те же вкладки и чат, во всю высоту справа; крестик — закрыть */
.sheet.ag-drawer.ag-pn-dw { width: min(460px, 100vw); }
.ag-pn-dw .sb { flex: 1 1 auto; display: flex; padding: 0; gap: 0; overflow: hidden; }
.ag-pn-dw .ag-ed-r { flex: 1 1 auto; height: 100%; padding-top: 12px; border-left: 0; }
.ag-pn-dw .ag-pn-top > .ib { display: inline-flex; }
/* низкое окно: подсказки чата — одной строкой, поле инструкции ниже */
@media (max-height: 700px) {
  .ag-pg-pills .cth-pills { max-height: 36px; }
  .ag-fld-l .ag-fld-ta { height: 196px; }
  .ag-pn-h { min-height: 44px; padding-top: 6px; padding-bottom: 6px; }
  .ag-msgs { --cth-gap: 14px; padding: 10px 4px 12px; }
}

/* ── Круг 2 (20.10): живой отклик редактора — свет лиловый и мятный, без красного; общий слой кнопок — css/motion.css ── */
.ag-ed, .sheet.ag-pn-dw, .sheet.ag-drawer, .ag-imp-sheet { --ag-mint: color-mix(in srgb, var(--vyg) 62%, #7ee8cf); --ag-lilac: color-mix(in srgb, var(--acc) 80%, #b9a3ff);
  --ag-glow: 0 0 0 3px color-mix(in srgb, var(--acc) 14%, transparent), 0 12px 32px -18px color-mix(in srgb, var(--acc) 80%, transparent); }
@keyframes ag-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes ag-fade { from { opacity: 0; } }
@keyframes ag-pop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.15); } }
@keyframes ag-bump { 40% { transform: scale(1.35); } }
@keyframes ag-ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--acc) 38%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
@keyframes ag-beacon { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sig-wait) 45%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }
@keyframes ag-shine { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes ag-spin { to { transform: rotate(360deg); } }
@keyframes ag-flash { 0% { background-color: color-mix(in srgb, var(--ag-mint, var(--vyg)) 22%, transparent); } 100% { background-color: transparent; } }
@keyframes ag-slide { from { opacity: 0; transform: translateX(-6px); } }
@keyframes ag-in-me { from { opacity: 0; transform: translate(10px, 6px); } }

/* вход в редактор и смена «Настройка · Статистика»: карточки поднимаются по очереди, панель проявляется */
.ag-ed.is-enter .ag-c { animation: ag-rise .46s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 70ms); }
.ag-ed.is-enter .ag-ed-r { animation: ag-fade .5s ease both .12s; }
.ag-ed.is-enter .ag-ed-st .kpi { animation: ag-rise .42s cubic-bezier(.2, .8, .2, 1) both; }
.ag-ed.is-enter .ag-ed-st .kpi:nth-child(2) { animation-delay: 40ms; }
.ag-ed.is-enter .ag-ed-st .kpi:nth-child(3) { animation-delay: 80ms; }
.ag-ed.is-enter .ag-ed-st .kpi:nth-child(4) { animation-delay: 120ms; }
.ag-ed.is-enter .ag-ed-st .kpi:nth-child(n+5) { animation-delay: 160ms; }
.ag-ed.is-enter .ag-ed-st .card { animation: ag-rise .46s cubic-bezier(.2, .8, .2, 1) both .18s; }

/* полоса: «Нужно внимание» — маячок у ромбика; «Сохранить» после первой правки — короткое свечение; состояния кнопок */
.ag-ed-att > i { animation: ag-beacon 2.6s ease-in-out infinite; }
.ag-ed-att:hover > i { animation: none; }
.ag-ed-save.is-ping { animation: ag-ring 1s ease-out; border-color: var(--acc-soft-brd); color: var(--acc); }
.ag-ed-pub.is-ping { animation: ag-ring 1.1s ease-out .1s; }
.ag-ed-bar .btn.is-busy { opacity: 1; gap: 8px; }
.ag-ed-bar .btn.is-done { opacity: 1; color: var(--ag-mint); border-color: color-mix(in srgb, var(--ag-mint) 55%, transparent); background: color-mix(in srgb, var(--ag-mint) 10%, var(--l1)); }
.ag-ed-bar .btn.is-done > svg { animation: ag-pop .4s cubic-bezier(.34, 1.56, .64, 1) both; }
.ag-spin { display: inline-block; flex: 0 0 auto; width: 13px; height: 13px; border-radius: 50%; border: 2px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor; animation: ag-spin .7s linear infinite; }
.ag-rv-n .ag-spin { margin-right: 8px; vertical-align: -2px; color: var(--acc); }
.ag-st { transition: border-color .14s, transform .16s cubic-bezier(.2, .8, .2, 1), box-shadow .2s; }
.ag-st:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -10px rgba(22, 32, 46, .35); }
.ag-st:active { transform: scale(.97); }
.ag-ed-dots button.is-on { box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 16%, transparent); }

/* карточки: метка «не сохранено» у заголовка; поле — свет при фокусе (лиловый→мятный перелив сверху), вспышка после вставки */
.ag-c-uns { display: none; align-items: center; gap: 6px; margin-left: 10px; font-size: 12px; font-weight: 560; color: var(--acc); vertical-align: 2px; }
.ag-c-uns > i { width: 6px; height: 6px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 16%, transparent); }
.ag-c.is-dirty .ag-c-uns { display: inline-flex; animation: ag-fade .3s ease both; }
.ag-fld { position: relative; transition: border-color .2s, box-shadow .3s; }
.ag-fld:focus-within { border-color: color-mix(in srgb, var(--acc) 45%, var(--line-2)); box-shadow: var(--ag-glow); }
.ag-fld:focus-within::before { content: ''; position: absolute; left: 12px; right: 12px; top: -1px; height: 2px; border-radius: 2px; pointer-events: none;
  background: linear-gradient(90deg, var(--ag-lilac), var(--ag-mint), var(--ag-lilac)); background-size: 200% 100%; animation: ag-shine 3.2s linear infinite; }
.ag-fld.is-flash { animation: ag-flash 1.2s ease-out; }
.ag-ai-b > svg { transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.ag-ai-b:hover > svg { transform: rotate(18deg) scale(1.12); }
.ag-ai-b.is-busy { pointer-events: none; color: var(--acc); border-color: color-mix(in srgb, var(--acc) 40%, transparent);
  background: linear-gradient(90deg, var(--l1), color-mix(in srgb, var(--acc) 12%, var(--l1)), var(--l1)); background-size: 200% 100%; animation: ag-shine 1s linear infinite; }
.ag-ai-b.is-busy > svg { animation: ag-spin 1s linear infinite; }

/* въезд и схлопывание (навыки, правила, источники, строки «Проверки») */
.ag-sk.is-in, .ag-rule.is-in, .ag-kr.is-in { animation: ag-rise .42s cubic-bezier(.2, .8, .2, 1) both; }
.ag-kr.is-new { box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 14%, transparent); }
.ag-rule.is-new { border-color: var(--acc-soft-brd); box-shadow: 0 0 0 3px var(--acc-soft); }
.ag-sk.is-out, .ag-rule.is-out, .ag-kr.is-out, .ag-rv-i.is-out { transition: height .26s cubic-bezier(.4, 0, .2, 1), opacity .2s, margin .26s, padding .26s, border-width .26s;
  height: 0 !important; opacity: 0; margin-top: 0 !important; margin-bottom: 0 !important; padding-top: 0 !important; padding-bottom: 0 !important; border-width: 0 !important; overflow: hidden; }
.ag-rule.is-up, .ag-rule.is-down { box-shadow: 0 0 0 3px var(--acc-soft); animation: ag-fade .3s ease both; }
.ag-c, .ag-sk { transition: box-shadow .5s, border-color .5s; }

/* свои кнопки и строки — тот же отклик, что у .btn (приподнимаются, вжимаются) */
.ag-pick, .ag-whobtn, .ag-rule-lw, .ag-ed-att { transition: border-color .15s, box-shadow .2s, transform .16s cubic-bezier(.2, .8, .2, 1), background .15s; }
.ag-pick:hover, .ag-whobtn:not(:disabled):hover, .ag-rule-lw:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -10px color-mix(in srgb, var(--acc) 55%, transparent); }
.ag-pick:active, .ag-whobtn:not(:disabled):active, .ag-rule-lw:active, .ag-ed-att:active { transform: scale(.97); box-shadow: none; }
.ag-kr { transition: background .15s, box-shadow .5s; border-radius: 10px; }
.ag-kr:hover { background: var(--l3); }
.ag-kr:hover .ag-kr-t b { color: var(--acc); }
.ag-sk:hover { border-color: var(--line-2); }
.ag-sk-ic { transition: transform .25s cubic-bezier(.34, 1.56, .64, 1), color .2s, border-color .2s; }
.ag-sk:hover .ag-sk-ic { transform: rotate(-6deg) scale(1.06); color: var(--acc); border-color: var(--acc-soft-brd); }
.ag-pn-reset:disabled { opacity: .45; cursor: default; background: none; color: var(--mut); }
.ag-lib-r .ag-lib-t b, .ag-chr .ag-chr-t b { transition: color .14s; }
.ag-lib-r:hover .ag-lib-t b, .ag-chr:not(.is-off):hover .ag-chr-t b { color: var(--acc); }
.ag-tp-i, .ag-sp-i { transition: background .12s, transform .14s; }
.ag-tp-i:active, .ag-sp-i:active { transform: scale(.985); }
.ag-sp-i:hover .ag-sk-ic { color: var(--acc); border-color: var(--acc-soft-brd); }

/* «Тест»: сообщения появляются плавно (cth-m.is-in — css/chat-thread.css), события навыков — по очереди, раскрытие «N источников» */
.cth-m.is-in .ag-ev { animation: ag-slide .4s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(.32s + var(--k, 0) * .14s); }
.ag-why-x.is-in { animation: ag-rise .28s cubic-bezier(.2, .8, .2, 1) both; }
.ag-msgs.is-clearing > * { transition: opacity .16s, transform .16s; opacity: 0; transform: translateY(-4px); }
.ag-pg-empty { animation: ag-fade .35s ease both; }
.ag-pn-sub-dot { display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--ag-mint, var(--vyg)); vertical-align: 2px; animation: ag-pop .4s cubic-bezier(.34, 1.56, .64, 1) both; }
.ag-cf-r.is-flash .ag-cf-v { border-radius: 6px; animation: ag-flash 1.6s ease-out both; }
.ag-cf-r.is-flash .ag-cf-ch { animation: ag-pop .45s cubic-bezier(.34, 1.56, .64, 1) both; }
.ag-pn-tabs button > i.is-bump { animation: ag-bump .45s cubic-bezier(.34, 1.56, .64, 1); }

/* «Проверка»: применённое — галочка мятным и уезжает; «Проверяю…» — мерцающие строки; «Всё готово» — галочка впрыгивает */
.ag-rv-i { transition: border-color .2s, background .2s; }
.ag-rv-i.is-done { border-color: color-mix(in srgb, var(--ag-mint) 55%, transparent); background: color-mix(in srgb, var(--ag-mint) 10%, var(--l1)); }
.ag-rv-i.is-done .cb span { background: var(--ag-mint); border-color: var(--ag-mint); color: #fff; animation: ag-pop .4s cubic-bezier(.34, 1.56, .64, 1) both; }
.ag-rv-i.is-done .ag-rv-t em { color: var(--ag-mint); }
.ag-rv-load { gap: 10px; }
.ag-rv-load > i { display: block; flex: 0 0 auto; height: 58px; border-radius: 12px; border: 1px solid var(--line);
  background: linear-gradient(90deg, var(--l2), color-mix(in srgb, var(--acc) 8%, var(--l1)), var(--l2)); background-size: 200% 100%; animation: ag-shine 1.1s linear infinite; }
.ag-rv-ok svg { animation: ag-pop .5s cubic-bezier(.34, 1.56, .64, 1) both .05s; }
.ag-rv-ok b, .ag-rv-ok span { animation: ag-fade .4s ease both .15s; }

/* «Предлагаем так»: что уйдёт — зачёркнуто серым, что появится — мятной полосой; строки проявляются по очереди */
.ag-imp-sum { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--mut); }
.ag-imp-sum > span { display: inline-flex; align-items: center; gap: 5px; }
.ag-imp-sum > span:first-child > svg { color: var(--ag-mint, var(--vyg)); }
.ag-dl { display: block; min-height: 20px; padding: 0 6px; margin: 0 -6px; border-radius: 4px; white-space: pre-wrap; }
.ag-dl.is-del { color: var(--mut2); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--mut2) 70%, transparent); background: var(--l3); }
.ag-dl.is-add { color: var(--ink); background: color-mix(in srgb, var(--ag-mint, var(--vyg)) 14%, transparent); box-shadow: inset 2px 0 0 var(--ag-mint, var(--vyg));
  animation: ag-slide .35s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(min(var(--k, 0), 30) * 18ms); }

@media (prefers-reduced-motion: reduce) {
  .ag-ed *, .ag-ed, .sheet.ag-drawer, .sheet.ag-drawer *, .ag-tpop *, .ag-spop *, .ag-imp-sheet * { animation: none !important; transition-duration: .01s !important; }
}

/* ══ r12 (23.10): редактор как у respond.io в бледном языке «Баланса» ══════════════════════════════════════════════
   Значки — только контурные в стеклянном квадрате (.ag-gi); цвет — у лица агента и сигналов; красного нет; главная — одна. */
.ag-gi { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 32px; height: 32px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--l2); color: var(--mut); transition: color .2s, border-color .2s, transform .25s cubic-bezier(.34, 1.56, .64, 1); }
.ag-gi-l { width: 38px; height: 38px; border-radius: 12px; color: var(--ink); }
.ag-gi-s { width: 28px; height: 28px; border-radius: 9px; }
.ag-gi-xs { width: 20px; height: 20px; border-radius: 6px; }
[data-theme="light"] .ag-gi { background: var(--pl-glass); border-color: var(--pl-glass-brd); box-shadow: var(--pl-glass-sh); color: var(--icon); }
[data-theme="light"] .ag-gi-l { background: linear-gradient(160deg, #fff, #f6f1ff); border-color: #e3d8fa; color: #4c2bb0; box-shadow: 0 8px 18px -12px rgba(91, 47, 191, .45), inset 0 1px 0 #fff; }
.ag-c-h { align-items: center; }

/* карточки разделов — дымка «Баланса»; поле — стекло */
[data-theme="light"] .ag-ed-l .ag-c { background: var(--pl-haze); border-color: var(--pl-haze-brd); box-shadow: var(--pl-haze-sh); }
[data-theme="light"] .ag-fld { background: rgba(255, 255, 255, .94); border-color: #e4dcf6; }
[data-theme="light"] .ag-fld-f { border-top: 1px solid #f1ecfb; }
[data-theme="light"] .ag-ed-dots button { background: #e3d9f8; }
[data-theme="light"] .ag-ed-dots button.is-on { background: linear-gradient(180deg, #a78bfa, #7c4ddf); box-shadow: 0 0 8px rgba(139, 92, 246, .45); }

/* ── Источники знаний: строки ── */
.ag-krs { gap: 2px; }
.ag-kr { padding: 8px 6px; margin: 0 -6px; border-top: 0; }
.ag-krs > .ag-kr:first-child { padding-top: 8px; }
.ag-kr + .ag-kr { box-shadow: inset 0 1px 0 var(--line); }
.ag-kr-ic { width: 34px; height: 34px; }
.ag-kr-st { margin-left: 4px; }
.ag-kr-st .sig { white-space: nowrap; }
.ag-kr-use { flex: 0 0 auto; margin-left: 6px; }
.ag-kr.is-off .ag-kr-t b { color: var(--mut); }
.ag-kr.is-off .ag-kr-t em { color: var(--mut2); }
.ag-kr.is-off .ag-gi { opacity: .55; }
.ag-kb-f { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; }
.ag-kb-f .ag-kb-more { margin: 0 0 0 -7px; }
.ag-kb-add { display: flex; align-items: center; justify-content: center; gap: 8px; flex: 1 1 100%; height: 40px; border: 1px dashed var(--line-3); border-radius: 12px; background: none;
  color: var(--mut); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.ag-kb-add:hover { color: var(--acc); border-color: var(--acc-soft-brd); background: var(--acc-row); }
[data-theme="light"] .ag-kr:hover { background: rgba(255, 255, 255, .92); box-shadow: inset 0 0 0 1px #ece5fa, 0 10px 22px -20px rgba(91, 47, 191, .5); }
[data-theme="light"] .ag-kr + .ag-kr { box-shadow: inset 0 1px 0 #f1ecfb; }
[data-theme="light"] .ag-kr + .ag-kr:hover { box-shadow: inset 0 0 0 1px #ece5fa, 0 10px 22px -20px rgba(91, 47, 191, .5); }
[data-theme="light"] .ag-kr:hover .ag-gi { color: var(--acc); border-color: #d9cbfa; }
[data-theme="light"] .ag-kb-add { border-color: #d9cbfa; background: rgba(255, 255, 255, .5); }
[data-theme="light"] .ag-kb-add:hover { background: var(--pl-sel-bg); border-color: var(--pl-sel-brd); }
[data-theme="light"] .ag-kb-none { background: var(--pl-glass); border-color: var(--pl-glass-brd); }

/* ── Навыки: обзор, карточка, паспорт «Когда → Проверяет → Делает → Видно» ── */
.ag-sko { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--l2); }
.ag-sko-n { margin-right: 6px; font-size: 12.5px; font-weight: 600; color: var(--mut); white-space: nowrap; }
.ag-sko-i { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line); background: var(--l1); color: var(--mut); cursor: pointer;
  transition: color .15s, border-color .15s, transform .16s cubic-bezier(.2, .8, .2, 1); }
.ag-sko-i:hover { color: var(--acc); border-color: var(--acc-soft-brd); transform: translateY(-1px); }
.ag-sko-i.is-off { opacity: .45; border-style: dashed; }
[data-theme="light"] .ag-sko { background: var(--pl-glass); border-color: var(--pl-glass-brd); box-shadow: var(--pl-glass-sh); }
[data-theme="light"] .ag-sko-i { background: rgba(255, 255, 255, .9); border-color: #e9e2f8; color: var(--icon); }

.ag-sk { padding: 16px 16px 12px; gap: 14px; }
.ag-sk-h { align-items: center; }
.ag-sk-sw { flex: 0 0 auto; margin-left: 4px; }
.ag-sk.is-off { background: var(--l2); }
.ag-sk.is-off .ag-sk-t b { color: var(--mut); }
.ag-sk.is-off .ag-gi { opacity: .55; }
.ag-sk-offt { display: flex; align-items: center; gap: 8px; margin: -4px 0 2px 44px; font-size: 12.5px; line-height: 18px; color: var(--mut2); }
.ag-sk-offt svg { flex: 0 0 auto; }
[data-theme="light"] .ag-sk { background: var(--pl-glass); border-color: var(--pl-glass-brd); box-shadow: var(--pl-glass-sh); }
[data-theme="light"] .ag-sk:hover { border-color: #ddd0fb; box-shadow: var(--pl-lift); }
[data-theme="light"] .ag-sk.is-off { background: rgba(250, 248, 255, .7); box-shadow: none; }
[data-theme="light"] .ag-sk:hover .ag-sk-ic { color: var(--acc); border-color: #d9cbfa; }

.ag-pp { position: relative; display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; }
.ag-pp::before { content: ""; position: absolute; left: 13px; top: 18px; bottom: 18px; width: 1.5px; border-radius: 2px; background: var(--line-2); }
.ag-pp-s { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; }
.ag-pp-m { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--l1); color: var(--mut); }
.ag-pp-b { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ag-pp-l { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; min-height: 28px; padding-top: 4px; }
.ag-pp-l b { font-size: 13px; font-weight: 650; color: var(--ink); }
.ag-pp-l em { font-style: normal; font-size: 12px; color: var(--mut2); }
.ag-pp-t { font-size: 13px; line-height: 19px; color: var(--ink); }
.ag-pp-ul { display: flex; flex-direction: column; gap: 5px; margin: 0; padding: 0; list-style: none; }
.ag-pp-ul li { position: relative; padding-left: 16px; font-size: 13px; line-height: 19px; color: var(--ink); }
.ag-pp-ul li::before { content: ""; position: absolute; left: 3px; top: 8px; width: 5px; height: 5px; border-radius: 1.5px; transform: rotate(45deg); background: var(--line-3); }
.ag-pp-over { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px dashed var(--line-3); font-size: 12.5px; line-height: 18px; color: var(--mut); }
.ag-pp-over > svg { flex: 0 0 auto; color: var(--mut2); }
.ag-pp-over > span { flex: 1 1 auto; min-width: 0; }
.ag-pp-over b { color: var(--ink); font-weight: 620; }
.ag-pp-over .link { flex: 0 0 auto; font-size: 12.5px; }
.ag-evp { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; max-width: 100%; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--l2); font-size: 12.5px; line-height: 18px; color: var(--mut); }
.ag-evp > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-sk-f { display: flex; align-items: center; gap: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.ag-sk-need { display: inline-flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; font-size: 12px; color: var(--mut2); }
.ag-sk-need > svg { flex: 0 0 auto; }
.ag-sk-need > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-sk-test { flex: 0 0 auto; font-size: 12.5px; font-weight: 600; }
[data-theme="light"] .ag-pp::before { background: linear-gradient(180deg, #e3d9f8, #efe9fb); }
[data-theme="light"] .ag-pp-m { background: #fff; border-color: #e3d9f8; color: var(--icon); box-shadow: 0 4px 10px -8px rgba(91, 47, 191, .45); }
[data-theme="light"] .ag-pp-s:focus-within .ag-pp-m { color: var(--acc); border-color: var(--pl-sel-brd); background: var(--pl-sel-bg); }
[data-theme="light"] .ag-pp-over { border-color: #e3d9f8; background: rgba(255, 255, 255, .6); }
[data-theme="light"] .ag-evp { background: rgba(255, 255, 255, .9); border-color: #ebe4fb; }
[data-theme="light"] .ag-sk-f { border-top-color: #f1ecfb; }
[data-theme="light"] .ag-cfg { background: rgba(255, 255, 255, .7); border-color: #ece5fa; }
.ag-more { flex-wrap: wrap; }
.ag-more > .link { font-size: 12.5px; }

/* метки, запрос во внешнюю систему, звонки — строки «ключ · значение» */
.ag-kv { display: flex; flex-direction: column; gap: 6px; }
.ag-kv-r { display: grid; grid-template-columns: minmax(90px, 160px) 18px minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.ag-kv-r.ag-kv-3 { grid-template-columns: minmax(80px, 130px) minmax(70px, 100px) minmax(0, 1fr) auto; }
.ag-kv-r.ag-kv-2 { grid-template-columns: minmax(110px, 180px) minmax(0, 1fr) auto; }
.ag-kv-r .in { min-width: 0; width: 100%; }
.ag-kv-tag { display: flex; align-items: center; gap: 2px; min-width: 0; font-weight: 600; color: var(--mut); }
.ag-kv-ar { display: inline-flex; color: var(--mut2); }
.ag-http { gap: 10px; }
.ag-http-r { display: flex; }
.ag-http-n { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; min-width: 0; }
.ag-http-u { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ag-http-u .seg { flex: 0 0 auto; }
.ag-http-u .seg button { height: 30px; padding: 0 10px; font-size: 12px; font-weight: 650; letter-spacing: .02em; }
.ag-http-url { flex: 1 1 auto; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; }
.ag-http-body { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; }
.ag-http-note { display: flex; gap: 7px; font-size: 12px; line-height: 17px; color: var(--mut2); }
.ag-http-note > svg { flex: 0 0 auto; margin-top: 2px; }
.ag-cl-greet { width: min(320px, 100%); }

/* ── Тест: строки событий навыков (как в тест-чате respond.io) — r31: тихие строки ленты, значок чернилами без плитки,
   без рамок и пунктира; подсвеченная (навык, который проверяют) — мягкая подложка ── */
.ag-evs { display: flex; flex-direction: column; gap: 2px; margin-top: -2px; }
.ag-ev { align-items: center; gap: 7px; margin: 0; padding: 2px 8px 2px 0; border-radius: 8px; border: 0; background: none; font-size: 12.5px; line-height: 18px; color: var(--mut); flex-wrap: wrap; }
.ag-ev > .ag-gi-xs { width: 16px; height: 16px; margin: 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--ink-icon, var(--ink)); opacity: .62; }
.ag-ev > span:not(.ag-gi):not(.ag-ev-tabs) { flex: 1 1 0; min-width: 0; }
.ag-ev-st { flex: 0 0 auto; font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--mut2); }
.ag-ev-st[data-st="wait"]::before { content: ""; display: inline-block; width: 5.5px; height: 5.5px; margin-right: 5px; border-radius: 1.5px; transform: rotate(45deg); background: var(--sig-wait); vertical-align: 1px; }
.ag-ev.is-off { color: var(--mut2); }
.ag-ev.is-off > .ag-gi-xs { opacity: .38; }
.ag-ev.is-hl { padding-left: 6px; margin-left: -6px; background: var(--cth-hover, var(--l2)); color: var(--ink); }
.ag-ev-tabs { display: inline-flex; gap: 2px; flex: 0 0 auto; }
.ag-ev-tabs button { height: 22px; padding: 0 8px; border: 0; border-radius: 999px; background: none; color: var(--mut); font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; transition: background .14s, color .14s; }
.ag-ev-tabs button:hover { color: var(--ink); background: var(--cth-hover, var(--l2)); }
.ag-ev-tabs button[aria-pressed="true"] { color: var(--ink); background: var(--cth-bub, var(--l2)); }
.ag-ev-pre { flex: 1 1 100%; margin: 4px 0 4px 23px; max-height: 180px; overflow: auto; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--cth-line, var(--line)); background: var(--cth-fill, var(--l1));
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11.5px; line-height: 16px; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.ag-pg-empty .aim { margin-bottom: 8px; }

/* ── Панель «Тест · Проверка» — стекло; дорожки и подвкладки — бледные ── */
[data-theme="light"] .ag-ed-r { background: radial-gradient(140% 26% at 100% 0%, rgba(196, 181, 253, .12), transparent 70%), linear-gradient(180deg, #fdfcff, #faf8ff); border-left-color: #ece6f8; }
[data-theme="light"] .ag-pn { background: rgba(255, 255, 255, .9); border-color: #ebe4fb; box-shadow: 0 18px 44px -38px rgba(91, 47, 191, .45); }
[data-theme="light"] .ag-pn-h { border-bottom-color: #f1ecfb; }
[data-theme="light"] .ag-pn-sub { padding: 2px; border-radius: 10px; background: var(--pl-track-bg); box-shadow: inset 0 0 0 1px var(--pl-track-brd); }
[data-theme="light"] .ag-pn-sub button[aria-pressed="true"] { background: var(--pl-sel-bg); color: var(--acc); box-shadow: inset 0 0 0 1px var(--pl-sel-brd), 0 4px 10px -8px rgba(91, 47, 191, .5); }
[data-theme="light"] .ag-pn[data-pn="test"] { background: none; box-shadow: none; }
[data-theme="light"] .ag-pn[data-pn="test"] > .ag-cf { background: rgba(255, 255, 255, .9); border-color: #ebe4fb; }
[data-theme="light"] .ag-why-x { background: #fff; border-color: rgba(62, 52, 104, .09); box-shadow: 0 10px 28px -24px rgba(62, 52, 104, .35); }
/* «Знания» в раскрытии — строки без рамок; значок источника — чернилами, без цветной плитки */
.ag-why-x .ag-src { padding: 3px 0; border: 0; border-radius: 0; background: none; }
.ag-why-x .ag-src .kb-ic { width: 22px; height: 22px; border: 0; border-radius: 0; background: none; color: var(--ink-icon, var(--ink)); opacity: .7; }
.ag-why-x .ag-src.is-miss { padding: 8px 10px; margin: 2px -4px 0; border-radius: 10px; background: color-mix(in srgb, var(--sig-wait) 7%, transparent); }

/* ── Проверка: находки по месту ── */
.ag-rv-gh { display: flex; align-items: center; gap: 8px; }
.ag-rv-place { font-size: 12px; }
.ag-rv-sk { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--mut); }
.ag-rv-fx { display: inline-flex; align-items: center; gap: 5px; }
.ag-rv-fx > svg { flex: 0 0 auto; color: var(--acc); }
.ag-pn-h .link > svg { margin-right: 4px; vertical-align: -2px; }
.ag-rv-ok b { max-width: 300px; }
.ag-rv-ok span { max-width: 320px; }
[data-theme="light"] .ag-rv-i { background: rgba(255, 255, 255, .9); border-color: #ece5fa; }
[data-theme="light"] .ag-rv-i.is-on { background: var(--pl-sel-bg); border-color: var(--pl-sel-brd); box-shadow: 0 6px 14px -12px rgba(91, 47, 191, .5); }
[data-theme="light"] .ag-rv-f { border-top-color: #f1ecfb; }
[data-theme="light"] .ag-rv-ok svg { color: #14b8a6; filter: drop-shadow(0 4px 10px rgba(20, 184, 166, .3)); }

/* ── «Шаблоны ⌄»: список слева, превью справа ── */
.pop.ag-tpop { padding: 0; overflow: hidden; }
.ag-tp2 { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 0; height: min(420px, calc(100vh - 140px)); }
.ag-tp2-l { display: flex; flex-direction: column; min-height: 0; padding: 6px; border-right: 1px solid var(--line); }
.ag-tp2-l .ag-tp-l { max-height: none; }
.ag-tp-i.is-cur { background: var(--l2); }
.ag-tp-i em { -webkit-line-clamp: 1; }
.ag-tp2-p { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; padding: 12px 14px; }
.ag-tp-ph { display: flex; align-items: center; gap: 10px; }
.ag-tp-ph b { flex: 1 1 auto; min-width: 0; font-size: 13.5px; font-weight: 650; }
.ag-tp-ins { flex: 0 0 auto; }
.ag-tp-pre { flex: 1 1 auto; min-height: 0; overflow: auto; margin: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--l2);
  font: inherit; font-size: 12.5px; line-height: 19px; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.ag-tp-pre mark { padding: 0 2px; border-radius: 4px; background: var(--acc-soft); color: var(--acc); }
.ag-tp-hint { font-size: 11.5px; line-height: 16px; color: var(--mut2); }
[data-theme="light"] .ag-tp2-l { border-right-color: #efe9fa; background: rgba(250, 248, 255, .7); }
[data-theme="light"] .ag-tp-i.is-cur { background: var(--pl-sel-bg); box-shadow: inset 0 0 0 1px var(--pl-sel-brd); }
[data-theme="light"] .ag-tp-pre { background: #fff; border-color: #ece5fa; }

/* ── Вид «Знания компании» в окне «Добавить источник» ── */
.ag-co-q { width: 100%; min-width: 0; margin-bottom: 12px; }
.ag-co { display: flex; flex-direction: column; gap: 2px; }
.ag-co-gl { margin: 10px 0 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--mut2); }
.ag-co-gl:first-child { margin-top: 0; }
.ag-co-r { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 6px 8px; border-radius: 10px; transition: background .14s; }
.ag-co-r:hover { background: var(--l2); }
.ag-co-c { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; cursor: pointer; }
.ag-co-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ag-co-t b { font-size: 13px; line-height: 18px; font-weight: 620; }
.ag-co-t em { font-style: normal; font-size: 12px; line-height: 16px; color: var(--mut2); }
.ag-co-st, .ag-co-open { flex: 0 0 auto; }
.ag-co-open { font-size: 12.5px; }
.ag-co-r.is-none { opacity: .6; }
[data-theme="light"] .ag-co-r:hover { background: rgba(255, 255, 255, .92); box-shadow: inset 0 0 0 1px #ece5fa; }

/* ── Окно «Библиотека навыков» ── */
.ag-sl-sheet .sb { gap: 12px; }
.sheet.ag-sl-sheet { height: min(720px, calc(100vh - 48px)); }
.ag-sl-q { width: 100%; min-width: 0; flex: 0 0 auto; }
.ag-sl { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; flex: 1 1 auto; min-height: 0; }
.ag-sl-nav { display: flex; flex-direction: column; gap: 3px; min-height: 0; overflow-y: auto; }
.ag-sl-n { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 36px; padding: 0 10px; border: 1px solid transparent; border-radius: 10px; background: none; color: var(--ink); font: inherit; font-size: 13px; font-weight: 560; text-align: left; cursor: pointer; }
.ag-sl-n > svg { flex: 0 0 auto; color: var(--mut2); }
.ag-sl-n > span { flex: 1 1 auto; min-width: 0; }
.ag-sl-n > em { font-style: normal; font-size: 12px; color: var(--mut2); }
.ag-sl-n:hover { background: var(--l2); }
.ag-sl-n.is-on { background: var(--acc-soft); border-color: var(--acc-soft-brd); color: var(--acc); }
.ag-sl-n.is-on > svg { color: var(--acc); }
.ag-sl-list { display: flex; flex-direction: column; gap: 16px; min-height: 0; overflow-y: auto; padding-right: 4px; }
.ag-sl-g { display: flex; flex-direction: column; gap: 8px; }
.ag-sl-gh { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--mut2); }
.ag-sl-gh b { font-size: 13px; font-weight: 650; color: var(--ink); }
.ag-sl-i { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--l1); transition: border-color .15s, box-shadow .2s; }
.ag-sl-i:hover { border-color: var(--line-2); }
.ag-sl-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ag-sl-t > b { font-size: 13.5px; line-height: 19px; font-weight: 650; }
.ag-sl-t > span { font-size: 12.5px; line-height: 18px; color: var(--mut); }
.ag-sl-m { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px 10px; margin: 6px 0 0; }
.ag-sl-m dt { font-size: 11.5px; font-weight: 600; color: var(--mut2); }
.ag-sl-m dd { margin: 0; min-width: 0; font-size: 12.5px; color: var(--ink); }
.ag-sl-m .ag-evp { padding: 2px 10px 2px 2px; font-size: 12px; }
.ag-sl-ok { display: inline-flex; align-items: center; gap: 5px; height: 30px; font-size: 12.5px; font-weight: 600; color: var(--mut); white-space: nowrap; }
.ag-sl-ok > svg { color: var(--vyg); }
.ag-sl-i.is-added { background: var(--l2); }
.ag-sl-i.is-just { animation: ag-rise .4s cubic-bezier(.2, .8, .2, 1) both; border-color: var(--acc-soft-brd); }
[data-theme="light"] .ag-sl-n:hover { background: rgba(255, 255, 255, .92); box-shadow: inset 0 0 0 1px #ece5fa; }
[data-theme="light"] .ag-sl-n.is-on { background: var(--pl-sel-bg); border-color: var(--pl-sel-brd); box-shadow: var(--pl-sel-sh); }
[data-theme="light"] .ag-sl-i { background: var(--pl-glass); border-color: var(--pl-glass-brd); box-shadow: var(--pl-glass-sh); }
[data-theme="light"] .ag-sl-i:hover { border-color: #ddd0fb; box-shadow: var(--pl-lift); }
[data-theme="light"] .ag-sl-i.is-added { background: rgba(250, 248, 255, .75); box-shadow: none; }
[data-theme="light"] .ag-sl-ok > svg { color: #14b8a6; }
@media (max-width: 1180px) { .ag-sl { grid-template-columns: 196px minmax(0, 1fr); gap: 12px; } }
@media (max-height: 640px) { .ag-sl-n { min-height: 31px; } .ag-sl-nav { gap: 1px; } .ag-sl-sheet .sb { gap: 10px; } }
.ag-sl-n > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Окно «Имя, описание и лицо» ── */
.ag-look { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.ag-look-pv { position: sticky; top: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 16px 22px; border-radius: 18px; border: 1px solid var(--line); background: var(--l2); text-align: center; }
.ag-look-pv .aim { margin-bottom: 12px; }
.ag-look-pv b { max-width: 100%; font-size: 15px; font-weight: 650; }
.ag-look-pv span { font-size: 12px; color: var(--mut2); }
.ag-look-opts { display: flex; flex-direction: column; gap: 14px; }
.ag-look-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ag-look-o, .ag-look-b { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; padding: 0; border-radius: 12px; border: 1px solid var(--line); background: var(--l1); color: var(--mut); cursor: pointer;
  transition: border-color .15s, box-shadow .2s, transform .16s cubic-bezier(.2, .8, .2, 1); }
.ag-look-b { width: 36px; height: 36px; border-radius: 10px; }
.ag-look-f { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--l1); color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 560; cursor: pointer;
  transition: border-color .15s, box-shadow .2s, transform .16s cubic-bezier(.2, .8, .2, 1); }
:is(.ag-look-o, .ag-look-b, .ag-look-f):hover { border-color: var(--acc-soft-brd); transform: translateY(-1px); }
:is(.ag-look-o, .ag-look-b, .ag-look-f).is-on { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); color: var(--acc); }
[data-theme="light"] .ag-look-pv { background: radial-gradient(80% 60% at 50% 0%, rgba(196, 181, 253, .22), transparent 70%), linear-gradient(170deg, #fdfcff, #f7f3ff); border-color: #e6ddfb; box-shadow: var(--pl-haze-sh); }
[data-theme="light"] :is(.ag-look-o, .ag-look-b, .ag-look-f) { background: var(--pl-glass); border-color: var(--pl-glass-brd); }
[data-theme="light"] :is(.ag-look-o, .ag-look-b, .ag-look-f).is-on { background: var(--pl-sel-bg); border-color: #b9a2f5; box-shadow: var(--pl-sel-sh), 0 0 0 3px rgba(139, 92, 246, .1); }
@media (max-width: 1180px) { .ag-look { grid-template-columns: 170px minmax(0, 1fr); gap: 18px; } }

@media (prefers-reduced-motion: reduce) {
  .ag-sl-sheet *, .ag-look-sheet *, .kb-add-win * { animation: none !important; transition-duration: .01s !important; }
}
.ag-co-fix { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 18px; height: 18px; color: var(--mut2); }
/* суть строки источника и строки событий переносятся по словам — числа не режутся многоточием */
.ag-kr-t em.ag-kr-m { white-space: normal; overflow-wrap: break-word; }
.ag-kr-u { white-space: nowrap; }
.ag-evp { align-items: flex-start; border-radius: 12px; }
.ag-evp > span:last-child { overflow: visible; text-overflow: clip; white-space: normal; padding-top: 1px; }
.ag-sk-need > span { overflow: visible; text-overflow: clip; white-space: normal; }

/* ── r16 (24.10): навык — компактная карточка, как у respond.io (Кирилл: «слишком много места занимает… уменьшил») ──
   значок · имя · одна строка «что умеет» · ×; «Когда и как выполнять этот навык?» (i); поле с панелью; одна строка
   своей настройки; «Как написать правило». Паспорта, рамок и строк «Нужно / Проверить в тесте» больше нет */
.ag-sks { gap: 12px; }
.ag-sk { gap: 10px; padding: 14px 14px 10px; }
.ag-sk-h { align-items: flex-start; gap: 12px; }
.ag-sk-h > .ib { margin: -4px -6px 0 0; }
.ag-sk-ic { width: 30px; height: 30px; border-radius: 9px; }
.ag-sk-t { padding-top: 1px; }
.ag-sk-t b { font-size: 14px; line-height: 19px; }
.ag-sk-t span { font-size: 12.5px; line-height: 17px; }
.ag-sk-q { margin: 2px 0 -4px; font-size: 12.5px; font-weight: 600; color: var(--mut); }
.ag-sk-qi { display: inline-flex; color: var(--mut2); cursor: help; border-radius: 50%; }
.ag-sk-qi:hover, .ag-sk-qi:focus-visible { color: var(--acc); outline: none; }
.ag-sk .ag-fld-ta { min-height: 46px; padding-top: 9px; }
.ag-sk-x { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-width: 0; padding: 0 2px; font-size: 12.5px; }
.ag-sk-xl { flex: 0 0 auto; font-weight: 600; color: var(--mut); }
.ag-sk-xv { min-width: 0; color: var(--ink); }
.ag-sk-x .ag-stg { flex: 1 1 auto; min-width: 0; gap: 6px 10px; }
.ag-sk-x .ag-pick-s { width: auto; max-width: 280px; height: 30px; padding: 0 8px 0 10px; border-radius: 9px; font-size: 12.5px; font-weight: 600; }
.ag-sk-code { flex: 0 1 auto; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 3px 8px; border-radius: 7px; border: 1px solid var(--line); background: var(--l2);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; color: var(--ink); }
.ag-sk-set { flex: 0 0 auto; margin-left: auto; font-size: 12.5px; font-weight: 600; }
.ag-sk-set > svg { margin-left: 3px; vertical-align: -2px; }
.ag-sk-lk { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin: 0; padding: 0 2px; font-size: 12px; line-height: 17px; color: var(--mut2); }
.ag-sk-lk > svg { flex: 0 0 auto; align-self: center; }
.ag-sk-lk > span { flex: 1 1 260px; min-width: 0; }
.ag-sk-lk > .link { flex: 0 0 auto; font-size: 12px; }
.ag-sk-how { margin: -2px 0 0 -7px; font-size: 12.5px; }
.ag-sk-add { flex: 0 0 auto; width: 100%; margin-top: 2px; }
.ag-sk-none { margin: 0; padding: 4px 2px 2px; font-size: 13px; line-height: 19px; color: var(--mut); }
[data-theme="light"] .ag-sk-code { background: rgba(250, 248, 255, .9); border-color: #ece5fa; }
/* «Открытые реестры» у «Проверки клиента» — строка без переключателя (всегда с агентом) */
.ag-kr.ag-kr-reg .ag-kr-t { cursor: default; }
/* строка источника — не ссылка: ничего не открывает (r16) */
.ag-kr-t { cursor: default; }
.ag-kr:hover .ag-kr-t b { color: var(--ink); }
.ag-kr.is-off:hover .ag-kr-t b { color: var(--mut); }
/* список «Добавить навык» у кнопки — как у respond.io: «Искать» и группы */
.choose.ag-skpop .menu-list { max-height: min(380px, calc(100vh - 160px)); }
.choose.ag-skpop .mi { min-height: 38px; }
.choose.ag-skpop .mi-i { color: var(--mut); }
.choose.ag-skpop .menu-t { margin-top: 4px; }
/* окна «Настроить» у HTTP-запроса и звонков */
.ag-cfg-sheet .ag-cfg { background: none; border: 0; padding: 0; }
.ag-cfg-sheet .ag-r { padding: 10px 0; }
@media (max-width: 1280px) { .ag-sk-x .ag-stg .stage-s:nth-child(n+6) { display: none; } }
/* r16 (И): «Документы для отправки» пустой — пояснение и «+ Добавить документ» одной рамкой-пунктиром */
.ag-sd-none { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.ag-sd-none > p { margin: 0; padding: 0 2px; font-size: 13px; line-height: 19px; color: var(--mut); }
.ag-sd-all { white-space: nowrap; }
/* FIN (17.11): агент сервера — строка версии на полосе (щелчок — «Версии»), окно версий, правки «Оптимизировать»,
   строка «проверен сохранённый черновик» в «Проверке» */
.ag-ed-ver { gap: 6px; height: 26px; padding: 0 7px; border: 0; border-radius: 8px; background: none; cursor: pointer; font: inherit; font-size: 12px; color: var(--mut2); transition: color .14s, background .14s; }
.ag-ed-ver .ag-dirty { margin-right: 0; }
.ag-ed-ver:hover { color: var(--ink); background: var(--l2); }
.ag-ed-ver:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.ag-ver-d { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.ag-ver-d:empty { display: none; }
.ag-ver-c { display: flex; flex-direction: column; gap: 6px; }
.ag-ver-d .ag-imp-c pre { max-height: 260px; }
.ag-ver-sheet .ag-r-c { flex-wrap: nowrap; }
.ag-opt { display: flex; flex-direction: column; gap: 18px; }
.ag-opt-h { display: flex; flex-direction: column; gap: 8px; }
.ag-opt-h.is-off { opacity: .6; }
.ag-opt-cb { align-items: flex-start; gap: 8px; }
.ag-opt-cb em { font-style: normal; font-size: 13px; line-height: 18px; color: var(--ink); }
.ag-opt .ag-imp-c pre { max-height: 220px; }
.ag-rv-saved { margin: 0 0 10px; }
