/*
 * CroStream on Zensical (modern variant), dark only. Sections:
 *   1. Brand colors and fonts   2. Banner and header   3. Section bar
 *   4. Sidebars                 5. Content             6. Footer
 *   7. Website pages            8. 404
 * The landing page has its own stylesheet (landing.css).
 */

/* 1. Brand colors and fonts -------------------------------------------------
 * Midnight violet surfaces; a gradient from live pink through Twitch purple
 * to the app's signal blue (#3D7EFF). Inter and JetBrains Mono are the
 * files the app ships, self-hosted.
 */
@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("../assets/fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("../assets/fonts/JetBrainsMono-Medium.woff2") format("woff2");
  font-weight: 500 700;
  font-display: swap;
}

:root {
  --md-text-font: "Inter";
  --md-code-font: "JetBrains Mono";

  --cs-navy: #070B17;
  --cs-navy-2: #0A1022;
  --cs-surface: #111A33;
  --cs-tile: #0F1730;
  --cs-border: #1F2C50;
  --cs-border-soft: #182344;
  --cs-text: #E8EDF8;
  --cs-muted: #A0ABC8;
  --cs-step: #7D8AB0;
  --cs-cyan: #38D3FF;
  --cs-primary: #3D7EFF;
  --cs-primary-hi: #8FB8FF;
  --cs-deep: #2F5BFF;
  --cs-amber-hi: #F5B748;
  --cs-link: #7EA6FF;
  --cs-green: #34D399;
  --cs-amber: #F2AE3D;
  --cs-red: #FF5A6A;
  --cs-live: #FF3D5A;
  --cs-grad: linear-gradient(90deg, var(--cs-cyan), var(--cs-primary) 55%, var(--cs-deep));
  --cs-grad-2: linear-gradient(90deg, var(--cs-cyan), var(--cs-primary));
}

[data-md-color-primary="custom"] {
  --md-primary-fg-color: var(--cs-navy);
  --md-primary-fg-color--light: var(--cs-surface);
  --md-primary-fg-color--dark: var(--cs-navy);
  --md-primary-bg-color: var(--cs-text);
  --md-primary-bg-color--light: var(--cs-muted);
}

[data-md-color-accent="custom"] {
  --md-accent-fg-color: var(--cs-primary-hi);
  --md-accent-fg-color--transparent: rgba(61, 126, 255, 0.12);
  --md-accent-bg-color: #FFFFFF;
}

/* [data-md-color-scheme] matches the specificity of the theme's own scheme
 * variables. */
[data-md-color-scheme] {
  --md-default-bg-color: var(--cs-navy);
  --md-default-bg-color--light: rgba(7, 11, 23, 0.7);
  --md-default-fg-color: var(--cs-text);
  --md-default-fg-color--light: var(--cs-muted);
  --md-default-fg-color--lighter: var(--cs-step);
  --md-default-fg-color--lightest: var(--cs-border);
  --md-typeset-color: #D3DBEE;
  --md-typeset-a-color: var(--cs-link);
  --md-code-bg-color: var(--cs-navy-2);
  --md-code-fg-color: #D3DBEE;
  --md-code-hl-keyword-color: #8FB8FF;
  --md-code-hl-string-color: #7EE0B8;
  --md-code-hl-number-color: #FFB86B;
  --md-code-hl-constant-color: #FFB86B;
  --md-code-hl-function-color: #7EA6FF;
  --md-code-hl-name-color: #D3DBEE;
  --md-code-hl-special-color: #FFD27A;
  --md-code-hl-comment-color: var(--cs-step);
  --md-typeset-table-color: var(--cs-border);
  --md-typeset-table-color--light: rgba(255, 255, 255, 0.02);
  --md-typeset-mark-color: rgba(56, 211, 255, 0.28);
  --md-typeset-kbd-color: var(--cs-surface);
  --md-typeset-kbd-accent-color: #18244A;
  --md-typeset-kbd-border-color: #2B3C6E;
  --md-admonition-bg-color: rgba(17, 26, 51, 0.55);
  --md-footer-bg-color: #060A16;
  --md-footer-bg-color--dark: #04070F;
  --md-shadow-z1: none;
  --md-shadow-z2: 0 12px 40px -16px rgba(0, 0, 0, 0.8);
  --md-shadow-z3: 0 16px 50px -16px rgba(0, 0, 0, 0.9);
}

body {
  background-color: var(--cs-navy);
  font-feature-settings: "cv11", "ss03";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(61, 126, 255, 0.45);
  color: #FFFFFF;
}

/* 2. Banner and header -------------------------------------------------------
 * A pre-release banner, then a navy site bar: logo, name, the primary
 * links with a gradient underline on the active one, search, and a
 * gradient Download pill.
 */
