/* docs.queueflow.dev — shares the palette of queueflow.dev */
:root {
  --bg: #0b0d11;
  --bg-2: #11141a;
  --bg-3: #171b23;
  --line: #232935;
  --line-2: #313947;
  --text: #e8ebf0;
  --muted: #9aa3b2;
  --dim: #6b7384;
  --accent: #34d399;
  --accent-2: #a7f3d0;
  --accent-dim: rgba(52, 211, 153, 0.12);
  --blue: #7dd3fc;
  --yellow: #fcd34d;
  --purple: #c4b5fd;
  --red: #fda4af;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --top-h: 60px;
  --side-w: 260px;
  --toc-w: 220px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top-h) + 20px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
code, pre, kbd { font-family: var(--mono); }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--accent); color: #06201a; padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }

/* top bar */
.top {
  position: sticky; top: 0; z-index: 30; height: var(--top-h);
  background: rgba(11, 13, 17, 0.88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-inner { display: flex; align-items: center; gap: 18px; height: 100%; padding: 0 24px; max-width: 1480px; margin: 0 auto; }
.menu { display: none; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; width: 36px; height: 36px; padding: 0; cursor: pointer; }
.menu svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 17px; letter-spacing: -0.01em; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; color: var(--text); }
.brand svg { width: 26px; height: 26px; }
.brand-docs { color: var(--dim); font-weight: 500; margin-left: -4px; }
.search { position: relative; flex: 1; max-width: 420px; margin-left: auto; }
.search input {
  width: 100%; height: 36px; padding: 0 40px 0 12px; border-radius: 8px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 14px;
}
.search input:focus { outline: none; border-color: var(--accent); }
.search kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 11.5px; color: var(--dim); background: var(--bg-3); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 6px; pointer-events: none;
}
.search-results {
  position: absolute; top: 44px; left: 0; right: 0; max-height: min(70vh, 520px); overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5); padding: 6px;
}
.search-results a { display: block; padding: 9px 12px; border-radius: 7px; color: var(--text); }
.search-results a:hover, .search-results a.active { background: var(--bg-3); text-decoration: none; }
.search-results .r-title { font-weight: 600; font-size: 14px; }
.search-results .r-title small { color: var(--dim); font-weight: 400; margin-left: 8px; }
.search-results .r-snippet { color: var(--muted); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results .r-snippet mark, .search-results .r-title mark { background: var(--accent-dim); color: var(--accent-2); border-radius: 2px; padding: 0 1px; }
.search-results .empty { padding: 12px; color: var(--dim); font-size: 14px; }
.top-links { display: flex; gap: 22px; font-size: 14.5px; color: var(--muted); white-space: nowrap; }
.top-links a { color: var(--muted); }
.top-links a:hover { color: var(--text); text-decoration: none; }
.top-links .gh { display: inline-flex; align-items: center; gap: 6px; }
.top-links .gh svg { width: 16px; height: 16px; fill: currentColor; }

/* layout */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr) var(--toc-w); max-width: 1480px; margin: 0 auto; }
.sidebar {
  position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto;
  padding: 28px 16px 40px 24px; border-right: 1px solid var(--line); font-size: 14px;
}
.nav-section + .nav-section { margin-top: 22px; }
.nav-title { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); margin: 0 0 8px 10px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a {
  display: block; padding: 6px 10px; border-radius: 6px; color: var(--muted);
  border-left: 2px solid transparent; margin-left: -2px;
}
.sidebar li a:hover { color: var(--text); background: var(--bg-2); text-decoration: none; }
.sidebar li a[aria-current="page"] { color: var(--accent); background: var(--accent-dim); }
.main { min-width: 0; padding: 40px 56px 80px; }
.doc { max-width: 780px; }
.crumb { font-family: var(--mono); font-size: 12.5px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 10px; }
h1 { font-size: clamp(30px, 3.6vw, 40px); line-height: 1.12; letter-spacing: -0.028em; margin: 0 0 14px; font-weight: 700; }
.lede { font-size: 17.5px; color: var(--muted); margin: 0 0 32px; }
h2 { font-size: 24px; letter-spacing: -0.02em; margin: 48px 0 14px; padding-top: 24px; border-top: 1px solid var(--line); font-weight: 650; }
h3 { font-size: 18px; letter-spacing: -0.01em; margin: 32px 0 10px; font-weight: 650; }
h4 { font-size: 14px; margin: 22px 0 8px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
h2 .anchor, h3 .anchor, h4 .anchor { float: left; margin-left: -1.1em; width: 1.1em; color: var(--dim); opacity: 0; font-weight: 400; }
h2:hover .anchor, h3:hover .anchor, h4:hover .anchor { opacity: 1; }
.anchor:hover { color: var(--accent); text-decoration: none; }
p, ul, ol { margin: 0 0 16px; }
li { margin-bottom: 6px; }
li > ul, li > ol { margin-top: 6px; margin-bottom: 0; }
strong { font-weight: 650; color: var(--text); }
hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
img { max-width: 100%; }
p code, li code, td code, h1 code, h2 code, h3 code, .type code, .op-id code {
  font-size: 0.88em; background: var(--bg-3); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; color: var(--accent-2);
}
h1 code, h2 code, h3 code { font-size: 0.85em; padding: 1px 8px; }
blockquote { margin: 0 0 16px; padding: 2px 0 2px 18px; border-left: 3px solid var(--line-2); color: var(--muted); }
blockquote p:last-child { margin-bottom: 0; }

/* callouts */
.callout { margin: 0 0 18px; padding: 14px 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); }
.callout p:last-child { margin-bottom: 0; }
.callout p:first-child strong:first-child { display: block; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.callout-note { border-color: rgba(125, 211, 252, 0.3); }
.callout-note p:first-child strong:first-child { color: var(--blue); }
.callout-tip { border-color: rgba(52, 211, 153, 0.3); }
.callout-tip p:first-child strong:first-child { color: var(--accent); }
.callout-warning { border-color: rgba(252, 211, 77, 0.35); }
.callout-warning p:first-child strong:first-child { color: var(--yellow); }

/* code blocks */
.code { position: relative; margin: 0 0 18px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-size: 13.25px; line-height: 1.62; color: #d6dbe4; tab-size: 2; }
.code code { font-family: var(--mono); }
.code-lang { position: absolute; top: 0; left: 0; font-family: var(--mono); font-size: 11px; color: var(--dim); padding: 4px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); border-bottom-right-radius: 8px; background: var(--bg-3); }
.code .copy { position: absolute; top: 8px; right: 8px; font: 12px var(--sans); color: var(--muted); background: var(--bg-3); border: 1px solid var(--line); border-radius: 6px; padding: 3px 9px; cursor: pointer; opacity: 0; transition: opacity .15s; }
.code:hover .copy, .code .copy:focus { opacity: 1; }
.code .copy:hover { color: var(--text); border-color: var(--line-2); }
.code .copy.done { color: var(--accent); border-color: rgba(52, 211, 153, 0.4); }
.code-lang ~ pre { padding-top: 34px; }

/* highlight.js theme mapped to site colors */
.hljs { background: transparent; color: #d6dbe4; }
.hljs-comment, .hljs-quote { color: var(--dim); font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-built_in, .hljs-type, .hljs-section, .hljs-meta { color: var(--blue); }
.hljs-string, .hljs-attr, .hljs-template-tag, .hljs-addition, .hljs-regexp, .hljs-symbol, .hljs-bullet { color: var(--yellow); }
.hljs-title, .hljs-title.function_, .hljs-title.class_, .hljs-name, .hljs-selector-id, .hljs-selector-class { color: var(--purple); }
.hljs-number, .hljs-variable, .hljs-template-variable, .hljs-deletion, .hljs-link { color: var(--red); }
.hljs-attribute, .hljs-params, .hljs-punctuation, .hljs-operator, .hljs-property { color: #d6dbe4; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 600; }
.language-bash .hljs-built_in, .language-sh .hljs-built_in { color: var(--purple); }
.language-json .hljs-attr { color: var(--blue); }
.language-json .hljs-string { color: var(--yellow); }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--bg-3); font-weight: 600; color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.05em; }
tbody tr:last-child td { border-bottom: 0; }
td p { margin: 0; }
td code { white-space: nowrap; }
.props td.type, .props .type { font-family: var(--mono); font-size: 12.75px; color: var(--muted); }
.props td.type code { white-space: normal; }
.req { display: inline-block; margin-left: 8px; font-family: var(--mono); font-size: 10.5px; color: var(--yellow); text-transform: uppercase; letter-spacing: 0.06em; }
.dim { color: var(--dim); }
.pill { display: inline-block; font-family: var(--mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; margin-left: 8px; }

/* API reference */
.endpoints td:first-child { width: 1%; }
.endpoints td:last-child { font-family: var(--mono); font-size: 12.5px; color: var(--dim); }
.method { display: inline-block; font-family: var(--mono); font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; padding: 2px 7px; border-radius: 5px; min-width: 56px; text-align: center; vertical-align: middle; }
.method-get { color: var(--blue); background: rgba(125, 211, 252, 0.12); }
.method-post { color: var(--accent); background: var(--accent-dim); }
.method-delete { color: var(--red); background: rgba(253, 164, 175, 0.12); }
.method-put, .method-patch { color: var(--yellow); background: rgba(252, 211, 77, 0.12); }
.op { margin-top: 36px; padding-top: 8px; }
.op h3 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 0; }
.op h3 code.path { background: none; border: 0; padding: 0; font-size: 16px; color: var(--text); }
.op-id { font-family: var(--mono); font-size: 12.5px; margin: -4px 0 12px; }
.status { font-weight: 600; }
.status-2 { color: var(--accent); }
.status-4 { color: var(--yellow); }
.status-5 { color: var(--red); }
.schema { margin-top: 32px; }
.schema h3 code { font-size: 15px; }
.schema-ref { font-family: var(--mono); }
.type p { margin: 0 0 10px; }

/* pager and footer */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 56px; }
.pager a { display: block; padding: 14px 18px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); font-weight: 600; background: var(--bg-2); transition: border-color .15s; }
.pager a:hover { border-color: var(--line-2); text-decoration: none; }
.pager a span { display: block; font-size: 12px; color: var(--dim); font-weight: 400; margin-bottom: 2px; }
.pager-next { text-align: right; }
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--dim); max-width: 780px; }
.foot a { color: var(--dim); }
.foot a:hover { color: var(--text); }

