/* Пульт VPN sub-lg — оформление. Светлая и тёмная темы, телефон и компьютер. */
:root {
  --bg: #eef2f5; --glow1: rgba(13, 148, 136, .13); --glow2: rgba(124, 58, 237, .09);
  --card: #ffffff; --card2: #f4f6f9; --card3: #e7ecf2; --raise: #ffffff;
  --text: #0f172a; --text2: #334155; --muted: #64748b; --line: #e2e7ee; --line2: #cfd7e2;
  --accent: #0d9488; --accent-2: #0891b2; --accent-ink: #ffffff; --accent-soft: #d6f3ef;
  --vpn: #0d9488; --star: #7c3aed; --hubvpn: #2563eb; --lds: #c2710c;
  --ok: #16a34a; --warn: #d97706; --crit: #dc2626; --idle: #94a3b8; --info: #0284c7;
  --ok-bg: #e6f7ec; --warn-bg: #fdf2df; --crit-bg: #fde9e9; --info-bg: #e2f1fb; --idle-bg: #eef1f5;
  --c1: #14b8a6; --c2: #8b5cf6; --c3: #f59e0b; --c4: #3b82f6; --c5: #ec4899; --c6: #22c55e;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px -14px rgba(15, 23, 42, .22);
  --radius: 18px; --tabbar: 66px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: #070b14; --glow1: rgba(45, 212, 191, .10); --glow2: rgba(139, 92, 246, .10);
    --card: #0e1522; --card2: #131c2b; --card3: #1b2537; --raise: #223049;
    --text: #e6ebf3; --text2: #c3cbd8; --muted: #8692a6; --line: #1d2738; --line2: #2a3650;
    --accent: #2dd4bf; --accent-2: #22d3ee; --accent-ink: #042321; --accent-soft: rgba(45, 212, 191, .13);
    --vpn: #2dd4bf; --star: #a78bfa; --hubvpn: #60a5fa; --lds: #fbbf24;
    --ok: #4ade80; --warn: #fbbf24; --crit: #f87171; --idle: #5b6779; --info: #38bdf8;
    --ok-bg: rgba(74, 222, 128, .10); --warn-bg: rgba(251, 191, 36, .10); --crit-bg: rgba(248, 113, 113, .12); --info-bg: rgba(56, 189, 248, .10); --idle-bg: rgba(148, 163, 184, .08);
    --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 32px -18px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme=dark] {
  --bg: #070b14; --glow1: rgba(45, 212, 191, .10); --glow2: rgba(139, 92, 246, .10);
  --card: #0e1522; --card2: #131c2b; --card3: #1b2537; --raise: #223049;
  --text: #e6ebf3; --text2: #c3cbd8; --muted: #8692a6; --line: #1d2738; --line2: #2a3650;
  --accent: #2dd4bf; --accent-2: #22d3ee; --accent-ink: #042321; --accent-soft: rgba(45, 212, 191, .13);
  --vpn: #2dd4bf; --star: #a78bfa; --hubvpn: #60a5fa; --lds: #fbbf24;
  --ok: #4ade80; --warn: #fbbf24; --crit: #f87171; --idle: #5b6779; --info: #38bdf8;
  --ok-bg: rgba(74, 222, 128, .10); --warn-bg: rgba(251, 191, 36, .10); --crit-bg: rgba(248, 113, 113, .12); --info-bg: rgba(56, 189, 248, .10); --idle-bg: rgba(148, 163, 184, .08);
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 32px -18px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  background: var(--bg); color: var(--text); min-height: 100vh; overflow-x: hidden;
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(900px 520px at 0% -10%, var(--glow1), transparent 60%), radial-gradient(820px 480px at 100% -6%, var(--glow2), transparent 60%);
}
body.noscroll { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 8px 0; }
svg { flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .92em; }
.hidden { display: none !important; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.min0 { min-width: 0; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; margin-top: 12px; }
.err { color: var(--crit); }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.g4 { gap: 4px; } .g6 { gap: 6px; } .g8 { gap: 8px; }
.sep { height: 1px; background: var(--line); margin: 14px 0; }
.lead { color: var(--text2); font-size: 14px; max-width: 760px; margin: 6px 0 16px; }

/* ── каркас ── */
.app { min-height: 100vh; }
.side { display: none; }
.content { min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); flex: 1; min-width: 0; }
.logo { width: 32px; height: 32px; border-radius: 9px; flex: none; box-shadow: 0 4px 14px -6px color-mix(in srgb, var(--accent) 70%, transparent); }
.brand-t { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-t b { font-size: 16.5px; font-weight: 750; letter-spacing: -.01em; }
.brand-t small { font-size: 11.5px; color: var(--muted); }
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 14px 10px 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.top .brand-t small { display: none; }
.live { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.live .spin { width: 12px; height: 12px; }
main { padding: 16px 16px calc(var(--tabbar) + env(safe-area-inset-bottom) + 28px); max-width: 1280px; margin: 0 auto; }
nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around;
  background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-top: 1px solid var(--line); padding: 6px 4px calc(env(safe-area-inset-bottom) + 6px);
}
nav.tabs a { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px; color: var(--muted); font-size: 10.5px; font-weight: 600; border-radius: 12px; min-width: 0; }
nav.tabs a svg { width: 24px; height: 24px; }
nav.tabs a.on { color: var(--accent); }
nav.tabs a .badge { position: absolute; top: 0; left: calc(50% + 6px); }
@media (min-width: 1000px) {
  .app { display: grid; grid-template-columns: 250px minmax(0, 1fr); }
  .side {
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 20px 14px 16px;
    border-right: 1px solid var(--line); background: color-mix(in srgb, var(--card) 62%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  }
  .top, nav.tabs { display: none; }
  main { padding: 28px 34px 56px; }
}
.side .brand { flex: none; padding: 0 6px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 22px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text2); font-weight: 600; font-size: 14.5px; }
.side-nav a svg { width: 20px; height: 20px; color: var(--muted); }
.side-nav a:hover { background: var(--card2); }
.side-nav a.on { background: var(--accent-soft); color: var(--text); }
.side-nav a.on svg { color: var(--accent); }
.side-nav .badge { margin-left: auto; }
.side-hub { margin-top: 22px; padding: 12px 14px; border-radius: 14px; background: var(--card2); border: 1px solid var(--line); }
.side-hub:empty { display: none; }
.sh-t { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 750; margin-bottom: 4px; }
.sh-row { display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 13.5px; }
.sh-row span:nth-child(2) { flex: 1; }
.sh-ic svg { width: 16px; height: 16px; color: var(--muted); display: block; }
.side-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 6px 0; }

