/* Панель PCS. Две темы, без сборки и без CDN.
   Система: один шрифт (Geist, моно — для адресов и портов), шаг отступов 4 px, один акцент,
   цвета состояний — только для состояний. Поверхности разделяет тон, линии — только в таблицах.
   Движение — transform и opacity, ease-out на вход; при prefers-reduced-motion — без перемещений. */

@font-face { font-family: "Geist"; src: url("fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  /* светлая */
  --bg: #f4f5f7; --side: #eceef2; --s1: #ffffff; --s2: #f7f8fa; --s3: #eef0f4; --hover: rgba(15, 23, 42, .045);
  --line: rgba(15, 23, 42, .08); --line2: rgba(15, 23, 42, .14);
  --fg: #111723; --fg2: #4a5262; --fg3: #8a92a2;
  --accent: hsl(221 72% 52%); --accent-fg: #fff; --accent-soft: hsl(221 80% 52% / .1);
  --ok: hsl(152 58% 36%); --warn: hsl(36 88% 42%); --bad: hsl(2 68% 50%); --info: hsl(206 70% 46%); --off: #a2a9b6;
  --ok-bg: hsl(152 55% 40% / .11); --warn-bg: hsl(38 90% 50% / .13); --bad-bg: hsl(2 70% 52% / .1); --info-bg: hsl(206 70% 50% / .1);
  --shadow-pop: 0 18px 40px -18px rgba(15, 23, 42, .35), 0 2px 6px -2px rgba(15, 23, 42, .12);
  --skel: rgba(15, 23, 42, .06); --skel-hi: rgba(15, 23, 42, .11);
  --chip-l: 46%;
  color-scheme: light;
  /* космос (украшения, не данные): звёзды, орбиты, планета на входе */
  --cos-star: hsl(244 45% 45% / .4); --cos-orbit: hsl(246 60% 50% / .2); --cos-sat: hsl(250 80% 58%);
  --cos-p0: #f3f1ff; --cos-p1: #d6d0fb; --cos-p2: #b9adf1; --cos-rim: hsl(250 90% 72% / .55);
  --wm-tint: hsl(248 62% 52%); --wm-orbit: hsl(248 70% 55% / .55);
  --cos-stars: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='620' height='620'%3E%3Ccircle cx='202' cy='96' r='0.9' fill='%23fff' fill-opacity='0.52'/%3E%3Ccircle cx='402' cy='48' r='1' fill='%23fff' fill-opacity='0.97'/%3E%3Ccircle cx='332' cy='228' r='1' fill='%23fff' fill-opacity='0.89'/%3E%3Ccircle cx='39' cy='315' r='1.2' fill='%23fff' fill-opacity='0.99'/%3E%3Ccircle cx='27' cy='269' r='0.9' fill='%23fff' fill-opacity='0.45'/%3E%3Ccircle cx='47' cy='60' r='0.7' fill='%23fff' fill-opacity='0.54'/%3E%3Ccircle cx='264' cy='510' r='0.8' fill='%23fff' fill-opacity='0.6'/%3E%3Ccircle cx='80' cy='141' r='1' fill='%23fff' fill-opacity='0.77'/%3E%3Ccircle cx='388' cy='584' r='1' fill='%23fff' fill-opacity='0.9'/%3E%3Ccircle cx='601' cy='33' r='1' fill='%23fff' fill-opacity='0.95'/%3E%3Ccircle cx='529' cy='181' r='0.9' fill='%23fff' fill-opacity='0.88'/%3E%3Ccircle cx='92' cy='76' r='0.7' fill='%23fff' fill-opacity='0.9'/%3E%3Ccircle cx='193' cy='503' r='0.7' fill='%23fff' fill-opacity='0.95'/%3E%3Ccircle cx='115' cy='360' r='1.4' fill='%23fff' fill-opacity='0.83'/%3E%3Ccircle cx='395' cy='232' r='0.8' fill='%23fff' fill-opacity='0.69'/%3E%3Ccircle cx='339' cy='42' r='0.8' fill='%23fff' fill-opacity='0.66'/%3E%3Ccircle cx='40' cy='130' r='1.2' fill='%23fff' fill-opacity='0.6'/%3E%3Ccircle cx='420' cy='266' r='1.4' fill='%23fff' fill-opacity='0.97'/%3E%3Ccircle cx='196' cy='362' r='1.2' fill='%23fff' fill-opacity='0.64'/%3E%3Ccircle cx='281' cy='187' r='1' fill='%23fff' fill-opacity='0.85'/%3E%3Ccircle cx='490' cy='432' r='0.7' fill='%23fff' fill-opacity='0.83'/%3E%3Ccircle cx='153' cy='356' r='0.8' fill='%23fff' fill-opacity='1.0'/%3E%3Ccircle cx='325' cy='540' r='0.7' fill='%23fff' fill-opacity='0.49'/%3E%3Ccircle cx='450' cy='180' r='1' fill='%23fff' fill-opacity='0.88'/%3E%3Ccircle cx='604' cy='76' r='0.8' fill='%23fff' fill-opacity='0.77'/%3E%3Ccircle cx='260' cy='467' r='1' fill='%23fff' fill-opacity='0.99'/%3E%3Ccircle cx='97' cy='303' r='1.2' fill='%23fff' fill-opacity='0.96'/%3E%3Ccircle cx='28' cy='413' r='0.8' fill='%23fff' fill-opacity='0.73'/%3E%3Ccircle cx='472' cy='355' r='0.8' fill='%23fff' fill-opacity='0.41'/%3E%3Ccircle cx='430' cy='368' r='1.4' fill='%23fff' fill-opacity='0.98'/%3E%3Ccircle cx='359' cy='283' r='1.2' fill='%23fff' fill-opacity='0.46'/%3E%3Ccircle cx='518' cy='582' r='1.2' fill='%23fff' fill-opacity='0.96'/%3E%3Ccircle cx='294' cy='410' r='1' fill='%23fff' fill-opacity='0.99'/%3E%3Ccircle cx='240' cy='413' r='0.8' fill='%23fff' fill-opacity='0.9'/%3E%3Ccircle cx='40' cy='474' r='0.8' fill='%23fff' fill-opacity='0.42'/%3E%3Ccircle cx='505' cy='533' r='0.8' fill='%23fff' fill-opacity='0.58'/%3E%3Ccircle cx='174' cy='258' r='0.8' fill='%23fff' fill-opacity='0.86'/%3E%3Ccircle cx='224' cy='545' r='0.9' fill='%23fff' fill-opacity='0.56'/%3E%3Ccircle cx='147' cy='301' r='1' fill='%23fff' fill-opacity='0.9'/%3E%3Ccircle cx='365' cy='165' r='0.7' fill='%23fff' fill-opacity='0.95'/%3E%3Ccircle cx='587' cy='427' r='0.9' fill='%23fff' fill-opacity='0.94'/%3E%3Ccircle cx='319' cy='382' r='1.2' fill='%23fff' fill-opacity='0.75'/%3E%3Ccircle cx='555' cy='481' r='1' fill='%23fff' fill-opacity='0.65'/%3E%3Ccircle cx='244' cy='248' r='1' fill='%23fff' fill-opacity='0.48'/%3E%3Ccircle cx='67' cy='392' r='0.8' fill='%23fff' fill-opacity='0.71'/%3E%3Ccircle cx='132' cy='103' r='0.7' fill='%23fff' fill-opacity='0.92'/%3E%3Ccircle cx='212' cy='36' r='1.4' fill='%23fff' fill-opacity='0.51'/%3E%3Ccircle cx='4' cy='97' r='0.7' fill='%23fff' fill-opacity='0.87'/%3E%3Ccircle cx='66' cy='227' r='0.8' fill='%23fff' fill-opacity='0.5'/%3E%3Ccircle cx='20' cy='539' r='1' fill='%23fff' fill-opacity='0.77'/%3E%3Ccircle cx='380' cy='95' r='0.7' fill='%23fff' fill-opacity='0.73'/%3E%3Ccircle cx='158' cy='217' r='0.9' fill='%23fff' fill-opacity='0.81'/%3E%3Ccircle cx='289' cy='300' r='1' fill='%23fff' fill-opacity='0.73'/%3E%3Ccircle cx='214' cy='166' r='1.4' fill='%23fff' fill-opacity='0.87'/%3E%3Ccircle cx='511' cy='103' r='1' fill='%23fff' fill-opacity='0.43'/%3E%3Ccircle cx='18' cy='586' r='0.8' fill='%23fff' fill-opacity='0.57'/%3E%3Ccircle cx='327' cy='94' r='1.4' fill='%23fff' fill-opacity='0.46'/%3E%3Ccircle cx='327' cy='603' r='1' fill='%23fff' fill-opacity='0.74'/%3E%3Ccircle cx='532' cy='430' r='1.4' fill='%23fff' fill-opacity='0.94'/%3E%3Ccircle cx='106' cy='476' r='0.7' fill='%23fff' fill-opacity='0.67'/%3E%3Ccircle cx='330' cy='481' r='1' fill='%23fff' fill-opacity='0.98'/%3E%3Ccircle cx='21' cy='175' r='1' fill='%23fff' fill-opacity='0.71'/%3E%3Cpath transform='translate%28112 418%29 scale%281%29' d='M0 -5Q.7 -.7 5 0Q.7 .7 0 5Q-.7 .7 -5 0Q-.7 -.7 0 -5Z' fill='%23fff'/%3E%3Cpath transform='translate%28488 96%29 scale%280.8%29' d='M0 -5Q.7 -.7 5 0Q.7 .7 0 5Q-.7 .7 -5 0Q-.7 -.7 0 -5Z' fill='%23fff'/%3E%3Cpath transform='translate%28322 262%29 scale%280.55%29' d='M0 -5Q.7 -.7 5 0Q.7 .7 0 5Q-.7 .7 -5 0Q-.7 -.7 0 -5Z' fill='%23fff'/%3E%3Cpath transform='translate%28560 530%29 scale%280.65%29' d='M0 -5Q.7 -.7 5 0Q.7 .7 0 5Q-.7 .7 -5 0Q-.7 -.7 0 -5Z' fill='%23fff'/%3E%3C/svg%3E");
  --cos-rings: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='760' height='760' fill='none' stroke='%23fff'%3E%3Ccircle cx='380' cy='380' r='378' stroke-width='1.2'/%3E%3Ccircle cx='380' cy='380' r='300' stroke-width='1' stroke-dasharray='2 9'/%3E%3Ccircle cx='380' cy='380' r='216' stroke-width='1' stroke-opacity='.6'/%3E%3C/svg%3E");
  --cos-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%23fff'%3E%3Ccircle cx='16' cy='16' r='6.2' fill='%23fff' stroke='none'/%3E%3Cellipse cx='16' cy='16' rx='13' ry='4.4' stroke-width='1.6' transform='rotate%28-24 16 16%29'/%3E%3Ccircle cx='26.4' cy='10.6' r='1.7' fill='%23fff' stroke='none'/%3E%3C/svg%3E");

  --sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r1: 7px; --r2: 10px; --r3: 14px;
  --side-w: 280px;
  /* строки таблиц: чётные — чуть темнее/светлее карточки, наведение — с оттенком акцента */
  --zebra: color-mix(in srgb, var(--s1) 96.5%, var(--fg));
  --row-hover: color-mix(in srgb, var(--s1) 90%, var(--accent));
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --t-press: 120ms; --t-hover: 160ms; --t-ui: 220ms; --t-page: 380ms;
}
:root[data-theme="dark"] {
  --bg: #0b0d11; --side: #0f1217; --s1: #13171d; --s2: #171c23; --s3: #1d232b; --hover: rgba(255, 255, 255, .04);
  --line: rgba(255, 255, 255, .065); --line2: rgba(255, 255, 255, .11);
  --fg: #e8ebf0; --fg2: #a4acb9; --fg3: #6c7484;
  --accent: hsl(221 78% 66%); --accent-fg: #0b0e14; --accent-soft: hsl(221 80% 66% / .13);
  --ok: hsl(152 52% 52%); --warn: hsl(38 86% 60%); --bad: hsl(2 74% 64%); --info: hsl(206 72% 63%); --off: #586070;
  --ok-bg: hsl(152 50% 50% / .12); --warn-bg: hsl(38 86% 58% / .12); --bad-bg: hsl(2 74% 62% / .13); --info-bg: hsl(206 72% 60% / .12);
  --shadow-pop: 0 22px 48px -20px rgba(0, 0, 0, .8), 0 2px 8px -2px rgba(0, 0, 0, .5);
  --skel: rgba(255, 255, 255, .05); --skel-hi: rgba(255, 255, 255, .1);
  --chip-l: 62%;
  color-scheme: dark;
  --cos-star: hsl(232 80% 92% / .75); --cos-orbit: hsl(236 80% 78% / .18); --cos-sat: hsl(190 100% 80%);
  --cos-p0: #3b2f9a; --cos-p1: #1c1758; --cos-p2: #0b0d22; --cos-rim: hsl(196 100% 70% / .5);
  --wm-tint: hsl(214 95% 82%); --wm-orbit: hsl(220 90% 78% / .5);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d11; --side: #0f1217; --s1: #13171d; --s2: #171c23; --s3: #1d232b; --hover: rgba(255, 255, 255, .04);
    --line: rgba(255, 255, 255, .065); --line2: rgba(255, 255, 255, .11);
    --fg: #e8ebf0; --fg2: #a4acb9; --fg3: #6c7484;
    --accent: hsl(221 78% 66%); --accent-fg: #0b0e14; --accent-soft: hsl(221 80% 66% / .13);
    --ok: hsl(152 52% 52%); --warn: hsl(38 86% 60%); --bad: hsl(2 74% 64%); --info: hsl(206 72% 63%); --off: #586070;
    --ok-bg: hsl(152 50% 50% / .12); --warn-bg: hsl(38 86% 58% / .12); --bad-bg: hsl(2 74% 62% / .13); --info-bg: hsl(206 72% 60% / .12);
    --shadow-pop: 0 22px 48px -20px rgba(0, 0, 0, .8), 0 2px 8px -2px rgba(0, 0, 0, .5);
    --skel: rgba(255, 255, 255, .05); --skel-hi: rgba(255, 255, 255, .1);
    --chip-l: 62%;
    color-scheme: dark;
    --cos-star: hsl(232 80% 92% / .75); --cos-orbit: hsl(236 80% 78% / .18); --cos-sat: hsl(190 100% 80%);
    --cos-p0: #3b2f9a; --cos-p1: #1c1758; --cos-p2: #0b0d22; --cos-rim: hsl(196 100% 70% / .5);
    --wm-tint: hsl(214 95% 82%); --wm-orbit: hsl(220 90% 78% / .5);
  }
}

