:root {
  --bg: #ffffff; --fg: #0f172a; --muted: #5b6478; --line: #e5e7eb; --soft: #f6f7f9;
  --accent: #4f46e5; --code-bg: #0f172a; --code-fg: #e2e8f0;
  --get: #0f766e; --post: #4338ca; --put: #b45309; --delete: #b91c1c;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b0f17; --fg: #e5e7eb; --muted: #9aa3b5; --line: #222a37; --soft: #121825;
          --accent: #8b87ff; --code-bg: #05080e; --get: #2dd4bf; --post: #a5b4fc; --put: #fbbf24; --delete: #f87171; }
}
* { box-sizing: border-box; }
html { scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--fg);
       font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .88em; background: var(--soft); border: 1px solid var(--line);
       padding: .05em .35em; border-radius: 4px; }
pre { background: var(--code-bg); color: var(--code-fg); padding: 14px 16px; border-radius: 8px; overflow-x: auto;
      font: 13.5px/1.55 var(--mono); margin: 12px 0 20px; }
pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 24px; height: 56px;
       padding: 0 20px; background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--fg); }
.brand span { color: var(--muted); font-weight: 500; margin-left: 4px; }
.top nav { margin-left: auto; display: flex; gap: 20px; font-size: 15px; }
.top .menu { display: none; }

.wrap { display: grid; grid-template-columns: 260px minmax(0, 1fr) 200px; max-width: 1400px; margin: 0 auto; }
.side { position: sticky; top: 56px; align-self: start; height: calc(100vh - 56px); overflow-y: auto;
        padding: 20px 12px 40px 20px; border-right: 1px solid var(--line); font-size: 14.5px; }
.side ul, .toc ul { list-style: none; margin: 0; padding: 0; }
.side li a { display: block; padding: 4px 8px; border-radius: 6px; color: var(--fg); }
.side li a.on { background: var(--soft); font-weight: 600; }
.side ul ul { margin: 2px 0 8px 6px; }
.side .opl { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .opl .verb { font-size: 10px; min-width: 42px; }
.h { text-transform: uppercase; letter-spacing: .06em; font-size: 12px; color: var(--muted); margin: 18px 8px 6px; font-weight: 600; }
main { padding: 28px 44px 80px; min-width: 0; max-width: 920px; }
.toc { position: sticky; top: 56px; align-self: start; padding: 28px 16px; font-size: 13.5px; }
.toc a { color: var(--muted); display: block; padding: 3px 0; }

h1 { font-size: 34px; line-height: 1.2; margin: 0 0 16px; }
h2 { font-size: 23px; margin: 40px 0 12px; padding-top: 8px; }
h3 { font-size: 17px; margin: 26px 0 8px; }
.anchor { margin-left: 8px; color: var(--line); font-weight: 400; visibility: hidden; }
h1:hover .anchor, h2:hover .anchor, h3:hover .anchor { visibility: visible; }
.note { border-left: 3px solid var(--accent); background: var(--soft); padding: 10px 14px; border-radius: 0 6px 6px 0; margin: 16px 0; }

.table { overflow-x: auto; margin: 12px 0 20px; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { font-weight: 600; background: var(--soft); }
td code { white-space: nowrap; }
tr:target { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.req { color: var(--delete); font-size: 11px; text-transform: uppercase; margin-left: 4px; }
.lim { color: var(--muted); font-size: 13px; margin-top: 2px; }

.verb { display: inline-block; min-width: 54px; text-align: center; font: 700 11px/1.9 var(--mono);
        border-radius: 4px; color: #fff; padding: 0 6px; margin-right: 8px; vertical-align: middle; }
.verb.get { background: var(--get); } .verb.post { background: var(--post); }
.verb.put { background: var(--put); } .verb.delete { background: var(--delete); }
.op { border-top: 1px solid var(--line); margin-top: 36px; }
.op h2 code { font-size: 19px; background: none; border: 0; }
.op .summary { color: var(--muted); margin-top: -4px; }
.oplist { list-style: none; padding: 0; }
.oplist li { padding: 4px 0; }

.tabs { margin: 12px 0 22px; border-radius: 8px; overflow: hidden; background: var(--code-bg); }
.tabbar { display: flex; gap: 2px; padding: 6px 6px 0; border-bottom: 1px solid #1e293b; }
.tabbar button { font: 13px system-ui, sans-serif; color: #94a3b8; background: none; border: 0; padding: 6px 12px;
                 cursor: pointer; border-radius: 6px 6px 0 0; }
.tabbar button.on { color: #fff; background: #1e293b; }
.tabbar .copy { margin-left: auto; }
.tabs pre { margin: 0; border-radius: 0; display: none; }
.tabs pre.on { display: block; }
.no-js .tabs pre { display: block; }

footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 20px; text-align: center; }

@media (max-width: 1100px) { .wrap { grid-template-columns: 240px minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 760px) {
  .wrap { display: block; }
  .side { display: none; position: fixed; inset: 56px 0 0 0; z-index: 4; background: var(--bg); height: auto; }
  body.nav-open .side { display: block; }
  .top .menu { display: inline-block; margin-left: auto; background: none; border: 1px solid var(--line);
               color: var(--fg); border-radius: 6px; padding: 4px 10px; }
  .top nav { display: none; }
  main { padding: 20px 18px 60px; }
  h1 { font-size: 28px; }
}
