/* cosmiq's docs in identityoperator.com's design, on the PyData theme.

   Every colour is a token of the website's src/app/globals.css (read-only), named in the
   comment: light mode from :root, dark mode from .dark. Sizes and spacing are the website's
   Tailwind classes (the header in src/components/layout/Header.tsx, the footer in Footer.tsx,
   the legal and lesson pages, the code block in src/components/ui/CodeBlock.tsx). */

/* -- Tokens ---------------------------------------------------------------------------------- */

html,
html[data-theme="light"] {
  --io-canvas: #ffffff; /* --canvas-rgb 255 255 255 */
  --io-canvas-alt: #f9fafb; /* --canvas-alt-rgb 249 250 251 */
  --io-card: #ffffff; /* --card-rgb */
  --io-raised: #f3f4f6; /* --raised-rgb 243 244 246 */
  --io-line-subtle: #f3f4f6; /* --line-subtle-rgb */
  --io-line: #e5e7eb; /* --line-rgb 229 231 235 */
  --io-line-strong: #d1d5db; /* --line-strong-rgb 209 213 219 */
  --io-fg: #111827; /* --fg-rgb 17 24 39 */
  --io-fg-secondary: #4b5563; /* --fg-secondary-rgb 75 85 99 */
  --io-fg-muted: #6b7280; /* --fg-muted-rgb 107 114 128 */
  --io-fg-disabled: #9ca3af; /* --fg-disabled-rgb 156 163 175 */
  --io-brand: #840d0a; /* --brand-rgb 132 13 10: fills, the same in both modes */
  --io-brand-light: #b0140f; /* --brand-light-rgb 176 20 15 */
  --io-primary: #840d0a; /* --primary-rgb: red ink (text, borders) */
  --io-primary-light: #b0140f; /* --primary-light-rgb */
  --io-primary-soft: rgb(132 13 10 / 0.08); /* bg-primary/10-ish tint */
  --io-success: #15803d; /* --success-rgb 21 128 61 */
  --io-warning: #b45309; /* --warning-rgb 180 83 9 */
  --io-danger: #b91c1c; /* --danger-rgb 185 28 28 */
  --io-info: #1d4ed8; /* --info-rgb 29 78 216 */
  --io-header-bg: rgb(255 255 255 / 0.8); /* bg-canvas/80 */
  --io-inline-code-bg: #f3f4f6; /* bg-gray-100 (BlocksRenderer's inline code) */
  --io-shadow-1: 0 1px 2px rgb(0 0 0 / 0.06); /* --shadow-1 */
  --io-shadow-2: 0 4px 12px rgb(0 0 0 / 0.1), 0 1px 2px rgb(0 0 0 / 0.06); /* --shadow-2 */
  --io-shadow-3: 0 12px 32px rgb(0 0 0 / 0.16), 0 2px 6px rgb(0 0 0 / 0.08); /* --shadow-3 */
  --io-code-border: #e5e7eb; /* CodeBlock: border-gray-200 */
  --io-scroll-thumb: #d1d5db; /* scrollbar: --line-strong-rgb */
  --io-scroll-thumb-hover: #840d0a; /* scrollbar hover: --primary-rgb */
}

html[data-theme="dark"] {
  --io-canvas: #171717; /* .dark --canvas-rgb 23 23 23 */
  --io-canvas-alt: #1b1b1b; /* .dark --canvas-alt-rgb 27 27 27 */
  --io-card: #1f1f1f; /* .dark --card-rgb 31 31 31 */
  --io-raised: #272727; /* .dark --raised-rgb 39 39 39 */
  --io-line-subtle: #2a2a2a; /* .dark --line-subtle-rgb 42 42 42 */
  --io-line: #363636; /* .dark --line-rgb 54 54 54 */
  --io-line-strong: #4a4a4a; /* .dark --line-strong-rgb 74 74 74 */
  --io-fg: #e8e8e8; /* .dark --fg-rgb 232 232 232 */
  --io-fg-secondary: #a8a8a8; /* .dark --fg-secondary-rgb 168 168 168 */
  --io-fg-muted: #949494; /* .dark --fg-muted-rgb 148 148 148 */
  --io-fg-disabled: #646464; /* .dark --fg-disabled-rgb 100 100 100 */
  --io-primary: #f5281f; /* .dark --primary-rgb 245 40 31: the brand hue, brightened */
  --io-primary-light: #ff3a30; /* .dark --primary-light-rgb 255 58 48 */
  --io-primary-soft: rgb(245 40 31 / 0.12);
  --io-success: #4ade80; /* .dark --success-rgb */
  --io-warning: #fbbf24; /* .dark --warning-rgb */
  --io-danger: #f87171; /* .dark --danger-rgb */
  --io-info: #60a5fa; /* .dark --info-rgb */
  --io-header-bg: rgb(23 23 23 / 0.8); /* bg-canvas/80 */
  --io-inline-code-bg: rgb(255 255 255 / 0.1); /* dark:bg-white/10 */
  --io-shadow-1: 0 0 0 1px #363636, 0 1px 2px rgb(0 0 0 / 0.4); /* .dark --shadow-1 */
  --io-shadow-2: 0 0 0 1px #363636, 0 8px 20px rgb(0 0 0 / 0.5); /* .dark --shadow-2 */
  --io-shadow-3: 0 0 0 1px #4a4a4a, 0 16px 40px rgb(0 0 0 / 0.6); /* .dark --shadow-3 */
  --io-code-border: rgb(255 255 255 / 0.1); /* CodeBlock: dark:border-white/10 */
  --io-scroll-thumb: #471817; /* .dark scrollbar: --brand-muted-rgb 71 24 23 */
  --io-scroll-thumb-hover: #840d0a; /* .dark scrollbar hover: --brand-rgb */
}

/* The PyData theme's own variables, pointed at the tokens. */
html,
html[data-theme="light"],
html[data-theme="dark"] {
  --pst-color-primary: var(--io-primary);
  --pst-color-primary-bg: var(--io-primary-soft);
  --pst-color-secondary: var(--io-primary-light);
  --pst-color-secondary-bg: var(--io-primary-soft);
  --pst-color-accent: var(--io-primary);
  --pst-color-link: var(--io-primary);
  --pst-color-link-hover: var(--io-primary);
  --pst-color-link-higher-contrast: var(--io-primary);
  --pst-color-text-base: var(--io-fg-secondary);
  --pst-color-text-muted: var(--io-fg-muted);
  --pst-color-heading: var(--io-fg);
  --pst-heading-color: var(--io-fg);
  --pst-color-background: var(--io-canvas-alt);
  --pst-color-on-background: var(--io-card);
  --pst-color-surface: var(--io-raised);
  --pst-color-on-surface: var(--io-line);
  --pst-color-border: var(--io-line);
  --pst-color-border-muted: var(--io-line);
  --pst-color-shadow: transparent;
  --pst-color-target: var(--io-primary-soft);
  --pst-color-inline-code: var(--io-fg);
  --pst-color-inline-code-links: var(--io-primary);
  --pst-color-info: var(--io-info);
  --pst-color-success: var(--io-success);
  --pst-color-warning: var(--io-warning);
  --pst-color-attention: var(--io-warning);
  --pst-color-danger: var(--io-danger);
  --pst-color-table-row-hover-bg: var(--io-raised);
  --pst-color-table-row-zebra-low-bg: transparent;
  --pst-color-table-row-zebra-high-bg: transparent;
  --pst-color-table-outer-border: var(--io-line);
  --pst-color-table-inner-border: var(--io-line);
  --pst-color-table-heading-bg: var(--io-canvas-alt);
  --pst-color-blockquote-notch: var(--io-line-strong);
}

/* Inter, the website's font (next/font in src/app/layout.tsx), and Tailwind's mono stack. */
html {
  --pst-font-family-base: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --pst-font-family-heading: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --pst-font-family-monospace: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  --pst-font-size-base: 1rem;
  --pst-font-size-h1: 2.25rem; /* text-4xl */
  --pst-font-size-h2: 1.5rem; /* text-2xl */
  --pst-font-size-h3: 1.125rem; /* text-lg */
  --pst-font-size-h4: 1rem;
  --pst-font-size-h5: 0.9375rem;
  --pst-font-size-h6: 0.875rem;
  --pst-font-weight-heading: 600;
  --pst-header-height: 4rem; /* h-16 */
  --pst-header-article-height: 2.75rem;
  --pst-sidebar-font-size: 0.875rem; /* text-sm */
  --pst-sidebar-font-size-mobile: 0.9375rem;
  --pst-sidebar-header-font-size: 0.875rem;
  --pst-sidebar-secondary: 14rem;
  --pst-font-size-icon: 1.25rem;
}

/* -- The page ------------------------------------------------------------------------------- */

body {
  background: var(--io-canvas-alt); /* bg-canvas-alt, as the website's content pages */
  color: var(--io-fg-secondary);
  font-family: var(--pst-font-family-base);
  -webkit-font-smoothing: antialiased; /* the body's `antialiased` */
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: normal;
}

::selection {
  background: rgb(132 13 10 / 0.2); /* rgb(var(--primary-rgb) / 0.2) */
  color: inherit;
}

html[data-theme="dark"] ::selection {
  background: rgb(245 40 31 / 0.35);
  color: var(--io-fg);
}

:focus-visible {
  outline: 2px solid var(--io-primary);
  outline-offset: 2px;
}

/* The website's 4px scrollbars. */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: var(--io-canvas-alt);
}

::-webkit-scrollbar-thumb {
  background: var(--io-scroll-thumb);
  border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--io-scroll-thumb-hover);
}

@supports (-moz-appearance: none) {
  * {
    scrollbar-width: thin;
  }
}

