:root {
  --bg: #f6f7f9; --panel: #ffffff; --panel-2: #f0f2f5; --line: #e2e5ea; --text: #15181d; --text-2: #4b5360; --faint: #8a93a1;
  --accent: #3e63dd; --ok: #2f9e6a; --warn: #d4881b; --bad: #d93f4c; --ok-bg: #e5f5ec; --warn-bg: #fdf1dc; --bad-bg: #fbe5e7;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116; --panel: #161a21; --panel-2: #1d222b; --line: #2a303b; --text: #e8ebf0; --text-2: #aab2bf; --faint: #6f7886;
    --accent: #7c9cff; --ok: #3ccf8e; --warn: #f2b14a; --bad: #ff6b76; --ok-bg: #12291f; --warn-bg: #2d2412; --bad-bg: #321619;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--sans); }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
.boot { padding: 40px; color: var(--faint); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px 60px; }
header.top { display: flex; align-items: center; gap: 12px; padding: 16px 0; flex-wrap: wrap; position: sticky; top: 0; background: var(--bg); z-index: 5; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.brand { font-weight: 800; font-size: 18px; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.brand i { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); display: inline-block; box-shadow: 0 0 0 4px var(--ok-bg); }
.brand i.bad { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-bg); }
.brand i.warn { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-bg); }
.spacer { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); }
.seg button { border: 0; background: none; padding: 6px 12px; cursor: pointer; color: var(--text-2); }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.btn:hover { background: var(--panel-2); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent); filter: brightness(1.08); }
.btn--sm { padding: 3px 9px; font-size: 13px; }
.btn[disabled] { opacity: .6; cursor: default; }
.muted { color: var(--text-2); } .faint { color: var(--faint); } .small { font-size: 13px; } .mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
@media (max-width: 800px) { .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.tile b { display: block; font-size: 24px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tile span { color: var(--text-2); font-size: 13px; }
.tile.bad { border-color: var(--bad); background: var(--bad-bg); } .tile.warn { border-color: var(--warn); background: var(--warn-bg); }
section.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 18px; overflow: hidden; }
section.card > h2 { margin: 0; font-size: 15px; padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
section.card > h2 .spacer { flex: 1; }
.card-body { padding: 12px 16px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 12px; color: var(--faint); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
th.num, td.num { text-align: right; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--faint); margin-right: 8px; vertical-align: 1px; }
.dot.up { background: var(--ok); } .dot.down { background: var(--bad); } .dot.unknown { background: var(--faint); }
.slots { display: flex; gap: 2px; align-items: center; }
.slots i { width: 5px; height: 18px; border-radius: 2px; background: var(--panel-2); display: block; }
.slots i.g { background: var(--ok); } .slots i.b { background: var(--bad); }
.spark { display: block; width: 120px; height: 26px; }
.spark path { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.spark .area { fill: var(--accent); opacity: .12; stroke: none; }
.meters { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.meter .row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.meter .row b { font-weight: 600; }
.bar { height: 8px; border-radius: 4px; background: var(--panel-2); overflow: hidden; margin: 6px 0 4px; position: relative; }
.bar i { display: block; height: 100%; background: var(--ok); border-radius: 4px; }
.bar i.warn { background: var(--warn); } .bar i.bad { background: var(--bad); }
.bar em { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text-2); opacity: .5; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--panel-2); color: var(--text-2); white-space: nowrap; }
.pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.ok { background: var(--ok-bg); color: var(--ok); }
.empty { color: var(--faint); padding: 14px 16px; }
.note { background: var(--warn-bg); border: 1px solid var(--warn); border-radius: 10px; padding: 12px 14px; margin-bottom: 18px; font-size: 14px; }
.note.bad { background: var(--bad-bg); border-color: var(--bad); }
.note ol { margin: 6px 0 0; padding-left: 20px; }
.errlist { list-style: none; margin: 0; padding: 0; }
.errlist li { padding: 10px 16px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
.errlist li:last-child { border-bottom: 0; }
.errlist .msg { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.errlist details { grid-column: 1 / -1; }
.errlist pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; background: var(--panel-2); padding: 8px; border-radius: 6px; max-height: 240px; overflow: auto; margin: 6px 0 0; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.alerts { list-style: none; margin: 0; padding: 0; }
.alerts li { padding: 9px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: baseline; }
.alerts li:last-child { border-bottom: 0; }
.alerts .when { color: var(--faint); font-size: 12px; white-space: nowrap; min-width: 86px; }
.alerts .body { color: var(--text-2); font-size: 13px; white-space: pre-line; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
form.inline { display: flex; gap: 8px; flex-wrap: wrap; }
input.input { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 6px 10px; min-width: 0; flex: 1 1 200px; }
.keybox { font-family: var(--mono); font-size: 13px; background: var(--panel-2); border: 1px dashed var(--line); border-radius: 8px; padding: 10px; overflow-wrap: anywhere; margin: 8px 0; }
.login { max-width: 380px; margin: 12vh auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 26px; }
.login h1 { margin: 0 0 4px; font-size: 22px; }
.login form { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.login input { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.err { color: var(--bad); font-size: 14px; min-height: 1.2em; }
.toast { position: fixed; bottom: 18px; right: 18px; background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 10px; font-size: 14px; z-index: 20; max-width: calc(100vw - 36px); }
.sitehost { font-weight: 600; overflow-wrap: anywhere; }
td.acts { white-space: nowrap; text-align: right; }
@media (max-width: 640px) { .hide-sm { display: none; } th, td { padding: 7px 8px; } }
