/* ============================================================
   kDomainBench docs: site styles on top of Material for MkDocs.
   The look follows the scMultiBench documentation.
   Palette: slate-900 ink + blue #0046ad / #00aeef accent + pure white.
   Type:    Inter body + Newsreader display + JetBrains Mono code.
   Motion:  short ease-out transitions, no gradients.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:opsz,wght@6..72,300;6..72,400;6..72,500;6..72,600&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=optional');


/* ---------- Tokens (light) ---------- */

:root {
  /* Neutrals */
  --slate-700: #334155;
  --slate-900: #0f172a;

  /* Brand: blue accent (b/w/grey base + #0046ad / #00aeef), solid only */
  --brand-600: #0046ad;   /* primary accent (deep blue) */

  /* Functional */
  --amber:   #f59e0b;

  /* Semantic */
  --bg:            #ffffff;   /* PURE white */
  --bg-elevated:   #f8fafc;   /* slate-50 — features section */
  --bg-card:       #ffffff;   /* cards on white */
  --bg-subtle:     #f1f5f9;   /* slate-100 — code fill */
  --border:        #e2e8f0;   /* slate-200 — hairlines */
  --border-strong: #cbd5e1;   /* slate-300 — table rules, button outlines */
  --text:          #0f172a;   /* slate-900 — primary ink */
  --text-muted:    #334155;   /* slate-700 — secondary */
  --text-faint:    #64748b;   /* slate-500 — meta, anchors */

  /* Elevation — soft for smooth hover */
  --shadow-xs:  0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md:  0 4px 12px rgba(15, 23, 42, 0.06),
                0 2px 4px rgba(15, 23, 42, 0.04);

  /* Motion — smooth defaults, no overshoot for hover */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);   /* expressive ease-out */
  --dur-fast:    160ms;
  --dur-base:    220ms;

  /* Layout */
  --reading-max: 44rem;         /* longest line of body text */
}


/* ---------- Tokens (dark) ---------- */

[data-md-color-scheme="slate"] {
  --bg:            #0a0a14;
  --bg-elevated:   #111122;
  --bg-card:       #14142b;
  --bg-subtle:     #1a1a30;
  --border:        #27273a;
  --border-strong: #3a3a52;
  --text:          #f8fafc;
  --text-muted:    #cbd5e1;
  --text-faint:    #94a3b8;

  --brand-600:    #00aeef;   /* dark-mode accent: brighter cyan-blue for contrast */

  --shadow-xs:    0 1px 2px rgba(0, 0, 0, 0.40);
  --shadow-md:    0 4px 12px rgba(0, 0, 0, 0.45);
}


/* ---------- Material's tokens ---------- */

:root {
  --md-primary-fg-color:        var(--slate-900);
  --md-primary-fg-color--light: var(--slate-700);
  --md-primary-fg-color--dark:  #000000;
  --md-accent-fg-color:         var(--brand-600);
  --md-typeset-a-color:         var(--brand-600);
  --md-default-bg-color:        var(--bg);
}
[data-md-color-scheme="slate"] {
  --md-primary-fg-color:        #f8fafc;
  --md-primary-fg-color--light: #cbd5e1;
  --md-primary-fg-color--dark:  #ffffff;
  --md-accent-fg-color:         var(--brand-600);
  --md-typeset-a-color:         var(--brand-600);
  --md-default-bg-color:        var(--bg);
}

/* The palette's `accent` in mkdocs.yml sets --md-accent-fg-color on <body>
   (data-md-color-accent), which beats the :root blue above. Re-assert the blue
   accent at that level. */
[data-md-color-accent] { --md-accent-fg-color: var(--brand-600); }
/* and keep code-block scrollbars grey (not the accent) on hover, like everywhere */
.md-typeset pre > code,
.md-typeset pre > code:hover,
.md-typeset [class*="highlight"] pre,
.md-typeset [class*="highlight"] pre:hover {
  scrollbar-color: var(--border-strong) transparent !important;
}

body, .md-main, .md-container { background: var(--bg); }


/* ---------- Typography ---------- */

body, .md-typeset {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.md-typeset {
  font-size: 15px;        /* body reads at 15/1.65 */
  line-height: 1.65;
  color: var(--text);
}
.md-typeset p {
  color: var(--text);
  max-width: var(--reading-max);
  margin: 0 0 1.1em;
}

/* Serif for headings, sans for body */
.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  font-family: 'Newsreader', 'Charter', 'Iowan Old Style', Georgia, serif;
  font-variation-settings: "opsz" 36;
  letter-spacing: -0.015em;
  color: var(--text);
}


.md-typeset h1 {
  font-size: 34px;             /* content/doc h1 (hero H1 is separate, .lp-hero-text) */
  line-height: 1.15;
  font-weight: 400;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 48;
  margin: 0.2rem 0 1.4rem;
  text-wrap: balance;
  max-width: 32ch;
}

.md-typeset h2 {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.25;
  font-variation-settings: "opsz" 32;
  margin-top: 2.4rem;
  margin-bottom: 0.6rem;
  text-wrap: balance;
}

.md-typeset h3 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.4;
  font-variation-settings: "opsz" 24;
  margin-top: 1.8rem;
}

.md-typeset h4 {
  font-size: 16px;
  font-weight: 600;
}

.md-typeset strong { font-weight: 600; color: var(--text); }

/* No ligatures in code: '>=', '->' and '!=' stay the characters a reader types. */
.md-typeset code, .md-typeset pre, .md-typeset kbd {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-variant-ligatures: none;
  font-feature-settings: "calt" 0, "liga" 0;
}
/* Code blocks: 13px at every root size. Inline code keeps 0.86em. */
.md-typeset .highlight pre,
.md-typeset pre > code {
  font-size: 13px;
}


@media (max-width: 768px) {
  .md-typeset h1 { font-size: 28px; }
  .md-typeset h2 { font-size: 21px; }
}


/* ---------- Section dividers ---------- */

.md-typeset hr {
  height: 1px;
  border: none;
  background: var(--border);
  margin: 3rem 0 1rem;
}


/* ============================================================
   Landing page: 2-column hero with the animated card, 4 link cards,
   3 feature columns on a grey band
   ============================================================ */


