/* The docs: page list on the left, the guide in the middle, "On this page" on the right. */
.dc-page { --top: 64px; --side: 272px; --toc: 220px; }
/* style.css hides sideways overflow on html and body; "hidden" makes the body its own scroller, which breaks sticky
   panels and jumping to a heading. "clip" hides it without that. */
html:has(body.dc-page), body.dc-page { overflow-x: clip; }
.dc-muted { color: var(--muted); }

/* ── top bar ───────────────────────────────────────────── */
.dc-top { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--line); }
.dc-top-in { display: flex; align-items: center; gap: 18px; height: var(--top); padding: 0 20px; }
.dc-tag { margin-left: -10px; padding: 1px 7px; border-radius: 4px; background: var(--bg-2); color: var(--muted);
  font: 600 12px/18px var(--mono); }
.dc-menu { display: none; padding: 6px; border: 0; border-radius: 4px; background: none; color: var(--fg); cursor: pointer; }
.dc-menu:hover { background: var(--hover); }
.dc-search-btn { display: flex; align-items: center; gap: 8px; width: 300px; height: 36px; padding: 0 8px 0 12px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg-2); color: var(--muted); font: 14px var(--sans);
  cursor: pointer; }
.dc-search-btn:hover { border-color: #5c5f66; color: var(--fg); }
.dc-search-btn span { flex: 1; text-align: left; }
kbd { padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: var(--bg);
  color: var(--muted); font: 11px/16px var(--mono); }
.dc-top nav { display: flex; gap: 20px; }
.dc-top nav a { color: var(--muted); font-weight: 500; }
.dc-top nav a.on, .dc-top nav a:hover { color: var(--head); text-decoration: none; }
.dc-top .right { margin-left: auto; }
.btn.sm { min-height: 32px; padding: 2px 12px; font-size: 13px; }

/* ── layout ────────────────────────────────────────────── */
.dc-shell { display: flex; align-items: flex-start; }
.dc-side { position: sticky; top: var(--top); flex: none; width: var(--side); height: calc(100vh - var(--top));
  overflow-y: auto; padding: 18px 12px 40px; border-right: 1px solid var(--line); background: var(--bg-2); }
.dc-main { flex: 1; min-width: 0; display: flex; justify-content: center; gap: 48px; padding: 36px 40px 96px; }
.dc-article { flex: 1; min-width: 0; max-width: 780px; }

/* ── sidebar ───────────────────────────────────────────── */
.dc-group + .dc-group { margin-top: 6px; }
.dc-group-btn { display: flex; align-items: center; gap: 6px; width: 100%; padding: 8px 8px; border: 0; border-radius: 4px;
  background: none; color: var(--head); font: 700 12px/16px var(--sans); letter-spacing: .04em; text-transform: uppercase;
  cursor: pointer; }
.dc-group-btn:hover { background: var(--hover); }
.dc-group-btn svg { flex: none; color: var(--muted); transition: transform .15s ease; }
.dc-group.shut .dc-group-btn svg { transform: rotate(-90deg); }
.dc-group.shut ul { display: none; }
.dc-group ul { margin: 2px 0 0; padding: 0; list-style: none; }
.dc-group li a { display: block; margin: 1px 0; padding: 6px 10px 6px 22px; border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0; color: var(--muted); font-size: 14px; text-decoration: none; }
.dc-group li a:hover { background: var(--hover); color: var(--head); }
.dc-group li a.on { border-left-color: var(--blurple); background: rgba(88, 101, 242, .16); color: var(--head); font-weight: 600; }

/* ── the guide ─────────────────────────────────────────── */
.dc-crumb { margin-bottom: 6px; color: var(--blurple); font: 600 13px var(--sans); }
.dc-article h1 { margin: 0 0 22px; color: var(--head); font-size: 34px; line-height: 1.2; font-weight: 800; }
.dc-body { font-size: 16px; line-height: 1.7; }
.dc-body h2 { margin: 44px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); color: var(--head);
  font-size: 23px; line-height: 1.3; scroll-margin-top: calc(var(--top) + 16px); }
.dc-body h3 { margin: 30px 0 8px; color: var(--head); font-size: 18px; scroll-margin-top: calc(var(--top) + 16px); }
.dc-body h2 .dc-anchor, .dc-body h3 .dc-anchor { margin-left: 8px; color: var(--faint); opacity: 0; text-decoration: none; }
.dc-body h2:hover .dc-anchor, .dc-body h3:hover .dc-anchor { opacity: 1; }
.dc-body p { margin: 0 0 16px; }
.dc-body ul, .dc-body ol { margin: 0 0 16px; padding-left: 24px; }
.dc-body li { margin: 4px 0; }
.dc-body strong { color: var(--head); }
.dc-body code { color: #e9eaec; }
.dc-body a code { color: inherit; }
.dc-body hr { margin: 32px 0; border: 0; border-top: 1px solid var(--line); }

/* code blocks */
.dc-code { position: relative; margin: 0 0 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-3); }
.dc-code-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 14px;
  border-bottom: 1px solid var(--line); color: var(--muted); font: 600 12px var(--mono); }