/* ── заголовки ── */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.page-head h1 { overflow-wrap: anywhere; }
.page-head .muted { margin-top: 3px; }
.section { margin: 26px 0 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.section h2 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 750; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 650; cursor: pointer; margin: 0 0 10px -4px; background: none; border: 0; padding: 4px; font-size: 14px; }
.back svg { width: 18px; height: 18px; }

/* ── карточки ── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 10px; margin-bottom: 12px; min-height: 30px; }
.card-h h2 { display: flex; align-items: center; gap: 9px; font-size: 15.5px; font-weight: 750; min-width: 0; }
.card-h h2 svg { width: 19px; height: 19px; color: var(--accent); }
.card-h > :last-child:not(:first-child) { margin-left: auto; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.cols { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); margin-top: 14px; }
.col { min-width: 0; }
.col > * + * { margin-top: 14px; }
@media (min-width: 1180px) { .cols { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } }
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.list .item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); color: inherit; min-height: 54px; }
.list .item:first-child { border-top: 0; }
.item.click { cursor: pointer; }
.chev { width: 18px; height: 18px; color: var(--idle); flex: none; }
.foot { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.foot span { display: inline-flex; align-items: center; gap: 5px; }
.foot svg { width: 14px; height: 14px; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (hover: hover) {
  .item.click:hover, a.item:hover { background: var(--card2); }
  .card.site:hover { transform: translateY(-2px); border-color: var(--line2); }
}

/* ── статусы ── */
.s-ok { --sc: var(--ok); --sbg: var(--ok-bg); }
.s-warn { --sc: var(--warn); --sbg: var(--warn-bg); }
.s-crit { --sc: var(--crit); --sbg: var(--crit-bg); }
.s-info { --sc: var(--info); --sbg: var(--info-bg); }
.s-idle { --sc: var(--muted); --sbg: var(--idle-bg); }
.k-vpn { --k: var(--vpn); } .k-star { --k: var(--star); } .k-hubvpn { --k: var(--hubvpn); } .k-lds { --k: var(--lds); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--idle); flex: none; display: inline-block; vertical-align: middle; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.crit { background: var(--crit); } .dot.info { background: var(--info); }
.dot.big { width: 14px; height: 14px; margin-top: 6px; }
.dot.pulse { animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--idle-bg); color: var(--muted); white-space: nowrap; vertical-align: middle; max-width: 100%; }
.pill svg { width: 13px; height: 13px; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.crit { background: var(--crit-bg); color: var(--crit); } .pill.info { background: var(--info-bg); color: var(--info); }
.pill.k-vpn, .pill.k-star, .pill.k-hubvpn, .pill.k-lds { background: color-mix(in srgb, var(--k) 14%, transparent); color: var(--k); white-space: normal; }
.badge { display: inline-flex; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--crit); color: #fff; font-size: 11px; font-weight: 750; align-items: center; justify-content: center; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 11.5px; font-weight: 650; background: var(--card2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.tag.big { font-size: 12px; padding: 3px 9px; border-radius: 8px; letter-spacing: 0; }
.tag.warn { color: var(--warn); }
.num { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 7px; font-size: 12px; font-weight: 800; color: #fff; background: var(--idle); flex: none; font-variant-numeric: tabular-nums; }
.num.big { min-width: 34px; height: 34px; border-radius: 11px; font-size: 15px; }
.c1 { --c: var(--c1); } .c2 { --c: var(--c2); } .c3 { --c: var(--c3); } .c4 { --c: var(--c4); } .c5 { --c: var(--c5); } .c6 { --c: var(--c6); }
.num.c1, .num.c2, .num.c3, .num.c4, .num.c5, .num.c6 { background: var(--c); }
.rtt-b { font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: -.01em; }
.rtt-b small { font-size: 11px; font-weight: 650; color: var(--muted); margin-left: 2px; }

/* ── обзор ── */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0 4px; }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.stat { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 0; }
.stat-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--sbg); color: var(--sc); flex: none; }
.stat-ic svg { width: 21px; height: 21px; }
.stat-n { font-size: 26px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-l { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.stat.zero { opacity: .5; box-shadow: none; }
.alerts { display: flex; flex-direction: column; gap: 8px; }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--warn-bg); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); color: var(--text); margin: 10px 0; }
.alerts .banner { margin: 0; }
.banner > svg { width: 20px; height: 20px; color: var(--warn); margin-top: 1px; }
.banner b { display: block; }
.banner span { font-size: 13px; color: var(--text2); }
.banner.crit { background: var(--crit-bg); border-color: color-mix(in srgb, var(--crit) 30%, transparent); }
.banner.crit > svg { color: var(--crit); }
.banner.idle { background: var(--idle-bg); border-color: var(--line); }
.banner.idle > svg { color: var(--muted); }
.card.hub { margin-top: 16px; }
.uplinks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr)); gap: 8px; }
.uplink { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--card2); border: 1px solid var(--line); min-width: 0; }
.uplink.st-crit { border-color: color-mix(in srgb, var(--crit) 40%, var(--line)); }
.uplink.st-warn { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.u-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--k); background: color-mix(in srgb, var(--k) 14%, transparent); flex: none; }
.u-ic svg { width: 20px; height: 20px; }
.u-k { font-size: 12px; color: var(--muted); }
.u-v { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.card.hub .foot { margin-top: 12px; }
@media (max-width: 480px) {
  .uplinks { grid-template-columns: 1fr 1fr; }
  .uplink { padding: 9px 10px; gap: 8px; }
  .u-ic { width: 30px; height: 30px; border-radius: 10px; }
  .u-ic svg { width: 17px; height: 17px; }
  .u-v { font-size: 13.5px; }
}

.card.site { display: flex; flex-direction: column; gap: 12px; color: inherit; position: relative; overflow: hidden; transition: transform .12s ease, border-color .12s ease; }
.card.site::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--sc); }
.card.site:active { transform: scale(.99); }
.sc-h { display: flex; align-items: center; gap: 8px; }
.sc-h h3 { flex: 1; font-size: 17px; font-weight: 750; }
.sc-st { display: flex; align-items: center; gap: 10px; }
.sc-st .big { font-weight: 750; color: var(--sc); }
.sc-spark { width: 84px; flex: none; }
.sc-spark .spark { height: 30px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 10px; background: var(--card2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; }
.chip em { font-style: normal; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.chip.act { border-color: color-mix(in srgb, var(--vpn) 60%, transparent); background: color-mix(in srgb, var(--vpn) 10%, var(--card)); }
.mchain { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.mn { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 6px; border-radius: 999px; font-size: 12px; font-weight: 650; color: var(--muted); background: var(--card2); border: 1px solid var(--line); }
.mn svg { width: 14px; height: 14px; color: var(--k); }
.mn.active { color: var(--text); border-color: color-mix(in srgb, var(--k) 60%, transparent); background: color-mix(in srgb, var(--k) 13%, var(--card)); }
.mn.st-off { opacity: .5; text-decoration: line-through; }
.mn.st-down svg { color: var(--crit); }
.ml { width: 10px; height: 2px; background: var(--line2); display: inline-block; border-radius: 1px; flex: none; }
.list .rtt-b { font-size: 16px; }

/* ── площадка ── */
.hero { margin: 14px 0 0; padding: 18px; border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--shadow);
  background: var(--card); background: linear-gradient(135deg, color-mix(in srgb, var(--sc) 15%, var(--card)), var(--card) 68%); }
.hero-main { display: flex; gap: 14px; align-items: flex-start; }
.hero-t { font-size: 21px; font-weight: 800; color: var(--sc); letter-spacing: -.01em; line-height: 1.25; }
.hero-s { color: var(--text2); margin-top: 3px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 8px; margin-top: 16px; }
.tile { padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--card) 75%, transparent); border: 1px solid var(--line); min-width: 0; }
.tile span { display: block; font-size: 11.5px; color: var(--muted); }
.tile b { display: block; font-size: 14px; overflow-wrap: anywhere; }

