/* «Код роли» — брендбук «Русское Золото» (блок 6 ТЗ): белый фон, чёрный текст,
   красный #FF0000 только для акцентов (основная кнопка, активный пункт, прогресс, данные респондента).
   Шрифт Inter (вместо Helvetica), локально. Без inline-стилей (CSP default-src 'self').
   Вёрстка mobile-first: базовые правила — для телефона от 360 px, расширения — через min-width. */

@font-face {
    font-family: "Inter";
    src: url("../fonts/InterVariable.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --black: #000;
    --white: #fff;
    --red: #FF0000;
    --red-dark: #D90000;
    --block: #F5F5F5;
    --muted: #8A8A8A;
    --line: #E0E0E0;
    --dark-grey: #555555;
    --light-grey: #A0A0A0;
    --tap: 44px;          /* минимальная зона касания */
    /* Отступы — один шаг 8 px (этап 7.1): между элементами внутри группы — s1, между группами — s2, между блоками — s3/s4 */
    --s1: 8px;
    --s2: 16px;
    --s3: 24px;
    --s4: 32px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Inter", Arial, sans-serif; font-weight: 400; font-size: 16px; line-height: 1.5;
       color: var(--black); background: var(--white); overflow-wrap: anywhere; }
h1, h2, h3 { font-weight: 700; line-height: 1.25; }
h1 { margin: 0 0 16px; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: 18px; margin: 24px 0 8px; }
a { color: var(--black); }
img { max-width: 100%; }
.muted { color: var(--muted); font-weight: 300; }
.small { font-size: 14px; }
.mono { font-family: Consolas, "Courier New", monospace; font-size: 14px; }
[hidden] { display: none !important; }

/* ---------- Кнопки (этап 7.1): три размера, одна основная на экран ----------
   .button.primary — основная: красная, 44 px, ровно одна на экране (главное действие экрана);
   .button        — обычная: белая с чёрной рамкой, 44 px;
   .button.small  — маленькая: видимая высота 36 px, зона касания 44 px (::after выступает на 4 px сверху и снизу) —
                    действия в строках таблиц, «Сбросить», меню «⋯». */
button, .button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--s1);
                  min-height: var(--tap); padding: 6px var(--s2); border: 1px solid var(--black); border-radius: 0;
                  background: var(--white); color: var(--black); font: inherit; font-size: 15px; font-weight: 700; line-height: 1.2;
                  text-align: center; text-decoration: none; cursor: pointer; overflow-wrap: normal; hyphens: manual;
                  -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:hover, .button:hover { background: var(--block); }
button:disabled { cursor: default; opacity: .45; }
button.primary, .button.primary { background: var(--red); border-color: var(--red); color: var(--white); }
button.primary:hover, .button.primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
button.primary:disabled { background: var(--block); border-color: var(--line); color: var(--muted); opacity: 1; }
button.small, .button.small { min-height: 36px; padding: 4px 12px; font-size: 14px; }
button.small::after, .button.small::after { content: ""; position: absolute; left: 0; right: 0; top: -4px; bottom: -4px; }
button.block, .button.block { display: flex; width: 100%; }
button.link { min-height: var(--tap); padding: 0 4px; border: 0; background: none; font-weight: 400; text-decoration: underline; }
button.link.danger { color: var(--red); }
form.inline { display: inline; }

label { display: block; margin-bottom: 14px; font-size: 15px; }
input, select, textarea { display: block; width: 100%; min-height: var(--tap); margin-top: 4px; padding: 9px 10px;
                          border: 1px solid #C8C8C8; border-radius: 0; font: inherit; font-size: 16px; color: var(--black); background: var(--white); }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--black); outline-offset: 1px; }
textarea { resize: vertical; }
input[type=checkbox], input[type=radio] { display: inline-block; width: 22px; height: 22px; min-height: 0; margin: 0; accent-color: var(--black); }
fieldset { min-width: 0; border: 0; padding: 16px; margin: 0 0 16px; background: var(--block); }
legend { float: left; width: 100%; padding: 0; margin-bottom: 12px; font-weight: 700; }

.alert { padding: 10px 14px; border-left: 3px solid var(--red); background: var(--block); }
.notice { padding: 10px 14px; border-left: 3px solid var(--black); background: var(--block); }

/* Плашка «Тестовый контур» (этап 8, только на /adizes-test/): чёрная полоса над шапкой, красный не занимаем — он для главной кнопки */
.contour-banner { padding: 6px 16px; background: var(--black); color: var(--white); font-size: 13px; font-weight: 600;
                  line-height: 20px; text-align: center; letter-spacing: .02em; }

/* ---------- Шапка и каркас админки ---------- */
.topbar { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 12px;
          padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--white); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; color: var(--black); }
.logo { display: block; height: 40px; width: auto; flex: none; }
.product { padding-left: 12px; border-left: 1px solid var(--line); font-weight: 800; font-size: 16px; white-space: nowrap; }
.who { color: var(--muted); }

.menu-toggle { padding: 8px 12px; font-weight: 700; }
.burger, .burger::before, .burger::after { display: block; width: 18px; height: 2px; background: var(--black); position: relative; }
.burger::before, .burger::after { content: ""; position: absolute; left: 0; }
.burger::before { top: -6px; }
.burger::after { top: 6px; }
.usernav { display: none; }

.shell { max-width: 1280px; margin: 0 auto; }
.sidemenu { display: none; border-bottom: 1px solid var(--line); background: var(--white); }
body.menu-open .sidemenu { display: block; }
.sidemenu a { display: flex; align-items: center; min-height: var(--tap); padding: 8px 16px; color: var(--black);
              text-decoration: none; border-left: 3px solid transparent; }
.sidemenu a:hover { background: var(--block); }
.sidemenu a.active { border-left-color: var(--red); font-weight: 700; }
.menu-user { padding: 8px 16px 12px; border-top: 1px solid var(--line); }
.menu-user .who { display: block; margin-bottom: 4px; font-size: 14px; }
.menu-user a { padding-left: 0; border-left: 0; }
.menu-user button.link { padding-left: 0; }
.content { min-width: 0; padding: 16px; }

.card { padding: 0 0 24px; background: var(--white); }
.card.narrow { max-width: 420px; margin: 16px auto; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-head h1 { margin: 0; }
.crumbs { margin: 0 0 8px; font-size: 14px; }
.crumbs a { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--muted); text-decoration: none; }

.grid-2, .grid-3 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
.narrow-field { max-width: 240px; }
.row-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; max-width: 560px; }
.row-form input { margin: 0; }
.danger-zone { margin-top: 32px; padding-top: 8px; border-top: 1px solid var(--line); }

