:root {
  --bg: #f6f4ef; --surface: #fffdf9; --ink: #1d2433; --muted: #667085; --line: #e2ddd2;
  --accent: #c2410c; --accent-ink: #fff; --ok: #15803d; --warn: #b45309; --bad: #b91c1c; --code: #f0ece3;
  --radius: 10px; --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14171f; --surface: #1c212c; --ink: #e8e6e1; --muted: #9aa3b5; --line: #2e3545; --accent: #fb923c; --accent-ink: #1a1206; --ok: #4ade80; --warn: #fbbf24; --bad: #f87171; --code: #232a38; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
h1 { font-size: 1.35rem; margin: 0 0 .6rem; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
h3 { font-size: .95rem; margin: 0 0 .4rem; }
p { margin: 0 0 .7rem; }
a { color: var(--accent); }
code, pre, .mono { font-family: var(--mono); font-size: .85em; }
code { background: var(--code); padding: .1em .35em; border-radius: 5px; }
pre { background: var(--code); padding: .8rem; border-radius: var(--radius); overflow: auto; max-height: 28rem; margin: 0 0 .7rem; white-space: pre-wrap; word-break: break-word; }
.muted { color: var(--muted); }
.error { color: var(--bad); }
.small { font-size: .85rem; }
.center { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.narrow { width: min(26rem, 100%); }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .7rem; }
input, select, textarea { display: block; width: 100%; margin-top: .25rem; padding: .5rem .6rem; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
input[type=checkbox], input[type=radio] { display: inline-block; width: auto; margin: 0 .4rem 0 0; }
textarea { font-family: var(--mono); font-size: .85rem; min-height: 9rem; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button { font: inherit; padding: .45rem .9rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
button:hover { border-color: var(--muted); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.danger { color: var(--bad); }
button:disabled { opacity: .55; cursor: wait; }
button.mini { padding: .2rem .55rem; font-size: .85rem; }

header.top { display: flex; align-items: center; gap: 1rem; padding: .7rem 1.2rem; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
header.top .brand { font-weight: 700; letter-spacing: -.01em; }
nav.tabs { display: flex; gap: .2rem; flex-wrap: wrap; flex: 1; }
nav.tabs button { border: 0; background: none; padding: .4rem .7rem; color: var(--muted); }
nav.tabs button[aria-current=page] { color: var(--ink); background: var(--code); font-weight: 600; }
main.page { max-width: 76rem; margin: 0 auto; padding: 1.2rem; }

.badge { display: inline-block; padding: .05rem .5rem; border-radius: 99px; font-size: .75rem; font-weight: 600; border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { color: var(--ok); border-color: var(--ok); }
.badge.warn { color: var(--warn); border-color: var(--warn); }
.badge.bad { color: var(--bad); border-color: var(--bad); }
.badge.count { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); margin-left: .3rem; }
.method { font-family: var(--mono); font-size: .72rem; font-weight: 700; min-width: 3.4rem; display: inline-block; }
.method.GET { color: var(--ok); } .method.POST, .method.PUT, .method.PATCH { color: var(--warn); } .method.DELETE { color: var(--bad); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
td img { width: 44px; height: 44px; object-fit: contain; border-radius: 6px; background: #fff; display: block; }
td input.inline { width: 6.5rem; margin: 0; padding: .3rem .45rem; display: inline-block; }

.checklist { list-style: none; padding: 0; margin: 0 0 .7rem; }
.checklist li { padding: .25rem 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: 1rem; }
.explorer { display: grid; grid-template-columns: minmax(16rem, 23rem) 1fr; gap: 1rem; align-items: start; }
@media (max-width: 800px) { .explorer { grid-template-columns: 1fr; } }
.oplist { max-height: 70vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.oplist button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; padding: .5rem .7rem; }
.oplist button[aria-selected=true] { background: var(--code); }
.oplist .opname { font-weight: 600; word-break: break-all; }
.oplist .group-title { padding: .35rem .7rem; font-size: .75rem; font-family: var(--mono); color: var(--muted); background: var(--bg); border-bottom: 1px solid var(--line); position: sticky; top: 0; }
.option { display: flex; gap: .5rem; align-items: flex-start; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; margin-bottom: .5rem; color: var(--ink); font-size: .95rem; cursor: pointer; }
.option input { margin-top: .3rem; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .2rem .8rem; }
.checks label { color: var(--ink); margin: 0; font-size: .9rem; }
details { margin-bottom: .7rem; } summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.toast { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: .5rem 1rem; border-radius: 8px; z-index: 20; }
