:root {
  --bg: #ffffff; --bg-alt: #f5f7f9; --surface: #ffffff; --text: #14181f; --muted: #5a6472; --line: #e2e6eb;
  --accent: #0b6e6e; --accent-hover: #095959; --accent-ink: #ffffff; --accent-soft: #e3f1f1;
  --ok: #0b6e3a; --warn: #9a6700; --err: #b42318;
  --j-key: #0b4f8a; --j-str: #0b6e3a; --j-num: #9a3412; --j-lit: #7c3aed; --j-punc: #5a6472;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216; --bg-alt: #151a20; --surface: #171c23; --text: #e8ebef; --muted: #9aa4b1; --line: #262d36;
    --accent: #3cc2b8; --accent-hover: #5fd3ca; --accent-ink: #06201e; --accent-soft: #12302e;
    --ok: #4ade80; --warn: #fbbf24; --err: #ff7b72;
    --j-key: #7cc4ff; --j-str: #86efac; --j-num: #fdba74; --j-lit: #c4b5fd; --j-punc: #9aa4b1;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 20px; height: 56px; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 2; }
.brand { color: var(--text); font-weight: 650; }
.brand span { color: var(--accent); font-weight: 600; }
.brand:hover { color: var(--text); text-decoration: none; }
.top nav { display: flex; gap: 18px; font-weight: 500; }

.layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: calc(100vh - 56px); }
.side { border-right: 1px solid var(--line); background: var(--bg-alt); padding: 16px; overflow-y: auto; max-height: calc(100vh - 56px); position: sticky; top: 56px; }
.main { padding: 20px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-content: start; min-width: 0; }

.about { margin-bottom: 16px; }
.about summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.prose { font-size: .9rem; }
.prose h3 { font-size: .95rem; margin: 14px 0 4px; }
.prose ul { padding-left: 1.1em; margin: 4px 0; }
.prose li { margin-bottom: 4px; }
.prose code { font-family: var(--mono); font-size: .85em; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 0 3px; }

.endpoints h3 { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 16px 0 6px; }
.endpoints ul { list-style: none; padding: 0; margin: 0; }
.ep { all: unset; box-sizing: border-box; display: flex; gap: 8px; align-items: baseline; width: 100%; padding: 5px 8px; border-radius: 6px; cursor: pointer; font-family: var(--mono); font-size: .82rem; }
.ep:hover, .ep:focus-visible { background: var(--surface); }
.ep .p { overflow-wrap: anywhere; }
.m { display: inline-block; min-width: 54px; text-align: center; font: 700 .7rem/1.6 var(--mono); border-radius: 4px; padding: 0 4px; color: #fff; }
.m-GET { background: #0b6e6e; } .m-PUT { background: #9a6700; } .m-POST { background: #1d4ed8; } .m-DELETE { background: #b42318; }

.request { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.bar { display: flex; gap: 8px; }
select, input, textarea, button { font: inherit; color: var(--text); }
select, input, textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; }
#method { font-family: var(--mono); font-weight: 700; }
#path { flex: 1; min-width: 0; font-family: var(--mono); }
textarea { width: 100%; font-family: var(--mono); font-size: .85rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.send { flex: none; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px; padding: 0 20px; font-weight: 650; cursor: pointer; }
.send:hover { background: var(--accent-hover); }
.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); border-radius: 6px; padding: 4px 10px; font-size: .85rem; font-weight: 600; cursor: pointer; }
.ghost:hover { background: var(--accent-soft); }
.options { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .9rem; }
.options label { font-weight: 600; }
#token { flex: 0 1 320px; min-width: 0; padding: 6px 10px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.row label, .row h2 { font-weight: 600; font-size: .95rem; margin: 0; }

.response, .curl { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; min-width: 0; }
.status-line { font-family: var(--mono); font-weight: 700; margin-bottom: 8px; }
.status-line .code-2 { color: var(--ok); } .status-line .code-3 { color: var(--warn); } .status-line .code-4, .status-line .code-5 { color: var(--err); }
.status-line .t { color: var(--muted); font-weight: 400; margin-left: 10px; }
.headers { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 0 0 12px; font-family: var(--mono); font-size: .8rem; }
.headers dt { color: var(--muted); }
.headers dd { margin: 0; overflow-wrap: anywhere; }
pre { margin: 0; font-family: var(--mono); font-size: .85rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.json .k { color: var(--j-key); } .json .s { color: var(--j-str); } .json .n { color: var(--j-num); } .json .l { color: var(--j-lit); } .json .p { color: var(--j-punc); }
.json a { text-decoration: underline; text-underline-offset: 2px; }
#curl-cmd { color: var(--text); }

@media (max-width: 820px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; max-height: none; border-right: 0; border-top: 1px solid var(--line); order: 2; }  /* request/response first on phones */
  .main { padding: 16px; }
  .top { padding: 0 16px; }
  .top nav { gap: 12px; font-size: .9rem; }
  .top nav .site { display: none; }
}
