/* The docs: a bar on top, navigation left, the page in the middle, its headings right. */
html:has(.dx-page), .dx-page { height: auto; }
.dx-page #app { height: auto; }
.dx { --top: 57px; min-height: 100vh; }

.dx-top { position: sticky; top: 0; z-index: 20; height: var(--top); display: flex; align-items: center; gap: 16px; padding: 0 20px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.dx-brand { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 16px; color: var(--hi); text-decoration: none; letter-spacing: -0.01em; }
.dx-brand i { width: 20px; height: 20px; background: url("favicon.svg") center / contain no-repeat; flex: none; }
.dx-brand span { font-weight: 450; color: var(--muted); }
.dx-searchbtn { display: flex; align-items: center; gap: 8px; width: min(320px, 34vw); margin-left: auto; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); color: var(--muted); font-size: 13.5px; cursor: pointer; }
.dx-searchbtn:hover { border-color: var(--line2); color: var(--text); }
.dx-searchbtn svg, .dx-search-in svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.dx-searchbtn span { flex: 1; text-align: left; }
.dx kbd, .dx-search kbd { font-family: var(--mono); font-size: 11px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--panel); }
.dx-top-r { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.dx-top-r > a:not(.btn) { color: var(--muted); font-size: 13.5px; text-decoration: none; }
.dx-top-r > a:not(.btn):hover { color: var(--text); }
.dx-ib { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.dx-ib:hover { background: var(--row); color: var(--text); }
.dx-ib svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dx-menu { display: none; }

.dx-body { display: grid; grid-template-columns: 272px minmax(0, 1fr) 240px; max-width: 1440px; margin: 0 auto; }
.dx-side, .dx-toc { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; }
.dx-side { padding: 22px 14px 40px 18px; }
.dx-group { margin: 22px 10px 8px; font-size: 13px; font-weight: 600; color: var(--hi); }
.dx-group:first-child { margin-top: 0; }
.dx-side a { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 10px; color: var(--muted); font-size: 14px; text-decoration: none; }
.dx-side a:hover { color: var(--text); background: var(--row); }
.dx-side a.on { color: var(--hi); background: var(--panel2); font-weight: 500; }
.dx-side svg, .dx-card svg, .dx-toc-h svg, .btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.dx-side a.on svg { color: var(--acc); }

.dx-main { padding: 44px clamp(20px, 5vw, 72px) 96px; min-width: 0; }
.dx-article { max-width: 720px; margin: 0 auto; }
.dx-eyebrow { font-size: 13.5px; font-weight: 600; color: var(--acc); margin-bottom: 10px; }
.dx-title { display: flex; align-items: flex-start; gap: 16px; }
.dx-title h1 { flex: 1; margin: 0; font-size: 34px; line-height: 1.15; font-weight: 650; letter-spacing: -0.025em; color: var(--hi); }
.dx-actions { display: flex; gap: 6px; padding-top: 6px; flex: none; }
.dx-actions .btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.dx-lead { margin: 12px 0 28px; font-size: 18px; line-height: 1.55; color: var(--muted); }
.dx-article p { margin: 16px 0; font-size: 15.5px; line-height: 1.7; color: var(--text); }
.dx-article li { font-size: 15.5px; line-height: 1.7; }
.dx-article ul, .dx-article ol { margin: 16px 0; padding-left: 22px; }
.dx-article li + li { margin-top: 6px; }
.dx-article h2 { margin: 48px 0 0; font-size: 22px; font-weight: 620; letter-spacing: -0.015em; color: var(--hi); scroll-margin-top: calc(var(--top) + 20px); }
.dx-article h3 { margin: 32px 0 0; font-size: 17px; font-weight: 600; color: var(--hi); scroll-margin-top: calc(var(--top) + 20px); }
.dx-article h3 .ic, .dx-article h2 .ic { font-size: 0.9em; }
.dx-anchor { color: inherit; text-decoration: none; }
.dx-anchor:hover::after { content: " #"; color: var(--faint); font-weight: 400; }
.dx-article a:not(.btn):not(.dx-card):not(.dx-anchor) { color: var(--acc); text-decoration: underline; text-decoration-color: var(--acc-dim); text-underline-offset: 3px; }
.dx-article a:not(.btn):not(.dx-card):not(.dx-anchor):hover { text-decoration-color: var(--acc); }
.ic { font-family: var(--mono); font-size: 0.86em; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--hi); white-space: nowrap; }
td .ic { white-space: normal; overflow-wrap: anywhere; }

.dx-code { margin: 18px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--field); overflow: hidden; }
.dx-code-h { display: flex; align-items: center; justify-content: space-between; height: 36px; padding: 0 6px 0 14px; border-bottom: 1px solid var(--line); color: var(--faint); font-size: 12px; }
.dx-code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.65; color: var(--text); }
.dx-code .k { color: var(--acc); }
.dx-code .c { color: var(--faint); }

.dx-table { margin: 18px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.dx-table table { width: 100%; border-collapse: collapse; }
.dx-table th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--line); white-space: nowrap; }
.dx-table td { padding: 10px 14px; font-size: 14.5px; line-height: 1.55; vertical-align: top; border-bottom: 1px solid var(--line); color: var(--text); white-space: normal; }
.dx-table tr:last-child td { border-bottom: 0; }
.dx-table td:first-child { color: var(--hi); }

