:root {
  --bg: #f4f5f7; --card: #fff; --text: #1d2330; --muted: #677085; --line: #dde1e8;
  --accent: #1f6feb; --ok: #1a7f37; --bad: #cf222e; --warn: #9a6700; --mono-bg: #0f1419; --mono-text: #d6dde6;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0d1117; --card: #161b22; --text: #e6edf3; --muted: #8b949e; --line: #30363d;
          --accent: #4493f8; --ok: #3fb950; --bad: #f85149; --warn: #d29922; --mono-bg: #010409; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--card);
         border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
header h1 { font-size: 17px; margin: 0; }
.grow { flex: 1; }
nav { display: flex; gap: 2px; padding: 0 12px; background: var(--card); border-bottom: 1px solid var(--line); overflow-x: auto; }
nav button { border: 0; background: none; color: var(--muted); padding: 10px 12px; font: inherit; cursor: pointer;
             border-bottom: 2px solid transparent; white-space: nowrap; }
nav button.active { color: var(--text); border-bottom-color: var(--accent); }
main { max-width: 1040px; margin: 0 auto; padding: 16px; }
section { display: none; } section.active { display: block; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; }
.card h2 { font-size: 15px; margin: 0 0 10px; }
.row .card h2, .row h2 { margin: 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.scroll { overflow-x: auto; }
table.list { border-collapse: collapse; width: 100%; font-size: 14px; }
table.list th { text-align: left; color: var(--muted); font-weight: 500; padding: 4px 10px 4px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
td.actions { white-space: nowrap; text-align: right; padding-right: 0; }
td.mono { font-family: ui-monospace, monospace; font-size: 13px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); margin-right: 8px; }
.dot.on { background: var(--ok); } .dot.busy { background: var(--warn); }
button.b, label.file { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 6px;
                       padding: 6px 12px; font: inherit; cursor: pointer; }
button.b.small { padding: 2px 8px; font-size: 13px; }
button.b.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.b.danger { color: var(--bad); }
button.b:disabled { opacity: .5; cursor: default; }
input:not([type=checkbox]):not([type=file]), select { border: 1px solid var(--line); background: var(--bg); color: var(--text);
  border-radius: 6px; padding: 6px 8px; font: inherit; min-width: 0; }
input.addr { width: 9em; font-family: ui-monospace, monospace; }
label.file input { display: none; }
.muted { color: var(--muted); font-size: 13px; }
.ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--warn); }
progress { width: 100%; height: 8px; display: block; }
pre.log { background: var(--mono-bg); color: var(--mono-text); border-radius: 6px; padding: 10px;
  font: 13px/1.4 ui-monospace, monospace; white-space: pre-wrap; word-break: break-all; margin: 6px 0; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px; margin: 10px 0; }
#login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
#login form { width: 320px; max-width: 100%; display: flex; flex-direction: column; gap: 10px; }
#login h1 { font-size: 20px; margin: 0 0 4px; }
@media (max-width: 600px) { main { padding: 10px; } }
