/* ==========================================================================
   iScor.ru — макет личного кабинета. Стили.
   Единая система оформления: все цвета, шкала риска, шрифт, радиусы, отступы,
   высоты элементов, фокус и движение заданы только в блоке токенов ниже.
   Светлая тема — основная; тёмная — [data-theme="dark"]; печать — @media print.
   Правило цвета: зелёный — бренд и действие (основная кнопка, ссылки, активный
   пункт меню, фокус); «готово / норма» — нейтральный серый с галочкой; синий —
   информация и «в работе»; янтарный — внимание; красный — ошибка, блокировка и
   счётчики срочного. Оценка риска — только своя шкала A–E, буква всегда есть.
   ========================================================================== */

/* TOKENS:BEGIN */
:root {
  /* бренд и действие */
  --brand: #00963F;            /* логотип, полосы, прогресс — не для текста */
  --action: #008538;           /* основная кнопка: белый текст 4,76:1 */
  --action-hover: #006E2E;     /* 6,42:1 */
  --action-press: #005C26;
  --action-ink: #00662B;       /* ссылки, активный пункт меню */
  --action-bg: #EAF6EF;        /* подложка активного пункта и выбранной карточки */
  --action-bg-2: #D3EEDD;
  --on-action: #FFFFFF;
  --focus-color: #00662B;      /* кольцо фокуса: сплошное 2 px, отступ 2 px — 7,15:1 */

  /* текст и поверхности */
  --text: #2B2A29;
  --text-2: #5A5F66;
  --text-3: #61676F;           /* 5,71:1 на белом, 4,63:1 на строке под курсором */
  --bg: #F3F4F6;
  --surface: #FFFFFF;
  --surface-2: #F8F9FA;
  --surface-3: #EEF0F2;
  --border: #E2E5E9;
  --border-2: #CFD4DA;         /* разделители, неактивные дорожки */
  --border-control: #8A9099;   /* рамка полей и обычных кнопок — 3,22:1 */
  --th-bg: #E9ECF0;
  --row-alt: #F4F6F8;          /* «зебра» */
  --row-hover: #E3E8EE;        /* строка под курсором — заметно темнее «зебры» */
  --row-sub: #EDF1F4;
  --line-v: #E9ECEF;
  --scrim: rgba(17, 20, 24, .48);
  --skel-shine: rgba(255, 255, 255, .55);
  --tip-bg: #2B2F33;
  --tip-ink: #FFFFFF;
  --tip-line: #2B2F33;
  --viewer-bg: #525659;
  --viewer-bar: #323639;
  --on-dark: #FFFFFF;
  --on-dark-2: rgba(255, 255, 255, .72);
  --qr-dark: #000000;
  --qr-light: #FFFFFF;
  --scroll-thumb: #C3C8CF;     /* полоса прокрутки: тонкая, без стрелок, в цвет темы */
  --scroll-thumb-hover: #8A9099;
  --chart-today: var(--action-hover);   /* столбец «сегодня» на графике расходов */

  /* уровни уведомлений: критично · внимание · информация · успех (нейтральный) */
  --crit: #C8372F;  --crit-bg: #FCEDEC;  --crit-ink: #B3302C;  --crit-line: #F2C9C6;
  --warn: #E0A010;  --warn-bg: #FDF4E2;  --warn-ink: #8A5500;  --warn-line: #EED9A8;
  --info: #3B7BE0;  --info-bg: #EBF2FD;  --info-ink: #1F57B8;  --info-line: #C7D8F5;
  --done: #5A5F66;  --done-bg: #EEF0F2;  --done-ink: #4B5057;  --done-line: #DADEE3;
  --on-crit: #FFFFFF;

  /* шкала риска — единственный источник для букв, кольца, полукруга, линейки и диапазонов */
  --risk-a: #1E874B;  --risk-a-on: #FFFFFF;  --risk-a-ink: #17703E;  --risk-a-bg: #E9F6EE;
  --risk-b: #7DB548;  --risk-b-on: #2B2A29;  --risk-b-ink: #3F6212;  --risk-b-bg: #EEF6E2;
  --risk-c: #E0A010;  --risk-c-on: #2B2A29;  --risk-c-ink: #8A5500;  --risk-c-bg: #FDF4E2;
  --risk-d: #E58A2E;  --risk-d-on: #2B2A29;  --risk-d-ink: #9A4A00;  --risk-d-bg: #FCEBDD;
  --risk-e: #C8372F;  --risk-e-on: #FFFFFF;  --risk-e-ink: #B3302C;  --risk-e-bg: #FCEDEC;
  --risk-none: #EEF0F2; --risk-none-on: #5A5F66;

  /* шрифт: шесть размеров, три насыщенности */
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: Consolas, "SFMono-Regular", Menlo, monospace;
  --fs-xs: 12px;   --lh-xs: 16px;    /* метки, шапки таблиц, сноски */
  --fs-sm: 13px;   --lh-sm: 18px;    /* подписи, таблицы отчёта, кнопки sm */
  --fs-md: 14px;   --lh-md: 20px;    /* основной текст */
  --fs-lg: 16px;   --lh-lg: 22px;    /* заголовок раздела */
  --fs-xl: 22px;   --lh-xl: 28px;    /* заголовок страницы */
  --fs-num: 28px;  --lh-num: 32px;   /* крупные показатели */
  --fw-regular: 400; --fw-semibold: 600; --fw-bold: 700;

  /* форма: четыре радиуса, шаг отступов 4 px, три высоты элементов + кнопка-значок */
  --r-1: 4px;  --r-2: 8px;  --r-3: 10px;  --r-pill: 999px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-6: 24px; --sp-8: 32px;
  --h-lg: 40px; --h-md: 36px; --h-sm: 28px; --h-icon: 32px; --hit: 24px;
  --bar-w: 3px;                /* цветная полоса слева — всегда внутренней тенью */

  /* фокус и тени */
  --focus-ring: 0 0 0 2px var(--surface), 0 0 0 4px var(--focus-color);
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-2: 0 4px 12px rgba(16, 24, 40, .08), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-3: 0 16px 40px rgba(16, 24, 40, .16), 0 4px 12px rgba(16, 24, 40, .08);

  /* движение */
  --dur-press: 80ms;   /* нажатие */
  --dur-fast: 160ms;   /* наведение, смена состояния, проявление */
  --dur-panel: 200ms;  /* раскрытие, панель, диалог */
  --dur-data: 400ms;   /* отрисовка индикатора, один раз */
  --dur-flash: 1200ms; /* подсветка цели перехода */
  --dur-row: 1500ms;   /* строка-новичок, след возврата */
  --ease-out: cubic-bezier(.2, 0, 0, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);

  /* каркас */
  --sidebar-w: 248px; --sidebar-mini: 64px; --topbar-h: 56px;
  color-scheme: light;
}
[data-theme="dark"] {
  --brand: #22B35E; --action: #008538; --action-hover: #006E2E; --action-press: #005C26;
  --action-ink: #5FD493; --action-bg: #12291C; --action-bg-2: #183A26; --focus-color: #5FD493;
  --text: #ECEDEE; --text-2: #B3B8BF; --text-3: #A0A6AE;
  --bg: #111315; --surface: #1A1D20; --surface-2: #202428; --surface-3: #272B30;
  --border: #2D3237; --border-2: #3A4047; --border-control: #747B84;
  --th-bg: #272B30; --row-alt: #1F2327; --row-hover: #2C3238; --row-sub: #23282D; --line-v: #262B30;
  --skel-shine: rgba(255, 255, 255, .06); --tip-bg: #363C43; --tip-ink: #FFFFFF; --tip-line: #545C66;
  --crit: #EE6B63; --crit-bg: #3A1C1B; --crit-ink: #FF9C94; --crit-line: #5A2B29;
  --warn: #E9AE3A; --warn-bg: #362A12; --warn-ink: #F2C66E; --warn-line: #5A4720;
  --info: #6B9BF2; --info-bg: #1A2742; --info-ink: #A7C3FF; --info-line: #2C4270;
  --done: #B3B8BF; --done-bg: #272B30; --done-ink: #C4C8CE; --done-line: #3A4047;
  --on-crit: #111315;
  --scroll-thumb: #464C54; --scroll-thumb-hover: #747B84;
  --chart-today: #7BDDA2;
  --risk-a-ink: #7BDDA2; --risk-a-bg: #15301F;
  --risk-b-ink: #B5DA8A; --risk-b-bg: #22301A;
  --risk-c-ink: #F2C66E; --risk-c-bg: #362A12;
  --risk-d-ink: #F2B27A; --risk-d-bg: #3A2614;
  --risk-e-ink: #FF9C94; --risk-e-bg: #3A1C1B;
  --risk-none: #272B30; --risk-none-on: #B3B8BF;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 4px 12px rgba(0, 0, 0, .35);
  --shadow-3: 0 16px 40px rgba(0, 0, 0, .55);
  color-scheme: dark;
}
/* «Бумага»: просмотр PDF и документы (счёт, реестр) всегда светлые */
.paper, .invoice-doc {
  --text: #2B2A29; --text-2: #5A5F66; --text-3: #61676F;
  --surface: #FFFFFF; --surface-2: #F8F9FA; --surface-3: #EEF0F2;
  --border: #E2E5E9; --border-2: #CFD4DA; --row-alt: #F4F6F8; --th-bg: #E9ECF0;
  --done-ink: #4B5057; --done-bg: #EEF0F2; --crit-ink: #B3302C; --crit-bg: #FCEDEC; --warn-ink: #8A5500; --warn-bg: #FDF4E2;
  --action-bg: #EAF6EF; --action-ink: #00662B; --doc-line: #999999;
}
@media print {
  :root, [data-theme="dark"] {
    --text: #2B2A29; --text-2: #55595E; --text-3: #61676F; --bg: #FFFFFF; --surface: #FFFFFF; --surface-2: #F6F7F8; --surface-3: #ECEEF0;
    --border: #DADDE1; --border-2: #C5CAD0; --th-bg: #ECEEF0; --row-alt: #F4F6F8;
    --action-bg: #EAF6EF; --action-bg-2: #D3EEDD; --action-ink: #00662B; --brand: #00963F;
    --crit: #C8372F; --crit-bg: #FCEDEC; --crit-ink: #B3302C; --warn: #E0A010; --warn-bg: #FDF4E2; --warn-ink: #8A5500;
    --info: #3B7BE0; --info-bg: #EBF2FD; --info-ink: #1F57B8; --done-ink: #4B5057; --done-bg: #EEF0F2;
    --risk-a-ink: #17703E; --risk-a-bg: #E9F6EE; --risk-b-ink: #3F6212; --risk-b-bg: #EEF6E2; --risk-c-ink: #8A5500; --risk-c-bg: #FDF4E2;
    --risk-d-ink: #9A4A00; --risk-d-bg: #FCEBDD; --risk-e-ink: #B3302C; --risk-e-bg: #FCEDEC; --risk-none: #EEF0F2; --risk-none-on: #5A5F66;
    --wm-ink: rgba(43, 42, 41, .07);
    --chart-today: #006E2E;
  }
}
/* Акцент «синий» (проба 27.11.2026, переключатель «Цвет» в меню пользователя).
   Приглушённый стальной синий — как в утилитах владельца (#8AA9DB / #6F8FC6 / #5E82C4, выбранное #2B313D).
   Синий берёт на себя бренд и действие; зелёный остаётся только за хорошей оценкой (A–B). */
[data-accent="blue"] {
  --brand: #5E82C4; --action: #4467A8; --action-hover: #395A96; --action-press: #304E84;
  --action-ink: #3A5A96; --action-bg: #EDF2FA; --action-bg-2: #DAE4F3; --focus-color: #3A5A96;
}
[data-theme="dark"][data-accent="blue"] {
  --brand: #6F8FC6; --action: #8AA9DB; --action-hover: #9DB7E2; --action-press: #7A9AD0; --on-action: #0F1724;
  --action-ink: #8AA9DB; --action-bg: #2B313D; --action-bg-2: #343C4B; --focus-color: #8AA9DB;
  --chart-today: #8AA9DB;
}
[data-accent="blue"] .paper, [data-accent="blue"] .invoice-doc { --action-bg: #EDF2FA; --action-ink: #3A5A96; }
@media print {
  [data-accent="blue"], [data-theme="dark"][data-accent="blue"] {
    --brand: #5E82C4; --action-bg: #EDF2FA; --action-bg-2: #DAE4F3; --action-ink: #3A5A96; --chart-today: #3A5A96;
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
/* TOKENS:END */

/* ---------- Основа ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: var(--fw-regular) var(--fs-md)/var(--lh-md) var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
body.has-modal { overflow: hidden; }
html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after { transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), fill var(--dur-fast) var(--ease-out) !important; }
a { color: var(--action-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: var(--fw-bold); }
h1 { font-size: var(--fs-xl); line-height: var(--lh-xl); }
h2 { font-size: var(--fs-lg); line-height: var(--lh-lg); }
h3, h4 { font-size: var(--fs-md); line-height: var(--lh-md); font-weight: var(--fw-semibold); }
p { margin: 0 0 var(--sp-2); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus-color); outline-offset: 2px; }
.ic { flex: none; display: inline-block; vertical-align: middle; }
/* Полосы прокрутки во всём кабинете: тонкие, без стрелок, цвет из темы (родные серые в тёмной теме смотрятся чужими) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border: 2px solid transparent; border-radius: var(--r-pill); background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--scroll-thumb-hover); }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; } }
/* светлый/тёмный вариант подписи, когда слова зависят от темы (например, «тёмный столбец» на графике) */
[data-theme="dark"] .theme-l, :root:not([data-theme="dark"]) .theme-d { display: none; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: var(--fs-sm); line-height: var(--lh-sm); }
.xs { font-size: var(--fs-xs); line-height: var(--lh-xs); }
.num, .money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.strong { font-weight: var(--fw-semibold); }
.right, .r { text-align: right; }
.center { text-align: center; }
.only-m { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mt8 { margin-top: var(--sp-2); } .mt16 { margin-top: var(--sp-3); } .mt24 { margin-top: var(--sp-4); } .mb8 { margin-bottom: var(--sp-2); } .mb16 { margin-bottom: var(--sp-3); }
.row { display: flex; align-items: center; gap: var(--sp-2); }
.row--wrap { flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.row--end { justify-content: flex-end; }
.row--top { align-items: flex-start; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack > * + * { margin-top: var(--sp-3); }
.hr { height: 1px; background: var(--border); margin: var(--sp-4) 0; border: 0; }
.ink-a { color: var(--risk-a-ink); } .ink-b { color: var(--risk-b-ink); } .ink-c { color: var(--risk-c-ink); } .ink-d { color: var(--risk-d-ink); } .ink-e { color: var(--risk-e-ink); }
.ink-crit { color: var(--crit-ink); } .ink-warn { color: var(--warn-ink); } .ink-ok { color: var(--done-ink); }

/* ---------- Каркас: меню сворачивается до 64 px, три точки перелома ---------- */
body { --side-cur: var(--sidebar-w); }
body.is-mini { --side-cur: var(--sidebar-mini); }
.app { display: grid; grid-template-columns: var(--side-cur) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; width: var(--side-cur); background: var(--surface); border-right: 1px solid var(--border); padding: var(--sp-3); z-index: 30; overflow: hidden auto; scrollbar-width: none; }
.sidebar::-webkit-scrollbar { display: none; }
.sidebar__logo { display: flex; align-items: center; height: var(--h-md); padding: 0 var(--sp-2); margin-bottom: var(--sp-3); color: var(--text); flex: none; }
.sidebar__logo .logo-svg { width: 132px; height: auto; }
.sidebar__logo .logo-mark { display: none; }
.sidebar__new { margin-bottom: var(--sp-3); flex: none; }
.nav { display: flex; flex-direction: column; gap: var(--sp-1); }
.nav__item { display: flex; align-items: center; gap: var(--sp-3); min-height: var(--h-md); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-2); color: var(--text-2); position: relative; white-space: nowrap; }
.nav__item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav__item.is-active { background: var(--action-bg); color: var(--action-ink); font-weight: var(--fw-semibold); box-shadow: inset var(--bar-w) 0 0 var(--action); }
.nav__t { flex: 1 1 auto; min-width: 0; white-space: normal; }
.nav__sep { height: 1px; background: var(--border); margin: var(--sp-2) var(--sp-1); flex: none; }
.sidebar__foot { margin-top: auto; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-3); background: var(--surface-2); font-size: var(--fs-sm); line-height: var(--lh-sm); flex: none; }
.sidebar__foot .strong { display: block; }
.mgr__acts { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-1); }
.mgr__acts a, .mgr__acts button { font-size: var(--fs-sm); }
.sidebar .mgr__mini { display: none; }
.side-toggle { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: var(--h-sm); margin-top: var(--sp-2); padding: 0 var(--sp-3); border: 0; border-radius: var(--r-2); background: none; color: var(--text-3); font-size: var(--fs-sm); flex: none; }
.side-toggle:hover { background: var(--surface-2); color: var(--text); }
/* свёрнутое меню: только значки, подписи — во всплывающей подсказке */
.is-mini-ui .sidebar { padding: var(--sp-3) var(--sp-2); }
.is-mini-ui .sidebar__logo { justify-content: center; padding: 0; }
.is-mini-ui .sidebar__logo .logo-full { display: none; }
.is-mini-ui .sidebar__logo .logo-mark { display: block; width: 34px; height: auto; }
.is-mini-ui .sidebar__new { width: var(--h-lg); padding: 0; margin-left: auto; margin-right: auto; }
.is-mini-ui .sidebar__new .btn__t, .is-mini-ui .nav__t, .is-mini-ui .side-toggle__t, .is-mini-ui .mgr__full { display: none; }
.is-mini-ui .nav__item { justify-content: center; padding: var(--sp-2); }
.is-mini-ui .nav__item .counter { position: absolute; top: 0; left: 34px; min-width: 16px; height: 16px; padding: 0 var(--sp-1); font-size: var(--fs-xs); line-height: 16px; }
.is-mini-ui .sidebar__foot { padding: 0; background: none; display: flex; justify-content: center; }
.is-mini-ui .sidebar .mgr__mini { display: inline-flex; }
.is-mini-ui .side-toggle { justify-content: center; padding: 0; }
.is-mini-ui .side-toggle .ic { transform: rotate(180deg); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 25; height: var(--topbar-h); display: flex; align-items: center; gap: var(--sp-3); padding: 0 var(--sp-6); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--border); min-width: 0; }
.topbar .topbar__menu { display: none; }
.topbar__logo { display: none; color: var(--text); }
.search-trigger { display: flex; align-items: center; gap: var(--sp-2); flex: 0 1 440px; min-width: 280px; height: var(--h-md); padding: 0 var(--sp-3); border: 1px solid var(--border-2); border-radius: var(--r-2); background: var(--surface-2); color: var(--text-3); text-align: left; }
.search-trigger:hover { border-color: var(--border-control); }
.search-trigger span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.kbd { font-size: var(--fs-xs); line-height: var(--lh-xs); padding: 0 var(--sp-1); border: 1px solid var(--border-2); border-bottom-width: 2px; border-radius: var(--r-1); color: var(--text-2); background: var(--surface); font-family: var(--font); white-space: nowrap; }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); }
.topbar__right > * { flex-shrink: 0; }
/* Шапка не шире экрана ни при какой ширине: правая часть не сжимается, пока поиск может стать уже (до 280 px);
   когда места совсем мало, правая часть упирается в остаток ширины и подпись пользователя переносится
   по строкам (по « · », без висящих точек) — ничего не обрезается. */