.md-banner {
  background: linear-gradient(90deg, #0B1A3A, #0E1630 50%, #0A1F45);
  border-bottom: 1px solid var(--cs-border-soft);
  color: var(--cs-muted);
  font-size: 0.64rem;
}

.md-banner a {
  color: var(--cs-primary-hi);
  font-weight: 600;
}

.md-banner a::after {
  content: "\00a0→";
}

.md-banner strong {
  color: var(--cs-text);
}

.cs-announce__dot {
  display: inline-block;
  width: 0.36rem;
  height: 0.36rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: var(--cs-live);
  box-shadow: 0 0 0 3px rgba(255, 61, 90, 0.22);
  vertical-align: 0.08em;
}

.md-banner__button {
  color: var(--cs-muted);
}

.md-header {
  background-color: rgba(7, 11, 23, 0.86);
  color: var(--cs-text);
  border-bottom: 1px solid var(--cs-border-soft);
  box-shadow: none;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
}

.md-header--shadow {
  box-shadow: none;
}

.md-header__button.md-logo {
  margin: 0;
  padding: 0.4rem;
}

.md-header__button.md-logo img {
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 0.3rem;
}

.cs-brand {
  margin: 0 1.2rem 0 0.1rem;
  color: var(--cs-text);
  font-size: 0.85rem;
  font-weight: 750;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.cs-brand:hover {
  color: #FFFFFF;
}

.cs-primary__link {
  gap: 0.35rem;
}

.cs-primary__link svg {
  flex: 0 0 auto;
  width: 0.82rem;
  height: 0.82rem;
  color: var(--cs-step);
  fill: none;
  stroke: currentcolor;
  transition: color 125ms, transform 200ms;
}

.cs-primary__link:hover svg {
  color: var(--cs-primary-hi);
  transform: translateY(-1px);
}

.cs-primary__link--active svg {
  color: var(--cs-cyan);
  filter: drop-shadow(0 0 6px rgba(56, 211, 255, 0.55));
}

.cs-cta svg {
  width: 0.78rem;
  height: 0.78rem;
  fill: none;
  stroke: currentcolor;
}

/* Between 60em (where the section links appear) and 76.25em the header
 * holds the logo, five links, search and Download: drop the link icons
 * and tighten the spacing so everything fits. */
@media screen and (min-width: 60em) and (max-width: 76.1875em) {
  .cs-primary__link svg {
    display: none;
  }

  .cs-primary__link {
    padding: 0 0.45rem;
  }

  .cs-brand {
    margin-right: 0.6rem;
  }

  .cs-cta {
    margin-left: 0.4rem;
  }
}

/* Join our Discord, beside Download: an outlined pill in Discord's blurple.
 * Icon only (its name in the title and for screen readers) where the
 * header is tight: phones and the compact range above. */
.cs-discord {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.35rem;
  height: 1.6rem;
  margin-left: 0.6rem;
  padding: 0 0.75rem;
  border: 1px solid rgba(88, 101, 242, 0.6);
  border-radius: 999px;
  background: rgba(88, 101, 242, 0.14);
  color: #FFFFFF;
  font-size: 0.66rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color 150ms, border-color 150ms;
}

.cs-discord:hover,
.cs-discord:focus-visible {
  border-color: #5865F2;
  background: rgba(88, 101, 242, 0.3);
  color: #FFFFFF;
}

.cs-discord svg {
  width: 0.8rem;
  height: 0.8rem;
  fill: currentcolor;
}

@media screen and (max-width: 76.1875em) {
  .cs-discord {
    width: 1.6rem;
    margin-left: 0.4rem;
    padding: 0;
    justify-content: center;
  }

  .cs-discord span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* The page title would compete with the section links for space. */
.md-header__title {
  visibility: hidden;
}

.cs-primary {
  display: none;
  align-self: stretch;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cs-primary li {
  display: flex;
}

.cs-primary__link {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 0.6rem;
  color: var(--cs-muted);
  font-size: 0.72rem;
  font-weight: 500;
  transition: color 125ms;
}

.cs-primary__link:hover,
.cs-primary__link:focus-visible {
  color: #FFFFFF;
}

.cs-primary__link--active {
  color: #FFFFFF;
  font-weight: 700;
}

.cs-primary__link--active::after {
  position: absolute;
  right: 0.6rem;
  bottom: 0;
  left: 0.6rem;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--cs-grad);
  box-shadow: 0 0 10px rgba(61, 126, 255, 0.6);
  content: "";
}

.md-header .md-header__button {
  color: var(--cs-text);
}

.md-header .md-search__button {
  border: 1px solid rgba(232, 237, 248, 0.14);
  background-color: rgba(255, 255, 255, 0.06);
  color: #C5CEE6;
}

.md-header .md-search__button:hover,
.md-header .md-search__button:focus-visible {
  background-color: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
}

[data-md-color-scheme] .md-header .md-search__button::before {
  background-color: currentcolor;
}

[data-md-color-scheme] .md-header .md-search__button::after {
  border-color: rgba(232, 237, 248, 0.2);
  background-color: rgba(255, 255, 255, 0.08);
  color: #C5CEE6;
  box-shadow: none;
}

.cs-cta {
  display: none;
  align-items: center;
  gap: 0.3rem;
  height: 1.6rem;
  margin-left: 0.6rem;
  padding: 0 0.8rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #1FB6FF, #3D7EFF 50%, #2F6BFF);
  box-shadow: 0 6px 20px -8px rgba(61, 126, 255, 0.8);
  color: #FFFFFF;
  font-size: 0.66rem;
  font-weight: 700;
  white-space: nowrap;
  transition: filter 150ms;
}

.cs-cta:hover,
.cs-cta:focus-visible {
  filter: brightness(1.12);
  color: #FFFFFF;
}

@media screen and (min-width: 60em) {
  .cs-primary {
    display: flex;
  }

  .cs-cta {
    display: inline-flex;
  }
}

/* 3. Section bar ------------------------------------------------------------
 * The header's second tier: a band a shade lighter, edged at the top with a
 * faint gradient hairline. Each sub-section is a pill with its icon; the
 * active one gets a tint, a hairline ring, a glow and the gradient
 * underline on the band's bottom edge. Rendered empty outside a section
 * (so instant navigation can swap it in), and hidden then.
 */
.md-tabs.cs-section {
  position: relative;
  background: linear-gradient(180deg, #0E1733 0%, #0B1228 100%);
  color: var(--cs-text);
  border-bottom: 1px solid var(--cs-border-soft);
  box-shadow: none;
}

.md-tabs.cs-section:not(:has(.md-tabs__item)) {
  display: none;
}

.md-tabs.cs-section::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 211, 255, 0.3) 25%, rgba(61, 126, 255, 0.35) 50%, rgba(61, 126, 255, 0.3) 75%, transparent);
  content: "";
  pointer-events: none;
}

[dir] .cs-section .md-tabs__list {
  align-items: center;
  gap: 0.15rem;
  margin: 0;
  padding: 0.4rem 0;
}

.cs-section .md-tabs__item {
  height: auto;
  padding: 0;
}

.cs-section .md-tabs__item--active {
  border-bottom-color: transparent;
}

.cs-section .md-tabs__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.36rem;
  margin-top: 0;
  padding: 0.38rem 0.6rem;
  border-radius: 0.55rem;
  color: var(--cs-muted);
  font-size: 0.66rem;
  font-weight: 500;
  opacity: 1;
  transition: background-color 150ms, color 150ms, box-shadow 150ms;
  transition-delay: 0s;
}

