/* Рабочее место руководителя — дизайн-система «Диспетчерская», продуктовая сборка.
   Токены + блоки по БЭМ: block__element--modifier.
   Источник визуала — ds.css холста; превью-разделы холста (.doc*, .swatch*, .vig*, .map-row, .code) исключены.
   Изменения относительно холста: ссылки с классом не получают стиль .ds a (правило сужено до a:not([class])),
   остальные дополнения собраны в конце файла в разделах «ПРОДУКТОВЫЕ ДОПОЛНЕНИЯ» и «АДАПТАЦИЯ». */

/* Шрифт Onest (SIL OFL 1.1) — локальные файлы static/ds/fonts/, без CDN. */
@font-face { font-family: "Onest"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/onest-400.woff2") format("woff2"); }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/onest-500.woff2") format("woff2"); }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/onest-600.woff2") format("woff2"); }


:root {
  /* Отступы безопасной области (вырез, строка состояния, «домашняя черта») — единственное
     место, где читается env(); слои берут --safe-*: нужны при viewport-fit=cover. */
  --safe-top: env(safe-area-inset-top, 0px); --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px); --safe-left: env(safe-area-inset-left, 0px);
  --font: "Onest", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;

  /* Шкалы по 12 ступеней (spec.md §3.1). Роли ступеней: 1 фон приложения, 2 фон панели, 3 фон элемента и тихой
     метки, 4 наведение/выбранное, 5 нажато, 6 разделитель, 7 граница не управляющая, 8 граница поля, 9 заливка,
     10 наведение заливки, 11 цветной текст, 12 тёмный текст. Красная шкала --r-N не пересекается с радиусами --r-xs…pill. */
  --n-1: #fcfcfd; --n-2: #f7f8f9; --n-3: #eff0f2; --n-4: #e6e8ea; --n-5: #dddfe2; --n-6: #d1d4d7;
  --n-7: #c1c4c9; --n-8: #8b8f97; --n-9: #6e757f; --n-10: #606671; --n-11: #545b66; --n-12: #1a2029;
  --c-1: #fbfcff; --c-2: #f5f8fe; --c-3: #eaf0fe; --c-4: #dde8fe; --c-5: #d0dffe; --c-6: #c0d4fe;
  --c-7: #a8c4fe; --c-8: #82a8fe; --c-9: #315dd4; --c-10: #244dc3; --c-11: #2f57bf; --c-12: #14295f;
  --a-1: #fffcf9; --a-2: #fef6ee; --a-3: #ffedda; --a-4: #fee3c5; --a-5: #fed7ab; --a-6: #f9ca94;
  --a-7: #f0b877; --a-8: #de9b46; --a-9: #fea92f; --a-10: #ed990e; --a-11: #915c08; --a-12: #482c01;
  --r-1: #fffcfb; --r-2: #fff5f4; --r-3: #feebe8; --r-4: #fee0dc; --r-5: #fed3cd; --r-6: #ffc3bb;
  --r-7: #feaba1; --r-8: #fc8175; --r-9: #cc3430; --r-10: #ba1e20; --r-11: #b32e2a; --r-12: #551915;
  --g-1: #f7fff9; --g-2: #eefcf2; --g-3: #e0f7e7; --g-4: #d1f1db; --g-5: #c1ebce; --g-6: #afe2bf;
  --g-7: #98d5ac; --g-8: #72be8e; --g-9: #14874e; --g-10: #057743; --g-11: #1a7244; --g-12: #0f3620;
  --v-1: #fcfcfe; --v-2: #f8f7ff; --v-3: #f0eefe; --v-4: #e8e4ff; --v-5: #dfd9ff; --v-6: #d4ccff;
  --v-7: #c5b9ff; --v-8: #ad98ff; --v-9: #7550d1; --v-10: #6740c0; --v-11: #6946bf; --v-12: #30205b;

  --shell: var(--n-2);
  --bg: var(--n-2);
  --surface: #ffffff;
  --surface-2: var(--n-2);
  --surface-3: var(--n-3);
  --line: var(--n-6);
  --line-2: var(--n-7);
  --ink: var(--n-12);
  --ink-2: var(--n-11);
  --ink-3: var(--n-11);
  --ink-inv: #ffffff;

  --accent: var(--c-9);
  --accent-hover: var(--c-10);
  --accent-soft: var(--c-3);
  --accent-wash: var(--c-2);
  --accent-line: var(--c-7);
  --wait: var(--a-11);
  --wait-soft: var(--a-3);
  --wait-line: var(--a-7);
  --risk: var(--r-11);
  --risk-soft: var(--r-3);
  --risk-line: var(--r-7);
  --done: var(--g-11);
  --done-soft: var(--g-3);
  --done-line: var(--g-7);
  --model: var(--v-11);
  --model-soft: var(--v-3);
  --model-line: var(--v-7);
  --focus: var(--c-9);
  --line-control: var(--n-8);
  --tag-gray: var(--n-9); --tag-blue: var(--c-9); --tag-amber: var(--a-10); --tag-red: var(--r-9); --tag-green: var(--g-9); --tag-violet: var(--v-9);
  --st-new: var(--ink-3);
  --st-new-soft: var(--surface);
  --st-todo: var(--ink-2);
  --st-todo-soft: var(--surface-3);
  --st-doing: var(--accent);
  --st-doing-soft: var(--accent-soft);
  --st-wait: var(--wait);
  --st-wait-soft: var(--wait-soft);
  --st-later: var(--ink-3);
  --st-later-soft: var(--surface-2);
  --st-done: var(--done);
  --st-done-soft: var(--done-soft);
  --scrim: rgba(22, 27, 38, 0.38);

  /* Шрифтовые роли (spec.md §3.2; шкала карточки v5 — TOKENS.md «Типографика»): вес размер/строка;
     трекинг — отдельным токеном. Табличные цифры шорткат font не задаёт: время и мета (--t-small)
     ставят font-variant-numeric: tabular-nums рядом. */
  --t-case: 600 26px/32px var(--font);
  --t-case-track: -0.022em;
  --t-screen: 600 24px/32px var(--font);
  --t-title: 600 20px/28px var(--font);
  --t-head: 600 16px/24px var(--font);
  --t-head-track: -0.005em;
  --t-strong: 500 14px/20px var(--font);
  --t-body: 400 14px/20px var(--font);
  --t-read: 400 15px/23px var(--font);
  --t-meta: 400 13px/18px var(--font);
  --t-small: 400 12px/16px var(--font);
  --t-tight: -0.01em;

  --dur-micro: 80ms;
  --dur-fast: 120ms;
  --dur-panel: 180ms;
  --dur-sheet: 240ms;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px;
  --r-xs: 6px; --r-s: 8px; --r-m: 12px; --r-l: 16px; --r-pill: 999px;
  --e-1: 0 1px 2px rgba(22, 27, 38, 0.06);
  --e-raised: 0 1px 2px rgb(26 32 41 / 0.06), 0 4px 12px -4px rgb(26 32 41 / 0.10);
  --e-pop: 0 1px 2px rgba(22, 27, 38, 0.06), 0 12px 32px -8px rgba(22, 27, 38, 0.18);
  --e-dialog: 0 2px 6px rgba(22, 27, 38, 0.08), 0 32px 64px -16px rgba(22, 27, 38, 0.34);
  --h-s: 32px;
  --h-m: 36px;
  --h-control: var(--h-m);
  --h-touch: 44px;
}
/* Chrome на iPhone, по снимку владельца, отдаёт отступ ≈91 px (панель браузера + черта);
   проверено эмуляцией отступа, не на устройстве. Страница уже кончается над панелью, поэтому
   отступ больше 40 px (черта — 34, альбом — 21) слоям у нижнего края не нужен: --safe-bottom = 0.
   Без sign() остаётся env() как есть. safeBox в ds.js читает вычисленный padding, не это свойство. */
@supports (width: calc(sign(1px) * 1px)) {
  :root { --safe-bottom: calc(env(safe-area-inset-bottom, 0px) * (1 - max(0, sign(env(safe-area-inset-bottom, 0px) - 40px)))); }
}

/* ---------- база ---------- */
.ds, .ds * { box-sizing: border-box; }
.ds { font-family: var(--font); font-size: 14px; line-height: 20px; color: var(--ink); background: var(--shell); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
.ds p { margin: 0; }
.ds a:not([class]) { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.ds a:not([class]):hover { color: var(--accent-hover); }
.ds :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.tnum { font-variant-numeric: tabular-nums; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--ink-3); }
.soft { color: var(--ink-2); }

/* типографика */
.text-display { font-size: 26px; line-height: 32px; font-weight: 600; letter-spacing: -0.015em; }
.text-title { font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -0.01em; }
.text-head { font-size: 16px; line-height: 22px; font-weight: 600; }
.text-body { font-size: 15px; line-height: 23px; }
.text-ui { font-size: 14px; line-height: 20px; }
.text-meta { font-size: 13px; line-height: 18px; color: var(--ink-2); }
.text-small { font-size: 12px; line-height: 16px; color: var(--ink-3); }

/* ---------- icon ---------- */
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 16px; height: 16px; }
.icon--xs { width: 14px; height: 14px; }
.icon--lg { width: 22px; height: 22px; }
.mark { width: 12px; height: 12px; flex: none; }

/* ---------- kbd ---------- */
.kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; font-size: 11px; line-height: 1; font-weight: 600; color: var(--ink-3); background: var(--surface); border: 1px solid var(--line-2); border-radius: 5px; box-shadow: 0 1px 0 var(--line-2); }
.kbd--on-accent { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.35); box-shadow: none; color: rgba(255, 255, 255, 0.9); }

/* ---------- btn ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h-control); padding: 0 14px; font: inherit; font-size: 14px; font-weight: 500; white-space: nowrap; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-s); cursor: pointer; }
.btn:hover { background: var(--surface-2); }
.btn--primary { color: var(--ink-inv); background: var(--accent); border-color: var(--accent); box-shadow: none; }
.btn--primary:hover { background: var(--accent-hover); }
.btn--ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); padding: 0 10px; }
.btn--ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn--danger { color: var(--risk); border-color: var(--risk-line); }
.btn--block { width: 100%; }
.btn--touch { height: var(--h-touch); font-size: 15px; padding: 0 18px; }
.btn--icon { width: var(--h-control); padding: 0; }
.btn--disabled { color: var(--ink-3); background: var(--surface-3); border-color: var(--line); box-shadow: none; cursor: not-allowed; }
.btn__kbd { margin-left: 4px; }

/* ---------- chip ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap; color: var(--ink-2); background: var(--surface-3); border: 1px solid transparent; border-radius: var(--r-xs); }
.chip .icon { width: 14px; height: 14px; }
.chip--mine { color: var(--accent); background: var(--accent-soft); }
.chip--wait { color: var(--wait); background: var(--wait-soft); }
.chip--risk { color: var(--risk); background: var(--risk-soft); }
.chip--done { color: var(--done); background: var(--done-soft); }
.chip--model { color: var(--model); background: transparent; border: 1px dashed var(--model-line); }
.chip--unknown { color: var(--ink-3); background: transparent; border: 1px dashed var(--line-2); }
.chip--person { padding-left: 3px; }

/* ---------- avatar ---------- */
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 18px; height: 18px; border-radius: var(--r-pill); font-size: 9px; line-height: 1; font-weight: 600; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line-2); }
.avatar--md { width: 24px; height: 24px; font-size: 10px; }
.avatar--lg { width: 32px; height: 32px; font-size: 12px; }
.avatar--unknown { border-style: dashed; color: var(--ink-3); background: transparent; }
.avatar--me { color: var(--ink-inv); background: var(--ink); border-color: var(--ink); }

/* ---------- due ---------- */
.due { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 16px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-3); white-space: nowrap; }
.due--today { color: var(--accent); }
.due--over { color: var(--risk); }
.due--check { color: var(--wait); }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); width: 1440px; height: 900px; padding: 8px 8px 8px 0; background: var(--shell); }
.app__main { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--e-1); }

/* ---------- sidebar ---------- */
.sidebar { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px 12px; min-height: 0; }
.sidebar__brand { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 6px; font-weight: 600; }
.sidebar__logo { width: 26px; height: 26px; border-radius: 7px; background: var(--ink); color: var(--ink-inv); display: inline-flex; align-items: center; justify-content: center; }
.sidebar__actions { display: flex; flex-direction: column; gap: 6px; padding: 6px 0 12px; }
.sidebar__search { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px 0 10px; color: var(--ink-3); background: rgba(255, 255, 255, 0.7); border: 1px solid var(--line); border-radius: var(--r-s); }
.sidebar__label { display: flex; align-items: center; justify-content: space-between; padding: 14px 10px 4px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--ink-3); }
.sidebar__foot { margin-top: auto; }

.nav-item { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 8px 0 10px; border-radius: var(--r-s); font-weight: 500; color: var(--ink-2); cursor: pointer; }
.nav-item:hover { background: rgba(255, 255, 255, 0.6); color: var(--ink); }
.nav-item--active, .nav-item--active:hover { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item--active .nav-item__count { color: var(--accent); }
.nav-item__count { margin-left: auto; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.nav-item__count--mine { color: var(--accent); }
.nav-item__count--over { color: var(--ink-inv); background: var(--risk); border-radius: var(--r-pill); padding: 0 6px; line-height: 18px; }
.nav-item .icon { width: 18px; height: 18px; }
.nav-item__dot { width: 8px; height: 8px; border-radius: 3px; flex: none; margin: 0 5px; background: var(--ink-3); }

/* ---------- page-head ---------- */
.page-head { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 24px; border-bottom: 1px solid var(--line); }
.page-head__title { font-size: 18px; line-height: 24px; font-weight: 600; letter-spacing: -0.01em; }
.page-head__count { font-size: 18px; line-height: 24px; font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.page-head__crumb { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-weight: 500; }

.toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 24px; border-bottom: 1px solid var(--line); }

/* ---------- view-switch (сегменты) ---------- */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: 9px; }
.seg__item { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; font-size: 13px; font-weight: 500; color: var(--ink-2); border-radius: 7px; cursor: pointer; white-space: nowrap; }
.seg__item .icon { width: 16px; height: 16px; }
.seg__item--on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(22, 27, 38, 0.12), 0 0 0 1px rgba(22, 27, 38, 0.04); }

