/* ============================================================
   Component doc layout
   3-pane: left nav · center prose · sticky right example panel
   ============================================================ */

body { background: var(--body-bg); color: var(--text-primary); }

/* ─── Canvas (3-pane container) ─── */
.canvas {
  display: flex;
  min-height: 100vh;
}
.canvas.with-example-panel {
  --example-panel-width: 440px;
  height: 100vh;
}
.canvas.with-example-panel > .content {
  flex: 1; min-width: 0;
  overflow-y: auto;
  height: 100vh;
}
.canvas.with-example-panel > .example-panel {
  flex: 0 0 var(--example-panel-width);
  width: var(--example-panel-width);
  min-width: 320px; max-width: 65vw;
}
.canvas.with-example-panel.examples-expanded > .content { display: none; }
.canvas.with-example-panel.examples-expanded > .example-panel-resize { display: none; }
.canvas.with-example-panel.examples-expanded > .example-panel { flex: 1; width: 100%; max-width: none; }

/* Single-pane variant — left nav + center prose, no example panel.
   Used for narrative pages (Introduction, Getting started). */
.canvas.with-left-nav { height: 100vh; }
.canvas.with-left-nav > .content {
  flex: 1; min-width: 0;
  overflow-y: auto; height: 100vh;
  max-width: 980px;
}

@media (max-width: 1024px) {
  .canvas.with-example-panel { flex-direction: column; height: auto; }
  .canvas.with-example-panel > .content,
  .canvas.with-example-panel > .example-panel { width: 100%; flex: 1 1 auto; height: auto; }
  .canvas.with-example-panel > .example-panel-resize { display: none; }
}

/* ─── Left sidebar ─── */
.left-sidebar {
  width: 264px; flex-shrink: 0;
  background: var(--card-bg);
  border-right: 1px solid oklch(24% 0.073 260 / 0.08);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  overflow: hidden;
  z-index: 10;
}
.sidebar-logo {
  padding: 20px 22px 14px;
  border-bottom: 1px solid oklch(24% 0.073 260 / 0.06);
}
.sidebar-logo .title { font-size: 14px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.005em; }
.sidebar-logo .sub { font-size: 12px; color: var(--text-help); margin-top: 4px; }
.sidebar-search { padding: 12px 16px; border-bottom: 1px solid oklch(24% 0.073 260 / 0.06); }
.sidebar-search-input {
  position: relative;
}
.sidebar-search-input input {
  width: 100%; box-sizing: border-box;
  padding: 7px 10px 7px 30px;
  font: inherit; font-size: 12px; color: var(--text-primary);
  background: var(--surface-soft);
  border: 1px solid oklch(24% 0.073 260 / 0.10);
  border-radius: var(--radius-sm); outline: none;
}
.sidebar-search-input input:focus {
  border-color: var(--btn-primary);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--btn-primary) calc(14% * var(--tint-mult, 1)), transparent);
}
.sidebar-search-input svg {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--text-help); pointer-events: none;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding-bottom: 16px; }
.sidebar-nav-item, .sidebar-group-label {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; box-sizing: border-box;
  background: transparent; border: 0; cursor: pointer;
  font-family: inherit; text-align: left;
  padding: 10px 22px;
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  text-decoration: none;
  transition: background 0.12s;
}
.sidebar-nav-item:hover, .sidebar-group-label:hover { background: var(--row-hover); }
.sidebar-nav-item.active { color: var(--btn-primary); background: color-mix(in oklch, var(--btn-primary) calc(6% * var(--tint-mult, 1)), transparent); }
.sidebar-nav-item .nav-chevron, .sidebar-group-label .nav-chevron {
  width: 10px; height: 10px; color: var(--text-help);
  transition: transform 0.16s ease;
}
.sidebar-nav-item[aria-expanded="false"] .nav-chevron,
.sidebar-group-label[aria-expanded="false"] .nav-chevron { transform: rotate(-90deg); }

