/*
 * Base styles copied from the uv documentation:
 * https://github.com/astral-sh/uv/blob/e006a69fe838/docs/stylesheets/extra.css
 * Copyright Astral Software Inc., licensed under the Apache License 2.0
 * (https://www.apache.org/licenses/LICENSE-2.0). Additions for this site are
 * at the end of the file, below the "Additions" marker.
 */
:root {
  --black: #261230;
  --white: #ffffff;
  --radiate: #d7ff64;
  --flare: #6340ac;
  --rock: #78876e;
  --galaxy: #261230;
  --space: #30173d;
  --comet: #6f5d6f;
  --cosmic: #de5fe9;
  --sun: #ffac2f;
  --electron: #46ebe1;
  --aurora: #46eb74;
  --constellation: #5f6de9;
  --neutron: #cff3cf;
  --proton: #f6afbc;
  --nebula: #cdcbfb;
  --supernova: #f1aff6;
  --starlight: #f4f4f1;
  --lunar: #fbf2fc;
  --asteroid: #e3cee3;
  --crater: #f0dfdf;
}

[data-md-color-scheme="astral-light"] {
  --md-default-bg-color--dark: var(--black);
  --md-default-fg-color--lightest: rgba(0, 0, 0, 0.14);
  --md-primary-fg-color: var(--galaxy);
  --md-typeset-a-color: var(--flare);
  --md-accent-fg-color: var(--cosmic);
}

[data-md-color-scheme="astral-dark"] {
  --md-default-bg-color: var(--galaxy);
  --md-default-fg-color: var(--white);
  --md-default-fg-color--light: var(--white);
  --md-default-fg-color--lighter: var(--white);
  --md-default-fg-color--lightest: rgba(255, 255, 255, 0.5);
  --md-primary-fg-color: var(--space);
  --md-primary-bg-color: var(--white);
  --md-accent-fg-color: var(--cosmic);

  --md-typeset-color: var(--white);
  --md-typeset-a-color: var(--radiate);
  --md-typeset-mark-color: var(--sun);

  --md-code-fg-color: var(--white);
  --md-code-bg-color: var(--space);

  --md-code-hl-comment-color: var(--asteroid);
  --md-code-hl-punctuation-color: var(--asteroid);
  --md-code-hl-generic-color: var(--supernova);
  --md-code-hl-variable-color: var(--starlight);
  --md-code-hl-string-color: var(--radiate);
  --md-code-hl-keyword-color: var(--supernova);
  --md-code-hl-operator-color: var(--supernova);
  --md-code-hl-number-color: var(--electron);
  --md-code-hl-special-color: var(--electron);
  --md-code-hl-function-color: var(--neutron);
  --md-code-hl-constant-color: var(--radiate);
  --md-code-hl-name-color: var(--md-code-fg-color);

  --md-typeset-del-color: hsla(6, 90%, 60%, 0.15);
  --md-typeset-ins-color: hsla(150, 90%, 44%, 0.15);

  --md-typeset-table-color: hsla(0, 0%, 100%, 0.12);
  --md-typeset-table-color--light: hsla(0, 0%, 100%, 0.035);
}

[data-md-color-scheme="astral-light"] img[src$="#only-dark"],
[data-md-color-scheme="astral-light"] img[src$="#gh-dark-mode-only"] {
  display: none; /* Hide dark images in light mode */
}

[data-md-color-scheme="astral-light"] img[src$="#only-light"],
[data-md-color-scheme="astral-light"] img[src$="#gh-light-mode-only"] {
  display: inline; /* Show light images in light mode */
}

[data-md-color-scheme="astral-dark"] img[src$="#only-light"],
[data-md-color-scheme="astral-dark"] img[src$="#gh-light-mode-only"] {
  display: none; /* Hide light images in dark mode */
}

[data-md-color-scheme="astral-dark"] img[src$="#only-dark"],
[data-md-color-scheme="astral-dark"] img[src$="#gh-dark-mode-only"] {
  display: inline; /* Show dark images in dark mode */
}

/* See: https://github.com/squidfunk/mkdocs-material/issues/175#issuecomment-616694465 */
.md-typeset__table {
  min-width: 100%;
}
.md-typeset table:not([class]) {
  display: table;
}

/* See: https://github.com/astral-sh/ruff/issues/8519 */
[data-md-color-scheme="astral-dark"] details summary a {
  color: var(--flare);
}

/* See: https://github.com/astral-sh/ruff/issues/9046 */
[data-md-color-scheme="astral-dark"] div.admonition {
  color: var(--md-code-fg-color);
  background-color: var(--md-code-bg-color);
}

/* Prevent the shadow from the nav title from blurring the top link.
The box shadow isn't really doing anything anyway.

This is a consequence of the reduced nav spacing below. */
.md-nav--primary .md-nav__title {
  box-shadow: none;
}

