/* Copyright 2024 Remy Blank <remy@c-space.org> */
/* SPDX-License-Identifier: MIT */

/* Variables */
body {
    --tdoc-background-light: #fff;
    --tdoc-background-dark: #121212;
}

/* Utility classes */
.hidden:not(#¶) {
    display: none;
}
section.hidden-heading:not(#¶) > :is(h1, h2, h3, h4, h5, h6):first-child {
    display: none;
}
.line-height-normal:not(#¶) .highlight pre {
    line-height: normal;
}

/* Set the maximum width of sidebars instead of a fixed width. */
div.sidebar, aside.sidebar {
    max-width: 40%;
    width: inherit;
}

/* Make rulers darker. */
hr {
    opacity: 1;
}

/* Invert the even and odd row colors in tables, so that the first row below the
   header has a different color than the header. */
.table > tbody > tr:nth-child(even) {
    background-color: var(--pst-color-table-row-zebra-low-bg);
}
.table > tbody > tr:nth-child(odd) {
    background-color: var(--pst-color-table-row-zebra-high-bg);
}
.table > tbody.inv > tr:nth-child(even) {
    background-color: var(--pst-color-table-row-zebra-high-bg);
}
.table > tbody.inv > tr:nth-child(odd) {
    background-color: var(--pst-color-table-row-zebra-low-bg);
}
.table > tbody > tr:hover:hover {
    background-color: var(--pst-color-table-row-hover-bg);
}

/* Make quotation attributions a bit more compact. */
blockquote div > p:has(+ p.attribution) {
    margin-bottom: 0;
}

/* Server termination buttons */
.article-header-buttons > button.btn-terminate::before {
    font: var(--fa-font-solid);
    content: '\f52a';
}
.article-header-buttons > button.btn-terminate:hover::before {
    content: '\f52b';
}

/* TOC */
.bd-sidebar-primary li:is(.toctree-l1, .toctree-l2, .toctree-l3) > a {
    padding-left: 1.25rem;  /* The original padding is 0.65rem */
    text-indent: -0.6rem;
}
.bd-toc-nav li:is(.toc-h2, .toc-h3, .toc-h4, .toc-h5, .toc-h6) > a {
    padding-left: 1.5rem;  /* The original padding is 1rem */
    text-indent: -0.5rem;
}

/* Layout */
.page-break {
    break-before: page;
}
.column-break {
    break-before: column;
}
.allow-break:not(#¶) {
    break-inside: auto;
}
.avoid-break:not(#¶) {
    break-inside: avoid;
}
.columns-2 {
    column-count: 2;
}
.columns-3 {
    column-count: 3;
}
.columns-4 {
    column-count: 4;
}
.columns-5 {
    column-count: 5;
}
.columns-6 {
    column-count: 6;
}
.columns-7 {
    column-count: 7;
}
.columns-8 {
    column-count: 8;
}
.tdoc-hspace {
    display: inline-block;
}
.tdoc-vspace {
    display: block;
}

/* Leaders */
.tdoc-leader.eol {
    position: relative;
    overflow: hidden;
}
.tdoc-leader.eol::after {
  position: absolute;
  margin-left: 0.5rem;
}
.tdoc-leader:not(.eol) {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
}
.tdoc-leader::after {
    white-space: nowrap;
}
.tdoc-leader.c\.::after {
  content: "................................................................"
           "................................................................"
           "................................................................"
           "................................................................"
           "................................................................"
           "................................................................";
}
.tdoc-leader.cdot::after {
  content: "․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․"
           "․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․"
           "․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․"
           "․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․";
}
.tdoc-leader.c\_::after {
  content: "________________________________________________________________"
           "________________________________________________________________"
           "________________________________________________________________"
           "________________________________________________________________";
}

/* Grids */
.tdoc-grid {
    margin: 1rem 0;
    display: grid;
    gap: 1rem;
}
.tdoc-grid > div > :first-child {
    margin-top: 0;
}
.tdoc-grid > div > :last-child {
    margin-bottom: 0;
}