/* max-w-7xl with the website's px-4 / sm:px-6 / lg:px-8 gutters: three columns need it. */
.bd-page-width {
  max-width: 80rem;
}

/* -- Header: Header.tsx ---------------------------------------------------------------------- */

.bd-header {
  background-color: var(--io-header-bg) !important;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px); /* backdrop-blur-md */
  border-bottom: 1px solid var(--io-line);
  box-shadow: none;
}

.bd-header .bd-header__inner {
  height: var(--pst-header-height);
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .bd-header .bd-header__inner {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .bd-header .bd-header__inner {
    padding: 0 2rem;
  }
}

/* The logo, then nav links centred between it and the controls (justify-between). */
.bd-header .navbar-header-items__start.col-lg-3,
.bd-header .navbar-header-items__start {
  flex: 0 0 auto;
  width: auto;
  margin-right: 0;
}

.bd-header .col-lg-9.navbar-header-items {
  flex: 1 1 auto;
  width: auto;
}

@media (min-width: 960px) {
  .bd-header .navbar-header-items {
    align-items: center;
    flex-wrap: nowrap;
    padding: 0;
  }

  .bd-header .navbar-header-items__center {
    margin-left: auto;
  }
}

.navbar-brand {
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
}

.navbar-brand img,
.bd-header .navbar-brand img {
  height: 1.5rem; /* sm:h-6 */
  width: auto;
}

/* "cosmiq" beside the Identity wordmark, after a hairline. */
.navbar-brand p.title.logo__title,
.navbar-brand .logo__title {
  border-left: 1px solid var(--io-line);
  color: var(--io-fg);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.5rem;
  margin: 0;
  padding-left: 0.75rem;
}

.navbar-brand:hover,
.navbar-brand:visited:hover {
  text-decoration: none;
}

.navbar-brand:hover .logo__title {
  color: var(--io-fg);
  text-decoration: none;
}

/* Nav links: text-sm text-fg-secondary hover:text-fg, gap-7; the current one text-fg font-medium. */
.bd-header ul.navbar-nav {
  column-gap: 1.5rem; /* gap-7 is 1.75rem; six links need a little less */
  flex-wrap: nowrap;
}

.bd-header ul.navbar-nav > li.nav-item {
  margin-inline: 0;
}

.bd-header ul.navbar-nav > li.nav-item > .nav-link {
  color: var(--io-fg-secondary);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.25rem;
  padding: 0.5rem 0;
  transition: color 0.15s;
  white-space: nowrap;
}

.bd-header ul.navbar-nav > li.nav-item > .nav-link:hover {
  color: var(--io-fg);
  text-decoration: none;
}

.bd-header ul.navbar-nav > li.nav-item > .nav-link:before,
.bd-header ul.navbar-nav > li.nav-item > .nav-link:hover:before,
.bd-header ul.navbar-nav > li.nav-item.current > .nav-link:before {
  border-bottom: 0;
}

.bd-header ul.navbar-nav > li.nav-item.current > .nav-link {
  color: var(--io-fg);
  font-weight: 500;
}

.bd-header ul.navbar-nav > li.nav-item.dropdown > .dropdown-toggle {
  color: var(--io-fg-secondary);
  font-size: 0.875rem;
}

.bd-header ul.navbar-nav > li.nav-item.dropdown > .dropdown-toggle:hover {
  box-shadow: none;
  color: var(--io-fg);
  text-decoration: none;
}

/* The controls on the right: gap-3, icon buttons p-2 rounded-lg hover:bg-raised. */
.bd-header .navbar-header-items__end {
  column-gap: 0.5rem;
}

.bd-header .navbar-header-items__center + .navbar-header-items__end,
.bd-header .navbar-header-items__end {
  padding-left: 1.5rem;
}

.bd-header .navbar-icon-links {
  column-gap: 0;
}

html body .pst-navbar-icon,
html body .bd-header button.sidebar-toggle,
html body .theme-switch-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0.5rem;
  color: var(--io-fg-secondary);
  display: inline-flex;
  font-size: 1.05rem;
  height: 2.25rem;
  justify-content: center;
  margin: 0;
  min-width: 2.25rem;
  padding: 0.5rem;
  transition: color 0.15s, background-color 0.15s;
  width: 2.25rem;
}

html body .pst-navbar-icon:hover,
html body .bd-header button.sidebar-toggle:hover,
html body .theme-switch-button:hover {
  background: var(--io-raised);
  box-shadow: none;
  color: var(--io-fg);
}

html body .pst-navbar-icon:before,
html body .pst-navbar-icon:hover:before {
  border-bottom: 0;
  display: none;
}

.bd-header button.primary-toggle {
  margin-right: 0.5rem;
}

.bd-header button.secondary-toggle {
  margin-left: 0.25rem;
}

/* Search: an icon button in the bar (the dialog keeps Ctrl+K). */
html body .search-button-field {
  background: transparent;
  border: 0;
  border-radius: 0.5rem;
  color: var(--io-fg-secondary);
  font-size: 0.875rem;
  gap: 0.5rem;
  height: 2.25rem;
  justify-content: center;
  padding: 0 0.5rem;
  width: auto;
}

html body .search-button-field:hover {
  background: var(--io-raised);
  border: 0;
  box-shadow: none;
  color: var(--io-fg);
}

.bd-header .search-button-field .search-button__default-text,
.bd-header .search-button-field .search-button__kbd-shortcut {
  display: none;
}

.navbar-persistent--mobile {
  margin-left: auto;
}

/* Dropdowns ("More"): bg-card border-line rounded-lg shadow-xl. */
.dropdown-menu,
.bd-header ul.navbar-nav .dropdown .dropdown-menu {
  background: var(--io-card);
  border: 1px solid var(--io-line);
  border-radius: 0.5rem;
  box-shadow: var(--io-shadow-3);
  min-width: 10rem;
  overflow: hidden;
  padding: 0.25rem 0;
}

.dropdown-item,
.theme-change-button {
  background: transparent;
  border: 0;
  color: var(--io-fg);
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
}

.dropdown-item:hover,
.dropdown-item:focus,
.theme-change-button:hover {
  background: var(--io-raised);
  color: var(--io-fg);
  text-decoration: none;
}

.dropdown-item.active,
.dropdown-item:active {
  background: var(--io-raised);
  color: var(--io-primary);
}

/* The red call to action: px-3.5 py-2 rounded-lg text-sm font-semibold text-white bg-primary. */
a.cosmiq-cta {
  align-items: center;
  background: var(--io-brand);
  border-radius: 0.5rem;
  color: #ffffff;
  display: inline-flex;
  font-size: 0.875rem;
  font-weight: 600;
  gap: 0.375rem;
  line-height: 1.25rem;
  margin-left: 0.25rem;
  padding: 0.5rem 0.875rem;
  text-decoration: none;
  transition: background-color 0.15s;
  white-space: nowrap;
}

a.cosmiq-cta:hover,
a.cosmiq-cta:focus {
  background: var(--io-brand-light);
  color: #ffffff;
  text-decoration: none;
}

a.cosmiq-cta svg {
  height: 0.875rem;
  width: 0.875rem;
}

/* Narrower desktops: the nav keeps its links, the extras give way. */
@media (max-width: 1359.98px) {
  .bd-header .navbar-header-items__end .navbar-item:has(.cosmiq-cta) {
    display: none;
  }

  .bd-header ul.navbar-nav {
    column-gap: 1.25rem;
  }
}

@media (max-width: 1099.98px) {
  .bd-header ul.navbar-nav {
    column-gap: 1rem;
  }

  .bd-header .navbar-header-items__end {
    padding-left: 0.5rem;
  }
}

@media (min-width: 960px) and (max-width: 1099.98px) {
  .bd-header .navbar-brand .logo__title {
    display: none;
  }
}

/* "More": the website's Resources menu. */
.bd-header ul.navbar-nav > li.nav-item.dropdown > .dropdown-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  display: inline-flex;
  gap: 0.25rem;
  line-height: 1.25rem;
  padding: 0.5rem 0;
}

.bd-header ul.navbar-nav .dropdown .dropdown-menu {
  border-radius: 0.75rem; /* rounded-xl shadow-3 */
  margin-top: 0.5rem;
  min-width: 12rem;
  padding: 0.5rem;
}

.bd-header ul.navbar-nav .dropdown .dropdown-menu .dropdown-item,
.bd-header ul.navbar-nav li a.nav-link.dropdown-item {
  border-radius: 0.375rem; /* rounded-md px-2 py-1.5 text-sm */
  color: var(--io-fg-secondary);
  font-size: 0.875rem;
  padding: 0.375rem 0.5rem;
}

.bd-header ul.navbar-nav li a.nav-link.dropdown-item:hover {
  background: var(--io-raised);
  color: var(--io-fg);
  text-decoration: none;
}

/* -- Layout --------------------------------------------------------------------------------- */

.bd-container .bd-container__inner {
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .bd-container .bd-container__inner {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .bd-container .bd-container__inner {
    padding: 0 2rem;
  }
}

/* The left nav: the legal pages' side nav, no border, sticky under the header. */
.bd-sidebar-primary {
  background: transparent;
  border-right: 0;
  gap: 0;
  padding: 2rem 1.5rem 2rem 0;
  top: var(--pst-header-height);
  max-height: calc(100vh - var(--pst-header-height));
}

@media (min-width: 960px) {
  .bd-sidebar-primary {
    font-size: 0.875rem;
    width: 16rem;
  }
}

@media (max-width: 959.98px) {
  .bd-sidebar-primary,
  #pst-primary-sidebar-modal,
  #pst-secondary-sidebar-modal {
    background: var(--io-canvas);
    padding: 1.25rem;
  }
}