/* ---------- filter ---------- */
.filter { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; font-size: 13px; font-weight: 500; color: var(--ink-2); background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--r-pill); cursor: pointer; white-space: nowrap; }
.filter .icon { width: 15px; height: 15px; }
.filter--on { color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.filter__n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--accent); color: var(--ink-inv); font-size: 11px; line-height: 18px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.filter--open { box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- lens: применённый фильтр под шапкой экрана; lens-dot — «фильтр включён» на пунктах меню и вкладках ---------- */
.lens { display: flex; align-items: center; gap: var(--s-2); min-height: 52px; padding: var(--s-2) var(--s-6); border-bottom: 1px solid var(--line); background: var(--accent-wash, var(--accent-soft)); }
.lens__one { display: inline-flex; align-items: center; gap: var(--s-2); flex: 0 1 auto; min-width: 0; font: var(--t-head, 600 16px/24px var(--font)); letter-spacing: var(--t-head-track, -0.005em); color: var(--ink); }
.lens__one > .icon { flex: none; color: var(--accent); }
.lens__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lens__kind { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: var(--t-meta); color: var(--ink-2); }
.lens__chips { display: flex; flex: 1; gap: var(--s-2); min-width: 0; overflow-x: auto; scrollbar-width: none; }
.lens__chip { display: inline-flex; align-items: center; flex: none; gap: 6px; height: 32px; padding: 0 2px 0 10px; border: 1px solid var(--accent-line); border-radius: var(--r-pill); background: var(--surface); color: var(--accent); font-size: 13px; font-weight: 500; white-space: nowrap; }
.lens__chip > .avatar { margin-left: -6px; }
.lens__x { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--r-pill); background: none; color: var(--ink-2); cursor: pointer; }
.lens__x:hover { background: var(--accent-soft); color: var(--ink); }
.lens__acts { display: flex; flex: none; gap: var(--s-1); margin-left: auto; }
.lens__form { display: flex; flex: 1; align-items: center; gap: var(--s-2); min-width: 0; }
.lens__form > .icon { flex: none; color: var(--accent); }
.lens__form .input { flex: 1; min-width: 0; }
.lens-dot { width: 7px; height: 7px; flex: none; border-radius: var(--r-pill); background: var(--accent); }
.nav-item .lens-dot { margin-left: auto; }
.nav-item .lens-dot + .nav-item__count { margin-left: 0; }
.nav-item__count--lens { color: var(--accent); }
.nav-item--off { color: var(--ink-3); }
.tabbar__item { position: relative; }
.tabbar__item .lens-dot { position: absolute; top: 2px; left: calc(50% + 9px); width: 8px; height: 8px; box-shadow: 0 0 0 2px var(--surface); }
@media (max-width: 767.98px) {
  .lens { padding: var(--s-1) var(--s-2) var(--s-1) var(--s-4); }
  .lens__chip { height: var(--h-touch); }
  .lens__x { width: var(--h-touch); height: var(--h-touch); }
  .lens__kind { display: none; }
  .lens__acts .btn { min-width: var(--h-touch); min-height: var(--h-touch); }
  .lens__form .btn { min-height: var(--h-touch); }
}

/* ---------- qf: ряд быстрых фильтров под заголовком экрана; «Ещё…» в конце открывает окно «Фильтр»; qf-sum — фраза над списком ---------- */
.qf { display: flex; align-items: center; min-height: 52px; padding: 0 var(--s-6); border-bottom: 1px solid var(--line); background: var(--surface); }
.qf[hidden] { display: none; }
.qf__track { display: flex; flex: 1; align-items: center; gap: var(--s-2) 4px; min-width: 0; margin-inline: calc(-1 * var(--s-1)); padding: var(--s-2) var(--s-1); overflow-x: auto; scrollbar-width: none; }
.qf__chips { display: contents; }
.qf__chip[hidden], .qf__sep[hidden] { display: none; }
.qf__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.qf__sep { flex: none; width: 1px; height: 20px; margin: 0 1px; background: var(--line-2); }
.qf__chip { --qf-line: var(--line-2); --qf-line-style: solid; --qf-bg: var(--surface); position: relative; display: inline-flex; flex: none; align-items: center; gap: 5px; height: 32px; padding: 0 9px; border: 1px var(--qf-line-style) var(--qf-line); border-radius: var(--r-pill); background: var(--qf-bg); color: var(--ink); font: 500 13px/18px var(--font); white-space: nowrap; cursor: pointer; }
/* .ds button { font: inherit } сильнее одиночного класса */
.qf .qf__chip, .qf .qf__more { font: 500 13px/18px var(--font); }
@media (min-width: 768px) { .qf__chip--on { flex: 0 1 auto; min-width: 0; } .qf--fit .qf__chip--on { flex: none; } }
.qf__chip:hover { --qf-line: var(--line-control); --qf-bg: var(--surface-2); }
.qf__chip:focus-visible, .qf__more:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.qf__chip > .icon { flex: none; width: 15px; height: 15px; color: var(--ink-2); }
.qf__chip > .avatar { width: 22px; height: 22px; margin-left: -7px; font-size: 11px; }
.qf__chip--late > .icon { color: var(--risk); }
.qf__chip--imp > .icon { color: var(--ink); fill: currentColor; }
.qf__n { color: var(--ink-2); font-weight: 400; font-variant-numeric: tabular-nums; }
.qf__chip--zero { --qf-line-style: dashed; color: var(--ink-2); }
.qf__chip--on, .qf__chip--on:hover { --qf-line: var(--accent); --qf-bg: var(--accent); }
.qf__chip--on { padding-right: 2px; color: var(--ink-inv); }
.qf__chip--on > .icon { color: var(--ink-inv); }
.qf__chip--on > .avatar { background: var(--ink-inv); color: var(--accent); }
.qf__chip--on .tag-dot { box-shadow: 0 0 0 2px var(--ink-inv); }
.qf__x { display: inline-grid; flex: none; place-items: center; width: 24px; height: 24px; border-radius: var(--r-pill); color: var(--ink-inv); }
.qf__chip--on:hover .qf__x { background: rgba(255, 255, 255, .2); }
.qf__x .icon { width: 13px; height: 13px; }
.qf--stale .qf__n { opacity: .45; }
.qf__end { position: sticky; right: 0; display: flex; flex: none; align-items: center; margin-left: auto; padding-left: var(--s-2); background: var(--surface); }
.qf__more { --qf-line: var(--line-2); --qf-line-style: dashed; --qf-bg: var(--surface); --qf-ring: none; position: relative; display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px; border: 1px var(--qf-line-style) var(--qf-line); border-radius: var(--r-pill); background: var(--qf-bg); box-shadow: var(--qf-ring); color: var(--ink-2); font: 500 13px/18px var(--font); white-space: nowrap; cursor: pointer; }
.qf__more .icon { width: 15px; height: 15px; }
.qf__more .filter__n { margin-right: -4px; }
.qf__more--open, .qf__more[aria-expanded="true"] { --qf-line-style: solid; --qf-line: var(--accent-line); --qf-ring: 0 0 0 3px var(--accent-soft); color: var(--accent); }
.qf-sum { display: flex; align-items: center; gap: var(--s-2); margin: 0; padding: var(--s-2) var(--s-6); font: var(--t-meta); color: var(--ink-2); }
.qf-sum__text { flex: 1 1 auto; min-width: 0; margin: 0; }
.qf-sum__acts { display: flex; flex: none; margin-left: auto; }
.qf-sum[hidden] { display: none; }
.qf-sum b { color: var(--ink); font-weight: 600; }
.qf-sum__reset { position: relative; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.qf-sum__reset:hover { text-decoration: underline; }
.qf-sum__reset:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
@media (max-width: 767.98px) {
  .qf { height: 44px; min-height: 44px; padding: 0; }
  .qf__track { flex-wrap: nowrap; height: 44px; margin-inline: 0; padding: 0 0 0 var(--s-4); overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  .qf__track::-webkit-scrollbar { display: none; }
  /* Кнопка — цель касания 44 px во всю высоту ряда, видимая пилюля 34 px рисуется ::before внутри неё. */
  .qf__chip, .qf__more { isolation: isolate; height: var(--h-touch); border-color: transparent; background: none; box-shadow: none; }
  .qf__chip::before, .qf__more::before { content: ""; position: absolute; inset: 5px 0; z-index: -1; border: 1px var(--qf-line-style) var(--qf-line); border-radius: var(--r-pill); background: var(--qf-bg); box-shadow: var(--qf-ring, none); }
  .qf__chip:focus-visible, .qf__more:focus-visible { outline: 0; }
  .qf__chip:focus-visible::before, .qf__more:focus-visible::before { outline: 2px solid var(--focus); outline-offset: 2px; }
  .qf__x { width: 30px; height: 30px; }
  .qf__end { position: sticky; right: 0; z-index: 1; align-self: stretch; height: 44px; padding: 0 var(--s-2) 0 var(--s-1); background: var(--surface); }
  .qf__end::before { content: ""; position: absolute; top: 0; right: 100%; bottom: 0; width: 28px; background: linear-gradient(to right, rgba(255, 255, 255, 0), var(--surface)); pointer-events: none; }
  .qf-sum { padding: var(--s-2) var(--s-4); }
  .qf-sum__reset::after { content: ""; position: absolute; inset: -13px -8px; }
  .qf-sum__acts .btn { min-width: var(--h-touch); min-height: var(--h-touch); }
  .qf-sum .lens__form .btn { min-height: var(--h-touch); }
}
@media (prefers-reduced-motion: no-preference) { .qf__chip { transition: background-color .12s, border-color .12s, color .12s; } .qf__n { transition: opacity .12s; } }

/* ---------- split: список + дело ---------- */
.split { flex: 1; display: grid; grid-template-columns: 420px minmax(0, 1fr); min-height: 0; }
.split__list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); overflow: hidden; }
.split__detail { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }

/* ---------- task-row ---------- */
.task-row { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; column-gap: 12px; row-gap: 4px; align-items: start; padding: 12px 20px 13px; border-bottom: 1px solid var(--line); cursor: pointer; }
.task-row:hover { background: var(--surface-2); }
.task-row--selected { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.task-row__mark { margin-top: 4px; }
.task-row__title { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row__meta { grid-column: 2 / 4; display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; line-height: 18px; color: var(--ink-2); }
.task-row__next { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.task-row__due { padding-top: 2px; }

/* ---------- queue (секция на «Сегодня») ---------- */
.queue { display: flex; flex-direction: column; }
.queue__head { display: flex; align-items: center; gap: 8px; padding: 0 4px 10px; }
.queue__title { font-size: 15px; line-height: 20px; font-weight: 600; }
.queue__count { font-size: 15px; line-height: 20px; font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.queue__hint { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.queue__body { border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; background: var(--surface); }
.queue__body .task-row:last-child { border-bottom: 0; }

/* ---------- panel (открытое дело) ---------- */
.panel__head { display: flex; flex-direction: column; gap: 12px; padding: 20px 32px 0; }
.panel__bar { display: flex; align-items: center; gap: 8px; }
.panel__title { font-size: 21px; line-height: 28px; font-weight: 600; letter-spacing: -0.012em; max-width: 60ch; text-wrap: pretty; }
.panel__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.panel__body { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 24px; padding: 24px 32px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); }
.tabs__item { display: inline-flex; align-items: center; gap: 6px; padding: 8px 0 11px; margin-bottom: -1px; font-weight: 500; color: var(--ink-2); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs__item--on { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.tabs__badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); font-size: 11px; line-height: 18px; font-weight: 600; text-align: center; color: var(--model); background: var(--model-soft); }
.tabs__dirty:not([hidden]) { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--a-11); }

/* ---------- section ---------- */
.section { display: flex; flex-direction: column; gap: 12px; }
.section__head { display: flex; align-items: center; gap: 8px; }
.section__title { font-size: 15px; line-height: 20px; font-weight: 600; }
.section__aside { margin-left: auto; }

/* ---------- source (исходная запись) ---------- */
.source { display: grid; grid-template-columns: 14px minmax(0, 1fr); column-gap: 10px; row-gap: 4px; padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-m); }
.source__mark { margin-top: 3px; }
.source__meta { font-size: 12px; line-height: 16px; color: var(--ink-3); }
.source__text { grid-column: 2; font-size: 15px; line-height: 23px; color: var(--ink); max-width: 68ch; }

/* ---------- outcome (пять исходов) ---------- */
.outcome { display: flex; flex-direction: column; gap: 6px; }
.outcome__item { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; column-gap: 14px; min-height: 56px; padding: 8px 14px 8px 16px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-m); cursor: pointer; }
.outcome__item:hover { border-color: var(--ink-3); background: var(--surface-2); }
.outcome__item .icon { color: var(--ink-2); }
.outcome__text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.outcome__label { font-size: 14px; line-height: 20px; font-weight: 600; }
.outcome__hint { font-size: 13px; line-height: 18px; color: var(--ink-3); }
.outcome__item--on { background: var(--accent-soft); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.outcome__item--on .icon { color: var(--accent); }

/* ---------- chosen (свёрнутый выбранный исход) ---------- */
.chosen { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--r-m); }
.chosen .icon { color: var(--accent); }
.chosen__label { font-weight: 600; }

/* ---------- field ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink); }
.field__opt { font-weight: 400; color: var(--ink-3); }
.field__help { font-size: 13px; line-height: 18px; color: var(--ink-3); }
.field__error { display: flex; gap: 6px; font-size: 13px; line-height: 18px; color: var(--risk); }
.input { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 8px 12px; font-size: 14px; line-height: 20px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-s); }
.input--area { align-items: flex-start; min-height: 72px; white-space: pre-line; }
.input--placeholder { color: var(--ink-3); }
.input--focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input--unknown { color: var(--ink-3); background: transparent; border-style: dashed; box-shadow: none; }
.input--error { border-color: var(--risk); box-shadow: 0 0 0 3px var(--risk-soft); }
.input--disabled { color: var(--ink-3); background: var(--surface-3); border-color: var(--line); box-shadow: none; }
.input .icon { color: var(--ink-3); }

.example { font-size: 13px; line-height: 18px; color: var(--ink-2); }
.example__toggle { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 500; cursor: pointer; }

.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

/* ---------- note ---------- */
.note { display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 10px; padding: 12px 14px; font-size: 13px; line-height: 19px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-m); }
.note--plain { grid-template-columns: minmax(0, 1fr); }
.note b { color: var(--ink); font-weight: 600; }
.note .icon { margin-top: 1px; }
.note--mine { background: var(--accent-soft); border-color: var(--accent-line); }
.note--mine .icon { color: var(--accent); }
.note--wait { background: var(--wait-soft); border-color: var(--wait-line); }
.note--wait .icon { color: var(--wait); }
.note--risk { background: var(--risk-soft); border-color: var(--risk-line); }
.note--risk .icon { color: var(--risk); }
.note--done { background: var(--done-soft); border-color: var(--done-line); }
.note--done .icon { color: var(--done); }
.note__actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* ---------- fact (пять видов) ---------- */
.fact { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; column-gap: 10px; row-gap: 2px; padding: 12px 0; border-top: 1px solid var(--line); }
.fact:first-child { border-top: 0; padding-top: 0; }
.fact__mark { margin-top: 4px; }
.fact__kind { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--ink-2); }
.fact__kind--model { color: var(--model); }
.fact__text { grid-column: 2 / 4; font-size: 14px; line-height: 20px; color: var(--ink); }
.fact__src { grid-column: 2 / 4; font-size: 12px; line-height: 16px; color: var(--ink-3); }
.fact__side { grid-row: 1; grid-column: 3; }

