/* Documentation typography. Style Sphinx's native Python and reST markup. */
:root,
[data-bs-theme="light"] {
  --cell-doc-muted: #566477;
  --cell-doc-border: #dce3ec;
  --cell-doc-surface: #f5f7fa;
  --cell-doc-inline-bg: #eef2f6;
  --cell-doc-inline-fg: #2d3f55;
  --cell-doc-code-bg: #ffffff;
  --cell-doc-code-fg: #24292f;
  --cell-doc-accent: #0088a8;
  --bs-code-color: var(--cell-doc-inline-fg);
}
[data-bs-theme="dark"] {
  --cell-doc-muted: #aab7c9;
  --cell-doc-border: #3b4758;
  --cell-doc-surface: #222a35;
  --cell-doc-inline-bg: #283341;
  --cell-doc-inline-fg: #dce6f4;
  --cell-doc-code-bg: #0d1117;
  --cell-doc-code-fg: #e6edf3;
  --cell-doc-accent: #36c2dd;
  --bs-code-color: var(--cell-doc-inline-fg);
}

/* Keep the prose quiet; reserve the brand blue for links and object names. */
.cell-content .body { font-size: 1.125rem; line-height: 1.65; }
.cell-content :is(h1, h2, h3, h4, h5, h6) {
  color: var(--cell-heading);
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.cell-content h1 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  letter-spacing: -.025em;
  margin: 1.5rem 0 1.25rem;
}
.cell-content h2 {
  font-size: 1.5rem;
  letter-spacing: -.015em;
  border-bottom: 1px solid var(--cell-doc-border);
  padding-bottom: .5rem;
  margin: 2.5rem 0 1.25rem;
}
.cell-content h3 { font-size: 1.2rem; margin: 2rem 0 1rem; }
.cell-content h4 { font-size: 1.05rem; margin: 1.5rem 0 .75rem; }
.cell-content .body p { max-width: 80ch; margin-bottom: 1rem; }
.cell-content .body li > p { margin-bottom: .5rem; }
.cell-content .body a {
  text-underline-offset: .18em;
  text-decoration-thickness: .06em;
  overflow-wrap: anywhere;
}
.cell-content .rubric {
  color: var(--cell-heading);
  font-size: 1rem;
  font-weight: 600;
  margin: 1.75rem 0 .75rem;
}
.cell-content img { max-width: 100%; height: auto; }
.cell-content .math { max-width: 100%; overflow-x: auto; }

/* Inline literals are neutral; linked Python objects retain their link color. */
.cell-content code.literal {
  padding: .12em .3em;
  border-radius: .25rem;
  background: var(--cell-doc-inline-bg);
  color: var(--cell-doc-inline-fg);
  font-size: .875em;
  font-weight: 400;
  overflow-wrap: anywhere;
}
.cell-content code.literal .pre { white-space: normal; }
.cell-content a > code.literal { color: inherit; font-weight: inherit; }
.cell-content :is(h1, h2, h3, h4) code.literal { background: transparent; padding: 0; color: inherit; }

/* Class/function signatures and their method descriptions. */
.cell-content dl.py { margin: 1.75rem 0 2.25rem; }
.cell-content dl.py > dt.sig {
  padding: .9rem 1rem;
  border: 1px solid var(--cell-doc-border);
  border-inline-start: 3px solid var(--cell-blue);
  border-radius: .375rem;
  background: var(--cell-doc-surface);
  color: var(--bs-body-color);
  font-family: var(--bs-font-monospace);
  font-size: .9375rem;
  font-weight: 400;
  line-height: 1.85;
  overflow-wrap: anywhere;
}
.cell-content .sig :is(.sig-name, .descname) {
  color: var(--bs-link-color);
  font-size: inherit;
  font-weight: 600;
}
.cell-content .sig :is(.sig-prename, .property, .default_value, .sig-return) {
  color: var(--cell-doc-muted);
  font-weight: 400;
}
.cell-content .sig :is(.sig-param, .property) { font-style: normal; }
.cell-content .sig .sig-paren { color: var(--cell-doc-muted); font-size: inherit; }
.cell-content .sig .pre { white-space: normal; }
.cell-content dl.py > dd { margin: 0; padding: 1rem .15rem 0 1.25rem; }
.cell-content dl.py dl.py { margin: 1.5rem 0; }
.cell-content dl.py dl.py > dt.sig { border-inline-start-width: 2px; border-inline-start-color: var(--cell-doc-border); }
.cell-content dl.py dl.py > dd { padding-inline-start: 1rem; }
.cell-content dl.py > dt.sig:target {
  border-inline-start-color: var(--cell-doc-accent);
  outline: 2px solid var(--cell-doc-accent);
  outline-offset: 2px;
}
.cell-content .sig dl { margin: .25rem 0; }
.cell-content .sig dl > dd { margin: 0; padding-inline-start: 1.5rem; }