[dir] .cs-section .md-tabs__link svg {
  flex: 0 0 auto;
  width: 0.85rem;
  height: 0.85rem;
  margin: 0;
  color: #6A7BA6;
  fill: none;
  stroke: currentcolor;
  transition: color 150ms, transform 200ms;
}

.cs-section .md-tabs__link:hover,
.cs-section .md-tabs__link:focus-visible {
  background-color: rgba(255, 255, 255, 0.055);
  color: #FFFFFF;
}

.cs-section .md-tabs__link:hover svg {
  color: var(--cs-primary-hi);
  transform: scale(1.08);
}

.cs-section .md-tabs__item--active .md-tabs__link,
.cs-section .md-tabs__item--active .md-tabs__link:hover {
  background: linear-gradient(135deg, rgba(61, 126, 255, 0.2), rgba(61, 126, 255, 0.16));
  box-shadow: inset 0 0 0 1px rgba(61, 126, 255, 0.4), 0 0 18px -6px rgba(61, 126, 255, 0.6);
  color: #FFFFFF;
  font-weight: 600;
}

.cs-section .md-tabs__item--active .md-tabs__link svg {
  color: var(--cs-primary-hi);
}

.cs-section .md-tabs__item--active .md-tabs__link::after {
  position: absolute;
  right: 0.6rem;
  bottom: calc(-0.4rem - 1px);
  left: 0.6rem;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--cs-grad);
  box-shadow: 0 0 10px rgba(61, 126, 255, 0.6);
  content: "";
}

