/* Вопросы. Два префикса:
   qs- — экран «Вопросы» (screens/questions.js): очередь коротких строк и окно «Кто решает»;
   qw- — окно вопроса и строки вопроса в переписке, сделке, карточке (screens/question-window.js).
   Только токены; тёмная тема работает сама. Цвет — только у отклонений: опаздываем (--zav), клиент ждёт дольше нормы,
   ответили сами, некому решать (--ryn). Шрифт видимого текста — не меньше 11 px. */

/* обёртки строк вопроса (mountList) — пустая не занимает места */
.qb-slot:empty { display: none; }

/* ══ Экран «Вопросы» (qs-) ═══════════════════════════════════════════════════════════════════════════
   Высота до первой группы (§4.2.1): полоса 48 + 14 + шапка 40 + 6 + папки 52 + 8 + отборы 40 + 8 + шапка таблицы 28;
   группа 28, строка 56. На низком окне (§4.2.2): 48 + 12 + 36 + 6 + отборы 36 + 6 + 24; группа 24, строка 52. */
.view-questions.view-page { padding-top: 14px; }
.qs { --qs-bar: 48px; --qs-row: 56px; --qs-grp: 28px; --qs-th: 28px; display: flex; flex-direction: column; min-width: 0; max-width: 1320px; }
.qs-grow { flex: 1 1 auto; }

/* шапка: заголовок с подсказкой, «Кто решает», «⋯» */
.qs-head { display: flex; align-items: center; gap: 8px; height: 40px; margin-bottom: 6px; min-width: 0; }
.qs-title { margin: 0; font-size: 22px; line-height: 28px; font-weight: 650; letter-spacing: -.012em; color: var(--ink); cursor: help; }
/* сводка «Ждут решения сделки на … · N сделок · это не выручка» (r2) — в той же строке, что заголовок, по базовой линии:
   высоту экрана не берёт; не помещается — куски уходят с конца целиком (сумма не режется) */
.qs-ttl { display: flex; align-items: baseline; gap: 14px; flex: 0 1 auto; min-width: 0; }
.qs-ttl .qs-title { flex: 0 0 auto; }
.qs-sum { margin: 0; min-width: 0; font-size: 13px; line-height: 20px; color: var(--mut); }
.qs-sum[hidden] { display: none; }
.qs-sum-in { display: flex; flex-wrap: wrap; height: 20px; overflow: hidden; }
.qs-sum-s { flex: 0 0 auto; white-space: pre; }
.qs-sum b { font-weight: 620; color: var(--ink); }
.qs-rules { height: 34px; }
.qs-hmore { width: 34px; height: 34px; padding: 0; justify-content: center; }

/* ряд папок — общий компонент (core/folders.js); здесь только отступ */
.qs-folders { margin-bottom: 8px; min-width: 0; }
/* карточки поплотнее, «⋯» папки — поверх карточки при наведении: пять папок демо помещаются в 1140 px без листания */
.qs-folders .fdr-pill, .qs-folders .fdr-add { min-height: 46px; padding: 0 14px; }
.qs-folders .fdr { position: relative; min-width: 0; }
.qs-folders .fdr-b { gap: 9px; padding: 6px 12px 6px 9px; border-radius: 13px; }
.qs-folders .fdr-i svg { width: 30px; height: 30px; }
.qs-folders .fdr-m { position: absolute; top: 6px; right: 4px; bottom: 6px; margin: 0; width: 28px; background: var(--l1); }
.qs-folders .fdr.is-on .fdr-m { background: var(--acc-row); }
.qs-folders:empty { display: none; }

/* строка отборов — липкая под верхней полосой */
.qs-sticky { position: sticky; top: var(--topbar-h); z-index: 6; background: var(--l0); padding-bottom: 8px; }
.qs-bar { display: flex; align-items: center; gap: 8px; height: 40px; min-width: 0; }
.qs-bar-f { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 0 1 auto; }
.qs-search { flex: 1 1 200px; min-width: 120px; max-width: 320px; margin-left: auto; height: 34px; }

/* плашка «Ждут решения N · Отложены N · Решено N» */
.qs-tabs { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 11px; background: var(--l2); border: 1px solid var(--line); flex: 0 0 auto; }
.qs-tab { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border: 1px solid transparent; border-radius: 8px; background: none;
  font: inherit; font-size: 13px; font-weight: 560; color: var(--mut); white-space: nowrap; cursor: pointer; transition: color .14s, background .14s; }
.qs-tab:hover { color: var(--ink); }
.qs-tab b { font-weight: 650; font-size: 12.5px; color: var(--mut2); }
.qs-tab[aria-pressed="true"] { background: var(--l1); border-color: var(--acc-soft-brd); color: var(--acc); box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 6%, transparent); }
.qs-tab[aria-pressed="true"] b { color: var(--acc); }