/* ---------- assistant ---------- */
.assistant { display: flex; flex-direction: column; min-height: 0; background: var(--surface-2); border-left: 1px solid var(--line); }
.assistant__head { display: flex; align-items: center; gap: 8px; min-height: 60px; padding: 0 16px 0 20px; border-bottom: 1px solid var(--line); }
.assistant__head .icon { color: var(--model); }
.assistant__body { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; }
.assistant__foot { padding: 0 16px 16px; }
.msg { font-size: 14px; line-height: 20px; }
.msg--me { align-self: flex-end; max-width: 88%; padding: 9px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px 12px 4px 12px; }
.msg--bot { display: flex; flex-direction: column; gap: 4px; }
.msg__who { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--model); }

.proposal { display: flex; flex-direction: column; gap: 12px; padding: 14px; background: var(--surface); border: 1px dashed var(--model-line); border-radius: var(--r-m); }
.proposal--applied { border-style: solid; border-color: var(--done-line); }
.proposal__head { display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 18px; font-weight: 600; }
.proposal__head .chip { margin-left: auto; }
.proposal__diff { display: flex; flex-direction: column; gap: 8px; }
.proposal__row { display: grid; grid-template-columns: 92px minmax(0, 1fr); column-gap: 10px; font-size: 13px; line-height: 18px; }
.proposal__key { color: var(--ink-3); }
.proposal__was { color: var(--ink-3); text-decoration: line-through; }
.proposal__now { color: var(--ink); font-weight: 500; }
.proposal__actions { display: flex; gap: 8px; }

.composer { display: flex; align-items: flex-end; gap: 8px; padding: 8px 8px 8px 12px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-m); color: var(--ink-3); }

/* ---------- contact ---------- */
.contact { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r-m); cursor: pointer; }
.contact:hover { background: var(--surface-2); }
.contact--next { background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--e-1); }
.contact__date { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--r-m); background: var(--surface-3); font-variant-numeric: tabular-nums; }
.contact__day { font-size: 16px; line-height: 18px; font-weight: 600; }
.contact__wd { font-size: 11px; line-height: 13px; color: var(--ink-3); }
.contact__date--today { background: var(--accent); color: var(--ink-inv); }
.contact__date--today .contact__wd { color: rgba(255, 255, 255, 0.85); }
.contact__title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact__meta { font-size: 13px; line-height: 18px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- action-bar ---------- */
.action-bar { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 12px 32px; border-top: 1px solid var(--line); background: var(--surface); }
.save-state { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; line-height: 18px; color: var(--ink-3); }
.save-state--dirty { color: var(--wait); }
.save-state--error { color: var(--risk); }
.save-state__dot { width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--wait); flex: none; }

/* ---------- dialog / scrim ---------- */
.scrim { position: absolute; inset: 0; background: rgba(22, 27, 38, 0.38); display: flex; align-items: flex-start; justify-content: center; padding-top: 120px; }
.dialog { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-l); box-shadow: var(--e-dialog); overflow: hidden; }
.dialog__head { display: flex; align-items: center; gap: 10px; padding: 18px 22px 0; }
.dialog__body { display: flex; flex-direction: column; gap: 14px; padding: 16px 22px 20px; }
.dialog__foot { display: flex; align-items: center; gap: 10px; padding: 14px 22px; background: var(--surface-2); border-top: 1px solid var(--line); }

/* ---------- toast ---------- */
.toast { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; max-width: 100%; font-size: 14px; color: var(--ink-inv); background: var(--ink); border-radius: var(--r-m); box-shadow: var(--e-pop); }
.toast .icon { color: var(--g-7); flex-shrink: 0; }
.toast > span { flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; }

/* ---------- mobile ---------- */
.mobile { position: relative; width: 390px; height: 844px; display: flex; flex-direction: column; background: var(--bg); overflow: hidden; }
.mobile__bar { display: flex; align-items: center; gap: 4px; min-height: 56px; padding: 0 8px 0 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.mobile__bar .btn--icon { width: 44px; height: 44px; }
.mobile__body { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 20px; padding: 16px; }
.mobile__dock { display: flex; flex-direction: column; gap: 10px; padding: 10px 16px 28px; background: var(--surface); border-top: 1px solid var(--line); }
.mobile .task-row { padding: 13px 16px 14px; }
.mobile .task-row__title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: end; padding: 6px 4px 26px; background: var(--surface); border-top: 1px solid var(--line); }
.tabbar__item { display: flex; flex-direction: column; align-items: center; gap: var(--s-1); padding: var(--s-1) 0 var(--s-2); font-size: 11px; line-height: 14px; font-weight: 500; color: var(--ink-3); }
.tabbar__item .icon { width: 22px; height: 22px; }
.tabbar__item--on { color: var(--ink); font-weight: 600; }
.quick-input { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 6px 0 14px; font-size: 15px; color: var(--ink-3); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-m); }

/* ---------- drawer: выезжающая панель дела (вместо вкладок и переходов) ---------- */
.drawer { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); border-left: 1px solid var(--line); box-shadow: -16px 0 32px -22px rgba(22, 27, 38, 0.35); }
.drawer__bar { display: flex; align-items: center; gap: 4px; min-height: 52px; padding: 0 12px 0 14px; border-bottom: 1px solid var(--line); }
.drawer__pos { margin: 0 6px; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.drawer__body { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 20px; padding: 22px 28px; }
.drawer__title { font: var(--t-case); letter-spacing: var(--t-case-track); text-wrap: pretty; }
.drawer__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.drawer__cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; min-height: 0; }

.disclosure { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; font-weight: 500; color: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-m); cursor: pointer; }
.disclosure .icon { color: var(--ink-3); }
.disclosure__aside { margin-left: auto; font-size: 13px; font-weight: 400; color: var(--ink-3); }

.btn__badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); font-size: 11px; line-height: 18px; font-weight: 600; text-align: center; color: var(--ink-inv); background: var(--model); }

/* действия строки при наведении */
.task-row--hover { background: var(--surface-2); }
.row-actions { display: flex; gap: 2px; margin: -5px -8px -5px 0; }
.row-actions .btn { width: 30px; height: 30px; padding: 0; color: var(--ink-2); background: transparent; border-color: transparent; box-shadow: none; }
.row-actions .btn:hover { background: var(--surface-3); }
.row-actions .btn--on { background: var(--surface); border-color: var(--line-2); }

/* ненавязчивая подсказка в списке */
.tip { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; column-gap: 10px; align-items: start; padding: 12px 14px; font-size: 13px; line-height: 19px; color: var(--ink-2); background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: var(--r-m); }
.tip .icon { color: var(--ink-3); }

/* ---------- popover и menu: мелкие решения на месте ---------- */
.popover { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--e-pop); overflow: hidden; }
.popover__head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; font-size: 13px; line-height: 18px; font-weight: 600; }
.popover__body { display: flex; flex-direction: column; gap: 10px; padding: 0 14px 14px; }
.popover__foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 12px; background: var(--surface-2); border-top: 1px solid var(--line); }
/* FLT8: подвал окна, которое на телефоне — лист: главная кнопка только там, подпись итога — только у окошка. */
.popover__foot > .popover__main { display: none; }
@media (max-width: 767.98px) {
  .popover__foot:has(> .popover__main) > .btn { min-height: var(--h-touch); }
  .popover__foot > .popover__main { display: inline-flex; flex: 1 1 auto; }
  .popover__foot > .popover__note { display: none; }
}
.menu { display: flex; flex-direction: column; padding: 4px; }
.menu__item { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; column-gap: 10px; align-items: center; min-height: 38px; padding: 6px 10px; font-size: 14px; line-height: 20px; border-radius: var(--r-s); cursor: pointer; }
.menu__item .icon { color: var(--ink-2); }
.menu__item--hl { background: var(--accent-soft); }
.menu__sub { display: block; font-size: 12px; line-height: 16px; color: var(--ink-3); }
.menu__aside { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.menu__sep { height: 1px; margin: 4px 6px; background: var(--line); }

.switch { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; line-height: 18px; color: var(--ink-2); }
.switch__track { position: relative; flex: none; width: 32px; height: 18px; border-radius: var(--r-pill); background: var(--line-2); }
.switch__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: var(--r-pill); background: #ffffff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
.switch--on .switch__track { background: var(--accent); }
.switch--on .switch__track::after { left: 16px; }

.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; font-size: 12px; text-align: center; }
.cal__d { display: flex; align-items: center; justify-content: center; height: 28px; border-radius: 7px; font-variant-numeric: tabular-nums; }
.cal__d--head { height: 22px; font-size: 11px; color: var(--ink-3); }
.cal__d--muted { color: var(--ink-3); }
.cal__d--today { color: var(--accent); font-weight: 600; }
.cal__d--on { color: #ffffff; background: var(--accent); font-weight: 600; }

/* ---------- people-list: выбор людей, проектов и направлений ---------- */
.people-list { display: flex; flex-direction: column; min-width: 0; }
.people-list__search { padding: var(--s-2) var(--s-3); }
.people-list__search .input { min-height: var(--h-touch); padding-block: 0; }
.people-list__search .input__control { align-self: stretch; }
.people-list__list { margin: 0; padding: 0 0 var(--s-1); list-style: none; max-height: 60vh; overflow-y: auto; overscroll-behavior: contain; }
.people-list__group { padding: var(--s-3) var(--s-4) var(--s-1); font: var(--t-small); font-weight: 600; color: var(--ink-3); }
.people-list__row { display: flex; align-items: center; gap: var(--s-3); min-height: var(--h-touch); padding: var(--s-1) var(--s-4); border-top: 1px solid var(--line); font: var(--t-body); color: var(--ink); cursor: pointer; }
.people-list__row:first-child, .people-list__group + .people-list__row { border-top-color: transparent; }
.people-list__row:hover { background: var(--surface-2); }
.people-list__row--hl, .people-list__row--hl:hover { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--focus); }
.people-list__icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: var(--s-6); height: var(--s-6); color: var(--ink-2); }
.people-list__text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.people-list__name, .people-list__sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people-list__row[aria-selected="true"] .people-list__name { font-weight: 600; }
.people-list__sub { font: var(--t-meta); color: var(--ink-3); }
.people-list__row--unknown .people-list__name { color: var(--ink-2); }
.people-list__load { display: flex; flex-wrap: wrap; gap: 0 10px; font: var(--t-meta); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.people-list__load-bit--risk { color: var(--risk); font-weight: 600; }
.people-list__load-bit--wait { color: var(--wait); font-weight: 600; }
.people-list__row--away .people-list__name { color: var(--ink-2); }
.people-list__row--away .avatar { background: var(--surface-3); color: var(--ink-2); }
.people-list__mark { display: inline-flex; align-items: center; justify-content: center; flex: none; width: var(--s-5); height: var(--s-5); color: var(--accent); }
.people-list--multiple .people-list__mark { color: var(--ink-inv); background: var(--surface); border: 1.5px solid var(--line-control); border-radius: var(--r-xs); }
.people-list--multiple .people-list__row[aria-selected="true"] .people-list__mark { background: var(--accent); border-color: var(--accent); }
.people-list__status { margin: 0; padding: var(--s-4); font: var(--t-meta); color: var(--ink-3); text-align: center; }
.people-list__status:empty { display: none; }
.recipient-load-note { text-align: left; padding: var(--s-2) var(--s-4) var(--s-3); }
.people-list--busy .people-list__list, .people-list__list[aria-disabled="true"] { opacity: 0.6; }
.people-list__list[aria-disabled="true"] .people-list__row { cursor: default; }
.people-list__foot { padding: var(--s-2) var(--s-3) var(--s-3); border-top: 1px solid var(--line); }
.people-list__terms { display: flex; flex-wrap: wrap; gap: var(--s-2); padding: 0 var(--s-4) var(--s-3); }
.people-list__terms > .people-list__group { flex: 0 0 100%; padding-inline: 0; }
.people-list__term { display: inline-flex; align-items: center; height: 32px; padding: 0 var(--s-3); border: 1px solid var(--line-2); border-radius: var(--r-pill); background: var(--surface); font: var(--t-meta); font-weight: 500; color: var(--ink); cursor: pointer; }
.people-list__term:hover { background: var(--surface-2); }
.people-list__term[aria-selected="true"] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.people-list__term--hl { box-shadow: 0 0 0 2px var(--focus); }
.people-list__create { display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: var(--h-touch); padding: var(--s-1) var(--s-4); border: 0; border-top: 1px solid var(--line); background: none; font: var(--t-body, 400 14px/20px var(--font)); font-weight: 600; color: var(--accent); text-align: left; cursor: pointer; }
.people-list__create .people-list__icon { color: var(--accent); }
.people-list__create .people-list__sub { font-weight: 400; }
.people-list__create:hover { background: var(--accent-wash, var(--accent-soft)); }
.people-list__create--hl, .people-list__create--hl:hover { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--focus); }
.people-list__create:disabled { opacity: 0.6; cursor: default; }
@media (max-width: 767.98px) { .people-list__term { height: var(--h-touch); } }

