/* KoshVPN Minecraft — панель сервера. Тёмная тема по умолчанию, светлая — по системе или переключателем. */
:root {
  --bg: #0e1014; --surface: #161a20; --surface-2: #1d222a; --surface-3: #252b35; --border: #272d37; --border-strong: #353d4a;
  --text: #e7eaf0; --text-2: #b4bac6; --muted: #7f8796;
  --accent: #3ec97a; --accent-strong: #2fb468; --accent-soft: rgba(62, 201, 122, .13); --on-accent: #06210f;
  --info: #5aa9ff; --info-soft: rgba(90, 169, 255, .13);
  --ok: #3ec97a; --ok-soft: rgba(62, 201, 122, .13);
  --warn: #f2b54a; --warn-soft: rgba(242, 181, 74, .14);
  --bad: #ff6470; --bad-soft: rgba(255, 100, 112, .13);
  --log-bg: #0a0c0f; --log-text: #c9ced8;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .18);
  --radius: 14px; --radius-sm: 9px; --side: 232px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f3f5f8; --surface: #ffffff; --surface-2: #f4f6f9; --surface-3: #e9edf2; --border: #e2e6ec; --border-strong: #cfd5de;
    --text: #151a22; --text-2: #3d4553; --muted: #6b7382;
    --accent: #1f9d57; --accent-strong: #188a4b; --accent-soft: rgba(31, 157, 87, .1); --on-accent: #ffffff;
    --info: #2563eb; --info-soft: rgba(37, 99, 235, .09);
    --ok: #1f9d57; --ok-soft: rgba(31, 157, 87, .1); --warn: #b7791f; --warn-soft: rgba(183, 121, 31, .11);
    --bad: #d63846; --bad-soft: rgba(214, 56, 70, .09); --log-bg: #11151b; --log-text: #d3d8e0;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 18px rgba(16, 24, 40, .06);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f3f5f8; --surface: #ffffff; --surface-2: #f4f6f9; --surface-3: #e9edf2; --border: #e2e6ec; --border-strong: #cfd5de;
  --text: #151a22; --text-2: #3d4553; --muted: #6b7382;
  --accent: #1f9d57; --accent-strong: #188a4b; --accent-soft: rgba(31, 157, 87, .1); --on-accent: #ffffff;
  --info: #2563eb; --info-soft: rgba(37, 99, 235, .09);
  --ok: #1f9d57; --ok-soft: rgba(31, 157, 87, .1); --warn: #b7791f; --warn-soft: rgba(183, 121, 31, .11);
  --bad: #d63846; --bad-soft: rgba(214, 56, 70, .09); --log-bg: #11151b; --log-text: #d3d8e0;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 18px rgba(16, 24, 40, .06);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .9em; }
code { background: var(--surface-3); padding: 1px 6px; border-radius: 6px; }
h1 { font-size: 24px; line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0; font-weight: 650; }
h3 { font-size: 13px; margin: 18px 0 8px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
p { margin: 8px 0; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── Каркас ─────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 18px 14px; background: var(--surface); border-right: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px 14px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand img { width: 36px; height: 36px; border-radius: 9px; image-rendering: pixelated; }
.brand small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; line-height: 1.2; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px; color: var(--text-2); font-weight: 520; }
.side nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.side nav a.active { background: var(--accent-soft); color: var(--accent); }
.side-status { margin-top: auto; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; }
.side-status .line { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); }
.side-status .line b { color: var(--text); font-weight: 600; }
.side-status .line + .line { margin-top: 4px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 10px 6px 0; border-top: 1px solid var(--border); margin-top: 8px; }
.avatar { width: 30px; height: 30px; flex: none; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; background: hsl(var(--hue, 150) 45% 42%); }
.avatar.lg { width: 38px; height: 38px; font-size: 15px; border-radius: 10px; }
.side-user .name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { border: 0; background: transparent; color: var(--muted); padding: 7px; border-radius: 8px; cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.topbar, .scrim { display: none; }
.shell > .side { grid-column: 1; grid-row: 1; }
.shell > main { grid-column: 2; grid-row: 1; }

main { padding: 28px 32px 64px; max-width: 1600px; width: 100%; margin: 0 auto; box-sizing: border-box; }
.page-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 3px; }
.page-head .tools { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

@media (max-width: 900px) {
  .shell { display: block; }
  .side { position: fixed; z-index: 30; left: 0; top: 0; bottom: 0; width: 264px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .nav-open .side { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, .45); display: none; }
  .nav-open .scrim { display: block; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
  .topbar .brand { padding: 0; }
  .topbar .brand img { width: 28px; height: 28px; }
  .topbar .pill { margin-left: auto; }
  main { padding: 18px 16px 48px; }
  h1 { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }

/* ── Карточки и сетки ───────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head .hint { color: var(--muted); font-size: 13px; }
.card-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.grid:last-child { margin-bottom: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-wide { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.stack-cards { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .g2, .g3, .g-wide { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .g4 { gap: 10px; } .stat { padding: 13px 14px 12px; } .stat .value { font-size: 23px; } .stat .meta { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }

/* Плитки показателей */
.stat { position: relative; overflow: hidden; padding: 16px 18px 14px; }
.stat .label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 520; }
.stat .value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 15px; color: var(--muted); font-weight: 520; }
.stat .meta { color: var(--muted); font-size: 12.5px; min-height: 18px; }
.spark { display: block; width: 100%; height: 38px; margin-top: 8px; }
.spark path.line { fill: none; stroke: var(--accent); stroke-width: 1.8; vector-effect: non-scaling-stroke; }
.spark path.area { fill: var(--accent-soft); stroke: none; }
.spark.info path.line { stroke: var(--info); } .spark.info path.area { fill: var(--info-soft); }
.spark.warn path.line { stroke: var(--warn); } .spark.warn path.area { fill: var(--warn-soft); }
.tone-ok { color: var(--ok); } .tone-warn { color: var(--warn); } .tone-bad { color: var(--bad); }

/* Списки */
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); min-width: 0; flex-wrap: wrap; }
.item:first-child { border-top: 0; padding-top: 2px; }
.item .grow { flex: 1; min-width: 0; }
.item .title { font-weight: 600; overflow-wrap: anywhere; }
.item .desc { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.item .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.empty { color: var(--muted); padding: 18px 0 6px; text-align: center; font-size: 14px; }
.scroll { max-height: 440px; overflow: auto; margin-right: -8px; padding-right: 8px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Метки */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.pill.ok { color: var(--ok); background: var(--ok-soft); }
.pill.bad { color: var(--bad); background: var(--bad-soft); }
.pill.warn { color: var(--warn); background: var(--warn-soft); }
.pill.info { color: var(--info); background: var(--info-soft); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.bad { background: var(--bad); }
.dot.warn { background: var(--warn); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { margin-left: auto; }
.inline { display: inline; }
.nowrap { white-space: nowrap; }

/* ── Кнопки и поля ──────────────────────────────────── */
.btn, button { font: inherit; font-weight: 560; font-size: 14px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-align: center; line-height: 1.3; }
.btn:hover, button:hover { background: var(--surface-3); text-decoration: none; }
.btn:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-strong); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn svg.i { width: 16px; height: 16px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

input, select, textarea { font: inherit; font-size: 14.5px; background: var(--bg); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 11px; width: 100%; min-width: 0; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="checkbox"] { width: auto; }
textarea { resize: vertical; line-height: 1.45; }
label { display: flex; flex-direction: column; gap: 6px; color: var(--text-2); font-size: 14px; font-weight: 520; }
label .hint, .field-hint { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.form { display: flex; flex-direction: column; gap: 14px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 560px) { .fields { grid-template-columns: minmax(0, 1fr); } }
.inline-form { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.inline-form input { flex: 1 1 140px; }
.form-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 4px; }
.form-foot .hint { color: var(--muted); font-size: 13px; }

/* Переключатель */
.toggle { flex-direction: row; align-items: flex-start; gap: 12px; cursor: pointer; color: var(--text); }
.toggle input { appearance: none; -webkit-appearance: none; flex: none; width: 38px; height: 22px; margin: 1px 0 0; padding: 0; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; cursor: pointer; transition: background .15s; }
.toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.toggle input:checked { background: var(--accent); border-color: var(--accent); }
.toggle input:checked::after { transform: translateX(16px); background: #fff; }
.toggle .text { display: flex; flex-direction: column; gap: 2px; }
.toggle .text .hint { color: var(--muted); font-size: 12.5px; font-weight: 400; }
.toggles { display: flex; flex-direction: column; gap: 14px; }

/* Диапазон «от — до» */
.range-row { display: grid; grid-template-columns: minmax(0, 1fr) 84px 14px 84px; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); font-size: 14px; }
.range-row:first-of-type { border-top: 0; }
.range-row .now { color: var(--muted); font-size: 12.5px; }
.range-row .sep { color: var(--muted); text-align: center; }
.range-row input { text-align: center; padding: 6px 8px; }
.range-head { display: grid; grid-template-columns: minmax(0, 1fr) 84px 14px 84px; gap: 8px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.range-head span:nth-child(n+2) { text-align: center; }
@media (max-width: 480px) { .range-row, .range-head { grid-template-columns: minmax(0, 1fr) 64px 10px 64px; } }

/* Прогресс */
progress { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border: 0; border-radius: 99px; background: var(--surface-3); overflow: hidden; display: block; }
progress::-webkit-progress-bar { background: var(--surface-3); border-radius: 99px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 99px; }

/* Вкладки внутри страницы */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 7px 14px; border-radius: 9px; color: var(--text-2); font-weight: 560; font-size: 14px; white-space: nowrap; }
.tabs a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.tabs a.active { background: var(--accent-soft); color: var(--accent); }
.tab-panel[hidden] { display: none; }

/* Уведомления */
.flash { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; margin-bottom: 18px; font-size: 14px; border: 1px solid transparent; }
.flash.ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-soft); }
.flash.err { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-soft); }
.flash.info { background: var(--info-soft); color: var(--info); }
.flash .grow { flex: 1; overflow-wrap: anywhere; }
.flash .icon-btn { color: inherit; padding: 2px; }
.note { padding: 11px 13px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 13.5px; }
.note.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }

/* Окно подтверждения */
dialog.confirm { border: 1px solid var(--border); border-radius: 16px; padding: 22px; width: min(420px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
dialog.confirm::backdrop { background: rgba(0, 0, 0, .5); }
dialog.confirm p { margin: 0 0 18px; font-size: 15px; }
dialog.confirm .actions { justify-content: flex-end; }

/* ── Консоль ────────────────────────────────────────── */
.log { margin: 0; height: 62vh; min-height: 300px; overflow: auto; padding: 14px 16px; background: var(--log-bg); color: var(--log-text); font: 12.5px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.log .warn { color: #f2c46d; } .log .err { color: #ff8a93; } .log .chat { color: #8fd3ff; } .log .join { color: #7fe0a6; }
.cmd { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--surface); }
.cmd .prompt { color: var(--accent); font-family: ui-monospace, Consolas, monospace; font-weight: 700; padding-left: 4px; }
.cmd input { flex: 1; font-family: ui-monospace, Consolas, monospace; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--surface); }
.output { margin: 0; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2); font: 12.5px/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
pre.block { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font: 13px/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
pre.block.select { user-select: all; }

/* ── Вход ───────────────────────────────────────────── */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 500px at 50% -10%, var(--accent-soft), transparent 70%), var(--bg); }
.auth { width: min(400px, 100%); padding: 28px; }
.auth h1 { font-size: 21px; margin: 18px 0 6px; }
.auth .form { margin: 18px 0 12px; }
.auth-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 16px; }
.auth-brand img { width: 44px; height: 44px; border-radius: 11px; image-rendering: pixelated; }
.auth-brand small { display: block; color: var(--muted); font-weight: 500; font-size: 13px; }
input.code { font-size: 28px; letter-spacing: .45em; text-align: center; font-family: ui-monospace, Consolas, monospace; padding: 10px; }
.steps { display: flex; gap: 6px; margin-top: 18px; }
.steps span { flex: 1; height: 4px; border-radius: 99px; background: var(--surface-3); }
.steps span.on { background: var(--accent); }
.wait { display: flex; align-items: center; gap: 10px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--surface-3); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* ── Публичные страницы (рейтинги, документация API) ── */
.public { max-width: 1080px; margin: 0 auto; padding: 28px 16px 56px; }
.public-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.public-head .tools { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.rank { width: 24px; height: 24px; flex: none; border-radius: 7px; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; background: var(--surface-3); color: var(--text-2); }
.rank.r1 { background: #f5c84c; color: #3d2c00; } .rank.r2 { background: #c9d1dc; color: #26303c; } .rank.r3 { background: #d99a63; color: #3a1d05; }
.method { display: flex; gap: 12px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.method:first-of-type { border-top: 0; }
.method code { white-space: nowrap; }
.method .desc { color: var(--muted); font-size: 13.5px; flex: 1 1 220px; }
.public .card + .card { margin-top: 16px; }
.public .card p:first-of-type { margin-top: 0; }

/* Дополнения */
main > .card, main > .tab-panel > .card, main > .tab-panel > form > .grid { margin-bottom: 16px; }
main > .tab-panel > form > .form-foot { margin-bottom: 16px; }
.spark.tall { height: 160px; margin: 0; }
.spark path.limit { fill: none; stroke: var(--bad); stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; opacity: .7; }
.toggle.small { font-size: 13px; align-items: center; }
.toggle.small input { margin: 0; }
.note svg.i { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }
.note { margin: 14px 0 0; }
.kv + .actions, progress + .kv { margin-top: 12px; }
.kv + .actions { margin-top: 14px; }
progress + p { margin-top: 8px; }
.card.chart { display: flex; flex-direction: column; }
.card.chart .spark.tall { flex: 1 1 0; height: 0; min-height: 160px; }
@media (max-width: 900px) { .page-head .tools [data-live="pill"] { display: none; } }

/* ── Живая панель ── */
[hidden] { display: none !important; }
.live-flag { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border); color: var(--muted); font-weight: 600; }
.live-flag .dot { background: var(--muted); }
.live-flag.on { color: var(--ok); }
.live-flag.on .dot { background: var(--ok); animation: live-pulse 2s ease-in-out infinite; }
@keyframes live-pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--ok-soft); } 50% { box-shadow: 0 0 0 5px var(--ok-soft); } }
.toasts { position: fixed; z-index: 50; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px 11px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border-strong); border-left: 4px solid var(--ok); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); font-size: 14px; animation: toast-in .18s ease-out; transition: opacity .3s, transform .3s; }
.toast.err { border-left-color: var(--bad); }
.toast.info { border-left-color: var(--info); }
.toast.out { opacity: 0; transform: translateY(6px); }
.toast .grow { flex: 1; overflow-wrap: anywhere; }
.toast .icon-btn { padding: 0 4px; font-size: 13px; line-height: 1.4; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@media (max-width: 600px) { .toasts { left: 16px; right: 16px; bottom: 16px; width: auto; } }
@media (prefers-reduced-motion: reduce) { .live-flag.on .dot, .toast { animation: none; } }
form.busy button { opacity: .6; cursor: progress; }
.playtime .value { font-weight: 620; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── Плотность и единство (KINFRA-21): как в панели VPN — мелкие подписи, крупные цифры, без пустых простыней ── */
.card { padding: 18px 20px; }
.card-head { margin-bottom: 12px; }
.card-head h2 { font-size: 15px; font-weight: 650; }
.stat .label { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.stat .value { font-size: 30px; font-weight: 700; }
.empty { padding: 8px 0 2px; font-size: 13px; }
/* Блок состояния внизу меню дублировал «Обзор» — оставляем одну строку: точка связи и TPS */
.side-status { padding: 8px 12px; border-radius: 10px; font-size: 12.5px; }
.side-status .line:not(:first-child):not(:last-child) { display: none; }
