/* The documentation theme. Tokens and rules are described in DESIGN.md. */
:root {
  --sm-bg: #ffffff;
  --sm-surface: #f5f5f5;
  --sm-ink: #0a0a0a;
  --sm-muted: #5c5c5c;
  --sm-line: #e2e2e2;
  --sm-mid: #d4d4d4;
  --sm-accent: #d92b21;
  --sm-accent-text: #b4231b;
  --sm-accent-bg: #fdeceb;
}
[data-md-color-scheme="slate"] {
  --sm-bg: #101011;
  --sm-surface: #19191b;
  --sm-ink: #f2f2f2;
  --sm-muted: #a8a8a8;
  --sm-line: #2c2c2f;
  --sm-mid: #4a4a4e;
  --sm-accent: #ff5a4f;
  --sm-accent-text: #ff7a71;
  --sm-accent-bg: #3a1714;
}

[data-md-color-scheme="default"],
[data-md-color-scheme="slate"] {
  --md-default-bg-color: var(--sm-bg);
  --md-default-fg-color: var(--sm-ink);
  --md-default-fg-color--light: var(--sm-muted);
  --md-default-fg-color--lighter: var(--sm-mid);
  --md-default-fg-color--lightest: var(--sm-line);
  --md-primary-fg-color: var(--sm-ink);
  --md-primary-bg-color: var(--sm-bg);
  --md-accent-fg-color: var(--sm-accent-text);
  --md-accent-fg-color--transparent: var(--sm-accent-bg);
  --md-typeset-color: var(--sm-ink);
  --md-typeset-a-color: var(--sm-ink);
  --md-code-bg-color: var(--sm-surface);
  --md-code-fg-color: var(--sm-ink);
  /* code colours from the same palette; the theme's defaults include violet */
  --md-code-hl-keyword-color: var(--sm-accent-text);
  --md-code-hl-function-color: var(--sm-ink);
  --md-code-hl-name-color: var(--sm-ink);
  --md-code-hl-constant-color: var(--sm-ink);
  --md-code-hl-special-color: var(--sm-accent-text);
  --md-code-hl-number-color: var(--sm-accent-text);
  --md-code-hl-string-color: var(--sm-muted);
  --md-code-hl-comment-color: var(--sm-muted);
  --md-footer-bg-color: #0a0a0a;
  --md-footer-bg-color--dark: #000000;
}

.md-grid { max-width: 1320px; }

/* ---- header and tabs: one quiet white bar with a hairline ------------- */
.md-header,
.md-tabs { background: var(--sm-bg); color: var(--sm-ink); }
.md-header,
.md-header--shadow { box-shadow: none; }
.md-tabs { border-bottom: 1px solid var(--sm-line); }
.md-header__button.md-logo img,
.md-header__button.md-logo svg { width: 22px; height: 22px; }
.md-header__title { font-weight: 500; letter-spacing: -0.01em; }
.md-tabs__link { opacity: 1; color: var(--sm-muted); margin-top: 0.7rem; padding-bottom: 0.55rem; border-bottom: 2px solid transparent; font-size: 0.72rem; font-weight: 500; }
.md-tabs__link:hover { color: var(--sm-ink); }
.md-tabs__item--active .md-tabs__link { color: var(--sm-ink); border-bottom-color: var(--sm-accent); }
.md-search__form { background: var(--sm-surface); border-radius: 4px; }
.md-search__form:hover { background: var(--sm-surface); }
.md-search__input::placeholder,
.md-search__input ~ .md-search__icon,
.md-search__input + .md-search__icon { color: var(--sm-muted); }

/* ---- navigation ------------------------------------------------------- */
.md-nav { font-size: 0.7rem; line-height: 1.5; }
.md-nav__title { box-shadow: none !important; }
.md-nav__link--active,
.md-nav__item .md-nav__link--active { color: var(--sm-ink); font-weight: 600; }
.md-sidebar--primary .md-nav__link--active { box-shadow: inset 2px 0 0 var(--sm-accent); padding-left: 0.5rem; }

/* ---- type ------------------------------------------------------------- */
.md-typeset { font-size: 0.8rem; line-height: 1.7; }
.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 { color: var(--sm-ink); font-weight: 500; }
.md-typeset h1 { margin: 0 0 1.2rem; font-size: 2rem; line-height: 1.12; letter-spacing: -0.035em; }
.md-typeset h2 { margin: 2.6rem 0 0.9rem; padding-top: 1.6rem; border-top: 1px solid var(--sm-line); font-size: 1.35rem; line-height: 1.25; letter-spacing: -0.025em; }
.md-typeset h3 { margin: 1.8rem 0 0.6rem; font-size: 1rem; letter-spacing: -0.01em; }
.md-typeset a { text-decoration: underline; text-decoration-color: var(--sm-mid); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: text-decoration-color 140ms; }
.md-typeset a:hover { color: var(--sm-ink); text-decoration-color: var(--sm-accent); }
.md-typeset a.headerlink { text-decoration: none; }
.md-typeset code { border-radius: 3px; font-size: 0.86em; }
.md-typeset pre > code { border-radius: 6px; border: 1px solid var(--sm-line); }

