/* ChatKomodo API docs (chatkomodo.com/docs). Static pages built by scripts/build-docs.mjs. */
@font-face { font-family: 'Plus Jakarta Sans Variable'; font-style: normal; font-display: swap; font-weight: 200 800; src: url(/fonts/plus-jakarta-sans-latin-wght-normal.woff2) format('woff2-variations'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans Variable'; font-style: normal; font-display: swap; font-weight: 200 800; src: url(/fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2) format('woff2-variations'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1E00-1E9F,U+20A0-20AB,U+20AD-20C0; }

:root {
  color-scheme: light;
  --bg: #f7f8f6; --surface: #ffffff; --surface-2: #f1f4f1; --border: rgba(15, 23, 32, 0.09); --border-strong: rgba(15, 23, 32, 0.16);
  --text: #0f1720; --text-2: #3f4a56; --text-3: #5b6370;
  --brand: #0a7350; --brand-strong: #085f40; --brand-soft: rgba(10, 115, 80, 0.09);
  --code-bg: #0f1a16; --code-text: #e6efe9; --code-head: #16241f; --code-border: #22362f; --code-muted: #8aa39a;
  --inline-code: #eef3f0;
  --get: #1760d6; --post: #0a7350; --put: #b45309; --patch: #8b5cf6; --delete: #c42b20;
  --warn: #b45309; --danger: #c42b20; --info: #1760d6;
  --hl-s: #9be2bf; --hl-k: #7cc4ff; --hl-n: #f7c873; --hl-kw: #f39ad6; --hl-c: #7d938b; --hl-b: #f7c873;
  --radius: 12px; --top: 60px; --side: 268px;
  --font: 'Plus Jakarta Sans Variable', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'JetBrains Mono', Menlo, Consolas, monospace;
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0b1210; --surface: #111a17; --surface-2: #16221e; --border: rgba(255, 255, 255, 0.09); --border-strong: rgba(255, 255, 255, 0.17);
  --text: #e8eeeb; --text-2: #b6c2bd; --text-3: #92a19b;
  --brand: #34c98a; --brand-strong: #5fd9a4; --brand-soft: rgba(52, 201, 138, 0.12);
  --code-bg: #08100d; --code-head: #0f1a16; --code-border: #1d2e28;
  --inline-code: #1b2924;
  --get: #6ea8ff; --post: #34c98a; --put: #f2b25b; --patch: #b79cff; --delete: #ff8a80;
  --warn: #f2b25b; --danger: #ff8a80; --info: #6ea8ff;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15.5px/1.65 var(--font); }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-strong); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
code, kbd, pre { font-family: var(--mono); font-size: 0.88em; }
:not(pre) > code { background: var(--inline-code); padding: 0.12em 0.4em; border-radius: 6px; overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
.muted { color: var(--text-3); }

/* ── top bar ── */
.top { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 10px; padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 750; font-size: 16px; letter-spacing: -0.01em; }
.brand img { border-radius: 8px; }
.brand-docs { color: var(--brand); text-decoration: none; font-weight: 650; padding: 2px 10px; border-radius: 999px; background: var(--brand-soft); font-size: 13px; }
.search { position: relative; flex: 1; max-width: 460px; margin: 0 auto; display: flex; align-items: center; }
.search svg { position: absolute; left: 11px; width: 17px; height: 17px; fill: none; stroke: var(--text-3); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.search input { width: 100%; height: 40px; padding: 0 40px 0 36px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 14.5px; }
.search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search kbd { position: absolute; right: 10px; padding: 1px 7px; border: 1px solid var(--border-strong); border-radius: 6px; color: var(--text-3); font-size: 12px; }
.search input:focus + kbd { display: none; }
#docs-results { position: absolute; top: 46px; left: 0; right: 0; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.3); max-height: min(70vh, 520px); overflow-y: auto; }
#docs-results li a { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
#docs-results li a > span:first-child { grid-row: span 2; align-self: center; }
#docs-results li[aria-selected='true'] a, #docs-results li a:hover { background: var(--brand-soft); }
#docs-results .r-t { font-weight: 600; font-size: 14px; }
#docs-results .r-k { font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#docs-results .r-none { padding: 12px; color: var(--text-3); }
.btn { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 10px; font-weight: 650; font-size: 14px; text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--brand); color: #fff; }
:root[data-theme='dark'] .btn-primary { color: #04261b; }
.btn-primary:hover { background: var(--brand-strong); color: #fff; }
:root[data-theme='dark'] .btn-primary:hover { color: #04261b; }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: none; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-toggle { display: none; }

/* ── layout ── */
.wrap { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); max-width: 1680px; margin: 0 auto; }
.wrap:has(.toc) { grid-template-columns: var(--side) minmax(0, 1fr) 220px; }
.side { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; padding: 20px 12px 40px 16px; border-right: 1px solid var(--border); overscroll-behavior: contain; }
.side-group + .side-group { margin-top: 18px; }
.side h2 { margin: 0 0 4px; padding: 0 10px; font-size: 11.5px; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.side ul { list-style: none; margin: 0; padding: 0; }
.side a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: 14px; line-height: 1.4; }
.side a:hover { background: var(--surface-2); color: var(--text); }
.side a[aria-current='page'] { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.content { min-width: 0; padding: 32px clamp(16px, 3.5vw, 48px) 64px; }
.content > h1 { margin: 2px 0 12px; font-size: clamp(28px, 3.4vw, 38px); line-height: 1.15; letter-spacing: -0.025em; }
.kicker { margin: 0; color: var(--brand); font-weight: 700; font-size: 13px; letter-spacing: 0.02em; }
.content h2 { margin: 40px 0 10px; font-size: 22px; line-height: 1.3; letter-spacing: -0.015em; }
.content h2 a { color: inherit; text-decoration: none; }
.content h2 a:hover::after { content: ' #'; color: var(--text-3); }
.content h3.sub, .content h4 { margin: 22px 0 8px; font-size: 13px; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); }
.content p, .content li { color: var(--text-2); }
.content strong { color: var(--text); }
.content :is(p, ul, ol) { max-width: 76ch; }
.lead, .lead p { font-size: 17px; color: var(--text-2); max-width: 72ch; }
.note { padding: 10px 14px; border-left: 3px solid var(--brand); background: var(--brand-soft); border-radius: 0 10px 10px 0; }
.toc { position: sticky; top: var(--top); align-self: start; max-height: calc(100vh - var(--top)); overflow-y: auto; padding: 32px 16px 32px 0; }
.toc h2 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc a { display: block; padding: 4px 0 4px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--text-3); text-decoration: none; font-size: 13.5px; line-height: 1.4; }
.toc a:hover { color: var(--text); }
.toc a.on { color: var(--brand); border-left-color: var(--brand); }
.device-note { margin: 0 0 18px; padding: 10px 14px; border-radius: 10px; background: var(--brand-soft); color: var(--text-2); font-size: 14px; }
.foot { margin-top: 64px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--text-3); font-size: 13.5px; }
.foot p { color: var(--text-3); }

/* ── cards, facts, tables ── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 12px; margin: 22px 0 8px; }
.card { display: grid; gap: 4px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.card:hover { border-color: var(--brand); color: var(--text); transform: translateY(-1px); }
.card strong { font-size: 15.5px; }
.card span { color: var(--text-3); font-size: 14px; line-height: 1.5; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 12px 0; max-width: 820px; }
.facts dt { font-weight: 650; color: var(--text); }
.facts dd { margin: 0; color: var(--text-2); }
.checks { padding-left: 0; list-style: none; }
.checks li { position: relative; padding-left: 26px; margin: 8px 0; }
.checks li::before { content: ''; position: absolute; left: 2px; top: 0.55em; width: 12px; height: 7px; border-left: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(-45deg); }
.tbl-wrap { overflow-x: auto; margin: 10px 0 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 650; color: var(--text-3); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; background: var(--surface-2); }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td { color: var(--text-2); }
caption { text-align: left; padding: 8px 12px; color: var(--text-3); }
.fields { list-style: none; margin: 8px 0 16px; padding: 0; border-top: 1px solid var(--border); max-width: none !important; }
.fields li { padding: 10px 0 10px calc(var(--d, 0) * 18px); border-bottom: 1px solid var(--border); margin: 0 !important; }
.fields li[style*="--d:1"], .fields li[style*="--d:2"], .fields li[style*="--d:3"], .fields li[style*="--d:4"] { background: linear-gradient(90deg, transparent calc(var(--d) * 18px - 10px), var(--border) calc(var(--d) * 18px - 10px), var(--border) calc(var(--d) * 18px - 9px), transparent calc(var(--d) * 18px - 9px)); }
.f-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.f-name { background: none !important; padding: 0 !important; color: var(--text); font-weight: 650; font-size: 13.5px; overflow-wrap: anywhere; }
.f-parent { color: var(--text-3); font-weight: 500; }
.f-type { color: var(--text-3); font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }
.f-meta { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 5px; }
.f-meta span { font-size: 12.5px; color: var(--text-3); background: var(--surface-2); border-radius: 6px; padding: 1px 7px; }
.f-meta code { background: none !important; padding: 0 !important; }
.f-desc { margin-top: 3px; color: var(--text-2); font-size: 14.5px; line-height: 1.6; }
.req { font-size: 11px; font-weight: 700; color: var(--danger); text-transform: uppercase; letter-spacing: 0.03em; }

/* ── endpoints ── */
.m { display: inline-block; min-width: 46px; padding: 2px 6px; border-radius: 6px; font: 700 11.5px/1.5 var(--mono); text-align: center; letter-spacing: 0.02em; color: #fff; }
.m-get { background: var(--get); } .m-post { background: var(--post); } .m-put { background: var(--put); } .m-patch { background: var(--patch); } .m-delete { background: var(--delete); }
:root[data-theme='dark'] .m { color: #07110d; }
.pp { color: var(--brand); }
.ep-index ul { list-style: none; margin: 18px 0 8px; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); display: grid; gap: 2px; }
.ep-index a { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px; align-items: center; padding: 7px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; }
.ep-index a:hover { background: var(--surface-2); }
.ep-index code { color: var(--text-3); background: none; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.ep-index-t { font-weight: 600; }
.ep { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 36px 0; border-top: 1px solid var(--border); scroll-margin-top: calc(var(--top) + 8px); }
.ep:first-of-type { border-top: 0; }
.ep-title { margin: 0 0 8px !important; font-size: 21px !important; }
.ep-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.ep-path { font-size: 14.5px; background: none !important; padding: 0 !important; color: var(--text); overflow-wrap: anywhere; }
.ep-desc p { margin: 8px 0; }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.badge-login { background: rgba(23, 96, 214, 0.1); color: var(--info); }
.badge-public { background: var(--surface-2); color: var(--text-3); }
.badge-warn { background: rgba(245, 158, 11, 0.15); color: #92400e; } :root[data-theme='dark'] .badge-warn { color: var(--warn); }
.responses { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-width: none !important; }
.responses li { display: grid; grid-template-columns: 52px 1fr; gap: 4px 10px; align-items: baseline; }
.responses details { grid-column: 1 / -1; }
.status { font: 700 12.5px/1.6 var(--mono); text-align: center; border-radius: 6px; padding: 0 4px; }
.s2 { background: rgba(19, 113, 58, 0.12); color: #13713a; } :root[data-theme='dark'] .s2 { color: #5fd9a4; }
.s3 { background: var(--surface-2); color: var(--text-3); }
.s4 { background: rgba(245, 158, 11, 0.15); color: #92400e; } :root[data-theme='dark'] .s4 { color: var(--warn); }
.s5 { background: rgba(196, 43, 32, 0.1); color: #a3241b; } :root[data-theme='dark'] .s5 { color: var(--danger); }
.resp-desc { color: var(--text-2); font-size: 14.5px; }
details summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: 13.5px; padding: 4px 0; }
.code-link code { color: var(--brand); }

/* ── code ── */
.code { margin: 12px 0 18px; border: 1px solid var(--code-border); border-radius: var(--radius); background: var(--code-bg); overflow: hidden; color: var(--code-text); }
.code-head { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 6px 0 14px; background: var(--code-head); border-bottom: 1px solid var(--code-border); color: var(--code-muted); font-size: 12.5px; font-weight: 600; }
.code-head > span { flex: 1; }
.code-title { flex: 0 0 auto !important; margin-right: 6px; }
.tablist { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tablist::-webkit-scrollbar { display: none; }
.tablist button { border: 0; background: none; color: var(--code-muted); font: 600 12.5px var(--font); padding: 6px 10px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.tablist button[aria-selected='true'] { background: rgba(255, 255, 255, 0.09); color: #fff; }
.tablist button:hover { color: #fff; }
.copy { border: 1px solid var(--code-border); background: none; color: var(--code-muted); font: 600 12px var(--font); padding: 4px 10px; border-radius: 7px; cursor: pointer; }
.copy:hover { color: #fff; border-color: #3b5a50; }
.copy.done { color: #5fd9a4; border-color: #5fd9a4; }
.copy-sm { color: var(--text-3); border-color: var(--border-strong); padding: 2px 8px; }
.copy-sm:hover { color: var(--text); border-color: var(--text-3); }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; line-height: 1.6; font-size: 13px; tab-size: 2; }
.js .code pre[data-hidden] { display: none; }
html:not(.js) .code pre[data-hidden] { border-top: 1px solid var(--code-border); }
html:not(.js) .tablist, html:not(.js) .tabs > .code-head > .copy { display: none; }
.code-note { margin: 0; padding: 12px 16px; color: var(--code-muted) !important; font-size: 13.5px; }
.hl-s { color: var(--hl-s); } .hl-k { color: var(--hl-k); } .hl-n { color: var(--hl-n); } .hl-kw { color: var(--hl-kw); } .hl-c { color: var(--hl-c); font-style: italic; } .hl-b { color: var(--hl-b); }
.ph-device { border-bottom: 1px dashed currentColor; }

/* ── wide: endpoint text left, code right ── */
@media (min-width: 1280px) {
  .ep { grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr); gap: 32px; }
  .ep-code { position: sticky; top: calc(var(--top) + 16px); align-self: start; max-height: calc(100vh - var(--top) - 32px); overflow-y: auto; }
  .ep-code .code:first-child { margin-top: 0; }
}

/* ── narrow ── */
@media (max-width: 1100px) {
  .wrap:has(.toc) { grid-template-columns: var(--side) minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 860px) {
  :root { --top: 56px; }
  .wrap, .wrap:has(.toc) { grid-template-columns: minmax(0, 1fr); }
  .nav-toggle { display: grid; }
  .side { position: fixed; top: var(--top); left: 0; bottom: 0; width: min(86vw, 320px); height: auto; z-index: 25; background: var(--surface); transform: translateX(-102%); transition: transform 0.2s ease; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25); }
  body.nav-open .side { transform: none; }
  body.nav-open::after { content: ''; position: fixed; inset: var(--top) 0 0; background: rgba(5, 10, 8, 0.4); z-index: 20; }
  .top-link, .brand span { display: none; }
  .top { gap: 6px; padding: 0 10px; }
  .search kbd { display: none; }
  .content { padding-top: 22px; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 10px; }
  .ep-index a { grid-template-columns: auto minmax(0, 1fr); }
  .ep-index code { grid-column: 2; }
}
@media (max-width: 520px) {
  .brand-docs { display: none; }
  .btn-primary { padding: 0 10px; }
  body { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .top, .side, .toc, .copy, .tablist { display: none !important; } .wrap { display: block; } .code pre[data-hidden] { display: block; } }