@media (min-width: 720px) { .topbar__right { flex-shrink: 0; max-width: calc(100% - 280px - var(--sp-3)); } }
.topbar__right > .user-anchor { flex-shrink: 1; }
.balance-chip { display: flex; align-items: center; gap: var(--sp-1); white-space: nowrap; height: var(--h-md); padding: 0 var(--sp-3); border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--surface); color: var(--text); text-decoration: none !important; }
.balance-chip:hover { border-color: var(--border-2); }
.balance-chip__val { font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.balance-chip__lbl { font-size: var(--fs-xs); color: var(--text-3); margin-right: var(--sp-1); }
.balance-chip__res { color: var(--info-ink); margin-left: var(--sp-1); font-size: var(--fs-xs); }
/* «ниже порога»: сама сумма обычным цветом, рядом — янтарная отметка */
.low-mark { display: inline-flex; align-items: center; gap: var(--sp-1); color: var(--warn-ink); font-size: var(--fs-xs); font-weight: var(--fw-semibold); white-space: nowrap; }
.low-mark .ic { color: var(--warn); }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: var(--h-icon); height: var(--h-icon); border: 0; border-radius: var(--r-2); background: transparent; color: var(--text-2); flex: none; transition: background-color var(--dur-fast) var(--ease-out); }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn:active { background: var(--border-2); }
.icon-btn--sm { width: var(--h-sm); height: var(--h-sm); }
/* счётчик у колокольчика — в углу кнопки, не закрывает значок */
#bellBadge .counter { position: absolute; top: -6px; left: 25px; min-width: 16px; height: 16px; padding: 0 var(--sp-1); line-height: 16px; box-shadow: 0 0 0 2px var(--surface); }
.user-btn { display: flex; align-items: center; gap: var(--sp-2); min-height: var(--h-lg); max-width: 100%; padding: 2px var(--sp-2) 2px var(--sp-1); border: 0; border-radius: var(--r-pill); background: transparent; }
.user-btn:hover { background: var(--surface-3); }
.avatar { width: var(--h-icon); height: var(--h-icon); border-radius: var(--r-pill); background: var(--surface-3); color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-xs); font-weight: var(--fw-bold); flex: none; }
.avatar--lg { width: 44px; height: 44px; font-size: var(--fs-md); }
.avatar--sm { width: 24px; height: 24px; font-size: var(--fs-xs); }
.user-btn__name { display: block; font-weight: var(--fw-semibold); font-size: var(--fs-sm); line-height: var(--lh-sm); text-align: left; white-space: nowrap; }
.user-btn__role { display: block; font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-3); }
.user-btn__txt { text-align: left; }
.user-pop { width: 300px; }
.user-pop__bal { display: none; }
.content { width: 100%; max-width: 1392px; padding: var(--sp-4) var(--sp-6) var(--sp-8); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.page-head__sub { color: var(--text-2); margin-top: 2px; font-size: var(--fs-sm); line-height: var(--lh-sm); }
.back-link { display: inline-flex; align-items: center; gap: var(--sp-1); color: var(--text-2); font-size: var(--fs-sm); margin-bottom: var(--sp-1); }
.bottom-nav { display: none; }
.scrim { display: none; }

/* ---------- Кнопки: основная · обычная · тихая · опасная; 40 / 36 / 28 и значок 32 ---------- */
.btn { --btn-ink: var(--text); position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); height: var(--h-md); padding: 0 var(--sp-4); border-radius: var(--r-2); border: 1px solid var(--border-control); background: var(--surface); color: var(--btn-ink); font-size: var(--fs-md); font-weight: var(--fw-semibold); white-space: nowrap; text-decoration: none !important; user-select: none; transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-press) var(--ease-out); }
.btn:hover { background: var(--surface-2); border-color: var(--text-2); }
.btn:active { transform: translateY(1px); background: var(--surface-3); }
.btn--secondary { /* обычная — то же, что .btn */ }
.btn--primary { --btn-ink: var(--on-action); background: var(--action); border-color: var(--action); }
.btn--primary:hover { background: var(--action-hover); border-color: var(--action-hover); }
.btn--primary:active { background: var(--action-press); border-color: var(--action-press); }
.btn--ghost { --btn-ink: var(--text-2); background: transparent; border-color: transparent; }
.btn--ghost:hover { --btn-ink: var(--text); background: var(--surface-3); border-color: transparent; }
.btn--ghost:active { background: var(--border-2); }
.btn--danger { --btn-ink: var(--crit-ink); background: var(--surface); border-color: var(--crit-ink); }
.btn--danger:hover { background: var(--crit-bg); border-color: var(--crit-ink); }
.btn--danger-fill { --btn-ink: var(--on-crit); background: var(--crit-ink); border-color: var(--crit-ink); }
.btn--danger-fill:hover { background: var(--crit); border-color: var(--crit); }
.btn--sm { height: var(--h-sm); padding: 0 var(--sp-3); font-size: var(--fs-sm); gap: var(--sp-1); }
.btn--lg { height: var(--h-lg); padding: 0 var(--sp-4); }
.btn--icon { width: var(--h-icon); padding: 0; }
.btn--sm.btn--icon { width: var(--h-sm); }
.btn--block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.is-disabled { pointer-events: none; }
/* загрузка: ширина не меняется, внутри индикатор, затем ✓ на секунду */
.btn.is-loading, .btn.is-done { color: transparent !important; pointer-events: none; }
.btn.is-loading .ic, .btn.is-done .ic { visibility: hidden; }
.btn.is-loading::after { content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border: 2px solid var(--btn-ink); border-right-color: transparent; border-radius: var(--r-pill); animation: spin .7s linear infinite; }
.btn.is-done::after { content: "✓"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--btn-ink); font-weight: var(--fw-bold); animation: fade-in var(--dur-fast) var(--ease-out); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; } }
/* обёртка для подсказки у отключённой кнопки (отключённая не получает наведение) */
.tip-wrap { display: inline-flex; }
.tip-wrap > .btn[disabled] { pointer-events: none; }
.tip-wrap--block { display: flex; }
.tip-wrap--block > .btn { flex: 1 1 auto; }
.link-btn { border: 0; background: none; padding: 0; color: var(--action-ink); font-weight: var(--fw-semibold); text-align: left; }
.link-btn:hover { text-decoration: underline; }
.link-btn--plain { color: var(--text); }
.link-btn--plain:hover { text-decoration: none; color: var(--action-ink); }
/* платное действие: «Глагол · цена» */
.btn--pay { gap: var(--sp-2); }
.btn--pay__p { padding-left: var(--sp-2); border-left: 1px solid var(--border-2); font-weight: var(--fw-bold); }

/* ---------- Карточки ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-3); box-shadow: var(--shadow-1); }
.card--pad { padding: var(--sp-4); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4) 0; min-height: 40px; }
.card__head h2 { font-size: var(--fs-lg); }
.card__body { padding: var(--sp-2) var(--sp-4) var(--sp-4); }
.card__body--flush { padding: var(--sp-2) 0 0; }
.card__foot { padding: var(--sp-2) var(--sp-4); border-top: 1px solid var(--border); }
.card--fill { display: flex; flex-direction: column; min-height: 0; }
.card--fill > .card__body { flex: 1 1 auto; min-height: 0; overflow: auto; }
.grid { display: grid; gap: var(--sp-4); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--dash { grid-template-columns: minmax(0, 1fr) 360px; }
.grid--gap16 { gap: var(--sp-4); }
/* колонка, которая растягивается до высоты соседней: последняя карточка забирает свободное место */
.dash-col { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; min-height: 0; }
.dash-col > .card:last-child { flex: 1 1 auto; }
.dash-col > .card--fill:last-child { flex: 1 1 0; min-height: 180px; }
.thread-card { display: flex; flex-direction: column; }
.thread-card > .card__body { flex: none; padding-top: var(--sp-3); }
.thread-card > .card__foot { flex: 1; display: flex; flex-direction: column; }
.thread-card > .card__foot .textarea { flex: 1; min-height: 64px; resize: none; }

.kpi { padding: var(--sp-3) var(--sp-4); display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--sp-3); align-items: baseline; align-content: start; }
.kpi > :not(.kpi__val):not(.kpi__sub) { grid-column: 1 / -1; }
.kpi__lbl { font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-2); display: flex; align-items: center; gap: var(--sp-2); }
.kpi__val { font-size: var(--fs-xl); line-height: var(--lh-xl); font-weight: var(--fw-bold); margin-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi__val--num { font-size: var(--fs-num); line-height: var(--lh-num); }
.kpi__sub { font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-3); min-width: 0; }
.kpi__sub--row { grid-column: 1 / -1; margin-top: 2px; }
.kpi__acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-top: var(--sp-2); }

/* ---------- Четыре компонента меток: статус · оценка · метка · счётчик ---------- */
/* Статус — значок формы и слово, без подложки */
.status { display: inline-flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--fw-semibold); white-space: nowrap; color: var(--text-2); }
.status .ic { width: 14px; height: 14px; stroke-width: 2.2; }
.status--done { color: var(--done-ink); }
.status--work, .status--info { color: var(--info-ink); }
.status--warn { color: var(--warn-ink); }
.status--crit { color: var(--crit-ink); }
.status--neutral { color: var(--text-3); }
.status--sm { font-size: var(--fs-xs); line-height: var(--lh-xs); }
/* Оценка — квадратная плашка с буквой, только риск */
.grade { width: 24px; height: 24px; border-radius: var(--r-1); font-weight: var(--fw-bold); font-size: var(--fs-sm); line-height: 1; display: inline-flex; align-items: center; justify-content: center; flex: none; background: var(--risk-none); color: var(--risk-none-on); }
.grade--sm { width: 20px; height: 20px; font-size: var(--fs-xs); }
.grade--lg { width: 28px; height: 28px; font-size: var(--fs-md); }
.grade--a { background: var(--risk-a); color: var(--risk-a-on); }
.grade--b { background: var(--risk-b); color: var(--risk-b-on); }
.grade--c { background: var(--risk-c); color: var(--risk-c-on); }
.grade--d { background: var(--risk-d); color: var(--risk-d-on); }
.grade--e { background: var(--risk-e); color: var(--risk-e-on); }
/* Метка — серая пилюля 22 px */
.tag { display: inline-flex; align-items: center; gap: var(--sp-1); min-width: 0; min-height: 22px; padding: 3px var(--sp-2); border-radius: var(--r-pill); background: var(--surface-3); color: var(--text-2); font-size: var(--fs-xs); line-height: var(--lh-xs); font-weight: var(--fw-regular); max-width: 100%; overflow-wrap: break-word; }
.tag > .tag__t { min-width: 0; }
.tag--opt { background: transparent; box-shadow: inset 0 0 0 1px var(--border-2); color: var(--text-3); }
.tag--user .tag__x { position: relative; width: 16px; height: 16px; padding: 0; margin-right: -4px; border: 0; border-radius: var(--r-pill); background: none; color: var(--text-3); display: inline-flex; align-items: center; justify-content: center; }
.tag--user .tag__x::before { content: ""; position: absolute; inset: -4px; }
.tag--user .tag__x:hover { color: var(--text); background: var(--border-2); }
/* Счётчик — круглая пилюля; красный только для того, что требует действия */
.counter { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 var(--sp-1); border-radius: var(--r-pill); background: var(--surface-3); color: var(--text-2); font-size: var(--fs-xs); line-height: 20px; font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; }
.counter--crit { background: var(--crit); color: var(--on-crit); }
.nav__item .counter { margin-left: auto; }
.nav__item.is-active .counter:not(.counter--crit) { background: var(--surface); color: var(--action-ink); }
/* Фильтр-переключатель — это кнопка, радиус как у кнопок */
.chip { display: inline-flex; align-items: center; gap: var(--sp-1); height: var(--h-sm); padding: 0 var(--sp-3); border-radius: var(--r-2); background: var(--surface); color: var(--text-2); font-size: var(--fs-sm); border: 1px solid var(--border-2); white-space: nowrap; transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
button.chip:hover { border-color: var(--border-control); color: var(--text); }
.chip.is-active { background: var(--action-bg); color: var(--action-ink); border-color: var(--action-ink); font-weight: var(--fw-semibold); }
.chip .counter { min-width: 18px; height: 18px; line-height: 18px; padding: 0 var(--sp-1); background: var(--surface-3); }
.chip.is-active .counter { background: var(--surface); color: var(--action-ink); }
.chip .ic { width: 14px; height: 14px; }
/* Значок факта: форма вместе с цветом — ✓ норма, ! внимание, ✕ проблема, — нет оценки */
.shape { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: var(--r-1); font-size: var(--fs-xs); font-weight: var(--fw-bold); line-height: 1; flex: none; }
.shape--good { color: var(--done-ink); background: var(--done-bg); }
.shape--warn { color: var(--warn-ink); background: var(--warn-bg); }
.shape--bad { color: var(--crit-ink); background: var(--crit-bg); }
.shape--info { color: var(--text-3); background: var(--surface-3); }
/* «новое / непрочитанное» — жирность и точка цвета текста */
.unseen-dot { display: inline-block; width: 8px; height: 8px; margin-right: var(--sp-1); border-radius: var(--r-pill); background: var(--text); vertical-align: middle; flex: none; }

/* прогресс */
.progress { height: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.progress__bar { height: 100%; background: var(--brand); border-radius: var(--r-pill); transition: width var(--dur-data) var(--ease-out); }
.progress--info .progress__bar { background: var(--info); }
.status-cell { min-width: 120px; }
.status-cell .progress { margin-top: var(--sp-1); width: 96px; height: 4px; }

/* ---------- Вкладки и сегменты: линия вкладки скользит ---------- */
.tabs { position: relative; display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--border); margin-bottom: var(--sp-3); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: var(--sp-2); height: var(--h-md); padding: 0 var(--sp-3); border: 0; background: none; color: var(--text-2); font-weight: var(--fw-semibold); white-space: nowrap; text-decoration: none !important; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--action-ink); }
.tabs__line { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; border-radius: var(--r-pill); background: var(--action); pointer-events: none; }
.tabs__line.is-anim { transition: transform var(--dur-fast) var(--ease-out), width var(--dur-fast) var(--ease-out); }
.tabs:not(.has-line) .tab.is-active::after { content: ""; position: absolute; left: var(--sp-2); right: var(--sp-2); bottom: 0; height: 2px; border-radius: var(--r-pill); background: var(--action); }
.tab.is-active .counter { background: var(--action-bg); color: var(--action-ink); }
.tabs__end { margin-left: auto; align-self: center; }
.tabs__end.is-on { background: var(--surface-3); color: var(--text); }
.tabs__hint { align-self: center; margin-left: var(--sp-2); white-space: nowrap; }
.seg { display: inline-flex; padding: 2px; background: var(--surface-3); border-radius: var(--r-2); gap: 2px; }
.seg__btn { border: 0; background: none; height: 32px; padding: 0 var(--sp-3); border-radius: var(--r-2); color: var(--text-2); font-weight: var(--fw-semibold); font-size: var(--fs-sm); white-space: nowrap; transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.seg__btn:hover { color: var(--text); }
.seg__btn.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.seg--sm .seg__btn { height: 24px; padding: 0 var(--sp-2); font-size: var(--fs-xs); }

/* ---------- Поля и формы ---------- */
.field { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.field__label { font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--fw-semibold); color: var(--text); display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.field__req { color: var(--crit-ink); }
.field__hint { font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-3); }
.field__err { font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--crit-ink); display: none; align-items: center; gap: var(--sp-1); }
.field__err.is-on, .field.is-invalid .field__err { display: flex; }
.field.is-invalid .input { border-color: var(--crit); }
.field.is-valid .input { border-color: var(--border-control); }
.field__need { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.input, .select, .textarea { width: 100%; height: var(--h-md); padding: 0 var(--sp-3); border: 1px solid var(--border-control); border-radius: var(--r-2); background: var(--surface); color: var(--text); transition: border-color var(--dur-fast) var(--ease-out); }
.textarea { height: auto; min-height: 80px; padding: var(--sp-2) var(--sp-3); resize: vertical; line-height: var(--lh-md); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-2); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--focus-color); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 2px solid var(--focus-color); outline-offset: -1px; }
.input[readonly] { background: var(--surface-2); color: var(--text-2); }
.input--lg { height: var(--h-lg); }
.input--sm, .select--sm, .input--xs { height: var(--h-sm); padding: 0 var(--sp-2); font-size: var(--fs-sm); }
.input--sm { width: 240px; }
.input--xs { width: 96px; }
.select--sm { width: auto; min-width: 168px; padding-right: var(--sp-8); }
.textarea--sm { min-height: 48px; padding: var(--sp-1) var(--sp-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.input-icon { position: relative; }
.input-icon .ic { position: absolute; left: var(--sp-3); top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 40px; }
.select { appearance: none; padding-right: var(--sp-8); background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3) var(--sp-4); }
.form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
.save-state { display: inline-flex; align-items: center; gap: var(--sp-1); min-height: var(--lh-xs); font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-3); transition: opacity var(--dur-fast) var(--ease-out); }
.save-state.is-busy { color: var(--info-ink); }
.save-state.is-err { color: var(--crit-ink); }
.save-state.is-swap { opacity: 0; }
.save-state:empty { display: none; }