/* ---------- board: доска с перетаскиванием ---------- */
.board { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 220px; gap: 12px; padding: 16px 24px 24px; background: var(--bg); }
.board__col { position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 10px; border-radius: var(--r-m); background: var(--surface-3); }
.board__head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 4px; font-weight: 600; }
.board__count { color: var(--ink-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.board__col--drop { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent-line); }
.board__drop { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 76px; padding: 0 14px; font-size: 13px; line-height: 18px; color: var(--accent); text-align: center; border: 1.5px dashed var(--accent); border-radius: 10px; }
.card { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--e-1); }
.card__title { font-weight: 500; text-wrap: pretty; }
.card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.card__foot { display: flex; align-items: center; gap: 8px; }
.card--ghost { box-shadow: var(--e-dialog); transform: rotate(-2deg); border-color: var(--accent-line); }
.card--placeholder { height: 78px; background: transparent; border: 1.5px dashed var(--line-2); box-shadow: none; }


/* строки меню не переносятся */
.nav-item { white-space: nowrap; overflow: hidden; }

/* свайп строки на телефоне — замена перетаскиванию */
.swipe { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.swipe__actions { position: absolute; top: 0; right: 0; bottom: 0; display: flex; }
.swipe__btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 72px; font-size: 12px; font-weight: 600; color: var(--ink-inv); }
.swipe .task-row { position: relative; border-bottom: 0; transform: translateX(-144px); box-shadow: 8px 0 16px -10px rgba(22, 27, 38, 0.25); }


/* в тесных местах переносим, а не вылезаем */
.task-row__meta { flex-wrap: wrap; row-gap: 4px; }
.proposal__actions { flex-wrap: wrap; }

/* загрузка */
.spinner { width: 14px; height: 14px; flex: none; border-radius: var(--r-pill); border: 2px solid var(--line-2); border-top-color: var(--ink-2); animation: ds-spin 0.9s linear infinite; }
.skel { display: block; height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--surface-3) 0%, var(--n-2) 50%, var(--surface-3) 100%); background-size: 200% 100%; animation: ds-skel 1.4s ease-in-out infinite; }
@keyframes ds-spin { to { transform: rotate(360deg); } }
@keyframes ds-skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .spinner, .skel { animation: none; } }

/* ---------- check / radio ---------- */
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; line-height: 20px; cursor: pointer; }
.check--row { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; width: 100%; min-height: 44px; padding: 6px 8px; border-radius: var(--r-s); }
.check--row .check__text { min-width: 0; overflow-wrap: anywhere; }
.check--row:has(input:checked) { background: var(--accent-soft); }
.check--row:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: -2px; }
.check__box { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 18px; height: 18px; color: #ffffff; background: var(--surface); border: 1.5px solid var(--line-2); border-radius: 5px; pointer-events: none; }
.check__box .icon { width: 14px; height: 14px; stroke-width: 2.2; }
.check--on .check__box, .check--mixed .check__box { background: var(--accent); border-color: var(--accent); }
.check--disabled { color: var(--ink-3); cursor: not-allowed; }
.check--disabled .check__box { background: var(--surface-3); border-color: var(--line); }
.radio { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; line-height: 20px; cursor: pointer; }
.radio--touch { min-height: var(--h-touch); padding: var(--s-2) var(--s-3); border: 1px solid var(--line-control); border-radius: var(--r-s); background: var(--surface); }
.radio--touch > input { flex: none; width: 18px; height: 18px; accent-color: var(--accent); }
.radio__dot { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 18px; height: 18px; background: var(--surface); border: 1.5px solid var(--line-2); border-radius: var(--r-pill); }
.delegation-preparation { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.delegation-preparation[hidden], .delegation-workflow[hidden], .delegation-mode[hidden], .delegation-slot[hidden], .delegation-summary[hidden] { display: none; }
.delegation-preparation .btn, .delegation-preparation .delegation-control { min-height: var(--h-touch); }
.delegation-preparation__head { display: flex; flex-direction: column; gap: var(--s-2); }
.delegation-preparation__heading { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); }
.delegation-preparation__start { align-self: flex-start; }
.delegation-mode { gap: var(--s-3); }
.delegation-mode__choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-1) var(--s-3); }
.delegation-mode__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-2); }
.delegation-workflow { min-width: 0; }
.delegation-workflow__overview { display: flex; justify-content: flex-end; padding-bottom: var(--s-2); }
.delegation-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); min-width: 0; padding-bottom: var(--s-4); border-bottom: 1px solid var(--line); }
.delegation-nav .btn { width: 100%; min-width: 0; height: auto; padding: var(--s-2); justify-content: flex-start; text-align: left; white-space: normal; line-height: inherit; }
.delegation-nav .btn[aria-current="step"], .delegation-nav .btn[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.delegation-workflow__step { min-width: 0; padding: var(--s-5) 0; }
.delegation-slot { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.delegation-slot__controls { display: grid; grid-template-columns: minmax(140px, 0.36fr) minmax(0, 1fr); gap: var(--s-3); align-items: start; }
.delegation-slot .field, .delegation-slot__controls .field { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.delegation-known-work { padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface-2); }
.delegation-summary { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.delegation-summary__items { display: grid; gap: var(--s-2); }
.delegation-summary__item { display: grid; grid-template-columns: minmax(150px, 0.38fr) minmax(0, 1fr); gap: var(--s-3); align-items: start; padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-s); }
.delegation-summary__value { overflow-wrap: anywhere; }
.delegation-summary__draft { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface-2); }
.delegation-summary__draft .btn { align-self: flex-start; }
.delegation-summary__text { display: block; width: 100%; min-height: var(--h-touch); margin: 0; padding: var(--s-2) var(--s-3); font: inherit; color: var(--ink); text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-s); cursor: text; transition: border-color .12s ease; }
.delegation-summary__text:hover { border-color: var(--line-control); }
.delegation-summary__text--empty { color: var(--ink-2); }
.delegation-summary__text[hidden], .delegation-summary__editor[hidden] { display: none; }
.delegation-summary__editor { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.delegation-summary__editor-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-2); }
.delegation-summary__editor-actions .btn { align-self: auto; }
.radio--on .radio__dot { border-color: var(--accent); }
.radio--on .radio__dot::after { content: ""; width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--accent); }
/* Строка выбора одного из многих (дело в окне «Жду»): та же сетка, что у .check--row, точка вместо галочки. */
.radio.check--row { display: grid; }

