:root {
  --bg: #0b0f0c;
  --panel: #10161200;
  --line: #1f2a22;
  --fg: #cfe6d3;
  --dim: #7d9a84;
  --accent: #39ff88;
  --amber: #ffb347;
  --red: #ff4d5e;
  --cyan: #4fd8ff;
  --mono: ui-monospace, "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 13px/1.45 var(--mono); }
body { display: flex; flex-direction: column; min-height: 100vh; }

.top { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.brand { color: var(--accent); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.cursor { animation: blink 1.1s steps(2) infinite; }
@keyframes blink { to { opacity: 0; } }
.ident { color: var(--dim); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pulse { color: var(--line); transition: color .2s; }
.pulse.on { color: var(--accent); }
.pulse.err { color: var(--red); }

.tabs { display: flex; gap: 2px; padding: 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--dim); padding: 10px 14px; font: inherit; cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--fg); }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabs button[disabled] { opacity: .4; cursor: not-allowed; }

main { flex: 1; padding: 16px; }
.tab { display: none; }
.tab.active { display: block; }

.gauges { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; margin-bottom: 20px; }
.gauges figure { margin: 0; text-align: center; color: var(--dim); }
.gauges canvas { width: 220px; height: 220px; max-width: 100%; }
.gauges figcaption { margin-top: 4px; text-transform: uppercase; letter-spacing: .1em; font-size: 11px; }

.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 24px; }
.kv div { display: flex; justify-content: space-between; border-bottom: 1px dotted var(--line); padding: 3px 0; }
.kv span:first-child { color: var(--dim); }
.kv b { color: var(--fg); font-weight: 600; }

.bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.bar .spacer { flex: 1; }
.muted { color: var(--dim); }
.num { text-align: right; }

.scroll { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; }
.grid th, .grid td { padding: 4px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; white-space: nowrap; }
.grid th { color: var(--dim); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: .06em; position: sticky; top: 0; background: var(--bg); }
.grid td.num, .grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
.grid td.wrap { white-space: pre-wrap; word-break: break-word; max-width: 60ch; }
.grid span.wrap { white-space: pre-wrap; word-break: break-word; max-width: 60ch; display: inline-block; }
.grid tr.self td { color: var(--cyan); }
.grid tr:hover td { background: #121a15; }
.grid td.ro { color: var(--dim); }

button, select, input, textarea { font: inherit; color: var(--fg); background: #0f1511; border: 1px solid var(--line); border-radius: 3px; padding: 5px 10px; }
button { cursor: pointer; }
button:hover { border-color: var(--dim); }
button.primary { color: var(--accent); border-color: var(--accent); }
button.danger { color: var(--red); border-color: var(--red); }
button.small { padding: 1px 8px; font-size: 11px; }
button[disabled] { opacity: .4; cursor: not-allowed; }
input[type=search] { min-width: 260px; }
textarea { width: 100%; resize: vertical; }
input.inline { width: 14ch; padding: 1px 6px; }
select.inline { padding: 1px 6px; }

.notice { border: 1px solid var(--amber); color: var(--amber); padding: 8px 12px; margin-bottom: 10px; white-space: pre-wrap; }
.notice pre { margin: 6px 0 0; color: var(--fg); }
.confirm { border: 1px solid var(--red); padding: 8px 12px; margin-bottom: 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.result { background: #0f1511; border: 1px solid var(--line); padding: 8px; white-space: pre-wrap; }

.toast { position: fixed; right: 16px; bottom: 16px; background: #0f1511; border: 1px solid var(--accent); color: var(--fg); padding: 8px 14px; max-width: 60ch; z-index: 10; }
.toast.err { border-color: var(--red); }

@media (max-width: 600px) {
  main { padding: 10px; }
  .gauges canvas { width: 150px; height: 150px; }
}