.check { position: relative; display: inline-flex; align-items: flex-start; gap: var(--sp-3); cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check__box { flex: none; width: 20px; height: 20px; border: 1.5px solid var(--border-control); border-radius: var(--r-1); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; color: var(--on-action); margin-top: 2px; transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.check__box .ic { opacity: 0; }
.check__box--lock { background: var(--surface-3); border-color: var(--border); color: var(--text-3); }
.check__box--lock .ic { opacity: 1; }
.check input:checked + .check__box { background: var(--action); border-color: var(--action); }
.check input:checked + .check__box .ic { opacity: 1; }
.check input:focus-visible + .check__box { box-shadow: var(--focus-ring); }
.check:hover .check__box { border-color: var(--action); }

.switch { position: relative; display: inline-flex; align-items: center; gap: var(--sp-3); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { width: 36px; height: 20px; border-radius: var(--r-pill); background: var(--border-control); position: relative; transition: background-color var(--dur-fast) var(--ease-out); flex: none; }
.switch__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--shadow-1); transition: transform var(--dur-fast) var(--ease-out); }
.switch input:checked + .switch__track { background: var(--action); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { box-shadow: var(--focus-ring); }
.switch input:disabled + .switch__track { opacity: .5; }

.dropzone { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-4); border: 1.5px dashed var(--border-control); border-radius: var(--r-2); background: var(--surface-2); color: var(--text-2); cursor: pointer; }
.dropzone:hover { border-color: var(--action); color: var(--text); }
.dropzone.has-file { border-style: solid; border-color: var(--done-line); background: var(--done-bg); color: var(--done-ink); }
.dropzone.is-off { opacity: .6; cursor: not-allowed; }
.dropzone .grow { min-width: 0; overflow-wrap: anywhere; }

/* ---------- Баннеры: те же четыре уровня, что у тостов, колокольчика и флагов ---------- */
.banner { display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-3); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.banner__ic { flex: none; display: inline-flex; margin-top: 1px; }
.banner__body { flex: 1; min-width: 0; }
.banner__title { font-weight: var(--fw-bold); }
.banner .banner__body p { color: inherit; margin: 0; }
.banner > .btn { align-self: center; }
.banner--crit { background: var(--crit-bg); border-color: var(--crit-line); }
.banner--crit .banner__ic, .banner--crit > .ic, .banner--crit .banner__title { color: var(--crit-ink); }
.banner--warn { background: var(--warn-bg); border-color: var(--warn-line); }
.banner--warn .banner__ic, .banner--warn > .ic, .banner--warn .banner__title { color: var(--warn-ink); }
.banner--info { background: var(--info-bg); border-color: var(--info-line); }
.banner--info .banner__ic, .banner--info > .ic, .banner--info .banner__title { color: var(--info-ink); }
.banner--done { background: var(--done-bg); border-color: var(--done-line); }
.banner--done .banner__ic, .banner--done > .ic { color: var(--done-ink); }
.banner--neutral > .ic, .banner--neutral .banner__ic { color: var(--text-3); }
.banner--tight { padding: var(--sp-2) var(--sp-3); }
.banners { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.banners__more { align-self: flex-start; }

/* ---------- Таблица: одна для списков и отчёта, две плотности ---------- */
.table-wrap { position: relative; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-md); line-height: var(--lh-md); }
.table th { text-align: left; font-size: var(--fs-xs); line-height: var(--lh-xs); font-weight: var(--fw-semibold); color: var(--text-2); padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border); background: var(--th-bg); }
.table th:first-child { border-top-left-radius: var(--r-2); }
.table th:last-child { border-top-right-radius: var(--r-2); }
.table td { padding: var(--sp-2) var(--sp-3); line-height: var(--lh-sm); border-bottom: 1px solid var(--border); vertical-align: middle; transition: height var(--dur-fast) var(--ease-out); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.is-click { cursor: pointer; }
.table td.money, .table th.money, .table td.r, .table th.r, .table td.num { text-align: right; }
.table .sub { font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-3); }
.table .obj-ic { width: 28px; height: 28px; }
.table .obj-cell { gap: var(--sp-2); min-width: 0; }
.table .avatar { width: 24px; height: 24px; font-size: var(--fs-xs); }
.table tbody tr:nth-child(even of :not(.is-sub)) td { background: var(--row-alt); }
.table tbody tr:hover > td { background: var(--row-hover); }
.table tbody tr:hover > td:first-child { box-shadow: inset 2px 0 0 var(--action); }
.table tr.is-sub td { background: var(--row-sub); font-size: var(--fs-sm); animation: fade-in var(--dur-panel) var(--ease-out); }
.table tr.is-sub td:first-child { box-shadow: inset var(--bar-w) 0 0 var(--action-bg-2); }
.table tr.is-new td { animation: row-flash var(--dur-row) var(--ease-out); }
.table tr.is-back td { animation: row-flash var(--dur-row) var(--ease-out); }
.table tr.is-cursor > td { background: var(--row-hover); }
.table tr.is-cursor > td:first-child { box-shadow: inset var(--bar-w) 0 0 var(--action); }
.table tr.is-muted > td { color: var(--text-3); background: var(--surface-2); }
.table tr.is-muted .row-link, .table tr.is-muted .strong, .table tr.is-muted .status--done { color: var(--text-3); }
.table tr.is-muted .avatar { background: var(--surface-3); color: var(--text-3); }
@keyframes row-flash { 0%, 30% { background-color: var(--action-bg); } }
@media (min-width: 720px) {
  .table { font-size: var(--fs-sm); line-height: var(--lh-sm); }
  .table td { height: 44px; }
  .table th + th, .table td + td { border-left: 1px solid var(--line-v); }
  .table td.td-check + td, .table th.td-check + th, .table td.td-exp + td { border-left: 0; }
  .table td.td-check, .table th.td-check { width: 1%; padding-left: var(--sp-3); padding-right: 0; }
  .table td.td-check .check { display: flex; }
  .table tr.is-sub td + td { border-left: 0; }
  .table .tag { min-height: 20px; padding-top: 2px; padding-bottom: 2px; }
  .table .rid__copy { width: 24px; height: 16px; }
  .table .rid__copy::before { content: ""; position: absolute; inset: -4px 0; }
  .table tbody tr:not(:hover):not(.is-cursor) .rid__copy:not(:focus-visible):not(.is-copied) { opacity: 0; }
  /* шапка закреплена при прокрутке страницы (на полном экране обёртка без своей прокрутки) */
  .table--sticky th { position: sticky; top: var(--topbar-h); z-index: 3; }
}
@media (min-width: 1280px) { .table-wrap--sticky { overflow: visible; } }
/* узкий рабочий вид: поля ячеек меньше, чтобы таблицы помещались без прокрутки вбок */
@media (min-width: 720px) and (max-width: 1099.98px) { .table th, .table td { padding-left: var(--sp-2); padding-right: var(--sp-2); } }
/* плотная таблица внутри отчёта и диалогов */
.table--sm { font-size: var(--fs-sm); line-height: var(--lh-sm); border: 1px solid var(--border); border-radius: var(--r-2); overflow: hidden; }
.table--sm th { padding: var(--sp-1) var(--sp-3); }
.table--sm td { height: auto; padding: var(--sp-1) var(--sp-3); vertical-align: top; }
.table--sm th + th, .table--sm td + td { border-left: 0; }
.table--sm tbody tr:hover > td:first-child { box-shadow: none; }
.table--sm tbody tr:hover > td { background: inherit; }
.table--sm tbody tr:nth-child(even) td { background: var(--row-alt); }
.table--sm .c { text-align: center; }
.table--sm tr.is-cur td { background: var(--action-bg); font-weight: var(--fw-semibold); }
.table--sm tr.is-past td { color: var(--text-3); }
.th-sort__b { display: inline-flex; align-items: center; gap: var(--sp-1); white-space: nowrap; min-height: var(--hit); padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.th-sort__a { font-size: var(--fs-xs); color: var(--text-3); }
.th-sort__b.is-on, .th-sort__b.is-on .th-sort__a { color: var(--text); }
.table tfoot td { background: var(--surface-2); font-weight: var(--fw-semibold); border-top: 1px solid var(--border-2); height: auto; }
.expander { position: relative; width: var(--hit); height: var(--hit); border-radius: var(--r-2); border: 0; padding: 0; background: transparent; color: var(--text-3); display: inline-flex; align-items: center; justify-content: center; flex: none; transition: transform var(--dur-panel) var(--ease-out); }
.expander:hover { background: var(--surface-3); color: var(--text); }
.expander.is-open { transform: rotate(90deg); }
.obj-cell { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.obj-cell__t { min-width: 0; }
.obj-ic { width: var(--h-md); height: var(--h-md); border-radius: var(--r-2); display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--text-2); flex: none; }
.prod-list { display: flex; flex-wrap: wrap; gap: var(--sp-1); max-width: 320px; min-width: 0; }
.row-link { color: var(--text); }
.row-link:hover { color: var(--action-ink); }

.toolbar { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; padding: var(--sp-3); border-bottom: 1px solid var(--border); }
.toolbar .input-icon { flex: 1 1 180px; max-width: 320px; }
.toolbar .select { width: auto; flex: 0 1 auto; min-width: 0; max-width: 148px; font-size: var(--fs-sm); padding-left: var(--sp-2); padding-right: 28px; background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; }
.toolbar .input-icon .input { font-size: var(--fs-sm); }
.toolbar__end { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); }
/* «Оригиналы согласий»: пояснение переносится, выбор сотрудника и печать остаются справа одной группой */
.cons-lead { flex: 1 1 320px; }
.cons-acts { flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 719.98px) { .cons-acts { flex: 1 1 100%; margin-left: 0; } .cons-acts > * { flex: 1 1 auto; } }
/* там же «Создал»: имя и отчество в одну строку, а на узком экране — переносятся, чтобы таблица не уезжала вбок */
.table--rq2 .rq-who .ln2 { white-space: normal; }
/* панель «Выбрано: N» — плавающая внизу, таблица не сдвигается */
.bulkbar { position: fixed; z-index: 150; left: calc(50% + var(--side-cur) / 2); bottom: var(--sp-6); transform: translateX(-50%); display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4); border-radius: var(--r-3); background: var(--surface); color: var(--text); border: 1px solid var(--border-2); font-weight: var(--fw-semibold); white-space: nowrap; box-shadow: var(--shadow-3); }
.bulkbar.is-in { animation: bulk-in var(--dur-panel) var(--ease-out); }
@keyframes bulk-in { from { opacity: 0; transform: translate(-50%, 16px); } }

/* пустые состояния и скелетоны */
.empty { text-align: center; padding: var(--sp-6) var(--sp-4); color: var(--text-2); }
.empty__ic { width: 44px; height: 44px; border-radius: var(--r-3); margin: 0 auto var(--sp-2); background: var(--surface-3); color: var(--text-3); display: flex; align-items: center; justify-content: center; }
.empty h3 { color: var(--text); margin-bottom: var(--sp-1); }
.empty--sm { padding: var(--sp-3); }
.skel { position: relative; overflow: hidden; background: var(--surface-3); border-radius: var(--r-1); }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, var(--skel-shine), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { 100% { transform: translateX(100%); } }
.skel-line { height: 12px; margin: var(--sp-2) 0; }
.skel--ring { width: 96px; height: 96px; border-radius: var(--r-pill); flex: none; }

/* ---------- Подсказки: один механизм (скрипт), задержка 300 мс, проверка краёв экрана ---------- */
.hint { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; padding: 0; border: 0; border-radius: var(--r-pill); background: var(--surface-3); color: var(--text-2); font-size: var(--fs-xs); font-weight: var(--fw-bold); line-height: 1; cursor: help; vertical-align: middle; flex: none; }
.hint::before { content: ""; position: absolute; inset: -4px; }
.hint:hover, .hint:focus-visible { background: var(--action-bg); color: var(--action-ink); }
.tip { position: fixed; z-index: 300; left: 0; top: 0; max-width: 280px; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--tip-line); border-radius: var(--r-2); background: var(--tip-bg); color: var(--tip-ink); font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--fw-regular); text-align: left; white-space: pre-line; overflow-wrap: break-word; box-shadow: var(--shadow-3); pointer-events: none; visibility: hidden; }
/* подсказка всегда непрозрачная: без проявления, чтобы текст под ней не просвечивал */
.tip.is-on { visibility: visible; }
.explain { font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-3); margin-top: 2px; }

/* ---------- Всплывающие меню и уведомления ---------- */
.pop-anchor { position: relative; }
.popover { position: absolute; top: calc(100% + 8px); right: 0; min-width: 260px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-3); box-shadow: var(--shadow-3); z-index: 60; opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), visibility var(--dur-fast); }
.popover.is-open { opacity: 1; visibility: visible; transform: none; }
.popover__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--border); }
.popover__foot { padding: var(--sp-2) var(--sp-4); border-top: 1px solid var(--border); }
.menu { padding: var(--sp-1); }
.menu__item { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: var(--h-md); padding: var(--sp-2) var(--sp-3); border: 0; background: none; border-radius: var(--r-2); color: var(--text); text-align: left; text-decoration: none !important; }
.menu__item:hover { background: var(--surface-2); }
.menu__item .ic { color: var(--text-3); }
.menu__sep { height: 1px; background: var(--border); margin: var(--sp-1); }
.menu__label { padding: var(--sp-2) var(--sp-3) var(--sp-1); font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-3); }
.menu__theme { padding: var(--sp-1) var(--sp-3) var(--sp-2); }
.menu__theme-lbl { display: flex; align-items: center; gap: var(--sp-3); min-height: var(--h-sm); margin-bottom: var(--sp-1); }
.menu__theme-lbl .ic { color: var(--text-3); }
.menu__theme-seg { display: flex; width: 100%; }
.menu__theme-seg .seg__btn { flex: 1 1 auto; }
.notif-pop { width: 392px; }
.notif-list { max-height: 440px; overflow-y: auto; }
.notif-group { padding: var(--sp-2) var(--sp-4) var(--sp-1); font-size: var(--fs-xs); line-height: var(--lh-xs); font-weight: var(--fw-semibold); color: var(--text-3); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.notif { display: flex; gap: var(--sp-3); padding: var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none !important; }
.notif:hover { background: var(--surface-2); }
.notif:last-child { border-bottom: 0; }
.notif__ic { width: 28px; height: 28px; border-radius: var(--r-pill); display: flex; align-items: center; justify-content: center; flex: none; }
.notif__ic--done { background: var(--done-bg); color: var(--done-ink); }
.notif__ic--warn { background: var(--warn-bg); color: var(--warn-ink); }
.notif__ic--crit { background: var(--crit-bg); color: var(--crit-ink); }
.notif__ic--info { background: var(--info-bg); color: var(--info-ink); }
.notif__text { font-size: var(--fs-sm); line-height: var(--lh-sm); }
.notif.is-unread .notif__text { font-weight: var(--fw-bold); }
.notif.is-unread .notif__text::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--text); margin-right: var(--sp-1); vertical-align: 1px; }
.notif__sub { font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-2); }
.notif__time { font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-3); margin-top: 2px; }
.notif-grp > summary { list-style: none; cursor: pointer; }
.notif-grp > summary::-webkit-details-marker { display: none; }
.notif-grp > summary .notif__chev { margin-left: auto; align-self: center; color: var(--text-3); transition: transform var(--dur-panel) var(--ease-out); }
.notif-grp[open] > summary .notif__chev { transform: rotate(180deg); }
.notif-grp .notif--child { padding-left: 56px; }
.notif--sig .obj-ic { width: 28px; height: 28px; }
.notif__name { font-weight: var(--fw-semibold); }
.notif.is-unread .notif__name { font-weight: var(--fw-bold); }
.notif__det { font-size: var(--fs-xs); font-weight: var(--fw-regular); color: var(--text-3); }
.notif--sig .notif__sub { color: var(--text); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.notif--sig .notif__sub .status { vertical-align: -2px; margin-right: var(--sp-1); }
.notif--sig .notif__sub .tag { min-height: 20px; padding-top: 2px; padding-bottom: 2px; vertical-align: 1px; }
.notif--more { color: var(--action-ink); font-weight: var(--fw-semibold); }
.role-switch { margin: var(--sp-1); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-3); background: var(--warn-bg); }
.role-switch__lbl { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--warn-ink); margin-bottom: var(--sp-1); }
.role-switch__note { font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--warn-ink); margin-top: var(--sp-1); }
.role-switch .seg { width: 100%; background: var(--surface); }
.role-switch .seg__btn { flex: 1; }

/* ---------- Диалоги ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 64px var(--sp-4) var(--sp-8); background: var(--scrim); overflow-y: auto; opacity: 0; transition: opacity var(--dur-panel) var(--ease-out); }
.modal-wrap.is-in { opacity: 1; }
.modal { width: 100%; background: var(--surface); border-radius: var(--r-3); box-shadow: var(--shadow-3); transform: translateY(8px); transition: transform var(--dur-panel) var(--ease-out); }
.modal-wrap.is-in .modal { transform: none; }
.modal--sm { max-width: 440px; }
.modal--md { max-width: 600px; }
.modal--lg { max-width: 820px; }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--sp-6) 0; }
.modal__title { font-size: var(--fs-lg); line-height: var(--lh-lg); }
.modal__body { padding: var(--sp-3) var(--sp-6) var(--sp-4); }
.modal__foot { display: flex; justify-content: flex-end; gap: var(--sp-2); padding: var(--sp-3) var(--sp-6); border-top: 1px solid var(--border); flex-wrap: wrap; }
.modal__foot .push { margin-right: auto; }
/* Большое окно (xl): постоянная высота — 90% экрана, прокрутка внутри тела; на телефоне — весь экран.
   «Подробнее» и «Пример» в мастере: два вида в одном окне, размер при переключении не меняется */
.modal-wrap--xl { align-items: center; padding: 5vh var(--sp-4); overflow: hidden; }
.modal--xl { max-width: 1100px; height: 90vh; display: flex; flex-direction: column; }
.modal--xl .modal__head { flex: none; padding-bottom: var(--sp-3); border-bottom: 1px solid var(--border); }
.modal--xl .modal__title { min-width: 0; overflow-wrap: anywhere; }
.modal--xl .modal__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-top: var(--sp-4); }
.modal--xl .modal__foot { flex: none; }
.modal [data-view][hidden], .modal [data-for][hidden] { display: none; }
.cm-about { display: grid; gap: var(--sp-4) var(--sp-8); align-items: start; }
@media (min-width: 960px) { .cm-about { grid-template-columns: minmax(0, 1fr) minmax(0, 420px); } }
.cm-bar { position: sticky; top: calc(-1 * var(--sp-4)); z-index: 2; display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: calc(-1 * var(--sp-4)) 0 var(--sp-2); padding: var(--sp-2) 0; background: var(--surface); }
/* Окно не меняет размер при переключении: панели в одной ячейке сетки, неактивные скрыты, но измерены */
.mstack { display: grid; min-width: 0; }
.mstack > * { grid-area: 1 / 1; min-width: 0; }
.mstack > :not(.is-on) { visibility: hidden; pointer-events: none; }
.keys { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--sp-2) var(--sp-4); align-items: center; }
.keys .kbd { justify-self: start; }

/* палитра поиска */
.palette { padding: 0; }
.palette__input { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); }
.palette__input input { flex: 1; border: 0; outline: none; background: none; font-size: var(--fs-lg); }
.palette__res { height: min(420px, calc(100vh - 220px)); overflow-y: auto; padding: var(--sp-2); }
.palette__item { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-2); color: var(--text); text-decoration: none !important; }
.palette__item:hover, .palette__item.is-sel { background: var(--action-bg); }
.palette__rq { align-items: flex-start; }
.palette__rq .grow, .palette__d, .palette__ai { display: flex; flex-direction: column; min-width: 0; }
.palette__rq .grow { overflow-wrap: break-word; }
.palette__d { flex: none; width: 128px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.palette__ai { flex: none; width: 168px; }
@media (max-width: 719.98px) { .palette__d { display: none; } .palette__ai { width: 128px; } }
.palette__group { padding: var(--sp-2) var(--sp-3) var(--sp-1); font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-3); }
mark { background: var(--warn-bg); color: inherit; border-radius: var(--r-1); padding: 0 1px; box-shadow: 0 0 0 1px var(--warn-line); }

/* ---------- Тосты: оформлены как баннер того же уровня ---------- */
.toasts { position: fixed; right: var(--sp-6); bottom: var(--sp-6); z-index: 200; display: flex; flex-direction: column; gap: var(--sp-2); align-items: flex-end; pointer-events: none; }
.toast { position: relative; overflow: hidden; pointer-events: auto; display: flex; align-items: center; gap: var(--sp-3); min-width: 320px; max-width: 440px; padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4); border-radius: var(--r-3); border: 1px solid var(--done-line); background: var(--surface); color: var(--text); box-shadow: var(--shadow-3); opacity: 0; transform: translateY(12px); transition: opacity var(--dur-panel) var(--ease-out), transform var(--dur-panel) var(--ease-out); }
.toast.is-in { opacity: 1; transform: none; }
.toast__ic { width: 28px; height: 28px; border-radius: var(--r-pill); display: flex; align-items: center; justify-content: center; flex: none; background: var(--done-bg); color: var(--done-ink); }
.toast--crit { background: var(--crit-bg); border-color: var(--crit-line); } .toast--crit .toast__ic { background: var(--surface); color: var(--crit-ink); }
.toast--warn { background: var(--warn-bg); border-color: var(--warn-line); } .toast--warn .toast__ic { background: var(--surface); color: var(--warn-ink); }
.toast--info { background: var(--info-bg); border-color: var(--info-line); } .toast--info .toast__ic { background: var(--surface); color: var(--info-ink); }
.toast__body { flex: 1; min-width: 0; }
.toast__text { font-weight: var(--fw-semibold); font-size: var(--fs-md); }
.toast__sub { font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-2); }
.toast__link { font-weight: var(--fw-semibold); white-space: nowrap; font-size: var(--fs-sm); }
.toast__x { border: 0; background: none; color: var(--text-3); width: var(--h-sm); height: var(--h-sm); border-radius: var(--r-2); display: flex; align-items: center; justify-content: center; flex: none; }
.toast__x:hover { background: var(--surface-3); color: var(--text); }
.toast__bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--action); transform-origin: left; animation: toast-bar linear forwards; }
.toast:hover .toast__bar { animation-play-state: paused; }
@keyframes toast-bar { to { transform: scaleX(0); } }

/* ---------- Главная ---------- */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-3); }
.balance-card .kpi__val { font-size: var(--fs-num); line-height: var(--lh-num); }
.balance-card__row { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); }
.fc { margin-top: var(--sp-2); padding-top: var(--sp-2); border-top: 1px solid var(--border); font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-2); }
.fc b { color: var(--text); }
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-2); }
.quick__btn { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--sp-3); align-items: center; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-3); border: 1px solid var(--border); background: var(--surface); color: var(--text); text-align: left; text-decoration: none !important; transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.quick__btn:hover { border-color: var(--action); box-shadow: var(--shadow-2); }
.quick__btn:active { transform: translateY(1px); }
.quick__ic { grid-row: span 2; width: var(--h-md); height: var(--h-md); border-radius: var(--r-2); background: var(--action-bg); color: var(--action-ink); display: flex; align-items: center; justify-content: center; }
.quick__t { font-weight: var(--fw-semibold); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.quick__d { font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-2); }
.todo { list-style: none; margin: 0; padding: 0; }
.todo__i { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); }
.todo__i:last-child { border-bottom: 0; }
.todo__ic { flex: none; display: inline-flex; }
.todo__ic--crit { color: var(--crit-ink); } .todo__ic--warn { color: var(--warn-ink); } .todo__ic--info { color: var(--info-ink); } .todo__ic--done { color: var(--done-ink); }
.todo__t { flex: 1 1 auto; min-width: 0; font-size: var(--fs-sm); line-height: var(--lh-sm); }
.todo__s { display: block; font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-3); }
.inv-mini { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none !important; font-size: var(--fs-sm); }
.inv-mini:last-child { border-bottom: 0; }
.inv-mini:hover .strong { color: var(--action-ink); }
.sig-mini { display: flex; gap: var(--sp-3); padding: var(--sp-2) 0 var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none !important; }
.sig-mini:last-child { border-bottom: 0; }
.sig-mini[hidden] { display: none; }
.sig-mini:hover { background: var(--surface-2); }
.sig-mini .obj-ic { width: 28px; height: 28px; }
.sig-mini__b { display: flex; flex-direction: column; min-width: 0; }
.sig-mini__who { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--sp-2); min-width: 0; }
.sig-mini__n { font-weight: var(--fw-semibold); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.sig-mini__d { font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-3); white-space: nowrap; }
.sig-mini__t { font-size: var(--fs-sm); line-height: var(--lh-sm); display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-1); }
.sig-mini__s { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--sp-1); min-width: 0; margin-top: 2px; font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-3); }
.sig-mini__s .tag { flex: none; }
.sig-mini__s > .dots { flex: 1 1 100%; min-width: 0; }
.sig-mini__s .status { vertical-align: top; }
.table--mon .last-cell { min-width: 140px; }
.table--mon .who--cell { align-items: flex-start; }
.table--rq2 .rq-obj__t > .tag { margin-left: var(--sp-1); }
@media (min-width: 720px) {
  .table--log { table-layout: fixed; } .table--log col.c-date { width: 168px; } .table--log col.c-who { width: 200px; }
  .table--tk { table-layout: fixed; } .table--tk col.c-date { width: 160px; } .table--tk col.c-topic { width: 27%; } .table--tk col.c-st { width: 17%; } .table--tk col.c-who { width: 160px; }
}
@media (min-width: 720px) {
  .table--mon { table-layout: fixed; }
  .table--mon col.c-subj { width: 22.5%; } .table--mon col.c-mode { width: 13.5%; } .table--mon col.c-per { width: 16%; } .table--mon col.c-st { width: 10%; }
  .table--mon col.c-cost { width: 90px; } .table--mon col.c-who { width: 160px; }
}
.table td.money .sub, .table td.money .ln2, .table th.money, .table--mon .status { white-space: normal; }
.sig-mini__x { min-width: 0; }
/* важность сигнала — полоса слева, один способ: внутренняя тень */
.sev--high { box-shadow: inset var(--bar-w) 0 0 var(--crit); }
.sev--mid { box-shadow: inset var(--bar-w) 0 0 var(--warn); }
.sev--low { box-shadow: inset var(--bar-w) 0 0 var(--info); }
.sev--good { box-shadow: inset var(--bar-w) 0 0 var(--done); }  /* «Улучшение»: тот же цвет, что у слова и точки в хронологии */