.sidebar-group-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-help);
  padding: 14px 22px 6px;
}
.sidebar-group-label:hover { color: var(--text-primary); background: transparent; }
.sidebar-group-body { padding-bottom: 6px; }
.sidebar-group-body.collapsed { display: none; }
.sidebar-group-body a {
  display: block;
  padding: 5px 22px 5px 32px;
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.sidebar-group-body a:hover { color: var(--text-primary); background: var(--row-hover); text-decoration: none; }
.sidebar-group-body a.active {
  color: var(--btn-primary); border-left-color: var(--btn-primary);
  background: color-mix(in oklch, var(--btn-primary) calc(4% * var(--tint-mult, 1)), transparent);
  font-weight: 600;
}
.sidebar-divider { margin: 8px 22px; border-top: 1px solid oklch(24% 0.073 260 / 0.06); }
.sidebar-footer {
  padding: 12px 22px;
  border-top: 1px solid oklch(24% 0.073 260 / 0.06);
  font-size: 11px; color: var(--text-help);
}

/* ─── Center content (.component-doc) ─── */
.content.component-doc {
  padding: 48px 56px 96px;
  background: var(--body-bg);
}
.component-doc .page-header { margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid oklch(24% 0.073 260 / 0.08); }
.component-doc .page-header-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-help); margin-bottom: 10px;
}
.component-doc .page-header-title {
  font-size: 32px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2;
  color: var(--text-primary); margin: 0 0 12px;
}
.component-doc .page-header-description {
  font-size: 15px; line-height: 1.6; color: var(--text-secondary); max-width: 680px;
}

.component-doc-body > section {
  padding: 15px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid oklch(24% 0.073 260 / 0.06);
  scroll-margin-top: 24px;
}
.component-doc-body > section:last-child { border-bottom: 0; margin-bottom: 0; }

/* On this page — anchor strip under the page header. Injected by docs.js
   when a page has four or more sections. */
.doc-toc {
  display: flex; align-items: baseline; gap: 14px;
  flex-wrap: wrap;
  margin: 0 0 28px;
  padding: 12px 0 14px;
  border-bottom: 1px solid oklch(24% 0.073 260 / 0.06);
}
.doc-toc-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-help);
  flex-shrink: 0;
}
.doc-toc ol {
  display: flex; flex-wrap: wrap; gap: 4px 18px;
  list-style: none; margin: 0; padding: 0;
}
.doc-toc li { margin: 0; padding: 0; }
.doc-toc a {
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.12s;
}
.doc-toc a:hover { color: var(--btn-primary); text-decoration: none; }

/* Related components — chip strip at the foot of the body, after the last
   section. Auto-injected by docs.js per the RELATED map. */
.related-components {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
  margin: 36px 0 0;
  padding: 18px 0 0;
  border-top: 1px dashed oklch(24% 0.073 260 / 0.12);
}
.related-components-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-help);
  flex-shrink: 0;
}
.related-components-list { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.related-components-list a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  font-size: 12.5px; font-weight: 500;
  color: var(--text-primary);
  background: var(--card-bg);
  border: 1px solid oklch(24% 0.073 260 / 0.10);
  border-radius: 999px;
  text-decoration: none;
  transition: color 0.12s, background 0.12s, border-color 0.12s, transform 0.12s;
}
.related-components-list a::after {
  content: '→'; color: var(--text-help); font-size: 11px; line-height: 1;
  transition: color 0.12s, transform 0.12s;
}
.related-components-list a:hover {
  color: var(--btn-primary);
  border-color: color-mix(in oklch, var(--btn-primary) 45%, oklch(24% 0.073 260 / 0.10));
  background: color-mix(in oklch, var(--btn-primary) 5%, var(--card-bg));
  text-decoration: none;
}
.related-components-list a:hover::after { color: var(--btn-primary); transform: translateX(1px); }
.component-doc h2 {
  font-size: 20px; font-weight: 700; letter-spacing: -0.015em;
  color: var(--text-primary);
  margin: 0 0 14px;
}
.component-doc h3 {
  font-size: 15px; font-weight: 600;
  color: var(--text-primary);
  margin: 24px 0 10px;
}
.component-doc p {
  font-size: 14px; line-height: 1.65; color: var(--text-secondary);
  max-width: 680px; margin: 0 0 14px;
}
.component-doc ul {
  margin: 0 0 16px; padding-left: 0; list-style: none;
}
.component-doc ul li {
  position: relative; padding: 5px 0 5px 22px;
  font-size: 14px; line-height: 1.6; color: var(--text-secondary);
  max-width: 680px;
}
.component-doc ul li::before {
  content: ''; position: absolute; left: 0; top: 13px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--btn-primary);
}
.component-doc ul li strong { color: var(--text-primary); font-weight: 600; }
.component-doc ul li code,
.component-doc p code {
  font-family: 'SF Mono', Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px; padding: 1.5px 6px;
  background: oklch(24% 0.073 260 / 0.06);
  border-radius: 4px; color: var(--text-primary);
}

