/* Documentation layout and typography. Theme colors come from site.css. */
.docs-shell  {
  --qf-accent: var(--qf-notebook-accent);
  --accent: var(--qf-notebook-accent);
  --doc-bg: var(--qf-surface);
  --doc-panel: var(--qf-surface-soft);
  --doc-selection: color-mix(in srgb, var(--accent) 14%, var(--doc-panel));
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  margin-block: 88px 32px;
  min-height: calc(100svh - 176px);
  background: var(--qf-surface-fill);
  overflow: visible;
  font-size: 15px;
}

/* Compact explorer: consistent rows and modest indentation, like a notebook. */
.docs-shell .explorer  {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow-y: auto;
  padding: 30px 16px 20px;
  border-right: 1px solid var(--qf-line);
  border-radius: 10px 0 0 10px;
  background: var(--doc-panel);
}

.docs-shell .explorer .eyebrow  {
  font-size: 9px;
  letter-spacing: 1.4px;
  margin-bottom: 12px;
}

.docs-shell .explorer h2  {
  font-size: 24px;
  letter-spacing: -.7px;
  margin: 0;
}

.docs-shell .explorer h2 span  {
  color: var(--accent);
}

.docs-shell .search-box  {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 12px;
  padding: 7px 10px;
  border: 1px solid var(--qf-line);
  border-radius: 6px;
  background: var(--qf-search-bg, var(--qf-surface-inset));
}

.docs-shell .search-box > span  {
  font-size: 22px;
  line-height: 1;
}

.docs-shell .search-box input  {
  width: 100%;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--qf-ink);
  font-size: 13px;
  font-weight: 500;
  outline-offset: 1px;
}

.docs-shell .search-box input::placeholder  {
  color: var(--qf-muted);
  opacity: 1;
}

.docs-shell .search-box kbd  {
  font-size: 10px;
  color: var(--qf-muted);
  border: 1px solid var(--qf-line);
  padding: 0 4px;
  border-radius: 3px;
}

.docs-shell .explorer-options  {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--qf-muted);
  font-size: 11px;
  font-weight: 600;
}

.docs-shell .explorer-options button  {
  font-size: inherit;
  font-weight: inherit;
  padding: 4px 0;
}

.docs-shell .file-tree details  {
  margin: 0;
}

.docs-shell .file-tree summary, .docs-shell .tree-note  {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  margin: 0;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
  color: var(--qf-ink);
  overflow-wrap: anywhere;
}

.docs-shell .file-tree summary  {
  cursor: var(--qf-cursor), pointer;
  list-style: none;
  font-weight: 650;
}

.docs-shell .file-tree summary::-webkit-details-marker  {
  display: none;
}

.docs-shell .file-tree summary::before  {
  content: '';
  flex: 0 0 5px;
  width: 5px;
  height: 5px;
  margin-right: 3px;
  border-right: 1.5px solid var(--qf-muted);
  border-bottom: 1.5px solid var(--qf-muted);
  transform: rotate(-45deg);
}

.docs-shell .file-tree details[open] > summary::before  {
  transform: rotate(45deg);
}

.docs-shell .tree-children  {
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid var(--qf-line);
}

.docs-shell .tree-note  {
  padding-left: 24px;
}

.docs-shell .file-tree summary:hover, .docs-shell .tree-note:hover  {
  background: var(--doc-selection);
}

.docs-shell .tree-note.active  {
  background: var(--doc-selection);
  color: var(--accent);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--accent);
}

.docs-shell .file-tree :focus-visible  {
  outline-offset: -2px;
}

.docs-shell .search-result  {
  display: block;
  padding: 10px 8px;
  border-bottom: 1px solid var(--qf-line);
  font-size: 13px;
}

.docs-shell .search-result strong  {
  color: var(--accent);
  font-weight: 700;
}

.docs-shell .search-result small  {
  display: block;
  margin-top: 4px;
  color: var(--qf-muted);
  font-size: 12px;
  line-height: 1.5;
}