/* List styling */
:is(ol, ul):is(.columns-2, .columns-3, .columns-4, .columns-5, .columns-6,
               .columns-7, .columns-8):not(.none) {
    column-gap: 2rem;
}
:is(ol, ul).none {
    list-style-type: none;
    padding-left: 0;
}
:is(ol, ul).disc {
    list-style-type: disc;
}
:is(ol, ul).circle {
    list-style-type: circle;
}
:is(ol, ul).square {
    list-style-type: square;
}
:is(ol, ul).decimal {
    list-style-type: decimal;
}
:is(ol, ul).decimal-leading-zero {
    list-style-type: decimal-leading-zero;
}
:is(ol, ul).lower-alpha {
    list-style-type: lower-alpha;
}
:is(ol, ul).upper-alpha {
    list-style-type: upper-alpha;
}
:is(ol, ul).lower-greek {
    list-style-type: lower-greek;
}
:is(ol, ul).lower-roman {
    list-style-type: lower-roman;
}
:is(ol, ul).upper-roman {
    list-style-type: upper-roman;
}
@counter-style decimal-paren {
    system: extends decimal;
    suffix: ') ';
}
@counter-style decimal-leading-zero-paren {
    system: extends decimal-leading-zero;
    suffix: ') ';
}
@counter-style lower-alpha-paren {
    system: extends lower-alpha;
    suffix: ') ';
}
@counter-style upper-alpha-paren {
    system: extends upper-alpha;
    suffix: ') ';
}
@counter-style lower-greek-paren {
    system: extends lower-greek;
    suffix: ') ';
}
@counter-style lower-roman-paren {
    system: extends lower-roman;
    suffix: ') ';
}
@counter-style upper-roman-paren {
    system: extends upper-roman;
    suffix: ') ';
}
:is(ol, ul).decimal-paren {
    list-style-type: decimal-paren;
}
:is(ol, ul).decimal-leading-zero-paren {
    list-style-type: decimal-leading-zero-paren;
}
:is(ol, ul).lower-alpha-paren {
    list-style-type: lower-alpha-paren;
}
:is(ol, ul).upper-alpha-paren {
    list-style-type: upper-alpha-paren;
}
:is(ol, ul).lower-greek-paren {
    list-style-type: lower-greek-paren;
}
:is(ol, ul).lower-roman-paren {
    list-style-type: lower-roman-paren;
}
:is(ol, ul).upper-roman-paren {
    list-style-type: upper-roman-paren;
}
:is(ol, ul).decimal-paren > li,
:is(ol, ul).decimal-leading-zero-paren > li,
:is(ol, ul).lower-alpha-paren > li,
:is(ol, ul).lower-greek-paren > li,
:is(ol, ul).lower-roman-paren > li,
:is(ol, ul).upper-roman-paren > li {
    padding-left: 0.5rem;
}
:is(ol, ul).hsep-0 > li {
    padding-left: 0;
}
:is(ol, ul).hsep-1 > li {
    padding-left: 0.5rem;
}
:is(ol, ul).hsep-2 > li {
    padding-left: 1rem;
}
:is(ol, ul).hsep-3 > li {
    padding-left: 1.5rem;
}
:is(ol, ul).hsep-4 > li {
    padding-left: 2rem;
}
:is(ol, ul).vsep-1 > li:not(:first-child) {
    margin-top: 0.5rem;
}
:is(ol, ul).vsep-2 > li:not(:first-child) {
    margin-top: 1rem;
}
:is(ol, ul).vsep-3 > li:not(:first-child) {
    margin-top: 1.5rem;
}
:is(ol, ul).vsep-4 > li:not(:first-child) {
    margin-top: 2rem;
}
:is(ol, ul).avoid-break-items > li {
    break-inside: avoid;
}

/* Grid tables */
table.grid {
    margin: 1rem auto;
    text-align: center;
}
table.grid > :is(thead, tbody) > tr > :is(th, td) {
    border: 1px solid var(--pst-color-text-base);
    padding: 0.1rem 0.5rem;
}
table.grid > :is(thead, tbody) > tr > :is(th, td).l {
    text-align: left;
}
table.grid > :is(thead, tbody) > tr > :is(th, td).r {
    text-align: right;
}

/* Function tables */
table.function-table {
    margin: 1rem 0;
    text-align: center;
}
table.function-table > :is(thead, tbody) > tr:not(:last-child) {
    border-bottom: 1px solid var(--pst-color-text-base);
}
table.function-table > :is(thead, tbody) > tr > :is(th, td) {
    border-right: 1px solid var(--pst-color-text-base);
    padding: 0.1rem 0.5rem;
}
table.function-table > :is(thead, tbody) > tr > :is(th, td).l {
    text-align: left;
}
table.function-table > :is(thead, tbody) > tr > :is(th, td).r {
    text-align: right;
}
table.function-table > :is(thead, tbody) > tr > :is(th, td).g {
    background-color: var(--pst-color-border);
}
table.function-table > :is(thead, tbody) > tr > :is(th, td).w {
    min-width: 5rem;
}
table.function-table > :is(thead, tbody) > tr
        > :is(th, td):is(:first-child, :last-child) {
    border-right: 3px double var(--pst-color-text-base);
}

