/* ============================================================
   VPN Панель — оформление кабинета simreg.

   Цвета, скругления и тени — только токенами из tokens.css (копия
   public/ui/tokens.css кабинета). Цвет значением здесь один — белая подложка
   QR-кода: сканер читает тёмные модули на светлом в любой теме.

   Правила перенесены из public/ui/shell.css, table.css, forms.css и
   metrics.css кабинета и подогнаны под серверную разметку панели: в кабинете
   её собирает JS, здесь — шаблоны Jinja, поэтому шторка меню и меню
   пользователя работают без скриптов (флажок + label, details/summary).

   Тема — как в системе: светлую и тёмную ветки токенов переключает
   prefers-color-scheme.
   ============================================================ */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--f-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Соты на фоне и бродящее по ним свечение — как у кабинета (shell.css):
   отдельные fixed-слои под содержимым, чтобы узор не уезжал с прокруткой. */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image: var(--grid);
  background-repeat: repeat;
  background-size: var(--grid-tile);
  background-position: var(--grid-offset);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: var(--glow-strength);
  background-image:
    radial-gradient(circle at 50% 50%, rgba(var(--glow-rgb), 1) 0%, rgba(var(--glow-rgb), .5) 42%, rgba(var(--glow-rgb), 0) 70%),
    radial-gradient(circle at 50% 50%, rgba(var(--glow-rgb), .85) 0%, rgba(var(--glow-rgb), .35) 45%, rgba(var(--glow-rgb), 0) 72%);
  background-repeat: no-repeat, no-repeat;
  background-size: 760px 760px, 540px 540px;
  -webkit-mask-image: var(--grid-mask); mask-image: var(--grid-mask);
  -webkit-mask-repeat: repeat; mask-repeat: repeat;
  -webkit-mask-size: var(--grid-tile); mask-size: var(--grid-tile);
  -webkit-mask-position: var(--grid-offset); mask-position: var(--grid-offset);
  animation: glow-drift 56s ease-in-out infinite;
}
@keyframes glow-drift {
  0%   { background-position: 12% 18%, 82% 74%; }
  13%  { background-position: 63% 6%,  21% 88%; }
  26%  { background-position: 89% 47%, 46% 21%; }
  38%  { background-position: 30% 71%, 93% 11%; }
  51%  { background-position: 5% 91%,  65% 60%; }
  63%  { background-position: 71% 28%, 11% 36%; }
  77%  { background-position: 40% 55%, 87% 93%; }
  88%  { background-position: 96% 80%, 33% 5%; }
  100% { background-position: 12% 18%, 82% 74%; }
}

