/* ===========================================================================
 * Brand palette.
 *
 * theme.palette uses primary: custom / accent: custom in mkdocs.yml, so
 * Material's bundled palette.css defines nothing for [data-md-color-primary]
 * / [data-md-color-accent] and these variables are the only source of truth.
 *
 * Declarations go on `:root > *` (i.e. <body>), not `:root` (<html>). Material
 * sets its per-colour values via attribute selectors on <body>
 * ([data-md-color-primary=...]); with a *named* palette color those selectors
 * would win over a plain `:root` declaration regardless of stylesheet order,
 * because a directly-applied rule on an element always beats one the element
 * only inherited from an ancestor. `primary`/`accent: custom` sidesteps that
 * fight entirely (no such selector exists for "custom"), but `:root > *`
 * costs nothing and stays correct if a named palette color is ever reintroduced.
 * ======================================================================== */
:root > * {
  --md-primary-fg-color:        #000;
  --md-primary-fg-color--light: #333;
  --md-primary-fg-color--dark:  #000;
  --md-primary-bg-color:        #fff;
  --md-primary-bg-color--light: #ffffffb3;

  /* Accent (interaction colour — link hover, active nav item, focus rings)
   * and body-link colour both match the Zensical reference's own palette
   * rather than this site's previous monochrome black: black-on-black/white
   * gave no visible signal for hover/focus state, and a black link is
   * indistinguishable from body text except by its underline. */
  --md-accent-fg-color:              oklch(45% 0.16 160);
  --md-accent-fg-color--transparent: oklch(45% 0.16 160 / 10%);
  --md-accent-bg-color:               #fff;
  --md-accent-bg-color--light:        #ffffffb3;
  --md-typeset-a-color:              #1a4fd6;

  /* Footer */
  --md-footer-bg-color:         #000;
}

/* Primary does NOT invert for slate: .md-header/.md-footer are hardcoded
 * solid black in both colour schemes (see below and --md-footer-bg-color), and
 * --md-primary-bg-color is what those surfaces use for their *text* colour —
 * flipping it to black for dark mode made the header title and icons black
 * on a black header (invisible). Accent and the link colour do need a
 * scheme-specific value, because both are also used on the scheme's own
 * (light/dark) default background — e.g. the active-nav-item tint in the
 * sidebar, or a link inside the page body. */
[data-md-color-scheme="slate"] {
  --md-accent-fg-color:              oklch(72% 0.18 155);
  --md-accent-fg-color--transparent: oklch(72% 0.18 155 / 10%);
  --md-accent-bg-color:               #000;
  --md-typeset-a-color:              #5e8bde;

  /* Material's own slate default sits at 14% lightness (a lighter charcoal);
   * `modern`'s is 5% (near-black). Same --md-default-fg-color in both — the
   * heading/body text is literally identical — but it reads as "not white
   * enough" against the lighter background, since the same text is lower
   * contrast on 14% than on 5%. Pulled directly from modern's compiled CSS
   * rather than guessed, down to the --md-hue custom property it's built on. */
  --md-default-bg-color:          hsla(var(--md-hue), 15%, 5%, 1);
  --md-default-bg-color--light:   hsla(var(--md-hue), 15%, 5%, 0.54);
  --md-default-bg-color--lighter: hsla(var(--md-hue), 15%, 5%, 0.26);
  --md-default-bg-color--lightest: hsla(var(--md-hue), 15%, 5%, 0.07);

  --md-code-bg-color:          hsla(var(--md-hue), 20%, 10%, 1);
  --md-code-bg-color--light:   hsla(var(--md-hue), 20%, 10%, 0.9);
  --md-code-bg-color--lighter: hsla(var(--md-hue), 20%, 10%, 0.54);
}

.md-header {
  background-color: #000;
}

/* The thin divider on the secondary (right-hand TOC) nav rail is the one
 * place Material paints with --md-primary-fg-color outside a hardcoded-black
 * surface — it sits on the scheme's own default page background. Since
 * primary-fg-color no longer inverts for dark mode (see above), give it its
 * own scheme-aware color instead of leaving a black-on-dark hairline. */
.md-nav--secondary {
  border-color: var(--md-default-fg-color--lighter);
}

/* The header, footer and footer meta bar are solid black in *both* colour
 * schemes (see .md-header above and --md-footer-bg-color), but the base
 * accent only inverts to its dark-appropriate shade for dark scheme. Without
 * this, light-mode focus rings (.md-header__button), the repo-link hover
 * (.md-source) and footer link hover all use the light-scheme accent (tuned
 * for a white background) on a black surface, which is unreadably dark. Use
 * the dark-scheme shade unconditionally here — this surface is black either
 * way, regardless of the page's own colour scheme. */
.md-header,
.md-footer,
.md-footer-meta {
  --md-accent-fg-color: oklch(72% 0.18 155);
}

/* The site title is wrapped in a link by custom_theme/main.html so it leads
 * home like the logo beside it. It shouldn't look inert, but shouldn't read
 * as a body-copy link either — inherit the header's colour and only signal
 * on hover. */
.md-header__title-link {
  color: inherit;
  text-decoration: none;
}

.md-header__title-link:hover,
.md-header__title-link:focus-visible {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: .2rem;
}

/* ---------------------------------------------------------------------------
 * Icons.
 *
 * Swaps Material's filled icon set for Zensical's `modern` theme's outline
 * (Lucide) icon set, extracted from its compiled CSS. Values pulled only
 * where modern actually differs from Material's default — icons it left
 * unchanged (e.g. the Font-Awesome version-tag icon) aren't listed here.
 * ------------------------------------------------------------------------ */