/* Table alignment */
table.align-left {
    margin-left: 0;
    margin-right: auto;
}
table.align-center {
    margin-left: auto;
    margin-right: auto;
}
table.align-right {
    margin-left: auto;
    margin-right: 0;
}

/* Fix the layout of admonition content. pydata_sphinx_theme sets left and right
   margins on all direct descendants, which breaks horizontal alignment classes.
   Use padding on the container instead, adn remove the margins through
   patching. Also, set a bottom margin on the title. */
.admonition, div.admonition {
    padding-left: 2rem;
    padding-right: 2rem;
}
.admonition > .admonition-title, div.admonition > .admonition-title {
    margin-left: -2rem;
    margin-right: -2rem;
    margin-bottom: 0.4em;
}

/* Admonitions */
.admonition.dropdown .admonition-title {
    cursor: pointer;
}
.admonition.dropdown .admonition-title:hover {
    box-shadow: inset 0 0 0px 20px rgb(0 0 0 / 1%);
}
.admonition.dropdown .admonition-title:active {
    box-shadow: inset 0 0 0px 20px rgb(0 0 0 / 3%);
}
.admonition.dropdown .admonition-title button {
    position: absolute;
    right: 0;
    outline: none;
    border: none;
    padding: 0;
    background: none;
}
.admonition.dropdown .admonition-title ~ * {
    transition: opacity 0.3s;
}
.admonition.dropdown:not(.expand) {
    padding-bottom: 0;
}
.admonition.dropdown:not(.expand) .admonition-title {
    margin-bottom: 0;
}
.admonition.dropdown:not(.expand) .admonition-title ~ * {
    display: block;
    margin: 0;
    border: none;
    padding: 0;
    height: 0;
    visibility: hidden;
    overflow: hidden;
    opacity: 0;
}
@media print {
    .admonition.dropdown:not(.expand) {
        display: none;
    }
}

/* Iframes */
iframe.tdoc {
    display: block;
    width: 100%;
    aspect-ratio: 16/9;
    margin: 1rem auto;
}

/* Solutions */
html:is([data-tdoc-solutions]:not([data-tdoc-solutions-state]),
        [data-tdoc-solutions-state=hide]
    ):not([data-tdoc-solutions-ctrl]) .admonition.solution:not(.always-show) {
    display: none;
}
.article-header-buttons > button.btn-toggle-solutions {
    min-width: 2.7rem;
}
.article-header-buttons > button.btn-toggle-solutions::before {
    font: var(--fa-font-solid);
    content: '\f070';
}
html:is([data-tdoc-solutions]:not([data-tdoc-solutions-state]),
        [data-tdoc-solutions-state=hide]
    ) .article-header-buttons > button.btn-toggle-solutions::before {
    content: '\f06e';
}
html:not([data-tdoc-solutions=hide]):not([data-tdoc-solutions-ctrl])
        .article-header-buttons > button.btn-toggle-solutions {
    display: none;
}

/* Inline code */
a code {
    color: inherit;
}
code.xref,
a code {
    font-weight: inherit;
}

/* Code blocks */
div.literal-block-wrapper {
    overflow: hidden;
}
div.literal-block-wrapper div.code-block-caption {
    padding: 0.3rem;
}
div.literal-block-wrapper div.highlight {
    border-radius: 0;
}
div.literal-block-wrapper div.highlight pre {
    border: none;
    border-radius: 0;
}
div.highlight {
    position: relative;
}
div.highlight pre {
    padding: 0.5rem;
}
div.highlight pre > .linenos {
    margin-right: 8px;
    border-right: 1px solid var(--pst-color-border);
}
div.highlight pre > .linenos::before {
    content: attr(data-n);
}

/* Icons */
span:is(.tdoc, [class^=tdoc-], [class*=" tdoc-"]):is([class^=fa-],
                                                     [class*=" fa-"]) {
    font: var(--fa-font-solid);
}

