/* Venturi docs brand layer on top of Material for MkDocs. */

/* Token values track the Venturi editorial canon (the investor-faqs page):
   pure white canvas, slate ink, 1px hairline structure, measurement blue as the
   single actionable accent (teal stays reserved for live/measured signal, never
   decoration). System font stacks only — no webfonts (theme.font is false in
   mkdocs.yml). The site ships light-only: the palette toggle is removed in
   mkdocs.yml and html is pinned to color-scheme: light.
   NOTE: scripts/validate_contrast.py parses the --venturi-* hex tokens out of
   the light and dark (slate-scheme) token blocks below and asserts the WCAG-AA
   pairs — keep the token NAMES and BOTH blocks intact, and do not mention the
   selectors verbatim in comments above the blocks (the validator locates each
   block by its first occurrence in the file). The dark block is unreachable
   while the palette is light-only, but it stays validated so a dark scheme can
   be re-enabled safely later. */
/* Material's off-canvas drawer and search overlay extend past the viewport on
   narrow screens; without containment the body scrolls ~7px horizontally at
   375px. clip (not hidden) avoids creating a new scroll container. */
body {
  overflow-x: clip;
}

:root {
  --venturi-ink: #0f172a;            /* editorial ink — slate-900 */
  --venturi-muted: #475569;          /* editorial muted — slate-600 (AA on white) */
  --venturi-subtle: #64748b;         /* metadata — slate-500 (AA on white) */
  --venturi-border: #e2e8f0;         /* quiet hairline — slate-200 */
  --venturi-border-strong: #cbd5e1;  /* structural hairline — slate-300 */
  --venturi-canvas: #ffffff;         /* editorial canon: pure white canvas */
  --venturi-surface: #ffffff;
  --venturi-surface-alt: #f1f5f9;    /* alt surface — slate-100 */
  --venturi-navy: #0f172a;           /* brand navy */
  --venturi-teal: #0f766e;           /* signal teal — reserved for live signal */
  --venturi-teal-bright: #0f766e;    /* pinned to the AA-safe teal on white */
  --venturi-blue: #2563eb;           /* measurement blue — PRIMARY accent */
  --venturi-blue-strong: #1d4ed8;    /* accent deep — prose links, hover */
  --venturi-safe-top: env(safe-area-inset-top, 0px);
  --venturi-safe-right: env(safe-area-inset-right, 0px);
  --venturi-safe-bottom: env(safe-area-inset-bottom, 0px);
  --venturi-safe-left: env(safe-area-inset-left, 0px);

  /* Editorial system tokens (non-color; ignored by the contrast validator). */
  --venturi-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --venturi-display: "SF Pro Display", "Inter Tight", "Helvetica Neue", "Segoe UI", sans-serif;
  --venturi-mono: "SF Mono", "JetBrains Mono", "IBM Plex Mono", "Roboto Mono", ui-monospace, monospace;
  --venturi-r-card: 12px;            /* card radius (0.75rem at 16px root) */
  --venturi-r-control: 8px;          /* control radius */
  --venturi-accent-wash: rgb(37 99 235 / 0.07);
  --venturi-shadow-quiet: 0 8px 24px -20px rgb(15 23 42 / 0.18);

  --md-text-font: var(--venturi-sans);
  --md-code-font: var(--venturi-mono);
  --md-primary-fg-color: var(--venturi-surface);
  --md-primary-bg-color: var(--venturi-ink);
  --md-accent-fg-color: var(--venturi-blue);
  --md-typeset-a-color: var(--venturi-blue-strong);
  --md-default-bg-color: var(--venturi-canvas);
  --md-default-fg-color: var(--venturi-ink);
  --md-default-fg-color--light: var(--venturi-muted);
  --md-code-bg-color: #f1f5f9;
  --md-code-fg-color: #1e293b;
}

/* Retained for scripts/validate_contrast.py and a safe dark re-enable path;
   unreachable while mkdocs.yml pins a single light palette. */