/* 4. Sidebars ---------------------------------------------------------------
 * Every docs and tutorial page has an icon and a subtitle (front matter),
 * so each entry is a row: icon, then title over a muted subtitle. The
 * active page gets a tinted pill with a purple edge; group headings are
 * small-caps labels.
 */
.md-sidebar--primary .md-nav__link {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.05rem 0;
  padding: 0.34rem 0.5rem;
  border-radius: 0.45rem;
  color: #C9D3EA;
  font-size: 0.68rem;
  line-height: 1.35;
  transition: background-color 125ms, color 125ms;
}

.md-sidebar--primary .md-nav__link .md-ellipsis {
  overflow: visible;
  white-space: normal;
}

.md-sidebar--primary .md-nav__link > svg {
  flex: 0 0 auto;
  width: 0.85rem;
  height: 0.85rem;
  margin-top: 0.08rem;
  color: var(--cs-step);
  fill: none;
  stroke: currentcolor;
  transition: color 125ms;
}

.md-sidebar--primary a.md-nav__link:hover,
.md-sidebar--primary a.md-nav__link:focus-visible {
  background-color: rgba(255, 255, 255, 0.045);
  color: #FFFFFF;
}

.md-sidebar--primary a.md-nav__link:hover > svg {
  color: var(--cs-link);
}

.md-sidebar--primary .md-nav__link--active,
.md-sidebar--primary .md-nav__link--active:hover {
  background: linear-gradient(90deg, rgba(61, 126, 255, 0.16), rgba(61, 126, 255, 0.08));
  box-shadow: inset 2px 0 0 var(--cs-primary);
  color: #FFFFFF;
  font-weight: 600;
}

.md-sidebar--primary .md-nav__link--active > svg {
  color: var(--cs-primary-hi);
}

/* A section with its own index page (e.g. Getting started) renders as a
 * container that is itself a .md-nav__link, holding the page's link and a
 * toggle. Unpadded, so its link lines up with the plain rows; the toggle
 * is a bare chevron, never part of a pill. */
.md-sidebar--primary .md-nav__container {
  align-items: flex-start;
  gap: 0;
  margin: 0;
  padding: 0;
}

.md-sidebar--primary .md-nav__container > a.md-nav__link {
  flex: 1 1 auto;
  margin: 0.05rem 0;
}

.md-sidebar--primary .md-nav__container > label.md-nav__link,
.md-sidebar--primary .md-nav__container > label.md-nav__link:hover {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.34rem 0.4rem;
  background: none;
  box-shadow: none;
}

@media screen and (min-width: 76.25em) {
  .md-sidebar--primary .md-nav__item--section > .md-nav__container > a.md-nav__link {
    color: #FFFFFF;
    font-weight: 700;
  }
}

.md-sidebar--primary .md-nav__link small {
  display: block;
  margin-top: 0.12rem;
  color: var(--cs-step);
  font-size: 0.58rem;
  font-weight: 400;
  line-height: 1.3;
}

.md-sidebar--primary .md-nav__link--active small {
  color: var(--cs-muted);
}

