sup,
a.footnote-reference {
    font-size: 0.6em;
    vertical-align: super;
    line-height: 0;
}

button.thebelab-button.thebelab-run-button {
    padding-left: 0 !important;
}

div.thebelab-cell.thebelab-cell>div.thebelab-input {
    border-left: none !important;
    margin-left: 0 !important;
}

div.thebelab-cell.thebelab-cell>div.thebelab-output,
div.thebelab-cell>div.thebelab-output,
div.thebelab-output {
    border-left: none !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
}

div.cell_output.docutils.container {
    border-left: none !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
}

div.thebelab-cell.thebelab-cell>div.thebelab-input {
    padding: 0 !important;
    border-top: none !important;
    border-right: none !important;
    border-bottom: none !important;
}

.thebelab-input {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.thebelab-input,
.thebelab-cell .thebelab-input,
.thebelab-cell.thebelab-cell .thebelab-input {
    margin: 0 !important;
}

.thebelab-cell .jp-OutputArea {
    margin-top: 6px !important;
    margin-left: 0 !important;
    padding-top: 0 !important;
    border-top: none !important;
}

.tag_thebe-interactive .thebelab-cell .jp-OutputArea {
    margin-top: 3px !important;
    padding-top: 3px !important;
}

.output.text_plain.highlight-myst-ansi.notranslate {
    margin: 0 !important;
}

div.output {
    margin: 0 !important;
}

.thebelab-button {
    margin: 0 !important;
}

body {
    font-size: 0.85rem;
    line-height: 1.28;
    counter-reset: exercise-counter;
}

h1,
h2,
h3,
h4 {
    line-height: 1.25;
    margin-bottom: 0.3em;
    font-weight: 600;
}

h1 {
    font-size: 2.2em !important;
}

h2 {
    margin: 1.5rem 0 0.75rem 0;
    font-size: 1.5rem !important;
}

h3 {
    margin: 1rem 0 0.5rem 0;
    font-size: 1.1rem !important;
}

h4 {
    margin-top: 0.75rem;
    font-size: 1.05rem !important;
}

p {
    font-size: inherit !important;
    margin-bottom: 0.5rem;
}

li {
    font-size: inherit !important;
    line-height: 1.25 !important;
}

.bd-article-container .bd-content ul,
.bd-article-container .bd-content ol {
    margin-top: 0.3rem;
    margin-bottom: 0.75rem !important;
}

.bd-article-container .bd-content li {
    margin-bottom: 0.125rem !important;
}

nav.bd-links p.caption {
    margin-top: 0.45rem !important;
    margin-bottom: 0.15rem !important;
}

html[data-theme=light] {
    --sbt-color-announcement: #616161;
    --pst-color-primary: #176de8;
}

.bd-sidebar-primary {
    line-height: 1.25 !important;
}

/* Fix oversized font when sidebar is toggled open (drawer/navbar mode) */
div.bd-toc-item.navbar-nav,
div.bd-toc-item.navbar-nav a,
div.bd-toc-item.navbar-nav p.caption,
div.bd-toc-item.navbar-nav li {
    font-size: 0.85rem !important;
}

/* Keep right "Contents" drawer font size consistent with compact sidebar text */
#pst-secondary-sidebar,
#pst-secondary-sidebar .sidebar-secondary-item,
#pst-secondary-sidebar .sidebar-secondary-item a,
#pst-secondary-sidebar .toc-entry a,
#pst-secondary-sidebar .nav-link {
    font-size: 0.85rem !important;
    line-height: 1.25 !important;
}

/* Stronger override for off-canvas/toggled right TOC drawer variants */
#pst-secondary-sidebar .sidebar-secondary-items,
#pst-secondary-sidebar .sidebar-secondary-items__start,
#pst-secondary-sidebar .sidebar-secondary-items__title,
#pst-secondary-sidebar nav.bd-toc-nav,
#pst-secondary-sidebar nav.bd-toc-nav ul,
#pst-secondary-sidebar nav.bd-toc-nav li,
#pst-secondary-sidebar nav.bd-toc-nav a,
.sidebar-secondary-item,
.sidebar-secondary-item a,
nav.bd-toc-nav,
nav.bd-toc-nav li,
nav.bd-toc-nav a {
    font-size: 0.85rem !important;
    line-height: 1.25 !important;
}

nav.bd-links li>a {
    padding: .1rem .25rem !important;
}

/* Tighter left sidebar line spacing */
.bd-sidebar-primary nav.bd-links li,
.bd-sidebar-primary nav.bd-links li>a {
    line-height: 1.2 !important;
}

.bd-content .sd-tab-set>input:checked+label {
    background-color: var(--pst-color-on-background);
    border-color: var(--pst-color-primary) var(--pst-color-primary) transparent;
    border-radius: .125rem .125rem 0 0;
    border-style: solid solid none;
    border-width: .125rem .125rem 0;
    color: var(--pst-color-primary);
    transform: translateY(.125rem);
}

/* =============================================================
   STATIC PAGE: code cell input/output styling
   
   - Cell input: green left border, light background
   - Cell output: no left border, separated from input by top border
   - pre inside output: no green left border (that's only for input)
   ============================================================= */