.bd-sidebar-primary .sidebar-primary-items__start,
.bd-sidebar-primary .sidebar-primary-items__start .sidebar-primary-item {
  border-top: 0;
  padding: 0;
}

.bd-sidebar-primary .sidebar-primary-items__end {
  display: none;
}

.bd-sidebar-primary .sidebar-primary-item.pst-sidebar-collapse,
#pst-collapse-sidebar-button {
  display: none !important;
}

nav.bd-links p.bd-links__title {
  display: none;
}

nav.bd-links {
  margin: 0;
}

nav.bd-links ul.bd-sidenav,
nav.bd-links .bd-sidenav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

nav.bd-links .bd-sidenav ul {
  border-left: 1px solid var(--io-line);
  margin: 0.125rem 0 0.25rem 0.75rem;
  padding-left: 0.5rem;
}

nav.bd-links li > a,
nav.bd-links .bd-sidenav li > a {
  border-radius: 0.375rem; /* rounded-md */
  color: var(--io-fg-secondary);
  display: block;
  font-size: 0.875rem;
  line-height: 1.25rem;
  padding: 0.375rem 0.5rem; /* px-2 py-1.5 */
  text-decoration: none;
  transition: color 0.15s, background-color 0.15s;
}

nav.bd-links li > a:hover {
  background: var(--io-raised);
  color: var(--io-fg);
  text-decoration: none;
}

nav.bd-links .current > a,
nav.bd-links li > a.current,
nav.bd-links .bd-sidenav .current > a,
nav.bd-links .bd-sidenav li > a.current {
  background: transparent;
  box-shadow: none;
  color: var(--io-primary);
  font-weight: 500;
}

nav.bd-links li.current > a:hover {
  background: var(--io-raised);
}

nav.bd-links li > a code,
nav.bd-links li > a code.literal {
  background: transparent;
  border: 0;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  padding: 0;
}

nav.bd-links p.caption,
.bd-sidebar-primary p.caption {
  color: var(--io-fg-muted);
  font-size: 0.6875rem; /* text-[11px] */
  font-weight: 600;
  letter-spacing: 0.025em;
  margin: 1.25rem 0 0.375rem;
  padding: 0 0.5rem;
  text-transform: uppercase;
}

nav.bd-links li.has-children > details > summary .toctree-toggle,
nav.bd-links .toctree-toggle {
  color: var(--io-fg-muted);
}

nav.bd-links .toctree-toggle:hover {
  background: var(--io-raised);
  border-radius: 0.375rem;
}

/* The mobile drawer's copy of the header nav. */
.bd-sidebar-primary .sidebar-header-items .bd-navbar-elements .nav-link,
.bd-sidebar-primary .sidebar-header-items .nav-link {
  border-radius: 0.375rem;
  color: var(--io-fg-secondary);
  font-size: 0.9375rem;
  padding: 0.375rem 0.5rem;
}

.bd-sidebar-primary .sidebar-header-items .nav-item.current > .nav-link {
  color: var(--io-fg);
  font-weight: 500;
  box-shadow: none;
}

.bd-sidebar-primary .sidebar-header-items__end {
  align-items: center;
  border-top: 1px solid var(--io-line);
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
}

/* The article column: about the legal pages' measure (max-w-5xl with a 200px nav). */
.bd-main .bd-content .bd-article-container {
  max-width: 50rem;
  padding: 0 1rem;
}

@media (min-width: 960px) {
  .bd-main .bd-content .bd-article-container {
    padding: 0 2.5rem;
  }
}

.bd-main .bd-content .bd-article-container .bd-article {
  padding: 0.5rem 0 0;
}

@media (min-width: 1200px) {
  .bd-main .bd-content .bd-article-container .bd-article {
    padding-left: 0;
    padding-top: 0.5rem;
  }
}

/* Breadcrumbs: the website's quiet back link (text-sm text-fg-muted). */
.bd-header-article {
  margin-top: 1.5rem;
}

.header-article__inner {
  padding: 0;
}

.bd-breadcrumbs {
  font-size: 0.8125rem;
  padding: 0;
}

.bd-breadcrumbs .breadcrumb-item,
.bd-breadcrumbs .breadcrumb-item a.nav-link {
  color: var(--io-fg-muted);
  font-size: 0.8125rem;
  padding: 0;
}

.bd-breadcrumbs .breadcrumb-item a.nav-link:hover {
  color: var(--io-fg);
  text-decoration: none;
}

.bd-breadcrumbs .breadcrumb-item.active {
  color: var(--io-fg-secondary);
}

.bd-breadcrumbs .breadcrumb-item + .breadcrumb-item::before {
  color: var(--io-fg-disabled);
  padding: 0 0.5rem;
}

/* The right column: "On this page". */
.bd-sidebar-secondary {
  background: transparent;
  padding: 2rem 0 2rem 1rem;
  top: var(--pst-header-height);
  max-height: calc(100vh - var(--pst-header-height));
}

@media (max-width: 1199.98px) {
  .bd-sidebar-secondary {
    background: var(--io-canvas);
    padding: 1.25rem;
  }
}

.sidebar-secondary-item {
  padding: 0;
}

.page-toc.tocsection.onthispage,
.tocsection.onthispage {
  border: 0;
  color: var(--io-fg-muted);
  font-size: 0.6875rem; /* text-[11px] font-semibold uppercase tracking-wide text-fg-muted */
  font-weight: 600;
  letter-spacing: 0.025em;
  margin-bottom: 0.75rem;
  padding: 0;
  text-transform: uppercase;
}

.page-toc.tocsection.onthispage i,
.tocsection.onthispage i {
  display: none;
}

nav.page-toc ul.section-nav,
.page-toc .section-nav {
  border-left: 1px solid var(--io-line);
  padding-left: 0;
}

.page-toc .section-nav ul.section-nav,
.page-toc .section-nav .section-nav {
  border-left: 0;
  padding-left: 0;
}

.page-toc .section-nav .section-nav .toc-entry > a.nav-link {
  padding-left: 1.5rem;
}

.toc-entry a.nav-link,
.page-toc .toc-entry > .nav-link {
  border-left: 1px solid transparent;
  color: var(--io-fg-muted);
  font-size: 0.8125rem;
  line-height: 1.25rem;
  margin-left: -1px;
  padding: 0.25rem 0 0.25rem 0.75rem;
  transition: color 0.15s, border-color 0.15s;
}

.toc-entry a.nav-link:hover {
  color: var(--io-fg);
  text-decoration: none;
}

.toc-entry a.nav-link.active,
.page-toc .toc-entry > .nav-link.active {
  background: transparent;
  border-left-color: var(--io-primary);
  box-shadow: none;
  color: var(--io-primary);
  font-weight: 500;
}

.toc-entry a.nav-link code,
.toc-entry a.nav-link code.literal {
  background: transparent;
  border: 0;
  color: inherit;
  font-size: 0.95em;
  padding: 0;
}

.tocsection.editthispage,
.editthispage {
  border-top: 1px solid var(--io-line);
  margin-top: 1.25rem;
  padding: 1rem 0 0;
}

.editthispage a,
.tocsection.editthispage a {
  color: var(--io-fg-muted);
  font-size: 0.8125rem;
}

.editthispage a:hover {
  color: var(--io-fg);
  text-decoration: none;
}

/* -- Typography: the legal and lesson pages -------------------------------------------------- */

.bd-article {
  color: var(--io-fg-secondary);
  font-size: 1rem;
  line-height: 1.625; /* leading-relaxed */
}

.bd-article p,
.bd-article li,
.bd-article dd {
  line-height: 1.625;
}

.bd-article p {
  margin: 0 0 1rem;
}

.bd-article h1,
.bd-article h2,
.bd-article h3,
.bd-article h4,
.bd-article h5,
.bd-article h6 {
  color: var(--io-fg);
  font-family: var(--pst-font-family-heading);
}

/* h1: text-3xl sm:text-4xl font-bold tracking-tight text-fg */
.bd-article h1 {
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 2.25rem;
  margin: 0.5rem 0 1.5rem;
}

@media (min-width: 640px) {
  .bd-article h1 {
    font-size: 2.25rem;
    line-height: 2.5rem;
  }
}

/* h2: text-2xl font-semibold (the lessons' section titles) */
.bd-article h2 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 2rem;
  margin: 3rem 0 1rem;
}

/* h3: text-lg font-semibold (the legal pages' section headings) */
.bd-article h3 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.75rem;
  margin: 2.25rem 0 0.75rem;
}

.bd-article h4,
.bd-article h5,
.bd-article h6 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5rem;
  margin: 1.75rem 0 0.5rem;
}

.bd-article :is(h1, h2, h3, h4, h5, h6) > code,
.bd-article :is(h1, h2, h3, h4, h5, h6) code.literal {
  font-size: 0.85em;
  font-weight: 600;
}

/* The heading anchors appear on hover only. */
.bd-article a.headerlink {
  color: var(--io-fg-disabled);
  font-weight: 400;
  margin-left: 0.375rem;
  opacity: 0;
  text-decoration: none;
  transition: opacity 0.15s;
}

.bd-article :is(h1, h2, h3, h4, h5, h6, dt):hover > a.headerlink,
.bd-article a.headerlink:focus {
  opacity: 1;
}

.bd-article a.headerlink:hover {
  background: transparent;
  color: var(--io-primary);
}

/* Links: font-medium text-primary underline-offset-4 hover:underline */
.bd-article a,
.bd-article a:visited {
  color: var(--io-primary);
  font-weight: 500;
  text-decoration: none;
  text-underline-offset: 4px;
}

