/* ════════════════════════════════════════════════════════════════
   RenDS — Shared docs site shell
   ════════════════════════════════════════════════════════════════
   Imported by every page in /rends/docs/, /rends/templates/,
   /rends/templates/, etc. so the entire site shares one chrome.

   Pages should NOT redeclare any of these classes inline.
   Page-specific styles live in their own <style> block AFTER this
   file is imported, and use only RenDS tokens.

   Class API (the public surface every page can use):
     .dx-nav, .dx-nav-inner, .dx-brand, .dx-brand-mark,
     .dx-nav-menu, .dx-nav-actions
     .dx-shell                 single-column page container
     .dx-shell-grid            sidebar + content page container
     .dx-sidebar               sticky left TOC (primitive-zero style)
     .dx-content               main content column
     .dx-header, .dx-kicker
     .dx-section
     .dx-pre, .dx-callout
     .dx-toc-pills             horizontal pill TOC (legacy support)
     .dx-footer
   ════════════════════════════════════════════════════════════════ */


/* ─────────────────────────────────────────────
   Body baseline
   ───────────────────────────────────────────── */
body {
  margin: 0;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-sans);
}


/* ─────────────────────────────────────────────
   Preview banner (used on /templates/ template pages
   to give users a way back to the docs site)
   ───────────────────────────────────────────── */
.dx-preview-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-6);
  background: var(--color-text);
  color: var(--color-surface);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.02em;
  position: sticky;
  top: 0;
  z-index: 60;
}

.dx-preview-banner a,
.dx-preview-banner a:visited {
  color: var(--color-surface);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dx-preview-banner a:hover {
  text-decoration: none;
}

.dx-preview-banner-label {
  opacity: 0.7;
}


/* ─────────────────────────────────────────────
   Top bar (sticky, blurred)
   ───────────────────────────────────────────── */
.dx-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--color-surface) 80%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--color-border-muted);
}

.dx-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-6);
  max-width: var(--width-7xl, 1280px);
  margin: 0 auto;
}

.dx-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--weight-bold);
  font-size: var(--text-md);
  text-decoration: none;
  color: var(--color-text);
}

.dx-brand-mark {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: var(--color-text);
  color: var(--color-surface);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
}

/* Shared identity for every standalone navigation preview. */
.ren10-demo-brand {
  --row-gap: var(--space-2);
  color: var(--color-text);
  font-weight: var(--weight-bold);
  text-decoration: none;
}

.ren10-demo-brand > .ren10-demo-brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 var(--size-sm);
  inline-size: var(--size-sm);
  block-size: var(--size-sm);
  color: var(--color-surface);
  background: var(--color-text);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  line-height: 1;
  text-align: center;
  padding: 0;
  margin: 0;
  max-width: none;
  align-self: center;
}

.ren10-demo-brand-glyph {
  display: block;
  line-height: 1;
  transform: translateY(-0.04em);
}

.ren10-demo-brand > .ren10-demo-brand-label {
  color: var(--color-text);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  line-height: 1;
}

.dx-nav-menu {
  display: flex;
  gap: var(--space-5);
}

.dx-nav-menu a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  padding: var(--space-1) 0;
}

.dx-nav-menu a:hover {
  color: var(--color-text);
}

.dx-nav-menu a[aria-current="page"] {
  color: var(--color-text);
}

.dx-nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

@media (max-width: 720px) {
  .dx-nav-menu { display: none; }
}


/* ─────────────────────────────────────────────
   Page shell (containers)
   ─────────────────────────────────────────────
   .dx-shell        single column, content centered
   .dx-shell-grid   left sidebar + content column
                    Use both classes together when a page needs
                    the sidebar pattern: <div class="dx-shell dx-shell-grid">
   ───────────────────────────────────────────── */
.dx-shell {
  max-width: var(--width-7xl, 1280px);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}

.dx-shell-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
}

@media (max-width: 900px) {
  .dx-shell-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}


/* ─────────────────────────────────────────────
   Sidebar (primitive-zero pattern, canonical)
   ───────────────────────────────────────────── */