/* Previous / Next pager — the last thing on every doc page. Two cells,
   direction label, page title, group. Injected by docs.js from NAV_GROUPS. */
.doc-pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin: 28px 0 0;
  padding-top: 24px;
  border-top: 1px solid oklch(24% 0.073 260 / 0.08);
}
.doc-pager-cell {
  display: flex; flex-direction: column; gap: 3px;
  padding: 14px 16px;
  background: var(--card-bg);
  border: 1px solid oklch(24% 0.073 260 / 0.08);
  border-radius: var(--radius-md);
  text-decoration: none; color: inherit;
  transition: border-color 0.12s, background 0.12s;
}
.doc-pager-cell.next { text-align: right; align-items: flex-end; }
.doc-pager-cell.empty { border: 0; background: transparent; }
.doc-pager-cell:hover {
  text-decoration: none;
  border-color: color-mix(in oklch, var(--btn-primary) 45%, oklch(24% 0.073 260 / 0.10));
  background: color-mix(in oklch, var(--btn-primary) 4%, var(--card-bg));
}
.doc-pager-dir {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-help);
}
.doc-pager-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.doc-pager-cell:hover .doc-pager-title { color: var(--btn-primary); }
.doc-pager-group { font-size: 12px; color: var(--text-help); }

/* ─── Properties / types tables ─── */
.fr-simple-table {
  width: 100%; border-collapse: collapse;
  margin: 0 0 8px;
  background: var(--card-bg);
  border: 1px solid oklch(24% 0.073 260 / 0.08);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.fr-simple-table th, .fr-simple-table td {
  padding: 10px 16px; text-align: left;
  font-size: 13px;
  border-bottom: 1px solid oklch(24% 0.073 260 / 0.06);
}
.fr-simple-table th {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-help);
  background: var(--surface-soft);
}
.fr-simple-table tbody tr:last-child td { border-bottom: 0; }
.fr-simple-table td code,
.fr-simple-table th code {
  font-family: 'SF Mono', Menlo, monospace; font-size: 12px;
  padding: 1px 5px; background: oklch(24% 0.073 260 / 0.06);
  border-radius: 4px; color: var(--text-primary);
}
.fr-simple-table td.nowrap { white-space: nowrap; }
.fr-simple-table tbody tr { transition: background 0.12s; }
.fr-simple-table tbody tr:hover { background: var(--row-hover); }
.scroll-on-mobile { overflow-x: auto; }

/* ─── Resize handle ─── */
.example-panel-resize {
  display: flex; align-items: center; justify-content: center;
  width: 10px; flex: 0 0 10px;
  cursor: col-resize; background: transparent;
  position: relative; z-index: 8;
  transition: background-color 0.15s ease;
}
.example-panel-resize::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: -6px; right: -6px;
}
.example-panel-resize:hover,
.example-panel-resize.dragging {
  background: color-mix(in oklch, var(--btn-primary) 8%, transparent);
}
.resize-handle-grip {
  width: 4px; height: 40px; border-radius: 4px;
  background: oklch(24% 0.073 260 / 0.18);
  transition: background 0.15s, height 0.15s;
}
.example-panel-resize:hover .resize-handle-grip,
.example-panel-resize.dragging .resize-handle-grip {
  background: var(--btn-primary); height: 56px;
}
body.resizing-panel { cursor: col-resize !important; user-select: none !important; }
body.resizing-panel * { cursor: col-resize !important; }
body.resizing-panel .example-panel-preview { pointer-events: none; }