/* «Решает: все ▾» — настоящий <select> поверх подписи (его открывает окно ядра pickers.js) */
.qs-dd { position: relative; display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 10px 0 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--l1); color: var(--mut); font-size: 13px; white-space: nowrap; flex: 0 0 auto; transition: border-color .14s, background .14s; }
.qs-dd:hover { border-color: var(--line-3); }
.qs-dd b { font-weight: 600; color: var(--ink); }
.qs-dd.is-on { border-color: var(--acc-soft-brd); background: var(--acc-soft); }
.qs-dd.is-on b { color: var(--acc); }
.qs-dd svg { flex: 0 0 auto; color: var(--mut2); }
.qs-dd select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; font-size: 13px; }
.qs-dd:focus-within { box-shadow: 0 0 0 3px var(--acc-soft); border-color: var(--acc-soft-brd); }
.qs-dd-folder { display: none; }

/* таблица: рамка — только вокруг списка; шапка таблицы липкая под строкой отборов */
.qs-table { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--l1); }
.qs-table[hidden] { display: none; }
.qs-th, .qs-row { display: grid; grid-template-columns: minmax(0, 1fr) 170px 140px 140px 32px; column-gap: 12px; align-items: center; padding: 0 6px 0 16px; }
.qs-th { position: sticky; top: calc(var(--topbar-h) + var(--qs-bar)); z-index: 5; height: var(--qs-th); box-sizing: border-box; border-bottom: 1px solid var(--line);
  border-radius: 13px 13px 0 0; background: var(--l2); font-size: 11px; line-height: 14px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--mut2); }
.qs-th > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qs-th-r { text-align: right; }
.qs-list { display: flex; flex-direction: column; min-width: 0; }

/* заголовок группы: «Опаздываем с ответом · 2» — красный только здесь */
.qs-grp { display: flex; align-items: center; gap: 6px; height: var(--qs-grp); box-sizing: border-box; padding: 0 16px; border-bottom: 1px solid var(--line);
  background: var(--l2); font-size: 11px; line-height: 14px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--mut2); }
.qs-grp b { font-weight: 700; }
.qs-grp b::before { content: '·'; margin-right: 6px; }
.qs-grp.is-late { color: var(--ink); }   /* r4: глиф ● — signals.css бл. 11 */

/* строка вопроса: 56 px, две строки текста; выделение — бледной подложкой, без рамки */
.qs-row { position: relative; height: var(--qs-row); box-sizing: border-box; border-bottom: 1px solid var(--line); cursor: pointer; outline: none; transition: background .12s; }
.qs-list > .qs-row:last-child { border-bottom: 0; border-radius: 0 0 13px 13px; }
.qs-row:hover { background: var(--l2); }
.qs-row:focus-visible, .qs-row.is-open { background: var(--acc-row); }
.qs-row.is-ghost { cursor: default; opacity: .62; }
.qs-row > div { min-width: 0; }
.qs-cq { display: flex; flex-direction: column; gap: 0; }
.qs-l1 { display: flex; align-items: baseline; gap: 8px; min-width: 0; height: 21px; line-height: 21px; white-space: nowrap; }
.qs-co { flex: 0 0 auto; font-size: 15px; font-weight: 650; color: var(--ink); }
.qs-dno { flex: 0 0 auto; font-size: 13px; color: var(--mut); text-decoration: none; border-radius: 5px; }
.qs-dno:hover { color: var(--acc); text-decoration: underline; }
.qs-dt { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 13px; color: var(--mut); }
/* компания вопроса после номера сделки (при нескольких компаниях, только не головная): подпись не режется, название сделки
   режет по словам fitRows в questions.js */
.qs-org { flex-shrink: 0; }
.qs-org + .qs-dt { flex-shrink: 100000; }
/* вторая строка режется по словам: лишние слова уходят на скрытую вторую строку, число с единицей не разрывается */
.qs-l2 { height: 18px; overflow: hidden; font-size: 13px; line-height: 18px; color: var(--ink); overflow-wrap: normal; word-break: keep-all; }
.qs-l2 .qs-adv, .qs-l2 .qs-tail { color: var(--mut); }
.qs-seg { white-space: nowrap; }
/* «По совету» (r2) — в конце первой строки (там режется название сделки), вторая строка с советом — во всю ширину.
   Кнопка второстепенная (бледная): без рамки, текст серый, значок — цветом совета */
.qs-l1 .qs-advb { flex: 0 0 auto; align-self: center; height: 26px; margin: -2px -4px -2px auto; padding: 0 8px; gap: 5px; }
.qs-l1 .qs-advb.is-ic { width: 26px; padding: 0; }   /* r4: «По совету» значком, слова — в подсказке */
.qs-advb.btn-ghost { color: var(--mut); }
.qs-advb.btn-ghost:hover { color: var(--ink); }
.qs-advb svg { color: var(--acc); }
/* ответ по совету ждёт своих 5 с: бледная подложка; вторая строка — что уйдёт и через сколько */
.qs-row.is-pend, .qs-row.is-pend:hover { background: var(--acc-row); }
.qs-l2.qs-l2-pend { display: flex; min-width: 0; }
.qs-pend-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qs-pend-left { flex: 0 0 auto; white-space: nowrap; color: var(--mut); }

.qs-cw { display: flex; flex-direction: column; font-size: 13px; line-height: 19px; }
.qs-who, .qs-who2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qs-who { color: var(--ink); font-weight: 520; }
.qs-who2 { font-size: 12px; line-height: 17px; color: var(--mut2); }
.qs-who[data-tone="ryn"], .qs-who2[data-tone="ryn"], .qs-who2[data-tone="zav"] { font-weight: 600; }   /* цвет — чернила, глиф — signals.css */
.qs-ws { display: none; }

