/* ============================================================
   Call Analyzer — дизайн-система нового интерфейса (v2)

   Грузится ТОЛЬКО каркасом v2 (templates/v2/base.html). style.css v2 не подключает:
   он заморожен и живёт ради «А360 Продаж». Поэтому здесь же — правила для всех классов,
   которые выдаёт ui.js (тосты, окна, панель, меню, подсказка, «занято», плашка «вход от
   имени», плеер записи и его закреплённая полоса).

   Принципы: светлая тема по умолчанию; один вид кнопки, карточки, таблицы и поля; цвет
   текстом — только токены *-ink и --text*; контраст считает тест
   (tests/test_ui_v2_static.py) прямо из значений токенов ниже — подбирать на глаз нельзя.
   Шкала балла (--score-*) — те же hex, что у pdf_report._tier_hex.

   Разделы: 1 токены · 2 база · 3 каркас · 4 страница · 5 компоненты · 6 таблицы ·
   7 ui.js · 8 плеер · 9 адаптив · 10 доступность и печать.
   ============================================================ */

/* ---------- 1. Токены ---------- */
:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef0f3;
  --border: #e2e5ea;
  --border-strong: #cfd4db;
  --border-field: #8a929e;
  --text: #16191d;
  --text-2: #47505c;
  --text-3: #5f6875;
  --accent: #2557d6;
  --accent-hover: #1e47b3;
  --accent-soft: #eaf0fd;
  --on-accent: #ffffff;
  --success: #1f9d55;
  --success-ink: #137a3f;
  --success-soft: #e6f5ec;
  --warning: #d98c00;
  --warning-ink: #8a5800;
  --warning-soft: #fdf3e0;
  --danger: #d92d20;
  --danger-ink: #b42318;
  --danger-soft: #fdecea;
  --overlay: rgba(16, 22, 32, 0.42);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 4px 14px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 18px 44px rgba(16, 24, 40, 0.18);

  /* Шкала балла — тема-независимая, совпадает с pdf_report._tier_hex. */
  --score-critical: #e5484d;
  --score-low:      #ef7016;
  --score-mid:      #d99413;
  --score-good:     #2fa56a;
  --score-great:    #159a55;
  --score-na:       #9aa3b2;
  /* Тёмные чернила поверх сплошной заливки яруса (белый там не проходит AA). */
  --on-solid: #0c0f14;
  /* Ярус ТЕКСТОМ — смесь с основным текстом (сам ярус на белом даёт 2.2–3.9:1). */
  --tier-great-ink:    color-mix(in srgb, var(--score-great) 55%, var(--text));
  --tier-good-ink:     color-mix(in srgb, var(--score-good) 55%, var(--text));
  --tier-mid-ink:      color-mix(in srgb, var(--score-mid) 55%, var(--text));
  --tier-low-ink:      color-mix(in srgb, var(--score-low) 55%, var(--text));
  --tier-critical-ink: color-mix(in srgb, var(--score-critical) 55%, var(--text));
  --tier-na-ink:       var(--text-3);

  /* Стороны разговора на карте записи и в расшифровке. */
  --side-a: #2557d6;
  --side-b: #c2410c;

  /* Цвета графиков (static/v2/charts.js читает их при каждой отрисовке). */
  --chart-axis: #5f6875;
  --chart-grid: #e2e5ea;
  --chart-1: #2557d6;
  --chart-2: #159a55;
  --chart-3: #d99413;
  --chart-4: #c2410c;
  --chart-5: #7c3aed;
  --chart-6: #0891b2;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-16: 16px;
  --fs-20: 20px;
  --fs-24: 24px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-pill: 999px;
  --motion: 160ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  --sidebar-w: 240px;
  --sidebar-w-rail: 68px;
  --topbar-h: 56px;
  --content-w: 1280px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1216;
  --surface: #171b21;
  --surface-2: #1c2128;
  --surface-3: #232932;
  --border: #2a313b;
  --border-strong: #38404c;
  --border-field: #6b7584;
  --text: #e9ecf1;
  --text-2: #b8c0cc;
  --text-3: #959eab;
  --accent: #6f9cff;
  --accent-hover: #93b4ff;
  --accent-soft: #1d2a45;
  --on-accent: #0b1220;
  --success: #3fbf74;
  --success-ink: #5fd08e;
  --success-soft: #16301f;
  --warning: #f0a92e;
  --warning-ink: #f5bd5c;
  --warning-soft: #33280f;
  --danger: #f0645a;
  --danger-ink: #ff8a80;
  --danger-soft: #3a1b1a;
  --overlay: rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.6);
  --tier-great-ink:    color-mix(in srgb, var(--score-great) 80%, var(--text));
  --tier-good-ink:     color-mix(in srgb, var(--score-good) 80%, var(--text));
  --tier-mid-ink:      color-mix(in srgb, var(--score-mid) 80%, var(--text));
  --tier-low-ink:      color-mix(in srgb, var(--score-low) 80%, var(--text));
  --tier-critical-ink: color-mix(in srgb, var(--score-critical) 80%, var(--text));
  --side-a: #6f9cff;
  --side-b: #fb923c;
  --chart-axis: #959eab;
  --chart-grid: #2a313b;
  --chart-1: #6f9cff;
  --chart-2: #3fbf74;
  --chart-3: #f0a92e;
  --chart-4: #fb923c;
  --chart-5: #a78bfa;
  --chart-6: #22d3ee;
}

/* ---------- 2. База ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-14);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { text-wrap: balance; font-weight: 600; }
p { text-wrap: pretty; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.workspace main:focus { outline: none; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.icon { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: -3px; }
.icon--sm { width: 12px; height: 12px; vertical-align: -2px; }
.icon--lg { width: 20px; height: 20px; }

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 5000;
  padding: 8px 14px; border-radius: var(--r-md);
  background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-md);
}
.skip-link:focus-visible { top: 8px; }

/* ---------- 3. Каркас: меню слева, шапка, рабочая область ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0;
  flex: none;
  width: var(--sidebar-w);
  height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 12px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 14px;
  color: var(--text); font-weight: 600; font-size: var(--fs-16);
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; flex: none; }
.brand-mark-image { width: 100%; height: 100%; }
.brand-mark-image--dark { display: none; }
html[data-theme="dark"] .brand-mark-image--light { display: none; }
html[data-theme="dark"] .brand-mark-image--dark { display: block; }
.brand-name { white-space: nowrap; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  min-height: 40px; padding: 8px 12px;
  border-radius: var(--r-md);
  color: var(--text-2); font-weight: 500;
  transition: background var(--motion) var(--ease), color var(--motion) var(--ease);
}
.side-link .icon { width: 18px; height: 18px; }
.side-link:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.side-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-label { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-badge {
  flex: none;
  margin-left: auto; padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent);
  font-size: 11px; font-weight: 600; line-height: 18px;
}
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.side-foot .side-link { gap: 10px; padding-right: 8px; }
.sidebar-overlay { display: none; }

.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .nav-burger { display: none; }
.top-search {
  position: relative;
  flex: 1 1 auto; max-width: 520px;
}
/* Поиск закрыт правом (раздел «Звонки» руководителю, access.py) — место держит распорка. */
.top-search-gap { flex: 1 1 auto; }
.top-search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none;
}
.top-search-input {
  width: 100%; height: 38px;
  padding: 0 12px 0 38px;
  background: var(--surface-3);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  color: var(--text);
  transition: border-color var(--motion) var(--ease), background var(--motion) var(--ease);
}
.top-search-input::placeholder { color: var(--text-3); }
.top-search-input:hover { border-color: var(--border-strong); }
.top-search-input:focus { background: var(--surface); border-color: var(--border-field); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.account-btn {
  display: flex; align-items: center; gap: 10px;
  min-height: 40px; padding: 4px 8px 4px 4px;
  background: transparent; border: 1px solid transparent;
  border-radius: var(--r-pill);
  text-align: left;
}
.account-btn:hover { background: var(--surface-3); }
.account-avatar {
  width: 32px; height: 32px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: var(--fs-13); font-weight: 600;
}
.account-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.account-name { font-weight: 600; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-role { font-size: var(--fs-12); color: var(--text-3); }
.account-caret { color: var(--text-3); }

/* ---------- 4. Страница ---------- */
.main {
  width: 100%; max-width: var(--content-w);
  margin: 0 auto;
  padding: 24px 24px 48px;
  display: flex; flex-direction: column; gap: 16px;
}
.main-narrow { max-width: 760px; }
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 4px;
}
.page-head-text { min-width: 0; }
.page-title { font-size: var(--fs-24); line-height: 1.25; letter-spacing: -0.01em; }
.page-lead { margin-top: 4px; max-width: 75ch; color: var(--text-2); }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row-wrap + .row-wrap { margin-top: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ---------- 5. Компоненты ---------- */

/* Карточка */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.card-head { margin-bottom: 14px; }
.card-head:last-child { margin-bottom: 0; }
.card-title { font-size: var(--fs-16); line-height: 1.35; }
.card-hint { margin-top: 2px; color: var(--text-3); font-size: var(--fs-13); max-width: 75ch; }
.card > :last-child { margin-bottom: 0; }

/* Кнопки — один вид, три веса: главная (сплошная), обычная, тихая; плюс опасная. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 36px; padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-weight: 600; font-size: var(--fs-14); line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  transition: background var(--motion) var(--ease), border-color var(--motion) var(--ease),
              color var(--motion) var(--ease), box-shadow var(--motion) var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-3); color: var(--text); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent); }
.btn-danger { background: var(--danger); color: #ffffff; }
.btn-danger:hover { background: var(--danger-ink); color: #ffffff; }
html[data-theme="dark"] .btn-danger { color: var(--on-solid); }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: var(--fs-13); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
/* Занятая кнопка: подпись («Сохраняем…») остаётся читаемой — прозрачность не роняем. */
.btn[aria-busy="true"] { opacity: 1; cursor: progress; }
.btn[aria-busy="true"]::before {
  content: ""; width: 14px; height: 14px; flex: none;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%;
  animation: v2-spin 0.8s linear infinite;
}

.icon-btn {
  position: relative;
  width: 36px; height: 36px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  background: transparent; color: var(--text-2);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  transition: background var(--motion) var(--ease), color var(--motion) var(--ease);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.link {
  padding: 0; background: none; border: 0;
  color: var(--accent); font-weight: 500;
}
.link:hover { text-decoration: underline; }
.link-danger { color: var(--danger-ink); }

/* Поля */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field-label { font-size: var(--fs-13); font-weight: 600; color: var(--text-2); }
.field-hint { font-size: var(--fs-12); color: var(--text-3); }
.field-error { font-size: var(--fs-12); color: var(--danger-ink); font-weight: 500; }
.field-input,
.field-select {
  width: 100%; min-height: 38px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border-field);
  border-radius: var(--r-md);
  color: var(--text);
  transition: border-color var(--motion) var(--ease), box-shadow var(--motion) var(--ease);
}
textarea.field-input { resize: vertical; line-height: 1.5; }
.field-input::placeholder { color: var(--text-3); }
.field-input:focus, .field-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-input:focus-visible, .field-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.field.is-invalid .field-input,
.field-input[aria-invalid="true"] { border-color: var(--danger); }
.field-input:disabled, .field-select:disabled { background: var(--surface-3); color: var(--text-3); cursor: not-allowed; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--text); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

/* Чипы-фильтры и метки */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px; padding: 4px 12px;
  background: var(--surface); color: var(--text-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  font-size: var(--fs-13); font-weight: 500;
}
.chip:hover { background: var(--surface-3); color: var(--text); }
.chip.active, .chip[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--surface-3); color: var(--text-2);
  font-size: var(--fs-12); font-weight: 600; line-height: 1.5;
  white-space: nowrap;
}
.badge-success { background: var(--success-soft); color: var(--success-ink); }
.badge-warning { background: var(--warning-soft); color: var(--warning-ink); }
.badge-danger  { background: var(--danger-soft);  color: var(--danger-ink); }
.badge-accent  { background: var(--accent-soft);  color: var(--accent); }

/* Балл: цифра на сплошной заливке яруса + слово-оценка текстом. */
.score {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 24px; padding: 0 8px;
  border-radius: var(--r-pill);
  color: var(--on-solid);
  font-size: var(--fs-13); font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.score-lg { min-width: 64px; height: 40px; font-size: var(--fs-20); border-radius: var(--r-md); }
.score-great { background: var(--score-great); }
.score-good { background: var(--score-good); }
.score-mid { background: var(--score-mid); }
.score-low { background: var(--score-low); }
.score-critical { background: var(--score-critical); }
.score-na { background: var(--surface-3); color: var(--text-3); }
.score-word { margin-left: 6px; font-size: var(--fs-13); font-weight: 600; }
.tier-ink-great { color: var(--tier-great-ink); }
.tier-ink-good { color: var(--tier-good-ink); }
.tier-ink-mid { color: var(--tier-mid-ink); }
.tier-ink-low { color: var(--tier-low-ink); }
.tier-ink-critical { color: var(--tier-critical-ink); }
.tier-ink-na { color: var(--tier-na-ink); }

/* Плитка-цифра */
.kpi {
  display: flex; flex-direction: column; gap: 2px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  min-width: 0;
}
.kpi-link:hover { border-color: var(--accent); text-decoration: none; }
.kpi-label { font-size: var(--fs-13); color: var(--text-2); font-weight: 500; }
.kpi-value { font-size: var(--fs-24); font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi-delta { font-size: var(--fs-13); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-2); }
.kpi-delta.is-up { color: var(--success-ink); }
.kpi-delta.is-down { color: var(--danger-ink); }
.kpi-sub { font-size: var(--fs-12); color: var(--text-3); }

/* Вкладки-ссылки */
.tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  display: inline-flex; align-items: center;
  min-height: 40px; padding: 8px 14px;
  color: var(--text-2); font-weight: 500;
  white-space: nowrap;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--accent); font-weight: 600; }