.docs-shell .search-result:hover  {
  background: var(--doc-selection);
}

.docs-shell .search-empty  {
  padding: 8px;
  font-size: 13px;
  color: var(--qf-muted);
}

/* Reading pane keeps the full available width; supporting links live below it. */
.docs-shell .reading-pane  {
  min-width: 0;
}

.docs-shell .note-toolbar  {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 56px;
  padding: 14px 36px;
  border-bottom: 1px solid var(--qf-line);
  color: var(--qf-muted);
  font-size: 12px;
  font-weight: 500;
}

.docs-shell .reading-actions  {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-shrink: 0;
}

.docs-shell .reading-actions button  {
  padding: 4px 0;
  font-size: 12px;
  font-weight: 600;
}

.docs-shell .note-layout  {
  padding: 32px 36px 48px;
}

.docs-shell .note-content  {
  min-width: 0;
  overflow-wrap: anywhere;
}

.docs-shell .note-category  {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
}

.docs-shell .note-title  {
  margin: 0 0 12px;
  font-size: clamp(30px, 3vw, 40px);
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -1.2px;
}

.docs-shell .note-meta  {
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--qf-line);
  color: var(--qf-muted);
  font-size: 12px;
  font-weight: 500;
}

.docs-shell .note-body  {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.75;
}

.docs-shell .note-body :is(h1, h2, h3, h4, h5, h6)  {
  font-family: var(--qf-font);
  font-weight: 750;
  letter-spacing: -.3px;
  line-height: 1.3;
  scroll-margin-top: 25px;
  color: var(--accent);
}

.docs-shell .note-body h1  {
  font-size: 28px;
  margin: 30px 0 14px;
}

.docs-shell .note-body h2  {
  font-size: 24px;
  margin: 28px 0 12px;
}

.docs-shell .note-body h3  {
  font-size: 20px;
  margin: 24px 0 10px;
}

.docs-shell .note-body :is(h4, h5, h6)  {
  font-size: 16px;
  margin: 20px 0 8px;
}

.docs-shell .note-body p  {
  margin: 12px 0;
}

.docs-shell .note-body :is(strong, b)  {
  font-weight: 750;
}

.docs-shell .note-body em  {
  font-family: inherit;
  font-weight: inherit;
}

.docs-shell .note-body a  {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  text-underline-offset: 3px;
}

.docs-shell .note-body a:hover  {
  text-decoration-color: currentColor;
}

.docs-shell .note-body img  {
  max-height: 600px;
  object-fit: contain;
  border-radius: 6px;
  margin: 20px auto;
}

.docs-shell .note-body pre  {
  position: relative;
  background: var(--doc-panel);
  border: 1px solid var(--qf-line);
  padding: 34px 18px 18px;
  border-radius: 6px;
  overflow: auto;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.7;
  white-space: pre;
  overflow-wrap: normal;
}

.docs-shell .note-body code  {
  font-family: Consolas, monospace;
  font-size: .9em;
  background: var(--doc-panel);
  padding: 2px 5px;
  border-radius: 3px;
}

.docs-shell .note-body pre code  {
  padding: 0;
  background: none;
  font-size: inherit;
}

.docs-shell .code-language  {
  position: absolute;
  top: 8px;
  left: 18px;
  color: var(--qf-muted);
  font-size: 10px;
}

.docs-shell .note-body blockquote  {
  margin: 18px 0;
  padding: 4px 18px;
  border-left: 3px solid var(--accent);
  background: var(--doc-panel);
  color: var(--qf-muted);
}

.docs-shell .note-body hr  {
  border: 0;
  border-top: 1px solid var(--qf-line);
  margin: 26px 0;
}

.docs-shell .table-scroll  {
  overflow: auto;
  margin: 20px 0;
}

