/* The public documentation: navigation on the left, the page in the middle, its sections on the right. */
.docpage { min-height: 100vh; }
.dhead { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; height: 60px; padding: 0 20px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.dhead__menu { display: none; }
.dhead__logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.dhead__logo img { display: block; }
.dhead__docs { padding: 2px 8px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); color: var(--muted); font-size: 0.74rem; font-weight: 550; }
.dhead__app { margin-left: 4px; }

.dsearch { position: relative; flex: 1; max-width: 420px; margin-left: auto; }
.dsearch__input { width: 100%; height: 38px; }
.dsearch__results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; max-height: 60vh; overflow-y: auto; padding: 6px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-input); box-shadow: 0 18px 40px rgb(0 0 0 / 0.35); }
.dsearch__results a { display: grid; gap: 2px; padding: 8px 10px; border-radius: 8px; text-decoration: none; }
.dsearch__results a:hover, .dsearch__results a[aria-selected="true"] { background: var(--surface-2); }
.dsearch__results strong { font-weight: 550; }
.dsearch__results small { color: var(--muted); font-size: 0.78rem; }
.dsearch__empty { padding: 10px; color: var(--muted); font-size: 0.86rem; }

.dlangs { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: var(--r-pill); }
.dlangs a { padding: 4px 9px; border-radius: var(--r-pill); color: var(--muted); font-size: 0.74rem; font-weight: 600; text-decoration: none; }
.dlangs a:hover { color: var(--text); }
.dlangs a[aria-current] { background: var(--accent-soft); color: var(--accent-text); }

.dshell { display: grid; grid-template-columns: 260px minmax(0, 1fr) 220px; gap: 40px; max-width: 1360px; margin: 0 auto; padding: 0 24px; }
.dnav { position: sticky; top: 60px; align-self: start; max-height: calc(100vh - 60px); overflow-y: auto; padding: 24px 4px 40px 0; scrollbar-width: thin; }
.dnav__section { margin: 18px 0 6px; color: var(--muted); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.dnav__section:first-child { margin-top: 0; }
.dnav a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--muted); font-size: 0.88rem; text-decoration: none; }
.dnav a:hover { color: var(--text); background: var(--surface); }
.dnav a[aria-current] { color: var(--accent-text); background: var(--accent-soft); font-weight: 550; }

.dmain { min-width: 0; padding: 36px 0 80px; }
.dtoc { position: sticky; top: 60px; align-self: start; max-height: calc(100vh - 60px); overflow-y: auto; padding: 36px 0 40px; font-size: 0.82rem; }
.dtoc__title { margin-bottom: 8px; font-weight: 600; }
.dtoc a { display: block; padding: 3px 0; color: var(--muted); text-decoration: none; }
.dtoc a:hover, .dtoc a.is-here { color: var(--text); }
.dtoc__l3 a { padding-left: 12px; }

/* the page */
.prose { max-width: 760px; font-size: 0.98rem; line-height: 1.7; }
.prose__head { margin-bottom: 28px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.prose h1 { font-size: 2.1rem; }
.prose__lead { margin-top: 10px; color: var(--muted); font-size: 1.08rem; }
.prose h2 { margin: 44px 0 12px; font-size: 1.35rem; scroll-margin-top: 80px; }
.prose h3 { margin: 30px 0 8px; font-size: 1.08rem; scroll-margin-top: 80px; }
.prose h2 .heading-permalink, .prose h3 .heading-permalink { margin-left: 8px; color: var(--muted); text-decoration: none; opacity: 0; }
.prose h2:hover .heading-permalink, .prose h3:hover .heading-permalink, .prose .heading-permalink:focus { opacity: 1; }
.prose p, .prose ul, .prose ol, .prose table, .prose .code, .prose .callout, .prose dl { margin: 0 0 16px; }
.prose ul { padding-left: 22px; list-style: disc; }
.prose ol { padding-left: 22px; list-style: decimal; }
.prose li { margin: 4px 0; }
.prose li > ul, .prose li > ol { margin: 4px 0 0; }
.prose a { color: var(--accent-text); text-underline-offset: 3px; }
.prose strong { font-weight: 600; }
.prose hr { margin: 32px 0; border: 0; border-top: 1px solid var(--line); }
.prose :not(pre) > code { padding: 2px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); font-size: 0.84em; overflow-wrap: anywhere; }
.prose table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 0.88rem; }
.prose th, .prose td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.prose td code { white-space: nowrap; }
.prose img { max-width: 100%; border-radius: 12px; border: 1px solid var(--line); }
.prose kbd { padding: 1px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; font: 0.82em var(--mono); }

