/* Shared Docs layout. Site colors and fonts are inherited from assets/css/main.css. */
.docs-page { --docs-border: color-mix(in srgb, var(--heading-color), transparent 84%); }
    .docs-page .mobile-nav-toggle { border: 0; background: transparent; padding: 8px; }
    .docs-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 56px; padding-top: 42px; padding-bottom: 70px; align-items: start; }
    .docs-sidebar { position: sticky; top: 120px; max-height: calc(100vh - 144px); overflow-y: auto; padding-right: 24px; border-right: 1px solid var(--docs-border); }
    .docs-sidebar-title { color: var(--heading-color); font-family: var(--heading-font); font-size: 1.15rem; font-weight: 800; margin-bottom: 18px; }
    .docs-sidebar .docs-current { color: var(--heading-color); font-weight: 700; font-size: .93rem; margin-bottom: 14px; }
    .docs-sidebar ol { list-style: none; padding: 0; margin: 0; }
    .docs-sidebar li { margin: 3px 0; }
    .docs-sidebar a { display: block; padding: 9px 12px; border-left: 2px solid transparent; color: var(--default-color); font-size: .9rem; line-height: 1.5; }
    .docs-sidebar a:hover, .docs-sidebar a[aria-current="location"] { color: var(--accent-color); background: #f6f7ff; border-left-color: var(--accent-color); }
    .docs-sidebar .docs-back { margin-top: 26px; padding-left: 0; color: var(--heading-color); font-size: .85rem; }
    .docs-article { min-width: 0; max-width: 820px; line-height: 1.85; }
    .docs-breadcrumb { color: #626b78; font-size: .85rem; margin-bottom: 14px; }
    .docs-article h1 { font-size: clamp(1.75rem, 3vw, 2.35rem); line-height: 1.3; font-weight: 800; margin-bottom: 16px; }
    .docs-lead { font-size: 1.08rem; color: var(--heading-color); line-height: 1.75; }
    .docs-sample-note { font-size: .85rem; color: #626b78; border-bottom: 1px solid var(--docs-border); padding-bottom: 24px; margin-bottom: 0; }
    .docs-article section { padding: 34px 0 0; overflow: visible; scroll-margin-top: 120px; }
    .docs-article h2 { scroll-margin-top: 120px; font-size: 1.4rem; font-weight: 800; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--docs-border); }
    .docs-article p { margin-bottom: 16px; }
    .docs-article figure.figure { display: block; width: 100%; max-width: 640px; margin-left: auto; margin-right: auto; }
    .docs-article figure.figure img { display: block; max-width: 100%; height: auto; }
    .docs-equation { overflow-x: auto; overflow-y: hidden; margin: 22px 0; padding: 4px 0; }
    .docs-equation mjx-container[display="true"] { margin: .75em 0 !important; }
    .docs-note { border-left: 3px solid var(--heading-color); background: #f6f7ff; padding: 16px 20px; margin: 22px 0; font-size: .95rem; }
    .docs-note p:last-child { margin-bottom: 0; }
    .docs-article .table { font-size: .94rem; vertical-align: middle; }
    .docs-article .table th { color: var(--heading-color); font-weight: 700; }
    .docs-references { padding-left: 1.5rem; font-size: .93rem; }
    .docs-references li { padding-left: 6px; margin-bottom: 18px; scroll-margin-top: 120px; overflow-wrap: anywhere; }
    .docs-footer { padding: 28px 0; border-top: 1px solid var(--docs-border); font-size: .8rem; text-align: center; }
    .docs-footer p { margin-bottom: 6px; }
    @media (max-width: 991.98px) {
      .docs-layout { grid-template-columns: 200px minmax(0, 1fr); gap: 28px; }
      .docs-sidebar { padding-right: 14px; }
    }
    @media (max-width: 767.98px) {
      .docs-layout { display: block; padding-top: 20px; }
      .docs-sidebar { position: static; max-height: none; border: 1px solid var(--docs-border); border-radius: 5px; padding: 14px 16px; margin-bottom: 28px; }
      .docs-sidebar-title { margin-bottom: 14px; }
      .docs-sidebar .docs-back { margin-top: 12px; }
      .docs-article { font-size: .97rem; }
      .docs-article section { scroll-margin-top: 100px; }
    }
    @media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.docs-layout { min-height: calc(100vh - 220px); }
.docs-sidebar a[aria-current="page"] { color: var(--accent-color); background: #f6f7ff; border-left-color: var(--accent-color); }
.docs-sidebar .docs-section-list { margin: 4px 0 12px; padding-left: 16px; }
.docs-sidebar .docs-section-list a { padding: 7px 10px; font-size: .82rem; }
.docs-status { color: #626b78; margin-top: 20px; }
.docs-index-list { padding-left: 1.25rem; }
.docs-index-list li { margin-bottom: 14px; }

/* Reference preview: hover or focus a citation; the citation itself stays a link. */
.docs-reference-preview {
    position: fixed;
    z-index: 1100;
    display: block;
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    color: var(--default-color);
    background: var(--surface-color);
    border: 1px solid var(--docs-border);
    border-radius: 5px;
    box-shadow: 0 6px 24px rgba(45, 64, 95, 0.16);
    font-size: .9rem;
    line-height: 1.7;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
}
.docs-reference-preview[hidden] { display: none; }
.docs-reference-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 14px;
    color: var(--heading-color);
    background: #f6f7ff;
    border-bottom: 1px solid var(--docs-border);
}
.docs-reference-preview-body { display: block; padding: 14px; }
.docs-reference-close {
    flex-shrink: 0;
    border: 0;
    background: transparent;
    color: var(--heading-color);
    font-size: 1.4rem;
    line-height: 1;
    padding: 4px 6px;
    cursor: pointer;
}
.docs-reference-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin-left: 3px;
    padding: 0;
    border: 1px solid var(--docs-border);
    border-radius: 50%;
    color: var(--heading-color);
    background: #f6f7ff;
    font-family: var(--default-font);
    font-size: .8rem;
    font-weight: 700;
    vertical-align: baseline;
}
.docs-reference-close:focus-visible, .docs-reference-toggle:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}
@media (hover: none), (any-pointer: coarse) {
    .docs-reference-toggle { display: inline-flex; }
}