/* ━━━━━━━━ HERO ━━━━━━━━ */
.md-typeset .lp-hero {
  display: grid;
  grid-template-columns: 5fr 6fr;        /* text | diagram card */
  gap: 48px;
  align-items: center;
  padding: 4px 0 12px;
}
.md-typeset .lp-hero-text { min-width: 0; }
html body .md-typeset .lp .lp-hero-text > h1 {
  font-family: 'Newsreader', 'Charter', Georgia, serif !important;
  font-variation-settings: "opsz" 60 !important;
  font-size: 34px !important;
  line-height: 1.08 !important;
  font-weight: 600 !important;
  letter-spacing: -0.02em !important;
  margin: 0 0 12px !important;
  color: var(--text) !important;
  max-width: 24ch !important;
  text-wrap: balance;
}
.md-typeset .lp-hero-text .lp-sub {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0 0 16px;
  max-width: 56ch;
}
.md-typeset .lp-hero-text .highlight {
  margin: 0 0 16px;
  max-width: 28rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: none;
}
.md-typeset .lp-hero-text .highlight pre,
.md-typeset .lp-hero-text .highlight pre > code {
  background: transparent !important;
  font-size: 14px;
  padding: 10px 14px !important;
  color: var(--text);
  margin: 0;
}

/* Hero buttons: plain ink, no accent colour */
html body .md-typeset .lp .lp-cta {
  background: var(--text) !important;
  color: var(--bg) !important;
  border: 1.5px solid var(--text) !important;
  font-family: 'Inter', sans-serif !important;
  font-weight: 500 !important;
  padding: 11px 22px !important;
  border-radius: 6px !important;
  font-size: 14px !important;
  display: inline-flex; align-items: center;
  text-decoration: none !important;
  box-shadow: none !important;
  transition: opacity 150ms cubic-bezier(0.4,0,0.2,1), transform 160ms var(--ease-out);
}
html body .md-typeset .lp .lp-cta:hover {
  opacity: 0.86;
}

/* Hero card: holds the task-flow animation */
.md-typeset .lp-hero-card {
  position: relative;
  padding: 8px 0;
}


/* ━━━━━━━━ Home: pull the content up under the header ━━━━━━━━ */


body:has(.md-typeset .lp) .md-content__inner::before { display: none; }
body:has(.md-typeset .lp) .md-content__inner { padding-top: 0.25rem; }
body:has(.md-typeset .lp) .md-main__inner { margin-top: 0.4rem; }   /* default 1.5rem */

/* ━━━━━━━━ Home: fill the viewport as one no-scroll screen ━━━━━━━━ */
/* the 24px content-inner bottom margin pushed the page past 100vh (caused a scroll) */
body:has(.md-typeset .lp) .md-content__inner { margin-bottom: 0 !important; }
/* stretch the landing to the full height under the header and distribute its three
   blocks (hero / cards / features band) so there is no empty band and no scroll */
body:has(.md-typeset .lp) .md-typeset .lp {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: calc(100vh - 134px);   /* header height + content offset above .lp (slimmed header) */
  box-sizing: border-box;
}
/* on a tall screen, scale the content up so the page fills with substance instead
   of large gaps (gated by min-height so shorter screens stay compact, no scroll) */
@media (min-height: 950px) {
  html body:has(.md-typeset .lp) .md-typeset .lp .lp-hero-text > h1 { font-size: 40px !important; }
  body:has(.md-typeset .lp) .md-typeset .lp-hero-text .lp-sub { font-size: 16px; }
  body:has(.md-typeset .lp) .md-typeset .lp-grid-4 { gap: 24px; }
  body:has(.md-typeset .lp) .md-typeset .lp-card { padding: 24px; }
  body:has(.md-typeset .lp) .md-typeset .lp-card .lp-card-title { font-size: 21px !important; }
  body:has(.md-typeset .lp) .md-typeset .lp-card .lp-card-desc { font-size: 14px; }
  body:has(.md-typeset .lp) .md-typeset .lp-section--band { padding: 30px 0 32px; }
}
/* at >=100em the header is one shorter row: give .lp that height back so the
   band still reaches the bottom */
@media (min-width: 100em) {
  body:has(.md-typeset .lp) .md-typeset .lp { min-height: calc(100vh - 113px); }
}
/* No footer site-wide: no prev/next nav, no social row, no meta bar. */
.md-footer { display: none; }


/* ━━━━━━━━ Task-flow card: run → estimate k → compare (animations.js) ━━━━━━━━ */
/* --tf-*: the animation's palette, read by animations.js when it draws */
.md-typeset .taskflow {
  color: var(--text);
  --tf-accent:      var(--brand-600);
  --tf-accent-soft: #8fb8e4;
  --tf-on-accent:   #ffffff;
  --tf-chip:        var(--bg-subtle);
  --tf-muted:       var(--text-faint);
  --tf-spot:        var(--border-strong);
  /* an estimate below, at and above the reference k: the colours of kdb.pl.plot_k_estimates */
  --tf-under:       #3a6ba5;
  --tf-exact:       #659b72;
  --tf-over:        #c65a36;
}
[data-md-color-scheme="slate"] .md-typeset .taskflow {
  --tf-accent-soft: #2f7ea6;
  --tf-on-accent:   #0a0a14;
  --tf-under:       #6f9bd1;
  --tf-exact:       #74b488;
  --tf-over:        #e07f5c;
}
.md-typeset .taskflow .tf-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.md-typeset .taskflow .tf-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
}
.md-typeset .taskflow .tf-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border: 1.5px solid var(--text);
  border-radius: 5px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}
.md-typeset .taskflow .tf-title {
  font-family: 'Newsreader', 'Charter', Georgia, serif;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text);
  position: relative;
  top: 2px;          /* serif optical-centring: Newsreader ink sits ~2px above the
                        line-box centre, so the title looked higher than the number
                        box — nudge down to centre the cap-body with the box */
}
/* In-figure annotation labels use Inter (sans, legible at small sizes) */
.md-typeset .taskflow .tf-stage svg text {
  font-family: 'Inter', sans-serif;
}
.md-typeset .taskflow .tf-stage {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  padding: 14px 14px 10px;
}
@media screen and (max-width: 480px) {
  .md-typeset .taskflow .tf-stage { padding: 8px 6px 4px; border-radius: 10px; }
}
.md-typeset .taskflow .tf-stage svg {
  width: 100%;
  height: auto;
  display: block;
}
/* in ②: a tissue spot takes the colour of its domain for the K under the cursor,
   and a point of the score curve pops in as the curve reaches it */