.bd-article a:hover {
  color: var(--io-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.bd-article strong {
  color: var(--io-fg);
  font-weight: 600;
}

.bd-article ul,
.bd-article ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem; /* pl-6 */
}

.bd-article li {
  margin: 0.25rem 0;
}

.bd-article li > p {
  margin: 0;
}

.bd-article li::marker {
  color: var(--io-fg-muted);
}

.bd-article hr {
  border: 0;
  border-top: 1px solid var(--io-line);
  margin: 2.5rem 0;
  opacity: 1;
}

.bd-article blockquote {
  background: transparent;
  border-left: 2px solid var(--io-line-strong);
  color: var(--io-fg-secondary);
  margin: 1.5rem 0;
  padding: 0 0 0 1rem;
}

.bd-article blockquote::before {
  display: none;
}

/* Inline code: rounded bg-gray-100 px-1 (dark:bg-white/10), in the text's own colour. */
.bd-article code.literal,
.bd-article code:not(pre code),
code.literal {
  background: var(--io-inline-code-bg);
  border: 0;
  border-radius: 0.25rem;
  color: var(--io-fg);
  font-family: var(--pst-font-family-monospace);
  font-size: 0.875em;
  padding: 0.125rem 0.3125rem;
}

.bd-article a code.literal,
.bd-article a code.xref {
  color: var(--io-primary);
}

/* -- Code blocks: CodeBlock.tsx (VS Code Dark+, a title bar with three dots and Copy) -------- */

.bd-article div[class*="highlight-"]:not(.output) {
  margin: 1.5rem 0; /* my-6 */
}

.bd-article div[class*="highlight-"]:not(.output) > div.highlight {
  background: #1e1e1e;
  border: 1px solid var(--io-code-border);
  border-radius: 0.75rem; /* rounded-xl */
  overflow: hidden;
  position: relative;
}

/* The title bar: bg #252526, border-b gray-700/50, the dots and the language. */
.bd-article div[class*="highlight-"]:not(.output) > div.highlight::before {
  background-color: #252526;
  background-image:
    radial-gradient(circle at 6px 6px, #ff5f56 5.5px, transparent 6px),
    radial-gradient(circle at 6px 6px, #ffbd2e 5.5px, transparent 6px),
    radial-gradient(circle at 6px 6px, #27c93f 5.5px, transparent 6px);
  background-position:
    1rem 50%,
    calc(1rem + 18px) 50%,
    calc(1rem + 36px) 50%;
  background-repeat: no-repeat;
  background-size:
    12px 12px,
    12px 12px,
    12px 12px;
  border-bottom: 1px solid rgb(55 65 81 / 0.5);
  color: #9ca3af; /* text-gray-400 */
  content: "";
  display: block;
  font-family: var(--pst-font-family-base);
  font-size: 0.75rem;
  font-weight: 500;
  height: 2.5rem;
  letter-spacing: 0.05em; /* uppercase tracking-wider */
  line-height: 2.5rem;
  padding-left: calc(1rem + 66px);
  text-transform: uppercase;
}

.bd-article :is(.highlight-python, .highlight-ipython3, .highlight-default, .highlight-python3)
  > div.highlight::before {
  content: "python";
}

.bd-article :is(.highlight-bash, .highlight-shell, .highlight-console, .highlight-sh)
  > div.highlight::before {
  content: "bash";
}

.bd-article .highlight-bibtex > div.highlight::before {
  content: "bibtex";
}

.bd-article :is(.highlight-toml, .highlight-yaml, .highlight-json)
  > div.highlight::before {
  content: "config";
}

.bd-article div.highlight pre,
.bd-article div[class*="highlight-"] pre {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: #d4d4d4;
  font-family: var(--pst-font-family-monospace);
  font-size: 0.8125rem; /* text-[13px] */
  line-height: 1.5rem; /* leading-6 */
  margin: 0;
  padding: 1.25rem; /* p-5 */
}

/* Copy: in the title bar, text-gray-400 hover:text-white hover:bg-white/10, with its label. */
.bd-article div[class*="highlight-"]:not(.output) button.copybtn {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0.375rem;
  color: #9ca3af;
  gap: 0.375rem;
  height: 1.75rem;
  opacity: 1;
  padding: 0 0.625rem;
  right: 0.5rem;
  top: 0.375rem;
  width: auto;
}

.bd-article div[class*="highlight-"]:not(.output) button.copybtn:hover {
  background: rgb(255 255 255 / 0.1);
  color: #ffffff;
}

.bd-article div[class*="highlight-"]:not(.output) button.copybtn.success {
  color: #4ade80; /* text-green-400 */
}

.bd-article div[class*="highlight-"] button.copybtn svg {
  height: 0.875rem;
  padding: 0;
  width: 0.875rem;
}

/* The tooltip becomes the button's own "Copy" / "Copied!" label. */
.bd-article div[class*="highlight-"]:not(.output) button.copybtn.o-tooltip--left::after {
  background: transparent;
  border: 0;
  color: inherit;
  content: attr(data-tooltip);
  font-family: var(--pst-font-family-base);
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 1;
  padding: 0;
  position: static;
  transform: none;
  visibility: visible;
  white-space: nowrap;
}

.bd-article div[class*="highlight-"]:not(.output) button.copybtn.o-tooltip--left::before {
  display: none;
}

/* Dark+ token colours (CodeBlock.tsx's colorMap), whatever the page's mode. */
html[data-theme] .bd-article .highlight,
html[data-theme] .bd-article .highlight .w {
  color: #d4d4d4;
}

html[data-theme] .highlight :is(.k, .kn, .kd, .kr, .kc, .kp, .kt, .ow) {
  color: #c586c0; /* keyword */
  font-weight: 400;
}

html[data-theme] .highlight :is(.s, .s1, .s2, .sa, .sb, .sc, .dl, .sd, .se, .sh, .si, .sx, .sr, .ss) {
  color: #ce9178; /* string */
  font-style: normal;
}

html[data-theme] .highlight :is(.c, .c1, .cm, .ch, .cp, .cpf, .cs) {
  color: #6a9955; /* comment */
  font-style: normal;
}

html[data-theme] .highlight :is(.m, .mi, .mf, .mh, .mo, .mb, .il) {
  color: #b5cea8; /* number */
}

html[data-theme] .highlight :is(.nd, .nb, .nf, .fm) {
  color: #dcdcaa; /* decorator, builtin, function */
  font-weight: 400;
}

html[data-theme] .highlight :is(.n, .nn, .nc, .nv, .na, .nx, .ni, .nl, .nt, .no, .ne, .bp, .vc, .vg, .vi, .vm, .py) {
  color: #9cdcfe; /* identifier */
  font-weight: 400;
}

html[data-theme] .highlight :is(.o, .p, .x, .g, .gh, .gu, .go, .esc) {
  color: #d4d4d4; /* operator, plain */
  font-weight: 400;
}

html[data-theme] .highlight .gp {
  color: #6a9955; /* the >>> and $ prompts */
}

html[data-theme] .highlight :is(.err, .gr, .gt, .gd) {
  background: transparent;
  border: 0;
  color: #f48771;
}

html[data-theme] .highlight .gi {
  color: #b5cea8;
}

html[data-theme] .highlight .hll {
  background: rgb(255 255 255 / 0.06);
}

/* Cell outputs: a plain panel under the code, labelled like the website's group labels. */
.bd-article div.cell {
  margin: 1.5rem 0;
}

.bd-article div.cell > div.cell_input {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.bd-article div.cell div.cell_input > div[class*="highlight-"] {
  margin: 0 !important;
}

.bd-article .cell_output {
  margin-top: 0.75rem;
  padding: 0;
}

.bd-article .cell_output .output,
.bd-article .cell_output .output.stream,
.bd-article .cell_output .output.text_plain {
  background: var(--io-card);
  border: 1px solid var(--io-line);
  border-radius: 0.75rem;
  margin: 0;
  overflow: hidden;
}

.bd-article .cell_output .output::before {
  color: var(--io-fg-muted);
  content: "Output";
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  padding: 0.75rem 1.25rem 0;
  text-transform: uppercase;
}

.bd-article .cell_output .output div.highlight,
.bd-article .cell_output .output pre {
  background: transparent;
  border: 0;
  color: var(--io-fg-secondary);
}

.bd-article .cell_output .output pre {
  padding: 0.5rem 1.25rem 1rem;
}

.bd-article .cell_output .output .highlight :is(.go, .x, .w, .n, .o, .p, .g) {
  color: inherit;
}

.bd-article .cell_output .output.stderr,
.bd-article .cell_output .output.traceback {
  border-color: var(--io-danger);
}

.bd-article .cell_output img {
  background: #ffffff;
  border-radius: 0.5rem;
  max-width: 100%;
}

/* -- Tables: rounded-xl border border-line bg-card ------------------------------------------ */

.bd-article .pst-scrollable-table-container {
  background: var(--io-card);
  border: 1px solid var(--io-line);
  border-radius: 0.75rem;
  margin: 1.5rem 0;
  overflow-x: auto;
}

.bd-article table,
.bd-article table.table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: transparent;
  --bs-table-hover-bg: var(--io-raised);
  background: transparent;
  border: 0;
  border-collapse: collapse;
  color: var(--io-fg-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0;
  width: 100%;
}

.bd-article table :is(th, td) {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--io-line);
  padding: 0.625rem 1rem;
  text-align: left;
  vertical-align: top;
}

.bd-article table thead tr,
.bd-article table.table thead tr {
  background: transparent;
  border-bottom: 0;
}

.bd-article table thead :is(th, td),
.bd-article table th.head {
  background: var(--io-canvas-alt);
  border-top: 0;
  color: var(--io-fg);
  font-weight: 600;
}

.bd-article table tbody tr:first-child :is(th, td) {
  border-top: 0;
}

.bd-article table thead + tbody tr:first-child :is(th, td) {
  border-top: 1px solid var(--io-line);
}

.bd-article table :is(th, td) p {
  margin: 0;
}

.bd-article table caption {
  color: var(--io-fg-muted);
  font-size: 0.8125rem;
  padding: 0.75rem 1rem;
}

.bd-article table.autosummary td:first-child {
  white-space: nowrap;
}

/* -- Callouts: the website's cards (rounded-xl border bg-card) ------------------------------- */

.bd-article .admonition,
.bd-article div.admonition {
  background: var(--io-card);
  border: 1px solid var(--io-line);
  border-left: 3px solid var(--io-info);
  border-radius: 0.75rem;
  box-shadow: none;
  color: var(--io-fg-secondary);
  font-size: 0.9375rem;
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
}

.bd-article .admonition > .admonition-title,
.bd-article div.admonition > .admonition-title {
  background: transparent;
  color: var(--io-fg);
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0 0 0.375rem;
  padding: 0;
}

.bd-article .admonition > .admonition-title::before,
.bd-article .admonition > .admonition-title::after {
  display: none;
}

.bd-article .admonition > :last-child {
  margin-bottom: 0;
}

.bd-article .admonition:is(.warning, .caution, .attention, .important) {
  border-left-color: var(--io-warning);
}

.bd-article .admonition:is(.error, .danger) {
  border-left-color: var(--io-danger);
}

.bd-article .admonition:is(.tip, .hint, .seealso) {
  border-left-color: var(--io-success);
}

/* -- The API reference ---------------------------------------------------------------------- */

.bd-article dl.py {
  margin: 0 0 2rem;
}

.bd-article dl.py > dt.sig {
  background: var(--io-card);
  border: 1px solid var(--io-line);
  border-radius: 0.5rem;
  color: var(--io-fg-secondary);
  font-family: var(--pst-font-family-monospace);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.5rem;
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.875rem;
  scroll-margin-top: calc(var(--pst-header-height) + 1rem);
}

.bd-article dl.py:is(.class, .function, .data) > dt.sig {
  border-left: 3px solid var(--io-primary);
}

.bd-article dl.py > dt.sig:target {
  background: var(--io-primary-soft);
}

.bd-article dt.sig .sig-name,
.bd-article dt.sig .sig-name .pre {
  color: var(--io-fg);
  font-weight: 600;
}

.bd-article dt.sig .sig-prename,
.bd-article dt.sig .sig-paren,
.bd-article dt.sig .p {
  color: var(--io-fg-muted);
}

.bd-article dt.sig .property,
.bd-article dt.sig em.property {
  color: var(--io-primary);
  font-style: normal;
}

.bd-article dt.sig .sig-param,
.bd-article dt.sig em.sig-param {
  font-style: normal;
}

.bd-article dt.sig a {
  font-weight: 400;
}

.bd-article dl.py > dd {
  margin: 0 0 0 1.25rem;
}

.bd-article dl.py dl.py > dt.sig {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--io-line);
  border-radius: 0;
  padding: 0.375rem 0;
}

.bd-article dl.field-list {
  display: grid;
  gap: 0.25rem 1rem;
  grid-template-columns: max-content auto;
  margin: 1rem 0;
}

.bd-article dl.field-list > dt {
  color: var(--io-fg);
  font-size: 0.875rem;
  font-weight: 600;
}

.bd-article dl.field-list > dd {
  margin: 0;
}

/* "Classes", "Functions": the website's group labels. */
.bd-article p.rubric {
  border-bottom: 0;
  color: var(--io-fg-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin: 2.5rem 0 0.75rem;
  text-transform: uppercase;
}

/* -- Previous / next: two cards ------------------------------------------------------------- */

.prev-next-footer {
  border-top: 1px solid var(--io-line);
  margin-top: 4rem;
  padding-top: 2rem;
}

.prev-next-area {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1fr;
  margin: 0 0 3rem;
}

.prev-next-area a {
  background: var(--io-card);
  border: 1px solid var(--io-line);
  border-radius: 0.75rem;
  box-shadow: var(--io-shadow-1);
  color: var(--io-fg);
  display: flex;
  gap: 0.75rem;
  max-width: none;
  padding: 1rem 1.25rem;
  text-decoration: none;
  transition: border-color 0.15s;
}

.prev-next-area a:hover {
  border-color: var(--io-primary);
  text-decoration: none;
}

.prev-next-area a.right-next {
  grid-column: 2;
  justify-content: flex-end;
  text-align: right;
}

.prev-next-area a i {
  align-self: center;
  color: var(--io-fg-muted);
  font-size: 0.875rem;
}

.prev-next-area a .prev-next-info p.prev-next-subtitle {
  color: var(--io-fg-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  margin: 0 0 0.125rem;
  text-transform: uppercase;
}

.prev-next-area a p.prev-next-title {
  color: var(--io-fg);
  font-size: 0.9375rem;
  font-weight: 500;
  margin: 0;
  text-decoration: none;
}

.prev-next-area a:hover p.prev-next-title,
.prev-next-area a:visited:hover p.prev-next-title {
  color: var(--io-primary);
  text-decoration: none;
}

.prev-next-area a p.prev-next-title code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* -- Footer: Footer.tsx, always dark --------------------------------------------------------- */

.bd-footer {
  /* The `dark` island: the footer's tokens are the dark ones in both modes. */
  --io-f-canvas: #171717;
  --io-f-line: #363636;
  --io-f-fg: #e8e8e8;
  --io-f-fg-secondary: #a8a8a8;
  --io-f-fg-muted: #949494;
  background: var(--io-f-canvas);
  border-top: 1px solid var(--io-f-line);
  color: var(--io-f-fg-secondary);
  font-size: 0.875rem;
}

.bd-footer .bd-footer__inner {
  display: block;
  max-width: 72rem; /* max-w-6xl */
  padding: 3rem 1rem; /* py-12 */
}

@media (min-width: 640px) {
  .bd-footer .bd-footer__inner {
    padding: 3rem 1.5rem;
  }
}

@media (min-width: 1024px) {
  .bd-footer .bd-footer__inner {
    padding: 3rem 2rem;
  }
}

.bd-footer .footer-items__start {
  display: block;
}

.cosmiq-footer__grid {
  display: grid;
  gap: 2rem; /* gap-8 */
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .cosmiq-footer__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)); /* md:grid-cols-4 */
  }
}

.cosmiq-footer__logo {
  height: 2.25rem; /* h-9 */
  width: auto;
}

@media (min-width: 640px) {
  .cosmiq-footer__logo {
    height: 2.5rem; /* sm:h-10 */
  }
}

.cosmiq-footer p,
.bd-footer .cosmiq-footer p {
  color: var(--io-f-fg-secondary);
  font-size: 0.875rem;
  line-height: 1.25rem;
  margin: 0.5rem 0 0;
}

.cosmiq-footer h3 {
  color: var(--io-f-fg);
  font-family: var(--pst-font-family-base);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5rem;
  margin: 0 0 0.75rem;
}

.cosmiq-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cosmiq-footer li + li {
  margin-top: 0.5rem; /* space-y-2 */
}

.cosmiq-footer a,
.bd-footer .cosmiq-footer a {
  color: var(--io-f-fg-secondary);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.15s;
}

.cosmiq-footer a:hover,
.bd-footer .cosmiq-footer a:hover {
  color: var(--io-f-fg);
  text-decoration: none;
}

.cosmiq-footer__contact ul {
  margin-top: 0.75rem;
}

.cosmiq-footer__muted {
  color: var(--io-f-fg-muted);
}

.cosmiq-footer__bottom {
  border-top: 1px solid var(--io-f-line);
  color: var(--io-f-fg-muted);
  font-size: 0.75rem;
  line-height: 1.625;
  margin-top: 3rem; /* mt-12 pt-8 */
  padding-top: 2rem;
}

.bd-footer .cosmiq-footer__bottom p {
  color: var(--io-f-fg-muted);
  font-size: 0.875rem;
  margin: 0;
  text-align: center;
}

/* -- Search, back to top -------------------------------------------------------------------- */

#pst-search-dialog {
  background: var(--io-card);
  border: 1px solid var(--io-line);
  border-radius: 0.75rem;
  box-shadow: var(--io-shadow-3);
  padding: 0.5rem 0.75rem;
}

#pst-search-dialog::backdrop {
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  background: rgb(0 0 0 / 0.4);
}