/* ── основа ─────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--fg); font: 14px/1.5 var(--sans); font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .2em; }
h1 { font-size: 22px; line-height: 1.2; margin: 0; font-weight: 620; letter-spacing: -.02em; text-wrap: balance; }
h2 { font-size: 15px; margin: 28px 0 10px; font-weight: 600; letter-spacing: -.01em; }
h2:first-child { margin-top: 0; }
.muted { color: var(--fg2); }
.mono, code { font-family: var(--mono); font-size: .93em; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.spacer { flex: 1; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ── кнопки и поля ──────────────────────────────────────────────────────── */
button, .btn {
  font: inherit; font-size: 13px; font-weight: 500; line-height: 20px; padding: 5px 12px; border-radius: var(--r1);
  border: 1px solid var(--line2); background: var(--s1); color: var(--fg); cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  transition: background-color var(--t-hover) ease, border-color var(--t-hover) ease, color var(--t-hover) ease, transform var(--t-press) var(--ease-out);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:hover { text-decoration: none; }
@media (hover: hover) and (pointer: fine) {
  button:hover:not(:disabled), .btn:hover { background: var(--s3); border-color: var(--line2); }
  button.primary:hover:not(:disabled), .btn.primary:hover { filter: brightness(1.07); background: var(--accent); }
}
button:active:not(:disabled), .btn:active { transform: scale(.97); }
button:disabled { opacity: .45; cursor: default; }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-fg); border-color: transparent; }
button.danger { color: var(--bad); }
button.danger.solid { background: var(--bad); color: #fff; border-color: transparent; }
button.link { border: 0; background: none; color: var(--accent); padding: 0 2px; font-weight: 500; }
@media (hover: hover) { button.link:hover:not(:disabled) { background: none; text-decoration: underline; text-underline-offset: .2em; } }
button.ghost { border-color: transparent; background: none; color: var(--fg2); }
@media (hover: hover) { button.ghost:hover:not(:disabled) { color: var(--fg); background: var(--hover); } }
button.icon { padding: 3px 8px; min-width: 30px; justify-content: center; }
button svg, .btn svg, .ic { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

input, select, textarea {
  font: inherit; font-size: 13px; color: var(--fg); background: var(--s1); border: 1px solid var(--line2);
  border-radius: var(--r1); padding: 5px 9px; line-height: 20px;
  transition: border-color var(--t-hover) ease, box-shadow var(--t-hover) ease;
}
input::placeholder, textarea::placeholder { color: var(--fg3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); margin: 0; }
textarea { font-family: var(--mono); font-size: 12.5px; width: 100%; }
select { background-color: var(--s1); color: var(--fg); }

/* ── каркас ─────────────────────────────────────────────────────────────── */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 50; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity 300ms ease; }
.progress::before { content: ""; position: absolute; inset: 0; width: 40%; background: var(--accent); border-radius: 2px; transform: translateX(-100%); }
.progress.on { opacity: 1; }
.progress.on::before { animation: progress-run 1.1s var(--ease-io) infinite; }
@keyframes progress-run { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); height: 100%; }
.side { background: var(--side); display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.side-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 640; font-size: 14px; letter-spacing: -.005em; color: var(--fg); min-width: 0; }
.brand:hover { text-decoration: none; }
.brand .mark, .login-brand .mark { width: 28px; height: 28px; border-radius: 7px; flex: none; display: block; }