/* Buttons */
button:is(.tdoc, [class^=tdoc-], [class*=" tdoc-"]) {
    border: 1px solid var(--pst-color-border);
    border-radius: 0.25rem;
    background-color: var(--pst-color-surface);
    transition: background-color 0.3s;
}
button:is(.tdoc, [class^=tdoc-], [class*=" tdoc-"]):not([disabled]) {
    color: var(--pst-color-text-muted);
}
button:is(.tdoc, [class^=tdoc-], [class*=" tdoc-"]):not([disabled]):hover {
    background-color: var(--pst-color-border);
}
button:is(.tdoc, [class^=tdoc-], [class*=" tdoc-"]):is([class^=fa-],
                                                       [class*=" fa-"]) {
    width: 1.8rem;
    height: 1.8rem;
    font: var(--fa-font-solid);
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

/* Input fields */
input[type=text]:is(.tdoc, [class^=tdoc-], [class*=" tdoc-"]) {
    border: 1px solid var(--pst-color-border);
    padding-block: 1px;
    padding-inline: 2px;
}
select:is(.tdoc, [class^=tdoc-], [class*=" tdoc-"]) {
    background-color: field;
    border: 1px solid var(--pst-color-border);
    padding: 2px;
}

/* Drawing */
.article-header-buttons > button.btn-draw::before {
    font: var(--fa-font-solid);
    content: '\f304';
}
html[data-tdoc-draw] .article-header-buttons > button.btn-draw {
    background-color: var(--pst-color-border);
}
html:not([data-tdoc-draw]) .tdoc-draw-toolbar {
    display: none;
}
.tdoc-draw-toolbar input[type=checkbox] {
    appearance: none;
    font: var(--fa-font-solid);
    font-size: 1.3rem;
}
.tdoc-draw-toolbar input[type=checkbox]:checked {
    background-color: var(--pst-color-border);
}
.tdoc-draw-toolbar .tdoc-size {
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    width: 4rem;
}
.tdoc-draw-toolbar .tdoc-size:focus-visible {
    outline: none;
}
.tdoc-draw-toolbar button {
    font: var(--fa-font-solid);
    font-size: 1.3rem;
}
.tdoc-draw-toolbar :is(.tdoc-tool, .tdoc-color) button {
    width: 2.5rem;
    justify-content: center;
}
.tdoc-draw-toolbar :is(.tdoc-tool, .tdoc-color) .dropdown-menu {
    min-width: 0;
}
.tdoc-draw-toolbar :is(.tdoc-tool, .tdoc-color) .dropdown-item {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    font: var(--fa-font-solid);
    font-size: 1.3rem;
    justify-content: center;
}
.bd-content {
    position: relative;
}
svg#tdoc-drawing {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
}
html[data-tdoc-draw] svg#tdoc-drawing {
    pointer-events: auto;
    touch-action: none;
}
@media print {
    svg#tdoc-drawing {
        display: none;
    }
}

/* Quizzes */
div.tdoc-quiz {
    display: flex;
    width: 100%;
    flex-direction: row;
    column-gap: 0.3rem;
}
div.tdoc-quiz > .content {
    position: relative;
    flex-basis: 100%;
}
div.tdoc-quiz > .controls {
    display: flex;
    flex-direction: column;
    row-gap: 0.3rem;
}
div.tdoc-quiz button.tdoc-check:disabled {
    color: var(--pst-color-success);
    border: none;
    background-color: var(--pst-color-success-bg);
}
.tdoc-quiz-hint {
    display: inline-block;
    position: absolute;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    border-left: 0.2rem solid var(--pst-color-success);
    background-color: var(--pst-color-success-bg);
    box-shadow: 0 0.2rem 0.5rem var(--pst-color-shadow),
                0 0 0.0625rem var(--pst-color-shadow);
    z-index: 100;
    visibility: hidden;
    opacity: 0;
    transition: 0.3s visibility, 0.3s opacity;
}
.tdoc-quiz-hint.show {
    visibility: visible;
    opacity: unset;
}
.tdoc-quiz-hint.invalid {
    border-left: 0.2rem solid var(--pst-color-warning);
    background-color: var(--pst-color-warning-bg);
}
.tdoc-quiz-field.right {
    float: right;
    clear: right;
    margin-left: 1rem;
}
.tdoc-quiz-field.right + .tdoc-quiz-field.right {
    margin-top: 0.25rem;
}
p:has(.tdoc-quiz-field.right)::after {
    content: ".";
    visibility: hidden;
    display: block;
    height: 0;
    clear: both;
}
.tdoc-quiz-field.bad {
    background-color: var(--pst-color-danger-bg);
}
.tdoc-quiz-entry > tr > td:has(.tdoc-quiz-field, .tdoc-check) {
    vertical-align: middle;
}
.tdoc-quiz-entry > tr > td:last-child {
    width: 0;
}

