/* Полоса меню и меню профиля — одни и те же в `/klar` и `/app` (задача #5476). Пункты полосы — только
   иконки: их подписей нет ни в одном состоянии, ширина полосы не меняется (задача 19.10). Надпись
   логотипа в полосе скрыта; выпадающую плашку меню рисует `klar-ui.css`, из своего здесь — снятие
   подсветки пункта после Escape (`.rail-hover-off`). Палитра полосы
   задана на самой полосе и её потомках значениями `klar.html` — тема страниц `/app` (`klar-theme.css` ставит
   палитру на каждый элемент через `*`) не меняет вид меню. */
:root { --rail-w: 64px; }
.rail, .rail * { --rail-bg: #0E141B; --text: #FFFFFF; --text2: rgba(255,255,255,0.62); --text3: #FFFFFF; --line: rgba(255,255,255,0.08);
  --panel-2: #2A3746; --icon-off: #6E767F; --risk: #E5484D; --shadow: rgba(0,0,0,.45);
  --hover: rgba(255,255,255,0.05); --on: rgba(255,255,255,0.07); --hover-strong: rgba(255,255,255,0.08); }
.rail { color: var(--text); }
:root[data-theme="light"] .rail, :root[data-theme="light"] .rail * { --rail-bg: #FFFFFF; --text: #1C2530; --text2: rgba(28,37,48,0.72); --text3: rgba(28,37,48,0.68);
  --line: rgba(28,37,48,0.12); --panel-2: #E9ECF0; --shadow: rgba(28,37,48,.16);
  --hover: rgba(28,37,48,0.05); --on: rgba(28,37,48,0.07); --hover-strong: rgba(28,37,48,0.08); }
/* Правый край светлой полосы — вставная тень, а не border: он не отнимает 1px у пунктов. */
:root[data-theme="light"] .rail { box-shadow: inset -1px 0 0 var(--line); }
/* ---------- Полоса меню ---------- */
.rail { position: fixed; left: 0; top: 0; bottom: 0; width: var(--rail-w); background: var(--rail-bg);
  display: flex; flex-direction: column; z-index: 30; }
/* Ширина полосы — всегда `--rail-w`: ни наведение, ни фокус, ни щелчок её не меняют. Классы `.open`/`.shut`
   остались состоянием клавиатурного хода (`klar/keys.js`), но вида не меняют: подписи не показываются.
   Строка логотипа шире полосы на надпись (`.name`): `width: max-content` и её фон `--rail-bg` держат
   марку и надпись на фоне полосы, а не на фоне страницы, в которую надпись выступает. */
.brand { height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 16px; flex: none;
  width: var(--rail-w); background: var(--rail-bg); }
/* Полоса не меняет ширину ни в одном состоянии: её вид задают иконки и выпадающая плашка. */
.brand svg { width: 28px; height: 28px; flex: none; }
.brand .frag { fill: var(--frag); }
/* Подпись логотипа в полосе скрыта: полоса — только иконки (Роман 19.10). */
.brand .name { display: none; font-weight: 700; font-size: 27.6px; letter-spacing: .04em; line-height: 1; }
/* Верхний отступ у списка убран: первый пункт начинается ровно на 64px — там же, где кончается
   строка логотипа. */
.items { flex: 1; padding: 0 4px 4px; display: flex; flex-direction: column; gap: 2px; }
/* Иконка 24, строка 44: под 8px-подписью дизайна 08.11; полоса не раскрывается, пункты стоят на своих
   линиях. Нажатие остаётся 48 (разработчик 18.11.2026, DS-06): прозрачный слой `::after` выступает на
   2px выше и ниже строки — WCAG 2.5.8 требует 24×24, и запас не снижается. */
.item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 44px; padding: 3px 2px; border: none; border-radius: 8px; background: none; color: var(--text2);
  cursor: pointer; text-align: center; font-size: 14px; width: 100%; }