a { color: var(--link); }
.num { font-variant-numeric: tabular-nums; }
.mono, code, textarea.conf { font-family: var(--f-mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
[hidden] { display: none !important; }
code {
  background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 6px;
  padding: 1px 6px; overflow-wrap: anywhere; word-break: break-all;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: none; box-shadow: var(--focus-ring); border-radius: 6px;
}
/* У полей своя рамка — кольцо поверх неё читалось бы второй рамкой
   (shell.css кабинета). Признак фокуса у них — подсвеченная граница. */
:where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus-visible { box-shadow: none; }

/* Размеры — как у кабинета (сверено getComputedStyle на его ui-stand): h1 20/650/-.02em, h2 15/650,
   межстрочный 1.5 от body. Закреплено тестом tests/test_design.py. */
h1 { margin: 0 0 14px; font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
h2 { margin: 0 0 10px; font-size: 15px; font-weight: 650; }
h3 { margin: 0 0 8px; font-size: 13.5px; font-weight: 650; }
p.muted, .card p.muted { font-size: 13px; }

/* ---------------- каркас ---------------- */

.app {
  display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr);
  min-height: 100vh; position: relative;
}
.pane { min-width: 0; display: flex; flex-direction: column; grid-column: 2; grid-row: 1; }
.side { grid-column: 1; grid-row: 1; }

/* Флажок шторки: состояние меню на телефоне без скриптов. Сам невидим,
   управляют им две label — кнопка меню в шапке и подложка. */
.navtoggle { position: absolute; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; margin: 0; }

.side {
  background: var(--rail);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 14px 12px; gap: 2px;
  position: sticky; top: 0; height: 100vh;
  /* Список темы раскрывается вправо за край меню — на широком экране меню его не обрезает
     (разделов меньше десятка, прокручивать нечего). На узком шторка прокручивается сама. */
  overflow: visible;
}
.navgroup { margin-top: 12px; display: flex; flex-direction: column; gap: 2px; }
/* Шапка меню — кнопка закрепления, как у кабинета (.sidehead): по центру полосы шапки страницы. */
.sidehead {
  display: flex; align-items: center;
  margin-top: calc((var(--top-h) - 34px) / 2 - 14px);
  padding: 0 0 4px;
}
.sidehead + .navgroup { margin-top: 4px; }
/* Кнопка меню #menuBtn — одна, как у кабинета: в шапке меню на широком экране, первой в шапке
   страницы на узком (переносит app.js). Без JS ей нечего делать: её нет, а на узком экране вместо неё
   label .menubtn, который переключает флажок шторки сам. Переключателя темы без JS тоже нет. */
html:not(.js) .sidehead, html:not(.js) #menuBtn, html:not(.js) .themepick { display: none; }
html:not(.js) .sidehead + .navgroup { margin-top: calc((var(--top-h) - 34px) / 2 - 2px); }
html.js .menubtn { display: none !important; }
.menubtn .ico-close, .navtoggle:checked ~ .pane .menubtn .ico-menu { display: none; }
.navtoggle:checked ~ .pane .menubtn .ico-close, .menubtn .ico-menu { display: contents; }

/* ---------------- переключатель темы — .themepick кабинета (shell.css) ----------------
   Стоит в самом низу меню (у кабинета его туда переносит sidebar.js) и раскрывается вправо
   рядом с кнопкой: внизу экрана ему некуда, ряд из трёх значков читается продолжением кнопки. */
.themepick { position: relative; flex: none; --themepick-w: 34px; }
.themepick-btn { width: var(--themepick-w); height: var(--themepick-w); }
.themepick-btn[aria-expanded="true"] { background: var(--surface-2); color: var(--ink); }
.themepick-cur { display: grid; place-items: center; }
.themepick-cur svg { width: 17px; height: 17px; }
.themepick-list {
  position: absolute; z-index: 55;
  top: calc(100% + var(--pop-gap, 6px));
  left: 50%; transform: translateX(-50%);
  width: var(--themepick-w); padding: 3px;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-pop);
}
.themepick-list[hidden] { display: none; }
.themepick-list button {
  display: grid; place-items: center;
  width: 100%; height: 26px; padding: 0;
  border: 0; border-radius: 9px; background: none;
  color: var(--muted); font: inherit; cursor: pointer;
}
.themepick-list button:hover { color: var(--ink); background: var(--surface-2); }
.themepick-list button[aria-checked="true"] { background: var(--surface-2); color: var(--ink); }
.themepick-list button svg { width: 16px; height: 16px; }
.side > .themepick { margin-top: auto; padding-top: 12px; align-self: flex-start; }
.side > .themepick .themepick-btn {
  width: var(--themepick-w); border-color: transparent; background: transparent;
  color: var(--muted);
}
.side > .themepick .themepick-btn:hover { background: var(--surface-2); color: var(--ink); }
.side > .themepick .themepick-list {
  top: 12px; bottom: auto; left: calc(100% + 6px); right: auto;
  width: auto; height: var(--themepick-w); box-sizing: border-box;
  transform: none; flex-direction: row; align-items: stretch;
}
.side > .themepick .themepick-list button { width: 32px; height: auto; }
/* В полосе значков (только широкий экран) кнопка темы по центру полосы; в шторке телефона — слева, как
   пункты меню (Task 9t: data-side="mini" остаётся и на узком экране, и правило без медиазапроса ставило
   кнопку в шторке посередине). Подвала «Время — МСК» больше нет: время подписано МСК там, где оно стоит. */
@media (min-width: 901px) { html[data-side="mini"] .side > .themepick { align-self: center; } }
.navgroup > span {
  display: block; padding: 0 8px 4px;
  font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}
.side a {
  display: flex; align-items: center; gap: 9px;
  padding: 8px; border-radius: var(--r-sm);
  color: var(--ink-2); text-decoration: none; font-size: 13.5px;
}
.side a > svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.side a > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side a:hover { background: var(--surface-2); color: var(--ink); }
.side a[aria-current] { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.side a[aria-current] > svg { opacity: 1; }

/* ---------------- шапка ---------------- */

.top {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0 20px; height: var(--top-h);
  display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 40;
  --pop-gap: calc((var(--top-h) - 34px) / 2 + 6px);
}
.brandmark {
  display: flex; align-items: center; gap: 9px; flex: 0 1 auto; min-width: 0;
  color: var(--ink); text-decoration: none; font-weight: 650; font-size: 15px; letter-spacing: -.01em;
}
/* Логотип — icons/icon-192.png: прозрачные скруглённые углы уже в самом файле. Прежний logo.png нёс
   белую рамку в 4 пикселя прямо в картинке — она и была «белым кольцом». Ни фона, ни рамки, ни
   скругления поверх: они только добавили бы ободок. */
.brandmark img { width: 32px; height: 32px; display: block; flex: none; border: 0; background: none; box-shadow: none; border-radius: 0; }
.brandmark span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topright { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.icobtn {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.icobtn:hover { background: var(--surface-2); color: var(--ink); }
.icobtn svg { width: 17px; height: 17px; }
.menubtn { display: none; }

/* Меню пользователя: кнопка-аватар, под ней кто вошёл и выход.
   details/summary вместо JS-меню кабинета; закрытие по щелчку мимо — app.js. */
.usermenu { position: relative; }
.usermenu > summary { list-style: none; cursor: pointer; border-radius: var(--r-sm); display: block; }
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu .ava {
  width: 34px; height: 34px; border-radius: var(--r-sm); flex: none;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2);
  display: grid; place-items: center; font-size: 11.5px; font-weight: 650; text-transform: uppercase;
  overflow: hidden;
}
.usermenu > summary:hover .ava, .usermenu[open] > summary .ava { border-color: var(--muted); color: var(--ink); }
.usermenu-list {
  position: absolute; top: calc(100% + var(--pop-gap, 6px)); right: 0; z-index: 55;
  min-width: 208px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; gap: 2px;
}
.usermenu-head { padding: 6px 10px 8px; display: flex; flex-direction: column; }
.usermenu-head b { font-size: 13.5px; font-weight: 650; overflow-wrap: anywhere; }
.usermenu-head small { font-size: 12px; color: var(--muted); }
.usermenu-list form { margin: 0; }
.usermenu-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--ink); text-decoration: none;
  font: inherit; font-size: 13.5px; text-align: left; cursor: pointer;
}
.usermenu-item svg { width: 16px; height: 16px; flex: none; }
.usermenu-item:hover { background: var(--surface-2); }
.usermenu-item.separated { margin-top: 5px; padding-top: 11px; border-top: 1px solid var(--line); border-radius: 0 0 var(--r-sm) var(--r-sm); }
.usermenu-item.danger { color: var(--crit); }
.usermenu-item.danger:hover { background: var(--crit-soft); }

/* ---------------- рабочая область ---------------- */

.main { padding: 14px 20px 28px; min-width: 0; flex: 1; }

/* Карточка — .panel кабинета: поверхность, волосяная рамка, без тени.
   Внутренние поля здесь у самой карточки: в кабинете их задают разделы. */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px; margin: 0 0 16px; min-width: 0;
}
.card > :last-child { margin-bottom: 0; }
.card p { margin: 0 0 10px; }
.center { text-align: center; }
.code { font-size: 44px; font-weight: 700; letter-spacing: -.03em; color: var(--link); line-height: 1.1; margin-bottom: 8px; }
.lead { font-size: 15px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.row-between h2 { margin: 0; }
.card > .row-between { margin-bottom: 10px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack > .btn { align-self: flex-start; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 20px; align-items: start; }

/* ---------------- заметки (баннеры) — .note кабинета ---------------- */

.banner, p.warn {
  border: 1px solid var(--line); border-left: 3px solid var(--line);
  background: var(--surface-2); color: var(--ink);
  border-radius: var(--r-sm); padding: 9px 12px; margin: 0 0 14px;
  font-size: 13px; overflow-wrap: anywhere;
}
.banner.ok { border-left-color: var(--ok); background: var(--ok-soft); }
.banner.warn, p.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.banner.error { border-left-color: var(--crit); background: var(--crit-soft); }
.banner a { color: var(--link); font-weight: 600; }

/* ---------------- плитки — .simtile кабинета ---------------- */

.tiles {
  display: grid; gap: 10px; margin: 0 0 16px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.card .tiles { margin-bottom: 12px; }
.tile {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 13px; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
}
.card .tile { background: var(--surface-2); }
.tile .num, .tile strong {
  order: 2; font-size: 24px; font-weight: 650; color: var(--ink);
  text-transform: none; letter-spacing: 0; font-variant-numeric: tabular-nums;
}
.tile.alert { box-shadow: inset 3px 0 0 var(--warn); }

.servers-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.srv {
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 13px;
  display: flex; flex-direction: column; gap: 2px; background: var(--surface-2); min-width: 0;
}
.srv b { font-weight: 650; }
.srv small { font-size: 12px; overflow-wrap: anywhere; }
.srv small.mono { font-size: 11.5px; }
.srv.off { opacity: .55; }

/* ---------------- поля — .fld кабинета ----------------
   Подпись — текст самой label, поле внутри неё: так размечены шаблоны,
   и разметку ради оформления не трогаем. */
label { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 12px; color: var(--muted); }
input, select, textarea {
  font: inherit; font-size: 14px; color: var(--ink);
  min-height: 38px; padding: 8px 11px; min-width: 0;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface);
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--link); }
input[readonly], textarea[readonly] { background: var(--surface-2); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
textarea.conf { width: 100%; white-space: pre; overflow: auto; font-size: 12px; }

.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 10px; }
.inline-form:last-child { margin-bottom: 0; }
.inline-form input[name=value] { flex: 1 1 220px; }
.inline-form input[name=comment] { flex: 1 1 180px; }
.inline-form input[name=login], .inline-form input[name=password], .inline-form input[name=ip] { flex: 1 1 180px; }
.inline-form.compact { margin: 0; flex-wrap: nowrap; gap: 6px; }
.inline-form.compact input { width: 150px; min-height: 28px; height: 28px; padding: 0 9px; font-size: 12.5px; flex: none; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; align-items: end; }
.grid-form .wide { grid-column: 1 / -1; }
.grid-form > .btn { justify-self: start; }
.issue-form { max-width: 560px; }

/* Выбор режима — две плашки-варианта; выбранная обведена фирменным цветом. */
fieldset.modes {
  border: 0; padding: 0; margin: 0; min-width: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px;
}
fieldset.modes legend { font-size: 12px; color: var(--muted); padding: 0; margin-bottom: 6px; }
label.radio {
  flex-direction: row; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font-size: 13.5px; cursor: pointer;
}
label.radio:hover { border-color: var(--muted); }
label.radio:has(input:checked) { border-color: var(--link); background: var(--brand-soft); }
label.radio input { min-height: 0; margin: 3px 0 0; accent-color: var(--link); flex: none; }
label.radio span { display: flex; flex-direction: column; gap: 1px; }
label.radio b { font-weight: 600; }
label.radio small { color: var(--muted); font-size: 12px; }

/* ---------------- кнопки — .btn кабинета ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap;
  text-decoration: none;
}
.btn:hover { background: var(--surface-2); }
.btn.primary, .btn.period-active {
  background: var(--brand-fill, var(--brand)); border-color: var(--brand-edge, var(--brand));
  color: var(--on-fill, var(--on-brand)); font-weight: 600;
}
.btn.primary:hover, .btn.period-active:hover { filter: brightness(.95); }
.btn.danger { color: var(--crit); border-color: var(--crit); }
.btn.danger:hover { background: var(--crit-soft); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------------- статусы — .pill кабинета ---------------- */

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.pill.active { background: var(--ok-soft); color: var(--ok); }
.pill.suspect, .pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.revoked { background: var(--crit-soft); color: var(--crit); }
.pill.provisioning, .pill.unblocking, .pill.unknown { background: var(--info-soft); color: var(--info); }

/* ---------------- таблицы — table.css кабинета ---------------- */

.table-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.card > .table-wrap:first-child { margin-top: -6px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; padding: 9px 10px; white-space: nowrap;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--muted);
}
tbody td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; vertical-align: middle; }
tbody td.wrap { white-space: normal; min-width: 200px; overflow-wrap: anywhere; }
tbody tr:hover { background: var(--ground); }
tbody tr:last-child td { border-bottom: 0; }
tr.dim td { opacity: .55; }
tr.sub td { padding-top: 0; white-space: normal; }
tr:has(+ tr.sub) td { border-bottom: 0; }
td.actions { text-align: right; }
td.actions > form { display: inline-flex; margin: 2px 0 2px 4px; vertical-align: middle; }
td[colspan].muted { text-align: center; padding: 28px 10px; }