.dx-sidebar {
  position: sticky;
  /* sit just under the sticky top bar */
  top: calc(var(--space-12) + var(--space-2));
  align-self: start;
  height: fit-content;
  max-height: calc(100vh - var(--space-16));
  overflow-y: auto;
  border-inline-end: 1px solid var(--color-border);
  padding-inline-end: var(--space-4);
  padding-block: var(--space-2);
  font-size: var(--text-sm);
}

.dx-sidebar h3,
.dx-sidebar .dx-sidebar-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-block: var(--space-4) var(--space-2);
}

.dx-sidebar h3:first-child,
.dx-sidebar .dx-sidebar-title:first-child {
  margin-block-start: 0;
}

.dx-sidebar ul,
.dx-sidebar ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

.dx-sidebar li { margin: 0; }

.dx-sidebar a {
  display: block;
  padding: var(--space-1) var(--space-2);
  color: var(--color-text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.dx-sidebar a:hover {
  background: var(--color-fill);
  color: var(--color-text);
}

.dx-sidebar a[aria-current="page"],
.dx-sidebar a.active {
  color: var(--color-text);
  background: var(--color-fill);
  font-weight: var(--weight-medium);
}

@media (max-width: 900px) {
  .dx-sidebar {
    position: static;
    border-inline-end: none;
    border-block-end: 1px solid var(--color-border);
    padding-inline-end: 0;
    padding-block-end: var(--space-4);
    margin-block-end: var(--space-4);
    max-height: none;
  }
}


/* ─────────────────────────────────────────────
   Content column
   ───────────────────────────────────────────── */
.dx-content {
  min-width: 0;
}


/* ─────────────────────────────────────────────
   Page header (hero)
   ───────────────────────────────────────────── */
.dx-header {
  margin-bottom: var(--space-10);
  max-width: 72ch;
}

.dx-header h1 {
  font-size: var(--text-6xl);
  letter-spacing: -0.03em;
  font-weight: var(--weight-bold);
  margin: var(--space-2) 0 var(--space-4);
}

.dx-header .lede {
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  line-height: 1.55;
  margin: 0;
  max-width: 60ch;
}

.dx-kicker {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin: 0 0 var(--space-2);
}

/* Shared detail chrome for standalone block previews. */
.bb-detail-header {
  --stack-gap: var(--space-2);
  max-width: 68ch;
  padding-block-end: var(--space-8);
}

.bb-detail-header .ren-breadcrumb {
  margin-block-end: var(--space-2);
}

.bb-detail-title {
  margin: 0;
  color: var(--color-text);
  font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  text-wrap: balance;
}

.bb-detail-description {
  max-width: 64ch;
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
}

.bb-detail-preview.bb-detail-preview {
  position: relative;
  isolation: isolate;
  overflow: clip;
  margin-block: var(--space-6) var(--space-10);
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

/* Standalone block pages share one exact vertical rhythm. The page itself is
   a grid so headers, previews, and pagination never accumulate child margins. */
.bb-detail-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-8);
}

/* Every standalone block uses the same contained canvas. The doubled class
   deliberately outranks legacy page-local `.dx-shell` overflow/width patches. */
.bb-detail-page.dx-shell {
  width: 100%;
  max-width: var(--width-7xl, 1280px);
  padding-inline: clamp(var(--space-6), 4vw, var(--space-12));
  box-sizing: border-box;
  overflow: visible;
}

.bb-detail-page > .bb-detail-header {
  padding-block: 0;
}

/* CTA documentation titles and introductions form one compact text group.
   Feature and navigation detail headers keep their existing rhythm. */
.bb-detail-page:has(> section.bb-detail-preview[class^="cta"]) > .bb-detail-header {
  --stack-gap: var(--space-1);
}

/* Legal consent belongs to the form control group, not to the surrounding
   CTA copy. Keep that relationship compact across every email CTA. */
.bb-detail-page > section.bb-detail-preview[class^="cta"] form.ren-stack:has(> [class^="cta"][class*="-legal"]) {
  --stack-gap: var(--space-1);
}

/* Feature headings need a generous column gutter without turning that same
   value into an oversized title-to-description gap when they stack. */
.bb-detail-page > section.bb-detail-preview[class^="feature"] > [class*="-heading"] {
  row-gap: var(--space-3);
}

/* Cap only pure text stacks. Structural stacks containing grids, media,
   actions, or cards keep their authored section rhythm. */
.bb-detail-page > section.bb-detail-preview[class^="feature"] .ren-stack:has(> :is(h2, h3, h4, p, span, strong, small, blockquote, cite)):not(:has(> :not(:is(h2, h3, h4, p, span, strong, small, blockquote, cite)))) {
  row-gap: min(var(--stack-gap, var(--space-stack)), var(--space-3));
}

.bb-detail-page > .bb-detail-preview.bb-detail-preview {
  min-width: 0;
  margin-block: 0;
}

.bb-detail-page > .bb-detail-preview.bb-detail-preview:not(.ren-cover):not(:has(ren-nav)) {
  min-height: 0;
}

/* CTA previews share one deliberate section rhythm. Batch-specific styles own
   their anatomy, while this catalog layer keeps every composition equally
   breathable and prevents split layouts from touching the preview edge. */
.bb-detail-page > section.bb-detail-preview.bb-detail-preview[class^="cta"] {
  --center-padding: 0;
  padding-block: clamp(var(--space-10), 5vw, var(--space-16));
  padding-inline: clamp(var(--space-6), 4vw, var(--space-12));
}

/* Media-backed CTAs need a stable landscape canvas in documentation. This
   restores a useful minimum after the generic preview reset without turning
   image and video examples into tall, nearly square cards. */
.bb-detail-page > section.bb-detail-preview.bb-detail-preview[class^="cta"]:has(> [class$="-background"]) {
  min-block-size: clamp(22rem, 34vw, 28rem);
}

/* A secondary CTA must remain a real surface on neutral, black, photographic,
   and video backgrounds. The generic blue outline is intentionally replaced
   by a neutral high-contrast treatment throughout the CTA catalog. */
.bb-detail-page > section.bb-detail-preview.bb-detail-preview[class^="cta"] .ren-btn.ren-btn-outline {
  color: var(--color-text);
  background-color: var(--color-surface-raised);
  border-color: var(--color-border-interactive);
}

.bb-detail-page > section.bb-detail-preview.bb-detail-preview[class^="cta"] .ren-btn.ren-btn-outline:hover:not(:disabled):not([aria-disabled="true"]) {
  color: var(--color-text);
  background-color: var(--color-fill-hover);
  border-color: var(--color-border-strong);
}

.bb-detail-page > section.bb-detail-preview.bb-detail-preview[class^="cta"] .ren-btn.ren-btn-outline:active:not(:disabled):not([aria-disabled="true"]) {
  color: var(--color-text);
  background-color: var(--color-fill-active);
  border-color: var(--color-border-interactive);
}

/* Fullscreen is useful in production, but block documentation needs a stable
   cinematic canvas so image/video examples can be compared without a 1:1 wall. */
.bb-detail-page > .bb-detail-preview.bb-detail-preview.ren-cover,
.bb-detail-page > .bb-detail-preview.bb-detail-preview > .ren-cover.ren-cover {
  --cover-height: clamp(34rem, 56vw, 42rem);
}

/* This centered cover is intentionally cinematic but compact enough to read as
   a landscape hero inside the catalog rather than a square viewport mockup. */
.bb-detail-page > .bb-detail-preview.bb-detail-preview[data-rh30-root] {
  --cover-height: clamp(30rem, 48vw, 36rem);
}

/* Media-over-band heroes need a minimum canvas, not a fixed block size: their
   stacked mobile copy can grow while the media keeps a useful landscape band. */
.bb-detail-page > .bb-detail-preview.bb-detail-preview:is(
  [data-rh9-root],
  [data-rh10-root],
  [data-rh11-root],
  [data-rh12-root],
  [data-rh13-root],
  [data-rh14-root]
) {
  block-size: auto;
  min-block-size: var(--cover-height);
}

/* Landscape-first compositions keep their generous production spacing in the
   component itself. Inside the catalog, use a compact comparison canvas so the
   media reads as a landscape rather than turning the example into a tall card. */
.bb-detail-page > .bb-detail-preview.bb-detail-preview:is(
  [data-rh15-root],
  [data-rh17-root],
  [data-rh18-root],
  [data-rh26-root],
  [data-rh28-root],
  [data-rh29-root]
) {
  padding-block: var(--space-8);
}

.bb-detail-page > .bb-detail-preview.bb-detail-preview:is(
  [data-rh16-root],
  [data-rh27-root]
) > section {
  padding-block: var(--space-8);
}

.bb-detail-page > .bb-detail-preview.bb-detail-preview :is(
  .rh15-container,
  .rh16-shell,
  .rh17-container,
  .rh18-container,
  .rh26-container,
  .rh27-layout,
  .rh28-container,
  .rh29-container
) {
  --stack-gap: var(--space-8);
}

.bb-detail-page > .bb-detail-preview.bb-detail-preview :is(
  .rh15-media,
  .rh16-media,
  .rh17-media,
  .rh18-media,
  .rh26-media,
  .rh27-media,
  .rh28-media,
  .rh29-media
) {
  width: min(100%, var(--width-3xl));
  margin-inline: auto;
}

/* Mega panels are absolute on desktop, so the documentation preview must
   preserve their visual canvas instead of clipping or overlapping pagination. */
.bb-detail-page > .bb-detail-preview.bb-detail-preview:has(ren-nav) {
  overflow: visible;
}

@media (min-width: 48.0625rem) {
  .bb-detail-page > .bb-detail-preview.bb-detail-preview:not(:is(
    [data-rn11-root],
    [data-rn12-root],
    [data-rn13-root],
    [data-rn14-root],
    [data-rn15-root]
  )):has(ren-nav details[open]) {
    min-height: var(--width-4xl);
  }
}

.bb-block-pagination {
  --grid-gap: var(--space-4);
  padding-block-start: var(--space-6);
  border-block-start: 1px solid var(--color-border-muted);
}

.bb-block-pagination-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--touch-min);
  padding: var(--space-4);
  color: var(--color-text);
  text-decoration: none;
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border-interactive);
  border-radius: var(--radius-lg);
}