/* Polls */
.tdoc-poll {
    margin: 1rem auto;
    border: 1px solid var(--pst-color-border);
    border-left: 0.3rem solid var(--pst-color-border);
    border-radius: 0.25rem;
    box-shadow: 0 0.2rem 0.5rem var(--pst-color-shadow),
                0 0 0.0625rem var(--pst-color-shadow);
    background-color: var(--pst-color-on-background);
    padding: 1rem;
    counter-reset: answerNum;
}
.tdoc-poll.open {
    border-left-color: var(--pst-color-warning);
}
.tdoc-poll-header > div {
    display: flex;
    white-space: nowrap;
    justify-content: space-between;
}
.tdoc-poll-header .stats {
    display: flex;
    column-gap: 1.3rem;
}
.tdoc-poll-header :is(.voters, .votes) > :last-child {
    margin-left: 0.4rem;
}
.tdoc-poll[data-mode=single] .tdoc-poll-header .votes {
    display: none;
}
.tdoc-poll.open .tdoc-poll-header .closed {
    display: none;
}
.tdoc-poll-header .controls {
    display: none;
    column-gap: 0.3rem;
}
@media not print {
    html[data-tdoc-poll-control] .tdoc-poll-header .controls {
        display: flex;
    }
}
.tdoc-poll-answers:not(:has(.tdoc-poll-sel.s)) .tdoc-poll-header .controls
        > .tdoc-solutions {
    display: none;
}
.tdoc-poll-header .controls > .tdoc-clear {
    margin-left: 0.5rem;
}
.tdoc-poll-num {
    counter-increment: answerNum;
}
.tdoc-poll.num-decimal .tdoc-poll-num::before {
    content: counter(answerNum, decimal);
}
.tdoc-poll.num-lower-alpha .tdoc-poll-num::before {
    content: counter(answerNum, lower-alpha);
}
.tdoc-poll.num-upper-alpha .tdoc-poll-num::before {
    content: counter(answerNum, upper-alpha);
}
.tdoc-poll.solutions .tdoc-poll-sel.s {
    background-color: var(--pst-color-success-bg);
}
.tdoc-poll-sel > span {
    visibility: hidden;
}
.tdoc-poll-answers {
    margin-bottom: 0;
}
.tdoc-poll-answers > tbody > tr.selected > td.tdoc-poll-sel > span {
    visibility: visible;
}
.tdoc-poll-ans {
    width: 100%;
}
tr[style*="--tdoc-value:"] > td.tdoc-poll-ans {
    background: linear-gradient(to right,
        var(--pst-color-attention-bg) var(--tdoc-value),
        var(--bs-table-bg) var(--tdoc-value));
}
.tdoc-poll-cnt, .tdoc-poll-pct {
    text-align: right;
    white-space: nowrap;
}
.tdoc-poll-answers:not(:has(.tdoc-poll-cnt:not(:empty))) .tdoc-poll-cnt,
.tdoc-poll-answers:not(:has(.tdoc-poll-pct:not(:empty))) .tdoc-poll-pct {
    display: none;
}

/* Auto-sizing text area */
.tdoc-autosize {
    display: grid;
}
.tdoc-autosize > textarea {
    resize: none;
    overflow: hidden;
}
.tdoc-autosize::after {
    content: attr(data-text) " ";
    white-space: pre-wrap;
    visibility: hidden;
}
.tdoc-autosize > textarea,
.tdoc-autosize::after {
    border: 1px solid var(--pst-color-border);
    padding-block: 1px;
    padding-inline: 2px;
    font: inherit;
    grid-area: 1 / 1 / 2 / 2;
    word-break: break-word;
}

