/* «Настройки → Команда и доступ» — screens/settings-team.js (r13, 23.10.2026; r14 — крупнее и понятнее; r16 — одна схема и окно полномочий).
   r16 (24.10): видов «Отделы» и «Доступ», раскладок, «Лесенки», подсказки о перегрузке и панели справа больше нет — холст подчинения
   сверху вниз (классы .cv-* — в agents-map.css) и окно «Полномочия» по щелчку на сотрудника (.tmw-*).
   Язык — бледное ядро: лавандовая дымка, белое стекло, лиловые связи под прямым углом; цвет несут только лица и точки подразделений;
   красного нет (янтарь). Светлая тема берёт рецепты --pl-* из pale-app.css, тёмная — токены. Карточка человека 232×68, лицо 40 px,
   имя 14 px, должность 12.5 px; текст не мельче 12 px. */

/* ── Страница: вместо колонки 1100 px — вся область справа от меню настроек ────────────────────────────────────────── */
.st-main:has(.tm) { max-width: none; padding: 0; }
.st-main:has(.tm) .st-body, .st-main:has(.tm) .st-pg { gap: 0; }
/* r16 (26.10): ассистент и здесь справа внизу (размер — helper.css) */
.tm {
  --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-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, .9); --am-glass-brd: #e7dffa;
  --tm-band: rgba(255, 255, 255, .55); --tm-band-brd: #e9e2f9;
  --tm-bg: #f8f6ff; --tm-top: rgba(255, 255, 255, .78); --tm-line: #ebe4fb;
  position: relative; display: flex; flex-direction: column; height: calc(100vh - var(--topbar-h)); min-height: 360px; overflow: hidden; container: tm / inline-size;
  background: var(--tm-bg);
}
[data-theme="dark"] .tm {
  --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, .92); --am-glass-brd: #34445f;
  --tm-band: rgba(30, 39, 58, .45); --tm-band-brd: #2f3d58;
  --tm-bg: var(--l0); --tm-top: rgba(27, 35, 52, .8); --tm-line: #2f3d58;
}
.tm [hidden] { display: none !important; }
@media (max-width: 900px) { .tm { height: calc(100vh - var(--topbar-h) - 56px); } }

/* ── Шапка над схемой: название с подсказкой, действия ───────────────────────────────────────────────────────────── */
.tm-top { position: relative; z-index: 10; display: flex; align-items: center; gap: 16px; flex: 0 0 auto; min-height: 68px; padding: 12px 24px; background: var(--tm-top); border-bottom: 1px solid var(--tm-line);
  backdrop-filter: blur(10px) saturate(1.3); -webkit-backdrop-filter: blur(10px) saturate(1.3); }
