:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --border: #dde1e7;
  --text: #1c2430;
  --muted: #5b6676;
  --accent: #00876c;          /* KIT green family */
  --accent-soft: #e3f3ef;
  --get: #0b7a55;
  --get-soft: #e2f4ec;
  --post: #2f5fd0;
  --post-soft: #e6edfc;
  --err: #b42318;
  --code-bg: #0f1720;
  --code-text: #dbe4ee;
  --code-key: #8cc8ff;
  --code-str: #a8e6a1;
  --code-num: #f5c07a;
  --code-lit: #e6a6f0;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --surface: #161b22;
    --surface-2: #1d232c;
    --border: #2b333e;
    --text: #e3e8ee;
    --muted: #9aa5b4;
    --accent: #3cc3a0;
    --accent-soft: #10302a;
    --get: #4fd29b;
    --get-soft: #12301f;
    --post: #7ea2ff;
    --post-soft: #172443;
    --err: #ff8a80;
    --code-bg: #0a0d12;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--sans);
}
a { color: var(--accent); }
code, pre, .mono { font-family: var(--mono); font-size: 13px; }
p code, td code, li code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

/* header */
.top { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--border); }
.top-inner { max-width: 1280px; margin: 0 auto; padding: 10px 16px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.brand-title { font-weight: 650; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 9px; }
.tabs a { text-decoration: none; color: var(--muted); padding: 6px 12px; border-radius: 6px; font-weight: 550; font-size: 14px; white-space: nowrap; }
.tabs a[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }


/* layout */
.layout { max-width: 1280px; margin: 0 auto; padding: 16px; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; }
.side { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow: auto; }
.side a { display: flex; gap: 8px; align-items: baseline; padding: 6px 8px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: 14px; }
.side a:hover { background: var(--surface-2); }
.side .m { font: 600 10.5px var(--mono); width: 34px; flex: none; }
.side .m.get { color: var(--get); }
.side .m.post { color: var(--post); }
main { min-width: 0; }
main:focus { outline: none; }
.loading { color: var(--muted); }

/* intro */
.intro { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 20px; }
.intro p { margin: 6px 0; color: var(--muted); max-width: 78ch; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 14px 0 4px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* operation card */
.op { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden; }
.op-head { display: flex; gap: 10px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.method { font: 700 12px var(--mono); padding: 3px 8px; border-radius: 5px; letter-spacing: .03em; }
.method.get { background: var(--get-soft); color: var(--get); }
.method.post { background: var(--post-soft); color: var(--post); }
.path { font: 600 14px var(--mono); overflow-wrap: anywhere; }
.op-body { padding: 4px 18px 18px; }
.op h2 { font-size: 17px; margin: 12px 0 4px; }
.op h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 8px; }
.op p.desc { margin: 4px 0 0; max-width: 80ch; }

table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
td.f { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
td.t { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.req { color: var(--err); font-size: 11px; margin-left: 4px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; }
.table-wrap table tr:last-child td { border-bottom: 0; }
input.pv, select.pv { width: 100%; min-width: 140px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font: 13px var(--mono); }
textarea.body { width: 100%; min-height: 150px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--code-bg); color: var(--code-text); font: 13px/1.5 var(--mono); resize: vertical; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 8px; }
button { font: 600 13.5px var(--sans); padding: 7px 14px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
button:hover { background: var(--surface-2); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { filter: brightness(1.06); background: var(--accent); }
@media (prefers-color-scheme: dark) { button.primary { color: #06231c; } }

pre.code { margin: 0; background: var(--code-bg); color: var(--code-text); padding: 12px 14px; border-radius: 8px; overflow: auto; max-height: 460px; line-height: 1.5; }
.j-k { color: var(--code-key); }
.j-s { color: var(--code-str); }
.j-n { color: var(--code-num); }
.j-l { color: var(--code-lit); }

.resp-head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.badge { font: 600 12px var(--mono); padding: 2px 7px; border-radius: 5px; background: var(--surface-2); color: var(--text); }
.badge.ok { background: var(--get-soft); color: var(--get); }
.badge.bad { background: #fde8e6; color: var(--err); }
@media (prefers-color-scheme: dark) { .badge.bad { background: #3a1714; } }

details { margin-top: 12px; border: 1px solid var(--border); border-radius: 8px; }
details > summary { cursor: pointer; padding: 9px 12px; font-weight: 600; font-size: 14px; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸"; display: inline-block; width: 16px; color: var(--muted); transition: transform .15s; }
details[open] > summary::before { transform: rotate(90deg); }
details > .inner { padding: 0 12px 12px; }
details .table-wrap { border: 0; }

.note { font-size: 13.5px; color: var(--muted); }


@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side a { flex: 1 1 auto; }
  .op-head, .op-body, .intro { padding-left: 14px; padding-right: 14px; }
  input.pv, select.pv { min-width: 110px; }
  .side { position: static; max-height: none; display: flex; flex-wrap: wrap; gap: 4px; }
  .side a { background: var(--surface); border: 1px solid var(--border); }
  .tabs { width: 100%; }
  .tabs a { flex: 1; text-align: center; padding: 6px 6px; }
  .facts { grid-template-columns: 1fr; }
  .facts dt { margin-top: 6px; }
}