/* ─── Example panel ─── */
.example-panel {
  display: flex; flex-direction: column;
  background: var(--surface-soft);
  border-left: 1px solid oklch(24% 0.073 260 / 0.08);
  height: 100vh;
  position: sticky; top: 0;
  overflow: hidden;
}
.example-panel-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  background: var(--card-bg);
  border-bottom: 1px solid oklch(24% 0.073 260 / 0.08);
  flex-shrink: 0;
}
.example-panel-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-help); flex-shrink: 0;
}
.example-panel-expand {
  width: 26px; height: 26px;
  border: 1px solid oklch(24% 0.073 260 / 0.10);
  border-radius: 5px;
  background: transparent; color: var(--text-help);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; flex-shrink: 0;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.example-panel-expand:hover { color: var(--text-primary); background: var(--row-hover); border-color: oklch(24% 0.073 260 / 0.18); }
.example-panel-expand.is-expanded { color: var(--btn-primary); border-color: var(--btn-primary); }
.example-panel-expand svg { width: 12px; height: 12px; }

.example-search-wrap { flex: 1; min-width: 0; position: relative; }
.example-search-input {
  width: 100%; box-sizing: border-box;
  padding: 6px 10px;
  font: inherit; font-size: 12.5px; font-weight: 500; color: var(--text-primary);
  background: var(--surface-soft);
  border: 1px solid oklch(24% 0.073 260 / 0.10);
  border-radius: 5px; outline: none;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.example-search-input:focus {
  border-color: var(--btn-primary);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--btn-primary) calc(14% * var(--tint-mult, 1)), transparent);
  cursor: text;
}
.example-search-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--card-bg);
  border: 1px solid oklch(24% 0.073 260 / 0.10);
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  z-index: 20;
  max-height: 280px; overflow-y: auto;
  padding: 4px;
}
.example-search-dropdown.hide { display: none; }
.example-search-option {
  display: block; width: 100%;
  background: transparent; border: 0;
  padding: 6px 10px; border-radius: 4px;
  font-family: inherit; font-size: 13px; font-weight: 500;
  text-align: left; color: var(--text-primary);
  cursor: pointer;
  transition: background 0.12s;
}
.example-search-option:hover { background: var(--row-hover); }
.example-search-option.active { background: color-mix(in oklch, var(--btn-primary) calc(10% * var(--tint-mult, 1)), transparent); color: var(--btn-primary); font-weight: 600; }
.example-search-option.filtered-out { display: none; }