.md-typeset .taskflow .tf-spot { transition: fill 180ms ease; }
.md-typeset .taskflow .tf-pt {
  opacity: 0;
  transform: scale(0.6);
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 160ms var(--ease-out), transform 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.md-typeset .taskflow .tf-pt.is-on { opacity: 1; transform: none; }

/* The controls: a dot per step, and the pause button at the right end of the row.
   The dot of the current step is a bar that fills while the step plays. */
.md-typeset .taskflow .tf-dots {
  position: relative;
  display: flex;
  gap: 7px;
  justify-content: center;
  align-items: center;
  min-height: 22px;
}
.md-typeset .taskflow .tf-dot {
  position: relative;            /* anchor the fill and the enlarged ::before hit area */
  width: 7px; height: 7px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: var(--border-strong);
  cursor: pointer;               /* clickable: jump to that scene */
  transition: width 280ms var(--ease-out), background 200ms var(--ease-out);
}
/* invisible padding so the tiny 7px dot is easy to click/tap */
.md-typeset .taskflow .tf-dot::before {
  content: '';
  position: absolute;
  inset: -8px -4px;
}
@media (hover: hover) and (pointer: fine) {
  .md-typeset .taskflow .tf-dot:not(.is-active):hover { background: var(--text-muted); }
}
.md-typeset .taskflow .tf-dot:focus-visible,
.md-typeset .taskflow .tf-toggle:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 4px;
}
.md-typeset .taskflow .tf-dot.is-active { width: 28px; }
.md-typeset .taskflow .tf-dot.is-active::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: max(7px, calc(var(--tf-progress, 0) * 100%));     /* set by animations.js on every frame */
  border-radius: inherit;
  background: var(--text);
}
.md-typeset .taskflow .tf-toggle {
  position: absolute;
  right: 0;
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-faint);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.md-typeset .taskflow .tf-toggle::before {      /* a larger area to click or tap */
  content: '';
  position: absolute;
  inset: -8px;
}
.md-typeset .taskflow .tf-toggle svg { width: 10px; height: 10px; fill: currentColor; }
@media (hover: hover) and (pointer: fine) {
  .md-typeset .taskflow .tf-toggle:hover { color: var(--text); background: var(--bg-subtle); }
}
.md-typeset .taskflow .tf-toggle:active { transform: scale(0.94); }


/* ━━━━━━━━ SECTIONS (FEATURES / TUTORIALS) ━━━━━━━━ */
.md-typeset .lp-section {
  padding: 16px 0 0;
}


/* Features band — solid grey spanning the full viewport width (no gradient).
   box-shadow paints a solid block 100vmax to each side; clip-path lets it show
   horizontally while clipping top/bottom to the section box. body has
   overflow-x:hidden so the over-wide shadow never creates a scrollbar. */
.md-typeset .lp-section--band {
  position: relative;
  margin-top: 16px;
  padding: 16px 0 26px;
  background: var(--bg-elevated);
  box-shadow: 0 0 0 100vmax var(--bg-elevated);
  clip-path: inset(0 -100vmax);
}

/* 4-across grid */
.md-typeset .lp-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 4px 0 0;
}

/* Cards */
.md-typeset .lp-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  background: var(--bg-card);
}
.md-typeset .lp-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
}
.md-typeset .lp-card .lp-card-title {
  display: block;
  font-family: 'Newsreader', 'Charter', Georgia, serif !important;
  font-variation-settings: "opsz" 24;
  font-size: 19px !important;
  font-weight: 500;
  margin: 0 0 8px !important;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.md-typeset .lp-card .lp-card-desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
  display: block;
}

/* Tutorial link cards */
.md-typeset .lp-card-link a.lp-card-cover {
  text-decoration: none !important;
  color: inherit !important;
  border-bottom: none !important;  /* override Material link underline */
  display: block;
}
/* the cover link makes the whole card clickable */
.md-typeset .lp-card-cover::after {
  content: "";
  position: absolute;
  inset: 0;
}


/* ━━━━━━━━ FEATURES — 3 text columns split by vertical rules ━━━━━━━━ */
.md-typeset .lp-feature-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 4px 0 0;
}
.md-typeset .lp-feat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px 34px;
}
.md-typeset .lp-feat:first-child { padding-left: 4px; }
.md-typeset .lp-feat:last-child { padding-right: 4px; }
/* thin vertical divider between columns (inset top/bottom) */
.md-typeset .lp-feat + .lp-feat { border-left: 1px solid var(--border); }
.md-typeset .lp-feat-icon {
  display: inline-flex;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.md-typeset .lp-feat-icon svg { width: 26px; height: 26px; display: block; }
.md-typeset .lp-feat .lp-feat-title {
  font-family: 'Newsreader', 'Charter', Georgia, serif !important;
  font-variation-settings: "opsz" 24;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.md-typeset .lp-feat .lp-feat-desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-muted);
}


/* ━━━━━━━━ Responsive ━━━━━━━━ */
@media (max-width: 1024px) {
  .md-typeset .lp-grid-4 { grid-template-columns: repeat(2, 1fr); }
  /* stack features vertically; swap vertical dividers for horizontal ones */
  .md-typeset .lp-feature-row { grid-template-columns: 1fr; }
  .md-typeset .lp-feat { padding: 22px 4px; }
  .md-typeset .lp-feat:first-child { padding-top: 4px; }
  .md-typeset .lp-feat + .lp-feat { border-left: none; border-top: 1px solid var(--border); }
}
@media (max-width: 860px) {
  .md-typeset .lp-hero { grid-template-columns: 1fr; gap: 32px; }
  html body .md-typeset .lp .lp-hero-text > h1 { font-size: 32px !important; max-width: none !important; }
  .md-typeset .lp-hero-card { order: 2; }
}
@media (max-width: 560px) {
  .md-typeset .lp-grid-4 { grid-template-columns: 1fr; }
}


/* ---------- Code blocks ---------- */

