:root {
  --bg: #0f1522;
  --panel: #151d2c;
  --panel2: #1b2436;
  --line: #24304a;
  --text: #e6ecf5;
  --muted: #8b98ab;
  --accent: #4da3ff;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body { padding: 16px 14px 40px; max-width: 980px; margin: 0 auto; }
body.light { --bg: #f4f6fb; --panel: #fff; --panel2: #f0f3f9; --line: #dfe5f0; --text: #16202f; --muted: #6a7789; }

header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
header h1 { font-size: 17px; margin: 0; font-weight: 650; letter-spacing: .2px; }
header .grow { flex: 1; }
header .when { color: var(--muted); font-size: 12px; }

.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 4px rgba(52, 211, 153, .14); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 4px rgba(248, 113, 113, .16); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 4px rgba(251, 191, 36, .16); }

.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 13px;
}

.card h2 {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}

.big { font-size: 22px; font-weight: 650; letter-spacing: -.2px; }
.sub { color: var(--muted); font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }

section { margin-bottom: 12px; }
.row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.row + .row { margin-top: 5px; }

.tag { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: var(--panel2); color: var(--muted); }
.tag.ok { color: var(--ok); }
.tag.bad { color: var(--bad); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: right; color: var(--muted); font-weight: 500; font-size: 11px; padding: 0 0 6px; }
th:first-child, td:first-child { text-align: left; }
td { padding: 5px 0; border-top: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
td:first-child { font-variant-numeric: normal; }

.alert { display: flex; gap: 8px; align-items: flex-start; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13px; }
.alert:first-of-type { border-top: 0; }
.alert .mark { color: var(--bad); }

.charts { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .charts { grid-template-columns: 1fr 1fr 1fr; } }
.spark { width: 100%; height: 56px; display: block; }
.spark path.line { fill: none; stroke: var(--accent); stroke-width: 1.8; }
.spark path.area { fill: rgba(77, 163, 255, .12); stroke: none; }
.spark path.zero { stroke: var(--line); stroke-width: 1; fill: none; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button {
  background: none; border: 0; color: var(--muted); padding: 3px 10px; font-size: 11px; cursor: pointer;
}
.seg button.on { background: var(--panel2); color: var(--text); }

/* вход */
.login { max-width: 360px; margin: 12vh auto 0; text-align: center; }
.login h1 { font-size: 18px; margin: 0 0 4px; }
.login p { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.login input {
  width: 100%; padding: 12px 13px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font-size: 15px; margin-bottom: 10px;
}
.login button, .btn {
  width: 100%; padding: 12px; border-radius: 11px; border: 1px solid #2f6fbf;
  background: linear-gradient(#3b8ff0, #2f7ad6); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn.ghost { background: none; border-color: var(--line); color: var(--muted); font-weight: 500; width: auto; padding: 7px 12px; font-size: 12px; }
.err { color: var(--bad); font-size: 13px; min-height: 18px; margin-bottom: 6px; }
.hidden { display: none !important; }