/* графики */
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--font); fill: var(--text-3); font-size: var(--fs-xs); }
.chart .bar { fill: var(--brand); opacity: .8; }
.chart .bar:hover { opacity: 1; }
.chart .bar--today { fill: var(--chart-today); opacity: 1; }
.chart .grid-line { stroke: var(--border); stroke-dasharray: 3 3; }

/* ---------- Новая проверка ---------- */
.wizard { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--sp-4); align-items: start; }
.wizard--single { grid-template-columns: minmax(0, 1fr); }
.stepper { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); flex-wrap: wrap; }
.stepper__item { display: inline-flex; align-items: center; gap: var(--sp-2); height: 32px; padding: 0 var(--sp-3) 0 var(--sp-1); border-radius: var(--r-pill); border: 0; background: transparent; color: var(--text-3); font-weight: var(--fw-semibold); }
.stepper__item.is-active { background: var(--action-bg); color: var(--action-ink); }
.stepper__item.is-done { color: var(--text); }
.stepper__item.is-done:hover { background: var(--surface-3); }
.stepper__n { width: 24px; height: 24px; border-radius: var(--r-pill); display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--text-2); font-size: var(--fs-sm); }
.stepper__item.is-active .stepper__n { background: var(--action); color: var(--on-action); }
.stepper__item.is-done .stepper__n { background: var(--action-bg-2); color: var(--action-ink); }
.stepper__line { width: 24px; height: 2px; background: var(--border); border-radius: var(--r-pill); }
.objects { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-3); }
.object { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border: 1.5px solid var(--border); border-radius: var(--r-3); background: var(--surface); text-align: left; transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.object:hover { border-color: var(--action); box-shadow: var(--shadow-2); }
.object.is-active { border-color: var(--action); background: var(--action-bg); }
.object__ic { width: var(--h-lg); height: var(--h-lg); border-radius: var(--r-3); display: flex; align-items: center; justify-content: center; flex: none; background: var(--surface-3); color: var(--text-2); }
.object__t { display: block; font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: var(--fw-bold); }
.object__d { display: block; font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-2); }
.presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); }
.preset { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3); border: 1px solid var(--border); border-radius: var(--r-3); background: var(--surface); text-align: left; }
.preset:hover { border-color: var(--action); box-shadow: var(--shadow-2); }
.preset__ic { width: var(--h-md); height: var(--h-md); border-radius: var(--r-2); background: var(--action-bg); color: var(--action-ink); display: flex; align-items: center; justify-content: center; flex: none; }
.preset__t { display: block; font-weight: var(--fw-bold); }
.preset__d { display: block; font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-2); }
.preset__p { display: block; font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text); font-weight: var(--fw-semibold); margin-top: 2px; }
.preset--fav { padding: 0; gap: 0; }
.preset__go { flex: 1; min-width: 0; display: block; padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-3); border: 0; border-radius: var(--r-3); background: none; color: var(--text); text-align: left; cursor: pointer; }
.preset__row { display: flex; align-items: baseline; gap: var(--sp-2); }
.preset__row .preset__t { flex: 1; min-width: 0; }
.preset__row .preset__p { flex: none; margin-top: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.preset--fav .preset__d { white-space: normal; overflow-wrap: anywhere; }
.preset--fav .fav-star { margin: var(--sp-2) var(--sp-2) 0 0; }
.section-title { display: flex; align-items: baseline; gap: var(--sp-3); margin: var(--sp-4) 0 var(--sp-2); flex-wrap: wrap; }
.section-title:first-child { margin-top: 0; }
.section-title h2 { font-size: var(--fs-lg); }
.smart { padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-1); }
.smart__lbl { display: flex; align-items: center; gap: var(--sp-2); font-weight: var(--fw-semibold); font-size: var(--fs-sm); line-height: var(--lh-sm); margin-bottom: var(--sp-2); color: var(--text); }
.smart__lbl .ic { color: var(--text-2); }
.smart__row { display: flex; gap: var(--sp-2); }
.smart__res { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); margin-top: var(--sp-2); min-height: var(--h-sm); }
.smart__ex-l { font-size: var(--fs-xs); color: var(--text-3); }
.pgroup { margin-bottom: var(--sp-4); }
.pgroup:last-child { margin-bottom: 0; }
.pgroup__head { display: flex; align-items: baseline; gap: var(--sp-3); margin-bottom: var(--sp-2); flex-wrap: wrap; }
.pgroup__name { font-size: var(--fs-md); font-weight: var(--fw-bold); }
.pgroup__q { font-size: var(--fs-xs); color: var(--text-3); }
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: var(--sp-2); }
.pcard { position: relative; display: flex; gap: var(--sp-3); padding: var(--sp-3); border: 1.5px solid var(--border); border-radius: var(--r-3); background: var(--surface); cursor: pointer; transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out); }
.pcard:hover { border-color: var(--border-control); box-shadow: var(--shadow-2); }
.pcard.is-on { border-color: var(--action); background: var(--action-bg); }
.pcard.is-locked { cursor: not-allowed; background: var(--surface-2); }
.pcard.is-locked:hover { box-shadow: none; border-color: var(--border); }
.pcard.is-locked .pcard__name, .pcard.is-locked .pcard__d { color: var(--text-3); }
.pcard__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pcard__main .pcard__meta { margin-top: auto; padding-top: var(--sp-1); }
.pcard__top { display: flex; align-items: flex-start; gap: var(--sp-2); }
/* галочка или замок — в первой строке перед названием; при переносе названия цена и звёздочка остаются на первой строке */
.pcard__top > .check, .pcard__top > .check__box { flex: none; }
.pcard__name { flex: 1; min-width: 0; font-weight: var(--fw-bold); line-height: var(--lh-md); }
.pcard__d { display: block; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-2); margin-top: 1px; }
.pcard__meta { display: flex; align-items: center; gap: var(--sp-1) var(--sp-3); margin-top: var(--sp-1); font-size: var(--fs-xs); color: var(--text-3); flex-wrap: wrap; }
.pcard__tags { display: inline-flex; gap: var(--sp-1); flex-wrap: wrap; }
.pcard__time { display: inline-flex; align-items: center; gap: var(--sp-1); white-space: nowrap; }
.pcard__price { flex: none; font-weight: var(--fw-bold); line-height: var(--lh-md); color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
/* звёздочка «Мои проверки»: контур — не отмечено, заливка — отмечено */
.fav-star { flex: none; align-self: flex-start; display: inline-flex; align-items: center; justify-content: center; width: var(--hit); height: var(--hit); margin: -2px -4px -2px 0; padding: 0; border: 0; border-radius: var(--r-1); background: none; color: var(--text-3); cursor: pointer; }
.fav-star:hover { color: var(--warn-ink); background: var(--surface-3); }
.fav-star.is-on { color: var(--warn-ink); }
.fav-star.is-on .ic { fill: var(--warn); }
.pcard__links { display: flex; gap: var(--sp-3); margin-left: auto; }
.pcard__links button { border: 0; background: none; padding: 0; min-height: var(--hit); font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--action-ink); }
.pcard__links button:hover { text-decoration: underline; }
.pcard__lock { font-size: var(--fs-xs); color: var(--warn-ink); display: flex; align-items: flex-start; gap: var(--sp-1); margin-top: var(--sp-1); }
/* Ступени цены на карточке: полоса «сделано / осталось» и три цены. Весь блок — кнопка, открывает окно со всеми ступенями.
   Текст на полосе нарисован дважды: второй слой (на заливке) обрезан clip-path по её краю — читается на обеих частях */
.ptier { display: block; width: 100%; margin-top: 6px; padding: var(--sp-2) 10px; border: 1px solid var(--border); border-radius: var(--r-2); background: var(--surface-2); text-align: left; color: var(--text-2); font-size: var(--fs-xs); line-height: var(--lh-xs); font-variant-numeric: tabular-nums; cursor: pointer; transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out); }
.ptier:hover { border-color: var(--border-control); background: var(--surface); }
.ptier:focus-visible { outline: 2px solid var(--focus-color); outline-offset: 2px; }
.pcard.is-on .ptier { background: var(--surface); }
.ptier > span { display: block; }
.ptier__bar { position: relative; border-radius: var(--r-2); background: var(--action-bg-2); overflow: hidden; }
/* первый слой задаёт высоту; если два больших числа не помещаются в узкой карточке — «осталось» переносится на вторую строку справа */
.ptier__lay { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 var(--sp-2); min-height: 30px; padding: 3px 10px; color: var(--text); }
.ptier__lay > span { white-space: nowrap; }
.ptier__lay > span:last-child { margin-left: auto; }
.ptier__lay b { font-size: var(--fs-md); font-weight: var(--fw-bold); }
.ptier__bar.is-long b { font-size: var(--fs-sm); }   /* два длинных числа — на размер меньше */
.ptier__lay--on { position: absolute; inset: 0; background: var(--action); color: var(--on-action); }
.ptier__steps { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 6px; }
.ptier__s { display: block; padding-left: var(--sp-2); border-left: 1px solid var(--border-2); }
.ptier__s:first-child { padding-left: 2px; border-left: 0; }
.ptier__s > span { display: block; }
.ptier__p { font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--fw-semibold); color: var(--text); }
.ptier__s.is-cur > .ptier__p { font-weight: var(--fw-bold); }
.ptier__s.is-past > .ptier__p { color: var(--text-3); }
.ptier__c { color: var(--text-3); }
.ptier__now { color: var(--action-ink); font-weight: var(--fw-semibold); }
.ptier__go { display: flex !important; justify-content: flex-end; margin-top: 6px; }
.ptier__all { display: inline-flex; align-items: center; gap: 2px; color: var(--action-ink); font-weight: var(--fw-semibold); white-space: nowrap; }
.ptier:hover .ptier__all { text-decoration: underline; }
/* закрытая карточка (выключено администратором): блок тот же, но приглушён — без зелёного */
.pcard.is-locked .ptier { background: var(--surface); }
.pcard.is-locked .ptier__bar { background: var(--surface-3); }
.pcard.is-locked .ptier__lay { color: var(--text-2); }
.pcard.is-locked .ptier__lay--on { background: var(--text-3); color: var(--surface); }
.pcard.is-locked .ptier__p, .pcard.is-locked .ptier__now { color: var(--text-2); }
/* Окно «Цена за проверку»: сводка из трёх плашек и таблица всех ступеней, своя выделена */
.modal-wrap.tmod-wrap { padding: var(--sp-6) var(--sp-4); }
.modal.tmod { max-width: 640px; display: flex; flex-direction: column; }
.tmod .modal__head, .tmod .modal__foot { flex: none; }
.tmod .modal__body { flex: 1 1 auto; min-height: 0; }
.tmod__intro { margin: 0 0 var(--sp-3); color: var(--text-2); }
.tsum { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr); gap: var(--sp-2); margin-bottom: var(--sp-3); }
.tsum > div { padding: var(--sp-2) var(--sp-3); border: 1px solid var(--border); border-radius: var(--r-2); background: var(--surface-2); }
.tsum__k, .tsum__s { font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-2); }
.tsum__v { font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.tlad { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; border: 1px solid var(--border); border-radius: var(--r-2); overflow: hidden; font-size: var(--fs-sm); line-height: var(--lh-sm); font-variant-numeric: tabular-nums; }
.tlad th { padding: 6px 10px; background: var(--th-bg); border-bottom: 1px solid var(--border); text-align: left; font-size: var(--fs-xs); line-height: var(--lh-xs); font-weight: var(--fw-semibold); color: var(--text-2); }
.tlad td { padding: 4px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tlad tbody tr:last-child td { border-bottom: 0; }
.tlad th + th, .tlad td + td { border-left: 1px solid var(--border); }
.tlad tbody tr:nth-child(even) td { background: var(--row-alt); }
.tlad tr.is-cur td { background: var(--action-bg); color: var(--text); font-weight: var(--fw-semibold); }
.tlad tr.is-cur td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.tlad tr.is-past td { color: var(--text-3); }
.tlad .r { text-align: right; }
.tlad__bar { display: block; height: 4px; max-width: 160px; margin: 3px 0 2px; border-radius: var(--r-pill); background: var(--action-bg-2); overflow: hidden; }
.tlad__bar > span { display: block; height: 100%; background: var(--brand); }
.tlad__sub { display: block; font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-2); font-weight: var(--fw-regular); }
.tlad col.c-n { width: 76px; } .tlad col.c-p { width: 92px; } .tlad col.c-s { width: 212px; }
/* телефон: окно на весь экран, таблица прокручивается внутри */
@media (max-width: 719.98px) {
  .modal-wrap.tmod-wrap { padding: 0; align-items: stretch; overflow: hidden; }
  .modal.tmod { max-width: none; height: 100%; border-radius: 0; transform: none; }
  .tmod .modal__body { overflow-y: auto; overscroll-behavior: contain; min-height: 0 !important; }
  .tsum { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tsum > div:last-child { grid-column: 1 / -1; }
  .tlad th, .tlad td { padding-left: 6px; padding-right: 6px; }
  .tlad col.c-n { width: 62px; } .tlad col.c-p { width: 68px; } .tlad col.c-s { width: 124px; }
}
.inside { display: grid; gap: var(--sp-2); }
.inside__t { font-weight: var(--fw-bold); font-size: var(--fs-sm); margin-bottom: 2px; }
.inside .ai__list li { padding: 2px 0; }
.fblock { padding: var(--sp-3) var(--sp-4); }
.fblock + .fblock { border-top: 1px solid var(--border); }
.fblock--note { padding-top: 0; }
.fblock--head { padding-bottom: 0; }
.fblock + .fblock--note { border-top: 0; }
.fblock__title { font-size: var(--fs-md); font-weight: var(--fw-bold); margin-bottom: var(--sp-2); display: flex; align-items: center; gap: var(--sp-2); }
.paste-hint { font-size: var(--fs-xs); color: var(--text-3); display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.consent { background: var(--surface-2); }
.summary { position: sticky; top: var(--fit-top, 72px); }
.summary__list { list-style: none; margin: 0; padding: 0; }
.summary__item { display: flex; align-items: flex-start; gap: var(--sp-2); padding: var(--sp-2) 0; border-bottom: 1px dashed var(--border); }
.summary__item:last-child { border-bottom: 0; }
.summary__name { flex: 1; min-width: 0; font-size: var(--fs-sm); line-height: var(--lh-sm); }
.summary__miss { display: flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--warn-ink); margin-top: 2px; }
.summary__miss.is-soft { color: var(--text-3); }
.summary__miss.is-ok { color: var(--done-ink); }
.summary__price { font-size: var(--fs-sm); font-weight: var(--fw-semibold); white-space: nowrap; }
.summary__x { position: relative; width: var(--hit); height: var(--hit); border: 0; background: none; color: var(--text-3); padding: 0; border-radius: var(--r-1); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.summary__x:hover { color: var(--crit-ink); background: var(--crit-bg); }
.summary__totals { margin-top: var(--sp-2); padding-top: var(--sp-2); border-top: 1px solid var(--border); }
.summary__row { display: flex; justify-content: space-between; gap: var(--sp-3); padding: 2px 0; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-2); }
.summary__row--total { font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: var(--fw-bold); color: var(--text); padding: var(--sp-1) 0; }
.summary__row .is-neg { color: var(--crit-ink); font-weight: var(--fw-bold); }
.dup { margin-top: var(--sp-3); }
.dup .banner__body { font-size: var(--fs-sm); }
.dup__actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-2); flex-wrap: wrap; }

/* ---------- Запрос: ход проверки ---------- */
.live-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: var(--sp-2) 0 var(--sp-1); }
.live-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--sp-1); font-size: var(--fs-xs); color: var(--text-3); font-weight: var(--fw-semibold); text-align: center; }
.live-step::before { content: ""; position: absolute; top: 9px; left: calc(-50% + 12px); right: calc(50% + 12px); height: 2px; background: var(--border); }
.live-step:first-child::before { display: none; }
.live-step__dot { width: 20px; height: 20px; border-radius: var(--r-pill); background: var(--surface-3); color: var(--text-3); display: flex; align-items: center; justify-content: center; position: relative; z-index: 1; }
.live-step.is-done { color: var(--text); }
.live-step.is-done .live-step__dot { background: var(--brand); color: var(--on-action); }
.live-step.is-done::before, .live-step.is-cur::before { background: var(--brand); }
.live-step.is-cur { color: var(--info-ink); }
.live-step.is-cur .live-step__dot { background: var(--info-bg); color: var(--info); box-shadow: 0 0 0 4px var(--info-bg); }
.live-step.is-cur .live-step__dot::after { content: ""; width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--info); animation: pulse 1.2s infinite ease-in-out; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
.live-step.is-fail .live-step__dot { background: var(--warn); color: var(--text); }
.live-step.is-err .live-step__dot { background: var(--crit); color: var(--on-crit); }
.check-row { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); }
.check-row:last-child { border-bottom: 0; }