.example-panel-preview {
  flex: 1 1 auto; min-height: 200px;
  padding: 28px;
  background: var(--card-bg);
  background-image: radial-gradient(circle, oklch(24% 0.073 260 / 0.08) 0.5px, transparent 0.5px);
  background-size: 16px 16px;
  overflow: auto;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.example-item {
  display: none;
  max-width: 100%; max-height: 100%;
}
.example-item.active { display: flex; flex-wrap: nowrap; gap: 12px; align-items: center; justify-content: center; }
.example-item.active[data-vert] { flex-direction: column; align-items: stretch; justify-content: flex-start; flex-wrap: nowrap; }

.example-panel-code {
  background: var(--surface-soft);
  border-top: 1px solid oklch(24% 0.073 260 / 0.08);
  flex-shrink: 0;
  max-height: 50%; overflow: hidden;
  display: flex; flex-direction: column;
}
.example-panel-code.collapsed { max-height: 36px; }
.example-panel-code.collapsed .example-panel-code-body { display: none; }
.example-panel-code-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--surface-soft);
  flex-shrink: 0;
}
.example-panel-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 0; padding: 0;
  font-family: inherit; cursor: pointer;
  color: var(--text-help);
}
.example-panel-toggle svg { width: 10px; height: 10px; transition: transform 0.16s ease; }
.example-panel-code.collapsed .example-panel-toggle svg { transform: rotate(-90deg); }
.example-panel-copy {
  margin-left: auto;
  width: 24px; height: 24px;
  background: transparent;
  border: 1px solid oklch(24% 0.073 260 / 0.10);
  border-radius: 4px;
  color: var(--text-help);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.example-panel-copy:hover { color: var(--text-primary); border-color: oklch(24% 0.073 260 / 0.18); background: var(--card-bg); }
.example-panel-copy.copied { color: oklch(51% 0.139 146); border-color: oklch(51% 0.139 146); }
.example-panel-copy svg { width: 12px; height: 12px; }
.example-panel-code-body { flex: 1; overflow: auto; }
.example-panel-code-body pre {
  margin: 0; padding: 12px 16px;
  font-family: 'SF Mono', Menlo, Monaco, Consolas, monospace;
  font-size: 12px; line-height: 1.6; color: var(--text-primary);
  white-space: pre; background: transparent;
}

/* ─── Doc-side mini renders (within Types tables) ─── */
.component-doc .mini-render {
  display: inline-flex; align-items: center; gap: 6px;
}

/* Back-to-top */
.back-to-top {
  position: fixed; right: 24px; bottom: 24px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid oklch(24% 0.073 260 / 0.10);
  box-shadow: var(--shadow-md);
  color: var(--text-secondary);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0; pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s, color 0.12s;
  z-index: 50;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { color: var(--btn-primary); }
.back-to-top svg { width: 14px; height: 14px; }

/* ============================================================
   Mobile (≤ 768px) — everything below is the mobile audit fix.
   The legacy 1024px breakpoint above keeps tablet behaviour; this
   block makes the docs site usable at phone widths.
   ============================================================ */
@media (max-width: 768px) {
  /* Release the 100vh trap — let the page scroll naturally instead
     of forcing each pane to its own scroll container. */
  .canvas,
  .canvas.with-example-panel,
  .canvas.with-left-nav { height: auto; min-height: 0; }
  .canvas.with-example-panel > .content,
  .canvas.with-left-nav > .content {
    height: auto;
    overflow-y: visible;
    max-width: 100%;
  }

  /* Tighter content padding — 31% horizontal padding on a 360px
     phone is unusable. */
  .content.component-doc {
    padding: 24px 16px 64px;
  }

  /* Page header scales down. */
  .component-doc .page-header-title { font-size: 24px; }
  .component-doc .page-header-description { font-size: 14.5px; }
  .component-doc h2 { font-size: 18px; }
  .component-doc h3 { font-size: 14.5px; margin-top: 18px; }
  .component-doc p,
  .component-doc ul li {
    font-size: 15px;
    max-width: 100%;
  }

  /* Sidebar — fully out of flow on mobile. Collapsed = 44×44 floating
     button at top-left; expanded = drawer overlay. The sidebar never
     occupies column space, so toggling it doesn't reflow content (the
     "page jumps down" bug from the original mobile pass). */
  .left-sidebar {
    position: fixed;
    left: 0; top: 46px;
    z-index: 40;
    border-right: 1px solid oklch(24% 0.073 260 / 0.08);
    transition: width 0.22s ease-out, height 0.22s ease-out, box-shadow 0.22s;
  }
  .left-sidebar.collapsed {
    width: 44px;
    height: 44px;
    box-shadow: 0 2px 8px oklch(24% 0.073 260 / 0.12);
    border-bottom-right-radius: 8px;
    overflow: hidden;
  }
  .left-sidebar:not(.collapsed) {
    width: min(85vw, 280px);
    height: calc(100vh - 46px);
    box-shadow: 0 6px 24px oklch(24% 0.073 260 / 0.18);
  }

  /* Touch targets — 44px minimum (Apple HIG / WCAG AAA). */
  .sidebar-nav-item,
  .sidebar-group-label,
  .sidebar-group-body a {
    padding-block: 12px;
    min-height: 44px;
    display: flex; align-items: center;
  }
  .sidebar-group-body a { padding-left: 36px; }

  /* Tables — horizontal scroll instead of viewport overflow. The
     .scroll-on-mobile rule above only covers wrapped tables; this
     handles every .fr-simple-table without needing HTML edits. */
  .component-doc .fr-simple-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .component-doc .fr-simple-table thead,
  .component-doc .fr-simple-table tbody {
    display: table;
    width: max-content;
    min-width: 100%;
  }
  .component-doc .fr-simple-table th,
  .component-doc .fr-simple-table td {
    padding: 8px 12px;
    font-size: 12.5px;
  }

  /* Example panel — release the 320px floor that pushes horizontal
     scroll on phones narrower than that. */
  .canvas.with-example-panel > .example-panel {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }
  .example-panel-preview { padding: 16px; min-height: 160px; }
  .example-panel-code-body pre { font-size: 11.5px; padding: 10px 12px; }

  /* Pager stacks; on-this-page strip and related chips wrap tighter. */
  .doc-pager { grid-template-columns: 1fr; }
  .doc-pager-cell.next { text-align: left; align-items: flex-start; }
  .doc-pager-cell.empty { display: none; }
  .doc-toc { gap: 10px; }
  .doc-toc ol { gap: 4px 14px; }
  .related-components { gap: 8px; }
  .related-components-list { gap: 6px; }
  .related-components-list a { padding: 6px 10px; font-size: 12px; }

  /* Back-to-top — respect iOS safe area + a tighter offset. */
  .back-to-top {
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    width: 40px; height: 40px;       /* a hair larger for touch */
  }
}

