:root {
  --bg: #f4f5f7; --card: #fff; --text: #1b1f27; --muted: #667085; --line: #e3e6eb;
  --accent: #2456d6; --ok: #12805c; --ok-bg: #e2f5ed; --warn: #9a5b00; --warn-bg: #fdf0d5;
  --bad: #b42318; --bad-bg: #fde4e1;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b; --card: #1b1f27; --text: #e8eaee; --muted: #98a1b0; --line: #2c323d;
    --accent: #7ea2ff; --ok: #5fd3a6; --ok-bg: #133428; --warn: #f2bd5b; --warn-bg: #3a2c0f;
    --bad: #ff8a80; --bad-bg: #41191a;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }

.top { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; padding: 12px 24px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--text); }
.brand:hover { text-decoration: none; }
.logo { width: 12px; height: 12px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); }
nav { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: center; }
main { max-width: 1180px; margin: 0 auto; padding: 24px 16px; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 8px 0 32px; }

h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 24px 0 6px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 600; }

.head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions.left { margin-top: 12px; }
.inline { display: inline; margin: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.tile b { display: block; font-size: 22px; line-height: 1.2; }
.tile span { color: var(--muted); font-size: 13px; }
.tile.ok { border-left-color: var(--ok); }
.tile.warn { border-left-color: var(--warn); }
.tile.bad { border-left-color: var(--bad); }

.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr.off { opacity: .55; }
td .small { display: block; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--line); color: var(--text); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--bad-bg); color: var(--bad); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }

form label { display: block; margin-bottom: 14px; font-weight: 600; font-size: 14px; }
form label .muted { display: block; font-weight: 400; margin-top: 4px; }
input:not([type=checkbox]):not([type=radio]) { display: block; width: 100%; margin-top: 5px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--text); font: inherit; }
input:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
label.check { font-weight: 400; display: flex; gap: 8px; align-items: center; }
fieldset { border: 1px solid var(--line); border-radius: 7px; margin: 0 0 14px; padding: 10px 14px 0; }
legend { font-weight: 600; font-size: 14px; padding: 0 6px; }

.btn { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 7px; background: var(--card); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.primary { color: #0d1220; } }
.btn.danger { color: var(--bad); border-color: var(--bad); }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
button.link:hover { text-decoration: underline; }

details { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
summary { cursor: pointer; color: var(--muted); font-size: 14px; }
details p { margin-top: 10px; }

.chart { display: block; width: 100%; height: 140px; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.chart .fail { stroke: var(--bad); stroke-width: 2; vector-effect: non-scaling-stroke; opacity: .7; }
.chart-legend { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; }
