/* Оформление 0.44 (portal/ui_plus.py): маскот «Фокус», плотность таблиц, значки статусов, цвета отделов, своё меню.
   Ночная тема — переменные в app.css (:root[data-theme="night"]). Подключается из core.js. */

/* ---------- маскот ---------- */
.mascot { display: inline-block; flex: none; overflow: visible; vertical-align: middle; }
/* на тёмных темах — «наклейка»: светлая обводка, чтобы чёрная база и кабель не терялись на фоне */
:root:not([data-theme="light"]) .mascot { filter: drop-shadow(0 0 1.2px rgba(255, 255, 255, .95)) drop-shadow(0 0 .4px rgba(255, 255, 255, .9)); }
:root[data-theme="night"] .mascot { filter: drop-shadow(0 0 1.2px rgba(240, 160, 75, .8)) brightness(.86) sepia(.25); }
.mascot .m-wave { transform-origin: 110px 100px; animation: m-wave 1.6s ease-in-out infinite; }
.mascot .m-poke { animation: m-poke 1.1s ease-in-out infinite; }
.mascot .m-z text { animation: m-float 2.6s ease-in-out infinite; }
.mascot .m-z text:nth-child(2) { animation-delay: .35s; }
.mascot .m-z text:nth-child(3) { animation-delay: .7s; }
.mascot .m-confetti > * { animation: m-twinkle 1.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.mascot .m-confetti > *:nth-child(2n) { animation-delay: .5s; }
.mascot .m-confetti > *:nth-child(3n) { animation-delay: 1s; }
.mascot .m-lens { animation: m-peek 3.2s ease-in-out infinite; }
.mascot .m-q { animation: m-float 2.4s ease-in-out infinite; }
@keyframes m-wave { 0%, 100% { transform: rotate(0deg); } 25% { transform: rotate(-14deg); } 75% { transform: rotate(10deg); } }
@keyframes m-poke { 0%, 60%, 100% { transform: translateX(0); } 75% { transform: translateX(6px); } }
@keyframes m-float { 0%, 100% { transform: translateY(0); opacity: 1; } 50% { transform: translateY(-4px); opacity: .7; } }
@keyframes m-twinkle { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(.75) rotate(25deg); } }
@keyframes m-peek { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-3px, 1px); } }
@media (prefers-reduced-motion: reduce) { .mascot * { animation: none !important; } }

/* пустые состояния с маскотом */
.blank .mascot { margin-bottom: calc(2px * var(--z)); }
.blank.blank-m { padding-top: calc(28px * var(--z)); }
/* окно входа: Фокус выглядывает из-за карточки */
.auth-card { position: relative; }
.auth-mascot { position: absolute; top: calc(-6px * var(--z)); right: calc(-34px * var(--z)); pointer-events: none; }
@media (max-width: 560px) { .auth-mascot { right: 0; top: calc(-40px * var(--z)); } }

