/* HIVE docs theme. Tokens follow the ClerkTree brand tokens (clerktree.com/brand, public/brand/tokens.css of the
   Frontend repository); fonts are self-hosted copies of the same files (DX-DOCS-R-001: no third-party hosts). */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/assets/fonts/inter-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/assets/fonts/inter-latin-ext.woff2) format("woff2"); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Cal Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/cal-sans-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cal Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/cal-sans-latin-ext.woff2) format("woff2"); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/assets/fonts/geist-latin.woff2) format("woff2"); }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/assets/fonts/geist-mono-latin.woff2) format("woff2"); }

:root {
  --ink: #0a0a0a; --muted: #555; --border: #c8c8c8; --hair: #e2e2e2; --canvas: #f4f4f4; --sunken: #ededed; --surface: #fff;
  --signal: #ff4d00; --link: #0a0a0a; --code-bg: #f1f1f1; --pre-bg: #0d0d0e; --pre-ink: #e8e9eb;
  --display: "Cal Sans", "Inter", system-ui, sans-serif; --text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ui: "Geist", "Inter", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --r-pill: 999px; --r-control: 14px; --r-card: 24px; --r-stage: 34px; --pad: 20px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8e9eb; --muted: #9b9ca1; --border: #3b3b41; --hair: #26262a; --canvas: #0d0d0e; --sunken: #131315; --surface: #19191b;
    --link: #fff; --code-bg: #26262a; --pre-bg: #0b0b0c; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--canvas); color: var(--ink); font: 400 16px/26px var(--text); margin: 0; padding: var(--pad) var(--pad) 0; }
a { color: var(--link); text-decoration-color: color-mix(in srgb, var(--link) 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--signal); }

.top { align-items: center; display: grid; gap: 24px; grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr); margin: 0 auto 20px; max-width: 1320px; min-height: 52px; padding: 0 14px; }
.brand { align-items: center; color: var(--ink); display: inline-flex; gap: 14px; text-decoration: none; }
.lockup { color: var(--ink); display: inline-flex; }
.lockup svg { display: block; height: 22px; width: auto; }
.brand .sep { background: var(--border); height: 22px; width: 1px; }
.brand .product { font: 500 16px/1 var(--ui); letter-spacing: -.02em; }
.brand .product em { color: var(--muted); font-style: normal; font-weight: 400; }
.top nav { display: flex; font: 400 15px/1 var(--ui); gap: 28px; letter-spacing: -.01em; }
.top nav a { color: var(--muted); padding: 8px 0; position: relative; text-decoration: none; transition: color .15s; }
.top nav a:hover, .top nav a[aria-current] { color: var(--ink); }
.top nav a[aria-current]::after { background: var(--signal); border-radius: 2px; bottom: -2px; content: ""; height: 2px; left: 0; position: absolute; right: 0; }
.right { align-items: center; display: flex; gap: 12px; justify-self: end; }
.cta { align-items: center; background: var(--ink); border-radius: var(--r-pill); color: var(--canvas); display: inline-flex; font: 500 14px/1 var(--ui); gap: 8px; padding: 11px 12px 11px 18px; text-decoration: none; transition: opacity .15s; white-space: nowrap; }
.cta svg { height: 14px; width: 14px; }
.cta:hover { opacity: .86; }
.skip { left: -9999px; position: absolute; }
.skip:focus { background: var(--surface); border-radius: 8px; left: 16px; padding: 8px 12px; top: 12px; z-index: 50; }
.search { position: relative; }
.search input { -webkit-appearance: none; appearance: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pill); color: var(--ink); font: 400 14px/20px var(--ui); padding: 9px 36px 9px 16px; transition: border-color .15s, box-shadow .15s; width: 230px; }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { border: 1px solid var(--border); border-radius: 6px; color: var(--muted); font: 500 11px/16px var(--mono); padding: 0 6px; pointer-events: none; position: absolute; right: 12px; top: 10px; }
.search input:focus + kbd { display: none; }
.search input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 8%, transparent); outline: none; }
#results { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-control); box-shadow: 0 24px 48px -16px rgba(0,0,0,.25); list-style: none; margin: 8px 0 0; max-height: 70vh; overflow: auto; padding: 6px; position: absolute; right: 0; width: min(440px, 90vw); z-index: 20; }
#results li a { border-radius: 10px; display: block; padding: 8px 10px; text-decoration: none; }
#results li a:hover, #results li a:focus { background: var(--sunken); outline: none; }
#results small { color: var(--muted); display: block; font-size: 12px; line-height: 18px; }

main { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-stage); margin: 0 auto; max-width: 1320px; min-height: 60vh; padding: clamp(24px, 5vw, 64px) clamp(20px, 6vw, 88px); }
main.has-toc { column-gap: 56px; display: grid; grid-template-columns: minmax(0, 1fr) 220px; }
article { min-width: 0; }
article > * { max-width: 920px; }
article > .table, article > section, article > .cards { max-width: none; }
.toc { align-self: start; font: 400 13.5px/20px var(--ui); position: sticky; top: 24px; }
.toc p { color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: .12em; margin: 6px 0 12px; text-transform: uppercase; }
.toc ol { border-left: 1px solid var(--hair); list-style: none; margin: 0; padding: 0; }
.toc a { border-left: 2px solid transparent; color: var(--muted); display: block; margin-left: -1px; padding: 5px 0 5px 14px; text-decoration: none; }
.toc a:hover, .toc a.on { border-left-color: var(--signal); color: var(--ink); }
.anchor { color: var(--border); font-family: var(--ui); margin-left: .35em; opacity: 0; text-decoration: none; transition: opacity .15s; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; }
h2, h3 { scroll-margin-top: 24px; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 400; letter-spacing: -.01em; }
h1 { font-size: clamp(34px, 4.4vw, 56px); line-height: 1.04; margin: 0 0 24px; }
h2 { border-top: 1px solid var(--hair); font-size: 28px; line-height: 34px; margin: 48px 0 14px; padding-top: 28px; }
h3 { font-size: 21px; line-height: 28px; margin: 32px 0 10px; }
h1 code, h2 code, h3 code { background: none; font-size: .86em; padding: 0; }
.lead { color: var(--muted); font-size: 18px; line-height: 30px; }
p, li { color: var(--ink); }
code { background: var(--code-bg); border-radius: 6px; font: .88em/1.4 var(--mono); padding: .12em .38em; }
.code { background: var(--pre-bg); border: 1px solid #1f1f22; border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 12px 32px -12px rgba(0,0,0,.35); margin: 20px 0; overflow: hidden; }
.code-head { align-items: center; background: #111113; border-bottom: 1px solid #222226; color: #8b8c92; display: flex; font: 500 12.5px/1 var(--ui); gap: 8px; min-height: 42px; padding: 8px 8px 8px 16px; }
.copy { -webkit-appearance: none; appearance: none; background: transparent; border: 1px solid #2c2c31; border-radius: 7px; color: #b8b9be; cursor: pointer; font: 500 12px/1 var(--ui); margin-left: auto; padding: 6px 10px; transition: background .15s, color .15s; }
.copy:hover { background: #1f1f23; color: #fff; }
.copy.done { border-color: #1c6b3a; color: #8fd8a8; }
pre { background: var(--pre-bg); color: var(--pre-ink); margin: 0; overflow: auto; padding: 16px 18px; }
.t-k { color: #9dbcf2; } .t-s { color: #ffb68a; } .t-n { color: #c7a6ff; } .t-b { color: #8fd8a8; } .t-c { color: #6c6d73; }
pre code { background: none; color: inherit; font-size: 13.5px; line-height: 21px; padding: 0; }
blockquote { border-left: 3px solid var(--signal); color: var(--muted); margin: 18px 0; padding: 2px 0 2px 18px; }
hr { border: 0; border-top: 1px solid var(--hair); margin: 36px 0; }

.table { margin: 18px 0; overflow-x: auto; }
table { border-collapse: collapse; font-size: 14.5px; line-height: 22px; width: 100%; }
th, td { border-bottom: 1px solid var(--hair); padding: 9px 12px; text-align: left; vertical-align: top; }
thead th { border-bottom: 1px solid var(--border); color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
tbody th { color: var(--muted); font-weight: 500; white-space: nowrap; width: 1%; }

.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin: 32px 0; max-width: none; }
.card { background: var(--canvas); border: 1px solid var(--hair); border-radius: var(--r-card); color: var(--ink); display: flex; flex-direction: column; gap: 8px; padding: 22px; text-decoration: none; transition: border-color .15s; }
.card:hover { border-color: var(--ink); }
.card strong { font: 400 21px/26px var(--display); }
.card span { color: var(--muted); font-size: 14.5px; line-height: 22px; }
.note, .crumb { color: var(--muted); font-size: 14px; }
ul.index { padding-left: 18px; }
.lang { border: 1px solid var(--border); border-radius: var(--r-pill); color: var(--muted); font-size: 11px; padding: 1px 7px; }

.op { border-top: 1px solid var(--hair); margin-top: 40px; }
.op h2 { border: 0; font-size: 22px; margin-top: 28px; padding-top: 0; }
.m { border-radius: var(--r-pill); display: inline-block; font: 500 11px/18px var(--mono); letter-spacing: .04em; min-width: 54px; padding: 1px 8px; text-align: center; vertical-align: 2px; }
.m-get { background: #e4f1e8; color: #1c6b3a; } .m-post { background: #fff0e6; color: #a83a00; } .m-put, .m-patch { background: #e8eef9; color: #1f4c99; } .m-delete { background: #fbe9e9; color: #a32020; }
@media (prefers-color-scheme: dark) {
  .m-get { background: #15301f; color: #8fd8a8; } .m-post { background: #3a1d0b; color: #ffab7a; } .m-put, .m-patch { background: #172440; color: #9dbcf2; } .m-delete { background: #3b1414; color: #f29a9a; }
}

@media (max-width: 900px) {
  body { padding: 12px; }
  .top { display: flex; flex-wrap: wrap; gap: 12px 18px; justify-content: space-between; }
  .top nav { order: 3; overflow-x: auto; width: 100%; }
  .search input { width: 150px; }
  .cta { display: none; }
  main.has-toc { display: block; }
  .toc { display: none; }
  .brand .sep, .brand .product em { display: none; }

  main { border-radius: 24px; }
}

/* ---------- API reference ---------- */
main.page:has(.ref) { padding: 0; }
main:has(.ref) > article > * { max-width: none; }
.ref { display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.refnav { align-self: start; border-right: 1px solid var(--hair); font: 400 13.5px/20px var(--ui); max-height: 100vh; overflow-y: auto; padding: 40px 18px 40px 28px; position: sticky; top: 0; }
.refnav-top { color: var(--ink); display: block; font-weight: 500; margin-bottom: 18px; text-decoration: none; }
.refnav p { margin: 22px 0 6px; }
.refnav p a { color: var(--ink); font-weight: 500; text-decoration: none; }
.refnav ul { list-style: none; margin: 0; padding: 0; }
.refnav li a { align-items: center; border-radius: 8px; color: var(--muted); display: flex; gap: 8px; padding: 4px 8px 4px 0; text-decoration: none; }
.refnav li a:hover, .refnav li a.on { color: var(--ink); }
.refnav .m { flex: none; font-size: 9.5px; line-height: 15px; min-width: 38px; padding: 0 4px; }
.ref-main { min-width: 0; padding: clamp(24px, 4vw, 56px) clamp(20px, 4vw, 56px) 64px; }
.ref-intro h1 { margin-top: 0; }
.ref-facts { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 28px 0; }
.ref-facts > div { background: var(--canvas); border: 1px solid var(--hair); border-radius: var(--r-card); padding: 18px 20px; }
.ref-facts h3 { font-size: 18px; margin: 0 0 6px; }
.ref-facts p { color: var(--muted); font-size: 14.5px; line-height: 22px; margin: 0; }
.ref-dl { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { background: var(--ink); border-radius: var(--r-pill); color: var(--canvas); font: 500 14px/1 var(--ui); padding: 11px 18px; text-decoration: none; }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--ink); }
h2.ref-group { border-top: 1px solid var(--hair); font-size: 34px; line-height: 40px; margin: 72px 0 0; padding-top: 40px; }
.op { border-top: 1px solid var(--hair); column-gap: 48px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-top: 40px; padding-top: 40px; scroll-margin-top: 16px; }
h2.ref-group + .op { border-top: 0; margin-top: 8px; }
.op-doc h3 { font-size: 24px; line-height: 30px; margin: 0 0 10px; }
.op-doc h4 { border-bottom: 1px solid var(--hair); color: var(--ink); font: 600 13px/18px var(--ui); letter-spacing: .02em; margin: 28px 0 0; padding-bottom: 8px; }
.op-doc p { font-size: 15.5px; line-height: 25px; }
.endpoint { align-items: center; display: flex; gap: 10px; margin: 0 0 14px; }
.endpoint code { background: none; font-size: 14px; padding: 0; }
.op-code { align-self: start; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 20px; }
.op-code .code { margin: 0; }
.op-code pre { max-height: 520px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; }
.pill { background: var(--canvas); border: 1px solid var(--hair); border-radius: var(--r-pill); color: var(--muted); font: 500 12px/18px var(--ui); padding: 3px 10px; }
.pill code { background: none; font-size: 11.5px; padding: 0; }
.pill.warn { background: color-mix(in srgb, var(--signal) 8%, var(--surface)); border-color: color-mix(in srgb, var(--signal) 30%, transparent); color: color-mix(in srgb, var(--signal) 75%, var(--ink)); }
.fields { margin: 0; }
.fields > div { border-bottom: 1px solid var(--hair); padding: 12px 0; }
.fields dt { align-items: baseline; display: flex; flex-wrap: wrap; gap: 8px; }
.fields dt code { background: none; font-size: 13.5px; font-weight: 600; padding: 0; }
.ftype { color: var(--muted); font: 400 12.5px/18px var(--ui); }
.req { color: var(--signal); font: 500 11px/18px var(--ui); letter-spacing: .04em; text-transform: uppercase; }
.fields dd { color: var(--muted); font-size: 14px; line-height: 22px; margin: 4px 0 0; }
.fields dd code { font-size: 12.5px; }
.errs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.errs a { align-items: center; border: 1px solid var(--border); border-radius: 8px; color: var(--ink); display: inline-flex; gap: 6px; padding: 3px 9px; text-decoration: none; transition: border-color .15s, background .15s; }
.errs a::before { background: #e5484d; border-radius: 50%; content: ""; height: 6px; width: 6px; }
.errs a:hover { background: var(--canvas); border-color: var(--ink); }
.errs code { background: none; font-size: 12px; padding: 0; }
.tablist { align-self: stretch; display: flex; gap: 18px; margin: -8px 0 -9px; }
.tablist button { -webkit-appearance: none; appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: #8b8c92; cursor: pointer; font: 500 12.5px/1 var(--ui); margin: 0; padding: 13px 0 11px; transition: color .15s, border-color .15s; }
.tablist button:hover { color: #e8e9eb; }
.tablist button[aria-selected="true"] { border-bottom-color: var(--signal); color: #fff; }
.tablist button:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.code-head .status { align-items: center; background: rgba(48, 164, 108, .12); border: 1px solid rgba(48, 164, 108, .3); border-radius: 999px; color: #8fd8a8; display: inline-flex; font: 500 11.5px/1 var(--mono); gap: 6px; margin-left: 10px; margin-right: auto; padding: 4px 9px; }
.code-head .status::before { background: #30a46c; border-radius: 50%; content: ""; height: 6px; width: 6px; }
.code-head > span:first-child { color: #c9cacf; }
@media (max-width: 1180px) {
  .op { grid-template-columns: minmax(0, 1fr); row-gap: 20px; }
  .op-code { position: static; }
}
@media (max-width: 900px) {
  .ref-facts { grid-template-columns: 1fr; }
  .ref { display: block; }
  .refnav { display: none; }
}

.quick { align-items: start; border-top: 1px solid var(--hair); column-gap: 48px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); margin-top: 48px; padding-top: 40px; }
article > .quick { max-width: none; }
.quick h2 { border: 0; margin-top: 0; padding-top: 0; }
.quick .code { margin: 0; }
.quick .btn { display: inline-block; margin: 6px 6px 0 0; }
@media (max-width: 1000px) { .quick { grid-template-columns: minmax(0, 1fr); row-gap: 24px; } }

/* Nothing may widen the page on a phone: grid and flex children can shrink, code scrolls inside its panel. */
.op-doc, .op-code, .ref-main, .quick > *, article { min-width: 0; }
.code, .code pre { max-width: 100%; }
p code, li code, dd code, td code { overflow-wrap: anywhere; }
html, body { overflow-x: clip; }
@media (max-width: 640px) {
  body { padding: 8px 8px 0; }
  main { border-radius: 20px; }
  .ref-main { padding: 24px 16px 48px; }
  main.page { padding: 24px 16px; }
  main.page:has(.ref) { padding: 0; }
  h1 { font-size: 34px; }
  h2.ref-group { font-size: 28px; margin-top: 48px; padding-top: 28px; }
  .op { margin-top: 28px; padding-top: 28px; }
  .code-head { padding-left: 12px; }
  .tablist { gap: 14px; }
  pre { padding: 14px; }
  pre code { font-size: 12.5px; line-height: 19px; }
  .top { padding: 4px 6px 0; }
  .search input { width: 100%; }
  .right { flex: 1; justify-self: stretch; }
  .search { flex: 1; }
  .brand .lockup svg { height: 19px; }
  .top nav { gap: 20px; }
}