.bb-block-pagination-link[rel="prev"] {
  grid-template-columns: auto minmax(0, 1fr);
}

.bb-block-pagination-link[rel="next"] {
  text-align: end;
}

.bb-block-pagination-link:hover {
  color: var(--color-text-link-hover);
  border-color: var(--color-border-accent);
}

.bb-block-pagination-link:focus-visible {
  outline: var(--ring-width) solid var(--color-focus-ring);
  outline-offset: var(--ring-offset);
}

.bb-block-pagination-direction {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* ─────────────────────────────────────────────
   API surface badge — flags whether a component
   works without JS, requires JS, or both.
   Placed in the page header next to <h1>.
   ───────────────────────────────────────────── */
.dx-api-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: var(--space-3);
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  line-height: 1;
  letter-spacing: 0.02em;
  vertical-align: middle;
  white-space: nowrap;
}

.dx-api-badge-css {
  color: var(--color-success);
  border-color: color-mix(in oklch, var(--color-success), transparent 70%);
  background: color-mix(in oklch, var(--color-success), transparent 92%);
}

.dx-api-badge-js {
  color: var(--color-warning);
  border-color: color-mix(in oklch, var(--color-warning), transparent 70%);
  background: color-mix(in oklch, var(--color-warning), transparent 92%);
}

