/* ServeRouter docs. Geometry ported from TaskWire's docs section; light tokens
   follow docs/design-brief.md Revision 2. No marketing/dashboard CSS overrides. */
:root { --ink-0:#eeeef1; --line:#e6e6ea; --line-2:#d6d6dc; --text:#111118; --muted:#4d4d5a; --dim:#6a6a76; --lavender:#6b2fe0; --focus:#7a3cf0; --lamp-idle:#6b2fe0; --body:'Switzer',Inter,system-ui,sans-serif; --display:var(--body); --mono:'JetBrains Mono',ui-monospace,monospace; --ease:cubic-bezier(.76,0,.24,1); color-scheme:light; }
* { box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; scroll-behavior:smooth; }
body { margin:0; color:var(--text); font:16px/1.55 var(--body); -webkit-font-smoothing:antialiased; }
a { color:inherit; }
img { display:block; max-width:100%; }
button,input { font:inherit; color:inherit; }
:focus-visible { outline:2px solid var(--focus); outline-offset:3px; border-radius:6px; }
::selection { background:rgb(107 47 224 / .16); }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.i { display:inline-flex; align-items:center; justify-content:center; font-size:18px; width:1.15em; height:1.15em; flex:none; color:inherit; }
.brand { display:inline-flex; align-items:center; gap:10px; text-decoration:none; font:600 19px/1 var(--display); letter-spacing:-.035em; white-space:nowrap; }
.brand-mark { width:26px; height:26px; object-fit:contain; }
.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:42px; padding:0 18px; border-radius:999px; border:1px solid var(--line-2); background:transparent; color:var(--text); font:500 15px/1 var(--body); cursor:pointer; white-space:nowrap; transition:background .1s,border-color .1s; }
.btn:hover { border-color:var(--text); background:rgb(17 17 24 / .035); }
.btn.small { min-height:32px; padding:0 12px; font-size:13.5px; }
/* ── docs (taskwire.si/docs, built by scripts/build-docs.mjs) ───────────── */
.docs-body { background: var(--ink-0); }
.docs { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; }
.docs-bar { display: none; }
.docs-side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 18px 14px 28px;
  border-right: 1px solid var(--line); background: #ffffff; display: flex; flex-direction: column; gap: 14px;
}
.docs-brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px; }
.docs-brand .brand { font-size: 17px; gap: 8px; }
.docs-brand .brand-mark { width: 22px; height: 22px; }
.docs-word { color: var(--dim); text-decoration: none; font-size: 15px; }
.docs-search {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 38px; padding: 0 10px; cursor: pointer;
  border: 1px solid var(--line-2); border-radius: 10px; background: rgb(17 17 24 / .025); color: var(--muted); font-size: 14px;
}
.docs-search:hover { border-color: var(--muted); color: var(--text); }
.docs-search span { flex: 1; text-align: left; }
.docs-search .i, .docs-side nav .i { width: 16px; height: 16px; }
kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border: 1px solid var(--line-2); border-radius: 5px; font: 500 11px/1 var(--body); color: var(--dim); }
.docs-side nav h2 { margin: 18px 8px 6px; font: 500 13.5px/1.3 var(--body); color: var(--text); }
.docs-side nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.docs-side nav a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 14px; line-height: 1.3; }
.docs-side nav a:hover { color: var(--text); background: rgb(17 17 24 / .035); }
.docs-side nav a[aria-current="page"] { color: var(--lavender); background: rgb(107 47 224 / .07); }
.docs-top { padding-bottom: 6px !important; border-bottom: 1px solid var(--line); }

.docs-main { display: grid; grid-template-columns: minmax(0, 820px) 220px; gap: 48px; padding: 56px clamp(24px, 4vw, 56px) 96px; justify-content: center; }
.docs-article h1 { margin: 0 0 14px; font: 500 clamp(32px, 3.4vw, 40px)/1.1 var(--display); letter-spacing: -.035em; }
.docs-lede { margin: 0 0 18px; color: var(--muted); font-size: 18px; line-height: 1.5; }
.docs-actions { display: flex; gap: 8px; padding-bottom: 22px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.docs-actions .btn { border-radius: 8px; }
.docs-actions .btn .i { width: 15px; height: 15px; }
[data-done] span::after { content: " · Copied"; color: var(--lamp-idle); }

.prose { font-size: 16px; line-height: 1.75; color: var(--muted); }
.prose > * { margin: 0 0 18px; }
.prose h2 { margin: 44px 0 14px; font: 500 24px/1.25 var(--display); letter-spacing: -.025em; color: var(--text); scroll-margin-top: 24px; position: relative; }
.prose h3 { margin: 30px 0 10px; font: 500 18px/1.3 var(--display); color: var(--text); scroll-margin-top: 24px; position: relative; }
.prose .anchor { position: absolute; left: -22px; color: var(--dim); text-decoration: none; opacity: 0; transition: opacity .15s; }
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: 1; }
.prose a { color: var(--lavender); text-underline-offset: 3px; text-decoration-color: rgb(107 47 224 / .35); }
.prose a:hover { text-decoration-color: currentColor; }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--dim); }
.prose code { font: 13.5px var(--mono); padding: 2px 6px; border-radius: 5px; background: rgb(107 47 224 / .04); border: 1px solid var(--line); color: var(--text); }
.prose .code { position: relative; }
.prose pre { margin: 0; padding: 16px 18px; overflow-x: auto; border-radius: 12px; border: 1px solid var(--line-2); background: #ffffff; font: 13px/1.7 var(--mono); color: var(--muted); }
.prose pre code { padding: 0; border: 0; background: none; color: inherit; font: inherit; }
.copy-code { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--line-2); background: #ffffff; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .15s; }
.code:hover .copy-code, .copy-code:focus-visible { opacity: 1; }
.copy-code[data-done] { color: var(--lamp-idle); opacity: 1; }
.copy-code .i { width: 15px; height: 15px; }
.prose .table { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.55; }
.prose th { text-align: left; font-weight: 500; color: var(--text); background: rgb(17 17 24 / .025); }
.prose th, .prose td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose tr:last-child td { border-bottom: 0; }
.prose td code { white-space: nowrap; }
.prose .note { padding: 14px 18px; border-radius: 12px; border: 1px solid rgb(107 47 224 / .22); background: rgb(107 47 224 / .04); }
.prose .note p { margin: 0; }
.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 56px; }
.docs-pager a { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--text); font-size: 15.5px; transition: border-color .2s; }
.docs-pager a:hover { border-color: rgb(107 47 224 / .45); }
.docs-pager a span { color: var(--dim); font-size: 13px; }
.docs-pager .next { text-align: right; grid-column: 2; }

