/* docs page: sticky header, section sidebar, page, outline on the right */
:root {
  color-scheme: light;
  --bg: #fff;
  --bar: rgba(255, 255, 255, 0.88);
  --text: #1d1d1d;
  --tint: #6e6e6e;
  --side: rgba(29, 29, 29, 0.64);
  --line: #e5e5e5;
  --soft: #f7f7f7;
  --primary: #7b5ce6;
  --primary-soft: rgba(123, 92, 230, 0.1);
  --shade: rgba(0, 0, 0, 0.32);
  --bar-h: 109px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1d1d1d;
  --bar: rgba(29, 29, 29, 0.88);
  --text: #ededed;
  --tint: #a0a0a0;
  --side: rgba(237, 237, 237, 0.64);
  --line: #363636;
  --soft: #282828;
  --primary: #a48ff2;
  --primary-soft: rgba(164, 143, 242, 0.14);
  --shade: rgba(0, 0, 0, 0.6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1d1d1d;
    --bar: rgba(29, 29, 29, 0.88);
    --text: #ededed;
    --tint: #a0a0a0;
    --side: rgba(237, 237, 237, 0.64);
    --line: #363636;
    --soft: #282828;
    --primary: #a48ff2;
    --primary-soft: rgba(164, 143, 242, 0.14);
    --shade: rgba(0, 0, 0, 0.6);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 16px; line-height: 26px; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }

/* header */
.bar { position: sticky; top: 0; z-index: 30; background: var(--bar); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.bar-top { max-width: 1536px; height: 64px; margin: 0 auto; padding: 0 32px; display: flex; align-items: center; gap: 16px; }
.bar-brand { width: 320px; flex: none; display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; letter-spacing: -0.2px; }
.bar-brand img { width: auto; height: 30px; }
.bar-burger { display: none; width: 36px; height: 36px; flex: none; }
.bar-burger i { display: block; width: 18px; height: 12px; margin: auto; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; position: relative; }
.bar-burger i::after { content: ''; position: absolute; left: 0; right: 0; top: 3px; border-top: 2px solid currentColor; }
.bar-search { width: 360px; height: 40px; padding: 0 8px 0 12px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 24px; color: var(--tint); font-size: 14px; }
.bar-search:hover { border-color: var(--primary); }
.bar-search span { flex: 1; text-align: left; }
kbd { min-width: 22px; padding: 1px 5px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--tint); font-family: inherit; font-size: 11px; line-height: 18px; text-align: center; }
.bar-home { margin-left: auto; height: 36px; padding: 0 16px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 20px; font-size: 14px; font-weight: 500; }
.bar-home:hover { border-color: var(--primary); color: var(--primary); }
.bar-tabs { max-width: 1536px; height: 44px; margin: 0 auto; padding: 0 20px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.bar-tabs::-webkit-scrollbar { display: none; }
.bar-tabs a { position: relative; flex: none; margin: 6px 0 5px; padding: 0 12px; display: flex; align-items: center; gap: 6px; color: var(--tint); font-size: 14px; font-weight: 500; }
.bar-tabs a:hover { color: var(--text); }
.bar-tabs a[aria-current] { color: var(--primary); }
.bar-tabs a[aria-current]::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -6px; height: 2px; background: var(--primary); }

/* three columns */
.shell { max-width: 1536px; margin: 0 auto; padding: 0 32px; display: grid; grid-template-columns: 320px minmax(0, 768px) 256px; column-gap: 16px; justify-content: space-between; align-items: start; }

.side { position: sticky; top: var(--bar-h); width: 288px; max-height: calc(100vh - var(--bar-h)); padding: 32px 0 24px; overflow-y: auto; scrollbar-width: thin; }
.side-group + .side-group { margin-top: 24px; }
.side h2 { margin: 0 0 4px; padding: 6px 6px 6px 12px; font-size: 12px; font-weight: 600; line-height: 16px; letter-spacing: 0.3px; text-transform: uppercase; }
.side a { display: block; padding: 6px 6px 6px 12px; border-left: 2px solid transparent; border-radius: 0 16px 16px 0; color: var(--side); font-size: 14px; line-height: 20px; }
.side a:hover { background: var(--soft); color: var(--text); }
.side a[aria-current] { border-left-color: var(--primary); color: var(--primary); font-weight: 600; }
.side a.side-sub { padding-left: 26px; font-size: 13px; }
.side-shade { display: none; }

/* page */
.page { min-width: 0; padding: 32px 0; }
.crumb { margin: 0 0 16px; display: flex; align-items: center; gap: 6px; color: var(--tint); font-size: 12px; line-height: 16px; }
.crumb .ic { width: 13px; height: 13px; }
.docs-panel { display: none; }
.docs-panel.is-open { display: block; }
.docs-panel h1 { margin: 0 0 12px; font-size: 36px; font-weight: 700; line-height: 45px; letter-spacing: -0.9px; overflow-wrap: anywhere; }
.docs-panel h2 { position: relative; margin: 40px 0 0; font-size: 24px; font-weight: 600; line-height: 32px; letter-spacing: -0.3px; scroll-margin-top: calc(var(--bar-h) + 24px); }
.docs-panel h1 + h2 { margin-top: 24px; }
.docs-panel p { margin: 20px 0 0; }
.docs-panel b { font-weight: 600; }
.docs-anchor { position: absolute; left: -26px; top: 0; width: 26px; color: var(--tint); font-weight: 400; opacity: 0; }
.docs-panel h2:hover .docs-anchor, .docs-anchor:focus-visible { opacity: 1; }
.docs-anchor:hover { color: var(--primary); }

.docs-table { width: 100%; margin: 20px 0 0; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; line-height: 20px; }
.docs-table th { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; font-weight: 600; background: var(--soft); }
.docs-table th:first-child { border-top-left-radius: 7px; }
.docs-table th:last-child { border-top-right-radius: 7px; }
.docs-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.docs-table tr:last-child td { border-bottom: 0; }

.docs-list, .docs-steps { margin: 20px 0 0; padding-left: 24px; line-height: 24px; }
.docs-list li, .docs-steps li { margin-bottom: 8px; padding-left: 4px; }
.docs-list li:last-child, .docs-steps li:last-child { margin-bottom: 0; }
.docs-list li::marker, .docs-steps li::marker { color: var(--tint); }

/* screenshots in the guides */
.docs-note { padding: 12px 16px; border-left: 3px solid var(--primary); border-radius: 0 8px 8px 0; background: var(--primary-soft); }
.docs-note a { color: var(--primary); font-weight: 600; }
.docs-shot { margin: 20px 0 0; }
.docs-shot img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: #fbf0dc; cursor: zoom-in; }
.docs-shot figcaption { margin-top: 8px; color: var(--tint); font-size: 14px; line-height: 20px; }
.docs-shot.is-narrow { max-width: 480px; }
.docs-shots { margin: 20px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.docs-shots.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.docs-shots .docs-shot { margin: 0; }

.pager { margin-top: 48px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pager a { padding: 12px 16px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--tint); }
.pager a:hover { border-color: var(--primary); color: var(--primary); }
.pager a.is-next { grid-column: 2; flex-direction: row-reverse; text-align: right; }
.pager a.is-prev .ic { transform: rotate(180deg); }
.pager span { min-width: 0; flex: 1; }
.pager small { display: block; font-size: 12px; line-height: 16px; }
.pager b { display: block; color: var(--text); font-size: 16px; font-weight: 500; line-height: 24px; }
.pager a:hover b { color: inherit; }

.page-foot { margin-top: 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--tint); font-size: 12px; line-height: 16px; }
.page-foot p { margin: 0; }
.theme { flex: none; padding: 3px; display: flex; gap: 2px; border: 1px solid var(--line); border-radius: 20px; }
.theme button { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: var(--tint); }
.theme button:hover { color: var(--text); }
.theme button[aria-pressed="true"] { color: var(--primary); background: var(--primary-soft); }

/* on this page */
.toc { position: sticky; top: var(--bar-h); max-height: calc(100vh - var(--bar-h)); padding: 32px 0 24px; overflow-y: auto; scrollbar-width: thin; }
.toc h2 { margin: 0 0 12px; display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; line-height: 16px; letter-spacing: 0.3px; text-transform: uppercase; }
.toc .ic { width: 13px; height: 13px; }
.toc nav { border-left: 1px solid var(--line); }
.toc a { display: block; margin-left: -1px; padding: 4px 12px; border-left: 2px solid transparent; color: var(--tint); font-size: 14px; line-height: 20px; }
.toc a:hover { color: var(--text); }
.toc a[aria-current] { border-left-color: var(--primary); color: var(--primary); font-weight: 500; }

/* footer */
.foot { border-top: 1px solid var(--line); }
.foot-in { max-width: 1536px; margin: 0 auto; padding: 40px 32px; display: flex; flex-wrap: wrap; gap: 32px 96px; }
.foot-brand { width: 240px; display: flex; align-items: center; gap: 10px; align-self: flex-start; font-size: 20px; font-weight: 700; letter-spacing: -0.2px; }
.foot-brand img { width: auto; height: 34px; }
.foot-col h2 { margin: 0 0 8px; font-size: 14px; font-weight: 600; line-height: 20px; }
.foot-col a { display: block; padding: 8px 0; color: var(--tint); font-size: 14px; line-height: 20px; }
.foot-col a:hover { color: var(--primary); }

/* search */
.find { position: fixed; inset: 0; z-index: 50; padding: 12vh 16px 16px; background: var(--shade); }
.find[hidden] { display: none; }
.find-box { max-width: 640px; max-height: 76vh; margin: 0 auto; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2); }
.find-field { padding: 0 16px; display: flex; align-items: center; gap: 10px; color: var(--tint); }
.find-field input { min-width: 0; flex: 1; height: 52px; border: 0; outline: 0; background: none; color: var(--text); font: inherit; }
.find-field input::-webkit-search-cancel-button { display: none; }
.find-list { overflow-y: auto; border-top: 1px solid var(--line); padding: 8px; }
.find-list:empty { display: none; }
.find-list a { display: block; padding: 10px 12px; border-radius: 10px; font-size: 14px; line-height: 20px; }
.find-list a.is-on { background: var(--primary-soft); }
.find-list b { display: block; font-weight: 600; }
.find-list small { display: block; color: var(--tint); font-size: 13px; }
.find-list mark { background: none; color: var(--primary); font-weight: 600; }
.find-none { padding: 16px 12px; color: var(--tint); font-size: 14px; }