.dx-api-badge-hybrid {
  color: var(--color-accent);
  border-color: color-mix(in oklch, var(--color-accent), transparent 70%);
  background: color-mix(in oklch, var(--color-accent), transparent 92%);
}


/* ─────────────────────────────────────────────
   Section (between-section dividers)
   ───────────────────────────────────────────── */
.dx-section {
  padding-top: var(--space-10);
  margin-top: var(--space-10);
  border-top: 1px solid var(--color-border-muted);
  scroll-margin-top: 80px;
}

.dx-section:first-of-type {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.dx-section h2 {
  font-size: var(--text-3xl);
  letter-spacing: -0.02em;
  font-weight: var(--weight-bold);
  margin: 0 0 var(--space-3);
}

.dx-section > p {
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin: 0 0 var(--space-4);
  max-width: 72ch;
}

.dx-section h3 {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin: var(--space-8) 0 var(--space-2);
}

.dx-section h4 {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  margin: var(--space-6) 0 var(--space-2);
  color: var(--color-text-secondary);
}

.dx-section ul,
.dx-section ol {
  max-width: 72ch;
  padding-left: var(--space-5);
  line-height: 1.7;
  color: var(--color-text-secondary);
}

.dx-section li { margin-bottom: var(--space-2); }


/* ─────────────────────────────────────────────
   Inline code
   ───────────────────────────────────────────── */
:where(.dx-content, .dx-section) code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-surface-sunken);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-xs);
  border: 1px solid var(--color-border-muted);
}