/* Omits the nav title "uv" entirely unless on a small screen, in which case
the nav title is needed for backwards navigation in the collapsible
nav variant.

See https://github.com/astral-sh/uv/issues/5130 */
@media screen and (min-width: 76.25em) {
  .md-nav__title {
    display: none;
  }
}

/* Always take the full screen for content, require scrolling to see the footer
This stops the size of the nav from jumping around when you visit a page without
a lot of content (i.e., an overview page). We don't apply this to sma screens
because the nav is in a hamburger menu anyway
*/
@media screen and (min-width: 76.25em) {
  .md-main {
    min-height: 100vh;
  }
}

/* Tweak the formatting of the primary nav on a large screen */
@media screen and (min-width: 76.25em) {
  .md-nav--primary .md-nav {
    font-size: 0.75rem;
  }
  /* Remove the bold from the section headings, use a larger font instead */
  .md-nav__item--section > .md-nav__link {
    font-weight: normal;
    font-size: 0.85rem;
  }
  /* Reducing spacing between nav items to fit more content
  First, disable `nav__link` spacing then use `nav__item` to enforce margins this reduces inconsistencies in the spacing. */
  .md-nav--primary .md-nav__link {
    margin: 0;
  }
  .md-nav--primary .md-nav__item {
    margin-top: 0.35em;
  }
  /* Use larger spacing for the sections headings */
  .md-nav--primary .md-nav__item--section {
    margin-bottom: 0.75em;
    margin-top: 1em;
  }
  /* Decrease the font size of items in a collapsible section */
  .md-nav__item--section
    > .md-nav
    > .md-nav__list
    > .md-nav__item
    > .md-nav
    > .md-nav__list {
    font-size: 0.725rem;
  }
  /* Increase top margin on the first item of a collapsible section */
  .md-nav__item--section
    > .md-nav
    > .md-nav__list
    > .md-nav__item
    > .md-nav
    > .md-nav__list
    > .md-nav__item:first-of-type {
    margin-top: 0.5em;
  }
  /* Increase bottom margin on the last item of a collapsible section */
  .md-nav__item--section
    > .md-nav
    > .md-nav__list
    > .md-nav__item
    > .md-nav
    > .md-nav__list
    > .md-nav__item:last-of-type {
    margin-bottom: 0.575em;
  }
  /* Increase the size of the first nav item to match the sections
  It has no children, so it is not considered a section */
  .md-nav--primary > .md-nav__list > .md-nav__item:first-of-type {
    font-size: 0.85rem;
    margin-bottom: 0.75em;
  }
}

/* Bold the active nav link for accessibility */
.md-nav__link--active {
  font-weight: bold;
}

/* See: https://mkdocstrings.github.io/recipes/#prevent-selection-of-prompts-and-output-in-python-code-blocks */
.highlight .gp,
.highlight .go {
  /* Generic.Prompt, Generic.Output */
  user-select: none;
}

/* Styling for the generated CLI reference page */
.cli-reference dd {
  margin-top: 0.1em;
  margin-bottom: 0.5em;
}
.cli-reference dd p {
  margin-block-start: 0.2em;
  margin-block-end: 0.3em;
}
.cli-reference ul {
  margin-bottom: 0.1em;
}
h3.cli-reference {
  font-size: 1.1em;
  margin: 0 0 0 0;
}
h3:has(+ p > small.added-in) {
  display: inline-block;
  margin: 0;
}
h3 + p:has(> small.added-in) {
  display: inline;
  margin: 0;
}

/* Styling for anchor link headers */
.toclink {
  color: unset !important;
}

.toclink:hover {
  color: var(--md-accent-fg-color) !important;
}

/* Omit the first breadcrumb item, which is the "Introduction" */
.md-path__list > .md-path__item:first-of-type {
  display: none;
}
.md-path__list > .md-path__item:nth-of-type(2):before {
  display: none;
}

/* Hide the modified date — its positioning is awkward but will require theme
modifications */
.md-source-file__fact {
  visibility: hidden;
}

/* ------------------------------------------------------------------ */
/* Additions for this site                                             */
/* ------------------------------------------------------------------ */

/* Collapsible admonitions get the same dark treatment uv gives div.admonition */
[data-md-color-scheme="astral-dark"] .md-typeset details {
  color: var(--md-code-fg-color);
  background-color: var(--md-code-bg-color);
}

/* Keyboard keys: uv's dark palette leaves Material's light key colours, so white text sat on a white key */
[data-md-color-scheme="astral-dark"] {
  --md-typeset-kbd-color: #4a2b5a;
  --md-typeset-kbd-accent-color: #5c3a6e;
  --md-typeset-kbd-border-color: #160a1d;
}

/* Numbered click markers that match the red boxes on screenshots */
.md-typeset .mk {
  display: inline-grid;
  place-items: center;
  width: 1.35em;
  height: 1.35em;
  border-radius: 50%;
  background: #dc2626;
  color: #fff;
  font-size: 0.78em;
  font-weight: 700;
  line-height: 1;
  vertical-align: 0.08em;
}