/* ---------- Отчёт ---------- */
.report-layout { display: grid; grid-template-columns: minmax(0, 1fr) 272px; gap: var(--sp-4); align-items: start; }
.report { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-3); box-shadow: var(--shadow-1); overflow: hidden; }
.print-wrap, .print-wrap > thead, .print-wrap > tbody, .print-wrap > thead > tr, .print-wrap > tbody > tr, .print-wrap > thead > tr > td, .print-wrap > tbody > tr > td { display: block; padding: 0; border: 0; }
.print-wrap > thead, .print-wrap > tfoot { display: none; }
.r-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-6); padding: var(--sp-4) var(--sp-6) var(--sp-3); border-bottom: var(--bar-w) solid var(--brand); }
.r-head__title { font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--fw-semibold); color: var(--text-2); }
.r-head__subj { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); margin: 2px 0 0; font-size: var(--fs-xl); line-height: var(--lh-xl); font-weight: var(--fw-bold); }
.r-head__subj .obj-ic { width: 32px; height: 32px; }
.r-head__grade { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: var(--fw-bold); }
.r-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--sp-4); margin-top: var(--sp-1); font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-2); }
.r-head__brand { text-align: right; color: var(--text); flex: none; }
.r-head__brand .logo-svg { width: 116px; height: auto; display: block; margin-left: auto; }
.r-sec { padding: var(--sp-4) var(--sp-6); border-bottom: 1px solid var(--border); }
.r-sec:last-child { border-bottom: 0; }
.r-sec__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); flex-wrap: wrap; }
.r-sec__title { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: var(--fw-bold); margin: 0; }
.r-sec__fact { font-size: var(--fs-md); font-weight: var(--fw-regular); color: var(--text-2); }
.r-sec__state { color: var(--text-2); font-weight: var(--fw-semibold); }
.r-sub { font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--fw-bold); margin: var(--sp-4) 0 var(--sp-2); display: flex; align-items: center; gap: var(--sp-2); }
.r-sub:first-child { margin-top: 0; }
.r-part { padding: var(--sp-3) 0 0; margin-top: var(--sp-3); border-top: 1px dashed var(--border); }
.r-sec__head + .r-part { border-top: 0; margin-top: 0; padding-top: 0; }
.r-part .factor { max-width: 760px; }
.r-part__h { display: flex; align-items: center; gap: var(--sp-2) var(--sp-3); flex-wrap: wrap; font-size: var(--fs-md); font-weight: var(--fw-bold); margin: 0 0 var(--sp-2); }
.r-part--skip .r-part__h { margin-bottom: 0; font-weight: var(--fw-semibold); color: var(--text-2); }
.r-part__fact, .r-part__state { font-size: var(--fs-sm); font-weight: var(--fw-regular); color: var(--text-2); }
.r-foot .print-foot { margin-top: var(--sp-1); }
/* сводка */
.ai { position: relative; padding: var(--sp-4) var(--sp-6); background: var(--surface); border-bottom: 1px solid var(--border); }
.ai__label { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--fw-bold); color: var(--text); margin: 0; }
.ai__label .ic { color: var(--text-2); }
.ai__counts { margin-left: var(--sp-1); font-weight: var(--fw-regular); color: var(--text-3); }
.ai__top { display: flex; gap: var(--sp-6); align-items: center; margin-top: var(--sp-3); }
.ai__ring { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; }
.ai__ring-l { font-size: var(--fs-xs); color: var(--text-3); }
.ai__score { position: relative; width: 104px; height: 104px; flex: none; }
.ai__score svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ai__score .ring-track { stroke: var(--surface-3); }
.ai__score.is-draw .ring-val { animation: ring-draw var(--dur-data) var(--ease-out); }
@keyframes ring-draw { from { stroke-dashoffset: var(--ring-c); } }
.ai__score-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ai__letter { font-size: var(--fs-num); line-height: 1; font-weight: var(--fw-bold); }
.ai__num { font-size: var(--fs-xs); color: var(--text-2); margin-top: 2px; font-weight: var(--fw-semibold); }
.ai__verdict { font-size: var(--fs-xl); line-height: var(--lh-xl); font-weight: var(--fw-bold); }
.ai__scale { display: flex; gap: var(--sp-1); margin-top: var(--sp-2); max-width: 360px; }
.ai__scale .grade { flex: 1; min-width: 32px; width: auto; height: 24px; }
.ai__scale .grade.is-off.grade--a { background: var(--risk-a-bg); color: var(--risk-a-ink); }
.ai__scale .grade.is-off.grade--b { background: var(--risk-b-bg); color: var(--risk-b-ink); }
.ai__scale .grade.is-off.grade--c { background: var(--risk-c-bg); color: var(--risk-c-ink); }
.ai__scale .grade.is-off.grade--d { background: var(--risk-d-bg); color: var(--risk-d-ink); }
.ai__scale .grade.is-off.grade--e { background: var(--risk-e-bg); color: var(--risk-e-ink); }
.ai__scale .grade.is-cur { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text-2); }
.ai__scale-l { display: flex; justify-content: space-between; max-width: 360px; margin-top: var(--sp-1); font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-3); }
.ai__stop { display: flex; gap: var(--sp-2); align-items: center; margin-top: var(--sp-3); padding: var(--sp-2) var(--sp-4); border-radius: var(--r-3); background: var(--crit-bg); border: 1px solid var(--crit-line); color: var(--crit-ink); font-size: var(--fs-md); line-height: var(--lh-md); }
.ai__stop--block { align-items: flex-start; background: var(--warn-bg); border-color: var(--warn-line); color: var(--text); }
.ai__stop--block a { color: inherit; }
.ai__stop--block .shape { margin-top: 2px; flex: none; }
.facts__note { align-items: flex-start; }
.facts__note .shape { margin-top: 2px; flex: none; }
.facts__note a { color: inherit; }
.ai__how { margin-top: var(--sp-1); max-width: 520px; }
.ai__how > summary { cursor: pointer; color: var(--action-ink); width: max-content; }
.ai__how > div { margin-top: 2px; }
.ai__h { font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--fw-bold); color: var(--text-2); margin-bottom: var(--sp-1); }
.ai__list { list-style: none; margin: 0; padding: 0; }
.ai__list li { display: flex; gap: var(--sp-2); padding: var(--sp-1) 0; line-height: var(--lh-md); }
.ai__list .shape { margin-top: 2px; }
.ai__rec { margin-top: var(--sp-3); padding: var(--sp-2) var(--sp-4); border-radius: var(--r-3); background: var(--surface-2); border: 1px solid var(--border); box-shadow: inset var(--bar-w) 0 0 var(--action); }
.ai__rec-t { font-weight: var(--fw-bold); font-size: var(--fs-sm); margin-bottom: var(--sp-1); display: flex; align-items: center; gap: var(--sp-2); }
.ai__disc { margin-top: var(--sp-3); font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-3); display: flex; gap: var(--sp-2); align-items: flex-start; }
.ai__parts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-2); margin-top: var(--sp-3); }
.ai__part { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-2); background: var(--surface); border: 1px solid var(--border); font-size: var(--fs-sm); line-height: var(--lh-sm); text-decoration: none !important; color: var(--text); }
.ai__part:hover { border-color: var(--action); }
.ai__part-n { display: block; font-weight: var(--fw-semibold); }
.ai__part-s { display: block; font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-2); }
.facts { margin-top: var(--sp-3); }
.fact-list { list-style: none; margin: 0; padding: 0; }
.fact { display: flex; gap: var(--sp-2); align-items: flex-start; padding: var(--sp-1) 0; line-height: var(--lh-md); }
.fact .shape { margin-top: 2px; }
.fact a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-2); text-underline-offset: 3px; }
.fact a:hover { color: var(--action-ink); text-decoration-color: currentColor; }
.facts__line { display: flex; gap: var(--sp-2); align-items: center; padding: var(--sp-1) 0; font-size: var(--fs-sm); color: var(--text-2); }
.facts__more { margin-top: var(--sp-1); }
.facts__more > summary { cursor: pointer; font-size: var(--fs-sm); color: var(--text-2); padding: 2px 0; }
.more-btn { display: inline-block; margin: var(--sp-1) 0 2px; font-size: var(--fs-sm); }
.got { margin-top: var(--sp-2); }
.got__h { font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.got-line { display: flex; gap: var(--sp-2); align-items: center; margin-bottom: var(--sp-2); }
/* расхождения между источниками */
.disc { margin-top: var(--sp-3); padding: var(--sp-2) var(--sp-4); border-radius: var(--r-3); background: var(--warn-bg); border: 1px solid var(--warn-line); }
.disc__h { display: flex; gap: var(--sp-2); align-items: center; font-weight: var(--fw-bold); color: var(--warn-ink); padding: 2px 0 var(--sp-1); }
.disc__row { padding: var(--sp-2) 0; font-size: var(--fs-sm); line-height: var(--lh-sm); border-top: 1px solid var(--warn-line); }
.disc__row a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.disc__row a:hover { color: var(--action-ink); }
.disc__note { margin-top: 2px; font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-2); }
.is-pair { box-shadow: 0 0 0 2px var(--warn) !important; border-radius: var(--r-2); }
.is-target { animation: target-flash var(--dur-flash) var(--ease-out); }
@keyframes target-flash { 0%, 20% { background-color: var(--action-bg); box-shadow: 0 0 0 2px var(--action-bg-2); } 100% { box-shadow: 0 0 0 2px transparent; } }
/* показатели */
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
.metrics--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric { padding: var(--sp-2) var(--sp-3); border-radius: var(--r-2); background: var(--surface-2); border: 1px solid var(--border); }
.metric__lbl { font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-2); display: flex; align-items: center; gap: var(--sp-2); }
.metric__val { font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: var(--fw-bold); margin-top: 1px; display: flex; align-items: center; gap: var(--sp-2); font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: minmax(100px, min(200px, 40%)) minmax(0, 1fr); border: 1px solid var(--border); border-radius: var(--r-2); overflow: hidden; font-size: var(--fs-sm); line-height: var(--lh-md); }
.kv > div { padding: var(--sp-1) var(--sp-3); border-bottom: 1px solid var(--border); min-width: 0; }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }
.kv__k { background: var(--surface-2); color: var(--text-2); }
@media (min-width: 1200px) {
  .kv--2 { grid-template-columns: minmax(120px, 172px) minmax(0, 1fr) minmax(120px, 172px) minmax(0, 1fr); }
  .kv--2 > div:nth-child(4n+3) { border-left: 1px solid var(--border); }
  .kv--2 > div:nth-last-child(-n+4) { border-bottom: 0; }
}
.kv--tight { grid-template-columns: 104px minmax(0, 1fr); }
.factor { display: grid; grid-template-columns: minmax(0, 1fr) 160px 44px; gap: var(--sp-3); align-items: center; padding: var(--sp-1) 0; font-size: var(--fs-sm); }
.factor__bar { height: 8px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.factor__bar--inline { display: inline-block; width: 88px; vertical-align: middle; margin-right: var(--sp-2); }
.factor__bar span { display: block; height: 100%; border-radius: var(--r-pill); background: var(--text-3); }
.factor__bar .is-plus { background: var(--risk-a); }
.factor__bar .is-minus { background: var(--risk-e); }
.factor__bar .is-brand { background: var(--brand); }
/* блок факта в модуле: фон нейтральный, цвет только у значка */
.flag-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
.flag-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* плитки в сетке — в одну строку: «Мошенничество с МФО — Нет» (27.11.2026, без пустых двухэтажных плиток) */
.flag-grid .flag { padding: 6px var(--sp-3); gap: var(--sp-2); }
.flag-grid .flag__ic { width: 20px; height: 20px; font-size: var(--fs-xs); }
.flag-grid .flag > span:last-child { display: flex; flex-wrap: wrap; column-gap: 6px; align-items: baseline; }
.flag-grid .flag__s::before { content: "— "; }
.flag { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-2); border: 1px solid var(--border); background: var(--surface-2); }
.flag__ic { width: 24px; height: 24px; border-radius: var(--r-pill); display: flex; align-items: center; justify-content: center; flex: none; font-size: var(--fs-sm); font-weight: var(--fw-bold); background: var(--surface-3); color: var(--text-3); }
.flag--ok .flag__ic { background: var(--done-bg); color: var(--done-ink); }
.flag--bad .flag__ic { background: var(--crit-bg); color: var(--crit-ink); }
.flag--warn .flag__ic { background: var(--warn-bg); color: var(--warn-ink); }
.flag__t { font-weight: var(--fw-semibold); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.flag__s { font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-2); }
.gauge { display: block; width: 100%; max-width: 300px; margin: 0 auto; }
.gauge text { font-family: var(--font); }
.gauge .g-val { font-size: var(--fs-num); font-weight: var(--fw-bold); fill: var(--text); }
.gauge .g-cap { font-size: var(--fs-xs); fill: var(--text-3); }
.score-scale { position: relative; height: 12px; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--risk-e) 0%, var(--risk-d) 25%, var(--risk-c) 50%, var(--risk-b) 75%, var(--risk-a) 100%); margin: var(--sp-8) 0 var(--sp-2); }
.score-scale__mark { position: absolute; top: -8px; width: 3px; height: 28px; background: var(--text); border-radius: var(--r-pill); transform: translateX(-50%); }
.score-scale__val { position: absolute; top: -32px; transform: translateX(-50%); font-weight: var(--fw-bold); font-size: var(--fs-lg); white-space: nowrap; }
.score-scale__ticks { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--text-3); }
.score-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--sp-4); margin-bottom: var(--sp-1); }
.score-head__v { font-size: var(--fs-lg); }
.score-head__v b { font-size: var(--fs-xl); }
.ranges { display: flex; flex-direction: column; gap: 2px; }
.range { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-sm); padding: var(--sp-1); border-radius: var(--r-2); }
.range.is-cur { background: var(--surface-3); font-weight: var(--fw-semibold); }
.range__lbl { width: 72px; flex: none; font-weight: var(--fw-semibold); }
.range__you { margin-left: auto; font-size: var(--fs-xs); font-weight: var(--fw-bold); white-space: nowrap; }
.debt { padding: var(--sp-2) var(--sp-3); border: 1px solid var(--border); border-radius: var(--r-2); margin-bottom: var(--sp-2); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--sp-4); align-items: center; }
.debt--open { box-shadow: inset var(--bar-w) 0 0 var(--crit); }
.debt--warn { box-shadow: inset var(--bar-w) 0 0 var(--warn); }
.debt--closed { box-shadow: inset var(--bar-w) 0 0 var(--border-2); }
.debt--closed .debt__amt { color: var(--text-2); }
.debt--info { box-shadow: inset var(--bar-w) 0 0 var(--border-2); }
.debt__amt { font-weight: var(--fw-bold); font-size: var(--fs-md); text-align: right; white-space: nowrap; }
.debt__amt .xs { font-weight: var(--fw-regular); }
.debt__sub { grid-column: 1 / -1; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-2); }
.debt__sub--row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-3); }
.debts-more { margin: var(--sp-1) 0 var(--sp-2); }
.debts-more > summary { cursor: pointer; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--border); border-radius: var(--r-2); background: var(--surface-2); font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-2); }
.debts-more[open] > summary { margin-bottom: var(--sp-2); }
.notfound { text-align: center; padding: var(--sp-4); }
.notfound__ic { width: 48px; height: 48px; border-radius: var(--r-pill); margin: 0 auto var(--sp-2); display: flex; align-items: center; justify-content: center; background: var(--warn-bg); color: var(--warn-ink); }
.notfound--err .notfound__ic { background: var(--crit-bg); color: var(--crit-ink); }
.notfound__p { max-width: 520px; margin: var(--sp-2) auto 0; }
.notfound .status { margin-top: var(--sp-2); }
.err-list { list-style: none; padding: 0; margin: var(--sp-2) auto 0; max-width: 520px; text-align: left; }
.err-list li { display: flex; gap: var(--sp-2); align-items: flex-start; padding: var(--sp-1) var(--sp-3); border-radius: var(--r-2); background: var(--crit-bg); color: var(--crit-ink); font-size: var(--fs-sm); margin-top: var(--sp-1); }
.err-list li svg { flex: none; margin-top: 2px; }
.timeline { position: relative; padding-left: var(--sp-6); }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: var(--sp-2); }
.tl-item:last-child { padding-bottom: 0; }
.tl-item__dot { position: absolute; left: -24px; top: 3px; width: 16px; height: 16px; border-radius: var(--r-pill); border: 3px solid var(--surface); background: var(--border-2); }
.tl-item__dot--high { background: var(--crit); } .tl-item__dot--mid { background: var(--warn); } .tl-item__dot--low { background: var(--info); } .tl-item__dot--good { background: var(--done); }
.case-link { display: flex; gap: var(--sp-2); align-items: flex-start; padding: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-2); border-radius: var(--r-2); background: var(--surface-2); border: 1px solid var(--border); font-size: var(--fs-sm); }
.case-link .ic { margin-top: var(--sp-1); }
.docv__head { display: flex; justify-content: space-between; gap: var(--sp-4); padding-bottom: var(--sp-2); margin-bottom: var(--sp-3); border-bottom: 2px solid var(--brand); }
.docv__brand { text-align: right; flex: none; }
.docv__brand .logo-svg { width: 96px; height: auto; display: block; margin-left: auto; }
.raw-json { margin-top: var(--sp-3); border: 1px solid var(--border); border-radius: var(--r-2); background: var(--surface-2); }
.raw-json > summary { cursor: pointer; padding: var(--sp-1) var(--sp-3); font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-2); }
.raw-json pre { margin: 0; padding: var(--sp-2) var(--sp-3) var(--sp-3); max-height: 360px; overflow: auto; font-size: var(--fs-xs); line-height: var(--lh-xs); white-space: pre-wrap; word-break: break-word; border-top: 1px solid var(--border); font-family: var(--font-mono); }
/* привязка записи к субъекту и сверка */
.mline { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-3); margin-top: var(--sp-1); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.mbase { display: inline-flex; align-items: center; gap: var(--sp-1); color: var(--text-2); }
.mbase--fio { color: var(--warn-ink); font-weight: var(--fw-semibold); }
.mbase--mismatch { color: var(--crit-ink); font-weight: var(--fw-semibold); }
.mneed { color: var(--warn-ink); font-weight: var(--fw-semibold); }
.mdec { color: var(--text-2); font-weight: var(--fw-semibold); }
.mdec--yes { color: var(--done-ink); }
.mbtns { display: inline-flex; gap: var(--sp-1); }
.mnote { margin-top: 2px; font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-3); }
/* подтверждение платного действия */
.pay-pop { position: absolute; z-index: 200; width: 332px; padding: var(--sp-3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-3); box-shadow: var(--shadow-3); animation: fade-in var(--dur-fast) var(--ease-out); }
.pay-pop__t { display: flex; gap: var(--sp-2); align-items: center; margin-bottom: var(--sp-2); font-weight: var(--fw-bold); }
/* правая колонка отчёта — не выше экрана; порядок: содержание, решение, остальное */
.report-aside { position: sticky; top: var(--fit-top, 100px); display: flex; flex-direction: column; gap: var(--sp-2); }
/* Боковые колонки (отчёт, «Ваш запрос») без своей прокрутки: помещаются в окно — стоят на месте;
   длиннее окна — едут вместе со страницей и останавливаются, когда виден их низ (--fit-top ставит App.fitSticky) */
.report-aside .card--pad { padding: var(--sp-3); }
.aside__h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 var(--sp-2); margin: 0 0 var(--sp-2); font-size: var(--fs-md); font-weight: var(--fw-bold); }
.toc { position: relative; display: flex; flex-direction: column; gap: 2px; }
.toc a { display: flex; align-items: center; gap: var(--sp-2); min-height: 28px; padding: var(--sp-1) var(--sp-2); border-radius: var(--r-2); color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); text-decoration: none; }
.toc a:hover { background: var(--surface-2); color: var(--text); }
.toc a.is-here { color: var(--text); font-weight: var(--fw-semibold); }
.toc__mark { position: absolute; left: -12px; top: 0; width: var(--bar-w); height: 28px; border-radius: 0 var(--r-1) var(--r-1) 0; background: var(--action); opacity: 0; pointer-events: none; transition: transform var(--dur-fast) var(--ease-out), height var(--dur-fast) var(--ease-out), opacity var(--dur-fast); }
.toc__mark.is-on { opacity: 1; }
.toc__ic { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--text-3); }
.toc__sub { margin: 0 0 2px var(--sp-4); padding-left: var(--sp-1); border-left: 1px solid var(--border); }
.toc__sub a { font-size: var(--fs-sm); line-height: var(--lh-sm); min-height: 24px; padding: 2px var(--sp-2); }
.aside-actions { display: flex; gap: var(--sp-2); align-items: center; }
.aside-actions .popover { right: 0; }
.cost-line > summary { display: flex; align-items: center; gap: var(--sp-2); min-height: var(--h-md); padding: var(--sp-2) var(--sp-3); cursor: pointer; list-style: none; font-size: var(--fs-sm); }
.cost-line > summary::-webkit-details-marker { display: none; }
.cost-line__ic { margin-left: auto; transition: transform var(--dur-panel) var(--ease-out); }
.cost-line[open] .cost-line__ic { transform: rotate(180deg); }
.cost-line__b { padding: 0 var(--sp-3) var(--sp-2); }
.tags-card.card--pad { padding: var(--sp-2) var(--sp-3); }
.tags-card .textarea { margin-top: var(--sp-2); }
.dec-pick { display: flex; gap: var(--sp-1); }
.dec-opt { flex: 1 1 auto; height: var(--h-sm); padding: 0 var(--sp-2); white-space: nowrap; border: 1px solid var(--border-control); border-radius: var(--r-2); background: var(--surface); color: var(--text-2); font-size: var(--fs-xs); font-weight: var(--fw-semibold); transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.dec-opt:hover { border-color: var(--text-2); color: var(--text); }
.dec-opt.is-on { border-color: var(--text); color: var(--text); background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--text); }
.dec { display: inline-flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-xs); line-height: var(--lh-xs); font-weight: var(--fw-semibold); white-space: nowrap; color: var(--text-2); }
.dec--approve { color: var(--done-ink); } .dec--reject { color: var(--crit-ink); } .dec--rework, .dec--wait { color: var(--warn-ink); }
.dec--lg { font-size: var(--fs-md); line-height: var(--lh-md); }
.dec-cur { padding: var(--sp-2); margin-bottom: var(--sp-2); border-radius: var(--r-2); background: var(--surface-2); border: 1px solid var(--border); }
.dec-hist summary { cursor: pointer; color: var(--text-2); }
.linked { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) 0; border-top: 1px solid var(--border); color: var(--text); font-size: var(--fs-sm); text-decoration: none !important; }
.linked:first-of-type { border-top: 0; }
.linked:hover .strong { color: var(--action-ink); }
/* панель над отчётом: назад, очередь */
.rq-bar { display: flex; align-items: center; gap: var(--sp-3); min-height: var(--h-sm); margin-bottom: var(--sp-2); }
.rq-bar .back-link { margin: 0; }
.rq-bar__q { display: inline-flex; align-items: center; gap: var(--sp-2); margin-left: auto; }
/* тонкая строка субъекта при прокрутке и лента разделов на узком экране */
.r-sticky { position: fixed; top: var(--topbar-h); left: var(--side-cur); right: 0; z-index: 24; height: var(--h-md); display: flex; align-items: center; padding: 0 var(--sp-6); background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-1); font-size: var(--fs-sm); transform: translateY(-110%); opacity: 0; pointer-events: none; transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out); }
.r-sticky.is-on { transform: none; opacity: 1; pointer-events: auto; }
.r-sticky__in { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; white-space: nowrap; }
.r-sticky .obj-ic { width: 24px; height: 24px; }
.r-strip { display: none; }
.print-wm { display: none; }