.dx-callout { display: grid; gap: 2px; margin: 20px 0; padding: 14px 16px; border: 1px solid var(--line2); border-radius: 12px; background: var(--panel); }
.dx-callout b { font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.dx-callout p { margin: 0; font-size: 14.5px; }
.dx-callout.tip { border-color: var(--ok-b); background: var(--ok-bg); }
.dx-callout.tip b { color: var(--ok); }
.dx-callout.warning { border-color: var(--warn-b); background: var(--warn-bg); }
.dx-callout.warning b { color: var(--warn); }

.dx-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 22px 0; }
.dx-card { display: grid; gap: 6px; align-content: start; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.dx-card:hover { border-color: var(--acc-dim); transform: translateY(-1px); }
.dx-card svg { width: 20px; height: 20px; color: var(--acc); margin-bottom: 6px; }
.dx-card b { color: var(--hi); font-size: 15px; font-weight: 600; }
.dx-card span { color: var(--muted); font-size: 14px; line-height: 1.5; }

.dx-article ol.dx-steps { list-style: none; padding: 0; margin: 28px 0; counter-reset: step; }
.dx-steps > li { position: relative; padding: 0 0 26px 46px; counter-increment: step; margin: 0; }
.dx-steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--panel2); border: 1px solid var(--line2); color: var(--hi); font-size: 13px; font-weight: 600; }
.dx-steps > li::after { content: ""; position: absolute; left: 13.5px; top: 36px; bottom: 6px; width: 1px; background: var(--line); }
.dx-steps > li:last-child { padding-bottom: 0; }
.dx-steps > li:last-child::after { display: none; }
.dx-step-t { font-size: 16.5px; font-weight: 600; color: var(--hi); line-height: 28px; }
.dx-steps > li > p:first-of-type { margin-top: 8px; }

.dx-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line); }
.dx-pager a { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; }
.dx-pager a:hover { border-color: var(--acc-dim); }
.dx-pager a.next { text-align: right; }
.dx-pager span { font-size: 12.5px; color: var(--muted); }
.dx-pager b { color: var(--hi); font-weight: 600; }

.dx-toc { padding: 44px 20px 40px 8px; }
.dx-toc-h { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--hi); margin-bottom: 10px; }
.dx-toc a { display: block; padding: 4px 0 4px 12px; border-left: 1px solid var(--line); color: var(--muted); font-size: 13.5px; line-height: 1.4; text-decoration: none; }
.dx-toc a.l3 { padding-left: 24px; }
.dx-toc a:hover { color: var(--text); }
.dx-toc a.on { color: var(--acc); border-left-color: var(--acc); }

.dx-search { position: fixed; inset: 0; z-index: 50; display: grid; justify-items: center; align-items: start; padding: 12vh 16px 0; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(3px); }
.dx-search-box { width: min(620px, 100%); border: 1px solid var(--line2); border-radius: 14px; background: var(--panel); box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5); overflow: hidden; }
.dx-search-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.dx-search-in input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--hi); font-size: 16px; }
.dx-search-in input::-webkit-search-cancel-button { display: none; }
.dx-results { max-height: 52vh; overflow-y: auto; padding: 6px; }
.dx-results button { display: grid; gap: 2px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: none; text-align: left; cursor: pointer; color: var(--text); }
.dx-results button.on { background: var(--acc-bg); }
.dx-results b { font-weight: 600; color: var(--hi); font-size: 14.5px; }
.dx-results span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-none { margin: 0; padding: 18px 12px; color: var(--muted); font-size: 14px; }

@media (max-width: 1180px) {
  .dx-body { grid-template-columns: 256px minmax(0, 1fr); }
  .dx-toc { display: none; }
}
@media (max-width: 820px) {
  .dx-menu { display: inline-grid; }
  .dx-body { grid-template-columns: minmax(0, 1fr); }
  .dx-side { position: fixed; z-index: 15; left: 0; top: var(--top); width: min(300px, 86vw); background: var(--bg); border-right: 1px solid var(--line); transform: translateX(-102%); transition: transform 0.18s ease; }
  .dx.nav-open .dx-side { transform: none; box-shadow: 30px 0 80px rgba(0, 0, 0, 0.5); }
  .dx-searchbtn { width: auto; flex: none; margin-left: auto; padding: 8px; }
  .dx-searchbtn kbd, .dx-searchbtn span, .dx-top-r > a:not(.btn), .dx-brand span { display: none; }
  .dx-top { gap: 8px; padding: 0 12px; }
  .dx-top-r { margin-left: 0; gap: 8px; }
  .dx-main { padding: 28px 18px 72px; }
  .dx-title { flex-direction: column; gap: 10px; }
  .dx-title h1 { font-size: 28px; }
  .dx-actions { padding-top: 0; }
  .dx-lead { font-size: 16.5px; }
}
@media (prefers-reduced-motion: reduce) { .dx-card, .dx-side { transition: none; } }
.dx-side, .dx-toc, .dx-results, .dx-code pre, .dx-table { scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