/* ---------- tooltip ---------- */
.tooltip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; font-size: 12px; line-height: 16px; white-space: nowrap; color: #ffffff; background: var(--ink); border-radius: var(--r-xs); box-shadow: var(--e-pop); }
.tooltip .kbd { height: 18px; color: #ffffff; background: transparent; border-color: var(--n-11); box-shadow: none; }

/* ---------- data-table ---------- */
.table { display: flex; flex-direction: column; min-width: 0; font-size: 14px; line-height: 20px; }
.table__row { display: grid; grid-template-columns: var(--cols); align-items: center; column-gap: 16px; min-height: 48px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.table__row:hover { background: var(--surface-2); }
.table__row--head { min-height: 38px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--ink-3); background: var(--surface-2); }
.table__row--group { min-height: 40px; font-size: 13px; font-weight: 600; background: var(--bg); }
.table__row--selected { background: var(--accent-soft); }
.table__cell { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table__cell--title { font-weight: 500; }
.table__sort { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); }
.bulk-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 18px; color: #ffffff; background: var(--ink); border-radius: var(--r-m); box-shadow: var(--e-dialog); }
.bulk-bar .btn { color: #ffffff; background: transparent; border-color: var(--n-11); box-shadow: none; height: 32px; }

/* ---------- week: календарь по дням ---------- */
.week { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.week__day { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 10px 8px; border-right: 1px solid var(--line); }
.week__day:last-child { border-right: 0; }
.week__day--today { background: var(--surface-2); }
.week__day--off { background: var(--bg); }
.week__day--drop { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent-line); }
.week__head { display: flex; align-items: center; gap: 6px; padding: 0 4px 6px; font-size: 13px; color: var(--ink-3); }
.week__num { font-size: 17px; line-height: 24px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.week__day--today .week__num { padding: 0 7px; color: #ffffff; background: var(--accent); border-radius: var(--r-s); }
.event { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 7px 9px; font-size: 12px; line-height: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s); }
.event__time { font-weight: 600; font-variant-numeric: tabular-nums; }
.event__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event--contact { color: var(--c-12); background: var(--accent-soft); border-color: var(--accent-line); }
.event--wait { color: var(--a-12); background: var(--wait-soft); border-color: var(--wait-line); }
.event--check { color: var(--wait); background: transparent; border: 1px dashed var(--wait-line); }
.event--over { color: var(--risk); background: var(--risk-soft); border-color: var(--risk-line); }

/* ---------- timeline: история дела ---------- */
.timeline { display: flex; flex-direction: column; }
.timeline__item { position: relative; display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; column-gap: 12px; padding-bottom: 16px; }
.timeline__item::before { content: ""; position: absolute; left: 6px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline__item:last-child::before { display: none; }
.timeline__mark { position: relative; margin-top: 4px; }
.timeline__text { font-size: 14px; line-height: 20px; }
.timeline__time { font-size: 12px; line-height: 20px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.timeline__meta { grid-column: 2 / 4; font-size: 12px; line-height: 16px; color: var(--ink-3); }

/* ---------- sheet: нижняя шторка на телефоне ---------- */
.sheet { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; background: var(--surface); border-radius: 18px 18px 0 0; box-shadow: 0 -12px 40px -12px rgba(22, 27, 38, 0.35); }
.sheet__handle { width: 40px; height: 5px; margin: 8px auto 4px; border-radius: var(--r-pill); background: var(--line-2); }
.sheet__head { display: flex; align-items: center; gap: 8px; padding: 6px 16px 10px; }
.sheet__body { display: flex; flex-direction: column; gap: 14px; padding: 0 16px 16px; }
.sheet__foot { display: flex; gap: 10px; padding: 10px 16px 28px; border-top: 1px solid var(--line); }

.btn--busy { cursor: progress; opacity: 0.9; }
.link { color: var(--accent); font-weight: 500; cursor: pointer; }


/* текст ячейки таблицы с многоточием */
.table__text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* границы элементов управления — контраст 3:1 (WCAG 1.4.11) */
.input { border-color: var(--line-control); }
.input--focus { border-color: var(--accent); }
.input--error { border-color: var(--risk); }
.input--unknown { border-color: var(--line-control); }
.input--disabled { border-color: var(--line); }
.check__box, .radio__dot { border-color: var(--line-control); }
.check--on .check__box, .check--mixed .check__box, .radio--on .radio__dot { border-color: var(--accent); }
.check--disabled .check__box { border-color: var(--line); }
.switch__track { background: var(--line-control); }
.switch--on .switch__track { background: var(--accent); }
.cal__d--today { font-weight: 600; }

/* ---------- empty: пустое состояние ---------- */
.empty { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 24px 16px; }
.empty__icon { color: var(--ink-3); }
.empty__title { font-size: 16px; line-height: 22px; font-weight: 600; }
.empty__text { font-size: 13px; line-height: 18px; color: var(--ink-2); }
.empty--lens { max-width: 560px; padding: var(--s-8) var(--s-6); }
.empty--lens .empty__title { font: var(--t-title, 600 20px/28px var(--font)); }
.empty__n { color: var(--ink-2); font-weight: 400; font-variant-numeric: tabular-nums; }
@media (max-width: 767.98px) {
  .empty--lens { padding: var(--s-6) var(--s-4); }
  .empty--lens .btn { min-height: var(--h-touch); }
}

/* поле помощника — как поле ввода */
.composer { border-color: var(--line-control); }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }


/* ---------- date-sheet: окно даты (одно на все поля даты, model.md §4) ---------- */
.date-sheet { display: grid; gap: var(--s-3); min-width: 0; font-variant-numeric: tabular-nums; }
.date-sheet [hidden] { display: none; }
.date-sheet__chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.date-sheet__chip { display: inline-flex; align-items: center; gap: var(--s-1); min-height: var(--h-control); padding: 0 var(--s-3); font: inherit; font-size: 14px; font-weight: 500; white-space: nowrap; color: var(--ink); background: var(--surface); border: 1px solid var(--line-control); border-radius: var(--r-pill); cursor: pointer; }
.date-sheet__chip:hover { background: var(--surface-3); }
.date-sheet__chip[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
.date-sheet__chip--more { color: var(--accent); }
.date-sheet__chip--more[aria-expanded="true"] { background: var(--accent-wash); border-color: var(--accent); }
.date-sheet__sub { font-size: 12px; line-height: 16px; font-weight: 400; color: var(--ink-3); }
.date-sheet__chip[aria-pressed="true"] .date-sheet__sub { color: var(--accent); }
.date-sheet--error .date-sheet__chip:not([aria-pressed="true"]) { border-color: var(--risk); }
.date-sheet__error { font-size: 13px; line-height: 18px; color: var(--risk); }
.date-sheet__more { display: grid; gap: var(--s-2); max-width: 360px; }
.date-sheet__text { width: 100%; }
.date-sheet__hint { min-height: 18px; font-size: 13px; line-height: 18px; color: var(--ink-2); }
.date-sheet__hint--error { color: var(--risk); }
.date-sheet__month { display: flex; align-items: center; gap: var(--s-2); }
.date-sheet__title { flex: 1; min-width: 0; text-align: center; font-weight: 600; }
.date-sheet__week { display: contents; }
.date-sheet__cell { display: flex; min-width: 0; }
.date-sheet__cell > .cal__d { width: 100%; }
.date-sheet__cell > .cal__d:disabled { color: var(--ink-3); background: transparent; cursor: not-allowed; text-decoration: line-through; }
.date-sheet__clear { justify-self: start; }
@media (max-width: 767.98px) {
  .date-sheet__chip, .date-sheet__nav, .date-sheet__clear, .date-sheet__cell > .cal__d { min-width: var(--h-touch); min-height: var(--h-touch); }
  .date-sheet__more { max-width: none; }
  .date-sheet__text { min-height: var(--h-touch); }
}
/* =====================================================================
   ПРОДУКТОВЫЕ ДОПОЛНЕНИЯ (нет в исходном ds.css холста).
   Всё ниже добавлено для работы блоков на настоящих элементах
   (button, a, input, dialog, details) и для адаптации по ширине.
   Литеральные цвета здесь — только те, что на холсте заданы inline-стилями.
   ===================================================================== */

/* ---------- сброс нативных элементов внутри .ds ----------
   :where() даёт нулевую специфичность, поэтому любой блок перекрывает сброс. */
:where(.ds) button { font: inherit; color: inherit; background: none; border: 0; margin: 0; padding: 0; text-align: inherit; cursor: pointer; }
:where(.ds) :is(input, textarea, select) { font: inherit; color: inherit; margin: 0; }
:where(.ds) :is(h1, h2, h3, h4) { margin: 0; font: inherit; }
:where(.ds) :is(ul, ol) { list-style: none; margin: 0; padding: 0; }
:where(.ds) fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
:where(.ds) legend { padding: 0; }
:where(.ds) :where(a[class]) { color: inherit; text-decoration: none; }
:where(.ds) summary { list-style: none; cursor: pointer; }
:where(.ds) summary::-webkit-details-marker { display: none; }
:where(.ds) [hidden] { display: none; }
:where(.ds) :is(figure, blockquote, dl, dd) { margin: 0; }
:where(.ds) kbd { font-family: inherit; }

body.ds { margin: 0; min-height: 100vh; min-height: 100dvh; }
/* viewport-fit=cover (ds/app.html): страница лежит под вырезом и строкой состояния.
   Верх и бока — отступом страницы; низ закрывают сами слои у нижнего края
   (action-bar, tabbar, листы), чтобы их фон доходил до края экрана. */
body.ds { padding: var(--safe-top) var(--safe-right) 0 var(--safe-left); }

.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; }
.skip { position: absolute; left: 16px; top: -64px; z-index: 100; padding: 10px 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-s); box-shadow: var(--e-pop); }
.skip:focus { top: 12px; }

/* ---------- кнопка: нативная недоступность, мелкие размеры, нажатое состояние ---------- */
.btn:disabled, .btn[aria-disabled="true"] { color: var(--ink-3); background: var(--surface-3); border-color: var(--line); box-shadow: none; cursor: not-allowed; }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn--xs { height: 24px; padding: 0 6px; font-size: 12px; gap: 4px; }
.btn--busy .spinner { border-color: rgba(255, 255, 255, 0.35); border-top-color: currentColor; }
.btn:not(.btn--primary).btn--busy .spinner { border-color: var(--line-2); border-top-color: var(--ink-2); }
.btn--on { background: var(--surface); border-color: var(--line-2); }
.chip__remove { display: inline-flex; margin-right: -4px; color: inherit; border-radius: 4px; }

/* ---------- поле: настоящий input внутри составного .input ---------- */
.input__control { flex: 1; min-width: 0; padding: 0; color: inherit; background: transparent; border: 0; outline: 0; font: inherit; line-height: inherit; }
.input__control::placeholder { color: var(--ink-3); }
textarea.input, .input textarea.input__control { resize: vertical; }
.input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input--error:focus-within, .input[aria-invalid="true"] { border-color: var(--risk); box-shadow: 0 0 0 3px var(--risk-soft); }
.input:is(input, textarea, select):focus-visible, .input__control:focus-visible { outline: 0; }
.input:disabled, .input:has(.input__control:disabled) { color: var(--ink-3); background: var(--surface-3); border-color: var(--line); box-shadow: none; }
button.input { width: 100%; text-align: left; cursor: pointer; }
.example__body { margin-top: 6px; padding: 10px 12px; font-size: 13px; line-height: 19px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s); }
.example[open] .example__toggle .icon { transform: rotate(180deg); }
.field__help .example { display: inline; }
.field__help .example__body { display: block; }

/* переключатели на настоящих input: вид берётся из :checked, модификаторы остаются для сервера */
:is(.switch, .check, .radio, .seg__item, .outcome__item) { position: relative; }
.switch:has(input:checked) .switch__track { background: var(--accent); }
.switch:has(input:checked) .switch__track::after { left: 16px; }
.switch:has(input:disabled) { opacity: 0.55; }
.check:has(input:checked) .check__box, .check:has(input:indeterminate) .check__box { background: var(--accent); border-color: var(--accent); }
.check__box .icon { visibility: hidden; }
.check--on .check__box .icon, .check:has(input:checked) .check__box .icon { visibility: visible; }
.check__dash { display: none; width: 8px; height: 2px; background: #ffffff; border-radius: 1px; }
.check--mixed .check__dash, .check:has(input:indeterminate) .check__dash { display: block; }
.check:has(input:indeterminate) .check__box .icon { visibility: hidden; }
.radio:has(input:checked) .radio__dot { border-color: var(--accent); }
.radio:has(input:checked) .radio__dot::after { content: ""; width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--accent); }
:is(.switch, .check, .radio) input:focus-visible + :is(.switch__track, .check__box, .radio__dot) { outline: 2px solid var(--focus); outline-offset: 2px; }
.seg__item:has(input:checked) { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(22, 27, 38, 0.12), 0 0 0 1px rgba(22, 27, 38, 0.04); }
.seg__item:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.outcome__item:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.outcome__item:has(input:checked) .icon { color: var(--accent); }
.outcome__item:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.outcome--compact .outcome__item { grid-template-columns: 20px minmax(0, 1fr); }

/* ---------- ссылка-заголовок строки растягивается на всю строку ---------- */
.task-row { position: relative; }
.task-row__link { color: inherit; }
.task-row__link::after { content: ""; position: absolute; inset: 0; }
.task-row__link:focus-visible { outline: 0; }
.task-row:has(.task-row__link:focus-visible) { outline: 2px solid var(--focus); outline-offset: -2px; }
.task-row :is(.row-actions, .chip__remove, .due, .save-state) { position: relative; z-index: 1; }
.task-row--compact { grid-template-columns: 14px minmax(0, 1fr); }
.task-row--closed .task-row__title { color: var(--ink-3); }
.row-actions { visibility: hidden; }
.task-row:hover .row-actions, .task-row:focus-within .row-actions, .task-row--hover .row-actions { visibility: visible; }
@media (hover: none) { .row-actions { display: none; } }

/* ---------- боковая панель: подпись пункта отдельно, чтобы сворачивать в иконки ---------- */
.nav-item__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-item--drop { color: var(--ink); background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.nav-item--queue-on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item__why { margin-left: auto; flex: none; font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nav-item__why--wait { color: var(--wait); }
.nav-item__why--risk { color: var(--risk); }
.nav-item__why--mine { color: var(--accent); }
.nav-item--away { flex-wrap: wrap; height: auto; min-height: 34px; padding-block: 4px; row-gap: 0; }
.nav-item__why--away { flex: 1 0 100%; margin-left: 0; padding-left: 34px; color: var(--ink-2); font-weight: 500; }
.nav-item--away .avatar { background: var(--surface-3); color: var(--ink-2); }
.nav-item--more { color: var(--ink-2); }
.nav-item--more .nav-item__label { font-size: 13px; }
.sidebar__search .input__control { height: 100%; }
.sidebar__add { display: inline-flex; padding: 2px; color: var(--ink-3); border-radius: 4px; }
/* у полей внутри составных оболочек нет своей рамки фокуса — её показывает оболочка */
.sidebar__search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.command__head:focus-within { box-shadow: inset 0 -2px 0 var(--accent); }

/* ---------- рабочая область: список + дело (+ помощник) ---------- */
.workspace { flex: 1; display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr); min-height: 0; position: relative; }
.workspace--wide { grid-template-columns: minmax(320px, 1fr) min(830px, calc(100% - 320px)); }
.workspace--focused { grid-template-columns: minmax(0, 1fr); }
.workspace--focused > .workspace__list { display: none; }
.workspace.workspace--focused > .drawer { width: 100%; }
.workspace--focused > .drawer > .drawer__body { align-items: center; }
.workspace--focused > .drawer > .drawer__body > * { width: min(100%, 1120px); }
@media (min-width: 1280px) {
  .workspace--focused .delegation-nav { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
/* 1280–1479: помощник заменяет список; четвёртой колонкой — только от 1480 */
.workspace--assistant { grid-template-columns: minmax(0, 1fr) 340px; }
.workspace--assistant > .workspace__list { display: none; }
.workspace:not(:has(> .drawer:not([hidden]))):not(.workspace--assistant) { grid-template-columns: minmax(0, 1fr); }
.workspace__list { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: auto; }
.workspace__pad { display: flex; flex-direction: column; gap: 24px; padding: 20px 24px 24px; }
.aside-panel { display: flex; flex-direction: column; gap: 20px; min-width: 0; padding: 20px 16px; background: var(--surface-2); border-left: 1px solid var(--line); overflow: auto; }
.drawer__body, .assistant__body, .panel__body, .mobile__body { overflow: auto; }
.drawer__head { display: flex; flex-direction: column; gap: 10px; }
.drawer__col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.drawer__assistant--on { color: var(--model); background: var(--model-soft); }
.drawer__to-list { display: none; }
.workspace--assistant .drawer__to-list { display: inline-flex; }
@media (min-width: 1480px) {
  .workspace--assistant { grid-template-columns: minmax(320px, 1fr) minmax(480px, 560px) 340px; }
  .workspace--assistant > .workspace__list { display: flex; }
  .workspace--assistant .drawer__to-list { display: none; }
  .workspace--focused.workspace--assistant { grid-template-columns: minmax(0, 1fr) 340px; }
  .workspace--focused.workspace--assistant > .workspace__list { display: none; }
}

/* ---------- мелкие элементы, заданные на холсте inline-стилями ---------- */
.menu__group { padding: 6px 10px 2px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--ink-3); }
.menu__item:hover, .menu__item:focus-visible { background: var(--surface-2); }
.menu__item:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.popover__hint { padding-bottom: 10px; }
.popover__icon--wait { color: var(--wait); }
.command__head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.command__head .input__control { font-size: 15px; }
.preview-list { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-m); }
.preview-list__title { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--ink-2); }
.preview-list__item { display: flex; align-items: baseline; gap: 10px; font-size: 13px; line-height: 18px; color: var(--ink); }
.fact--presented { padding: 12px 14px; background: var(--a-2); border: 1px solid var(--wait-line); border-radius: var(--r-m); }
.fact--presented:first-child { padding-top: 12px; }
.facts { display: flex; flex-direction: column; }
.empty__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.skel--dot { width: 12px; height: 12px; border-radius: var(--r-pill); }
.skel--title { width: 64%; height: 12px; margin-top: 4px; }
.skel--meta { grid-column: 2 / 4; width: 40%; }
.task-row:nth-child(3n + 2) .skel--title { width: 55%; }
.task-row:nth-child(3n + 2) .skel--meta { width: 30%; }
.task-row:nth-child(3n) .skel--title { width: 70%; }
.skeleton--drawer { display: flex; flex-direction: column; gap: 12px; padding: 8px 4px; }
.skeleton__tags { display: flex; gap: 6px; }
.skel--heading { width: 80%; height: 16px; }
.skel--tag { width: 90px; height: 20px; }
.skel--block { width: 100%; height: 60px; border-radius: var(--r-m); }
.skel--row { width: 100%; height: 44px; border-radius: var(--r-m); }
.loading { display: flex; align-items: center; gap: 8px; }
.skeleton .loading { margin-top: 12px; }
.queue__icon--mine { color: var(--accent); }
.queue__icon--wait { color: var(--wait); }
.board__head--mine { color: var(--accent); }
.board__head--wait { color: var(--wait); }
.board__head--close { color: var(--ink-2); }
.board__col--close { background: transparent; border: 1.5px dashed var(--line-2); }
.board__hint { padding: 0 4px; font-size: 12px; line-height: 16px; color: var(--ink-3); }
.board__list { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.board__col:not(.board__col--drop) .board__drop { display: none; }
.card[draggable="true"] { cursor: grab; }
.card { position: relative; }
.card__title::after { content: ""; position: absolute; inset: 0; }
.drawer__bar { flex-wrap: wrap; }
.drawer__bar .btn { flex-shrink: 0; }
.drawer__pos { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.card:has(.card__title:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.card__title:focus-visible { outline: 0; }
.card--dragging { opacity: 0.5; }
.card--blocked { border-color: var(--risk-line); box-shadow: 0 0 0 3px var(--risk-soft); }
.card__reason { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; line-height: 16px; color: var(--risk); }
.table-scroll { max-width: 100%; overflow-x: auto; }
.table__cell--title { display: flex; align-items: center; gap: 10px; }
.table__cell--num { font-variant-numeric: tabular-nums; }
.table__row--group .table__cell { grid-column: 1 / -1; }
.table__group-count { font-weight: 500; color: var(--ink-3); }
.tabbar__count { font-variant-numeric: tabular-nums; }
.disclosure__chevron { margin-left: 8px; }
details[open] > .disclosure .disclosure__chevron { transform: rotate(180deg); }
.disclosure__body { padding: 12px 4px 0; }
.contact__text { min-width: 0; }
.contact__title, .contact__meta { display: block; }
.contact--drop { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent-line); }
.contact--moved { opacity: 0.7; }
.contact--moved .contact__title { text-decoration: line-through; }
.event--moved { opacity: 0.6; }
.event--moved .event__title { text-decoration: line-through; }
.recent { display: flex; flex-direction: column; gap: 10px; padding: 0 8px; }
.recent__item { display: flex; gap: 10px; align-items: baseline; font-size: 13px; line-height: 18px; color: var(--ink); }
.composer__input { padding: 5px 0; resize: none; }
.composer .btn--icon { width: 30px; height: 30px; }
.proposal__done-icon { color: var(--done); }
.proposal--rejected { border-style: solid; border-color: var(--line); opacity: 0.8; }
.proposal--rejected .proposal__head { color: var(--ink-3); }
.save-state--saving { color: var(--ink-2); }
.save-state__ok { color: var(--done); }
.tip--single { grid-template-columns: 18px minmax(0, 1fr); }
.tip .btn--icon { width: 24px; height: 24px; }
.cal__d:is(button, a) { width: 100%; }
.cal__d:is(button, a):hover { background: var(--surface-3); }
.cal__d--on:is(button, a):hover { background: var(--accent-hover); }
.shortcuts { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px 14px; align-items: center; }
.shortcuts__group { grid-column: 1 / -1; padding-top: 6px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--ink-3); }
.shortcuts__keys { display: flex; gap: 4px; }
.dialog__icon--risk { color: var(--risk); }
.dialog__icon--wait { color: var(--wait); }

/* ---------- конфликт версий: «ваш вариант» и «сохранено сейчас» ---------- */
.conflict { display: flex; flex-direction: column; gap: 14px; }
.conflict__grid { display: grid; grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1fr); gap: 10px 12px; font-size: 13px; line-height: 18px; }
.conflict__head { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--ink-3); }
.conflict__label { color: var(--ink-3); }
.conflict__value { padding: 8px 10px; background: var(--surface-2); border-radius: var(--r-s); white-space: pre-wrap; overflow-wrap: anywhere; }
.conflict__value--diff { background: var(--accent-soft); }
.conflict__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- слои: окошко, диалог, шторка, сообщение ---------- */
.popover[data-ds-popover-panel] { position: fixed; z-index: 40; max-width: min(380px, calc(100vw - 32px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; }
.popover--wide { width: 360px; }
.ds-window { display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--surface); }
.ds-window__head, .ds-window__foot { flex: 0 0 auto; }
.ds-window__content { display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column; overflow: hidden; }
.ds-window__body { flex: 1 1 auto; min-height: 0; overflow: auto; }
dialog.dialog { width: var(--dialog-w, min(700px, calc(100vw - 32px))); max-height: calc(100vh - 64px); max-height: calc(100dvh - 64px); margin: 120px auto auto; padding: 0; color: var(--ink); border: 0; overflow: auto; }
dialog.dialog::backdrop { background: rgba(22, 27, 38, 0.38); }
/* .dialog { display: flex } из холста — авторское правило, оно перебивает браузерное
   dialog:not([open]) { display: none }: закрытый диалог оставался бы на странице и перехватывал клики. */
dialog.dialog:not([open]) { display: none; }
/* ширина через переменную: dialog.dialog специфичнее модификатора */
.dialog--narrow { --dialog-w: min(460px, calc(100vw - 32px)); }
.dialog__foot, .action-bar { flex-wrap: wrap; }
.dialog__foot .text-small { flex: 1 1 220px; }
.dialog__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.quick-picks { display: flex; flex-wrap: wrap; gap: 6px; }
button.chip { cursor: pointer; }
.scrim--fixed { position: fixed; z-index: 45; }
.sheet[data-ds-sheet] { position: fixed; z-index: 50; max-height: 85vh; max-height: 85dvh; overflow: auto; }
.toast-region { position: fixed; left: 50%; bottom: 24px; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; transform: translateX(-50%); pointer-events: none; }
.toast-region .toast { pointer-events: auto; }
.toast__undo { color: var(--c-7); font-weight: 500; flex-shrink: 0; white-space: nowrap; }
.toast--error { background: var(--r-12); }
.toast--error .icon { color: var(--r-7); }
.toast--error .toast__undo { color: var(--r-6); }
.toast--wait .icon { color: var(--wait-line); }
.bulk-bar__count { font-weight: 600; }
.bulk-bar .btn--ghost { color: var(--line-2); border-color: transparent; }

/* ---------- движение: только при отсутствии настройки «уменьшить движение» ---------- */
@media (prefers-reduced-motion: no-preference) {
  .drawer[data-ds-drawer-panel] { animation: ds-drawer-in var(--dur-panel) var(--ease-out); }
  .popover[data-ds-popover-panel]:not([hidden]) { animation: ds-pop-in var(--dur-fast) var(--ease-out); }
  .swipe .task-row { transition: transform var(--dur-fast) var(--ease-out); }
}
@keyframes ds-drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ds-pop-in { from { transform: translateY(-4px); opacity: 0; } to { transform: none; opacity: 1; } }

/* свайп: на холсте строка нарисована уже сдвинутой; в продукте сдвиг только в открытом состоянии */
.swipe .task-row { transform: none; box-shadow: none; }
.swipe--open .task-row { transform: translateX(-144px); box-shadow: 8px 0 16px -10px rgba(22, 27, 38, 0.25); }
.swipe { touch-action: pan-y; }
.swipe__btn--wait { background: var(--wait); }
.swipe__btn--done { background: var(--done); }

/* =====================================================================
   АДАПТАЦИЯ (добавлено: на холсте экраны нарисованы фиксированной ширины
   1440 и 390). Брейкпоинты: ≥1480 помощник колонкой, ≥1280 три зоны,
   768–1279 панель дела поверх списка, 768–1023 боковая панель иконками,
   <768 одна колонка с нижними вкладками.
   ===================================================================== */
.app { width: auto; height: calc(100vh - var(--safe-top)); height: calc(100dvh - var(--safe-top)); }
.mobile { width: auto; height: calc(100vh - var(--safe-top)); height: calc(100dvh - var(--safe-top)); }
.tabbar { display: none; }

@media (max-width: 1279.98px) {
  .workspace, .workspace--wide, .workspace--assistant { grid-template-columns: minmax(0, 1fr); }
  .workspace > .drawer, .workspace > .assistant { position: absolute; top: 0; right: 0; bottom: 0; z-index: 20; width: min(720px, 66.6667%); }
  .workspace--wide > .drawer { width: min(830px, calc(100% - 120px)); }
  .workspace--assistant > .assistant { position: static; width: auto; }
  .drawer__cols { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1023.98px) {
  .app { grid-template-columns: 64px minmax(0, 1fr); }
  .sidebar { padding: 8px 6px 12px; align-items: stretch; }
  .sidebar :is(.nav-item__count, .sidebar__label, .sidebar__brand-name, .sidebar__search .kbd, .sidebar__actions .kbd, .sidebar__actions .grow) { display: none; }
  /* подписи прячутся визуально, но остаются именем ссылки для чтения с экрана */
  .sidebar :is(.nav-item__label, .sidebar__actions .btn__text) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .sidebar__search .input__control { width: 0; flex: 0; }
  .sidebar__brand { justify-content: center; padding: 0; }
  .sidebar__brand .avatar { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .sidebar__actions .btn { padding: 0; }
  .sidebar__search { justify-content: center; padding: 0; }
  .workspace > .drawer, .workspace > .assistant, .workspace--wide > .drawer { width: 66.6667%; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .board { grid-template-columns: repeat(4, minmax(240px, 1fr)); overflow-x: auto; }
}

@media (max-width: 767.98px) {
  .delegation-mode__choices { grid-template-columns: minmax(0, 1fr); }
  .delegation-mode__actions > .btn { flex: 1 1 140px; }
  .delegation-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .delegation-slot__controls, .delegation-summary__item { grid-template-columns: minmax(0, 1fr); }
  .delegation-summary__item { gap: var(--s-1); }
  .app { display: flex; flex-direction: column; padding: 0; }
  .app > .sidebar { display: none; }
  .app__main { border: 0; border-radius: 0; box-shadow: none; }
  .tabbar { display: grid; position: sticky; bottom: 0; z-index: 30; padding-bottom: max(6px, var(--safe-bottom)); }
  .page-head { flex-wrap: wrap; padding: 10px 16px; }
  .toolbar { flex-wrap: wrap; padding: 10px 16px; }
  .seg { flex-wrap: wrap; max-width: 100%; }
  .seg__item { flex: 1 1 auto; justify-content: center; }
  .workspace__pad { padding: 16px; }
  .workspace > .drawer, .workspace > .assistant, .workspace--wide > .drawer { position: fixed; inset: 0; z-index: 35; width: auto; border-left: 0; padding: var(--safe-top) var(--safe-right) 0 var(--safe-left); }
  /* Лист у нижнего края: последняя строка над «домашней чертой», фон до края.
     Распорка, а не padding: у окон продукта свой padding корня. */
  .popover[data-ds-popover-panel]::after, dialog.dialog::after { content: ""; flex: none; height: var(--safe-bottom); }
  .drawer__body { padding: 16px; }
  .action-bar { flex-wrap: wrap; padding: 10px 16px max(10px, var(--safe-bottom)); }
  .task-row { padding: 13px 16px 14px; }
  .row-actions { display: none; }
  .task-row__title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .btn, .input, .nav-item, .menu__item, .filter, .seg__item, .disclosure, .tabbar__item { min-height: var(--h-touch); }
  .btn { height: auto; }
  .btn--icon { width: var(--h-touch); }
  /* цели касания не меньше 44×44, включая второстепенные кнопки и сегменты */
  .btn--sm, .btn--xs { min-height: var(--h-touch); }
  .row-actions .btn, .composer .btn--icon, .tip .btn--icon { width: var(--h-touch); height: var(--h-touch); }
  :is(.chip__remove, .toast__undo, .sidebar__add, .example__toggle, .link, button.chip, .table__sort, .cal__d:is(button, a)) { min-width: var(--h-touch); min-height: var(--h-touch); }
  .link { display: inline-flex; align-items: center; }
  :is(.check, .radio, .switch) { min-width: var(--h-touch); min-height: var(--h-touch); }
  .tabs__item { min-width: var(--h-touch); min-height: var(--h-touch); justify-content: center; }
  .composer__input { min-height: var(--h-touch); }
  .input:has(> input.input__control) { padding-block: 0; }
  .input__control { align-self: stretch; min-height: var(--h-touch); }
  .sidebar__search, :is(.sidebar__search, .command__head) .input__control { min-height: var(--h-touch); }
  /* Бока листа — по безопасной области: в альбоме под вырезом не остаётся кнопок. */
  .popover[data-ds-popover-panel] { left: var(--safe-left); right: var(--safe-right); top: auto; bottom: 0; max-width: none; max-height: 85vh; max-height: 85dvh; border-radius: 18px 18px 0 0; box-shadow: 0 -12px 40px -12px rgba(22, 27, 38, 0.35); }
  dialog.dialog { width: calc(100% - var(--safe-left) - var(--safe-right)); max-width: none; max-height: 92vh; max-height: 92dvh; margin: auto var(--safe-right) 0 var(--safe-left); border-radius: 18px 18px 0 0; }
  .board { grid-template-columns: repeat(4, 84%); scroll-snap-type: x mandatory; padding: 12px 16px 16px; }
  .board__col { scroll-snap-align: start; }
  .week { grid-template-columns: minmax(0, 1fr); }
  .week__day { border-right: 0; border-bottom: 1px solid var(--line); }
  .table-scroll { overflow-x: auto; }
  .table-scroll .table { min-width: 640px; }
  .conflict__grid { grid-template-columns: minmax(0, 1fr); }
  .conflict__head { display: none; }
  .conflict__value::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 600; color: var(--ink-3); }
  .toast-region { bottom: calc(72px + var(--safe-bottom)); width: calc(100% - 32px); }
  /* Лист снизу занимает низ экрана: сообщение с «Отменить» уходит наверх, а не ложится на его чипы. */
  body:has(.popover[data-ds-popover-panel]:not([hidden]), .sheet--modal[data-ds-sheet]:not([hidden])) .toast-region { top: calc(16px + var(--safe-top)); bottom: auto; }
  .bulk-bar { flex-wrap: wrap; }
}

/* =====================================================================
   ВЫБОР ДЕЛ И СПРАВОЧНИКИ (FLT6): task-row--picking, row-actions «⋯»,
   bulk-bar, cat-row — одинаковы во всех копиях ds.css, сверку держит
   tests/test_ds_flt6_blocks.py.
   ===================================================================== */
.task-row--picking { grid-template-columns: 22px minmax(0, 1fr) auto; }
.task-row--picking .task-row__pick { position: static; align-self: start; margin-top: var(--s-1); }
/* Подложка флажка накрывает всю строку: щелчок по названию или по строке под ним отмечает дело,
   а не открывает его. Поэтому у флажка position: static, а точкой отсчёта служит сама строка. */
.task-row--picking .task-row__pick::after { content: ""; position: absolute; inset: 0; }
.task-row--picking :is(.due, .save-state) { position: static; z-index: auto; }
.task-row--picking:has(.task-row__pick input:checked) { background: var(--accent-soft); }
.task-row--picking:has(.task-row__pick input:focus-visible) { outline: 2px solid var(--focus); outline-offset: -2px; }

.row-actions:has([aria-expanded="true"]) { visibility: visible; }
.row-actions .btn[aria-expanded="true"] { background: var(--surface); border-color: var(--line-2); }

.bulk-bar__count { font-weight: 600; white-space: nowrap; }
.bulk-bar__acts { display: flex; align-items: center; gap: var(--s-1); padding-inline: var(--s-2); border-inline: 1px solid var(--ink-2); }
.bulk-bar :is(.bulk-bar__act, .bulk-bar__cancel) { color: var(--ink-inv); background: transparent; border-color: transparent; box-shadow: none; }
.bulk-bar :is(.bulk-bar__act, .bulk-bar__cancel):hover { background: var(--ink-2); }
.bulk-bar--dock { position: sticky; bottom: var(--s-6); z-index: 20; width: max-content; max-width: 100%; margin-inline: auto; }
:is(.app, .mobile):has(.bulk-bar--dock) > .tabbar { display: none; }

.cat-row { display: flex; align-items: center; gap: var(--s-3); min-height: 52px; padding: 0 var(--s-3) 0 var(--s-6); border-bottom: 1px solid var(--line); }
.cat-row:hover { background: var(--surface-2); }
.cat-row:has([aria-expanded="true"]) { background: var(--accent-soft); }
.cat-row__icon { flex: none; color: var(--ink-2); }
.cat-row__name { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-row__n { flex: none; color: var(--ink-2); font: var(--t-meta); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cat-row__n--none { color: var(--ink-3); }
.cat-row--archived .cat-row__name { color: var(--ink-2); font-weight: 400; }
.cat-row--edit { padding-block: var(--s-2); background: var(--surface-2); }
.cat-row__form { display: flex; flex: 1; align-items: center; gap: var(--s-2); min-width: 0; }
.cat-row__form .input { flex: 1; min-width: 0; }
.menu__item--risk, .menu__item--risk .icon { color: var(--risk); }

@media (max-width: 767.98px) {
  .task-row--picking .task-row__pick { min-width: 0; min-height: 0; margin-top: 0; }
  .task-row--picking .check__box { width: 22px; height: 22px; }
  .bulk-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0; padding: var(--s-1) var(--s-1) max(var(--s-2), var(--safe-bottom, 0px)); }
  .bulk-bar__count { grid-area: 1 / 1; padding-left: var(--s-3); font-size: 15px; }
  .bulk-bar__cancel { grid-area: 1 / 2; }
  .bulk-bar__acts { grid-area: 2 / 1 / 3 / -1; display: grid; grid-auto-flow: column; align-items: stretch; grid-auto-columns: minmax(0, 1fr); gap: 0; padding: 0; border: 0; }
  .bulk-bar .bulk-bar__act { flex-direction: column; gap: var(--s-1); height: auto; min-height: 52px; padding: var(--s-1) 0; font-size: 12px; line-height: 14px; letter-spacing: -0.01em; white-space: normal; text-align: center; }
  .bulk-bar .bulk-bar__act .icon { width: 22px; height: 22px; }
  .bulk-bar--dock { bottom: 0; z-index: 30; width: auto; max-width: none; margin-inline: 0; border-radius: 0; box-shadow: none; }
  .cat-row { min-height: 56px; padding: 0 var(--s-1) 0 var(--s-4); }
  .cat-row--edit { padding: var(--s-2) var(--s-4); }
  .cat-row__form { flex-wrap: wrap; }
  .cat-row__form .input { flex-basis: 100%; }
  .cat-row__form :is(.cat-row__icon, .avatar) { display: none; }
  .cat-row__form .btn { flex: 1; }
}

/* =====================================================================
   МЕТКИ: ЗАПИСЬ И ВЫБОР (TAG6): capture-suggest, capture-bar, третий вид
   галочки people-list «у части», раздел с seg «Любая из / Все сразу» —
   одинаковы во всех копиях ds.css, сверку держит tests/test_ds_tag6_blocks.py.
   ===================================================================== */
.people-list--multiple .people-list__row[aria-checked="mixed"] .people-list__mark { color: var(--accent); background: var(--surface); border-color: var(--accent); }
.people-list__dash { display: block; width: 10px; height: 2px; border-radius: 1px; background: currentColor; }
.people-list__match { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); padding: var(--s-1) var(--s-4) var(--s-3); }
.people-list__match-label { font: var(--t-meta); color: var(--ink-2); }
.people-list__match .seg { flex: none; min-width: 0; margin: 0; border: 0; }
.people-list__match .seg:disabled { opacity: 0.6; }
.people-list__match .seg:disabled .seg__item { cursor: default; }

.capture-suggest { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); box-shadow: var(--e-pop); overflow: hidden; }
.capture-suggest .people-list__list { max-height: 240px; padding: 0; }
.capture-suggest .people-list__row:first-child { border-top-color: transparent; }
.capture-suggest__foot { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); padding: var(--s-2) var(--s-4); border-top: 1px solid var(--line); background: var(--surface-2); font: var(--t-meta); color: var(--ink-2); }

.capture-bar { display: flex; gap: var(--s-2); padding: var(--s-2) var(--s-3); border-top: 1px solid var(--line); background: var(--surface-3); overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
.capture-bar__item { display: inline-flex; flex: none; align-items: center; gap: var(--s-2); min-height: var(--h-touch); padding: 0 var(--s-4); border: 0; border-radius: var(--r-s); background: var(--surface); box-shadow: var(--e-1); font: var(--t-body); font-weight: 600; color: var(--ink); white-space: nowrap; cursor: pointer; }
.capture-bar__item .people-list__icon { width: auto; height: auto; }
.capture-bar__item--new { color: var(--accent); }
.capture-bar__item[aria-disabled="true"], .capture-suggest .people-list__create[aria-disabled="true"] { opacity: 0.6; cursor: default; }
.capture-bar__item:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* =====================================================================
   МЕТКИ ЗАПИСИ (TAG9): чипы меток под полем «Записать», по строке
   записи на ряд — одинаковы во всех копиях ds.css.
   ===================================================================== */
.capture-tags { display: flex; flex-direction: column; gap: var(--s-2); }
.capture-tags[hidden] { display: none; }
.capture-tags__row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin: 0; }
.capture-tags__label { font: var(--t-meta); color: var(--ink-2); }

/* =====================================================================
   БЛОКИ ЕДИНОЙ МОДЕЛИ (ДС4, model.md §2, §3, §5, §7): одинаковы во всех
   копиях ds.css, сверку держит tools/test_ds4_model_blocks.py.
   ===================================================================== */
.state-mark { --state: var(--st-todo); --state-soft: var(--st-todo-soft); display: inline-flex; align-items: center; gap: var(--s-2); color: var(--state); font: var(--t-strong); white-space: nowrap; }
.state-mark__dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: currentColor; }
.state-mark__note { color: var(--ink-2); font-weight: 400; }
.state-mark--new { --state: var(--st-new); --state-soft: var(--st-new-soft); }
.state-mark--todo { --state: var(--st-todo); --state-soft: var(--st-todo-soft); }
.state-mark--doing { --state: var(--st-doing); --state-soft: var(--st-doing-soft); }
.state-mark--wait { --state: var(--st-wait); --state-soft: var(--st-wait-soft); }
.state-mark--later { --state: var(--st-later); --state-soft: var(--st-later-soft); }
.state-mark--done { --state: var(--st-done); --state-soft: var(--st-done-soft); }
.state-mark--new .state-mark__dot { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.state-mark--later .state-mark__dot { background: transparent; border: 1.5px dashed currentColor; }
.state-mark--plate { min-height: 28px; padding: 0 var(--s-3) 0 var(--s-2); border-radius: var(--r-pill); background: var(--state-soft); box-shadow: inset 0 0 0 1.5px var(--state); font-weight: 600; font-size: 13px; line-height: 16px; }
.state-mark--band { position: absolute; top: var(--s-3); bottom: var(--s-3); left: var(--s-2); width: 4px; padding: 0; border-radius: 2px; background: var(--state); }
.state-mark--band.state-mark--new { background: transparent; box-shadow: inset 0 0 0 1.5px var(--state); }
.state-mark--band.state-mark--later { background: repeating-linear-gradient(180deg, var(--state) 0 3px, transparent 3px 6px); }

.action-bar--card { position: sticky; bottom: 0; z-index: 2; flex: none; flex-wrap: wrap; gap: var(--s-2); min-height: 0; margin-top: auto; padding: var(--s-2) var(--s-3) max(var(--s-3), var(--safe-bottom)); }
/* В карточке (.drawer — колонка, тело прокручивается само) полоса — обычный последний ребёнок, не липкая:
   WebKit поднимал липкую полосу внутри fixed-карточки на высоту липкого таббара под ней (mbar3). */
.drawer > .action-bar--card { position: relative; bottom: auto; }
/* Сообщение не ложится на полосу действий открытой карточки: регион встаёт над ней.
   Высоту полосы пишет продукт в --action-bar-h (меняется с числом рядов). */
body:has(.drawer:not([hidden]) > .action-bar--card:not([hidden])) .toast-region { bottom: calc(var(--action-bar-h, 64px) + 16px); }
.action-bar__mark { display: flex; flex: 1 1 100%; min-width: 0; }
.action-bar__mark > .seg { flex: 1 1 auto; flex-wrap: nowrap; max-width: 100%; }
.action-bar__mark .seg__item { flex: 1 1 0; justify-content: center; min-height: var(--h-touch); }
.action-bar__acts { display: flex; flex: 1 1 100%; flex-wrap: wrap; gap: var(--s-2); min-width: 0; }
.action-bar__acts > .btn { flex: 1 1 auto; min-height: var(--h-touch); padding-inline: var(--s-3); }
.action-bar__reply { display: flex; flex: 1 1 100%; flex-wrap: wrap; align-items: flex-end; gap: var(--s-1) var(--s-2); margin: 0; }
.action-bar__label { flex: 1 1 100%; color: var(--ink-2); font: var(--t-meta); }
.action-bar__question { margin: 0; }
/* Двойной класс: общие правила полей продукта (.ds textarea) не перебивают размер и ручку поля ответа. */
.action-bar__reply > .action-bar__field { flex: 1 1 0; width: auto; min-width: 0; min-height: var(--h-touch); max-height: 140px; padding: var(--s-2) var(--s-3); border: 1px solid var(--line-control); border-radius: var(--r-m); background: var(--surface); color: var(--ink); font: var(--t-body); font-size: 16px; resize: none; field-sizing: content; overflow-y: auto; }
.action-bar__reply > .btn { min-height: var(--h-touch); }
.action-bar__reply[hidden], .action-bar__acts[hidden] { display: none; }

.tabbar__item--active { color: var(--accent); font-weight: 600; }
.tabbar__item[hidden] { display: none; }
.tabbar__label { white-space: nowrap; }
.tabbar__capture { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: var(--s-1); min-width: 0; min-height: var(--h-touch); padding: 0 0 var(--s-2); border: 0; background: none; color: var(--ink); font-size: 11px; line-height: 14px; font-weight: 600; text-decoration: none; cursor: pointer; }
.tabbar__plus { display: grid; place-items: center; width: 48px; height: 40px; border-radius: var(--r-l); background: var(--accent); color: var(--ink-inv); }
.tabbar__plus .icon { width: 24px; height: 24px; }
.tabbar__capture:hover .tabbar__plus { background: var(--accent-hover); }

.section-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
.section-tiles__item { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); min-width: 0; min-height: var(--h-touch); padding: var(--s-2) var(--s-3); border-radius: var(--r-m); background: var(--surface); box-shadow: 0 0 0 1px var(--line); color: var(--ink); font: var(--t-strong); text-decoration: none; }
.section-tiles__item:hover { background: var(--surface-2); }
.section-tiles__name { min-width: 0; overflow-wrap: break-word; }
.section-tiles__count { flex: none; color: var(--ink-3); font-weight: 400; font-variant-numeric: tabular-nums; }
.section-tiles__item--risk .section-tiles__count { color: var(--risk); font-weight: 600; }
.section-tiles--page { margin: var(--s-4) var(--s-5) 0; }
.tile-people { grid-column: 1 / -1; }
.tile-people__text { display: grid; flex: 1 1 auto; min-width: 0; }
.tile-people__faces { display: flex; flex: none; }
.tile-people__faces:empty { display: none; }
.tile-people__faces .avatar { width: 28px; height: 28px; margin-left: -6px; font-size: 12px; color: var(--accent); background: var(--accent-soft); border: 0; box-shadow: 0 0 0 2px var(--surface); }
.tile-people__faces .avatar:first-child { margin-left: 0; }
.tile-people__why { color: var(--ink-2); font: var(--t-meta); }
.tile-people__go { color: var(--ink-3); margin-left: calc(-1 * var(--s-1)); }
.tile-people:has(.tile-people__why:not([hidden])) { min-height: 64px; box-shadow: 0 0 0 1px var(--accent-line); }
.queue__head--flush { padding: var(--s-4) var(--s-5) var(--s-2); }
.screen-foot:not([hidden]) { display: flex; flex-direction: column; gap: var(--s-1); margin-top: var(--s-5); padding: var(--s-4) var(--s-3) var(--s-5); border-top: 1px solid var(--line); }
.screen-foot__who { margin: var(--s-2) 0 0; color: var(--ink-2); font: var(--t-meta); overflow-wrap: anywhere; }
.screen-foot__out { margin: 0; }

.section-switch { display: flex; gap: var(--s-1); padding: var(--s-1); border-radius: var(--r-m); background: var(--surface-3); }
.section-switch__item { display: inline-flex; flex: 1 1 0; align-items: center; justify-content: center; gap: var(--s-1); min-width: 0; min-height: var(--h-touch); padding: 0 var(--s-2); border: 0; border-radius: var(--r-s); background: none; color: var(--ink-2); font: var(--t-strong); white-space: nowrap; cursor: pointer; }
.section-switch__item--on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--e-1), 0 0 0 1px var(--line); }
.section-switch__count { color: var(--ink-2); font-weight: 400; font-variant-numeric: tabular-nums; }
.section-switch__dirty:not([hidden]) { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--wait); }