.qs-cd { font-size: 13px; line-height: 19px; color: var(--ink); white-space: nowrap; }
.qs-cd[data-tone="zav"] { font-weight: 650; }
.qs-cd[data-tone="ryn"] { font-weight: 600; }
.qs-cd[data-tone="mut"] { color: var(--mut2); }

.qs-cs { display: flex; flex-direction: column; align-items: flex-end; text-align: right; white-space: nowrap; }
.qs-s1 { font-size: 14px; line-height: 20px; font-weight: 620; color: var(--ink); }
.qs-s2 { font-size: 12px; line-height: 17px; color: var(--mut2); overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* «⋯» строки — при наведении и выборе; на сенсорном экране — всегда */
.qs-cm { display: flex; justify-content: center; }
.qs-rm { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: none;
  color: var(--mut); cursor: pointer; opacity: 0; transition: opacity .12s, background .12s; }
.qs-row:hover .qs-rm, .qs-row:focus-visible .qs-rm, .qs-row.is-open .qs-rm, .qs-rm:focus-visible { opacity: 1; }
.qs-rm:hover { background: var(--l3); color: var(--ink); }
@media (hover: none) { .qs-rm { opacity: 1; } }

/* перетаскивание строки на папку */
.qs.is-fdrag .qs-row[draggable="true"] { cursor: grabbing; }

/* пусто и «ещё в решённых» */
.qs-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--l1); text-align: center; }
.qs-empty p { margin: 0; max-width: 560px; font-size: 14px; line-height: 21px; color: var(--mut); }
.qs-empty-w:empty, .qs-more-w:empty { display: none; }
.qs-more-w { margin-top: 8px; }
.qs-moredone { border: 0; background: none; padding: 6px 10px; border-radius: 8px; font: inherit; font-size: 13px; color: var(--acc); cursor: pointer; }
.qs-moredone:hover { background: var(--acc-soft); }

/* окно «Кто решает» (ВП-4.7) */
.qs-ru { display: flex; flex-direction: column; gap: 14px; }
.qs-ru-first { margin: 0; font-size: 13.5px; line-height: 20px; color: var(--ink); }
.qs-ru-t { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 19px; }
.qs-ru-t th { padding: 0 10px 6px 0; text-align: left; font-size: 11px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--mut2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.qs-ru-t td { padding: 6px 10px 6px 0; vertical-align: top; border-bottom: 1px solid var(--line); color: var(--ink); }
.qs-ru-t tr:last-child td { border-bottom: 0; }
/* несколько компаний (владелец): заголовок раздела — название компании над её правилами */
.qs-ru-t .qs-ru-sec th { padding: 16px 10px 6px 0; font-size: 12.5px; font-weight: 650; letter-spacing: 0; text-transform: none; color: var(--ink); border-bottom: 1px solid var(--line); }
.qs-ru-t tbody:first-of-type .qs-ru-sec th { padding-top: 8px; }
.qs-ru-t td:first-child { font-weight: 560; }
.qs-ru-who { display: flex; flex-direction: column; }
.qs-ru-who b { font-weight: 560; }
.qs-ru-who span { font-size: 12px; line-height: 17px; color: var(--mut2); }
.qs-ru-who b[data-tone="ryn"] { color: var(--mut); font-weight: 600; }
.qs-ru-who .qs-ru-d { font-size: inherit; line-height: inherit; color: inherit; }
.qs-ru-l { padding: 0 4px; margin-left: -4px; white-space: nowrap; font-size: 13px; }
.qs-ru-none { margin: 0; font-size: 12.5px; color: var(--mut); font-weight: 560; }
.qs-ru-terms h3 { margin: 0 0 6px; font-size: 11px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--mut2); }
.qs-ru-terms ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; line-height: 19px; color: var(--ink); }

/* ── узкая рабочая область (1100: 816 px, поля 16): РЕШАЕТ 112 («может и Мартынова» в 11 px), СРОК 114 («спросили
   в 09:47»), СДЕЛКА 104 («КП просмотрено»); фамилии вместо полного имени. Совет остаётся (рядом «По совету»), первыми
   уходят добавка и подробности — fitRows в questions.js ── */