/* Таблицы прокручиваются внутри своего контейнера, а не всей страницей */
.table-wrap { position: relative; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; } /* relative: скрытые подписи (position: absolute) не раздвигают страницу */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { padding: 8px 10px; border-bottom: 2px solid var(--black); font-weight: 700; text-align: left; white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table th, table td { overflow-wrap: normal; word-break: normal; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td:has(> .code), td:has(> .status) { white-space: nowrap; }
td:first-child { min-width: 9em; }
td.actions { text-align: right; white-space: nowrap; }
tr.inactive td { color: var(--muted); }
.code { font-weight: 800; letter-spacing: .04em; }

/* ---------- Этап 7: реестр «Тестирования», «Люди», карточка, сравнение, главная ---------- */
.cell-note { display: block; font-size: 12px; color: var(--muted); white-space: normal; }
.segmented-links { display: inline-flex; margin: 0 0 12px; border: 1px solid var(--black); }
.segmented-links a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 18px; text-decoration: none; }
.segmented-links a + a { border-left: 1px solid var(--black); }
.segmented-links a.active { background: var(--black); color: var(--white); font-weight: 700; }
.filters { margin: 0 0 12px; border: 1px solid var(--line); }
.filters summary { display: flex; align-items: center; min-height: var(--tap); padding: 8px 12px; cursor: pointer; font-weight: 700; }
.filter-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; padding: 4px 12px 12px; }
.filter-form label { margin-bottom: 10px; }
.filter-buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.registry-count { margin: 0 0 8px; }
td.rt-check { width: 44px; min-width: 0; padding-top: 0; padding-bottom: 0; }
td.rt-check + td { min-width: 9em; }
a.status-link { text-decoration: none; }
.registry .rtable th, .registry .rtable td { padding: 8px 6px; } /* 11 колонок реестра в 1280 px */
/* таблица: колонка галочки — ровно зона касания 44 px, без полей и выноса (иначе зона залезала на 4 px в колонку ФИО) */
@media (min-width: 600px) {
    .rtable td.rt-check, .registry .rtable td.rt-check { padding-left: 0; padding-right: 0; }
    .rtable td.rt-check label.pick { margin: 0; }
}
.compare-scores { margin-top: 8px; }
a.status-link:hover .status { outline: 1px solid var(--black); }
label.pick { display: inline-flex; align-items: center; justify-content: center; width: var(--tap); height: var(--tap); margin: 0 -10px; cursor: pointer; }
label.pick input { width: 24px; height: 24px; }
a.sort { color: var(--black); text-decoration: none; }
a.sort.active { text-decoration: underline; }
.mini-radar { display: block; }
.pager { margin: var(--s3) 0 0; }
.pager-info { margin: var(--s1) 0 0; color: var(--muted); font-size: 14px; }
@media (min-width: 600px) { .pager .ui-pair { max-width: 400px; } }

/* ===================== Компоненты интерфейса (этап 7.1) =====================
   Все экраны админки собираются только из них; витрина — /admin/ui-kit (только администратор).
   Правила: отступы 8 / 16 / 24 (--s1…--s3); высота управляющих элементов 44 px (маленькая кнопка — 36 видимо, 44 зона касания);
   на 360 px поля, списки и переключатели — во всю ширину колонки, левые края на одной линии;
   кнопки в одном ряду — одной высоты; два равноценных действия — .ui-pair (1fr 1fr);
   одна красная кнопка на экран, на телефоне — во всю ширину; статусы — серые плашки без рамки. */

/* --- Кнопки: .button (обычная) · .primary (красная, одна на экран) · .dark (залитая чёрная) · .text (текстом)
       · .small (36 / 44) · .block (во всю ширину) · .icon (квадрат 44×44) */
.button.dark, button.dark { background: var(--black); border-color: var(--black); color: var(--white); }
.button.dark:hover, button.dark:hover { background: #333; border-color: #333; }
.button.text, button.text { border-color: transparent; background: none; font-weight: 700; text-decoration: underline; padding: 6px var(--s1); }
.button.text:hover, button.text:hover { background: none; text-decoration: none; }
.button.icon, button.icon { width: var(--tap); min-width: var(--tap); padding: 0; font-size: 20px; letter-spacing: 1px; }
button.dark:disabled { background: var(--line); border-color: var(--line); color: var(--muted); opacity: 1; }
@media (max-width: 599.98px) { .button.primary, button.primary { display: flex; width: 100%; } }

.button.danger, button.danger { border-color: var(--red); color: var(--red); background: var(--white); }
.button.danger:hover, button.danger:hover { background: #FFF2F2; }

/* --- Ряды кнопок */
.ui-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: var(--s1); }
.ui-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s1); }   /* два равноценных действия */
.ui-fill { display: grid; grid-template-columns: minmax(0, 1fr) var(--tap); gap: var(--s1); }      /* действие + квадрат «⋯» */
.ui-pair > *, .ui-fill > * { width: 100%; min-width: 0; }
.ui-pair .button, .ui-pair button { padding-left: var(--s1); padding-right: var(--s1); }
.ui-pair > form, .ui-fill > form { display: flex; margin: 0; }
.ui-pair > form > button, .ui-fill > form > button { width: 100%; }
.rtable td.rt-actions .ui-pair { min-width: 300px; }
.ui-fill > .row-menu > summary { width: var(--tap); }

/* --- Колонка формы: на телефоне каждый элемент во всю ширину, левые края на одной линии */
.ui-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s1); }
.ui-col > *, .ui-col > label > input, .ui-col > label > select { width: 100%; margin: 0; }
.ui-col label { margin: 0; }
.ui-col > label.check > input { width: auto; flex: none; } /* галочка в колонке формы — своего размера, подпись переносится */
.ui-col > label.check > span { min-width: 0; }

/* --- Переключатель-сегменты: сегменты одинаковой ширины, 44 px; на телефоне — во всю ширину */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; border: 1px solid var(--black); background: var(--white); }
.seg > a, .seg > button { display: flex; align-items: center; justify-content: center; min-height: var(--tap); margin: 0; padding: 0 var(--s1);
                          border: 0; background: none; color: var(--black); font-size: 15px; font-weight: 400; text-decoration: none;
                          white-space: nowrap; overflow: hidden; text-overflow: ellipsis; -webkit-tap-highlight-color: transparent; }
.seg > a + a, .seg > button + button, .seg > label + label { border-left: 1px solid var(--black); }
/* сегменты на радиокнопках (формы): выбранный — по :checked */
.seg > label { display: flex; align-items: center; justify-content: center; min-height: var(--tap); margin: 0; padding: 0 var(--s1); cursor: pointer;
               font-size: 15px; text-align: center; -webkit-tap-highlight-color: transparent; }
.seg > label > input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg > label:has(input:checked) { background: var(--black); color: var(--white); font-weight: 700; }
.seg > label:has(input:focus-visible) { outline: 2px solid var(--black); outline-offset: 2px; }
.seg > .active { background: var(--black); color: var(--white); font-weight: 700; }
@media (hover: hover) { .seg > :not(.active):hover { background: var(--block); } }

/* --- Поле поиска и список — стандартные input / select (44 px, во всю ширину колонки) */
input[type=search] { -webkit-appearance: none; appearance: none; }

select { padding-left: 6px; }
.field { display: block; margin: var(--s2) 0 0; color: var(--dark-grey); font-size: 14px; line-height: 1.25; }
.field > input, .field > select, .field > textarea { margin-top: 6px; }
.ui-col > .field { margin-top: var(--s1); }          /* + промежуток колонки 8 px = 16 px над подписью */
.ui-col > .field:first-child { margin-top: 0; }