.md-typeset .highlight {
  border-radius: 0.6rem;
  position: relative;
  margin: 1.2rem 0;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.md-typeset pre { margin: 0; }
.md-typeset pre > code {
  border-radius: 0.6rem;
  line-height: 1.6;
  padding: 1rem 1.2rem !important;
}
.md-typeset code:not(pre code) {
  background: var(--bg-subtle);
  color: var(--text);
  border-radius: 0.25rem;
  padding: 0.05rem 0.35rem;
  font-size: 0.86em;
  font-weight: 500;
}

/* ───────── API reference formatting ─────────
   Inline code in a heading: monospace at the heading's weight, no pill. */
.md-typeset h1 code:not(pre code),
.md-typeset h2 code:not(pre code),
.md-typeset h3 code:not(pre code),
.md-typeset h4 code:not(pre code) {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 0.92em;
  font-weight: inherit;
  color: inherit;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: -0.01em;
}
/* ───────── Restrained syntax highlighting — b/w/grey + blue only ─────────
   Default Pygments uses green keywords (#008000) + red strings/numbers (#ba2121).
   Recolour the loud tokens: keywords/operators → blue, strings → muted slate,
   comments → faint grey, numbers → ink. Each group lists every token of its family,
   also those no page uses yet, so a new code block gets the same colours. */
.md-typeset [class*="highlight"] .k,  .md-typeset [class*="highlight"] .kc,
.md-typeset [class*="highlight"] .kd, .md-typeset [class*="highlight"] .kn,
.md-typeset [class*="highlight"] .kp, .md-typeset [class*="highlight"] .kr,
.md-typeset [class*="highlight"] .kt, .md-typeset [class*="highlight"] .ow,
.md-typeset [class*="highlight"] .bp {
  color: var(--brand-600);
}
.md-typeset [class*="highlight"] .s,  .md-typeset [class*="highlight"] .sa,
.md-typeset [class*="highlight"] .sb, .md-typeset [class*="highlight"] .sc,
.md-typeset [class*="highlight"] .dl, .md-typeset [class*="highlight"] .sd,
.md-typeset [class*="highlight"] .s2, .md-typeset [class*="highlight"] .se,
.md-typeset [class*="highlight"] .sh, .md-typeset [class*="highlight"] .si,
.md-typeset [class*="highlight"] .sx, .md-typeset [class*="highlight"] .sr,
.md-typeset [class*="highlight"] .s1, .md-typeset [class*="highlight"] .ss {
  color: var(--text-muted);
}
.md-typeset [class*="highlight"] .c,  .md-typeset [class*="highlight"] .ch,
.md-typeset [class*="highlight"] .cm, .md-typeset [class*="highlight"] .cp,
.md-typeset [class*="highlight"] .cpf, .md-typeset [class*="highlight"] .c1,
.md-typeset [class*="highlight"] .cs {
  color: var(--text-faint); font-style: italic;
}
.md-typeset [class*="highlight"] .m,  .md-typeset [class*="highlight"] .mb,
.md-typeset [class*="highlight"] .mf, .md-typeset [class*="highlight"] .mh,
.md-typeset [class*="highlight"] .mi, .md-typeset [class*="highlight"] .mo,
.md-typeset [class*="highlight"] .il { color: var(--text); }

/* Filename label: inline mono prefix, no dark strip */
.md-typeset .highlight .filename {
  background: transparent;
  color: var(--text-faint);
  border-radius: 0;
  padding: 0 0 6px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  display: block;
  border: none;
}
.md-typeset .highlight .filename::before {
  content: "// ";
  color: var(--text-faint);
  opacity: 0.7;
}
.md-typeset .highlight:has(.filename) > pre { border-radius: 0; }
.md-typeset .highlight:has(.filename) > pre > code {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}


.md-typeset .md-clipboard {
  color: var(--text-faint);
  transition: color var(--dur-fast) var(--ease-out);
}
.md-typeset .md-clipboard:hover { color: var(--brand-600); }


/* ---------- Tables ---------- */

.md-typeset table:not([class]) {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  font-size: 14px;
}
.md-typeset table:not([class]) th {
  background: var(--bg-subtle);
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.9rem;
  text-align: left;
}
.md-typeset table:not([class]) td {
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border);
}
.md-typeset table:not([class]) tr:last-child td { border-bottom: none; }
.md-typeset table:not([class]) code { white-space: nowrap; }
.md-typeset table:not([class]) tr {
  transition: background var(--dur-fast) var(--ease-out);
}
.md-typeset table:not([class]) tr:hover { background: var(--bg-subtle); }


/* ---------- Admonitions ---------- */

.md-typeset .admonition {
  border-radius: 0.5rem;
  /* Force grey on all four sides (!important beats Material's per-type colour,
     e.g. the green `tip` box border); only the LEFT edge carries the accent. */
  border: 1px solid var(--border) !important;
  border-left-width: 3px !important;
  font-size: 14px;
  box-shadow: var(--shadow-xs);
  background: var(--bg-card);
}
.md-typeset .admonition-title {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  background: var(--bg-subtle) !important;   /* neutral bar — kill Material's per-type colour tints (green tip, etc.) */
}
/* Admonition icon: neutral grey, never Material's per-type colour (e.g. the green flame) */
.md-typeset .admonition-title::before { background-color: var(--text-muted) !important; }
/* Left accent: blue, amber for a warning. */
.md-typeset .admonition { border-left-color: var(--brand-600) !important; }
.md-typeset .admonition.warning { border-left-color: var(--amber) !important; }


/* ---------- Collapsible blocks (<details>) ----------
   One look for every collapsible block: `??? note "Details"` on markdown pages
   (pymdownx.details, <details class="note">) and the Notes / See Also sections of
   the API reference. Closed: a one-line bar with the chevron before
   the label. Open: a hairline under the bar, then the body with its own
   paragraph and list spacing.
   Sizes are in em of the 14px block text, so the bar and the body keep their
   proportions at every root size Material sets.
   Specificity: Material puts the summary padding and the chevron position under
   `[dir=ltr] .md-typeset summary`, hence the `[dir]` prefix. */

.md-typeset details {
  margin: 1em 0 1.25em;
  padding: 0 1em;
  border: 1px solid var(--border) !important;   /* all four sides; beats Material's per-type colour */
  border-radius: 8px;
  background: var(--bg-card);
  box-shadow: none;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

/* the bar */
[dir] .md-typeset details > summary {
  margin: 0 -1em;
  padding: 0.6em 1em 0.6em 2.4em;
  border-radius: 7px;
  background: var(--bg-elevated);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-muted);
  transition: background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
[dir] .md-typeset details > summary:hover {
  background: var(--bg-subtle);
  color: var(--text);
}
[dir] .md-typeset details[open] > summary {
  border-bottom: 1px solid var(--border);
  border-radius: 7px 7px 0 0;
  color: var(--text);
}
/* no type icon: the chevron alone marks the block as collapsible */
.md-typeset details > summary::before { content: none; display: none; }
/* the chevron: before the label, turns down when open */
[dir] .md-typeset details > summary::after {
  left: 0.85em;
  right: auto;
  top: 50%;
  width: 1.1em;
  height: 1.1em;
  margin-top: -0.55em;
  background-color: var(--text-faint);
  transition: transform var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
}
[dir] .md-typeset details > summary:hover::after { background-color: var(--brand-600); }
[dir] .md-typeset details[open] > summary::after { transform: rotate(90deg); }

/* the body: paragraphs, lists and code blocks share one 0.8em rhythm */
.md-typeset details > p {
  margin: 0 0 0.8em;
  max-width: var(--reading-max);
  line-height: 1.6;
}
.md-typeset details > ul,
.md-typeset details > ol { margin: 0 0 0.8em 0.625em; }
.md-typeset details > ul > li,
.md-typeset details > ol > li { margin-bottom: 0.3em; line-height: 1.6; }
.md-typeset details > .highlight { margin: 0 0 0.8em; }
/* first block under the bar, and the last block before the bottom edge */
.md-typeset details > summary + * { margin-top: 0.85em; }
html .md-typeset details > :last-child:not(summary) { margin-bottom: 0.9em; }

/* <details>/<summary> focus ring: the browser paints it in the OS accent colour
   (green on many macOS setups) and it wraps the WHOLE box. Kill it on BOTH the
   <summary> and the <details> (clicking can focus / focus-within either), in
   every focus state. A mouse click leaves no halo at all; keyboard users still
   get a subtle on-brand blue ring. */
.md-typeset details,
.md-typeset details > summary {
  outline: none !important;
}
.md-typeset details:focus-within {
  box-shadow: none !important;
}
.md-typeset details > summary:focus-visible {
  box-shadow: inset 0 0 0 2px var(--brand-600) !important;
}


/* ---------- Header + top tabs ---------- */

/* The header shows the logo only: the site name is in the page hero. With the
   title gone, the controls would bunch up next to the logo, so the first of
   them takes the free space on its left. */
.md-header__title { display: none; }
.md-header__option { margin-left: auto; }

.md-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  box-shadow: none;
  border-bottom: 1px solid transparent;
  color: var(--text);
  transition: border-color var(--dur-base) var(--ease-out);
}
[data-md-color-scheme="slate"] .md-header {
  background: rgba(10, 10, 20, 0.88);
}
.md-header[data-md-state="shadow"] {
  border-bottom-color: var(--border);
}