@media (max-width: 1279px) {
  .view-questions.view-page { padding-left: 16px; padding-right: 16px; }
  .qs-th, .qs-row { grid-template-columns: minmax(0, 1fr) 112px 114px 104px 28px; column-gap: 6px; padding: 0 4px 0 12px; }
  .qs-wf { display: none; }
  .qs-ws { display: inline; }
  .qs-who2 { font-size: 11px; }
  .qs-s2 { font-size: 11.5px; }
  .qs-tab { padding: 0 9px; font-size: 12.5px; }
  .qs-dd { padding: 0 8px 0 10px; font-size: 12.5px; }
  .qs-search { flex-basis: 140px; min-width: 96px; }
}
/* ── низкое окно (< 700 px): строка 52, ряда папок нет — «Папка ▾» в строке отборов (X11) ── */
@media (max-height: 699px) {
  .view-questions.view-page { padding-top: 12px; }
  .qs { --qs-bar: 42px; --qs-row: 52px; --qs-grp: 24px; --qs-th: 24px; }
  .qs-head { height: 36px; }
  .qs-title { font-size: 20px; }
  .qs-rules, .qs-hmore { height: 32px; }
  .qs-hmore { width: 32px; }
  .qs-folders { display: none; }
  .qs-dd-folder { display: inline-flex; }
  .qs-sticky { padding-bottom: 6px; }
  .qs-bar { height: 36px; }
  .qs-tabs { padding: 2px; }
  .qs-tab { height: 30px; }
  .qs-dd, .qs-search { height: 32px; }
  .qs-th { font-size: 11px; }
  .qs-grp { font-size: 11px; }
}
@media (max-width: 900px) {
  .qs-bar { flex-wrap: wrap; height: auto; }
  .qs-th, .qs-row { grid-template-columns: minmax(0, 1fr) 96px 104px 28px; }
  .qs-th > span:nth-child(4), .qs-cs { display: none; }
}

/* ══ Окно вопроса (qw-, screens/question-window.js, этап Б1) ══════════════════════════════════════════
   Одно окно на все места: шапка (2 строки) · слева Сделка → Что просит клиент → Варианты → Что уйдёт клиенту → Участники ·
   справа Что изменится → Уже известно → Обсуждение / История · подвал с одной главной кнопкой. 1440×900: 1040 × ≤ 820,
   без прокрутки; низкое окно (< 700): 1068 × ≤ 536, шапка 60, подвал 52. Цвет — только отклонения (§1.4). */
.sheet-wrap:has(> .sheet.qw) { padding: 16px 20px; }
.sheet.qw { width: min(1040px, 100%); max-height: min(820px, calc(100vh - 32px)); }
.sheet.qw .sb { padding: 0; gap: 0; }
.sheet.qw [data-num], .qw-lines [data-num] { white-space: nowrap; }
.qw-grow { flex: 1 1 auto; min-width: 0; }
.qw-mut { color: var(--mut); }
/* r4, вариант A: тревожный текст — чернилами, цвет только в глифе (signals.css бл. 11 и ниже); красным — только ошибка ввода */
.qw-ryn, .qw-zav { color: var(--ink); }
.qw-zav[data-err] { color: var(--zav); }
:is(.qw-dl dd.qw-ryn, .qw-kl li.qw-ryn, .qw-under.is-warn, .qw-eff.is-warn, .qw-line[data-tone="ryn"] .qw-line-t)::before {
  content: ''; display: inline-block; flex: 0 0 auto; width: 6px; height: 6px; margin: 0 8px 0 2px; border-radius: 1.5px; transform: rotate(45deg); vertical-align: 1px; background: var(--sig-wait); }
.qw-fi-log p.qw-zav::before {
  content: ''; display: inline-block; width: 7px; height: 7px; margin: 0 7px 0 1px; border-radius: 50%; vertical-align: 1px; background: var(--sig-late); box-shadow: 0 0 0 3px var(--sig-late-halo); }
.qw-nowrap { white-space: nowrap; flex: 0 0 auto; }

/* шапка */
.qw-head { flex: 0 0 auto; padding: 12px 16px 12px 24px; border-bottom: 1px solid var(--line); }
.qw-h1 { display: flex; align-items: center; gap: 8px; min-height: 32px; min-width: 0; }
.qw-nav { display: inline-flex; align-items: center; gap: 2px; margin-left: -6px; padding-right: 6px; border-right: 1px solid var(--line); margin-right: 4px; flex: 0 0 auto; }
.qw-pos { font-size: 12.5px; font-weight: 600; color: var(--mut); min-width: 42px; text-align: center; }
.qw-kind { font-size: 16px; font-weight: 650; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.qw-round { font-size: 14px; color: var(--mut); white-space: nowrap; }
.qw-due { font-size: 13px; font-weight: 600; color: var(--ink); flex: 0 0 auto; }
.qw-due[data-tone="mut"] { color: var(--mut2); font-weight: 500; }
.qw-h2 { display: flex; align-items: baseline; gap: 14px; min-width: 0; margin-top: 2px; }
.qw-co { font-size: 18px; line-height: 24px; font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; letter-spacing: -.01em; }
a.qw-co:hover { color: var(--acc); text-decoration: none; }
.qw-ct { font-size: 13px; color: var(--mut); white-space: nowrap; flex: 0 0 auto; }
.qw-band { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 7px 12px; border-radius: 10px; background: var(--l2); color: var(--mut);
  font-size: 13px; line-height: 18px; }
.qw-band b { font-weight: 600; color: var(--ink); }
.qw-band em { display: block; font-style: normal; color: var(--mut2); }
.qw-band .link { margin-left: auto; flex: 0 0 auto; }
/* полоса состояния с тоном (опаздываем, ждём) — серая подложка, текст чернилами, глиф цветом (r4, вариант A) */
.qw-band[data-tone="zav"], .qw-band[data-tone="ryn"] { background: var(--l2); color: var(--ink); }
.qw-band[data-tone="zav"]::before { content: ''; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--sig-late); box-shadow: 0 0 0 3px var(--sig-late-halo); }
.qw-band[data-tone="ryn"]::before { content: ''; flex: 0 0 auto; width: 6px; height: 6px; margin: 0 1px; border-radius: 1.5px; transform: rotate(45deg); background: var(--sig-wait); }