/* Exec outputs */
div.tdoc-exec-output {
    position: relative;
    margin: 1rem 0;
}
div.tdoc-exec-output :has(> button.tdoc-remove) {
    timeline-scope: --scroll-y;
    animation: --scroll-y forwards;
    animation-timeline: --scroll-y;
    container-name: --scroll;
}
@keyframes --scroll-x {
    0%,to { --scroll-x: 1; }
}
@keyframes --scroll-y {
    0%,to { --scroll-y: 1; }
}
div.tdoc-exec-output button.tdoc-remove {
    position: absolute;
    top: 0.3rem;
    right: 0.3rem;
    user-select: none;
    opacity: 0;
    transition: background-color 0.3s, opacity 0.3s;
}
@container --scroll style(--scroll-y: 1) {
    div.tdoc-exec-output button.tdoc-remove {
        right: 1.3rem;
    }
}
div.tdoc-exec-output:hover button.tdoc-remove {
    opacity: 1;
}
div.tdoc-exec-output.tdoc-sectioned {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    border: 1px solid var(--pst-color-border);
    border-top: 0.25rem solid var(--pst-color-border);
    border-radius: 0.25rem;
    overflow: hidden;
}
div.tdoc-exec-output.tdoc-sectioned:empty {
    display: none;
}
div.tdoc-exec-output.tdoc-sectioned > :not(:last-child) {
    border-bottom: 1px solid var(--pst-color-border);
}
div.tdoc-exec-output.tdoc-sectioned > div.highlight {
    border-radius: 0;
}
div.tdoc-exec-output.tdoc-sectioned > div.highlight > pre {
    border: none;
    border-radius: 0;
}
div.tdoc-exec-output.tdoc-sectioned > .canvas > canvas {
    display: block;
    margin: 0 auto;
}
div.tdoc-exec-output > div.tdoc-console > pre {
    max-height: 20rem;
    scroll-timeline: --scroll-y y;
}
div.tdoc-exec-output > div.tdoc-console > pre span.err {
    color: var(--pst-color-danger);
}
div.tdoc-exec-output > div.tdoc-console > pre span.warn {
    color: var(--pst-color-warning);
}
div.tdoc-exec-output > div.tdoc-console > pre span.info {
    color: var(--pst-color-info);
}
div.tdoc-exec-output > div.tdoc-console > pre span.debug {
    color: var(--pst-color-text-muted);
}
div.tdoc-exec-output.tdoc-sectioned > div.tdoc-input {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    margin: 0;
    padding: 0.3rem;
    column-gap: 0.3rem;
}
div.tdoc-exec-output.tdoc-sectioned > div.tdoc-input > .prompt {
    white-space: pre;
    padding-left: 0.2rem;
    padding-right: 0.2rem;
}
div.tdoc-exec-output.tdoc-sectioned > div.tdoc-input > .input {
    width: 100%;
}
div.tdoc-exec-output.tdoc-sectioned > div.tdoc-input > input[type=text] {
    border: 1px solid var(--pst-color-border);
    padding-block: 1px;
    padding-inline: 2px;
}
div.tdoc-exec-output > .tdoc-navbar {
    padding: 0.3rem;
    display: flex;
    flex-direction: row;
    column-gap: 0.3rem;
    background-color: var(--pst-color-background);
}
div.tdoc-exec-output > .tdoc-navbar > .tdoc-title {
    flex-basis: 100%;
    padding: 0 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
div.tdoc-exec-output > iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16/9;
    background: white;
}
html.tdoc-fullscreen {
    overflow: hidden;
}
div.tdoc-exec-output.tdoc-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2000;
    margin: 0;
    border: none;
}
div.tdoc-exec-output:not(.tdoc-fullscreen) > .tdoc-navbar .tdoc-restore {
    display: none;
}
div.tdoc-exec-output.tdoc-fullscreen > .tdoc-navbar .tdoc-maximize {
    display: none;
}
div.tdoc-exec-output.tdoc-fullscreen > iframe {
    height: 100% !important;  /* Override element style */
    aspect-ratio: auto;
}

/* Editor */
div.tdoc-exec[data-tdoc-editor] div.highlight :is(pre, button.copybtn) {
    display: none;
}
div.tdoc-exec[data-tdoc-editor] div.cm-editor {
    height: 100%;
    max-height: 80vh;
    border: 1px solid var(--pst-color-border);
    border-radius: 0.25rem;
    overflow: hidden;
}
div.literal-block-wrapper > div.tdoc-exec[data-tdoc-editor] div.cm-editor {
    border-top: none;
    border-bottom: none;
    border-left: none;
    border-radius: 0;
}
div.cm-editor.cm-focused {
    outline: none;
}
div.cm-editor div.cm-scroller {
    font-family: var(--pst-font-family-monospace);
    font-size: 0.875em;
}
html[data-theme=dark] div.cm-editor {
    background-color: var(--pst-color-surface);
}

/* Execution controls */
div.tdoc-exec:is([class^=highlight-], [class*=" highlight-"]) {
    flex-direction: row;
    column-gap: 0.3rem;
}
div.tdoc-exec div.highlight {
    flex-basis: 100%;
    overflow: auto;
}
div.tdoc-exec > div.tdoc-exec-controls {
    display: flex;
    flex-direction: column;
    row-gap: 0.3rem;
}
div.literal-block-wrapper
        > div.tdoc-exec:is([class^=highlight-], [class*=" highlight-"]) pre {
    border-right: 1px solid var(--pst-color-border);
}
div.literal-block-wrapper > div.tdoc-exec > div.tdoc-exec-controls {
    margin-top: 0.3rem;
    margin-bottom: 0.3rem;
    margin-right: 0.3rem;
}

/* SQL execution results */
.table > tbody > tr:nth-child(odd).tdoc-no-results {
    background-image: linear-gradient(-45deg,
        var(--pst-color-table-row-zebra-low-bg) 5%,
        var(--pst-color-table-row-zebra-high-bg) 5% 50%,
        var(--pst-color-table-row-zebra-low-bg) 50% 55%,
        var(--pst-color-table-row-zebra-high-bg) 55%);
    background-size: 28.28px 28.28px;
}
.tdoc-error {
    margin-bottom: 1rem;
    border: 1px solid var(--pst-color-danger);
    padding: 0.5rem;
    background-image: linear-gradient(-45deg,
        var(--pst-color-table-row-zebra-low-bg) 5%,
        var(--pst-color-table-row-zebra-high-bg) 5% 50%,
        var(--pst-color-table-row-zebra-low-bg) 50% 55%,
        var(--pst-color-table-row-zebra-high-bg) 55%);
    background-size: 28.28px 28.28px;
}