.bd-search,
form.bd-search {
  background: transparent;
  border: 0;
  color: var(--io-fg);
}

.bd-search input.form-control,
.bd-search .form-control {
  background: transparent;
  color: var(--io-fg);
  font-size: 1rem;
}

.bd-search .form-control:focus {
  box-shadow: none;
}

.search-button__kbd-shortcut kbd,
kbd.kbd-shortcut__modifier {
  background: var(--io-raised);
  border: 1px solid var(--io-line);
  border-radius: 0.25rem;
  box-shadow: none;
  color: var(--io-fg-muted);
  font-family: var(--pst-font-family-base);
  font-size: 0.6875rem;
}

#pst-back-to-top {
  background: var(--io-card);
  border: 1px solid var(--io-line);
  border-radius: 9999px;
  box-shadow: var(--io-shadow-2);
  color: var(--io-fg-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.375rem 0.875rem;
  top: calc(var(--pst-header-height) + 1rem);
}

#pst-back-to-top:hover {
  color: var(--io-fg);
}

#pst-back-to-top i {
  margin-right: 0.375rem;
}

/* The search results page. */
#search-results .search li {
  border-top: 1px solid var(--io-line);
  padding: 1rem 0;
}

#search-results p.search-summary {
  color: var(--io-fg-muted);
}

