.navbar-brand img {
  height: clamp(2.75rem, 5vw, 4.5rem);
  max-height: none;
}

html[data-theme="dark"] .navbar-brand img {
  filter: invert(1);
}

/* MyST-NB renders stored outputs directly; keep complete output scrollable. */
.cell_output {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  margin: 0.75rem 0 1.25rem;
  padding: 0.8rem 0.9rem;
  overflow-x: auto;
  color: var(--pst-color-text-base);
  background: var(--pst-color-surface);
  border: 0.05rem solid var(--pst-color-border);
  border-radius: 0.4rem;
  box-shadow: 0 0.1rem 0.3rem rgb(0 0 0 / 5%);
  scrollbar-color: var(--pst-color-text-muted) transparent;
}

.cell_output:focus-visible,
.cell_output details summary:focus-visible {
  outline: 0.12rem solid var(--pst-color-accent);
  outline-offset: 0.12rem;
}

.cell_output > :first-child { margin-top: 0; }
.cell_output > :last-child { margin-bottom: 0; }

.cell_output pre {
  width: max-content;
  min-width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow: visible;
  color: inherit;
  background: transparent;
  font-size: 0.72rem;
  line-height: 1.5;
  white-space: pre;
}

.cell_output table {
  width: max-content;
  min-width: 100%;
  margin: 0;
  border-collapse: collapse;
  background: transparent;
}

.cell_output th,
.cell_output td {
  padding: 0.4rem 0.65rem;
  border: 0.05rem solid var(--pst-color-border);
  white-space: nowrap;
}

.cell_output thead th {
  color: var(--pst-color-text-base);
  background: color-mix(in srgb, var(--pst-color-surface), var(--pst-color-text-base) 7%);
  font-weight: 600;
}

.cell_output tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--pst-color-surface), var(--pst-color-text-base) 3%);
}

.cell_output .vtk-info {
  max-width: 34rem;
  font-family: var(--pst-font-family-base);
  font-size: 0.75rem;
}

.cell_output .vtk-info details + details { margin-top: 0.45rem; }

.cell_output .vtk-info summary {
  padding: 0.35rem 0;
  cursor: pointer;
  font-size: 0.8rem;
}

.cell_output .vtk-info th {
  width: 50%;
  text-align: left;
  opacity: 0.78;
}

.cell_output .vtk-info td {
  width: 50%;
  text-align: right;
}

.cell_output .vtk-na {
  opacity: 0.55;
  font-style: italic;
}

.notebook-ansi-bold { font-weight: 700; }
.notebook-ansi-red { color: #b42318; }
.notebook-ansi-green { color: #18864b; }
.notebook-ansi-yellow { color: #8a6800; }
.notebook-ansi-blue { color: #2457c5; }
.notebook-ansi-magenta { color: #9d3ca6; }
.notebook-ansi-cyan { color: #007f82; }
.notebook-ansi-gray { color: #68707c; }
.notebook-ansi-bright-red { color: #d92d20; }
.notebook-ansi-bright-green { color: #12a150; }
.notebook-ansi-bright-yellow { color: #a77800; }
.notebook-ansi-bright-blue { color: #326ce5; }
.notebook-ansi-bright-white { color: #454c59; }

html[data-theme="dark"] .notebook-ansi-red { color: #ff8a80; }
html[data-theme="dark"] .notebook-ansi-green { color: #72d69c; }
html[data-theme="dark"] .notebook-ansi-yellow { color: #e5c76b; }
html[data-theme="dark"] .notebook-ansi-blue { color: #86a8ff; }
html[data-theme="dark"] .notebook-ansi-magenta { color: #dda0e6; }
html[data-theme="dark"] .notebook-ansi-cyan { color: #72d5d7; }
html[data-theme="dark"] .notebook-ansi-gray { color: #a8b0bd; }
html[data-theme="dark"] .notebook-ansi-bright-red { color: #ff9a91; }
html[data-theme="dark"] .notebook-ansi-bright-green { color: #83e3aa; }
html[data-theme="dark"] .notebook-ansi-bright-yellow { color: #f3d66f; }
html[data-theme="dark"] .notebook-ansi-bright-blue { color: #9bb6ff; }
html[data-theme="dark"] .notebook-ansi-bright-white { color: #f2f4f8; }

@media screen and (max-width: 45rem) {
  .cell_output {
    margin-right: -0.4rem;
    margin-left: -0.4rem;
    padding: 0.65rem;
    border-radius: 0.25rem;
  }

  .cell_output pre { font-size: 0.65rem; }
}
