@font-face { font-family: 'Geist Variable'; src: url('fonts/geist-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Geist Mono Variable'; src: url('fonts/geist-mono-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

/* Chab docs: white page, one clear column for reading, a calm sidebar.
   Same colours and type as the marketing site (rose accent, ink greys). */
:root {
    --bg: #ffffff;
    --soft: #f6f7f9;
    --text: #111217;
    --text-2: #3f4351;
    --text-3: #535868;
    --text-4: #6b7183;
    --line: #eceef2;
    --line-strong: #d9dce3;
    --accent: #c9123f;
    --accent-hover: #a80e36;
    --accent-soft: #fff0f3;
    --accent-line: #ffbfcb;
    --code-bg: #111217;
    --sans: 'Geist Variable', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --mono: 'Geist Mono Variable', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --header: 72px;
    color-scheme: light;
    font-family: var(--sans);
    font-size: 17px;
    line-height: 28px;
    color: var(--text-2);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header) + 24px); }
body { margin: 0; overflow-x: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -80px; background: #fff; padding: 12px; z-index: 50; border-radius: 8px; }
.skip:focus { top: 12px; }

/* Header: the marketing site's bar */
.site-header { background: rgb(255 255 255 / 0.92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.site-header-inner { max-width: 1360px; margin: 0 auto; padding: 0 32px; height: var(--header); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-logo { height: 28px; width: auto; display: block; }
.brand-docs { font-size: 16px; font-weight: 500; color: var(--text-3); padding-left: 12px; border-left: 1px solid var(--line-strong); line-height: 24px; }
.site-nav { display: flex; gap: 4px; }
.site-nav a, .site-actions > a { color: var(--text); font-size: 16px; line-height: 24px; padding: 8px 12px; border-radius: 8px; }
.site-nav a:hover, .site-actions > a:hover { background: var(--soft); text-decoration: none; }
.site-nav a[aria-current] { background: var(--soft); font-weight: 500; }
.site-actions { display: flex; align-items: center; gap: 8px; }
.btn-primary { background: var(--accent); color: #fff !important; font-weight: 500; font-size: 15px; height: 40px; display: inline-flex; align-items: center; padding: 0 16px !important; border-radius: 10px !important; box-shadow: inset 0 -6px 12px rgb(145 10 45 / 0.2), 0 1px 2px rgb(201 18 63 / 0.16); }
.btn-primary:hover { background: var(--accent-hover) !important; }
.menu-toggle { display: none; height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-strong); background: #fff; font: inherit; font-size: 15px; font-weight: 500; color: var(--text); cursor: pointer; }

/* Layout: sidebar, article, on-this-page */
.layout { max-width: 1360px; margin: 0 auto; padding: 0 32px; display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 64px; }
.docs-nav { position: sticky; top: var(--header); align-self: start; height: calc(100vh - var(--header)); overflow-y: auto; padding: 32px 16px 48px 0; border-right: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.docs-nav section + section { margin-top: 28px; }
.docs-nav h2 { font-size: 15px; line-height: 24px; font-weight: 600; color: var(--text); margin: 0 0 6px; padding: 0 12px; border: 0; letter-spacing: 0; text-transform: none; }
.docs-nav a { display: block; font-size: 15px; line-height: 22px; color: var(--text-3); padding: 7px 12px; border-radius: 8px; }
.docs-nav a:hover { background: var(--soft); color: var(--text); text-decoration: none; }
.docs-nav a[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 500; box-shadow: inset 3px 0 0 var(--accent); }
.docs-nav-foot { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.search { position: relative; margin: 0 0 28px; }
.search input { width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; font: inherit; font-size: 16px; color: var(--text); }
.search input::placeholder { color: var(--text-4); }
.search input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgb(201 18 63 / 0.12); }
.search-results { position: absolute; left: 0; right: 0; top: 50px; z-index: 30; background: #fff; border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 16px 40px -12px rgb(17 18 23 / 0.25); max-height: 420px; overflow: auto; padding: 6px; }
.search-results a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 8px; color: var(--text); }
.search-results a:hover { background: var(--soft); text-decoration: none; }
.search-title { font-size: 15px; line-height: 22px; }
.search-sep { color: var(--text-4); }
.search-group { font-size: 14px; line-height: 20px; color: var(--text-4); }
.search-empty { margin: 10px 12px; font-size: 15px; color: var(--text-3); }

main { min-width: 0; padding: 48px 0 96px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 64px; align-items: start; }
.prose { min-width: 0; max-width: 760px; }
.toc { display: none; position: sticky; top: calc(var(--header) + 48px); max-height: calc(100vh - var(--header) - 96px); overflow-y: auto; }
@media (min-width: 1240px) { main:has(.toc) { grid-template-columns: minmax(0, 760px) 220px; } .toc { display: block; } }
.toc p { margin: 0 0 12px; font-size: 15px; line-height: 22px; font-weight: 600; color: var(--text); }
.toc a { display: block; font-size: 14px; line-height: 20px; color: var(--text-3); padding: 6px 0 6px 14px; border-left: 2px solid var(--line); }
.toc a:hover { color: var(--text); border-left-color: var(--accent); text-decoration: none; }
.toc a.toc-endpoint { font-family: var(--mono); font-size: 13px; color: var(--text); font-weight: 500; margin-top: 10px; }
.toc a.toc-endpoint:first-of-type { margin-top: 0; }
.toc a.toc-sub { padding-left: 26px; }

/* Article */
.prose h1 { font-size: 40px; line-height: 48px; letter-spacing: -0.02em; font-weight: 600; color: var(--text); margin: 0 0 20px; }
.prose h2 { font-size: 28px; line-height: 36px; letter-spacing: -0.01em; font-weight: 600; color: var(--text); margin: 56px 0 16px; }
.prose h2.endpoint { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 80px; padding-top: 40px; border-top: 1px solid var(--line-strong); }
.prose > h2.endpoint:first-of-type { margin-top: 56px; }
.method { font-family: var(--mono); font-size: 15px; line-height: 24px; font-weight: 600; letter-spacing: 0.02em; padding: 3px 10px; border-radius: 8px; }
.method-get { background: #e7f6ee; color: #0f6b3c; }
.method-post { background: var(--accent-soft); color: var(--accent-hover); }
.method-put, .method-patch { background: #fff4e0; color: #8a5600; }
.method-delete { background: #fdecec; color: #b42318; }
.endpoint-path { font-family: var(--mono); font-size: 26px; line-height: 34px; font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
.prose h3 { font-size: 22px; line-height: 30px; font-weight: 600; color: var(--text); margin: 40px 0 12px; }
.prose h4 { font-size: 18px; line-height: 28px; font-weight: 600; color: var(--text); margin: 28px 0 8px; }
.prose h1 + p, .prose .lead { font-size: 20px; line-height: 32px; color: var(--text-2); }
.prose p, .prose ul, .prose ol { margin: 16px 0; }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li { margin: 8px 0; padding-left: 4px; }
.prose li::marker { color: var(--text-4); }
.prose li > p { margin: 4px 0; }

code { font-family: var(--mono); font-size: 0.86em; color: var(--text); background: var(--soft); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.code-block { position: relative; margin: 24px 0; }
pre { overflow: auto; background: var(--code-bg); color: #eceef2; padding: 20px 24px; border-radius: 14px; font-size: 14px; line-height: 24px; margin: 0; }
pre code { background: transparent; border: 0; padding: 0; color: inherit; font-size: inherit; overflow-wrap: normal; }
.copy-code { position: absolute; top: 10px; right: 10px; height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid rgb(255 255 255 / 0.16); background: rgb(255 255 255 / 0.08); color: #eceef2; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; opacity: 0; transition: opacity 0.15s ease, background-color 0.15s ease; }
.code-block:hover .copy-code, .copy-code:focus-visible { opacity: 1; }
.copy-code:hover { background: rgb(255 255 255 / 0.16); }
@media (hover: none) { .copy-code { opacity: 1; } }

.table-wrap { overflow-x: auto; margin: 24px 0; border: 1px solid var(--line-strong); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 24px; }
th, td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { background: var(--soft); color: var(--text); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td + td, th + th { border-left: 1px solid var(--line); }

blockquote { margin: 24px 0; padding: 16px 20px; color: var(--text-2); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 12px; }
blockquote > :first-child { margin-top: 0; }
blockquote > :last-child { margin-bottom: 0; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

/* Docs home */
.docs-home { max-width: 980px; }
.docs-home h2 { border-top: 0; padding-top: 0; margin-top: 56px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin: 24px 0 0; }
.card { display: flex; flex-direction: column; gap: 8px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 16px; background: #fff; color: var(--text); box-shadow: 0 1px 2px rgb(17 18 23 / 0.04); transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.card:hover { border-color: var(--accent-line); box-shadow: 0 8px 24px -12px rgb(17 18 23 / 0.18); text-decoration: none; }
.card strong { font-size: 18px; line-height: 26px; font-weight: 600; color: var(--text); }
.card strong::after { content: ' \2192'; color: var(--accent); }
.card span { font-size: 15px; line-height: 24px; color: var(--text-3); }
.cards-compact { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.cards-compact .card { padding: 16px 18px; }
.cards-compact .card strong { font-size: 16px; line-height: 24px; }

.site-footer { border-top: 1px solid var(--line); background: var(--bg); }
.site-footer-inner { max-width: 1360px; margin: 0 auto; padding: 28px 32px; display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; font-size: 15px; line-height: 24px; color: var(--text-4); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer nav a { color: var(--text-3); }

@media (max-width: 1024px) {
    .site-nav { display: none; }
    .site-actions > a:not(.btn-primary) { display: none; }
    .menu-toggle { display: inline-flex; align-items: center; }
    .site-header-inner { padding: 0 16px; gap: 12px; }
    .brand-docs { display: none; }
    .layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0 16px; }
    .docs-nav { display: none; position: static; height: auto; overflow: visible; margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
    .docs-nav.open { display: block; }
    main { padding: 32px 0 64px; }
    .prose h1 { font-size: 32px; line-height: 40px; }
    .prose h2 { font-size: 24px; line-height: 32px; margin-top: 44px; }
    .prose h2.endpoint { margin-top: 56px; padding-top: 28px; }
    .endpoint-path { font-size: 20px; line-height: 28px; }
    .prose h3 { font-size: 20px; line-height: 28px; }
    .prose h1 + p, .prose .lead { font-size: 18px; line-height: 30px; }
    pre { padding: 16px 18px; font-size: 13px; line-height: 22px; border-radius: 12px; }
    .site-footer-inner { padding: 24px 16px; }
}