:root {
  --md-admonition-icon--abstract: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><path d="M2 6h4m-4 4h4m-4 4h4m-4 4h4"/><rect width="16" height="20" x="4" y="2" rx="2"/><path d="M9.5 8h5m-5 4H16m-6.5 4H14"/></svg>');
  --md-admonition-icon--bug: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><path d="M12 20v-9m2-4a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4zm.12-3.12L16 2"/><path d="M21 21a4 4 0 0 0-3.81-4M21 5a4 4 0 0 1-3.55 3.97M22 13h-4M3 21a4 4 0 0 1 3.81-4M3 5a4 4 0 0 0 3.55 3.97M6 13H2M8 2l1.88 1.88M9 7.13V6a3 3 0 1 1 6 0v1.13"/></svg>');
  --md-admonition-icon--danger: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><path d="M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"/></svg>');
  --md-admonition-icon--example: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><path d="M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2M6.453 15h11.094M8.5 2h7"/></svg>');
  --md-admonition-icon--failure: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><path d="M12 16h.01M12 8v4m3.312-10a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z"/></svg>');
  --md-admonition-icon--info: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4m0-4h.01"/></svg>');
  --md-admonition-icon--note: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><path d="m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551"/></svg>');
  --md-admonition-icon--question: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3m.08 4h.01"/></svg>');
  --md-admonition-icon--quote: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><path d="M14 14a2 2 0 0 0 2-2V8h-2"/><path d="M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"/><path d="M8 14a2 2 0 0 0 2-2V8H8"/></svg>');
  --md-admonition-icon--success: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><path d="M20 6 9 17l-5-5"/></svg>');
  --md-admonition-icon--tip: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><path d="M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4"/></svg>');
  --md-admonition-icon--warning: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3M12 9v4m0 4h.01"/></svg>');
  --md-clipboard-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><rect width="8" height="4" x="8" y="2" rx="1" ry="1"/><path d="M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2M16 4h2a2 2 0 0 1 2 2v4m1 4H11"/><path d="m15 10-4 4 4 4"/></svg>');
  --md-code-copy-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><rect width="8" height="4" x="8" y="2" rx="1" ry="1"/><path d="M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2M16 4h2a2 2 0 0 1 2 2v4m1 4H11"/><path d="m15 10-4 4 4 4"/></svg>');
  --md-code-select-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><path d="M3 7V5a2 2 0 0 1 2-2h2m10 0h2a2 2 0 0 1 2 2v2m0 10v2a2 2 0 0 1-2 2h-2M7 21H5a2 2 0 0 1-2-2v-2"/></svg>');
  --md-details-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><path d="m9 18 6-6-6-6"/></svg>');
  --md-footnotes-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><path d="M5 3h14m-1 10-6-6-6 6m6-6v14"/></svg>');
  --md-nav-icon--next: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><path d="m9 18 6-6-6-6"/></svg>');
  /* Material has no --prev counterpart to override for nav — the toggle just
   * rotates --next — but the tabbed/details prev icon and this one otherwise
   * mismatch the new outline style. Hand-authored to match --next's chevron. */
  --md-nav-icon--prev: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><path d="m15 18-6-6 6-6"/></svg>');
  --md-path-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><path d="m9 18 6-6-6-6"/></svg>');
  --md-search-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><path d="m21 21-4.34-4.34"/><circle cx="11" cy="11" r="8"/></svg>');
  --md-source-forks-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><circle cx="12" cy="18" r="3"/><circle cx="6" cy="6" r="3"/><circle cx="18" cy="6" r="3"/><path d="M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9m6 3v3"/></svg>');
  --md-source-repositories-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20"/></svg>');
  --md-source-stars-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><path d="M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.12 2.12 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.12 2.12 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.12 2.12 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.12 2.12 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.12 2.12 0 0 0 1.597-1.16z"/></svg>');
  --md-source-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><path d="M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z"/><circle cx="7.5" cy="7.5" r=".5" fill="currentColor"/></svg>');
  --md-tasklist-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/></svg>');
  --md-tasklist-icon--checked: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><path d="M21.801 10A10 10 0 1 1 17 3.335"/><path d="m9 11 3 3L22 4"/></svg>');
  --md-toc-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><path d="M21 5H3m12 7H3m14 7H3"/></svg>');
  --md-typeset-table-sort-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><path d="m3 16 4 4 4-4m-4 4V4m14 4-4-4-4 4m4-4v16"/></svg>');
  --md-typeset-table-sort-icon--asc: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><path d="m3 16 4 4 4-4m-4 4V4m4 0h4m-4 4h7m-7 4h10"/></svg>');
  --md-typeset-table-sort-icon--desc: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24"><path d="m3 8 4-4 4 4M7 4v16m4-8h4m-4 4h7m-7 4h10"/></svg>');
}

/* ---------------------------------------------------------------------------
 * Typography.
 *
 * This is the single biggest visual signal separating `modern` from
 * Material's default: classic renders h1 in a lighter grey and h2/h3 at a
 * light font-weight (300/400) — an editorial, understated look. `modern`
 * renders every heading at full-strength foreground colour and bold (700),
 * which reads as a much punchier, more contemporary design even though the
 * actual font sizes barely change. Values pulled from modern's compiled CSS.
 * ------------------------------------------------------------------------ */
.md-typeset {
  font-size: .75rem;
  letter-spacing: -.01em;
  line-height: 1.8;
}

.md-typeset h1,
.md-typeset h2 {
  font-weight: var(--kai-heading-weight);

  /* ⚠ STILL THE BOLD-ERA VALUE. Tight tracking is how you stop heavy display
   * type from closing up; at 500 it is doing that job to type that no longer
   * needs it, and these two may now read cramped. Left alone deliberately so
   * the weight change can be judged on its own -- -0.015em is the obvious
   * thing to try next. */
  letter-spacing: -.025em;
}

.md-typeset h1 {
  color: var(--md-default-fg-color);
  font-size: 1.875em;

  /* Material ships the h1 with `margin: 0 0 1.25em` against the h2's 0.64em,
   * and because adjacent margins collapse to the larger of the two, that is
   * the gap you actually get:
   *
   *              own margin-bottom     gap after collapse     in its own em
   *   h1         38.67px (1.25em)      38.67px                1.25
   *   h2         15.84px (0.64em)      16.50px                0.67
   *
   * 2.3x the absolute space and 1.9x the proportional space, and the 22.2px
   * of excess is about three quarters of a body line -- which is why it reads
   * as a stray carriage return under the title. John saw it as one and asked
   * whether the page template had one; it does not, there is nothing between
   * the h1 and the first paragraph at all.
   *
   * 0.64em is the h2's own figure, so the two are now proportionally equal,
   * and the h1 still gets slightly more absolute air (19.8px against 16.5px)
   * purely because it is bigger type. That is the right relationship: the
   * space scales with the thing it follows. 0.8em if this reads too tight. */
  margin-bottom: 0.64em;

  /* OPTICAL ALIGNMENT. Every glyph carries built-in whitespace to its left --
   * its left side bearing -- and in Overpass that is about 0.055em, so it
   * SCALES WITH THE TYPE. Measured by supersampled canvas scan at 10x:
   *
   *   body copy   16.5px/400   A, T      0.8px
   *   h1          30.9px/700   Q         1.7px
   *   h1          30.9px/700   D, I      2.5px
   *   page title  30px/500     Q         1.9px
   *
   * So an h1 whose BOX is aligned to the body copy to a hundredth of a pixel
   * still reads as indented by about a pixel, which is what John saw on
   * 2026-11-03. Pulling it back by the difference aligns the ink instead.
   *
   * ⚠ THE BEARING DEPENDS ON THE WEIGHT, AND NOT THE WAY YOU WOULD GUESS --
   * LIGHTER CARRIES MORE OF IT, because a thinner stem leaves more room
   * inside the same advance. Measured per em, Q: 400 -> 0.068, 500 -> 0.064,
   * 600 -> 0.060, 700 -> 0.055. So lightening the headings to 500 WIDENED the
   * gap this corrects, from 0.90px to about 1.18px, and the value moved from
   * 0.026em to 0.038em with it. One value still serves both the h1 and the
   * page title: 0.0381em and 0.0373em respectively, at the same weight now.
   *
   * ⚠ APPROXIMATE BY NATURE, and it cannot be otherwise. The bearing is a
   * property of the FIRST LETTER, so the residual runs from about 0.1px on a
   * title starting with Q to about 0.9px on one starting with D or I. CSS
   * cannot see which letter is first. This is the standard trade and it is
   * why the value is round rather than fitted to one page.
   *
   * text-indent rather than margin-left on purpose: it moves the first line
   * only, which is the line being aligned, and leaves the measure alone. */
  text-indent: var(--kai-optical-indent);
}