/* ---- tables: hairlines only ------------------------------------------- */
.md-typeset table:not([class]) { border: 0; border-radius: 0; box-shadow: none; font-size: 0.72rem; font-variant-numeric: tabular-nums; }
.md-typeset table:not([class]) th { background: none; border-bottom: 1px solid var(--sm-ink); font-weight: 500; min-width: 4rem; padding: 0.55rem 0.8rem; }
.md-typeset table:not([class]) td { border-top: 0; border-bottom: 1px solid var(--sm-line); padding: 0.6rem 0.8rem; }
.md-typeset table:not([class]) tr > :first-child { padding-left: 0; }
.md-typeset table:not([class]) tbody tr:hover { background: var(--sm-surface); box-shadow: none; }

/* ---- maths ------------------------------------------------------------ */
.md-typeset div.arithmatex { margin: 1.1rem 0; padding: 0.35rem 1rem; border-left: 2px solid var(--sm-ink); background: var(--sm-surface); border-radius: 0 6px 6px 0; overflow-x: auto; overflow-y: hidden; }
.md-typeset .katex { font-size: 1.08em; }
.md-typeset div.arithmatex .katex-display { margin: 0.7em 0; text-align: left; }
.md-typeset div.arithmatex .katex-display > .katex { text-align: left; }
.md-typeset .katex .penalised,
.md-typeset .katex-error { color: var(--sm-accent-text); }

/* ---- language tabs: a logo beside each name --------------------------- */
.md-typeset .tabbed-set > .tabbed-labels > label { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.8rem; font-weight: 500; }
.md-typeset .tabbed-labels a { text-decoration: none; }
.md-typeset .tabbed-labels .twemoji { width: 1.4em; height: 1.4em; vertical-align: middle; }
.md-typeset .tabbed-labels .twemoji svg { width: 100%; height: 100%; max-height: none; }
.md-typeset .tabbed-content h2:first-child { margin-top: 1.2rem; padding-top: 0; border-top: 0; }

/* ---- admonitions ------------------------------------------------------ */
.md-typeset .admonition,
.md-typeset details { border-width: 1px; border-color: var(--sm-line); border-radius: 6px; box-shadow: none; font-size: 0.74rem; }
.md-typeset .admonition:focus-within,
.md-typeset details:focus-within { box-shadow: none; }
/* "deviation": where the code does something other than the specification says. */
.md-typeset .admonition.deviation { border-color: var(--sm-accent); }
.md-typeset .deviation > .admonition-title { background-color: var(--sm-accent-bg); }
.md-typeset .deviation > .admonition-title::before {
  background-color: var(--sm-accent);
  -webkit-mask-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 14h-2V9h2m0 9h-2v-2h2M1 21h22L12 2z"/></svg>');
          mask-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 14h-2V9h2m0 9h-2v-2h2M1 21h22L12 2z"/></svg>');
}

/* ---- figures on the docs ground --------------------------------------- */
.md-typeset .pen {
  --pen-bg: var(--sm-bg);
  --pen-ink: var(--sm-ink);
  --pen-muted: var(--sm-muted);
  --pen-line: var(--sm-line);
  --pen-soft: var(--sm-surface);
  --pen-mid: var(--sm-mid);
  --pen-cost: var(--sm-accent);
  --pen-cost-bg: var(--sm-accent-bg);
  --pen-cost-text: var(--sm-accent-text);
  font-size: 0.7rem;
}
.md-typeset .pen table { margin: 0; }

/* In formulas, as in figures, red marks what lowers the score. */
.md-typeset .katex .cost { color: var(--sm-accent-text); }

/* The numbers behind a figure, for readers and crawlers that do not run scripts. */
.md-typeset details.pen-data { margin-top: -1.2rem; }
.md-typeset .pen-data table:not([class]) { display: table; width: 100%; margin: 0.4rem 0 1rem; }
.md-typeset .pen table.pen-static { font-size: 0.7rem; }

/* ---- footer ----------------------------------------------------------- */
.md-footer { margin-top: 3rem; }

@media screen and (max-width: 76.1875em) {
  .md-nav--primary .md-nav__title[for="__drawer"] { background: var(--sm-bg); color: var(--sm-ink); }
  .md-nav__source { background: var(--sm-surface); color: var(--sm-ink); }
}