.docs-toc { position: sticky; top: 56px; align-self: start; font-size: 13.5px; }
.docs-toc h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font: 500 13.5px/1 var(--body); color: var(--text); }
.docs-toc h2 .i { width: 15px; height: 15px; color: var(--dim); }
.docs-toc ul { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 9px; }
.docs-toc a { color: var(--muted); text-decoration: none; }
.docs-toc a:hover, .docs-toc a[aria-current] { color: var(--lavender); }

.docs-find { width: min(640px, calc(100% - 32px)); max-height: min(560px, calc(100% - 96px)); margin-top: 12vh; padding: 0; border-radius: 16px; border: 1px solid var(--line-2); background: #ffffff; color: var(--text); box-shadow: 0 24px 80px rgb(17 17 24 / .15); overflow: hidden; }
.docs-find[open] { display: flex; flex-direction: column; }
.docs-find::backdrop { background: rgb(17 17 24 / .3); backdrop-filter: blur(2px); }
.find-box { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.find-box .i { width: 18px; height: 18px; color: var(--dim); }
.find-box input { flex: 1; min-width: 0; height: 54px; border: 0; background: none; outline: none; font-size: 16px; }
.find-results { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.find-results a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--text); }
.find-results li[aria-selected] a, .find-results a:hover { background: rgb(107 47 224 / .07); }
.find-results b { font-weight: 500; font-size: 15px; }
.find-results span { margin-left: 8px; color: var(--dim); font-size: 12.5px; }
.find-results p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.find-results mark { background: none; color: var(--lavender); }
.find-none { padding: 18px 12px; color: var(--dim); }

.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line-2); border-radius: 10px; background: none; color: var(--text); cursor: pointer; }
.icon-btn .i { width: 18px; height: 18px; }

@media (max-width: 1180px) {
  .docs-main { grid-template-columns: minmax(0, 820px); }
  .docs-toc { display: none; }
}
@media (max-width: 860px) {
  .docs { grid-template-columns: minmax(0, 1fr); }
  .docs-bar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20; padding: 10px 16px; border-bottom: 1px solid var(--line); background: rgb(255 255 255 / .96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
  .docs-bar .brand { flex: 1; font-size: 16px; gap: 8px; }
  .docs-bar .brand-mark { width: 22px; height: 22px; }
  .docs-side { position: fixed; z-index: 30; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-100%); transition: transform .3s var(--ease); box-shadow: 20px 0 60px rgb(17 17 24 / .12); }
  [data-menu-open] .docs-side { transform: none; }
  .docs-main { padding: 32px 16px 72px; }
  .prose .anchor { display: none; }
  .docs-pager { grid-template-columns: minmax(0, 1fr); }
  .docs-pager .next { grid-column: 1; }
}


.docs-article { min-width:0; }
.docs-article h1,.prose { overflow-wrap:anywhere; }
.prose .anchor:focus-visible { opacity:1; }
.prose img { margin:24px 0; border:1px solid var(--line); border-radius:12px; }
.docs-shade,.docs-close { display:none; }
.docs-search .i,.docs-side nav .i { font-size:16px; }
.docs-actions .i,.copy-code .i,.docs-toc .i { font-size:15px; }
@media (max-width:860px) {
  .docs-brand { gap:8px; }
  .docs-close { display:inline-grid; margin-left:auto; width:30px; height:30px; flex:none; }
  [data-menu-open] .docs-shade { display:block; position:fixed; inset:0; z-index:25; border:0; background:rgb(17 17 24 / .2); }
  .prose h2,.prose h3 { scroll-margin-top:80px; }
}
@media (prefers-reduced-motion:reduce) { html { scroll-behavior:auto; } .docs-side,.prose .anchor,.copy-code,.btn { transition:none; } }