/* Слой нажатия вида не меняет: он только доводит область пункта до 48 px по высоте. */
.item::after { content: ''; position: absolute; inset: -2px 0; }
/* Иконки — файлы дизайнера; маска берёт форму файла, а цвет даёт `background-color` (в полосе — `--icon-off`,
   у активного пункта — `--text`), поэтому литерал цвета в SVG на полосе не виден. */
.ic { width: 24px; height: 24px; flex: none; background-color: var(--icon-off);
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
.ic-search { --ic: url('/static/img/icons/ui/search.svg'); } .ic-lists { --ic: url('/static/img/icons/ui/lists.svg'); }
.ic-checks { --ic: url('/static/img/icons/ui/checks.svg'); } .ic-recon { --ic: url('/static/img/icons/ui/recon.svg'); }
.ic-monitoring { --ic: url('/static/img/icons/ui/monitoring.svg'); } .ic-company { --ic: url('/static/img/icons/ui/company.svg'); }
/* Дом — значок строки пространства в меню профиля: то же место, где человек выбирает, где работать. */
.ic-home { --ic: url('/static/img/icons/ui/home.svg'); }
/* «Компания» на полосе — `contractors`: `company` читается как документ (Роман 20.10). Иконка нарисована
   мельче остальных (15×18 из 24 против 18×18 у «Проверок»/«Мониторинга»), поэтому маска шире — 28,8×24. */
.ic-contractors { --ic: url('/static/img/icons/ui/contractors.svg'); }
.ic-dialogs { --ic: url('/static/img/icons/ui/dialogs.svg'); } .ic-user { --ic: url('/static/img/icons/ui/user.svg'); }
.ic-eye { --ic: url('/static/img/icons/ui/eye.svg'); } .ic-eye-off { --ic: url('/static/img/icons/ui/eye-off.svg'); }
.ic-panels { --ic: url('/static/img/icons/ui/panels.svg'); } .ic-settings { --ic: url('/static/img/icons/ui/settings.svg'); }
.ic-theme-dark { --ic: url('/static/img/icons/ui/theme-dark.svg'); } .ic-theme-light { --ic: url('/static/img/icons/ui/theme-light.svg'); }
.ic-regulations { --ic: url('/static/img/icons/ui/regulations.svg'); } .ic-graph { --ic: url('/static/img/icons/ui/graph.svg'); }
/* Подпись пункта — всегда: Golos 8px, капсом, под иконкой (дизайн 08.11). Ширина полосы прежняя, 64px:
   подписи короткие, полное имя пункта остаётся в `aria-label` и в шапке раздела. */
.item .lbl { display: block; font-family: 'Golos Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 8px; line-height: 10px; font-weight: 500; letter-spacing: .02em; text-transform: uppercase;
  color: inherit; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* Одна активная строка на меню (решение 10.10): в режиме мыши подсвечено наведение, в режиме клавиатуры (`body.kbd`)
   — фокус, и курсор над меню скрыт, пока мышь не сдвинется (`keys.js`). */
body:not(.kbd) .item:hover, body.kbd .item:focus-visible { color: var(--text); background: var(--hover); }
/* Пункт кликается — фокус с клавиатуры виден кольцом, как у строк меню. */
.item:focus-visible { outline: 2px solid var(--accent-fill, #4C6FFF); outline-offset: -2px; border-radius: 8px; }
body:not(.kbd) .item:hover .ic, body.kbd .item:focus-visible .ic, .item.on .ic { background-color: var(--text); }
/* Escape снял наведение: пункт не подсвечивается, пока курсор не сойдёт с полосы или не войдёт в другой пункт.
   Текущий пункт (`.item.on`) свою отметку сохраняет. */
body:not(.kbd) .rail.rail-hover-off .item:not(.on):hover { color: var(--text2); background: none; }
body:not(.kbd) .rail.rail-hover-off .item:not(.on):hover .ic { background-color: var(--icon-off); }
.kbd .rail, .kbd .rail *, .kbd .cstrip, .kbd .cstrip * { cursor: none; }
/* Текущая страница помечена только полоской-отметкой (`::before`), без серой заливки: заливка
   остаётся за наведением (Роман, 20.10 — «отметку лучше оставить»). */
.item.on { color: var(--text); background: none; }
.item.on::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; background: var(--frag); }
/* Открытое меню подсвечивает свой пункт: пункт остаётся узнаваемым, пока меню открыто. */
body:not(.kbd) .rail .item.is-current { color: var(--text); background: var(--on); }
body:not(.kbd) .rail .item.is-current .ic { background-color: var(--text); }
/* Подсказка клавиш (решение 10.10, «2а»): мелко, серым; у полосы меню её место занимает плашка. */
.keys { color: var(--text3); font-size: 12px; letter-spacing: .06em; padding: 8px 10px 4px; white-space: nowrap; }
/* Подсказка клавиш — только у полосы разделов карточки, где она есть куда встать; у полосы меню её нет. */
.rail > .keys { display: none; padding: 6px 20px; }
/* Стрелки работают только там, где есть наведение (`keys.js`): на телефоне подсказки нет ни в одном меню. */
.cstrip-list .keys { display: none; }
@media (hover: hover) {
  .cstrip-list .keys { display: block; }
}
.rail .foot { position: relative; padding: 6px 4px 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; border-top: 1px solid var(--line); }
/* Кружок активных задач: только когда задачи есть (дизайн 08.11); при нуле пункта нет вовсе. */
.act-dot { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 40px; height: 40px; padding: 2px; }
.act-dot[hidden] { display: none; }
.act-dot .act-n { position: static; display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: var(--accent-fill, #4C6FFF);
  color: #fff; font-family: 'Golos Text', -apple-system, sans-serif; font-size: 11px; font-weight: 500;
  line-height: 1; font-variant-numeric: tabular-nums; }
/* Меню профиля — начинка той же плашки `.rail-panel` (задача #5476): своих фона, тени и места у него нет.
   Строки — `.rail-panel-row`; здесь только подменю и его стрелки. */
.profile-menu .pm-theme { display: flex; align-items: center; gap: 12px; }
.profile-menu .pm-theme .ic { width: 20px; height: 20px; background-color: var(--text2); }
.profile-menu .pm-open { display: flex; align-items: center; justify-content: flex-start; gap: 12px; }
.profile-menu .pm-open > .rail-panel-row-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-menu .pm-arrow { flex: none; margin-left: auto; color: var(--text2); font-size: 16px; line-height: 1; }
.profile-menu .pm-open[aria-expanded="true"] { background: var(--hover-strong); }
/* Подсветка строк меню профиля — ровно одна: в режиме мыши под курсором, в режиме клавиатуры (`body.kbd`)
   в фокусе, как у пунктов полосы. Программный `.focus()` (возврат из подменю, фокус после щелчка) в режиме
   мыши иначе оставлял вторую подсвеченную строку рядом с наведённой — Роман 20.10 видел «Профиль (…)» и
   «Тема» разом. Заливка и кольцо фокуса в мышином режиме молчат, в клавиатурном — показываются. */
body:not(.kbd) .profile-menu .rail-panel-row:focus-visible { outline: none; }
body:not(.kbd) .profile-menu .rail-panel-row:focus-visible:not(:hover),
body:not(.kbd) .profile-menu .pm-sub button:focus-visible:not(:hover) { background: none; }
body.kbd .profile-menu .rail-panel-row:hover:not(:focus-visible),
body.kbd .profile-menu .pm-sub button:hover:not(:focus-visible) { background: none; }
/* Меню раздела — те же строки и та же одна подсветка: в мышином режиме под курсором, в клавиатурном в фокусе. */
body:not(.kbd) .rail-panel.is-menu .rail-panel-row:focus-visible { outline: none; }
body:not(.kbd) .rail-panel.is-menu .rail-panel-row:focus-visible:not(:hover) { background: none; }
body.kbd .rail-panel.is-menu .rail-panel-row:hover:not(:focus-visible) { background: none; }
/* Подменю — вбок от меню, верхним краем вровень со своей строкой (первый пункт — на её уровне); у нижнего края окна
   поднимается на `--pm-lift`. Выбранный пункт — точкой акцента. На узком экране — вместо меню, со строкой «‹ Назад». */
.profile-menu .pm-anchor { position: relative; }
.profile-menu .pm-sub { display: none; position: absolute; left: calc(100% + 10px); top: -6px; min-width: 220px; max-height: 70vh;
  overflow-y: auto; padding: 6px; border-radius: 10px; background: var(--panel-2); z-index: 46;
  transform: translateY(calc(-1 * var(--pm-lift, 0px))); }
.profile-menu .pm-sub.open { display: block; }
.profile-menu .pm-back { display: none; color: var(--text2); padding: 7px 10px; }
/* Меню профиля: строка выбора с отметкой выбранного и счётчики-значки (вернул после отката режима
   «у курсора»: правка вырезала их вместе с чужим блоком). */
.profile-menu .pm-sub button:not(.pm-back) { display: block; width: 100%; text-align: left; background: none; border: none;
  color: var(--text); padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.profile-menu .pm-sub button:not(.pm-back):hover, .profile-menu .pm-sub button:not(.pm-back):focus-visible {
  background: var(--hover-strong); outline: none;
}
.profile-menu .pm-pick { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.profile-menu .pm-pick.on::after { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
/* Меню профиля по макету 20.10: плашка 324×238, пять строк по 40px, шапки и подписи нет. Строки идут на всю
   ширину плашки: значок 20px в 26px от края, подпись с 58px, шеврон у правого края. */
.rail-panel.profile { padding: 19px 0; border: 0; }
.rail-panel.profile .rail-panel-list { gap: 0; }
.rail-panel.profile .rail-panel-row { height: 40px; padding: 0 26px; border-radius: 0; gap: 12px; }
.rail-panel.profile .rail-panel-row-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Переключатель пространства на верхнем уровне меню профиля: две строки с видом, текущее отмечено словом. */
.rail-panel.profile .pf-space { height: auto; min-height: 40px; padding-top: 5px; padding-bottom: 5px; align-items: flex-start; }
.rail-panel.profile .pf-space > .ic { margin-top: 2px; }
.pf-space-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.pf-space-kind { color: var(--text2); font-size: 12px; }
.pf-space-cur { flex: none; margin-left: auto; color: var(--text2); font-size: 12px; }
.pf-space.on .rail-panel-row-label { font-weight: 600; }

.item .news-badge { position: absolute; top: 4px; left: 26px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--risk); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
/* ---------- Телефон: полоса меню — нижняя панель ---------- */
@media (max-width: 700px) {
  :root, .rail:is(:hover, :focus-within) { --rail-w: 0px; }
  .rail { top: auto; width: 100%; height: 58px; flex-direction: row; border-right: none; border-top: 1px solid var(--line); }
  .brand, .item .lbl { display: none !important; }
  .items { flex-direction: row; padding: 0 4px; justify-content: space-around; align-items: center; flex: 1; overflow: visible; }
  .item { width: auto; justify-content: center; padding: 0 8px; }
  .item.on::before { left: 8px; right: 8px; top: auto; bottom: -9px; width: auto; height: 3px; }
  .rail .foot { flex-direction: row; border-top: none; padding: 0 4px; align-items: center; gap: 6px; }
  .act-dot { width: auto; min-height: 40px; height: 40px; padding: 0 2px; }
  .profile-menu.subbed > :not(.rail-panel-list),
  .profile-menu.subbed .rail-panel-list > :not(.pm-anchor),
  .profile-menu.subbed .pm-anchor > :not(.pm-sub) { display: none; }
  .profile-menu .pm-sub.open { position: static; padding: 0; min-width: 0; background: none; transform: none; }
  .profile-menu .pm-back { display: block; }
  .item .news-badge { top: 6px; left: auto; right: 2px; }
}

@media print {
  .rail { display: none !important; }
}