.card.route { container-type: inline-size; }
.route-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@container (min-width: 640px) { .route-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; } }
.chain { display: flex; flex-direction: column; }
.node { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card2); min-width: 0; transition: box-shadow .2s, border-color .2s; }
.n-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--k); background: color-mix(in srgb, var(--k) 14%, transparent); flex: none; }
.n-ic svg { width: 21px; height: 21px; }
.n-b { flex: 1; min-width: 0; }
.n-t { font-weight: 700; display: flex; align-items: center; gap: 7px; }
.n-no { display: inline-grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; font-size: 11px; font-weight: 800; background: var(--card3); color: var(--muted); flex: none; }
.n-s { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.n-st { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.node.active { border-color: color-mix(in srgb, var(--k) 65%, transparent); background: color-mix(in srgb, var(--k) 10%, var(--card));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--k) 15%, transparent), 0 10px 26px -14px color-mix(in srgb, var(--k) 75%, transparent); }
.node.active .n-ic, .node.active .n-no { background: var(--k); color: var(--card); }
.node.st-off { opacity: .55; border-style: dashed; background: transparent; }
.node.st-down .n-s { color: var(--crit); }
.node.st-down .n-ic { color: var(--crit); background: var(--crit-bg); }
.now { font-size: 11.5px; font-weight: 750; color: var(--k); background: color-mix(in srgb, var(--k) 15%, transparent); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.link { display: flex; justify-content: center; color: var(--line2); height: 18px; align-items: center; }
.link svg { width: 16px; height: 16px; }
.ctls { display: flex; flex-direction: column; gap: 14px; }
.ctl { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; }
.ctl-l { font-weight: 650; font-size: 14px; flex: 1 1 140px; }
.ctl-l span { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); }
.ctl .seg2 { flex: 1 1 280px; }
.ctl-row { display: flex; flex-wrap: wrap; gap: 8px; }
.help { margin: 0; line-height: 1.5; }
.seg2 { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--card2); border: 1px solid var(--line); }
.seg2 button { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 8px; border-radius: 10px; border: 0; background: transparent; font-weight: 650; color: var(--muted); cursor: pointer; font-size: 13.5px; min-width: 0; text-align: center; }
.seg2 button svg { width: 18px; height: 18px; }
.seg2 button.on { background: var(--raise); color: var(--text); box-shadow: 0 1px 2px rgba(15, 23, 42, .12), 0 0 0 1px var(--line); }
.seg2 button.on svg { color: var(--accent); }
.seg2 button[disabled] { cursor: not-allowed; }
.seg2 button[disabled]:not(.on) { opacity: .4; }
.busy { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--info-bg); color: var(--info); font-weight: 650; font-size: 13.5px; }
.sw { width: 50px; height: 30px; border-radius: 15px; background: var(--line2); border: 0; position: relative; cursor: pointer; flex: none; transition: background .15s; padding: 0; }
.sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .18s ease; }
.sw.on { background: var(--ok); }
.sw.on::after { transform: translateX(20px); }
.sw[disabled] { opacity: .5; cursor: default; }