.side-search { margin: 0 12px 8px; position: relative; display: block; }
.side-search .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--fg3); width: 15px; height: 15px; pointer-events: none; }
.side-search input { width: 100%; padding-left: 32px; background: var(--s1); border-color: var(--line); }
nav#tree { flex: 1; overflow: auto; padding: 4px 8px 16px; overscroll-behavior: contain; }
.side-foot { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--fg2); }
.side-foot #h-user { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main-col { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; isolation: isolate; overflow: hidden; }
header.top {
  height: 52px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 28px;
  border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent);
}
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13.5px; color: var(--fg2); }
.crumbs a { color: var(--fg2); white-space: nowrap; }
.crumbs a:hover { color: var(--fg); text-decoration: none; }
.crumbs .sep { color: var(--fg3); }
.crumbs b { color: var(--fg); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-sum { display: flex; gap: 14px; align-items: center; font-size: 12.5px; color: var(--fg2); }
.top-sum .dot { margin-right: 6px; }
.top-sum > span { white-space: nowrap; }
@media (max-width: 1180px) { .top-sum > span.num { display: none; } }
main#main { flex: 1; overflow: auto; padding: 28px 28px 64px; min-width: 0; scroll-behavior: smooth; }
.page { max-width: 1320px; margin: 0 auto; }
.menu-btn { display: none; }

/* ── дерево хостов и ВМ ─────────────────────────────────────────────────── */
.t-host { margin-top: 6px; }
.t-host:first-child { margin-top: 0; }
.t-row {
  position: relative; display: grid; grid-template-columns: 16px 10px minmax(0, 1fr) auto; align-items: center; column-gap: 8px;
  padding: 6px 8px; border-radius: var(--r1); color: var(--fg); min-height: 34px;
  transition: background-color var(--t-hover) ease, color var(--t-hover) ease;
}
.t-row:hover { background: var(--hover); text-decoration: none; }
.t-row.active { background: var(--s1); box-shadow: 0 0 0 1px var(--line); }
.t-row.active::before { content: ""; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); animation: bar-in var(--t-ui) var(--ease-out); }
@keyframes bar-in { from { transform: scaleY(.3); opacity: 0; } to { transform: none; opacity: 1; } }
.t-twist { width: 16px; height: 16px; display: grid; place-items: center; border: 0; background: none; padding: 0; color: var(--fg3); border-radius: 4px; }
.t-twist .ic { width: 14px; height: 14px; transition: transform var(--t-ui) var(--ease-out); }
.t-host.closed .t-twist .ic { transform: rotate(-90deg); }
.t-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.t-host > .t-row .t-name { font-weight: 650; }
.t-meta { font-size: 11.5px; color: var(--fg3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.t-kids { display: grid; grid-template-rows: 1fr; transition: grid-template-rows var(--t-ui) var(--ease-out); }
.t-host.closed .t-kids { grid-template-rows: 0fr; }
.t-kids > div { overflow: hidden; position: relative; padding-left: 10px; }
.t-kids > div::before { content: ""; position: absolute; left: 15px; top: 2px; bottom: 6px; width: 1px; background: var(--line2); }
.t-vm { grid-template-columns: 6px 10px minmax(0, 1fr) auto; padding-left: 14px; }
.t-vm .chip { width: 6px; height: 18px; border-radius: 3px; background: hsl(var(--h, 220) 62% var(--chip-l)); }
.t-vm .t-name b { font-weight: 600; font-variant-numeric: tabular-nums; margin-right: 6px; color: var(--fg2); }
.t-vm.active .t-name b { color: var(--fg); }
.t-vm .t-meta { display: inline-flex; align-items: center; gap: 6px; }
.t-add { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 30px; color: var(--fg3); font-size: 13px; border-radius: var(--r1); }
.t-add:hover { color: var(--accent); background: var(--hover); text-decoration: none; }
.t-add .ic { width: 14px; height: 14px; }
.t-add.active { color: var(--accent); background: var(--s1); box-shadow: 0 0 0 1px var(--line); }
.t-sec { margin: 18px 8px 6px; font-size: 12px; color: var(--fg3); font-weight: 500; }
.t-empty { padding: 10px 12px; color: var(--fg3); font-size: 13px; }
.t-row.off .t-name, .t-row.off .t-meta { opacity: .55; }

/* маленькая шкала «сколько модемов работает» */
.meter { --v: 0; display: inline-block; width: 34px; height: 4px; border-radius: 3px; background: var(--line2); position: relative; overflow: hidden; vertical-align: middle; }
.meter::after { content: ""; position: absolute; inset: 0; background: var(--ok); transform-origin: left; transform: scaleX(var(--v)); transition: transform 600ms var(--ease-out); border-radius: 3px; }
.meter.warn::after { background: var(--warn); } .meter.bad::after { background: var(--bad); }
.meter.lg { width: 100%; height: 6px; }

/* ── состояние ──────────────────────────────────────────────────────────── */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--off); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
.dot.info { background: var(--info); box-shadow: 0 0 0 3px var(--info-bg); }
.dot.off { background: var(--off); }
.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; white-space: nowrap; color: var(--fg); }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--s3); color: var(--fg2); white-space: nowrap; }
.tag.ok { background: var(--ok-bg); color: var(--ok); } .tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.bad { background: var(--bad-bg); color: var(--bad); } .tag.info { background: var(--info-bg); color: var(--info); }
.badge { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); font-weight: 500; }
.res { font-size: 13px; color: var(--fg2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60ch; }
.res.ok { color: var(--ok); } .res.err { color: var(--bad); white-space: normal; } .res.run { color: var(--fg2); }
.res.run::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 7px; vertical-align: -1px; border-radius: 50%; border: 2px solid var(--line2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.problems { font-size: 12.5px; color: var(--warn); }
.banner { padding: 10px 14px; border-radius: var(--r2); margin-bottom: 16px; background: var(--bad-bg); color: var(--bad); font-size: 13.5px; }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.info { background: var(--info-bg); color: var(--info); }

/* ── шапка страницы и вкладки ───────────────────────────────────────────── */
.ph { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px 14px; margin-bottom: 20px; }
.ph .chip { width: 10px; min-height: 40px; align-self: stretch; border-radius: 5px; background: hsl(var(--h, 221) 62% var(--chip-l)); grid-row: span 2; }
.ph h1 { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.ph h1 .id { color: var(--fg3); font-weight: 500; font-variant-numeric: tabular-nums; }
.ph .meta { grid-column: 2; display: flex; flex-wrap: wrap; gap: 4px 0; font-size: 13px; color: var(--fg2); }
.ph .meta { column-gap: 16px; }
.ph .meta > span { white-space: nowrap; }
.ph .side-r { grid-row: 1 / span 2; grid-column: 3; display: flex; align-items: center; gap: 10px; }
.ph.plain { grid-template-columns: minmax(0, 1fr) auto; }
.ph.plain .meta { grid-column: 1; }
.ph.plain .side-r { grid-column: 2; }

.tabs { position: relative; display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 9px 12px 11px; color: var(--fg2); font-weight: 500; font-size: 13.5px; white-space: nowrap; transition: color var(--t-hover) ease; border-radius: var(--r1) var(--r1) 0 0; }
.tabs a:hover { color: var(--fg); text-decoration: none; background: var(--hover); }
.tabs a.active { color: var(--fg); }
.tabs .ind { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100px; background: var(--accent); border-radius: 2px; transform-origin: left;
  transition: transform var(--t-ui) var(--ease-io); pointer-events: none; }

/* ── панели, показатели, списки ─────────────────────────────────────────── */
.panel { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r2); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); background: var(--s1); border: 1px solid var(--line); border-radius: var(--r2); margin-bottom: 28px; }
.kpi { padding: 16px 20px 18px; position: relative; min-width: 0; }
.kpi + .kpi::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 1px; background: var(--line); }
.kpi .k { font-size: 12.5px; color: var(--fg2); }
.kpi .v { font-size: 26px; font-weight: 620; letter-spacing: -.02em; line-height: 1.25; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .v small { font-size: 15px; color: var(--fg3); font-weight: 500; margin-left: 2px; }
.kpi .v.warn { color: var(--warn); } .kpi .v.bad { color: var(--bad); }
.kpi .meter { margin-top: 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 0 0 24px; }
.card { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r2); padding: 14px 16px; }
.card .k { font-size: 12.5px; color: var(--fg2); }
.card .v { font-size: 22px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.card .v.warn { color: var(--warn); } .card .v.bad { color: var(--bad); }

.sec-head { display: flex; align-items: center; gap: 10px; margin: 28px 0 10px; }
.sec-head h2 { margin: 0; }
.sec-head .count { font-size: 12.5px; color: var(--fg3); font-variant-numeric: tabular-nums; }
.sec-head:first-child { margin-top: 0; }

.list { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; }
.list .item { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line); transition: background-color var(--t-hover) ease; }
.list .item:first-child { border-top: 0; }
.list > .item:where(:nth-child(even of .item)) { background: var(--zebra); }
.list .item:hover { background: var(--row-hover); }
.item .title { font-weight: 600; }
.item .title .id { color: var(--fg3); font-weight: 500; margin-right: 6px; font-variant-numeric: tabular-nums; }
.item .sub { font-size: 12.5px; color: var(--fg2); }
.item .grow { flex: 1; min-width: 0; }
.item .btns { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.item.muted { color: var(--fg2); }

/* строки ВМ на странице хоста */
.vmrow { display: grid; grid-template-columns: 10px minmax(180px, 1.4fr) minmax(70px, .5fr) minmax(150px, 1fr) minmax(110px, .7fr) 196px; align-items: center; gap: 16px; padding: 12px 16px; border-top: 1px solid var(--line); transition: background-color var(--t-hover) ease; }
.vmrow:first-child { border-top: 0; }
.vmrow:where(:nth-child(even of .vmrow)) { background: var(--zebra); }
.vmrow:hover { background: var(--row-hover); }
.vmrow .who { min-width: 0; }
.vmrow .who a { color: var(--fg); font-weight: 600; }
.vmrow .who a .id { color: var(--fg3); font-weight: 500; margin-right: 6px; font-variant-numeric: tabular-nums; }
.vmrow .who .sub { font-size: 12.5px; color: var(--fg2); font-family: var(--mono); }
.vmrow .cell { font-size: 13px; color: var(--fg2); min-width: 0; }
.vmrow .mod { display: grid; gap: 6px; }
.vmrow .mod b { font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums; }
.vmrow .row-acts { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.vmhead { color: var(--fg3); font-size: 12px; padding-top: 10px; padding-bottom: 10px; background: var(--s2); }
.vmhead:hover { background: var(--s2); }
@media (max-width: 1100px) { .vmrow { grid-template-columns: 10px minmax(0, 1fr) 196px; } .vmrow .cell { display: none; } }

/* действия-строки (настройка): название и пояснение слева, управление справа */
.acts-list, .acts { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r2); }
.act { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: 6px 28px; padding: 16px 20px; border-top: 1px solid var(--line); }
.act:first-child { border-top: 0; }
.act .name { font-weight: 600; }
.act .hint { font-size: 12.5px; color: var(--fg2); margin-top: 2px; line-height: 1.45; }
.act .ctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.act .ctl input[type="text"], .act .ctl input[type="password"], .act .ctl input:not([type]) { min-width: 220px; flex: 1; max-width: 420px; }
.act .joblog { grid-column: 1 / -1; margin-top: 4px; }
.act .joblog:empty, .act > .joblog:has(> .joblog-slot:empty) { display: none; }
.act .ctl { align-self: center; }
/* вкладка «настройка»: сведения чипами, дальше разделы */
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 24px; min-height: 26px; align-items: center; }
.facts > span:not(.skel) { background: var(--s1); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 12.5px; color: var(--fg2); white-space: nowrap; }
.set-sec + .set-sec { margin-top: 28px; }
.set-sec > h2 { margin: 0 0 10px; font-size: 13px; color: var(--fg2); font-weight: 600; }
.stagger-sec > * { animation: row-in 360ms var(--ease-out) both; }
.stagger-sec > :nth-child(2) { animation-delay: 40ms; } .stagger-sec > :nth-child(3) { animation-delay: 80ms; }
.stagger-sec > :nth-child(4) { animation-delay: 120ms; } .stagger-sec > :nth-child(5) { animation-delay: 160ms; }
@media (max-width: 860px) { .act { grid-template-columns: 1fr; } }