.docs-shell .note-body table  {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.docs-shell .note-body th  {
  text-align: left;
  background: var(--doc-panel);
  font-weight: 700;
}

.docs-shell .note-body :is(td, th)  {
  border-bottom: 1px solid var(--qf-line);
  padding: 10px 12px;
  min-width: 90px;
}

.docs-shell .unresolved  {
  color: var(--qf-muted);
  border-bottom: 1px dashed var(--qf-muted);
}

.docs-shell .note-bottom  {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--qf-line);
  color: var(--qf-muted);
  font-size: 12px;
}

/* Outline, connections and backlinks share a separate supporting section. */
.docs-shell .note-context  {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 28px;
  padding: 28px 36px 36px;
  border-top: 1px solid var(--qf-line);
  border-radius: 0 0 10px 0;
  background: var(--doc-panel);
}

.docs-shell .note-context > div  {
  min-width: 0;
}

.docs-shell .context-title  {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1px;
}

.docs-shell .context-title button  {
  padding: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
}

.docs-shell .note-graph  {
  height: 185px;
  border: 1px solid var(--qf-line);
  border-radius: 6px;
}

.docs-shell .note-graph svg  {
  width: 100%;
  height: 100%;
}

.docs-shell .note-graph line  {
  stroke: var(--qf-muted);
  opacity: .3;
  stroke-width: 1;
}

.docs-shell .note-graph circle  {
  fill: var(--qf-muted);
  stroke: var(--doc-bg);
  stroke-width: 2;
}

.docs-shell .note-graph .current circle, .docs-shell .note-graph a:hover circle  {
  fill: var(--accent);
}

.docs-shell .note-graph text  {
  fill: var(--qf-muted);
  font-size: 6px;
  pointer-events: none;
}

.docs-shell .graph-hint  {
  font-size: 11px;
  color: var(--qf-muted);
  line-height: 1.6;
}

.docs-shell :is(#toc, #backlinks) a  {
  display: block;
  padding: 4px 0;
  color: var(--qf-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.docs-shell :is(#toc, #backlinks) a:hover  {
  color: var(--accent);
}

.docs-shell #toc a  {
  border-left: 1px solid var(--qf-line);
  padding-left: 10px;
}

.docs-shell #toc a.subheading  {
  padding-left: 20px;
}

.docs-shell #backlinks p  {
  font-size: 12px;
  color: var(--qf-muted);
}

.docs-shell .docs-mobile-bar  {
  display: none;
}

.toast  {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 22px;
  border-radius: 5px;
  background: var(--qf-ink);
  color: var(--qf-surface);
  font-size: 13px;
  z-index: 50;
  box-shadow: 0 6px 25px #0002;
}

@media (max-width: 760px)  {
  .docs-shell  {
    display: block;
    margin-block: 56px 32px;
    min-height: calc(100svh - 176px);
  }

  .docs-shell .docs-mobile-bar  {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px 10px;
    border-bottom: 1px solid var(--qf-line);
    background: var(--doc-panel);
    font-size: 12px;
    font-weight: 600;
  }

  .docs-shell .docs-mobile-bar button  {
    min-height: 32px;
    padding: 0;
    font-size: 13px;
    font-weight: 650;
  }

  .docs-shell .explorer  {
    display: none;
    position: relative;
    height: auto;
    max-height: 65svh;
    border-right: 0;
    border-bottom: 1px solid var(--qf-line);
    border-radius: 0;
  }

  .docs-shell .explorer.open  {
    display: block;
  }

  .docs-shell .file-tree summary, .docs-shell .tree-note  {
    min-height: 36px;
    padding-block: 8px;
  }

  .docs-shell .note-toolbar  {
    padding: 12px 22px;
    gap: 15px;
  }

  .docs-shell #breadcrumbs  {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .docs-shell .note-layout  {
    padding: 26px 22px 36px;
  }

  .docs-shell .note-title  {
    font-size: 30px;
  }

  .docs-shell .note-body h2  {
    font-size: 22px;
  }

  .docs-shell .note-context  {
    padding: 24px 22px 32px;
  }

  .docs-shell .note-graph  {
    height: 220px;
  }

}