.tuns { display: flex; flex-direction: column; gap: 10px; }
.tun { padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--card2); min-width: 0; }
.tun.act { border-color: color-mix(in srgb, var(--vpn) 50%, transparent); background: color-mix(in srgb, var(--vpn) 6%, var(--card)); }
.tun-h { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tun-g { margin-top: 8px; }
.tun-g .spark { height: 40px; }
.tun-g .tiny { margin-top: 2px; }
.tun-m { font-size: 12.5px; color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
.tun-a { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.results { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.spark { width: 100%; height: 36px; display: block; overflow: visible; }
.spark .line { fill: none; stroke: var(--muted); stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.spark .area { fill: color-mix(in srgb, var(--muted) 12%, transparent); }
.spark.act .line, .spark.mini .line { stroke: var(--accent); stroke-width: 2; }
.spark.act .area, .spark.mini .area { fill: color-mix(in srgb, var(--accent) 16%, transparent); }
.spark .bad { fill: color-mix(in srgb, var(--crit) 28%, transparent); }
.strip-w { margin-bottom: 14px; }
.strip-h { display: flex; justify-content: space-between; gap: 6px 12px; font-size: 12px; color: var(--muted); margin-bottom: 6px; flex-wrap: wrap; }
.legend { display: inline-flex; gap: 4px 10px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.strip { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--card3); }
.strip i { display: block; height: 100%; }
.strip i.c1, .strip i.c2, .strip i.c3, .strip i.c4, .strip i.c5, .strip i.c6,
.legend i.c1, .legend i.c2, .legend i.c3, .legend i.c4, .legend i.c5, .legend i.c6 { background: var(--c); }
.strip i.none, .legend i.none { background: color-mix(in srgb, var(--crit) 55%, transparent); }
.strip-l { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
.order { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.ord { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px 4px 4px; border-radius: 999px; background: var(--card2); border: 1px solid var(--line); font-weight: 650; font-size: 13.5px; }
.kvs { display: grid; gap: 12px; }
.kv2 .k { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-bottom: 3px; font-weight: 600; }
.kv2 .v { font-size: 14px; overflow-wrap: anywhere; }
.meters { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.mt { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.mt b { color: var(--text); font-weight: 650; white-space: nowrap; }
.meter .bar { height: 7px; border-radius: 4px; background: var(--card3); overflow: hidden; }
.meter .bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.meter .bar i.warm { background: var(--warn); }
.meter .bar i.hot { background: var(--crit); }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 14px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.rt { margin-top: 6px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.rt-r { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-top: 1px solid var(--line); font-size: 13.5px; min-width: 0; }
.rt-r:first-child { border-top: 0; }
.rt-r.on { background: color-mix(in srgb, var(--ok) 10%, transparent); font-weight: 650; }
.rt-r.dis { opacity: .5; }
.rt-d { width: 22px; text-align: center; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; flex: none; }
.evs .ev { display: flex; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 14px; }
.evs .ev:first-child { border-top: 0; }
.card .evs { margin: -4px -2px 0; }
.card .evs .ev { padding: 9px 2px; }
.ev .t { color: var(--muted); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 42px; padding-top: 1px; }
.ev .x { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ev .dot { margin-top: 6px; }
.ev .src { margin-left: 8px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.ev.l-crit { background: color-mix(in srgb, var(--crit) 6%, transparent); }

/* ── серверы и площадки ── */
.srv-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 470px), 1fr)); }
.card.srv.off { opacity: .72; }
.srv-h { display: flex; align-items: center; gap: 12px; }
.schips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 12px; }
.schip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--card2); border: 1px solid var(--line); color: var(--text); font-size: 13px; font-weight: 650; }
.schip em { font-style: normal; font-weight: 500; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.schip.act { border-color: color-mix(in srgb, var(--vpn) 60%, transparent); background: color-mix(in srgb, var(--vpn) 11%, var(--card)); }
.schip.off { opacity: .5; }
.srv-f { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; }
.sites-l .mchain { margin: 7px 0 5px; }
.matrix { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.matrix th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 650; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.matrix th .num { margin-right: 6px; }
.matrix td { padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.matrix tr:last-child td { border-bottom: 0; }
.matrix td.na { color: var(--muted); }
.matrix td.act { background: color-mix(in srgb, var(--vpn) 10%, transparent); font-weight: 700; }
.matrix .dot { margin-right: 7px; }
.matrix td a { color: var(--text); }
.card.scroll-x { padding: 6px 8px; }
.ss-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.ss-row { display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); }
.ss-mv { display: none; }
.ss-list.own .ss-mv { display: inline-flex; }
.cl-list { margin-top: 12px; display: flex; flex-direction: column; }
.cl { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-top: 1px solid var(--line); }
.cl:first-child { border-top: 0; }
.devs { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.dev { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0; padding: 12px; }
.filters select { width: auto; flex: 1 1 170px; }
.filters .search { flex: 2 1 220px; }

/* ── кнопки и формы ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  padding: 10px 16px; border-radius: 12px; font-weight: 650; background: var(--card2); color: var(--text);
  border: 1px solid var(--line); min-height: 42px; white-space: nowrap; text-decoration: none; transition: border-color .12s, filter .12s;
}
.btn:hover { border-color: var(--line2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink); border-color: transparent; box-shadow: 0 6px 18px -10px color-mix(in srgb, var(--accent) 80%, transparent); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { color: var(--crit); }
.btn.danger.solid { background: var(--crit); color: #fff; border-color: transparent; }
.btn.small { padding: 6px 12px; min-height: 34px; font-size: 13.5px; border-radius: 10px; }
.btn.xs { padding: 5px 10px; min-height: 30px; font-size: 12.5px; border-radius: 9px; gap: 5px; }
.btn.xs svg { width: 15px; height: 15px; }
.btn.wide { width: 100%; }
.btn.big { min-height: 50px; font-size: 16px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); padding-left: 4px; padding-right: 4px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn svg { width: 18px; height: 18px; }
.icon-btn { background: none; border: 0; padding: 7px; border-radius: 10px; cursor: pointer; color: var(--muted); display: inline-flex; }
.icon-btn:hover { background: var(--card2); color: var(--text); }
.icon-btn[disabled] { opacity: .25; pointer-events: none; }
.icon-btn svg { width: 20px; height: 20px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field > .label { font-size: 13px; font-weight: 650; color: var(--muted); }
.hint { font-size: 12.5px; color: var(--muted); }
.sub-h { font-weight: 750; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-top: 6px; }
input[type=text], input[type=password], input[type=number], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--card2);
  outline: none; min-height: 42px; font-size: 16px; -webkit-appearance: none; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
textarea { min-height: 84px; resize: vertical; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; padding: 4px 0; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 440px) { .two { grid-template-columns: 1fr; } }
fieldset.tg { border: 0; padding: 0 0 0 30px; margin: 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
fieldset.tg[disabled] { opacity: .42; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { flex: 1; min-width: 130px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); cursor: pointer; }
.seg button.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.seg button b { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.seg button b svg { width: 17px; height: 17px; }
.seg button span { font-size: 12.5px; color: var(--muted); }
.seg.mini { margin-top: 10px; }
.seg.mini button { min-width: 0; padding: 7px 12px; text-align: center; font-weight: 650; font-size: 13.5px; }
.search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--card2); min-width: 0; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.search svg { width: 18px; height: 18px; color: var(--muted); }
.search input { border: 0; background: transparent; padding: 9px 0; min-height: 40px; box-shadow: none !important; }
details.adv summary { cursor: pointer; color: var(--accent); font-weight: 650; font-size: 14px; padding: 6px 0; }
details.adv[open] summary { margin-bottom: 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

/* ── окна ── */
.sheet-bg { position: fixed; inset: 0; background: rgba(2, 6, 15, .5); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sheet { background: var(--card); width: 100%; max-width: 640px; max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; border-radius: 22px 22px 0 0; padding: 18px 16px calc(env(safe-area-inset-bottom) + 18px); animation: up .2s ease; border: 1px solid var(--line); }
.sheet.wide { max-width: 760px; }
@media (min-width: 700px) { .sheet-bg { align-items: center; padding: 20px; } .sheet { border-radius: 22px; padding: 22px; } }
.sheet .bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sheet .bar h2 { flex: 1; font-size: 18px; }
.sheet .actions { margin-top: 18px; flex-wrap: nowrap; }
.sheet .actions .btn { flex: 1; }
.confirm p { margin: 0 0 10px; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 12px); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
@media (min-width: 1000px) { .toast-wrap { bottom: 24px; } }
.toast { background: #0f172a; color: #fff; padding: 11px 16px; border-radius: 13px; font-size: 14px; max-width: 560px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); animation: up .2s; pointer-events: auto; border: 1px solid rgba(255, 255, 255, .08); }
.toast.err { background: #b91c1c; color: #fff; }

/* ── вход ── */
.login-bg { min-height: 100vh; display: flex; justify-content: center; padding: calc(env(safe-area-inset-top) + 9vh) 16px 40px; }
.login { width: 100%; max-width: 400px; }
.login-logo img { width: 78px; height: 78px; border-radius: 21px; display: block; margin: 0 auto 18px; box-shadow: 0 14px 34px -12px color-mix(in srgb, var(--accent) 70%, transparent); }
.login h1 { text-align: center; }
.login .sub { text-align: center; color: var(--muted); margin: 6px 0 24px; }
.login .card { padding: 18px; }
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 13px; background: var(--info-bg); font-size: 13.5px; margin-bottom: 14px; }
.note svg { width: 18px; height: 18px; color: var(--info); }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ── прочее ── */
.empty { text-align: center; color: var(--muted); padding: 26px 12px; font-size: 14px; }
.code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; background: var(--card2); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.code.center { text-align: center; }
.spin { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: rot .7s linear infinite; display: inline-block; flex: none; vertical-align: middle; }
@keyframes rot { to { transform: rotate(360deg); } }
.qr { width: 200px; height: 200px; border-radius: 12px; background: #fff; padding: 8px; display: block; margin: 8px auto; }
@media (max-width: 420px) {
  h1 { font-size: 23px; }
  .card { padding: 14px; }
  .hero { padding: 15px; }
  .hero-t { font-size: 19px; }
  .meters { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