/* панель инструментов вкладки */
.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; }
.toolbar .res { margin-left: 4px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; margin: 0 0 18px; font-size: 13.5px; }
.kv .k { color: var(--fg2); }
.srcline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; font-size: 13px; color: var(--fg2); margin: -6px 0 18px; }
.srcline { column-gap: 16px; }
.srcline a { max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }

/* вкладка «Сетевые интерфейсы»: физические и виртуальные модемы */
.net-sum { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 13px; color: var(--fg2); margin: 0 0 18px; }
.net-sum b { color: var(--fg); font-variant-numeric: tabular-nums; }
.net-sec + .net-sec { margin-top: 32px; }
.net-sec > .sec-head { margin-top: 0; }
.net-sec.empty > .sec-head h2 { color: var(--fg2); }
.net-sec .row-tools { display: inline-flex; gap: 8px; align-items: center; }
.net-empty { padding: 14px 16px; background: var(--s1); border: 1px dashed var(--line2); border-radius: var(--r2); color: var(--fg2); font-size: 13px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
table.t td .sub { font-size: 11.5px; color: var(--fg3); }
.net-cell { display: inline-flex; align-items: center; gap: 8px; }
.sig { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.sig i { width: 3px; border-radius: 1px; background: var(--line2); }
.sig i:nth-child(1) { height: 4px; } .sig i:nth-child(2) { height: 6px; } .sig i:nth-child(3) { height: 8px; }
.sig i:nth-child(4) { height: 10px; } .sig i:nth-child(5) { height: 12px; }
.sig i.on { background: var(--fg2); }

/* вкладки mp.space и ЮMoney: прокси сверху, кнопки-помогаторы, окно браузера */
.br-hint { margin: -4px 0 14px; font-size: 13px; }
/* колонка — не шире карточки: иначе картинка браузера (её ширина — экран браузера, 1320+ px) растягивает
   сетку, и экран с кнопками вылезают за край (у элементов сетки по умолчанию min-width: auto) */
.br-card { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r2); padding: 12px 14px; margin: 0 0 12px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }
.br-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.br-row2 { justify-content: space-between; }
.br-lbl { font-size: 12.5px; font-weight: 600; color: var(--fg2); min-width: 64px; }
.br-proxy-in { flex: 1; min-width: 260px; font-family: var(--mono); font-size: 12.5px; }
.br-ip { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; font-size: 13px; color: var(--fg2); min-width: 0; }
.br-ip b { color: var(--fg); }
.br-links { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; }
.br-links button .ic { width: 14px; height: 14px; color: var(--fg3); }
.br-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 10px; background: var(--s1); border: 1px solid var(--line);
  border-bottom: 0; border-radius: var(--r2) var(--r2) 0 0; }
.br-screen { position: relative; height: max(480px, calc(100vh - 330px)); background: #0b0d11; border: 1px solid var(--line);
  border-radius: 0 0 var(--r2) var(--r2); overflow: hidden; }