/* ---------- Header logo ---------- */
.md-header .md-logo img {
  height: 56px;          /* fills the header without raising its height */
  width: auto;
}
.md-tabs {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  color: var(--text);
}
[data-md-color-scheme="slate"] .md-tabs { background: var(--bg); }
/* Tabs with a 2px ink underline */
.md-tabs__list {
  gap: 4px;
}
.md-tabs__item { height: auto; }
.md-tabs__link {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0;
  color: var(--text-muted) !important;
  opacity: 1;
  padding: 9px 12px;
  margin: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 180ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.md-tabs__link:hover {
  color: var(--text) !important;
}


/* ---------- Single-row header (desktop): one flex row, no overlap ---------- */
/* On wide screens (≥100em) the whole header is one flex row:
     logo ·· Home · Get started · … · Resources ·· search · GitHub · ☾/☀
   The .md-header__inner <nav> is flattened with display:contents so its children
   join the .md-tabs <nav> as direct flex items of .md-header. The tabs are centred
   at the true header midpoint, and --header-side keeps them clear of the logo and
   of the controls: tabs wider than the space between scroll instead of sliding
   under the search box. Between 76.25em and 100em the header keeps Material's two
   rows (tabs on their own row). Below 76.25em the drawer takes over. */
@media screen and (min-width: 100em) {
  .md-header {
    --header-side: 16.5rem;        /* search + GitHub + theme switch, the wider of the two sides */
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 4.4rem;
    padding: 0 0.9rem;
  }
  .md-header__inner { display: contents; }

  /* Placement: the logo hugs the left, the nav is centred in the header, and the
     controls (search · GitHub · ☾) are pushed to the far right. */
  .md-header .md-logo { order: 0; flex: 0 0 auto; margin-left: 0.85rem; }


  .md-header .md-tabs {
    order: 2;
    position: absolute;
    left: 50%;
    top: 0;
    height: 100%;
    width: max-content;            /* hug the links so the centred box stays narrow */
    max-width: calc(100% - 2 * var(--header-side));
    overflow: hidden;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
  }
  .md-header .md-search { order: 3; flex: 0 0 auto; margin-left: auto; }
  .md-header .md-header__source { order: 4; flex: 0 0 auto; width: auto; margin: 0 2px; }
  .md-header .md-header__source .md-source__repository {
    max-width: none;               /* the block hugs its label, so there is nothing to truncate against */
    white-space: nowrap;
  }
  .md-header .md-header__option { order: 5; flex: 0 0 auto; margin-left: 0; }

  /* Drop the mobile-only icon buttons (hamburger + search-open) on desktop.
     IMPORTANT: scope the search rule to the *toggle button* only. There are
     three label[for="__search"] in the DOM — the open button, the click-away
     .md-search__overlay (unchecks #__search so the dropdown closes), and the
     magnifier .md-search__icon inside the field. Hiding all three left the
     overlay dead, so clicking away never closed the "Type to start searching"
     dropdown. Keep the overlay + magnifier alive. */
  .md-header label[for="__drawer"],
  .md-header label.md-header__button[for="__search"] { display: none; }

  /* Tabs sit inline: no band */
  .md-tabs {
    background: transparent !important;
    border-bottom: none !important;
    box-shadow: none !important;
  }
  .md-tabs .md-grid {
    max-width: 100%;
    min-width: 0;
    width: auto;
    margin: 0;
    padding: 0;
  }
  .md-tabs__list {
    gap: 2px;
  }
  .md-tabs__link {
    padding: 6px 12px;
    margin: 0;
    border-bottom: none;
  }
}


/* ---------- Narrow screens (<76.25em): keep the desktop header ---------- */
/* Material hides the logo and the tab row below 76.25em and leaves only the
   hamburger drawer. Keep both: the logo stays left of the controls, and the
   tabs stay a row under the header that scrolls sideways when it does not fit
   (a phone). The drawer still opens for the pages of a section. */
@media screen and (max-width: 76.234375em) {
  .md-header__button.md-logo { display: inline-block; }
  .md-header .md-logo img { height: 44px; }
  .md-tabs { display: block; }
  .md-tabs__list::-webkit-scrollbar { display: none; }

  /* The drawer's top: the site's white header, not Material's primary colour */
  .md-nav--primary .md-nav__title[for="__drawer"],
  .md-nav__source {
    background-color: var(--bg);
    color: var(--text);
  }
  .md-nav__source { border-bottom: 1px solid var(--border); }

  /* The drawer's first level lists the tabs: one style for every entry (the
     desktop panel styles section titles and pages differently, and its card
     border sat inside the drawer) */
  .md-sidebar--primary .md-nav--primary > .md-nav__list {
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    padding: 0.4rem 0;
  }
  .md-sidebar--primary .md-nav--primary > .md-nav__list > .md-nav__item > .md-nav__link {
    font-size: 15px;
    font-weight: 500 !important;
    color: var(--text) !important;
    letter-spacing: 0;
    padding: 0.7rem 1rem;
    margin: 0 !important;
    border-radius: 0;
    box-shadow: none;
  }
  .md-sidebar--primary .md-nav--primary > .md-nav__list > .md-nav__item--active > a.md-nav__link {
    background: var(--bg-subtle) !important;
  }
}


/* ---------- Sidebar + TOC ---------- */

.md-nav__link {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease-out);
}
.md-nav__link:hover { color: var(--text); }
.md-nav__title {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 11px;        /* section and TOC labels */
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* Left nav: a floating panel. Section titles (<label>) are bold ink, pages (<a>)
   regular, the current page is a grey chip with a soft shadow. */
.md-sidebar--primary .md-nav--primary > .md-nav__list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem 0.6rem 0.9rem;   /* taller, roomier panel */
  box-shadow: var(--shadow-md);
  margin-right: 0.4rem;
}
/* section title — bold, dark, a header (kill the blue+bold that mimicked items) */
.md-sidebar--primary label.md-nav__link {
  font-weight: 700 !important;
  color: var(--text) !important;
  font-size: 12px;
  letter-spacing: 0.02em;
  padding: 0.3rem 0.6rem 0.45rem;
  margin: 0 0 0.5rem;   /* more distance between the title row and the first option */
  cursor: default;
}
/* page options — regular weight, pill on hover/active */
.md-sidebar--primary a.md-nav__link {
  font-weight: 400 !important;
  color: var(--text-muted) !important;
  font-size: 13.5px;
  padding: 0.32rem 0.6rem;
  margin: 1px 0.3rem !important;   /* symmetric inset so the pill never bleeds onto the panel edge */
  border-radius: 7px;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.md-sidebar--primary a.md-nav__link:hover {
  background: rgba(15, 23, 42, 0.05);
  color: var(--text) !important;
}
[data-md-color-scheme="slate"] .md-sidebar--primary a.md-nav__link:hover {
  background: rgba(255, 255, 255, 0.06);
}
/* the current page */
.md-sidebar--primary .md-nav__item--active > a.md-nav__link,
.md-sidebar--primary a.md-nav__link--active {
  background: var(--bg-subtle) !important;
  color: var(--text) !important;
  font-weight: 500 !important;
  /* soft, EVEN shadow — enough blur (>offset) that the top edge is as soft as the
     bottom, so the pill reads as evenly floating instead of "cut off" at the top. */
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}
[data-md-color-scheme="slate"] .md-sidebar--primary .md-nav__item--active > a.md-nav__link,
[data-md-color-scheme="slate"] .md-sidebar--primary a.md-nav__link--active {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.36);
}
/* flatten Material's nested indentation so options align cleanly under the title */
.md-sidebar--primary .md-nav__list .md-nav__list { padding-left: 0; margin: 0; }
.md-sidebar--primary .md-nav__item { padding: 0; margin: 0; }
/* Material sets overflow:hidden on nav lists (for its drawer slide animation); on our
   always-expanded desktop sections that clips the first item's chip shadow at the top.
   Let it render fully — the floating panel itself provides the visual containment. */