[data-md-color-scheme="slate"] {
  --venturi-ink: #eff3f8;            /* corpus dark text */
  --venturi-muted: #bac5d4;          /* corpus dark secondary */
  --venturi-subtle: #91a0b4;         /* corpus dark metadata */
  --venturi-border: #1e2738;         /* corpus dark quiet hairline */
  --venturi-border-strong: #313e54;  /* corpus dark structural hairline */
  --venturi-canvas: #080b12;         /* corpus dark bg */
  --venturi-surface: #0e131e;        /* corpus dark surface */
  --venturi-surface-alt: #121926;    /* corpus dark alt surface */
  --venturi-navy: #0f172a;           /* corpus navy */
  --venturi-teal: #5ec4b6;           /* corpus dark signal teal — secondary */
  --venturi-teal-bright: #5ec4b6;
  --venturi-blue: #7eb6ff;           /* corpus dark measurement blue — PRIMARY */
  --venturi-blue-strong: #9dc8ff;    /* corpus dark accent hover / active */

  --md-primary-fg-color: #0e131e;
  --md-primary-bg-color: var(--venturi-ink);
  --md-accent-fg-color: var(--venturi-blue);
  --md-typeset-a-color: var(--venturi-blue);
  --md-default-bg-color: var(--venturi-canvas);
  --md-default-fg-color: var(--venturi-ink);
  --md-default-fg-color--light: var(--venturi-muted);
  --md-code-bg-color: #121926;
  --md-code-fg-color: #eff3f8;
}

/* Material's palette stylesheet re-declares --md-typeset-a-color at body
   scheme scope, mapping it onto --md-primary-fg-color — which this layer
   repurposes to white for the header. That mapping made code-inside-link text
   render white on the code background. Pin the link token at the same scope
   so the theme mapping can never win the cascade. */
[data-md-color-scheme="default"] {
  --md-typeset-a-color: var(--venturi-blue-strong);
}

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
  scroll-padding-top: calc(3.2rem + var(--venturi-safe-top));
}

body {
  /* Editorial canon: pure white, no gradients, no canvas fades. */
  background: var(--venturi-canvas);
}

.md-grid {
  max-width: 86rem;
}

.md-header {
  background: var(--venturi-surface);
  border-bottom: 1px solid var(--venturi-border);
  box-shadow: none;
  color: var(--venturi-ink);
}

.md-header__inner {
  min-height: 3.4rem;
}

.md-header__button.md-logo {
  border-radius: var(--venturi-r-control);
  margin: 0.25rem 0.35rem;
}

.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  height: 1.55rem;
  width: 1.55rem;
}

.md-header__title {
  /* Wordmark register: display stack, weight 650, letter-spacing 0. */
  font-family: var(--venturi-display);
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: 0;
}

.md-search__form {
  background: var(--venturi-surface);
  border: 1px solid var(--venturi-border-strong);
  border-radius: var(--venturi-r-control);
  box-shadow: none;
}

.md-search__form:hover,
.md-search__form:focus-within {
  border-color: var(--venturi-blue);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--venturi-blue) 16%, transparent);
}

.md-search__input,
.md-search__icon {
  color: var(--venturi-ink);
}

.md-search__input::placeholder {
  color: var(--venturi-subtle);
  opacity: 1;
}

.md-main {
  background: transparent;
}

/* Breadcrumbs (navigation.path): quiet metadata register. */
.md-path {
  margin-bottom: 0.2rem;
}

.md-path__list {
  color: var(--venturi-subtle);
  font-size: 0.68rem;
}

.md-path__link {
  color: var(--venturi-subtle);
}

.md-path__link:is(:focus, :hover) {
  color: var(--venturi-blue-strong);
}

.md-content {
  /* White on white: the content column is bounded by quiet hairlines only. */
  background: var(--venturi-surface);
  border-left: 1px solid color-mix(in srgb, var(--venturi-border) 62%, transparent);
  border-right: 1px solid color-mix(in srgb, var(--venturi-border) 62%, transparent);
}