.br-screen:fullscreen { height: 100vh; border-radius: 0; }
.br-screen > div:not(.br-empty):not(.br-fake):not(.banner) { width: 100%; height: 100%; background: #0b0d11; }
.br-empty { background: var(--s1); border: 1px dashed var(--line2); border-radius: var(--r2); padding: 28px; display: grid; gap: 6px; justify-items: start; }
.br-screen .br-empty { border: 0; border-radius: 0; height: 100%; align-content: center; justify-items: center; text-align: center; background: var(--s1); }
.br-empty-t { font-weight: 600; font-size: 15px; }
.br-empty p { margin: 0 0 6px; max-width: 64ch; }
.br-fake { height: 100%; display: grid; place-items: center; color: #8a92a2; font-size: 14px; padding: 20px; text-align: center; }
.br-skel { display: grid; place-items: center; border-radius: var(--r2); }
@media (max-width: 900px) { .br-proxy-in { min-width: 0; width: 100%; } .br-screen { height: 70vh; } }

/* фильтры-счётчики */
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; }
.chips button { border-radius: 999px; padding: 3px 12px; font-size: 12.5px; background: var(--s1); color: var(--fg2); border-color: var(--line); gap: 7px; }
.chips button .n { font-variant-numeric: tabular-nums; color: var(--fg); font-weight: 600; }
.chips button.on { background: var(--fg); color: var(--bg); border-color: transparent; }
.chips button.on .n { color: var(--bg); }
.chips button .dot { box-shadow: none; width: 7px; height: 7px; }

/* ── таблицы ────────────────────────────────────────────────────────────── */
.tbl-wrap { overflow: auto; background: var(--s1); border: 1px solid var(--line); border-radius: var(--r2); max-width: 100%; }
table.t { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
table.t th { text-align: left; font-weight: 500; font-size: 12px; color: var(--fg3); padding: 9px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--s2); white-space: nowrap; z-index: 1; }
table.t td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t tbody tr { transition: background-color var(--t-hover) ease; }
/* зебра: чётные строки (раскрытые подробности modlink — не в счёт); правки, наведение и строки «новая/удалена» — поверх */
table.t tbody tr:where(:nth-child(even of :not(.ml-more))) td { background: var(--zebra); }
table.t tbody tr:hover td { background: var(--row-hover); }
table.t td.num, table.t td.mono { font-variant-numeric: tabular-nums; }
table.t td.mono { font-family: var(--mono); font-size: 12.5px; }
table.t tr.dirty td { background: var(--warn-bg); }
table.t tr.new td { background: var(--ok-bg); }
table.t tr.gone td { background: var(--bad-bg); text-decoration: line-through; opacity: .75; }
table.t tr.gone td.acts-cell { text-decoration: none; opacity: 1; }
table.t input { padding: 3px 7px; width: 100%; min-width: 60px; }
table.t input[type="checkbox"] { width: auto; min-width: 0; }
table.t input.w-xs { min-width: 0; width: 52px; }
table.t input.w-s { min-width: 0; width: 72px; }
table.t input.w-ip { min-width: 0; width: 130px; font-family: var(--mono); font-size: 12.5px; }
table.t input.w-m { min-width: 0; width: 110px; }
table.t input.w-l { min-width: 0; width: 330px; }
/* колонка действий — всегда видна справа, даже когда таблица шире экрана */
table.t td.acts-cell, table.t th.acts-cell { position: sticky; right: 0; background: var(--s1); white-space: nowrap; text-align: right; z-index: 1; box-shadow: -10px 0 12px -12px rgba(0, 0, 0, .35); }
table.t th.acts-cell { background: var(--s2); z-index: 2; }
table.t tbody tr:where(:nth-child(even of :not(.ml-more))) td.acts-cell { background: var(--zebra); }
table.t tbody tr:hover td.acts-cell { background: var(--row-hover); }
table.t tr.dirty td.acts-cell { background: color-mix(in srgb, var(--s1) 85%, var(--warn)); }
.acts-cell .ia { display: inline-flex; gap: 2px; }
.ia button { border-color: transparent; background: none; color: var(--fg2); padding: 4px 7px; min-width: 30px; justify-content: center; gap: 5px; }
@media (hover: hover) { .ia button:hover:not(:disabled) { background: var(--s3); color: var(--fg); } .ia button.danger:hover:not(:disabled) { color: var(--bad); background: var(--bad-bg); } }
.ia button .lbl { font-size: 12.5px; }
td.note { font-size: 12px; color: var(--fg2); }
td.clip { max-width: 360px; }
td.clip > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
table.export td { white-space: nowrap; user-select: all; font-family: var(--mono); font-size: 12.5px; }
tr.flash td { animation: flash 1.4s var(--ease-out); }
@keyframes flash { 0% { background: var(--accent-soft); } 100% { background: transparent; } }

/* ── всплывающее ────────────────────────────────────────────────────────── */
.menu-wrap { position: relative; display: inline-flex; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 230px; padding: 5px;
  background: var(--s1); border: 1px solid var(--line2); border-radius: var(--r2); box-shadow: var(--shadow-pop);
  transform-origin: top right; animation: pop var(--t-ui) var(--ease-out); }
.menu.left { right: auto; left: 0; transform-origin: top left; }
.menu button { display: flex; width: 100%; text-align: left; border: none; background: none; padding: 8px 10px; border-radius: var(--r1); font-weight: 500; gap: 10px; color: var(--fg); }
.menu button .ic { color: var(--fg2); }
.menu button:hover:not(:disabled) { background: var(--s3); }
.menu button.danger, .menu button.danger .ic { color: var(--bad); }
.menu hr { border: 0; height: 1px; background: var(--line); margin: 5px 4px; }
.menu .hint { display: block; font-size: 11.5px; color: var(--fg3); font-weight: 400; }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(-4px); } to { opacity: 1; transform: none; } }

.modal-bg { position: fixed; inset: 0; background: rgba(4, 7, 12, .5); display: flex; align-items: flex-start; justify-content: center;
  padding: 10vh 16px 16px; z-index: 40; animation: fade 200ms ease; overscroll-behavior: contain; }
.modal { background: var(--s1); color: var(--fg); border: 1px solid var(--line2); border-radius: var(--r3); padding: 22px 24px;
  width: min(720px, 100%); max-height: 80vh; overflow: auto; box-shadow: var(--shadow-pop); animation: rise 280ms var(--ease-out); }
.modal h3 { margin: 0 0 12px; font-size: 16px; font-weight: 620; letter-spacing: -.01em; }
.modal .btns { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 18px;
  position: sticky; bottom: -22px; background: var(--s1); padding: 10px 0 12px; margin-bottom: -12px; }
.modal.wide { width: min(1100px, 100%); }
.modal .note { margin: 0 0 12px; font-size: 13px; color: var(--fg2); }
.modal .warn-line { color: var(--warn); margin-bottom: 4px; }
.modal .tbl-wrap { max-height: 56vh; }
.modal .btns label { margin-right: auto; display: inline-flex; gap: 6px; align-items: center; }
.modal pre { background: var(--s2); border-radius: var(--r2); padding: 12px 14px; font: 12.5px/1.55 var(--mono); white-space: pre-wrap; max-height: 52vh; overflow: auto; margin: 0; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.steps { list-style: none; padding: 0; margin: 0; }
.steps li { padding: 6px 0; display: grid; grid-template-columns: 18px 140px minmax(0, 1fr); gap: 10px; border-top: 1px solid var(--line); }
.steps li:first-child { border-top: 0; }
.steps .ok { color: var(--ok); } .steps .bad { color: var(--bad); }

.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 45; }
.toast { background: var(--s1); border: 1px solid var(--line2); border-radius: var(--r2); padding: 10px 14px; box-shadow: var(--shadow-pop); font-size: 13px; max-width: 380px; display: flex; gap: 10px; align-items: flex-start; animation: toast-in 320ms var(--ease-out); }
.toast .dot { margin-top: 6px; }
.toast.out { animation: toast-out 220ms ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ── загрузка ───────────────────────────────────────────────────────────── */
.skel { display: block; height: 12px; border-radius: 6px; background: var(--skel); position: relative; overflow: hidden; }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--skel-hi), transparent); animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.skel.h { height: 22px; width: 40%; margin-bottom: 10px; }
.skel-rows { display: grid; gap: 0; }
.skel-rows > div { display: grid; grid-template-columns: 40px 1.2fr 1fr .8fr 1.4fr; gap: 18px; padding: 13px 16px; border-top: 1px solid var(--line); align-items: center; }
.skel-rows > div:first-child { border-top: 0; }
.loading-note { display: flex; align-items: center; gap: 10px; color: var(--fg2); font-size: 13px; padding: 12px 16px; }

/* ── движение ───────────────────────────────────────────────────────────── */
.page-in { animation: page-in var(--t-page) var(--ease-out); }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pane-in { animation: pane-in 280ms var(--ease-out); }
@keyframes pane-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.stagger > * { animation: row-in 360ms var(--ease-out) both; animation-delay: calc(min(var(--i, 0), 18) * 26ms); }
@keyframes row-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
  .skel::after, .progress.on::before { animation: none !important; }
  main#main { scroll-behavior: auto; }
}