@media screen and (min-width: 76.25em) {
  .md-sidebar--primary .md-nav__item--section > label.md-nav__link {
    margin-top: 0.9rem;
    padding-bottom: 0.2rem;
    color: var(--cs-step);
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .md-sidebar--primary .md-nav__item--section > label.md-nav__link .md-nav__icon {
    display: none;
  }

  /* The landing page keeps only the drawer. */
  .cs-drawer-only {
    display: none;
  }
}

.md-nav__title {
  color: var(--cs-step);
}

/* Table of contents */
.md-sidebar--secondary .md-nav__title {
  color: var(--cs-step);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.md-sidebar--secondary .md-nav__list {
  border-left: 1px solid var(--cs-border-soft);
}

.md-sidebar--secondary .md-nav__link {
  color: var(--cs-muted);
  font-size: 0.64rem;
}

.md-sidebar--secondary .md-nav__link:hover,
.md-sidebar--secondary .md-nav__link--active {
  color: #FFFFFF;
}

.md-sidebar--secondary .md-nav__link--passed {
  color: var(--cs-step);
}

/* 5. Content ----------------------------------------------------------------
 * Headings in white with tight tracking, an h1 with a gradient rule under
 * it, readable body copy, and brand-tinted code, tables, admonitions, cards
 * and buttons.
 */
.md-typeset {
  line-height: 1.7;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  color: #FFFFFF;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.md-typeset h1 {
  margin-bottom: 0.9rem;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.md-typeset :is(h1, h2, h3, h4) {
  text-wrap: balance;
}

.md-typeset h1::after {
  display: block;
  width: 2.4rem;
  height: 3px;
  margin-top: 0.7rem;
  border-radius: 3px;
  background: var(--cs-grad);
  content: "";
}

.md-typeset h2 {
  margin-top: 2.2em;
}

.md-typeset .headerlink {
  color: var(--cs-step);
}

.md-typeset a {
  text-decoration: none;
}

.md-typeset a:hover {
  color: var(--cs-primary-hi);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.md-typeset strong {
  color: #FFFFFF;
}

.md-typeset hr {
  border-bottom: 1px solid var(--cs-border);
}

.md-typeset :not(pre, a) > code {
  padding: 0.1em 0.38em;
  border: 1px solid rgba(61, 126, 255, 0.22);
  border-radius: 5px;
  background-color: rgba(61, 126, 255, 0.1);
  color: #DCE8FF;
}

.md-typeset a > code {
  color: var(--cs-link);
}

.md-typeset pre > code {
  border: 1px solid var(--cs-border);
  border-radius: 12px;
}

.md-typeset .highlight .filename {
  border: 1px solid var(--cs-border);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--cs-step);
  font-family: var(--md-code-font-family);
}

.md-typeset kbd {
  font-family: var(--md-code-font-family);
  color: var(--cs-text);
}

.md-typeset mark {
  padding: 0 0.2em;
  border-radius: 4px;
  color: inherit;
}

/* tables: every one spans the column. One too wide for it (only on narrow
 * screens) keeps its frame and scrolls, fading out at the edge it continues
 * past (tables.js sets cs-more-left/right). */
.md-typeset__table {
  display: block;
}

.md-typeset table:not([class]) {
  display: table;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--cs-border);
  border-radius: 12px;
  background: rgba(17, 26, 51, 0.35);
  font-size: 0.68rem;
  line-height: 1.5;
}

.md-typeset table:not([class]) th {
  min-width: 0;
  white-space: nowrap;
  background: rgba(61, 126, 255, 0.08);
  color: #FFFFFF;
  font-weight: 700;
}

.md-typeset table:not([class]) :is(th, td) {
  padding: 0.6em 0.9em;
  border-top: 1px solid var(--cs-border-soft);
}

/* The first column names the row; keep short names on one line. */
.md-typeset table:not([class]) :is(th, td):first-child {
  min-width: 6.5rem;
}

.md-typeset table:not([class]) tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
  box-shadow: none;
}

.md-typeset__scrollwrap.cs-more-right {
  mask-image: linear-gradient(to right, #000 calc(100% - 3rem), transparent);
}

.md-typeset__scrollwrap.cs-more-left {
  mask-image: linear-gradient(to left, #000 calc(100% - 3rem), transparent);
}

.md-typeset__scrollwrap.cs-more-left.cs-more-right {
  mask-image: linear-gradient(to right, transparent, #000 3rem, #000 calc(100% - 3rem), transparent);
}

/* Chips in the settings tables: "required" after a name, the default at the
 * start of the details. */
.md-typeset .cs-chip {
  display: inline-block;
  margin: 0 0.3em 0.15em 0;
  padding: 0.05em 0.55em;
  border: 1px solid var(--cs-border);
  border-radius: 999px;
  background: var(--cs-tile);
  color: var(--cs-muted);
  font-size: 0.85em;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: baseline;
}

.md-typeset .cs-chip code {
  padding: 0;
  background: none;
  color: var(--cs-text);
  font-size: 0.95em;
}

.md-typeset .cs-chip--req {
  margin: 0 0 0 0.2em;
  border-color: color-mix(in srgb, var(--cs-amber) 40%, transparent);
  background: color-mix(in srgb, var(--cs-amber) 10%, transparent);
  color: var(--cs-amber-hi);
  font-size: 0.78em;
  letter-spacing: 0.02em;
}

/* Phones: a picture floated beside the text would squeeze it, and any
 * table next to it, into a sliver. Stack it instead. */
@media screen and (max-width: 37.4375em) {
  .md-typeset img[align] {
    float: none;
    display: block;
    margin: 1em auto;
  }

  .md-typeset table:not([class]) th {
    white-space: normal;
  }
}

/* Phones: a table of three or more columns becomes a card per row, the
 * first cell its title and each other cell under its column's name
 * (tables.js copies them into data-label). Empty cells are left out. */
@media screen and (max-width: 37.4375em) {
  .md-typeset table[data-cards] {
    display: block;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: none;
  }

  .md-typeset table[data-cards] thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .md-typeset table[data-cards] tbody {
    display: grid;
    gap: 0.6rem;
  }

  .md-typeset table[data-cards] tr {
    display: block;
    padding: 0.7em 0.9em;
    border: 1px solid var(--cs-border);
    border-radius: 12px;
    background: rgba(17, 26, 51, 0.35);
  }

  .md-typeset table[data-cards] tbody tr:hover {
    background: rgba(17, 26, 51, 0.35);
  }

  .md-typeset table[data-cards] td {
    display: block;
    min-width: 0;
    padding: 0.3em 0 0;
    border: 0;
  }

  .md-typeset table[data-cards] td code {
    overflow-wrap: anywhere;
  }

  .md-typeset table[data-cards] td:empty {
    display: none;
  }

  .md-typeset table[data-cards] td:first-child {
    padding: 0 0 0.45em;
    margin-bottom: 0.15em;
    border-bottom: 1px solid var(--cs-border-soft);
    color: #FFFFFF;
    font-size: 0.74rem;
    font-weight: 700;
  }

  .md-typeset table[data-grouped] td:first-child {
    padding: 0;
    margin: 0;
    border: 0;
    color: var(--cs-primary-hi);
    font-size: 0.56rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .md-typeset table[data-grouped] td:first-child strong {
    color: inherit;
  }

  .md-typeset table[data-grouped] td:first-child:empty:not([data-group=""]) {
    display: block;
  }

  .md-typeset table[data-grouped] td:first-child:empty::before {
    content: attr(data-group);
  }

  .md-typeset table[data-grouped] td:nth-child(2) {
    padding: 0.1em 0 0.45em;
    margin-bottom: 0.15em;
    border-bottom: 1px solid var(--cs-border-soft);
    color: #FFFFFF;
    font-size: 0.74rem;
  }

  /* A title with nothing under it needs no rule beneath it. */
  .md-typeset table[data-cards] td:first-child:not(:has(~ td:not(:empty))),
  .md-typeset table[data-grouped] td:nth-child(2):not(:has(~ td:not(:empty))) {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
  }

  .md-typeset table[data-cards][data-grouped] td:nth-child(2)[data-label]::before {
    display: none;
  }

  .md-typeset table[data-cards] td:not(:first-child)[data-label]::before {
    content: attr(data-label);
    display: block;
    color: var(--cs-step);
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
}

/* admonitions: one tone per kind */
.md-typeset :is(.admonition, details) {
  --cs-adm: var(--cs-primary);
  border: 1px solid color-mix(in srgb, var(--cs-adm) 35%, var(--cs-border));
  border-left: 3px solid var(--cs-adm);
  border-radius: 12px;
  font-size: 0.7rem;
  line-height: 1.6;
  box-shadow: none;
}

.md-typeset :is(.admonition, details):is(.tip, .success, .example) {
  --cs-adm: var(--cs-green);
}

.md-typeset :is(.admonition, details):is(.warning, .bug, .caution, .attention) {
  --cs-adm: var(--cs-amber);
}

.md-typeset :is(.admonition, details):is(.danger, .failure, .error) {
  --cs-adm: var(--cs-red);
}

.md-typeset :is(.admonition, details):is(.question, .abstract) {
  --cs-adm: var(--cs-cyan);
}

/* Beat the theme's per-type tints (.md-typeset details.question etc.). */
.md-typeset :is(.admonition, details):is(.admonition, details)[class] {
  background-color: color-mix(in srgb, var(--cs-adm) 6%, rgba(17, 26, 51, 0.55));
}

.md-typeset :is(.admonition, details)[class] > :is(.admonition-title, summary) {
  background-color: transparent;
  color: #FFFFFF;
  font-weight: 700;
}

.md-typeset :is(.admonition, details)[class] > :is(.admonition-title, summary)::before {
  background-color: var(--cs-adm);
}

.md-typeset :is(.admonition, details)[class] > summary::after {
  color: var(--cs-step);
}

/* buttons */
.md-typeset .md-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.2rem 0.4rem 0.2rem 0;
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--cs-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--cs-text);
  font-weight: 600;
  transition: border-color 150ms, filter 150ms, transform 150ms;
}

.md-typeset .md-button:is(:hover, :focus) {
  border-color: var(--cs-primary);
  background: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
  text-decoration: none;
  transform: translateY(-1px);
}

.md-typeset .md-button--primary {
  border: 0;
  background: linear-gradient(90deg, #1FB6FF, #3D7EFF 50%, #2F6BFF);
  box-shadow: 0 8px 24px -10px rgba(61, 126, 255, 0.8);
  color: #FFFFFF;
}

.md-typeset .md-button--primary:is(:hover, :focus) {
  background: linear-gradient(90deg, #1FB6FF, #3D7EFF 50%, #2F6BFF);
  filter: brightness(1.12);
}

/* grid cards */
.md-typeset .grid.cards > :is(ul, ol) > li,
.md-typeset .grid > .card {
  border: 1px solid var(--cs-border);
  border-radius: 14px;
  background: rgba(17, 26, 51, 0.7);
  transition: border-color 150ms, transform 150ms, box-shadow 150ms;
}

.md-typeset .grid.cards > :is(ul, ol) > li:hover,
.md-typeset .grid > .card:hover {
  border-color: rgba(61, 126, 255, 0.55);
  box-shadow: 0 20px 50px -30px rgba(61, 126, 255, 0.6);
  transform: translateY(-2px);
}

/* Cards are columns with their closing link pinned to the bottom, so the
 * links in a row line up whatever the length of the text above them. */
.md-typeset .grid.cards > :is(ul, ol) > li {
  display: flex;
  flex-direction: column;
}

.md-typeset .grid.cards > :is(ul, ol) > li > p:last-child:not(:first-child) {
  margin-top: auto;
  padding-top: 0.4em;
}

/* In a column, margins no longer collapse: tighten title, rule and text. */
.md-typeset .grid.cards > :is(ul, ol) > li > p:first-child {
  margin-bottom: 0;
}

.md-typeset .grid.cards > :is(ul, ol) > li > hr {
  margin: 0.6em 0;
}

.md-typeset .grid.cards > :is(ul, ol) > li > hr + p {
  margin-top: 0;
}

.md-typeset .grid.cards > :is(ul, ol) > li > hr {
  border-bottom-color: var(--cs-border-soft);
}

.md-typeset .grid.cards .lg,
.md-typeset .grid.cards svg {
  color: var(--cs-primary-hi);
}

.md-typeset .grid.cards > :is(ul, ol) > li:nth-child(3n + 2) :is(.lg, svg) {
  color: #5EDCFF;
}

.md-typeset .grid.cards > :is(ul, ol) > li:nth-child(3n) :is(.lg, svg) {
  color: var(--cs-amber-hi);
}

/* content tabs */
.md-typeset .tabbed-labels > label {
  color: var(--cs-muted);
  font-weight: 600;
}

.md-typeset .tabbed-labels > label:hover {
  color: #FFFFFF;
}

.md-typeset .tabbed-labels::before {
  background: var(--cs-grad);
}

/* path / breadcrumbs */
.md-path {
  color: var(--cs-step);
  font-size: 0.62rem;
}

/* 6. Footer -----------------------------------------------------------------
 * Compact previous/next links, then one slim bar: logo, site links,
 * copyright and legal links, under a faint gradient hairline. Kept short
 * so the sticky sidebar keeps its room at the end of a page.
 */
.md-footer {
  background-color: var(--cs-navy);
  color: var(--cs-text);
}

/* Previous / next, at the end of the content (partials/pagenav.html). */
.md-typeset .cs-pagenav {
  display: flex;
  gap: 0.6rem;
  margin: 2.4rem 0 0.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--cs-border-soft);
}

.md-typeset .cs-pagenav__link {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--cs-border);
  border-radius: 10px;
  background: rgba(17, 26, 51, 0.5);
  color: var(--cs-text);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.35;
  transition: border-color 125ms, background-color 125ms;
}

.md-typeset .cs-pagenav__link:hover {
  border-color: var(--cs-primary);
  background-color: rgba(61, 126, 255, 0.08);
  color: #FFFFFF;
  text-decoration: none;
}

.md-typeset .cs-pagenav__link--next {
  justify-content: flex-end;
  text-align: right;
}

.md-typeset .cs-pagenav__link:only-child.cs-pagenav__link--next {
  margin-left: auto;
  max-width: 50%;
}

.md-typeset .cs-pagenav__link small {
  display: block;
  color: var(--cs-step);
  font-size: 0.56rem;
  font-weight: 500;
}

.md-typeset .cs-pagenav__link svg {
  flex: 0 0 auto;
  width: 0.85rem;
  height: 0.85rem;
  color: var(--cs-primary-hi);
}

.cs-footer {
  position: relative;
  border-top: 1px solid var(--cs-border-soft);
  background: #060A16;
  color: var(--cs-muted);
}

.cs-footer::before {
  position: absolute;
  top: -1px;
  right: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 211, 255, 0.45), rgba(61, 126, 255, 0.55), transparent);
  content: "";
}

.cs-footer__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.4rem;
  padding: 0.7rem 0.8rem;
  font-size: 0.62rem;
}

.cs-footer .cs-footer__logo {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #FFFFFF;
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.cs-footer__logo img {
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
}

.cs-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.6rem;
}

/* Tap targets at least 24px tall, with room between them. */
.cs-footer__links a,
.cs-footer__meta a {
  display: inline-flex;
  align-items: center;
  min-height: 1.6rem;
  padding: 0 0.2rem;
}

.cs-footer__meta {
  align-items: center;
}

/* Dark only, so the theme's colour-scheme switch is never shown; hidden
 * outright so its input isn't a focus stop inside aria-hidden. */
.md-header__option {
  display: none;
}

.cs-footer__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1rem;
  margin: 0 0 0 auto;
  color: var(--cs-step);
}