.md-typeset h2 {
  font-size: 1.5em;
}

.md-typeset h3 {
  font-weight: var(--kai-heading-weight);
}

/* Light scheme keeps the standard alpha-based --md-default-fg-color on
 * headings (rgba(0,0,0,.87) — same as body text). Dark scheme does not: this
 * exact rule (selector and all) is what the Zensical reference actually
 * serves for slate — confirmed via Chrome DevTools Protocol matched-styles,
 * since it isn't present in its own checked-in extra.css and appears to be
 * injected by its build for any site using a custom palette. Full white
 * headings, unlike the softer alpha-based body text, is a deliberate
 * dark-mode-only contrast bump. */
[data-md-color-scheme="slate"] .md-header__title,
[data-md-color-scheme="slate"] h1,
[data-md-color-scheme="slate"] h2,
[data-md-color-scheme="slate"] h3,
[data-md-color-scheme="slate"] h4,
[data-md-color-scheme="slate"] h5,
[data-md-color-scheme="slate"] h6 {
  color: hsla(var(--md-hue), 0%, 100%, 1);
}

/* `modern` underlines body links unconditionally; classic relies on colour
 * alone (invisible here, since accent is black/white — indistinguishable
 * from body text without it). */
.md-typeset a {
  text-decoration: underline;
}

/* MAP ADAPTATION: content tabs (pymdownx.tabbed, alternate style) wrap each
 * tab label in an <a> for linkable tabs, so the rule above underlined them.
 * They are controls, not body links; the active-tab bar marks them already.
 * The k0rdent content has no tabs, which is why it never showed there. */
.md-typeset .tabbed-labels > label > a {
  text-decoration: none;
}

.md-header__title {
  letter-spacing: -.025em;
}

/* ---------------------------------------------------------------------------
 * Border radius.
 *
 * The `modern` skin uses a noticeably bigger radius scale (0.4rem baseline)
 * than Material's default (0.1rem-0.2rem). Bumping it per-component since
 * there's no single variable that controls it.
 * ------------------------------------------------------------------------ */
@media screen and (min-width: 45em) {
  .md-search__button {
    border-radius: .4rem;
  }
}

.md-typeset code {
  border-radius: .2rem;
  padding: .2em .4em;
}

.md-typeset pre {
  line-height: 1.5;
}

.md-typeset pre > code {
  border-radius: .4rem;
}

/* `modern` renders .md-button as a filled pill instead of Material's
 * outlined rectangle. */
.md-typeset .md-button {
  background-color: var(--md-default-fg-color--lightest);
  border: none;
  border-radius: 1.2rem;
  color: var(--md-default-fg-color--light);
}

.md-typeset .md-button--primary {
  background-color: var(--md-primary-fg-color);
  color: var(--md-primary-bg-color);
}

.md-typeset .md-button--primary:focus,
.md-typeset .md-button--primary:hover {
  color: var(--md-primary-bg-color);
  opacity: .8;
}

/* ---------------------------------------------------------------------------
 * Sidebar: nav links as pills.
 *
 * Classic renders nav items as a plain text list — vertical margin between
 * items, no padding or background, colour-only hover. `modern` renders every
 * item as a rounded, padded "pill" that gets a filled background on hover —
 * a much bigger part of the sidebar's visual identity than the accent colour
 * is. margin-top: 0 is required, not decorative — it replaces classic's
 * vertical-rhythm model (margin-based) with modern's (padding-based); without
 * it you get both stacked.
 * ------------------------------------------------------------------------ */
.md-nav__link {
  border-radius: .4rem;
  margin-left: .2rem;
  margin-right: .2rem;
  margin-top: 0;
  /* modern uses .8rem horizontal padding; tightened to .5rem here because this
   * nav has labels longer than Zensical's own demo content ever hits
   * ("k0rdent Observability & FinOps") — at .8rem they wrap inside the
   * narrowed pill instead of merely sitting in a denser row. */
  padding: .35rem .5rem;
  transition: color .25s, background-color .25s;
}

/* Classic bumps the primary sidebar specifically to .8rem (from .md-nav's own
 * .7rem base) to compensate for its zero-padding, zero-radius links. `modern`
 * has no such bump — it stays at .7rem, sized for the padded pill above. Left
 * at .8rem, longer labels ("Administrator Guide", "Frequently Asked
 * Questions") wrap inside the pill's narrower text area and the sidebar looks
 * cramped instead of merely denser. */
.md-nav--primary .md-nav__item,
.md-nav--primary .md-nav__title {
  font-size: .7rem;
  line-height: 1.3;
}

.md-nav__link--active {
  font-weight: 500;
}

.md-nav--primary .md-nav__link[for]:focus:not(.md-nav__link--active),
.md-nav--primary .md-nav__link[for]:hover:not(.md-nav__link--active),
.md-nav--primary .md-nav__link[href]:focus:not(.md-nav__link--active),
.md-nav--primary .md-nav__link[href]:hover:not(.md-nav__link--active) {
  background-color: var(--md-default-fg-color--lightest);
  color: var(--md-default-fg-color);
}

/* Material gives the expand chevron (.md-nav__icon) its own circular
 * border-radius: 100% and its own independent :hover background, so a nav
 * item with children rendered as one pill (text + chevron on hover above) and
 * a second, separate round highlight on the chevron itself — two shapes
 * instead of one oval. Neutralize the icon's own hover so only the label's
 * pill background shows. */
.md-nav__link .md-nav__icon {
  border-radius: 0;
}

.md-nav__link .md-nav__icon:hover {
  background-color: transparent;
}