/* ── терминал, журналы, формы ───────────────────────────────────────────── */
.term-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.term-bar button { font-family: var(--mono); font-size: 12px; font-weight: 450; }
.term-box { height: calc(100vh - 330px); min-height: 320px; background: #0b0d11; border-radius: var(--r2); padding: 8px; border: 1px solid var(--line); }
.term-box.full { height: calc(100vh - 230px); }
.term-box .xterm { height: 100%; }
.joblog { margin-top: 12px; }
.joblog pre { background: var(--s2); border-radius: var(--r2); padding: 12px 14px; max-height: 360px; overflow: auto; margin: 8px 0 0; font: 12.5px/1.55 var(--mono); white-space: pre-wrap; }
.job-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.job-time { font-size: 12.5px; color: var(--fg3); }
.joblog.page { margin-top: 0; display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 16px 24px; align-items: start; }
.joblog.page .job-head > b { display: none; }
.joblog.page .job-head { grid-column: 1 / -1; background: var(--s1); border: 1px solid var(--line); border-radius: var(--r2); padding: 12px 16px; }
.joblog.page .stages { position: sticky; top: 0; }
.joblog.page .stages[hidden] + div { grid-column: 1 / -1; }
.joblog.page pre { margin: 0; max-height: calc(100vh - 290px); min-height: 240px; background: var(--s1); border: 1px solid var(--line); }
.joblog.page > div:last-child:empty { display: none; }
.joblog.page > div:last-child { grid-column: 1 / -1; }
/* этапы задания: пройденные — галочка, текущий — крутилка, упавший — крестик */
.stages { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; }
.stages li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; align-items: start; padding: 5px 0; font-size: 13px; color: var(--fg2); position: relative; }
.stages li:not(:last-child)::after { content: ""; position: absolute; left: 8.5px; top: 25px; bottom: -3px; width: 1px; background: var(--line2); }
.stages li.fresh { animation: row-in 360ms var(--ease-out) both; }
.stages .mk { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; margin-top: 1px; background: var(--s3); position: relative; }
.stages li.done .mk { background: var(--ok-bg); }
.stages li.done .mk::before { content: ""; width: 7px; height: 4px; border: 2px solid var(--ok); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.stages li.now { color: var(--fg); font-weight: 500; }
.stages li.now .mk { background: none; border: 2px solid var(--line2); border-top-color: var(--accent); animation: spin .9s linear infinite; }
.stages li.warn .mk { background: var(--warn-bg); }
.stages li.warn .mk::before { content: "!"; color: var(--warn); font-weight: 700; font-size: 12px; line-height: 1; }
.stages li.fail { color: var(--bad); }
.stages li.fail .mk { background: var(--bad-bg); }
.stages li.fail .mk::before { content: "×"; color: var(--bad); font-weight: 700; font-size: 13px; line-height: 1; }

/* формы: слева поля по разделам, справа — план «что будет» */
.split { display: grid; grid-template-columns: minmax(0, 640px) minmax(240px, 320px); gap: 24px; align-items: start; }
@media (max-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr); } }
.form { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r2); padding: 4px 22px; max-width: 640px; display: grid; }
.form .fs { display: grid; gap: 12px; padding: 18px 0; }
.form .fs + .fs { border-top: 1px solid var(--line); }
.form .fs-t { font-size: 13px; font-weight: 600; color: var(--fg); }
.form .bar-end { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.form label { display: grid; gap: 6px; font-size: 13px; color: var(--fg2); }
.form label.inline { display: flex; align-items: center; gap: 8px; color: var(--fg); }
.form input:not([type="checkbox"]):not([type="radio"]) { padding: 7px 10px; }
.form .row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.form .radio { display: grid; gap: 8px; }
.form .radio label { display: flex; gap: 8px; align-items: baseline; color: var(--fg); }
.form input:user-invalid { border-color: var(--bad); }
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.opt { position: relative; display: grid !important; gap: 2px !important; padding: 12px 14px 12px 40px; border: 1px solid var(--line2); border-radius: var(--r2); background: var(--s2); cursor: pointer;
  transition: border-color var(--t-hover) ease, background-color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.opt:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line2)); }
.opt:active { transform: scale(.985); }
.opt input { position: absolute; left: 14px; top: 15px; }
.opt b { color: var(--fg); font-weight: 600; font-size: 13.5px; }
.opt span { font-size: 12.5px; color: var(--fg2); }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
@media (max-width: 560px) { .opts, .form .row3 { grid-template-columns: 1fr; } }
.aside-card { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r2); padding: 18px 20px; position: sticky; top: 0; }
.aside-t { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.aside-note { font-size: 12.5px; color: var(--fg3); margin: 12px 0 0; line-height: 1.5; }
.plan { list-style: none; margin: 0; padding: 0; display: grid; }
.plan li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; padding: 6px 0; font-size: 13px; position: relative; transition: opacity var(--t-ui) ease; }
.plan li:not(:last-child)::after { content: ""; position: absolute; left: 8.5px; top: 26px; bottom: -4px; width: 1px; background: var(--line2); }
.plan .mk { width: 18px; height: 18px; border-radius: 50%; margin-top: 1px; border: 1.5px solid var(--accent); background: var(--accent-soft); transition: border-color var(--t-ui) ease, background-color var(--t-ui) ease; }
.plan .sub { font-size: 12px; color: var(--fg2); margin-top: 1px; }
.plan li.off { opacity: .5; }
.plan li.off .mk { border-color: var(--line2); background: none; border-style: dashed; }
.cmd { display: flex; align-items: center; gap: 4px; background: var(--s2); border-radius: var(--r1); padding: 4px 4px 4px 10px; margin: 0 0 6px 28px; }
.cmd code { flex: 1; min-width: 0; font-size: 11.5px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.cmd code::-webkit-scrollbar { display: none; }
.colors { display: inline-flex; gap: 6px; align-items: center; }
.colors .sw { width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 2px solid transparent; background: hsl(var(--h) 62% var(--chip-l)); cursor: pointer; transition: transform var(--t-press) var(--ease-out); }
.colors .sw:hover { transform: scale(1.1); }
.colors .sw.on { border-color: var(--fg); box-shadow: 0 0 0 2px var(--s1) inset; }
.colors .sw.none { background: var(--s3); color: var(--fg2); font-size: 12px; line-height: 18px; justify-content: center; }
.node-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 16px; }
.node-bar .spacer { flex: 1; }
.guard { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; font-size: 12.5px; color: var(--ok); }
.guard.off { color: var(--bad); font-weight: 600; }
.pw-hidden { letter-spacing: 2px; color: var(--fg3); }
.pw-gen { font-style: italic; color: var(--fg2); font-size: 12px; }
.grid-ed table.t td { padding: 3px 4px; }
.grid-ed table.t th input { font-weight: 600; }

/* ── modlink (по образцу modlink для Windows) ──────────────────────────── */
.card.ml-net { padding: 18px 20px; margin: 0 0 24px; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--fg); margin-bottom: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.field label { display: block; font-size: 12.5px; color: var(--fg2); margin-bottom: 6px; }
.field input { width: 100%; }
.field .hint { font-size: 12px; color: var(--fg3); margin-top: 6px; line-height: 1.4; }
.ml-opts { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-top: 14px; }
.ml-opts > label.muted { min-width: 104px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--s3); border-radius: 9px; }
.seg button { border: 0; background: none; color: var(--fg2); padding: 4px 12px; border-radius: 7px; }
.seg button.primary { background: var(--s1); color: var(--fg); box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 0 0 1px var(--line); filter: none; }
@media (hover: hover) { .seg button:hover:not(:disabled):not(.primary) { background: var(--hover); color: var(--fg); } }
/* выключатель modlink */
.ml-power { display: inline-flex; align-items: center; gap: 12px; padding: 8px 14px 8px 10px; background: var(--s1); border: 1px solid var(--line); border-radius: var(--r2); min-width: 0; }
.ml-power-t { display: grid; line-height: 1.3; min-width: 0; }
.ml-power-t b { font-weight: 600; font-size: 13.5px; }
.ml-power-t .muted { font-size: 12px; }
.switch { position: relative; width: 38px; height: 22px; padding: 0; border-radius: 999px; border: 0; background: var(--line2); flex: none;
  transition: background-color var(--t-ui) var(--ease-out); }
.switch .knob { position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform var(--t-ui) var(--ease-out); }
.switch[aria-checked="true"] { background: var(--ok); }
.switch[aria-checked="true"] .knob { transform: translateX(16px); }
@media (hover: hover) { .switch:hover:not(:disabled) { background: color-mix(in srgb, var(--line2) 70%, var(--fg3)); } .switch[aria-checked="true"]:hover:not(:disabled) { background: var(--ok); filter: brightness(1.08); } }
.switch:active:not(:disabled) .knob { transform: scale(.9); }
.switch[aria-checked="true"]:active:not(:disabled) .knob { transform: translateX(16px) scale(.9); }
.ml-head { margin-top: 0; }
.ml-head b { font-size: 15px; }
table.ml td.ml-n { white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }
table.ml td.ml-n .dot { margin-right: 8px; }
table.ml td.ml-n input { width: 60px; }
table.ml tr.off td { opacity: .5; }
table.ml td.ml-ext { font-family: var(--mono); font-size: 12.5px; }
table.ml td.ml-ext .ok { color: var(--ok); } table.ml td.ml-ext .bad { color: var(--bad); }
table.ml tr.ml-more td { background: var(--s2); }
.ml-more-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 6px 0 12px; }
.ml-more-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; }
.ml-pw { display: inline-flex; gap: 4px; align-items: center; }
.speedline { font: 12px var(--mono); color: var(--fg2); margin: 6px 0; }
.speedline.ok { color: var(--ok); } .speedline.bad { color: var(--warn); } .speedline.busy { color: var(--fg); }