/* ─────────────────────────────────────────────
   Code block — fills the content column; long
   lines wrap so nothing is hidden behind a
   hidden-by-default macOS scrollbar.
   ───────────────────────────────────────────── */
.dx-pre {
  background: var(--color-surface-sunken);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.6;
  margin: var(--space-3) 0;
  color: var(--color-text);
}

.dx-pre code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.dx-pre code {
  background: none;
  padding: 0;
  border: none;
  font-size: inherit;
}


/* ─────────────────────────────────────────────
   Callout
   ───────────────────────────────────────────── */
.dx-callout {
  border-left: 3px solid var(--color-accent);
  background: var(--color-accent-subtle);
  padding: var(--space-4) var(--space-5);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: var(--space-6) 0;
  max-width: 72ch;
}

.dx-callout p { margin: 0 0 var(--space-2); color: var(--color-text); }
.dx-callout p:last-child { margin: 0; }
.dx-callout strong { color: var(--color-accent-active); }


/* ─────────────────────────────────────────────
   Reference tables (.dx-api) and key tables (.dx-keys)
   ─────────────────────────────────────────────
   All reference tables on a page share the SAME
   column boundary so the eye can scan downward
   without re-anchoring on every section.

   Default shape — .dx-api — is 2 columns at 35/65.
   For 4-column attribute tables (Attribute / Type
   / Default / Notes) add .dx-api-cols-4.

   The visual rhythm is enforced via table-layout: fixed.
   ───────────────────────────────────────────── */
.dx-api {
  width: 100%;
  margin: var(--space-4) 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: var(--text-sm);
}

.dx-api caption {
  text-align: left;
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-2);
  padding-bottom: var(--space-2);
}

.dx-api thead th {
  text-align: left;
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  padding: var(--space-2) var(--space-3) var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dx-api tbody td {
  padding: var(--space-3) var(--space-3) var(--space-3) 0;
  border-bottom: 1px solid var(--color-border-muted);
  vertical-align: top;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.dx-api tbody tr:last-child td { border-bottom: none; }

.dx-api thead th:first-child,
.dx-api tbody td:first-child { padding-left: 0; }

.dx-api thead th:last-child,
.dx-api tbody td:last-child { padding-right: 0; }

.dx-api code {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Cell helpers for the 4-column shape */
.dx-api .dx-api-name { color: var(--color-text); font-weight: var(--weight-medium); }
.dx-api .dx-api-type { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-accent); }
.dx-api .dx-api-default { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-text-muted); }

/* Default 2-column shape — class column on the left always 35% */
.dx-api thead th:first-child { width: 35%; }

/* 4-column shape — Attribute / Type / Default / Notes */
.dx-api.dx-api-cols-4 thead th:nth-child(1) { width: 18%; }
.dx-api.dx-api-cols-4 thead th:nth-child(2) { width: 32%; }
.dx-api.dx-api-cols-4 thead th:nth-child(3) { width: 14%; }
.dx-api.dx-api-cols-4 thead th:nth-child(4) { width: 36%; }

/* Keyboard table — same 35/65 grid as the 2-column .dx-api so the eye
   reads them as one continuous column boundary. */
.dx-keys {
  display: grid;
  gap: 0;
  margin: var(--space-4) 0;
  font-size: var(--text-sm);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.dx-keyrow {
  display: grid;
  grid-template-columns: 35% 1fr;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border-muted);
  align-items: center;
}

.dx-keyrow:last-child { border-bottom: none; }

.dx-keyrow .keys {
  display: inline-flex;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.dx-keyrow span {
  color: var(--color-text-secondary);
  line-height: 1.5;
}


/* ─────────────────────────────────────────────
   Pill TOC (horizontal jump menu used in some pages)
   ───────────────────────────────────────────── */
.dx-toc-pills {
  padding: var(--space-4);
  background: var(--color-surface-sunken);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin: var(--space-6) 0 var(--space-8);
  max-width: 72ch;
}

.dx-toc-pills-title {
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: var(--weight-semibold);
  margin: 0 0 var(--space-2);
}

.dx-toc-pills-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.dx-toc-pills-links a {
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--text-sm);
  padding: 0 var(--space-1);
}

.dx-toc-pills-links a:hover { color: var(--color-accent); }


/* ─────────────────────────────────────────────
   Footer
   ───────────────────────────────────────────── */
.dx-footer {
  border-top: 1px solid var(--color-border-muted);
  padding: var(--space-10) var(--space-6);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-top: var(--space-16);
}

.dx-footer-inner {
  max-width: var(--width-7xl, 1280px);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.dx-footer a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.dx-footer a:hover { color: var(--color-text); }

.dx-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
}

@media (max-width: 720px) {
  .dx-footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* ─────────────────────────────────────────────
   Mobile drawer & filter (added by shell.js)
   ────────────────────────────────────────────── */

/* Hamburger button — visible only on mobile (≤900px) */
.dx-sidebar-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--space-1);
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--color-text);
}