/* ---------- Мониторинг ---------- */
.sig-day__h { font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--text-2); margin-bottom: var(--sp-2); display: flex; align-items: center; gap: var(--sp-2); }
/* Лента сигналов — таблица того же вида, что «Запросы»: зебра, тонкие вертикальные линии,
   в каждой колонке главная строка и под ней вторая. Колонки делят ширину по содержимому
   (table-layout: auto), поэтому на широком экране запас ложится понемногу во все колонки,
   а не одной дырой между текстом и статусами. Ничего не обрезается — текст переносится. */
.table--sig { font-size: var(--fs-md); line-height: var(--lh-md); }
.table--sig td { vertical-align: top; height: auto; }
.table--sig .sig-t { color: var(--text); overflow-wrap: break-word; }
.table--sig tr.is-unseen .sig-t { font-weight: var(--fw-bold); }
.table--sig tr.is-closed .sig-t { color: var(--text-2); }
.table--sig .sig-c-what { min-width: 0; }
.table--sig .sig-c-what .ln2 { margin-top: 1px; }
/* онлайн-сигнал «заявка от имени человека»: что делать — одной строкой, красным со значком (переносится, без многоточия) */
.sig-hint, .ln2.sig-hint { display: flex; align-items: flex-start; gap: var(--sp-1); color: var(--crit-ink); overflow-wrap: break-word; }
.sig-hint .ic { flex: none; margin-top: 2px; }
.mon-allf { margin-top: 0; padding-top: 0; border-top: 0; }
.mon-allf .allf__part:first-of-type { margin-top: var(--sp-2); }
.mode-opt.is-disabled { opacity: .6; }
.mode-opt.is-disabled, .mode-opt.is-disabled input { cursor: not-allowed; }
.table--sig .sig-c-wk .ln2 { white-space: nowrap; }
.table--sig .sig-c-when { white-space: nowrap; font-variant-numeric: tabular-nums; }
.table--sig .who--cell { align-items: flex-start; }
.table--sig .who__n { font-size: var(--fs-md); line-height: var(--lh-md); }
.table--sig td.sig-c-exp { padding: var(--sp-1) var(--sp-1) 0; width: 1%; }
/* короткие колонки — по ширине значения, запас ширины уходит в «Кто» и «Что случилось» */
@media (min-width: 720px) { .table--sig td.sig-c-when, .table--sig:not(.table--sig-p) td.sig-c-sev, .table--sig:not(.table--sig-p) td.sig-c-wk { width: 1%; } }
.sig-chev { width: 28px; height: 28px; color: var(--text-3); }
.sig-chev .ic { transition: transform var(--dur-panel) var(--ease-out); }
.sig-row.is-open .sig-chev .ic { transform: rotate(180deg); }
/* строка-разделитель группы (день или человек / компания) во всю ширину таблицы */
.table--sig tr.sig-gh > td, .table--sig tr.sig-gh > td:first-child { background: var(--surface-2); box-shadow: none; animation: none; color: var(--text-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.table--sig tbody:first-of-type tr.sig-gh > td { border-top: 0; }
.table--sig tr.sig-gh:hover > td, .table--sig tr.sig-gh:hover > td:first-child { background: var(--surface-2); box-shadow: none; }
.sig-gh__d { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--fw-bold); }
.sig-gh__d .ic { flex: none; color: var(--text-3); }
.sig-gh__p { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-1) var(--sp-6); font-size: var(--fs-md); line-height: var(--lh-md); color: var(--text); }
.sig-gh__p > .who { flex: 1 1 360px; min-width: 0; }
.sig-gh__p .who__l { column-gap: var(--sp-4); }
.sig-gh__cnt { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0 var(--sp-4); }
.sig-gh__acts { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-left: auto; }
/* раскрытый сигнал — подстрока под строкой, как «по проверкам» в «Запросах» */
.table--sig tr.sig-det > td { padding: var(--sp-1) var(--sp-3) var(--sp-3) var(--sp-4); }
.table--sig tr.sig-det:hover > td { background: var(--row-sub); }
.table--sig tr.sig-det:hover > td:first-child { box-shadow: inset var(--bar-w) 0 0 var(--action-bg-2); }
.sig-det__in { max-width: 1040px; }
.sig-foot { padding: var(--sp-2) var(--sp-4); border-top: 1px solid var(--border); }
/* Пункты через « · » без висящих точек: точка — перед пунктом; у первого пункта строки она уходит
   за левый край блока и обрезается. Так точка никогда не остаётся в конце строки. */
.dots { display: block; overflow: hidden; }
.dots__in { display: flex; flex-wrap: wrap; margin-left: -15px; }
.dots__in > span { position: relative; padding-left: 15px; min-width: 0; overflow-wrap: break-word; }
.dots__in > span::before { content: "·"; position: absolute; left: 5px; top: 0; color: var(--text-3); }
/* кнопки-ссылки после пунктов («ещё 2», «по проверкам») — переносятся так же, но без точки */
.dots__in > .dots__tail::before { content: none; }
.dots__tail > .rq-exp { margin-left: 0; }
.sig-subj { display: flex; gap: var(--sp-1); }
.sig-subj > .faint { flex: none; }
.sig-subj .dots { flex: 1 1 auto; min-width: 0; }
@media (min-width: 720px) {
  .table--sig td { padding-top: var(--sp-2); padding-bottom: var(--sp-2); }
  .table--sig td.sig-c-who, .table--sig td.sig-c-when { position: relative; padding-left: var(--sp-4); }
  /* точка «ещё не открывали» — у левого края строки, как у непросмотренного запроса */
  .table--sig .sig-dot { position: absolute; left: 4px; top: 14px; margin: 0; }
  .table--sig tr.sig-gh > td { padding: 6px var(--sp-3) 6px var(--sp-4); }
  .table--sig td.sig-c-exp, .table--sig th.td-exp { border-left: 0; }
}
.mon-mode { display: flex; align-items: flex-start; gap: var(--sp-1); }
.mon-mode .ic { margin-top: 3px; color: var(--text-2); }
/* «кто»: значок объекта (как в списке запросов), имя полужирным, под ним д. р. или ИНН */
.who { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.who .obj-ic { width: 28px; height: 28px; }
.who__t { display: flex; flex-direction: column; min-width: 0; }
.who__n { font-size: var(--fs-md); line-height: var(--lh-md); font-weight: var(--fw-semibold); color: var(--text); overflow-wrap: break-word; }
a.who__n:hover { color: var(--action-ink); }
.who__d { font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-2); font-variant-numeric: tabular-nums; }
.who--grp .obj-ic { width: var(--h-icon); height: var(--h-icon); }
.table .who--cell .who__d { overflow: visible; }
.who__l { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--sp-2); min-width: 0; }
.tag--online .ic { color: var(--text-2); }
/* раскрытый сигнал начинается с того, кто это */
.sig-subj { margin-bottom: var(--sp-2); color: var(--text-2); }
.sig-subj .who__n { font-size: var(--fs-sm); }
/* постановка на мониторинг */
.mode-opts { display: flex; flex-direction: column; gap: var(--sp-2); }
.mode-opt { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3); border: 1px solid var(--border-2); border-radius: var(--r-2); background: var(--surface); }
.mode-opt.is-on { border-color: var(--action-ink); background: var(--action-bg); }
.mode-opt .check__box { margin-top: 0; }
.mode-opt__t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.mode-opt__n { display: inline-flex; align-items: center; gap: var(--sp-1); flex-wrap: wrap; }
.mode-opt__p { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mon-note { display: flex; align-items: flex-start; gap: var(--sp-2); height: 100%; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-2); background: var(--surface-2); color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.mon-note .ic { flex: none; margin-top: 1px; color: var(--text-3); }
.mon-renew { align-self: end; min-height: var(--h-md); }
.mon-renew__s { display: block; }
.mon-total { color: var(--text-2); align-self: center; }
.sig-work { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-top: var(--sp-2); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-2); background: var(--surface-2); border: 1px solid var(--border); }
.sig-filters .row + .row { margin-top: var(--sp-2); }
.examples { padding-top: var(--sp-3); border-top: 1px dashed var(--border); }
.examples__b { margin-top: var(--sp-3); }
/* раскрытие с высотой */
.is-expanding { overflow: hidden; transition: height var(--dur-panel) var(--ease-out); }

