:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1a2230;
  --muted: #667085;
  --line: #e3e7ee;
  --accent: #2455d6;
  --ok: #17803d;
  --warn: #b25e09;
  --bad: #c0301f;
  --warn-bg: #fff6e5;
  --warn-line: #f0d9a8;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --on-accent: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1218;
    --surface: #161b24;
    --text: #e6eaf1;
    --muted: #8b95a7;
    --line: #262d3a;
    --accent: #6c93ff;
    --ok: #3ccb7a;
    --warn: #e5a04a;
    --bad: #ff6b57;
    --warn-bg: #241c0e;
    --warn-line: #4a3a18;
    --on-accent: #0b1018;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; padding-bottom: 48px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .92em; }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }

/* header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; }
.brand:hover { text-decoration: none; }
.brand em { font-style: normal; font-weight: 400; color: var(--muted); }
.top nav { display: flex; gap: 20px; align-items: center; }
.top nav a { color: var(--muted); font-size: 14px; }
.top nav a:hover { color: var(--text); text-decoration: none; }

/* переключатель языка */
.langsel {
  font: inherit; font-size: 12px; letter-spacing: .04em; line-height: 1.6;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 2px 6px; cursor: pointer;
}
.langsel:hover { border-color: var(--muted); }
.langsel:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* hero */
.hero { padding: 44px 0 12px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 13px; color: var(--muted);
}
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.pill[data-state="ok"] i { background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: pulse 2.4s infinite; }
.pill[data-state="ok"] { color: var(--text); }
.pill[data-state="degraded"] i { background: var(--warn); }
.pill[data-state="down"] i { background: var(--bad); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
h1 { font-size: clamp(26px, 5vw, 38px); line-height: 1.15; margin: 16px 0 10px; letter-spacing: -.02em; }
.lead { max-width: 640px; color: var(--muted); margin: 0 0 20px; font-size: 16px; }
.notice {
  max-width: 640px; padding: 12px 16px; border-radius: 8px;
  background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--text);
  font-size: 14px;
}
.notice strong { color: var(--warn); }

/* sections */
section { margin-top: 36px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 13px; font-weight: 600; margin: 0 0 8px; color: var(--muted); }
h3.mt { margin-top: 22px; }

.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 12px; }
.cols > *, .grid4 > * { min-width: 0; }
.card, .panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px;
}
.big { margin: 4px 0 0; font-size: 28px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.big small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 5px; letter-spacing: 0; }
.sub { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.spark { display: block; width: 100%; height: 28px; margin-top: 6px; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }

/* tables */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-weight: 500; color: var(--muted); font-size: 12px; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; padding-right: 14px; }
td { font-variant-numeric: tabular-nums; }
.st { display: inline-flex; align-items: center; gap: 6px; }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.st.warn::before { background: var(--warn); }
.st.bad::before { background: var(--bad); }
.ep td:nth-child(3) { white-space: normal; min-width: 220px; }
.m { font-family: var(--mono); font-size: 11.5px; padding: 2px 6px; border-radius: 4px; border: 1px solid var(--line); }
.m.get { color: var(--ok); }
.m.post { color: var(--accent); }

.kv { margin: 14px 0 0; }
.kv div { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.badge { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: 4px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); margin-left: 6px; }

/* авторизация */
.auth { max-width: 380px; margin: 56px auto 40px; }
.auth .card { padding: 24px; }
.auth h1 { font-size: 24px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -.01em; }
.auth .lead { font-size: 14px; margin: 0 0 18px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 9px 11px; font: inherit; font-size: 14px;
  color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 7px;
}
.field input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.btn {
  width: 100%; padding: 10px 12px; margin-top: 4px;
  font: inherit; font-size: 14px; font-weight: 600;
  color: var(--on-accent); background: var(--accent);
  border: 0; border-radius: 7px; cursor: pointer;
}
.btn:disabled { opacity: .6; cursor: default; }
.alert {
  margin: 0 0 14px; padding: 9px 12px; border-radius: 7px; font-size: 13px;
  color: var(--bad);
  background: color-mix(in srgb, var(--bad) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--bad) 32%, transparent);
}
.alert[hidden] { display: none; }
.auth .note { margin: 16px 0 0; font-size: 12.5px; color: var(--muted); }
.auth .back { display: inline-block; margin-top: 18px; font-size: 13px; }

/* footer */
footer { border-top: 1px solid var(--line); background: var(--surface); font-size: 13px; }
.foot-in { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 16px; padding-bottom: 16px; }

/* 404 */
.err { text-align: center; padding: 80px 0 40px; }
.err .code { font-family: var(--mono); font-size: 64px; font-weight: 700; letter-spacing: -.04em; color: var(--muted); margin: 0; }
.err p { color: var(--muted); }

@media (max-width: 620px) {
  .top-in { height: auto; min-height: 56px; padding-top: 9px; padding-bottom: 9px; flex-wrap: wrap; gap: 8px 16px; }
  .top nav { flex-wrap: wrap; gap: 10px 14px; }
  .auth { margin-top: 32px; }
}
@media (max-width: 860px) {
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 460px) {
  .grid4 { grid-template-columns: minmax(0, 1fr); }
  .top nav { gap: 14px; }
  .brand em { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .pill[data-state="ok"] i { animation: none; }
}
