/* NodeForEdge documentation */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.shell {
  max-width: var(--maxw); margin: 0 auto; padding: 8px var(--gutter) 40px;
  display: grid; grid-template-columns: 244px minmax(0, 1fr) 208px; gap: clamp(24px, 4vw, 56px); align-items: start;
}

/* sidebar */
.side { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; padding-right: 8px; scrollbar-width: thin; }
.side-fold summary { display: none; }
.search { position: relative; margin-bottom: 26px; }
.search input {
  width: 100%; padding: 10px 12px; font: inherit; font-size: .95rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 4px;
}
.search input::placeholder { color: var(--muted); }
.results { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 12px 32px rgba(0,0,0,.22); max-height: 60vh; overflow: auto; }
.results a { display: block; padding: 8px 10px; text-decoration: none; border-radius: 4px; }
.results a:hover, .results a:focus { background: var(--accent-soft); }
.results strong { display: block; font-weight: 600; font-size: .95rem; }
.results span { display: block; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.results mark { background: var(--accent-soft); color: inherit; border-radius: 2px; }
.results .none { padding: 10px; color: var(--muted); font-size: .9rem; }

.nav-group { margin-bottom: 22px; }
.nav-title { margin: 0 0 6px; font-size: .88rem; font-weight: 650; color: var(--ink); }
.nav-group ul, .toc ul { list-style: none; margin: 0; padding: 0; }
.nav-group a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 2px solid var(--line); text-decoration: none; color: var(--muted); font-size: .95rem; line-height: 1.4; transition: color .12s, border-color .12s; }
.nav-group a:hover { color: var(--ink); }
.nav-group a[aria-current] { color: var(--ink); border-left-color: var(--accent); font-weight: 560; }

/* on this page */
.toc { position: sticky; top: 16px; font-size: .88rem; }
.toc a { display: block; padding: 4px 0; color: var(--muted); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--ink); }
.toc .l3 a { padding-left: 14px; }

/* article */
.doc { min-width: 0; }
.crumbs { margin: 6px 0 22px; color: var(--muted); font-size: .9rem; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.doc h1 { margin: 0 0 14px; font-size: clamp(2.1rem, 4.2vw, 3.3rem); font-weight: 750; line-height: 1.05; letter-spacing: -.03em; text-wrap: balance; }
.doc .lead { margin: 0 0 40px; max-width: 58ch; font-size: 1.28rem; line-height: 1.5; color: var(--muted); font-weight: 350; }
.doc article > :not(pre):not(table):not(.codehilite):not(.admonition):not(.table-wrap) { max-width: 70ch; }
.doc h2 { margin: 2.6em 0 .6em; padding-top: 1.1em; border-top: 1px solid var(--line); font-size: 1.6rem; font-weight: 680; letter-spacing: -.02em; line-height: 1.2; }
.doc h3 { margin: 2em 0 .4em; font-size: 1.2rem; font-weight: 640; letter-spacing: -.01em; }
.doc h2 a, .doc h3 a { text-decoration: none; color: inherit; }
.doc h2, .doc h3 { scroll-margin-top: 20px; }
.doc p, .doc li { line-height: 1.7; }
.doc li { margin: .3em 0; }
.doc article a { color: var(--accent); text-decoration-thickness: 1px; }
.doc :not(pre) > code { background: var(--surface-2); padding: .12em .38em; border-radius: 3px; font-size: .86em; }
.doc strong { font-weight: 620; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }

.doc pre, .codehilite { margin: 1.4em 0; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow-x: auto; line-height: 1.55; tab-size: 2; }
.codehilite pre { margin: 0; padding: 0; background: none; border: 0; }
.doc pre code, .codehilite code { font-size: .84rem; background: none; padding: 0; }

.doc table { border-collapse: collapse; margin: 1.5em 0; width: 100%; font-size: .95rem; display: block; overflow-x: auto; }
.doc th, .doc td { padding: 10px 14px 10px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); line-height: 1.5; }
.doc th { font-weight: 620; border-bottom: 2px solid var(--ink); white-space: nowrap; }
.doc td:first-child { white-space: nowrap; font-weight: 520; }

.admonition { margin: 1.6em 0; padding: 14px 18px; max-width: 70ch; background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 0 6px 6px 0; }
.admonition p { margin: .3em 0; }
.admonition-title { font-weight: 640; }
.admonition.warning { background: color-mix(in srgb, var(--warn) 14%, transparent); border-left-color: var(--warn); }
.admonition.danger { background: color-mix(in srgb, var(--down) 14%, transparent); border-left-color: var(--down); }

.pager { display: flex; gap: 16px; margin-top: 64px; }
.pager a { flex: 1; display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; transition: border-color .15s, background .15s; }
.pager a:hover { border-color: var(--accent); background: var(--accent-soft); }
.pager small { display: block; color: var(--muted); font-size: .8rem; }
.pager span { font-weight: 600; }
.pager .next { text-align: right; margin-left: auto; }
.built { margin: 28px 0 0; color: var(--muted); font-size: .85rem; }

@media (max-width: 1120px) {
  .shell { grid-template-columns: 232px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; gap: 12px; }
  .side { position: static; max-height: none; overflow: visible; padding: 0; }
  .side-fold { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
  .side-fold summary { display: block; cursor: pointer; padding: 12px 16px; font-weight: 600; }
  .side-fold > :not(summary) { margin-left: 16px; margin-right: 16px; }
  .side-fold > .nav-group:last-child { margin-bottom: 16px; }
  .pager { flex-direction: column; }
}