/* JSXGraph boards */
.tdoc-dyn[data-type=jsxgraph] {
    /* The magic value is used to detect the default in jsxgraph.js. */
    aspect-ratio: 142857 / 142857;
    margin: 1rem auto;
    border-color: var(--pst-color-border);
    border-radius: 0.25rem;
}
:fullscreen > .tdoc-dyn[data-type=jsxgraph] {
    border: none;
    border-radius: 0;
}
.tdoc-dyn[data-type=jsxgraph].align-left {
    margin-left: 0;
}
.tdoc-dyn[data-type=jsxgraph].align-right {
    margin-right: 0;
}
html[data-tdoc-dev] .tdoc-dyn[data-type=jsxgraph]:not(.rendered) {
    border-color: var(--pst-color-danger);
}
.tdoc-dyn[data-type=jsxgraph] > div.spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    color: var(--pst-color-text-base);
    background-color: var(--pst-color-background);
}
.JXG_navigation > .JXG_navigation_button {
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
}
.JXG_navigation > .JXG_navigation_button > svg {
    top: unset;
}
@media print {
    .tdoc-dyn[data-type=jsxgraph] .JXG_navigation {
        display: none;
    }
}

/* Mermaid diagrams */
.tdoc-dyn[data-type=mermaid] {
    margin: 1rem auto;
    text-align: center;
}
.tdoc-dyn[data-type=mermaid].align-left {
    text-align: left;
}
.tdoc-dyn[data-type=mermaid].align-right {
    text-align: right;
}
.tdoc-dyn[data-type=mermaid]:not([data-processed]) {
    display: none;
}
.tdoc-dyn[data-type=mermaid].background-light > svg {
    background-color: var(--tdoc-background-light);
}
.tdoc-dyn[data-type=mermaid].background-dark > svg {
    background-color: var(--tdoc-background-dark);
}
.mermaidTooltip {
  position: absolute;
  max-width: 30%;
  border: 1px solid var(--pst-color-border);
  border-radius: 0.25rem;
  padding: 2px 4px;
  background-color: var(--pst-color-surface);
  font-size: var(--pst-font-size-milli);
  pointer-events: none;
  z-index: 100;
}

/* Drop-down menus */
.dropdown-menu {
    --bs-dropdown-link-color: var(--pst-color-text-muted);
    --bs-dropdown-link-hover-color: var(--pst-color-text-muted);
    --bs-dropdown-link-active-color: var(--pst-color-text-muted);
    --bs-dropdown-padding-y: 0.2rem;
    box-shadow: 0 0.2rem 0.5rem var(--pst-color-shadow),
                0 0 0.0625rem var(--pst-color-shadow) !important;
    border-color: var(--pst-color-border);
    background-color: var(--pst-color-background);
    color: var(--pst-color-text-muted);
}
.dropdown-menu .dropdown-item {
    display: inline-flex;
    align-items: center;
    padding-left: 0.5rem;
    padding-right: var(--bs-dropdown-item-padding-x);
    cursor: pointer;
}
.dropdown-menu .btn__icon-container.tdoc:is([class^=fa-], [class*=" fa-"]) {
    font: var(--fa-font-solid);
    display: inline-flex;
    width: 1.7rem;
    align-items: center;
    justify-content: center;
}

/* Content footer */
.bd-footer-content .tdoc-version {
    float: right;
    margin-left: 2rem;
}

/* Create a hanging indent for signatures. */
.sig {
    padding-left: 3rem;
    text-indent: -3rem;
}

/* Login functionality */
.article-header-buttons > .dropdown-user > button::before {
    font: var(--fa-font-regular);
    content: '\f007';
}
html[data-tdoc-logged-in] .article-header-buttons > .dropdown-user
        > button::before {
    font: var(--fa-font-solid);
}
html[data-tdoc-logged-in] .article-header-buttons > .dropdown-user
        .dropdown-item.btn-login {
    display: none;
}
html:not([data-tdoc-logged-in]) .article-header-buttons > .dropdown-user
        .dropdown-item.btn-settings {
    display: none;
}
.tdoc-domain-storage {
    position: absolute;
    width: 0px;
    height: 0px;
}

