/* helicopter docs (web-rs/src/pages/site/docs.rs), loaded after /site/site.css on /docs pages only.
   Layout after docs.boat.dev: top bar (wordmark + Docs, search, app links), grouped pages on the left, the article,
   "On this page" on the right, previous/next at the bottom. Brand: black, Inter + Geist Mono, white and grey
   text, square corners, 1px #262a28 lines; green only for links and the current page. No inline styles (CSP). */
.dx {
  --ln: #262a28; --top: 56px; --side: 280px; --tocw: 232px;
  --panel: #0a0c0b; --panel2: #0f1211;
  min-height: 100vh; background: var(--bg);
}
html:has(.dx) { scroll-padding-top: calc(var(--top, 56px) + 24px); }
.dx :focus-visible { border-radius: 0; }
.dx .s-i { width: 16px; height: 16px; }

/* ---------- top bar ---------- */
.dx-top { position: sticky; top: 0; z-index: 40; height: var(--top); display: flex; align-items: center; gap: 24px; padding: 0 20px;
  border-bottom: 1px solid var(--ln); background: rgba(5,7,6,.92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.dx-brand { display: flex; align-items: center; gap: 14px; width: calc(var(--side) - 20px - 24px); flex: none; }
.dx-brand .s-word { padding: 4px 0; }
.dx-docs { padding-left: 14px; border-left: 1px solid var(--ln); color: var(--soft); text-decoration: none; font-size: 14px; font-weight: 500; line-height: 20px; }
.dx-docs:hover { color: var(--text); }
.dx-search { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 420px; height: 36px; padding: 0 10px 0 12px;
  border: 1px solid var(--ln); background: var(--panel); color: var(--faint); font: 400 14px var(--sans); cursor: pointer; text-align: left; }
.dx-search:hover { border-color: #3a3f3c; color: var(--muted); }
.dx-search .t { flex: 1; }
.dx kbd { font: 500 11px/1 var(--mono); color: var(--faint); border: 1px solid var(--ln); padding: 3px 5px; }
.dx-links { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.dx-links a { padding: 8px 10px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap; }
.dx-links a:hover { color: var(--text); }
.dx-links .dx-btn { margin-left: 8px; padding: 8px 14px; color: #050706; background: var(--text); border: 1px solid var(--text); }
.dx-links .dx-btn:hover { background: #fff; color: #050706; }

/* ---------- body grid ---------- */
.dx-body { display: grid; grid-template-columns: var(--side) minmax(0, 1fr) var(--tocw); align-items: start; }
.dx-body:not(:has(.dx-toc)) { grid-template-columns: var(--side) minmax(0, 1fr); }

/* sidebar */
.dx-side { position: sticky; top: var(--top); height: calc(100vh - var(--top)); display: flex; flex-direction: column; border-right: 1px solid var(--ln); }
.dx-side > nav { flex: 1; overflow-y: auto; padding: 24px 16px 24px 20px; scrollbar-width: thin; scrollbar-color: #262a28 transparent; }
.dx-group + .dx-group { margin-top: 26px; }
.dx-label { display: block; margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: -0.005em; }
.dx-group ul { list-style: none; margin: 0; padding: 0 0 0 1px; border-left: 1px solid var(--ln); }
.dx-group a { display: flex; align-items: center; gap: 6px; margin-left: -1px; padding: 6px 12px; border-left: 1px solid transparent;
  color: var(--muted); text-decoration: none; font-size: 14px; line-height: 1.4; }
.dx-group a:hover { color: var(--text); border-left-color: #4a504d; }
.dx-group a[aria-current="page"] { color: var(--text); font-weight: 500; border-left-color: var(--green); background: rgba(255,255,255,.035); }
.dx-group a.ext .s-i { width: 12px; height: 12px; color: var(--faint); }
.dx-dash { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-top: 1px solid var(--ln);
  color: var(--soft); text-decoration: none; font-size: 14px; }
.dx-dash:hover { color: var(--text); background: var(--panel); }

/* main column */
.dx-main { min-width: 0; outline: none; padding: 40px 56px 0; }
.dx-col { max-width: 720px; margin: 0 auto; }
.dx-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; min-height: 32px; }
.dx-eyebrow { font-size: 14px; font-weight: 500; color: var(--green); }
.dx-copypage, .dx-copy { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--ln); background: var(--panel);
  color: var(--muted); font: 500 12.5px var(--sans); cursor: pointer; }
.dx-copypage { height: 32px; padding: 0 12px; }
.dx-copypage > span:first-child { display: contents; }
.dx-copypage:hover, .dx-copy:hover { color: var(--text); border-color: #3a3f3c; }
.dx-copypage[data-done], .dx-copy[data-done] { color: var(--text); }
.dx-copypage .s-i, .dx-copy .s-i { width: 14px; height: 14px; }

/* ---------- article ---------- */
.dx-prose { max-width: none; color: var(--soft); font-size: 16px; line-height: 1.7; }
.dx-prose h1 { font-size: clamp(32px, 3.4vw, 40px); line-height: 1.1; letter-spacing: -0.035em; color: var(--text); margin: 0 0 12px; font-weight: 600; }
.dx-prose .lede { font-size: 17px; line-height: 1.6; color: var(--muted); margin: 0 0 36px; padding-bottom: 32px; border-bottom: 1px solid var(--ln); max-width: none; }
.dx-prose h2 { margin: 48px 0 14px; font-size: 23px; letter-spacing: -0.025em; }
.dx-prose h3 { margin: 32px 0 10px; font-size: 18px; }
.dx-prose a { text-decoration-color: rgba(122,227,95,.55); }
.dx-prose code { border-radius: 0; border-color: var(--ln); background: var(--panel2); font-size: .85em; padding: 1px 5px; }
.dx-prose pre { border-radius: 0; border-color: var(--ln); }
.dx-prose .table-scroll, .dx-prose .tbl { border-radius: 0; border-color: var(--ln); background: var(--panel); }
.dx-prose th, .dx-prose td { border-bottom-color: var(--ln); }
.dx-prose details { border-radius: 0; border-color: var(--ln); }
.dx-prose hr { border-top-color: var(--ln); }

/* code blocks: header with a label and a copy button */
.dx-code { margin: 0 0 20px; border: 1px solid var(--ln); background: var(--panel); }
.dx-code-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 38px; padding: 0 6px 0 14px; border-bottom: 1px solid var(--ln); }
.dx-code-h > span { font: 500 12px var(--mono); color: var(--faint); }
.dx-copy { height: 28px; padding: 0 9px; border-color: transparent; background: none; }
.dx-code pre { margin: 0; border: 0; border-radius: 0; background: none; padding: 14px 16px 16px; font-size: 13.5px; line-height: 1.65; color: var(--text); }

/* callouts */
.dx-prose .callout, .dx-prose .d-archive { position: relative; margin: 0 0 20px; padding: 12px 16px 12px 18px; border: 1px solid var(--ln); border-left: 2px solid #5b625e;
  border-radius: 0; background: var(--panel); color: var(--soft); font-size: 15px; line-height: 1.6; }
.dx-prose .callout > :last-child { margin-bottom: 0; }
.dx-prose .callout::before, .dx-prose .d-archive::before { content: "Note"; display: block; margin-bottom: 2px; font: 500 11px/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dx-prose .callout.warn, .dx-prose .d-archive { border-left-color: var(--amber); background: linear-gradient(90deg, rgba(224,173,79,.06), transparent 60%), var(--panel); }
.dx-prose .callout.warn::before { content: "Important"; color: var(--amber); }
.dx-prose .d-archive::before { content: "Archive"; color: var(--amber); }

/* cards on the introduction */
.dx-prose .d-paths { gap: 0; border-top: 1px solid var(--ln); border-left: 1px solid var(--ln); }
.dx-prose .d-paths a { border: 0; border-right: 1px solid var(--ln); border-bottom: 1px solid var(--ln); border-radius: 0; background: var(--panel); text-decoration: none; }
.dx-prose .d-paths a:hover { background: var(--panel2); }
.dx-prose .d-paths a:hover svg { stroke: var(--green); }

/* previous / next */
.dx-pager { display: grid; grid-template-columns: 1fr 1fr; margin-top: 64px; border: 1px solid var(--ln); }
.dx-pager a { display: grid; gap: 4px; padding: 16px 18px; text-decoration: none; }
.dx-pager a:hover { background: var(--panel); }
.dx-pager a:hover b { color: var(--green); }
.dx-pager .next { grid-column: 2; text-align: right; border-left: 1px solid var(--ln); }
.dx-pager .prev:only-child { border-right: 1px solid var(--ln); }
.dx-pager small { font-size: 13px; color: var(--faint); }
.dx-pager b { font-weight: 500; color: var(--text); }
.dx-pager .prev small::before { content: "‹ "; }
.dx-pager .next small::after { content: " ›"; }
.dx-foot { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 48px; padding: 24px 0 40px; border-top: 1px solid var(--ln); font-size: 13px; color: var(--faint); }
.dx-foot span { margin-right: auto; }
.dx-foot a { color: var(--faint); text-decoration: none; }
.dx-foot a:hover { color: var(--text); }

/* on this page */
.dx-toc { position: sticky; top: var(--top); max-height: calc(100vh - var(--top)); overflow-y: auto; padding: 44px 24px 24px 0; }
.dx-toc h2 { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: -0.005em; }
.dx-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--ln); }
.dx-toc a { display: block; margin-left: -1px; padding: 5px 0 5px 12px; border-left: 1px solid transparent; color: var(--faint); text-decoration: none; font-size: 13px; line-height: 1.45; }
.dx-toc a:hover { color: var(--text); }
.dx-toc a[aria-current] { color: var(--text); border-left-color: var(--green); }

/* mobile breadcrumb + menu */
.dx-crumb { display: none; }

/* search dialog */
.dx-dlg { width: min(640px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 120px)); margin: 12vh auto auto; padding: 0;
  border: 1px solid #333836; border-radius: 0; background: #0b0d0c; color: var(--text); box-shadow: 0 32px 80px rgba(0,0,0,.7); }
.dx-dlg::backdrop { background: rgba(0,0,0,.6); }
.dx-dlg[open] { display: flex; }
.dx-dlg-in { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.dx-dlg-q { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 52px; border-bottom: 1px solid var(--ln); color: var(--faint); flex: none; }
.dx-dlg-q input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: none; color: var(--text); font: 400 16px var(--sans); }
.dx-dlg-q input::-webkit-search-cancel-button { display: none; }
.dx-results { list-style: none; margin: 0; padding: 6px; overflow-y: auto; scrollbar-width: thin; }
.dx-results a { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 9px 10px; color: var(--soft); text-decoration: none; font-size: 14px; }
.dx-results a b { font-weight: 500; color: var(--text); }
.dx-results a span { font-size: 12.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dx-results li[data-active] a, .dx-results a:hover { background: var(--panel2); box-shadow: inset 2px 0 0 var(--green); }
.dx-none { padding: 28px; text-align: center; color: var(--faint); font-size: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .dx-body, .dx-body:not(:has(.dx-toc)) { grid-template-columns: var(--side) minmax(0, 1fr); }
  .dx-toc { display: none; }
  .dx-main { padding-inline: 48px; }
}
@media (max-width: 900px) {
  .dx { --top: 56px; }
  .dx-top { gap: 8px; padding: 0 16px; }
  .dx-brand { width: auto; flex: 1; }
  .dx-search { width: 38px; height: 38px; padding: 0; justify-content: center; border: 0; background: none; color: var(--soft); flex: none; }
  .dx-search .t, .dx-search kbd { display: none; }
  .dx-search .s-i { width: 18px; height: 18px; }
  .dx-links { margin-left: 0; }
  .dx-links .o { display: none; }
  .dx-links .dx-btn { margin-left: 0; padding: 7px 12px; font-size: 13.5px; }
  .dx-body, .dx-body:not(:has(.dx-toc)) { display: block; }
  .dx-side { display: none; }
  .dx-crumb { display: block; position: sticky; top: var(--top); z-index: 30; border-bottom: 1px solid var(--ln); background: rgba(5,7,6,.96); }
  .dx-crumb > summary { list-style: none; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 16px; cursor: pointer; font-size: 14px; color: var(--muted); }
  .dx-crumb > summary::-webkit-details-marker { display: none; }
  .dx-crumb > summary .s-i { width: 18px; height: 18px; color: var(--soft); }
  .dx-crumb > summary .sep { width: 14px; height: 14px; color: var(--faint); }
  .dx-crumb > summary b { font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dx-crumb > nav { max-height: calc(100vh - var(--top) - 48px); overflow-y: auto; padding: 8px 16px 24px; border-top: 1px solid var(--ln); }
  .dx-main { padding: 28px 16px 0; }
  .dx-prose h2 { margin-top: 40px; font-size: 21px; }
  .dx-prose .lede { font-size: 16px; margin-bottom: 28px; padding-bottom: 24px; }
  .dx-prose .d-paths { grid-template-columns: 1fr; }
  .dx-code pre { font-size: 12.5px; }
  .dx-pager { grid-template-columns: 1fr; }
  .dx-pager .next { grid-column: 1; border-left: 0; }
  .dx-pager .prev + .next { border-top: 1px solid var(--ln); }
  .dx-dlg { margin-top: 64px; }
}
@media (max-width: 380px) {
  .dx-docs { padding-left: 10px; }
  .dx-brand { gap: 10px; }
}
.dx-dlg-q input:focus-visible { outline: none; }
.dx-dlg-q:focus-within { color: var(--soft); }
