/* ─────────────────────────────────────────────────────────────
   Палитра «Анализатор» 1.1 (docs/v4/analizator_palette.css) — смысловые
   токены --ui-*, одинаковые определения статусов в светлой и тёмной теме.
   Ниже — прежние имена (ими пользуется архив) и короткие имена нового
   кабинета, все отображены на токены палитры. Прямые HEX в компонентах не пишем.

   Жёлтый — только бренд и выбранная реплика/эпизод. Синий — ссылки, фокус
   и «Думает / ждём ответ». Серый — «Не хватает данных». Зелёный —
   подтверждённый переход. Красный — только подтверждённый пропуск.
   Цвет всегда вместе с подписью или знаком.
   ───────────────────────────────────────────────────────────── */
:root, [data-theme="light"] {
  color-scheme: light;
  --ui-bg: #F6F7F9;
  --ui-surface: #FFFFFF;
  --ui-surface-subtle: #EEF0F3;
  --ui-text: #202327;
  --ui-text-muted: #626C77;
  --ui-divider: #D9DDE3;
  --ui-divider-soft: #E6E9ED;
  --ui-control-border: #7C8793;
  --ui-brand: #F5C400;
  --ui-brand-text: #202327;
  --ui-primary: #202327;
  --ui-primary-text: #FFFFFF;
  --ui-primary-hover: #343A41;
  --ui-link: #1457B5;
  --ui-focus: #1457B5;
  --ui-selected-bg: #FFF5C2;
  --ui-selected-border: #9B7600;
  --ui-critical: #B42318;
  --ui-critical-bg: #FEF3F2;
  --ui-material: #8A4B08;
  --ui-material-bg: #FFF4E5;
  --ui-success: #176B45;
  --ui-success-bg: #EAF7EF;
  --ui-info: #1457B5;
  --ui-info-bg: #EDF4FF;
  --ui-neutral: #59636F;
  --ui-neutral-bg: #EEF0F3;
}
[data-theme="dark"] {
  color-scheme: dark;
  --ui-bg: #141618;
  --ui-surface: #1C1F23;
  --ui-surface-subtle: #25292E;
  --ui-text: #F2F4F7;
  --ui-text-muted: #ADB5BF;
  --ui-divider: #39414A;
  --ui-divider-soft: #2E353D;
  --ui-control-border: #8793A0;
  --ui-brand: #F5C400;
  --ui-brand-text: #202327;
  --ui-primary: #F2F4F7;
  --ui-primary-text: #141618;
  --ui-primary-hover: #D9DFE6;
  --ui-link: #87B9FF;
  --ui-focus: #87B9FF;
  --ui-selected-bg: #3B3317;
  --ui-selected-border: #F5C400;
  --ui-critical: #FFA69B;
  --ui-critical-bg: #3B2020;
  --ui-material: #F5C078;
  --ui-material-bg: #352817;
  --ui-success: #82D9AA;
  --ui-success-bg: #193328;
  --ui-info: #87B9FF;
  --ui-info-bg: #1C2C43;
  --ui-neutral: #BEC6D0;
  --ui-neutral-bg: #292E35;
}
:root {
  /* прежние имена — архив (методика 2.0) и страница входа */
  --bg:          var(--ui-bg);
  --surface:     var(--ui-surface);
  --raise:       var(--ui-surface-subtle);
  --text:        var(--ui-text);
  --muted:       var(--ui-text-muted);
  --faint:       var(--ui-neutral);
  --line:        var(--ui-divider);
  --line-soft:   var(--ui-divider-soft);
  --control:     var(--ui-control-border);
  --accent:      var(--ui-brand);
  --accent-ink:  var(--ui-brand-text);
  --pick-bg:     var(--ui-selected-bg);
  --pick-line:   var(--ui-selected-border);
  --link:        var(--ui-link);
  --focus:       var(--ui-focus);
  --button:      var(--ui-primary);
  --button-ink:  var(--ui-primary-text);
  --button-over: var(--ui-primary-hover);
  --critical:    var(--ui-critical);  --critical-bg: var(--ui-critical-bg);
  --material:    var(--ui-material);  --material-bg: var(--ui-material-bg);
  --done:        var(--ui-success);   --done-bg:     var(--ui-success-bg);
  --pending:     var(--ui-info);      --pending-bg:  var(--ui-info-bg);
  --none:        var(--ui-neutral);   --none-bg:     var(--ui-neutral-bg);

  /* новый кабинет */
  --surface-subtle:  var(--ui-surface-subtle);
  --text-muted:      var(--ui-text-muted);
  --divider:         var(--ui-divider);
  --control-border:  var(--ui-control-border);
  --brand:           var(--ui-brand);
  --brand-text:      var(--ui-brand-text);
  --primary:         var(--ui-primary);
  --primary-text:    var(--ui-primary-text);
  --primary-hover:   var(--ui-primary-hover);
  --selected-bg:     var(--ui-selected-bg);
  --selected-border: var(--ui-selected-border);
  --success:         var(--ui-success);  --success-bg: var(--ui-success-bg);
  --info:            var(--ui-info);     --info-bg:    var(--ui-info-bg);
  --neutral:         var(--ui-neutral);  --neutral-bg: var(--ui-neutral-bg);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Onest', 'Segoe UI', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-feature-settings: 'tnum'; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
/* Действие видно без наведения: подчёркивание — признак ссылки, hover только усиливает. */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.015em; }
table { width: 100%; border-collapse: collapse; }
button { font-family: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ── шапка ─────────────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 32px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.mark {
  width: 26px; height: 26px; flex: none; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  font-size: 13px; font-weight: 700;
}
.brand { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; }
.brand span { color: var(--faint); font-weight: 400; }
.spacer { flex: 1; }
.ghost {
  height: 40px; padding: 0 12px; display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; background: transparent; border: 1px solid var(--control); border-radius: 3px; cursor: pointer;
}
.ghost:hover { background: var(--raise); }
.ghost svg { width: 14px; height: 14px; }
.who { font-size: 12px; color: var(--muted); white-space: nowrap; }
.logout { font-size: 12px; color: var(--muted); background: none; border: none; cursor: pointer; padding: 0; }
.logout:hover { color: var(--text); }

.periods { display: flex; gap: 2px; }
.periods button {
  height: 40px; padding: 0 9px; font-size: 12px; color: var(--muted);
  background: none; border: 1px solid transparent; border-radius: 3px; cursor: pointer;
}
.periods button:hover { color: var(--text); }
.periods button[aria-pressed="true"] { color: var(--text); border-color: var(--control); }

/* ── навигация ─────────────────────────────────────────────── */
.nav {
  display: flex; gap: 2px; padding: 0 32px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.nav a {
  display: flex; align-items: center; height: 40px; padding: 0 12px;
  font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap;
}
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }

.nav a { font-size: 14px; }
/* Меню листается пальцем, полоса прокрутки под ним только мешает. */
.nav, .subnav { scrollbar-width: none; }
.nav::-webkit-scrollbar, .subnav::-webkit-scrollbar { display: none; }
.subnav {
  display: flex; gap: 2px; padding: 0 32px;
  background: var(--bg); border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.subnav:empty { display: none; }
.subnav a {
  display: flex; align-items: center; height: 36px; padding: 0 12px;
  font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap;
}
.subnav a:hover { color: var(--text); text-decoration: none; }
.subnav a[aria-current="page"] { color: var(--text); font-weight: 600; border-bottom-color: var(--text); }

.badge {
  display: inline-block; padding: 1px 6px; border-radius: 3px;
  font-size: 11px; font-weight: 500; color: var(--muted); border: 1px solid var(--line); white-space: nowrap;
}
.badge.follow { color: var(--text); border-color: var(--control); }
.badge.bad { color: var(--critical); border-color: var(--critical); }
.badge.ok { color: var(--done); border-color: var(--done); }

.notice { margin-top: 14px; padding: 11px 14px; background: var(--pending-bg); color: var(--pending); font-size: 14px; }

.source { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: 13px; }
.source dt { color: var(--muted); }
.source dd { margin: 0; }

.profiles { margin-top: 8px; }
.profile { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.profile .who-name { width: 190px; font-weight: 500; }
.profile .state { flex: 1; color: var(--muted); }

.wrap { max-width: 1600px; margin: 0 auto; padding: 24px 32px 56px; }

/* ── общие куски ───────────────────────────────────────────── */
/* ТЗ, раздел 3: вместо крупного лозунга — короткая фактическая сводка, она не занимает первый экран. */
.lede { max-width: 860px; margin: 0; font-size: 15px; line-height: 1.45; font-weight: 400; color: var(--muted); }
.lede em { font-style: normal; color: var(--text); font-weight: 600; }

.figures { display: flex; margin-top: 20px; border-top: 1px solid var(--text); border-bottom: 1px solid var(--line); }
.figures > div { flex: 1; padding: 13px 20px; border-left: 1px solid var(--line); }
.figures > div:first-child { padding-left: 0; border-left: none; }
.figures > div:last-child { padding-right: 0; }
.fig-num { font-size: 25px; font-weight: 600; line-height: 1; }
.fig-num small { font-size: 13px; font-weight: 400; color: var(--muted); }
.fig-cap { margin-top: 6px; font-size: 12px; color: var(--muted); }

.cols { display: flex; gap: 38px; margin-top: 24px; align-items: flex-start; }
.col-main { flex: 1 1 0; min-width: 0; }
.col-side { flex: 0 0 410px; min-width: 0; }

.head-line { display: flex; align-items: baseline; gap: 10px; padding-bottom: 7px; border-bottom: 1px solid var(--text); }
.head-line h2 { font-size: 14px; }
.head-line .note { font-size: 12px; color: var(--muted); }
.head-line.soft { border-bottom-color: var(--line); }

th { padding: 0 0 7px; text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); }
thead tr { border-bottom: 1px solid var(--text); }
td { padding: 12px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; vertical-align: top; }
tbody tr:hover td { background: var(--raise); }
.num { text-align: right; }
.dim { color: var(--muted); }
.faint { color: var(--faint); }

.track { display: inline-block; width: 92px; height: 4px; background: var(--line); vertical-align: middle; }
.track i { display: block; height: 4px; background: var(--text); }
.up { color: var(--done); }
.down { color: var(--critical); }
/* Изменение к прошлому периоду — факт, а не оценка: без «зелёного успеха». */
.delta { color: var(--muted); font-size: 13px; }
.bad { color: var(--critical); }
.warn { color: var(--material); }

.row-link { color: var(--text); font-weight: 500; }
.row-link:hover { color: var(--link); text-decoration: none; }

.alert { display: block; padding: 11px 0; border-bottom: 1px solid var(--line-soft); color: var(--text); }
.alert:hover { text-decoration: none; }
.alert:hover .alert-title { color: var(--link); }
.alert-top { display: flex; align-items: baseline; gap: 8px; }
.alert-title { font-size: 13px; font-weight: 600; }
.alert-kind { font-size: 12px; color: var(--critical); }
.alert-when { margin-left: auto; font-size: 11px; color: var(--faint); white-space: nowrap; }
.alert-text { display: block; margin-top: 3px; font-size: 13px; color: var(--muted); }

.foot { margin-top: 26px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 11px; color: var(--faint); }
.empty { padding: 28px 0; color: var(--muted); }
.loading { padding: 40px 0; color: var(--faint); }
.error-box { padding: 14px 16px; background: var(--pending-bg); color: var(--text); }

.tabs { display: flex; gap: 18px; margin-left: 18px; }
.tabs button { padding: 0 0 2px; font-size: 13px; color: var(--muted); background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; }
.tabs button[aria-pressed="true"] { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }

.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); cursor: pointer; }
.check input { accent-color: var(--link); }