.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.periods { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }

/* ---------------- профиль ---------------- */

.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 4px 0 14px; font-size: 13.5px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.profile-card form { margin: 0 0 10px; }
.qr { width: 100%; max-width: 320px; border-radius: var(--r-sm); background: #fff; padding: 8px; image-rendering: pixelated; display: block; border: 1px solid var(--line); }

/* ---------------- график трафика ---------------- */

svg.chart { width: 100%; height: 180px; display: block; margin-bottom: 8px; }
.bar-rx { fill: var(--brand); }
.bar-tx { fill: var(--info); opacity: .75; }
.chart-label { fill: var(--muted); }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; }
.key-rx { background: var(--brand); }
.key-tx { background: var(--info); opacity: .75; }

/* ---------------- вход — экран .login кабинета ---------------- */

.login {
  min-height: 100vh; padding: 24px 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
}
.login > .banner { width: min(380px, 100%); margin: 0; }
.loginbox, .login > .card {
  width: min(380px, 100%); margin: 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow);
  padding: 26px 24px;
}
.login > .card { width: min(460px, 100%); }
.loginbox { display: flex; flex-direction: column; gap: 14px; }
.loginbox .head { display: flex; align-items: center; gap: 12px; padding-bottom: 2px; }
.loginbox .head img { width: 44px; height: 44px; display: block; flex: none; border: 0; background: none; box-shadow: none; border-radius: 0; }
.loginbox .head h1 { margin: 0; font-size: 19px; line-height: 1.2; }
.loginbox .head small { font-size: 12px; color: var(--muted); }
.loginbox form { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.loginbox form .banner { margin: 0; }
.loginbox input { width: 100%; }
.loginbox .btn { height: 40px; width: 100%; }
.loginbox p { margin: 0; font-size: 13px; }

/* ---------------- прелоадеры — shell.css кабинета ----------------
   Два вида, как у кабинета:
   .bootscreen — экран загрузки: стоит в разметке первым узлом body и виден с
     первого кадра, пока страница не готова; app.js гасит его не раньше
     MIN_SHOW_MS (450) от начала загрузки и уводит за --fade-shell (.28s).
   .loader — накладка на время перехода: ссылка меню, отправка формы. app.js
     показывает её через 160 мс (короткий переход проходит без вспышки).
   Навсегда не перекрывают ничего: без JS их прячет noscript.css, при сбое
   скрипта — страховочная анимация (8 с), у экрана загрузки ещё и
   pointer-events: none.
   ⚠️ Подложка обоих — глухой цвет фона темы (--ground), без прозрачности и
   размытия: так попросил владелец, сквозь прелоадер не должно быть видно
   страницы. И текста в них нет вовсе — только точки; скринридеру прелоадер
   называют aria-busy и aria-label на контейнере. */

.pdots { display: flex; gap: 8px; }
.pdots i {
  display: block; width: 14px; height: 14px; flex: none;
  border-radius: 999px; background: var(--dot-color);
  transform: scale(0);
  animation: dotpulse var(--dot-pulse) ease-in-out infinite;
}
.pdots i:nth-child(2) { animation-delay: calc(var(--dot-pulse) * -0.25); }
.pdots i:nth-child(3) { animation-delay: calc(var(--dot-pulse) * -0.5); }
@keyframes dotpulse { 50% { transform: scale(1); } }

.bootscreen {
  position: fixed; inset: 0; z-index: 65;
  display: grid; place-items: center; align-content: center;
  padding: 24px; pointer-events: none;
  background: var(--ground);
  opacity: 0; transition: opacity var(--fade-shell);
  /* Страховка: что бы ни случилось со скриптом, через 8 с экран уходит сам. */
  animation: preload-safety .28s ease-out 8s forwards;
}
.bootscreen[data-phase="in"] { opacity: 1; }
.bootart { gap: 10px; }
.bootart i { width: 22px; height: 22px; }

.loader {
  position: fixed; inset: 0; z-index: 70;
  display: grid; place-items: center; align-content: center;
  background: var(--ground);
  animation: preload-safety .28s ease-out 8s forwards;
}
@keyframes preload-safety { to { opacity: 0; visibility: hidden; } }

@media (max-width: 640px) {
  .bootart { gap: 8px; }
  .bootart i { width: 17px; height: 17px; }
}
/* Меньше движения: точки стоят, а не мигают (tokens.css сжимает анимации до
   0.01 мс, и пульс превратился бы в мерцание). Затухание — мгновенно. */
@media (prefers-reduced-motion: reduce) {
  .pdots i { animation: none; transform: scale(.75); }
  .bootscreen { transition: none; }
}

/* ---------------- свёрнутое меню: полоса значков (shell.css кабинета) ----------------
   Только там, где сайдбар стоит колонкой (>=901px). Состояние — data-side на <html> (boot.js до
   отрисовки, app.js по кнопке). Наведение раскрывает не панель, а подпись одного пункта. */
@media (min-width: 901px) {
  html[data-side="mini"] .app { grid-template-columns: var(--side-w-mini) minmax(0, 1fr); }
  html[data-side="mini"] .side {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 41; height: auto;
    width: var(--side-w-mini); overflow: visible;
    padding-left: 8px; padding-right: 8px;
  }
  html[data-side="mini"] .side .navgroup > span { display: none; }
  html[data-side="mini"] .side a { position: relative; justify-content: center; padding: 9px 0; }
  html[data-side="mini"] .sidehead { justify-content: center; padding-bottom: 22px; }
  html[data-side="mini"] .sidehead + .navgroup { margin-top: 0; }
  html[data-side="mini"] .side a > span {
    display: none;
    position: absolute; left: 100%; top: 0; bottom: 0; margin-left: -2px;
    align-items: center; padding: 0 14px;
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    background: var(--surface-2); color: var(--ink);
    box-shadow: var(--shadow-pop);
    white-space: nowrap; font-size: 13.5px; overflow: visible;
  }
  html[data-side="mini"] .side a:hover > span,
  html[data-side="mini"] .side a:focus-visible > span {
    display: flex;
    animation: navlabel .09s cubic-bezier(.22, 1, .36, 1);
  }
  @keyframes navlabel {
    from { opacity: 0; transform: translateX(-5px); }
    to   { opacity: 1; transform: none; }
  }
  html[data-side="mini"] .side a:hover,
  html[data-side="mini"] .side a:focus-visible { border-radius: var(--r-sm) 0 0 var(--r-sm); }
  html[data-side="mini"] .side .navgroup + .navgroup {
    margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line);
  }
}