/* ── вход ───────────────────────────────────────────────────────────────── */
.login-wrap { min-height: 100%; display: grid; place-items: center; padding: 20px; position: relative; isolation: isolate; }
/* фон: мягкое пятно акцента и точечная сетка, гаснущая к краям */
.login-wrap::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(600px 380px at 50% 30%, var(--accent-soft), transparent 70%); }
.login-wrap::after { content: ""; position: absolute; inset: 0; z-index: -2; background: var(--cos-star);
  -webkit-mask: var(--cos-stars) 0 0 / 620px 620px repeat, var(--cos-stars) 230px 170px / 940px 940px repeat;
  mask: var(--cos-stars) 0 0 / 620px 620px repeat, var(--cos-stars) 230px 170px / 940px 940px repeat; }
.login-card { width: min(380px, 100%); background: var(--s1); border: 1px solid var(--line); border-radius: var(--r3); padding: 28px; display: grid; gap: 16px;
  box-shadow: var(--shadow-pop); animation: rise 520ms var(--ease-out); transition: opacity 160ms ease, transform 160ms ease; }
.login-card > * { animation: row-in 420ms var(--ease-out) both; }
.login-card > :nth-child(2) { animation-delay: 60ms; } .login-card > :nth-child(3) { animation-delay: 100ms; } .login-card > :nth-child(n+4) { animation-delay: 140ms; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.login-brand .mark { width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 6px 18px -6px hsl(250 80% 40% / .55); }
.login-brand h1 { font-size: 20px; }
.login-brand .muted { font-size: 12.5px; }
.login-card label { display: grid; gap: 6px; font-size: 13px; color: var(--fg2); }
.login-card input { width: 100%; padding: 9px 11px; font-size: 14px; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 42px; }
.pw-wrap button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); padding: 4px 6px; }
.pw-wrap button[aria-pressed="true"] { color: var(--accent); }
.login-card button.primary { justify-content: center; padding: 9px 12px; font-size: 14px; }
.login-card button.busy::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin .8s linear infinite; }
.login-card .err { color: var(--bad); min-height: 1.2em; margin: -4px 0 0; font-size: 13px; }
.login-card .caps { margin: -8px 0 0; font-size: 12.5px; color: var(--warn); }
.login-card.shake { animation: shake 360ms var(--ease-out); }
@keyframes shake { 20% { transform: translateX(-6px); } 45% { transform: translateX(5px); } 70% { transform: translateX(-3px); } 100% { transform: none; } }
.login-card.leaving { opacity: 0; transform: scale(.985) translateY(-4px); }

/* ── узкий экран: дерево — выезжающая панель ───────────────────────────── */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(320px, 86vw); z-index: 35; transform: translateX(-102%); transition: transform 280ms var(--ease-out); box-shadow: var(--shadow-pop); }
  body.side-open .side { transform: none; }
  body.side-open::after { content: ""; position: fixed; inset: 0; background: rgba(4, 7, 12, .45); z-index: 34; animation: fade 200ms ease; }
  .menu-btn { display: inline-flex; }
  header.top { padding: 0 16px; }
  main#main { padding: 20px 16px 48px; }
  .top-sum { display: none; }
  .grid3, .ml-more-grid { grid-template-columns: 1fr; }
  /* шапка страницы: имя, под ним сведения, ниже — состояние и кнопки */
  .ph { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
  .ph .chip { width: 8px; height: 26px; }
  .ph h1 { flex: 1; min-width: 0; }
  .ph .meta { flex-basis: 100%; order: 2; }
  .ph .side-r { flex-basis: 100%; order: 3; flex-wrap: wrap; }
  /* крошки: только последние две ступени */
  .crumbs > :not(:nth-last-child(-n+3)) { display: none; }
  .crumbs b, .crumbs a { overflow: hidden; text-overflow: ellipsis; }
  .badge { white-space: nowrap; }
  /* в строках таблиц — только иконки, подписи в подсказке */
  .ia button .lbl { display: none; }
  .split { gap: 16px; }
}

/* раздел под таблицей — с тем же отступом, что и остальные */
.sub-sec { margin-top: 28px; }
.sub-sec > h2, .sub-sec > .sec-head { margin: 0 0 10px; }