/* ── карточка сотрудника ───────────────────────────────────── */
.person { display: flex; align-items: flex-end; gap: 22px; margin-top: 14px; flex-wrap: wrap; }
.person h1 { font-size: 28px; }
.person .sub { margin-top: 4px; font-size: 13px; color: var(--muted); }
.scores { display: flex; margin-left: auto; text-align: right; }
.scores > div { padding: 0 18px; border-left: 1px solid var(--line); }
.scores > div:first-child { border-left: none; }
.scores > div:last-child { padding-right: 0; }
.score-num { font-size: 29px; font-weight: 600; line-height: 1; }
.score-num small { font-size: 16px; color: var(--muted); }
.score-cap { margin-top: 5px; font-size: 12px; color: var(--muted); }

.blockrow { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.blockrow .idx { width: 16px; font-size: 12px; color: var(--faint); }
.blockrow .nm { flex: 1; font-size: 13px; }
.blockrow .val { width: 44px; text-align: right; font-size: 13px; color: var(--muted); }
.blockrow.low .val { color: var(--critical); font-weight: 600; }

.miss { display: flex; align-items: baseline; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.miss-id { width: 28px; font-size: 12px; color: var(--faint); flex: none; }
.miss-nm { flex: 1; font-size: 13px; }
.miss-cnt { font-size: 13px; font-weight: 600; color: var(--critical); white-space: nowrap; }

/* ── оценка: число, полоса, слово ──────────────────────────── */
/* Цвет только подсказывает слово: понимать интерфейс по одному цвету не нужно. */

.score { display: inline-flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.score-val { font-size: 16px; font-weight: 600; }
.val.is-low { font-weight: 600; }
.fig-num.is-critical { color: var(--critical); }
.low-data { color: var(--none); }

/* Смысловой статус — подпись, знак и слабый фон: цвет не единственный носитель смысла. */
.chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 2px 8px; border-radius: 3px; font-size: 13px; white-space: nowrap;
}
.chip-sign { font-weight: 700; }
.chip-critical { color: var(--critical); background: var(--critical-bg); }
.chip-material { color: var(--material); background: var(--material-bg); }
.chip-done     { color: var(--done);     background: var(--done-bg); }
.chip-pending  { color: var(--pending);  background: var(--pending-bg); }
.chip-none     { color: var(--none);     background: var(--none-bg); }

/* ── свёрнутые разделы ─────────────────────────────────────── */
/* Первый уровень — решение, второй — выкладки. Подпись говорит, что внутри, до открытия. */
.fold { margin-top: 14px; border-top: 1px solid var(--line); }
.fold summary {
  display: flex; align-items: baseline; gap: 10px; padding: 11px 0;
  cursor: pointer; list-style: none; user-select: none;
}
.fold summary::-webkit-details-marker { display: none; }
.fold summary::before {
  content: '+'; width: 13px; flex: none;
  font-family: 'JetBrains Mono', ui-monospace, monospace; color: var(--faint);
}
.fold[open] summary::before { content: '−'; }
.fold summary:hover .fold-title { color: var(--link); }
.fold-title { font-size: 14px; font-weight: 600; }
.fold-note { font-size: 12px; color: var(--muted); }
.fold-body { padding: 2px 0 18px 23px; }

.hint { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.counts { margin: 2px 0 0; font-size: 13px; }
.panel { margin-top: 16px; padding: 14px 16px; background: var(--raise); }
.sub-title { margin: 16px 0 4px; font-size: 12px; color: var(--muted); }
.sub-title:first-child { margin-top: 0; }
.back { font-size: 12px; }

/* ── таблица отдела ────────────────────────────────────────── */
table.people { margin-top: 12px; }
/* Шапка держится на месте: на длинном отделе иначе не помнишь, что за столбец. */
table.people thead th { position: sticky; top: 56px; z-index: 4; background: var(--bg); padding-top: 8px; }
table.people th[data-sort] { cursor: pointer; user-select: none; white-space: nowrap; }
table.people th[data-sort]:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
table.people th[data-sort]:hover { color: var(--text); }
table.people th[data-sort]::after { content: ''; margin-left: 5px; font-size: 10px; color: var(--faint); }
table.people th[aria-sort="descending"]::after { content: '▼'; }
table.people th[aria-sort="ascending"]::after { content: '▲'; }
table.people td { vertical-align: middle; }
table.people th, table.people td { padding-right: 18px; }
table.people th:last-child, table.people td:last-child { padding-right: 0; }
.score-col { width: 210px; }
.flag { color: var(--critical); font-weight: 600; }
a.flag:hover { color: var(--critical); }

/* Матрица «сотрудник × блок»: провал видно, не вчитываясь в числа. */
.matrix-wrap { overflow-x: auto; }
.matrix { width: auto; min-width: 460px; }
.matrix td:first-child, .matrix th:first-child { width: 230px; padding-right: 24px; }
.matrix th { padding-bottom: 8px; white-space: nowrap; }
.matrix th.num { width: 52px; }
.matrix td { padding: 7px 0; }
.matrix .cell { text-align: right; padding-right: 9px; font-size: 13px; }
.matrix .cell.is-low { color: var(--material); font-weight: 600; }
.cell-mark { margin-left: 4px; font-size: 10px; }
.matrix tr.whole td { font-weight: 600; border-bottom-color: var(--line); }

/* ── список разговоров ─────────────────────────────────────── */
table.rows td { vertical-align: middle; }
.when { width: 148px; font-size: 12px; }
.when .mono + .mono { margin-left: 8px; }
.who-cell { width: 230px; }
.who-cell .badge, .who-cell .mono { margin-left: 7px; font-size: 11px; white-space: nowrap; }
.note-cell { padding-left: 18px; }
.open { font-size: 12px; }

/* ── заголовок страницы ────────────────────────────────────── */
.page-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.page-head h1 { font-size: 25px; }
.page-head .period { font-size: 12px; }
.call-head { align-items: flex-end; margin-top: 12px; }
.call-head h1 { font-size: 25px; }
.call-head .meta { margin-top: 4px; font-size: 12px; color: var(--muted); }
.call-head a { font-size: 13px; }
.track-line { margin-top: 8px; font-size: 12px; }

/* ── итог разговора одной полосой ──────────────────────────── */
/* Первое, что видит глаз сверху: сколько, как это называется словами и что случилось. */
.strip {
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
  margin-top: 14px; padding: 14px 18px;
  background: var(--surface); border: 1px solid var(--line);
}
.strip-score { display: flex; align-items: baseline; gap: 9px; }
.strip-num { font-size: 32px; font-weight: 600; line-height: 1; }
.strip-item { display: flex; align-items: baseline; gap: 8px; }
.strip-val { font-size: 19px; font-weight: 600; }
.strip-val small { font-size: 12px; font-weight: 400; color: var(--muted); }
.strip-cap { font-size: 12px; color: var(--muted); }
.strip-text { flex: 1 1 260px; margin: 0; font-size: 13px; color: var(--muted); }

.issues.big { margin-top: 12px; }
.issues.big > div { padding: 9px 12px; border-bottom: none; background: var(--critical-bg); }
.issues.big > div + div { margin-top: 4px; }
.issues.big .bad { font-size: 12px; }
.notice.bad-notice { background: var(--critical-bg); color: var(--critical); }

/* ── что исправить ─────────────────────────────────────────── */
.fix-head { display: flex; align-items: baseline; gap: 10px; margin-top: 18px; padding-bottom: 5px; border-bottom: 1px solid var(--line); }
.fix-head:first-child { margin-top: 4px; }
.fix-head .idx { width: 16px; font-size: 12px; color: var(--faint); }
.fix-head .nm { flex: 1; font-size: 13px; font-weight: 600; }
.fix-lost { font-size: 13px; font-weight: 600; color: var(--critical); }
.mark-st b { font-weight: 600; }
.cblocks { margin-top: 8px; }
.cblock .val { width: 66px; text-align: right; font-size: 12px; }
.outcome { margin: 14px 0 0; font-size: 13px; }
.scores .main .score-num { font-size: 40px; }
.scores .main .score-num .mono { font-size: 15px; }
table.people td:first-child { white-space: nowrap; }
.verdict .dim { font-size: 13px; }

/* ── разговор ──────────────────────────────────────────────── */
.player { margin-top: 16px; padding: 14px 16px; background: var(--raise); }
.player-row { display: flex; align-items: center; gap: 16px; }
.play {
  width: 42px; height: 42px; flex: none; display: grid; place-items: center;
  background: var(--text); border: none; border-radius: 50%; cursor: pointer;
}
.play svg { width: 16px; height: 16px; fill: var(--surface); }
.play[disabled] { opacity: 0.4; cursor: default; }
.timeline { position: relative; flex: 1; height: 36px; cursor: pointer; }
.timeline .rail { position: absolute; left: 0; right: 0; top: 16px; height: 4px; background: var(--line); }
.timeline .done { position: absolute; left: 0; top: 16px; height: 4px; background: var(--text); width: 0; }
.timeline .tick {
  position: absolute; top: 8px; width: 3px; height: 20px; margin-left: -1px;
  background: var(--critical); border: none; padding: 0; cursor: pointer;
}
.timeline .tick.part { background: var(--material); }
.timeline .head { position: absolute; top: 10px; width: 2px; height: 16px; background: var(--text); margin-left: -1px; }
.clock { width: 112px; text-align: right; font-size: 14px; font-weight: 600; }
.clock span { color: var(--faint); font-weight: 400; }
.speeds { display: flex; align-items: center; gap: 13px; margin-top: 9px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.speeds button { padding: 0; font-size: 12px; color: var(--muted); background: none; border: none; border-bottom: 1px solid transparent; cursor: pointer; }
.speeds button[aria-pressed="true"] { color: var(--text); border-bottom-color: var(--text); }

.mark-row {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 11px 10px 11px 0;
  text-align: left; background: none; border: none; border-bottom: 1px solid var(--line-soft);
  cursor: pointer; font-size: 13px;
}
.mark-row:hover { background: var(--raise); }
.mark-row[aria-current="true"] { background: var(--pick-bg); }
.mark-row[disabled] { cursor: default; }
.mark-time {
  flex: none; width: 48px; font-size: 13px; font-weight: 600;
  color: var(--link); text-decoration: underline; text-underline-offset: 2px;
}
.mark-body { flex: 1; min-width: 0; }
.mark-name { font-weight: 500; }
.mark-id { margin-left: 8px; font-size: 11px; color: var(--faint); }
.mark-note { display: block; margin-top: 2px; color: var(--muted); }
.mark-st { flex: none; font-size: 12px; }

.dot { width: 6px; height: 6px; flex: none; border-radius: 50%; }
.dot.ok { background: var(--done); }
.dot.warn { background: var(--material); }
.dot.bad { background: var(--critical); }
.cblock { display: flex; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line-soft); }
.cblock .nm { flex: 1; font-size: 13px; color: var(--muted); }

/* Текст разговора: время · кто · реплика · номер замечания. Сотрудник — акцентом, его и оцениваем. */
.dialog { position: relative; max-height: 560px; overflow-y: auto; border-bottom: 1px solid var(--line); }
.line {
  display: grid; grid-template-columns: 44px 84px minmax(0, 1fr) auto; column-gap: 12px;
  padding: 6px 10px 6px 8px; border-left: 2px solid transparent; font-size: 13px;
}
.line.cont { padding-top: 0; }
.line[data-at] { cursor: pointer; }
.line[data-at]:hover { background: var(--raise); }
.line-time { padding-top: 1px; font-size: 11px; color: var(--faint); }
.line-who { padding-top: 1px; font-size: 12px; font-weight: 600; color: var(--muted); }
.line.employee .line-who { color: var(--text); font-weight: 700; }
.line-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.line.ctx { opacity: 0.55; }
.line.flag-bad { background: var(--critical-bg); }
.line.flag-part { background: var(--material-bg); }
.line-flag { padding-top: 2px; font-size: 11px; font-weight: 600; color: var(--critical); white-space: nowrap; }
.line.flag-part .line-flag { color: var(--material); }
.line.now { border-left-color: var(--pick-line); }
.line.now:not(.flag-bad):not(.flag-part) { background: var(--pick-bg); }
.line.flash { animation: flash 1.6s ease-out; }
@keyframes flash { from { box-shadow: inset 0 0 0 2px var(--pick-line); } to { box-shadow: inset 0 0 0 2px transparent; } }
.line-day { padding: 14px 0 6px 10px; font-size: 11px; color: var(--faint); }

/* Возражения: суть, что сказал кандидат, что ответил сотрудник, чем кончилось. */
.objection { padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.objection-top { display: flex; align-items: baseline; gap: 10px; }
.objection-topic { flex: 1; font-weight: 600; }
.objection-line { margin-top: 3px; }
.stamp {
  margin-right: 4px; padding: 0; font-size: 12px; font-weight: 600; color: var(--link);
  background: none; border: none; cursor: pointer;
}
.stamp:hover { text-decoration: underline; }

.issues { margin-top: 14px; }
.issues div { padding: 6px 0; font-size: 13px; border-bottom: 1px solid var(--line-soft); }

.verdict { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.verdict button { min-height: 40px; padding: 3px 10px; font-size: 14px; color: var(--text); background: none; border: 1px solid var(--control); border-radius: 3px; cursor: pointer; }
.verdict button[aria-pressed="true"] { font-weight: 600; background: var(--raise); border-color: var(--text); }
.verdict .said { font-size: 12px; color: var(--done); }

/* ── вход ──────────────────────────────────────────────────── */
.login { max-width: 360px; margin: 12vh auto 0; padding: 0 22px; }
.login .mark { width: 34px; height: 34px; font-size: 16px; }
.login h1 { margin-top: 18px; font-size: 24px; }
.login p { margin: 6px 0 22px; color: var(--muted); font-size: 13px; }
.login label { display: block; margin-top: 14px; font-size: 12px; color: var(--muted); }
.login input {
  display: block; width: 100%; height: 40px; margin-top: 5px; padding: 0 12px;
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--control); border-radius: 3px;
}
.login input:focus { outline: 2px solid var(--focus); outline-offset: 2px; }
.login .go {
  width: 100%; height: 42px; margin-top: 22px; font-weight: 600; font-size: 14px;
  color: var(--button-ink); background: var(--button); border: none; border-radius: 3px; cursor: pointer;
}
.login .go:hover { background: var(--button-over); }
.login .msg { margin-top: 14px; font-size: 13px; color: var(--critical); }
.login .msg.ok { color: var(--muted); }

/* Плеер остаётся на виду, пока читаешь текст разговора. На телефоне шапка выше и места мало — там не липнет. */
/* Закреплённый плеер не выше 64 px и стоит ниже общей навигации — он не должен закрывать
   ни элементы управления, ни цель перехода по таймкоду (ТЗ, раздел 6). */
@media (min-width: 901px) {
  .player { position: sticky; top: 56px; z-index: 5; max-height: 64px; padding: 8px 16px; overflow: hidden; }
  .player .speeds { margin-top: 2px; }
}

@media (max-width: 900px) {
  .line { grid-template-columns: 40px minmax(0, 1fr) auto; column-gap: 10px; }
  .line-who, .line-text { grid-column: 2; }
  .line-flag { grid-column: 3; grid-row: 1; }
  .line.cont .line-who { display: none; }
  .dialog { max-height: 70vh; }
  .top { padding: 8px 14px; gap: 8px; height: auto; flex-wrap: wrap; row-gap: 6px; }
  .periods { order: 10; width: 100%; overflow-x: auto; }
  .brand span, .who { display: none; }
  .wrap { padding: 18px 14px 40px; }
  .cols { flex-direction: column; gap: 26px; align-items: stretch; }
  .col-side { flex: 1 1 auto; width: 100%; }
  .figures { flex-wrap: wrap; }
  .figures > div { flex: 1 1 45%; padding: 12px 0; border-left: none; }
  .lede { font-size: 21px; }
  .head-line { flex-wrap: wrap; }
  .head-line h2 { white-space: nowrap; }
  .fold-body { padding-left: 0; }
  .strip { gap: 14px 22px; padding: 13px 14px; }
  .strip-num { font-size: 28px; }
  .score-col { width: auto; }
  .scores { margin-left: 0; }
  .scores > div:first-child { padding-left: 0; }
  .scores .main .score-num { font-size: 30px; }
  .hide-sm { display: none; }
  table { font-size: 12px; }
}

/* ═════════════════════════════════════════════════════════════
   Новый кабинет (методика 4.0, ТЗ 2.0). Всё ниже — новые классы или
   правила под body.v4: прежние классы архива не меняются.
   Размеры — ТЗ 2.0, раздел 6: текст 14–16 px, таблицы от 14, заголовки
   24–28, ширина до 1600, поля 24–32, строки списка 56–72, зоны нажатия ≥ 40.
   ═════════════════════════════════════════════════════════════ */

.chip-success { color: var(--success); background: var(--success-bg); }
.chip-info    { color: var(--info);    background: var(--info-bg); }
.chip-neutral { color: var(--neutral); background: var(--neutral-bg); }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.v4 { font-size: 15px; line-height: 1.5; }
.v4 .chip { font-size: 14px; white-space: normal; line-height: 1.35; padding: 2px 8px; align-items: baseline; }
.v4 .chip-sm { font-size: 13px; }
.v4 .strong { font-weight: 600; }
.tnum { font-variant-numeric: tabular-nums; }
.v4 .dim { color: var(--text-muted); }
.v4 .sep { color: var(--text-muted); }
.v4 .spacer { flex: 1 1 auto; }
.v4 .hint { margin: 10px 0 0; font-size: 13px; color: var(--text-muted); }
.v4 .hint a { display: inline-flex; align-items: center; min-height: 40px; }
.v4 .empty { padding: 28px 0; color: var(--text-muted); font-size: 15px; }
.v4 .loading { padding: 40px 0; color: var(--text-muted); }
.v4 .error-box { margin-top: 16px; padding: 14px 16px; background: var(--info-bg); color: var(--text); border-radius: 4px; }
.v4 .error-box p { margin: 0 0 10px; }

.skip-link { position: absolute; left: 8px; top: -60px; z-index: 50; padding: 10px 14px; background: var(--surface);
  color: var(--link); border: 2px solid var(--focus); }
.skip-link:focus { top: 8px; }

/* ── шапка ─────────────────────────────────────────────────── */
.app-head {
  display: flex; align-items: center; gap: 8px 12px; min-height: 56px; padding: 0 32px;
  background: var(--surface); border-bottom: 1px solid var(--divider); flex-wrap: wrap;
}
@media (min-width: 1024px) {
  .app-head { position: sticky; top: 0; z-index: 20; height: 56px; flex-wrap: nowrap; }
}
.app-brand { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; color: var(--text); text-decoration: none; }
.app-brand:hover .brand { text-decoration: underline; text-underline-offset: 3px; }
.app-brand .brand span { color: var(--text-muted); }
.app-nav { display: flex; align-self: stretch; gap: 4px; margin-left: 20px; }
.app-nav a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; font-size: 15px;
  color: var(--text-muted); text-decoration: none; border-bottom: 2px solid transparent;
}
.app-nav a:hover { color: var(--text); }
.app-nav a[aria-current="page"] { color: var(--text); font-weight: 600; border-bottom-color: var(--text); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 40px; min-height: 40px;
  padding: 0 10px; font: inherit; font-size: 14px; color: var(--text); background: transparent;
  border: 1px solid var(--control-border); border-radius: 4px; cursor: pointer;
}
.icon-btn:hover { background: var(--surface-subtle); }
.icon-btn svg { width: 18px; height: 18px; flex: none; }
.v4 .who { font-size: 14px; color: var(--text-muted); white-space: nowrap; }
.v4 .logout {
  min-height: 40px; padding: 0 6px; font: inherit; font-size: 14px; color: var(--link);
  background: none; border: none; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.menu { position: relative; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 270px; padding: 6px 0;
  background: var(--surface); border: 1px solid var(--control-border); border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.menu-list a { display: flex; align-items: center; min-height: 44px; padding: 0 16px; color: var(--text); text-decoration: none; font-size: 15px; }
.menu-list a:hover, .menu-list a:focus-visible { background: var(--surface-subtle); }
.menu-list a:focus-visible { outline-offset: -2px; }

/* ── строка фильтров ───────────────────────────────────────── */
.filters { padding: 10px 32px; background: var(--bg); border-bottom: 1px solid var(--divider); }
.filters-row, .filters-extra { max-width: 1536px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.filters-extra { padding-top: 10px; margin-top: 10px; border-top: 1px dashed var(--divider); }
.period-presets { display: flex; flex-wrap: wrap; gap: 2px; }
.period-presets button {
  min-height: 40px; padding: 0 12px; font: inherit; font-size: 14px; color: var(--text-muted);
  background: none; border: 1px solid transparent; border-radius: 4px; cursor: pointer;
}
.period-presets button:hover { color: var(--text); }
.period-presets button[aria-pressed="true"] { color: var(--text); font-weight: 600; background: var(--surface); border-color: var(--control-border); }
.period-dates { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--text-muted); }
.period-dates label { display: inline-flex; align-items: center; gap: 6px; }
.v4 input[type="date"], .v4 select, .v4 input[type="search"], .v4 textarea {
  min-height: 40px; padding: 0 10px; font: inherit; font-size: 14px; color: var(--text);
  background: var(--surface); border: 1px solid var(--control-border); border-radius: 4px;
}
.v4 textarea { padding: 8px 10px; }
.dates-note { font-size: 13px; color: var(--material); }
.dates-note:empty { display: none; }
.filter-field { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); }
.filter-search { position: relative; display: inline-flex; align-items: center; }
.filter-search svg { position: absolute; left: 10px; width: 16px; height: 16px; color: var(--text-muted); pointer-events: none; }
.v4 .filter-search input { width: 250px; padding-left: 34px; }
.count-badge {
  min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center; font-size: 13px; font-weight: 600;
  color: var(--primary-text); background: var(--primary); border-radius: 10px;
}

/* ── каркас экрана ─────────────────────────────────────────── */
.app-main { max-width: 1600px; margin: 0 auto; padding: 24px 32px 64px; outline: none; }
.screen-head, .person-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin: 4px 0 12px; }
.screen-head h1, .person-head h1, .card-head h1 { font-size: 26px; line-height: 1.25; overflow-wrap: anywhere; }
.screen-period { font-size: 14px; color: var(--text-muted); }
.screen-sub { font-size: 15px; color: var(--text-muted); }
.back-link { display: inline-flex; align-items: center; min-height: 40px; font-size: 14px; }
.section-head { margin: 28px 0 10px; font-size: 18px; line-height: 1.3; }
.sub-head { margin: 20px 0 8px; font-size: 15px; font-weight: 600; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px;
  font: inherit; font-size: 14px; color: var(--text); text-decoration: none; background: var(--surface);
  border: 1px solid var(--control-border); border-radius: 4px; cursor: pointer;
}
.btn:hover { background: var(--surface-subtle); }
.btn[disabled] { opacity: 0.55; cursor: default; }
.btn[disabled]:hover { background: var(--surface); }
.btn[aria-pressed="true"], .btn.is-current { color: var(--primary-text); background: var(--primary); border-color: var(--primary); font-weight: 600; }
.btn-strong { color: var(--primary-text); background: var(--primary); border-color: var(--primary); font-weight: 600; }
.btn-strong:hover { background: var(--primary-hover); }
.btn-quiet { border-color: transparent; background: none; color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.btn-quiet:hover { background: var(--surface-subtle); }
.linkish { min-height: 40px; padding: 0 4px; font: inherit; font-size: 14px; color: var(--link); background: none; border: none;
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.status-lines { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
.status-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; font-size: 14px; }
.inline-details { display: inline; font-size: 14px; }
.inline-details summary { color: var(--link); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; list-style: none; }
.inline-details summary::-webkit-details-marker { display: none; }
.inline-details[open] span { display: inline; margin-left: 6px; color: var(--text-muted); }
.note-box { margin: 14px 0; padding: 14px 16px; background: var(--surface-subtle); border: 1px solid var(--divider); border-radius: 4px; }
.note-box p { margin: 8px 0 0; }
.note-inline { margin: 8px 0 12px; padding: 8px 12px; font-size: 14px; color: var(--text); background: var(--neutral-bg); border-radius: 4px; }
.lead-line { margin: 0 0 8px; font-size: 15px; }
.facts { display: grid; grid-template-columns: minmax(140px, max-content) 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.facts dt { color: var(--text-muted); }
.facts dd { margin: 0; }
.facts-line { margin: 4px 0; font-size: 14px; }
.flash-msg { margin: 8px 0 12px; padding: 12px 16px; font-size: 15px; color: var(--text); background: var(--info-bg);
  border-left: 3px solid var(--info); border-radius: 0 4px 4px 0; outline: none; }
.done-mark { font-size: 14px; font-weight: 600; color: var(--success); white-space: nowrap; }
.state-note { font-size: 14px; color: var(--text-muted); white-space: nowrap; }
.state-note.is-open { color: var(--text); font-weight: 600; }

/* ── таблицы ───────────────────────────────────────────────── */
.v4 table { font-size: 15px; }
.v4 thead th {
  padding: 0 16px 8px 0; font-size: 14px; font-weight: 500; color: var(--text-muted); text-align: left;
  border-bottom: 1px solid var(--text); vertical-align: bottom;
}
.v4 thead tr { border-bottom: none; }
.v4 tbody th, .v4 tbody td, .v4 tfoot th, .v4 tfoot td {
  padding: 12px 16px 12px 0; font-size: 15px; color: var(--text); text-align: left; font-weight: 400;
  border-bottom: 1px solid var(--divider); vertical-align: middle;
}
.v4 th:last-child, .v4 td:last-child { padding-right: 0; }
.v4 tbody tr:hover td, .v4 tbody tr:hover th { background: none; }
.v4 .num { text-align: right; }
.th-note { display: block; font-size: 13px; font-weight: 400; color: var(--text-muted); }

.team-table { margin-top: 4px; }
.team-table tbody th, .team-table tbody td { height: 60px; }
.team-table tbody th { width: 38%; }
.team-table tbody th .chip { margin: 4px 0 0; }
.person-link { font-weight: 600; color: var(--text); text-decoration: underline; text-decoration-color: var(--control-border); text-underline-offset: 3px; overflow-wrap: anywhere; }
.person-link:hover { color: var(--link); text-decoration-color: currentColor; }
.count-link { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 16px; font-weight: 600; color: var(--link); }
.count-link.strong { font-size: 17px; }
.cell-note { display: block; margin-top: 2px; font-size: 13px; color: var(--text-muted); }
/* Зоны нажатия ≥ 40 px и у ссылок внутри таблиц и строк состояния. */
.team-table a, .plain-table a, .status-line a, .person-facts a, .facts-line a, .result-row a, .card-meta a {
  display: inline-flex; align-items: center; min-height: 40px;
}
.count-link { min-width: 40px; justify-content: flex-end; }
.person-facts a { min-width: 28px; justify-content: center; }
.note-box a, .service-links a, .status-line a { display: inline-flex; align-items: center; min-height: 40px; }
.inline-details summary { display: inline-flex; align-items: center; min-height: 40px; }
.team-table tfoot th, .team-table tfoot td { font-weight: 600; border-top: 1px solid var(--text); border-bottom: none; }
.team-table tfoot tr.unassigned th, .team-table tfoot tr.unassigned td { font-weight: 400; border-top: 1px solid var(--divider); }
@media (min-width: 1024px) {
  .team-table thead th { position: sticky; top: 56px; z-index: 4; padding-top: 8px; background: var(--bg); }
}

.plain-table { margin-top: 8px; }
.table-scroll { max-width: 100%; overflow-x: auto; }
.table-scroll > table { min-width: 100%; }
@media (max-width: 760px) {
  .table-scroll > .blocks-table { min-width: 560px; }
  .table-scroll > .plain-table td, .table-scroll > .plain-table th { white-space: normal; }
}
.plain-table tbody th { font-weight: 500; }
.bar { display: inline-block; width: 120px; height: 8px; margin-right: 10px; vertical-align: middle; background: var(--surface-subtle); }
.bar i { display: block; height: 8px; background: var(--neutral); }

/* ── рекрутер: наблюдения ──────────────────────────────────── */
.person-facts { margin: 0; font-size: 15px; }
.person-facts a { font-weight: 600; }
.attention { margin-top: 8px; }
.obs-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--divider); }
.obs {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; min-height: 52px; padding: 10px 4px;
  color: var(--text); text-decoration: none; border-bottom: 1px solid var(--divider);
}
.obs:hover { background: var(--surface-subtle); }
.obs-title { flex: 1 1 260px; font-size: 15px; font-weight: 500; }
.obs-count { font-size: 15px; font-weight: 600; color: var(--link); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.obs-count::after { content: ' →'; }
.obs-empty { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; margin: 0; font-size: 15px; }
.details-fold { margin-top: 32px; }
.v4 .fold summary { min-height: 44px; align-items: center; }
.v4 .fold-title { font-size: 16px; }
.v4 .fold-note { font-size: 14px; }
.v4 .fold-body { padding: 4px 0 18px 23px; }
.blocks-table td, .blocks-table th { font-size: 14px; }

/* ── список контактов ──────────────────────────────────────── */
.list-section { margin-top: 8px; scroll-margin-top: 72px; }
.list-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 0 12px; }
.seg { display: inline-flex; border: 1px solid var(--control-border); border-radius: 4px; overflow: hidden; }
.seg button {
  min-height: 40px; padding: 0 14px; font: inherit; font-size: 14px; color: var(--text); background: var(--surface);
  border: none; border-left: 1px solid var(--control-border); cursor: pointer;
}
.seg button:first-child { border-left: none; }
.seg button:hover { background: var(--surface-subtle); }
.seg button[aria-pressed="true"] { color: var(--primary-text); background: var(--primary); font-weight: 600; }
.seg button:focus-visible { outline-offset: -4px; }
.seg-count { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13px; color: var(--text-muted); }
[aria-pressed="true"] > .seg-count { color: inherit; }
.toggle {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; font: inherit; font-size: 14px;
  color: var(--text); background: var(--surface); border: 1px solid var(--control-border); border-radius: 4px; cursor: pointer;
}
.toggle-box { width: 18px; height: 18px; display: grid; place-items: center; font-size: 13px; border: 1px solid var(--control-border); border-radius: 3px; }
.toggle[aria-pressed="true"] { font-weight: 600; border-color: var(--text); }
.toggle[aria-pressed="true"] .toggle-box { color: var(--primary-text); background: var(--primary); border-color: var(--primary); }
.field-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 2px; min-height: 36px; padding: 0 2px 0 12px; font-size: 14px;
  background: var(--surface); border: 1px solid var(--control-border); border-radius: 18px;
}
.filter-chip button { width: 36px; height: 36px; font-size: 14px; color: var(--text-muted); background: none; border: none; border-radius: 50%; cursor: pointer; }
.filter-chip button:hover { color: var(--text); background: var(--surface-subtle); }

.list-table { table-layout: fixed; }
.list-table th:nth-child(1) { width: 32%; }
.list-table th:nth-child(2) { width: 124px; }
.list-table th:nth-child(3) { width: 21%; }
.c-row { cursor: pointer; }
.v4 .c-row td { height: 60px; padding-top: 8px; padding-bottom: 8px; font-size: 14px; }
.v4 .c-row:hover td { background: var(--surface-subtle); }
.c-row.is-unread .c-name { font-weight: 700; }
.c-name {
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
  font-weight: 600; color: var(--text); text-decoration: underline; text-decoration-color: var(--divider); text-underline-offset: 3px;
}
.c-name:hover { color: var(--link); text-decoration-color: currentColor; }
.c-meta { display: block; margin-top: 1px; font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-when { font-size: 14px; }
.c-meta .mono, .card-meta .mono { white-space: nowrap; }
.c-when .mono, .c-when .tnum { display: block; }
.reason { display: flex; flex-direction: column; gap: 3px; }
.reason-kind { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.reason-title { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; }
.more { color: var(--text-muted); }
.unread { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--info); white-space: nowrap; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--info); }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 16px; }
.pager-info { font-size: 14px; color: var(--text-muted); }
.pager-pages { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pager-pages .btn { min-width: 40px; padding: 0 10px; }
.pager-size { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); margin-left: auto; }

/* ── карточка контакта ─────────────────────────────────────── */
.card-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 4px; }
.card-pos { font-size: 14px; color: var(--text-muted); }
.card-head { margin: 4px 0 8px; }
.card-meta { margin: 6px 0 0; font-size: 15px; line-height: 1.6; }
.card-meta svg { width: 14px; height: 14px; vertical-align: -1px; }
.card-cc { margin: 6px 0 0; font-size: 14px; }
.result-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 6px 16px; padding: 12px 0; border-top: 1px solid var(--divider); }
.row-label { font-size: 14px; font-weight: 600; color: var(--text-muted); padding-top: 2px; }
.result-body { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.result-summary { font-size: 15px; }
.result-basis { font-size: 14px; }
.result-ev { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.card-attention { padding-top: 4px; border-top: 1px solid var(--divider); }
.card-attention .section-head { margin-top: 16px; }
.episodes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.episode {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; width: 100%; min-height: 48px; padding: 8px 12px;
  font: inherit; color: var(--text); text-align: left; background: var(--surface); border: 1px solid var(--divider);
  border-radius: 4px; cursor: pointer;
}
.episode:hover { border-color: var(--control-border); }
.episode[aria-pressed="true"] { background: var(--selected-bg); border-color: var(--selected-border); box-shadow: inset 4px 0 0 var(--selected-border); }
.episode-title { flex: 1 1 240px; font-size: 15px; font-weight: 500; }
.review-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; font-size: 14px; }
/* Звонок колл-центра: причины разбора КЦ списком (не кнопками-эпизодами) и заметная ссылка в архив. */
.op-reasons { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.op-reason {
  display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; background: var(--surface);
  border: 1px solid var(--divider); border-radius: 4px;
}
.op-reason-kind { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.op-reason-title { font-size: 15px; overflow-wrap: anywhere; }
.note-box a.archive-link { margin-top: 4px; text-decoration: none; }
.history-rev { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.decide-msg { margin: 6px 0 0; font-size: 14px; color: var(--text-muted); }
.decide-msg:empty { display: none; }

.card-body { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 28px; align-items: start; margin-top: 20px; }
.card-tabs { display: none; }
.pane-dialog {
  position: sticky; top: 68px; display: flex; flex-direction: column; min-width: 0;
  /* Не выше, чем помещается между шапкой (68) и нижним полем страницы (64): иначе в конце прокрутки
     колонка уезжает под шапку и та закрывает плеер. */
  height: calc(100vh - 140px); min-height: 380px;
}
.pane-review { min-width: 0; }
.talk-note { margin: 6px 0 0; font-size: 13px; }
.talk {
  flex: 1 1 auto; min-height: 180px; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--divider); border-radius: 0 0 4px 4px;
}
.talk:first-child { border-radius: 4px; }
.t-line {
  display: grid; grid-template-columns: 50px 96px minmax(0, 1fr) 18px; column-gap: 10px; padding: 7px 10px 7px 9px;
  font-size: 15px; line-height: 1.45; border-left: 3px solid transparent;
}
.t-line[data-at] { cursor: pointer; }
.t-line[data-at]:hover { background: var(--surface-subtle); }
.t-time { padding-top: 2px; font-size: 13px; color: var(--text-muted); }
.t-who { padding-top: 1px; font-size: 14px; font-weight: 600; color: var(--text-muted); overflow-wrap: anywhere; }
.t-employee .t-who { color: var(--text); font-weight: 700; }
.t-other .t-who { font-style: italic; }
.t-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.t-mark { padding-top: 2px; font-size: 13px; color: var(--text-muted); text-align: center; }
.t-line.is-context .t-text { color: var(--text-muted); }
.t-line.is-selected { background: var(--selected-bg); border-left-color: var(--selected-border); }
.t-line.is-selected .t-mark { color: var(--selected-border); }
.t-line.is-now { border-left-color: var(--text); }
.t-line.is-now .t-time { color: var(--text); font-weight: 700; }
.t-line.flash { animation: v4flash 1.6s ease-out; }
@keyframes v4flash { from { box-shadow: inset 0 0 0 2px var(--selected-border); } to { box-shadow: inset 0 0 0 2px transparent; } }
.t-day { padding: 12px 10px 4px; font-size: 13px; font-weight: 600; color: var(--text-muted); border-top: 1px dashed var(--divider); }
.t-day:first-child { border-top: none; }
.attach { display: inline-block; margin-right: 4px; padding: 0 6px; font-size: 13px; border: 1px dashed var(--control-border); border-radius: 3px; }

.ev-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.ev {
  display: flex; align-items: baseline; gap: 10px; width: 100%; min-height: 40px; padding: 8px 10px;
  font: inherit; font-size: 14px; color: var(--text); text-align: left; background: var(--surface);
  border: 1px solid var(--divider); border-left: 3px solid var(--link); border-radius: 0 4px 4px 0; cursor: pointer;
}
.ev:hover { background: var(--surface-subtle); }
.ev-static { cursor: default; border-left-color: var(--divider); }
.ev-where { flex: none; font-size: 13px; font-weight: 600; color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.ev-static .ev-where { color: var(--text-muted); text-decoration: none; font-weight: 400; }
.ev-text { min-width: 0; overflow-wrap: anywhere; }
.ev-note { display: block; font-size: 13px; color: var(--text-muted); }

.episode-view { padding-bottom: 8px; }
.episode-kind { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin: 0 0 6px; }
.episode-head { margin: 0 0 8px; font-size: 20px; line-height: 1.3; outline: none; }
.finding { padding: 14px 0; border-top: 1px solid var(--divider); }
.finding-head { font-size: 16px; line-height: 1.35; }
.finding-kind { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin: 6px 0; font-size: 14px; }
.finding-detail { margin: 6px 0; font-size: 15px; }
.finding-follow { margin: 6px 0; font-size: 14px; }
.finding.is-rejected .finding-head, .finding.is-rejected .finding-detail { color: var(--text-muted); }
.decide { margin-top: 10px; }
.decide-state { margin: 0 0 8px; font-size: 14px; }
.decide-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.reject-form { margin-top: 10px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--control-border); border-radius: 4px; }
.reject-form fieldset { margin: 0; padding: 0; border: none; }
.reject-form legend { padding: 0; font-size: 14px; font-weight: 600; }
.reject-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px; margin-top: 6px; }
.radio { display: flex; align-items: center; gap: 8px; min-height: 40px; font-size: 14px; cursor: pointer; }
.radio input { width: 18px; height: 18px; accent-color: var(--primary); }
.comment { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; font-size: 14px; }
.comment textarea { width: 100%; resize: vertical; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.topic { padding: 12px 0; border-top: 1px solid var(--divider); }
.topic-head { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.topic-facts { grid-template-columns: minmax(150px, max-content) 1fr; }
.block-list { list-style: none; margin: 0; padding: 0; }
.block-item { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--divider); }
.block-status { flex: 0 0 176px; }
.block-body { min-width: 0; }
.block-name { font-weight: 500; }
.block-reason { display: block; font-size: 14px; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { padding: 6px 0; font-size: 14px; border-bottom: 1px solid var(--divider); }
.history-fold, .blocks-fold { margin-top: 14px; }

/* ── плеер ─────────────────────────────────────────────────── */
/* Закреплён над текстом (колонка карточки держится на экране), не выше 64 px, текст разговора и кнопки
   под ним не перекрывает — у текста своя прокрутка ниже плеера. */
.player-v4 {
  display: flex; align-items: center; gap: 8px 12px; flex: none; max-height: 64px; padding: 8px 10px;
  background: var(--surface-subtle); border: 1px solid var(--divider); border-bottom: none; border-radius: 4px 4px 0 0;
}
.p-controls { display: flex; align-items: center; gap: 4px; flex: none; }
.p-btn, .p-play {
  position: relative; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; color: var(--text);
  background: var(--surface); border: 1px solid var(--control-border); border-radius: 50%; cursor: pointer;
}
.p-btn svg { width: 22px; height: 22px; }
.p-btn-num { position: absolute; font-size: 9px; font-weight: 700; line-height: 1; }
.p-play { color: var(--primary-text); background: var(--primary); border-color: var(--primary); }
.p-play svg { width: 18px; height: 18px; }
.p-play[disabled] { opacity: 0.5; cursor: default; }
.p-track { position: relative; flex: 1 1 160px; min-width: 120px; height: 44px; display: flex; align-items: flex-end; }
.p-track input[type="range"] { width: 100%; height: 32px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.p-ticks { position: absolute; left: 7px; right: 7px; top: 0; height: 16px; pointer-events: none; }
.p-tick {
  position: absolute; top: 0; width: 24px; height: 16px; margin-left: -12px; padding: 0; background: none; border: none;
  pointer-events: auto; cursor: pointer;
}
.p-tick i { display: block; width: 4px; height: 14px; margin: 1px auto 0; background: var(--neutral); border-radius: 1px; }
.p-tick.is-selected i { width: 6px; background: var(--selected-border); }
.p-clock { flex: none; font-size: 14px; white-space: nowrap; }
.p-rate select { min-height: 40px; padding: 0 6px; }
.p-now { flex: none; min-height: 40px; }
.p-now-short { display: none; }
.p-note { font-size: 13px; color: var(--text-muted); }
.p-note:empty { display: none; }

/* ── адаптив ───────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .app-head, .filters { padding-left: 24px; padding-right: 24px; }
  .app-main { padding-left: 24px; padding-right: 24px; }
}
/* До 1024 px карточка — вкладками «Разбор / Диалог». */
@media (max-width: 1023px) {
  .card-body { display: block; }
  .card-tabs {
    display: flex; gap: 4px; position: sticky; top: 0; z-index: 6; margin: 0 0 12px;
    background: var(--bg); border-bottom: 1px solid var(--divider);
  }
  .card-tabs button {
    min-height: 44px; padding: 0 16px; font: inherit; font-size: 15px; color: var(--text-muted); background: none;
    border: none; border-bottom: 3px solid transparent; cursor: pointer;
  }
  .card-tabs button[aria-selected="true"] { color: var(--text); font-weight: 600; border-bottom-color: var(--text); }
  .card-body[data-tab="review"] .pane-dialog { display: none; }
  .card-body[data-tab="dialog"] .pane-review { display: none; }
  .pane-dialog { position: static; height: calc(100vh - 64px); height: calc(100dvh - 64px); scroll-margin-top: 52px; }
  .pane-review { scroll-margin-top: 52px; }
  .app-nav { margin-left: 8px; }
}
@media (max-width: 760px) {
  .app-head { padding: 8px 16px; gap: 6px 8px; }
  .app-nav { order: 10; width: 100%; margin: 0; }
  .app-nav a { padding: 0 10px; }
  .icon-btn-label, .v4 .who, .app-brand .brand span { display: none; }
  .filters { padding: 10px 16px; }
  .app-main { padding: 16px 16px 48px; }
  .screen-head h1, .person-head h1, .card-head h1 { font-size: 24px; }
  .filter-search { flex: 1 1 150px; }
  .v4 .filter-search input { width: 100%; }
  .filters-more-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .period-dates input[type="date"] { max-width: 150px; }
  .filters-extra .filter-field { flex: 1 1 100%; justify-content: space-between; }
  .result-row { grid-template-columns: 1fr; }
  .facts, .topic-facts { grid-template-columns: 1fr; gap: 0 16px; }
  .facts dd { margin-bottom: 6px; }
  .reject-options { grid-template-columns: 1fr; }
  .block-item { flex-direction: column; gap: 4px; }
  .block-status { flex: none; }
  .v4 .fold-body { padding-left: 0; }
  .pager-size { margin-left: 0; }
  .t-line { grid-template-columns: 44px minmax(0, 1fr) 16px; column-gap: 8px; }
  .t-line .t-time { grid-row: 1 / span 2; }
  .t-line .t-who { grid-column: 2; }
  .t-line .t-text { grid-column: 2; }
  .t-line .t-mark { grid-column: 3; grid-row: 1; }

  /* Команда карточками: имя, затем объём, переходы и «нужно разобрать» с подписями. */
  .team-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .team-table, .team-table tbody, .team-table tfoot { display: block; }
  .team-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--divider); }
  .team-table tbody th, .team-table tbody td, .team-table tfoot th, .team-table tfoot td { display: block; height: auto; padding: 0; border: none; text-align: left; width: auto; }
  .team-table th[scope="row"] { grid-column: 1 / -1; }
  .team-table td::before { content: attr(data-label); display: block; font-size: 13px; font-weight: 400; color: var(--text-muted); }
  .team-table td[data-label=""]::before { display: none; }
  .team-table td:first-of-type { grid-column: 1 / -1; }
  .team-table tfoot tr { border-top: 1px solid var(--text); border-bottom: none; }

  /* Список карточками: имя, результат, причина. */
  .list-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .list-table, .list-table tbody { display: block; }
  .list-table tr.c-row {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main when" "result result" "reason reason";
    gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--divider);
  }
  .list-table tr.c-row td { display: block; height: auto; padding: 0; border: none; }
  .c-main { grid-area: main; }
  .c-when { grid-area: when; text-align: right; font-size: 13px; }
  .c-result { grid-area: result; }
  .c-reason { grid-area: reason; }
  .c-meta { white-space: normal; }
  .c-name, .reason-title { -webkit-line-clamp: 3; }
  .list-tools .spacer { display: none; }

  /* Плеер на телефоне — две строки, не выше 88 px. */
  .player-v4 { flex-wrap: wrap; max-height: 88px; padding: 6px 8px; row-gap: 2px; }
  .p-track { order: 5; flex: 1 1 100%; height: 30px; }
  .p-track input[type="range"] { height: 20px; }
  .p-ticks { height: 12px; }
  .p-tick { height: 12px; }
  .p-tick i { height: 10px; }
  .p-clock { margin-left: auto; }
  .player-v4.is-away .p-clock { display: none; }
  .p-now-long { display: none; }
  .p-now-short { display: inline; }
  .p-note { order: 6; flex: 1 1 100%; }
}
@media (max-width: 420px) {
  .period-presets button { padding: 0 9px; }
  .seg button { padding: 0 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .v4 *, .v4 *::before, .v4 *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
}

/* ── страница «Доступ» (/admin) ────────────────────────────── */
.access-main { max-width: 1280px; }
.access-lead { margin: 0 0 16px; max-width: 760px; font-size: 15px; color: var(--text-muted); }
.flash-bad { background: var(--critical-bg); border-left-color: var(--critical); }
.access-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 20px 0 4px; }
.access-toolbar .btn svg { width: 16px; height: 16px; }
.access-check { font-size: 14px; color: var(--text-muted); }
.access-table th[scope="row"] { min-width: 180px; }
.access-table td, .access-table th { vertical-align: top; }
.access-name { font-weight: 600; margin-right: 6px; overflow-wrap: anywhere; }
.access-table .chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.access-table .cell-line { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.access-table .linkish { min-height: 32px; padding: 0; font-size: 13px; }
.cell-note.is-bad { color: var(--critical); }
.access-actions { width: 1%; white-space: nowrap; text-align: right; }

.access-requests { margin: 8px 0 4px; padding: 4px 16px 12px; background: var(--info-bg); border-radius: 4px; }
.access-requests .section-head { margin-top: 12px; }
.request-list { list-style: none; margin: 0; padding: 0; }
.request-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 8px 0;
  border-top: 1px solid var(--divider); font-size: 15px; }
.request-row:first-child { border-top: none; }
.request-who { overflow-wrap: anywhere; }

.handoff { margin: 12px 0; padding: 14px 16px; background: var(--success-bg); border-left: 3px solid var(--success);
  border-radius: 0 4px 4px 0; }
.handoff-title { margin: 0 0 10px; font-weight: 600; }
.handoff-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 12px; font-size: 15px; }
.handoff-facts dt { color: var(--text-muted); }
.handoff-facts dd { margin: 0; overflow-wrap: anywhere; user-select: all; }
.handoff-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }

.access-log { margin-top: 32px; }
.log-list { list-style: none; margin: 0; padding: 0 0 12px; }
.log-list li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 2px 14px; padding: 8px 0;
  border-bottom: 1px solid var(--divider-soft); font-size: 14px; }
.log-detail { grid-column: 2; color: var(--text-muted); overflow-wrap: anywhere; }

.btn-danger { color: var(--critical); border-color: var(--critical); }
.btn-danger:hover { background: var(--critical-bg); }

/* Окно правки: на широком экране — по центру, на телефоне — во весь экран. */
.sheet { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; color: var(--text);
  background: var(--surface); border: 1px solid var(--control-border); border-radius: 6px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25); }
.sheet::backdrop { background: rgba(20, 22, 24, 0.45); }
.sheet-form { display: flex; flex-direction: column; max-height: calc(100vh - 50px); }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--divider); }
.sheet-head h2 { flex: 1; font-size: 19px; overflow-wrap: anywhere; }
.sheet-body { padding: 8px 20px 16px; overflow-y: auto; }
.sheet-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 20px;
  border-top: 1px solid var(--divider); background: var(--surface); }
.sheet-foot .spacer { flex: 1 1 auto; }
.form-row { margin: 12px 0 0; }
.form-label { display: block; margin-bottom: 4px; font-size: 14px; font-weight: 500; }
.form-input { width: 100%; min-height: 40px; padding: 0 10px; font: inherit; font-size: 15px; color: var(--text);
  background: var(--surface); border: 1px solid var(--control-border); border-radius: 4px; }