/* ---------------- адаптив ---------------- */

.backdrop { display: none; }

/* Сайдбар на узком экране — выдвижная шторка, как у кабинета: без неё
   разделы были бы недостижимы с телефона. Открывает её флажок .navtoggle. */
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .pane { grid-column: 1; }
  .side {
    position: fixed; top: 0; bottom: 0; left: 0; height: auto; width: min(280px, 84vw);
    z-index: 50; transform: translateX(-100%); visibility: hidden;
    transition: transform .22s ease-out, visibility 0s linear .22s;
    box-shadow: var(--shadow-pop);
  }
  .navtoggle:checked ~ .side { transform: none; visibility: visible; transition: transform .22s ease-out; }
  .backdrop {
    display: block; position: fixed; inset: 0; z-index: 45;
    background: rgba(0, 0, 0, .45);
    opacity: 0; pointer-events: none; transition: opacity .22s ease-out;
  }
  .navtoggle:checked ~ .backdrop { opacity: 1; pointer-events: auto; }
  /* Шторка под пальцем (app.js, перенос drawer-swipe.js): положение задаёт жест через --drawer-x,
     переходы выключены, иначе шторка догоняла бы палец с задержкой. */
  body[data-drawer-swipe="1"] .side {
    transform: translate3d(var(--drawer-x, -100%), 0, 0);
    transition: none; visibility: visible;
  }
  body[data-drawer-swipe="1"] .backdrop { transition: none; }
  .sidehead { display: none; }
  .side { touch-action: pan-y; overscroll-behavior: contain; overflow-y: auto; }
  /* В шторке список темы открывается вверх-вправо внутри неё: за край шторки уходить некуда. */
  .side > .themepick .themepick-list { left: calc(var(--themepick-w) + 6px); }
  .themepick { --themepick-w: 38px; }
  .themepick-list button { height: 32px; }
  .navtoggle:focus-visible ~ .pane .menubtn { box-shadow: var(--focus-ring); }
  .menubtn { display: grid; }
  .top { gap: 10px; padding: 0 12px; }
  .main { padding: 14px 16px 24px; }
  .icobtn, .usermenu .ava { width: 38px; height: 38px; }
  .side a { padding: 11px 8px; }
  .navgroup:first-child, .sidehead + .navgroup, html:not(.js) .sidehead + .navgroup { margin-top: 4px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .card { padding: 14px; }
  .table-wrap { margin: 0 -14px; padding: 0 14px; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .facts dd { margin-bottom: 6px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile .num, .tile strong { font-size: 20px; }
  .inline-form > input, .inline-form > select { flex: 1 1 100%; }
  .inline-form > .btn { flex: 1 1 auto; }
  .inline-form.compact > input { flex: 1 1 120px; width: auto; }
  .loginbox { padding: 22px 18px; }
}

/* ---------------- «По пользователям»: строка раскрывается в профили пользователя (Task 9l) ----------------
   Без JS вложенные строки просто открыты (кнопки нет — noscript.css); со скриптом закрыты, пока не нажать. */
.js .tr-sub:not(.open) { display: none; }
.tr-user .row-toggle {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; margin: -4px 6px -4px -4px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink-2); cursor: pointer;
  vertical-align: middle; padding: 0;
}
.tr-user .row-toggle:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.tr-user .chev { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s ease; }
.tr-user .row-toggle[aria-expanded="true"] .chev { transform: rotate(45deg); }
.tr-user { cursor: pointer; }
.tr-sub > td { padding: 0 0 10px 34px; background: var(--surface-2); white-space: normal; }
.tr-sub:hover { background: transparent; }
.sub-wrap { overflow-x: auto; max-width: 100%; }
.sub-table { width: 100%; font-size: 12px; }
.sub-table thead th { background: transparent; }
.sub-table tbody tr:last-child td { border-bottom: 0; }
.sub-table tr.dim td { color: var(--muted); }
meter.share { width: 60px; height: 8px; vertical-align: middle; }
@media (max-width: 600px) {
  .tr-sub > td { padding-left: 8px; }
}

/* ---------------- профили по владельцам (Task 9o): те же строки-группы, что «По пользователям» ---------------- */
.group-tools { gap: 8px; flex-wrap: wrap; margin: 0 0 8px; }
.group-tools > span:last-child { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.profile-groups .tr-user > td { white-space: normal; }
.profile-groups .group-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 14px; }
.profile-groups .group-name { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; overflow-wrap: anywhere; }
.profile-groups .group-meta { display: inline-flex; flex-wrap: wrap; gap: 2px 12px; }
.profile-groups .tr-user.attn > td { box-shadow: inset 3px 0 0 var(--warn); }
/* вложенная таблица не раздвигает внешнюю: ширина 0 не входит в расчёт столбца, а min-width растягивает её
   на ширину ячейки — лишнее прокручивается внутри карточки */
.profile-groups .sub-wrap { width: 0; min-width: 100%; }
.profile-groups .sub-table td.actions { white-space: nowrap; }
/* пометка о блокировке второго адреса переносится, а не раздвигает таблицу группы */
.profile-groups .sub-table td:nth-child(2) { white-space: normal; min-width: 160px; max-width: 320px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------------- пошаговые страницы (Task 9q): «Профиль выпущен» и «Обновить профиль» ----------------
   Владелец: «всё сливается». Иерархия: заголовок + вводная строка → карточки способов с
   акцентной кромкой (главная — фирменная, опасная — красная) → нумерованные шаги → одна главная кнопка
   на шаг. Только токены; длинное значение AllowedIPs спрятано под «Показать значение». */
.pagehead { margin: 2px 0 16px; max-width: 860px; }
.pagehead h1 { margin-bottom: 6px; }
.pagehead .lead { margin: 0; color: var(--ink-2); line-height: 1.5; overflow-wrap: anywhere; }

.card-main, .way-main { box-shadow: inset 0 3px 0 var(--brand), var(--shadow); }
.way-danger { box-shadow: inset 0 3px 0 var(--crit); }
.way { padding: 18px; }
.wayhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.wayhead h2 { margin: 0; font-size: 16px; flex: 1 1 200px; min-width: 0; }

.banner.info { border-left-color: var(--info); background: var(--info-soft); }
.note {
  margin: 0; padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--ink-2); font-size: 13px;
}

/* крупные кнопки: палец попадает (44px), на телефоне — столбцом во всю ширину */
.btn.big { height: 44px; padding: 0 16px; font-size: 14px; }
.btns.actions { gap: 10px; }

/* ссылка и срок */
.expiry { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin: 0 0 16px; font-size: 14px; }
.expiry .pill { font-size: 12px; padding: 3px 10px; }
.expiry b { font-size: 16px; }
.issue-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 22px; align-items: start; }
.issue-grid.noqr { grid-template-columns: minmax(0, 1fr); }
.linkqr { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.linkqr .qr { width: 100%; max-width: 260px; height: auto; }
.linkqr figcaption { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
label.field { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.linkfield { width: 100%; min-height: 44px; font-size: 13px; text-overflow: ellipsis; }
.hints { margin: 0; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
.hints b { color: var(--ink); font-weight: 600; }

/* «Что меняется»: свёрнутая карточка-пояснение */
details.about { padding: 0; }
details.about > summary { cursor: pointer; font-weight: 600; font-size: 14px; min-height: 44px; display: flex; align-items: center; padding: 10px 40px 10px 16px; }
details.about > p { padding: 0 16px 16px; }
details.about[open] > summary { margin-bottom: 10px; }
details.about p { margin: 0; color: var(--ink-2); }

/* нумерованные шаги: кружок с номером и линия между шагами */
ol.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: flex; flex-direction: column; }
ol.steps > li {
  counter-increment: step; position: relative; min-width: 0;
  padding: 0 0 20px 40px; display: flex; flex-direction: column; gap: 10px;
}
ol.steps > li:last-child { padding-bottom: 0; }
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: -2px;
  width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center;
  border: 2px solid var(--brand); color: var(--link); background: var(--surface);
  font-weight: 700; font-size: 13px;
}
ol.steps > li:not(:last-child)::after {
  content: ""; position: absolute; left: 12px; top: 28px; bottom: 4px; width: 2px; background: var(--line);
}
ol.steps h3 { margin: 0; font-size: 14.5px; }
ol.steps p, ol.steps .banner { margin: 0; }

/* раскрывашки значения: длинная строка не занимает страницу */
details.reveal { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); min-width: 0; }
details.reveal > summary {
  cursor: pointer; padding: 10px 12px; min-height: 44px; display: flex; align-items: center;
  font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere;
}
details.reveal > summary:hover { color: var(--ink); }
details.reveal[open] > summary { border-bottom: 1px solid var(--line-soft); }
details.reveal > :not(summary) { margin: 10px 12px; }
details.reveal > :last-child { margin-bottom: 12px; }
textarea.valuebox {
  display: block; width: calc(100% - 24px); height: 9.5em; resize: vertical;
  white-space: pre-wrap; word-break: break-all; overflow-wrap: anywhere;
}

/* устройства: строки-кнопки, раскрытая обведена фирменным цветом */
.platforms { display: flex; flex-direction: column; gap: 8px; }
details.platform { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); min-width: 0; }
details.platform > summary, details.reveal > summary, details.about > summary { list-style: none; position: relative; padding-right: 36px; }
details.platform > summary::-webkit-details-marker, details.reveal > summary::-webkit-details-marker,
details.about > summary::-webkit-details-marker { display: none; }
details.platform > summary {
  cursor: pointer; min-height: 48px; padding: 10px 36px 10px 14px;
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px;
  font-weight: 600; font-size: 14px; color: var(--ink); border-radius: var(--r-sm);
}
details.platform > summary small { font-weight: 400; font-size: 12px; color: var(--muted); }
details.platform > summary:hover { background: var(--surface-2); }
details.platform > summary::after, details.reveal > summary::after, details.about > summary::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 7px; height: 7px; margin-top: -6px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .15s ease;
}
details.platform[open] > summary::after, details.reveal[open] > summary::after,
details.about[open] > summary::after { transform: rotate(-135deg); margin-top: -2px; }
details.platform[open] { border-color: var(--link); box-shadow: inset 3px 0 0 var(--link); }
details.platform[open] > summary { border-bottom: 1px solid var(--line-soft); border-radius: var(--r-sm) var(--r-sm) 0 0; }
details.platform > :not(summary) { margin: 10px 14px; }
details.platform > :last-child { margin-bottom: 14px; }
details.platform ol { padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.platform-mine > summary::before {
  content: "ваше устройство"; order: 3; font-size: 11px; font-weight: 600; padding: 1px 8px;
  border-radius: 999px; background: var(--brand-soft); color: var(--link);
}
.doneform { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin: 0; }

@media (max-width: 760px) {
  .issue-grid { grid-template-columns: minmax(0, 1fr); }
  .linkqr { align-items: center; text-align: center; }
  .linkqr .qr { max-width: 220px; }
}
@media (max-width: 560px) {
  .way { padding: 14px; }
  .btns.actions { flex-direction: column; align-items: stretch; }
  .btns.actions > .btn { width: 100%; white-space: normal; text-align: center; height: auto; min-height: 44px; padding: 8px 14px; }
  .doneform > .btn { width: 100%; }
  .way-danger form > .btn { width: 100%; }
  ol.steps > li { padding-left: 34px; }
  details.platform > :not(summary) { margin: 10px 12px; }
}

/* ---------------- страница конфига по ссылке (Task 9t): без входа, поэтому в колонке .login ----------------
   Три шага; QR фиксированного размера на белой подложке с тихой зоной в любой теме; текст конфига с
   закрытым ключом свёрнут; запасная загрузка с сервера подписана как запасная. */
.login > .linkpage { width: min(780px, 100%); }
.linkpage > .banner { margin: 0 0 10px; }
.linkpage > .card { margin: 6px 0 0; }
.getconf { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 22px; align-items: start; }
.getconf.noqr { grid-template-columns: minmax(0, 1fr); }
.confqr { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.confqr .qr { width: 280px; max-width: 100%; height: auto; padding: 14px; }
.confqr figcaption { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.fallback {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 0;
  padding-top: 10px; border-top: 1px dashed var(--line);
}
details.secret textarea.valuebox { height: 16em; white-space: pre; word-break: normal; overflow-wrap: normal; }
details.secret > .banner { margin-bottom: 0; }
@media (max-width: 760px) {
  .getconf { grid-template-columns: minmax(0, 1fr); }
  .confqr { align-items: center; text-align: center; }
  .confqr .qr { width: 260px; }
}
@media (max-width: 560px) {
  .fallback > .btn { width: 100%; }
}

/* ---------------- подсветка фона под курсором — .bgglow кабинета (shell.css), Task 9t ----------------
   Слой создаёт app.js при точной мыши и без «меньше движения» и пишет --glow-x / --glow-y; до первого
   движения мыши и после ухода курсора из окна слой прозрачный. Светятся линии сот (маска той же плитки),
   а не круг поверх страницы; прозрачность — токен --glow-hover (у кабинета .10 / .09 в тёмной). */
.bgglow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0; transition: opacity .45s ease;
  background-image: radial-gradient(circle 300px at var(--glow-x, 50%) var(--glow-y, 50%),
    rgba(var(--glow-rgb), 1) 0%, rgba(var(--glow-rgb), .7) 32%,
    rgba(var(--glow-rgb), .25) 62%, rgba(var(--glow-rgb), 0) 100%);
  background-repeat: no-repeat;
  -webkit-mask-image: var(--grid-mask); mask-image: var(--grid-mask);
  -webkit-mask-repeat: repeat; mask-repeat: repeat;
  -webkit-mask-size: var(--grid-tile); mask-size: var(--grid-tile);
  -webkit-mask-position: var(--grid-offset); mask-position: var(--grid-offset);
}
body.cursor-inside .bgglow { opacity: var(--glow-hover); }
@media (prefers-reduced-motion: reduce) { .bgglow { display: none; } }

/* ---------------- широкий экран (Task 9t): формы не растягиваются на 1900 px ----------------
   Таблицы по-прежнему во всю ширину карточки; формы ограничены и разложены в колонки. */
@media (min-width: 901px) {
  /* «Выпустить профиль»: слева поля (владелец, имя, затем сервер / маршруты), справа два режима карточками,
     кнопка отдельной строкой. Явно поставлен только блок режимов — поля встают по порядку сами. */
  .issue-form {
    display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
    gap: 14px 20px; max-width: 1000px; align-items: start;
  }
  .grid-form { max-width: 1180px; }
  .card > .inline-form:not(.compact) { max-width: 1180px; }
  /* две маленькие таблицы (трафик по режимам и по серверам) — рядом, когда места хватает */
  .cardpair { display: grid; grid-template-columns: repeat(auto-fit, minmax(460px, 1fr)); gap: 0 16px; align-items: start; }
}
#issue-form { scroll-margin-top: calc(var(--top-h) + 12px); }

/* ---------------- «Выпустить профиль» в шапке (Task 9t) ---------------- */
.topissue { height: 34px; padding: 0 12px 0 10px; }
.topissue svg { width: 16px; height: 16px; flex: none; }
@media (max-width: 640px) {
  .topissue { width: 44px; height: 44px; padding: 0; }
  .topissue span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .topissue svg { width: 20px; height: 20px; }
}

/* ---------------- «Обзор и статистика» (Task 9w): бывшая страница трафика на главной ----------------
   Плитки: четыре обзорные и три итога трафика одной сеткой без пустот (на телефоне — по две в ряд, правило
   .tiles выше). На широком экране две колонки: слева туннели и маленькие таблицы, справа график по дням;
   «По пользователям» — во всю ширину ниже. */
.dash-tiles { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.tile-traffic { box-shadow: inset 3px 0 0 var(--info); }
.stats-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap;
  margin: 4px 0 12px; scroll-margin-top: calc(var(--top-h) + 12px); }
.stats-head h2 { margin: 0; font-size: 16px; }
.stats-head .periods { margin: 0; }
.dash { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; align-items: start; }
.dash-col { min-width: 0; }
h3.subhead { margin: 16px 0 6px; font-size: 13.5px; }
@media (min-width: 1000px) {
  .dash { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (min-width: 901px) {
  .dash-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .dash-tiles { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
@media (max-width: 560px) { .dash-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------------- состояние сервисов в шапке — .statuspick кабинета (shell.css), Task 9w ----------------
   Кнопка-значок слева от аватара; точка-значок и сама кнопка красятся по худшему состоянию. Список
   прижат к экрану (fixed), позицию под кнопкой считает app.js; без скрипта список не открывается — есть
   страница /status. */
.statuspick { display: block; position: relative; flex: none; }
html:not(.js) .statuspick { display: none; }
.statuspick-btn { position: relative; }
.statuspick-btn[aria-expanded="true"] { background: var(--surface-2); color: var(--ink); }
.statuspick-badge {
  position: absolute; top: 4px; right: 4px; width: 9px; height: 9px;
  border-radius: 999px; background: var(--muted); box-shadow: 0 0 0 2px var(--surface);
}
.statuspick.is-ok .statuspick-badge { background: var(--ok); }
.statuspick.is-warning .statuspick-badge { background: var(--warn); }
.statuspick.is-error .statuspick-badge { background: var(--crit); }
.statuspick.is-warning .statuspick-btn { color: var(--warn); border-color: var(--warn); }
.statuspick.is-error .statuspick-btn { color: var(--crit); border-color: var(--crit); background: var(--crit-soft); }
.statuspick-list {
  position: fixed; z-index: 55; top: 0; left: 0;
  width: min(320px, calc(100vw - 16px)); padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-pop);
}
.statuspick-list[hidden] { display: none; }
.statuspick-rows { display: flex; flex-direction: column; gap: 2px; }
.statuspick-row {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 10px;
  border-radius: 9px; color: var(--ink); text-decoration: none;
}
.statuspick-row:hover, .statuspick-foot:hover { background: var(--surface-2); }
.statuspick-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--muted); flex: none; }
.statuspick-row.is-ok .statuspick-dot { background: var(--ok); }
.statuspick-row.is-warning .statuspick-dot { background: var(--warn); }
.statuspick-row.is-error .statuspick-dot { background: var(--crit); }
.statuspick-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; }
.statuspick-name { font-size: 14px; font-weight: 650; }
.statuspick-state { font-size: 13px; color: var(--muted); }
.statuspick-row.is-error .statuspick-name, .statuspick-row.is-error .statuspick-state { color: var(--crit); }
.statuspick-row.is-warning .statuspick-state { color: var(--warn); }
.statuspick-foot {
  display: flex; align-items: center; min-height: 44px; padding: 8px 10px; margin-top: 4px;
  border-top: 1px solid var(--line-soft); border-radius: 0 0 9px 9px;
  color: var(--link); font-weight: 600; font-size: 13px; text-decoration: none;
}
@media (max-width: 900px) { .statuspick-btn { width: 44px; height: 44px; } }
@media (max-width: 420px) {
  .top { gap: 6px; padding: 0 8px; }
  .topright { gap: 6px; }
  .statuspick-btn, .icobtn.menubtn, html.js .top > #menuBtn { width: 40px; height: 40px; }
  .topissue { width: 40px; height: 40px; }
}
@media (max-width: 340px) {
  .top { gap: 4px; padding: 0 6px; }
  .topright { gap: 4px; }
  .brandmark span { display: none; }
}

/* ---------------- «Список обхода VPN» (Task 9x) ----------------
   Светофор состояния, цветные плитки цифр, категории карточками со своей цветной полосой (оттенки — токены,
   текст всегда --ink: контраст не зависит от цвета категории), записи строками с цветной отметкой проверки и
   переключателем. Цвет категории задаёт --cat. */
.bp-state { display: flex; gap: 16px; align-items: flex-start; }
.bp-state h2 { margin: 0 0 4px; font-size: 17px; }
.bp-state p { margin: 0 0 4px; }
.bp-light { flex: none; width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line); }
.bp-light i { width: 22px; height: 22px; border-radius: 999px; background: var(--muted); }
.bp-ok .bp-light i { background: var(--ok); box-shadow: 0 0 0 6px var(--ok-soft); }
.bp-warn .bp-light i { background: var(--warn); box-shadow: 0 0 0 6px var(--warn-soft); }
.bp-error .bp-light i { background: var(--crit); box-shadow: 0 0 0 6px var(--crit-soft); }
.bp-ok { box-shadow: inset 0 3px 0 var(--ok); }
.bp-warn { box-shadow: inset 0 3px 0 var(--warn); }
.bp-error { box-shadow: inset 0 3px 0 var(--crit); }

.bp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 0 0 16px; }
.bp-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: inset 4px 0 0 var(--st, var(--line)); font-size: 12.5px; color: var(--muted); }
.bp-stat b { font-size: 24px; font-weight: 650; color: var(--ink); }
.st-info { --st: var(--info); }
.st-brand { --st: var(--brand); }
.st-ok { --st: var(--ok); }
.st-warn { --st: var(--warn); }
.st-muted { --st: var(--muted); }