.sheet__close { flex: none; }
.sheet__cancel { display: none; }
.sheet__main { flex: 1 1 auto; min-height: var(--h-touch); }
.sheet--modal[data-ds-sheet] { left: 0; right: 0; bottom: 0; z-index: 50; max-height: 92vh; max-height: 92dvh; overflow: hidden; box-shadow: var(--e-dialog); }
.sheet--modal .sheet__handle { margin: var(--s-2) auto 0; cursor: grab; }
.sheet--modal :is(.sheet__handle, .sheet__head) { touch-action: none; }
.sheet--modal .sheet__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.sheet--modal .sheet__foot { padding: var(--s-2) var(--s-4) var(--s-3); }
@media (max-width: 1023.98px) {
  .sheet--modal[data-ds-sheet] { padding: 0 var(--safe-right) 0 var(--safe-left); }
  .sheet--modal[data-ds-sheet]::after { content: ""; flex: none; height: var(--safe-bottom); }
}
.veil { position: fixed; inset: 0; z-index: 49; background: var(--scrim); }

@media (min-width: 768px) {
  .section-tiles { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .screen-foot:not([hidden]) { display: none; }
}

/* page-head на телефоне (M1, ЕМ1a, PL8b): заголовок и счётчик без многоточия — имя экрана, которое не влезло, переносится; справа без переноса
   поиск и профиль. __lead обёртывает заголовок и счётчик; от 768 он display: contents и вида не меняет. На странице человека от 768
   заголовка нет, на телефоне он «Люди» без счётчика — вход в «Разделы» остаётся. */
.page-head__lead { display: contents; }
@media (min-width: 768px) { .page-head--person .page-head__lead { display: none; } }
@media (max-width: 767.98px) {
  .page-head--person .page-head__count { display: none; }
  .page-head { flex-wrap: nowrap; min-height: calc(var(--h-touch) + var(--s-3)); gap: var(--s-1); padding: var(--s-1) var(--s-2) var(--s-1) var(--s-4); }
  .page-head > .grow { display: none; }
  .page-head > :not(.page-head__lead) { flex: none; }
  .page-head__lead { position: relative; display: flex; flex: 1 1 0; flex-wrap: wrap; align-items: center; align-content: center; gap: 0 var(--s-1); min-width: 0; min-height: var(--h-touch); }
  .page-head__title { flex: 0 1 auto; min-width: 0; font-size: 18px; line-height: 24px; }
  .page-head__count { flex: none; font-size: 16px; line-height: 24px; }
  .page-head > .seg { display: none; }
  .section-tiles--page { margin-inline: var(--s-4); }
  .queue__head--flush { padding-inline: var(--s-4); }
}

@media (min-width: 1024px) {
  .action-bar--card { padding: var(--s-3) var(--s-5); }
  .action-bar__mark { flex: 0 1 auto; }
  .action-bar__acts { flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
  .action-bar__acts > .btn { flex: none; min-height: 0; padding-inline: var(--s-4); }
  .action-bar__question { flex: 0 1 auto; align-self: center; }
  .action-bar__reply > .action-bar__field, .action-bar__reply > .btn { min-height: var(--h-control); }
  .section-switch__item { min-height: var(--h-control); }
  .sheet--modal[data-ds-sheet] { left: 50%; right: auto; bottom: auto; top: 12vh; width: min(480px, calc(100vw - 32px)); max-height: 76vh; border-radius: var(--r-l); translate: -50% 0; }
  .sheet--modal .sheet__handle { display: none; }
  .sheet--modal .sheet__head { padding-top: var(--s-4); }
  .sheet--modal .sheet__foot { justify-content: flex-end; padding: var(--s-3) var(--s-4); background: var(--surface-2); }
  .sheet__cancel { display: inline-flex; }
  .sheet__main { flex: none; min-height: 0; }
}

/* sheet--side: на компьютере лист встаёт окном справа во всю высоту (данные человека, «Мои данные»). */
@media (min-width: 1024px) {
  .sheet--modal.sheet--side[data-ds-sheet] { top: 8px; right: 8px; bottom: 8px; left: auto; width: min(480px, calc(100vw - 16px)); max-height: none; translate: none; border-radius: var(--r-l); }
}

@media (prefers-reduced-motion: no-preference) {
  .sheet--modal[data-ds-sheet]:not([hidden]) { animation: ds-sheet-in var(--dur-panel) var(--ease-out); }
  .veil:not([hidden]) { animation: ds-veil-in var(--dur-panel) var(--ease-out); }
}
@keyframes ds-sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ds-veil-in { from { opacity: 0; } to { opacity: 1; } }

/* =====================================================================
   МЕТКИ (TAG5): tag, tag-dot, task-row__tags, menu__swatches и точка цвета
   в people-list, cat-row, lens — одинаковы во всех копиях ds.css, сверку
   держит tests/test_ds_tag5_blocks.py.
   ===================================================================== */
/* Метка — белая «таблетка» в тонкой рамке, цвет только у точки, текст тёмный: иначе её не отличить
   от плашки состояния (chip — заливка). Цвет задаёт модификатор через --tag, у точки серый по умолчанию. */
.tag--gray { --tag: var(--tag-gray); }
.tag--blue { --tag: var(--tag-blue); }
.tag--amber { --tag: var(--tag-amber); }
.tag--red { --tag: var(--tag-red); }
.tag--green { --tag: var(--tag-green); }
.tag--violet { --tag: var(--tag-violet); }
.tag { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 22px; margin: 0; padding: 0 var(--s-2) 0 7px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--ink); font: inherit; font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap; }
.tag__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tag, var(--tag-gray)); flex: none; }
.tag--more { padding: 0 7px; color: var(--ink-2); }
.tag--lg { height: 28px; padding: 0 var(--s-1) 0 10px; font-size: 13px; }
.tag__x { display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ink-2); cursor: pointer; }
.tag__x .icon { width: 12px; height: 12px; }
.tag__x:hover { background: var(--surface-2); color: var(--ink); }
:is(.tag, .tag__x, .menu__swatch):focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.tag-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--tag, var(--tag-gray)); flex: none; }
.tag-dot--none { background: none; border: 1.5px dashed var(--line-control); }