/* --- Панель списка: «Найдено: N» + список сортировки — см. .list-bar ниже */

/* --- Плашка: статус, вид, «пробное» — серая, без рамки */
.pill, .status { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border: 0; background: #EDEDED; color: var(--black);
                 font-size: 13px; font-weight: 400; line-height: 1.2; white-space: nowrap; vertical-align: middle; }
.status-revoked, .status-expired, .pill.muted { color: var(--dark-grey); }
.pill.practice { background: none; outline: 1px dashed var(--dark-grey); outline-offset: -1px; color: var(--dark-grey); }

/* --- Карточка с сеткой «подпись — значение» и низом с действиями */
.kcard { padding: var(--s2); border: 1px solid var(--line); background: var(--white); }
.kcard + .kcard { margin-top: var(--s2); }
.kcard.is-practice { background: #F7F7F7; }
.kcard-head { display: flex; align-items: flex-start; gap: var(--s1); }
.kcard-head .pick { flex: none; margin: 0 0 0 -10px; justify-content: flex-start; padding-left: 10px; }
.kcard-head .pick + .kcard-title { margin-left: -8px; }
.kcard-title { flex: 1; min-width: 0; padding-top: 10px; }
.kcard-title h2, .kcard-title h3 { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.3; }
.kcard-title a { text-decoration: none; }
.kcard-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.kcard-tags .pill { font-size: 12px; }
.kcard-result { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: var(--s2); margin: var(--s2) 0 0; }
.kcard-code { font-size: 28px; font-weight: 800; letter-spacing: .04em; text-decoration: none; }
.kcard-index { text-align: right; line-height: 1.1; }
.kcard-index small { display: block; color: var(--muted); font-size: 13px; }
.kcard-index b { font-size: 24px; }
.kv { display: grid; grid-template-columns: var(--label-w, 120px) minmax(0, 1fr); gap: var(--s1) var(--s2); margin: var(--s2) 0 0; font-size: 15px; }
.kv dt { color: var(--muted); overflow-wrap: normal; }
.kv dd { margin: 0; min-width: 0; }
.kv dd .note { display: block; color: var(--muted); font-size: 13px; }
.kcard-actions { margin-top: var(--s2); }

/* --- Этап 8.1: описание должности и внешний AI-сервис (редактор A8, экран «ждущие проверки для AI») */
.field-hint { margin: 6px 0 0; }
.ai-verify { margin-top: var(--s3); padding-top: var(--s2); border-top: 1px solid var(--line); }
.ai-verify h2 { margin-top: 0; }
.ai-verify form { margin-top: var(--s2); }
.ai-review-text { margin: var(--s2) 0 0; white-space: normal; overflow-wrap: anywhere; }
.ai-review-item .alert, .ai-review-item .muted.small { margin: var(--s1) 0 0; }
.bottom-bar .wide-only { display: none; } /* на телефоне — короткая подпись: «Выбрано N» не сжимается */
@media (min-width: 600px) { .bottom-bar .wide-only { display: inline; } }
.ai-test-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
@media (min-width: 900px) { .ai-test-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.ai-test-col > h2 { margin-top: var(--s2); }

/* --- Нижняя панель (выбор для сравнения): закреплена внизу, все элементы 44 px */
.bottom-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
              align-items: center; gap: var(--s1); padding: var(--s1) var(--s2); border-top: 2px solid var(--black); background: var(--white);
              box-shadow: 0 -6px 18px rgba(0, 0, 0, .12); }
.bottom-bar-count { display: flex; align-items: center; min-height: var(--tap); font-size: 15px; white-space: nowrap; }
.bottom-bar-hint { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 14px; }
.bottom-bar-hint:empty { display: none; }
body.has-bottom-bar .content { padding-bottom: 140px; }
@media (min-width: 600px) { .bottom-bar .button.dark { min-width: 160px; } }
@media (min-width: 900px) { .bottom-bar { left: 220px; padding: var(--s1) var(--s3); } }

/* --- Меню «⋯» строки: кнопка-иконка 44×44; на телефоне — лист снизу с затемнением, на ПК — рядом с кнопкой */
.row-menu { position: relative; display: inline-block; }
.row-menu > summary { list-style: none; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu[open] > summary { background: var(--black); color: var(--white); }
.row-menu-list { z-index: 50; min-width: 240px; padding: var(--s1) 0; border: 1px solid var(--black); background: var(--white);
                 box-shadow: 0 8px 24px rgba(0, 0, 0, .16); text-align: left; white-space: normal; }
.row-menu-title { display: none; margin: 0; padding: var(--s1) var(--s2); color: var(--muted); font-size: 14px; }
.row-menu-list a, .row-menu-list button { display: flex; align-items: center; justify-content: flex-start; width: 100%; min-height: var(--tap);
                 margin: 0; padding: 0 var(--s2); border: 0; background: none; color: var(--black); font-size: 15px; font-weight: 400;
                 text-align: left; text-decoration: none; }
.row-menu-list a:hover, .row-menu-list button:hover { background: var(--block); }
.row-menu-list button.danger { color: var(--red); }
@media (max-width: 599.98px) {
    .row-menu[open]::before { content: ""; position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .35); }
    .row-menu-list { position: fixed; left: 0; right: 0; bottom: 0; padding-bottom: var(--s2); border: 0; }
    .row-menu-title { display: block; }
}
@media (min-width: 600px) {
    .row-menu-list { position: absolute; right: 0; top: 100%; }
    .row-menu-list[data-side] { position: fixed; top: auto; right: var(--menu-right, 0); }
    .row-menu-list[data-side="down"] { top: calc(var(--menu-top) + 4px); }
    .row-menu-list[data-side="up"] { bottom: calc(100vh - var(--menu-top) + 4px); }
}

/* --- Показ только на телефоне / только на ПК */
@media (min-width: 600px) { .phone-only { display: none !important; } }
@media (max-width: 599.98px) { .desk-only { display: none !important; } }

/* Витрина /admin/ui-kit */
.ui-kit > h2 { margin: var(--s4) 0 var(--s2); padding-top: var(--s2); border-top: 1px solid var(--line); }
.ui-kit > .ui-row, .ui-kit > .ui-pair, .ui-kit > .ui-fill, .ui-kit > .ui-col, .ui-kit > .button { margin: 0 0 var(--s1); }
.bottom-bar.ui-kit-static { position: static; z-index: auto; box-shadow: none; }

/* --- Окно (лист): на телефоне — во весь экран, на ПК — по центру; заголовок с кнопкой «×» 44×44 */
dialog.sheet { width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; padding: var(--s2); border: 0; background: var(--white); color: var(--black); }
dialog.sheet::backdrop { background: rgba(0, 0, 0, .45); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.sheet-head h2 { margin: 0; font-size: 20px; }
.sheet-head form { margin: 0; }
.sheet-note { margin: var(--s1) 0 0; }
@media (min-width: 600px) { dialog.sheet { width: min(900px, calc(100% - 64px)); height: auto; max-height: calc(100% - 64px); margin: auto; padding: var(--s3); border: 1px solid var(--black); } }
/* Шаблоны должностей: ровная сетка строк «Название · код» + профиль мелко */
.tpl-level { margin: var(--s3) 0 var(--s1); font-size: 16px; }
.tpl-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s1); margin: 0; padding: 0; list-style: none; }
.tpl-item { display: flex; flex-direction: column; justify-content: center; min-height: 56px; height: 100%; padding: var(--s1) var(--s2); border: 1px solid var(--line);
            color: var(--black); text-decoration: none; }