/* ---------------------------------------------------------------------------
 * Sidebar: section-index rows.
 *
 * A section with an index page (navigation.indexes, e.g. "Overview" pages
 * throughout this nav) is a .md-nav__container holding two targets — an <a>
 * to the index page and a <label> that expands the section. Material gives
 * them a .2rem gap and each its own rounded hover background, so the row
 * reads as two separate buttons. Close the gap, square the meeting edges, and
 * drive both backgrounds from the container so the row highlights as a unit
 * without collapsing the two hit targets, which do different things.
 * ------------------------------------------------------------------------ */
.md-nav__container {
  gap: 0;
}

/* `gap: 0` above only closes the flex gap between the container's two
 * children — it doesn't touch their own margins. Both the <a> and <label>
 * still carry the generic .md-nav__link rule's margin-left/margin-right:
 * .2rem (confirmed via computed styles: each sat with a 4px margin, an 8px
 * gap total between them, independent of gap). That's what actually rendered
 * as two separate pills with daylight between them. The container itself
 * keeps its own margin (for spacing against the sidebar edge / neighbouring
 * rows) — only its direct children need zeroing. */
.md-nav__container > .md-nav__link {
  margin-left: 0;
  margin-right: 0;
}

/* The wrapper carries class="md-nav__link md-nav__container" (Material's own
 * markup — nav-item.html), so it also matches the generic .md-nav__link rule
 * above and picks up padding + border-radius that only its two children (the
 * <a> and <label>) should have. That put a second padded, rounded box around
 * the pair — the actual pill (each child's own background) sat inset inside a
 * bigger invisible one, reading as two shapes floating apart instead of one
 * continuous oval. The wrapper itself should have no box of its own.
 *
 * Compound selector, not `.md-nav__container` alone: at the top level the
 * wrapper also sits inside `.md-nav--primary`, and Material's own
 * `.md-nav--primary .md-nav__link { padding: .6rem .8rem }` is two classes —
 * higher specificity than a single `.md-nav__container` class, so it was
 * winning back the padding my first attempt zeroed out. This selector matches
 * the exact same single element (both classes, same node) but is also two
 * classes, so it ties on specificity and wins on being declared later. */
.md-nav__link.md-nav__container {
  padding: 0;
  border-radius: 0;
}