.md-sidebar--primary .md-nav--primary .md-nav__list { overflow: visible; }
/* Material indents nested section navs with a negative left margin; zero it so the
   active pill respects the panel's padding instead of bleeding onto the left border. */
.md-sidebar--primary .md-nav--primary .md-nav { margin-left: 0 !important; }

.md-sidebar--secondary .md-nav__link {
  font-size: 13px;        /* TOC links a touch smaller than the left nav */
  border-left: 2px solid transparent;
  padding-left: 0.6rem;
  margin-left: 0;
  transition: color var(--dur-fast) var(--ease-out);
}
/* item padding (not link margin) widens the gap reliably — vertical margins between
   block siblings collapse, padding doesn't; the link box stays text-height so the
   sliding indicator bar still matches the active item. */
.md-sidebar--secondary .md-nav--secondary .md-nav__item { padding: 0.3rem 0; }
.md-sidebar--secondary .md-nav__link--active {
  color: var(--brand-600) !important;
  font-weight: 600;
}
/* The sliding `.toc-indicator` (animations.js) marks the active item. */
.md-sidebar--secondary .md-nav--secondary > .md-nav__list { position: relative; }
.md-sidebar--secondary .toc-indicator {
  position: absolute;
  left: 0; top: 0;
  width: 2px;
  background: var(--brand-600);
  border-radius: 2px;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              height 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.2s ease;
}
@media (prefers-reduced-motion: reduce) {
  .md-sidebar--secondary .toc-indicator { transition: opacity 0.2s ease; }
}
.md-sidebar--secondary .md-nav__link--passed {
  color: var(--text-faint) !important;
}
.md-sidebar--secondary .md-nav__title {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}




/* ---------- Links ---------- */

.md-typeset a:not(.md-button):not(.md-tabs__link):not(.md-nav__link):not(.headerlink) {
  color: var(--brand-600);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.md-typeset a:not(.md-button):not(.md-tabs__link):not(.md-nav__link):not(.headerlink):hover {
  border-bottom-color: var(--brand-600);
}


/* ---------- Headerlink anchors visible on hover ---------- */

.md-typeset .headerlink {
  color: var(--text-faint) !important;
  opacity: 0;
  margin-left: 0.4rem;
  font-weight: 400;
  border-bottom: none !important;
  transition: opacity var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.md-typeset h1:hover .headerlink,
.md-typeset h2:hover .headerlink,
.md-typeset h3:hover .headerlink,
.md-typeset h4:hover .headerlink {
  opacity: 1;
}
.md-typeset .headerlink:hover {
  color: var(--brand-600) !important;
}


/* Scroll progress bar at the very top */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--brand-600);
  width: 0;
  z-index: 9999;
  pointer-events: none;
  transition: width 80ms linear, opacity 200ms var(--ease-out);
  opacity: 0;
}
.scroll-progress.is-scrolling { opacity: 1; }

/* Back-to-top button (visible after scroll, added by JS) */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--slate-900);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
  box-shadow: var(--shadow-md);
  z-index: 100;
  border: none;
  font-size: 1.1rem;
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--brand-600);
}
[data-md-color-scheme="slate"] .back-to-top {
  background: #ffffff;
  color: var(--slate-900);
}
[data-md-color-scheme="slate"] .back-to-top:hover {
  background: var(--brand-600);
  color: #ffffff;
}


/* ---------- Abbreviation tooltips ---------- */

.md-typeset abbr {
  text-decoration: none;
  border-bottom: 1px dotted var(--brand-600);
  cursor: help;
  transition: color var(--dur-fast) var(--ease-out);
}
.md-typeset abbr:hover {
  color: var(--brand-600);
}


/* ---------- Blockquote ---------- */

.md-typeset blockquote {
  border-left: 3px solid var(--brand-600);
  background: var(--bg-subtle);
  color: var(--text);
  padding: 0.7rem 1.1rem;
  border-radius: 0 0.4rem 0.4rem 0;
}


/* ---------- Search ---------- */