/* no outline column */
@media (max-width: 1279px) {
  .shell { grid-template-columns: 320px minmax(0, 768px); justify-content: start; }
  .toc { display: none; }
}

/* phones and tablets: the sidebar slides in from the left */
@media (max-width: 1023px) {
  :root { --bar-h: 101px; }
  .bar-top { height: 56px; padding: 0 16px; gap: 8px; }
  .bar-burger { display: block; }
  .bar-brand { width: auto; min-width: 0; font-size: 16px; }
  .bar-brand img { height: 26px; }
  .bar-search { width: 36px; height: 36px; margin-left: auto; padding: 0; justify-content: center; flex: none; }
  .bar-search span, .bar-search kbd { display: none; }
  .bar-home { display: none; }
  .bar-tabs { padding: 0 4px; }
  .shell { padding: 0 16px; display: block; }
  .side { position: fixed; z-index: 40; top: 0; left: 0; bottom: 0; width: 288px; max-width: calc(100% - 56px); max-height: none; padding: 20px 12px 24px 0; background: var(--bg); border-right: 1px solid var(--line); transform: translateX(-100%); visibility: hidden; transition: transform 0.2s ease, visibility 0.2s; }
  .side-open .side { transform: none; visibility: visible; }
  .side-open .side-shade { display: block; position: fixed; z-index: 35; inset: 0; background: var(--shade); }
  .page { padding: 24px 0 32px; }
  .docs-panel h1 { font-size: 30px; line-height: 38px; }
  .docs-anchor { display: none; }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager a.is-next { grid-column: 1; }
  .page-foot { align-items: flex-start; }
  .docs-shots { gap: 12px; }
  .foot-in { padding: 32px 16px; }
}