/* -- Buttons: the run buttons (D94) and the home page's ------------------------------------ */

.cosmiq-run,
.cosmiq-home-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem; /* gap-3 */
  margin: 1rem 0 1.75rem;
}

.bd-article .cosmiq-run a,
.bd-article .cosmiq-home-buttons a {
  align-items: center;
  border: 1px solid var(--io-line-strong);
  border-radius: 0.5rem; /* rounded-lg */
  color: var(--io-fg);
  display: inline-flex;
  font-size: 0.875rem; /* Button size sm: px-4 py-2 text-sm */
  font-weight: 500;
  letter-spacing: 0.025em; /* tracking-wide */
  line-height: 1.25rem;
  padding: 0.5rem 1rem;
  text-decoration: none;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.bd-article .cosmiq-run a:hover,
.bd-article .cosmiq-home-buttons a:hover {
  background: var(--io-raised);
  text-decoration: none;
}

/* Primary: bg-primary text-white hover:bg-primary-light shadow-lg shadow-primary/20 */
.bd-article .cosmiq-run a.cosmiq-run-studio,
.bd-article .cosmiq-home-buttons a.cosmiq-run-studio {
  background: var(--io-brand);
  border-color: var(--io-brand);
  box-shadow: 0 10px 15px -3px rgb(132 13 10 / 0.2), 0 4px 6px -4px rgb(132 13 10 / 0.2);
  color: #ffffff;
}

html[data-theme="dark"] .bd-article .cosmiq-run a.cosmiq-run-studio,
html[data-theme="dark"] .bd-article .cosmiq-home-buttons a.cosmiq-run-studio {
  box-shadow: 0 0 14px rgb(245 40 31 / 0.45); /* dark:shadow-[0_0_14px_rgba(var(--primary-rgb),0.45)] */
}

.bd-article .cosmiq-run a.cosmiq-run-studio:hover,
.bd-article .cosmiq-home-buttons a.cosmiq-run-studio:hover {
  background: var(--io-brand-light);
  border-color: var(--io-brand-light);
  color: #ffffff;
}

/* The downloads: the text-link action (tertiary). */
.bd-article .cosmiq-run a.cosmiq-run-file {
  border-color: transparent;
  color: var(--io-fg-muted);
  font-weight: 400;
  letter-spacing: 0;
  padding-inline: 0.5rem;
}

.bd-article .cosmiq-run a.cosmiq-run-file:hover {
  background: transparent;
  color: var(--io-primary);
  text-decoration: underline;
}

/* -- The home page: the reading page's title block, the features as cards ------------------- */

.bd-article section#cosmiq > h1 {
  font-size: 2.25rem; /* text-4xl sm:text-5xl font-bold mb-4 */
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 2.5rem;
  margin: 1rem 0 1rem;
}

@media (min-width: 640px) {
  .bd-article section#cosmiq > h1 {
    font-size: 3rem;
    line-height: 1;
  }
}

/* The pitch: text-lg text-primary font-medium mb-6 */
.bd-article section#cosmiq > p:first-of-type,
.bd-article section#cosmiq > p:first-of-type strong {
  color: var(--io-primary);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.75rem;
}

.bd-article section#cosmiq > p:first-of-type {
  margin-bottom: 1.5rem;
}

/* The lead: text-xl text-fg-secondary */
.bd-article section#cosmiq > p:nth-of-type(2) {
  color: var(--io-fg-secondary);
  font-size: 1.25rem;
  line-height: 1.75rem;
}

/* The rest of the introduction (what it's for, what it does): text-lg text-fg-secondary. */
.bd-article section#cosmiq > p:nth-of-type(n + 3) {
  color: var(--io-fg-secondary);
  font-size: 1.0625rem;
  line-height: 1.75rem;
}

/* The facts line, the paragraph just above the buttons: text-sm text-fg-muted. */
.bd-article section#cosmiq > p:has(+ .cosmiq-home-buttons) {
  color: var(--io-fg-muted);
  font-size: 0.875rem;
  line-height: 1.25rem;
  margin-top: 1.25rem;
}

.bd-article section#cosmiq > .cosmiq-home-buttons {
  margin: 2rem 0 1rem; /* mt-8 */
}

.bd-article section#cosmiq > .cosmiq-home-buttons a {
  font-size: 1rem; /* Button size md: px-6 py-3 text-base */
  padding: 0.75rem 1.5rem;
}

.bd-article section#key-features > ul {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  list-style: none;
  padding: 0;
}

.bd-article section#key-features > ul > li {
  background: var(--io-card);
  border: 1px solid var(--io-line);
  border-radius: 0.75rem; /* Card: rounded-xl border border-line bg-card shadow-sm */
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  font-size: 0.9375rem;
  margin: 0;
  padding: 1.25rem;
}

.bd-article section#key-features > ul > li strong:first-child {
  color: var(--io-fg);
  display: block;
  font-size: 1rem;
  margin-bottom: 0.375rem;
}

/* -- Odds and ends -------------------------------------------------------------------------- */

.bd-article img {
  border-radius: 0.5rem;
}

.bd-article .math,
.bd-article div.math {
  overflow-x: auto;
}

/* The refusal table is wide: it scrolls rather than squeezes. */
.cosmiq-refusals .pst-scrollable-table-container {
  overflow-x: auto;
}

.bd-article .footnote,
.bd-article aside.footnote {
  color: var(--io-fg-muted);
  font-size: 0.875rem;
}

.bd-article .versionmodified {
  color: var(--io-fg-muted);
  font-style: normal;
}

.bd-article div.versionadded,
.bd-article div.versionchanged,
.bd-article div.deprecated {
  border-left: 3px solid var(--io-line-strong);
  margin: 1rem 0;
  padding-left: 1rem;
}

.bd-article div.deprecated {
  border-left-color: var(--io-warning);
}

/* The Ctrl+K hint in the search dialog stays; elsewhere the badges stay quiet. */
.bd-article .badge {
  border-radius: 9999px;
  font-weight: 500;
}

@media print {
  .bd-footer {
    display: none;
  }
}

/* The theme's "Back to top" button: the website has none, so it is hidden. */
#pst-back-to-top { display: none !important; }


/* ── Leftover theme chrome, replaced by the website's (the founder's review, 15 Nov) ─────── */

/* Sidebar toggles: only where their sidebar is hidden. The left sidebar shows from 960px, the
   "On this page" column from 1200px; above those widths a toggle would only repeat what's shown. */
@media (min-width: 960px) {
  html body .bd-header button.sidebar-toggle.primary-toggle { display: none !important; }
}
@media (min-width: 1200px) {
  html body button.sidebar-toggle.secondary-toggle { display: none !important; }
}

/* The theme's three-state colour switcher and its GitHub icon are gone from the header; any copy
   left in other places is hidden. */
html body .theme-switch-container,
html body .navbar-icon-links { display: none !important; }

/* The website's theme toggle (Header.tsx): p-2, rounded-lg, 20px icons, secondary text colour,
   raised background on hover; a moon in light mode, a sun in dark mode. */
.io-theme-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0.5rem;
  color: var(--io-fg-secondary);
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  padding: 0.5rem;
  transition: color 0.15s, background-color 0.15s;
}
.io-theme-toggle:hover { background: var(--io-raised); color: var(--io-fg); }
.io-theme-toggle:focus-visible { outline: 2px solid var(--io-primary); outline-offset: 2px; }
html[data-theme="dark"] .io-theme-toggle .io-icon-moon,
html:not([data-theme="dark"]) .io-theme-toggle .io-icon-sun { display: none; }

/* No glow anywhere: the theme's focus and hover rings become the website's plain 2px outline. */
html body a:focus,
html body button:focus { box-shadow: none !important; }
html body a:focus-visible,
html body button:focus-visible { outline: 2px solid var(--io-primary); outline-offset: 2px; box-shadow: none !important; }


/* ── The founder's second review (15 Nov): icons, the right column, the edit button ────────── */

/* Lucide icons (ISC licence) in place of the theme's Font Awesome ones, as the website uses Lucide:
   PanelLeft for the site navigation, PanelRight for "On this page", Search, SquarePen. */
html body .bd-header button.sidebar-toggle > span,
html body .bd-header button.sidebar-toggle > i,
html body button.sidebar-toggle.secondary-toggle > span,
html body .search-button__button > i,
html body .editthispage a > i { display: none !important; }