.tab.active::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px;
  height: 2px; border-radius: 2px; background: var(--accent);
}
/* Раскладка «на виду / глубже» (ui_elements.MORE): редкая у роли вкладка скрыта, пока не
   активна, — её открывают из «Ещё» (кнопка в том же ряду) или по прямой ссылке ?tab=. */
.tab[data-more]:not(.active) { display: none; }
.tab-more { background: none; border: 0; font: inherit; cursor: pointer; }

/* Пустое состояние */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 32px 16px;
  text-align: center;
}
.empty-icon { width: 28px; height: 28px; color: var(--text-3); }
.empty-title { font-weight: 600; font-size: var(--fs-16); }
.empty-text { color: var(--text-2); max-width: 52ch; }
.empty .btn { margin-top: 8px; }

/* Подсказка-«?» (пузырь рисует ui.js по [data-tip]) */
.help {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  border: 1px solid var(--border-strong); border-radius: 50%;
  color: var(--text-3); font-size: 11px; font-weight: 700;
  cursor: help; vertical-align: 1px;
}
.help::before { content: ""; position: absolute; inset: -4px; }
.help:hover, .help:focus-visible { color: var(--accent); border-color: var(--accent); }

/* Аватар (UI.initialsAvatar) и мини-графики ui.js */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  flex: none; border-radius: var(--r-pill);
  font-weight: 600; line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  --avatar-l: 38%;
}
html[data-theme="dark"] .avatar { --avatar-l: 72%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); }
.score-ring { display: inline-block; vertical-align: middle; }
svg.score-ring text { stroke: none; fill: var(--text); font-weight: 700; }
.score-track { fill: none; stroke: var(--surface-3); }
.sparkline { display: inline-block; vertical-align: middle; }

/* ---------- 6. Таблицы ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-14); }
.table th {
  padding: 8px 12px;
  text-align: left;
  font-size: var(--fs-12); font-weight: 600;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: 0; }
.table th.num, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr:hover td { background: var(--surface-2); }
.row-link { cursor: pointer; }
.row-link a { color: var(--text); font-weight: 600; }
.row-link:hover a { color: var(--accent); }
.cell-sub { margin-top: 2px; font-size: var(--fs-12); color: var(--text-3); }

/* Сортируемые заголовки (UI.sortableTable) */
th.th-sort { cursor: pointer; user-select: none; }
th.th-sort:hover { color: var(--text); }
th.th-sort::after { content: "↕"; margin-left: 4px; opacity: 0.45; }
th.th-sort.asc::after { content: "↑"; opacity: 1; color: var(--accent); }
th.th-sort.desc::after { content: "↓"; opacity: 1; color: var(--accent); }
th.th-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ---------- 7. Примитивы ui.js ---------- */

/* Уведомления */
.ui-toasts {
  position: fixed; top: calc(var(--topbar-h) + 12px); right: 16px; z-index: 2000;
  display: flex; flex-direction: column; gap: 8px;
  max-width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.ui-toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  font-size: var(--fs-13); line-height: 1.45;
  cursor: pointer; pointer-events: auto;
  animation: v2-toast-in 220ms var(--ease) both;
}
.ui-toast.leaving { opacity: 0; transform: translateX(12px); transition: opacity 200ms var(--ease), transform 200ms var(--ease); }
.ui-toast.success { border-left-color: var(--success); }
.ui-toast.error { border-left-color: var(--danger); }
.ui-toast-icon { flex: none; margin-top: 1px; font-weight: 700; color: var(--accent); }
.ui-toast-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ui-toast.success .ui-toast-icon { color: var(--success-ink); }
.ui-toast.error .ui-toast-icon { color: var(--danger-ink); }
@keyframes v2-toast-in { from { opacity: 0; transform: translateX(16px); } }

