/* =========================================================================
   WIRE GH DOCS
   ========================================================================= */
:root {
  --wd-blue: #0078d4;
  --wd-blue-dark: #005a9e;
  --wd-blue-soft: #e8f1fb;
  --wd-ink: #0f1b2d;
  --wd-text: #2b3a4d;
  --wd-muted: #5f6f82;
  --wd-line: #e4e9f0;
  --wd-bg: #ffffff;
  --wd-bg-soft: #f6f9fc;
  --wd-code-bg: #0e1c2f;
  --wd-code-bar: #142740;
  --wd-code-text: #d6e2f0;
  --wd-green: #107c10;
  --wd-orange: #c25400;
  --wd-red: #c4262e;
  --wd-top-h: 68px;
  --wd-side-w: 260px;
  --wd-font: 'Source Sans 3', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --wd-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --wd-radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--wd-top-h) + 20px); -webkit-text-size-adjust: 100%; }
body.wd { margin: 0; font-family: var(--wd-font); font-size: 17px; line-height: 1.65; color: var(--wd-text); background: var(--wd-bg); }
[hidden] { display: none !important; }
a { color: var(--wd-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
code, kbd, pre { font-family: var(--wd-mono); }
:focus-visible { outline: 2px solid var(--wd-blue); outline-offset: 2px; }
.wd-ico { width: 20px; height: 20px; fill: currentColor; flex: none; }

.wd-skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--wd-ink); color: #fff; padding: 8px 14px; border-radius: 6px; }
.wd-skip:focus { left: 12px; }

/* ---------------------------------------------------------------- top bar */
.wd-top { position: fixed; inset: 0 0 auto 0; height: var(--wd-top-h); background: rgba(255,255,255,.96); backdrop-filter: saturate(1.4) blur(6px); border-bottom: 1px solid var(--wd-line); z-index: 40; }
.wd-top-inner { max-width: 1400px; height: 100%; margin: 0 auto; padding: 0 28px; display: flex; align-items: center; gap: 20px; }
.wd-brand { display: flex; align-items: center; gap: 8px; color: var(--wd-ink); width: calc(var(--wd-side-w) - 28px); flex: none; }
.wd-brand:hover { text-decoration: none; }
.wd-brand img { width: 28px; height: 28px; object-fit: contain; }
.wd-brand-name { font-weight: 700; font-size: 18px; letter-spacing: .2px; }
.wd-brand-site { font-weight: 600; font-size: 18px; color: var(--wd-blue); }
.wd-menu-btn { display: none; background: none; border: 0; padding: 6px; margin-left: -6px; color: var(--wd-ink); cursor: pointer; border-radius: 6px; }
.wd-menu-btn .wd-ico { width: 24px; height: 24px; }

.wd-search { position: relative; flex: 1; max-width: 560px; }
.wd-search input { width: 100%; height: 42px; border: 1px solid var(--wd-line); border-radius: 8px; background: var(--wd-bg-soft); padding: 0 40px 0 42px; font: inherit; font-size: 15px; color: var(--wd-ink); transition: border-color .15s, background .15s, box-shadow .15s; }
.wd-search input::placeholder { color: #7d8b9c; }
.wd-search input:focus { outline: none; background: #fff; border-color: var(--wd-blue); box-shadow: 0 0 0 3px rgba(0,120,212,.15); }
.wd-search input::-webkit-search-cancel-button { display: none; }
.wd-search-ico { position: absolute; left: 13px; top: 11px; color: #7d8b9c; pointer-events: none; }
.wd-kbd { position: absolute; right: 10px; top: 10px; font-size: 12px; line-height: 20px; padding: 0 7px; border: 1px solid var(--wd-line); border-radius: 5px; color: var(--wd-muted); background: #fff; }
.wd-search input:focus + .wd-kbd { display: none; }
.wd-search-results { position: absolute; top: 50px; left: 0; right: 0; background: #fff; border: 1px solid var(--wd-line); border-radius: 10px; box-shadow: 0 12px 32px rgba(15,27,45,.14); max-height: min(70vh, 520px); overflow-y: auto; padding: 6px; z-index: 60; }
.wd-search-item { display: block; padding: 9px 12px; border-radius: 7px; color: var(--wd-ink); }
.wd-search-item:hover, .wd-search-item.is-active { background: var(--wd-blue-soft); text-decoration: none; }
.wd-search-item strong { display: block; font-weight: 600; font-size: 15px; }
.wd-search-item span { display: block; font-size: 13px; color: var(--wd-muted); }
.wd-search-item mark { background: none; color: var(--wd-blue); font-weight: 700; }
.wd-search-tag { float: right; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--wd-muted); background: var(--wd-bg-soft); border-radius: 4px; padding: 1px 6px; margin-left: 8px; }
.wd-search-empty { padding: 14px 12px; color: var(--wd-muted); font-size: 15px; }

.wd-top-tabs { display: flex; gap: 26px; margin-left: auto; }
.wd-top-tabs a { color: var(--wd-text); font-weight: 600; font-size: 16px; padding: 22px 0 20px; border-bottom: 2px solid transparent; }
.wd-top-tabs a:hover { color: var(--wd-blue); text-decoration: none; }
.wd-top-tabs a.is-active { color: var(--wd-blue); border-bottom-color: var(--wd-blue); }

.wd-btn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: 7px; border: 1px solid var(--wd-line); background: #fff; color: var(--wd-ink); font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap; }
.wd-btn:hover { text-decoration: none; border-color: #c9d3df; }
.wd-btn--primary { background: var(--wd-blue); border-color: var(--wd-blue); color: #fff; }
.wd-btn--primary:hover { background: var(--wd-blue-dark); border-color: var(--wd-blue-dark); color: #fff; }

/* ---------------------------------------------------------------- shell */
.wd-shell { max-width: 1400px; margin: 0 auto; padding-top: var(--wd-top-h); display: flex; }
.wd-side { position: sticky; top: var(--wd-top-h); height: calc(100vh - var(--wd-top-h)); width: var(--wd-side-w); flex: none; display: flex; flex-direction: column; padding: 28px 12px 16px 28px; overflow-y: auto; }
.wd-side-inner { flex: 1; }
.wd-nav { list-style: none; margin: 0; padding: 0; }
.wd-nav > li { margin: 2px 0; }
.wd-nav-link { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border-radius: 7px; color: var(--wd-ink); font: inherit; font-weight: 600; font-size: 16px; background: none; border: 0; cursor: pointer; text-align: left; }
.wd-nav-link .wd-ico { color: var(--wd-ink); width: 19px; height: 19px; }
.wd-nav-link:hover { background: var(--wd-bg-soft); text-decoration: none; }
.wd-nav-link.is-active, .wd-nav-link.is-parent { color: var(--wd-blue); }
.wd-nav-link.is-active .wd-ico, .wd-nav-link.is-parent .wd-ico { color: var(--wd-blue); }
.wd-nav-plain { font-weight: 600; font-size: 15.5px; padding: 7px 10px; }
.wd-chev { margin-left: auto; width: 18px; height: 18px; transition: transform .15s; color: var(--wd-muted) !important; }
.wd-nav-group.is-open .wd-chev { transform: rotate(90deg); }
.wd-subnav { list-style: none; margin: 2px 0 8px 19px; padding: 0 0 0 12px; border-left: 1px solid var(--wd-line); display: none; }
.wd-nav-group.is-open > .wd-subnav, .wd-nav--endpoints > li.is-open > .wd-subnav { display: block; }
.wd-subnav a { display: block; padding: 5px 10px; font-size: 15px; color: var(--wd-text); border-radius: 6px; }
.wd-subnav a:hover { color: var(--wd-blue); text-decoration: none; }
.wd-subnav a.is-active { color: var(--wd-blue); font-weight: 600; }
.wd-nav-label { display: flex; align-items: center; gap: 10px; margin: 26px 10px 8px; font-size: 12px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--wd-muted); }
.wd-nav-label::after { content: ''; flex: 1; height: 1px; background: var(--wd-line); }
.wd-side-foot { border-top: 1px solid var(--wd-line); margin-top: 20px; padding: 14px 10px 0; display: flex; gap: 18px; font-size: 14px; }
.wd-side-foot a { color: var(--wd-muted); }
.wd-side-signup { display: none; }
@media (max-width: 960px) { .wd-side-signup { display: inline; color: var(--wd-blue) !important; font-weight: 600; } }
.wd-scrim { position: fixed; inset: var(--wd-top-h) 0 0 0; background: rgba(15,27,45,.4); z-index: 35; }

.wd-main { flex: 1; min-width: 0; display: flex; gap: 40px; padding: 36px 40px 0 48px; }
.wd-content { flex: 1; min-width: 0; max-width: 780px; }
.wd-content--wide { max-width: none; }
.wd-toc { position: sticky; top: calc(var(--wd-top-h) + 36px); align-self: flex-start; width: 210px; flex: none; font-size: 14px; max-height: calc(100vh - var(--wd-top-h) - 60px); overflow-y: auto; }
.wd-toc-title { font-size: 12px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--wd-muted); margin-bottom: 10px; }
.wd-toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--wd-line); }
.wd-toc a { display: block; padding: 4px 0 4px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--wd-muted); }
.wd-toc a:hover { color: var(--wd-ink); text-decoration: none; }
.wd-toc a.is-active { color: var(--wd-blue); border-left-color: var(--wd-blue); }

/* ---------------------------------------------------------------- typography */
.wd-content h1 { font-size: 38px; line-height: 1.2; color: var(--wd-ink); margin: 0 0 12px; font-weight: 700; letter-spacing: -.3px; }
.wd-content h2 { font-size: 27px; line-height: 1.3; color: var(--wd-ink); margin: 52px 0 14px; font-weight: 700; position: relative; }
.wd-content h3 { font-size: 20px; color: var(--wd-ink); margin: 34px 0 10px; font-weight: 700; position: relative; }
.wd-content h4 { font-size: 16px; color: var(--wd-ink); margin: 24px 0 8px; }
.wd-content p { margin: 0 0 16px; }
.wd-content ul, .wd-content ol { margin: 0 0 18px; padding-left: 24px; }
.wd-content li { margin: 6px 0; }
.wd-content :not(pre) > code { font-size: .86em; background: var(--wd-bg-soft); border: 1px solid var(--wd-line); border-radius: 5px; padding: 1px 6px; color: #0b3a66; word-break: break-word; }
.wd-lead { font-size: 19px; color: var(--wd-muted); margin: 0 0 28px; }
.wd-lead p:last-child { margin-bottom: 0; }
.wd-anchor { position: absolute; left: -28px; top: 50%; transform: translateY(-50%); opacity: 0; color: var(--wd-muted); padding: 4px; transition: opacity .15s; }
.wd-anchor .wd-ico { width: 18px; height: 18px; }
h2:hover > .wd-anchor, h3:hover > .wd-anchor, .wd-anchor:focus { opacity: 1; }
.wd-content table { width: 100%; border-collapse: collapse; margin: 8px 0 24px; font-size: 15.5px; }
.wd-content th { text-align: left; font-weight: 700; color: var(--wd-ink); background: var(--wd-bg-soft); border-bottom: 1px solid var(--wd-line); padding: 10px 12px; }
.wd-content td { border-bottom: 1px solid var(--wd-line); padding: 10px 12px; vertical-align: top; }
.wd-table-wrap { overflow-x: auto; margin: 0 0 24px; border: 1px solid var(--wd-line); border-radius: var(--wd-radius); }
.wd-table-wrap table { margin: 0; }
.wd-table-wrap tr:last-child td { border-bottom: 0; }

.wd-steps { counter-reset: step; list-style: none; padding: 0 !important; }
.wd-steps--from2 { counter-reset: step 1; }
.wd-steps > li { counter-increment: step; position: relative; padding-left: 46px; margin: 0 0 22px; }
.wd-steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--wd-blue-soft); color: var(--wd-blue); font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.wd-steps > li > strong:first-child { display: block; color: var(--wd-ink); }

/* ---------------------------------------------------------------- callouts */
.wd-callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--wd-radius); margin: 0 0 22px; font-size: 16px; background: var(--wd-blue-soft); border: 1px solid #cfe2f6; }
.wd-callout > .wd-ico { margin-top: 2px; color: var(--wd-blue); }
.wd-callout strong { color: var(--wd-ink); display: block; margin-bottom: 2px; }
.wd-callout p:last-child { margin: 0; }
.wd-callout--warning { background: #fff6ec; border-color: #f5d6b3; }
.wd-callout--warning > .wd-ico { color: var(--wd-orange); }
.wd-callout--tip { background: #f1f9f1; border-color: #cde6cd; }
.wd-callout--tip > .wd-ico { color: var(--wd-green); }

/* ---------------------------------------------------------------- code blocks */
.wd-code { background: var(--wd-code-bg); border-radius: 10px; margin: 0 0 24px; overflow: hidden; box-shadow: 0 1px 2px rgba(15,27,45,.12); }
.wd-code-bar { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 8px 0 16px; background: var(--wd-code-bar); border-bottom: 1px solid rgba(255,255,255,.06); }
.wd-code-title { display: flex; align-items: center; gap: 8px; color: #e8eff7; font-size: 14px; font-weight: 600; min-width: 0; }
.wd-code-path { font-family: var(--wd-mono); font-size: 13px; color: #c3d3e6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wd-code-tabs { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; }
.wd-tab { background: none; border: 0; color: #8fa4bd; font: inherit; font-size: 13.5px; font-weight: 600; padding: 6px 10px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.wd-tab:hover { color: #fff; }
.wd-tab.is-active { color: #fff; background: rgba(255,255,255,.09); }
.wd-tab--ok.is-active { color: #7ee2a8; }
.wd-tab--err.is-active { color: #ff9ea2; }
.wd-copy { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; color: #8fa4bd; font: inherit; font-size: 13px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.wd-copy .wd-ico { width: 16px; height: 16px; }
.wd-copy:hover { color: #fff; background: rgba(255,255,255,.07); }
.wd-copy.is-done { color: #7ee2a8; }
.wd-code-tabs + .wd-copy, .wd-code-title + .wd-copy { margin-left: auto; }
.wd-code-tabs:empty { display: none; }
.wd-pre { margin: 0; padding: 16px 18px 18px; overflow: auto; max-height: 560px; color: var(--wd-code-text); font-size: 13.5px; line-height: 1.65; tab-size: 2; }
.wd-pre code { font-size: inherit; white-space: pre; }
.wd-code--response .wd-pre { max-height: 440px; }
.wd-code--ep .wd-code-bar { flex-wrap: wrap; row-gap: 0; padding-top: 10px; }
.wd-code--ep .wd-code-title { flex: 1 0 100%; padding-bottom: 6px; }
.wd-code--ep .wd-code-path { white-space: normal; word-break: break-all; }
.wd-code--ep .wd-code-tabs { margin-left: -10px; padding-bottom: 4px; }
.tk-str { color: #a5e3a1; }
.tk-key { color: #8cc8ff; }
.tk-num { color: #f9c97c; }
.tk-kw { color: #d7a6ff; }
.tk-com { color: #6f87a3; font-style: italic; }
.tk-lit { color: #ff9e7a; }
.tk-fn { color: #ffd88a; }
.tk-tag { color: #8cc8ff; }

.wd-method { display: inline-block; font-family: var(--wd-mono); font-size: 11.5px; font-weight: 600; letter-spacing: .4px; padding: 2px 7px; border-radius: 4px; line-height: 1.5; }
.wd-method--get { background: #e3f4e6; color: #0d6b25; }
.wd-method--post { background: #e4effd; color: #0a5aa8; }
.wd-method--put { background: #fff1de; color: #9a5300; }
.wd-method--delete { background: #fde6e7; color: #a51d24; }
.wd-code .wd-method--get { background: rgba(70,200,110,.16); color: #7ee2a8; }
.wd-code .wd-method--post { background: rgba(80,160,255,.18); color: #9cccff; }

/* ---------------------------------------------------------------- API endpoints */
.wd-api-head { max-width: 780px; margin-bottom: 8px; }
.wd-ep { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 44px; padding: 40px 0 44px; border-top: 1px solid var(--wd-line); }
.wd-ep:first-of-type { border-top: 0; padding-top: 16px; }
.wd-ep-title { margin-top: 0 !important; }
.wd-ep-desc { margin-bottom: 20px; }
.wd-sticky { position: sticky; top: calc(var(--wd-top-h) + 24px); }
.wd-params { margin: 0 0 24px; }
.wd-params-title { font-size: 13px !important; text-transform: uppercase; letter-spacing: .7px; color: var(--wd-muted) !important; margin: 0 0 4px !important; padding-bottom: 8px; border-bottom: 1px solid var(--wd-line); }
.wd-param-list { margin: 0; }
.wd-param { padding: 12px 0; border-bottom: 1px solid var(--wd-line); }
.wd-param dt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.wd-param dd { margin: 0; font-size: 15.5px; color: var(--wd-text); }
.wd-param dd p:last-child { margin: 0; }
.wd-param-name { font-family: var(--wd-mono); font-size: 14px !important; font-weight: 600; color: var(--wd-ink) !important; background: none !important; border: 0 !important; padding: 0 !important; }
.wd-param-type { font-size: 13px; color: var(--wd-muted); }
.wd-param-req { font-size: 12px; font-weight: 600; color: var(--wd-orange); }
.wd-param-opt { font-size: 12px; color: #8a97a6; }

.wd-props { border: 1px solid var(--wd-line); border-radius: var(--wd-radius); padding: 0 16px; margin: 0 0 24px; }
.wd-props .wd-param:last-child { border-bottom: 0; }

/* ---------------------------------------------------------------- home */
.wd-hero h1 { font-size: 42px; }
.wd-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 18px 0 8px; }
.wd-card { display: flex; flex-direction: column; border: 1px solid var(--wd-line); border-radius: 10px; overflow: hidden; color: var(--wd-text); background: #fff; transition: box-shadow .15s, border-color .15s, transform .15s; }
.wd-card:hover { text-decoration: none; border-color: #c8d9ec; box-shadow: 0 8px 24px rgba(15,27,45,.08); transform: translateY(-1px); }
.wd-card-art { height: 130px; background: var(--wd-bg-soft); border-bottom: 1px solid var(--wd-line); display: flex; align-items: center; justify-content: center; }
.wd-card-art svg { width: 100%; height: 100%; }
.wd-card-body { padding: 18px 20px 20px; }
.wd-card-body strong { display: block; color: var(--wd-blue); font-size: 18px; margin-bottom: 4px; }
.wd-card-body span { font-size: 15.5px; }
.wd-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 10px 0 28px; }
.wd-link-tile { display: flex; gap: 12px; padding: 14px 16px; border: 1px solid var(--wd-line); border-radius: 9px; color: var(--wd-text); font-size: 15px; }
.wd-link-tile:hover { text-decoration: none; border-color: #c8d9ec; background: var(--wd-bg-soft); }
.wd-link-tile .wd-ico { color: var(--wd-blue); margin-top: 2px; }
.wd-link-tile strong { display: block; color: var(--wd-ink); }

/* ---------------------------------------------------------------- pager and footer */
.wd-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 56px 0 0; }
.wd-pager a { display: block; border: 1px solid var(--wd-line); border-radius: 9px; padding: 12px 16px; color: var(--wd-text); }
.wd-pager a:hover { text-decoration: none; border-color: var(--wd-blue); }
.wd-pager span { display: block; font-size: 13px; color: var(--wd-muted); }
.wd-pager strong { display: flex; align-items: center; gap: 6px; color: var(--wd-ink); font-size: 16px; }
.wd-pager strong .wd-ico { width: 18px; height: 18px; color: var(--wd-blue); }
.wd-pager-next { text-align: right; grid-column: 2; }
.wd-pager-next strong { justify-content: flex-end; }
.wd-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 40px; padding: 22px 0 32px; border-top: 1px solid var(--wd-line); font-size: 14px; color: var(--wd-muted); }
.wd-foot a { color: var(--wd-muted); margin-left: 18px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1240px) {
  .wd-toc { display: none !important; }
  .wd-ep { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .wd-sticky { position: static; }
}
@media (max-width: 960px) {
  :root { --wd-top-h: 60px; }
  .wd-top-inner { padding: 0 16px; gap: 12px; }
  .wd-menu-btn { display: inline-flex; }
  .wd-brand { width: auto; }
  .wd-brand-name { display: none; }
  .wd-top-tabs { gap: 16px; }
  .wd-top-tabs a { padding: 18px 0 16px; font-size: 15px; }
  .wd-signup { display: none; }
  .wd-side { position: fixed; top: var(--wd-top-h); left: 0; bottom: 0; height: auto; background: #fff; z-index: 38; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 4px 0 24px rgba(15,27,45,.12); padding-left: 16px; }
  body.wd-nav-open .wd-side { transform: none; }
  .wd-main { padding: 26px 20px 0; }
  .wd-content h1, .wd-hero h1 { font-size: 31px; }
  .wd-content h2 { font-size: 23px; }
  .wd-anchor { display: none; }
  .wd-links { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  body.wd { font-size: 16px; }
  .wd-search { max-width: none; }
  .wd-kbd { display: none; }
  .wd-top-tabs { display: none; }
  .wd-cards, .wd-links { grid-template-columns: 1fr; }
  .wd-pager { grid-template-columns: 1fr; }
  .wd-pager-next { grid-column: 1; }
  .wd-foot a { margin: 0 14px 0 0; }
  .wd-mobile-tabs { display: flex !important; }
}
.wd-mobile-tabs { display: none; gap: 8px; margin: 0 0 14px; padding: 0 10px; }
.wd-mobile-tabs a { flex: 1; text-align: center; padding: 8px; border: 1px solid var(--wd-line); border-radius: 7px; color: var(--wd-ink); font-weight: 600; font-size: 15px; }
.wd-mobile-tabs a.is-active { border-color: var(--wd-blue); color: var(--wd-blue); background: var(--wd-blue-soft); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .wd-top, .wd-side, .wd-toc, .wd-pager, .wd-copy { display: none !important; } .wd-shell { padding-top: 0; } }