/* метка тестового контура — подробности по нажатию */
.live-mark { display: inline-flex; align-items: center; gap: var(--sp-1); height: var(--h-sm); padding: 0 var(--sp-3); border: 1px solid var(--warn-line); border-radius: var(--r-2); background: var(--warn-bg); color: var(--warn-ink); font-size: var(--fs-xs); font-weight: var(--fw-semibold); white-space: nowrap; cursor: pointer; }
.live-mark .ic { color: var(--warn); }
.live-mark__s { display: none; }
.live-pop { width: 360px; }
.live-pop__b { padding: var(--sp-2) var(--sp-4) var(--sp-3); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.live-pop__b ul { margin: 2px 0 var(--sp-2); padding-left: 0; list-style: none; }
.live-pop__b li { padding: 2px 0; }

/* ---------- Финансы, счёт, тарифы, сотрудники ---------- */
.amount-input { font-size: var(--fs-xl); font-weight: var(--fw-bold); height: 52px; }
.period { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.period .input { width: 136px; height: var(--h-sm); font-size: var(--fs-sm); }
.op-cell { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.op-cell .obj-ic { width: 28px; height: 28px; }
.amt--plus { color: var(--done-ink); }
.who-cell { display: inline-flex; align-items: center; gap: var(--sp-2); white-space: nowrap; }
.invoice-doc { background: var(--surface); color: var(--text); padding: var(--sp-8); border-radius: var(--r-3); border: 1px solid var(--border); max-width: 860px; margin: 0 auto; font-size: var(--fs-sm); }
.invoice-doc h1 { font-size: var(--fs-xl); margin: var(--sp-6) 0 var(--sp-1); }
.invoice-doc table { width: 100%; border-collapse: collapse; }
.invoice-doc td, .invoice-doc th { border: 1px solid var(--doc-line); padding: var(--sp-1) var(--sp-2); text-align: left; vertical-align: top; font-weight: var(--fw-regular); }
.invoice-doc .noborder td { border: 0; padding: 2px 0; }
.invoice-doc .noborder td:first-child:not(:last-child) { padding-right: var(--sp-2); white-space: nowrap; }
.invoice-doc td.right { text-align: right; }
.invoice-doc .logo-svg { width: 120px; height: auto; color: var(--text); }
/* реестр оригиналов: ID запроса и «Создал» не переносим — на бумаге и на широком экране; на узком лучше перенос, чем прокрутка вбок */
@media print, (min-width: 960px) { .invoice-doc .reg-nw { white-space: nowrap; } }
/* на телефоне таблица реестра (A4) не помещается — прокручивается сама, страница вбок не уезжает */
@media screen { .doc-scroll { overflow-x: auto; } }
.doc-gap { margin-top: var(--sp-6); align-items: flex-start; gap: var(--sp-6); }
.doc-sign { margin-top: var(--sp-8); }
.qr { background: var(--qr-light); }
.qr__cap { margin-top: var(--sp-1); max-width: 150px; }
/* тарифы: одна шапка ступеней на группу, колонки выровнены */
.tariff-tbl { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); line-height: var(--lh-sm); }
.tariff-tbl.is-all { width: auto; }
.tariff-tbl thead th { width: 96px; }
.tariff-tbl thead th.t-name { width: 300px; }
.tariff-tbl thead th.t-prog { width: auto; min-width: 200px; }
.tariff-tbl.is-all thead th.t-prog { width: 240px; }
.tariff-tbl tbody th { background: var(--surface); color: var(--text); font-size: var(--fs-xs); line-height: var(--lh-xs); font-weight: var(--fw-regular); text-align: left; }
.tariff-tbl tbody th .strong { font-size: var(--fs-sm); line-height: var(--lh-sm); }
.tariff-tbl th, .tariff-tbl td { padding: var(--sp-2); border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tariff-tbl th { font-size: var(--fs-xs); line-height: var(--lh-xs); font-weight: var(--fw-semibold); color: var(--text-2); background: var(--th-bg); }
.tariff-tbl th.t-name, .tariff-tbl td.t-name { text-align: left; white-space: normal; padding-left: var(--sp-4); min-width: 260px; position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--border); }
.tariff-tbl thead th.t-name { background: var(--th-bg); }
.tariff-tbl td.t-prog { text-align: left; white-space: normal; min-width: 232px; padding-right: var(--sp-4); }
.tariff-tbl th.t-prog { text-align: left; }
.tariff-tbl tr:last-child td { border-bottom: 0; }
.tariff-tbl td.is-cur { color: var(--action-ink); font-weight: var(--fw-bold); }
.tariff-tbl td.is-past { color: var(--text-3); }
.tariff-tbl td.t-one { text-align: left; color: var(--text-2); }
.tariff-tbl .t-extra { display: none; }
.tariff-tbl.is-all .t-extra { display: table-cell; }
.tariff-wrap { position: relative; overflow-x: auto; container: tw / inline-size; }
/* шапка ступени переносится после тире («100 001–» / «300 000»), длинный статус — по словам */
.tariff-tbl:not(.is-all) thead th:not(.t-name):not(.t-prog) { white-space: normal; vertical-align: bottom; }
.tariff-tbl .status { white-space: normal; align-items: flex-start; }
.tariff-tbl .status .ic { margin-top: 2px; }
/* список уже 1100 px (1366 с меню, 1280, 960): колонки ступеней и названия уже, ничего не уезжает вбок */
@container tw (max-width: 1100px) {
  .tariff-tbl:not(.is-all) thead th:not(.t-name):not(.t-prog) { width: 80px; }
  .tariff-tbl:not(.is-all) thead th.t-name { width: 240px; }
  .tariff-tbl:not(.is-all) td.t-prog { min-width: 0; }
}
@container tw (max-width: 900px) {
  .tariff-tbl:not(.is-all) thead th:not(.t-name):not(.t-prog) { width: 70px; }
  .tariff-tbl:not(.is-all) thead th.t-name { width: 200px; }
  .tariff-tbl:not(.is-all) th.t-name, .tariff-tbl:not(.is-all) td.t-name { padding-left: var(--sp-3); }
}
.tar { table-layout: fixed; min-width: 940px; font-size: var(--fs-md); }
.table.tar td { white-space: nowrap; font-variant-numeric: tabular-nums; padding: var(--sp-2) var(--sp-3); line-height: var(--lh-md); }
.table.tar thead th { white-space: nowrap; }
.tar td + td, .tar th + th { box-shadow: inset 1px 0 0 var(--line-v); }
.tar td.tar__name { white-space: normal; }
.tar__src { font-size: var(--fs-xs); color: var(--text-3); }
.table.tar tbody tr > td.tar__cur { color: var(--action-ink); font-weight: var(--fw-bold); }
.tar__left { display: flex; align-items: center; gap: var(--sp-2); }
.tar__left > span { flex: none; min-width: 64px; }
.tar__left .progress { flex: 1; margin: 0; }
.table.tar tbody tr.tar__grp > td { background: var(--surface); padding: var(--sp-3) var(--sp-3) var(--sp-1); box-shadow: none; border-bottom: 0; }
.table.tar tbody tr.tar__grp:hover > td { background: var(--surface); box-shadow: none; }
.tar__grp span { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--action-ink); }
.tar__grp span::before, .tar__grp span::after { content: ""; flex: 1; height: 1px; background: var(--border-2); }
.tar .status { white-space: normal; }
@media (max-width: 760px) {
  .tar { min-width: 0; }
  .tar colgroup, .tar thead { display: none; }
  .tar, .tar tbody, .tar tr, .tar td { display: block; width: auto; }
  .table.tar tbody tr[data-tname] { padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border); }
  .table.tar tbody tr[data-tname] > td { padding: 2px 0; border: 0; box-shadow: none; background: transparent; text-align: left; white-space: normal; }
  .table.tar tbody tr[data-tname]:nth-child(even) { background: var(--row-alt); }
  .tar td[data-label] { display: flex; justify-content: space-between; gap: var(--sp-3); }
  .tar td[data-label]::before { content: attr(data-label); color: var(--text-2); font-weight: var(--fw-regular); }
  .tar td[data-label] .tar__left { flex: 1; justify-content: flex-end; max-width: 60%; }
  .tar td.tar__name { padding-bottom: var(--sp-1); }
  .tar td.tar__lad { padding-top: var(--sp-1); }
  .table.tar tbody tr.tar__grp > td { padding: var(--sp-3) var(--sp-3) var(--sp-2); }
}
.role-txt { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.role-txt .ic { color: var(--text-3); }
.perm-group__head .check { align-items: center; gap: var(--sp-2); padding: var(--sp-1) 0; }
.perm-item { display: flex; align-items: center; gap: var(--sp-2); padding: 6px 0; font-size: var(--fs-sm); }
.perm-item .check { align-items: center; gap: var(--sp-2); }
.perm-src { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; }
.check__box--part { background: var(--action); border-color: var(--action); }
.check__box--part .ic { display: none; }
.check__box--part::after { content: ""; width: 10px; height: 2px; border-radius: 1px; background: var(--on-action); }
.tar__src { cursor: default; display: inline-flex; align-items: center; gap: 4px; }
.sig-filters .select--sm { width: auto; }
#opsTbl td[data-label="Сотрудник"], #opsTbl td[data-label="Сотрудник"] * { white-space: nowrap; }
#opsTbl thead th { white-space: nowrap; }
.cr-g .gauge { max-width: 240px; }
.cr-g__cap { gap: 6px; margin-top: 2px; }
/* отчётность: таблицы одна под другой — столбцы лет на одной вертикали */
.table--bfo { table-layout: fixed; }
.table--bfo th:not(:first-child) { width: 160px; }
.table--cmp { table-layout: fixed; }
.table--cmp th:first-child, .table--cmp td:first-child { width: 172px; }
.table--cmp td.kv__k { color: var(--text-2); }
.cr-top + .explain, .metrics + .explain { margin-bottom: var(--sp-4); }
.r-how { margin-top: var(--sp-2); font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-2); }
.r-how > summary { cursor: pointer; color: var(--text-3); width: max-content; }
.r-how > summary:hover { color: var(--action-ink); }
.r-how > div { margin-top: var(--sp-1); max-width: 760px; }
.score-top { align-items: start; }
.score-top .r-sub:first-child { margin-top: 0; }
@media print { .table--cmp th, .table--cmp td { border-color: var(--border) !important; box-shadow: none !important; } }
.rq-ai__more { color: var(--text-3); font-weight: var(--fw-regular); white-space: nowrap; }
.tb-more { display: contents; }
.tb-more[hidden] { display: none; }
/* шкала балла — своим узким столбцом слева, показатели занимают остальное */
.cr-top { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); }
/* причины балла: название, полоса и вес рядом, без растягивания на всю ширину */
.factor { grid-template-columns: minmax(0, 440px) 160px 92px; justify-content: start; }
.factor--head > span:last-child { white-space: nowrap; }
.r-how { margin-bottom: var(--sp-2); }
/* скоркарта и причины балла (у компании — ключевые признаки) — двумя колонками, без пустой правой половины */
.cr-mid { align-items: start; gap: var(--sp-6); }
.cr-mid .sc { max-width: none; }
.cr-mid .factor { grid-template-columns: minmax(0, 1fr) 96px 88px; }
.cr-mid .factor--head > span:last-child { white-space: nowrap; }
.flag-grid--1 { grid-template-columns: minmax(0, 1fr); }
.flag-grid > .flag:only-child { grid-column: 1 / -1; }
@media print {
  /* на листе A4 две колонки тесны — скоркарта, причины и просрочки идут друг под другом */
  .cr-mid { grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); }
  .cr-mid .factor { grid-template-columns: minmax(0, 1fr) 160px 92px; }
  .cr-mid .kv { grid-template-columns: 220px minmax(0, 1fr); }
}
/* доступные проверки: группы двумя колонками (короткие группы встают рядом), внутри группы — по одной в строке */
#permBox { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); align-items: stretch; }
.perm-col { display: flex; flex-direction: column; gap: var(--sp-2); }
/* низ колонок вровень: остаток высоты делится между строками последней группы, а не пустым местом */
.perm-col > .perm-group:last-child { flex: 1; display: flex; flex-direction: column; }
.perm-col > .perm-group:last-child .perm-group__body { flex: 1; align-content: space-evenly; }
#permBox .perm-group { margin-bottom: 0; }
#permBox .perm-group__body { grid-template-columns: minmax(0, 1fr); }
.perm-top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); }
.perm-top h3 { margin: 0; }
.perm-all { display: inline-flex; align-items: baseline; gap: var(--sp-2); }
@media (max-width: 719.98px) { #permBox { grid-template-columns: minmax(0, 1fr); } }
#eRoleL + .seg { width: max-content; }
.tariff-more { display: flex; justify-content: flex-end; padding: var(--sp-2) var(--sp-4); border-top: 1px solid var(--border); }
.tariff-row__parts { display: block; white-space: normal; max-width: 360px; }
.ladder-tbl tr.is-extra { display: none; }
.perm-group { border: 1px solid var(--border); border-radius: var(--r-2); margin-bottom: var(--sp-2); overflow: hidden; }
.perm-group__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-1) var(--sp-3); background: var(--surface-2); font-weight: var(--fw-semibold); font-size: var(--fs-sm); }
.perm-group__body { padding: var(--sp-1) var(--sp-3); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--sp-4); }
.perm-group__body .switch { padding: var(--sp-1) 0; font-size: var(--fs-sm); }
.role-tag .ic { width: 14px; height: 14px; }
.avail-btn { display: inline-flex; align-items: center; gap: var(--sp-1); min-height: var(--hit); padding: 0; border: 0; background: none; color: var(--text); font-variant-numeric: tabular-nums; }
.avail-btn .ic { color: var(--text-3); transition: transform var(--dur-panel) var(--ease-out); }
.avail-btn[aria-expanded="true"] .ic { transform: rotate(180deg); }
.avail-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: var(--sp-1) var(--sp-4); padding: var(--sp-1) 0; font-size: var(--fs-sm); line-height: var(--lh-sm); }
.avail-list .is-off { color: var(--text-3); }
.avail-list .status { white-space: normal; align-items: flex-start; }
.avail-list .status .ic { margin-top: 2px; }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { list-style: none; cursor: pointer; padding: var(--sp-2) 0; font-weight: var(--fw-semibold); display: flex; justify-content: space-between; gap: var(--sp-3); align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ic { transition: transform var(--dur-panel) var(--ease-out); color: var(--text-3); }
.faq details[open] summary .ic { transform: rotate(180deg); }
.faq details > div { padding: 0 0 var(--sp-2); color: var(--text-2); }
.set-row { padding: var(--sp-2) 0; border-bottom: 1px solid var(--border); }
.settings-nav { display: flex; flex-direction: column; gap: 2px; }
.code { font-family: var(--font-mono); font-size: var(--fs-sm); background: var(--surface-3); padding: 2px var(--sp-1); border-radius: var(--r-1); }
.ol { padding-left: 20px; }

/* ---------- ID запроса: копирование — галочка на месте значка ---------- */
.rid { display: inline-flex; align-items: center; gap: 2px; font-variant-numeric: tabular-nums; font-weight: var(--fw-semibold); white-space: nowrap; }
.rid__copy { position: relative; border: 0; background: transparent; color: var(--text-3); width: var(--hit); height: var(--hit); border-radius: var(--r-1); display: inline-flex; align-items: center; justify-content: center; padding: 0; transition: opacity var(--dur-fast) var(--ease-out); }
.rid__copy:hover { background: var(--surface-3); color: var(--action-ink); }
.rid__copy.is-copied { color: var(--done-ink); opacity: 1; }
.rid__copy.is-copied .ic { animation: fade-in var(--dur-fast) var(--ease-out); }
.rid--big { padding: 0 2px 0 var(--sp-2); border-radius: var(--r-2); background: var(--surface-3); }
.rid--big .rid__copy { width: 28px; height: 28px; }
.idc { display: flex; align-items: center; }
.table .rid__v { color: var(--text); }
.table .rid__v:hover { color: var(--action-ink); }
.table tr.is-unseen .rid__v, .table tr.is-unseen .row-link { font-weight: var(--fw-bold); }
.table tr:not(.is-unseen) .rid__v { font-weight: var(--fw-regular); }

/* ---------- Просмотрщик PDF ---------- */
.fake-line { height: 12px; margin: var(--sp-2) 0; border-radius: var(--r-1); background: var(--surface-3); }

/* ---------- Переписка в обращении ---------- */
.msg { margin-bottom: var(--sp-3); max-width: 80%; }
.msg--me { margin-left: auto; }
.msg__who { font-size: var(--fs-xs); color: var(--text-3); margin-bottom: var(--sp-1); white-space: nowrap; }
.msg__who .row { display: inline-flex; gap: var(--sp-1); }
.msg--me .msg__who { text-align: right; }
.msg__bubble { padding: var(--sp-2) var(--sp-3); border-radius: var(--r-3); background: var(--surface-2); border: 1px solid var(--border); white-space: pre-wrap; }
.msg--me .msg__bubble { background: var(--surface-3); border-color: var(--border-2); }
.msg__file { display: flex; align-items: center; gap: var(--sp-1); margin-top: var(--sp-2); font-size: var(--fs-xs); color: var(--text-2); }
.reply-acts { margin-top: var(--sp-2); }

/* ---------- Список запросов: каждая колонка — главная строка и под ней вторая ----------
   Главная — 14 px, вторая — 13 px вторичным цветом. Ничего не обрезается: текст переносится,
   строка может стать выше. Неразрывными остаются только суммы, даты, ID и номера. */
.views { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.pills { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border); }
.pill { display: inline-flex; align-items: center; gap: 2px; height: var(--hit); padding: 0 2px 0 var(--sp-3); border-radius: var(--r-pill); background: var(--surface-3); color: var(--text); font-size: var(--fs-xs); font-weight: var(--fw-semibold); }
.pill__x { position: relative; width: 20px; height: 20px; padding: 0; border: 0; border-radius: var(--r-pill); background: none; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; }
.pill__x::before { content: ""; position: absolute; inset: -2px; }
.pill__x:hover { background: var(--border); color: var(--text); }
.pager { display: flex; align-items: center; gap: var(--sp-1); }
.pager__info { margin-right: var(--sp-2); color: var(--text-2); font-variant-numeric: tabular-nums; }
.pager__n { min-width: 28px; height: 28px; border: 1px solid transparent; border-radius: var(--r-2); background: none; color: var(--text-2); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.pager__n.is-on { border-color: var(--border-control); background: var(--surface); color: var(--text); font-weight: var(--fw-bold); }
.ln2 { font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-2); font-weight: var(--fw-regular); }
.rq-date { display: flex; align-items: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rq-obj { display: flex; align-items: flex-start; gap: var(--sp-1); min-width: 0; }
/* значок объекта — без подложки, на высоте первой строки: ширина отдана тексту */
.rq-obj .obj-ic, .table .who--cell .obj-ic { width: 20px; height: 20px; background: none; color: var(--text-2); }
.rq-who .ln2 { white-space: nowrap; }
.rq-obj__t { min-width: 0; overflow-wrap: break-word; }
.rq-obj__n { font-weight: var(--fw-semibold); }
.rq-role { color: var(--text); }
.r-head__role { font-size: var(--fs-md); line-height: var(--lh-md); font-weight: var(--fw-semibold); color: var(--text-2); }
.rq-obj__t > .unseen-dot { margin-right: var(--sp-1); }
.rq-chk { overflow-wrap: break-word; font-size: var(--fs-sm); line-height: var(--lh-sm); padding-top: 1px; }
.rq-chk .tag { vertical-align: 1px; }
.rq-chk__more { font-size: var(--fs-sm); line-height: var(--lh-sm); min-height: var(--hit); }
.rq-tags { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin-top: var(--sp-1); }
.rq-ai__h { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--sp-2); row-gap: 2px; }
.rq-ai__h .grade { align-self: flex-start; margin-top: 0; }
.rq-ai__v { font-weight: var(--fw-semibold); }
.rq-ai__v.is-none { color: var(--text-2); }
.rq-ai__v.is-wait { color: var(--text-3); font-weight: var(--fw-regular); }
.rq-ai__act { display: inline-flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--fw-semibold); }
.rq-ai__act .ic { color: var(--warn); }
.rq-ai__s { margin-top: 2px; }
.rq-st .status { white-space: normal; align-items: flex-start; }
.rq-st .status .ic { margin-top: 2px; }
.rq-st .progress { margin-top: var(--sp-2); width: 96px; height: 4px; }
.rq-st__c { display: flex; align-items: flex-start; gap: var(--sp-1); margin-top: 2px; }
.rq-st__c .ic { margin-top: 2px; width: 14px; height: 14px; }
.rq-st__c.status--crit, .rq-st__c.status--work, .rq-st__c.status--warn { font-weight: var(--fw-semibold); }
.rq-st__c.rq-st__c--soft { font-weight: var(--fw-regular); }   /* «Ждём оригинал согласия до …» — сведения, а не действие */
.rq-st__a { color: var(--action-ink); font-weight: var(--fw-semibold); cursor: pointer; white-space: nowrap; }
.rq-st__a:hover { text-decoration: underline; }
.rq-st__dec .ic { display: none; }
.rq-sub__n { display: inline-flex; align-items: flex-start; gap: var(--sp-1); }
.rq-sub__n .ic { margin-top: 3px; }
.oc { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.oc__f { min-width: 0; font-size: var(--fs-sm); }
.oc__sub { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: 2px; }
.repl { display: flex; align-items: center; gap: var(--sp-1); margin-top: 2px; cursor: pointer; }
@media (min-width: 720px) {
  /* одна раскладка: колонки с короткими значениями — по ширине значения, остальное делят «Объект», «Проверки» и «ИИ-заключение» */
  .table--rq { table-layout: fixed; font-size: var(--fs-md); line-height: var(--lh-md); }
  .table--rq col.c-chk { width: 36px; } .table--rq col.c-date { width: 120px; } .table--rq col.c-cost { width: 86px; } .table--rq col.c-who { width: 138px; }
  .table--rq col.c-obj { width: 20.2%; } .table--rq col.c-prod { width: 14%; } .table--rq col.c-st { width: 14%; }
  .table--rq td.td-check { position: relative; }
  .table--rq .rq-dot { position: absolute; left: 4px; top: 14px; margin: 0; }
  .rq-who-m { display: none; }
  .table--rq td, .table--rq th { padding-left: 6px; padding-right: 6px; }
  .table--rq td { height: auto; padding-top: var(--sp-2); padding-bottom: var(--sp-2); vertical-align: top; }
  .table--rq td.td-check { padding-left: var(--sp-4); padding-right: 0; }
  .table--rq td.td-check .check__box { margin-top: 0; }
  .table--rq td.td-check .expander { display: flex; margin: var(--sp-1) 0 0 -2px; }
  .table--rq .rid { font-size: var(--fs-sm); }
  .table--rq tr.is-sub td { font-size: var(--fs-sm); line-height: var(--lh-sm); padding-top: var(--sp-1); padding-bottom: var(--sp-1); }
  .table--rq tr.is-sub td + td { border-left: 0; }
  .table--rq .tag { height: auto; min-height: 20px; }
  .table--rq2 { font-size: var(--fs-md); line-height: var(--lh-md); }
  .table--rq2 td { vertical-align: top; height: auto; }
  .table--rq-dash col.c-date { width: 136px; } .table--rq-dash col.c-obj { width: 30%; } .table--rq-dash col.c-st { width: 20%; }
}
/* ширина списка, а не окна: при узком списке (меню развёрнуто на 1280 или свёрнуто на 960)
   колонку «Создал» убираем — автор встаёт третьей строкой под ID, высота строки не растёт */
.rq-cq { container: rq / inline-size; }
@container rq (max-width: 1000px) {
  .table--rq col.c-who, .table--rq .td-who { display: none; }
  .table--rq .rq-who-m { display: block; }
  .table--rq col.c-obj { width: 25%; } .table--rq col.c-prod { width: 15%; } .table--rq col.c-st { width: 13%; }
}
/* ещё уже (меню свёрнуто на 960): сумма уходит строкой в «Состояние» */
@container rq (max-width: 880px) {
  .table--rq col.c-cost, .table--rq td.td-cost, .table--rq th.th-cost { display: none; }
  .table--rq .rq-cost-m { display: block; }
  .table--rq col.c-obj { width: 26%; } .table--rq col.c-prod { width: 18%; } .table--rq col.c-st { width: 17%; }
}
.rq-cost-m { display: none; font-variant-numeric: tabular-nums; }
.grid--dash .table .obj-cell { min-width: 0; }
.grid--dash .table td.money { min-width: 96px; }

/* мелкие помощники разметки (вместо стилей в разметке) */
.row--center { justify-content: center; }
.cr-top { align-items: center; }
.push-r { margin-left: auto; }
.search-w { flex: 1 1 240px; max-width: 420px; }
.form-narrow { max-width: 640px; }
.mon-err { margin-top: var(--sp-1); max-width: 220px; }
col.c-date { width: 112px; } col.c-act { width: 112px; }
.skel-w40 { width: 40%; height: 18px; } .skel-w65 { width: 65%; } .skel-w75 { width: 75%; } .skel-w80 { width: 80%; } .skel-w90 { width: 90%; }
.toast__bar { animation-duration: 8s; }
.toast__undo { flex: none; }
.banners__rest { display: contents; }
.td-noclick, .oc-cell, .th-sort, .aside-toc, .dec-card, .case-card, .r-hist, .docv, .inside__g, .sig-work__st, .modal__x { /* точки привязки для скриптов и тестов */ }

/* ==========================================================================
   Адаптив: до 720 — мобильный вид; 720–1279 — рабочий вид (меню свёрнуто,
   одна колонка, лента разделов отчёта); от 1280 — полный вид.
   ========================================================================== */
@media (max-width: 1439.98px) {
  .grid--dash { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (max-width: 1279.98px) {
  body { --side-cur: var(--sidebar-mini); }
  .live-mark__t { display: none; }
  .live-mark__s { display: inline; }
  .report-layout { grid-template-columns: minmax(0, 1fr); }
  .report-aside { position: static; max-height: none; overflow: visible; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .r-strip { display: flex; gap: var(--sp-1); position: sticky; top: 92px; z-index: 20; overflow-x: auto; scrollbar-width: none; padding: var(--sp-1) 0; margin-bottom: var(--sp-2); background: var(--bg); }
  .r-strip::-webkit-scrollbar { display: none; }
  .r-strip a { display: inline-flex; align-items: center; gap: var(--sp-1); flex: none; height: 28px; padding: 0 var(--sp-3) 0 var(--sp-1); border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--surface); color: var(--text-2); font-size: var(--fs-sm); white-space: nowrap; text-decoration: none; }
  .r-strip a.is-here { border-color: var(--action-ink); color: var(--text); }
  .r-strip a.r-strip__sub { font-size: var(--fs-xs); border-style: dashed; }
  .r-strip .toc__ic { width: 20px; height: 20px; }
  .grid--dash { grid-template-columns: minmax(0, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .objects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content { padding: var(--sp-4) var(--sp-4) var(--sp-8); }
  .topbar { padding: 0 var(--sp-4); }
  .user-btn__txt { display: none; }
  .balance-chip__lbl { display: none; }
}
/* тестовый контур: поиск остаётся полем не уже 280 px — сжимаются метка контура и подпись пользователя */
@media (min-width: 1280px) and (max-width: 1599.98px) {
  .is-live .live-mark__t { display: none; }
  .is-live .live-mark__s { display: inline; }
  .is-live .user-btn__txt, .is-live .balance-chip__lbl { display: none; }
}
/* рабочий вид: меню свёрнуто; раскрытое меню — поверх содержимого */
@media (min-width: 720px) and (max-width: 1279.98px) {
  .app { grid-template-columns: var(--sidebar-mini) minmax(0, 1fr); }
  body.nav-open .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w); box-shadow: var(--shadow-3); }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: var(--scrim); z-index: 29; }
}
@media (max-width: 959.98px) {
  .wizard { grid-template-columns: minmax(0, 1fr); }
  .summary { position: static; }
  .search-trigger { flex: 1 1 auto; min-width: 280px; }
  .live-mark__t, .live-mark__s { display: none; }
  .live-mark { padding: 0 var(--sp-2); }
  .balance-chip__res { display: none; }
  .form-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 719.98px) {
  body { --side-cur: 0px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .only-m { display: inline-flex !important; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform var(--dur-panel) var(--ease-out); box-shadow: var(--shadow-3); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: var(--scrim); z-index: 29; }
  .side-toggle { display: none; }
  .topbar { padding: 0 var(--sp-2); gap: var(--sp-1); }
  .topbar .topbar__menu { display: inline-flex; }
  .topbar__logo { display: flex; align-items: center; margin-right: auto; }
  .topbar__logo .logo-svg { width: 92px; height: auto; }
  .search-trigger { flex: none; width: var(--h-icon); min-width: 0; height: var(--h-icon); padding: 0; justify-content: center; border: 0; background: transparent; }
  .search-trigger span, .search-trigger .kbd { display: none; }
  .topbar__right { margin-left: 0; gap: 2px; }
  .balance-chip, #liveMark { display: none !important; }
  .user-pop__bal { display: block; }
  .content { padding: var(--sp-3) var(--sp-3) 88px; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: 64px; padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--border); }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: var(--fs-xs); color: var(--text-3); font-weight: var(--fw-semibold); text-decoration: none; }
  .bottom-nav a.is-active { color: var(--action-ink); }
  .bottom-nav__new { width: 44px; height: 44px; border-radius: var(--r-3); background: var(--action); color: var(--on-action); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-2); }
  .toasts { left: var(--sp-4); right: var(--sp-4); bottom: 80px; align-items: stretch; }
  .toast { min-width: 0; max-width: none; }
  .popover { position: fixed; top: var(--topbar-h); left: var(--sp-2); right: var(--sp-2); width: auto; min-width: 0; }
  .notif-pop, .user-pop, .live-pop { width: auto; }
  .bulkbar { left: var(--sp-3); right: var(--sp-3); transform: none; bottom: 84px; white-space: normal; flex-wrap: wrap; }
  @keyframes bulk-in { from { opacity: 0; transform: translateY(16px); } }
  .r-sticky { left: 0; padding: 0 var(--sp-3); }
  .grid--2, .grid--3 { grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
  .grid { gap: var(--sp-3); }
  .kpi { padding: var(--sp-2) var(--sp-3); grid-template-columns: minmax(0, 1fr); }
  .kpi__val { font-size: var(--fs-lg); line-height: var(--lh-lg); }
  .pcards { grid-template-columns: minmax(0, 1fr); }
  .smart__row { flex-direction: column; }
  .flag-grid, .flag-grid--3 { grid-template-columns: minmax(0, 1fr); }
  /* лента сигналов на телефоне: строка — карточка, важность и обработка рядом; точка «не открывали» — у левого края */
  .table--sig tr.sig-gh { padding: var(--sp-2) var(--sp-3); background: var(--surface-2); }
  .table--sig td.sig-c-sev, .table--sig td.sig-c-wk { display: inline-block; width: auto; min-width: 0; vertical-align: top; margin-right: var(--sp-6); }
  .table--sig .sig-dot { position: absolute; left: 2px; top: 16px; margin: 0; }
  .sig-gh__acts { margin-left: 0; }
  .table--sig td.sig-c-what[data-label]::before { display: none; }
  .form-grid, .form-grid--3, .form-grid--4 { grid-template-columns: minmax(0, 1fr); }
  .mode-opt { flex-wrap: wrap; }
  .span-2 { grid-column: auto; }
  .objects { gap: var(--sp-2); }
  .object { padding: var(--sp-2); gap: var(--sp-2); }
  .object__d { display: none; }
  .presets { grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); }
  .card__head { padding: var(--sp-3) var(--sp-3) 0; }
  .card__body { padding: var(--sp-2) var(--sp-3) var(--sp-3); }
  .card--pad { padding: var(--sp-3); }
  .fblock { padding: var(--sp-3); }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick__d { display: none; }
  .r-head { padding: var(--sp-3); gap: var(--sp-3); }
  .r-head__subj { font-size: var(--fs-lg); line-height: var(--lh-lg); }
  .r-head__brand .logo-svg { width: 88px; }
  .banner { flex-wrap: wrap; }
  .banner > .btn { margin-left: var(--sp-8); }
  .banner__body { flex: 1 1 calc(100% - 40px); }
  .r-sec, .ai { padding: var(--sp-3); }
  .ai__top { gap: var(--sp-3); }
  .ai__score { width: 84px; height: 84px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-1); }
  .metrics--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric { padding: var(--sp-1) var(--sp-2); }
  .page-head > .row { flex-wrap: wrap; }
  .factor { grid-template-columns: minmax(0, 1fr) 80px 36px; }
  .kv { grid-template-columns: minmax(96px, 38%) minmax(0, 1fr); }
  .kv > div { padding: var(--sp-1) var(--sp-2); }
  .kv > div:empty { display: none; }
  .report-aside { grid-template-columns: minmax(0, 1fr); }
  .perm-group__body { grid-template-columns: minmax(0, 1fr); }
  .toolbar .input-icon { flex: 1 1 100%; max-width: none; }
  .toolbar .select { flex: 1 1 calc(50% - 4px); max-width: none; min-width: 0; }
  .invoice-doc { padding: var(--sp-4); }
  .msg { max-width: 100%; }
  .modal-wrap { padding: var(--sp-4) var(--sp-2); }
  .modal-wrap.modal-wrap--xl { padding: 0; }
  .modal--xl { max-width: none; height: 100%; border-radius: 0; }
  .modal__head, .modal__body, .modal__foot { padding-left: var(--sp-3); padding-right: var(--sp-3); }
  .page-head { margin-bottom: var(--sp-3); }
  .page-head > .row, .page-head > .btn { width: 100%; }
  .page-head > .row > .btn { flex: 1 1 auto; }
  .views__dens { margin-left: 0; }
  .tariff-tbl th.t-name, .tariff-tbl td.t-name { min-width: 180px; }
  /* таблицы → карточки */
  .rq-bar { flex-wrap: wrap; }
  .rq-bar__q { flex-wrap: wrap; justify-content: flex-end; }
  .report .table--sm { display: block; max-width: 100%; overflow-x: auto; }
  .table--cards thead { display: none; }
  .table--cards, .table--cards tbody, .table--cards tr, .table--cards td { display: block; width: 100%; }
  .table--cards tr { position: relative; padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border); }
  .table--cards tr:last-child { border-bottom: 0; }
  .table--cards td { border: 0; padding: 2px 0; height: auto; background: none !important; box-shadow: none !important; }
  .table--cards td[data-label]::before { content: attr(data-label); display: block; font-size: var(--fs-xs); color: var(--text-3); font-weight: var(--fw-semibold); }
  .table--cards td.money { text-align: left; }
  .table--cards td.td-check { position: absolute; right: var(--sp-3); top: var(--sp-3); width: auto; }
  .table--cards td.td-exp { display: none; }
  .table--cards tr.is-sub { padding-left: var(--sp-6); background: var(--surface-2); }
  .table--cards .obj-cell { min-width: 0; }
  .table--cards td.status-cell, .table--cards td.money, .table--cards td.cons-cell, .table--cards td[data-label="Статус"], .table--cards td[data-label="Роль"], .table--cards td[data-label="Тип"], .table--cards td[data-label="Сумма"], .table--cards td[data-label="Дата"], .table--cards td[data-label="В месяц"] { display: inline-block; width: auto; min-width: 0; vertical-align: top; margin-right: var(--sp-6); }
  .table--cards td:first-child[data-label]::before, .table--cards td.td-check + td[data-label]::before { display: none; }
  .table--cards .status-cell .progress { width: 100%; }
  .table--cards td.hide-m { display: none; }
  .table--cards tfoot { display: block; }
}

