:root {
  --bg: #0a0f1a;
  --panel: #0f1623;
  --panel2: #131c2b;
  --line: #1c2738;
  --line2: #263247;
  --ink: #d5dde8;
  --ink-strong: #f1f5fb;
  --muted: #6c7b92;
  --accent: #22d3ee;
  --accent2: #3b82f6;
  --accent-ink: #04121a;
  --ok: #34d399;
  --warn: #f59e0b;
  --bad: #f43f5e;
  --danger: #f43f5e;
  --violet: #a78bfa;
  --pink: #f472b6;
  --field: #0b1220;
  --glow: rgba(34, 211, 238, .18);
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, "Courier New", monospace;
  --rail: 56px;
  --head: 52px;
}
body[data-theme="light"] {
  --bg: #eef2f7;
  --panel: #ffffff;
  --panel2: #f6f8fb;
  --line: #e1e7ef;
  --line2: #d3dbe6;
  --ink: #233046;
  --ink-strong: #0d1626;
  --muted: #6b778a;
  --accent: #0891b2;
  --accent2: #2563eb;
  --accent-ink: #ffffff;
  --ok: #059669;
  --warn: #d97706;
  --bad: #e11d48;
  --danger: #e11d48;
  --violet: #7c3aed;
  --pink: #db2777;
  --field: #ffffff;
  --glow: rgba(8, 145, 178, .14);
}

