:root {
  --bg: #f6f7f9; --card: #fff; --text: #1b1f24; --muted: #5f6b7a; --line: #dde2e8;
  --accent: #1d5fa8; --bad: #b42318; --warn: #a15c00; --good: #1a7f37;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--accent); }
header.top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 10px 16px; background: #13263f; color: #fff; }
header.top a { color: #fff; text-decoration: none; }
header.top .brand { font-weight: 700; }
header.top nav { display: flex; gap: 14px; flex-wrap: wrap; flex: 1; }
header.top .who { display: flex; gap: 10px; align-items: center; }
main { max-width: 1200px; margin: 0 auto; padding: 16px; }
footer { max-width: 1200px; margin: 0 auto; padding: 8px 16px 24px; color: var(--muted); font-size: 13px; }
h1 { font-size: 22px; margin: 6px 0 10px; }
h2 { font-size: 17px; margin: 0 0 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin: 0 0 14px; overflow-x: auto; }
.card.narrow { max-width: 420px; margin: 40px auto; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-bottom: 14px; }
.grid .card { margin: 0; }
.meta, .muted { color: var(--muted); }
.small { font-size: 13px; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
tr.lte td { background: #f9fbfd; }
label { display: block; margin: 8px 0; font-size: 14px; }
label input, label select { display: block; width: 100%; margin-top: 4px; }
.row label, .filters label { display: inline-block; margin-right: 12px; }
.row label input, .filters label select { display: inline-block; width: auto; }
label.check input { display: inline; width: auto; margin: 0 4px 0 0; }
input, select, button { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
button { background: var(--accent); color: #fff; border-color: var(--accent); cursor: pointer; }
button.small { padding: 2px 8px; font-size: 13px; }
button.link { background: none; border: none; color: #fff; text-decoration: underline; padding: 0; }
form.inline { display: inline; }
.search { display: flex; gap: 8px; margin-bottom: 14px; }
.search input { flex: 1; }
.error { color: var(--bad); font-weight: 600; }
.notice { background: #eef5ff; border-left: 4px solid var(--accent); padding: 8px 10px; }
.secret { font: 600 18px/1.4 ui-monospace, monospace; background: #fff7e6; border: 1px dashed var(--warn); padding: 8px 10px; display: inline-block; }
.bad { color: var(--bad); font-weight: 600; }
.tag { display: inline-block; background: #eef1f5; border-radius: 4px; padding: 0 6px; margin: 0 4px 2px 0; font-size: 13px; }
.flag { display: inline-block; border-radius: 4px; padding: 0 6px; margin-left: 6px; font-size: 12px; font-weight: 700; color: #fff; }
.flag-weak { background: var(--warn); }
.flag-drop { background: var(--bad); }
.band { font-weight: 700; padding: 1px 8px; border-radius: 4px; background: #eef1f5; }
.band-high { background: var(--bad); color: #fff; }
.band-medium { background: var(--warn); color: #fff; }
.status-good { color: var(--good); }
.status-warning { color: var(--warn); font-weight: 600; }
.status-bad, .status-down { color: var(--bad); font-weight: 600; }
.actions form { margin: 0 4px 4px 0; }
.readings { font-variant-numeric: tabular-nums; }
.charts { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
pre { white-space: pre-wrap; font-size: 12px; background: #f3f4f6; padding: 8px; border-radius: 6px; }
/* SVG charts (webapp/charts.py) */
svg.chart { width: 100%; height: auto; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
svg.chart .grid { stroke: #e7ebf0; stroke-width: 1; }
svg.chart .series { fill: none; stroke: var(--accent); stroke-width: 2; }
svg.chart circle.series { fill: var(--accent); }
svg.chart .threshold { stroke: var(--bad); stroke-width: 1; stroke-dasharray: 5 4; }
svg.chart .axis { fill: var(--muted); font-size: 11px; }
svg.chart .threshold-label { fill: var(--bad); }
@media (max-width: 600px) { th, td { padding: 5px 4px; font-size: 13px; } h1 { font-size: 19px; } }
