:root {
  --bg: #f7f7f5;
  --panel: #ffffff;
  --text: #1d1f23;
  --muted: #646a73;
  --line: #e3e4e0;
  --accent: #2f5bd3;
  --accent-soft: #e6ecfb;
  --good: #1f7a4d;
  --bad: #b3261e;
  --bar: #2f5bd3;
  --bar2: #c2cbe0;
  --code: #f0f0ec;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171b;
    --panel: #1d2026;
    --text: #e6e7ea;
    --muted: #9aa0aa;
    --line: #30343c;
    --accent: #7ea2ff;
    --accent-soft: #263150;
    --good: #5cc98f;
    --bad: #ff8a80;
    --bar: #7ea2ff;
    --bar2: #3b4252;
    --code: #262a31;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.topbar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 24px;
  padding: 10px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 17px; color: var(--text); }
.brand span { font-weight: 400; color: var(--muted); margin-left: 6px; font-size: 14px; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { padding: 6px 10px; border-radius: 6px; color: var(--muted); }
nav a.active { background: var(--accent-soft); color: var(--accent); }
nav a:hover { text-decoration: none; color: var(--text); }
.menu { display: none; margin-left: auto; background: none; border: 1px solid var(--line);
  color: var(--text); border-radius: 6px; padding: 4px 10px; font-size: 18px; }
main { max-width: 1180px; margin: 0 auto; padding: 24px 16px 48px; outline: none; }
footer { max-width: 1180px; margin: 0 auto; padding: 0 16px 32px; font-size: 13px; }
h1 { font-size: 26px; margin: 4px 0 4px; }
h2 { font-size: 19px; margin: 32px 0 10px; }
h3 { font-size: 16px; margin: 20px 0 8px; }
.lead { color: var(--muted); margin: 0 0 20px; max-width: 760px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; min-width: 0;
}
a.card { color: inherit; display: block; }
a.card:hover { border-color: var(--accent); text-decoration: none; }
.kpi .value { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .label { color: var(--muted); font-size: 13px; }
.kpi .note { font-size: 13px; margin-top: 4px; }
.pos { color: var(--good); }
.neg { color: var(--bad); }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-weight: 600; color: var(--muted); white-space: nowrap; cursor: default; }
th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--text); }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.baseline td { background: var(--accent-soft); }
.bar { position: relative; height: 8px; background: var(--bar2); border-radius: 4px; min-width: 80px; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--bar); border-radius: 4px; }
.params { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); }
.toolbar { display: flex; gap: 10px; align-items: center; margin: 0 0 12px; flex-wrap: wrap; }
input[type=search], select {
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 7px 10px; font: inherit; min-width: 220px;
}
.tag { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--accent-soft);
  color: var(--accent); font-size: 12px; }
.docs { display: grid; grid-template-columns: 250px 1fr; gap: 24px; align-items: start; }
.docs aside { position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow: auto; }
.docs aside h4 { margin: 14px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.docs aside a { display: block; padding: 3px 8px; border-radius: 6px; color: var(--text); font-size: 14px; }
.docs aside a.active { background: var(--accent-soft); color: var(--accent); }
.md { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 28px 24px; min-width: 0; }
.md pre { background: var(--code); padding: 12px; border-radius: 8px; overflow-x: auto; font-size: 13px; }
.md code { background: var(--code); padding: 1px 4px; border-radius: 4px; font-size: 92%; }
.md pre code { background: none; padding: 0; }
.md table { display: block; overflow-x: auto; margin: 12px 0; }
.md blockquote { margin: 0; padding: 4px 14px; border-left: 3px solid var(--line); color: var(--muted); }
.md img { max-width: 100%; }
details.comp { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
details.comp summary { cursor: pointer; font-weight: 600; }
details.comp li { margin: 3px 0; }
.empty { padding: 24px; text-align: center; color: var(--muted); }
.error { color: var(--bad); }
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; padding: 10px 16px; gap: 8px; }
  .menu { display: block; }
  nav { display: none; width: 100%; flex-direction: column; }
  nav.open { display: flex; }
  .docs { grid-template-columns: 1fr; }
  .docs aside { position: static; max-height: none; }
  .md { padding: 4px 16px 16px; }
  input[type=search], select { min-width: 0; width: 100%; }
}