.tpl-item:hover, .tpl-item:focus-visible { border-color: var(--black); background: var(--block); }
.tpl-name { font-size: 15px; line-height: 1.3; }
.tpl-profile { color: var(--muted); font-size: 13px; }
@media (min-width: 600px) { .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .tpl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.head-actions { margin: 0 0 var(--s3); }
@media (min-width: 600px) { .head-actions { display: flex; flex-wrap: wrap; } .head-actions > * { width: auto; } }

/* ===================== Реестр «Тестирования» (этап 7.1) ===================== */
.registry-filters { margin: 0 0 var(--s2); }
.registry-filters .search-field { display: block; margin: 0 0 var(--s1); }
.registry-filters .search-field input { margin: 0; }
.registry-filters .list-bar { margin-top: var(--s2); }
.js-more-panel[hidden] { display: none; }
.registry-filters .more-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s2); padding: var(--s2); background: var(--block); }
.registry-filters .more-grid .field { margin: 0; }
.more-filters > summary { list-style: none; }
.more-filters > summary::-webkit-details-marker { display: none; }
.more-filters[open] { display: contents; }
.caret { display: inline-block; transition: transform .15s; }
.more-filters[open] .caret { transform: rotate(180deg); }
.list-bar { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--s2); min-height: var(--tap); margin: 0 0 var(--s2); }
.list-bar > p { display: flex; align-items: center; min-height: var(--tap); margin: 0; white-space: nowrap; }
.list-bar label { margin: 0; }
.list-bar select { margin: 0; }
.registry-dynamic.is-loading .registry-list, .registry-dynamic.is-loading .empty { opacity: .5; transition: opacity .15s .15s; }
p.empty { margin: var(--s3) 0; }
tr.is-practice td { background: #F7F7F7; color: var(--dark-grey); }
tr.is-practice td a { color: var(--dark-grey); }
.rtable td.rt-actions { white-space: nowrap; }
@media (min-width: 600px) {
    .registry-filters .ui-col { display: flex; flex-wrap: wrap; align-items: stretch; }
    .registry-filters .ui-col > * { width: auto; }
    .registry-filters .search-field { flex: 1 1 100%; max-width: 560px; }
    .registry-filters .ui-col > .seg { display: inline-grid; width: auto; }
    .registry-filters .ui-col select { width: 260px; }
    .registry-filters .more-filters[open] .more-grid { flex: 1 1 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .registry-filters .list-bar { grid-template-columns: auto; }
}
.attention-head { margin: var(--s3) 0 var(--s2); }
.attention-head .seg { width: 100%; }
@media (min-width: 600px) { .attention-head .seg { width: auto; } }
.attention-head h2 { margin: 0; }
.attention { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.attention-block { padding: 10px 14px; border-left: 3px solid var(--black); background: var(--block); }
.attention-block.is-alert { border-left-color: var(--red); }
.attention-block h3 { margin: 0 0 6px; font-size: 16px; }
.attention-block ul { margin: 0 0 4px; padding-left: 18px; }
.attention-block li { margin-bottom: 4px; }
.attention-block p { margin: 4px 0 0; }
.attention-count { display: inline-block; min-width: 26px; padding: 0 6px; background: var(--black); color: var(--white); text-align: center; font-size: 14px; }
.is-alert .attention-count { background: var(--red); }
.person h2, .assessment h2 { margin: var(--s4) 0 var(--s2); padding-top: var(--s2); border-top: 1px solid var(--line); }
.assessment > .kcard-tags { margin: 0 0 var(--s1); }
.person > h1 { margin-bottom: var(--s1); }
.person-position { margin: 0 0 var(--s1); font-size: 17px; }
.section-action { margin: 0 0 var(--s2); }
.form-narrow { max-width: 420px; }
.field.field-first { margin-top: 0; }
.position-form fieldset.sliders { margin-top: var(--s2); }
.form-wide { max-width: 560px; }
.ui-col > .mode-new, .ui-col > .mode-existing { margin: 0; }
.mode-new > .field:first-child, .mode-existing > .field:first-child { margin-top: var(--s1); } /* + промежуток 8 = 16 над подписью */
.mode-existing .search-results { margin: 0; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--s2); }
.form-grid > .field:first-of-type { margin-top: 0; }
.form-grid > .field > input, .form-grid > .field > select { width: 100%; }
.form-submit { grid-column: 1 / -1; margin-top: var(--s2); }
.ui-col > .form-submit { margin-top: 0; }
@media (max-width: 599.98px) { .form-submit > button, .form-submit > .button { width: 100%; } } /* на телефоне кнопка формы — во всю ширину колонки */
.access-list { margin: 0 0 var(--s2); }
.access-grant { margin-top: var(--s2); }
.danger-block { margin-top: var(--s4); padding-top: var(--s2); border-top: 1px solid var(--line); }
.danger-block > summary { list-style: none; }
.danger-block > summary::-webkit-details-marker { display: none; }
.danger-block[open] .caret { transform: rotate(180deg); }
.danger-block > p { margin: var(--s2) 0; color: var(--dark-grey); font-size: 15px; }
@media (min-width: 600px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-grid > .field:nth-of-type(2) { margin-top: 0; } .danger-block > summary, .danger-block .button { width: auto; display: inline-flex; } }
@media (min-width: 900px) { .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .form-grid > .field:nth-of-type(3) { margin-top: 0; } }
/* A7 Сравнение (этап 7.1): легенда над графиком — строки 44 px (цвет, маркер, номер, ФИО), касание выделяет человека */
.compare-controls { margin: 0 0 var(--s3); }
.compare-controls form { margin: 0; }
.compare-controls label { margin: 0; }
.cmp-legend { list-style: none; margin: 0 0 var(--s2); padding: 0; }
.cmp-legend li { margin: 0; }
.cmp-person, .cmp-target { display: flex; align-items: center; gap: var(--s1); width: 100%; min-height: var(--tap); margin: 0; padding: 0 var(--s1);
                           border: 0; background: none; color: var(--black); font-size: 15px; font-weight: 400; text-align: left; }
.cmp-person, .cmp-target { padding: 0; } /* строки легенды — от общей левой линии */
.cmp-person:hover { background: var(--block); }
.cmp-person[aria-pressed="true"] { background: var(--block); font-weight: 700; }
.cmp-person.is-dim { color: var(--muted); }
.cmp-legend svg { flex: none; }
.cmp-n { flex: none; width: 1.4em; font-weight: 700; }
.cmp-name { min-width: 0; }
.cmp-target { color: var(--dark-grey); }
.compare-chart .radar-box { padding-top: 0; }
.compare-chart .radar-scale { margin: 0 0 var(--s2); text-align: center; color: var(--muted); font-size: 14px; }
table.cmp-table { margin: 0 0 var(--s1); }
table.cmp-table th, table.cmp-table td { padding: var(--s1) 6px; }
table.cmp-table td:first-child, table.cmp-table th:first-child { min-width: 0; }
.cmp-who a { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); text-decoration: none; font-weight: 700; }
.cmp-delta { display: block; font-size: 12px; color: var(--muted); }
.cmp-delta.fit-excess, .cmp-delta.fit-deficit { color: var(--black); font-weight: 700; }
/* Задача B: критичное расхождение — балл красным и жирным (жирный различим и без цвета); «равнозначны» — над таблицей */
td.cmp-critical { color: var(--red); font-weight: 700; }
.cmp-critical-note b { color: var(--red); }
.cmp-equal { margin: 0 0 var(--s1); }
.compare-chart > .button.block { margin-top: var(--s2); }
.compare-diff { margin-top: var(--s3); }
@media (min-width: 900px) {
    .compare-controls { display: grid; grid-template-columns: minmax(0, 360px) auto; align-items: end; justify-content: start; gap: var(--s2); }
    .compare-chart { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 0 var(--s4); align-items: start; }
    .compare-chart > .cmp-legend, .compare-chart > .radar-box, .compare-chart > .radar-scale { grid-column: 1; }
    .compare-chart > .table-wrap, .compare-chart > p.muted, .compare-chart > .button.block { grid-column: 2; }
    .compare-chart > .table-wrap { grid-row: 1 / span 2; }
    .compare-chart > .button.block { justify-self: start; width: auto; }
}
.differences { margin: 0; padding: 0; list-style: none; }
.differences li { margin-bottom: var(--s1); padding-left: var(--s2); border-left: 3px solid var(--line); }
.differences li.notable { border-left-color: var(--black); }
.differences li.notable b { color: var(--black); }
details.guide { margin: -6px 0 12px; font-size: 14px; }
details.guide summary { display: flex; align-items: center; min-height: var(--tap); cursor: pointer; color: var(--dark-grey); }
details.guide p { margin: 0 0 6px; padding: 8px 10px; background: var(--white); }
.profile-diff { margin: 0 0 16px; }
.profile-diff p { margin: 0 0 8px; }
table.diff-table { width: auto; margin: 0 0 8px; background: var(--white); }
table.diff-table td, table.diff-table th { padding: 4px 8px; }
table.diff-table td:first-child { min-width: 0; }
.template-form { align-items: flex-end; }
.template-form label { flex: 1; margin: 0; }

dl.facts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin: 0 0 20px; }
dl.facts dt { color: var(--muted); font-size: 14px; }
dl.facts dd { margin: 0 0 8px; }