.bp-attn { box-shadow: inset 0 3px 0 var(--warn); }
.bp-attn h2 { color: var(--warn); }
.bp-held p { margin: 0 0 8px; }
.bp-diff { list-style: none; margin: 0 0 12px; padding: 0; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 16px; font-size: 13px; }
.bp-diff li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--line-soft); }
.bp-diff .up { color: var(--ok); }
.bp-diff .down { color: var(--crit); }
.btn.btn-ok { background: var(--ok); border-color: var(--ok); color: var(--surface); }

.bp-toolbar {
  position: sticky; top: var(--top-h); z-index: 30;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
}
.bp-search { flex: 1 1 220px; max-width: 420px; }
.seg { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.seg .btn[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--link); color: var(--ink); font-weight: 600; }
.bp-refresh { margin: 0 0 0 auto; }

.bp-cats { column-width: 400px; column-gap: 12px; margin: 0 0 16px; }
.bpcat { --cat: var(--info); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; min-width: 0; break-inside: avoid; margin: 0 0 12px; }
.bpcat[hidden] { display: none; }
.cat-gov { --cat: var(--info); }
.cat-bank { --cat: var(--ok); }
.cat-shop { --cat: var(--op-mts); }
.cat-maps { --cat: var(--op-beeline); }
.cat-travel { --cat: var(--op-yota); }
.cat-telecom { --cat: var(--op-rostelecom); }
.cat-media { --cat: var(--warn); }
.cat-ddos { --cat: var(--muted); }
.bpcat-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 7px 10px;
  border-top: 4px solid var(--cat); background: color-mix(in srgb, var(--cat) 10%, var(--surface));
}
.bpcat-head h3 { margin: 0; font-size: 14.5px; flex: 1 1 140px; min-width: 0; }
.bpcat-count { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bpcat-head form { margin: 0; }
.bpcat-fold { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--surface); color: var(--ink-2); cursor: pointer; padding: 0; }
.bpcat-fold .chev { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); margin-top: -3px; transition: transform .15s ease; }
.bpcat-fold[aria-expanded="false"] .chev { transform: rotate(-45deg); margin-top: 0; }
.bpcat.is-off .bpcat-head { background: var(--surface-2); border-top-color: var(--line); }
.bpcat.is-off .bpcat-head h3 { color: var(--muted); }
.bpcat-body { list-style: none; margin: 0; padding: 0; }
.bpcat-body[hidden] { display: none; }
/* имя сверху, отметка проверки под ним, переключатель справа на всю высоту строки: длинное имя переносится,
   а тумблер не съезжает на новую строку */