/* окно веба модемов (#/md/<id>): только экран браузера модемов */
body.viewer .side, body.viewer .top, body.viewer #progress { display: none; }
body.viewer .app { display: block; }
body.viewer .main-col, body.viewer #main { padding: 0; margin: 0; max-width: none; height: 100vh; overflow: hidden; }
body.viewer .page { height: 100vh; }
.md-page { display: flex; flex-direction: column; height: 100vh; }
.md-bar { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--s1); flex-wrap: wrap; }
.md-bar .muted { font-size: 12.5px; }
.md-screen { flex: 1; min-height: 0; min-width: 0; background: var(--s2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.md-screen > div:not(.br-empty) { width: 100%; height: 100%; min-width: 0; }
.md-card { margin-top: 18px; }
.md-card .md-ip { width: 160px; }
.md-card .md-hint { font-size: 12.5px; }
.md-card .md-more { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.md-card .md-more[hidden] { display: none; }
.md-body { margin-top: 10px; min-width: 0; }
.md-inline { width: 100%; height: min(72vh, 760px); border-radius: var(--r2); overflow: hidden; }

.term-bar button.on { background: var(--fg); color: var(--bg); border-color: transparent; }

/* «узнать номер» (proxyveth number) */
.num-out { margin-top: 12px; display: grid; gap: 6px; }
.num-big { display: flex; align-items: center; gap: 12px; }
.num-big b { font-size: 22px; letter-spacing: .02em; }
.ussd-text { white-space: pre-wrap; margin: 0; padding: 10px 12px; background: var(--s2); border-radius: var(--r1, 8px); font-size: 13px; max-height: 180px; overflow: auto; }

/* ── присоединённый хост (PCS.md §19.4): его панель в рамке справа, без своего дерева и шапки ── */
body.node-view main#main { padding: 0; overflow: hidden; }
body.node-view #main > .page { height: 100%; }
.node-frame { display: block; width: 100%; height: 100%; border: 0; background: var(--bg); }
body.embedded .side, body.embedded header.top { display: none !important; }
body.embedded .app { grid-template-columns: minmax(0, 1fr); }
.t-host.t-node { position: relative; }
.t-gear { position: absolute; right: 4px; top: 5px; width: 24px; height: 24px; min-width: 0; padding: 0; display: grid; place-items: center;
  border: 0; background: none; border-radius: 6px; color: var(--fg3); opacity: 0; transition: opacity .15s; }
.t-host.t-node:hover .t-gear, .t-gear:focus-visible, .t-gear.active { opacity: 1; }
.t-gear:hover { background: var(--s2); color: var(--fg); }
.t-gear .ic { width: 14px; height: 14px; }

/* ── космос: украшения (знак PCS «Орбита» — static/favicon.svg) ──────────────
   Ничего не значат и ни на что не нажимаются: звёзды в боковой панели, кольца орбит в углу
   рабочей области (по кольцу изредка проходит спутник), сцена с планетой на входе, рисунок
   в пустых состояниях. Всё — под содержимым и тонко; при reduce — без движения. */
.side { position: relative; isolation: isolate; }
.side::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 240px; z-index: -1; pointer-events: none;
  background: var(--cos-star);
  -webkit-mask: var(--cos-stars) 30px -40px / 620px 620px repeat, linear-gradient(#000, transparent);
  -webkit-mask-composite: source-in;
  mask: var(--cos-stars) 30px -40px / 620px 620px repeat, linear-gradient(#000, transparent); mask-composite: intersect; }
.main-col::before, .main-col::after { content: ""; position: absolute; z-index: -1; pointer-events: none;
  width: 760px; height: 760px; right: -360px; top: -430px; }
.main-col::before { background: var(--cos-orbit);
  -webkit-mask: var(--cos-rings) center / 100% 100% no-repeat; mask: var(--cos-rings) center / 100% 100% no-repeat; }
/* два спутника на внешнем кольце, напротив друг друга; видна только нижняя левая дуга кольца */
.main-col::after { border-radius: 50%; animation: cos-orbit 150s linear infinite;
  background: radial-gradient(circle at 50% .4%, var(--cos-sat) 0 2.5px, transparent 3.5px),
              radial-gradient(circle at 50% 99.6%, var(--cos-sat) 0 2px, transparent 3px); }
@keyframes cos-orbit { to { transform: rotate(360deg); } }
body.viewer .main-col::before, body.viewer .main-col::after { display: none; }

/* вход: планета встаёт из-за правого нижнего края, по орбите идёт спутник (login.html) */
.cosmos { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.cosmos .c-planet { fill: url(#c-planet); }
.cosmos .c-rim { fill: none; stroke: var(--cos-rim); stroke-width: 3; }
.cosmos .c-band { fill: none; stroke: var(--cos-p0); stroke-width: 26; opacity: .16; }
.cosmos .c-band.thin { stroke-width: 6; opacity: .22; }
.cosmos .c-air { fill: none; stroke: var(--cos-rim); stroke-width: 40; opacity: .07; }
.cosmos .c-p0 { stop-color: var(--cos-p0); } .cosmos .c-p1 { stop-color: var(--cos-p1); } .cosmos .c-p2 { stop-color: var(--cos-p2); }
.cosmos .c-orbit { fill: none; stroke: var(--cos-orbit); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.cosmos .c-far { stroke-dasharray: 2 10; }
.cosmos .c-sat { fill: var(--cos-sat); }
.cosmos .c-sat-glow { fill: var(--cos-sat); opacity: .2; }

/* пустые состояния: маленькая планета с орбитой */
.net-empty::before { content: ""; width: 26px; height: 26px; flex: none; background: var(--fg3); opacity: .7;
  -webkit-mask: var(--cos-icon) center / contain no-repeat; mask: var(--cos-icon) center / contain no-repeat; }
.br-empty::before { content: ""; width: 44px; height: 44px; background: var(--accent); opacity: .45;
  -webkit-mask: var(--cos-icon) center / contain no-repeat; mask: var(--cos-icon) center / contain no-repeat; }
@media (prefers-reduced-motion: reduce) { .main-col::after { animation: none; } }

/* ── роутер хоста (MikroTik, PCS.md §20) ─────────────────────────────────── */
.t-router { grid-template-columns: 16px minmax(0, 1fr) auto; padding-left: 14px; color: var(--fg2); }
.t-router .ic { width: 15px; height: 15px; color: var(--fg3); }
.t-router.active, .t-router:hover { color: var(--fg); }
.t-router.active .ic { color: var(--accent); }
.rt-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px 16px; background: var(--s1); border: 1px solid var(--line); border-radius: var(--r2); }
.rt-form input:not([type]) { min-width: 0; }
.rt-form .w-port, .act .ctl input.w-port { width: 150px; min-width: 0; flex: none; }
.rt-form .w-ip { width: 150px; }
.rt-form input[aria-label="подпись"] { flex: 1; min-width: 180px; max-width: 320px; }
.rt-note { font-size: 12.5px; margin: 8px 2px 0; }
table.t tr.off td:not(:first-child) { opacity: .5; }
.rt-other { margin-top: 18px; }
.rt-other summary { cursor: pointer; color: var(--fg2); font-size: 13px; margin-bottom: 10px; }
.rt-log .item { align-items: baseline; gap: 12px; padding: 7px 16px; font-size: 13px; }
.rt-log .rt-time { color: var(--fg3); font-size: 12px; white-space: nowrap; }
.rt-log .rt-topics { color: var(--fg3); font-size: 12px; min-width: 150px; }
.rt-log .rt-line.bad { background: var(--bad-bg); } .rt-log .rt-line.bad .grow { color: var(--bad); }
.rt-log .rt-line.warn .grow { color: var(--warn); }
.rt-webfig { height: min(78vh, 900px); }
@media (max-width: 700px) { .rt-log .rt-topics { display: none; } .rt-form .w-port, .rt-form .w-ip { width: 120px; } }

/* ── сведения: подпись мелко, значение под ней, тонкая черта между (шапки, строки над таблицами) ── */
/* черта — слева у каждого; у первого в каждой строке она уходит за край и обрезается
   (при переносе вторая строка начинается ровно под первой, без черты и отступа) */
.facts-line { display: flex; flex-wrap: wrap; align-items: stretch; row-gap: 10px; margin: 0 0 0 -18px; overflow: hidden; }
.facts-line .fact { display: grid; align-content: start; gap: 2px; margin-left: -1px; padding: 0 18px; border-left: 1px solid var(--line2); min-width: 0; }
.facts-line dt { font-size: 11.5px; line-height: 16px; color: var(--fg3); white-space: nowrap; }
.facts-line dd { margin: 0; min-height: 22px; display: flex; align-items: center; gap: 7px; font-size: 13.5px; line-height: 20px; color: var(--fg); white-space: nowrap; }
.facts-line dd .mono { font-size: 12.5px; }
.facts-line dd .meter { width: 54px; flex: none; }
.facts-line dd a { display: inline-flex; align-items: center; gap: 4px; }
.facts-line dd a .ic { width: 13px; height: 13px; }
.facts-line .fact.warn dd { color: var(--warn); } .facts-line .fact.bad dd { color: var(--bad); }
.facts-line .fact.muted dd { color: var(--fg2); }
.facts-line .copy-mini { padding: 2px; min-width: 0; height: 22px; width: 22px; opacity: 0; transition: opacity var(--t-hover) ease; }
.facts-line .copy-mini .ic { width: 13px; height: 13px; }
.facts-line .fact:hover .copy-mini, .facts-line .copy-mini:focus-visible { opacity: 1; }
@media (hover: none) { .facts-line .copy-mini { opacity: .6; } }
.ph .meta.has-facts { margin-top: 6px; }
.srcline .facts-line { flex: 1; }
.srcline:has(.facts-line) { margin: 0 0 18px; }
@media (max-width: 700px) { .facts-line dd { white-space: normal; } }

/* создание ВМ: номер рядом с именем, под номером — свободен ли */
.form .row-id { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; align-items: start; }
.form .row-id input[type="number"] { font-family: var(--mono); }
.id-note { font-size: 12px; min-height: 18px; color: var(--fg3); }
.id-note.ok { color: var(--ok); } .id-note.bad { color: var(--bad); }
@media (max-width: 560px) { .form .row-id { grid-template-columns: 1fr; } }

/* ячейка «модемы»: вирт. / физ. — подпись мелко */
.vmrow .mod .mod-line { display: block; }
.vmrow .mod .mod-k { font-size: 11.5px; color: var(--fg3); margin-right: 6px; }
.vmrow .mod .mod-line + .meter + .mod-line, .vmrow .mod .meter + .mod-line { margin-top: 4px; }

/* ── надпись «Proxy Control Service»: к концу уходит в цвет неба, под ней — орбита со спутником
   (продолжение кольца планеты из знака) ── */
.wordmark { position: relative; display: inline-block; padding-bottom: 7px; white-space: nowrap;
  background: linear-gradient(90deg, var(--fg) 0 52%, var(--wm-tint)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wm-orbit { position: absolute; left: -14px; bottom: -3px; width: calc(100% + 16px); height: 11px; overflow: visible; pointer-events: none; }
.wm-orbit path { fill: none; stroke: var(--wm-orbit); stroke-width: 1.1; vector-effect: non-scaling-stroke; }
.wm-orbit circle { fill: var(--cos-sat); filter: drop-shadow(0 0 3px var(--cos-sat)); }
.login-brand h1.wordmark { font-size: 19px; letter-spacing: -.01em; padding-bottom: 9px; }

/* внешний IP в строке модема: рядом — проверить только его */
table.t td.ip-cell { white-space: nowrap; }
table.t td.ip-cell button { padding: 2px; min-width: 0; width: 24px; height: 24px; margin-left: 6px; border: 0; background: none;
  color: var(--fg3); opacity: .55; vertical-align: middle; transition: opacity var(--t-hover) ease, color var(--t-hover) ease; }
table.t td.ip-cell button .ic { width: 14px; height: 14px; }
table.t tr:hover td.ip-cell button, table.t td.ip-cell button:focus-visible { opacity: 1; color: var(--accent); }
table.t td.ip-cell button.spin { opacity: 1; color: var(--accent); }
table.t td.ip-cell button.spin .ic { animation: spin .9s linear infinite; }

/* «управление» по линеечке: состояние | поле | кнопки — одни колонки во всех строках */
/* поле растягивается до 420 px (а не по содержимому) — тогда и кнопки во всех строках с одной линии */
.act .ctl.cols { display: grid; grid-template-columns: 130px minmax(0, 360px) minmax(0, 1fr); gap: 8px 12px; align-items: center; }
/* окно поуже — подпись строки над колонками, чтобы полям хватило места; колонки те же */
@media (max-width: 1280px) {
  .act:has(> .ctl.cols) { grid-template-columns: minmax(0, 1fr); }
  .act .ctl.cols { grid-template-columns: 120px minmax(0, 280px) minmax(0, 1fr); }
}
.act .ctl.cols .c-state { color: var(--fg2); font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.act .ctl.cols .c-field { display: grid; gap: 6px; min-width: 0; }
.act .ctl.cols .c-field input:not([type="file"]):not([type="checkbox"]), .act .ctl.cols .c-field select,
.act .ctl.cols .c-field textarea { width: 100%; max-width: none; min-width: 0; }
.act .ctl.cols .c-field input[type="file"] { font-size: 12.5px; color: var(--fg2); }
.act .ctl.cols .c-field .mono { font-size: 12.5px; overflow-wrap: anywhere; }
.act .ctl.cols .c-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
@media (max-width: 1000px) {
  .act .ctl.cols { grid-template-columns: minmax(0, 1fr); }
  .act .ctl.cols .c-state:empty, .act .ctl.cols .c-field:empty { display: none; }
}