.md-search__form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.4rem;
  transition: border-color var(--dur-fast) var(--ease-out);
  height: 2rem;
}
.md-search__form:hover { border-color: var(--border-strong); }
.md-search__form:focus-within {
  border-color: var(--text);
}
/* The focused input draws a violet :focus-visible halo by default — make it black */
.md-search__input:focus-visible {
  outline-color: var(--text) !important;
}
.md-search__input {
  font-family: 'Inter', sans-serif;
  font-size: 14px;            /* match the nav links (Home / Get started / …) */
  color: var(--text);
}
.md-search__input::placeholder { color: var(--text-faint); }

/* Narrower search box on desktop (the single-row header is tight on space).
   Use .md-header specificity to beat Material's default .md-search__inner width. */
@media screen and (min-width: 76.25em) {
  .md-header .md-search__inner { width: 8rem; }
  .md-header .md-search__inner:focus-within { width: 17rem; }
  /* The centred nav (.md-tabs) is position:absolute with z-index:3, so it
     paints ON TOP of the (opaque white) search form (z-index:2) — when the box
     expands leftward over "Tutorials"/"API" the nav text showed through.
     Lift the whole search subtree above the tabs so the opaque field covers
     them. Collapsed, the search sits far right and never overlaps the nav. */
  .md-header .md-search { z-index: 4; }
  .md-search__form { height: 1.9rem; }
  .md-search__input { padding-left: 1.9rem; }
  /* the magnifier icon sits left, sized to the smaller field */
  .md-search__icon[for="__search"] { width: 1.1rem; height: 1.1rem; }
}


/* ---------- Focus + selection + scrollbar + print ---------- */

:where(select, textarea, [tabindex]):focus-visible {    /* links, buttons, inputs: the rule further down */
  outline: 2px solid var(--brand-600);
  outline-offset: 2px;
}

* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track,
::-webkit-scrollbar-corner { background: transparent !important; }
/* A grey thumb in every state: while dragging, Chrome on macOS tints the thumb
   with the OS accent colour. */
::-webkit-scrollbar-thumb,
::-webkit-scrollbar-thumb:active,
::-webkit-scrollbar-thumb:window-inactive {
  background: var(--border-strong) !important;
  border-radius: 5px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-faint) !important; }

@media print {
  .md-header,
.md-tabs,
.md-sidebar,
.md-footer { display: none !important; }
  body { background: white; color: black; }
  .md-typeset h1, .md-typeset h2 { color: black; }
}


/* ---------- Misc ---------- */

html { scroll-behavior: smooth; }
/* clip (NOT hidden) — still contains the features band's 100vmax over-wide
   box-shadow so no horizontal scrollbar appears, but does NOT create a scroll
   container, so the sticky left nav + right TOC keep working when scrolling. */
html, body { overflow-x: clip; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* The small label above a landing card's title (DISCOVER / RUN / …): the one blue accent */
.lp-card .lp-card-kicker {
  display:block;
  font-size:.62rem;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--brand-600);
  margin-bottom:.35rem;
}


/* ════════════════════════════════════════════════════════════════════════════
   Interaction details: selection, hover, press and focus states.
   Palette-locked (ink / blue / grey) and reduced-motion-safe.
   ════════════════════════════════════════════════════════════════════════════ */

/* — Text selection in the brand accent — */
::selection { background: rgba(0, 70, 173, 0.18); }
[data-md-color-scheme="slate"] ::selection { background: rgba(0, 174, 239, 0.30); }

/* — Link cards lift on hover (only where a pointer can hover: a tap would
     leave the lift stuck) and give a little under a press — */
.md-typeset .lp-card {
  transition: border-color 220ms cubic-bezier(0.4,0,0.2,1),
              background-color 220ms cubic-bezier(0.4,0,0.2,1),
              transform 220ms cubic-bezier(0.4,0,0.2,1),
              box-shadow 220ms cubic-bezier(0.4,0,0.2,1);
}
@media (hover: hover) and (pointer: fine) {
  .md-typeset .lp-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 38px -18px rgba(15, 23, 42, 0.30);
  }
  [data-md-color-scheme="slate"] .md-typeset .lp-card:hover {
    box-shadow: 0 18px 42px -16px rgba(0, 0, 0, 0.62);
  }
}
.md-typeset .lp-card:active { transform: scale(0.985); }
html body .md-typeset .lp .lp-cta:active,
.back-to-top:active { transform: scale(0.97); }
@media (prefers-reduced-motion: reduce) {
  .md-typeset .lp-card:hover,
  .md-typeset .lp-card:active,
  html body .md-typeset .lp .lp-cta:active,
  .back-to-top:active { transform: none; }
}

/* — Top-nav tabs: a 2px underline that grows from the centre. The CURRENT section's
     tab stays underlined: Material marks the <li> as .md-tabs__item--active (not the
     link), shown with an ink underline + ink label, black/white/grey only, no accent
     colour. — */
.md-tabs__link::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: -1px;
  height: 2px;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 240ms cubic-bezier(0.4, 0, 0.2, 1), background-color 240ms ease;
}
.md-tabs__link:hover::after { transform: scaleX(1); background: var(--border-strong); }
.md-tabs__item--active .md-tabs__link::after { transform: scaleX(1); background: var(--text); }
.md-tabs__item--active .md-tabs__link { color: var(--text) !important; font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
  .md-tabs__link::after { transition: none; }
}

/* — Visible, on-brand focus rings (keyboard a11y + a crafted detail) — */
a:focus-visible,
button:focus-visible,
input:focus-visible,
.md-tabs__link:focus-visible,
.md-nav__link:focus-visible,
.md-typeset .lp-card-cover:focus-visible,
.md-typeset .lp-cta:focus-visible {
  outline: 2px solid var(--brand-600);
  outline-offset: 3px;
  border-radius: 4px;
}


.md-search-result__meta {
  font-family: 'Inter', sans-serif !important;
  font-size: 11.5px !important;
}
.md-search-result mark { color: var(--brand-600); background: transparent; font-weight: 600; }

   


/* ---------- API reference (mkdocstrings) ----------
   The pages under docs/reference/ are generated from the numpydoc docstrings
   (mkdocs.yml: docstring_section_style: spacy). Each entry reads as one card:
   a hairline and space above it, the public name in mono after a small kind
   tag, a compact signature box, the summary sentence, then Parameters /
   Returns / Raises as two-column tables - the name alone on the left (one
   fixed column, so names line up down the page), the description on the
   right with its type and default on a quiet line below - then Examples;
   Notes and See Also are the collapsed bars styled under "Collapsible blocks".
   Every selector hangs off mkdocstrings' `.doc` classes, so no other page changes. Tokens only; dark mode
   re-tints through the same variables - which is why colours below name
   var(--border) / var(--brand-600) directly: a custom property set on :root
   to var(--border) resolves there, to the LIGHT value, and the dark theme
   (tokens on body) would never reach it. */