/* GUI / CLI and topic badges */
.md-typeset .tag {
  font-family: var(--md-code-font-family);
  font-size: 0.68em;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.1em 0.5em;
  border-radius: 0.3em;
  vertical-align: 0.12em;
  white-space: nowrap;
  background: var(--md-code-bg-color);
  color: var(--md-default-fg-color--light);
}
.md-typeset .tag.gui {
  background: #e0f3e6;
  color: #1b6a38;
}
[data-md-color-scheme="astral-dark"] .md-typeset .tag.gui {
  background: #14291c;
  color: var(--aurora);
}

/* Result pills in tables */
.md-typeset .pill {
  font-size: 0.75em;
  font-weight: 600;
  padding: 0.1em 0.6em;
  border-radius: 999px;
  white-space: nowrap;
}
.md-typeset .pill.ok { background: #e0f3e6; color: #1b6a38; }
.md-typeset .pill.warn { background: #fff3d4; color: #7a4f00; }
.md-typeset .pill.bad { background: #fde9e7; color: #9b2a24; }
[data-md-color-scheme="astral-dark"] .md-typeset .pill.ok { background: #14291c; color: var(--aurora); }
[data-md-color-scheme="astral-dark"] .md-typeset .pill.warn { background: #2c2410; color: var(--sun); }
[data-md-color-scheme="astral-dark"] .md-typeset .pill.bad { background: #331a18; color: var(--proton); }

/* Screenshots */
.md-typeset figure img {
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.4em;
}
.md-typeset figcaption {
  max-width: 100%;
  color: var(--md-default-fg-color--light);
}

/* Diagrams carried over from the HTML guides */
.md-typeset .diagram {
  overflow-x: auto;
}
.md-typeset .diagram svg {
  max-width: 100%;
  height: auto;
  color: var(--md-accent-fg-color);
}
.md-typeset .diagram svg text { font-family: var(--md-text-font-family); }
.md-typeset .diagram .dt { fill: var(--md-default-fg-color); font-size: 14px; font-weight: 650; }
.md-typeset .diagram .ds { fill: var(--md-default-fg-color--light); font-size: 12px; }
.md-typeset .diagram .box { fill: var(--md-default-bg-color); stroke: var(--md-default-fg-color--lighter); stroke-width: 1.5; }
.md-typeset .diagram .boxA { fill: var(--md-code-bg-color); stroke: var(--constellation); stroke-width: 1.5; }
.md-typeset .diagram .boxB { fill: var(--md-code-bg-color); stroke: var(--flare); stroke-width: 1.5; }
.md-typeset .diagram .boxC { fill: var(--md-code-bg-color); stroke: var(--sun); stroke-width: 1.5; }
.md-typeset .diagram .ln { stroke: var(--md-default-fg-color--light); stroke-width: 1.6; fill: none; }
.md-typeset .diagram .lnA { stroke: var(--md-accent-fg-color); stroke-width: 2; fill: none; }

/* External links: arrow icon after the text. extra.js sets data-external-link.
   Adapted from the FastAPI documentation (https://github.com/fastapi/fastapi, MIT). */
.md-typeset a[data-external-link]:not(:has(img))::after {
  content: "";
  display: inline-block;
  width: 0.75em;
  height: 0.75em;
  margin-left: 0.25em;
  vertical-align: middle;
  opacity: 0.55;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E") no-repeat center / contain;
}
.md-typeset a[data-external-link]:hover::after {
  opacity: 0.85;
}

/* Announcement bar link, from the FastAPI documentation */
.md-banner a.announce-link,
.md-banner a.announce-link:visited {
  color: var(--md-primary-bg-color);
}
.md-banner a.announce-link:hover {
  color: var(--md-accent-fg-color);
}

/* Guide cards on the topic pages */
.md-typeset .grid.cards.guide-cards > ul > li {
  border-top: 3px solid var(--md-accent-fg-color);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.md-typeset .grid.cards.guide-cards > ul > li:hover {
  transform: translateY(-2px);
}
.md-typeset .grid.cards.guide-cards .lg {
  color: var(--md-accent-fg-color);
}
.md-typeset .grid.cards.guide-cards p:has(.tag) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35em;
}
.md-typeset .grid.cards.guide-cards a.card-main {
  display: inline-block;
  font-weight: 700;
  margin-right: 0.6em;
  margin-bottom: 0.3em;
}
.md-typeset .grid.cards.guide-cards p:has(a.card-main) {
  font-size: 0.75rem;
  color: var(--md-default-fg-color--light);
}
.md-typeset .grid.cards.guide-cards p:has(a.card-main) a.card-main {
  font-size: 0.8rem;
}

/* Lead paragraph under a page title */
.md-typeset .lead {
  font-size: 1.05em;
  color: var(--md-default-fg-color--light);
}