.md-content__inner {
  margin-bottom: 3rem;
  padding-top: 1.6rem;
}

.md-content__inner::before {
  display: none;
}

.md-sidebar {
  color: var(--venturi-muted);
}

.md-sidebar--primary .md-sidebar__scrollwrap,
.md-sidebar--secondary .md-sidebar__scrollwrap {
  scrollbar-color: var(--venturi-border-strong) transparent;
}

.md-nav__title {
  color: var(--venturi-ink);
  font-weight: 700;
}

/* With the tab row retired, the primary sidebar is the site's main
   navigation: give top-level entries wordmark-adjacent presence so the
   15 sections scan as an IA, not a flat link list. */
.md-sidebar--primary .md-nav[data-md-level="0"] > .md-nav__list > .md-nav__item > .md-nav__link {
  color: var(--venturi-ink);
  font-weight: 650;
}

.md-sidebar--primary .md-nav[data-md-level="0"] > .md-nav__list > .md-nav__item {
  margin-bottom: 0.1rem;
}

.md-sidebar--primary .md-nav[data-md-level="0"] > .md-nav__list > .md-nav__item > .md-nav__link--active {
  color: var(--venturi-blue-strong);
}

.md-nav__item .md-nav__link {
  border-radius: var(--venturi-r-control);
  color: var(--venturi-muted);
  font-weight: 500;
  margin: 0.08rem 0;
  padding: 0.35rem 0.45rem;
}

.md-nav__link:is(:focus, :hover) {
  background: var(--venturi-surface-alt);
  color: var(--venturi-ink);
}

.md-nav__link--active,
.md-nav__item .md-nav__link--active {
  background: var(--venturi-accent-wash);
  color: var(--venturi-blue-strong);
  font-weight: 650;
}