.bpitem { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; row-gap: 1px; align-items: center;
  padding: 5px 10px; min-height: 0; border-top: 1px solid var(--line-soft); }
.bpitem > .bpitem-name { grid-column: 1; grid-row: 1; }
.bpitem > .badge { grid-column: 1; grid-row: 2; justify-self: start; white-space: normal; }
.bpitem > form { grid-column: 2; grid-row: 1 / span 2; }
.bpitem:first-child { border-top: 0; }
.bpitem-name { min-width: 0; font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.bpitem.is-off .bpitem-name { color: var(--muted); }
.bpitem form { margin: 0; }
.bpitem[hidden] { display: none; }
.badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 1px 7px; line-height: 1.4;
  border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.tone-crit { background: var(--crit-soft); color: var(--crit); }
.badge.tone-warn { background: var(--warn-soft); color: var(--warn); }
.badge.tone-ok { background: var(--ok-soft); color: var(--ok); }

/* переключатель: обычная кнопка формы (POST), а выглядит как тумблер; состояние — aria-checked */
.switch { position: relative; width: 46px; height: 26px; flex: none; padding: 0; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 999px;
  background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s ease; }
.switch[aria-checked="true"] { background: var(--ok); border-color: var(--ok); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.switch.small { width: 36px; height: 21px; }
.switch.small::after { width: 15px; height: 15px; }
.switch.small[aria-checked="true"]::after { transform: translateX(15px); }
.switch:hover { filter: brightness(.96); }
@media (max-width: 900px) {
  .bpitem-switch, .bpcat-switch { padding: 4px 0; }
}
.bp-history { list-style: none; margin: 0 0 12px 6px; padding: 0 0 0 16px; border-left: 2px solid var(--line); }
.bp-history li { position: relative; padding: 0 0 10px 6px; }
.bp-history li::before { content: ""; position: absolute; left: -23px; top: 5px; width: 10px; height: 10px; border-radius: 999px;
  background: var(--surface); border: 2px solid var(--line); }
.bp-history li.is-current::before { background: var(--ok); border-color: var(--ok); }
details.faq { margin: 0 0 8px; }
details.faq > p { margin: 0 12px 12px; color: var(--ink-2); }
details.bp-tech > summary { cursor: pointer; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; list-style: none; min-height: 32px; }
details.bp-tech > summary::-webkit-details-marker { display: none; }
details.bp-tech > summary h2 { margin: 0; }
details.bp-tech > summary h2::before { content: "▸ "; color: var(--muted); }
details.bp-tech[open] > summary h2::before { content: "▾ "; }
details.bp-tech[open] > summary { margin-bottom: 12px; }
details.bp-tech h3 { margin: 16px 0 8px; }
@media (max-width: 560px) {
  .bp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bp-stat b { font-size: 20px; }
  .bp-state { flex-direction: column; gap: 10px; }
  .bp-refresh { margin: 0; width: 100%; }
  .bp-refresh .btn { width: 100%; height: 44px; }
  .bp-search { max-width: none; min-height: 44px; }
  .seg .btn { height: 36px; }
}

/* ---------------- «Установите приложение» на страницах ссылки (Task 9z) ---------------- */
.apps-card .banner { margin-bottom: 12px; }
.applinks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.applinks a { font-weight: 600; display: inline-flex; align-items: center; min-height: 32px; }
.apps-card details.platform ol { margin-top: 4px; }

/* ---------------- график «По дням»: колонки «Обзора» одной высоты (Task 9w, правка) ----------------
   Подписи дней — HTML в равных ячейках (по одной на столбик, как слоты в traffic.chart), поэтому при
   растягивании SVG (preserveAspectRatio="none") тянутся только столбики, а текст нет. */
.chart-axis { display: flex; margin: 2px 0 8px; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-axis span { flex: 1 1 0; min-width: 0; text-align: center; white-space: nowrap; overflow: visible; }
.chart-foot p { margin: 0 0 4px; }
@media (min-width: 1000px) {
  .dash { align-items: stretch; }
  .dash-col:last-child { display: flex; flex-direction: column; }
  .dash-col:last-child > .chart-card { flex: 1 1 auto; display: flex; flex-direction: column; }
  .chart-card svg.chart { flex: 1 1 220px; min-height: 220px; height: auto; margin-bottom: 0; }
  .chart-card .chart-foot { margin-top: auto; }
}

/* ---------------- ракета при выпуске профиля (Task 9v, rocket.js) ----------------
   Один canvas поверх страницы на время ожидания; щелчки проходят сквозь него. При «меньше движения»
   ракеты нет: кнопка мягко светится (.rocket-quiet). */
.rocket-layer { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 80; pointer-events: none; }
.btn[data-busy="1"] { opacity: 1; cursor: progress; }
.btn.rocket-quiet { box-shadow: 0 0 0 4px var(--brand-soft); animation: rocket-glow 1.6s ease-in-out infinite; }
.btn.rocket-landed { box-shadow: 0 0 0 4px var(--ok-soft); animation: none; }
@keyframes rocket-glow { 50% { box-shadow: 0 0 0 7px var(--brand-soft); } }
.rocket-msg { margin-top: 10px; }

/* ---------------- таблицы: выравнивание (Task 9y) ----------------
   Вложенные таблицы профилей у всех владельцев одной раскладки: table-layout: fixed + общий colgroup, поэтому
   столбцы не прыгают от группы к группе. Числа справа и моноширинными цифрами, даты не переносятся, действия —
   одна аккуратная строка: «Обновить профиль», «⋯» (остальное), отдельно «Отозвать». */
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.date { font-variant-numeric: tabular-nums; white-space: nowrap; }
td.wrapcell { white-space: normal; overflow-wrap: anywhere; }
.table-wrap > table > tbody > tr:not(.tr-user):not(.tr-sub):nth-child(even) > td { background: var(--ground); }
.ptable { table-layout: fixed; min-width: 1060px; }
.ptable col.c-id { width: 52px; }
.ptable col.c-name { width: auto; }
.ptable col.c-mode { width: 110px; }
.ptable col.c-server { width: 150px; }
.ptable col.c-status { width: 190px; }
.ptable col.c-date { width: 128px; }
.ptable col.c-actions { width: 290px; }
.ptable td { vertical-align: top; }
.ptable td.actions, .ptable th.actions { text-align: right; position: relative; }   /* keeps .sr-only inside the scroller */
.row-actions { display: inline-flex; align-items: flex-start; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.row-actions form, .rcard-actions form { margin: 0; }
.row-actions form.revoke { margin-left: 8px; padding-left: 8px; border-left: 1px solid var(--line-soft); }
details.rowmenu { position: relative; }
details.rowmenu > summary { list-style: none; cursor: pointer; min-width: 32px; }
details.rowmenu > summary::-webkit-details-marker { display: none; }
details.rowmenu[open] > summary { background: var(--surface-2); }
.rowmenu-list { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; align-items: stretch; }
.rowmenu-list .btn { width: 100%; justify-content: flex-start; }
.profile-groups .group-head { align-items: center; }
.profile-groups .group-meta { font-variant-numeric: tabular-nums; justify-content: flex-end; }

/* ---------------- вид списка профилей: таблица или плашки (Task 9y) ----------------
   Оба вида отрисованы сервером; переключает класс на .pview (app.js, выбор помнится). Без выбора — таблица
   на широком экране и плашки на телефоне. */
.toolbar-right { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.viewpick .seg { position: relative; display: inline-flex; gap: 0; padding: 2px; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--surface-2); }
.viewpick .icobtn { position: relative; z-index: 1; border: 0; background: transparent; width: 34px; height: 30px; }
.viewpick .icobtn[aria-pressed="true"] { color: var(--ink); }
.viewpick .segdrop { position: absolute; z-index: 0; top: 2px; bottom: 2px; left: 2px; width: 34px;
  border-radius: calc(var(--r-sm) - 2px); background: var(--surface); box-shadow: var(--shadow);
  transition: transform .2s cubic-bezier(.22, 1, .36, 1); }
.viewpick[data-view="cards"] .segdrop { transform: translateX(34px); }
.cardgrid { display: none; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; padding: 12px 0 4px; }
.pview.view-cards .cardgrid { display: grid; }
.pview.view-cards .sub-wrap { display: none; }
@media (max-width: 700px) {
  .pview:not(.view-table) .cardgrid { display: grid; }
  .pview:not(.view-table) .sub-wrap { display: none; }
}
.rcard { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); white-space: normal; }
.rcard.dim { opacity: .6; }
.rcard header { display: flex; flex-wrap: wrap; gap: 6px; }
.pill.mode-bridge { background: var(--info-soft); color: var(--info); }
.pill.mode-direct { background: var(--brand-soft); color: var(--link); }
.rcard-title { font-weight: 650; font-size: 15px; overflow-wrap: anywhere; }
.rcard-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; margin: 0; font-size: 13px; }
.rcard-facts dt { color: var(--muted); }
.rcard-facts dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.rcard-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.rcard-actions form.revoke { margin-left: auto; }
.rcard-actions .btn { min-height: 36px; }
@media (max-width: 560px) {
  .rcard-actions .btn { min-height: 44px; }
  .pview .tr-sub > td { padding-left: 0; }
}

/* ---------------- вход по Face ID / отпечатку (Task 10a, static/passkey.js) ----------------
   Шаг биометрии на странице входа виден ВМЕСТО полей пароля, когда устройство помнит свой ключ: boot.js ставит
   html[data-pk="1"] до первой отрисовки, без скрипта атрибута нет — остаётся обычная форма. */
.pkstep { display: none; flex-direction: column; gap: 12px; }
html[data-pk="1"] .pkstep { display: flex; }
html[data-pk="1"] .loginbox .login-form { display: none; }
.pkstep-lead { color: var(--ink-2); }
.pkbtn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.pkbtn svg { width: 22px; height: 22px; flex: none; }
.loginbox .pkbtn { height: 48px; font-size: 15px; }
.loginbox .pkswitch { height: 36px; font-weight: 600; color: var(--link); border-color: transparent; }
.pkstep .banner, .pknote { margin: 0; }
.btn[aria-busy="true"] { opacity: 1; cursor: progress; }

.pkoffer { display: grid; grid-template-columns: auto 1fr; gap: 12px 14px; align-items: center; max-width: 860px; }
.pkoffer[hidden] { display: none; }
.pkoffer-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--info-soft); color: var(--info); }
.pkoffer-ico svg { width: 26px; height: 26px; }
.pkoffer h2 { margin: 0 0 4px; font-size: 16px; }
.pkoffer p { margin: 0; }
.pkoffer .btns { grid-column: 1 / -1; }
@media (min-width: 720px) {
  .pkoffer { grid-template-columns: auto 1fr auto; }
  .pkoffer .btns { grid-column: auto; }
}
.pkcard, .pkcard + .card { max-width: 860px; }
.pkform { max-width: 420px; }
.pkform input { width: 100%; }
.pkenroll .banner { margin: 12px 0 0; max-width: 560px; }
.pktable td .pill { margin-left: 6px; }
.pkfoot { margin: 12px 0 0; font-size: 12.5px; }
@media (max-width: 560px) {
  .pkform .btn, .pkoffer .btn { width: 100%; min-height: 44px; }
}
.pkoffer-go { border-color: var(--brand); color: var(--ink); font-weight: 650; }