.cs-footer a {
  color: var(--cs-muted);
  transition: color 125ms;
}

.cs-footer a:hover,
.cs-footer .cs-footer__logo:hover {
  color: #FFFFFF;
}

.cs-footer__meta a {
  color: var(--cs-step);
}

@media screen and (max-width: 44.9375em) {
  .cs-footer__meta {
    margin-left: 0;
  }
}

/* 7. Website pages ------------------------------------------------------------
 * Pages without sidebars (features, FAQ, legal...) keep a readable measure
 * and sit on a soft glow.
 */
.md-main__inner:has(.md-sidebar--primary[hidden]) .md-content {
  max-width: 48rem;
  margin: 0 auto;
}

.md-main:has(.md-sidebar--primary[hidden]) {
  background:
    radial-gradient(50rem 24rem at 20% -6rem, rgba(61, 126, 255, 0.14), transparent 70%),
    radial-gradient(40rem 22rem at 90% -4rem, rgba(61, 126, 255, 0.1), transparent 70%);
}

.md-main:has(.md-sidebar--primary[hidden]) .md-typeset h1 {
  font-size: 2.2rem;
}

/* Docs and tutorial pages sit on a fainter glow. */
.md-main {
  background:
    radial-gradient(60rem 22rem at 30% -8rem, rgba(61, 126, 255, 0.08), transparent 70%);
}