.dc-copy { padding: 3px 10px; border: 0; border-radius: 4px; background: #4e5058; color: #fff; font: 600 12px/16px var(--sans);
  cursor: pointer; }
.dc-copy:hover { background: #6d6f78; }
.dc-copy.done { background: var(--green); }
.dc-body pre { margin: 0; padding: 14px 16px; overflow-x: auto; }
.dc-body pre code { padding: 0; background: none; color: #dbdee1; font-size: 14px; line-height: 1.5; }
.tk-c { color: #80848e; font-style: italic; }
.tk-s { color: #57d18b; }
.tk-k { color: #c792ea; }
.tk-f { color: #82aaff; }
.tk-n { color: #f78c6c; }
.tk-p { color: #00a8fc; }

/* tip boxes and tables */
.dc-body blockquote { margin: 0 0 20px; padding: 12px 16px; border-left: 4px solid var(--blurple); border-radius: 0 6px 6px 0;
  background: rgba(88, 101, 242, .1); }
.dc-body blockquote p:last-child { margin-bottom: 0; }
.dc-body .table { margin: 0 0 20px; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.dc-body table { width: 100%; border-collapse: collapse; font-size: 14px; }
.dc-body th { padding: 10px 14px; background: var(--bg-2); color: var(--head); text-align: left; font-weight: 600; }
.dc-body td { padding: 9px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.dc-body td code { white-space: nowrap; }

/* previous / next */
.dc-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 56px; padding-top: 24px;
  border-top: 1px solid var(--line); }
.dc-pager a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; color: var(--head);
  font-weight: 600; text-decoration: none; }
.dc-pager a:hover { border-color: var(--blurple); background: var(--bg-2); }
.dc-pager a small { display: block; margin-bottom: 2px; color: var(--muted); font-weight: 400; font-size: 12px; }
.dc-pager .next { grid-column: 2; text-align: right; }

/* ── on this page ──────────────────────────────────────── */
.dc-toc { position: sticky; top: calc(var(--top) + 36px); flex: none; width: var(--toc); max-height: calc(100vh - var(--top) - 60px);
  overflow-y: auto; font-size: 13px; }
.dc-toc h4 { margin: 0 0 10px; color: var(--head); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.dc-toc ul { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--line); }
.dc-toc a { display: block; margin-left: -1px; padding: 4px 0 4px 12px; border-left: 2px solid transparent; color: var(--muted);
  text-decoration: none; }
.dc-toc a.sub { padding-left: 24px; }
.dc-toc a:hover { color: var(--head); }
.dc-toc a.on { border-left-color: var(--blurple); color: var(--head); }

/* ── search ────────────────────────────────────────────── */
.dc-dialog { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: center; align-items: flex-start;
  padding: 10vh 16px 16px; background: rgba(0, 0, 0, .6); }
.dc-dialog-box { width: 640px; max-width: 100%; max-height: 72vh; display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); box-shadow: 0 16px 48px rgba(0, 0, 0, .5); }
.dc-search-field { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line);
  color: var(--muted); }
.dc-search-field input { flex: 1; min-width: 0; height: 54px; border: 0; background: none; color: var(--head);
  font: 17px var(--sans); outline: none; }
.dc-search-field input::-webkit-search-cancel-button { display: none; }
.dc-results { margin: 0; padding: 8px; overflow-y: auto; list-style: none; }
.dc-results a { display: block; padding: 10px 12px; border-radius: 6px; color: var(--fg); text-decoration: none; }
.dc-results a .t { color: var(--head); font-weight: 600; }
.dc-results a .s { color: var(--muted); font-size: 12px; }
.dc-results a .x { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.dc-results a mark { background: none; color: var(--link); }
.dc-results li.on a, .dc-results a:hover { background: var(--blurple); color: #fff; }
.dc-results li.on a .t, .dc-results li.on a .s, .dc-results li.on a .x, .dc-results li.on a mark { color: #fff; }
.dc-empty { padding: 24px 12px; color: var(--muted); text-align: center; }

/* ── smaller screens ───────────────────────────────────── */
@media (max-width: 1180px) { .dc-toc { display: none; } }
@media (max-width: 960px) {
  .dc-top nav { display: none; }
  .dc-search-btn { width: auto; flex: 1; max-width: 300px; }
}
@media (max-width: 820px) {
  .dc-menu { display: block; }
  .dc-side { position: fixed; left: 0; top: var(--top); z-index: 40; transform: translateX(-100%); transition: transform .2s ease; }
  .dc-side.open { transform: none; }
  .dc-scrim { position: fixed; inset: var(--top) 0 0 0; z-index: 35; background: rgba(0, 0, 0, .5); }
  .dc-main { padding: 24px 16px 72px; }
  .dc-article h1 { font-size: 28px; }
}
@media (max-width: 560px) {
  .dc-top-in { gap: 10px; padding: 0 12px; }
  .dc-top .brand span[data-bot-name], .dc-tag, .dc-top .right { display: none; }
  .dc-search-btn kbd { display: none; }
  .dc-pager { grid-template-columns: 1fr; }
  .dc-pager .next { grid-column: 1; }
}