/* «По пользователям»: полоса долей + легенда сверху, карточка тянется до низа экрана */
.ubar { display: block; width: 100%; height: 14px; margin: 4px 0 10px; border-radius: 999px; background: var(--surface-2); }
.ubar rect.c0 { fill: hsl(210 75% 52%); } .ubar rect.c1 { fill: hsl(152 60% 42%); } .ubar rect.c2 { fill: hsl(32 90% 52%); } .ubar rect.c3 { fill: hsl(280 55% 58%); }
.ubar rect.c4 { fill: hsl(350 70% 56%); } .ubar rect.c5 { fill: hsl(188 70% 42%); } .ubar rect.c6 { fill: hsl(60 70% 44%); } .ubar rect.c7 { fill: hsl(220 10% 55%); }
.ulegend { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; font-size: 12.5px; }
.ulegend li { display: flex; align-items: center; gap: 7px; min-width: 0; }
.ulegend .uname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 10px; height: 10px; border-radius: 999px; flex: none; display: inline-block; margin-right: 6px; vertical-align: middle; }
.ulegend .dot { margin: 0; }
.c0 { background: hsl(210 75% 52%); } .c1 { background: hsl(152 60% 42%); } .c2 { background: hsl(32 90% 52%); } .c3 { background: hsl(280 55% 58%); }
.c4 { background: hsl(350 70% 56%); } .c5 { background: hsl(188 70% 42%); } .c6 { background: hsl(60 70% 44%); } .c7 { background: hsl(220 10% 55%); }
meter.share.wide { display: block; width: 100%; max-width: 260px; height: 5px; margin: 5px 0 0 22px; }
.by-user-card .tr-user > td:first-child { padding-top: 10px; padding-bottom: 10px; }