/* 8. 404 ------------------------------------------------------------------- */
.cs-404 {
  padding: 3rem 0 4rem;
  text-align: center;
}

.cs-404 .cs-404__code {
  margin: 0;
  background: var(--cs-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: clamp(5rem, 18vw, 10rem);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.06em;
  filter: drop-shadow(0 12px 48px rgba(61, 126, 255, 0.35));
}

.md-typeset .cs-404 h1 {
  margin: 0.8rem 0 0.6rem;
  font-size: 1.8rem;
}

.md-typeset .cs-404 h1::after {
  margin: 0.7rem auto 0;
}

.cs-404 p {
  max-width: 30rem;
  margin: 0 auto 1.4rem;
  color: var(--cs-muted);
}

.cs-404 .cs-404__scene {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.4rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid rgba(255, 90, 106, 0.4);
  border-radius: 999px;
  background: rgba(255, 90, 106, 0.08);
  color: #FFC1C8;
  font-family: var(--md-code-font-family);
  font-size: 0.62rem;
}

/* 9. Chat text ---------------------------------------------------------------
 * Commands and placeholders a streamer types are inline code, drawn as a
 * soft chip (section 5). Whole chat messages are bubbles:
 *   <p class="cs-chat"><b>CroStream</b> @{user} clipped it!</p>
 *   <p class="cs-chat cs-chat--viewer"><b>viewer</b> !clip</p>
 */
.md-typeset .cs-chat {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.5rem;
  width: fit-content;
  max-width: 100%;
  margin: 0.8em 0;
  padding: 0.55rem 0.85rem;
  border: 1px solid rgba(61, 126, 255, 0.45);
  border-radius: 12px 12px 12px 4px;
  background: rgba(61, 126, 255, 0.1);
  color: var(--cs-text);
  font-size: 0.74rem;
  line-height: 1.5;
}

.md-typeset .cs-chat > b:first-child {
  padding: 0.05rem 0.45rem;
  border-radius: 5px;
  background: #2563EB;
  color: #FFFFFF;
  font-size: 0.62rem;
  font-weight: 700;
}

.md-typeset .cs-chat--viewer {
  border-color: var(--cs-border);
  background: rgba(17, 26, 51, 0.7);
}

.md-typeset .cs-chat--viewer > b:first-child {
  padding: 0;
  background: none;
  color: var(--cs-green);
}

/* Screen-reader-only text: names the header's icon buttons. */
.md-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* The theme hides the logo below 76.25em (the drawer button takes its
 * place); there is room for both, so keep the brand mark visible. */
@media screen and (max-width: 76.234375em) {
  [dir] .md-header__button.md-logo {
    display: block;
    margin: 0 0 0 -0.3rem;
  }

  /* Menu button first, then the brand. */
  .md-header__inner > label[for="__drawer"] {
    order: -1;
  }

  .md-header__button.md-logo img {
    width: 1.2rem;
    height: 1.2rem;
  }

  .cs-brand {
    margin-left: 0;
  }
}