/* A8: ползунки и радар */
.slider-row { display: grid; grid-template-columns: minmax(0, 1fr) 76px; grid-template-areas: "label num" "range range";
              align-items: center; gap: 4px 12px; margin-bottom: 12px; clear: both; }
.slider-row label { grid-area: label; margin: 0; }
.slider-row input[type=range] { grid-area: range; width: 100%; min-height: var(--tap); margin: 0; padding: 0; border: 0;
                                background: none; accent-color: var(--black); }
.slider-row .slider-num { grid-area: num; margin: 0; text-align: right; }
.sum-line { margin: 12px 0 0; }
/* Радар: Chart.js подстраивается под ширину .radar-box (квадрат), поэтому размер задаёт только контейнер */
.radar-box { position: relative; width: 100%; max-width: 360px; margin: 0 auto; padding: 8px 0 16px; }
.radar-box canvas { display: block; }

/* A4 */
.segmented { display: flex; flex-direction: column; margin-bottom: 20px; }
.segmented label { display: flex; align-items: center; gap: 10px; min-height: var(--tap); margin: 0; padding: 8px 14px;
                   border: 1px solid var(--black); cursor: pointer; }
.segmented label + label { border-top: 0; }
.search-results { list-style: none; margin: -8px 0 12px; padding: 0; border: 1px solid var(--line); max-width: 560px; }
.search-results:empty { display: none; }
.search-results li { padding: 0; }
.search-results li.muted { padding: 10px 12px; }
.search-results li button { width: 100%; justify-content: flex-start; border: 0; border-bottom: 1px solid var(--line); font-weight: 400; text-align: left; }
.selected { font-weight: 700; }
.copy-status { display: block; margin-top: 6px; color: var(--muted); }
.copy-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }

/* A6 Отчёт: сначала телефон (руководитель смотрит с телефона) */
.report { max-width: 1000px; }
.eyebrow { margin: 0 0 4px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.report-head h1 { margin: 0 0 6px; }
.report-meta { display: flex; flex-wrap: wrap; gap: 2px 0; margin: 0 0 16px; color: var(--dark-grey); font-size: 15px; }
.report-meta span:not(:last-child)::after { content: "·"; margin: 0 8px; color: var(--muted); }
.report-meta span:first-child { color: var(--black); font-weight: 700; }
.pdf-bar { margin: 0 0 var(--s2); }
.pdf-bar .pdf-state { margin: var(--s1) 0 0; }
@media (min-width: 600px) { .pdf-bar .ui-pair, .pdf-bar .ui-col { display: inline-grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: minmax(180px, auto); } }
.pdf-state { font-size: 14px; }
.pdf-bar .pdf-stale { padding: 10px 14px; border-left: 3px solid var(--black); background: var(--block); }
/* Версии PDF (задача A): свёрнутый список, «Сформировать заново» — под таблицей */
.pdf-history { margin: var(--s3) 0 var(--s2); } /* внизу отчёта, свёрнутым (08.10.2026) */
.pdf-history > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
.pdf-history .table-wrap { margin: var(--s1) 0 0; }
.pdf-history .pdf-regen { margin: var(--s2) 0 0; }
.pdf-history .pdf-regen form { margin: 0; }
/* Короткое окно-вопрос: на телефоне — снизу по высоте содержимого, на ПК — узкое по центру */
dialog.sheet.compact { height: fit-content; margin: auto 0 0; }  /* у модального окна top и bottom = 0: auto растянул бы его на весь экран */
dialog.sheet.compact p { margin: var(--s2) 0; }
dialog.sheet.compact form[method="dialog"] { margin: 0; }
@media (min-width: 600px) { dialog.sheet.compact { width: min(480px, calc(100% - 64px)); margin: auto; } }
.flag-warning { margin: 0 0 12px; }
.flag-warning p { margin: 0 0 6px; }
.flag-warning .flag-title { font-weight: 700; }
.toc { margin: 8px 0 24px; padding: 8px 16px; background: var(--block); }
.toc-title { margin: 0 0 4px; font-weight: 700; }
.toc ol { margin: 0; padding-left: 22px; }
.toc a { display: inline-flex; align-items: center; min-height: var(--tap); }
.report-section { padding-top: 8px; border-top: 2px solid var(--black); margin-bottom: 32px; scroll-margin-top: 8px; }
/* Страница решения (этап 7.2): первый блок отчёта — код и тип, индекс и расхождения, достоверность, вопросы, риски */
.decision { margin: 0 0 var(--s3); padding: var(--s2); border: 2px solid var(--black); }
.decision > h2 { margin: 0 0 var(--s2); font-size: 22px; }
.decision-head { display: flex; align-items: center; gap: var(--s2); }
.decision-head .mini-radar { flex: none; }
.decision-code { margin: 0; font-size: 30px; font-weight: 800; line-height: 1.25; }
.decision-type { margin: var(--s1) 0 0; }
.decision-block { margin-top: var(--s2); padding-top: var(--s2); border-top: 1px solid var(--line); }
.decision-block h3 { margin: 0 0 var(--s1); font-size: 18px; }
.decision-block h4 { margin: var(--s2) 0 4px; font-size: 15px; }
/* Заголовок группы вопросов (09.10.2026): две строки у всех групп — роль и статус мельче приглушённым; без переноса внутри строки,
   поэтому высота одинаковая на 360 px и на ПК */
.decision-qhead span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.decision-qrole { font-size: 15px; font-weight: 700; line-height: 22px; }
.decision-qstatus { font-size: 13px; font-weight: 400; line-height: 18px; color: var(--muted); }
/* Статус раздела AI под «Что проверить на интервью» (09.10.2026): на ПК — строка и действие рядом; на телефоне кнопка — своей
   строкой во всю ширину (44 px), строка статуса не делится кнопкой */
.decision-ai { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s2); margin: 0 0 var(--s1); }
.decision-block .decision-ai-text { margin: 0; font-size: 14px; line-height: 20px; color: var(--dark-grey); }
.decision-block .decision-ai-note { margin: 0; }
.decision-ai-act { margin: 0; }
.decision-ai-act button.decision-ai-link { font-size: 14px; font-weight: 600; padding: 0 var(--s1); } /* ссылка мелко, зона касания 44 px */
@media (max-width: 599px) {
    .decision-ai { display: block; }
    .decision-ai-act { margin-top: var(--s1); }
    .decision-ai-act button.dark { width: 100%; }
}
.decision-block p { margin: 0 0 var(--s1); }
.decision-block p.decision-note { margin-top: var(--s1); } /* «Полный список рисков — в разделе AI»: 8 px от списка */
.decision-index { font-size: 18px; }
.decision-index b { font-size: 24px; }
.decision-list { margin: 0; padding-left: 20px; }
.decision-list li + li { margin-top: 4px; }
.decision-questions ol { margin: 0; padding-left: 24px; }
.decision-questions li + li { margin-top: var(--s1); }
.decision-hint { display: block; margin-top: 2px; font-size: 14px; color: var(--muted); }
div.decision-hint { margin: 6px 0 0 24px; }
div.decision-hint p { margin: 0 0 2px; }
.decision-footer { margin: var(--s2) 0 0; padding: 10px 14px; border-left: 3px solid var(--black); background: var(--block); font-weight: 700; }
/* «Помогло ли заключение…» (этап 7.2) */
.feedback-form textarea { width: 100%; }
/* этап 8.2: оценка в конце «Главное для решения» — пять кнопок одной строкой (44 px), после оценки — «Изменить оценку» */
.decision-feedback { margin-top: var(--s3); padding-top: var(--s2); border-top: 1px solid var(--line); }
.decision-feedback h3 { margin-top: 0; }
.feedback-scale { max-width: 360px; }
.feedback-legend { margin: 6px 0 0; }
.feedback-thanks { margin: var(--s1) 0 var(--s2); }
.feedback-date { display: block; margin-top: 2px; }
.feedback-edit > summary { list-style: none; }
.feedback-edit > summary::-webkit-details-marker { display: none; }
.feedback-edit[open] > summary { margin-bottom: var(--s2); }
@media (min-width: 600px) { .feedback-edit > summary, .decision-feedback .feedback-form > button { width: auto; display: inline-flex; } }
.report-section h2 { margin: 8px 0 16px; font-size: 22px; }
.sec-num { color: var(--red); }
.report-section h3 { margin: 20px 0 8px; font-size: 18px; }
.report-section h4 { margin: 16px 0 6px; font-size: 16px; }
.report-section ul { padding-left: 20px; }
.report-section li { margin-bottom: 4px; }
.report-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px 32px; align-items: start; margin-bottom: 8px; }
.radar-figure { margin: 0 0 16px; }
.radar-figure .radar-box { padding: 0 0 8px; }
.radar-figure figcaption { max-width: 360px; margin: 0 auto; font-size: 14px; }
.radar-scale { display: block; margin-top: 4px; color: var(--muted); }
.code-line { margin: 0 0 12px; font-size: 15px; color: var(--muted); }
.big-code { margin-left: 8px; font-size: 34px; color: var(--black); }
.scores { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; list-style: none; margin: 0 0 16px; padding: 0; }
.scores li { margin: 0; padding: 8px 4px; border: 1px solid var(--line); text-align: center; }
.scores li.is-high { border-color: var(--red); border-width: 2px; }
.scores li.is-low { color: var(--muted); }
.score-letter { display: block; font-weight: 800; font-size: 15px; }
.score-value { display: block; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.type-block { padding: 4px 16px 8px; background: var(--block); }
.radar-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; }
.radar-legend .lg { display: inline-flex; align-items: center; gap: 8px; }
.lg-person, .lg-target, .lg-mid { flex: none; display: inline-block; width: 22px; height: 0; border-top: 3px solid var(--red); }
.lg-target { border-top: 2px dashed var(--black); }
.lg-mid { border-top: 2px dashed var(--muted); }
.fit { white-space: nowrap; }
.fit-match { font-weight: 400; }
.fit-excess, .fit-deficit { font-weight: 700; }
.fit-note { margin: 4px 0 8px; font-size: 14px; }
.letter-group + .letter-group { margin-top: 24px; }
.lib-block p { margin: 0 0 10px; }
.llm-alert { margin: 0 0 16px; }
.llm-alert p { margin: 0 0 4px; }
.ai-state { margin: 0 0 16px; }
.alert.ai-state p { margin: 0 0 4px; }
.ai-summary { margin: 0 0 8px; padding: 10px 14px; background: var(--block); }
.ai-risk p, .ai-questions p { margin: 0 0 6px; }
.ai-label { color: var(--dark-grey); font-weight: 700; }
.ai-questions { padding-left: 22px; }
.ai-questions li { margin-bottom: 14px; }
.ai-q { font-weight: 700; }
.ai-note { margin: 16px 0 0; }
.ai-actions { margin-top: 16px; }
.ai-actions p { margin: 6px 0 0; }
.ai-settings .grid-3 { margin-top: 8px; }
dl.ai-facts { margin-top: 24px; }
.inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 8px; }
.prompt-text { min-height: 320px; line-height: 1.45; }
.ai-test-body { margin-top: 0; border-top: 0; }
.month-nav { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.month-nav .button { width: var(--tap); padding: 0; }
.alert-text { color: var(--red); font-weight: 700; }
.response-text { margin: 0; padding: 12px; background: var(--block); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.role-note { margin: 0 0 12px; }

/* ---------- Зона респондента (телефон от 360 px) ---------- */
body.public { background: var(--white); }
.public-header { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.public-main { max-width: 640px; margin: 0 auto; padding: 16px 16px 32px; }
.r-screen h1 { font-size: 22px; }
.r-center { text-align: center; padding-top: 24px; }
.lead { font-size: 17px; }
.meta-line { margin: 0 0 8px; font-size: 15px; color: var(--dark-grey); }
.r-screen h2 { margin: 16px 0 6px; }
.consent-form { margin-top: 16px; }
/* этап 8.2: текст согласия юриста (краткий — на R1, полный — своей страницей) */
.consent-short { padding: 12px 14px; border: 1px solid var(--line); background: #FAFAFA; font-size: 15px; line-height: 1.5; }
.consent-short p { margin: 0 0 10px; }
.consent-short p:last-child { margin-bottom: 0; }
label.check a { text-decoration: underline; }
.consent-full-text { font-size: 15px; line-height: 1.55; }
.consent-full-text p { margin: 0 0 12px; overflow-wrap: anywhere; }
.consent-full .button { margin-top: 16px; }


.consent-text { margin: 0 0 16px; border: 1px solid var(--line); }
.consent-text summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--tap); padding: 8px 12px; cursor: pointer; font-weight: 700; list-style: none; }
.consent-text summary::-webkit-details-marker { display: none; }
.consent-text summary::after { content: "▾"; flex: none; font-size: 18px; transition: transform .15s; }
.consent-text[open] summary::after { transform: rotate(180deg); }
.consent-body { padding: 0 12px 12px; font-size: 14px; }
label.check { -webkit-tap-highlight-color: transparent; display: flex; align-items: flex-start; gap: 12px; min-height: var(--tap); padding: 10px 0; cursor: pointer; }
label.check input { margin-top: 1px; flex: none; }

.q-progress { margin-bottom: 16px; }
.q-counter { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 700; }
progress { display: block; width: 100%; height: 6px; border: 0; background: var(--line); -webkit-appearance: none; appearance: none; }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--red); }
progress::-moz-progress-bar { background: var(--red); }
.q-head { display: flex; align-items: flex-start; gap: 12px; }
.q-text { flex: 1; margin: 0 0 12px; font-size: 20px; }
.hint-toggle { flex: none; width: var(--tap); height: var(--tap); min-height: 0; padding: 0; border-radius: 50%; font-weight: 800; }
.hint-toggle[aria-expanded="true"] { background: var(--black); color: var(--white); }
.hint-text { margin: 0 0 12px; padding: 10px 12px; border-left: 3px solid var(--black); background: var(--block); font-size: 15px; }

