/* harbor0 API docs. Colors and type follow the harbor0 apps' tokens. */
@font-face { font-family: 'Geist'; src: url(/fonts/geist-latin-wght-normal.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url(/fonts/geist-mono-latin-wght-normal.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --background: #ffffff; --foreground: #16181d; --muted: #5d6270; --subtle: #f6f7f9;
  --primary: #4353d9; --border: #e8eaee; --code-bg: #f7f8fa; --inline-code: #f0f1f4;
  --get: #15803d; --post: #4353d9; --patch: #b45309; --put: #0e9384; --delete: #d33b3b;
  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --header: 64px;
  color-scheme: light;
}
.dark {
  --background: #141518; --foreground: #eceef1; --muted: #9aa0ad; --subtle: #1b1d21;
  --primary: #8793ff; --border: #26292f; --code-bg: #191b1f; --inline-code: #23262c;
  --get: #52c987; --post: #8793ff; --patch: #e5a949; --put: #3fd0c0; --delete: #f26d6d;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header) + 24px); }
body { margin: 0; background: var(--background); color: var(--foreground); font: 17px/1.75 var(--font-sans); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Header */
.top { position: sticky; top: 0; z-index: 10; height: var(--header); display: flex; align-items: center; gap: 16px; padding: 0 32px; background: color-mix(in srgb, var(--background) 90%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--foreground); font-weight: 600; font-size: 18px; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 7px; background: #16181d; }
.brand-sub { color: var(--muted); font-weight: 500; padding-left: 10px; border-left: 1px solid var(--border); }
.beta { font-size: 12px; font-weight: 600; line-height: 1; padding: 5px 8px; border-radius: 999px; color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); }
.beta-note { max-width: 760px; margin: 0 0 32px; padding: 12px 16px; font-size: 15px; line-height: 1.6; color: var(--muted); background: var(--subtle); border: 1px solid var(--border); border-radius: 10px; }
.beta-note strong { color: var(--foreground); }
.top-links { margin-left: auto; display: flex; align-items: center; gap: 28px; font-size: 15px; }
.top-links a { color: var(--muted); }
.top-links a:hover { color: var(--foreground); text-decoration: none; }
.theme, .menu { border: 1px solid var(--border); background: none; color: var(--foreground); border-radius: 8px; width: 36px; height: 36px; cursor: pointer; font-size: 16px; }
.menu { display: none; }

/* Layout */
.shell { display: grid; grid-template-columns: 300px minmax(0, 1fr) 240px; max-width: 1520px; margin: 0 auto; }
.sidebar { position: sticky; top: var(--header); height: calc(100vh - var(--header)); overflow-y: auto; padding: 32px 16px 48px 24px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.content { min-width: 0; padding: 56px 64px 120px; }
article { max-width: 760px; }

/* Sidebar */
.nav-group + .nav-group { margin-top: 28px; }
.nav-group p { margin: 0 0 8px 12px; font-size: 13px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.nav-group ul { list-style: none; margin: 0; padding: 0; }
.nav-group li { margin: 1px 0; }
.nav-group a { display: block; padding: 6px 12px; border-radius: 8px; color: var(--foreground); font-size: 15.5px; line-height: 1.45; }
.nav-group a:hover { background: var(--subtle); text-decoration: none; }
.nav-group a[aria-current='page'] { background: color-mix(in srgb, var(--primary) 11%, transparent); color: var(--primary); font-weight: 500; }

/* On this page */
.toc { position: sticky; top: var(--header); height: calc(100vh - var(--header)); overflow-y: auto; padding: 56px 24px 40px 8px; font-size: 14px; line-height: 1.5; }
.toc p { margin: 0 0 12px; font-size: 13px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 8px 0; }
.toc li.d3 { padding-left: 14px; }
.toc a { color: var(--muted); }
.toc a:hover, .toc a.active { color: var(--primary); text-decoration: none; }

/* Prose */
h1 { font-size: 42px; line-height: 1.15; letter-spacing: -0.025em; font-weight: 650; margin: 0 0 24px; }
h1 + p { font-size: 19px; line-height: 1.7; color: var(--muted); margin-bottom: 40px; }
h2 { font-size: 28px; line-height: 1.3; letter-spacing: -0.015em; font-weight: 620; margin: 72px 0 18px; }
h3 { font-size: 20px; line-height: 1.4; font-weight: 600; margin: 48px 0 14px; }
h4 { font-size: 17px; margin: 32px 0 10px; }
h2 a.anchor, h3 a.anchor { color: inherit; }
h2 a.anchor:hover, h3 a.anchor:hover { text-decoration: none; }
h2 a.anchor:hover::after, h3 a.anchor:hover::after { content: ' #'; color: var(--muted); font-weight: 400; }
p, ul, ol { margin: 0 0 22px; }
ul, ol { padding-left: 24px; }
li { margin: 8px 0; }
li > p { margin-bottom: 10px; }
code { font-family: var(--font-mono); font-size: 0.84em; background: var(--inline-code); padding: 2px 6px; border-radius: 5px; overflow-wrap: anywhere; }
a code { color: var(--primary); }
strong { font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--border); margin: 56px 0; }
blockquote { margin: 0 0 24px; padding: 4px 20px; border-left: 3px solid var(--primary); color: var(--muted); }

/* Code */
.code { position: relative; margin: 0 0 28px; }
.code pre { margin: 0; padding: 20px 24px; border-radius: 12px; background: var(--code-bg) !important; overflow-x: auto; font: 14.5px/1.7 var(--font-mono); }
.code pre code { background: none; padding: 0; font-size: inherit; overflow-wrap: normal; }
.dark .shiki, .dark .shiki span { color: var(--shiki-dark) !important; }
.copy { position: absolute; top: 10px; right: 10px; opacity: 0; transition: opacity 120ms; font: 13px var(--font-sans); padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--background); color: var(--muted); cursor: pointer; }
.code:hover .copy, .copy:focus { opacity: 1; }
.file-name { margin: 0 0 8px; font: 14px var(--font-mono); color: var(--muted); }

.tabs { margin: 0 0 28px; }
.tab-list { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tab-list button { font: 500 15px var(--font-sans); background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 8px 14px; color: var(--muted); cursor: pointer; }
.tab-list button:hover { color: var(--foreground); }
.tab-list button[aria-selected='true'] { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel .code { margin: 0; }

/* Tables: rules between rows only, no box. */
.table { overflow-x: auto; margin: 0 0 32px; }
table { border-collapse: collapse; width: 100%; font-size: 15.5px; line-height: 1.6; }
th, td { text-align: left; padding: 12px 16px 12px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 600; font-size: 14px; color: var(--muted); border-bottom-color: color-mix(in srgb, var(--foreground) 18%, transparent); }
td:last-child, th:last-child { padding-right: 0; }
td code { white-space: nowrap; }
td:last-child code { white-space: normal; }

/* Reference: method badges on route headings. */
.method { display: inline-block; min-width: 64px; text-align: center; font: 600 12.5px/24px var(--font-mono); border-radius: 6px; margin-right: 12px; color: #fff; vertical-align: 2px; }
.dark .method { color: #111; }
h3 .method + code { font-size: 0.9em; background: none; padding: 0; }

/* Pager */
.pager { max-width: 760px; display: flex; justify-content: space-between; gap: 20px; margin-top: 96px; }
.pager a { display: flex; flex-direction: column; gap: 4px; padding: 18px 22px; border: 1px solid var(--border); border-radius: 12px; color: var(--foreground); font-weight: 500; font-size: 16px; min-width: 240px; }
.pager a:hover { border-color: var(--primary); text-decoration: none; }
.pager a span { font-size: 13px; color: var(--muted); font-weight: 400; }
.pager .next { text-align: right; margin-left: auto; }

@media (max-width: 1320px) { .shell { grid-template-columns: 270px minmax(0, 1fr); } .toc { display: none; } .content { padding: 48px 56px 100px; } }
@media (max-width: 900px) {
  body { font-size: 16.5px; }
  .shell { grid-template-columns: 1fr; }
  .top { padding: 0 20px; }
  .menu { display: block; }
  .sidebar { display: none; position: fixed; inset: var(--header) 0 0 0; height: auto; background: var(--background); z-index: 9; }
  body.nav-open .sidebar { display: block; }
  .content { padding: 36px 22px 72px; }
  .top-links a:not(:first-child) { display: none; }
  h1 { font-size: 32px; }
  h2 { font-size: 24px; margin-top: 56px; }
  .pager a { min-width: 0; }
}

/* Reference: object names in type blocks link to their definitions. */
.code pre a.type-link { color: var(--primary); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--primary) 40%, transparent); text-underline-offset: 3px; }
.code pre a.type-link:hover { text-decoration-color: var(--primary); }
:target { animation: target-flash 1.6s ease-out; }
@keyframes target-flash { from { background: color-mix(in srgb, var(--primary) 14%, transparent); } to { background: transparent; } }

/* Sidebar: the reference's objects, each a tree of the routes that return it. */
.nav-group .nav-sub-title { margin: 14px 0 4px 12px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; }
.nav-sub { list-style: none; margin: 0 0 0 12px; padding: 0; }
.nav-sub > li { margin: 1px 0; }
.nav-sub summary { display: flex; align-items: center; gap: 4px; list-style: none; cursor: pointer; border-radius: 8px; padding-left: 6px; }
.nav-sub summary::-webkit-details-marker { display: none; }
.nav-sub summary::before { content: ''; width: 6px; height: 6px; flex: none; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); transition: transform 120ms; margin: 0 6px 0 2px; }
.nav-sub details[open] > summary::before { transform: rotate(45deg); }
.nav-sub summary:hover { background: var(--subtle); }
.nav-group .nav-sub summary a { flex: 1; padding: 5px 6px; font-size: 15px; }
.nav-group .nav-sub summary a:hover { background: none; }
.nav-sub .count { font-size: 12.5px; color: var(--muted); padding: 0 10px; }
.nav-sub code { background: none; padding: 0; font-size: 14.5px; }
.nav-routes { list-style: none; margin: 4px 0 10px 12px; padding: 0 0 0 6px; border-left: 1px solid var(--border); }
.nav-routes li { margin: 1px 0; }
.nav-group .nav-routes a { display: flex; align-items: baseline; gap: 8px; padding: 4px 6px; font-size: 13.5px; }
.nav-routes code { font-size: 12.5px; line-height: 1.5; overflow-wrap: normal; color: var(--foreground); }
.nav-routes .m { flex: none; width: 40px; font: 600 10.5px/18px var(--font-mono); text-align: center; border-radius: 4px; color: #fff; }
.m-get { background: var(--get); } .m-post { background: var(--post); } .m-patch { background: var(--patch); } .m-put { background: var(--put); } .m-delete { background: var(--delete); }
.dark .nav-routes .m { color: #111; }
.nav-group .nav-sub a.active { background: color-mix(in srgb, var(--primary) 11%, transparent); }
.nav-group .nav-sub a.active code { color: var(--primary); }