/* ---------- значки статусов (web/js/status-icons.js проставляет data-si) ---------- */
.label[data-si]:not([data-si=""])::before {
  content: ""; flex: none; width: calc(11px * var(--z)); height: calc(11px * var(--z)); margin-left: calc(-1px * var(--z));
  background: currentColor; -webkit-mask: var(--si) center / contain no-repeat; mask: var(--si) center / contain no-repeat;
}
.label[data-si="ok"] { --si: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.label[data-si="done"] { --si: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 6 7 16.5 2.5 12'/%3E%3Cpath d='M22 8.5 13.5 17l-1.2-1.2'/%3E%3C/svg%3E"); }
.label[data-si="wait"] { --si: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 7.5V12l3 2'/%3E%3C/svg%3E"); }
.label[data-si="progress"] { --si: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 3.5a8.5 8.5 0 0 1 0 17z' fill='black'/%3E%3C/svg%3E"); }
.label[data-si="draft"] { --si: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4L19 9a2.1 2.1 0 0 0-3-3L5 17z'/%3E%3Cpath d='m14 7 3 3'/%3E%3C/svg%3E"); }
.label[data-si="back"] { --si: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 14 4 9l5-5'/%3E%3Cpath d='M4 9h10.5a5.5 5.5 0 0 1 0 11H11'/%3E%3C/svg%3E"); }
.label[data-si="cancel"] { --si: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E"); }
.label[data-si="stop"] { --si: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E"); }
.label[data-si="urgent"] { --si: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 2 4 14h7l-1 8 9-12h-7z' fill='black'/%3E%3C/svg%3E"); }
.label[data-si="alert"] { --si: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 2 20h20z'/%3E%3Cpath d='M12 10v4M12 17.2v.1'/%3E%3C/svg%3E"); }
.label[data-si="soon"] { --si: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h12M6 21h12M7 3c0 5 10 5 10 9s-10 4-10 9M17 3c0 5-10 5-10 9s10 4 10 9'/%3E%3C/svg%3E"); }

/* ---------- плотность таблиц (Профиль → Интерфейс) ---------- */
:root[data-density="compact"] { --cell-y: 4px; --cell-x: 10px; --grid-y: 1px; }
:root[data-density="compact"] .t td, :root[data-density="compact"] .t th { font-size: calc(13px * var(--z)); line-height: 1.35; }
:root[data-density="compact"] .t .label { height: calc(19px * var(--z)); }
:root[data-density="compact"] .pay-std .t td, :root[data-density="compact"] .t tr.dep-head td { padding-top: calc(3px * var(--z)); padding-bottom: calc(3px * var(--z)); }
:root[data-density="comfy"] { --cell-y: 14px; --cell-x: 16px; --grid-y: 7px; }
:root[data-density="comfy"] .t td { line-height: 1.6; }

/* ---------- цвета отделов ---------- */
.dept-chip {
  display: inline-flex; align-items: center; gap: calc(5px * var(--z)); height: calc(20px * var(--z)); padding: 0 calc(8px * var(--z)) 0 calc(6px * var(--z));
  border-radius: 2em; font-size: calc(12px * var(--z)); font-weight: 500; white-space: nowrap; color: var(--fg); line-height: 1;
  background: color-mix(in srgb, var(--dc) 14%, transparent); border: 1px solid color-mix(in srgb, var(--dc) 42%, transparent);
}
.dept-chip::before { content: ""; flex: none; width: calc(8px * var(--z)); height: calc(8px * var(--z)); border-radius: 50%; background: var(--dc); }
.dept-chip.bare { background: none; border: 0; padding: 0; height: auto; color: inherit; }
.dept-chip.sm { font-size: calc(11px * var(--z)); height: calc(18px * var(--z)); }
tr.dep-head td.dep-colored { box-shadow: inset 3px 0 0 var(--dc); }

/* ---------- ночная тема: картинки и видео не слепят ---------- */
:root[data-theme="night"] #view img, :root[data-theme="night"] #view video, :root[data-theme="night"] .modal img { filter: brightness(.78) sepia(.18); }
:root[data-theme="night"] ::selection { background: rgba(241, 154, 62, .35); color: #fff3e6; }
:root[data-theme="night"] .dept-chip, :root[data-theme="night"] .dept-bar { filter: saturate(.75) brightness(.9); }

/* ---------- Администрирование → Цвета отделов ---------- */
.dc-swatch { width: calc(26px * var(--z)); height: calc(26px * var(--z)); border-radius: 50%; border: 2px solid var(--surface); background: var(--dc);
  box-shadow: 0 0 0 1px var(--border); cursor: pointer; padding: 0; }
.dc-swatch:hover, .dc-swatch:focus-visible { box-shadow: 0 0 0 2px var(--fg-muted); outline: none; }
.dc-swatch.on { box-shadow: 0 0 0 2px var(--fg); }
.dc-pop { display: grid; gap: calc(10px * var(--z)); padding: calc(10px * var(--z)); }
.dc-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: calc(6px * var(--z)); }
.dc-grid .dc-swatch { width: calc(22px * var(--z)); height: calc(22px * var(--z)); }
.dc-own { display: flex; align-items: center; justify-content: space-between; font-size: calc(12.5px * var(--z)); color: var(--fg-muted); }
.dc-own input { width: calc(44px * var(--z)); height: calc(26px * var(--z)); border: 1px solid var(--border); border-radius: var(--r); background: none; padding: 1px; }
.dc-sample { display: inline-flex; align-items: center; gap: calc(14px * var(--z)); }
.dc-bar { display: inline-flex; width: calc(120px * var(--z)); height: calc(10px * var(--z)); border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.dc-bar i { display: block; height: 100%; background: var(--dc); border-radius: 3px; }
.dc-prev { display: grid; grid-template-columns: repeat(auto-fit, minmax(calc(230px * var(--z)), 1fr)); gap: calc(12px * var(--z)); }
.dc-theme { border-radius: var(--r-lg); padding: calc(12px * var(--z)); border: 1px solid var(--border-muted); }
.dc-theme-t { font-size: calc(12px * var(--z)); font-weight: 650; opacity: .75; margin-bottom: calc(8px * var(--z)); }
.dc-lane { display: grid; grid-template-columns: calc(96px * var(--z)) 1fr; align-items: center; height: calc(20px * var(--z));
  font-size: calc(11px * var(--z)); }
.dc-lane span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .85; }
.dc-lane b { position: relative; display: block; height: calc(10px * var(--z)); overflow: hidden; }
.dc-lane i { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--dc); }

/* витрина маскота */
.mascot-show { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(132px * var(--z)), 1fr)); gap: calc(12px * var(--z)); }
.mascot-show figure { margin: 0; display: grid; justify-items: center; gap: calc(6px * var(--z)); padding: calc(10px * var(--z)) calc(6px * var(--z));
  border-radius: var(--r-lg); background: var(--surface-2); }
.mascot-show figcaption { display: grid; text-align: center; gap: 2px; font-size: calc(12.5px * var(--z)); }
.mascot-show figcaption span { color: var(--fg-muted); font-size: calc(11.5px * var(--z)); }

/* ---------- Профиль → Интерфейс: ночной режим, плотность, своё меню ---------- */
.pu-night { display: grid; grid-template-columns: auto 1fr; gap: calc(16px * var(--z)); align-items: center; }
.pu-night-art { display: grid; place-items: center; width: calc(104px * var(--z)); height: calc(104px * var(--z)); border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #2a1610, #0c0605 70%); }
.pu-hours { gap: calc(8px * var(--z)); align-items: center; flex-wrap: wrap; }
@media (max-width: 560px) { .pu-night { grid-template-columns: 1fr; } .pu-night-art { justify-self: center; } }
.pu-dens { display: grid; gap: 3px; width: calc(120px * var(--z)); padding: calc(8px * var(--z)); border-radius: var(--r); background: var(--surface-2);
  border: 1px solid var(--border-muted); margin-bottom: calc(6px * var(--z)); }
.pu-dens i { display: block; height: calc(4px * var(--z)); border-radius: 2px; background: var(--fg-subtle); opacity: .55; }
.pu-dens.compact { gap: calc(3px * var(--z)); }
.pu-dens.normal { gap: calc(6px * var(--z)); }
.pu-dens.comfy { gap: calc(10px * var(--z)); }
.mn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: calc(4px * var(--z)); }
.mn-row { display: flex; align-items: center; gap: calc(8px * var(--z)); min-height: calc(36px * var(--z)); padding: 0 calc(8px * var(--z));
  border: 1px solid var(--border-muted); border-radius: var(--r); background: var(--surface); }
.mn-row.dragging { opacity: .55; border-style: dashed; }
.mn-row.off .mn-l, .mn-row.off > .icon { opacity: .45; text-decoration: line-through; }
.mn-grip { cursor: grab; color: var(--fg-subtle); letter-spacing: -2px; font-size: calc(12px * var(--z)); user-select: none; }
.mn-l { flex: 1; min-width: 0; }
.mn-tools { display: flex; align-items: center; gap: calc(2px * var(--z)); }
.mn-tools .check { margin-left: calc(6px * var(--z)); }
.mn-kids { list-style: none; padding-left: calc(28px * var(--z)); }
.mn-kids.off { opacity: .5; }
/* строки табеля ЗУП — полоска цвета отдела слева */
.t tr.dept-row > td:first-child { box-shadow: inset 3px 0 0 var(--dc, transparent); }
/* метка-отдел в списках заявок: точка цвета отдела и лёгкая подложка */
.label.dept-tag { color: var(--fg); border-color: color-mix(in srgb, var(--dc) 45%, transparent); background: color-mix(in srgb, var(--dc) 12%, transparent); }
.label.dept-tag::before { content: ""; flex: none; width: calc(7px * var(--z)); height: calc(7px * var(--z)); border-radius: 50%; background: var(--dc); }
/* графики в ночной теме — приглушённые */
:root[data-theme="night"] #view svg:not(.icon):not(.mascot), :root[data-theme="night"] #view .bar, :root[data-theme="night"] #view .dv-legend i { filter: saturate(.7) brightness(.86) sepia(.12); }

/* ================= 0.45: окна и меню ================= */
/* свернуть окно (web/js/layout.js): кнопка ▾ в заголовке; свёрнутое окно — только строка заголовка */
.win-fold { flex: none; display: inline-flex; align-items: center; justify-content: center; width: calc(24px * var(--z)); height: calc(24px * var(--z));
  margin-left: auto; border: 0; border-radius: var(--r); background: transparent; color: var(--fg-subtle); cursor: pointer; }
.box-head h2 + .win-fold, .box-head h3 + .win-fold { margin-left: 0; }
.win-fold:hover { color: var(--fg); background: var(--hover); }
.win-fold:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
[data-win].fold-path { position: relative; }
.win-fold.float { position: absolute; top: calc(6px * var(--z)); right: calc(6px * var(--z)); z-index: 2; opacity: 0; transition: opacity .15s; background: var(--surface); }
[data-win]:hover > .win-fold.float, .win-fold.float:focus-visible, .win-folded > .win-fold.float { opacity: 1; }
.win-folded.fold-path > :not(.fold-keep):not(.fold-path), .win-folded .fold-path > :not(.fold-keep):not(.fold-path) { display: none !important; }
.win-folded { height: auto !important; min-height: 0 !important; }
.win-folded .fold-keep.box-head { border-bottom-color: transparent; border-radius: var(--r); }
.win-fold-title { display: flex; align-items: center; min-height: calc(36px * var(--z)); padding: 0 calc(40px * var(--z)) 0 calc(16px * var(--z));
  font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); }
@media print { .win-folded.fold-path > *, .win-folded .fold-path > * { display: revert !important; } }
/* вкладки внутри окна */
.win-tabs-head { padding-top: calc(6px * var(--z)); padding-bottom: 0; align-items: flex-end; flex-wrap: wrap; }
.win-tabs { display: flex; gap: calc(2px * var(--z)); flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.win-tab { display: inline-flex; align-items: center; gap: calc(6px * var(--z)); padding: calc(7px * var(--z)) calc(12px * var(--z)); border: 0;
  border-bottom: 2px solid transparent; background: transparent; color: var(--fg-muted); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.win-tab:hover { color: var(--fg); }
.win-tab.on { color: var(--fg); border-bottom-color: var(--accent); }
.win-tab-extra { align-self: center; padding-bottom: calc(4px * var(--z)); }
/* звёздочка «Избранное» в заголовке карточки */
.fav-star { display: inline-flex; vertical-align: middle; margin-left: calc(8px * var(--z)); padding: calc(3px * var(--z)); border: 0; border-radius: var(--r);
  background: transparent; color: var(--fg-subtle); cursor: pointer; }
.fav-star:hover { color: #f5b301; background: var(--hover); }
.fav-star.on { color: #f5b301; }
.fav-star.on svg { fill: currentColor; }
/* Главная: избранное и недавние */
.mine-sec { padding: calc(8px * var(--z)) calc(16px * var(--z)) calc(2px * var(--z)); font-size: calc(12px * var(--z)); color: var(--fg-muted); display: flex; align-items: center; gap: 6px; }
.mine-row { padding-top: calc(7px * var(--z)); padding-bottom: calc(7px * var(--z)); }
.mine-row .grow { display: flex; flex-direction: column; min-width: 0; }
.mine-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* правая панель: задачи, чат, уведомления */
.hbtn.sp-btn.on { color: var(--fg); background: var(--hover); }
.sidepanel { position: fixed; right: 0; top: var(--hdr-h, 56px); bottom: 0; width: calc(330px * var(--z)); z-index: 25; display: flex; flex-direction: column;
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: -8px 0 24px rgba(0, 0, 0, .18); }
.sidepanel.pinned { box-shadow: none; }
:root.sp-on .shell-body { padding-right: calc(330px * var(--z)); }
:root.sp-on[data-nav="right"] .shell-body { padding-right: calc(330px * var(--z) + var(--side-w)); }
:root[data-nav="right"] .sidepanel { right: var(--side-w); }
:root[data-nav="bottom"] .sidepanel { bottom: var(--bnav-h); }
.sp-head { display: flex; align-items: center; gap: 2px; padding: calc(6px * var(--z)) calc(6px * var(--z)) 0; border-bottom: 1px solid var(--border-muted); }
.sp-tabs { display: flex; flex: 1; min-width: 0; }
.sp-tab { display: inline-flex; align-items: center; gap: 5px; padding: calc(8px * var(--z)) calc(8px * var(--z)); border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--fg-muted); font: inherit; font-size: calc(13px * var(--z)); font-weight: 600; cursor: pointer; white-space: nowrap; }
.sp-tab.on { color: var(--fg); border-bottom-color: var(--accent); }
.sp-tab .counter { margin-left: 2px; }
.sp-ic { flex: none; display: inline-flex; align-items: center; justify-content: center; width: calc(28px * var(--z)); height: calc(28px * var(--z));
  border: 0; border-radius: var(--r); background: transparent; color: var(--fg-subtle); cursor: pointer; }
.sp-ic:hover { color: var(--fg); background: var(--hover); }
.sp-ic.on { color: var(--accent); }
.sp-body { flex: 1; overflow-y: auto; padding-bottom: calc(16px * var(--z)); }
.sp-sec { display: flex; align-items: center; gap: 6px; padding: calc(10px * var(--z)) calc(12px * var(--z)) calc(4px * var(--z)); font-size: calc(12px * var(--z)); color: var(--fg-muted); font-weight: 600; }
.sp-row { display: flex; align-items: flex-start; gap: calc(8px * var(--z)); padding: calc(7px * var(--z)) calc(12px * var(--z)); color: inherit; border-top: 1px solid var(--border-muted); }
.sp-row:hover { background: var(--hover); text-decoration: none; }
.sp-row .grow { display: flex; flex-direction: column; min-width: 0; }
.sp-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-t.wrap { white-space: normal; }
.sp-row.unread .sp-t { font-weight: 600; }
.sp-row.note.read { opacity: .65; }
.sp-more { display: flex; align-items: center; gap: 4px; padding: calc(10px * var(--z)) calc(12px * var(--z)); font-size: calc(13px * var(--z)); }
.sp-empty { display: flex; align-items: center; gap: 6px; padding: calc(20px * var(--z)) calc(12px * var(--z)); }
@media (max-width: 760px) { .hbtn.sp-btn, .sidepanel { display: none !important; } :root.sp-on .shell-body { padding-right: 0; } }
@media print { .sidepanel { display: none !important; } :root.sp-on .shell-body { padding-right: 0; } }
/* компактная шапка: при прокрутке вниз прячется строка разделов */
.app-header { transition: top .2s ease; }
:root.hdr-hide .app-header { top: calc(-1 * var(--hdr-hide, 0px)); }
:root.hdr-hide[data-nav="bottom"] .app-nav { transform: translateY(100%); }
:root[data-nav="bottom"] .app-nav { transition: transform .2s ease; }
/* профиль: мои фильтры, стартовая страница */
.sf-list { display: grid; gap: calc(4px * var(--z)); }
.sf-row { display: flex; align-items: center; gap: calc(8px * var(--z)); min-height: calc(36px * var(--z)); padding: 0 calc(8px * var(--z));
  border: 1px solid var(--border-muted); border-radius: var(--r); background: var(--surface); }
.sf-row .grow { min-width: 0; display: flex; flex-direction: column; }
.pu-start { display: grid; grid-template-columns: max-content minmax(0, 320px); gap: calc(8px * var(--z)) calc(12px * var(--z)); align-items: center; }
@media (max-width: 760px) { .pu-start { grid-template-columns: 1fr; } }
/* администрирование: виды по ролям */
.rv-grid { display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); gap: calc(16px * var(--z)); align-items: start; }
@media (max-width: 860px) { .rv-grid { grid-template-columns: 1fr; } }
.rv-roles { display: grid; gap: 2px; }
.rv-role { display: flex; align-items: center; gap: 8px; width: 100%; padding: calc(8px * var(--z)) calc(10px * var(--z)); border: 1px solid transparent; border-radius: var(--r);
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.rv-role:hover { background: var(--hover); }
.rv-role.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.rv-menu { columns: 2 220px; column-gap: calc(16px * var(--z)); }
.rv-menu label { display: flex; align-items: center; gap: 6px; break-inside: avoid; padding: 2px 0; }
.rv-menu .kid { padding-left: calc(20px * var(--z)); }
/* правая панель: три вкладки со счётчиками помещаются рядом с кнопками «закрепить» и «закрыть» */
.sp-tabs { overflow: hidden; }
.sp-tab { flex: none; padding-left: calc(5px * var(--z)); padding-right: calc(5px * var(--z)); gap: 4px; font-size: calc(12.5px * var(--z)); }
.sp-tab .counter { position: static; transform: none; flex: none; }
.sp-tab > svg { display: none; }