.rank-label { margin: 8px 0 6px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cards { list-style: none; margin: 0; padding: 0; }
.opt { display: flex; align-items: center; gap: 8px; min-height: 64px; margin-bottom: 8px; padding: 6px 6px 6px 10px;
       border: 1px solid var(--black); background: var(--white); cursor: grab; user-select: none; -webkit-user-select: none;
       -webkit-touch-callout: none; }
/* Ручка ⋮⋮: на сенсорном экране тянем только за неё и сразу (touch-action: none), остальная карточка прокручивает страницу */
.opt .grip { flex: none; display: flex; align-items: center; justify-content: center; width: var(--tap); height: var(--tap);
             margin-left: -4px; background: var(--block); color: var(--dark-grey); font-size: 22px; font-weight: 800;
             letter-spacing: -4px; line-height: 1; cursor: grab; touch-action: none; }
.opt .grip:active { background: var(--line); color: var(--black); cursor: grabbing; }
@media (pointer: coarse) { .opt { cursor: default; } }
.drag-tip { margin: -4px 0 0; font-weight: 700; }
.grip-icon { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 2px; font-size: 20px; line-height: 1;
             background: var(--block); color: var(--dark-grey); font-weight: 800; letter-spacing: -3px; vertical-align: middle; }
.opt-text { flex: 1; min-width: 0; font-size: 16px; line-height: 1.35; }
.moves { display: flex; flex: none; gap: 2px; }
.move { width: var(--tap); padding: 0; font-size: 18px; }
.move:disabled { opacity: .25; }
.opt-chosen { border-color: var(--red); }
.opt-ghost { opacity: .35; background: var(--block); }
.opt-drag { box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.opt.moved { animation: moved .5s ease-out; }
@keyframes moved { from { background: var(--block); } to { background: var(--white); } }
.js-next { margin-top: 16px; }
.done-mark { width: 64px; height: 64px; margin: 0 auto 16px; border: 2px solid var(--black); border-radius: 50%;
             font-size: 32px; line-height: 60px; text-align: center; }

/* ---------- Общий компонент data_table: на телефоне строка = карточка ---------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 599.98px) {
    /* карточка — как .kcard (этап 7.1): рамка, отступ 16, сетка «подпись — значение» с одной колонкой подписей, кнопки внизу в ряд */
    .rtable, .rtable tbody { display: block; }
    .rtable thead { display: none; }
    .rtable tr { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s2); margin-bottom: var(--s2); padding: var(--s2);
                 border: 1px solid var(--line); background: var(--white); }
    .rtable tr.inactive { color: var(--muted); }
    .rtable td { display: block; padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; }
    .rtable td.rt-main { flex: 1 1 100%; font-size: 17px; font-weight: 700; line-height: 1.3; }
    .rtable td.rt-main a { text-decoration: none; }
    .rtable td.rt-field { flex: 1 1 100%; display: grid; grid-template-columns: var(--label-w, 120px) minmax(0, 1fr); gap: var(--s2); font-size: 15px; }
    .rtable td.rt-field::before { content: attr(data-label); color: var(--muted); overflow-wrap: normal; }
    .rtable td.rt-inline { flex: none; font-size: 15px; white-space: nowrap; }
    .rtable td.rt-inline.num::before { content: attr(data-label) " "; color: var(--muted); }
    .rtable td.rt-actions { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: var(--s1); text-align: left; white-space: normal; }
    .rtable td.rt-actions > * { flex: 1 1 0; min-width: 0; }
    /* пара кнопок и пояснение — каждое своей строкой во всю ширину: пояснение не делит ряд с кнопками */
    .rtable td.rt-actions > .ui-pair, .rtable td.rt-actions > .cell-note { flex: 1 1 100%; }
    .rtable td.rt-actions > .row-menu { flex: none; }
    .rtable td.rt-actions > form { display: flex; }
    .rtable td.rt-actions > form > button { width: 100%; }
    .rtable td.rt-actions .ui-pair { min-width: 0; width: 100%; }
    .rtable td.rt-check { order: -1; flex: none; width: auto; }
    .rtable td.rt-check + td.rt-main { flex: 1 1 0; }
    .rtable td.rt-inline .mini-radar { margin: -4px 0; }
    .rtable td .cell-note { display: block; }
    .rtable td.rt-field .rt-value { min-width: 0; }
    /* пустые ячейки (нет результата, нет галочки) на карточке не показываются */
    .rtable td.rt-check:empty, .rtable td.rt-inline:empty, .rtable td:has(> .na:only-child), .rtable td.rt-actions:empty { display: none; }
    .rtable tr.is-practice { background: #F7F7F7; }
    .rtable tr.is-practice td { background: none; }
    .rtable td:first-child { min-width: 0; }
    .table-wrap { overflow: visible; }
}
/* ---------- Шире телефона ---------- */
@media (min-width: 600px) {
    .row-form { flex-direction: row; }
    .segmented { flex-direction: row; flex-wrap: wrap; }
    .segmented label + label { border-top: 1px solid var(--black); border-left: 0; }
    .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .filter-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-form .f-wide { grid-column: 1 / -1; }
    .more-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .attention { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    dl.facts { grid-template-columns: 160px minmax(0, 1fr); gap: 6px 16px; }
    dl.facts dd { margin: 0; }
    .slider-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 76px; grid-template-areas: "label range num"; }
    h1 { font-size: 26px; }
    .r-screen h1 { font-size: 24px; }
}

@media (min-width: 900px) {
    .topbar { padding: 10px 24px; }
    .product { font-size: 18px; }
    .menu-toggle { display: none; }
    .usernav { display: flex; align-items: center; gap: 18px; font-size: 14px; }
    .shell.with-menu { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
    .sidemenu { display: block; min-height: calc(100vh - 61px); padding: 24px 0; border-bottom: 0; border-right: 1px solid var(--line); }
    .sidemenu a { padding: 8px 24px; }
    .menu-user { display: none; }
    .content { padding: 24px; }
    .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
    .card.narrow { margin: 40px auto; }
    .report-grid { grid-template-columns: 360px minmax(0, 1fr); }
    .filter-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .more-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .search-field { max-width: 560px; }
    .report-grid .radar-box, .report-grid .radar-figure figcaption { margin: 0; }
}

/* --- Этап 8.2: A14 «Пользователи» */
.temp-password { font-family: Consolas, "Courier New", monospace; font-size: 18px; letter-spacing: .06em; overflow-wrap: anywhere; }
.user-actions { margin-top: var(--s2); }
.user-actions form + form { margin-top: var(--s1); }
.feedback-filter { margin: var(--s2) 0 var(--s3); max-width: 440px; }
.no-break { white-space: nowrap; }
.consent-admin { margin-top: var(--s3); max-width: 760px; }
.consent-preview-check { margin: var(--s2) 0 0; font-size: 15px; }

/* --- Справка (файл 24): оглавление слева (ПК — закреплено, телефон — раскрывающийся список), колонка текста ≤ 760 px,
       разделы — карточки с номером, снимки во всю ширину колонки, блок «Важно», таблицы (на телефоне — карточки) */
.help-docs { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s2); max-width: 900px; }
.help-docs .kcard + .kcard { margin-top: 0; }
.help-docs .kcard-actions { margin-top: var(--s2); }
.help-top h1 { margin-bottom: var(--s1); }
.help-actions { margin-bottom: var(--s3); }
.help-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
.help-toc ol { margin: 0; padding: 0; list-style: none; }
.help-toc li a { display: flex; gap: var(--s1); align-items: baseline; min-height: var(--tap); padding: 10px var(--s1); border-left: 3px solid transparent;
                 color: var(--black); text-decoration: none; line-height: 1.3; font-size: 15px; }
.help-toc li a.active { border-left-color: var(--red); font-weight: 700; }
.help-toc .help-num { flex: none; min-width: 32px; color: var(--muted); font-variant-numeric: tabular-nums; }
.help-toc-mobile > summary { list-style: none; justify-content: space-between; }
.help-toc-mobile > summary::-webkit-details-marker { display: none; }
.help-toc-mobile[open] > summary .caret { transform: rotate(180deg); }
.help-toc-mobile > ol { margin-top: var(--s1); border: 1px solid var(--line); }
.help-toc-desktop { display: none; }
.help-body { min-width: 0; max-width: 760px; }
.help-sec { margin: 0 0 var(--s3); padding: var(--s2); border: 1px solid var(--line); scroll-margin-top: var(--s2); }
.help-h { display: flex; gap: var(--s1); align-items: baseline; margin: 0 0 var(--s2); font-size: 19px; }
.help-h .help-num { color: var(--red); font-weight: 800; }
.help-sec p, .help-sec ul, .help-sec ol { margin: 0 0 var(--s2); }
.help-sec ul, .help-sec ol { padding-left: 22px; }
.help-sec li + li { margin-top: 4px; }
.help-important { margin: 0 0 var(--s2); padding: 12px var(--s2); border-left: 3px solid var(--red); background: var(--block); }
.help-important p:last-child { margin-bottom: 0; }
.help-shot { margin: 0 0 var(--s2); }
.help-shot a { display: block; }
.help-shot img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
.help-shot figcaption { margin-top: 6px; color: var(--dark-grey); font-size: 14px; }
.help-shot-missing { padding: var(--s3) var(--s2); border: 1px dashed var(--light-grey); color: var(--dark-grey); text-align: center; font-size: 14px; }
.help-table-wrap { margin: 0 0 var(--s2); }
.help-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.help-table th { text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--black); vertical-align: bottom; }
.help-sec del { color: var(--dark-grey); }
.help-version { margin: 0; }
@media (max-width: 599.98px) {
    /* таблица на телефоне — карточки: подпись столбца над значением */
    .help-table thead { display: none; }
    .help-table, .help-table tbody, .help-table tr, .help-table td { display: block; width: 100%; }
    .help-table tr { padding: var(--s1) 0; border-bottom: 1px solid var(--line); }
    .help-table td { padding: 4px 0; border: 0; }
    .help-table td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 13px; }
    .help-sec { padding: var(--s2) 12px; }
}
@media (min-width: 600px) { .help-docs { grid-template-columns: repeat(2, minmax(0, 1fr)); } .help-actions .button { width: auto; } }
@media (min-width: 1100px) {
    .help-layout { grid-template-columns: 260px minmax(0, 760px); }
    .help-toc { position: sticky; top: var(--s2); align-self: start; max-height: calc(100vh - var(--s4)); overflow-y: auto; }
    .help-toc-mobile { display: none; }
    .help-toc-desktop { display: block; }
}

/* --- Экран первого входа (файл 24, 5.3) */
.welcome { max-width: 640px; }
.welcome-steps { display: grid; gap: var(--s1); margin: 0 0 var(--s3); padding: 0; list-style: none; }
.welcome-step { display: flex; align-items: center; gap: 12px; padding: var(--s2); border: 1px solid var(--line); font-weight: 700; line-height: 1.35; }
.welcome-icon { flex: none; color: var(--black); }
.welcome-n { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: var(--black); color: var(--white); font-size: 14px; }
.welcome-actions { margin-top: var(--s3); }
.welcome-actions .button.primary { width: 100%; }
.help-link { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--dark-grey); font-size: 14px; }
.help-link:hover { color: var(--black); }
.help-shot.phone img { max-width: 360px; margin: 0 auto; }
.help-shot.phone figcaption { text-align: center; }