/* TOC title as an editorial kicker: small, 700, wide tracking, muted. */
.md-sidebar--secondary .md-nav__title {
  color: var(--venturi-muted);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.md-typeset {
  color: var(--venturi-ink);
  font-size: 0.8rem;
}

.md-typeset p,
.md-typeset li {
  line-height: 1.68;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4 {
  color: var(--venturi-ink);
  font-family: var(--venturi-display);
  font-weight: 650;
  letter-spacing: 0;
}

.md-typeset h1 {
  border-bottom: 1px solid var(--venturi-border);
  font-size: 2rem;
  line-height: 1.05;
  margin: 0 0 1.35rem;
  max-width: 48rem;
  padding-bottom: 0.85rem;
}

.md-typeset h2 {
  font-size: 1.32rem;
  line-height: 1.08;
  margin-top: 2.15rem;
}

.md-typeset h3 {
  font-size: 1.02rem;
  line-height: 1.25;
}

/* Readable measure: top-level prose blocks cap at 72ch (inside the 45–75ch
   readability band the minimalism direction prescribes) while tables, code,
   grids, and section furniture keep the full composition width. Only direct
   children of the article body are capped so admonition and card interiors
   are never squeezed. */
.md-typeset > p,
.md-typeset > ul,
.md-typeset > ol,
.md-typeset > dl,
.md-typeset > blockquote {
  max-width: 72ch;
}

.md-typeset a {
  color: var(--venturi-blue-strong);
  font-weight: 600;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
  transition: color 160ms ease;
}

.md-typeset a:is(:focus, :hover) {
  color: var(--venturi-ink);
}

.md-typeset hr {
  border-bottom-color: var(--venturi-border);
}

.md-typeset strong {
  font-weight: 600;
}

/* Buttons: neutral outlined controls (editorial canon — accent blue is for
   links and focus, never a filled button). Compact control radius per the
   Web Interaction Standards: full-radius pills are reserved for badges, a
   call-to-action is never a 999px pill. */
.md-typeset .md-button {
  align-items: center;
  background: var(--venturi-surface);
  border: 1px solid var(--venturi-border-strong);
  border-radius: var(--venturi-r-control);
  box-shadow: none;
  color: var(--venturi-ink);
  display: inline-flex;
  font-weight: 600;
  justify-content: center;
  min-height: 2.2rem;
  padding: 0.45rem 1rem;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.md-typeset .md-button:is(:focus, :hover) {
  background: var(--venturi-surface-alt);
  border-color: color-mix(in srgb, var(--venturi-blue) 50%, transparent);
  color: var(--venturi-ink);
}

.md-typeset .md-button--primary {
  background: var(--venturi-surface);
  border-color: var(--venturi-border-strong);
  color: var(--venturi-ink);
}

/* Dark (slate) scheme is unreachable while the palette is light-only; kept so a
   re-enable cannot ship a low-contrast button (see validate_contrast.py). */
[data-md-color-scheme="slate"] .md-typeset .md-button--primary,
[data-md-color-scheme="slate"] .venturi-docs-actions .md-button--primary {
  color: #0f172a;
}

.md-typeset .md-button--primary:hover {
  background: var(--venturi-surface-alt);
  border-color: color-mix(in srgb, var(--venturi-blue) 50%, transparent);
}

.md-typeset .grid.cards > ul {
  gap: 0.85rem;
}

.md-typeset .grid.cards > ul > li {
  background: var(--venturi-surface);
  border: 1px solid var(--venturi-border);
  border-radius: var(--venturi-r-card);
  box-shadow: none;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.md-typeset .grid.cards > ul > li:hover {
  background: var(--venturi-accent-wash);
  border-color: color-mix(in srgb, var(--venturi-blue) 50%, var(--venturi-border));
}

.md-typeset .grid.cards .lg {
  color: var(--venturi-blue);
}

.venturi-path-cards .lg {
  color: var(--venturi-blue);
}

.md-typeset table:not([class]) {
  background: var(--venturi-surface);
  border: 1px solid var(--venturi-border);
  border-radius: var(--venturi-r-card);
  box-shadow: none;
  overflow: hidden;
}

.md-typeset table:not([class]) th {
  background: var(--venturi-surface-alt);
  color: var(--venturi-ink);
  font-weight: 600;
}

.md-typeset table:not([class]) td,
.md-typeset table:not([class]) th {
  border-color: var(--venturi-border);
  padding: 0.7em 0.9em;
  vertical-align: top;
}

.md-typeset table:not([class]) td {
  font-variant-numeric: tabular-nums;
}

.md-typeset__scrollwrap,
.md-typeset .highlight {
  -webkit-overflow-scrolling: touch;
}

.md-typeset code {
  border: 1px solid color-mix(in srgb, var(--venturi-border) 70%, transparent);
  border-radius: 5px;
  padding: 0.08em 0.34em;
}

.md-typeset pre > code {
  border: 0;
  border-radius: 0;
  padding: 0;
}

.md-typeset .highlight {
  border: 1px solid var(--venturi-border);
  border-radius: var(--venturi-r-card);
  box-shadow: none;
  overflow: hidden;
}

.md-typeset .highlight > pre {
  -webkit-overflow-scrolling: touch;
}

.md-typeset .admonition,
.md-typeset details {
  background: var(--venturi-surface);
  border: 1px solid var(--venturi-border);
  border-left: 2px solid var(--venturi-blue);
  border-radius: var(--venturi-r-card);
  box-shadow: none;
}

.md-typeset .admonition-title,
.md-typeset summary {
  background: var(--venturi-accent-wash);
  color: var(--venturi-ink);
  font-weight: 650;
}

/* Semantic admonition types → Venturi palette (corpus alignment). Informational
   types (note/info/abstract) use measurement blue; tip uses the corpus signal
   teal. True-status types (warning/danger/success/failure/bug) keep Material's
   semantic status colors, per the corpus rule that status colors are reserved
   for true status. The box border stays a neutral 1px hairline; only the thin
   left rule, title wash, and icon carry the accent. */
.md-typeset .admonition.note,
.md-typeset details.note,
.md-typeset .admonition.info,
.md-typeset details.info,
.md-typeset .admonition.abstract,
.md-typeset details.abstract {
  border-color: var(--venturi-border);
  border-left-color: var(--venturi-blue);
}
.md-typeset .note > .admonition-title,
.md-typeset .note > summary,
.md-typeset .info > .admonition-title,
.md-typeset .info > summary,
.md-typeset .abstract > .admonition-title,
.md-typeset .abstract > summary {
  background-color: var(--venturi-accent-wash);
}
.md-typeset .note > .admonition-title::before,
.md-typeset .note > summary::before,
.md-typeset .info > .admonition-title::before,
.md-typeset .info > summary::before,
.md-typeset .abstract > .admonition-title::before,
.md-typeset .abstract > summary::before {
  background-color: var(--venturi-blue);
}

.md-typeset .admonition.question,
.md-typeset details.question {
  border-color: var(--venturi-border);
  border-left-color: var(--venturi-blue);
}
.md-typeset .question > .admonition-title,
.md-typeset .question > summary {
  background-color: var(--venturi-accent-wash);
}
.md-typeset .question > .admonition-title::before,
.md-typeset .question > summary::before {
  background-color: var(--venturi-blue);
}

.md-typeset .admonition.tip,
.md-typeset details.tip {
  border-color: var(--venturi-border);
  border-left-color: var(--venturi-teal);
}
.md-typeset .tip > .admonition-title,
.md-typeset .tip > summary {
  background-color: color-mix(in srgb, var(--venturi-teal) 8%, transparent);
}
.md-typeset .tip > .admonition-title::before,
.md-typeset .tip > summary::before {
  background-color: var(--venturi-teal);
}

.md-typeset .tabbed-set {
  margin: 1.1rem 0;
}

.md-typeset .tabbed-labels {
  gap: 0.3rem;
}

.md-typeset .tabbed-labels > label {
  border: 1px solid var(--venturi-border);
  border-radius: var(--venturi-r-control) var(--venturi-r-control) 0 0;
  color: var(--venturi-muted);
  font-weight: 600;
  padding: 0.55rem 0.75rem;
}

.md-typeset .tabbed-labels > label:hover {
  color: var(--venturi-ink);
}

.md-typeset .tabbed-content {
  background: var(--venturi-surface);
  border: 1px solid var(--venturi-border);
  border-radius: 0 var(--venturi-r-card) var(--venturi-r-card);
  padding: 0.15rem 0.95rem 0.95rem;
}

/* Hero: light editorial panel — white surface, hairline frame, no gradients,
   no shadows, no dark band. The kicker is the muted editorial label. */
.venturi-docs-hero {
  background: var(--venturi-surface);
  border: 1px solid var(--venturi-border);
  border-radius: var(--venturi-r-card);
  box-shadow: none;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1.55fr) minmax(14rem, 0.75fr);
  margin: 0.15rem 0 1.6rem;
  overflow: hidden;
  padding: 1.1rem;
  position: relative;
}

.venturi-docs-hero__copy,
.venturi-docs-hero__panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.venturi-docs-hero__copy p,
.venturi-docs-hero__copy {
  color: var(--venturi-muted);
  line-height: 1.5;
}

.venturi-docs-hero__copy strong {
  color: var(--venturi-ink);
}

.venturi-docs-hero__panel {
  border-left: 1px solid var(--venturi-border);
  padding-left: 1.25rem;
}

.venturi-docs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0.9rem 0 0;
}

.venturi-docs-actions .md-button {
  margin: 0;
  padding-inline: 0.9rem;
}

.venturi-docs-contract {
  display: grid;
  gap: 0;
  margin: 0.8rem 0 1.1rem;
  overflow: hidden;
}

.venturi-docs-contract div {
  border-top: 1px solid var(--venturi-border);
  display: grid;
  gap: 0.65rem;
  grid-template-columns: minmax(0, 0.98fr) minmax(0, 1.02fr);
  padding: 0.58rem 0;
}

.venturi-docs-contract div:first-child {
  border-top: 0;
  padding-top: 0;
}

.venturi-docs-contract dt {
  color: var(--venturi-muted);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.venturi-docs-contract dd {
  color: var(--venturi-ink);
  font-size: 0.82rem;
  font-weight: 600;
  margin: 0;
}

.venturi-docs-contract code {
  background: var(--venturi-surface-alt);
  border-color: var(--venturi-border);
  color: var(--venturi-ink);
}

/* Editorial kicker: 700, wide tracking, uppercase, muted. */
.venturi-docs-kicker,
.venturi-docs-panel-label {
  color: var(--venturi-muted);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  margin: 0 0 0.65rem;
  text-transform: uppercase;
}

.venturi-docs-hero__panel a {
  color: var(--venturi-blue-strong);
}

/* Back-to-top (navigation.top): quiet outlined pill instead of elevation. */
.md-top {
  background: var(--venturi-surface);
  border: 1px solid var(--venturi-border-strong);
  box-shadow: var(--venturi-shadow-quiet);
  color: var(--venturi-muted);
}

/* Footer: light surface with hairline structure instead of Material's solid
   dark band. Prev/next become quiet cards in the site register. */
.md-footer {
  background: var(--venturi-surface);
  border-top: 1px solid var(--venturi-border);
  color: var(--venturi-ink);
}

.md-footer__link {
  align-items: center;
  border: 1px solid var(--venturi-border);
  border-radius: var(--venturi-r-card);
  background: var(--venturi-surface);
  margin: 0.7rem 0;
  padding: 0.45rem 0.7rem;
  opacity: 1;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.md-footer__link:is(:focus, :hover) {
  border-color: color-mix(in srgb, var(--venturi-blue) 50%, var(--venturi-border));
  background: var(--venturi-accent-wash);
  opacity: 1;
}

.md-footer__title {
  color: var(--venturi-ink);
  font-weight: 650;
}

.md-footer__direction {
  color: var(--venturi-subtle);
  opacity: 1;
}

.md-footer__button {
  color: var(--venturi-muted);
}

.md-footer-meta {
  background: transparent;
  border-top: 1px solid var(--venturi-border);
}

html .md-footer-meta.md-typeset a,
.md-copyright,
.md-copyright__highlight {
  color: var(--venturi-subtle);
}

html .md-footer-meta.md-typeset a:is(:focus, :hover) {
  color: var(--venturi-blue-strong);
}

.md-social__link svg {
  fill: var(--venturi-subtle);
}

@media screen and (max-width: 76.1875em) {
  .md-content {
    border-left: 0;
    border-right: 0;
  }

  /* Mobile drawer: Material colors the active link and section title with
     --md-primary-fg-color, which this theme sets to the (white) surface for
     the light header — leaving the active item near-invisible. Pin drawer
     text back to the token palette. */
  .md-nav--primary .md-nav__title {
    background: var(--venturi-surface-alt);
    color: var(--venturi-ink);
  }

  .md-nav--primary .md-nav__title .md-nav__icon {
    color: var(--venturi-ink);
  }

  .md-nav--primary .md-nav__item .md-nav__link--active,
  .md-nav--primary .md-nav__link--active {
    color: var(--venturi-blue-strong);
  }

  .md-nav--primary .md-nav__item .md-nav__link--active .md-nav__icon,
  .md-nav--primary .md-nav__button {
    color: var(--venturi-muted);
  }
}

@media screen and (max-width: 59.9375em) {
  .md-header {
    padding-top: var(--venturi-safe-top);
  }

  .md-header__inner {
    min-height: 2.7rem;
    padding-left: max(0.2rem, var(--venturi-safe-left));
    padding-right: max(0.2rem, var(--venturi-safe-right));
  }

  /* 2.75rem = 44px: touch-target floor for standalone header controls. */
  .md-header__button {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    min-height: 2.75rem;
    min-width: 2.75rem;
  }

  .md-header__button.md-logo {
    height: 2.75rem;
    margin: 0 0.15rem;
    width: 2.75rem;
  }

  .md-search__form {
    min-height: 2.75rem;
  }

  .md-search__overlay {
    height: 2.75rem;
    width: 2.75rem;
  }

  .md-nav__item .md-nav__link {
    align-items: center;
    display: flex;
    min-height: 2.75rem;
    padding-bottom: 0.55rem;
    padding-top: 0.55rem;
  }

  .md-sidebar--primary .md-sidebar__scrollwrap {
    padding-bottom: max(1rem, var(--venturi-safe-bottom));
  }

  .md-content__inner {
    padding-top: 1.4rem;
  }

  .md-typeset h1 {
    font-size: 1.72rem;
    margin-bottom: 1.35rem;
  }

  .venturi-docs-hero {
    grid-template-columns: 1fr;
    padding: 1.25rem;
  }

  .venturi-docs-hero__panel {
    border-left: 0;
    border-top: 1px solid var(--venturi-border);
    padding-left: 0;
    padding-top: 1.05rem;
  }
}

@media screen and (max-width: 38em) {
  .md-typeset {
    font-size: 0.78rem;
  }

  .md-content__inner {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }

  .md-typeset h1 {
    font-size: 1.54rem;
    line-height: 1.16;
    margin-bottom: 1rem;
  }

  .md-typeset p,
  .md-typeset li {
    line-height: 1.58;
  }

  .md-typeset .md-button {
    min-height: 2.2rem;
  }

  .md-typeset code:not(pre code) {
    border-radius: 4px;
    overflow-wrap: anywhere;
    padding: 0.04em 0.24em;
    word-break: break-word;
  }

  .md-typeset .highlight,
  .md-typeset__scrollwrap {
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100%;
  }

  .md-typeset .highlight {
    border-radius: var(--venturi-r-control);
  }

  .md-typeset .highlight > pre,
  .md-typeset__scrollwrap {
    overflow-x: auto;
  }

  .md-typeset table:not([class]) td,
  .md-typeset table:not([class]) th {
    padding: 0.6em 0.72em;
  }

  .venturi-docs-hero {
    gap: 0.8rem;
    margin: 0 0 1.15rem;
    padding: 0.9rem;
  }

  .venturi-docs-hero__copy p,
  .venturi-docs-hero__copy {
    line-height: 1.42;
  }

  .venturi-docs-kicker,
  .venturi-docs-panel-label {
    margin-bottom: 0.45rem;
  }

  .venturi-docs-actions {
    display: grid;
    gap: 0.45rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0.65rem;
  }

  .venturi-docs-actions .md-button {
    font-size: 0.68rem;
    line-height: 1.2;
    padding: 0.5rem 0.55rem;
    width: 100%;
  }

  .venturi-docs-hero__panel {
    padding-top: 0.75rem;
  }

  .venturi-docs-contract {
    gap: 0.5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0.55rem 0 0.7rem;
  }

  .venturi-docs-contract div {
    background: var(--venturi-surface-alt);
    border: 1px solid var(--venturi-border);
    border-radius: 6px;
    gap: 0.25rem;
    grid-template-columns: 1fr;
    padding: 0.5rem;
  }

  .venturi-docs-contract div:first-child {
    border-top: 1px solid var(--venturi-border);
    padding-top: 0.5rem;
  }

  .venturi-docs-contract dt {
    font-size: 0.52rem;
  }

  .venturi-docs-contract dd {
    font-size: 0.74rem;
    line-height: 1.25;
  }

  .md-typeset .tabbed-content {
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }
}

/* Editorial motion rule: state changes may only fade color/background/border
   (≤180ms); reduced-motion users get instant everything. */
@media (prefers-reduced-motion: reduce) {
  .md-typeset a,
  .md-typeset .md-button,
  .md-typeset .grid.cards > ul > li,
  .md-footer__link {
    transition: none !important;
  }
}