* { box-sizing: border-box; }
html { scrollbar-color: var(--line2) var(--bg); zoom: var(--ui-scale, 1); }
body { margin: 0; color: var(--ink); background: var(--bg); font: 14px/1.45 "Inter", "Segoe UI", system-ui, sans-serif; }
a { color: var(--accent); }
h1 { margin: 0 0 16px; font-size: 20px; font-weight: 600; color: var(--ink-strong); }
h2 { font-size: 12px; margin: 0 0 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
h3 { color: var(--ink-strong); }
code, pre, .mono { font-family: var(--mono); }

/* ---------- rail + header ---------- */
.rail { position: fixed; z-index: 30; inset: 0 auto 0 0; width: var(--rail); background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding: 8px 0; gap: 4px; }
.rail .logo { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent2), var(--accent)); color: #fff; font-weight: 800; font-size: 15px; text-decoration: none; margin-bottom: 10px; box-shadow: 0 0 16px var(--glow); }
.rail a.ico, .rail button.ico { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 9px; color: var(--muted); background: transparent; border: 0; padding: 0; cursor: pointer; text-decoration: none; }
.rail a.ico svg, .rail button.ico svg { width: 19px; height: 19px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rail a.ico:hover, .rail button.ico:hover { color: var(--ink-strong); background: var(--panel2); }
.rail a.ico.on { color: var(--accent); background: var(--panel2); }
.rail a.ico.on:before { content: ""; position: absolute; left: -8px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.rail .tip { position: absolute; left: 48px; top: 50%; transform: translateY(-50%); white-space: nowrap; background: var(--panel2); color: var(--ink-strong); border: 1px solid var(--line2); border-radius: 6px; padding: 4px 8px; font-size: 12px; pointer-events: none; opacity: 0; transition: opacity .12s; }
.rail .ico:hover .tip { opacity: 1; }
.rail .bottom { margin-top: auto; display: flex; flex-direction: column; gap: 4px; align-items: center; }
body.rail-wide { --rail: 228px; }
body.rail-wide .rail { align-items: stretch; padding: 8px; }
body.rail-wide .rail .logo { margin: 0 0 10px 3px; }
body.rail-wide .rail a.ico, body.rail-wide .rail button.ico { width: auto; height: 36px; display: flex; align-items: center; justify-content: flex-start; gap: 10px; padding: 0 10px; }
body.rail-wide .rail .tip { position: static; transform: none; opacity: 1; background: none; border: 0; padding: 0; color: inherit; font-size: 13px; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.rail-wide .rail .bottom { align-items: stretch; }
.sitehead { position: fixed; z-index: 25; top: 0; left: var(--rail); right: 0; height: var(--head); display: flex; align-items: center; gap: 14px; padding: 0 18px; background: var(--panel); border-bottom: 1px solid var(--line); }
.sitehead .name { display: flex; align-items: center; }
.sitehead .name img { height: 32px; width: auto; }
.sitehead .name .brand-light { display: none; }
body[data-theme="light"] .sitehead .name .brand-dark { display: none; }
body[data-theme="light"] .sitehead .name .brand-light { display: block; }
.rail .logo { background: none; box-shadow: none; padding: 0; overflow: hidden; }
.rail .logo img { width: 34px; height: 34px; display: block; border-radius: 9px; }
.sitehead .crumb { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; padding-left: 14px; border-left: 1px solid var(--line); }
.sitehead .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
b.ev-bad { color: var(--bad); }
.lang-pick { display: flex; align-items: center; gap: 2px; }
.lang-pick .lang-a { color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 800; letter-spacing: .04em; padding: 4px 7px; border-radius: 6px; line-height: 1; }
.lang-pick .lang-a:hover { color: var(--ink-strong); background: var(--panel2); }
.lang-pick .lang-a.on { color: var(--accent); background: var(--panel2); }
.sitehead .clock { font-family: var(--mono); color: var(--muted); font-size: 13px; }
.sitehead select.router-pick { min-width: 190px; padding: 5px 30px 5px 10px; border-radius: 8px; font-size: 13px; background: var(--panel2); color: var(--ok); border: 1px solid var(--line2); font-weight: 600; }
.sitehead .who { color: var(--muted); font-size: 12px; }
main { margin-left: var(--rail); padding: calc(var(--head) + 18px) 20px 64px; min-height: 100vh; }
main > h1 { display: none; }

/* ---------- base widgets ---------- */
.panel, details.grow, .stat, .graph, .dcard, .mk-card, .md-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.panel { padding: 16px; margin-bottom: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--ink); background: var(--field); border: 1px solid var(--line2); border-radius: 8px; padding: 8px 10px; min-width: 0; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow); }
input[type=checkbox] { min-width: auto; width: auto; accent-color: var(--accent); }
textarea { width: 100%; min-height: 90px; }
textarea.code { font-family: var(--mono); font-size: 12.5px; min-height: 280px; white-space: pre; }
button, .btn { background: var(--accent); color: var(--accent-ink); border: 1px solid transparent; border-radius: 8px; padding: 7px 14px; font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { filter: brightness(1.08); }
button.ghost, .btn.ghost { background: transparent; color: var(--ink); border-color: var(--line2); font-weight: 500; }
button.ghost:hover, .btn.ghost:hover { border-color: var(--accent); color: var(--accent); filter: none; }
button.danger { background: var(--danger); color: #fff; }
table { width: 100%; border-collapse: collapse; background: transparent; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
tbody tr:hover { background: var(--panel2); }
.panel > table, .panel table { margin-top: 4px; }
.muted { color: var(--muted); }
.release { margin: 14px 0 0; }
.release b { display: inline-block; min-width: 52px; color: var(--accent); }
.release span { color: var(--ink); }
.release ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.release li { margin: 2px 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
td .actions form { margin: 0; }
.badge, .pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--panel2); color: var(--muted); border: 1px solid var(--line2); }
.badge.active, .badge.online, .pill.running { background: rgba(52, 211, 153, .12); color: var(--ok); border-color: rgba(52, 211, 153, .35); }
.badge.offline { color: var(--muted); }
.badge.blocked, .badge.expired, .badge.err, .pill.down { background: rgba(244, 63, 94, .1); color: var(--bad); border-color: rgba(244, 63, 94, .3); }
.badge.warn { background: rgba(245, 158, 11, .1); color: var(--warn); border-color: rgba(245, 158, 11, .3); }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid var(--line2); }
.flash.ok { background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .35); }
.flash.err { background: rgba(244, 63, 94, .1); border-color: rgba(244, 63, 94, .35); }
.tabs { display: flex; gap: 6px; margin: 0 0 14px; flex-wrap: wrap; }
.tabs a { text-decoration: none; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; font-size: 13px; }
.tabs a.on { background: var(--panel2); color: var(--accent); border-color: var(--accent); }
pre.ros { white-space: pre-wrap; word-break: break-word; font: 12px/1.45 var(--mono); background: var(--field); border: 1px solid var(--line); color: var(--ink); padding: 10px 12px; border-radius: 8px; max-height: 420px; overflow: auto; }
details summary { cursor: pointer; margin: 8px 0; color: var(--muted); }
.find { max-width: 260px; margin: 0 0 8px; }
.checks label { display: flex; flex-direction: row; align-items: center; gap: 6px; margin: 3px 0; font-size: 13px; color: var(--ink); }
.checks .g { display: block; margin: 14px 0 4px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.chk { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.meters { display: flex; flex-wrap: wrap; gap: 12px; }
.meter { min-width: 140px; }
.meter b { display: block; font-size: 22px; color: var(--ink-strong); font-family: var(--mono); }
.spark { width: 100%; height: 72px; color: var(--accent); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: radial-gradient(circle at 30% 20%, rgba(34, 211, 238, .08), transparent 40%), var(--bg); }
.login { width: min(400px, calc(100% - 32px)); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 26px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.login h1 { display: block; }
.login h1 img { width: auto; height: 64px; max-width: 100%; border-radius: 0; }
.brand-light, body[data-theme="light"] .brand-dark, body[data-theme="light"] .sitehead .brand-dark { display: none; }
body[data-theme="light"] .brand-light, body[data-theme="light"] .sitehead .brand-light { display: block; }
.totp-secret { font-family: var(--mono); font-size: 18px; letter-spacing: .14em; color: var(--ink-strong); word-break: break-all; }
.qr { display: inline-block; background: #fff; padding: 10px; border-radius: 10px; line-height: 0; }
.codes { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.codes code { background: var(--field); border: 1px solid var(--line2); border-radius: 8px; padding: 6px 8px; color: var(--ink-strong); }

/* ---------- monitoring list ---------- */
.dcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-bottom: 16px; }
.dcard { display: flex; flex-direction: column; gap: 6px; padding: 14px; transition: border-color .15s; }
.dcard:hover { border-color: var(--line2); }
.dcard a { color: inherit; text-decoration: none; }
.dcard b { display: block; color: var(--ink-strong); font-size: 15px; }
.dcard small, .dcard .sub { color: var(--muted); font-size: 12px; }
.dcard .sub { color: var(--accent); }
.dcard .top { display: flex; align-items: center; gap: 8px; }
.dcard .pair { display: flex; justify-content: space-between; font: 12.5px var(--mono); color: var(--ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-left: auto; }
.dot.online { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.gauge { display: block; height: 4px; margin-top: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.gauge i { display: block; height: 100%; }
.gauge .ok { background: var(--ok); }
.gauge .warn { background: var(--warn); }
.gauge .bad { background: var(--bad); }

/* ---------- old dashboard helpers (interfaces page) ---------- */
.dash { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 8px 0 14px; }
.stat, .graph { padding: 12px 14px; }
.stat span, .graph > span { display: block; font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.stat b { display: block; font: 600 24px/1.15 var(--mono); margin: 6px 0 2px; color: var(--ink-strong); }
.stat b.tone-ok { color: var(--ok); }
.stat b.tone-warn { color: var(--warn); }
.stat b.tone-bad { color: var(--bad); }
.stat.wide { grid-column: 1 / -1; }
.stat.wide b { font-size: 20px; }
.stat small { color: var(--muted); }
.graph { grid-column: span 2; }
.graph.solo { margin-bottom: 14px; }
.gchart { width: 100%; height: 180px; display: block; }
.gchart .grid { stroke: var(--line); stroke-width: .4; }
.legend { display: flex; gap: 14px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 2px; vertical-align: -1px; }
details.grow { margin: 0 0 12px; }
details.grow > summary { cursor: pointer; margin: 0; padding: 12px 16px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
details.grow .inner { padding: 0 14px 14px; }
.ranges { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 12px; }
.ranges a { text-decoration: none; color: var(--muted); background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 3px 9px; font: 12px var(--mono); }
.ranges a.on { color: var(--accent); border-color: var(--accent); }

/* ---------- device page chrome ---------- */
.topbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.topbar a { color: var(--muted); text-decoration: none; }
.topbar a:hover { color: var(--accent); }
.device-pick { display: none; }
.mk-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.mk-id, .mk-actions, .mk-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mk-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; margin-left: auto; }
.mk-title { font-size: 22px; font-weight: 700; color: var(--ink-strong); letter-spacing: -.01em; }
.mk-status { font-size: 12px; font-weight: 600; color: var(--ok); background: rgba(52, 211, 153, .1); border: 1px solid rgba(52, 211, 153, .3); padding: 2px 10px; border-radius: 99px; }
.mk-status.is-off { color: var(--bad); background: rgba(244, 63, 94, .1); border-color: rgba(244, 63, 94, .3); }
.mk-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); display: inline-block; margin-right: 6px; box-shadow: 0 0 6px var(--ok); }
.mk-dot.off { background: var(--bad); box-shadow: 0 0 6px var(--bad); }
.mk-actions form { margin: 0; }
.btn-mk, .mk-actions button, .mk-actions .btn-mk { background: var(--panel2); color: var(--ink); border: 1px solid var(--line2); border-radius: 8px; padding: 5px 11px; font-size: 12.5px; font-weight: 500; text-decoration: none; cursor: pointer; display: inline-block; }
.btn-mk:hover { border-color: var(--accent); color: var(--accent); filter: none; }
.btn-mk.reboot { color: var(--warn); }
.btn-mk.del { color: var(--bad); border-color: rgba(244, 63, 94, .4); }
.winbar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 5px 6px; margin: 0 0 14px; }
.win-items { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; flex: 1; }
.win-link, .win-drop > button { background: transparent; border: 0; color: var(--ink); border-radius: 7px; padding: 6px 10px; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; }
.win-link.on, .win-drop.on > button, .win-link:hover, .win-drop > button:hover { background: var(--panel2); color: var(--accent); filter: none; }
.win-drop { position: relative; }
.win-sub { display: none; position: absolute; z-index: 20; top: 100%; left: 0; min-width: 210px; max-height: 340px; overflow: auto; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 12px 30px rgba(0, 0, 0, .35); padding: 6px; }
.win-drop:hover .win-sub, .win-drop:focus-within .win-sub { display: block; }
.win-mode { display: flex; align-items: center; gap: 6px; margin: 0; padding: 3px 4px 3px 12px; background: color-mix(in srgb, var(--accent) 14%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 70%, transparent); border-radius: 999px; }
.win-mode-label { color: var(--accent); font-size: 12px; font-weight: 700; white-space: nowrap; }
.win-mode button { background: transparent; border: 1px solid transparent; color: var(--accent); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.win-mode button.on { background: var(--accent); color: #04141c; border-color: var(--accent); }
.win-mode button:hover:not(.on) { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.win-sub .win-note { display: block; padding: 6px 9px; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.win-sub a { display: block; padding: 6px 9px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 13px; }
.win-sub a.on, .win-sub a:hover { background: var(--panel2); color: var(--accent); }
.win-find { padding: 5px 9px; min-width: 150px; font-size: 13px; }
.win-burger { display: none; }
.win-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 8px; }
.win-scroll { overflow: auto; }
.workspace, .sheet { display: block; }

/* ---------- MikroDash-like grid ---------- */
.md-tools { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin: 0 0 12px; position: relative; }
.md-tools .hint { color: var(--muted); font-size: 12px; margin-right: auto; }
.md-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; align-items: stretch; }
.md-card { padding: 14px 16px; min-width: 0; display: flex; flex-direction: column; gap: 10px; position: relative; }
.md-card.s12 { grid-column: span 12; }
.md-card.s9 { grid-column: span 9; }
.md-card.s8 { grid-column: span 8; }
.md-card.s6 { grid-column: span 6; }
.md-card.s4 { grid-column: span 4; }
.md-card.s3 { grid-column: span 3; }
.md-h { display: flex; align-items: center; gap: 10px; min-height: 26px; }
.md-h > b { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.md-h .grip { cursor: grab; color: var(--line2); font-size: 14px; letter-spacing: -2px; user-select: none; }
.md-h .grip:hover { color: var(--accent); }
.md-h .end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.md-h .end b { font: 600 12px var(--mono); color: var(--ink); letter-spacing: 0; text-transform: none; }
.md-card.dragging { opacity: .45; }
.md-card.drop-before { box-shadow: -3px 0 0 var(--accent); }
.md-card select, .md-h select { padding: 4px 26px 4px 9px; font-size: 12.5px; border-radius: 7px; background: var(--panel2); }
.count { background: var(--panel2); color: var(--accent); border: 1px solid var(--line2); border-radius: 999px; padding: 0 8px; font: 600 11.5px/18px var(--mono); }
.tag-up { color: var(--ok); background: rgba(52, 211, 153, .1); border: 1px solid rgba(52, 211, 153, .3); border-radius: 6px; padding: 1px 8px; font: 600 11.5px var(--mono); }
.tag-down { color: var(--bad); background: rgba(244, 63, 94, .1); border: 1px solid rgba(244, 63, 94, .3); border-radius: 6px; padding: 1px 8px; font: 600 11.5px var(--mono); }
.rx { color: var(--accent); }
.tx { color: var(--ok); }
.md-big { font: 600 13px var(--mono); }
.md-big .rx, .md-big .tx { font-size: 15px; }
.md-chart { width: 100%; height: 190px; display: block; }
.md-chart .grid { stroke: var(--line); stroke-width: .35; }
.md-axis { display: flex; justify-content: space-between; font: 10.5px var(--mono); color: var(--muted); }
.md-empty { color: var(--muted); font-size: 13px; padding: 20px 0; text-align: center; }
.bars { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; height: 100%; }
.bar { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 180px; }
.bar small { font: 600 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.bar .pct { font: 11px var(--mono); color: var(--muted); }
.bar .tube { flex: 1; width: 100%; max-width: 74px; border-radius: 8px; background: var(--panel2); border: 1px solid var(--line); position: relative; overflow: hidden; }
.bar .tube i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 0 0 7px 7px; }
.bar.rx .tube i { background: linear-gradient(180deg, rgba(34, 211, 238, .9), rgba(59, 130, 246, .6)); box-shadow: 0 0 16px rgba(34, 211, 238, .35); }
.bar.tx .tube i { background: linear-gradient(180deg, rgba(52, 211, 153, .9), rgba(16, 185, 129, .5)); box-shadow: 0 0 16px rgba(52, 211, 153, .3); }
.bar .val { font: 600 13px var(--mono); color: var(--ink-strong); }
.rings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ring { text-align: center; }
.ring svg { width: 100%; max-width: 104px; height: auto; display: block; margin: 0 auto; }
.ring .track { stroke: var(--line); }
.ring b { display: block; margin-top: -42px; font: 700 17px var(--mono); color: var(--ink-strong); }
.ring small { display: block; margin-top: 2px; font: 600 10px var(--mono); color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.ring.ok .arc { stroke: var(--ok); }
.ring.warn .arc { stroke: var(--warn); }
.ring.bad .arc { stroke: var(--bad); }
.ring.cpu .arc { stroke: var(--accent2); }
.facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font: 12px var(--mono); color: var(--muted); margin-top: 18px; }
.facts b { color: var(--ink-strong); font-weight: 600; }
.okline { display: flex; align-items: center; gap: 8px; font: 12px var(--mono); color: var(--ok); background: rgba(52, 211, 153, .07); border: 1px solid rgba(52, 211, 153, .25); border-radius: 8px; padding: 7px 10px; }
.okline.off { color: var(--bad); background: rgba(244, 63, 94, .07); border-color: rgba(244, 63, 94, .25); }
.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.types div { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
.types small { display: block; font: 600 10px var(--mono); color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.types b { display: block; font: 700 20px var(--mono); }
.types .t0 b { color: var(--accent2); } .types .t1 b { color: var(--violet); } .types .t2 b { color: var(--ok); }
.types .t3 b { color: var(--warn); } .types .t4 b { color: var(--pink); } .types .t5 b { color: var(--accent); }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.kv div { background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; min-width: 0; }
.kv span { display: block; font: 600 10px var(--mono); color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.kv b { display: block; font: 600 13px var(--mono); color: var(--ink-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ifc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 8px; }
.ifc { background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; display: flex; flex-direction: column; gap: 3px; min-width: 0; position: relative; }
.ifc.up { border-color: rgba(52, 211, 153, .28); }
.ifc.down { opacity: .55; }
.ifc .n { display: flex; align-items: center; gap: 6px; font: 600 12.5px var(--mono); color: var(--ink-strong); min-width: 0; }
.ifc .n b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ifc .n .t { flex: none; padding: 0 6px; border: 1px solid var(--line); border-radius: 5px; font-size: 10px; line-height: 16px; }
.ifc .mc { position: relative; height: 38px; margin: 4px 0 2px; border-radius: 6px; background: rgba(34, 211, 238, .03); border-bottom: 1px solid var(--line); overflow: hidden; }
.ifc .mc svg { width: 100%; height: 100%; display: block; }
.ifc .mc .fr { fill: rgba(34, 211, 238, .22); }
.ifc .mc .ft { fill: rgba(52, 211, 153, .12); }
.ifc .mc .lr { fill: none; stroke: var(--accent); stroke-width: 1.4; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.ifc .mc .lt { fill: none; stroke: var(--ok); stroke-width: 1.2; vector-effect: non-scaling-stroke; stroke-linejoin: round; opacity: .9; }
.ifc .mc .mx { position: absolute; top: 2px; right: 3px; padding: 0 4px; border-radius: 4px; background: rgba(15, 22, 35, .85); font: 9.5px/14px var(--mono); color: var(--muted); }
body[data-theme="light"] .ifc .mc .mx { background: rgba(255, 255, 255, .85); }
.ifc .mc .flat { position: absolute; inset: 0; display: grid; place-items: center; font: 10px var(--mono); color: var(--muted); opacity: .6; letter-spacing: .08em; }
.ifc .v { display: flex; justify-content: space-between; gap: 6px; font: 600 12px var(--mono); }
.ifc .v span { white-space: nowrap; }
.ifc .v .r { color: var(--accent); }
.ifc .v .t2 { color: var(--ok); }
.ifc .n i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: none; }
.ifc.up .n i { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.ifc.down .n i { background: var(--bad); }
.ifc .t { font: 11px var(--mono); color: var(--muted); }
.ifc-filter { display: flex; gap: 6px; }
.md-table { width: 100%; font: 12px var(--mono); }
.md-table th { font-size: 10.5px; }
.md-table td { padding: 7px 8px; }
.md-scroll { max-height: 330px; overflow: auto; }
.chips, .v-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { border-radius: 6px; padding: 3px 8px; font: 600 11.5px var(--mono); background: var(--panel2); color: var(--muted); border: 1px solid var(--line); }
.chip.on { color: var(--ok); border-color: rgba(52, 211, 153, .3); }
.chip.warn { color: var(--warn); border-color: rgba(245, 158, 11, .35); }
.chip.off { opacity: .6; }
a.chip { color: var(--muted); text-decoration: none; }
a.chip small { color: var(--dim, var(--muted)); font-weight: 500; margin-left: 4px; }
a.chip.on { color: var(--accent); border-color: var(--accent); }
.login-journals { margin: 0 0 14px; }
.vchip { display: inline-flex; align-items: center; gap: 6px; max-width: 280px; border-radius: 8px; padding: 5px 9px; font: 12px var(--mono); background: var(--panel2); border: 1px solid var(--line); color: var(--ink); }
.vchip b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; color: var(--ink-strong); }
.vchip small { color: var(--muted); }
.vchip small.rate { color: var(--accent); }
.vchip .led { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.vchip.up .led { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.vchip.down { opacity: .55; }
.vchip.vpn { border-color: rgba(167, 139, 250, .35); }
.vchip.lan { border-color: rgba(59, 130, 246, .35); }
.vchip.wireless { border-color: rgba(52, 211, 153, .35); }
.v-group + .v-group { margin-top: 10px; }
.v-group .v-row { margin-top: 6px; }
.mk-sub { display: flex; align-items: center; gap: 6px; font: 600 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.mk-sub span { color: var(--accent); }
.vlan-pick { flex-direction: row; align-items: center; gap: 6px; font-size: 12px; }
.vlan-pick select { width: auto; min-width: 80px; }
.blk-menu { display: none; position: absolute; right: 0; top: 100%; z-index: 25; min-width: 250px; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 12px 30px rgba(0, 0, 0, .35); padding: 10px; margin-top: 6px; }
.blk-menu.on { display: block; }
.blk-menu label { display: flex; flex-direction: row; gap: 8px; align-items: center; padding: 4px 2px; font-size: 13px; color: var(--ink); cursor: pointer; }
.blk-menu .btn-mk { margin-top: 6px; width: 100%; }
.mk-note { color: var(--muted); font-size: 12px; margin: 0; }
.poe-num b { font: 700 26px var(--mono); color: var(--ok); }

/* ---------- ports ---------- */
.mk-split { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.port-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.port-col:first-child { flex: 1; }
.sfp-box, .lte-box { flex: none; padding-left: 22px; border-left: 1px solid var(--line); }
.port.lte:not(.down) .jack { border-color: rgba(167, 139, 250, .6); box-shadow: 0 0 10px rgba(167, 139, 250, .16); }
.port.lte:not(.down) b { color: var(--violet); }
.port.lte:not(.down) .jack .led { background: var(--violet); box-shadow: 0 0 6px var(--violet); }
.mk-legend .sw.lte { background: var(--violet); }
.port-grid { display: flex; flex-wrap: wrap; gap: 12px 8px; align-items: flex-start; }
.port { width: 70px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; border: 0; background: transparent; color: var(--ink); cursor: pointer; text-align: center; font-weight: 400; }
.port:hover { filter: none; }
.port:hover .jack { transform: translateY(-2px); }
.jack { position: relative; width: 44px; height: 38px; border-radius: 6px; background: linear-gradient(180deg, #1d2a3d, #121b2a); border: 1px solid #2a3a52; transition: transform .12s, border-color .12s; }
.port:not(.down) .jack { border-color: rgba(52, 211, 153, .55); box-shadow: 0 0 10px rgba(52, 211, 153, .15); }
.port.s100 .jack { border-color: rgba(245, 158, 11, .55); box-shadow: 0 0 10px rgba(245, 158, 11, .12); }
.port.s10 .jack { border-color: rgba(59, 130, 246, .6); box-shadow: 0 0 10px rgba(59, 130, 246, .15); }
.jack .slot { position: absolute; left: 8px; right: 8px; bottom: 6px; height: 17px; border-radius: 2px 2px 4px 4px; background: #070b12; box-shadow: inset 0 2px 0 #000; }
.jack .slot:before { content: ""; position: absolute; left: 3px; right: 3px; top: 3px; height: 4px; background: repeating-linear-gradient(90deg, #5d6d84 0 1px, transparent 1px 3px); opacity: .9; }
.jack .led { position: absolute; top: 5px; width: 5px; height: 5px; border-radius: 50%; background: #253247; }
.jack .led.link { left: 8px; }
.jack .led.act { right: 8px; }
.port.s1 .jack .led, .port.up .jack .led { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.port.s100 .jack .led { background: var(--warn); box-shadow: 0 0 6px var(--warn); }
.port.s10 .jack .led { background: var(--accent2); box-shadow: 0 0 6px var(--accent2); }
.port.down .jack .led { background: #253247; box-shadow: none; }
.port.s1 .jack .led.act, .port.up .jack .led.act, .port.s100 .jack .led.act, .port.s10 .jack .led.act { animation: port-blink 1s steps(2) infinite; }
.port b { display: block; width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 11px var(--mono); color: var(--ok); }
.port.down b { color: var(--muted); }
.port small { display: block; width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font: 10px var(--mono); }
.port .bolt { position: absolute; top: -8px; right: -6px; font-style: normal; font-size: 10px; }
@keyframes port-blink { 50% { opacity: .2; } }
.mk-legend { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 11.5px; color: var(--muted); }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; border: 1px solid var(--line2); }
.sw.s1 { background: var(--ok); } .sw.s100 { background: var(--warn); } .sw.s10 { background: var(--accent2); } .sw.down { background: #253247; } .sw.sfp { background: transparent; border-style: dashed; }
.mk-modal { display: none; position: fixed; inset: 0; background: rgba(3, 7, 14, .6); z-index: 50; place-items: center; }
.mk-modal.on { display: grid; }
.mk-dialog { width: min(420px, calc(100% - 32px)); background: var(--panel); color: var(--ink); border: 1px solid var(--line2); border-radius: 12px; padding: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
.ros-dialog { width: min(720px, calc(100% - 32px)); max-height: min(680px, calc(100vh - 48px)); overflow: auto; }
.ros-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin: 12px 0; }
.ros-fields label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ros-fields label.ros-wide { grid-column: 1 / -1; }
.ros-fields input, .ros-fields select { width: 100%; text-transform: none; letter-spacing: 0; font-weight: 500; font-family: var(--mono); font-size: 13px; }
.ros-fields input:disabled { opacity: .55; }
.ros-edit-actions { display: flex; justify-content: flex-end; gap: 8px; }
.win-table td .ros-edit { padding: 3px 8px; font-size: 12px; white-space: nowrap; }
.mk-dialog h3 { margin: 8px 0; font-family: var(--mono); }
.mk-dialog p { margin: 4px 0; font: 12.5px var(--mono); }
#mk-comment { margin-top: 10px; }

.md-status { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }
.md-note { font-size: 11.5px; margin: 0; }
.mono { font-family: var(--mono); }
.ifc-pick { margin: 0; }
.md-h .ranges { margin: 0; }
.md-h .ranges a { padding: 2px 7px; font-size: 11px; }
.md-big { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
.md-big b { font-size: 20px; color: inherit; }
.md-big .muted { font-size: 11.5px; font-weight: 400; }
.md-chart { position: relative; }
.md-chart svg { width: 100%; height: 100%; display: block; color: var(--ink); }
.md-chart .ymax { position: absolute; top: 0; left: 4px; font: 10.5px var(--mono); color: var(--muted); }
.ring circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.ring .arc { stroke: var(--ok); transition: stroke-dasharray .4s; }
.ring span { display: block; margin-top: 18px; font: 600 10.5px var(--mono); color: var(--ink); letter-spacing: .1em; text-transform: uppercase; }
.facts div { display: flex; gap: 6px; }
.okline { padding: 3px 9px; }
.okline i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; }
.types small { margin-bottom: 5px; }
.types i { display: block; height: 3px; border-radius: 3px; background: currentColor; opacity: .7; }
.types .t0 i { color: var(--accent2); } .types .t1 i { color: var(--violet); } .types .t2 i { color: var(--ok); }
.types .t3 i { color: var(--warn); } .types .t4 i { color: var(--pink); } .types .t5 i { color: var(--accent); }
.ifc-filter button { padding: 3px 10px; font: 600 11.5px var(--mono); background: var(--panel2); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; }
.ifc-filter button.on { color: var(--accent); border-color: var(--accent); }
.methods em { font-style: normal; margin-right: 6px; color: var(--muted); opacity: .6; }
.methods em.on { color: var(--accent); opacity: 1; }

.topo { display: flex; flex-direction: column; gap: 12px; }
.topo-sum { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tsum { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.tsum small { display: block; font: 600 11px var(--mono); color: var(--muted); letter-spacing: .06em; }
.tsum b { display: block; font: 700 24px/1.1 var(--mono); color: var(--ink-strong); }
.ti { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; background: rgba(34, 211, 238, .1); color: var(--accent); border: 1px solid rgba(34, 211, 238, .25); }
.ti svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tnode .tt small.hw { color: var(--violet); }
.tsum.wireless .ti, .k-ap .ti { background: rgba(167, 139, 250, .12); color: var(--violet); border-color: rgba(167, 139, 250, .3); }
.tsum.online .ti, .k-pc .ti, .k-laptop .ti, .k-phone .ti, .k-tv .ti { background: rgba(52, 211, 153, .1); color: var(--ok); border-color: rgba(52, 211, 153, .28); }
.tsum.dhcp .ti, .k-iot .ti, .k-printer .ti { background: rgba(245, 158, 11, .1); color: var(--warn); border-color: rgba(245, 158, 11, .28); }
.tsum.wan .ti, .k-wan .ti { background: rgba(52, 211, 153, .1); color: var(--ok); border-color: rgba(52, 211, 153, .3); }
.k-server .ti, .k-router .ti { background: rgba(59, 130, 246, .12); color: var(--accent2); border-color: rgba(59, 130, 246, .3); }
.k-camera .ti { background: rgba(244, 114, 182, .1); color: var(--pink); border-color: rgba(244, 114, 182, .3); }
.k-other .ti { background: var(--panel2); color: var(--muted); border-color: var(--line2); }
.topo-card { gap: 12px; }
.topo-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.topo-spot { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.topo-spot button { min-width: 0; padding: 3px 9px; font: 600 11px var(--mono); background: var(--panel2); color: var(--muted); border: 1px solid var(--line2); border-radius: 6px; cursor: pointer; }
.topo-spot button:hover, .topo-spot button.on { border-color: var(--accent); color: var(--accent); background: rgba(34, 211, 238, .08); }
.topo-legend { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; font: 11px var(--mono); color: var(--muted); }
.topo-legend .lg { display: inline-block; width: 16px; height: 3px; border-radius: 2px; margin-left: 6px; }
.lg.wired { background: var(--accent); } .lg.wireless { background: var(--violet); } .lg.wan { background: var(--ok); } .lg.down { background: var(--bad); }
.lg.g1 { background: var(--ok); } .lg.g100 { background: var(--warn); } .lg.g10 { background: var(--accent2); }
.lg.stp { background: repeating-linear-gradient(90deg, #94a3b8 0 4px, transparent 4px 7px); }
.lg.fiber { background: var(--accent2); } .lg.vpn { background: var(--pink); }
.topo-scroll { overflow: auto; border-radius: 12px; border: 1px solid var(--line); background: radial-gradient(circle, rgba(148, 163, 184, .09) 1px, transparent 1.2px) 0 0 / 18px 18px, var(--bg); min-height: 420px; cursor: grab; }
.topo-scroll.panning { cursor: grabbing; }
.topo-zoom { transform-origin: 0 0; }
.topo-tools { display: inline-flex; align-items: center; gap: 4px; }
.topo-tools button { min-width: 32px; padding: 3px 8px; font: 600 12px var(--mono); background: var(--panel2); color: var(--ink); border: 1px solid var(--line2); border-radius: 6px; cursor: pointer; }
.topo-tools button:hover { border-color: var(--accent); color: var(--accent); }
.topo-stage { position: relative; display: block; padding: 24px; min-width: 1100px; min-height: 520px; }
.topo-links { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; z-index: 0; }
.topo-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: stretch; gap: 14px 18px; position: relative; z-index: 1; width: 100%; }
.topo-scan { margin: 0; display: inline; }
.tnode { position: absolute; z-index: 1; display: flex; align-items: center; gap: 10px; width: 228px; padding: 10px 26px 10px 10px; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; color: var(--ink); text-decoration: none; box-shadow: 0 4px 18px rgba(0, 0, 0, .25); transition: border-color .2s, box-shadow .2s; cursor: grab; user-select: none; touch-action: none; }
.tnode:hover { border-color: var(--accent); text-decoration: none; }
.tnode.dragging { z-index: 6; cursor: grabbing; opacity: .94; box-shadow: 0 10px 28px rgba(0, 0, 0, .4); }
.tnode .tt { display: flex; flex-direction: column; min-width: 0; }
.tnode .tt b { font: 600 12.5px var(--mono); color: var(--ink-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tnode .tt small { font: 10.5px var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tnode .tt small.trace { color: var(--accent); }
.tnode .tt small.rates { margin-top: 2px; font-weight: 600; }
.tnode .badges { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.tnode .rates .r { color: var(--accent); } .tnode .rates .t2 { color: var(--ok); }
.tnode .dot { position: absolute; top: 9px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .6; }
.tnode.up .dot { background: var(--ok); box-shadow: 0 0 7px var(--ok); opacity: 1; }
.tnode.down .dot { background: var(--bad); box-shadow: 0 0 7px var(--bad); opacity: 1; }
.tnode.down { border-color: rgba(244, 63, 94, .35); }
.tnode.now { border-color: rgba(52, 211, 153, .65); box-shadow: 0 0 0 3px rgba(52, 211, 153, .12), 0 0 22px rgba(52, 211, 153, .18); }
.tnode.backup { border-color: rgba(245, 158, 11, .5); box-shadow: 0 0 0 3px rgba(245, 158, 11, .08); }
.tnode.core { flex-direction: column; text-align: center; width: 200px; padding: 18px 14px 14px; border-color: rgba(34, 211, 238, .45); box-shadow: 0 0 0 6px rgba(34, 211, 238, .05), 0 0 34px rgba(34, 211, 238, .18); cursor: grab; }
.tnode.core.down { border-color: rgba(244, 63, 94, .45); box-shadow: 0 0 0 6px rgba(244, 63, 94, .05), 0 0 34px rgba(244, 63, 94, .15); }
.tnode.core .tt { align-items: center; max-width: 100%; }
.ti.big { width: 72px; height: 72px; border-radius: 50%; background: radial-gradient(circle, rgba(34, 211, 238, .18), rgba(34, 211, 238, .04)); border-color: rgba(34, 211, 238, .45); }
.ti.big svg { width: 38px; height: 38px; }
.tnode.wanhint { width: 280px; padding: 12px; font-size: 12px; color: var(--muted); border-style: dashed; cursor: default; }
.tports { display: none; flex: 1 0 100%; flex-wrap: wrap; gap: 4px; justify-content: center; width: 100%; margin-top: 8px; }
.tnode.core:hover .tports, .tnode.k-switch:hover .tports, .tnode.k-router:hover .tports, .tnode.k-ap:hover .tports, .tnode.ports-on .tports, .tports.on { display: flex; }
.tnode.has-hw { flex-wrap: wrap; align-items: flex-start; }
.tnode.core:hover, .tnode.core.ports-on, .tnode.k-switch:hover, .tnode.k-router:hover, .tnode.k-switch.ports-on, .tnode.k-router.ports-on { width: auto; min-width: 200px; max-width: 420px; z-index: 5; flex-wrap: wrap; }
.tport { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 18px; padding: 0 4px; border-radius: 3px; border: 1px solid var(--line2); background: var(--panel2); color: var(--muted); cursor: pointer; }
.tport b { font: 600 9px var(--mono); color: inherit; }
.tport.up { color: var(--ok); border-color: rgba(52, 211, 153, .55); }
.tport.plain.up { color: var(--accent); border-color: rgba(34, 211, 238, .55); background: rgba(34, 211, 238, .1); }
.tport.s1.up { background: rgba(52, 211, 153, .16); }
.tport.s100.up { color: var(--warn); background: rgba(245, 158, 11, .16); border-color: rgba(245, 158, 11, .7); }
.tport.s10.up { color: var(--accent2); background: rgba(59, 130, 246, .18); border-color: rgba(59, 130, 246, .75); }
.tport.down { opacity: .4; }
.tport.stp { border-style: dashed; color: #94a3b8; border-color: #94a3b8; }
.tport.stp::after { content: ""; width: 5px; height: 4px; margin-left: 2px; border: 1px solid currentColor; border-radius: 1px; box-shadow: 0 -3px 0 -1px currentColor; }
.tport.hot.up { animation: port-pulse 1.5s ease-in-out infinite; }
.tport.spot { outline: 2px solid var(--ink-strong); outline-offset: 1px; }
.topo-portbox { margin: 0 0 10px; padding: 0 0 4px; border: 1px solid var(--line2); border-radius: 10px; background: var(--panel); }
.topo-portbox .md-h { padding: 8px 12px; }
.topo-portgrid { display: grid; grid-template-columns: minmax(140px, 200px) 1fr; gap: 4px 14px; padding: 0 12px 12px; font: 12.5px var(--mono); }
.topo-portgrid span { color: var(--muted); }
.topo-portgrid b { color: var(--ink-strong); font-weight: 600; }
.topo-portact { padding: 0 12px 12px; }
.topo-portbox .wan-lock { margin: 0 12px 12px; color: var(--muted); font-size: 12.5px; }
.tnode.k-ap { overflow: visible; }
.tnode.k-ap.front { z-index: 7; }
.twifi-zone { position: absolute; left: 4px; top: calc(100% + 10px); box-sizing: border-box; background: rgba(167, 139, 250, .08); border: 1px dashed rgba(167, 139, 250, .34); border-radius: 14px; z-index: 0; pointer-events: none; overflow: visible; }
.twifi-zone > b { position: absolute; left: 10px; top: 6px; font: 600 10px var(--mono); color: rgba(167, 139, 250, .5); letter-spacing: .04em; pointer-events: none; }
.twifi-zone > b span { color: rgba(167, 139, 250, .75); }
.twifi-align { position: absolute; right: 8px; top: 4px; z-index: 4; padding: 0; border: 0; background: transparent; color: rgba(167, 139, 250, .72); font: 600 10px var(--mono); letter-spacing: .03em; cursor: pointer; pointer-events: auto; }
.twifi-align:hover { color: rgba(167, 139, 250, 1); }
.twifi-grip { position: absolute; right: -2px; bottom: -2px; z-index: 4; width: 16px; height: 16px; pointer-events: auto; cursor: nwse-resize; opacity: .5; }
.twifi-grip::before, .twifi-grip::after { content: ""; position: absolute; right: 3px; bottom: 3px; border-right: 1.5px solid rgba(167, 139, 250, .9); border-bottom: 1.5px solid rgba(167, 139, 250, .9); }
.twifi-grip::before { width: 6px; height: 6px; }
.twifi-grip::after { width: 11px; height: 11px; }
.twifi-grip:hover { opacity: 1; }
.twifi-zone .tnode { pointer-events: auto; width: 180px; z-index: 2; }
body[data-theme="light"] .twifi-zone { background: rgba(124, 58, 237, .06); border-color: rgba(124, 58, 237, .3); }
body[data-theme="light"] .twifi-zone > b, body[data-theme="light"] .twifi-zone > b span { color: rgba(124, 58, 237, .55); }
body[data-theme="light"] .twifi-align { color: rgba(124, 58, 237, .7); }
.topo-stage.is-spot .tnode.dim { opacity: .14; }
.lk-base { fill: none; stroke-width: 2; opacity: .2; }
.lk-flow { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 2 11; animation: topo-flow 1.1s linear infinite; }
.lk-base.l-wired, .lk-flow.l-wired, .lk-base.l-pppoe, .lk-flow.l-pppoe { stroke: var(--accent); }
.lk-base.l-wireless, .lk-flow.l-wireless, .lk-base.l-lte, .lk-flow.l-lte { stroke: var(--violet); }
.lk-base.l-fiber, .lk-flow.l-fiber { stroke: var(--accent2); }
.lk-base.l-vpn, .lk-flow.l-vpn { stroke: var(--pink); }
.lk-flow.l-wired, .lk-flow.l-pppoe { filter: drop-shadow(0 0 3px rgba(34, 211, 238, .8)); }
.lk-flow.l-wireless, .lk-flow.l-lte { filter: drop-shadow(0 0 3px rgba(167, 139, 250, .8)); }
.lk-flow.l-fiber { filter: drop-shadow(0 0 3px rgba(59, 130, 246, .8)); }
.lk-flow.l-vpn { filter: drop-shadow(0 0 3px rgba(244, 114, 182, .8)); stroke-dasharray: 6 5 1 5; }
.lk-base.wan.l-wired, .lk-flow.wan.l-wired, .lk-base.wan.l-fiber, .lk-flow.wan.l-fiber { stroke: var(--ok); }
.lk-flow.wan { stroke-dasharray: 8 6; animation-duration: .9s; }
.lk-flow.wan.l-wired, .lk-flow.wan.l-fiber { filter: drop-shadow(0 0 3px rgba(52, 211, 153, .8)); }
.lk-flow.wan.l-vpn { stroke-dasharray: 6 5 1 5; }
.ltag { font-style: normal; font: 600 9.5px/14px var(--mono); padding: 0 5px; margin-left: 4px; border-radius: 4px; vertical-align: 1px; color: var(--ok); border: 1px solid rgba(52, 211, 153, .35); }
.ltag.pppoe { color: var(--accent); border-color: rgba(34, 211, 238, .35); }
.ltag.vpn { color: var(--pink); border-color: rgba(244, 114, 182, .35); }
.ltag.lte, .ltag.wireless { color: var(--violet); border-color: rgba(167, 139, 250, .35); }
.ltag.fiber { color: var(--accent2); border-color: rgba(59, 130, 246, .35); }
.ltag.now { color: var(--ok); border-color: rgba(52, 211, 153, .5); margin-left: 0; }
.ltag.backup { color: var(--warn); border-color: rgba(245, 158, 11, .45); margin-left: 0; }
.ltag.ok { color: var(--ok); margin-left: 0; }
.ltag.bad { color: var(--bad); border-color: rgba(244, 63, 94, .45); margin-left: 0; }
.ltag.dist { color: var(--muted); border-color: var(--line2); margin-left: 0; }
.ltag.caps-old { color: var(--warn); border-color: rgba(245, 158, 11, .5); margin-left: 0; }
.ltag.caps-new { color: var(--accent); border-color: rgba(34, 211, 238, .45); margin-left: 0; }
.ltag.caps-local { color: var(--muted); border-color: var(--line2); margin-left: 0; }
.cap-up { color: var(--ok); }
.cap-down { color: var(--bad); }
.cap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.cap-tile { background: var(--panel2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cap-tile.up { border-color: rgba(52, 211, 153, .28); }
.cap-tile.down { opacity: .55; }
.cap-tile .n { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.cap-tile .n b { flex: 1; min-width: 0; white-space: normal; overflow: visible; line-height: 1.3; font: 600 12.5px var(--mono); color: var(--ink-strong); }
.cap-tile .n i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: none; }
.cap-tile.up .n i { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.cap-tile.down .n i { background: var(--bad); }
.cap-tile small { color: var(--muted); font: 11px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cap-pick { margin: 0; flex: none; }
.cap-pick select { width: auto; min-width: 88px; padding: 2px 22px 2px 8px; font-size: 11px; }
.cap-board .mk-sub { margin: 2px 0 6px; }
.md-grid > .md-card::after { content: ""; position: absolute; right: 5px; bottom: 5px; width: 8px; height: 8px; border-right: 2px solid var(--line2); border-bottom: 2px solid var(--line2); pointer-events: none; }
.md-card.resizing { user-select: none; }
.md-card.resizing::after { border-color: var(--accent); }
.lk-base.spd-s1, .lk-flow.spd-s1, .lk-base.wan.spd-s1, .lk-flow.wan.spd-s1 { stroke: var(--ok); }
.lk-flow.spd-s1, .lk-flow.wan.spd-s1 { filter: drop-shadow(0 0 3px rgba(52, 211, 153, .8)); }
.lk-base.spd-s100, .lk-flow.spd-s100, .lk-base.wan.spd-s100, .lk-flow.wan.spd-s100 { stroke: var(--warn); }
.lk-flow.spd-s100, .lk-flow.wan.spd-s100 { filter: drop-shadow(0 0 3px rgba(245, 158, 11, .8)); }
.lk-base.spd-s10, .lk-flow.spd-s10, .lk-base.wan.spd-s10, .lk-flow.wan.spd-s10 { stroke: var(--accent2); }
.lk-flow.spd-s10, .lk-flow.wan.spd-s10 { filter: drop-shadow(0 0 3px rgba(59, 130, 246, .85)); }
.lk-base.stp, .lk-flow.stp, .lk-base.wan.stp, .lk-flow.wan.stp { stroke: #94a3b8; }
.lk-flow.stp, .lk-flow.wan.stp { animation: none; filter: none; opacity: .65; stroke-dasharray: 2 7; }
.lk-base.down, .lk-flow.down, .lk-base.wan.down, .lk-flow.wan.down { stroke: var(--bad); }
.lk-flow.down, .lk-flow.wan.down { animation: none; opacity: .5; stroke-dasharray: 3 7; filter: none; }
.lk-base.dim, .lk-flow.dim { opacity: .06; }
.lk-flow.dim { animation: none; filter: none; }
.lk-flow.unk { animation: none; opacity: .35; filter: none; }
@keyframes topo-flow { to { stroke-dashoffset: -26; } }
@keyframes port-pulse { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 50% { box-shadow: 0 0 8px 1px currentColor; } }
.tico { display: inline-block; vertical-align: middle; width: 16px; height: 16px; color: var(--accent); }
.tico svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.topo-act { white-space: nowrap; }
.topo-act form { display: inline; margin: 0 0 0 4px; }
.topo-form .row { align-items: flex-end; }
@media (prefers-reduced-motion: reduce) { .lk-flow, .tport.hot { animation: none; } }
.keybox { font-family: var(--mono); font-size: 13px; padding: 8px 10px; background: var(--field); border: 1px solid var(--line); border-radius: 8px; word-break: break-all; }

body[data-theme="light"] .jack { background: linear-gradient(180deg, #4a5568, #2d3748); border-color: #94a3b8; }
body[data-theme="light"] .port b { color: var(--ok); }

@media (max-width: 1200px) {
  .md-card.s9, .md-card.s8 { grid-column: span 12; }
  .md-card.s3 { grid-column: span 6; }
  .md-card.s4 { grid-column: span 6; }
}
.hscroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.home-hero { display: grid; grid-template-columns: 1.5fr .7fr; gap: 12px; margin: 0 0 14px; }
.home-brand { padding: 22px 24px; border: 1px solid var(--line); border-radius: 14px; background: radial-gradient(520px 160px at 0% 0%, var(--glow), transparent 62%), var(--panel); }
.home-brand > span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.home-brand .ver { margin: 8px 0 10px; font: 600 46px/1 var(--mono); color: var(--accent); }
.home-brand p { margin: 0; max-width: 46ch; color: var(--muted); }
.home-count { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.home-count b { font: 600 32px/1 var(--mono); color: var(--ink-strong); }
.home-count span { color: var(--muted); font-size: 13px; line-height: 1.35; }
.home-side { display: grid; gap: 12px; align-content: start; }
.home-side .stat { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.home-more { display: inline-block; margin-top: 12px; color: var(--accent); text-decoration: none; font-size: 13px; }
.home-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.home-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); }
.home-line .dot { margin-left: 0; }
.home-line a { color: var(--ink-strong); text-decoration: none; font-weight: 600; }
.home-line small { margin-left: auto; color: var(--muted); }
@media (max-width: 900px) {
  .home-hero, .home-cols { grid-template-columns: 1fr; }
  .home-brand .ver { font-size: 36px; }
  .home-line small { margin-left: 16px; }
}
@media (max-width: 800px) {
  html, body { overflow-x: hidden; }
  .md-grid > .md-card { grid-column: span 12; }
  .md-grid > .md-card::after { display: none; }
  .dash { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat, .graph { padding: 10px; }
  .stat b { font-size: 16px; white-space: nowrap; }
  .stat small { display: block; overflow-wrap: anywhere; }
  .sitehead { gap: 8px; padding: 0 8px; }
  .sitehead .name { font-size: 15px; }
  .sitehead .crumb, .sitehead .clock, .sitehead .who { display: none; }
  .sitehead select.router-pick { min-width: 0; max-width: 34vw; }
  main { max-width: calc(100vw - var(--rail)); padding: calc(var(--head) + 12px) 10px 48px; }
  .panel, .graph, details.grow, .hscroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .panel table, .graph table, .hscroll table, .md-scroll table { width: max-content; min-width: 100%; }
  .panel th, .panel td, .graph th, .graph td, .hscroll th, .hscroll td { white-space: nowrap; padding: 7px 8px; }
  .panel th:first-child, .panel td:first-child, .hscroll th:first-child, .hscroll td:first-child { position: sticky; left: 0; background: var(--panel); z-index: 1; }
  .panel tbody tr:hover td:first-child, .hscroll tbody tr:hover td:first-child { background: var(--panel2); }
  .row > label { flex: 1 1 100%; }
  .row > label input, .row > label select, .row > label textarea { width: 100%; }
  .md-h, .md-h .end, .md-tools, .mk-actions, .topbar { flex-wrap: wrap; }
  .md-h .end { margin-left: 0; width: 100%; }
  .md-h .ranges, .ranges { flex-wrap: wrap; }
  .ifc-pick, .ifc-pick select, .md-h select { max-width: 100%; }
  .md-big { display: flex; flex-wrap: wrap; gap: 6px 14px; }
  .md-tools .hint { font-size: 12px; line-height: 1.35; }
  .mk-title { font-size: 18px; }
  .win-find { min-width: 0; width: 100%; }
  .sfp-box, .lte-box { padding-left: 0; border-left: 0; }
  .ros-fields { grid-template-columns: 1fr; }
  .win-burger { display: inline-block; }
  .win-items { display: none; width: 100%; }
  .winbar.is-open .win-items { display: flex; flex-direction: column; align-items: stretch; }
  .win-sub { position: static; box-shadow: none; max-width: 100%; }
  .topo-legend { width: 100%; }
}
@media (max-width: 480px) {
  .dash { grid-template-columns: 1fr; }
  .graph { grid-column: auto; }
}

.rs svg { width: 18px; height: 18px; flex: none; }
.rs-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 4px 0 12px; }
.rs-kpi, .rs-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.rs-kpi { display: flex; gap: 14px; align-items: center; padding: 14px 16px; min-width: 0; }
.rs-kpi > div { min-width: 0; }
.rs-ico { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--panel2); border: 1px solid var(--line2); color: var(--accent); flex: none; }
.rs-ico svg { width: 22px; height: 22px; }
.rs-kpi small { display: block; color: var(--ink); font-size: 12.5px; }
.rs-kpi b { display: block; font-size: 24px; line-height: 1.2; color: var(--ink-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-kpi em { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
.rs-charts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1.1fr); gap: 12px; margin-bottom: 12px; }
.rs-card { padding: 14px 16px; min-width: 0; }
.rs-card h3 { margin: 0 0 10px; font-size: 13.5px; font-weight: 600; color: var(--ink-strong); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rs-keys { display: flex; gap: 14px; font-size: 11.5px; font-weight: 500; color: var(--ink); }
.rs-keys i, .rs-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.rs-pie { display: flex; align-items: center; gap: 16px; }
.rs-donut { position: relative; width: 128px; height: 128px; flex: none; }
.rs-donut svg { width: 128px; height: 128px; transform: none; }
.rs-donut > div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.rs-donut b { font-size: 17px; color: var(--ink-strong); line-height: 1.1; }
.rs-donut small { font-size: 11px; color: var(--muted); }
.rs-legend { width: auto; flex: 1; min-width: 0; }
.rs-legend td { border: 0; padding: 4px 6px; font-size: 12.5px; white-space: nowrap; }
.rs-legend td:first-child { overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.rs-legend td + td { text-align: right; color: var(--ink-strong); }
.rs-legend td + td + td { color: var(--muted); }
.rs-legend .rs-sum td { border-top: 1px solid var(--line); }
.rs-legend .rs-sum i { background: transparent; }
.rs-plot { display: flex; gap: 6px; height: 150px; }
.rs-axis { display: flex; flex-direction: column; justify-content: space-between; font-size: 10.5px; color: var(--muted); padding-bottom: 18px; text-align: right; min-width: 18px; }
.rs-bars { flex: 1; display: flex; align-items: stretch; gap: 3px; position: relative; padding-bottom: 18px; background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% calc((100% - 18px) / 3); }
.rs-bar { flex: 1; position: relative; display: flex; flex-direction: column-reverse; justify-content: flex-start; }
.rs-bar i { display: block; width: 100%; max-width: 12px; margin: 0 auto; }
.rs-bar i.a { background: #0ea5e9; border-radius: 2px 2px 0 0; }
.rs-bar i.d { background: #8b5cf6; }
.rs-bar span { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); white-space: nowrap; }
.rs-filter { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.rs-search { position: relative; flex: 0 1 260px; display: flex; }
.rs-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.rs-search input { padding-left: 34px; width: 100%; }
.rs-filter select { min-width: 150px; }
.rs-filter .chk { display: flex; flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: var(--ink); margin: 0; }
.rs-search { flex-direction: row; }
.rs-refresh { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.rs-refresh svg { width: 16px; height: 16px; }
.rs-list { padding: 4px 8px; overflow-x: auto; }
.rs-table { min-width: 980px; }
.rs-table > thead th { text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--muted); }
.rs-table > tbody > tr > td { vertical-align: middle; font-size: 13px; }
.rs-table form { display: inline; margin: 0; }
.rs-exp { background: transparent; border: 0; padding: 2px; color: var(--muted); cursor: pointer; line-height: 0; }
.rs-exp svg { transition: transform .15s; }
.rs-exp[aria-expanded="true"] { color: var(--accent); }
.rs-exp[aria-expanded="true"] svg { transform: rotate(90deg); }
.rs-user { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink-strong); }
.rs-user svg { color: #60a5fa; width: 16px; height: 16px; }
.rs-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; border: 1px solid; white-space: nowrap; }
.rs-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.rs-pill.ok { color: var(--ok); background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .35); }
.rs-pill.warn { color: var(--warn); background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .35); }
.rs-pill.bad { color: var(--bad); background: rgba(244, 63, 94, .1); border-color: rgba(244, 63, 94, .35); }
.rs-sm { padding: 4px 14px; font-size: 12.5px; }
.rs-row[data-open="1"] > td { background: var(--panel2); }
.rs-detail > td { background: var(--panel2); padding: 4px 12px 14px; }
.rs-grid { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.2fr) minmax(200px, .9fr); gap: 12px; }
.rs-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--panel); min-width: 0; }
.rs-grid h4 { margin: 0 0 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-strong); }
.rs-procs table th { text-transform: none; letter-spacing: 0; font-size: 11px; padding: 6px 8px; }
.rs-procs table td { padding: 6px 8px; font-size: 12px; vertical-align: middle; }
.rs-procs tr.rs-more { display: none; }
.rs-procs.all tr.rs-more { display: table-row; }
.rs-link { background: transparent; border: 0; padding: 2px; color: var(--muted); line-height: 0; cursor: pointer; }
.rs-link:hover { color: var(--bad); }
.rs-link svg { width: 15px; height: 15px; }
.rs-info > div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 12.5px; }
.rs-info span { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); white-space: nowrap; }
.rs-info span svg { width: 14px; height: 14px; color: #60a5fa; }
.rs-info b { font-weight: 500; color: var(--ink-strong); text-align: left; min-width: 0; overflow-wrap: anywhere; flex: 1; padding-left: 8px; }
.rs-acts { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rs-acts form { display: block; }
.rs-act { width: 100%; display: flex; align-items: center; gap: 8px; background: var(--panel); color: var(--ink); border: 1px solid var(--line2); font-weight: 500; text-align: left; }
.rs-act svg { width: 16px; height: 16px; }
.rs-act:hover { border-color: var(--accent); color: var(--accent); filter: none; }
.rs-act.danger { background: rgba(244, 63, 94, .12); color: var(--bad); border-color: rgba(244, 63, 94, .5); }
.rs-act.danger:hover { background: rgba(244, 63, 94, .2); color: var(--bad); border-color: var(--bad); }
.rs-msg { display: flex; flex-direction: column; gap: 6px; }
.rs-msg[hidden] { display: none; }
.rs-msg textarea { width: 100%; resize: vertical; }
.ns svg { width: 18px; height: 18px; flex: none; }
.ns-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin: 4px 0 12px; }
.ns-kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; min-width: 0; }
.ns-kpi .rs-ico { width: 38px; height: 38px; }
.ns-kv { min-width: 0; }
.ns-kv small { display: block; font-size: 12px; color: var(--ink); }
.ns-kv b { display: block; font-size: 22px; line-height: 1.2; color: var(--ink-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ns-kv b.tone-ok, .ns-kv b.tone-warn, .ns-kv b.tone-bad { color: var(--accent); }
.ns-kv b.tone-warn { color: var(--warn); }
.ns-kv b.tone-bad { color: var(--bad); }
.ns-kv em { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ns-kv .ns-rx, .ns-kv .ns-tx { font-size: 15px; display: flex; gap: 6px; align-items: baseline; }
.ns-kv .ns-rx span { color: #22d3ee; }
.ns-kv .ns-tx span { color: #10b981; }
.ns-kv b i { font-style: normal; overflow: hidden; text-overflow: ellipsis; }
.ns svg.ns-spark, .ns-spark { grid-column: 1 / -1; width: 100%; height: 34px; margin-top: 8px; display: block; }
.ns-row2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
.ns-row3 { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
.ns-row4 { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
.ns h3 { align-items: center; }
.ns-range { padding: 4px 8px; font-size: 12px; font-weight: 500; min-width: 110px; }
.ns-keys { margin: -2px 0 10px; flex-wrap: wrap; }
.ns-chart { display: flex; gap: 6px; height: 170px; }
.ns-y { display: flex; flex-direction: column; justify-content: space-between; font-size: 10.5px; color: var(--muted); text-align: right; padding-bottom: 18px; min-width: 34px; white-space: nowrap; }
.ns-y span { line-height: 1; transform: translateY(-1px); }
.ns-plot { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ns-plot svg { flex: 1; width: 100%; height: auto; min-height: 0; background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 25%; border-bottom: 1px solid var(--line); }
.ns-x { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); height: 18px; align-items: flex-end; }
.ns-empty { height: 170px; display: grid; place-items: center; margin: 0; }
.ns-disk { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; font-size: 12.5px; }
.ns-disk b { color: var(--ink-strong); font-weight: 600; }
.ns-disk small { color: var(--ink); white-space: nowrap; }
.ns-track { height: 8px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); overflow: hidden; }
.ns-track i { display: block; height: 100%; border-radius: 999px; }
.ns-scroll { overflow-x: auto; }
.ns-people { min-width: 820px; }
.ns-acts { white-space: nowrap; }
.ns-acts form { margin-right: 6px; }
.ns-more { padding: 4px 10px; }
.ns-title-ico { display: inline-flex; align-items: center; gap: 8px; }
.ns-title-ico svg { color: var(--bad); width: 20px; height: 20px; }
.ns-note { font-size: 11.5px; font-weight: 500; }
.ns-guard-body { display: grid; grid-template-columns: minmax(90px, .8fr) minmax(0, 1.4fr); gap: 12px; align-items: end; }
.ns-guard-nums > div { margin-bottom: 14px; }
.ns-guard-nums b { display: block; font-size: 26px; line-height: 1.1; color: var(--ink-strong); }
.ns-guard-nums b.ns-up::before { content: "↑ "; color: var(--bad); font-size: 18px; }
.ns-guard-nums b.ns-lock::before { content: "● "; color: var(--bad); font-size: 14px; vertical-align: 4px; }
.ns-guard-nums small { color: var(--muted); font-size: 11.5px; }
.ns-gb { height: 110px; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--line); background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 33.3%; }
.ns-gb i { flex: 1; background: linear-gradient(#f43f5e, rgba(244, 63, 94, .45)); border-radius: 2px 2px 0 0; min-height: 0; }
.ns-gx { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.ns-tile { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; position: relative; }
.ns-tile > div { flex: 1 1 190px; min-width: 0; }
.ns-tile > .ns-side { margin-left: auto; }
#pc-seen { white-space: nowrap; }
.ns-tile h3 { margin-bottom: 8px; }
.ns-tile-ico { color: var(--accent); line-height: 0; padding-top: 2px; }
.ns .ns-tile-ico svg { width: 26px; height: 26px; }
.ns-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ns-btns form { margin: 0; }
.ns-btns .rs-sm, .ns-side { display: inline-flex; align-items: center; gap: 6px; }
.ns-btns svg, .ns-side svg { width: 15px; height: 15px; }
.ns-stop { color: var(--bad); border-color: rgba(244, 63, 94, .45); }
.ns-stop:disabled { opacity: .55; cursor: not-allowed; }
.ns-big { margin: 0 0 4px; font-size: 17px; font-weight: 700; color: var(--ink-strong); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ns-big .rs-pill { font-size: 11px; }
.ns-side { align-self: center; white-space: nowrap; }
@media (max-width: 1400px) {
  .ns-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ns-row4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1100px) {
  .ns-row2 { grid-template-columns: 1fr 1fr; }
  .ns-row2 > :first-child { grid-column: 1 / -1; }
  .ns-row3 { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .ns-kpis, .ns-row2, .ns-row4 { grid-template-columns: 1fr; }
  .ns-tile { flex-wrap: wrap; }
}
@media (max-width: 1200px) {
  .rs-charts { grid-template-columns: 1fr 1fr; }
  .rs-charts .rs-card:nth-child(2) { grid-column: 1 / -1; order: 3; }
  .rs-grid { grid-template-columns: 1fr 1fr; }
  .rs-procs { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .rs-kpis, .rs-charts, .rs-grid { grid-template-columns: 1fr; }
  .rs-pie { flex-direction: column; align-items: flex-start; }
  .rs-refresh { margin-left: 0; }
}
.df-top { display: grid; grid-template-columns: minmax(280px, 1.15fr) minmax(0, 1.25fr) minmax(240px, .95fr); gap: 12px; margin-bottom: 12px; }
.df-hico { display: inline-flex; align-items: center; gap: 8px; }
.df-hico svg { width: 18px; height: 18px; color: var(--accent); }
.df-bad svg { color: var(--bad); }
.df-aside { font-size: 11.5px; font-weight: 500; }
.df .rs-kpi b.tone-ok { color: var(--ok); }
.df .rs-kpi b.tone-bad { color: var(--bad); }
.df .chk { flex-direction: row; color: var(--ink); font-size: 13px; }
.df-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.df-fields input { width: 100%; }
.df-note { margin: 0 0 8px; color: var(--ink); }
.df-facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.df-facts span { color: var(--muted); }
.df-facts b { color: var(--ink-strong); font-weight: 600; text-align: right; }
.df-bars { height: 150px; margin-top: 8px; }
.df-add { margin-bottom: 12px; }
.df-addrow { align-items: end; }
.df-grow { flex: 1 1 220px; }
.df-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.df-scroll { padding: 0; margin: 0 -4px; }
.df-mini { min-width: 420px; }
.df-blocks { min-width: 680px; }
.df-search { width: min(340px, 100%); margin: 0 0 12px; }
.df-blocked h3 form { margin: 0; }
.df-blocked h3 button { display: inline-flex; align-items: center; gap: 6px; }
.df-blocked h3 button svg { width: 15px; height: 15px; }
.df button:disabled { opacity: .55; cursor: not-allowed; }
.df-acts { white-space: nowrap; }
.df-acts form { margin-right: 6px; }
.df-none[hidden] { display: none; }
@media (max-width: 1200px) {
  .df-top { grid-template-columns: 1fr 1fr; }
  .df-top > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .df-top, .df-split, .df-fields { grid-template-columns: 1fr; }
}

.ev-bar { display: flex; flex-wrap: wrap; gap: 14px 16px; align-items: flex-end; }
.ev-bar label, .ev-pick > span { font-size: 13px; color: var(--muted); }
.ev-bar select, .ev-bar input[type="date"], .ev-bar input[type="search"], .ev-bar input[name="ip"] { font-size: 14px; min-width: 148px; }
.ev-dates[hidden] { display: none; }
.ev-sys { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); min-height: 38px; }
.ev-actions { display: flex; gap: 8px; align-items: center; }
.ev-tags { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 8px; }
.ev-tag { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line2); background: var(--panel2); color: var(--ink); text-decoration: none; font-size: 13px; }
.ev-tag span { color: var(--muted); font-size: 14px; }
.ev-tag:hover { border-color: var(--accent); color: var(--accent); }
.ev-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
.ev-stat { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; text-decoration: none; color: var(--ink); }
.ev-stat small { display: block; color: var(--muted); font-size: 13px; font-weight: 500; }
.ev-stat b { display: block; margin-top: 4px; font-size: 26px; font-weight: 650; letter-spacing: -.02em; color: var(--ink); }
.ev-stat.on { border-color: var(--accent); }
.ev-pick { position: relative; display: flex; flex-direction: column; gap: 4px; }
.ev-pick-btn { text-align: left; background: var(--field); color: var(--ink); border: 1px solid var(--line2); border-radius: 8px; min-width: 190px; font-weight: 500; }
.ev-pick-btn small, .ev-pick-list small { color: var(--muted); font-weight: 500; margin-left: 6px; }
.ev-pick-menu { position: absolute; z-index: 6; top: calc(100% + 4px); left: 0; width: 280px; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; padding: 8px; box-shadow: 0 12px 32px rgba(0, 0, 0, .28); }
.ev-pick-menu input { width: 100%; margin-bottom: 6px; }
.ev-pick-list { max-height: 280px; overflow: auto; display: flex; flex-direction: column; }
.ev-pick-list button { display: flex; justify-content: space-between; width: 100%; background: transparent; color: var(--ink); border: 0; border-radius: 6px; text-align: left; font-weight: 500; }
.ev-pick-list button:hover, .ev-pick-list button.on { background: var(--panel2); color: var(--ink); filter: none; }
.ev-scroll { max-height: 680px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.ev-table { margin: 0; }
.ev-table th { position: sticky; top: 0; z-index: 2; background: var(--panel); font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--muted); }
.ev-table td { color: var(--ink); font-size: 14px; }
.ev-table .ev-time, .ev-table .ev-detail { color: var(--muted); }
.ev-table tbody tr.ev-line { cursor: pointer; }
.ev-table tbody tr.ev-line:hover, .ev-table tbody tr.ev-line.open { background: var(--panel2); }
.ev-day td { position: sticky; top: 38px; z-index: 1; background: var(--panel2); color: var(--ink); font-weight: 650; font-size: 13px; }
.ev-kind { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; }
.ev-kind i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.ev-kind.fail i { background: var(--bad); }
.ev-kind.ok i { background: var(--ok); }
.ev-ip { background: none; border: 0; padding: 0; color: var(--ink); font-family: var(--mono); font-size: 13px; font-weight: 500; cursor: pointer; }
.ev-ip:hover { color: var(--accent); filter: none; }
.ev-extra td { background: var(--bg); cursor: default; }
.ev-extra dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 16px; margin: 4px 0; }
.ev-extra dt { color: var(--muted); font-size: 12px; }
.ev-extra dd { margin: 2px 0 0; color: var(--ink); font-size: 14px; }
.ev-foot { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 12px; color: var(--muted); font-size: 13px; }
.ev-foot label { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; }
.ev-foot select { min-width: 76px; }
@media (max-width: 980px) {
  .ev-stats, .ev-extra dl { grid-template-columns: 1fr 1fr; }
}
.stat b small { font-size: 14px; color: var(--muted); font-weight: 500; }
.ver-line { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin: 0 0 14px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--muted); font-size: 13px; }
.ver-line b { color: var(--ink-strong); font-family: var(--mono); font-weight: 600; }
.ver-line a { margin-left: auto; text-decoration: none; }
.home-board { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.home-board .wide { grid-column: 1 / -1; }
.panel h2 .home-more { float: right; margin: 0; text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 500; }
.board-scroll { max-height: 440px; overflow: auto; }
.board-scroll th { position: sticky; top: 0; z-index: 1; background: var(--panel); }
.name-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 500; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--panel2); color: var(--muted); border: 1px solid var(--line2); white-space: nowrap; }
.tag.ok { background: rgba(52, 211, 153, .12); color: var(--ok); border-color: rgba(52, 211, 153, .35); }
.tag.bad { background: rgba(244, 63, 94, .1); color: var(--bad); border-color: rgba(244, 63, 94, .3); }
.tag.warn { background: rgba(245, 158, 11, .1); color: var(--warn); border-color: rgba(245, 158, 11, .3); }
.tag.off { color: var(--muted); }
.mini { display: inline-block; width: 48px; height: 4px; margin-right: 6px; background: var(--line); border-radius: 99px; vertical-align: middle; overflow: hidden; }
.mini i { display: block; height: 100%; }
.mini .ok { background: var(--ok); }
.mini .warn { background: var(--warn); }
.mini .bad { background: var(--bad); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 108px 1fr; gap: 10px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line); }
.feed time { color: var(--muted); font-family: var(--mono); font-size: 12px; padding-top: 2px; }
.feed a { color: var(--ink-strong); text-decoration: none; font-weight: 600; }
.feed small { display: block; color: var(--muted); font-weight: 500; }
@media (max-width: 1100px) {
  .home-board { grid-template-columns: 1fr; }
}

.ua-title { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.ua-title h2 { margin: 0; text-transform: none; letter-spacing: 0; font-size: 22px; font-weight: 700; color: var(--ink-strong); }
.ua-title p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.ua-badge { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(59, 130, 246, .15); color: var(--accent2); }
.ua-badge svg, .ua-card-name svg, .ua-device svg, .ua-note > i svg, .ua-lead svg, .ua-search > i svg, .ua-mini svg, .ua-foot button svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ua-top { display: grid; grid-template-columns: minmax(180px, 1.1fr) minmax(180px, 1.1fr) minmax(150px, .8fr) minmax(220px, 1.35fr); gap: 12px; align-items: end; margin-bottom: 14px; }
.ua-combo { position: relative; display: flex; align-items: center; min-height: 40px; background: var(--field); border: 1px solid var(--line2); border-radius: 10px; }
.ua-combo:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow); }
.ua-combo input, .ua-combo select { flex: 1; border: 0; background: transparent; box-shadow: none; padding: 8px 8px 8px 34px; min-width: 0; }
.ua-combo input:focus, .ua-combo select:focus { box-shadow: none; }
.ua-lead { position: absolute; left: 10px; display: grid; place-items: center; color: var(--muted); pointer-events: none; }
.ua-mini { width: 32px; height: 32px; margin-right: 4px; padding: 0; display: grid; place-items: center; border-radius: 8px; background: transparent; color: var(--muted); border: 0; flex: 0 0 auto; }
.ua-mini:hover, .ua-mini.on { color: var(--accent); background: var(--panel2); filter: none; }
.ua-menu { position: absolute; z-index: 5; top: calc(100% + 6px); right: 0; min-width: 220px; padding: 6px; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 12px 30px rgba(0, 0, 0, .28); }
.ua-menu button { display: block; width: 100%; text-align: left; background: transparent; color: var(--ink); border: 0; border-radius: 8px; font-weight: 500; }
.ua-menu button:hover { background: var(--panel2); filter: none; }
.ua-menu .ua-danger { color: var(--bad); }
.ua-note { display: flex; gap: 10px; align-items: flex-start; min-height: 40px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.ua-note > i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; color: var(--accent2); background: rgba(59, 130, 246, .15); }
.ua-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.ua-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.ua-card header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.ua-card-name { display: flex; align-items: center; gap: 8px; color: var(--ink-strong); font-weight: 700; }
.ua-card-name b { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: rgba(59, 130, 246, .16); color: var(--accent2); font-size: 12px; text-align: center; }
.ua-card-tools { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ua-all { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-size: 13px; }
.ua-card > .muted { margin: 4px 0 10px; }
.ua-search { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding: 0 4px 0 10px; border: 1px solid var(--line2); border-radius: 10px; background: var(--field); }
.ua-search > i { color: var(--muted); display: grid; }
.ua-search input { flex: 1; border: 0; background: transparent; box-shadow: none; padding: 8px 0; }
.ua-search input:focus { box-shadow: none; }
.ua-scroll { max-height: 460px; overflow: auto; }
.ua-scroll th { position: sticky; top: 0; z-index: 1; background: var(--panel); }
.ua-scroll th[data-sort] { cursor: pointer; }
.ua-check { width: 36px; }
.ua-device { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.ua-device b { color: var(--ink-strong); font-weight: 650; }
.ua-meta { color: var(--ink); font-size: 12.5px; }
.ua-meta small { display: block; color: var(--muted); font-family: var(--mono); font-size: 11px; }
.ua-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 650; }
.ua-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ua-pill.on { color: var(--ok); background: rgba(52, 211, 153, .12); }
.ua-pill.off { color: var(--bad); background: rgba(244, 63, 94, .1); }
.ua-access label { flex-direction: row; align-items: center; gap: 6px; color: var(--ink); font-size: 13px; }
.ua-none, .ua-look { color: var(--muted); font-size: 13px; }
.ua-foot { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.ua-foot button { display: inline-flex; align-items: center; gap: 8px; }
.ua-foot span { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.ua-extra { margin: 0 0 14px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.ua-extra h3 { margin: 0 0 8px; }
.ua-extra-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
@media (max-width: 1100px) {
  .ua-top, .ua-grid { grid-template-columns: 1fr; }
  .ua-foot span { margin-left: 0; }
}