.tm-title { display: flex; align-items: center; gap: 12px; flex: 0 1 auto; min-width: 0; }
.tm-title-i { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 12px; color: var(--acc); background: var(--pl-sel-bg, var(--acc-soft)); border: 1px solid var(--pl-sel-brd, var(--acc-soft-brd)); }
.tm-title-t { display: flex; flex-direction: column; min-width: 0; }
.tm-title h2 { margin: 0; font-size: 18px; line-height: 23px; font-weight: 700; letter-spacing: -.014em; color: var(--ink); white-space: nowrap; }
.tm-title-t > span { font-size: 13px; line-height: 17px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-acts { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.tm-acts .btn { height: 38px; padding: 0 16px; font-size: 14px; box-shadow: 0 10px 22px -16px rgba(91, 47, 191, .5); background-clip: padding-box; }
.tm-head { width: 38px; height: 38px; border-radius: 12px; background: var(--am-glass); border: 1px solid var(--am-glass-brd); }
/* «Ждут входа · N» — приглашения без записи в справочнике */
.tm-acts .tm-inv { gap: 8px; padding: 0 12px 0 14px; }
.tm-inv b { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--pl-sel-bg, var(--acc-soft)); color: var(--acc); font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; }

/* ── Окно схемы ──────────────────────────────────────────────────────────────────────────────────────────────────── */
.tm-stage { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.tm-cv { position: absolute; inset: 0; }
.tm-t { display: flex; flex-direction: column; justify-content: center; gap: 1px; min-width: 0; flex: 1 1 auto; }
.tm-t b { font-size: 14px; line-height: 18px; font-weight: 650; letter-spacing: -.005em; color: var(--ink); }
.tm-t > span { font-size: 12.5px; line-height: 16px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-av, .tm-face { display: inline-flex; flex: 0 0 auto; border-radius: 50%; }
.tm-face { border-radius: 14px; }
/* роль — кольцом вокруг лица: владелец сплошное лиловое, руководитель бледнее, наблюдатель тонкое */
.tm-av[title] .av, .tmw .tm-av .av { box-shadow: none; }
[data-role="owner"] > .tm-av, .tm-av[data-role="owner"] { box-shadow: 0 0 0 2px var(--l1), 0 0 0 4px var(--acc); }
[data-role="manager"] > .tm-av, .tm-av[data-role="manager"] { box-shadow: 0 0 0 2px var(--l1), 0 0 0 4px var(--acc-brd, #cdb9f8); }
[data-role="viewer"] > .tm-av, .tm-av[data-role="viewer"] { box-shadow: 0 0 0 2px var(--l1), 0 0 0 3.5px var(--line-3); }
.tm-bt-dot { position: relative; display: inline-block; flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--tn, var(--acc)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tn, var(--acc)) 18%, transparent); }
.tm-more { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--mut2); cursor: pointer; opacity: 0; transition: opacity .12s, background .12s, color .12s; }
.tm-more:hover { background: var(--acc-soft); color: var(--acc); }

/* ── Схема: холст ────────────────────────────────────────────────────────────────────────────────────────────────── */
.tm-cv { 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"] .tm-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%); }
.tm-lanes { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 0; }
/* связи спокойнее: тонкие и бледные, у выбранного и под курсором — ярче */
.tm .cv-line { stroke-width: 1.6; opacity: .5; }
.tm .cv-edge.is-rel .cv-line { stroke-width: 2.2; opacity: .95; }
.tm .cv-edge.is-hot .cv-line, .tm .cv-edge.is-sel .cv-line { stroke-width: 2.6; opacity: 1; }
.tm .cv-port { display: none; }

/* полоса ИИ-сотрудников: стекло под связями; шапка — карточка слева */
.tm-band { --tn: var(--ai); position: absolute; left: 0; border-radius: 24px; background: var(--tm-band); border: 1px solid var(--tm-band-brd); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6); }
.tm-bt { position: absolute; left: 14px; top: 14px; width: 218px; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 12px 14px 12px; border: 1px solid var(--am-glass-brd); border-radius: 18px; background: var(--am-glass); box-shadow: var(--am-n-sh); color: var(--ink); }
.tm-bt-h { display: flex; align-items: center; gap: 9px; max-width: 100%; }
.tm-bt b { font-size: 15.5px; line-height: 20px; font-weight: 700; letter-spacing: -.01em; }
.tm-bt-s { max-width: 100%; padding-left: 18px; white-space: normal; font-size: 12.5px; line-height: 16px; color: var(--mut); }
/* r16 (Н): полоса «Новые · без места в схеме» — пунктир; пустая — тонкая, с одной строкой подсказки; при перетаскивании — подсвечена */
.tm-band-new { background: transparent; border: 1.5px dashed var(--am-dash, var(--line-3)); box-shadow: none; transition: border-color .15s, background .15s; }
.tm-band-new .tm-bt-h { color: var(--mut); }
.tm-band-new .tm-bt-h .ic { color: var(--acc); }
.tm-band-new .tm-bt-h em { font-style: normal; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--acc-soft); color: var(--acc); font-size: 12px; font-weight: 650; line-height: 20px; text-align: center; }
.tm-band-new .tm-bt-s { padding-left: 23px; }
.tm-band-new.is-empty { border-width: 1px; }
.tm-band-new.is-empty .tm-bt { top: 50%; transform: translateY(-50%); padding: 8px 14px; box-shadow: none; background: transparent; border-color: transparent; }
.tm-new-hint { position: absolute; left: 256px; right: 20px; top: 50%; transform: translateY(-50%); font-size: 13px; line-height: 17px; color: var(--mut2); }
.tm.is-dragp .tm-band-new { border-color: var(--acc-brd, #cdb9f8); }
.tm-band-new.is-over { border-color: var(--acc); border-style: solid; background: var(--pl-sel-bg, var(--acc-soft)); }
.cv[data-z="low"] .tm-new-hint { font-size: 15px; line-height: 19px; }
/* только что добавленный или поставленный — короткая подсветка */
.tm-n.is-fresh { animation: tm-fresh 1.8s ease both; }
@keyframes tm-fresh { 0%, 35% { border-color: var(--acc); box-shadow: 0 0 0 6px var(--acc-soft), var(--am-n-hover); } 100% { box-shadow: var(--am-n-sh); } }

/* карточки людей и ИИ-сотрудников 232×68: отдел — третьей строкой с точкой подразделения */
.tm-n { position: absolute; display: flex; align-items: center; gap: 12px; padding: 0 14px; border-radius: 18px; 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; }
.tm-n:hover { border-color: var(--acc-brd); box-shadow: var(--am-n-hover); transform: translateY(-1px); }
.tm-n:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.tm-n.is-sel { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft), var(--am-n-hover); }
.tm-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 .tm-n { transition: none; transform: none; }
.tm-n.is-target { border-color: var(--acc); box-shadow: 0 0 0 4px var(--acc-soft), 0 12px 26px -14px rgba(91, 47, 191, .6); }
.tm-n.is-bad { border-color: var(--zav-brd, #f5deb0); box-shadow: 0 0 0 3px var(--zav-soft, #fff6e6); opacity: .6; }
.tm-a { background: var(--am-ag-bg); border-color: var(--pl-sel-brd, var(--acc-soft-brd)); }
.tm-n.is-off { opacity: .6; }
.tm-n .tm-more { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; }
.tm-n:hover .tm-more, .tm-n.is-sel .tm-more, .tm-n .tm-more:focus-visible { opacity: 1; }
.tm-p .tm-t { padding-right: 4px; }
.tm-dn { display: block; font-size: 12px; line-height: 16px; color: var(--mut2); }
.tm-t > .tm-dn { font-size: 12px; color: var(--mut2); }
.tm-dn::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--tn, var(--acc)); vertical-align: 1px; }
.tm-dn[data-tone="ai"] { --tn: var(--ai); } .tm-dn[data-tone="vyg"] { --tn: var(--vyg); } .tm-dn[data-tone="ryn"] { --tn: var(--ryn); } .tm-dn[data-tone="nei"] { --tn: var(--nei); }
/* «свернуть / показать ветку» у руководителя */
.tm-fold { position: absolute; z-index: 4; left: 50%; bottom: -13px; transform: translateX(-50%); display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 26px; height: 24px; padding: 0 7px; border-radius: 999px;
  border: 1px solid var(--am-glass-brd); background: var(--l1); color: var(--mut); font: inherit; cursor: pointer; box-shadow: 0 6px 12px -8px rgba(91, 47, 191, .5); transition: color .12s, border-color .12s, background .12s; }
.tm-fold:hover, .tm-fold:focus-visible { color: var(--acc); border-color: var(--acc-brd, #cdb9f8); }
.tm-fold.is-on { color: var(--acc); border-color: var(--pl-sel-brd, var(--acc-soft-brd)); background: var(--pl-sel-bg, var(--acc-soft)); }
.tm-fold b { font-size: 12px; line-height: 14px; font-weight: 650; color: var(--acc); font-variant-numeric: tabular-nums; }
.tm-n.is-folded { box-shadow: 0 6px 0 -3px var(--l1), 0 7px 0 -3px var(--am-n-brd), var(--am-n-sh); }

/* плавное «свернуть ветку»: карточки переезжают, связи пропадают на время и проявляются после */
.tm-cv .cv-svg, .tm-cv .cv-ctl { transition: opacity .34s ease .08s; }
.tm-cv.is-morph .cv-svg, .tm-cv.is-morph .cv-ctl { opacity: 0; transition: none; }
.tm-cv.is-morph .tm-n { transition: left .5s cubic-bezier(.32, .72, .24, 1), top .5s cubic-bezier(.32, .72, .24, 1), border-color .15s, box-shadow .18s, opacity .3s; }
.tm-cv.is-morph .tm-n.is-new { animation: tm-appear .46s ease both; }
@keyframes tm-appear { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

/* ── Поверх холста: зона «без руководителя» (у левого края — по центру сверху лежит владелец), масштаб ───────────── */
.tm-zone, .tm-zoom { position: absolute; z-index: 8; }
.tm-zone { left: 24px; top: 18px; display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 20px; border-radius: 999px; border: 1.5px dashed var(--am-dash); background: var(--am-glass); color: var(--mut); font-size: 14px; font-weight: 560;
  opacity: 0; pointer-events: none; transform: translate(0, -8px) scale(.96); transform-origin: left top; transition: opacity .15s, transform .15s, border-color .15s, color .15s, background .15s; }
.tm.is-dragp .tm-zone { opacity: 1; transform: none; }
.tm-zone.is-over { border-color: var(--acc); border-style: solid; color: var(--acc); background: var(--pl-sel-bg, var(--acc-soft)); }
.tm-zoom { left: 16px; bottom: 16px; display: flex; align-items: center; gap: 2px; padding: 5px; 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 -24px rgba(91, 47, 191, .55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); cursor: default; }
.tm-zb, .tm-zt, .tm-zp { display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0; border: 0; border-radius: 12px; background: none; color: var(--mut); font: inherit; cursor: pointer; transition: background .12s, color .12s; }
.tm-zb { width: 36px; }
.tm-zp { min-width: 58px; color: var(--ink); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tm-zt { gap: 7px; padding: 0 12px; color: var(--ink); font-size: 14px; font-weight: 560; white-space: nowrap; }
.tm-zb:hover:not(:disabled), .tm-zt:hover, .tm-zp:hover { background: var(--acc-soft); color: var(--acc); }
.tm-zb:disabled { opacity: .35; cursor: default; }
.tm-zmini[aria-pressed="true"] { color: var(--acc); background: var(--pl-sel-bg, var(--acc-soft)); }
.tm-zs { width: 1px; height: 22px; margin: 0 4px; background: var(--am-glass-brd); }
.tm-redo svg { transform: scaleX(-1); }
.tm-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); }
.tm-help b { color: var(--ink); font-weight: 620; }

/* мини-карта: вся схема уменьшенно и рамка «где я»; щелчок или перетаскивание двигает вид */
.tm-mini { position: absolute; z-index: 8; right: 16px; bottom: 16px; overflow: hidden; border-radius: 16px; background: var(--am-glass); border: 1px solid var(--am-glass-brd); cursor: pointer; touch-action: none;
  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); }
.tm-mini.is-drag { cursor: grabbing; }
.tm-mini i { position: absolute; display: block; pointer-events: none; }
.tm-mnb { --tn: var(--ai); border-radius: 3px; background: color-mix(in srgb, var(--tn) 9%, transparent); border: 1px solid color-mix(in srgb, var(--tn) 24%, transparent); }
.tm-mnn { border-radius: 2px; background: color-mix(in srgb, var(--acc) 38%, var(--l1)); }
.tm-mnn.is-a { background: color-mix(in srgb, var(--ai, var(--acc)) 55%, var(--l1)); }
.tm-mnn.is-sel { background: var(--acc); }
.tm-mnv { border: 1.5px solid var(--acc); border-radius: 4px; background: color-mix(in srgb, var(--acc) 9%, transparent); }

/* ── Узкая область: меню настроек съедает ширину — подписи кнопок уходят в значки ─────────────────────────────────── */
@container tm (max-width: 1100px) {
  .tm-zt-x span { display: none; }
  .tm-zt-x { width: 36px; padding: 0; }
}
@container tm (max-width: 1000px) {
  .tm-title-i { display: none; }
  .tm-top { gap: 12px; padding: 10px 16px; }
}
@container tm (max-width: 760px) {
  .tm-acts .btn:not(.btn-main):not(.tm-inv) > span, .tm-acts .btn:not(.btn-main):not(.tm-inv) > svg:last-child:not(:first-child) { display: none; }
  .tm-acts .btn:not(.btn-main):not(.tm-inv) { width: 38px; padding: 0; justify-content: center; }
  .tm-top { gap: 10px; min-height: 56px; padding: 9px 12px; }
  .tm-title-t > span { display: none; }
  .tm-inv > span { display: none; }
  .tm-zt span { display: none; }
  .tm-zt { width: 36px; padding: 0; }
}
@container tm (max-width: 560px) { .tm-title { display: none; } }
@media (prefers-reduced-motion: reduce) { .tm *, .tm-cv * { transition: none !important; animation: none !important; } .tm-n:hover { transform: none; } }

/* мелкий масштаб (ручное уменьшение схемы): подписи крупнее, второстепенное прячется — карточки читаются, как на карте */
.cv[data-z="low"] .tm-t b { font-size: 17px; line-height: 21px; }
.cv[data-z="low"] .tm-t > span { font-size: 14px; line-height: 18px; }
.cv[data-z="low"] .tm-bt b { font-size: 17px; line-height: 21px; }
.cv[data-z="low"] .tm-bt-s { font-size: 14px; line-height: 18px; }
.cv[data-z="low"] .tm-more { width: 34px; height: 34px; top: 4px; right: 4px; }
.cv[data-z="low"] .tm-dn { font-size: 13.5px; line-height: 17px; }

/* ══ r16 · окно «Полномочия» (.tmw): слева — кто он, роль, переписки, что ещё может; справа — разделы и ИИ-агенты ═══════
   Всё в одном окне 960 px: на 1280×680 видно без панели поверх схемы; правки — черновиком до «Сохранить». */
.tmw { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 0 28px; align-items: start; }
.tmw-l, .tmw-r { display: flex; flex-direction: column; min-width: 0; }
.tmw-r { padding-left: 28px; border-left: 1px solid var(--line); align-self: stretch; }
.tmw-sec { display: flex; flex-direction: column; gap: 10px; padding: 16px 0 6px; border-top: 1px solid var(--line); }
.tmw-l > .tmw-sec:first-child, .tmw-r > .tmw-sec:first-child, .tmw-r > .tmw-ro > .tmw-sec:first-child { border-top: 0; padding-top: 2px; }
.tmw-sec h3 { margin: 0; font-size: 12px; line-height: 16px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--mut2); }
.tmw-sec [data-in] { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tmw .hint { margin: 0; font-size: 13px; line-height: 18px; color: var(--mut2); }
.tmw .hint svg { vertical-align: -2px; }
.tmw .seg { align-self: stretch; display: flex; flex-wrap: nowrap; }
.tmw .seg button { flex: 1 1 auto; justify-content: center; padding-left: 8px; padding-right: 8px; font-size: 13.5px; white-space: nowrap; }
.tmw-who { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 14px; }
.tmw-who .field { gap: 6px; min-width: 0; }
.tmw-who .field-l { font-size: 12.5px; }
.tmw-who .sel { min-width: 0; }
.tmw-none { display: flex; align-items: center; min-height: 40px; font-size: 14px; color: var(--mut); }
/* одна строка: права как у роли или чем отличаются, с «Как у роли» */
.tmw-own { display: flex; align-items: center; gap: 10px; min-height: 36px; margin: 2px 0 6px; padding: 7px 12px; border-radius: 12px; background: var(--pl-sel-bg, var(--acc-soft)); border: 1px solid var(--pl-sel-brd, var(--acc-soft-brd)); }
.tmw-own:empty { display: none; }
.tmw-own-t { display: inline-flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; font-size: 13px; line-height: 18px; color: var(--acc); font-weight: 560; }
.tmw-own-t.is-ok { color: var(--mut); font-weight: 500; }
.tmw-own .link { flex: 0 0 auto; font-size: 13px; }
/* разделы программы: две колонки строк «значок · раздел · переключатель» */
.tmw-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; }
.tmw-tab { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 4px 10px 4px 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--l1); cursor: pointer; transition: border-color .12s, background .12s; }
.tmw-tab:hover { border-color: var(--acc-brd, #cdb9f8); }
.tmw-tab.is-on { border-color: var(--pl-sel-brd, var(--acc-soft-brd)); background: color-mix(in srgb, var(--acc) 5%, var(--l1)); }
.tmw-tab-i { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 28px; height: 28px; border-radius: 9px; color: var(--mut); }
.tmw-tab.is-on .tmw-tab-i { color: var(--acc); }
.tmw-tab-l { flex: 1 1 auto; min-width: 0; font-size: 14px; line-height: 18px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tmw-tab:not(.is-on) .tmw-tab-l { color: var(--mut); }
.tmw-tab .toggle { flex: 0 0 auto; }
/* ИИ-агенты и люди: лицо · имя · «нет · видит · настраивает» */
.tmw-ag { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; column-gap: 12px; min-height: 52px; padding: 5px 0; border-top: 1px solid var(--line); color: var(--ink); }
.tmw-ag:first-child { border-top: 0; }
.tmw-lv { flex: 0 0 auto; }
.tmw .tmw-lv, .tmw-one .tmw-lv { align-self: auto; display: inline-flex; }
.tmw-lv button { height: 32px; padding: 0 10px; font-size: 13px; }
.tmw-fix { font-size: 13px; color: var(--mut2); padding-right: 6px; }
.tmw-acts .check { padding: 4px 0; }
/* «Всё открыто» у владельца */
.tmw-all { display: flex; align-items: flex-start; gap: 14px; margin-top: 4px; padding: 18px; border-radius: 16px; background: var(--pl-sel-bg, var(--acc-soft)); border: 1px solid var(--pl-sel-brd, var(--acc-soft-brd)); color: var(--acc); }
.tmw-all span { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; line-height: 19px; color: var(--mut); }
.tmw-all b { font-size: 15px; color: var(--ink); }
.tmw-ro { display: contents; margin: 0; padding: 0; border: 0; min-width: 0; }
.tmw-ro .tmw-tab, .tmw-ro .seg, .tmw-ro .check { opacity: .62; cursor: default; }
/* подвал окна: «Что решает», вход в программу */
.tmw-fl { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px; min-width: 0; }
.tmw-fl .link { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; }
.tm-del { color: var(--mut); }
/* окна «Кто видит агента» и «Подразделение» */
.tmw-one { display: flex; flex-direction: column; gap: 14px; }
.tmw-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; padding: 2px 12px; }
.tmw-go { width: 100%; border: 0; border-top: 1px solid var(--line); background: none; font: inherit; text-align: left; cursor: pointer; text-decoration: none; color: var(--ink); }
.tmw-go:first-child { border-top: 0; }
.tmw-go > svg { color: var(--mut2); }
.tmw-go:hover > svg { color: var(--acc); }
@media (max-width: 860px) {
  .tmw { grid-template-columns: minmax(0, 1fr); }
  .tmw-r { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
}
@media (max-width: 520px) { .tmw-who, .tmw-tabs { grid-template-columns: minmax(0, 1fr); } }

/* ── r16 (О, 26.10): «Как войдёт в команду» — ссылка и код; отметка «ждёт входа» на карточке ── */
.tm-av { position: relative; }
.tm-pend { position: absolute; right: -3px; bottom: -3px; width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center;
  background: var(--l1); color: var(--sig-wait, var(--ryn)); box-shadow: 0 0 0 1px var(--ryn-brd, var(--line)); font-style: normal; }
/* ── r16 (Р, 26.10): «Добавить в команду» — одно окно в языке окна оплаты «Токенов»: слева тёмная сцена с «пропуском в команду»
   (собирается по вводу), справа поля и роль; итог — в том же окне: пропуск «в команде», личная ссылка для входа, «Как войдёт».
   Пароль владелец не видит — его задаёт сотрудник по ссылке (экран входа — css/screens/team-join.css) ── */
.tmj-sheet .sb { padding: 18px 20px; }
.tmj { display: grid; grid-template-columns: 336px minmax(0, 1fr); gap: 20px; align-items: stretch; }
.tmj-stage { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; gap: 14px; padding: 18px 16px 16px; border-radius: 18px;
  color: #f6f3ff; border: 1px solid rgba(167, 139, 250, .32);
  background: radial-gradient(60% 70% at 0% 0%, rgba(124, 77, 255, .45), transparent 62%), radial-gradient(60% 70% at 100% 100%, rgba(94, 234, 212, .16), transparent 62%), linear-gradient(165deg, #1e1244 0%, #150c33 55%, #0f0a26 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07); }
.tmj-stage::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(55% 50% at 50% 35%, rgba(167, 139, 250, .22), transparent 75%);
  -webkit-mask-image: radial-gradient(80% 70% at 50% 35%, #000, transparent 78%); mask-image: radial-gradient(80% 70% at 50% 35%, #000, transparent 78%); }
.tmj-stage-k { font-size: 10.5px; line-height: 13px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: rgba(196, 181, 253, .82); }

/* пропуск — объёмная карточка, чуть повёрнута; при наведении выравнивается */
.tmj-pass { --rc: #5eead4; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; height: 184px; padding: 14px 16px; border-radius: 16px;
  background: radial-gradient(90% 80% at 100% 0%, rgba(240, 171, 252, .28), transparent 60%), radial-gradient(80% 90% at 0% 100%, rgba(94, 234, 212, .2), transparent 60%), linear-gradient(140deg, #6a3ce0 0%, #4a2bb0 48%, #2a1d72 100%);
  box-shadow: 0 22px 40px -18px rgba(14, 6, 44, .85), inset 0 0 0 1px rgba(255, 255, 255, .16), inset 0 1px 0 rgba(255, 255, 255, .22);
  transform: perspective(900px) rotateX(5deg) rotateY(-7deg); transition: transform .45s cubic-bezier(.2, .8, .2, 1), box-shadow .6s; }
.tmj-pass:hover { transform: none; }
.tmj-pass-gl { position: absolute; top: 0; bottom: 0; left: -60%; width: 45%; transform: skewX(-20deg); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), transparent); pointer-events: none; animation: tmj-sheen 3.6s ease 0.4s 1 both; }
@keyframes tmj-sheen { from { left: -60%; } to { left: 130%; } }
.tmj-pass-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.tmj-co { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, .86); }
.tmj-co i { flex: 0 0 auto; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; font-style: normal; font-size: 10px; font-weight: 750; letter-spacing: .02em;
  background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }
.tmj-pass-st { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: rgba(255, 255, 255, .82); background: rgba(255, 255, 255, .12); }
.tmj-pass-mid { display: flex; align-items: center; gap: 13px; min-width: 0; }
.tmj-ava { flex: 0 0 auto; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: rgba(255, 255, 255, .12);
  box-shadow: 0 0 0 2px var(--rc), 0 0 22px -2px var(--rc); transition: box-shadow .35s; }
.tmj-ava b { font-size: 21px; font-weight: 700; letter-spacing: .02em; color: #fff; }
.tmj-ava[data-role="owner"] { --rc: #f0abfc; } .tmj-ava[data-role="manager"] { --rc: #c4b5fd; } .tmj-ava[data-role="viewer"] { --rc: rgba(255, 255, 255, .55); }
.tmj-pass.is-blank .tmj-ava { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .4); background: transparent; border: 1.5px dashed rgba(255, 255, 255, .35); }
.tmj-pass.is-blank .tmj-ava b { color: rgba(255, 255, 255, .55); }
.tmj-who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tmj-who b { font-size: 17px; line-height: 21px; font-weight: 650; color: #fff; letter-spacing: -.01em; }
.tmj-pass.is-blank .tmj-who b { color: rgba(255, 255, 255, .55); font-weight: 550; }
.tmj-who em { font-style: normal; font-size: 12.5px; color: rgba(229, 222, 255, .74); }
.tmj-pass-bot { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.tmj-role { flex: 0 0 auto; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650; color: #0f2e2a; background: #5eead4; }
.tmj-mail { min-width: 0; font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 11.5px; color: rgba(229, 222, 255, .78); }
.tmj-pass.is-done { transform: none; box-shadow: 0 22px 40px -18px rgba(14, 6, 44, .85), 0 0 0 2px rgba(94, 234, 212, .85), 0 0 42px rgba(94, 234, 212, .4); }
.tmj-pass.is-done .tmj-pass-st { color: #0f2e2a; background: #5eead4; }

/* что будет видеть — три стеклянные ячейки */
.tmj-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tmj-f { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 9px 10px; border-radius: 12px; background: linear-gradient(160deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .025)); border: 1px solid rgba(255, 255, 255, .11); }
.tmj-f span { font-size: 9.5px; line-height: 12px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: rgba(196, 181, 253, .78); }
.tmj-f b { font-size: 14.5px; line-height: 18px; font-weight: 650; color: #fff; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tmj-f b i { font-style: normal; font-weight: 500; font-size: 12px; color: rgba(229, 222, 255, .6); }
.tmj-f em { font-style: normal; font-size: 11px; color: rgba(229, 222, 255, .6); }

/* «Как войдёт» — три шага с нитью */
.tmj-steps { position: relative; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tmj-steps::before { content: ''; position: absolute; left: 11px; top: 14px; bottom: 14px; width: 1.5px; background: linear-gradient(var(--acc-soft-brd), var(--acc-soft-brd)); }
.tmj-steps li { position: relative; display: flex; gap: 11px; align-items: flex-start; }
.tmj-steps li > span:last-child { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tmj-steps b { font-size: 13.5px; color: var(--ink); }
.tmj-steps em { font-style: normal; font-size: 12px; line-height: 16px; color: var(--mut); }
.tmj-sn { position: relative; flex: 0 0 auto; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 11.5px; font-weight: 700; color: var(--acc); background: var(--l1); box-shadow: 0 0 0 1.5px var(--acc-soft-brd); }
.tmj-stage .tmj-steps::before { background: linear-gradient(rgba(167, 139, 250, .6), rgba(94, 234, 212, .6)); }
.tmj-stage .tmj-steps b { color: #fff; }
.tmj-stage .tmj-steps em { color: rgba(229, 222, 255, .7); }
.tmj-stage .tmj-sn { color: #fff; background: #241a5c; box-shadow: 0 0 0 1.5px rgba(167, 139, 250, .7), 0 0 12px rgba(124, 77, 255, .5); }
.tmj-stage .tmj-steps li:last-child .tmj-sn { box-shadow: 0 0 0 1.5px rgba(94, 234, 212, .85), 0 0 12px rgba(94, 234, 212, .45); }

/* справа: поля, роль, доступ */
.tmj-side { min-width: 0; display: flex; flex-direction: column; }
.tmj-form { display: flex; flex-direction: column; gap: 12px; }
.tmj-form .frow { gap: 14px; }
.tmj-roles .hint { margin: 6px 0 0; }
.tmj-acc { border: 1px solid var(--line); border-radius: 14px; background: var(--l2); overflow: hidden; }
.tmj-acc-t { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; border: 0; background: none; cursor: pointer; text-align: left; color: var(--acc); }
.tmj-acc-t > span:nth-child(2) { display: flex; flex-direction: column; gap: 1px; flex: 1 1 auto; min-width: 0; }
.tmj-acc-t b { font-size: 13.5px; color: var(--ink); }
.tmj-acc-t em { font-style: normal; font-size: 12px; color: var(--mut); }
.tmj-acc-m { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; }
.tmj-acc.is-open .tmj-acc-m svg { transform: rotate(180deg); }
.tmj-acc-b { display: flex; flex-direction: column; gap: 10px; padding: 2px 14px 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.tmj-acc-r { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 10px; align-items: start; }
.tmj-acc-r > em { font-style: normal; font-size: 12.5px; color: var(--mut); padding-top: 5px; }
.tmj-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tmj-chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--l1); color: var(--mut); font-size: 12.5px; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.tmj-chip[aria-pressed="true"] { background: var(--acc-soft); border-color: var(--acc-soft-brd); color: var(--acc); }
.tmj-ags .tmw-ag { padding: 3px 0; }
.tmj-acc-b .hint { display: flex; align-items: center; gap: 6px; margin: 0; }
.tmj-fn { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--mut); }

/* итог: личная ссылка, почему безопасно, демо */
.tmj-done { display: flex; flex-direction: column; gap: 14px; }
.tmj-link { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--acc-soft-brd); background: var(--acc-soft); }
.tmj-link-h { display: flex; align-items: center; gap: 8px; color: var(--acc); }
.tmj-link-h b { font-size: 14.5px; color: var(--ink); }
.tmj-link-h span { margin-left: auto; font-size: 12px; color: var(--mut); }
.tmj-url { display: flex; align-items: center; gap: 8px; }
.tmj-url-v { flex: 1 1 auto; min-width: 0; padding: 9px 12px; border-radius: 10px; background: var(--l1); border: 1px solid var(--line-2);
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 13px; color: var(--ink); }
.tmj-send { display: flex; flex-wrap: wrap; gap: 8px; }
.tmj-send .btn[disabled] { opacity: .75; }
.tmj-why { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; line-height: 17px; color: var(--mut); }
.tmj-why svg { flex: 0 0 auto; margin-top: 1px; color: var(--acc); }
.tmj-demo { display: flex; gap: 6px; align-items: flex-start; margin: 0; font-size: 12px; line-height: 16px; color: var(--mut2); }
.tmj-demo svg { flex: 0 0 auto; margin-top: 1px; }
.tmj-js [data-in="jl"] { display: flex; flex-direction: column; gap: 16px; }
.tmj-js .tmj-demo { margin-top: 12px; }
.tmj-sheet .sf .link { display: inline-flex; align-items: center; gap: 6px; }
.tmj-emp { color: var(--acc); }
@media (max-width: 1100px) { .tmj { grid-template-columns: minmax(0, 1fr); } .tmj-stage { flex-direction: row; flex-wrap: wrap; align-items: center; } .tmj-pass { flex: 1 1 280px; } .tmj-facts, .tmj-stage .tmj-steps { flex: 1 1 260px; } }
@media (max-height: 760px) { .tmj-pass { height: 166px; } .tmj-stage { gap: 12px; padding: 14px 14px 14px; } .tmj-form { gap: 10px; } }
@media (prefers-reduced-motion: reduce) { .tmj-pass, .tmj-pass-gl, .tmj-ava { transition: none !important; animation: none !important; } .tmj-pass-gl { display: none; } }

/* блок «Аккаунт» в полномочиях */
.tmw-acc { display: flex; flex-direction: column; gap: 6px; }
.tmw-acc-r { display: flex; align-items: center; gap: 10px; min-height: 34px; font-size: 13.5px; }
.tmw-acc-r em { font-style: normal; flex: 0 0 96px; color: var(--mut); }
.tmw-acc-r > span { flex: 1 1 auto; min-width: 0; color: var(--ink); }
.tmw-acc-r .btn { flex: 0 0 auto; }