/* Both reST definition lists and Sphinx field lists occur in the API. */
.cell-content .body dl:not(.py, .field-list) > dt {
  color: var(--cell-doc-muted);
  font-weight: 400;
  margin-top: 1.1rem;
  overflow-wrap: anywhere;
}
.cell-content .body dl:not(.py, .field-list) > dt code {
  background: transparent;
  padding: 0;
  color: var(--bs-body-color);
  font-weight: 600;
}
.cell-content .body dl:not(.py, .field-list) > dd {
  border-inline-start: 1px solid var(--cell-doc-border);
  margin: .4rem 0 1.25rem .15rem;
  padding-inline-start: 1rem;
}
.cell-content dl.py > dd > p:has(> strong:only-child) { margin-top: 1.5rem; margin-bottom: .75rem; }
.cell-content dl.py > dd > p:first-child { margin-top: 0; }
.cell-content .field-list {
  display: grid;
  grid-template-columns: minmax(6rem, max-content) minmax(0, 1fr);
  gap: .75rem 1.25rem;
  border-block: 1px solid var(--cell-doc-border);
  padding-block: 1rem;
  margin-block: 1.25rem;
}
.cell-content .field-list > dt { color: var(--cell-heading); font-weight: 600; padding: 0; }
.cell-content .field-list > dd { min-width: 0; margin: 0; padding: 0; }
.cell-content .field-list > dd > :last-child { margin-bottom: 0; }

/* Shared example blocks, command help, and saved notebook cells. */
.cell-content pre {
  padding: 1.1rem 1.25rem;
  margin: 1rem 0;
  max-width: 100%;
  overflow-x: auto;
  background: var(--cell-doc-code-bg);
  color: var(--cell-doc-code-fg);
  border: 1px solid var(--cell-doc-border);
  border-radius: .375rem;
  font-size: .9375rem;
  line-height: 1.7;
  tab-size: 4;
}
.cell-content .highlight {
  margin: 1.25rem 0;
  border: 1px solid var(--cell-doc-border);
  border-radius: .375rem;
  overflow: hidden;
}
.cell-content .highlight pre { margin: 0; border: 0; border-radius: 0; }
.cell-content pre code { padding: 0; background: transparent; color: inherit; overflow-wrap: normal; }
.cell-content .code-block-caption {
  color: var(--cell-doc-muted);
  font-size: .85rem;
  padding: .5rem 0;
}
.cell-content .nbinput .input_area {
  border: 1px solid var(--cell-doc-border);
  border-radius: .375rem;
  background: var(--cell-doc-code-bg);
}
.cell-content :is(.nbinput, .nboutput) .highlight { margin: 0; border: 0; border-radius: 0; }
.cell-content :is(.nbinput, .nboutput) pre { padding: .85rem 1rem; }
.cell-content :is(.nbinput, .nboutput) .prompt { color: var(--cell-doc-muted); }
.cell-content .nboutput .output_area { color: var(--bs-body-color); }
.cell-content .nboutput .widget-hbox { flex-wrap: wrap; }

.cell-content table:not(.highlighttable) {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  margin: 1.25rem 0;
  border-collapse: collapse;
  font-size: .925rem;
}
.cell-content table:not(.highlighttable) :is(th, td) {
  padding: .65rem .85rem;
  border: 1px solid var(--cell-doc-border);
  vertical-align: top;
}
.cell-content table:not(.highlighttable) th { background: var(--cell-doc-surface); font-weight: 600; }
.cell-content table:not(.highlighttable) p { margin-bottom: 0; }
.cell-content .admonition {
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border: 1px solid var(--cell-doc-border);
  border-inline-start: 3px solid var(--cell-doc-accent);
  border-radius: .375rem;
  background: var(--cell-doc-surface);
}
.cell-content .admonition-title { color: var(--cell-heading); font-weight: 600; }
.cell-content .admonition > :last-child { margin-bottom: 0; }
.cell-content .admonition.warning { border-inline-start-color: var(--bs-warning); }
.cell-content .admonition:is(.danger, .error) { border-inline-start-color: var(--bs-danger); }
.cell-content a.headerlink {
  padding-inline-start: .5rem;
  color: var(--cell-doc-muted);
  text-decoration: none;
  opacity: 0;
}
.cell-content :is(h1, h2, h3, h4, h5, h6, dt):hover > a.headerlink,
.cell-content a.headerlink:focus { opacity: 1; }

@media (max-width: 767.98px) {
  .cell-content h1 { margin-top: 1rem; }
  .cell-content h2 { font-size: 1.35rem; }
  .cell-content dl.py > dt.sig { padding: .75rem; }
  .cell-content dl.py > dd,
  .cell-content dl.py dl.py > dd { padding-inline-start: .5rem; }
  .cell-content .field-list { display: block; }
  .cell-content .field-list > dd { margin: .35rem 0 1rem; }
  .cell-content .field-list > dd:last-child { margin-bottom: 0; }
  .cell-content pre { padding: .85rem; }
}