/* Окна (UI.confirm / UI.prompt) и боковая панель (UI.slideover) */
dialog.ui-modal,
dialog.ui-slideover {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
dialog.ui-modal::backdrop,
dialog.ui-slideover::backdrop { background: rgba(16, 22, 32, 0.42); }
/* ::backdrop в части браузеров не наследует переменные :root — цвет литералом. */
html[data-theme="dark"] dialog.ui-modal::backdrop,
html[data-theme="dark"] dialog.ui-slideover::backdrop { background: rgba(0, 0, 0, 0.6); }
dialog.ui-modal {
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 22px 24px;
  border-radius: var(--r-lg);
}
dialog.ui-modal[open] { animation: v2-modal-in 200ms var(--ease) both; }
@keyframes v2-modal-in { from { opacity: 0; transform: translateY(8px) scale(0.985); } }
.ui-modal--scroll { max-height: 90vh; overflow-y: auto; }
.ui-modal-head { margin-bottom: 12px; }
.ui-modal-title { font-size: var(--fs-16); font-weight: 600; }
.ui-modal-body { color: var(--text-2); font-size: var(--fs-14); line-height: 1.55; white-space: pre-line; }
.ui-modal-msg { margin: 0 0 12px; }
.ui-modal-field { margin: 4px 0; }
.ui-modal-hint { margin-top: 8px; font-size: var(--fs-12); color: var(--text-3); }
.ui-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

dialog.ui-slideover {
  position: fixed; top: 0; right: 0; bottom: 0; left: auto;
  margin: 0; padding: 0;
  width: min(480px, 100vw); max-width: 100vw;
  height: 100vh; max-height: 100vh;
  border: 0; border-left: 1px solid var(--border); border-radius: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: v2-slide-in 220ms var(--ease);
}
dialog.ui-slideover.leaving { animation: v2-slide-out 200ms var(--ease) forwards; }
@keyframes v2-slide-in { from { transform: translateX(100%); } }
@keyframes v2-slide-out { to { transform: translateX(100%); } }
.ui-slideover-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex: none; }
.ui-slideover-title { flex: 1; min-width: 0; font-size: var(--fs-16); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-slideover-title:focus-visible { outline: none; }
.ui-slideover-close { margin-left: auto; }
.ui-slideover-body { flex: 1; padding: 20px; overflow-y: auto; }

/* Меню «⋯» (UI.menu) */
.ui-menu {
  position: fixed; z-index: 4100;
  min-width: 220px;
  display: flex; flex-direction: column; gap: 2px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  transform-origin: top center;
  animation: v2-menu-in 160ms var(--ease);
}
@keyframes v2-menu-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.ui-menu-item {
  display: block; width: 100%;
  padding: 8px 10px;
  background: transparent; border: 0; border-radius: var(--r-sm);
  color: var(--text); text-align: left; font-size: var(--fs-14);
}
.ui-menu-item:hover, .ui-menu-item:focus-visible { background: var(--surface-3); outline: none; }
.ui-menu-item.danger { color: var(--danger-ink); }
.ui-menu-item.danger:hover, .ui-menu-item.danger:focus-visible { background: var(--danger-soft); }
.ui-menu-sep { height: 1px; margin: 4px 2px; background: var(--border); }

/* Подсказка [data-tip] */
.ui-tip {
  position: fixed; z-index: 4000;
  max-width: 280px;
  padding: 8px 12px;
  background: var(--text); color: var(--surface);
  border-radius: var(--r-md);
  font-size: var(--fs-12); line-height: 1.5;
  box-shadow: var(--shadow-md);
  pointer-events: none;
}

/* Полоса «страница занята» и спиннер */
.ui-busy { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 3000; background: var(--accent-soft); overflow: hidden; }
.ui-busy-fill { position: absolute; top: 0; bottom: 0; width: 38%; background: var(--accent); animation: v2-busy 1.1s ease-in-out infinite; }
@keyframes v2-busy { from { left: -40%; } to { left: 100%; } }
.spinner {
  display: inline-block; width: 14px; height: 14px; flex: none;
  border: 2px solid var(--border-strong); border-top-color: var(--accent);
  border-radius: 50%;
  animation: v2-spin 0.8s linear infinite;
  vertical-align: -2px;
}
@keyframes v2-spin { to { transform: rotate(360deg); } }

/* Плашка «вход от имени» */
.ui-impersonation {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 14px;
  padding: 10px 16px;
  background: var(--warning); color: var(--on-solid);
  font-size: var(--fs-13); font-weight: 600;
  box-shadow: var(--shadow-lg);
}
.ui-impersonation button {
  padding: 6px 12px;
  background: var(--on-solid); color: #ffffff;
  border: 0; border-radius: var(--r-md);
  font-size: var(--fs-13); font-weight: 600;
}
.ui-impersonation button:disabled { opacity: 0.6; cursor: wait; }
body.has-impersonation { padding-bottom: 56px; }

/* Таблица → карточки на телефоне (UI.tableCards) */
@media (max-width: 720px) {
  table.responsive-cards, table.responsive-cards tbody { display: block; }
  table.responsive-cards thead { display: none; }
  table.responsive-cards tbody { display: flex; flex-direction: column; gap: 8px; }
  table.responsive-cards tbody tr {
    display: block; padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--r-md);
  }
  table.responsive-cards tbody tr:hover td { background: transparent; }
  table.responsive-cards td {
    display: flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end;
    gap: 2px 12px; padding: 3px 0;
    border: 0; text-align: right;
  }
  table.responsive-cards td::before {
    content: attr(data-label);
    margin-right: auto;
    font-size: var(--fs-12); color: var(--text-3); text-align: left;
  }
  table.responsive-cards td:not([data-label])::before,
  table.responsive-cards td[data-label=""]::before { content: none; }
  table.responsive-cards td:not([data-label]) { justify-content: flex-start; text-align: left; }
  table.responsive-cards td:empty { display: none; }
  table.responsive-cards td > div { flex-basis: 100%; min-width: 0; }
}

/* ---------- 8. Плеер записи (UI.audioPlayer) и закреплённая полоса (UI.playerDock) ----------
   ⚠️ position:fixed полосы резолвится от предка с transform/filter: у .card и её
   предков transform/filter не ставить (ui.js тогда не закрепляет полосу). */
.call-player {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.call-player-label { flex: none; font-size: var(--fs-12); color: var(--text-3); font-weight: 600; }
.call-audio { flex: 1; min-width: 220px; height: 36px; }
.call-audio:not([controls]) { display: none; }
.call-audio[hidden] + .ap-controls { display: none; }
.call-audio-download {
  flex: none; width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2);
  border: 1px solid var(--border-strong); border-radius: var(--r-md);
}
.call-audio-download:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.call-audio-download svg { width: 15px; height: 15px; }
.call-audio-missing { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; color: var(--text-2); }