.task-row__tags { display: inline-flex; gap: var(--s-1); flex: none; }

.menu__label { display: flex; align-items: center; gap: 10px; padding: var(--s-2) var(--s-3) 0; color: var(--ink-2); font-size: 13px; }
.menu__label .icon { width: 20px; }
.menu__swatches { display: flex; align-items: center; gap: var(--s-3); padding: 6px var(--s-3) var(--s-2) var(--s-10); }
.menu__swatch { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.menu__swatch .tag-dot { width: 16px; height: 16px; }
.menu__swatch[aria-current="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }

.people-list__icon .tag-dot { width: 12px; height: 12px; }
.cat-row .tag-dot { margin: 0 3px; }
.lens__chip .tag-dot { margin-right: 2px; }
.lens__chip--tag { color: var(--ink); border-color: var(--line-2); }

/* На компьютере метка в строке — своя цель щелчка (ставит её в фильтр), поэтому выше ссылки строки.
   На телефоне и в режиме выбора щелчок по метке принадлежит строке. */
@media (min-width: 768px) {
  .task-row__tags { position: relative; z-index: 1; }
  .task-row--picking .task-row__tags { position: static; z-index: auto; }
  button.tag { cursor: pointer; }
  button.tag:hover { border-color: var(--line-control); }
}

@media (max-width: 767.98px) {
  .task-row__tags { order: 3; flex-basis: 100%; }
  .tag--lg { height: 36px; }
  .tag__x { width: 44px; height: 44px; margin: -4px -4px -4px 0; }
  .menu__label { padding: 10px var(--s-4) 0; }
  .menu__swatches { justify-content: space-between; padding: var(--s-1) var(--s-4) 10px calc(var(--s-10) + var(--s-2)); }
  .menu__swatch { flex: none; width: 44px; height: 44px; }
  .menu__swatch .tag-dot { width: 22px; height: 22px; }
  .cat-row__form .tag-dot { display: none; }
}

/* =====================================================================
   ВАЖНОЕ (IMP2a): star — звезда «Важное» в строке, star-btn — она же в
   карточке у названия. Одинаковы во всех копиях ds.css, сверку держит
   tests/test_frontend_important.py.
   ===================================================================== */
/* Цвета строки заняты состояниями, поэтому звезда чернилами: залитая — важное, контур — можно отметить.
   Место — свой правый столбец первой строки, после срока. */
.task-row--star { grid-template-columns: 14px minmax(0, 1fr) auto 24px; }
.task-row--star .task-row__meta { grid-column: 2 / 4; }
.star { position: relative; z-index: 1; display: inline-grid; place-items: center; width: 24px; height: 24px; margin-top: -2px; padding: 0; border: 0; border-radius: var(--r-pill); background: none; color: var(--ink); cursor: pointer; }
.star .icon { width: 18px; height: 18px; stroke-width: 1.5; }
.star--on .icon { fill: currentColor; }
.star--off { color: var(--ink-3); visibility: hidden; }
.star:hover { background: var(--surface-3); }
.star:focus-visible { visibility: visible; outline: 2px solid var(--focus); outline-offset: 1px; }
.task-row:hover .star--off, .task-row:focus-within .star--off, .task-row--hover .star--off { visibility: visible; }
/* «★ N» у числа группы: сколько в ней важных (IMP2b). */
.queue__imp { display: inline-flex; align-items: center; gap: 3px; color: var(--ink-2); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.queue__imp .icon { width: 13px; height: 13px; fill: currentColor; stroke-width: 1.4; }
.task-row--imp-last { border-bottom-color: var(--line-control); }
.star-btn { gap: 6px; }
.star-btn .icon { stroke-width: 1.5; }
.star-btn[aria-pressed="true"] { color: var(--ink); background: var(--surface-3); }
.star-btn[aria-pressed="true"] .icon { fill: currentColor; }
.star-btn small { color: var(--ink-2); font-size: 13px; font-weight: 400; }
@media (max-width: 767.98px) {
  /* Касание без наведения: пустая звезда видна всегда, бледно; цель 44×44 поверх отступов строки. */
  .star { width: 44px; height: 44px; margin: -12px -12px -10px -10px; }
  .star--off { visibility: visible; color: var(--line-control); }
  .star .icon { width: 20px; height: 20px; }
  .star-btn { min-height: var(--h-touch); }
  .star-btn small { display: none; }
}

/* =====================================================================
   ВИД СПИСКА (VW1): qf__more--view — кнопка «Вид» рядом с «Ещё…»,
   vw-pop / sheet--view — окно вида, qf-sum--view — строка «Дела …».
   Макет docs/proposals/list-view-2026-10/prototype.html, В0, В1, В5, В6.
   ===================================================================== */
/* Сплошная рамка: «Вид» ничего не прячет, только раскладывает. */
.qf__end { gap: var(--s-1); }
.qf__more[hidden] { display: none; }
.qf .qf__more--view { --qf-line-style: solid; color: var(--ink); }
.qf .qf__more--view .icon { color: var(--ink-2); }
.qf .qf__more--set { --qf-line: var(--accent-line); --qf-bg: var(--accent-wash); color: var(--accent); font-weight: 600; }
.qf .qf__more--set .icon { color: var(--accent); }
.qf .qf__more--view[aria-expanded="true"] { --qf-line: var(--accent-line); --qf-ring: 0 0 0 3px var(--accent-soft); color: var(--accent); }
.qf-sum--view .qf-sum__text b { color: var(--ink); }
.qf-sum + .qf-sum { padding-top: 0; }
.vw-pop { width: 312px; padding: var(--s-2) 0; }
.vw-set { margin: 0; padding: var(--s-1) 0 var(--s-2); border: 0; }
.vw-set > :not(legend) { clear: both; }
.vw-set + .vw-set { border-top: 1px solid var(--line); padding-top: var(--s-2); }
.vw-set legend { float: left; width: 100%; padding: var(--s-2) var(--s-4) var(--s-1); font: var(--t-meta); color: var(--ink-2); }
.vw-opt { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: var(--s-3); width: 100%; min-height: 40px; padding: 0 var(--s-4); border: 0; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.vw-set .vw-opt { font: var(--t-body); }
.vw-opt:hover { background: var(--surface-2); }
.vw-opt:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.vw-opt .icon { width: 16px; height: 16px; color: var(--ink-2); }
.vw-opt__name { font-weight: 500; }
.vw-opt__hint { color: var(--ink-3); font: var(--t-meta); white-space: nowrap; }
.vw-opt--on { background: var(--accent-wash); }
.vw-opt--on .vw-opt__name { color: var(--accent); font-weight: 600; }
.vw-opt--on .icon { color: var(--accent); }
.vw-opt .vw-opt__tick { color: var(--accent); }
.vw-opt--on .vw-opt__hint, .vw-opt:not(.vw-opt--on) .vw-opt__tick { display: none; }
.vw-foot { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-4) var(--s-1); border-top: 1px solid var(--line); }
.vw-foot .text-meta { flex: 1; color: var(--ink-2); }
.sheet--view .sheet__head h2 { flex: 1; font: var(--t-title); }
.sheet--view .sheet__head small { display: block; font: var(--t-meta); color: var(--ink-2); }
@media (max-width: 767.98px) {
  .vw-opt { min-height: 52px; }
  .vw-set .vw-opt { font-size: 15px; }
  .sheet--view .sheet__body { gap: 0; padding: 0 0 var(--s-2); }
  .sheet--view .sheet__foot .btn { min-height: var(--h-touch); }
  .sheet--view .sheet__foot .btn--primary { flex: 1; }
}
/* Заголовок группы вида (VW2, макет В2–В4): queue__head--group / vw-head. У людей — лицо, имя, число и что просрочено;
   на телефоне прилипает к верху списка при прокрутке. */
.vw-head { gap: var(--s-2); min-height: 36px; }
.vw-head .avatar { flex: none; }
.vw-head__icon { flex: none; width: 18px; height: 18px; color: var(--ink-2); }
.vw-head__icon--risk { color: var(--risk); }
.vw-head__note { font: var(--t-meta); color: var(--ink-2); }
.vw-head__note--risk { color: var(--risk); font-weight: 500; }
.vw-person .queue__title { font-size: 17px; line-height: 24px; letter-spacing: -0.01em; }
.vw-person .vw-head .avatar { width: 30px; height: 30px; font-size: 13px; }
.queue--none .queue__title { color: var(--ink-2); font-weight: 500; }
@media (max-width: 767.98px) {
  .vw-head { position: sticky; top: 0; z-index: 2; padding-top: var(--s-3); background: var(--surface); }
}