/* ==========================================================================
   Печать (кнопка «Скачать PDF» → печать в PDF): А4, логотип iScor.ru (он же адрес сайта) вверху
   справа на каждой странице, без интерфейса кабинета; водяной знак «кто и когда выгрузил».
   Поля страницы у браузера — 0: тогда Chrome не печатает свои колонтитулы (дату, заголовок
   вкладки, адрес страницы). Поля делаем сами: у отчёта — таблица-обёртка, её шапка (сверху)
   и подвал-распорка (снизу) повторяются на каждой странице; у прочих страниц — отступ
   .content, повторяемый на каждой странице (box-decoration-break: clone).
   ========================================================================== */
@page { size: A4; margin: 0; }
@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  html, body { margin: 0; padding: 0; }
  body { background: var(--surface); font-size: var(--fs-xs); }
  .sidebar, .topbar, .bottom-nav, .toasts, .no-print, .report-aside, .page-head, .scrim, .back-link, .modal-wrap, .tip, .live-mark, .raw-json, .r-sticky, .r-strip, .rq-bar, .mbtns, .more-btn, .r-head .rid__copy, .hint,
  .report button, .report .btn, .report .icon-btn, .report .ai__counts, .report .ai__stop, .report .ai__how, .toc { display: none !important; }
  .report .ai__stop.ai__stop--block { display: flex !important; }
  .r-sec__head, .r-sub { break-after: avoid; }
  .app { display: block; }
  .content { max-width: none; padding: 12mm 14mm; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
  .content:has(.print-wrap) { padding: 0; }
  .report-layout { display: block; }
  .report { border: 0; box-shadow: none; border-radius: 0; overflow: visible; background: transparent; }
  .print-wrap { display: table; width: 100%; border-collapse: collapse; }
  .print-wrap > thead { display: table-header-group; }
  .print-wrap > tbody { display: table-row-group; }
  .print-wrap > tfoot { display: table-footer-group; }
  .print-wrap > thead > tr, .print-wrap > tbody > tr, .print-wrap > tfoot > tr { display: table-row; }
  .print-wrap > thead > tr > td, .print-wrap > tbody > tr > td, .print-wrap > tfoot > tr > td { display: table-cell; padding: 0 14mm; }
  .print-wrap > thead > tr > td { padding-top: 12mm; }
  .print-tail { height: 12mm; }
  /* шапка каждой страницы: высота задана точно — на первой странице её целиком закрывает шапка отчёта */
  .print-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-4); box-sizing: border-box; height: 13mm; margin-bottom: 3mm; padding: 0; border-bottom: 2px solid var(--brand); font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-3); overflow: hidden; }
  .print-head b { color: var(--text); }
  .print-head .logo-svg { width: 92px; height: auto; color: var(--text); display: block; margin-left: auto; }
  .print-head__r { text-align: right; flex: none; }
  .print-wm { display: flex; position: fixed; inset: 0; align-items: center; justify-content: center; pointer-events: none; z-index: 0; }
  .print-wm span { transform: rotate(-30deg); font-size: var(--fs-num); font-weight: var(--fw-bold); color: var(--wm-ink); white-space: nowrap; text-align: center; }
  /* шапка отчёта на первой странице: встаёт на место повторяющейся строки (−16 мм = её высота с отступом) */
  .r-head { position: relative; z-index: 1; margin-top: -16mm; padding: 0 0 var(--sp-3); background: var(--surface); box-shadow: 3px 0 0 var(--surface), -3px 0 0 var(--surface); border-bottom: 2px solid var(--brand); gap: var(--sp-4); }
  .r-head__brand { display: block; }
  .r-head__brand .logo-svg { width: 92px; }
  .r-sec, .ai { padding: var(--sp-3) 0 var(--sp-2); break-inside: auto; }
  .r-part { break-inside: auto; }
  .r-part__h { break-after: avoid; }
  /* целиком не разрываем только мелкое: карточки, строки таблиц, заголовки; большие блоки (рекомендация, таблицы «ключ — значение»)
     переходят на следующую страницу частями — без пустого низа страницы. Заголовок не остаётся один внизу страницы. */
  .r-sec__head, .r-sub, .r-part__h, .ai__h, .ai__label, .ai__rec-t, .got__h, .disc__h, .metric, .flag, .debt, .table--sm tr, .factor, .range, .sc__row, .sc__total, .ai__top, .ai__part, .fact, .disc__row { break-inside: avoid; }
  .r-sec__head, .r-sub, .r-part__h, .ai__h, .ai__label, .ai__rec-t, .got__h, .disc__h, .facts__more > summary { break-after: avoid; }
  .report details > summary { list-style: none; cursor: auto; }
  .report details > summary::-webkit-details-marker { display: none; }
  .report details > summary::marker { content: ''; }
  .facts__more > summary { padding: 0; margin: var(--sp-2) 0 var(--sp-1); font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--fw-bold); color: var(--text-2); }
  .ai__rec, .disc { -webkit-box-decoration-break: clone; box-decoration-break: clone; }
  .notfound { text-align: left; padding: 0; }
  /* «ключ — значение» в две колонки на бумаге идёт в одну: пустая пара-заполнитель не нужна */
  .kv > div:empty { display: none; }
  .kv--2:has(> div:empty) > div:nth-last-child(-n+4) { border-bottom: 0; }
  .notfound__p { max-width: none; margin: 0; }
  .more-box { display: block !important; }
  .print-foot { display: inline; margin-left: .3em; color: var(--text-2); }
  .r-sec.r-foot { padding: var(--sp-2) 0 0; break-inside: avoid; }
  .explain { color: var(--text-2); }
  a { color: inherit; }
  .report a[data-jump] { text-decoration: none; }
  .invoice-page.invoice-doc, .invoice-page .invoice-doc { border: 0; border-radius: 0; padding: 0; max-width: none; }
  .table--sticky th, .summary { position: static; }
}
@media screen { .print-head, .print-foot, .print-only { display: none !important; } }

/* мобильный вид: сумма уже есть своей строкой «Стоимость» — дубль в «Состоянии» не нужен */
@media (max-width: 719.98px) { .table--rq .rq-cost-m { display: none !important; } .table--rq td.td-cost { display: inline-block !important; } }

/* ---------- Понятность: список запросов, шапка, мастер (правка по отзыву «первый день») ---------- */
.page-head--tight { align-items: center; margin-bottom: var(--sp-2); }
.rq-bar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border); margin-bottom: var(--sp-3); }
.rq-bar > .tabs { border-bottom: 0; margin-bottom: 0; flex: none; }
.rq-bar > .views { margin-bottom: 0; flex: 1 1 auto; }
.rq-bar__end { margin-left: auto; }
.rq-bar__end.is-on { background: var(--surface-3); color: var(--text); }
.rq-exp { display: inline; font-size: var(--fs-sm); line-height: var(--lh-sm); margin-left: var(--sp-1); white-space: nowrap; }
.table tr.is-live > td { background: var(--info-bg); }
.card.has-bulk { margin-bottom: calc(var(--h-lg) + var(--sp-8)); }
.rq-legend { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1) var(--sp-4); }
.rq-legend__i { display: inline-flex; align-items: center; gap: var(--sp-1); }
.rq-legend .unseen-dot { margin-right: 0; }
.rq-ai__stop { display: flex; align-items: flex-start; gap: var(--sp-1); margin-top: 2px; color: var(--crit-ink); font-weight: var(--fw-semibold); }
.rq-ai__stop .ic { color: var(--crit); flex: none; margin-top: 2px; }
.rq-ai__block { color: var(--warn-ink); }
.rq-ai__block .ic { color: var(--warn); }
.pcard__when { display: block; font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-2); margin-top: 2px; }
/* Карточки в ряду одинаковы по строению: верх · описание · ступени цены · пометка · низ — строки общей сетки
   (subgrid), поэтому блок ступеней и нижняя строка у соседних карточек на одной высоте. Если описание короче —
   место остаётся под текстом описания. Браузер без subgrid — прежняя колонка, низ прижат к краю карточки. */
.pcard__txt { display: block; }
@supports (grid-template-rows: subgrid) {
  /* промежуток между рядами — отступом карточки: зазор сетки встал бы и между частями внутри карточки */
  .pcards { row-gap: 0; margin-bottom: calc(-1 * var(--sp-2)); }
  .pcards > .pcard { display: grid; grid-template-columns: minmax(0, 1fr); grid-row: span 5; grid-template-rows: subgrid; row-gap: 0; margin-bottom: var(--sp-2); }
  .pcards > .pcard > .pcard__main { display: contents; }
  .pcards > .pcard .pcard__top { grid-row: 1; }
  .pcards > .pcard .pcard__txt { grid-row: 2; }
  .pcards > .pcard .ptier { grid-row: 3; align-self: start; }
  .pcards > .pcard .pcard__lock { grid-row: 4; align-self: start; }
  .pcards > .pcard .pcard__meta { grid-row: 5; margin-top: 0; align-self: end; }
}
/* оригиналы согласий: карточка на Главной и блок на странице запроса */
.cons-mini { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-1); }
.cons-mini .status, .cons-card .status { white-space: normal; align-items: flex-start; }
.cons-mini .status .ic, .cons-card .status .ic { margin-top: 2px; flex: none; }
.cons-card__go { display: inline-block; margin-top: var(--sp-2); }
.balance-chip .low-mark { margin-left: var(--sp-1); }
/* 1280–1365: «Доступно … · в резерве … · ниже порога» в шапке важнее подписи пользователя (имя — в меню по аватару) */
@media (min-width: 1280px) and (max-width: 1365.98px) { .user-btn__txt { display: none; } }
/* узкий рабочий вид: у «Изменить» в таблице сотрудников остаётся значок (подпись — в aria-label), таблица не прокручивается вбок */
@media (max-width: 1279.98px) { .emp-edit__t { display: none; } }

/* мигающий курсор в обычном тексте (режим «просмотр с курсором», F7 в Chrome) — показываем только в полях ввода */
body { caret-color: transparent; }
input, textarea, select, [contenteditable] { caret-color: auto; }

/* ===== Все поля отчёта: «Подробнее» → «Что будет в отчёте — все поля» ===== */
.allf { margin-top: var(--sp-6); padding-top: var(--sp-4); border-top: 1px solid var(--border); }
.allf__h { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2); margin: 0 0 var(--sp-1); }
.allf__n { font-size: var(--fs-xs); line-height: var(--lh-xs); font-weight: var(--fw-regular); color: var(--text-3); }
.allf__part { margin-top: var(--sp-4); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--border); border-radius: var(--r-3); background: var(--surface-2); }
.allf__ph { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2); font-weight: var(--fw-bold); font-size: var(--fs-md); }
.allf__g { margin-top: var(--sp-3); }
.allf__part .allf__g:first-of-type { margin-top: var(--sp-2); }
.allf__gt { font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: var(--fw-semibold); color: var(--text-2); margin-bottom: var(--sp-1); display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: baseline; }
.allf__gn { font-size: var(--fs-xs); font-weight: var(--fw-regular); color: var(--text-3); }
.allf__list { list-style: none; margin: 0; padding: 0; columns: 3 230px; column-gap: var(--sp-6); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.allf__list li { break-inside: avoid; padding: 3px 0 3px 14px; position: relative; overflow-wrap: anywhere; }
.allf__list li::before { content: ""; position: absolute; left: 2px; top: 10px; width: 5px; height: 5px; border-radius: 50%; background: var(--brand); }
.allf__g--alt .allf__list li::before { background: var(--text-3); }
.allf__l { color: var(--text); }
.allf__d { color: var(--text-3); font-size: var(--fs-xs); line-height: var(--lh-xs); }

/* ===== Отчёт: записи источников, таблицы с линиями, «Какие ещё ответы бывают» ===== */
.table--grid th + th, .table--grid td + td { border-left: 1px solid var(--line-v); }
/* отчётность: много лет в столбцах — поуже поля, подпись показателя не сжимается в столбик */
.table--bfo th, .table--bfo td { padding-left: var(--sp-2); padding-right: var(--sp-2); }
.table--bfo td:first-child { min-width: 11em; }
.rec { margin-bottom: var(--sp-2); }
.rec--muted { opacity: .72; }
.alt-box { margin-top: var(--sp-4); padding: var(--sp-3); border: 1px dashed var(--border-2); border-radius: var(--r-3); }
.alt-box .r-sub { margin-top: 0; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li + li { margin-top: 2px; }
.case-moves { margin-top: var(--sp-2); }
.case-moves > summary { cursor: pointer; font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-2); padding: 2px 0; }
.case-moves[open] > summary { margin-bottom: var(--sp-1); }
.debt .debt__sub .kv { margin-top: var(--sp-1); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.factor--head { padding-bottom: 0; }
/* «Из чего сложилась оценка» — скоркарта iScor: группа, «набрано из максимума», тонкая полоса цветом доли, причины потерь */
.sc { max-width: 720px; }
.sc__rows { display: flex; flex-direction: column; gap: var(--sp-3); margin-top: var(--sp-2); }
.sc__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.sc__name { font-weight: var(--fw-semibold); min-width: 0; }
.sc__pts { flex: none; color: var(--text-2); white-space: nowrap; }
.sc__pts b { color: var(--text); }
.sc__bar { height: 6px; margin-top: 4px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.sc__fill { display: block; height: 100%; border-radius: var(--r-pill); background: var(--text-3); }
.sc__fill--a { background: var(--risk-a); }
.sc__fill--c { background: var(--risk-c); }
.sc__fill--e { background: var(--risk-e); }
.sc__why { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-xs); line-height: var(--lh-xs); color: var(--text-2); }
.sc__why li { display: flex; gap: var(--sp-2); }
.sc__d { flex: none; min-width: 28px; font-weight: var(--fw-semibold); color: var(--text); }
.sc__d.is-plus { color: var(--risk-a-ink); }
.sc__caps { margin-top: var(--sp-3); display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); }
.sc__sum { color: var(--text-2); }
.sc__cap { display: flex; gap: var(--sp-2); align-items: flex-start; }
.sc__total { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-top: var(--sp-3); padding-top: var(--sp-2); border-top: 1px solid var(--border); font-size: var(--fs-md); }
.ai__card-link { display: inline-block; margin-top: var(--sp-2); color: var(--action-ink); }


@media (max-width: 719.98px) { .allf__list { columns: 1; } }
.kv > div { overflow-wrap: break-word; }
.pcard__lock .ic { flex: none; margin-top: 2px; }

/* Пакеты в настоящем режиме: ход по каждому источнику (название — слева, статус — справа) */
.src-list { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-1) var(--sp-3); margin-top: var(--sp-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.src-list__n { color: var(--text-2); overflow-wrap: anywhere; }
.src-list__n .xs { display: block; color: var(--text-3); }
/* фото профиля мессенджера или соцсети — маленькое, в отчёте и в PDF */
.r-pic { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; vertical-align: middle; }
/* настоящий документ дела в окне: PDF — во встроенном просмотре, текст — с переносами */
.docv__frame { width: 100%; height: 65vh; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.docv__text { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; max-height: 65vh; overflow: auto; margin: 0; }

/* ссылки из ответов источников (фото, объявления, карточки) — длинный адрес переносится, не обрезается */
.u-break { overflow-wrap: anywhere; word-break: break-word; }

/* ==========================================================================
   Вход сотрудника iScor в кабинет из админки («Войти как»): полоса сверху — не сворачивается
   и не печатается; жёлтая — только просмотр, красная — полный доступ (действия настоящие).
   Объявление iScor для всех кабинетов — строка под верхней панелью. Заблокированный клиент.
   ========================================================================== */
.imp-strip { position: sticky; top: 0; z-index: 45; display: flex; align-items: center; gap: var(--sp-3); min-height: 40px; padding: var(--sp-1) var(--sp-6); background: var(--warn-bg); color: var(--text); border-bottom: 1px solid var(--warn-line); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.imp-strip > .ic { flex: none; color: var(--warn-ink); }
.imp-strip--full { background: var(--crit-bg); border-bottom-color: var(--crit-line); }
.imp-strip--full > .ic { color: var(--crit-ink); }
.imp-strip__t { flex: 1; min-width: 0; }
.imp-strip__back { flex: none; display: inline-flex; align-items: center; gap: var(--sp-1); height: var(--h-sm); padding: 0 var(--sp-3); border: 1px solid var(--border-control); border-radius: var(--r-2); background: var(--surface); color: var(--text); font-size: var(--fs-sm); font-weight: var(--fw-semibold); white-space: nowrap; }
.imp-strip__back:hover { border-color: var(--text-2); }
body.is-imp { --imp-h: 40px; }
body.is-imp .topbar { top: var(--imp-h); }
body.is-imp .sidebar { top: var(--imp-h); height: calc(100vh - var(--imp-h)); }
.ann-bar { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-6); background: var(--info-bg); color: var(--text); border-bottom: 1px solid var(--info-line); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.ann-bar[hidden] { display: none; }
.ann-bar > .ic { flex: none; color: var(--info-ink); }
.blocked-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--sp-4); }
.blocked-page .card { max-width: 520px; }
@media (max-width: 1279.98px) { .imp-strip, .ann-bar { padding-left: var(--sp-4); padding-right: var(--sp-4); } }
@media (max-width: 719.98px) {
  .imp-strip { flex-wrap: wrap; padding: var(--sp-2) var(--sp-3); }
  .imp-strip__back { margin-left: 30px; }
  .ann-bar { padding: var(--sp-2) var(--sp-3); }
  body.is-imp .sidebar { top: 0; height: auto; }
}
@media print { .imp-strip, .ann-bar { display: none !important; } body.is-imp .topbar { top: 0; } }