fieldset.routes-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.routes-pick legend { grid-column: 1 / -1; }
fieldset.routes-pick label.radio { height: 100%; }

.issue-left, .issue-right { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.issue-left .btn { align-self: flex-start; }

/* «По пользователям»: одна плоская таблица — столбцы устройств выровнены с итогами пользователя; ширину можно менять */
.utable { table-layout: fixed; width: 100%; min-width: 980px; }
.utable th, .utable td { white-space: nowrap; }
.utable td.cut, .utable th { overflow: hidden; text-overflow: ellipsis; }
.utable th { position: relative; }
.utable .tr-user > td { background: var(--surface-2); border-top: 1px solid var(--line); }
.utable tr.tr-dev > td { background: transparent; padding: 5px 10px; font-size: 12.5px; }
.utable tr.tr-dev > td:first-child { padding-left: 42px; }
.utable tr.tr-dev.dim > td { color: var(--muted); }
.utable tr.tr-dev:hover { background: var(--surface-2); }
.col-grip { position: absolute; top: 0; right: -4px; width: 9px; height: 100%; cursor: col-resize; z-index: 2; touch-action: none; }
.col-grip::after { content: ""; position: absolute; top: 25%; bottom: 25%; left: 4px; width: 1px; background: var(--line); }
.col-grip:hover::after, .col-grip.drag::after { background: var(--link); width: 2px; left: 3px; }
.utable col:nth-child(1) { width: 230px; } .utable col:nth-child(2) { width: 110px; } .utable col:nth-child(3) { width: 130px; }
.utable col:nth-child(4) { width: 96px; } .utable col:nth-child(5) { width: 100px; } .utable col:nth-child(6) { width: 110px; }
.utable col:nth-child(7) { width: 100px; } .utable col:nth-child(8) { width: 150px; }
