/* Clatter Labs Help Center — same design language as developers.clatterlabs.com / Console:
   Geist + Geist Mono (self-hosted), white #ffffff / dark #0a0a0a, cards #f9f8f6 / #1a1a1a, Clatter green accent,
   dot-ring logo, console 24px icon set (1.6 stroke). Tokens copied from clatter-guide docs-site/theme/site.css. */
@font-face { font-family: "Geist"; src: url("/fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/geist-mono.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #ffffff; --bg-soft: #f9f8f6; --card: #f9f8f6; --card-hover: #f3f1ee;
  --fg: #0a0a0a; --fg-2: #0a0a0a; --fg-3: rgba(10,10,10,.6); --fg-4: rgba(10,10,10,.4);
  --line: rgba(213,217,226,.55); --line-2: rgba(213,217,226,.9); --pill-line: rgba(10,10,10,.15);
  --accent: #16a34a; --accent-fg: #15803d; --accent-soft: rgba(22,163,74,.1); --accent-line: rgba(22,163,74,.3); --mark-bg: rgba(22,163,74,.18);
  --code-bg: #ffffff; --shadow: 0 12px 40px rgba(10,10,10,.08);
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 16px; --radius-sm: 12px; --w: 1120px; --content-w: 720px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0a0a0a; --bg-soft: #121212; --card: #1a1a1a; --card-hover: #202020;
    --fg: #ffffff; --fg-2: #d5d9e2; --fg-3: rgba(255,255,255,.6); --fg-4: rgba(255,255,255,.38);
    --line: rgba(48,52,60,.6); --line-2: rgba(60,64,72,.9); --pill-line: rgba(255,255,255,.15);
    --accent: #4ade80; --accent-fg: #4ade80; --accent-soft: rgba(74,222,128,.1); --accent-line: rgba(74,222,128,.3); --mark-bg: rgba(74,222,128,.2);
    --code-bg: #121212; --shadow: 0 12px 40px rgba(0,0,0,.5);
  }
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0a; --bg-soft: #121212; --card: #1a1a1a; --card-hover: #202020;
  --fg: #ffffff; --fg-2: #d5d9e2; --fg-3: rgba(255,255,255,.6); --fg-4: rgba(255,255,255,.38);
  --line: rgba(48,52,60,.6); --line-2: rgba(60,64,72,.9); --pill-line: rgba(255,255,255,.15);
  --accent: #4ade80; --accent-fg: #4ade80; --accent-soft: rgba(74,222,128,.1); --accent-line: rgba(74,222,128,.3); --mark-bg: rgba(74,222,128,.2);
  --code-bg: #121212; --shadow: 0 12px 40px rgba(0,0,0,.5);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body { margin: 0; font: 14px/24px var(--sans); color: var(--fg-2); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--mark-bg); }
img { max-width: 100%; height: auto; }
.ci { flex: none; display: block; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; padding: 8px 14px; border-radius: 999px; background: var(--fg); color: var(--bg); }
.skip:focus { left: 16px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: var(--w); margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- top bar */
.topbar { position: sticky; top: 0; z-index: 40; height: 64px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .wrap { height: 100%; display: flex; align-items: center; gap: 20px; max-width: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; letter-spacing: -.02em; color: var(--fg); white-space: nowrap; }
.brand .sub { font-weight: 400; color: var(--fg-3); }
.nav { display: flex; align-items: center; gap: 24px; margin-left: auto; }
.nav a { font-size: 14px; font-weight: 500; color: var(--fg-3); transition: color .15s; }
.nav a:hover { color: var(--fg); }
.top-right { display: flex; align-items: center; gap: 8px; }
.search-pill { display: inline-flex; align-items: center; gap: 8px; height: 36px; width: 200px; padding: 0 12px 0 14px; border: 1px solid var(--pill-line); border-radius: 999px; color: var(--fg-3); font-size: 13px; }
.search-pill:hover { color: var(--fg); border-color: var(--fg-4); }
.search-pill .kbd { margin-left: auto; font: 12px var(--mono); color: var(--fg-4); }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border: 0; border-radius: 999px; background: none; color: var(--fg-3); cursor: pointer; }
.icon-btn:hover { color: var(--fg); }
.theme-btn .moon { display: none; }
[data-theme="dark"] .theme-btn .sun { display: none; }
[data-theme="dark"] .theme-btn .moon { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-btn .sun { display: none; } :root:not([data-theme="light"]) .theme-btn .moon { display: block; } }
.btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 16px; border-radius: 999px; background: var(--fg); color: var(--bg); font-size: 14px; font-weight: 500; white-space: nowrap; }
.btn:hover { opacity: .88; }
.menu { display: none; position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: 44px; min-width: 200px; padding: 8px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--bg); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.menu-panel a { padding: 8px 12px; border-radius: 8px; color: var(--fg-2); font-weight: 500; }
.menu-panel a:hover { background: var(--card); color: var(--fg); }

/* ---------------------------------------------------------------- hero + search */
.hero { padding: 72px 0 40px; text-align: center; }
.hero h1 { margin: 0; font-size: 48px; line-height: 1.1; font-weight: 450; letter-spacing: -.02em; color: var(--fg); }
.hero p { margin: 16px auto 0; max-width: 560px; font-size: 16px; line-height: 26px; color: var(--fg-3); }
.hero-search { position: relative; max-width: 640px; margin: 32px auto 0; text-align: left; }
.hero-search.inline { margin: 24px 0 0; max-width: 560px; }
.field { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 8px 0 18px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--bg); color: var(--fg-3); transition: border-color .15s, box-shadow .15s; }
.field:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
.field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font: 16px var(--sans); color: var(--fg); }
.field input::placeholder { color: var(--fg-4); }
.field button { height: 38px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--fg); color: var(--bg); font: 500 14px var(--sans); cursor: pointer; }
.suggest { position: absolute; left: 0; right: 0; top: 60px; z-index: 30; padding: 6px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--bg); box-shadow: var(--shadow); }
.suggest .sr { padding: 10px 12px; border-radius: 8px; }
.suggest-all { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; font: 500 13px var(--sans); color: var(--accent-fg); cursor: pointer; }
.hero-hints { margin-top: 14px; font-size: 13px; color: var(--fg-3); }
.hero-hints a { color: var(--fg-2); border-bottom: 1px dotted var(--fg-4); margin: 0 4px; }
.hero-hints a:hover { color: var(--fg); }

