/* Схема ИИ-агента — screens/agents-map.js и общий холст core/canvas.js (r12, 23.10.2026; r16 — один агент, разделы-блоки).
   Язык — бледное ядро: лавандовая дымка с точечной сеткой, белое стекло, лиловые связи под прямым углом со скруглением, лицо
   сотрудника — единственный цвет; сигналы — словом с глифом, красного нет (янтарь). Светлая тема берёт рецепты --pl-* из
   pale-app.css, тёмная — токены; «уменьшить движение» гасит переходы. Минимальный текст — 11 px (масштаб холста его не меняет). */

/* ── Экран ──────────────────────────────────────────────────────────────────────────────────────────────────────── */
.view-full.view-agents > .screen-agents { max-width: none; }
.am {
  --am-edge: #8f6df0; --am-edge-q: rgba(143, 109, 240, .34); --am-edge-bg: rgba(143, 109, 240, .2);
  --am-dash: rgba(120, 88, 214, .42); --am-ink-s: var(--mut2);
  --am-n-bg: linear-gradient(160deg, rgba(255, 255, 255, .99), rgba(255, 255, 255, .9));
  --am-n-brd: #e8e1f8; --am-n-sh: 0 1px 2px rgba(91, 47, 191, .05), 0 14px 30px -24px rgba(91, 47, 191, .42);
  --am-n-hover: 0 1px 2px rgba(91, 47, 191, .06), 0 18px 34px -20px rgba(91, 47, 191, .55);
  --am-ag-bg: linear-gradient(160deg, #fff 0%, #f7f2ff 100%);
  --am-glass: rgba(255, 255, 255, .86); --am-glass-brd: #e7dffa;
  --am-chip: rgba(139, 92, 246, .07); --am-chip-brd: #ebe4fb;
  --am-bar: #e6dcfd; --am-bar-now: #7c4ddf;
  position: relative; display: flex; flex: 1 1 auto; min-width: 0; min-height: 0; overflow: hidden; container: am / inline-size;
}
.am-main { position: relative; flex: 1 1 auto; min-width: 0; min-height: 0; overflow: hidden; container: amm / inline-size; }
[data-theme="dark"] .am {
  --am-edge: #a98bff; --am-edge-q: rgba(169, 139, 255, .34); --am-edge-bg: rgba(169, 139, 255, .2);
  --am-dash: rgba(180, 150, 255, .4);
  --am-n-bg: linear-gradient(160deg, rgba(38, 48, 68, .98), rgba(30, 39, 58, .94));
  --am-n-brd: #34445f; --am-n-sh: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 30px -22px rgba(0, 0, 0, .75);
  --am-n-hover: 0 1px 2px rgba(0, 0, 0, .35), 0 20px 34px -20px rgba(0, 0, 0, .85);
  --am-ag-bg: linear-gradient(160deg, rgba(48, 40, 78, .98), rgba(34, 36, 62, .95));
  --am-glass: rgba(30, 39, 58, .86); --am-glass-brd: #34445f;
  --am-chip: rgba(169, 139, 255, .1); --am-chip-brd: #3b4a66;
  --am-bar: #3a3560; --am-bar-now: #b9a0ff;
}
.am.is-empty .cv-world { opacity: .5; }

/* ── Слева — выбор сотрудника: как колонка «Воронки» (лицо 36, имя, должность, одно число — подключённые каналы) ───────── */
.am-rail { flex: 0 0 248px; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--l1); border-right: 1px solid var(--line); }
[data-theme="light"] .am-rail { background: radial-gradient(140% 30% at 0% 0%, rgba(196, 181, 253, .13), transparent 70%), linear-gradient(180deg, #fdfcff 0%, #faf8ff 100%); border-right-color: #ece6f8; }
.am-rh { display: flex; align-items: center; gap: 6px; padding: 14px 12px 6px 8px; }
.am-rh b { font-size: 15.5px; line-height: 22px; font-weight: 700; letter-spacing: -.012em; color: var(--ink); }
.am-rs { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 6px 8px 8px; scrollbar-width: thin; display: flex; flex-direction: column; gap: 2px; }
.am-rt { padding: 14px 10px 4px; font-size: 11.5px; font-weight: 650; letter-spacing: .02em; color: var(--mut2); }
.am-r { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; min-height: 56px; padding: 8px 10px; border: 0; border-radius: 12px; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; transition: background .12s, box-shadow .12s; }
.am-r:hover { background: var(--l3); }
[data-theme="light"] .am-r:hover { background: rgba(255, 255, 255, .92); }
.am-r:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--acc-soft-brd); }
.am-r.is-on { background: var(--selection-bg, var(--acc-soft)); }
[data-theme="light"] .am-r.is-on { background: var(--pl-sel-bg); box-shadow: inset 0 0 0 1px var(--pl-sel-brd), 0 6px 14px -10px rgba(91, 47, 191, .45); }
.am-rf { display: inline-flex; flex: 0 0 auto; transition: opacity .2s, filter .2s; }
.am-r.is-quiet .am-rf { opacity: .6; filter: saturate(.55); }
.am-rl { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.am-rl b { font-size: 14px; line-height: 19px; font-weight: 600; color: var(--ink); }
.am-r.is-on .am-rl b { font-weight: 680; }
.am-rl em { font-style: normal; font-size: 12px; line-height: 16px; color: var(--mut2); }
.am-rn { flex: 0 0 auto; min-width: 22px; height: 20px; padding: 0 7px; box-sizing: border-box; border-radius: 999px; background: var(--l3); color: var(--mut); font-size: 12px; font-weight: 650; line-height: 20px; text-align: center; }
[data-theme="light"] .am-rn { background: #fff; box-shadow: inset 0 0 0 1px #ebe4fb; }
.am-r.is-on .am-rn { color: var(--acc); }
.am-rnote { margin: 0; padding: 12px 16px 14px; border-top: 1px solid var(--line); font-size: 12px; line-height: 17px; color: var(--mut2); }
@container am (max-width: 980px) {
  .am-rail { flex-basis: 66px; }
  .am-rh { justify-content: center; padding: 12px 4px 4px; }
  .am-rh b, .am-rt, .am-rl, .am-rn, .am-rnote { display: none; }
  .am-rs { align-items: center; padding: 8px 6px; }
  .am-r { width: 48px; min-height: 52px; padding: 0; justify-content: center; }
}

/* ── Холст (общий, core/canvas.js): мир двигается и растёт, сетка точек едет вместе с ним ─────────────────────────── */
.cv { --dot: 24px; --dm: 1; position: relative; overflow: hidden; outline: none; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.cv[data-z="low"] { --dm: 2; }
.am-cv {
  position: absolute; inset: 0;
  background-color: #f8f6ff;
  background-image:
    radial-gradient(circle, rgba(139, 109, 224, .3) 1.1px, transparent 1.6px),
    radial-gradient(900px 560px at 102% -12%, rgba(196, 181, 253, .42), transparent 62%),
    radial-gradient(760px 520px at -6% 108%, rgba(94, 234, 212, .15), transparent 62%),
    radial-gradient(640px 420px at 40% -20%, rgba(167, 139, 250, .1), transparent 62%);
  background-size: calc(var(--dot) * var(--dm)) calc(var(--dot) * var(--dm)), auto, auto, auto;
  background-position: calc(var(--tx, 0px) - var(--dot) * var(--dm) / 2) calc(var(--ty, 0px) - var(--dot) * var(--dm) / 2), 0 0, 0 0, 0 0;
}
[data-theme="dark"] .am-cv {
  background-color: var(--l0);
  background-image:
    radial-gradient(circle, rgba(150, 130, 230, .22) 1.1px, transparent 1.6px),
    radial-gradient(900px 560px at 102% -12%, rgba(120, 80, 220, .2), transparent 62%),
    radial-gradient(760px 520px at -6% 108%, rgba(60, 190, 170, .09), transparent 62%);
}
.cv:focus, .cv:focus-visible { outline: none; }
.cv.is-pan, .cv.is-drag { cursor: grabbing; }
.cv.is-conn { cursor: crosshair; }
.cv-world { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; will-change: transform; }
.cv-svg { position: absolute; left: 0; top: 0; z-index: 1; overflow: visible; pointer-events: none; }
.cv-nodes { position: absolute; left: 0; top: 0; z-index: 2; width: 0; height: 0; }
.cv-ctl { position: absolute; left: 0; top: 0; z-index: 3; width: 0; height: 0; }
.cv-marq { position: absolute; z-index: 7; border: 1px solid var(--acc); border-radius: 8px; background: color-mix(in srgb, var(--acc) 9%, transparent); pointer-events: none; }
.cv-marq[hidden] { display: none; }

/* связи: ломаные под прямым углом, без стрелок — как у eVa; общий фон — тоньше, подключения знаний, каналов и передачи — ярче */
.cv-line { fill: none; stroke: var(--am-edge); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; opacity: .66; transition: opacity .14s, stroke-width .14s; }
.cv-hit { fill: none; stroke: transparent; stroke-width: 18; pointer-events: stroke; cursor: pointer; }
.cv-edge.is-quiet .cv-line { stroke: var(--am-edge-q); stroke-width: 1.7; opacity: .9; }
.cv-edge.is-quiet.k-bg .cv-line { stroke: var(--am-edge-bg); opacity: 1; }
.cv-edge.is-dash .cv-line { stroke-dasharray: 3 7; stroke-width: 2.4; opacity: .9; }
.cv-edge.is-rel .cv-line { opacity: 1; stroke-width: 2.7; }
.cv-edge.is-quiet.is-rel .cv-line { opacity: 1; stroke: var(--am-edge-q); stroke-width: 2; }
.cv-edge.is-hot .cv-line, .cv-edge.is-sel .cv-line { opacity: 1; stroke-width: 3; stroke: var(--acc); }
.cv-edge.is-dim { opacity: .14; }
.cv-tmp { fill: none; stroke: var(--acc); stroke-width: 2.4; stroke-dasharray: 6 5; stroke-linecap: round; }
.cv-ectl { position: absolute; transform: translate(-50%, -50%); width: 26px; height: 26px; pointer-events: none; }
.cv-eb { position: absolute; inset: 0; display: inline-flex; align-items: center; justify-content: center; padding: 0; border-radius: 50%; border: 1px solid var(--am-glass-brd); background: var(--l1);
  color: var(--mut); box-shadow: 0 6px 14px -8px rgba(91, 47, 191, .5); cursor: pointer; opacity: 0; transform: scale(.8); transition: opacity .12s, transform .12s, color .12s, border-color .12s; }
.cv-ectl.is-hot .cv-eb { opacity: 1; transform: none; pointer-events: auto; }
.cv-eb:hover { color: var(--acc); border-color: var(--acc-brd); }
.cv-eb:disabled { opacity: .5 !important; cursor: not-allowed; }
.cv-pend { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 2px; transform: rotate(45deg); background: var(--sig-wait, #d97706); box-shadow: 0 0 0 3px var(--l1); transition: opacity .12s; }
.cv-ectl.is-hot .cv-pend { opacity: 0; }

/* точки связи: у подключаемых — всегда, у «фоновых» — тихая точка; тянется от любой */
.cv-port { position: absolute; z-index: 3; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--l1); border: 2px solid var(--am-edge); box-shadow: 0 0 0 3px color-mix(in srgb, var(--l1) 70%, transparent); transition: transform .12s, background .12s, box-shadow .12s; cursor: crosshair; }
.cv-port[data-port="in"] { left: -6px; top: 50%; }
.cv-port[data-port="out"] { right: -6px; top: 50%; }
.cv-port::after { content: ''; position: absolute; inset: -9px; border-radius: 50%; }
.cv-port.is-deco { pointer-events: none; width: 8px; height: 8px; margin-top: -4px; border-width: 1.5px; border-color: var(--am-edge-q); }
.cv-port.is-deco[data-port="in"] { left: -5px; } .cv-port.is-deco[data-port="out"] { right: -5px; }
.cv-port:hover { transform: scale(1.3); background: var(--acc-soft); }

/* ── Карточка агента (в центре схемы) ────────────────────────────────────────────────────────────────────────────── */
.am-n { position: absolute; display: flex; align-items: center; gap: 11px; padding: 0 12px 0 12px; border-radius: 16px; background: var(--am-n-bg); border: 1px solid var(--am-n-brd); box-shadow: var(--am-n-sh);
  cursor: pointer; color: var(--ink); transition: border-color .15s, box-shadow .18s, transform .18s, opacity .22s; }
.am-n:hover { border-color: var(--acc-brd); box-shadow: var(--am-n-hover); transform: translateY(-1px); }
.am-n:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.am-n.is-sel { z-index: 5; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft), var(--am-n-hover); }   /* выбранный блок — поверх соседних */
.am-n.is-moving { z-index: 6; cursor: grabbing; box-shadow: 0 0 0 3px var(--acc-soft), 0 26px 40px -22px rgba(91, 47, 191, .6); transition: none; transform: none; }
.cv.is-drag .am-n { transition: none; transform: none; }
.am-n.is-quiet .am-face { opacity: .6; filter: saturate(.55); }

.am-t { display: flex; flex-direction: column; justify-content: center; gap: 1px; min-width: 0; flex: 1 1 auto; }
.am-t b { font-size: 13.5px; line-height: 18px; font-weight: 650; letter-spacing: -.005em; color: var(--ink); }
.am-t > span { font-size: 12px; line-height: 16px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-t em { display: flex; align-items: center; gap: 8px; min-width: 0; font-style: normal; line-height: 17px; }
.am-t em .sig { flex: 0 0 auto; font-size: 12px; }
.am-t em .am-meta { min-width: 0; font-size: 12px; color: var(--mut2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-for { display: inline-flex; align-items: center; flex: 0 0 auto; color: var(--mut2); }
.am-for svg { flex: 0 0 auto; }
.am-wait { flex: 0 0 auto; width: 6.5px; height: 6.5px; border-radius: 1.5px; transform: rotate(45deg); background: var(--sig-wait, #d97706); }
.am-more { position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--mut2);
  cursor: pointer; opacity: 0; transition: opacity .12s, background .12s, color .12s; }
.am-n:hover .am-more, .am-n.is-sel .am-more, .am-more:focus-visible { opacity: 1; }
.am-more:hover { background: var(--acc-soft); color: var(--acc); }
.am-agent .am-t { padding-right: 18px; }

/* значок в стеклянном квадрате: контурный, без цветной плашки */
.am-ic { --s: 34px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: var(--s); height: var(--s); border-radius: 11px; color: var(--icon, var(--mut));
  background: linear-gradient(160deg, rgba(255, 255, 255, .95), rgba(246, 241, 255, .85)); border: 1px solid var(--am-glass-brd); box-shadow: inset 0 1px 0 #fff; }
[data-theme="dark"] .am-ic { background: linear-gradient(160deg, rgba(60, 70, 98, .6), rgba(44, 52, 78, .6)); box-shadow: none; }
.am .ch { flex: 0 0 auto; }

.am-agent { background: var(--am-ag-bg); gap: 16px; padding-left: 18px; border-color: var(--pl-sel-brd, var(--acc-soft-brd)); box-shadow: 0 1px 2px rgba(91, 47, 191, .06), 0 22px 40px -26px rgba(91, 47, 191, .55); }
.am-face { display: inline-flex; flex: 0 0 auto; transition: opacity .2s, filter .2s; }
.am-agent .am-t { gap: 2px; }
.am-agent .am-t b { font-size: 19px; line-height: 25px; letter-spacing: -.012em; }
.am-agent .am-t > span { font-size: 13.5px; line-height: 18px; }
.am-agent .am-t em { margin-top: 4px; }
.am-agent .am-t em .sig { font-size: 12.5px; }
.am-agent .am-t > .am-stat { margin-top: 2px; font-size: 12.5px; color: var(--mut2); }
.am-agent .am-more { top: 12px; right: 12px; }

/* ── Разделы-блоки (r16): шапка с числом, «+» и «⋯», строки с «×», внизу «+ добавить». Блок тянется целиком за любое место;
   высоты — те же числа, что secH() в agents-map.js: шапка 54, строка --rh, зазор 8 (плитки навыков 30 и 6), пусто 64, низ 12 + 36 + 14 ── */
.am-sec { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0; padding: 0 12px 14px; border-radius: 20px; cursor: grab;
  background: linear-gradient(160deg, rgba(255, 255, 255, .74), rgba(250, 247, 255, .62)); border-color: var(--am-glass-brd);
  box-shadow: 0 1px 2px rgba(91, 47, 191, .04), 0 18px 36px -30px rgba(91, 47, 191, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
[data-theme="dark"] .am-sec { background: linear-gradient(160deg, rgba(38, 48, 68, .74), rgba(30, 39, 58, .62)); }
.am-sec:hover { transform: none; border-color: var(--acc-brd); box-shadow: 0 1px 2px rgba(91, 47, 191, .05), 0 20px 38px -28px rgba(91, 47, 191, .55); }
.am-sec.is-sel { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft), 0 20px 38px -28px rgba(91, 47, 191, .55); }
.am-sec-h { display: flex; align-items: center; gap: 8px; flex: 0 0 54px; height: 54px; min-width: 0; padding-left: 2px; }
.am-sec-ic { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 28px; height: 28px; border-radius: 9px; color: var(--acc);
  background: var(--pl-sel-bg, var(--acc-soft)); border: 1px solid var(--pl-sel-brd, var(--acc-soft-brd)); }
.am-sec-h b { min-width: 0; font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-sec-n { flex: 0 0 auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; font-size: 11.5px; font-weight: 650; line-height: 18px; text-align: center; color: var(--acc); background: var(--acc-soft); border: 1px solid var(--acc-soft-brd); }
.am-sec.is-none .am-sec-n { color: var(--mut2); background: transparent; border-color: var(--am-glass-brd); }
.am-sec-h .grow { flex: 1 1 auto; }
.am-sec .am-sec-more { position: static; flex: 0 0 auto; width: 26px; height: 26px; opacity: .75; }
.am-sec .am-sec-more:hover, .am-sec .am-sec-more:focus-visible { opacity: 1; }
.am-plus { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 26px; height: 26px; padding: 0; border-radius: 50%; color: var(--acc); background: var(--am-glass); border: 1px solid var(--am-glass-brd);
  box-shadow: 0 6px 14px -10px rgba(91, 47, 191, .6); cursor: pointer; transition: transform .12s, background .12s, border-color .12s; }
.am-plus:hover { background: var(--acc-soft); border-color: var(--acc-brd); transform: scale(1.08); }
.am-plus-s { width: 24px; height: 24px; }
.am-sec-b { flex: 0 0 auto; min-width: 0; }
.am-rows { display: flex; flex-direction: column; gap: 8px; }
.am-row { position: relative; display: flex; align-items: center; gap: 10px; height: var(--rh, 52px); min-width: 0; padding: 0 6px 0 10px; border-radius: 13px;
  background: var(--am-n-bg); border: 1px solid var(--am-n-brd); box-shadow: 0 1px 2px rgba(91, 47, 191, .04); transition: border-color .12s, box-shadow .12s; }
.am-row:hover { border-color: var(--acc-brd); box-shadow: 0 10px 20px -16px rgba(91, 47, 191, .5); }
.am-row.is-link { cursor: pointer; }
.am-row.is-kb { cursor: inherit; }
.am-row .am-t b { font-size: 13.5px; line-height: 18px; }
.am-row .am-ic { --s: 32px; }
.am-x { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--mut2);
  cursor: pointer; opacity: .55; transition: opacity .12s, background .12s, color .12s; }
.am-row:hover .am-x, .am-x:focus-visible { opacity: 1; }
.am-x:hover { background: var(--acc-soft); color: var(--acc); }
.am-lock, .am-go { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; color: var(--mut2); }
.am-row .am-wait { margin-right: 2px; }
.am-otag { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 18px; padding: 0 6px; border-radius: 6px; font-size: 11px; font-weight: 650; letter-spacing: .02em; color: var(--mut); background: var(--am-chip); border: 1px solid var(--am-chip-brd); }
.am-sec-e { box-sizing: border-box; display: flex; align-items: center; height: 64px; margin: 0; padding: 0 14px; border-radius: 13px; border: 1.5px dashed var(--am-dash); font-size: 12.5px; line-height: 17px; color: var(--mut); }
.am-sec-add { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: 0 0 36px; height: 36px; margin-top: 12px; padding: 0 12px; border-radius: 12px; border: 1.5px dashed var(--am-dash);
  background: transparent; color: var(--mut); font: inherit; font-size: 13px; font-weight: 560; cursor: pointer; transition: background .12s, border-color .12s, color .12s; }
.am-sec-add:hover, .am-sec-add:focus-visible { background: var(--acc-soft); border-color: var(--acc-brd); color: var(--acc); outline: none; }
.am-sec-add span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* навыки: плитки в две колонки, «×» на плитке */
.am-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.am-chip { position: relative; display: inline-flex; align-items: center; gap: 6px; min-width: 0; height: 30px; padding: 0 4px 0 9px; border-radius: 10px; font-size: 12.5px; font-weight: 540; color: var(--ink); background: var(--am-n-bg); border: 1px solid var(--am-chip-brd); }
.am-chip svg { flex: 0 0 auto; color: var(--icon, var(--mut)); }
.am-chip > span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-chip.is-pend { border-style: dashed; border-color: var(--am-dash); }
.am-chip .am-lock { width: 20px; height: 20px; }
.am-chip-x { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--mut2); cursor: pointer; opacity: .5; transition: opacity .12s, background .12s, color .12s; }
.am-chip:hover .am-chip-x, .am-chip-x:focus-visible { opacity: 1; }
.am-chip-x:hover { background: var(--acc-soft); color: var(--acc); }

/* связь агент → раздел: одна на раздел, тише связей-выборов */
.cv-edge.is-quiet.k-sec .cv-line { stroke: var(--am-edge); stroke-width: 2; opacity: .45; }
.cv-edge.is-quiet.k-sec.is-rel .cv-line { stroke: var(--am-edge); stroke-width: 2.4; opacity: .9; }

/* ── Поверх холста: заголовок, действия, панель масштаба ─────────────────────────────────────────────────────────── */
.am-zoom { position: absolute; z-index: 8; }
.am-top { position: absolute; z-index: 8; left: 16px; right: 16px; top: 14px; display: flex; align-items: center; gap: 12px; pointer-events: none; }
.am-top > * { pointer-events: auto; }
.am-title { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 18px 8px 10px; border-radius: 18px;
  background: var(--am-glass); border: 1px solid var(--am-glass-brd); box-shadow: 0 1px 2px rgba(91, 47, 191, .04), 0 16px 34px -26px rgba(91, 47, 191, .5); backdrop-filter: blur(10px) saturate(1.3); -webkit-backdrop-filter: blur(10px) saturate(1.3); cursor: default; }
.am-back { flex: 0 0 auto; width: 32px; height: 32px; color: var(--mut); }
.am-title-f { display: inline-flex; flex: 0 0 auto; }
.am-title-f > * { flex: 0 0 auto; }
.am-title-t { min-width: 0; }
.am-title-t h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; font-size: 15.5px; line-height: 20px; font-weight: 700; letter-spacing: -.012em; color: var(--ink); }
.am-title-t p { margin: 1px 0 0; font-size: 12.5px; line-height: 16px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-acts { flex: 0 0 auto; margin-left: auto; display: flex; align-items: center; gap: 8px; }
.am-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 13px; background: var(--am-glass); border: 1px solid var(--am-glass-brd); box-shadow: 0 10px 22px -18px rgba(91, 47, 191, .5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.am-sg { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--mut); font: inherit; font-size: 13px; font-weight: 560; white-space: nowrap; cursor: pointer; transition: background .12s, color .12s; }
.am-sg:hover { color: var(--acc); }
.am-sg[aria-pressed="true"] { color: var(--acc); background: var(--pl-sel-bg, var(--acc-soft)); box-shadow: inset 0 0 0 1px var(--pl-sel-brd, var(--acc-soft-brd)); cursor: default; }
.am-acts .btn { box-shadow: 0 10px 22px -16px rgba(91, 47, 191, .55); background-clip: padding-box; }
.am-secb { position: relative; }
.am-secb.is-quiet { color: var(--mut); }
.am-secb-n { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; margin-left: 2px; padding: 0 6px; border-radius: 999px; font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--acc); background: var(--acc-soft); border: 1px solid var(--acc-soft-brd); }
.am-secb-n[hidden] { display: none; }
.am-zoom { left: 16px; bottom: 16px; display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 16px; background: var(--am-glass); border: 1px solid var(--am-glass-brd);
  box-shadow: 0 1px 2px rgba(91, 47, 191, .04), 0 16px 34px -24px rgba(91, 47, 191, .55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); cursor: default; }
.am-zb, .am-zt, .am-zp { display: inline-flex; align-items: center; justify-content: center; height: 32px; padding: 0; border: 0; border-radius: 11px; background: none; color: var(--mut); font: inherit; cursor: pointer; transition: background .12s, color .12s; }
.am-zb { width: 32px; }
.am-zp { min-width: 54px; color: var(--ink); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.am-zt { gap: 7px; padding: 0 11px; color: var(--ink); font-size: 13px; font-weight: 560; white-space: nowrap; }
.am-zb:hover:not(:disabled), .am-zt:hover, .am-zp:hover { background: var(--acc-soft); color: var(--acc); }
.am-zb:disabled { opacity: .35; cursor: default; }
.am-zs { width: 1px; height: 20px; margin: 0 4px; background: var(--am-glass-brd); }
.am-redo svg { transform: scaleX(-1); }
.am-help { margin: 0; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; line-height: 20px; color: var(--mut); }
.am-help b { color: var(--ink); font-weight: 620; }

@container amm (max-width: 1080px) {
  .am-acts [data-k="am-layout"] .am-sg span { display: none; }
  .am-acts [data-k="am-layout"] .am-sg { width: 34px; padding: 0; justify-content: center; }
}
@container amm (max-width: 900px) {
  .am-zt span { display: none; }
  .am-zt { width: 32px; padding: 0; }
  .am-title-t p { display: none; }
  .am-title { min-height: 52px; }
}
@container amm (max-width: 760px) {
  .am-secb > span { display: none; }
  .am-sg span { display: none; }
  .am-sg { width: 34px; padding: 0; justify-content: center; }
}
@container amm (max-width: 620px) {
  .am-title-f { display: none; }
}

/* уменьшить движение: ни переходов, ни подъёма карточек */
@media (prefers-reduced-motion: reduce) {
  .am *, .cv * { transition: none !important; animation: none !important; }
  .am-n:hover { transform: none; }
}

/* мелкий масштаб (обзор): подписи крупнее, второстепенное прячется — блоки читаются, как на карте */
.cv[data-z="low"] .am-t b { font-size: 17px; line-height: 21px; }
.cv[data-z="low"] .am-agent .am-t b { font-size: 20px; line-height: 25px; }
.cv[data-z="low"] .am-t > span, .cv[data-z="low"] .am-meta { display: none; }
.cv[data-z="low"] .am-agent .am-t > span { display: block; font-size: 14.5px; line-height: 18px; }
.cv[data-z="low"] .am-t em, .cv[data-z="low"] .am-t em .sig, .cv[data-z="low"] .am-t em .sig > span { font-size: 14.5px; line-height: 19px; }
.cv[data-z="low"] .am-sec-h b { font-size: 15px; }
.cv[data-z="low"] .am-chip { font-size: 14px; }
.cv[data-z="low"] .am-chip svg { display: none; }
.cv[data-z="low"] .am-more, .cv[data-z="low"] .am-x, .cv[data-z="low"] .am-chip-x { display: none; }
.cv[data-z="low"] .am-sec-e, .cv[data-z="low"] .am-sec-add { font-size: 14.5px; }

/* появление при смене агента */
.am-fade { animation: am-in .3s ease both; }
@keyframes am-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* r16 (И): подпись под шапкой раздела «Документы» — «отправляет клиентам — не знания для ответов» (высота — NOTE в agents-map.js) */
.am-sec-note { box-sizing: border-box; flex: 0 0 26px; height: 26px; margin: -4px 0 4px; padding: 0 2px 0 38px; font-size: 12px; line-height: 18px; color: var(--mut2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv[data-z="low"] .am-sec-note { visibility: hidden; }
/* «ещё N документов» / «Свернуть» — строка-кнопка внизу блока «Документы» (высота — MORE_H в agents-map.js) */
.am-row-more { box-sizing: border-box; display: flex; align-items: center; justify-content: center; width: 100%; height: 30px; margin: 0; padding: 0 10px; border: 0; border-radius: 10px;
  background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--acc); cursor: pointer; }
.am-row-more:hover, .am-row-more:focus-visible { background: var(--acc-soft); outline: none; }
.cv[data-z="low"] .am-row-more { font-size: 14px; }