/* Revert table style changes from pydata_sphinx_theme in Bootstrap modals. */
.modal .table {
    --bs-table-bg: var(--bs-body-bg);
    --bs-table-color: var(--bs-emphasis-color);
    border-color: var(--bs-table-border-color);
    border-style: initial;
    border-width: initial;
    color: var(--bs-table-color);
}
.modal .table thead tr {
    background-color: initial;
    border-bottom-color: initial;
    border-bottom-style: initial;
    border-bottom-width: initial;
}
.modal .table td ~ td, .modal .table td ~ th,
.modal .table th ~ td, .modal .table th ~ th {
    border-left-color: initial;
    border-left-style: initial;
    border-left-width: initial;
}
.modal .table thead tr {
    background-color: initial;
    border-bottom-color: initial;
    border-bottom-style: initial;
    border-bottom-width: initial;
}
.modal .table tbody tr:nth-child(odd), .modal .table tbody tr:nth-child(even),
.modal .table tbody tr:hover {
    background-color: initial;
}

/* Hide the Read-the-Docs switcher in the sidebar added by pydata_sphinx_theme
   if it's empty, as it causes the scrollbar to always appear. */
.bd-sidebar-primary div#rtd-footer-container:empty {
    display: none;
}

/* Make the modal created by pydata_sphinx_theme when opening the left sidebar
   full-height, and remove the ugly dialog border. */
.bd-sidebar-primary[open] {
    position: fixed;
    height: 100vh;
    border-top: none;
    border-left: none;
    border-bottom: none;
}

/* Remove the underline on hover on navbar buttons. */
.pst-navbar-icon.pst-navbar-icon:hover::before {
    border-bottom: none;
}

/* Fix the alignment of navbar icons. */
.article-header-buttons > button,
.article-header-buttons > .dropdown > button {
    justify-content: center;
}
.article-header-buttons > button > .btn__icon-container {
    display: inline-flex;
    align-items: center;
}

/* Don't open dropdown menus on hover. */
.bd-header-article .btn:hover + .dropdown-menu:not(.show) {
    display: none;
}
.bd-header-article .dropdown-menu:hover:not(.show) {
    display: none;
}

/* Add a slight background shading on hover to menu items. */
.bd-header-article .dropdown-menu .dropdown-item:hover {
    background-color: var(--bs-dropdown-link-hover-bg);
}

/* Render alerts in the header. */
.bd-header-article {
    flex-direction: column;
    row-gap: 0.5rem;
    align-items: stretch;
}
.bd-header-article:has(.alert) {
    padding-bottom: 0.5rem;
}
.bd-header-article > .alert {
    --bs-alert-margin-bottom: 0;
}

/* Prevent the wrapper background set by pygments from being visible if the
   wrapper is larger than its content (visible in dark mode). */
div.highlight.highlight.highlight {
    background: none;
}

/* Prevent the wrapper background set by pygments from overriding code literal
   styles. */
code.literal.literal.literal {
    background-color: var(--pst-color-surface);
}

/* Fix the gap left by pydata_sphinx_theme between the table and the
   scrollbar. */
.pst-scrollable-table-container {
    margin-bottom: 1rem;
    scroll-timeline: --scroll-y y;
}
.pst-scrollable-table-container > .table {
    margin-bottom: 0;
}

/* Reduce the bottom margin of directive definition list options. */
dl[class]:not(.directive, .option-list, .field-list, .footnote, .glossary,
              .simple):not(#¶) {
    margin-bottom: 1.5rem;
}

/* Hide the search shortcut, which is disabled. */
.search-button-field .search-button__kbd-shortcut,
.bd-search .search-button__kbd-shortcut {
    display: none;
}

/* Adjust the stroke width for SVG character paths. */
/* TODO(mathjax-4): Remove and use the svg.blacker config instead */
mjx-container[jax="SVG"]:not(#¶) path[data-c],
mjx-container[jax="SVG"]:not(#¶) use[data-c] {
    stroke-width: 0;
}

/* Make align-* classes work on math blocks. */
div.math.align-left:not(#¶) > mjx-container {
    text-align: left;
}
div.math.align-center:not(#¶) > mjx-container {
    text-align: center;
}
div.math.align-right:not(#¶) > mjx-container {
    text-align: right;
}

/* Avoid that math blocks sometimes get cut off at the top. */
div.math, span.math {
    overflow: visible;
}
div.math mjx-container {
    padding-top: 0.2rem;
}

/* Fix margin collapse with math blocks. */
div.math {
    margin: 1em 0;
}
mjx-container[display="true"]:not(#¶) {
    margin: 0;
}

/* Avoid that form controls change size on focus. */
.form-control:focus, .form-control:focus-visible {
    border: var(--bs-border-width) solid var(--bs-border-color);
}
