.python-runtime {
  padding: 1rem 1.2rem;
  margin: 1.2rem 0;
  border: 1px solid var(--border-1);
  border-radius: 12px;
  background: var(--surface-1);
}
.python-runtime p { margin: 0 0 .6rem; }
.code-examples .python-cell-compact { border: 0; border-radius: 0; margin: 0; }
.python-cell-compact .python-cell-toolbar { justify-content: flex-end; padding: .4rem .6rem; }
.python-cell-compact .python-restore { background: none; border-color: transparent; color: var(--text-2); }
#python-download, #python-status, #python-type-status { font-size: .9rem; }
#python-status { color: var(--brand-strong); }
.python-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.python-runtime button, .python-cell button, #python-session-controls button {
  padding: .35rem .75rem;
  border: 1px solid var(--border-1);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-1);
  font: inherit;
  font-size: .875rem;
  cursor: pointer;
}
.python-cell .python-run, #python-session-controls #python-run-all {
  color: var(--brand-strong);
  border-color: var(--brand);
  font-weight: 600;
}
#python-session-controls { margin: 0 0 1rem; font-size: .875rem; color: var(--text-2); }
#python-session-controls button + button { margin-left: .5rem; }
.python-browser-note { margin: 1rem 0 1.25rem; padding: .35rem 0 .35rem .85rem; border-left: 2px solid var(--border-1); color: var(--text-2); font-size: .875rem; line-height: 1.5; }
.python-browser-note p { margin: 0 0 .4rem; }
.python-browser-title { color: var(--brand-strong); font-weight: 600; }
.python-browser-note #python-session-controls { margin: .6rem 0 0; }
.python-browser-note #python-session-controls button { padding: .2rem .55rem; background: transparent; font-size: .8rem; }
.python-runtime button:disabled, .python-cell button:disabled, #python-session-controls button:disabled { opacity: .55; cursor: default; }
.python-runtime button:focus-visible, .python-cell button:focus-visible, #python-session-controls button:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.python-cell { border: 1px solid var(--border-1); border-radius: 10px; overflow: hidden; margin-bottom: 1rem; }
.python-cell-toolbar { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .5rem; padding: .6rem .8rem; border-top: 1px solid var(--border-1); font-size: .875rem; color: var(--text-2); }
.python-editor { min-width: 0; --selection-bg: #b3d8ef80; }
.python-editor .cm-editor { max-width: 100%; }
.python-editor .cm-scroller { max-height: 32rem; }
.python-editor .cm-focused { outline: 2px solid var(--brand); outline-offset: -2px; }
.python-editor .cm-content::selection, .python-editor .cm-content ::selection { color: inherit; }
.python-output-region { border-top: 1px solid var(--border-1); padding: .7rem .8rem; background: var(--surface-1); }
.python-result { color: var(--text-2); font-size: .875rem; margin-bottom: .4rem; }
.python-output { max-height: 24rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: .9rem/1.6 var(--bs-font-monospace); }
.python-output { padding-right: .35rem; color-scheme: light; }
body.quarto-dark .python-output { color-scheme: dark; }
.python-error { color: #b02a37; }
body.quarto-dark .python-error { color: #ff9b9b; }
/* Match the static Python code overrides in styles.css. Light mode inherits
   Quarto's syntax palette directly, including changes to the site theme. */
body.quarto-dark :is(.python-editor, .python-tooltips) {
  --selection-bg: color-mix(in srgb, var(--brand) 20%, var(--surface-1));
  --python-code-color: #dbe7f3;
  --quarto-hl-co-color: #93a7bb;
  --quarto-hl-im-color: #8fd3c1;
  --quarto-hl-st-color: #8fd3c1;
  --quarto-hl-sc-color: #8fd3c1;
  --quarto-hl-kw-color: #f0b48a;
  --quarto-hl-op-color: #f0b48a;
  --quarto-hl-fu-color: #f0b48a;
  --quarto-hl-dt-color: #f0b48a;
  --quarto-hl-cn-color: #84b8ff;
  --quarto-hl-at-color: #84b8ff;
  --quarto-hl-dv-color: #d8c28f;
}
.python-output .rich-result { white-space: normal; }
.python-graphs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: .8rem; white-space: normal; }
.python-graphs > figure { min-width: 0; margin: 0; padding: .75rem; border: 1px solid var(--border-1); border-radius: 10px; background: var(--mermaid-bg); }
.python-graphs > figure:only-child { grid-column: 1 / -1; }
.python-graphs figcaption { margin: .5rem 0 0; text-align: center; color: var(--text-2); font: .8rem/1.5 var(--bs-font-sans-serif); }
.python-graph { text-align: center; }
.python-graph svg { display: block; margin: auto; max-width: 100%; height: auto; }
/* SVG drop shadows can be clipped into rectangular patches around live nodes. */
.python-output .python-graph svg { background: transparent !important; }
.python-output .python-graph .node :is(rect, polygon, ellipse, circle, path) { filter: none; }
.python-graph-error { color: var(--text-2); }
.python-cell[aria-busy="true"] { border-color: var(--brand); }

.python-tooltips { position: absolute; top: 0; left: 0; width: 0; height: 0; z-index: 1080; color-scheme: light; }
body.quarto-dark .python-tooltips { color-scheme: dark; }
.type-hint { max-width: min(620px, 85vw); padding: .75rem 1rem; color: var(--text-1); }
.type-hint-title { font: 600 .875rem/1.5 system-ui, sans-serif; color: var(--brand-strong); margin-bottom: .5rem; }
.type-hint-body { white-space: normal; max-height: min(380px, 55vh); overflow: auto; padding-right: .35rem; font: .875rem/1.6 system-ui, sans-serif; overflow-wrap: anywhere; }
.type-hint-body > :first-child { margin-top: 0; }
.type-hint-body > :last-child { margin-bottom: 0; }
.type-hint-body p { margin: .6rem 0; }
.type-hint-body :is(h1, h2, h3, h4, h5, h6) { font: 650 .9rem/1.5 system-ui, sans-serif; margin: 1rem 0 .4rem; border: 0; padding: 0; }
.type-hint-body code { font: .875rem/1.6 var(--bs-font-monospace); background: var(--surface-2); color: var(--text-1); padding: 1px 4px; border-radius: 3px; }
.type-hint-body pre { background: var(--surface-2); color: var(--python-code-color, var(--quarto-hl-ot-color)); border-radius: 6px; padding: .6rem .75rem; margin: .6rem 0; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.type-hint-body pre code { background: none; padding: 0; color: inherit; }
.type-hint-body ul, .type-hint-body ol { padding-left: 1.5rem; margin: .5rem 0; }
.type-hint-body blockquote { border-left: 3px solid var(--brand); padding-left: .6rem; margin: .6rem 0; }
.type-hint-body table { border-collapse: collapse; margin: .6rem 0; }
.type-hint-body th, .type-hint-body td { border: 1px solid var(--border-1); padding: .3rem .5rem; text-align: left; }
.cm-tooltip-autocomplete { max-width: calc(100vw - 32px); font: .875rem/1.6 var(--bs-font-monospace); }
.python-tooltips .cm-tooltip.cm-tooltip-autocomplete > ul { width: min(620px, calc(100vw - 32px)); min-width: 0; max-width: 100%; height: auto; max-height: min(280px, 40vh); padding: 4px 0; }
.python-tooltips .cm-tooltip.cm-tooltip-autocomplete > ul > li[role=option] { display: grid; grid-template-columns: 16px minmax(100px, 175px) minmax(0, 1fr); align-items: center; gap: 8px; padding: 5px 10px; line-height: 1.6; }
.cm-tooltip-autocomplete .cm-completionLabel { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.python-tooltips code.cm-completionSignature { display: block; min-width: 0; padding: 0; background: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: inherit; color: var(--python-code-color, var(--quarto-hl-ot-color)); }
.python-tooltips .cm-tooltip-autocomplete > ul > li[aria-selected] { background: var(--surface-2); color: var(--text-1); }
.python-tooltips .cm-tooltip.cm-completionInfo { padding: 0; white-space: normal; }
.type-hint-plain { white-space: pre-wrap; }

/* Theme live output and the outer documentation/list scrollbars.
   The prefixed rules cover WebKit versions without CSS Scrollbars support. */
:is(.python-output, .python-tooltips .type-hint-body, .python-tooltips .cm-tooltip-autocomplete > ul) {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--brand) 34%, var(--border-1)) transparent;
}
:is(.python-output, .python-tooltips .type-hint-body, .python-tooltips .cm-tooltip-autocomplete > ul)::-webkit-scrollbar { width: 8px; height: 8px; }
:is(.python-output, .python-tooltips .type-hint-body, .python-tooltips .cm-tooltip-autocomplete > ul)::-webkit-scrollbar-track { background: transparent; }
:is(.python-output, .python-tooltips .type-hint-body, .python-tooltips .cm-tooltip-autocomplete > ul)::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--brand) 34%, var(--border-1)); border: 2px solid transparent; border-radius: 999px; background-clip: padding-box; }
:is(.python-output, .python-tooltips .type-hint-body, .python-tooltips .cm-tooltip-autocomplete > ul)::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--brand) 50%, var(--border-1)); }
:is(.python-output, .python-tooltips .type-hint-body, .python-tooltips .cm-tooltip-autocomplete > ul)::-webkit-scrollbar-button { display: none; }
:is(.python-output, .python-tooltips .type-hint-body, .python-tooltips .cm-tooltip-autocomplete > ul)::-webkit-scrollbar-corner { background: transparent; }