html body button.sidebar-toggle.primary-toggle::before,
html body button.sidebar-toggle.secondary-toggle::before,
html body .search-button__button::before,
html body .editthispage a::before {
  background-color: currentColor;
  content: "";
  display: inline-block;
  flex: none;
  height: 20px;
  -webkit-mask: var(--io-icon) center / contain no-repeat;
  mask: var(--io-icon) center / contain no-repeat;
  width: 20px;
}
html body button.sidebar-toggle.primary-toggle { --io-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20width%3D%2218%22%20height%3D%2218%22%20x%3D%223%22%20y%3D%223%22%20rx%3D%222%22/%3E%3Cpath%20d%3D%22M9%203v18%22/%3E%3C/svg%3E"); }
html body button.sidebar-toggle.secondary-toggle { --io-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20width%3D%2218%22%20height%3D%2218%22%20x%3D%223%22%20y%3D%223%22%20rx%3D%222%22/%3E%3Cpath%20d%3D%22M15%203v18%22/%3E%3C/svg%3E"); }
html body .search-button__button { --io-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2211%22%20cy%3D%2211%22%20r%3D%228%22/%3E%3Cpath%20d%3D%22m21%2021-4.3-4.3%22/%3E%3C/svg%3E"); }
html body .editthispage a { --io-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%203H5a2%202%200%200%200-2%202v14a2%202%200%200%200%202%202h14a2%202%200%200%200%202-2v-7%22/%3E%3Cpath%20d%3D%22M18.375%202.625a1%201%200%200%201%203%203l-9.013%209.014a2%202%200%200%201-.853.505l-2.873.84a.5.5%200%200%201-.62-.62l.84-2.873a2%202%200%200%201%20.506-.852z%22/%3E%3C/svg%3E"); }
html body .editthispage a::before { height: 16px; width: 16px; }

/* The right column, "On this page": wider, and its links at the website's sidebar size rather than
   squeezed. */
html body { --pst-sidebar-secondary: 17rem; }
.bd-sidebar-secondary { min-width: 17rem; width: 17rem; }
.page-toc .section-nav .nav-link,
nav.page-toc .nav-link,
.bd-sidebar-secondary .toc-entry > .nav-link {
  font-size: 0.875rem;
  line-height: 1.45;
  padding: 0.3rem 0 0.3rem 0.875rem;
  white-space: normal;
}
.page-toc .section-nav ul .nav-link { padding-left: 1.75rem; }
.page-toc .section-nav { gap: 0.125rem; }

/* "Edit on GitHub" as the website's secondary button: rounded-lg, a 1px line border, px-3 py-2,
   text-sm font-medium, raised background on hover. */
html body .tocsection.editthispage { border-top: 0; margin-top: 1.5rem; padding: 0; }
html body .editthispage a {
  align-items: center;
  background: var(--io-card);
  border: 1px solid var(--io-line);
  border-radius: 0.5rem;
  color: var(--io-fg-secondary);
  display: inline-flex;
  font-size: 0.875rem;
  font-weight: 500;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}
html body .editthispage a:hover {
  background: var(--io-raised);
  border-color: var(--io-line-strong);
  color: var(--io-fg);
  text-decoration: none;
}


/* ── The founder's third review (15 Nov): the page width, the right column, Sphinx leftovers ── */

/* A wider page so the "On this page" column gets room on large screens: 88rem in all, with the
   right column at 20rem and a clear gap from the article. */
html body { --pst-sidebar-secondary: 20rem; }
@media (min-width: 1200px) {
  .bd-page-width { max-width: 88rem !important; }
  .bd-sidebar-secondary { min-width: 20rem !important; width: 20rem !important; padding-left: 2.5rem !important; }
}

/* The right column lists the page's main sections only (h2), like the website's lesson pages; the
   theme's nested, expanding sub-lists and their code-styled titles are gone. */
.page-toc .section-nav ul,
.page-toc .section-nav .section-nav { display: none !important; }
.page-toc .nav-link code,
.page-toc .nav-link .pre {
  background: none !important;
  border: 0 !important;
  color: inherit !important;
  font-family: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  padding: 0 !important;
}
/* No scrollbar track drawn beside the column. */
.bd-sidebar-secondary,
.bd-sidebar-secondary .sidebar-secondary-items { scrollbar-width: none; }
.bd-sidebar-secondary::-webkit-scrollbar,
.bd-sidebar-secondary .sidebar-secondary-items::-webkit-scrollbar { display: none; }

/* Sphinx leftovers: the breadcrumb trail and the pilcrow anchors beside headings. */
html body .bd-breadcrumbs,
html body nav[aria-label="Breadcrumb"] { display: none !important; }
html body a.headerlink { display: none !important; }


/* ── The page's actions in one row under the title (the founder's review, 15 Nov) ─────────── */
/* Built by _static/cosmiq-actions.js from the tutorials' run buttons plus "Edit on GitHub".
   The website's buttons: the red primary for Code Studio, the secondary (card, 1px line,
   rounded-lg, px-3 py-2, text-sm font-medium) for the rest; Lucide icons. */
.bd-article .io-page-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 2rem;
}
.bd-article .io-page-actions a {
  align-items: center;
  background: var(--io-card);
  border: 1px solid var(--io-line);
  border-radius: 0.5rem;
  box-shadow: none;
  color: var(--io-fg-secondary) !important;
  display: inline-flex;
  font-size: 0.875rem;
  font-weight: 500;
  gap: 0.5rem;
  line-height: 1.25rem;
  padding: 0.5rem 0.75rem;
  text-decoration: none !important;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}
.bd-article .io-page-actions a:hover {
  background: var(--io-raised);
  border-color: var(--io-line-strong);
  color: var(--io-fg) !important;
}
.bd-article .io-page-actions a.cosmiq-run-studio {
  background: var(--io-primary);
  border-color: var(--io-primary);
  color: #fff !important;
  font-weight: 600;
}
.bd-article .io-page-actions a.cosmiq-run-studio:hover {
  background: var(--io-primary-light);
  border-color: var(--io-primary-light);
  color: #fff !important;
}
.bd-article .io-page-actions a::before {
  background-color: currentColor;
  content: "";
  display: inline-block;
  flex: none;
  height: 16px;
  -webkit-mask: var(--io-icon) center / contain no-repeat;
  mask: var(--io-icon) center / contain no-repeat;
  width: 16px;
}
.bd-article .io-page-actions a.cosmiq-run-studio { --io-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m18%2016%204-4-4-4%22/%3E%3Cpath%20d%3D%22m6%208-4%204%204%204%22/%3E%3Cpath%20d%3D%22m14.5%204-5%2016%22/%3E%3C/svg%3E"); }
.bd-article .io-page-actions a.cosmiq-run-colab { --io-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolygon%20points%3D%226%203%2020%2012%206%2021%206%203%22/%3E%3C/svg%3E"); }
/* Icons by class: the Code Studio and Colab links' URLs also end in .py/.ipynb, so the file
   icons must not be chosen by href alone. Lucide: FileCode (script), NotebookText (notebook). */
.bd-article .io-page-actions a.cosmiq-run-file[href$=".py"] { --io-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M15%202H6a2%202%200%200%200-2%202v16a2%202%200%200%200%202%202h12a2%202%200%200%200%202-2V7Z%22/%3E%3Cpath%20d%3D%22M14%202v4a2%202%200%200%200%202%202h4%22/%3E%3Cpath%20d%3D%22m10%2013-2%202%202%202%22/%3E%3Cpath%20d%3D%22m14%2017%202-2-2-2%22/%3E%3C/svg%3E"); }
.bd-article .io-page-actions a.cosmiq-run-file[href$=".ipynb"] { --io-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M2%206h4%22/%3E%3Cpath%20d%3D%22M2%2010h4%22/%3E%3Cpath%20d%3D%22M2%2014h4%22/%3E%3Cpath%20d%3D%22M2%2018h4%22/%3E%3Crect%20width%3D%2216%22%20height%3D%2220%22%20x%3D%224%22%20y%3D%222%22%20rx%3D%222%22/%3E%3Cpath%20d%3D%22M9.5%208h5%22/%3E%3Cpath%20d%3D%22M9.5%2012H16%22/%3E%3Cpath%20d%3D%22M9.5%2016H14%22/%3E%3C/svg%3E"); }
.bd-article .io-page-actions a.cosmiq-run-edit { --io-icon: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%203H5a2%202%200%200%200-2%202v14a2%202%200%200%200%202%202h14a2%202%200%200%200%202-2v-7%22/%3E%3Cpath%20d%3D%22M18.375%202.625a1%201%200%200%201%203%203l-9.013%209.014a2%202%200%200%201-.853.505l-2.873.84a.5.5%200%200%201-.62-.62l.84-2.873a2%202%200%200%201%20.506-.852z%22/%3E%3C/svg%3E"); }
/* Every action is the same button: the downloads lose the older tertiary text-link look, and
   all share one border, padding, weight and tracking, so the row lines up. */
.bd-article .io-page-actions a,
.bd-article .io-page-actions a.cosmiq-run-file {
  border-color: var(--io-line);
  color: var(--io-fg-secondary) !important;
  font-weight: 500;
  letter-spacing: 0.025em;
  margin: 0;
  padding: 0.5rem 0.75rem;
}
.bd-article .io-page-actions a.cosmiq-run-file:hover,
.bd-article .io-page-actions a.cosmiq-run-edit:hover {
  background: var(--io-raised);
  border-color: var(--io-line-strong);
  color: var(--io-fg) !important;
}
.bd-article .io-page-actions a.cosmiq-run-studio {
  border-color: var(--io-primary);
  color: #fff !important;
  font-weight: 600;
}
.bd-article .io-page-actions a.cosmiq-run-studio:hover {
  border-color: var(--io-primary-light);
  color: #fff !important;
}
/* The right column no longer carries the edit link (the script moves it); hide the empty holder. */
html body .bd-sidebar-secondary .tocsection.editthispage { display: none !important; }


/* == The sweep (15 Nov): the last PyData/Sphinx pieces, replaced by the website's ============ */

/* -- Search dialog: the website's Dialog (bg-black/40 overlay; bg-card border-line rounded-xl
      shadow-xl) holding its search field (Search icon, text, a kbd hint: admin/SearchInput.tsx). */
/* The theme styles it as #pst-search-dialog[open], so these name [open] too. */
html body #pst-search-dialog,
html body #pst-search-dialog[open] {
  background: var(--io-card);
  border: 1px solid var(--io-line);
  border-radius: 0.75rem;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  margin: 12vh auto 0;
  max-width: calc(100vw - 2rem);
  overflow: hidden;
  padding: 0;
  width: 36rem;
}
html body #pst-search-dialog::backdrop,
html body #pst-search-dialog[open]::backdrop {
  opacity: 1;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: rgb(0 0 0 / 0.4);
}
html body form.bd-search {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none !important;
  display: flex;
  gap: 0.75rem;
  margin: 0;
  outline: none !important;
  padding: 0.875rem 1rem;
}
html body form.bd-search::before {
  background-color: var(--io-fg-muted);
  content: "";
  flex: none;
  height: 1rem;
  -webkit-mask: var(--io-icon-search) center / contain no-repeat;
  mask: var(--io-icon-search) center / contain no-repeat;
  width: 1rem;
}
html body form.bd-search > i,
html body form.bd-search > svg { display: none !important; }
html body form.bd-search input.form-control {
  background: transparent;
  border: 0;
  box-shadow: none !important;
  color: var(--io-fg);
  flex: 1;
  font-size: 1rem;
  line-height: 1.5rem;
  min-width: 0;
  outline: none !important;
  padding: 0;
}
html body #pst-search-dialog[open] form.bd-search input { font-size: 1rem; }
html body form.bd-search input.form-control::placeholder { color: var(--io-fg-muted); opacity: 1; }
/* Ctrl+K means nothing once the search is open: the dialog shows "Esc", the page shows none. */
html body form.bd-search .search-button__kbd-shortcut { display: none !important; }
html body #pst-search-dialog form.bd-search::after {
  border: 1px solid var(--io-line-strong);
  border-radius: 0.25rem;
  color: var(--io-fg-muted);
  content: "Esc";
  flex: none;
  font-family: var(--pst-font-family-monospace);
  font-size: 0.625rem;
  line-height: 1rem;
  padding: 0.125rem 0.375rem;
}

/* -- The search page: the field as the website's (bg-raised rounded-lg, ring-primary/25 on
      focus), then the results as a plain list with hairlines, no Sphinx headings or icons. */
html body .bd-search-container form.bd-search {
  background: var(--io-raised);
  border-radius: 0.5rem;
  margin: 1rem 0 0.5rem;
  padding: 0.625rem 0.875rem;
}
html body .bd-search-container form.bd-search:focus-within {
  box-shadow: 0 0 0 2px rgb(132 13 10 / 0.25) !important;
}
html[data-theme="dark"] body .bd-search-container form.bd-search:focus-within {
  box-shadow: 0 0 0 2px rgb(245 40 31 / 0.3) !important;
}
#search-results > h2 { display: none; }
#search-results p.search-summary {
  color: var(--io-fg-muted);
  font-size: 0.875rem;
  margin: 1.25rem 0 0.25rem;
}
#search-results ul.search {
  list-style: none;
  margin: 0;
  padding: 0;
}
#search-results ul.search li {
  background: none;
  border-top: 1px solid var(--io-line);
  margin: 0;
  padding: 1rem 0;
}
#search-results ul.search li::before { content: none; }
#search-results ul.search li > a {
  color: var(--io-fg);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}
#search-results ul.search li > a:hover { color: var(--io-primary); }
#search-results ul.search li .io-search-kind {
  color: var(--io-fg-muted);
  display: block;
  font-size: 0.8125rem;
  margin-top: 0.125rem;
}
#search-results ul.search li p.context {
  color: var(--io-fg-secondary);
  font-size: 0.875rem;
  line-height: 1.5rem;
  margin: 0.375rem 0 0;
}
/* Matched words, on the results and on the page a result opens (Sphinx's yellow otherwise). */
html body span.highlighted {
  background: var(--io-primary-soft);
  border-radius: 0.25rem;
  color: inherit;
  padding: 0 0.125rem;
}
html body .highlight-link { display: none; }