.form-input.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 14px; }
.form-group { margin: 18px 0 0; padding: 0; border: none; }
.form-group legend { padding: 0; margin-bottom: 4px; font-size: 15px; font-weight: 600; }
.form-note { margin: 6px 0 0; font-size: 13px; color: var(--text-muted); }
.form-error { margin: 16px 0 0; padding: 10px 12px; font-size: 14px; color: var(--critical); background: var(--critical-bg);
  border-radius: 4px; }
.choice { display: flex; align-items: flex-start; gap: 10px; min-height: 40px; padding: 6px 0; cursor: pointer; font-size: 15px; }
.choice input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--primary); }
.choice b { font-weight: 500; }
.choice-hint { display: block; font-size: 13px; color: var(--text-muted); }
.choice-inline { margin-top: 8px; }
.choice input:disabled + span { opacity: 0.6; }
.password-row { display: flex; flex-wrap: wrap; gap: 8px; }
.password-row .form-input { flex: 1 1 220px; width: auto; }

@media (max-width: 760px) {
  /* Таблица людей — карточками: подпись столбца над значением. */
  .access-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .access-table, .access-table tbody, .access-table tr, .access-table th, .access-table td { display: block; width: auto; }
  .access-table tr { padding: 12px 0; border-bottom: 1px solid var(--divider); }
  .v4 .access-table tbody th, .v4 .access-table tbody td { padding: 4px 0; border-bottom: none; }
  .access-table td[data-label]::before { content: attr(data-label); display: block; font-size: 13px; color: var(--text-muted); }
  .access-actions { width: auto; text-align: left; padding-top: 8px !important; }
  .log-list li { grid-template-columns: 1fr; }
  .log-detail { grid-column: 1; }
  .sheet { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .sheet-form { height: 100%; max-height: 100dvh; }
  .sheet-body { flex: 1 1 auto; }
}