.dx-sidebar-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: all 0.3s ease;
}

@media (max-width: 900px) {
  .dx-sidebar-toggle {
    display: flex;
  }
}

/* Backdrop overlay for drawer (mobile only) */
.dx-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dx-sidebar-backdrop[data-open] {
  opacity: 1;
}

@media (max-width: 900px) {
  .dx-sidebar-backdrop {
    display: block;
  }
}

/* Mobile drawer: transform off-screen by default, slide in on open */
@media (max-width: 900px) {
  .dx-sidebar {
    position: fixed;
    top: calc(var(--space-12) + var(--space-2));
    left: 0;
    width: 280px;
    height: calc(100vh - (var(--space-12) + var(--space-2)));
    max-height: none;
    background: var(--color-surface);
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    border-inline-end: 1px solid var(--color-border);
    border-block-end: none;
    padding-inline-end: var(--space-4);
    padding-block: var(--space-2);
    overflow-y: auto;
  }

  .dx-sidebar[data-open] {
    transform: translateX(0);
  }

  /* Respect prefers-reduced-motion */
  @media (prefers-reduced-motion: reduce) {
    .dx-sidebar,
    .dx-sidebar-toggle span,
    .dx-sidebar-backdrop {
      transition: none;
    }
  }
}

/* Sidebar filter input */
.dx-sidebar-filter-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.dx-sidebar-filter-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin: 0;
}

.dx-sidebar-filter {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  transition: border-color 0.2s ease;
}

.dx-sidebar-filter:focus {
  outline: none;
  border-color: var(--color-accent);
  background: var(--color-surface-raised);
}

.dx-sidebar-filter::placeholder {
  color: var(--color-text-muted);
}


/* ─────────────────────────────────────────────────────────
   Doc-site <details>/<summary> chevron — clean Lucide SVG
   ─────────────────────────────────────────────────────────
   The base classless.css draws a chevron with two rotated
   borders. That works in isolation but clashes whenever a
   doc page uses <details> in prose or in a demo, because
   the borders appear ALONGSIDE any custom chevron the page
   adds. Within the doc-site shell we replace the base
   chevron with a real Lucide chevron-down SVG so it always
   renders the same.

   Scope: only applies inside .dx-content (the doc-site
   article column) so it doesn't reach back into component
   demos that intentionally set their own.
   ───────────────────────────────────────────────────────── */

.dx-content details > summary::after {
  content: "";
  width: 16px;
  height: 16px;
  border: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transform: rotate(0deg);
  transition: transform 150ms;
  flex-shrink: 0;
}

.dx-content details[open] > summary::after {
  transform: rotate(180deg);
}
