/* Color scheme toggle for the MkDocs readthedocs theme.
   The toggle button is injected by js/color-scheme.js. Default follows the
   OS setting ( System ); the chosen mode is remembered per browser. */

/* Layout: use the full screen width. The theme caps the content column at
   ~800px, which wastes the right half of a wide monitor. Applies to both
   light and dark modes. */
.wy-nav-content {
  max-width: none;
}

#theme-toggle {
  display: block;
  margin: 10px auto 4px;
  padding: 4px 14px;
  font: inherit;
  cursor: pointer;
  border: 1px solid #c8ccd2;
  border-radius: 4px;
  background: #f5f6f7;
  color: #404040;
}

/* ---- Dark palette ---- */
html[data-theme="dark"] { color-scheme: dark; }

html[data-theme="dark"] body,
html[data-theme="dark"] .wy-body-for-nav {
  background: #161a1d;
  color: #c9d1d9;
}

html[data-theme="dark"] .wy-nav-side {
  background: #101418;
}
html[data-theme="dark"] .wy-side-nav-search {
  background: #1a2027;
}
html[data-theme="dark"] .wy-side-nav-search input[type="text"] {
  background: #0b0e11;
  color: #d4d7dc;
  border-color: #2a2f36;
}
html[data-theme="dark"] .wy-side-nav-search a,
html[data-theme="dark"] .wy-side-nav-search > a,
html[data-theme="dark"] .wy-side-nav-search .wy-dropdown > a {
  color: #b9c2cc;
}

html[data-theme="dark"] .wy-menu-vertical a {
  color: #b9c2cc;
}
html[data-theme="dark"] .wy-menu-vertical a:hover {
  background: #1b2127;
  color: #e8eef5;
}
/* The theme highlights the CURRENT page with a light box at every
   toctree level ( .current > a, .toctree-l2/l3/l4.current > a, .on a ).
   Those per-level selectors out-specify a plain ".current a" rule and
   left a white box inside the dark sidebar ( found 2026-12-02 ). Match
   every level explicitly and force the colors. */
html[data-theme="dark"] .wy-menu-vertical li.current a,
html[data-theme="dark"] .wy-menu-vertical li.current > a,
html[data-theme="dark"] .wy-menu-vertical li.on a,
html[data-theme="dark"] .wy-menu-vertical li.toctree-l2.current > a,
html[data-theme="dark"] .wy-menu-vertical li.toctree-l2.on > a,
html[data-theme="dark"] .wy-menu-vertical li.toctree-l3.current > a,
html[data-theme="dark"] .wy-menu-vertical li.toctree-l3.on > a,
html[data-theme="dark"] .wy-menu-vertical li.toctree-l4.current > a,
html[data-theme="dark"] .wy-menu-vertical li.toctree-l4.on > a,
html[data-theme="dark"] .wy-menu-vertical li.current a:hover {
  background: #1c2530 !important;
  border-color: #40526b !important;
  color: #e8eef5 !important;
}
html[data-theme="dark"] .wy-menu-vertical span {
  color: #8892a0;
}

html[data-theme="dark"] .wy-nav-content-wrap,
html[data-theme="dark"] .wy-nav-content {
  background: #1e2022;
  color: #c9d1d9;
}