/* screenshots */
.shot { margin: 8px 0 22px; }
.shot a { display: block; cursor: zoom-in; }
.shot img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); box-shadow: 0 10px 30px rgb(0 0 0 / 0.25); }
.shot figcaption { margin-top: 8px; color: var(--muted); font-size: 0.82rem; text-align: center; }
.zoom { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgb(0 0 0 / 0.82); cursor: zoom-out; }
.zoom img { max-width: 100%; max-height: 100%; border-radius: 10px; }

.callout { padding: 12px 16px; border-left: 3px solid var(--line-strong); border-radius: 0 10px 10px 0; background: var(--surface); }
.callout p:last-child { margin-bottom: 0; }
.callout__label { margin-bottom: 4px !important; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.callout--note { border-left-color: #6ea8fe; }
.callout--tip { border-left-color: var(--accent-text); }
.callout--warning { border-left-color: var(--danger); }

.code { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.code__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; padding: 0 8px 0 14px; border-bottom: 1px solid var(--line); }
.code__label { color: var(--muted); font-size: 0.76rem; font-weight: 550; }
.code__copy { padding: 4px 8px; border: 0; border-radius: 6px; background: none; color: var(--muted); font: 550 0.76rem var(--font); cursor: pointer; }
.code__copy:hover { background: var(--surface-2); color: var(--text); }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 0.82rem/1.6 var(--mono); tab-size: 2; }
.code code { font: inherit; white-space: pre; }
.codetabs { margin: 0 0 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.codetabs .code { margin: 0; border: 0; border-radius: 0; }
.codetabs .code__label { display: none; }
.codetabs__bar { display: flex; align-items: center; gap: 2px; padding: 4px 6px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.codetabs__tab { padding: 6px 10px; border: 0; border-radius: 7px; background: none; color: var(--muted); font: 550 0.78rem var(--font); cursor: pointer; white-space: nowrap; }
.codetabs__tab[aria-selected="true"] { background: var(--surface-2); color: var(--text); }
.codetabs .code__bar { position: absolute; right: 6px; top: 4px; min-height: 0; padding: 0; border: 0; }
.codetabs { position: relative; }

.dpager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 760px; margin-top: 48px; }
.dpager a { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; font-weight: 550; }
.dpager a:hover { border-color: var(--line-strong); }
.dpager small { color: var(--muted); font-weight: 400; font-size: 0.78rem; }
.dpager__next { grid-column: 2; text-align: right; }

.docpage .legal { max-width: 1360px; margin: 0 auto; }

@media (max-width: 1180px) {
  .dshell { grid-template-columns: 240px minmax(0, 1fr); }
  .dtoc { display: none; }
}
@media (max-width: 820px) {
  .dhead { gap: 10px; padding: 0 12px; }
  .dhead__menu { display: grid; }
  .dhead__docs, .dhead__app { display: none; }
  .dshell { grid-template-columns: minmax(0, 1fr); padding: 0 16px; }
  .dnav { position: fixed; top: 60px; left: 0; bottom: 0; z-index: 25; width: min(300px, 85vw); max-height: none; padding: 20px 16px; background: var(--bg); border-right: 1px solid var(--line); transform: translateX(-100%); transition: transform .2s; }
  .dnav.is-open { transform: none; }
  .prose h1 { font-size: 1.7rem; }
  .dpager { grid-template-columns: 1fr; }
  .dpager__next { grid-column: 1; }
}