[dir="ltr"] .md-nav__container > :first-child {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

[dir="ltr"] .md-nav__container > :nth-child(2) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

[dir="rtl"] .md-nav__container > :first-child {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

[dir="rtl"] .md-nav__container > :nth-child(2) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.md-nav--primary .md-nav__container:hover > .md-nav__link:not(.md-nav__link--active) {
  background-color: var(--md-default-fg-color--lightest);
  color: var(--md-default-fg-color);
}

/* Tint a section's own header whenever you are anywhere inside it — not only
 * when its index page is the exact current page. `.md-nav__item--active` is
 * Material's "this branch contains the current page" marker, a superset of
 * "this IS the current page", so one rule covers both a section with an index
 * page (a container's two hit targets) and a bare toggle with none (a single
 * label). */
.md-nav--primary .md-nav__item--active > .md-nav__link,
.md-nav--primary .md-nav__item--active > .md-nav__container > .md-nav__link {
  background: var(--md-accent-fg-color--transparent);
  color: var(--md-accent-fg-color);
}

.md-version__list {
  overflow: auto;
}

ul.video-list {
  counter-reset: section;
  list-style: none;
  padding-left: 0;
  position:relative
}

ul.video-list .video:not(:last-of-type) a {
  border-bottom:2px solid #e6e6e6
}

ul.video-list a {
  position: relative;
  padding: 2rem 2rem 2rem 4.2rem;
  display: block;
  box-sizing:border-box
}

ul.video-list a .info {
  padding-top:0.25rem
}

ul.video-list a .info::before {
  counter-increment: section;
  content: counter(section);
  position: absolute;
  left: 1.5rem;
  color:black
}

ul.video-list a .info > p, ul.video-list a .info > span {
  color:black
}

ul.video-list a .info .title {
  margin-top: 0;
  margin-bottom:0.7rem
}

ul.video-list a .info .description {
  margin-bottom: 1rem;

}

ul.video-list a .info .duration, ul.video-list a .info .duration span {
  color: #6e6e6e;
 
}

ul.video-list a:hover, ul.video-list a:focus {
  text-decoration:none
}

ul.video-list a:hover {
  background:#f2f2f2
}

ul.video-list a:hover::after {
  content: '';
  display: block;
  width: 6rem;
  height: 6rem;
  position: absolute;
  background: url("/img/play.svg");
  background-size: 6rem;
  top: 3rem;
  left:8.6rem
}

/* ---------------------------------------------------------------------------
 * Search: collapsed "Search ⌘K" pill + centered floating panel.
 *
 * Material's search is a full-width takeover: the input bar spans the header
 * width and results drop down beneath it edge-to-edge. Zensical's `modern`
 * renders search as a small pill button in the header ("Search" + a keyboard
 * hint) that opens a centered, rounded, floating card near the top of the
 * viewport. This keeps Material's actual search — index, worker, lunr, the
 * results markup — entirely as-is; only the trigger button and the open
 * panel's position/shape change.
 *
 * The trigger's "Search" text and the ⌘K chip are injected by JS (see
 * custom_theme/main.html's scripts block) — the label Material renders here
 * is icon-only with no text node to style via CSS alone.
 * ------------------------------------------------------------------------ */

/* Above 60em Material drops the checkbox-toggle pattern entirely: it hides
 * the icon-button trigger and instead renders .md-search__inner inline in
 * the header, always expanded, no click needed. That's a second, redundant
 * search entry point next to the pill above once this button is forced
 * visible at all widths (confirmed via computed styles: at 1400px .md-search
 * __inner sat at position:relative, width:234px, fully visible with no
 * [data-md-toggle=search]:checked in sight). Zensical's collapsed-pill
 * pattern doesn't have a wide-viewport inline mode at all, so force Material
 * back into its own narrow-viewport collapsed/toggle-driven behaviour
 * unconditionally. !important because this is overriding a whole responsive
 * breakpoint's worth of rules wholesale, not fighting normal cascade. */
@media screen and (min-width: 60em) {
  .md-search__inner {
    float: none !important;
    height: 0 !important;
    left: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    position: fixed !important;
    right: auto !important;
    top: 0 !important;
    width: 0 !important;
  }

  /* Material's wide-viewport inline mode positions this via `right:0` (it
   * floats the search bar to the right of the header). Forcing `position:
   * fixed` above without also pinning `left`/`right` explicitly left that
   * inherited `right:0` in charge — confirmed via computed styles: `left`
   * resolved to 1044px on a 1400px viewport instead of 0, pushing the whole
   * panel off-screen to the right once width:100% applied on open. */
  [data-md-toggle="search"]:checked ~ .md-header .md-search__inner {
    height: 100% !important;
    left: 0 !important;
    opacity: 1 !important;
    width: 100% !important;
  }
}

/* The overlay (.md-search__overlay, the dimmed/blurred backdrop) has an
 * explicit z-index:1. .md-search__inner — the card's actual container —
 * computes to z-index:auto in this open state, which stacks it BELOW a
 * positioned sibling with z-index:1, not above. So the overlay's 54%-black
 * tint and its blur were painting directly over the card's own content, not
 * just the page behind it — confirmed via computed styles (backdrop-filter:
 * blur(1px) and backgroundColor: rgba(0,0,0,.54) both present on the
 * overlay, .md-search__inner's own z-index reading "auto"). Not scoped to
 * the >=60em block above: the same z-index:auto vs :1 mismatch applies at
 * any width. */
[data-md-toggle="search"]:checked ~ .md-header .md-search__inner {
  z-index: 2;
}

/* Raising .md-search__inner above the overlay (above) had a side effect:
 * .md-search__inner is itself a full-viewport box (width/height:100% a few
 * rules up) — only its children are visually constrained to the centered
 * card. Now that it's stacked on top, that invisible full-size box also
 * intercepts clicks on what looks like open backdrop, before they can reach
 * .md-search__overlay underneath — the actual click-to-close target.
 * Confirmed: clicking outside the card left #__search checked. Make the
 * container click-through except where the card itself actually is. */
[data-md-toggle="search"]:checked ~ .md-header .md-search__inner {
  pointer-events: none;
}

[data-md-toggle="search"]:checked ~ .md-header .md-search__form,
[data-md-toggle="search"]:checked ~ .md-header .md-search__output {
  pointer-events: auto;
}

.md-header__button[for="__search"] {
  align-items: center;
  background-color: var(--md-default-bg-color--light);
  border: 1px solid transparent;
  border-radius: .4rem;
  color: var(--md-default-fg-color--light);
  display: flex;
  gap: .5rem;
  height: 1.6rem;
  padding: 0 .5rem;
  transition: background-color .25s, border-color .25s;
  width: auto;
}

.md-header__button[for="__search"]:hover {
  background-color: var(--md-default-bg-color--lighter);
  color: var(--md-default-fg-color);
}

.md-header__button[for="__search"] .md-search__label {
  font-size: .65rem;
  white-space: nowrap;
}

.md-header__button[for="__search"] .md-search__shortcut {
  background-color: var(--md-default-fg-color--lightest);
  border-radius: .2rem;
  font-size: .55rem;
  line-height: 1.1rem;
  padding: 0 .3rem;
}

/* The label's own SVG search icon, injected by Material — size it down to
 * match the smaller pill instead of the full 1.2rem header-button default. */
.md-header__button[for="__search"] .md-icon svg {
  height: .75rem;
  width: .75rem;
}

/* Centered floating card instead of a full-bleed takeover. `.md-search__inner`
 * stays full-viewport (it's the fixed-position layer the backdrop click lands
 * on); the card shape comes from constraining `__form` and `__output` — the
 * two pieces that actually paint a background — to the same centered
 * max-width column, same technique as the nav's section-index-row fix: two
 * adjacent boxes read as one only if their edges and radii line up exactly. */
[data-md-toggle="search"]:checked ~ .md-header .md-search__form {
  background-color: var(--md-code-bg-color);
  border-radius: .8rem .8rem 0 0;
  box-shadow: var(--md-shadow-z3);
  margin: 4rem auto 0;
  max-width: 40rem;
}

[data-md-toggle="search"]:checked ~ .md-header .md-search__output {
  background-color: var(--md-code-bg-color);
  border-radius: 0 0 .8rem .8rem;
  left: 50%;
  max-width: 40rem;
  top: 6.4rem;
  transform: translateX(-50%);
  width: calc(100% - 2rem);
}

/* `--md-code-bg-color` is a fixed dark shade (docs/stylesheets/extra.css's
 * own slate block above) — appropriate contrast against the dark backdrop in
 * slate, but wrong direction in light mode, where it would be a code block's
 * usual pale grey against an already-white page: still technically visible,
 * but not the deliberate elevation Zensical's white-on-dimmed-backdrop card
 * has. Give light mode its own lift off white instead of reusing the dark
 * scheme's token. */
[data-md-color-scheme="default"] [data-md-toggle="search"]:checked ~ .md-header .md-search__form,
[data-md-color-scheme="default"] [data-md-toggle="search"]:checked ~ .md-header .md-search__output {
  background-color: var(--md-default-bg-color);
  box-shadow: var(--md-shadow-z3), 0 0 0 1px var(--md-default-fg-color--lightest);
}

/* Darken/blur the backdrop behind the card, closer to Zensical's modern
 * overlay than Material's flat 54%-black default. */
[data-md-toggle="search"]:checked ~ .md-header .md-search__overlay {
  backdrop-filter: blur(1px);
}

ul.video-list .thumb {
  max-height: 8.2rem;
  padding-right: 2rem;
  position: relative;
  float:left
}

/* ---------------------------------------------------------------------------
 * Header, from Figma "k0rdent-ai-docs-header-dark-v2" (file
 * OnABAf9UtqyWbChqRX7Xol, node 39:50). Look and feel only: search and the
 * version switcher are still Material's (and mike's) own controls. Measurements
 * are the frame's, in px so they can be checked against it directly.
 *
 *   76px bar, 60px side margins · Mirantis wordmark | 12px · 1px #8E94A5
 *   divider, 40px tall · 12px | k0rdent AI logo · 16px · DOCUMENTATION,
 *   Overpass 14/24 #C3C8DB · 37px · version, Overpass 16/24 white, 8px to caret
 *
 * One deliberate departure: the frame sits the k0rdent logo ~4px above the
 * other items' centre line. Here everything is centred on one line.
 * ------------------------------------------------------------------------ */
.md-header__inner {
  max-width: none;
  height: var(--kai-header-height);
  padding: 0 60px;
}

/* Material forces logo images to 1.2rem tall; the lockup rule below sets
 * the real height. */
.md-header__button.md-logo img.kai-logo {
  width: auto;
  height: auto;
}

/* ---- The header lockup, rev 2026-11-06 (MAP brand lockup) --------------
 * The lockup is ONE IMAGE from brand: mirantis-agent-platform-lockup-inverted
 * .svg (Mirantis mark, MIRANTIS, divider, AGENT PLATFORM). It replaced the
 * k0rdent-era three-piece build (wordmark image + CSS divider + product name
 * in text). The word DOCUMENTATION follows it, and the two share a baseline.
 *
 * ⚙ THE ONE KNOB IS --kai-lockup-size BELOW. Nothing else needs touching to
 * make the whole lockup bigger or smaller.
 *
 * MATCHED TO THE k0rdent AI DOCS HEADER, as it stands in
 * k0rdent-AI-docs-staging-mkdocs-private, so every docs site shares one set
 * of header metrics whatever its product name: the same knob values (30 / 22
 * / 17px), the same bar, and MIRANTIS at the same size -- its caps exactly as
 * tall as the caps of DOCUMENTATION, on DOCUMENTATION's baseline, which is
 * how the k0rdent header sets its Mirantis wordmark. The product name is
 * whatever size the brand lockup draws it beside MIRANTIS.
 *
 * So the graphic follows the text, through the cap unit (the browser reading
 * Overpass's own metrics, 0.70em): the image is sized so that MIRANTIS's
 * caps come out exactly 1cap tall.
 *
 * MEASURED from the SVG's path geometry (svgelements), box 1049 x 121:
 *
 *   MIRANTIS caps .................. y 32.851 -> 87.581   (cap 54.730)
 *   AGENT PLATFORM caps ............ y 42.112 -> 77.588   (cap 35.476)
 *   divider ........................ y 0      -> 120.84   (the full box)
 *   box / MIRANTIS cap ............. 121 / 54.730 = 2.21085
 *   above the MIRANTIS baseline .... 87.581 / 54.730 = 1.60024 cap
 *   below the MIRANTIS baseline .... 33.419 / 54.730 = 0.61062 cap
 * ---------------------------------------------------------------------- */
:root {
  /* ⚙ THE KNOB. This is the font-size of DOCUMENTATION; the cap height it
   * yields (0.70 of it, in Overpass) is what MIRANTIS in the lockup is
   * matched to. 30px, the k0rdent AI docs value: keep the two in step. */
  --kai-lockup-size: 30px;

  --kai-header-height: 76px;

  /* How far the shared baseline sits above the bottom of the header bar. This
   * is what makes one baseline possible at all: the logo and the title are
   * SIBLING flex items in Material's header, not one container, so they cannot
   * be aligned to each other directly. Both are instead measured from the same
   * edge -- the bottom of the bar -- and each is pushed down by its own slack
   * below the baseline.
   *
   * DERIVED, not chosen, so the lockup stays optically centred at every size.
   * Solving top-clearance = bottom-clearance:
   *
   *   gap = (barHeight - aboveBaseline + belowBaseline) / 2
   *
   * The tallest item is the lockup image: 1.60024cap above the baseline and
   * 0.61062cap below. gap = barHeight/2 - (1.60024 - 0.61062)/2 cap
   * = barHeight/2 - 0.49481cap, and Overpass's cap is 0.70 of the font size,
   * hence 0.34637.
   *
   * ⚠ Uses the KNOB and not the cap unit on purpose: `cap` resolves against
   * the element it is written on, and this figure has to come out identical
   * on two SIBLING containers -- the logo button and the title. */
  --kai-baseline-gap: calc(
    var(--kai-header-height) / 2 - var(--kai-lockup-size) * 0.34637
  );

  /* ⚙ HEADING WEIGHT for h1-h3, matched to the word DOCUMENTATION in the bar.
   * Was 700 until 2026-11-03.
   *
   * ⚠ IT STOPS AT h3, and that is not an oversight. Stem widths measured off
   * a canvas at each heading's own real size:
   *
   *            size      400     500     600     700
   *   h1     30.9px     2.7     3.1     3.6     4.0
   *   h2     24.8px     2.2     2.5     2.8     3.3
   *   h3     20.6px     1.8     2.1     2.4     2.7
   *   h4     16.5px     1.5     1.7     2.0     2.1
   *   h5     13.2px     1.2     1.4     1.5     1.7
   *   body   16.5px     1.5
   *
   * h1-h3 are bigger than the body copy, so SIZE carries the hierarchy and
   * the weight is only colour -- lighten it and nothing is lost. h4 is 16.5px,
   * exactly body size, so weight is the ONLY signal it has: at 700 its stems
   * are 2.1px against the body's 1.5px, and at 500 they would be 1.7px, a
   * 0.2px difference that antialiasing eats. h6 is worse, being smaller than
   * the body copy. h5 at least keeps its capitals.
   *
   * So h4-h6 stay where Material left them. 600 is available if they should
   * be lighter without going flat. */
  --kai-heading-weight: 500;

  /* ⚙ Optical alignment for type noticeably larger than the body copy. See
   * the measurements on .md-typeset h1. Applied to the h1 and to the scrolled
   * page title, which sit at 30.9px and 30px against the body's 16.5px. Not
   * applied to h2 and below: at 24.8px the same arithmetic gives 0.46px,
   * which is under the threshold where correcting is worth the risk of
   * over-correcting. */
  --kai-optical-indent: -0.038em;

  /* ⚙ Where the scrolled page title starts, measured from the LEFT EDGE OF
   * THE BAR -- which is why the page title is re-anchored to .md-header at the
   * desktop breakpoint below instead of to its own box.
   *
   * This is the left edge of the body column, and it is exact:
   *
   *   bodyLeft = (clientWidth - 61rem) / 2 + 12.1rem + 1.2rem
   *            = 50% - 30.5rem + 13.3rem
   *            = 50% - 17.2rem
   *
   *   61rem    .md-grid's max-width -- the page column, centred
   *   12.1rem  .md-sidebar's width -- the nav
   *   1.2rem   the gutter between the nav and the body copy
   *
   * Three numbers, all of them Material's own grid, all in rem. NOTHING about
   * the header is in it: not the lockup, not the search pill, not the bar's
   * padding. That is the point. Verified at 326.00px / 574.08px against the
   * measured body column at two different root font sizes, exactly.
   *
   * ⚠ THE FIRST ATTEMPT CHAINED THROUGH THE HEADER and was 25.6px out on a
   * wide screen. It derived the offset from .md-header__ellipsis's own width,
   * which meant subtracting the lockup on the left and the search pill on the
   * right -- and MATERIAL STEPS ITS ROOT FONT FROM 20px TO 22px AT 100em
   * (1600px), and again at 125em. The pill is sized in rem, so it grew, and
   * the title moved right with it. Two measurements taken either side of that
   * step would have caught it; both of mine were below it.
   *
   * The lesson generalises past this rule: ALIGN TO THE THING, NOT TO A CHAIN
   * OF WIDTHS THAT HAPPENS TO END AT IT. */
  --kai-title-indent: calc(50% - 17.2rem);

  /* The floor: never left of where DOCUMENTATION starts, or the title lands on
   * top of the logo. 60px bar padding + 16px title margin, plus the lockup's
   * width, which is a fixed multiple of the knob: 2.21085cap tall x 0.70 x
   * (1049/121) = 13.4167 knobs. */
  --kai-title-indent-floor: calc(76px + var(--kai-lockup-size) * 13.4167);
}

/* Shared type context for the lockup and the label. `cap` resolves against the
 * element's OWN font-family, not merely its size, so naming the family is
 * load-bearing even on the image: leaving it to inherit silently produced
 * ratio 0.654 instead of 0.70. Set here rather than on .md-header__inner on
 * purpose -- font-size inherits, and putting it on the inner would blow up
 * the search button, the version selector and the nav along with the lockup. */
.md-header__button.md-logo img.kai-logo,
.md-header__topic:first-child {
  font-family: var(--md-text-font-family);
  font-size: var(--kai-lockup-size);
}

/* Bottom-aligned, then pushed down by its own below-baseline slack. The
 * padding is what positions the shared baseline. */
.md-header__button.md-logo {
  display: flex;
  height: 100%;
  margin: 0;
  padding: 0 0 var(--kai-baseline-gap);
  align-items: flex-end;
}

/* MIRANTIS's caps come out 1cap tall, and its baseline lands on the shared
 * line: the box bottom sits on the line (flex-end), then moves down by the
 * 0.61062cap of artwork that hangs below that baseline. width:auto keeps the
 * aspect ratio. */
.md-header__button.md-logo img.kai-logo--lockup {
  height: calc(1cap * 2.21085);
  width: auto;
  transform: translateY(calc(1cap * 0.61062));
}

.md-header__title {
  height: 100%;
  letter-spacing: 0;

  /* A flex item will not shrink below its content's intrinsic width unless
   * min-width is cleared -- the default is `auto`, not 0. Without these two the
   * label simply overflows its box instead of being ellipsised, which is what
   * put DOCUMENTATION on top of the search pill at 390px. This is the general
   * guard; the media query below is what stops it being needed on a phone. */
  min-width: 0;
  overflow: hidden;
}

[dir=ltr] .md-header__title {
  margin-left: 16px;
}

.md-header__ellipsis {
  height: 100%;
  min-width: 0;
  overflow: hidden;
}

/* Same bottom edge and same padding as the logo container, which is the whole
 * mechanism for one baseline across two sibling containers. */
.md-header__topic {
  height: 100%;
  align-items: flex-end;
  padding-bottom: var(--kai-baseline-gap);
  line-height: 24px;
}

.md-header__topic:first-child {
  /* MEASURED, not chosen by eye. Stem width over cap height is 0.14632 for the
   * Mirantis wordmark -- exact, because its "I" is a plain <rect> in the SVG,
   * 1.82719 wide against a 12.4876 cap. Overpass measured off a canvas at a
   * 200px size: 400 is 0.12057 (17.6% light), 500 is 0.14184 (3.1% light),
   * 600 is 0.16312 (11.5% heavy), 700 is 0.18440 (26% heavy). 500 is the match.
   *
   * ⚠ 500 only exists because main.html asks for it. Material's own font
   * setting fetches 300/400/700, and a weight it does not hold is SNAPPED to
   * the nearest one it does, with no warning -- so before that link, this line
   * rendered identically to 400. */
  font-weight: 500;
  text-transform: uppercase;
  color: #fff;   /* both logo SVGs fill white; #c3c8db read as a weaker thing */
}

/* Centring a LINE BOX does not centre the CAPS, and here it is worse than
 * cosmetic: with text-box the box bottom IS the baseline, which is exactly
 * what lets the label share an edge with the two graphics. Overpass's ascent
 * and descent are asymmetric (0.983 / 0.283), so without this the label sat
 * 2.3px high at matched heights.
 *
 * On the inner span, not on .md-header__topic: that div is a flex container in
 * Material and holds the version selector beside this text.
 *
 * line-height must stay `normal`. A fixed line-height does not scale with the
 * font and the box rounds to device pixels, so the residual DRIFTS with size:
 * measured -1.90 / -2.30 / -2.39px at 14 / 18 / 24px. */
.md-header__topic:first-child .md-ellipsis {
  display: block;
  line-height: normal;
  text-box: trim-both cap alphabetic;
}

/* text-box is Chrome 133+ and Safari 18.2+. Firefox UNVERIFIED as of
 * 2026-11-02, so this is a fallback rather than an optional nicety. Without
 * text-box the box bottom is the descender, not the baseline, so the label is
 * nudged down by the descent it should not be carrying. */
@supports not (text-box: trim-both cap alphabetic) {
  .md-header__topic:first-child .md-ellipsis {
    position: relative;
    top: 0.0997em;
  }
}

/* ---- The scrolled page title ------------------------------------------
 * Scroll past the h1 and Material swaps DOCUMENTATION for the page's own
 * title. They are two absolutely positioned siblings inside
 * .md-header__ellipsis that cross-fade, the outgoing one sliding left and the
 * incoming one arriving from the right.
 *
 * ⚠ BOTH SLIDES ARE TRANSFORMS, so nothing in this block may set `transform`.
 * The offset below is `left`, which the animation does not touch. A transform
 * here would look right until the first scroll and then fight the cross-fade.
 *
 * Material ships the replacement at 18px/400 against the label's 30px/500, on
 * a different baseline -- so the bar changed shape as you scrolled, and the
 * title read as a caption rather than as the thing that replaced the word.
 * Same family, same size, same weight, same baseline mechanism.
 *
 * NOT uppercased, deliberately, and that is the one property of the four not
 * copied across. DOCUMENTATION is a fixed word and carries caps fine; a page
 * title is a sentence -- "Organizations, projects and quotas" -- where caps
 * cost real legibility as well as about a fifth more width. */
.md-header__topic + .md-header__topic {
  font-family: var(--md-text-font-family);
  font-size: var(--kai-lockup-size);
  font-weight: 500;   /* 500 exists only because main.html asks for it */
}

/* A flex item has to be allowed to shrink or text-overflow never fires -- the
 * same `min-width: auto` default that put DOCUMENTATION over the search pill. */
.md-header__topic + .md-header__topic .md-ellipsis {
  min-width: 0;
  display: block;
  line-height: normal;
  text-box: trim-both cap alphabetic;

  /* The same optical correction the h1 gets, for the same reason and in the
   * same em, so the title and the heading it mirrors stay together: they are
   * the same words at 30px and 30.9px, and measured 0.2px apart in bearing
   * before this. Safe against the overflow clip above -- it shifts left by
   * 0.78px into a bearing of 1.9px, so no ink is cut. */
  text-indent: var(--kai-optical-indent);

  /* MAP ADAPTATION: DESCENDERS WERE CLIPPED. The trim above makes the box
   * bottom the baseline, and .md-ellipsis clips overflow, so every g, p and y
   * lost its tail -- "Agent" read as "Aaent". Room for the descent is added
   * below and given back with the negative margin, so the box still ends on
   * the shared baseline and nothing moves. 0.3em covers Overpass's 0.283
   * descent. (DOCUMENTATION is all caps, which is why the k0rdent label never
   * showed it; a k0rdent page title with a descender would.) */
  padding-bottom: 0.3em;
  margin-bottom: -0.3em;
}

@supports not (text-box: trim-both cap alphabetic) {
  .md-header__topic + .md-header__topic .md-ellipsis {
    position: relative;
    top: 0.0997em;
  }
}

/* ---- Lining the page title up with the body copy ----------------------
 * Desktop only. Below this width the nav is in a drawer, there is no body
 * column out to the right to line up with, and the title stays where
 * Material puts it.
 *
 * Material positions both topics against .md-header__ellipsis, whose left
 * edge is wherever the lockup happens to end. Measuring a page-grid offset
 * from that box means adding back everything between the two, which is how
 * the first attempt came to depend on the search pill. So the page title is
 * re-anchored to .md-header -- already `position: sticky`, so already a
 * containing block, and its padding box is the full width of the bar. Its
 * 50% is then clientWidth/2, which is exactly what the grid centres on.
 *
 * The label goes `static` rather than being given a left of its own: it
 * wants the ellipsis's left edge, and in flow it gets it for free. The
 * cross-fade is unaffected -- it runs on opacity and transform, and the
 * z-index Material puts on the hidden one is belt-and-braces behind an
 * opacity of 0 and pointer-events: none. */
@media screen and (min-width: 76.25em) {
  /* ⚠ The child combinator is not decoration. Material ships this as
   * `.md-header__title > .md-header__ellipsis`, so a bare class loses the
   * specificity contest SILENTLY -- the declaration is simply ignored, the
   * page title keeps resolving against the ellipsis, and the only symptom is
   * that it lands in the wrong place. */
  .md-header__title > .md-header__ellipsis,
  .md-header__topic:first-child {
    position: static;
  }

  .md-header__topic + .md-header__topic {
    /* Both are REQUIRED once the label is back in flow: an absolutely
     * positioned box with `top: auto` falls to its static position, which is
     * now BELOW the label rather than on top of it. Height is stated rather
     * than inherited as 100%, so this does not quietly depend on .md-header
     * holding nothing but the bar. */
    top: 0;
    height: var(--kai-header-height);

    left: max(var(--kai-title-indent-floor), var(--kai-title-indent));

    /* ⚠ A BOUND, NOT ALIGNMENT, and it belongs ONLY here. Re-anchoring moves
     * the title out of .md-header__title's overflow, so the clip that used to
     * stop a long title short of the search pill is gone and this replaces
     * it. 9rem is deliberately a little more than the pill actually needs
     * (8.671rem measured): erring large truncates a very long title a few
     * pixels early, erring small puts it under the pill.
     *
     * It was briefly set on the base rule instead. With `left` still auto, a
     * right of 0 does not bound the box -- IT MOVES IT, shrink-to-fit against
     * the right edge, which right-aligned the page title at tablet width.
     * Below this breakpoint the title is bounded the way Material intends,
     * by max-width: 100% against the ellipsis, which is also what lets the
     * span truncate with an ellipsis rather than being clipped flat. */
    right: calc(60px + 9rem);
  }
}

/* ---- The lockup at narrow widths --------------------------------------
 * ⚠ THE HEADER OVERFLOWED ON A PHONE BEFORE ANY OF THIS, and scaling the
 * lockup up made it worse rather than causing it. Measured at a 390px
 * viewport: the lockup ran to 766px against a 375px bar, pushing the search
 * button off-screen and giving the whole PAGE a horizontal scrollbar.
 *
 * Breakpoints are Material's own, so the lockup steps down at the same widths
 * the drawer and the nav do rather than at a second set nobody can see.
 *
 * Only the knob and the gutter move. The baseline mechanism is untouched,
 * because it is expressed in cap units and therefore already scales. */

/* Tablet and below: the nav collapses into the drawer here. */
@media screen and (max-width: 76.1875em) {
  :root {
    --kai-lockup-size: 22px;   /* the gap follows automatically */
  }

  /* The drawer's menu button comes first, at the left edge, where readers
   * look for it. Material's markup puts it after the logo, which left it
   * stranded between the lockup and DOCUMENTATION once the lockup became
   * one wide image. */
  .md-header__inner > label.md-header__button[for="__drawer"] {
    order: -1;
    margin-left: 0;
  }

  .md-header__inner {
    padding: 0 24px;
  }
}

/* Phone. The lockup stays whole (it is one image) at the k0rdent phone knob,
 * and DOCUMENTATION goes (see below): 17px gives a 228px lockup, which fits a
 * 375px bar beside the menu and search buttons. */
@media screen and (max-width: 44.9375em) {
  :root {
    --kai-lockup-size: 17px;   /* the gap follows automatically */
  }

  .md-header__inner {
    padding: 0 12px;
  }

  [dir=ltr] .md-header__title {
    margin-left: 10px;
  }

  /* ⚠ AND THE SEARCH PILL'S TEXT COMES OUT, which is what actually makes room
   * for DOCUMENTATION. Measured at 390px: the pill is 158px of a 375px bar,
   * which squeezed the title box to 23px while the label inside it stayed
   * 139px -- so the word DOCUMENTATION ran straight across the pill. Dropping
   * the label and the shortcut chip returns ~117px, which is more than the
   * label needs.
   *
   * The chip is no loss here either: it advertises Ctrl/Cmd+K, and a phone has
   * no such key. The magnifier alone is the universally understood control. */
  .md-search__label,
  .md-search__shortcut {
    display: none;
  }

  /* There is no room for DOCUMENTATION beside the full lockup on a phone (it
   * truncated to "DOCUMENTATI" at 390px). The product name is the one that
   * tells a reader where they are, so the generic word goes.
   * Only the text span is hidden: the version selector shares its container
   * and stays. */
  .md-header__topic:first-child .md-ellipsis {
    display: none;
  }
}

.md-header__topic:first-child .md-version {
  margin-left: 37px;
  font-size: 16px;
  line-height: 24px;
  color: #fff;
  text-transform: none;
}

/* Material's own margins here are [dir]-scoped, so these must be too. */
[dir=ltr] .md-version__current {
  margin-left: 0;
}

.md-version {
  height: auto;
}

[dir=ltr] .md-version__current::after {
  margin-left: 8px;
}