.ap-controls { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 220px; }
.ap-controls .ap-play {
  width: 36px; height: 36px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--on-accent);
  border: 0; border-radius: 50%;
}
.ap-controls .ap-play:hover { background: var(--accent-hover); color: var(--on-accent); }
.ap-controls .ap-play svg { width: 16px; height: 16px; }
.ap-controls .ap-play:not([aria-label="Пауза"]) svg { margin-left: 2px; }
.ap-controls.is-failed .ap-play { background: var(--warning); color: var(--on-solid); }
.ap-controls.is-failed .ap-play svg { margin-left: 0; }
.ap-track { position: relative; flex: 1 1 auto; min-width: 80px; height: 36px; }
.ap-lanes, .ap-marks { position: absolute; inset: 0; pointer-events: none; }
.ap-seg { position: absolute; height: 4px; border-radius: 2px; }
.ap-seg.is-a { top: 8px; background: var(--side-a); }
.ap-seg.is-b { top: 24px; background: var(--side-b); }
.ap-mark {
  position: absolute; top: 0;
  width: 10px; height: 6px; margin-left: -5px;
  background: var(--ap-mark, var(--text-3));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.ap-scrub {
  -webkit-appearance: none; appearance: none;
  position: absolute; inset: 0;
  width: 100%; height: 100%; margin: 0;
  background: transparent;
  --ap-buffered: color-mix(in srgb, var(--text-3) 40%, var(--border-strong));
}
.ap-scrub::-webkit-slider-runnable-track {
  height: 6px; border-radius: var(--r-pill);
  background: linear-gradient(to right,
    var(--accent) var(--ap-fill, 0%),
    var(--ap-buffered) var(--ap-fill, 0%),
    var(--ap-buffered) var(--ap-buf, 0%),
    var(--border-strong) var(--ap-buf, 0%));
}
.ap-scrub::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px; margin-top: -4px;
  border-radius: 50%; border: 2px solid var(--surface);
  background: var(--accent);
}
.ap-scrub::-moz-range-track {
  height: 6px; border-radius: var(--r-pill);
  background: linear-gradient(to right, var(--ap-buffered) var(--ap-buf, 0%), var(--border-strong) var(--ap-buf, 0%));
}
.ap-scrub::-moz-range-progress { height: 6px; border-radius: var(--r-pill); background: var(--accent); }
.ap-scrub::-moz-range-thumb { width: 14px; height: 14px; border: 2px solid var(--surface); border-radius: 50%; background: var(--accent); }
.ap-scrub:disabled { cursor: default; opacity: 0.45; }
.ap-scrub:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ap-hover {
  position: absolute; bottom: calc(100% + 2px); left: 0; z-index: 3;
  max-width: 280px; padding: 3px 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  box-shadow: var(--shadow-md);
  font-size: var(--fs-12); font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.ap-note { flex: none; font-size: var(--fs-12); color: var(--text-2); white-space: nowrap; }
.ap-controls.is-failed .ap-note { color: var(--warning-ink); }
.ap-controls.is-recovering .ap-track { opacity: 0.55; }
.ap-time { flex: none; font-size: var(--fs-12); color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ap-cur { color: var(--text-2); }
.ap-rate {
  min-width: 44px; height: 28px; padding: 0 8px;
  background: transparent; color: var(--text-2);
  border: 1px solid var(--border-strong); border-radius: var(--r-pill);
  font-size: var(--fs-12); font-variant-numeric: tabular-nums;
}
.ap-rate:hover { color: var(--accent); border-color: var(--accent); }
.ap-legend {
  order: 10; flex-basis: 100%;
  display: flex; flex-wrap: wrap; gap: 4px 16px;
  margin-top: -4px;
  font-size: var(--fs-12); color: var(--text-2);
}
.ap-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.ap-legend-item::before { content: ""; width: 12px; height: 4px; border-radius: 2px; background: var(--text-3); }
.ap-legend-item.is-a::before { background: var(--side-a); }
.ap-legend-item.is-b::before { background: var(--side-b); }
.ap-legend-item.is-mark::before { width: 10px; height: 6px; border-radius: 0; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.call-audio[hidden] ~ .ap-legend,
.is-docked .ap-legend,
.player-dock-bar .ap-legend { display: none; }

.player-dock-slot { display: block; }
.call-player.is-docked,
.player-dock-bar {
  position: fixed; bottom: 0; left: var(--sidebar-w); right: 0; z-index: 180;
  display: flex; align-items: center; flex-wrap: nowrap; gap: 12px;
  margin: 0; padding: 10px 16px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 0; border-top: 1px solid var(--border); border-radius: 0;
  box-shadow: var(--shadow-lg);
  animation: v2-dock-in 200ms var(--ease) both;
}
@keyframes v2-dock-in { from { opacity: 0; transform: translateY(100%); } }
.call-player.is-docked .call-audio,
.player-dock-bar .call-audio { flex: 1; min-width: 0; height: 34px; }
.player-dock-bar .ap-controls,
.call-player.is-docked .ap-controls { min-width: 0; }
.is-docked .call-player-label,
.is-docked .call-audio-download { display: none; }
.player-dock-title { display: none; }
.is-docked .player-dock-title,
.player-dock-bar .player-dock-title {
  display: block; flex: 0 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--fs-12); color: var(--text-3); font-variant-numeric: tabular-nums;
}
.player-dock-close { display: none; }
.is-docked .player-dock-close,
.player-dock-bar .player-dock-close { display: inline-flex; flex: none; margin-left: 12px; }
.is-docked .player-dock-close::before,
.player-dock-bar .player-dock-close::before {
  content: ""; position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
  width: 1px; height: 18px; background: var(--border);
}
.player-dock-close svg { width: 15px; height: 15px; }
body.player-docked .workspace,
body.row-player-open .workspace { padding-bottom: var(--player-dock-h, 68px); }
body.has-impersonation .call-player.is-docked,
body.has-impersonation .player-dock-bar { bottom: 56px; }

/* Тайм-коды критериев — переход по записи */
.tc-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid transparent; border-radius: var(--r-pill);
  font-size: var(--fs-12); font-weight: 600; font-variant-numeric: tabular-nums;
}
.tc-chip:hover { border-color: var(--accent); }

/* ---------- 9. Адаптив ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Планшет: меню — колонка иконок (подписи в title). */
@media (max-width: 1100px) and (min-width: 721px) {
  :root { --sidebar-w: var(--sidebar-w-rail); }
  .sidebar { padding: 14px 10px; }
  .brand { justify-content: center; padding: 6px 0 14px; }
  .brand-name, .side-label, .side-badge { display: none; }
  .side-link { justify-content: center; padding: 8px; }
  .account-text { display: none; }
}
/* Телефон: меню выезжает слева по бургеру (shell.js ставит body.nav-open). */
@media (max-width: 720px) {
  :root { --sidebar-w: 0px; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 200;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 220ms var(--ease);
    box-shadow: none;
  }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .sidebar-overlay { position: fixed; inset: 0; z-index: 190; background: var(--overlay); }
  body.nav-open .sidebar-overlay { display: block; }
  .topbar .nav-burger { display: inline-flex; }
  .topbar { padding: 0 12px; gap: 8px; }
  .top-upload { padding: 7px 10px; }
  .top-upload-label, .account-text, .account-caret { display: none; }
  .account-btn { padding: 2px; }
  .main { padding: 16px 16px 40px; }
  .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .page-title { font-size: var(--fs-20); }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .call-player.is-docked, .player-dock-bar { left: 0; padding: 8px 12px; }
  .is-docked .player-dock-title, .player-dock-bar .player-dock-title,
  .player-dock-bar .ap-sep, .player-dock-bar .ap-dur,
  .is-docked .ap-sep, .is-docked .ap-dur { display: none; }
  .call-player:not(.is-docked) .ap-controls { flex-wrap: wrap; row-gap: 2px; }
  .call-player:not(.is-docked) .ap-track { order: 5; flex-basis: 100%; }
  dialog.ui-slideover { width: 100vw; border-left: 0; }
}
@media (max-width: 400px) {
  .player-dock-bar .call-audio-download { display: none; }
  .player-dock-bar .ap-controls, .is-docked .ap-controls { gap: 6px; }
}

/* ---------- 10. Доступность и печать ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
@media (prefers-contrast: more) {
  :root { --border: #8a929e; --text-3: #47505c; }
  html[data-theme="dark"] { --border: #6b7584; --text-3: #b8c0cc; }
}
@media print {
  .sidebar, .topbar, .call-player, .ap-controls, .player-dock-bar, .ui-toasts { display: none !important; }
  body { background: #ffffff; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* Окно «Мой аккаунт» (core.js: openAccount) */
.account-body { white-space: normal; display: flex; flex-direction: column; gap: 18px; }
.account-who { color: var(--text-2); }
.account-form { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.account-form .ui-modal-actions { margin-top: 4px; }
.account-sub { font-size: var(--fs-14); }
dialog.account-dialog { width: min(480px, calc(100vw - 32px)); }

/* ---------- 11. Общие блоки текста ---------- */
.prose { max-width: 75ch; line-height: 1.6; white-space: pre-wrap; }
.small { font-size: var(--fs-12); }
.bullets { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.bullets li { max-width: 75ch; line-height: 1.5; }
.notice {
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--surface-3); color: var(--text);
  border-left: 3px solid var(--border-strong);
}
.notice .prose { margin-top: 6px; }
.notice-success { background: var(--success-soft); border-left-color: var(--success); }
.notice-warning { background: var(--warning-soft); border-left-color: var(--warning); }
.notice-danger { background: var(--danger-soft); border-left-color: var(--danger); }
.field-inline { flex-direction: row; align-items: center; gap: 8px; }
.field-inline .field-select { width: auto; min-width: 220px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.code-block {
  margin: 0; padding: 12px;
  max-height: 60vh; overflow: auto;
  background: var(--surface-3); border-radius: var(--r-md);
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap; overflow-wrap: anywhere;
}

/* Раскрывающаяся карточка (<details class="card disclosure">) */
.disclosure { padding: 0; }
.disclosure-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px;
  cursor: pointer; list-style: none;
}
.disclosure-head::-webkit-details-marker { display: none; }
.disclosure-caret { transition: transform var(--motion) var(--ease); color: var(--text-3); }
.disclosure[open] .disclosure-caret { transform: rotate(180deg); }
.disclosure-body { padding: 0 20px 20px; }

/* ---------- 12. Страница звонка ---------- */
.call-page { gap: 16px; }
.back-link {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 4px;
  margin: -8px 0 -4px -6px; padding: 4px 6px;
  border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 500;
}
.back-link:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.call-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.call-head-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.call-head-main .page-title { overflow-wrap: anywhere; }
.call-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--text-2); }
.call-ids { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.call-ids:empty { display: none; }
.call-contact { color: var(--text-2); font-size: var(--fs-13); }
.call-head-side { flex: none; display: flex; align-items: center; gap: 8px; }
.call-body { display: flex; flex-direction: column; gap: 16px; }

.verdict-main { display: flex; align-items: flex-start; gap: 16px; }
.verdict-text { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.verdict-title { font-size: var(--fs-20); line-height: 1.3; }
.verdict-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--text-2); font-size: var(--fs-13); }
.verdict-context { color: var(--text-2); font-size: var(--fs-13); }
.verdict-summary { margin-top: 14px; }
.verdict-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.verdict-foot:has(> :not(:empty)) { margin-top: 14px; }
.verdict-foot > div:empty { display: none; }

.crit-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.crit {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.crit:first-child { border-top: 0; padding-top: 0; }
.crit:last-child { padding-bottom: 0; }
.crit > .score { flex: none; margin-top: 1px; }
.crit-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.crit-name { font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.crit-comment { color: var(--text-2); max-width: 75ch; line-height: 1.55; }
.crit-times { gap: 6px; }
.crit.is-excluded .crit-name { color: var(--text-2); }
.crit-items summary { cursor: pointer; color: var(--accent); font-size: var(--fs-13); font-weight: 500; width: fit-content; }
.crit-items ul { list-style: none; margin: 8px 0 0; padding: 0 0 0 4px; display: flex; flex-direction: column; gap: 8px; }
.crit-items li { display: flex; gap: 10px; font-size: var(--fs-13); }
.crit-item-score { flex: none; min-width: 34px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-2); }

.finding .card-title { display: flex; align-items: center; gap: 8px; }
.finding .card-title::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.finding-good .card-title::before { background: var(--success); }
.finding-bad .card-title::before { background: var(--danger); }
.finding-tip .card-title::before { background: var(--accent); }

/* Расшифровка: реплики с цветом стороны (менеджер — a, клиент — b) */
.tr-tools { margin-bottom: 12px; }
.tr-list { display: flex; flex-direction: column; gap: 10px; }
.tr-row { max-width: 80%; display: flex; flex-direction: column; gap: 3px; }
.tr-side-b { align-self: flex-end; }
.tr-meta { display: flex; align-items: center; gap: 8px; font-size: var(--fs-12); color: var(--text-3); }
.tr-side-b .tr-meta { justify-content: flex-end; }
.tr-who { font-weight: 600; color: var(--text-2); }
.tr-time {
  padding: 0 4px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--text-3);
  font-size: var(--fs-12); font-variant-numeric: tabular-nums;
}
button.tr-time:hover { background: var(--accent-soft); color: var(--accent); }
.tr-text {
  padding: 10px 14px;
  border-radius: 14px 14px 14px 4px;
  background: var(--surface-3);
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.tr-side-a .tr-text { background: color-mix(in srgb, var(--side-a) 10%, var(--surface)); }
.tr-side-b .tr-text { background: color-mix(in srgb, var(--side-b) 10%, var(--surface)); border-radius: 14px 14px 4px 14px; }
.tr-row.is-current .tr-text { box-shadow: 0 0 0 2px var(--accent); }
.tr-plain { white-space: pre-wrap; line-height: 1.6; }
mark.kw { padding: 0 2px; border-radius: 3px; background: #ffe58a; color: #10141a; }

/* Панель проверки: прилипает к низу страницы над закреплённым плеером */
.review-bar {
  position: sticky; bottom: 12px; z-index: 60;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 10px 12px 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}
.review-bar-text { margin-right: auto; color: var(--text-2); font-weight: 500; }
body.player-docked .review-bar { bottom: calc(var(--player-dock-h, 68px) + 12px); }

@media (max-width: 720px) {
  .call-head { flex-direction: column; }
  .verdict-main { flex-direction: column; gap: 10px; }
  .tr-row { max-width: 100%; }
  .field-inline { flex-direction: column; align-items: stretch; }
  .field-inline .field-select { min-width: 0; width: 100%; }
}

/* ---------- 13. Списки с фильтрами (компании, звонки, команда) ---------- */
.filter-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px;
  padding: 14px 16px;
}
.field-grow { flex: 1 1 260px; }
.field-compact { flex: 0 1 190px; }
.list-more { justify-content: center; margin-top: 14px; }
.cell-text { color: var(--text-2); }
.card-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.plain-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

/* ---------- 14. Карточка компании ---------- */
.company-page { gap: 16px; }
.ext-summary td { background: var(--surface-2); }
.ext-summary .stack { gap: 6px; max-width: 80ch; }
.dept + .dept { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.dept-title { font-size: var(--fs-14); margin-bottom: 10px; }
.ai-verdict { margin: 8px 0 6px; font-size: var(--fs-16); font-weight: 600; }
.ai-grid { margin-top: 12px; }
.ai-grid:empty { display: none; }
@media (max-width: 720px) {
  .field-compact { flex: 1 1 100%; }
}

/* ---------- 15. Список звонков (главная продавца, команда) ---------- */
.list-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.list-toolbar .field-grow { min-width: 220px; }
.seg {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface-3); border-radius: var(--r-md);
}
.seg-btn {
  min-height: 32px; padding: 4px 12px;
  border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--text-2); font-weight: 500;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); font-weight: 600; }