html[data-theme="dark"] .rst-content h1,
html[data-theme="dark"] .rst-content h2,
html[data-theme="dark"] .rst-content h3,
html[data-theme="dark"] .rst-content h4,
html[data-theme="dark"] .rst-content h5,
html[data-theme="dark"] .rst-content h6 {
  color: #e6e9ed;
  border-color: #31363d;
}
html[data-theme="dark"] .rst-content a { color: #7fb0dd; }
html[data-theme="dark"] .rst-content a:visited { color: #a58fd0; }
html[data-theme="dark"] .rst-content .headerlink { color: #6a737d; }

html[data-theme="dark"] .rst-content code,
html[data-theme="dark"] .rst-content tt {
  background: #22262b;
  color: #e6e6e6;
  border-color: #3a3f46;
}
/* Code blocks: the readthedocs theme loads highlight.js from a CDN with the
   light `github` palette, which paints the inner code.hljs element white
   and colors tokens for a light background. That stylesheet loads before
   this one; the container colors are forced below. */
/* Code blocks: force the container colors. The theme and the CDN
   highlight.js palette both paint code containers with explicit light
   backgrounds at selector levels that vary per MkDocs/pymdownx version;
   on 2026-12-02 the boxes still rendered white in dark mode despite the
   plain overrides. Cover every wrapper variant and use !important.
   Token colors come from the per-class rules below and are untouched. */
html[data-theme="dark"] .rst-content .highlight,
html[data-theme="dark"] .rst-content .codehilite,
html[data-theme="dark"] .rst-content .highlight pre,
html[data-theme="dark"] .rst-content .codehilite pre,
html[data-theme="dark"] .rst-content pre,
html[data-theme="dark"] .rst-content pre code,
html[data-theme="dark"] .rst-content code.hljs,
html[data-theme="dark"] .rst-content .hljs {
  background: #14181c !important;
  color: #d4d7dc !important;
}
html[data-theme="dark"] .rst-content pre {
  border: 1px solid #2a2f36 !important;
}
/* Dark token palette ( github-dark inspired ), light mode keeps the
   theme's CDN palette untouched. */
html[data-theme="dark"] .hljs-comment,
html[data-theme="dark"] .hljs-quote {
  color: #8b949e;
  font-style: italic;
}
html[data-theme="dark"] .hljs-keyword,
html[data-theme="dark"] .hljs-selector-tag,
html[data-theme="dark"] .hljs-subst,
html[data-theme="dark"] .hljs-doctag {
  color: #ff7b72;
}
html[data-theme="dark"] .hljs-string,
html[data-theme="dark"] .hljs-regexp,
html[data-theme="dark"] .hljs-addition {
  color: #a5d6ff;
}
html[data-theme="dark"] .hljs-number,
html[data-theme="dark"] .hljs-literal,
html[data-theme="dark"] .hljs-variable,
html[data-theme="dark"] .hljs-template-variable,
html[data-theme="dark"] .hljs-type,
html[data-theme="dark"] .hljs-built_in,
html[data-theme="dark"] .hljs-attr,
html[data-theme="dark"] .hljs-attribute,
html[data-theme="dark"] .hljs-meta {
  color: #79c0ff;
}
html[data-theme="dark"] .hljs-title,
html[data-theme="dark"] .hljs-title.function_,
html[data-theme="dark"] .hljs-title.class_ {
  color: #d2a8ff;
}
html[data-theme="dark"] .hljs-name,
html[data-theme="dark"] .hljs-tag,
html[data-theme="dark"] .hljs-selector-id,
html[data-theme="dark"] .hljs-selector-class {
  color: #7ee787;
}
html[data-theme="dark"] .hljs-section,
html[data-theme="dark"] .hljs-symbol,
html[data-theme="dark"] .hljs-bullet,
html[data-theme="dark"] .hljs-link {
  color: #ffa657;
}
html[data-theme="dark"] .hljs-deletion {
  color: #ffdcd7;
}
html[data-theme="dark"] .hljs-emphasis { font-style: italic; }
html[data-theme="dark"] .hljs-strong { font-weight: bold; }

html[data-theme="dark"] .rst-content table.docutils,
html[data-theme="dark"] .rst-content table.field-list,
html[data-theme="dark"] .wy-table {
  border-color: #2f343a;
}
/* Cell and stripe backgrounds: the theme paints these explicitly with light
   colors and higher specificity, so they must be overridden one by one,
   otherwise tables stay light boxes inside the dark page. */
html[data-theme="dark"] .rst-content table.docutils td,
html[data-theme="dark"] .rst-content table.docutils th,
html[data-theme="dark"] .wy-table td,
html[data-theme="dark"] .wy-table th {
  background: transparent;
  border-color: #2f343a;
  color: #c9d1d9;
}
html[data-theme="dark"] .rst-content table.docutils th,
html[data-theme="dark"] .wy-table th {
  background: #22262b;
  color: #e6e9ed;
}
html[data-theme="dark"] .rst-content table.docutils tbody tr:nth-child(2n-1) td,
html[data-theme="dark"] .rst-content table.docutils tbody tr:nth-child(2n-1) th,
html[data-theme="dark"] .wy-table-striped tr:nth-child(2n-1) td,
html[data-theme="dark"] .wy-table-striped tr:nth-child(2n-1) th {
  background: #23272c;
}
html[data-theme="dark"] .rst-content table.docutils tr:hover td,
html[data-theme="dark"] .wy-table-striped tr:hover td {
  background: #2a2f36;
}

html[data-theme="dark"] .rst-content .admonition,
html[data-theme="dark"] .rst-content .admonition-title {
  background: #1c2127;
  color: #c9d1d9;
}
html[data-theme="dark"] .rst-content .admonition.note,
html[data-theme="dark"] .rst-content .wy-alert.wy-alert-info,
html[data-theme="dark"] .rst-content .admonition-title {
  background: #10222f;
  color: #b8d3e8;
}
html[data-theme="dark"] .rst-content .admonition.warning,
html[data-theme="dark"] .rst-content .wy-alert.wy-alert-warning {
  background: #2a2115;
  color: #e6c98a;
}

html[data-theme="dark"] .rst-content blockquote {
  border-left-color: #3a3f46;
  color: #9aa4b0;
}
html[data-theme="dark"] .rst-content hr,
html[data-theme="dark"] hr {
  border-color: #2f343a;
}
html[data-theme="dark"] footer,
html[data-theme="dark"] .rst-content .footer { color: #8892a0; }
html[data-theme="dark"] .btn {
  background: #22262b;
  color: #c9d1d9;
  border-color: #3a3f46;
}
html[data-theme="dark"] .btn-neutral:hover {
  background: #2a2f36;
  color: #e6e9ed;
}

html[data-theme="dark"] .rst-versions {
  background: #101418;
  color: #8892a0;
}
html[data-theme="dark"] .rst-versions .rst-current-version { color: #b9c2cc; }

html[data-theme="dark"] #theme-toggle {
  background: #22262b;
  color: #c9d1d9;
  border-color: #3a3f46;
}