:root {
  --api-sig-bg:      #f7f4ec;   /* warm tan, one step off the white page */
  --api-sig-border:  #e7e1d2;
  --api-name-col:    184px;     /* left column of every section table */
}
[data-md-color-scheme="slate"] {
  --api-sig-bg:      #17172a;
  --api-sig-border:  #2a2a40;
}


/* ---- one entry per `:::` directive ---- */
.md-typeset > .doc-object {
  margin: 3.2em 0 0;
  padding-top: 1.6em;
  border-top: 1px solid var(--border);
}

/* heading: kind tag, then the public spelling in mono */
.md-typeset h2.doc-heading {
  margin: 0 0 0.55em;
  padding: 0;
  border: 0;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  overflow-wrap: anywhere;
}
.md-typeset h2.doc-heading { font-size: 20px; }
.md-typeset .doc-heading code.doc-symbol-heading {
  display: inline-block;
  margin-right: 0.7em;
  padding: 0.2em 0.5em;
  border-radius: 4px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: 0.25em;
}
/* the kind colours of mkdocstrings' own tags, as in the table of contents */
.md-typeset .doc-heading > code.doc-symbol-function {
  color: var(--doc-symbol-function-fg-color);
  background: var(--doc-symbol-function-bg-color);
}
.md-typeset .doc-heading > code.doc-symbol-class {
  color: var(--doc-symbol-class-fg-color);
  background: var(--doc-symbol-class-bg-color);
}
/* the signature box: compact, one parameter per line */
.md-typeset .doc-signature.highlight {
  margin: 0 0 1.1em;
  border: 1px solid var(--api-sig-border);
  border-left: 2px solid var(--brand-600);
  border-radius: 6px;
  background: var(--api-sig-bg);
}
.md-typeset .doc-signature.highlight > pre { margin: 0; background: transparent; }
.md-typeset .doc-signature.highlight > pre > code {
  display: block;
  padding: 0.75em 1em !important;   /* beats the site-wide 1rem 1.2rem !important */
  background: transparent;
  font-size: 12.5px;
  line-height: 1.5;
  white-space: pre-wrap;          /* long single-line signatures wrap too */
  overflow-wrap: anywhere;
}
.md-typeset .doc-signature.highlight .nf { font-weight: 700; color: var(--text); }
.md-typeset .doc-signature.highlight .n { color: var(--text); }
.md-typeset .doc-signature.highlight .o,
.md-typeset .doc-signature.highlight .p { color: var(--text-faint); }
.md-typeset .doc-signature.highlight .kc { color: var(--brand-600); }
.md-typeset .doc-signature.highlight .md-clipboard { top: 0.35em; right: 0.35em; }
.md-typeset .doc-signature.highlight .md-clipboard::after { color: var(--text-faint); }

/* the summary sentence leads; body paragraphs keep the page rhythm */
.md-typeset .doc-contents > p:first-child {
  margin-bottom: 0.7em;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}
.md-typeset .doc-contents > p { color: var(--text-muted); }

/* section labels - PARAMETERS / RETURNS / RAISES / EXAMPLES - one quiet style */
.md-typeset .doc-contents .doc-section-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.md-typeset .doc-contents > p:has(> .doc-section-title) { margin: 1.6em 0 0.5em; }

/* the section tables */
.md-typeset .doc-contents .md-typeset__scrollwrap { margin: 1.4em 0 0; }
.md-typeset .doc-contents .md-typeset__table { padding: 0; }
.md-typeset .doc-contents table:not([class]) {
  table-layout: fixed;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  font-size: 14px;
  line-height: 1.6;
}
.md-typeset .doc-contents table:not([class]) th {
  padding: 0 0 0.45em;
  background: transparent;
  border: 0;
  text-transform: none;
  letter-spacing: 0;
}
.md-typeset .doc-contents table:not([class]) th:first-child { width: var(--api-name-col); }
/* the "Description" column head says nothing the layout does not */
.md-typeset .doc-contents table:not([class]) th + th > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.md-typeset .doc-contents table:not([class]) td {
  padding: 0.6em 0;
  border: 0;
  border-top: 1px solid var(--border);
  vertical-align: top;
}
.md-typeset .doc-contents table:not([class]) td:first-child { padding-right: 1em; }
.md-typeset .doc-contents table:not([class]) tr:hover { background: transparent; }

/* left column: the parameter name (or exception, or return type) in mono */
.md-typeset .doc-contents .doc-section-item > td:first-child code {
  padding: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}
.md-typeset .doc-contents .doc-section-item > td:first-child span[title] { border-bottom: 0; }

/* right column: the description, then the quiet type / default line */
.md-typeset .doc-contents .doc-md-description,
.md-typeset .doc-contents .doc-md-description > p:first-child { display: block; }
.md-typeset .doc-contents .doc-md-description { color: var(--text); }
.md-typeset .doc-contents .doc-md-description > p { margin: 0 0 0.45em; color: inherit; }
.md-typeset .doc-contents .doc-md-description > :last-child { margin-bottom: 0; }
.md-typeset .doc-contents td > p:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1em 1.4em;
  margin: 0.3em 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-faint);
}
.md-typeset .doc-contents td > p:last-child:not(:has(span)) { display: none; }
.md-typeset .doc-contents td > p:last-child > span { float: none; }
.md-typeset .doc-contents td > p:last-child b {
  margin-right: 0.45em;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 500;
  color: var(--text-faint);
}
.md-typeset .doc-contents td > p:last-child code {
  padding: 0;
  background: transparent;
  font-size: 1em;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.md-typeset .doc-contents td > p:last-child code span[title] { border-bottom: 0; }

/* Examples: the doctest block under its label */
.md-typeset .doc-contents > .highlight { margin: 0 0 1.2em; }
.md-typeset .doc-contents > .highlight code { font-size: 12.5px; }

/* Notes / See Also bars sit close under the sections */
.md-typeset .doc-contents > details { margin: 1.2em 0 0; }

/* phones: each row stacks - name, then its description */
@media screen and (max-width: 44.9375em) {
  .md-typeset .doc .md-typeset__table table:not([class]),
  .md-typeset .doc .md-typeset__table table:not([class]) tbody,
  .md-typeset .doc .md-typeset__table table:not([class]) thead,
  .md-typeset .doc .md-typeset__table table:not([class]) tr,
  .md-typeset .doc .md-typeset__table table:not([class]) th:first-child,
  .md-typeset .doc .md-typeset__table table:not([class]) td {
    display: block !important;
    width: auto;
  }
  .md-typeset .doc .md-typeset__table table:not([class]) th + th { display: none; }
  .md-typeset .doc-contents table:not([class]) td:first-child { padding: 0.6em 0 0; }
  .md-typeset .doc-contents table:not([class]) td + td { padding-top: 0.15em; border-top: 0; }
}