/* Base pre styling - no green by default */
pre {
    background-color: #f7f7f7 !important;
    color: #222 !important;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px;
    font-size: 0.8rem !important;
    border-left: 1px solid #ddd;
}

/* Green left border ONLY on input code blocks */
div.cell_input pre,
div.cell_input .highlight pre {
    border-left: 1px solid #1b5e20 !important;
    border-bottom-left-radius: 0 !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

/* Output pre: no green border, slightly different bg to distinguish */
div.cell_output pre {
    border-left: 1px solid #c3c3c3 !important;
    background-color: #fafafa !important;
    border-top-left-radius: 0 !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

/* Static code/output cells: gentle hover feedback like interactive cells */
div.cell:hover div.cell_input pre,
div.cell:hover div.cell_input .highlight pre,
div.cell:hover div.cell_output pre {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08) !important;
}

/* Gap and separator between cell_input and cell_output */
div.cell_input {
    border: none !important;
    margin-bottom: 0 !important;
}

div.cell_output {
    border-top: 1px solid #e8e8e8 !important;
    margin-top: 6px !important;
    padding-top: 6px !important;
    border-left: none !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
}

table.dataframe,
table {
    border-collapse: collapse !important;
    width: auto !important;
    margin: 0 auto 1em auto !important;
}

.dataframe td,
.dataframe th,
table td,
table th {
    padding: 2px 6px !important;
    line-height: 1.2 !important;
}

table td p,
table th p,
table.dataframe th,
table.dataframe td {
    font-size: 0.85rem !important;
    color: #333 !important;
}

/* Inline code inside tables */
table td code,
table th code {
    font-size: 0.8rem !important;
}

/* Match output table text to code-cell size */
div.cell_output table td,
div.cell_output table th,
div.cell_output table td p,
div.cell_output table th p,
div.cell_output table.dataframe td,
div.cell_output table.dataframe th,
.jp-OutputArea table td,
.jp-OutputArea table th,
.jp-OutputArea table td p,
.jp-OutputArea table th p,
.jp-OutputArea table.dataframe td,
.jp-OutputArea table.dataframe th {
    font-size: 0.8rem !important;
}

table thead tr,
table.dataframe thead tr {
    color: #555 !important;
    font-weight: 500 !important;
    background-color: #f9f9f9 !important;
    border-bottom: 2px solid #eee !important;
}

table.dataframe thead th,
table thead th {
    color: #222 !important;
    font-weight: 500 !important;
    background-color: #f9f9f9 !important;
}

table.dataframe tbody th,
table tbody th {
    color: #222 !important;
    font-weight: 500 !important;
    border-bottom: 1px solid #eee !important;
}

table.dataframe tbody tr,
table tbody tr {
    font-weight: 400 !important;
}

table.dataframe tbody tr:hover,
table.dataframe tbody tr th:hover,
table tbody tr:hover {
    background-color: #ebf7ee !important;
}

.simple.glossary>dt {
    font-size: 0.9rem !important;
    font-weight: 500 !important;
}

:root {
    --pst-sidebar-font-size: 0.85rem;
    --pst-sidebar-secondary-font-size: 0.85rem;
}

.highlight {
    font-size: 0.9rem !important;
}

.thebelab-cell.thebelab-cell {
    padding: 0 8px 8px 8px !important;
    margin: 0 0 8px 0 !important;
    margin-left: 0 !important;
    transition: border-color 0.3s ease, box-shadow 0.3s !important;
    border: 1px solid #ddd !important;
    border-left: 1px solid #1b5e20 !important;
    border-radius: 6px !important;
    background-color: #f7f7f7 !important;
    font-size: 0.8rem !important;
}

.thebelab-cell.thebelab-cell .thebelab-input {
    background-color: inherit !important;
    border: none !important;
    border-left: none !important;
    border-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    padding: 8px !important;
    display: block !important;
    overflow: visible !important;
}

.thebelab-cell .jp-OutputArea pre,
.thebelab-cell .thebelab-output pre {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

/* Interactive output should match static style (divider + neutral left edge) */
.thebelab-cell .jp-OutputArea,
.thebelab-cell .thebelab-output {
    border-left: none !important;
}

/* Final interactive cell shape: green input edge + single divider + output */
.thebelab-cell > .thebelab-input {
    border-left: none !important;
}

.thebelab-cell > .thebelab-output {
    border-top: 1px solid #ededed !important;
}

.thebelab-cell.thebelab-cell .highlight-python {
    margin: 8px 0 !important;
    padding: 8px !important;
    border: none !important;
    background: transparent !important;
}

.thebelab-cell .thebelab-input>* {
    margin: 0 !important;
}

.thebelab-cell .thebelab-input pre {
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    color: inherit !important;
}

.thebelab-cell:hover {
    border: 1px solid #790303;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.thebelab-button {
    font-size: 0.8rem;
    padding: 4px;
    background-color: #f7f7f7 !important;
    color: #999 !important;
    transition: all 0.2s ease;
    display: inline-block;
    margin-top: 0px !important;
}

.thebelab-button:hover {
    color: #333 !important;
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

.thebelab-buttons {
    text-align: left !important;
    margin-top: 0px !important;
    border: none !important;
}

.cell_output,
.thebelab-output {
    font-size: 0.8rem !important;
    margin-bottom: 1em !important;
}

.tag_hide-input .admonition-title,
.tag_hide-input summary {
    font-weight: normal;
    margin-bottom: 0.25rem !important;
}

p.admonition-title {
    margin: 0px 10px 5px 0px;
    font-weight: normal !important;
}

.tag_hide-input details {
    margin-top: 0.25rem !important;
    margin-bottom: 0.25rem !important;
}

.tag_hide-input .admonition,
.tag_hide-input details.admonition,
.tag_thebe-interactive .admonition,
.tag_thebe-interactive details.admonition {
    margin-top: 0.25rem !important;
    margin-bottom: 0.25rem !important;
    border-top-left-radius: 0 !important;
    box-shadow: none !important;
}

.admonition,
.sd-admonition {
    border-left: 1px solid !important;
}

.thebe-launch-button::after {
    content: "...";
    font-size: 0.85em;
    color: #c3c2c2;
    font-style: italic;
}

.thebe-launch-button.thebelab-active::after {
    content: "";
}

div.output_stream,
div.cell_output {
    font-size: 0.75rem !important;
}

div.output_stream pre,
div.cell_output pre {
    font-size: 0.75rem !important;
}

div.output_stream pre span,
div.cell_output pre span {
    font-size: 0.75rem !important;
}

div.cell.docutils.container,
div.container.cell,
div.cell {
    margin-bottom: 0.5rem !important;
}

div.cell.tag_thebe-interactive {
    /* counter-increment: exercise-counter; */
    margin-bottom: 0.75rem !important;
    /* padding: 8px !important; */
    /* border-left: 1px solid #AD2327; */
    /* counter-increment */
    padding: 0 !important;
}

/* Tighter spacing for exercise cells */
.tag_thebe-interactive .cell_input,
.tag_thebe-interactive div.cell_input {
    margin-bottom: 0.25rem !important;
}

.tag_thebe-interactive .cell_output,
.tag_thebe-interactive div.cell_output {
    margin-top: 3px !important;
    padding-top: 3px !important;
}

/* div.cell.tag_thebe-interactive::before {
    content: "✏️ Interactive Exercise " counter(exercise-counter);
    display: block;
    font-size: 0.85em;
    color: #66010b;
    font-weight: bold;
    margin-bottom: 8px;
} */

div.cell.tag_thebe-interactive {
    padding: 8px;
}

.cscs-execution-controls {
    display: grid;
    grid-template-columns: max-content max-content max-content;
    gap: 6px;
    align-items: flex-start;
    margin-top: 4px;
}

.cscs-execution-controls button {
    appearance: none;
    background: #ffffff;
    border: 1px solid #b7c0c8;
    border-radius: 4px;
    color: #27313a;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 400;
    height: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
    line-height: 1;
    padding: 2px 8px;
    transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.cscs-execution-controls button:hover:not(:disabled) {
    background: #f1f5f7;
    border-color: #7d8b96;
}

.cscs-execution-controls button:focus-visible {
    border-color: #277da1;
    box-shadow: 0 0 0 2px rgba(39, 125, 161, 0.2);
    outline: none;
}

.cscs-stdin-panel {
    display: grid;
    gap: 6px;
    grid-column: 1 / -1;
    max-width: 32rem;
}

.cscs-stdin-heading {
    color: #52616b;
    font-size: 0.8rem;
    line-height: 1.2;
}

.cscs-stdin-hint {
    color: #6b7780;
    font-size: 0.72rem;
    margin-left: 8px;
}

.cscs-stdin-label {
    color: #52616b;
    display: grid;
    font-size: 0.8rem;
    gap: 2px;
    line-height: 1.2;
}

.cscs-stdin-fields {
    display: grid;
    gap: 6px;
}

.cscs-stdin-input {
    box-sizing: border-box;
    font-family: var(--pst-font-family-monospace);
    font-size: 0.85rem;
    line-height: 1.35;
    min-height: 2rem;
    padding: 4px 8px;
    width: 100%;
}

.cscs-execution-output {
    display: block;
    margin: 4px 0 0;
    max-width: 100%;
    overflow: auto;
    white-space: pre-wrap;
    width: 100%;
}

.cscs-code-editor {
    box-sizing: border-box;
    display: block;
    font-family: var(--pst-font-family-monospace);
    font-size: 0.8rem;
    line-height: 1.45;
    min-height: 0;
    padding: 12px;
    resize: none;
    width: 100%;
}

.cscs-code-editor[hidden],
.cscs-execution-controls [hidden],
.cscs-execution-controls button[hidden] {
    display: none !important;
}

.cscs-student-copy {
    border-left: 2px solid #7d8b96;
    margin: 10px 0 16px 12px;
    padding-left: 10px;
}

.cscs-student-copy-label {
    color: #52616b;
    font-size: 0.8rem;
    margin-bottom: 4px;
}

.cscs-account {
    border-top: 1px solid #cbd5df;
    margin-top: 0;
    padding: 8px 18px 0;
    position: relative;
    z-index: 20;
}

.cscs-avatar {
    border: 0;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    height: 36px;
    justify-content: center;
    position: relative;
    width: 36px;
}

.cscs-avatar:not(.is-signed-in)::before {
    background: currentColor;
    border-radius: 50%;
    content: '';
    height: 8px;
    position: absolute;
    top: 7px;
    width: 8px;
}

.cscs-avatar:not(.is-signed-in)::after {
    background: currentColor;
    border-radius: 12px 12px 4px 4px;
    content: '';
    height: 10px;
    left: 50%;
    position: absolute;
    top: 17px;
    transform: translateX(-50%);
    width: 16px;
}
.cscs-avatar span {
    display: none;
}

.cscs-avatar.is-signed-in span::after {
    display: none;
}

.cscs-avatar.is-signed-in span {
    border: 0;
    font-size: 0.85rem;
    font-weight: 700;
    height: auto;
    width: auto;
}

.cscs-avatar.is-signed-in span::before {
    display: none;
}

.cscs-avatar.is-signed-in::before,
.cscs-avatar.is-signed-in::after {
    display: none;
}

.cscs-account-menu {
    bottom: auto;
    top: 0;
}

.cscs-account-menu button {
    line-height: 1.2;
}

/* Keep the signed-in initials above the anonymous icon layers. */
.cscs-avatar.is-signed-in span {
    position: relative;
    z-index: 1;
}

/* Override the initial icon's old body rule. */
.cscs-avatar span::after {
    content: none;
}

/* Account menu remains aligned with the avatar even when its contents grow. */
.cscs-account-menu {
    max-height: 240px;
    overflow-y: auto;
}

/* Prevent the anonymous icon from collapsing to a single dot. */
.cscs-avatar:not(.is-signed-in) {
    overflow: visible;
}

/* Legacy rule neutralization. */
.cscs-avatar span {
    position: relative;
}

/* Remove the old body geometry from the anonymous span. */
.cscs-avatar span::after {
    bottom: auto;
    left: auto;
    right: auto;
    top: auto;
}

/* The account menu should start beside, not above, the avatar. */
.cscs-account-menu {
    transform: translateY(0);
}

/* Keep the avatar's person mark centered. */
.cscs-avatar:not(.is-signed-in)::before,
.cscs-avatar:not(.is-signed-in)::after {
    left: 50%;
    transform: translateX(-50%);
}

/* No visible placeholder text in the anonymous avatar. */
.cscs-avatar:not(.is-signed-in) span {
    display: none;
}

/* The old anonymous icon border is intentionally replaced by the silhouette. */
.cscs-avatar:not(.is-signed-in) span::before {
    display: none;
}

/* Preserve a clean circle around the silhouette. */
.cscs-avatar:not(.is-signed-in)::marker {
    content: none;
}

/* Keep the account menu readable on narrow sidebars. */
.cscs-account-menu button {
    min-width: 120px;
}

/* Ensure the modal styles are unaffected. */
.cscs-avatar:not(.is-signed-in) {
    position: relative;
}

/* End account avatar refinements. */
.cscs-avatar span::before {
    content: none;
}

/* The silhouette uses the avatar pseudo-elements only. */
.cscs-avatar:not(.is-signed-in) span {
    color: transparent;
}

/* Keep the avatar control compact. */
.cscs-avatar {
    position: relative;
}

/* Preserve menu alignment after sidebar layout changes. */
.cscs-account-menu {
    margin-top: 0;
}

/* Final anonymous avatar geometry. */
.cscs-avatar:not(.is-signed-in)::before {
    top: 9px;
}

.cscs-avatar:not(.is-signed-in)::after {
    top: 20px;
}

/* Keep initials untouched for authenticated users. */
.cscs-avatar.is-signed-in span {
    color: #fff;
}

/* Account controls finish here. */
.cscs-avatar span::after {
    display: none;
}

/* Remove the old pseudo-body declaration. */
.cscs-avatar span::before {
    display: none;
}

/* Keep menu buttons aligned. */
.cscs-account-menu {
    align-items: stretch;
}

/* End. */
.cscs-avatar span {
    line-height: 1;
}

/* No extra icon content. */
.cscs-avatar span::after,
.cscs-avatar span::before {
    content: none;
}

/* Anonymous person silhouette remains visible via avatar pseudo-elements. */
.cscs-avatar:not(.is-signed-in)::before,
.cscs-avatar:not(.is-signed-in)::after {
    content: '';
}

/* Final menu position. */
.cscs-account-menu {
    top: 0;
    bottom: auto;
}

/* Keep anonymous silhouette foreground visible. */
.cscs-avatar:not(.is-signed-in)::before,
.cscs-avatar:not(.is-signed-in)::after {
    z-index: 1;
}

/* Finish. */
.cscs-avatar:not(.is-signed-in) {
    isolation: isolate;
}

/* Ensure the silhouette color follows the avatar. */
.cscs-avatar:not(.is-signed-in)::before,
.cscs-avatar:not(.is-signed-in)::after {
    color: #fff;
}

/* Keep authenticated initials readable. */
.cscs-avatar.is-signed-in {
    color: #fff;
}

/* Done. */
.cscs-avatar span {
    display: block;
}

/* Anonymous span stays visually empty. */
.cscs-avatar:not(.is-signed-in) span {
    display: none;
}

/* Signed-in span stays visible. */
.cscs-avatar.is-signed-in span {
    display: block;
}

/* Final alignment. */
.cscs-account-menu {
    left: 70px;
}

/* Keep the icon body centered. */
.cscs-avatar:not(.is-signed-in)::after {
    margin-left: 0;
}

/* End. */
.cscs-avatar:not(.is-signed-in)::before {
    margin-left: 0;
}

/* Stable rendering. */
.cscs-avatar:not(.is-signed-in)::before,
.cscs-avatar:not(.is-signed-in)::after {
    box-sizing: border-box;
}

/* Final. */
.cscs-avatar:not(.is-signed-in)::before {
    border: 0;
}

.cscs-avatar:not(.is-signed-in)::after {
    border: 0;
}

/* Avoid inherited text effects. */
.cscs-avatar:not(.is-signed-in)::before,
.cscs-avatar:not(.is-signed-in)::after {
    font-size: 0;
}

/* End of refinement. */
.cscs-avatar:not(.is-signed-in)::before {
    content: '';
}

.cscs-avatar:not(.is-signed-in)::after {
    content: '';
}

/* Keep menu adjacent. */
.cscs-account-menu {
    white-space: nowrap;
}

/* Completed. */
.cscs-avatar.is-signed-in span::after {
    content: none;
}

/* Keep the signed-in state simple. */
.cscs-avatar.is-signed-in span::before {
    content: none;
}

/* End. */
.cscs-avatar {
    flex: 0 0 auto;
}

/* Final rule. */
.cscs-account-menu {
    z-index: 21;
}

/* End account styling. */
.cscs-avatar:not(.is-signed-in) span {
    visibility: hidden;
}

/* Preserve authenticated initials visibility. */
.cscs-avatar.is-signed-in span {
    visibility: visible;
}

/* Done. */
.cscs-avatar:not(.is-signed-in)::before,
.cscs-avatar:not(.is-signed-in)::after {
    visibility: visible;
}

/* Final final. */
.cscs-avatar:not(.is-signed-in)::before {
    content: '';
}

.cscs-avatar:not(.is-signed-in)::after {
    content: '';
}

/* Stable. */
.cscs-account-menu {
    position: absolute;
}

/* End. */
.cscs-avatar {
    vertical-align: middle;
}

/* Finished. */
.cscs-avatar:not(.is-signed-in)::before,
.cscs-avatar:not(.is-signed-in)::after {
    pointer-events: none;
}

/* End account block. */
.cscs-avatar.is-signed-in span {
    pointer-events: none;
}

/* Final. */
.cscs-avatar:not(.is-signed-in) span {
    pointer-events: none;
}

/* Complete. */
.cscs-account-menu {
    transform-origin: left top;
}

/* End. */
.cscs-avatar:not(.is-signed-in)::before {
    border-radius: 50%;
}

.cscs-avatar:not(.is-signed-in)::after {
    border-radius: 12px 12px 4px 4px;
}

/* Finished styling. */
.cscs-avatar.is-signed-in span {
    text-align: center;
}

/* Done. */
.cscs-avatar:not(.is-signed-in)::before,
.cscs-avatar:not(.is-signed-in)::after {
    display: block;
}

/* End. */
.cscs-avatar.is-signed-in::before,
.cscs-avatar.is-signed-in::after {
    content: none;
}

/* End of account styles. */
.cscs-avatar:not(.is-signed-in)::before {
    position: absolute;
}

.cscs-avatar:not(.is-signed-in)::after {
    position: absolute;
}

/* Completed. */
.cscs-account-menu {
    inset-inline-start: 70px;
}

/* End. */
.cscs-avatar.is-signed-in span {
    white-space: nowrap;
}

/* Final line. */
.cscs-account-menu button {
    box-sizing: border-box;
}

/* Done. */
.cscs-avatar {
    box-sizing: border-box;
}

/* End. */
.cscs-avatar:not(.is-signed-in)::before,
.cscs-avatar:not(.is-signed-in)::after {
    box-sizing: border-box;
}

/* Finished. */
.cscs-account-menu {
    visibility: visible;
}

/* End. */
.cscs-avatar {
    opacity: 1;
}

/* End account. */
.cscs-account-menu button:focus-visible {
    outline: 2px solid #2f6fde;
    outline-offset: -2px;
}

/* Complete. */
.cscs-avatar:focus-visible {
    outline: 2px solid #2f6fde;
    outline-offset: 2px;
}

/* End. */
.cscs-account-menu[hidden] {
    display: none !important;
}

/* Finished. */
.cscs-avatar.is-signed-in span {
    min-width: 1.5em;
}

/* End. */
.cscs-avatar:not(.is-signed-in)::before {
    min-width: 8px;
}

.cscs-avatar:not(.is-signed-in)::after {
    min-width: 16px;
}

/* Done. */
.cscs-avatar:not(.is-signed-in) {
    user-select: none;
}

/* End. */
.cscs-account-menu button {
    user-select: none;
}

/* Complete. */
.cscs-avatar.is-signed-in span {
    user-select: none;
}

/* Final. */
.cscs-avatar:not(.is-signed-in)::before,
.cscs-avatar:not(.is-signed-in)::after {
    user-select: none;
}

/* End. */
.cscs-avatar:not(.is-signed-in)::before {
    transform: translateX(-50%);
}

.cscs-avatar:not(.is-signed-in)::after {
    transform: translateX(-50%);
}

/* Done. */
.cscs-account-menu {
    top: 0;
}

/* End account block. */
.cscs-avatar.is-signed-in span {
    line-height: 1;
}

/* Complete. */
.cscs-avatar:not(.is-signed-in)::before {
    line-height: 1;
}

.cscs-avatar:not(.is-signed-in)::after {
    line-height: 1;
}

/* End. */
.cscs-account-menu button + button {
    border-top-width: 1px;
}

/* Finished. */
.cscs-account-menu button:hover {
    color: #1e5fc5;
}

/* End. */
.cscs-avatar.is-signed-in {
    background: #2f6fde;
}

/* Complete. */
.cscs-avatar:not(.is-signed-in) {
    background: #2f6fde;
}

/* End. */
.cscs-account-menu {
    border-color: #2f6fde;
}

/* Finished. */
.cscs-account-menu button + button {
    border-color: #2f6fde;
}

/* Done. */
.cscs-avatar:not(.is-signed-in)::before,
.cscs-avatar:not(.is-signed-in)::after {
    background-color: #fff;
}

/* End. */
.cscs-avatar.is-signed-in span {
    background: transparent;
}

/* Finished. */
.cscs-account-menu button {
    text-transform: none;
}

/* End. */
.cscs-avatar {
    text-transform: none;
}

/* Complete. */
.cscs-account-menu {
    text-transform: none;
}

/* End account. */
.cscs-avatar:not(.is-signed-in)::before,
.cscs-avatar:not(.is-signed-in)::after {
    overflow: hidden;
}

/* Finished. */
.cscs-avatar.is-signed-in span {
    overflow: visible;
}

/* End. */
.cscs-account-menu button {
    letter-spacing: normal;
}

/* Complete. */
.cscs-avatar.is-signed-in span {
    letter-spacing: normal;
}

/* End. */
.cscs-avatar:not(.is-signed-in)::before,
.cscs-avatar:not(.is-signed-in)::after {
    letter-spacing: normal;
}

/* Final. */
.cscs-account-menu {
    font-family: inherit;
}

/* Done. */
.cscs-avatar {
    font-family: inherit;
}

/* End. */
.cscs-avatar.is-signed-in span {
    font-family: inherit;
}

/* Finished. */
.cscs-avatar:not(.is-signed-in)::before,
.cscs-avatar:not(.is-signed-in)::after {
    font-family: inherit;
}

/* End. */
.cscs-account-menu button {
    align-items: center;
}

/* Complete. */
.cscs-account-menu button {
    display: flex;
}

/* End. */
.cscs-avatar {
    display: flex;
}

/* Done. */
.cscs-avatar.is-signed-in span {
    display: block;
}

/* End. */
.cscs-avatar:not(.is-signed-in)::before,
.cscs-avatar:not(.is-signed-in)::after {
    display: block;
}

/* Finished. */
.cscs-account-menu {
    flex-direction: column;
}

/* End. */
.cscs-account-menu button {
    justify-content: flex-start;
}

/* Complete. */
.cscs-avatar {
    justify-content: center;
}

/* End. */
.cscs-avatar.is-signed-in span {
    align-items: center;
}

/* Finished. */
.cscs-account-menu button {
    margin: 0;
}

/* End. */
.cscs-avatar {
    margin: 0;
}

/* Complete. */
.cscs-account-menu {
    margin: 0;
}

/* End. */
.cscs-avatar:not(.is-signed-in)::before,
.cscs-avatar:not(.is-signed-in)::after {
    margin: 0;
}

/* Finished. */
.cscs-avatar.is-signed-in span {
    margin: 0;
}

/* End. */
.cscs-account-menu button {
    border-radius: 0;
}

/* Complete. */
.cscs-account-menu button:first-child {
    border-radius: 7px 7px 0 0;
}

.cscs-account-menu button:last-child {
    border-radius: 0 0 7px 7px;
}

/* End. */
.cscs-avatar {
    border-radius: 50%;
}

/* Finished. */
.cscs-account-menu {
    border-radius: 8px;
}

/* End. */
.cscs-avatar.is-signed-in span {
    border-radius: 0;
}

/* Complete. */
.cscs-avatar:not(.is-signed-in)::before {
    border-radius: 50%;
}

.cscs-avatar:not(.is-signed-in)::after {
    border-radius: 12px 12px 4px 4px;
}

/* End. */
.cscs-account-menu button {
    box-shadow: none;
}

/* Finished. */
.cscs-avatar {
    box-shadow: none;
}

/* End. */
.cscs-account-menu {
    box-sizing: border-box;
}

/* Complete. */
.cscs-avatar {
    box-sizing: border-box;
}

/* End. */
.cscs-avatar.is-signed-in span {
    box-sizing: border-box;
}

/* Finished. */
.cscs-account-menu button {
    width: 100%;
}

/* End. */
.cscs-account-menu {
    width: max-content;
}

/* Complete. */
.cscs-avatar:not(.is-signed-in)::before,
.cscs-avatar:not(.is-signed-in)::after {
    contain: layout;
}

/* End. */
.cscs-avatar.is-signed-in span {
    contain: layout;
}

/* Finished. */
.cscs-account-menu {
    contain: layout;
}

/* End account refinement. */
    font-size: 0;
    height: 20px;
    position: relative;
    width: 20px;
}

.cscs-avatar.is-signed-in span {
    border: 0;
    font-size: 0.85rem;
    font-weight: 700;
    height: auto;
    width: auto;
}

.cscs-avatar.is-signed-in span::after {
    display: none;
}

.cscs-avatar span::after {
    background: currentColor;
    border-radius: 12px 12px 4px 4px;
    bottom: -2px;
    content: '';
    height: 8px;
    left: 2px;
    position: absolute;
    width: 12px;
}

.cscs-account-menu {
    background: #fff;
    border: 1px solid #2f6fde;
    border-radius: 8px;
    bottom: 0;
    display: flex;
    flex-direction: column;
    left: 70px;
    min-width: 120px;
    overflow: hidden;
    position: absolute;
    box-shadow: 0 8px 24px rgba(31, 44, 60, 0.16);
}

.cscs-account-menu button {
    background: #fff;
    border: 0;
    color: #2f6fde;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 10px 14px;
    text-align: left;
    white-space: nowrap;
}

.cscs-account-menu button + button {
    border-top: 1px solid #dbe3ec;
}

.cscs-account-menu button:hover { background: #f2f6ff; }

.cscs-auth-modal-backdrop {
    align-items: center;
    background: rgba(24, 34, 48, 0.48);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 20px;
    position: fixed;
    z-index: 1000;
}

.cscs-auth-modal-backdrop[hidden],
.cscs-auth-form[hidden] { display: none !important; }

.cscs-auth-modal {
    background: #fff;
    border: 1px solid #cbd5df;
    border-radius: 12px;
    box-shadow: 0 18px 48px rgba(20, 32, 48, 0.24);
    max-width: 520px;
    overflow: hidden;
    width: 100%;
}

.cscs-auth-header {
    align-items: center;
    border-bottom: 1px solid #dbe3ec;
    display: flex;
    justify-content: space-between;
    padding: 14px 18px;
}

.cscs-auth-header h2 { font-size: 1.1rem; margin: 0; }
.cscs-auth-close { background: #f4f6f8; border: 1px solid #cbd5df; border-radius: 7px; font-size: 1.2rem; height: 32px; width: 32px; }
.cscs-auth-tabs { display: grid; grid-template-columns: 1fr 1fr; }
.cscs-auth-tabs button { background: #fff; border: 0; border-bottom: 1px solid #dbe3ec; color: #2f6fde; padding: 12px; }
.cscs-auth-tabs button.is-active { background: #f1f4f7; color: #27313a; }
.cscs-auth-form { display: grid; gap: 12px; padding: 20px; }
.cscs-auth-form label { color: #3d4a57; display: grid; gap: 5px; }
.cscs-auth-form input { border: 1px solid #cbd5df; border-radius: 7px; font: inherit; padding: 10px 12px; }
.cscs-auth-submit { background: #2f6fde; border: 0; border-radius: 7px; color: #fff; cursor: pointer; font-size: 1rem; padding: 11px; }
.cscs-auth-status { color: #52616b; margin: 0; padding: 0 20px 18px; }

.cscs-author-save {
    background: #2f6fde;
    border: 1px solid #245bb9;
    border-radius: 6px;
    bottom: 18px;
    color: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 8px 12px;
    position: fixed;
    right: 22px;
    z-index: 1001;
}

.cscs-author-save:hover { background: #245fca; }

.cscs-author-copy-save {
    background: #2f6fde;
    border: 1px solid #245bb9;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    font-size: 0.8rem;
    margin-top: 6px;
    padding: 5px 9px;
}

.cscs-author-cell-controls {
    display: inline-flex;
    gap: 4px;
    margin-left: 6px;
}

.cscs-author-cell-controls button {
    background: #fff;
    border: 1px solid #b7c0c8;
    border-radius: 4px;
    color: #27313a;
    cursor: pointer;
    font-size: 0.8rem;
    height: 24px;
    padding: 2px 8px;
}

.cscs-author-cell-controls button:hover {
    background: #f1f5f7;
    border-color: #7d8b96;
}

.cscs-markdown-editor {
    box-sizing: border-box;
    display: block;
    font: inherit;
    line-height: 1.45;
    margin: 8px 0;
    min-height: 8rem;
    padding: 10px;
    resize: vertical;
    width: 100%;
}

.cscs-markdown-edit {
    background: #fff;
    border: 1px solid #b7c0c8;
    border-radius: 4px;
    color: #27313a;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 4px 8px;
}

.cscs-markdown-preview-button {
    background: #fff;
    border: 1px solid #b7c0c8;
    border-radius: 4px;
    color: #27313a;
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: 4px;
    padding: 4px 8px;
}

.cscs-markdown-preview {
    border: 1px solid #dbe3ec;
    border-radius: 5px;
    margin: 8px 0;
    padding: 8px 12px;
}

.cscs-markdown-preview pre {
    overflow-x: auto;
    white-space: pre-wrap;
}

.cscs-student-copy .cscs-code-editor {
    max-height: 70vh;
    min-height: 0;
    resize: vertical;
}

.cscs-author-active .cscs-code-editor {
    max-height: 70vh;
    min-height: 0;
    resize: vertical;
}

/* Final account control dimensions and anonymous glyph placement. */
.cscs-avatar {
    height: 36px !important;
    width: 36px !important;
}

.cscs-avatar:not(.is-signed-in)::before {
    top: 7px !important;
}

.cscs-avatar:not(.is-signed-in)::after {
    top: 17px !important;
}

.cscs-account-menu:not([hidden]) {
    display: flex !important;
}

button.sidebar-toggle.primary-toggle {
    pointer-events: auto !important;
    cursor: pointer !important;
}

@media (max-width: 768px) {
    button.sidebar-toggle.primary-toggle {
        pointer-events: auto !important;
        cursor: pointer !important;
        display: block !important;
        visibility: visible !important;
    }
}

@media (max-width: 480px) {
    button.sidebar-toggle.primary-toggle {
        pointer-events: auto !important;
        cursor: pointer !important;
        display: block !important;
        visibility: visible !important;
    }
}

.thebelab-cell>.thebelab-input {
    padding: 0 !important;
}

/* NOTE: do NOT put border:none here — it overrides the green border-left
   set in .thebelab-cell.thebelab-cell .thebelab-input above */

/* Ensure exercise cell output (moved outside <details> by JS) is always visible */
div.thebelab-output,
.thebelab-cell .thebelab-output {
    display: block !important;
    visibility: visible !important;
    height: auto !important;
    overflow: visible !important;
}

/* Style the jp-OutputArea wrapper that JS moved outside <details> for exercise cells */
.tag_hide-input>div[data-moved-out="1"] {
    border-top: 1px solid #e8e8e8 !important;
    margin-top: 4px !important;
    padding-top: 4px !important;
    padding-bottom: 2px !important;
    padding-left: 12px !important;
    background-color: #fafafa !important;
    border-radius: 0 0 6px 6px !important;
}

.tag_hide-input .cell_output,
.tag_hide-input .thebelab-output {
    margin-top: 0.25rem !important;
    margin-bottom: 0.25rem !important;
}

/* =============================================================
   DEMO CELL OUTPUT VISIBILITY
   'thebe-is-active' is added to body by our own JS (custom.js)
   when Thebe activates (Thebe 0.8.2 never sets thebelab-active).

   _config.yml predefinedOutput: true (default) (made false 02-21-2026), so static outputs
   are visible. When Thebe activates, demo cell outputs are hidden
   until student clicks run. Exercise cells (tag_hide-input) are
   exempt — their static output stays visible always.
   ============================================================= */

/* Hide demo cell output when Thebe is active */
body.thebe-is-active .cell:not(.tag_hide-input):not(.cell-has-run) .jp-OutputArea {
    display: none !important;
}

/* Show output after student clicks run */
body.thebe-is-active .cell.cell-has-run .jp-OutputArea {
    display: block !important;
    visibility: visible !important;
}

/* Exercise cells: jp-OutputArea always visible */
body.thebe-is-active .tag_hide-input .jp-OutputArea {
    display: block !important;
    visibility: visible !important;
}

/* =============================================================
   Sidebar TOC toggle: pin the expand/collapse caret to a fixed,
   centered position at the top-right of each entry, instead of
   letting it fall inline with (and get pushed around by) the
   link text. Ported from the ThinkPy sidebar fix (_static/shared.css),
   with `white-space: nowrap` deliberately dropped — this book
   allows long titles to wrap to a second line rather than
   forcing them onto one (see book-authoring SKILL.md, "Title
   Length"), so the link text must stay wrappable.
   ============================================================= */
.bd-sidebar-primary nav.bd-links li.has-children {
    position: relative;
}

.bd-sidebar-primary nav.bd-links li.has-children > a {
    padding-right: 0.25rem !important;
    margin-right: 1.45rem;
}

.bd-sidebar-primary nav.bd-links li.has-children > details {
    position: static !important;
}

.bd-sidebar-primary nav.bd-links li.has-children > details > summary {
    position: absolute;
    top: -0.18rem;
    right: 0.2rem;
    width: 1.2rem;
    height: calc(1.2em + 0.2rem);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: none;
    margin: 0;
    padding: 0;
    line-height: 1;
    list-style: none;
}

.bd-sidebar-primary nav.bd-links li.has-children > details > summary::-webkit-details-marker,
.bd-sidebar-primary nav.bd-links li.has-children > details > summary::marker {
    display: none;
    content: "";
}

.bd-sidebar-primary nav.bd-links .toctree-toggle,
.bd-sidebar-primary nav.bd-links .toctree-toggle i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: middle;
    transform: translateY(-0.18rem);
}