/* ---------------------------------------------------------------- sections, cards */
.section { padding: 32px 0; }
.section-title { margin: 0 0 18px; font-size: 20px; line-height: 28px; font-weight: 500; color: var(--fg); letter-spacing: -.01em; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; padding: 24px; border-radius: var(--radius); background: var(--card); transition: background .15s; }
a.card:hover { background: var(--card-hover); }
.card .ci { color: var(--fg); margin-bottom: 14px; }
.card-title { font-size: 16px; line-height: 24px; font-weight: 500; letter-spacing: -.01em; color: var(--fg); }
.card-text { margin-top: 4px; font-size: 14px; line-height: 22px; color: var(--fg-3); }
.card-meta { margin-top: auto; padding-top: 14px; font-size: 12px; color: var(--fg-4); }
.list { margin: 0; padding: 0; list-style: none; }
.list li + li { border-top: 1px solid var(--line); }
.list a { display: flex; align-items: center; gap: 12px; padding: 14px 4px; color: var(--fg); font-weight: 500; }
.list a:hover .lt { text-decoration: underline dotted; text-underline-offset: 4px; }
.list .lm { margin-left: auto; flex: none; font-size: 12px; font-weight: 400; color: var(--fg-4); }
.list .ld { display: block; font-weight: 400; font-size: 13px; line-height: 20px; color: var(--fg-3); margin-top: 2px; }
.list .ci { color: var(--fg-3); }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 48px; }
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border: 1px solid var(--accent-line); border-radius: 999px; font-size: 11px; font-weight: 500; color: var(--accent-fg); white-space: nowrap; }
.badge.muted { border-color: var(--pill-line); color: var(--fg-3); }

/* ---------------------------------------------------------------- page heads, breadcrumbs */
.page { padding: 40px 0 24px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 20px; padding: 0; list-style: none; font-size: 13px; color: var(--fg-3); }
.crumbs a:hover { color: var(--fg); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--fg-4); }
.page-title { margin: 0; font-size: 40px; line-height: 1.15; font-weight: 450; letter-spacing: -.015em; color: var(--fg); }
.page-desc { margin: 14px 0 0; max-width: 680px; font-size: 16px; line-height: 26px; color: var(--fg-3); }
.head-row { display: flex; align-items: center; gap: 14px; }
.head-row .ci { color: var(--fg); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 56px; align-items: start; }
.aside { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 24px; font-size: 13px; }
.aside h2 { margin: 0 0 8px; font-size: 13px; font-weight: 500; color: var(--fg); }
.aside ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.aside a { color: var(--fg-3); }
.aside a:hover, .aside a.on { color: var(--fg); }