/* тело: две колонки; правая не задаёт высоту окна — её лента ужимается под левую */
.qw-cols { display: grid; grid-template-columns: minmax(0, 1fr) 316px; min-height: 380px; outline: none; }
.qw-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: 14px 22px 16px 24px; }
.qw-side { position: relative; min-width: 0; border-left: 1px solid var(--line); background: var(--l3); }
.qw-side-in { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 14px; padding: 14px 18px 14px 18px; overflow-y: auto; }
.qw-sec { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.qw-h { font-size: 11px; line-height: 16px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--mut2); flex: 0 0 auto; }
.qw-sh { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.qw-sh-r { margin-left: auto; font-size: 12px; color: var(--mut2); }
.qw-sh-m { display: inline-flex; align-items: baseline; gap: 4px; font-size: 12.5px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.qw-sh .link { flex: 0 0 auto; margin: -3px -7px -3px 0; }

/* сделка — одна строка; режется только название сделки */
.qw-deal { flex-direction: row; align-items: baseline; gap: 8px; }
/* строка течёт как текст: название сделки не режется посреди смысла — тесно, и статус документа (неразрывный)
   уходит на вторую строку */
.qw-deal-t { display: block; flex: 1 1 auto; min-width: 0; font-size: 13px; line-height: 20px; color: var(--ink); white-space: normal; }
.qw-deal-t b { font-weight: 650; }
.qw-nav .ib[aria-disabled="true"] { opacity: .32; pointer-events: none; }
.qw-band .qw-more-in { display: inline; margin: 0; padding: 0; font-size: inherit; }
.qw-eff-l { flex: 0 0 auto; font-size: 12.5px; }
.qw-links { display: inline-flex; gap: 0; flex: 0 0 auto; margin-right: -5px; }
.qw-links .link { padding: 3px 5px; gap: 3px; }

/* что просит клиент */
.qw-quote { margin: 0; font-size: 15px; line-height: 21px; color: var(--ink); }
.qw-rep { font-size: 13px; color: var(--mut); }
.qw-words { margin: 0; font-size: 14px; line-height: 20px; color: var(--ink); }
.qw-was { margin: 0; font-size: 12.5px; line-height: 17px; color: var(--mut); }
.qw-line1 { margin: 0; font-size: 13px; line-height: 18px; color: var(--ink); }
.qw-line1.qw-mut { color: var(--mut); }
.qw-clampbox { position: relative; min-width: 0; }
.sheet.qw [data-clamp] { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.sheet.qw [data-clamp="2"] { -webkit-line-clamp: 2; }
.sheet.qw [data-clamp="3"] { -webkit-line-clamp: 3; }
.sheet.qw [data-clamp="4"] { -webkit-line-clamp: 4; }
.qw-more { position: absolute; right: 0; bottom: 0; padding: 0 2px 0 28px; border: 0; background: linear-gradient(to right, transparent, var(--l1) 26px);
  font: inherit; font-size: 12.5px; line-height: 20px; font-weight: 600; color: var(--acc); cursor: pointer; }
.qw-more[hidden] { display: none; }

/* варианты: строка 30 px, круглая отметка; поля выбранного — в его названии, пунктиром */
.qw-opt-list { display: flex; flex-direction: column; }
.qw-opt-r { display: flex; align-items: center; gap: 10px; min-height: 30px; margin: 0 -8px; padding: 2px 8px; border-radius: 9px; cursor: pointer; font-size: 13.5px; line-height: 20px; color: var(--ink); outline: none; }
.qw-opt-r:hover { background: var(--l2); }
.qw-opt-r:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.qw-opt.is-on .qw-opt-r { background: var(--acc-row); }
.qw-radio { position: relative; width: 16px; height: 16px; flex: 0 0 auto; border-radius: 50%; border: 1.5px solid var(--line-3); background: var(--l1); }
.qw-opt.is-on .qw-radio { border-color: var(--acc); }
.qw-opt.is-on .qw-radio::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--acc); }
.qw-opt-t { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qw-opt.is-on .qw-opt-t { font-weight: 600; white-space: normal; overflow: visible; }
.qw-rec { flex: 0 0 auto; padding: 0 7px; border-radius: 6px; background: var(--acc-soft); color: var(--acc); font-size: 11.5px; line-height: 18px; font-weight: 600; }
.qw-eff { flex: 0 0 auto; font-size: 12.5px; color: var(--mut); white-space: nowrap; }
.qw-eff.is-warn { color: var(--ink); }
.qw-back { flex: 0 0 auto; font-size: 12px; margin-right: -7px; }
.qw-under { margin: 1px 0 3px 26px; font-size: 12.5px; line-height: 17px; color: var(--mut); }
.qw-under.is-warn { color: var(--ink); }
.qw-ed { display: inline; padding: 0 1px; margin: 0; border: 0; border-bottom: 1.5px dashed var(--acc-brd); border-radius: 0; background: none;
  font: inherit; font-weight: 650; line-height: inherit; color: var(--acc); cursor: text; }
.qw-ed:hover, .qw-ed:focus-visible { border-bottom-color: var(--acc); color: var(--acc-hover); outline: none; }
.qw-edin { height: 24px; padding: 0 6px; margin: -2px 0; border: 1px solid var(--acc); border-radius: 6px; background: var(--l1); color: var(--ink);
  font: inherit; font-weight: 600; outline: none; box-shadow: 0 0 0 3px var(--acc-soft); vertical-align: baseline; }
.qw-edin[type="date"] { width: 15ch; }
.qw-opts.is-ro .qw-opt-r { cursor: default; }
.qw-opts.is-ro .qw-opt-r:hover { background: none; }
.sheet.qw.is-pend .qw-opts, .sheet.qw.is-pend .qw-send { pointer-events: none; opacity: .6; }

/* что уйдёт клиенту */
.qw-via { display: inline-flex; align-items: center; gap: 2px; padding: 0; border: 0; background: none; font: inherit; color: var(--ink); font-weight: 600; cursor: pointer; }
.qw-via:hover { color: var(--acc); }
.qw-say { margin: 0; font-size: 13.5px; line-height: 20px; color: var(--ink); white-space: pre-line; }
.qw-ta { min-height: 0; padding: 6px 10px; font-size: 13.5px; line-height: 19px; resize: none; }

/* участники — одна строка, только люди (Q2) */
.qw-people { display: flex; align-items: baseline; gap: 8px; min-width: 0; font-size: 12.5px; line-height: 18px; color: var(--mut); }
.qw-people-t { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qw-people b { font-weight: 600; color: var(--ink); }
.qw-rule { padding: 0; border: 0; background: none; font: inherit; color: var(--acc); cursor: pointer; }
.qw-rule:hover { text-decoration: underline; }

/* правая колонка */
.qw-dl { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 4px 10px; margin: 0; font-size: 13px; line-height: 18px; }
.qw-dl dt { color: var(--mut2); }
.qw-dl dd { margin: 0; color: var(--ink); }
.qw-dl dd.qw-ryn { color: var(--ink); }
.qw-kl { display: flex; flex-direction: column; gap: 3px; margin: 0; padding: 0; list-style: none; font-size: 13px; line-height: 18px; color: var(--mut); }
.qw-kl li.qw-ryn { color: var(--ink); }
.qw-kmore, .qw-earlier { align-self: flex-start; margin-left: -7px; font-size: 12px; }
.qw-earlier[hidden] { display: none; }
.qw-feedbox { flex: 1 1 0; min-height: 0; gap: 8px; }
.qw-tabs { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.qw-tab { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid transparent; border-radius: 9px; background: none;
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--mut); cursor: pointer; }
.qw-tab:hover { color: var(--ink); }
.qw-tab[aria-selected="true"] { background: var(--acc-soft); border-color: var(--acc-soft-brd); color: var(--acc); }
.qw-tab-n { font-size: 11.5px; font-weight: 650; color: inherit; opacity: .8; }
.qw-backb { margin-left: -7px; }
.qw-feed { display: flex; flex-direction: column; gap: 8px; flex: 1 1 0; min-height: 0; overflow: hidden; }
.qw-feedbox.is-all .qw-feed { overflow-y: auto; }
.qw-fi { flex: 0 0 auto; font-size: 12.5px; line-height: 17px; color: var(--ink); }
.qw-fi[hidden] { display: none; }
.qw-fi p { margin: 0; }
.qw-fi-log { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; }
.qw-fi-at { align-self: start; min-width: 36px; color: var(--mut2); }
.qw-fi-h { display: flex; gap: 8px; font-size: 12px; color: var(--mut2); }
.qw-fi-h b { font-weight: 600; color: var(--ink); }
.qw-fi-empty { margin: 0; font-size: 12.5px; }
/* r31: поле «Обсуждения» — как поле чата «Новая рассылка»: скруглённое, лиловая кромка, круглая кнопка справа */
.qw-say-in { position: relative; flex: 0 0 auto; display: flex; align-items: center; gap: 6px; min-width: 0; height: 40px; box-sizing: border-box; padding: 0 4px 0 14px; border-radius: 20px;
  background: var(--l1); border: 1px solid color-mix(in srgb, var(--acc) 22%, var(--line-2)); box-shadow: 0 10px 24px -20px color-mix(in srgb, var(--acc) 55%, transparent); transition: border-color .2s, box-shadow .2s; }
.qw-say-in:focus-within { border-color: color-mix(in srgb, var(--acc) 50%, var(--line-2)); box-shadow: 0 14px 30px -20px color-mix(in srgb, var(--acc) 60%, transparent); }
.qw-say-in .qw-note { flex: 1 1 auto; min-width: 0; height: 100%; margin: 0; padding: 0; border: 0; outline: 0; background: transparent; box-shadow: none; font: inherit; font-size: 13px; color: var(--ink); }
.qw-say-in .qw-note::placeholder { color: var(--mut2); }
.qw-note-send { display: inline-grid; place-items: center; flex: 0 0 auto; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: var(--action-strong-bg); color: var(--action-strong-fg);
  cursor: pointer; opacity: .32; transition: opacity .18s, transform .25s cubic-bezier(.175, .885, .32, 1.275), background .15s; }
.qw-say-in:focus-within .qw-note-send, .qw-say-in:has(.qw-note:not(:placeholder-shown)) .qw-note-send { opacity: 1; }
.qw-note-send:active { transform: scale(.9); }
.qw-note-send:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.qw-note-send .ic { stroke-width: 2; }
.qw-feedrow { align-self: flex-start; padding: 2px 0; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--acc); cursor: pointer; }
.qw-feedrow:hover { text-decoration: underline; }

/* подвал */
.sheet.qw .sf { flex-wrap: nowrap; padding: 12px 20px 12px 24px; }
.qw-hint { min-width: 0; font-size: 12.5px; color: var(--mut2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qw-hint.is-shake { animation: qw-shake .32s; color: var(--ink); }
@keyframes qw-shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

/* меню «Отложить ▾» и малые окна */
.qw-pop { display: flex; flex-direction: column; padding: 2px; }
.qw-pop .mi { width: 100%; border: 0; background: none; font: inherit; text-align: left; color: inherit; }
.qw-pop-back { align-self: flex-start; margin: 2px 0 4px; }
.qw-pop-tell { display: flex; align-items: flex-start; gap: 8px; margin-top: 6px; padding: 8px 8px 4px; border-top: 1px solid var(--line); font-size: 12.5px; line-height: 17px; color: var(--ink); cursor: pointer; }
.qw-pop-tell input, .qw-chk input, .qw-r input { accent-color: var(--acc); margin: 2px 0 0; flex: 0 0 auto; }
.qw-pop-f { display: flex; justify-content: flex-end; padding: 6px 4px 4px; }
/* отложили позже обещанного и клиента не предупреждаем — «Клиенту обещали к 15:00 — опоздаем на 30 мин» (смотр 15.10) */
.qw-pop-late { margin: 4px 0 0; padding: 0 8px 0 29px; font-size: 12.5px; line-height: 17px; color: var(--ink); font-weight: 560; }   /* глиф ● — signals.css */
.qw-pop-late[hidden] { display: none; }
.sheet .qw-pop-late { padding-left: 0; }
.qw-rs { display: flex; flex-direction: column; gap: 6px; }
.qw-r { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.qw-r:has(input:checked) { background: var(--acc-row); border-color: var(--acc-soft-brd); }
.qw-r-t { display: flex; flex-direction: column; gap: 1px; }
.qw-r-t b { font-size: 13px; font-weight: 600; color: var(--ink); }
.qw-r-t em { font-style: normal; font-size: 12px; color: var(--mut2); }
.qw-r-client { display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 18px; color: var(--mut); }
.qw-chk { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); cursor: pointer; }

/* низкое окно (< 700 px): 1068 × ≤ 536, шапка 60, подвал 52, отступы между разделами 10 */
@media (max-height: 699px) {
  .sheet-wrap:has(> .sheet.qw) { padding: 12px 16px; }
  .sheet.qw { width: min(1068px, 100%); max-height: calc(100vh - 24px); }
  .qw-head { padding: 8px 12px 8px 18px; }
  .qw-h1 { min-height: 28px; }
  .qw-h2 { margin-top: 0; }
  .qw-co { font-size: 17px; line-height: 22px; }
  .qw-band { margin-top: 6px; padding: 5px 10px; }
  .qw-cols { grid-template-columns: minmax(0, 1fr) 360px; min-height: 300px; }
  .qw-main { gap: 8px; padding: 8px 16px 8px 18px; }
  .qw-side-in { gap: 10px; padding: 10px 14px; }
  .qw-sec { gap: 2px; }
  .qw-quote { font-size: 14.5px; line-height: 20px; }
  .qw-opt-r { min-height: 28px; padding: 1px 8px; }
  .qw-under { margin-bottom: 1px; }
  .qw-say { line-height: 19px; }
  .qw-ta { padding: 4px 8px; line-height: 18px; }
  .sheet.qw .sf { padding: 8px 14px 8px 18px; }
}

/* ══ Строки вопроса (qw-line): переписка, сделка, карточка — 36 px, «Решить» и, где есть совет, «По совету» (R39, R47) ══ */
.qw-lines { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.qw-lines .qb-slot + .qb-slot { margin-top: 0; }
.qw-line { display: flex; align-items: center; gap: 8px; width: 100%; height: 36px; min-width: 0; padding: 0 4px 0 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--l2); color: var(--ink); font: inherit; font-size: 13px; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.qw-line:hover { border-color: var(--line-2); }
.qw-line[data-tone="ryn"] { background: var(--l2); border-color: var(--line-2); }   /* «запишите решение» — глиф ◆, без янтарной заливки (r4) */
.qw-line[data-tone="vyg"] { background: var(--vyg-soft); border-color: var(--vyg-brd); color: var(--vyg); cursor: default; }
.qw-line[data-tone="acc"] { background: var(--acc-row); border-color: var(--acc-soft-brd); cursor: default; }
.qw-line-t { display: flex; align-items: baseline; gap: 6px; flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; }
.qw-l-kind { flex: 0 0 auto; font-weight: 650; }
.qw-l-no { flex: 0 0 auto; color: var(--mut); }
.qw-l-sep { flex: 0 0 auto; color: var(--ink-off); }
.qw-l-due { flex: 0 0 auto; color: var(--mut); }
.qw-l-due[data-tone="zav"] { font-weight: 600; }   /* цвет — чернила, глиф — signals.css */
.qw-l-who, .qw-l-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--mut); }
/* «· решает Белоусов А. О.» — одна строка без многоточия: не помещается — уходят инициалы, затем весь кусок (смотр Q1) */
.qw-l-dec { flex: 1 1 0; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; height: 19px; line-height: 19px; overflow: hidden; color: var(--mut); }
.qw-l-d0 { flex: 0 0 0; width: 0; height: 19px; }   /* пустой первый элемент: «решает …», не влезший целиком, уходит во вторую (скрытую) строку */
/* пустой элемент без текста в выравнивании по базовой линии ставит её по своему низу — «решает …» уезжал на 5 px вниз и
   резался снизу («реш» → «peш»); из выравнивания его убираем (смотр окна сделки 14.10) */
.qw-l-d0 { align-self: flex-start; }
.qw-l-d2 { margin-left: 4px; }
.qw-l-d1, .qw-l-d2 { flex: 0 0 auto; white-space: nowrap; }
.qw-l-d1 > .qw-l-sep { margin-right: 6px; font-style: normal; }
.qw-line[data-tone="ryn"] .qw-l-main, .qw-line[data-tone="vyg"] .qw-l-main, .qw-line[data-tone="acc"] .qw-l-main { color: inherit; }
.qw-line[data-tone="mut"] .qw-l-kind { color: var(--mut); font-weight: 600; }
.qw-line .btn-s { flex: 0 0 auto; height: 28px; }
.qw-line-more { justify-content: flex-start; gap: 4px; color: var(--acc); font-weight: 600; background: none; }
/* «По совету» (r2) — второстепенная (бледная) кнопка перед «Решить». В окне сделки кнопки строки главного вопроса спрятаны
   (их дело делает «Решить: …» в подвале); «По совету» — не повтор подвала, она видна и там */
.qw-line .qw-l-adv { gap: 5px; }
.qw-line .qw-l-adv.btn-ghost { color: var(--mut); }
.qw-line .qw-l-adv.btn-ghost:hover { color: var(--ink); }
.qw-line .qw-l-adv svg { color: var(--acc); }
.qw-lines[data-place] .qw-line .btn.qw-l-adv { display: inline-flex; }
/* тесная строка (fitLines): срок не режется — сначала уходит номер сделки, затем «По совету» — одним значком */
.qw-l-nob { display: inline-flex; align-items: baseline; gap: 6px; flex: 0 0 auto; }
.qw-line.is-tight .qw-l-nob { display: none; }
.qw-line.is-tight2 .qw-l-adv:not(.has-s) > span { display: none; }
.qw-line.is-tight2 .qw-l-adv:not(.has-s) { width: 30px; padding: 0; }
/* у кнопки с советом («По совету: признать»): тесно — один совет («Признать»), ещё теснее — значок */
.qw-l-advs { display: none; }
.qw-line.is-tight2 .qw-l-adv.has-s .qw-l-advf { display: none; }
.qw-line.is-tight2 .qw-l-adv.has-s .qw-l-advs { display: inline; }
.qw-line.is-tight3 .qw-l-adv.has-s .qw-l-advs { display: none; }
.qw-line.is-tight3 .qw-l-adv.has-s { width: 30px; padding: 0; }
/* ответ по совету ждёт своих 5 с: «по совету: …» режется многоточием, «уйдёт через 4 с» — никогда */
.qw-l-left { flex: 0 0 auto; white-space: nowrap; color: var(--mut); }

/* узкое место (старая лента «Входящих», карточка): решающий — одной фамилией (D11) */
.qw-lines { container-type: inline-size; }
.qw-l-who .is-short { display: none; }
@container (max-width: 560px) {
  .qw-l-who .is-full { display: none; }
  .qw-l-who .is-short { display: inline; }
}
/* «Сроки» — число правится на месте (сверка Б, App.questions.setRule) */
.qs-ru-terms .qs-ru-n { display: inline-block; width: 64px; height: 26px; padding: 0 6px; margin: 0 2px; font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; vertical-align: baseline; }

/* «Дальше» в «Что изменится» — правка щелчком (сверка Б): обычный текст слева, подчёркнут пунктиром */
.qw-ed.qw-ed-next { display: inline; text-align: left; font-weight: inherit; white-space: normal; line-height: inherit; }

/* FIN (18.11): окно «Совет» вопроса сервера — вариант и причины (screens/question-window.js srvAdvice) */
.qw-adv { display: flex; flex-direction: column; gap: 8px; }
.qw-adv p { margin: 0; overflow-wrap: anywhere; }
.qw-adv-o b { font-weight: 650; }
.qw-adv-r ul { margin: 4px 0 0; padding-left: 18px; }
.qw-adv-r li { margin: 2px 0; }