/* right toc */
.toc { position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; padding: 40px 24px 40px 8px; font-size: 13px; }
.toc-title { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); margin-bottom: 10px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 4px 0 4px 14px; color: var(--muted); border-left: 2px solid transparent; margin-left: -1px; }
.toc li.toc-3 a { padding-left: 26px; font-size: 12.5px; }
.toc li a:hover { color: var(--text); text-decoration: none; }
.toc li a.active { color: var(--accent); border-left-color: var(--accent); }

/* home grid */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0 0 18px; }
.cards a { display: block; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); color: var(--text); transition: border-color .15s; }
.cards a:hover { border-color: var(--line-2); text-decoration: none; }
.cards a strong { display: block; margin-bottom: 4px; }
.cards a span { color: var(--muted); font-size: 14px; }
.cards a code { font-size: 0.85em; }

/* responsive */
@media (max-width: 1240px) {
  .shell { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .menu { display: inline-flex; align-items: center; justify-content: center; }
  .sidebar {
    position: fixed; top: var(--top-h); left: 0; bottom: 0; width: min(320px, 85vw); z-index: 25;
    background: var(--bg); transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 0 100vmax rgba(0,0,0,0);
  }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,0.5); }
  .main { padding: 28px 20px 64px; }
  .top-inner { padding: 0 16px; gap: 12px; }
  .top-links a:not(.gh) { display: none; }
  .search { max-width: none; }
  .search kbd { display: none; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager-next { text-align: left; }
  h2 .anchor, h3 .anchor { display: none; }
}
@media (max-width: 600px) {
  .brand span:not(.brand-docs) { display: none; }
  .code pre { font-size: 12.5px; padding-left: 14px; padding-right: 14px; padding-bottom: 14px; }
}