/* ---------------------------------------------------------------- article */
.article { max-width: var(--content-w); }
.art-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; font-size: 12px; color: var(--fg-3); }
.prose { margin-top: 32px; font-size: 15px; line-height: 26px; color: var(--fg-2); }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 16px 0; }
.prose strong { color: var(--fg); font-weight: 500; }
.prose a { color: var(--fg); font-weight: 500; text-decoration: underline; text-decoration-style: dotted; text-decoration-color: var(--fg-4); text-underline-offset: 4px; }
.prose a:hover { text-decoration-style: solid; }
.prose h2 { margin: 40px 0 12px; font-size: 24px; line-height: 32px; font-weight: 500; color: var(--fg); letter-spacing: -.01em; }
.prose h3 { margin: 28px 0 8px; font-size: 18px; line-height: 26px; font-weight: 500; color: var(--fg); }
.prose h4 { margin: 24px 0 8px; font-size: 15px; font-weight: 600; color: var(--fg); }
.prose ul, .prose ol { margin: 16px 0; padding-left: 24px; }
.prose li { margin: 6px 0; padding-left: 4px; }
.prose li::marker { color: var(--fg-4); }
.prose ol > li::marker { font-family: var(--mono); font-size: 13px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.prose blockquote { margin: 20px 0; padding: 14px 18px; border-radius: var(--radius-sm); background: var(--card); color: var(--fg-2); }
.prose blockquote > :first-child { margin-top: 0; } .prose blockquote > :last-child { margin-bottom: 0; }
.prose code { font-family: var(--mono); font-size: .9em; color: var(--accent-fg); }
.prose pre { margin: 20px 0; padding: 14px 18px; overflow-x: auto; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--code-bg); font: 13px/20px var(--mono); }
.prose pre code { color: var(--fg); font-size: inherit; }
.table-wrap { margin: 20px 0; overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 21px; }
.prose th { text-align: left; font-weight: 500; color: var(--fg); padding: 8px 12px 12px 0; border-bottom: 1px solid var(--line-2); }
.prose td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose img { border-radius: var(--radius-sm); }
.prose .anchor { margin-left: 8px; color: var(--fg-4); text-decoration: none; opacity: 0; font-weight: 400; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose .anchor:focus { opacity: 1; }

.block { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); }
.block h2 { margin: 0 0 8px; font-size: 18px; line-height: 26px; font-weight: 500; color: var(--fg); }

/* "Still need help?" */
.help { margin-top: 48px; padding: 28px; border-radius: var(--radius); background: var(--card); }
.help h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 18px; line-height: 26px; font-weight: 500; color: var(--fg); }
.help p { margin: 10px 0 0; color: var(--fg-3); }
.help-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.help-row { padding: 16px; border-radius: var(--radius-sm); background: var(--bg); }
.help-row .k { font-size: 12px; color: var(--fg-3); }
.help-row a { display: block; margin-top: 4px; font-weight: 500; color: var(--fg); word-break: break-all; }
.help-row a:hover { color: var(--accent-fg); }
.help-row .k2 { margin-top: 6px; font-size: 12px; line-height: 18px; color: var(--fg-3); }

/* ---------------------------------------------------------------- search page */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip { height: 30px; padding: 0 12px; border: 1px solid var(--pill-line); border-radius: 999px; background: none; color: var(--fg-3); font: 500 12px var(--sans); cursor: pointer; }
.chip:hover { color: var(--fg); }
.chip.on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-fg); }
.search-status { margin: 24px 0 8px; font-size: 13px; color: var(--fg-3); }
.results { display: flex; flex-direction: column; }
.sr { display: flex; flex-direction: column; gap: 2px; padding: 16px 4px; border-bottom: 1px solid var(--line); }
.sr:hover .sr-title, .sr:focus .sr-title { text-decoration: underline dotted; text-underline-offset: 4px; }
.sr-title { font-size: 15px; font-weight: 500; color: var(--fg); }
.sr-meta { font-size: 12px; color: var(--accent-fg); }
.sr-desc { font-size: 13px; line-height: 20px; color: var(--fg-3); }
mark { background: var(--mark-bg); color: inherit; border-radius: 3px; padding: 0 1px; }
.empty { padding: 20px 0; color: var(--fg-3); }
.empty a { color: var(--fg); font-weight: 500; }

/* ---------------------------------------------------------------- 404 */
.nf { padding: 96px 0 40px; text-align: center; }
.nf .code { font: 500 14px var(--mono); color: var(--accent-fg); }
.nf h1 { margin: 12px 0 0; font-size: 40px; font-weight: 450; color: var(--fg); letter-spacing: -.015em; }

/* ---------------------------------------------------------------- footer */
.footer { margin-top: 64px; padding: 48px 0 40px; border-top: 1px solid var(--line); font-size: 13px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 32px; }
.foot-grid h2 { margin: 0 0 12px; font-size: 13px; font-weight: 500; color: var(--fg); }
.foot-grid ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.foot-grid a { color: var(--fg-3); }
.foot-grid a:hover { color: var(--fg); }
.foot-brand p { margin: 12px 0 0; max-width: 300px; color: var(--fg-3); }
.foot-bottom { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--fg-4); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1000px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .aside { position: static; }
  .nav { display: none; }
  .menu { display: block; }
  .top-right { margin-left: auto; }
  .foot-grid { grid-template-columns: repeat(3, 1fr); }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .topbar .wrap { gap: 8px; }
  .brand .sub { display: none; }
  .search-pill { width: 36px; padding: 0; justify-content: center; border-color: transparent; }
  .search-pill .lbl, .search-pill .kbd { display: none; }
  .top-right .btn { display: none; }
  .hero { padding: 48px 0 24px; }
  .hero h1 { font-size: 34px; }
  .page-title { font-size: 30px; }
  .grid, .cols-2, .help-rows { grid-template-columns: minmax(0, 1fr); }
  .field { height: 48px; }
  .field button { display: none; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
  .help { padding: 20px; }
}
@media print { .topbar, .footer, .help, .aside, .hero-search { display: none !important; } }
.nf-desc { margin-left: auto; margin-right: auto; }
input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
@media (max-width: 640px) { .list .lm { display: none; } }