.call-list { list-style: none; margin: 0; padding: 0; }
.call-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 4px;
  border-top: 1px solid var(--border);
}
.call-row:first-child { border-top: 0; }
.call-row:hover { background: var(--surface-2); }
.call-play { flex: none; color: var(--accent); }
.call-play.is-playing { background: var(--accent-soft); }
.call-play-gap { flex: none; width: 36px; }
.call-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.call-row-main:hover { text-decoration: none; }
.call-row-main:hover .call-row-title { color: var(--accent); }
.call-row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-row-meta { font-size: var(--fs-13); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-row-side { flex: none; }
.call-list-note { padding: 12px 4px; list-style: none; }
.kpi-focus { font-size: var(--fs-14); font-weight: 600; line-height: 1.4; }

/* ---------- 16. Загрузка звонка (панель справа) ---------- */
.upload-form { gap: 16px; }
.drop-zone {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 28px 16px;
  border: 2px dashed var(--border-strong); border-radius: var(--r-lg);
  background: var(--surface-2);
  text-align: center; cursor: pointer;
  color: var(--text-2);
}
.drop-zone:hover, .drop-zone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.drop-zone.has-file { border-style: solid; border-color: var(--success); background: var(--success-soft); }
.drop-zone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop-title { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }

/* ---------- 17. «Звонки» руководителя ---------- */
.search-form { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.more-filters > summary { cursor: pointer; color: var(--accent); font-weight: 500; width: fit-content; }
.more-filters[open] > summary { margin-bottom: 10px; }
.filter-bar-plain { padding: 0; }
.call-row-snippet { font-size: var(--fs-13); color: var(--text-2); line-height: 1.5; white-space: normal; }
.call-row-snippet mark { background: var(--warning-soft); color: var(--text); border-radius: 3px; padding: 0 2px; }
.ext-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.ext-block .card-title { margin-bottom: 4px; }

/* ---------- 18. Главная руководителя ---------- */
.kpi-row { gap: 10px; }
.kpi-flat { padding: 10px 12px; box-shadow: none; background: var(--surface-2); }
.kpi-flat .kpi-value { font-size: var(--fs-20); }
.kpi-row-label { margin-top: 14px; }
.meter { height: 6px; margin-top: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

/* ---------- 19. «Команда» и страница менеджера ---------- */
.coach-grid { margin-top: 12px; }
.heatmap { font-size: var(--fs-13); }
.heatmap th.hm-col { max-width: 120px; white-space: normal; vertical-align: bottom; line-height: 1.3; }
.heatmap th.hm-col span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hm-cell { text-align: center; padding: 6px; }
.hm-cell .score { min-width: 44px; }
.hm-cell .score:hover { text-decoration: none; filter: brightness(0.95); }
.hm-empty { color: var(--text-3); }
.crit-bars { gap: 10px; }
.crit-bar { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(80px, 1fr) 44px 32px; align-items: center; gap: 10px; }
.crit-bar > a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.crit-bar-track { height: 8px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.crit-bar-fill { display: block; height: 100%; border-radius: inherit; }
.crit-bar-val { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.client-group { border-top: 1px solid var(--border); padding: 10px 4px; }
.client-group:first-child { border-top: 0; }
.client-group > summary { cursor: pointer; list-style-position: inside; }
.client-group-title { font-weight: 600; }
.client-group .call-list { margin: 6px 0 0 16px; }
.client-analysis { margin: 10px 0 4px 16px; display: flex; flex-direction: column; gap: 10px; }

/* Выбор менеджеров (static/v2/picker.js) */
.picker { display: flex; flex-direction: column; gap: 10px; }
.picker-tools .field-input { flex: 1 1 180px; width: auto; }
.picker-list { max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.picker-group { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 6px; }
.picker-group legend { font-weight: 600; margin-bottom: 4px; }
.picker-item { padding-left: 24px; }
@media (max-width: 720px) {
  .crit-bar { grid-template-columns: minmax(0, 1fr) 44px; }
  .crit-bar-track, .crit-bar > .muted { display: none; }
}

/* ---------- 20. «Настройки» ---------- */
.settings-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-nav { position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; gap: 2px; }
.settings-link { padding: 8px 12px; border-radius: var(--r-md); color: var(--text-2); font-weight: 500; }
.settings-link:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.settings-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.settings-body { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.settings-card { color: var(--text); }
.settings-card:hover { border-color: var(--accent); text-decoration: none; }
@media (max-width: 900px) {
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; border-bottom: 1px solid var(--border); gap: 4px; }
  .settings-link { white-space: nowrap; border-radius: var(--r-md) var(--r-md) 0 0; }
}

/* Глубокий разбор нейросетью (вкладка «По смыслу») */
.deep-search { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.deep-search-head { cursor: pointer; display: flex; flex-direction: column; gap: 2px; list-style: none; }
.deep-search-head::-webkit-details-marker { display: none; }
.deep-search-body { margin-top: 14px; }
.ds-hist { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 6px 0; border-top: 1px solid var(--border); }
.ds-hist.active .ds-hist-name { color: var(--accent); }
.ds-hist-name { font-weight: 600; }

/* ---------- 21. Публичные страницы (вход, новый пароль) ---------- */
.public-body { min-height: 100vh; }
.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 32px 16px;
}
.auth-card { width: 100%; max-width: 400px; padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.auth-brand { padding: 0; justify-content: flex-start; }
.auth-brand .brand-name { display: inline; }
.auth-title { font-size: var(--fs-20); }
.auth-sub { color: var(--text-2); }
.auth-submit { width: 100%; min-height: 40px; }
.auth-switch { text-align: center; }
.link-btn {
  padding: 0; border: 0; background: none;
  color: var(--accent); font-weight: 500;
}
.link-btn:hover { text-decoration: underline; }
@media (max-width: 720px) {
  .auth-page { align-items: flex-start; padding-top: 24px; }
  .auth-card { padding: 20px; }
}

/* ---------- 22. «Мой прогресс» и «Анонсы месяца» ---------- */
/* ---------- «Мой прогресс» (static/v2/progress.js, static/v2/charts.js) ---------- */
/* Карточки-якоря (/progress#test) не уходят под липкую шапку. */
.pg-anchor { scroll-margin-top: calc(var(--topbar-h) + 16px); }
.pg-block {
  display: flex; flex-direction: column; gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.card > .pg-block { margin-top: 18px; }
.pg-block > .card-hint { margin-top: -6px; }
.pg-sub { font-size: var(--fs-14); font-weight: 600; }
.pg-label { margin-bottom: 6px; font-size: var(--fs-13); font-weight: 600; color: var(--text-2); }
.pg-coach { margin-top: 12px; }
.pg-meta { margin-top: 10px; }
.pg-total-row td { font-weight: 600; background: var(--surface-2); }
/* Сдвиг к прошлому периоду: цвет — только чернила статуса, текстом. */
.delta {
  display: inline-flex; align-items: center; gap: 2px;
  color: var(--text-2);
  font-weight: 600; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.delta.is-up { color: var(--success-ink); }
.delta.is-down { color: var(--danger-ink); }
.delta.is-warn { color: var(--warning-ink); }
.kpi-delta.is-warn { color: var(--warning-ink); }
/* Холст Chart.js: responsive + maintainAspectRatio:false — высоту задаёт обёртка. */
.chart-box { position: relative; height: 240px; }

/* Тест менеджера: общий результат и полосы шкал (тест — заливка, «на деле» — засечка). */
.pg-test-total { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.pg-test-label { font-weight: 600; }
.pg-scales { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.pg-scale { display: flex; flex-direction: column; gap: 6px; }
.pg-scale-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.pg-scale-name { font-weight: 600; }
.pg-scale-value { font-variant-numeric: tabular-nums; }
.pg-scale-bar { position: relative; height: 8px; border-radius: var(--r-pill); background: var(--surface-3); }
.pg-scale-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: var(--pct, 0%);
  border-radius: var(--r-pill);
}
.pg-scale-fact {
  position: absolute; top: -4px; bottom: -4px; left: var(--pct, 0%);
  width: 3px; margin-left: -1px;
  border-radius: 2px;
  background: var(--text);
  box-shadow: 0 0 0 2px var(--surface);
}
.pg-scale-nums { color: var(--text-2); }
.pg-parts > summary {
  width: fit-content;
  color: var(--accent); font-size: var(--fs-13); font-weight: 500;
  cursor: pointer;
}
.pg-parts-list {
  list-style: none; margin: 8px 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
  font-size: var(--fs-13);
}
.pg-parts-list li { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.pg-parts-list b { font-variant-numeric: tabular-nums; }
.pg-concl { margin-top: 16px; }
.pg-concl > .stack { margin-top: 10px; }
.pg-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 12px; color: var(--text-2); }
.pg-legend-bar { display: inline-block; width: 18px; height: 8px; border-radius: var(--r-pill); background: var(--score-good); }
.pg-legend-fact { display: inline-block; width: 3px; height: 14px; margin-left: 10px; border-radius: 2px; background: var(--text); }

/* ---------- «Анонсы месяца» (static/v2/announcements.js) ---------- */
.tab-count {
  margin-left: 6px; padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--surface-3); color: var(--text-2);
  font-size: var(--fs-12); font-weight: 600; line-height: 18px;
  font-variant-numeric: tabular-nums;
}
.tab.active .tab-count { background: var(--accent-soft); color: var(--accent); }
.ann-item { display: flex; flex-direction: column; gap: 8px; }
.ann-item.is-past .card-title { color: var(--text-2); }
.ann-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ann-head .badge { flex: none; margin-top: 1px; }
.ann-meta { color: var(--text-3); font-size: var(--fs-13); }
.ann-text.is-clamped {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
}
.ann-toggle { align-self: flex-start; font-size: var(--fs-13); }

/* ---------- 23. Задания (/tasks: продавец и старший менеджер) ----------
   Выполненное помечается значком «Выполнено» (badge-success) и зелёным кружком, а НЕ
   прозрачностью строки: она роняла текст ниже AA (CLAUDE.md, «Задания продавца»).
   Ширину заливки полосы ставит static/v2/tasks.js (style="width:N%"), больше инлайн-
   стилей у страницы нет. */

/* Полоса прогресса: дорожка + заливка. Число рядом с полосой всегда есть текстом. */
.tasks-meter {
  height: 6px; margin: 4px 0 2px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  overflow: hidden;
}
.tasks-meter-fill {
  width: 0; height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width var(--motion) var(--ease);
}
.tasks-meter.is-done .tasks-meter-fill { background: var(--success); }
.kpi .tasks-meter { margin: 8px 0 4px; }
.tasks-kpi-action { align-self: flex-start; margin-top: 10px; }

/* Список заданий: кружок-значок слева, текст справа. */
.tasks-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tasks-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.tasks-item:first-child { border-top: 0; padding-top: 0; }
.tasks-item:last-child { padding-bottom: 0; }
.tasks-item-icon {
  flex: none; width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
}
.tasks-item-icon.is-done { background: var(--success-soft); color: var(--success-ink); }
.tasks-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tasks-item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.tasks-item-title { font-weight: 600; overflow-wrap: anywhere; }
.tasks-item-desc { color: var(--text-2); max-width: 75ch; white-space: pre-line; overflow-wrap: anywhere; }
.tasks-item-meta { font-size: var(--fs-13); color: var(--text-3); overflow-wrap: anywhere; }
.tasks-item-meta .link { display: inline-flex; align-items: center; gap: 4px; }
.tasks-item-actions { margin-top: 6px; }
.tasks-quote {
  max-width: 75ch;
  padding: 4px 0 4px 12px;
  border-left: 3px solid var(--border-strong);
  color: var(--text-2); font-size: var(--fs-13);
  overflow-wrap: anywhere;
}
.tasks-nearest { margin: -4px 0 12px; color: var(--text-2); font-size: var(--fs-13); }
.tasks-nearest .icon { margin-right: 6px; color: var(--accent); }

/* Достижения: компактная сетка; полученное — зелёный кружок и значок «Получено». */
.tasks-ach-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px;
}
.tasks-ach {
  display: flex; align-items: flex-start; gap: 10px;
  min-width: 0; padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-md);
}
.tasks-ach-icon {
  flex: none; width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--surface-3); color: var(--text-3);
}
.tasks-ach-icon .icon { width: 18px; height: 18px; }
.tasks-ach.is-earned .tasks-ach-icon { background: var(--success-soft); color: var(--success-ink); }
.tasks-ach-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tasks-ach-title { font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }

/* «Подопечным»: задание → кто выполнил → подсказки к зачёту. */
.tasks-team { display: flex; flex-direction: column; }
.tasks-task {
  display: flex; flex-direction: column; gap: 8px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
}
.tasks-task:first-child { border-top: 0; padding-top: 0; }
.tasks-task:last-child { padding-bottom: 0; }
.tasks-task-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }
.tasks-task-text { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tasks-task-title { font-size: var(--fs-16); line-height: 1.35; overflow-wrap: anywhere; }
.tasks-task-actions { flex: none; gap: 16px; }
.tasks-people {
  list-style: none; margin: 4px 0 0; padding: 0;
  border: 1px solid var(--border); border-radius: var(--r-md);
}
.tasks-person { padding: 10px 12px; border-top: 1px solid var(--border); }
.tasks-person:first-child { border-top: 0; }
.tasks-person-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.tasks-person-name { min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.tasks-person-side { justify-content: flex-end; gap: 12px; }
.tasks-suggest {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 10px; padding: 10px 12px;
  background: var(--surface-2);
  border-left: 3px solid var(--accent); border-radius: var(--r-md);
}
.tasks-suggest-head {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-13); font-weight: 600; color: var(--text-2);
}
.tasks-suggest-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; }
.tasks-suggest-row + .tasks-suggest-row { padding-top: 10px; border-top: 1px solid var(--border); }
.tasks-suggest-text { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }

/* Формы в панели справа: «Я сделал(а)» и «Новое задание». */
.tasks-form { gap: 16px; }
.tasks-form-lead { color: var(--text-2); }
.tasks-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 8px; }
.tasks-fieldset > legend { padding: 0; margin-bottom: 8px; }
.tasks-checklist { display: flex; flex-direction: column; gap: 10px; }
.tasks-pick { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; }
.tasks-pick-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  cursor: pointer;
}
.tasks-pick-row:hover { background: var(--surface-2); }
.tasks-pick-row:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
.tasks-pick-row input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.tasks-pick-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tasks-pick-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tasks-pick-meta { font-size: var(--fs-12); color: var(--text-3); }
.tasks-form-actions { margin-top: 4px; }

@media (max-width: 720px) {
  .tasks-person-side { justify-content: flex-start; }
  .tasks-ach-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 24. «Команда» → «Динамика» (static/v2/team_dynamics.js) ---------- */
/* Отклонение от нормы ТЕКСТОМ — только чернила статуса. */
.ink-warn { color: var(--warning-ink); font-weight: 600; }
.ink-danger { color: var(--danger-ink); font-weight: 600; }
/* Клиенты по стадии счёта: полоса = доля клиентов, число справа. */
.funnel { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.funnel-row { display: grid; grid-template-columns: 140px minmax(0, 1fr) 56px; align-items: center; gap: 12px; }
.funnel-label { color: var(--text-2); font-size: var(--fs-13); }
.funnel-track { height: 12px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.funnel-fill { display: block; height: 100%; width: var(--pct, 0%); border-radius: var(--r-pill); background: var(--text-3); }
.funnel-fill.is-none { background: var(--text-3); }
.funnel-fill.is-promised { background: var(--score-low); }
.funnel-fill.is-sent { background: var(--score-mid); }
.funnel-fill.is-paid { background: var(--score-great); }
.funnel-num { text-align: right; font-weight: 600; }
@media (max-width: 720px) {
  .funnel-row { grid-template-columns: 110px minmax(0, 1fr) 44px; gap: 8px; }
}

/* «Анонсы, ИИ-продукты и счета» (static/v2/ann_ai.js): «Динамика» и закреплённая карточка
   на главной. Цвета ступеней — те же серии, что на графике (1 — актуальный анонс,
   5 — ИИ, 2 — счёт). */
.ann-ai-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.ann-ai-top > p { margin: 0; }
.ann-ai-funnels { margin-top: 12px; }
.ann-ai-funnel-title { margin: 0; font-size: var(--fs-13); font-weight: 600; color: var(--text-2); }
.ann-ai-funnel .funnel { margin-top: 8px; }
.ann-ai-funnel .funnel-row { grid-template-columns: 150px minmax(0, 1fr) 100px; }
.funnel-share { margin-left: 6px; font-size: var(--fs-12); font-weight: 400; color: var(--text-3); }
.funnel-fill.is-calls { background: var(--text-3); }
.funnel-fill.is-checked { background: var(--chart-6); }
.funnel-fill.is-ann { background: var(--chart-3); }
.funnel-fill.is-actual { background: var(--chart-1); }
.funnel-fill.is-ai { background: var(--chart-5); }
.funnel-fill.is-inv { background: var(--chart-2); }
.ann-ai-cmp {
  display: flex; flex-wrap: wrap; gap: 6px 16px;
  margin: 16px 0 0; padding: 10px 12px;
  background: var(--surface-2); border-radius: var(--r-md);
  font-size: var(--fs-13); color: var(--text-2);
}
.ann-ai-cmp-lead { font-weight: 600; color: var(--text); }
.ann-ai-cmp-item strong { color: var(--text); font-variant-numeric: tabular-nums; }
.ann-ai-terms { margin: 8px 0 0; }
.ann-ai-subtitle { margin: 24px 0 8px; font-size: var(--fs-14); font-weight: 600; }
.ann-ai-calls-hint { margin: 0; }
.ann-ai-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ann-ai-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
@media (max-width: 720px) {
  .ann-ai-funnel .funnel-row { grid-template-columns: 110px minmax(0, 1fr) 88px; }
}

/* ---------- 25. «Настройки»: критерии и анонсы (static/v2/criteria.js, announcements_admin.js) ---------- */
/* ---------- Настройки → Критерии и промпт (static/v2/criteria.js) ---------- */
.crit-ed { gap: 16px; }
.crit-ed-help .disclosure-body { gap: 8px; }
.crit-ed-toolbar { row-gap: 10px; }
.crit-ed-status { align-self: center; margin-left: auto; font-size: var(--fs-13); }
.crit-ed-status:empty { display: none; }
.crit-ed-list { display: flex; flex-direction: column; }
.crit-ed-crit {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}
.crit-ed-crit:first-child { border-top: 0; padding-top: 0; }
.crit-ed-crit:last-child { padding-bottom: 0; }
.crit-ed-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.crit-ed-head > .crit-ed-text,
.crit-ed-head > .field-input { flex: 1 1 280px; min-width: 0; }
.crit-ed-crit > .crit-ed-head [data-f="name"] { font-weight: 600; }
.crit-ed-imp { flex: 0 0 auto; width: auto; min-width: 200px; }
.crit-ed-cond { flex: none; font-size: var(--fs-13); color: var(--text-2); white-space: nowrap; }
.crit-ed-imp-hint { margin-top: -2px; max-width: 75ch; }
.crit-ed-imp-hint.is-warn { color: var(--warning-ink); font-weight: 500; }
/* «Не оценивать вовсе» — зачёркнутое название, а не прозрачность строки (та роняла текст ниже AA) */
.is-skipped > .crit-ed-head [data-f="name"] { text-decoration: line-through; color: var(--text-2); }
.crit-ed-text { display: flex; align-items: center; gap: 6px; min-width: 0; }
.crit-ed-text.is-area { align-items: flex-start; }
.crit-ed-text > .field-input { flex: 1 1 auto; min-width: 0; }
.crit-ed-changed { flex: none; }
.crit-ed-text.is-area > .crit-ed-changed { margin-top: 9px; }
.crit-ed-revert { flex: none; width: 32px; height: 32px; }
.crit-ed-items { margin-top: 2px; }
.crit-ed-items-sum { cursor: pointer; width: fit-content; color: var(--accent); font-size: var(--fs-13); font-weight: 500; }
.crit-ed-items[open] > .crit-ed-items-sum { margin-bottom: 8px; }
.crit-ed-item-list { display: flex; flex-direction: column; gap: 10px; }
.crit-ed-item-list:empty { display: none; }
.crit-ed-item {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.crit-ed-item.is-own { border-style: dashed; border-color: var(--border-strong); }
.crit-ed-crit.is-own > .crit-ed-item-list { margin-top: 4px; }
.crit-ed-add { align-self: flex-start; margin-top: 4px; }
.crit-ed-prompt[open] > .disclosure-head { padding-bottom: 12px; }
.crit-ed-prompt-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.crit-ed-scenario .field-select { max-width: 420px; }
.crit-ed-sub { margin-top: 8px; font-size: var(--fs-14); }
.crit-ed-count { align-self: flex-end; font-variant-numeric: tabular-nums; }
.crit-ed-count.is-over { color: var(--danger-ink); font-weight: 600; }
.crit-ed-savebar { margin-top: 4px; }
.crit-ed-savebar .review-bar-text.is-dirty { color: var(--warning-ink); }
/* Только чтение (старший менеджер): поля выглядят текстом, а не выключенной формой —
   серый текст на сером фоне не дочитать. Фокус с клавиатуры остаётся видимым. */
.crit-ed.is-readonly .field-input[readonly],
.crit-ed.is-readonly .field-select:disabled {
  background: transparent; color: var(--text);
  border-color: transparent; box-shadow: none;
  padding-left: 0; padding-right: 0;
  cursor: default;
}
.crit-ed.is-readonly textarea.field-input[readonly] { resize: none; }
.crit-ed.is-readonly .crit-ed-imp:disabled {
  -webkit-appearance: none; appearance: none;
  min-width: 0; color: var(--text-2); font-weight: 600;
}
.crit-ed.is-readonly .check { cursor: default; }
.crit-ed.is-readonly .crit-ed-item { background: transparent; }
@media (max-width: 720px) {
  .crit-ed-head > .crit-ed-imp { flex: 1 1 100%; }
  .crit-ed-status { margin-left: 0; }
}

/* ---------- Настройки → Анонсы месяца: правка (static/v2/announcements_admin.js) ---------- */
/* Список — правила продавца (.ann-item, .ann-head, .tab-count … — уже в app.css, блок
   «Анонсы месяца»). У администратора в шапке ДВЕ метки (срок + «из библиотеки»):
   название забирает ширину, метки встают вплотную справа. Продавцу вид не меняется. */
.ann-head > .card-title { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.ann-item.is-editing { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.ann-actions { gap: 4px; margin-top: 2px; }
.btn-ghost.ann-del { color: var(--danger-ink); }
.btn-ghost.ann-del:hover { background: var(--danger-soft); color: var(--danger-ink); }
.ann-tech { margin-top: 8px; }
.ann-tech > summary { cursor: pointer; width: fit-content; font-size: var(--fs-13); color: var(--text-2); }
.ann-tech .prose { margin-top: 6px; overflow-wrap: anywhere; }

/* ---------- 26. Прохождение теста менеджера (движок static/psytest_take.js) ----------
   Движок один на кабинет (/psytest/take) и на ссылку (/t/<token>), классы psy-* — его.
   Ярус результата — как у «Моего прогресса»: low → --score-low, mid → mid, good → good,
   high → great; текстом — только чернила яруса. */
.auth-card.is-wide { max-width: 760px; }
.psy-take { width: 100%; }
.psy-screen {
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
  padding: 24px;
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.auth-card .psy-screen { padding: 0; border: 0; box-shadow: none; }
.psy-lead { max-width: 68ch; color: var(--text-2); }
.psy-para { max-width: 68ch; line-height: 1.6; }
.psy-hint { max-width: 68ch; font-size: var(--fs-13); color: var(--text-3); }
.psy-subtitle { font-size: var(--fs-20); font-weight: 600; }
.psy-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-top: 4px; }
.psy-field { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.psy-field-label { font-size: var(--fs-13); font-weight: 500; color: var(--text-2); }
.psy-input {
  width: 100%; min-height: 38px; padding: 8px 12px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-field); border-radius: var(--r-md);
}
.psy-input::placeholder { color: var(--text-3); }
.psy-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.psy-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.psy-inline-error { color: var(--danger-ink); font-size: var(--fs-13); }
.psy-note {
  width: 100%; padding: 12px 14px;
  border: 1px dashed var(--border-strong); border-radius: var(--r-md);
  color: var(--text-2); font-size: var(--fs-13);
}
.psy-note-error { border-style: solid; border-color: var(--danger); background: var(--danger-soft); color: var(--text); }

/* Вопрос: высота держится, чтобы кнопки не прыгали между утверждениями разной длины. */
.psy-question { gap: 16px; min-height: 380px; }
.psy-screen.psy-question { animation: psy-fade 120ms var(--ease) both; }
@keyframes psy-fade { from { opacity: 0; } to { opacity: 1; } }
.psy-progress { width: 100%; height: 4px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.psy-progress-fill { height: 100%; border-radius: var(--r-pill); background: var(--accent); transition: width var(--motion) var(--ease); }
.psy-counter { font-size: var(--fs-13); font-weight: 600; color: var(--text-3); }
.psy-statement { font-size: 18px; line-height: 1.45; font-weight: 500; text-wrap: pretty; }
/* Фокус ставит движок после ответа (tabindex −1) — для чтения, не для действия. */
.psy-statement:focus { outline: none; }
.psy-options { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.psy-option {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 11px 14px;
  text-align: left;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-md);
  transition: border-color var(--motion) var(--ease), background var(--motion) var(--ease);
}
.psy-option-num {
  flex: none; width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--fs-12); font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--text-3);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
}
.psy-option-label { flex: 1; min-width: 0; }
.psy-option:hover { border-color: var(--accent); background: var(--accent-soft); }
.psy-option:hover .psy-option-num { color: var(--accent); border-color: var(--accent); }
.psy-option:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.psy-option.is-picked { border-color: var(--accent); background: var(--accent-soft); }
.psy-option.is-picked .psy-option-num { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }

/* Результат сразу после прохождения. */
.psy-result { width: 100%; }
.psy-res-total {
  display: flex; align-items: center; gap: 16px;
  width: 100%; padding: 14px 18px;
  border: 1px solid var(--border); border-left: 3px solid var(--score-na);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.psy-res-total-value { font-size: 30px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.psy-res-total-value small { margin-left: 2px; font-size: var(--fs-16); font-weight: 500; color: var(--text-3); }
.psy-res-total-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.psy-res-total-label { font-weight: 600; }
.psy-res-scale { width: 100%; display: flex; flex-direction: column; gap: 6px; padding-top: 6px; }
.psy-res-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.psy-res-name { font-weight: 600; }
.psy-res-num { margin-left: auto; font-size: var(--fs-13); font-variant-numeric: tabular-nums; color: var(--text-2); }
.psy-res-bar { position: relative; height: 8px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.psy-res-fill { height: 100%; border-radius: var(--r-pill); background: var(--score-na); }
.psy-res-text { max-width: 72ch; }
.psy-res-text p { margin-top: 6px; font-size: var(--fs-13); line-height: 1.6; color: var(--text-2); }
.psy-res-total.psy-band-low { border-left-color: var(--score-low); }
.psy-res-total.psy-band-mid { border-left-color: var(--score-mid); }
.psy-res-total.psy-band-good { border-left-color: var(--score-good); }
.psy-res-total.psy-band-high { border-left-color: var(--score-great); }
.psy-res-total.psy-band-low .psy-res-total-value { color: var(--tier-low-ink); }
.psy-res-total.psy-band-mid .psy-res-total-value { color: var(--tier-mid-ink); }
.psy-res-total.psy-band-good .psy-res-total-value { color: var(--tier-good-ink); }
.psy-res-total.psy-band-high .psy-res-total-value { color: var(--tier-great-ink); }
.psy-res-fill.psy-band-low { background: var(--score-low); }
.psy-res-fill.psy-band-mid { background: var(--score-mid); }
.psy-res-fill.psy-band-good { background: var(--score-good); }
.psy-res-fill.psy-band-high { background: var(--score-great); }
@media (max-width: 720px) {
  .psy-screen { padding: 18px 16px; }
  .psy-question { min-height: 0; }
  .psy-statement { font-size: var(--fs-16); }
  .psy-res-total { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ---------- 27. «Настройки»: разделы администратора (static/v2/admin_*.js) ---------- */
/* Блок в панели справа и в формах: отделён линией сверху. */
.adm-section { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; border-top: 1px solid var(--border); }
.adm-section-title { font-size: var(--fs-14); font-weight: 600; }
.adm-danger .adm-section-title { color: var(--danger-ink); }
/* Опасное, но не главное действие — красная обводка (главное рядом — «Отключить»). */
.btn.adm-btn-danger { background: var(--surface); color: var(--danger-ink); border-color: var(--danger); }
.btn.adm-btn-danger:hover { background: var(--danger-soft); color: var(--danger-ink); }
/* Поле, которое растёт в одной строке с кнопкой («Пароль» + «Другой»). */
.adm-grow { flex: 1 1 180px; width: auto; min-width: 0; }
/* Коды приглашений, пароли, номера в системе прослушки, расписание. */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; overflow-wrap: anywhere; }
/* Строка переключателя функции: описание слева, состояние и кнопка справа. */
.adm-switch { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--border); }
.adm-switch:last-child { padding-bottom: 0; }
.adm-switch-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.adm-switch > .row-wrap { flex: none; }
/* Диск заполнен больше чем на 85%. */
.meter.is-high > span { background: var(--danger); }
@media (max-width: 720px) {
  .adm-switch { flex-direction: column; }
  .adm-switch > .row-wrap { flex: 1 1 auto; }
}

/* ---------- 28. Тест менеджера («Команда» → «Тест», «Настройки» → «Тест») ----------
   static/v2/test_people.js (общая отрисовка результата — CA.psytest) и test_admin.js.
   Полоса шкалы: заливка — «в тесте» (цвет диапазона методики, та же шкала, что у балла),
   сплошная риска — «на деле», пунктир — проходной балл (отличается ФОРМОЙ, не только цветом). */
.pt-kpis { grid-template-columns: repeat(auto-fill, minmax(170px, 240px)); margin-bottom: 12px; }
.pt-name { font-weight: 600; text-align: left; }
.pt-row { cursor: pointer; }
.table tbody tr.pt-row.is-open td { background: var(--surface-2); border-bottom-color: transparent; }
.table tr.is-dim td { color: var(--text-3); }
.table tbody tr.pt-detail:hover td { background: transparent; }
.pt-detail-body { max-width: 900px; padding: 4px 4px 12px; }
.pt-detail-foot { margin-top: 16px; }

.pt-total { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; }
.pt-total-text { flex: 1 1 220px; min-width: 0; }
.pt-total-label { font-weight: 600; }
.pt-why { margin-top: 10px; max-width: 75ch; font-size: var(--fs-13); color: var(--danger-ink); }
.pt-why.is-comp { color: var(--text-2); }

.pt-scales { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.pt-scale { min-width: 0; }
.pt-scale-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; }
.pt-scale-name { font-weight: 600; }
.pt-scale.is-below .pt-scale-name { color: var(--danger-ink); }
.pt-scale-value { font-variant-numeric: tabular-nums; }
.pt-bar { position: relative; height: 8px; margin-top: 6px; border-radius: var(--r-pill); background: var(--surface-3); }
.pt-bar-fill { position: absolute; top: 0; bottom: 0; left: 0; width: var(--pct, 0%); border-radius: inherit; }
.pt-bar-fact {
  position: absolute; top: -4px; bottom: -4px; left: var(--pct, 0%);
  width: 3px; margin-left: -1px; border-radius: 2px; background: var(--text);
}
.pt-bar-min { position: absolute; top: -2px; bottom: -2px; left: var(--pct, 0%); margin-left: -1px; border-left: 2px dashed var(--danger-ink); }
.pt-scale-nums { margin-top: 6px; color: var(--text-2); }
.pt-gap { font-weight: 600; }
.pt-gap.is-up { color: var(--success-ink); }
.pt-gap.is-down { color: var(--warning-ink); }
.pt-gap.is-flat { color: var(--text-2); }
.pt-parts { margin-top: 6px; }
.pt-parts > summary,
.pt-more > summary { width: fit-content; cursor: pointer; color: var(--accent); font-weight: 500; }
.pt-more[open] > summary { margin-bottom: 10px; }
.pt-parts-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-13); }
.pt-parts-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 12px; }
.pt-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; color: var(--text-3); }
.pt-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.pt-key { display: inline-block; flex: none; }
.pt-key-test { width: 16px; height: 8px; border-radius: var(--r-pill); background: var(--score-good); }
.pt-key-fact { width: 3px; height: 14px; border-radius: 2px; background: var(--text); }
.pt-key-min { height: 12px; border-left: 2px dashed var(--danger-ink); }

.pt-concl { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.pt-concl-title { font-size: var(--fs-14); }
.pt-concl-sub { margin-bottom: 4px; font-size: var(--fs-13); color: var(--text-2); }
.pt-concl-note { margin-top: 12px; }

.pt-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pt-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-13); }
.pt-log:empty { display: none; }
.pt-log-line { max-width: 90ch; }
.pt-log-line.is-ok { color: var(--success-ink); }
.pt-log-line.is-bad { color: var(--danger-ink); }
.pt-link {
  display: inline-block; max-width: 26ch; vertical-align: bottom;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-2); font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.pt-actions { justify-content: flex-end; flex-wrap: nowrap; gap: 12px; }
.field-input.pt-thr-input { width: 96px; }
@media (max-width: 720px) {
  .pt-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pt-parts-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .pt-parts-list li > :last-child { grid-column: 1 / -1; }
}

/* ---------- «Битрикс24» (только admin): две картины одной компании рядом ---------- */
/* Колонки равной ширины; уже 1200px таблицам сделок тесно — колонки встают друг под друга. */
.bitrix-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.bitrix-cols > .stack { gap: 16px; min-width: 0; }
.bitrix-col-title {
  font-size: var(--fs-13); font-weight: 600; color: var(--text-2);
  letter-spacing: 0.04em; text-transform: uppercase;
}
.bitrix-meter { margin-top: 12px; }
/* Счётчики и суммы в узких колонках не рвём посередине («1 в / работе», «664 462 / ₽»). */
.bitrix-nowrap { white-space: nowrap; }
.bitrix-note { margin-top: 4px; white-space: pre-line; }
/* Журнал обмена: строк тысячи, поэтому колонке «Запрос» отдаём ширину — подпись и строка
   под ней (метод, проход обновления) встают в две строки, а не в три-четыре. */
.bitrix-log-req { width: 42%; }
/* Виды журнала. «Сводка» — три карточки с тем же шагом, что у страницы; таблица «По времени»
   длинная (сутки — 25 строк), поэтому листается внутри себя; «JSON» — выше обычного блока
   кода: это весь вид, а не вставка в строку. */
.bitrix-log-sum { display: flex; flex-direction: column; gap: 16px; }
.bitrix-log-time { max-height: 420px; overflow-y: auto; margin-top: 12px; }
.bitrix-log-time th { position: sticky; top: 0; background: var(--surface); }
.bitrix-log-total td { font-weight: 600; background: var(--surface-2); }
.bitrix-log-bad { color: var(--danger-ink); font-weight: 600; }
.bitrix-log-json { max-height: 75vh; }
/* «Отделы»: подразделы карточки (переводы, увольнения, списки людей) — отступ от
   предыдущего подраздела, заголовок «капсом» тот же, что у колонок карточки компании. */
.bitrix-staff-sub { gap: 8px; margin-top: 16px; }
@media (max-width: 1200px) {
  .bitrix-cols { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- «Доступы и права» (только admin): матрица прав в боковой панели ---------- */
/* Панель шире обычной: подпись права с пояснением слева, переключатель из трёх положений
   справа. На узком экране переключатель уходит под текст. */
dialog.ui-slideover.acc-panel { width: min(680px, 100vw); }
.acc-note { margin-top: 8px; }
.acc-tools { gap: 8px; align-items: center; }
.acc-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px;
  align-items: start; padding: 12px 0; border-top: 1px solid var(--border);
}
.acc-row:first-of-type { border-top: 0; }
/* Изменённая строка — полоса слева, а не заливка: текст остаётся на обычном фоне. */
.acc-row-changed { box-shadow: inset 3px 0 0 var(--accent); padding-left: 12px; }
.acc-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.acc-row-label { font-weight: 600; }
.acc-row-hint { font-size: var(--fs-12); color: var(--text-3); }
.acc-row-now { font-size: var(--fs-12); color: var(--text-2); margin-top: 2px; }
.acc-now-on { color: var(--success-ink); font-weight: 600; }
.acc-now-off { color: var(--danger-ink); font-weight: 600; }
.acc-seg .seg-btn { min-height: 30px; padding: 4px 10px; white-space: nowrap; }
/* «Да», которое роли не положено: серое, причина — в подсказке кнопки. */
.acc-seg .seg-btn:disabled { color: var(--text-3); cursor: not-allowed; }
@media (max-width: 720px) {
  .acc-row { grid-template-columns: minmax(0, 1fr); }
}
