/* Shared reading surface, also exported to tensorplay-index. */
.tp-sphinx-content.tp-reference {
  --doc-fg: var(--color-fd-foreground, #18181b);
  --doc-muted: var(--color-fd-muted-foreground, #52525b);
  --doc-border: var(--color-fd-border, #e4e4e7);
  --doc-bg: var(--color-fd-background, #fff);
  --doc-surface: var(--color-fd-muted, #fafafa);
  --doc-link: var(--color-fd-accent-foreground, #0550ae);
  min-width: 0; color: var(--doc-muted); font-family: var(--tp-font-sans, system-ui, sans-serif); font-size: 15px; line-height: 1.75;
  overflow-wrap: anywhere;
}
.tp-sphinx-content.tp-reference :is(h1,h2,h3,h4) { color: var(--doc-fg); letter-spacing: -.025em; font-weight: 600; text-wrap: initial; }
.tp-sphinx-content.tp-reference h1 { max-width: none; font-size: clamp(26px, 2.5vw, 36px); line-height: 1.25; margin: 0 0 28px; }
.tp-sphinx-content.tp-reference h2 { font-size: 22px; line-height: 1.4; margin: 44px 0 20px; padding: 0 0 12px; border-bottom: 1px solid var(--doc-border); }
.tp-sphinx-content.tp-reference h2::before { content: none; }
.tp-sphinx-content.tp-reference h3 { font-size: 18px; line-height: 1.5; margin: 32px 0 16px; }
.tp-sphinx-content.tp-reference h4 { font-size: 16px; margin: 24px 0 12px; }
.tp-sphinx-content.tp-reference :is(p,li,dd,td,th) { font-size: 15px; line-height: 1.75; }
.tp-sphinx-content.tp-reference p { margin: 14px 0; max-width: 80ch; }
.tp-sphinx-content.tp-reference :is(ul,ol) { padding-left: 22px; margin: 16px 0; }
.tp-sphinx-content.tp-reference ul { list-style: disc; }
.tp-sphinx-content.tp-reference ol { list-style: decimal; }
.tp-sphinx-content.tp-reference li { margin: 5px 0; }
.tp-sphinx-content.tp-reference a { color: var(--doc-link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.tp-sphinx-content.tp-reference a:hover { color: var(--doc-fg); }
.tp-sphinx-content.tp-reference :is(code,tt) { font-family: var(--tp-font-mono, ui-monospace, monospace); font-size: .88em; color: var(--doc-fg); }
.tp-sphinx-content.tp-reference :not(pre) > code { background: var(--doc-surface); padding: 2px 4px; border-radius: 4px; }
.tp-sphinx-content.tp-reference pre { max-width: 100%; overflow: auto; padding: 18px 20px; margin: 20px 0; border: 1px solid var(--doc-border); border-radius: 8px; background: var(--doc-surface) !important; font-size: 13px; line-height: 1.7; }
.tp-sphinx-content.tp-reference pre code { padding: 0; background: none; font-size: inherit; color: inherit; }
.tp-sphinx-content.tp-reference pre :is(code,span) { border: 0; box-shadow: none; border-radius: 0; }
.dark .tp-reference pre.shiki span { color: var(--shiki-dark) !important; background: transparent !important; }
.tp-sphinx-content.tp-reference :is(dl.py,dl.cpp) { margin: 0 0 32px; padding: 0; }
.tp-sphinx-content.tp-reference dt.sig { position: relative; padding: 16px 38px 16px 18px; border: 1px solid var(--doc-border); border-radius: 8px; background: var(--doc-surface); font-family: var(--tp-font-mono, ui-monospace, monospace); font-size: 13px; line-height: 1.8; white-space: normal; overflow-wrap: anywhere; }
.tp-sphinx-content.tp-reference :is(dl.py,dl.cpp) > dd { padding: 18px 0 24px; margin: 0; border: 0; border-bottom: 1px solid var(--doc-border); border-radius: 0; background: transparent; }
.tp-sphinx-content.tp-reference :is(dl.py,dl.cpp) > dd:empty { padding: 0; border: 0; }
.tp-sphinx-content.tp-reference .sig-name { color: var(--doc-fg); font-weight: 600; }
.tp-sphinx-content.tp-reference .sig-prename { color: var(--doc-muted); }
.tp-sphinx-content.tp-reference .sig-param { font-style: normal; }
.tp-sphinx-content.tp-reference .field-list { margin: 20px 0; display: block; }
.tp-sphinx-content.tp-reference .field-list > dt { margin: 22px 0 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: var(--doc-muted); }
.tp-sphinx-content.tp-reference .field-list > dd { margin: 0 0 16px 16px; }
.tp-sphinx-content.tp-reference .pst-scrollable-table-container { max-width: 100%; overflow: auto; }
.tp-sphinx-content.tp-reference table { display: table; width: 100%; margin: 16px 0 28px; border-collapse: collapse; border-top: 1px solid var(--doc-border); }
.tp-sphinx-content.tp-reference :is(td,th) { min-width: 0; padding: 10px 12px; border-bottom: 1px solid var(--doc-border); text-align: left; vertical-align: top; font-size: 14px; }
.tp-sphinx-content.tp-reference table.autosummary td:first-child { width: 44%; min-width: 180px; }
.tp-sphinx-content.tp-reference table p { margin: 0; font-size: inherit; }
.tp-sphinx-content.tp-reference :is(.admonition,.topic) { padding: 16px 18px; margin: 24px 0; border: 1px solid var(--doc-border); border-left: 3px solid #69a5df; border-radius: 6px; background: var(--doc-surface); }
.tp-sphinx-content.tp-reference :is(.warning,.danger,.caution) { border-left-color: #d99039; }
.tp-sphinx-content.tp-reference .admonition-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-top: 0; }
.tp-sphinx-content.tp-reference .rubric { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; margin-top: 24px; }
.tp-sphinx-content.tp-reference .katex-display { overflow: auto; padding: 16px; margin: 24px 0; }
.tp-sphinx-content.tp-reference :is(img,video) { max-width: 100%; height: auto; }
.tp-sphinx-content.tp-reference [id] { scroll-margin-top: var(--doc-scroll-offset, 110px); }
.tp-sphinx-content.tp-reference :is(section,dt):target { outline: 2px solid color-mix(in srgb, var(--doc-link) 25%, transparent); outline-offset: 6px; }
.tp-api-kind { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 99px; font: 500 11px/1.6 var(--tp-font-mono, monospace); background: #438de51a; color: #3978bd; }
.dark .tp-api-kind { color: #91c2ff; }
.tp-api-kind--class { background: #d7a3261a; color: #94701c; }
.dark .tp-api-kind--class { color: #e6c05e; }
.tp-api-kind--attribute,.tp-api-kind--data { background: #a56bdc1a; color: #9566bd; }
@media (max-width: 640px) {
  .tp-sphinx-content.tp-reference h1 { font-size: 26px; }
  .tp-sphinx-content.tp-reference dt.sig { padding: 14px; }
  .tp-sphinx-content.tp-reference table.autosummary td:first-child { min-width: 145px; }
}

/* Semantic colours and API hierarchy, aligned with the npmx docs reference. */
.tp-sphinx-content.tp-reference {
  --doc-function: #8250df; --doc-keyword: #e83e56; --doc-type: #0969da;
  --doc-param: #bc4c00; --doc-value: #16804a; --doc-comment: #6e7781;
}
.dark .tp-sphinx-content.tp-reference {
  --doc-function: #c1a0ff; --doc-keyword: #ff7b8d; --doc-type: #79b8ff;
  --doc-param: #ffba7a; --doc-value: #7ee2a1; --doc-comment: #96a2b1;
}
.tp-sphinx-content.tp-reference .docs-api-section { margin: 0 0 64px; }
.tp-sphinx-content.tp-reference .docs-section-title { position: sticky; top: var(--doc-sticky-top, 0px); z-index: 2; margin: 0 0 32px; padding: 18px 0 12px; background: var(--doc-bg); font-size: 18px; letter-spacing: -.025em; }
.tp-sphinx-content.tp-reference .docs-section-count { font-size: 11px; font-weight: 400; margin-left: 5px; color: var(--doc-muted); vertical-align: middle; }
.tp-sphinx-content.tp-reference .docs-symbol { margin: 0 0 38px; padding: 0 0 30px; border-bottom: 1px solid color-mix(in srgb, var(--doc-border) 65%, transparent); }
.tp-sphinx-content.tp-reference .docs-symbol-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.tp-sphinx-content.tp-reference .docs-symbol-name { margin: 0; color: var(--doc-fg); font: 600 18px/1.5 var(--tp-font-mono, monospace); letter-spacing: -.03em; }
.tp-sphinx-content.tp-reference .docs-anchor { color: var(--doc-comment); font: 16px var(--tp-font-mono, monospace); text-decoration: none; }
.tp-sphinx-content.tp-reference .docs-symbol-permalink { margin-left: auto; color: var(--doc-muted); font-size: 11px; text-decoration: none; }
.tp-sphinx-content.tp-reference .docs-symbol :is(dl.py,dl.cpp) { margin-bottom: 0; }
.tp-sphinx-content.tp-reference .docs-symbol :is(dl.py,dl.cpp) > dd { border-bottom: 0; padding-bottom: 0; }
.tp-sphinx-content.tp-reference .docs-symbol dt.sig { background: var(--doc-bg); border-color: var(--doc-border); padding: 16px; border-radius: 8px; font-size: 14px; }
.tp-sphinx-content.tp-reference :is(.sig-name,.sig-name .pre) { color: var(--doc-function); }
.tp-sphinx-content.tp-reference :is(.sig-prename,.sig-prename .pre) { color: var(--doc-comment); }
.tp-sphinx-content.tp-reference :is(.sig-param .n,.sig-param .n .pre) { color: var(--doc-param); }
.tp-sphinx-content.tp-reference :is(.sig-param a,.sig-param a .pre,.sig-return-typehint,.sig-return-typehint .pre) { color: var(--doc-type); }
.tp-sphinx-content.tp-reference :is(.default_value,.default_value .pre) { color: var(--doc-value); }
.tp-sphinx-content.tp-reference :is(em.property,.sig-paren,.sig-param .o,.sig-param .o .pre) { color: var(--doc-keyword); }
.tp-sphinx-content.tp-reference :is(.deprecated,.versionmodified.deprecated) { border: 1px solid #e88b32; border-radius: 8px; padding: 16px; color: #af5100; background: #fff0df; }
.dark .tp-sphinx-content.tp-reference :is(.deprecated,.versionmodified.deprecated) { color: #ffb86b; background: #5c340b55; }
.tp-sphinx-content.tp-reference .tp-api-kind { font-size: 11px; font-family: var(--tp-font-mono, monospace); }
.tp-api-kind--function { color: #0878e8; background: #e8f2ff; }
.tp-api-kind--class,.tp-api-kind--enum { color: #966600; background: #fff5ca; }
.tp-api-kind--method { color: #7f40c5; background: #f3e9ff; }
.tp-api-kind--attribute,.tp-api-kind--data { color: #b9580a; background: #fff0df; }
.tp-api-kind--exception { color: #c9326f; background: #ffe9f1; }
.dark .tp-api-kind--function { color: #79b8ff; background: #153c634d; }
.dark .tp-api-kind--class,.dark .tp-api-kind--enum { color: #f0cc60; background: #614d194d; }
.dark .tp-api-kind--method { color: #c1a0ff; background: #5029764d; }
.dark .tp-api-kind--attribute,.dark .tp-api-kind--data { color: #ffb86b; background: #653b174d; }
.dark .tp-api-kind--exception { color: #ff94c0; background: #6727434d; }
@media (max-width: 640px) {
  .tp-sphinx-content.tp-reference .docs-symbol-header { gap: 8px; }
  .tp-sphinx-content.tp-reference .docs-symbol-name { font-size: 16px; }
  .tp-sphinx-content.tp-reference .docs-symbol-permalink { flex-basis: 100%; margin-left: 0; }
}