/* -- Chevrons: Lucide's, not FontAwesome's or Bootstrap's carets. */
.prev-next-area a i {
  background-color: currentColor;
  display: inline-block;
  flex: none;
  height: 1rem;
  width: 1rem;
}
.prev-next-area a i::before { content: none !important; }
.prev-next-area a i.fa-angle-left {
  -webkit-mask: var(--io-icon-left) center / contain no-repeat;
  mask: var(--io-icon-left) center / contain no-repeat;
}
.prev-next-area a i.fa-angle-right {
  -webkit-mask: var(--io-icon-right) center / contain no-repeat;
  mask: var(--io-icon-right) center / contain no-repeat;
}
nav.bd-links .toctree-toggle i {
  background-color: currentColor;
  display: inline-block;
  height: 0.875rem;
  -webkit-mask: var(--io-icon-down) center / contain no-repeat;
  mask: var(--io-icon-down) center / contain no-repeat;
  width: 0.875rem;
}
nav.bd-links .toctree-toggle i::before { content: none !important; }
/* "More": ChevronDown w-3.5, turned over while open (Header.tsx). */
.bd-header ul.navbar-nav > li.nav-item.dropdown > .dropdown-toggle::after {
  background-color: currentColor;
  border: 0 !important;
  content: "";
  display: inline-block;
  height: 0.875rem;
  margin: 0 0 0 0.25rem;
  -webkit-mask: var(--io-icon-down) center / contain no-repeat;
  mask: var(--io-icon-down) center / contain no-repeat;
  opacity: 0.8;
  transition: transform 0.15s;
  vertical-align: middle;
  width: 0.875rem;
}
.bd-header ul.navbar-nav > li.nav-item.dropdown > .dropdown-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }

/* -- "Skip to main content" (shown on keyboard focus): a website button, not the theme's bar. */
html body #pst-skip-link a {
  background: var(--io-card);
  border: 1px solid var(--io-line);
  border-radius: 0.5rem;
  box-shadow: var(--io-shadow-3);
  color: var(--io-fg);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.875rem;
}

:root {
  --io-icon-search: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2211%22%20cy%3D%2211%22%20r%3D%228%22/%3E%3Cpath%20d%3D%22m21%2021-4.3-4.3%22/%3E%3C/svg%3E");
  --io-icon-left: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m15%2018-6-6%206-6%22/%3E%3C/svg%3E");
  --io-icon-right: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m9%2018%206-6-6-6%22/%3E%3C/svg%3E");
  --io-icon-down: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m6%209%206%206%206-6%22/%3E%3C/svg%3E");
}

/* ── The founder's review (3 Dec): the sidebar buttons leave the header ─────────────────────── */
/* cosmiq-ui.js moves "Site navigation" and "On this page" out of the header into this slim bar
   at the top of the page: icon plus label, the website's secondary button text. The bar shows
   only below 1200px, where at least one sidebar is hidden; each button keeps its own width rule
   (the left sidebar shows from 960px, "On this page" from 1200px). */
.io-page-bar {
  align-items: center;
  border-bottom: 1px solid var(--io-line);
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  margin: 0 0 1rem;
  padding: 0.5rem 0;
}
html body .io-page-bar button.sidebar-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0.5rem;
  color: var(--io-fg-secondary);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.875rem;
  font-weight: 500;
  gap: 0.5rem;
  height: auto;
  margin: 0;
  padding: 0.375rem 0.5rem;
  width: auto;
}
html body .io-page-bar button.sidebar-toggle:hover { background: var(--io-raised); color: var(--io-fg); }
html body .io-page-bar button.sidebar-toggle > span:not(.io-label),
html body .io-page-bar button.sidebar-toggle > i { display: none !important; }
html body .io-page-bar button.sidebar-toggle > span.io-label { display: inline !important; }
html body .io-page-bar button.sidebar-toggle::before {
  border: 0;
  height: 18px;
  margin: 0;
  position: static;
  width: 18px;
}
html body .io-page-bar button.secondary-toggle { margin-left: auto; }
@media (min-width: 960px) {
  html body .io-page-bar button.sidebar-toggle.primary-toggle { display: none !important; }
}
@media (min-width: 1200px) {
  html body .io-page-bar { display: none; }
}

/* The "On this page" drawer (below 1200px) matches the "Contents" drawer (the founder's review,
   3 Dec): the same canvas and padding, its links at the left nav's size, colour, padding and
   hover, no rail and no indent, and its title as the nav's small caption. The desktop column,
   from 1200px, keeps its own style. */
@media (max-width: 1199.98px) {
  html body #pst-secondary-sidebar-modal {
    background: var(--io-canvas);
    padding: 1.25rem;
  }
  html body #pst-secondary-sidebar-modal .bd-sidebar-secondary {
    background: transparent;
    border: 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
    width: auto !important;
  }
  html body #pst-secondary-sidebar-modal .tocsection.onthispage {
    border: 0;
    color: var(--io-fg-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    margin: 0 0 0.375rem;
    padding: 0 0.5rem;
    text-transform: uppercase;
  }
  html body #pst-secondary-sidebar-modal .section-nav,
  html body #pst-secondary-sidebar-modal .section-nav ul,
  html body #pst-secondary-sidebar-modal .toc-entry {
    border: 0 !important;
    list-style: none;
    margin: 0 !important;
    padding: 0 !important;
  }
  html body #pst-secondary-sidebar-modal .toc-entry > .nav-link {
    border: 0 !important;
    border-radius: 0.375rem;
    box-shadow: none !important;
    color: var(--io-fg-secondary);
    display: block;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.25rem;
    margin: 0 !important;
    padding: 0.375rem 0.5rem !important;
    text-decoration: none;
  }
  html body #pst-secondary-sidebar-modal .toc-entry > .nav-link:hover {
    background: var(--io-raised);
    color: var(--io-fg);
  }
  html body #pst-secondary-sidebar-modal .toc-entry > .nav-link.active {
    background: transparent;
    color: var(--io-primary);
    font-weight: 500;
  }
}

/* Inline maths never scrolls (the founder's review, 3 Dec): the theme gives every span.math
   `overflow-x: auto`, and a formula 1px wider than its box ($\chi = 32$ in "Key features") showed
   a scrollbar in the middle of a sentence. Display equations (div.math) keep their scrolling. */
.bd-article span.math {
  overflow: visible !important;
}
