/* docs-theme-extras component baseline.
   Always loaded. Brand-specific colors / fonts live in brand-oss.css and
   brand-enterprise.css and are layered on top via head-end.html based on
   Site.Params.themeExtras.brand. Per-repo overrides go in the consumer's
   own assets/css/custom.css (which Hextra concats into its main bundle). */

/* ── Theme color vars ────────────────────────────────────────────────── */
/* Defaults are Tailwind blue-500/600/400 — generic brand-neutral primary.
   Brand layers (brand-enterprise.css, brand-oss.css) override these to
   the consumer's actual palette. Component rules below reference
   var(--theme-primary*) so swapping the brand layer swaps the color. */
:root {
  --theme-primary:       #3b82f6;
  --theme-primary-hover: #2563eb;
  --theme-primary-tint:  rgba(59, 130, 246, 0.1);
}
.dark {
  --theme-primary:       #60a5fa;
  --theme-primary-tint:  rgba(96, 165, 250, 0.1);
}

/* ── Light/dark image toggle ─────────────────────────────────────────── */
/* reuse-image uses .toggle-dark (light-mode image), reuse-image-dark uses
   .toggle-light (dark-mode image). Match old theme behavior. */
.toggle-dark  { display: block; }
.toggle-light { display: none;  }
.dark .toggle-light { display: block; }
.dark .toggle-dark  { display: none;  }

/* ── Cards-shortcode grid wrapper handling ──────────────────────────────
   Both the auto-card partial and the {{< cards >}} shortcode emit a
   `.section-cards` container; the grid styling lives further down with
   the rest of the .section-card* rules.

   When a card is wrapped by Goldmark's <p> (e.g., a card inside a
   percent-form shortcode like `{{%% version %%}}{{< card >}}{{%% /version %%}}`),
   the <p> becomes the direct grid child. CSS grid stretches the <p>
   to row height, but the <a> card inside doesn't fill the <p>. Force
   any single-card-only <p> wrapper to flex so the card fills it. */
.section-cards > p:has(> .section-card:only-child) {
  display: flex;
  margin: 0;
}
.section-cards > p:has(> .section-card:only-child) > .section-card {
  flex: 1;
}

/* ── Version banner ──────────────────────────────────────────────────── */
/* Matches old alert-info banner styling */
.version-banner {
  background: hsl(204, 45.5%, 97.8%);
  border: 1px solid #dee2e6;
  border-radius: 4px;
  color: var(--tw-prose-body, #374151);
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
  line-height: 1.5;
}

.version-banner p {
  margin: 0 !important;
}

.dark .version-banner {
  background: hsla(210, 100%, 50%, 0.1);
  border-color: #1e3a5f;
  color: #d1d5db;
}

/* ── Alerts and callouts ─────────────────────────────────────────────── */
/* Matches old docs-theme-lotus alert styling with Material Icons */
.solo-alert {
  display: flex;
  gap: 0.5rem;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: inherit;
}

.solo-alert-icon {
  flex-shrink: 0;
}

.solo-alert-icon .material-icons {
  font-size: 20px;
  vertical-align: middle;
}

.solo-alert-body {
  flex: 1;
  min-width: 0;
}

.solo-alert-body p {
  margin: 0 !important;
}

/* Alert color variants — light mode */
.alert-info    { background: hsl(204, 45.5%, 97.8%); }
.alert-warning { background: hsl(48, 100%, 96%); }
.alert-success { background: hsl(140, 50%, 96%); }
.alert-danger  { background: hsl(0, 70%, 97%); }
.alert-default { background: hsl(226, 68%, 95.1%); }

.alert-info .solo-alert-icon    { color: var(--theme-primary); }
.alert-warning .solo-alert-icon { color: #d97706; }
.alert-success .solo-alert-icon { color: #059669; }
.alert-danger .solo-alert-icon  { color: #dc2626; }
.alert-default .solo-alert-icon { color: #6b7280; }

/* Alert color variants — dark mode */
.dark .solo-alert { border-color: #374151; color: #d1d5db; }
.dark .alert-info    { background: hsla(210, 100%, 50%, 0.1); }
.dark .alert-warning { background: hsla(48, 100%, 50%, 0.1); }
.dark .alert-success { background: hsla(160, 100%, 40%, 0.1); }
.dark .alert-danger  { background: hsla(0, 100%, 50%, 0.1); }
.dark .alert-default { background: hsla(226, 68%, 50%, 0.05); }
.dark .alert-info .solo-alert-icon    { color: #60a5fa; }
.dark .alert-warning .solo-alert-icon { color: #fbbf24; }
.dark .alert-success .solo-alert-icon { color: #34d399; }
.dark .alert-danger .solo-alert-icon  { color: #f87171; }
.dark .alert-default .solo-alert-icon { color: #9ca3af; }

/* ── Copy as Markdown button ─────────────────────────────────────────── */
.copy-md-wrapper {
  display: inline-flex;
}

.copy-md-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
  background: transparent;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}

.copy-md-btn:hover {
  color: var(--theme-primary);
  border-color: var(--theme-primary);
}

.copy-md-btn.copied {
  color: #059669;
  border-color: #059669;
}

.copy-md-icon {
  font-size: 14px !important;
  width: 14px !important;
  height: 14px !important;
}

.copy-md-source {
  display: none !important;
}

.dark .copy-md-btn {
  color: #9ca3af;
  border-color: #4b5563;
}
.dark .copy-md-btn:hover {
  color: var(--theme-primary);
  border-color: var(--theme-primary);
}
.dark .copy-md-btn.copied {
  color: #34d399;
  border-color: #34d399;
}

/* ── Full-width layout ───────────────────────────────────────────────── */
/* Wide layout — large enough to feel flush but bounded so TOC stays visible */
:root {
  --hextra-max-page-width: 100%;
  --hextra-max-navbar-width: 100%;
}

/* Show TOC at smaller viewport widths (default is xl/1280px) */
.hextra-toc {
  display: none;
}
@media (min-width: 1024px) {
  .hextra-toc {
    display: block !important;
  }
}

/* ── Typography ──────────────────────────────────────────────────────── */
/* Heading weight is component-shaped (lighter than hextra default). Heading
   *colors* are brand-specific and live in brand-{oss,enterprise}.css. */
.content h1, .content h2, .content h3, .content h4, .content h5, .content h6 {
  font-weight: 600 !important;
}

.content h1 {
  padding-top: 1.75rem;
}

/* Ensure spacing after headings even when followed by non-paragraph text (e.g. reuse snippets) */
.content h2, .content h3, .content h4, .content h5, .content h6 {
  margin-bottom: 1rem;
}

/* Body text size matching old theme — scoped to main content, not sidebar */
#content > .content p, #content > .content li {
  font-size: 1rem;
  line-height: 1.7;
}

/* ── Links ───────────────────────────────────────────────────────────── */
/* Link weight is component-shaped (consistent across brands). Link colors
   live in brand-{oss,enterprise}.css. */
.content a {
  font-weight: 500;
}

/* ── Code block highlighted lines ────────────────────────────────────── */
/* Expand code to the widest line. With .hl using width:max-content below,
   code's intrinsic max-content is unambiguously the widest line's text width
   (no circular dependency). .hl's min-width:100% then references this
   expanded code width, giving all highlights uniform width. */
.chroma pre > code {
  display: block;
  min-width: max-content;
}

.chroma .line.hl {
  display: block;
  width: max-content;
  min-width: 100%;
  background-color: var(--theme-primary-tint);
}

/* Line-number highlight: put the background on the .hl wrapper that contains
   .lnt (structure is <span class="hl"><span class="lnt">N</span></span>), so it
   spans the full line-number cell — not just the digit text. */
.chroma .lntable .hl:not(.line) {
  display: block;
  background-color: var(--theme-primary-tint);
}

/* Strip horizontal padding from <pre>s inside lntable so the line-number and
   code highlights meet flush and span the cell width uniformly. Hextra's own
   padding on .lnt / .hl provides breathing room within the highlight area. */
.content .chroma .lntable pre {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Remove gap between line number and code columns */
.lntable {
  border-spacing: 0 !important;
  border-collapse: collapse !important;
}

.lntd {
  vertical-align: top !important;
  padding: 0 !important;
  border: 0 !important;
}

/* Remove right padding/margin on line number column */
.lntd:first-child {
  padding-right: 0 !important;
}

/* Remove left padding/margin on code column */
.lntd:last-child {
  padding-left: 0 !important;
}

/* ── Ordered lists (numbered steps) ──────────────────────────────────── */
/* Matches old docs-theme-lotus: grey background square with number */
#content > .content ol {
  list-style: none;
  padding-left: 0;
}

/* Flush top-level steps to the content edge. Hextra's prose adds
   margin-left: 1.5rem on every ol; we keep that for nested ols (which
   should stay indented under their parent step) but zero it for the
   first level. `ol:not(li ol)` matches ols that aren't inside any li. */
#content > .content ol:not(li ol) {
  margin-left: 0;
}

#content > .content ol > li {
  position: relative;
  padding-left: 27px;
  margin-top: 1rem;
  margin-left: 0;
}

#content > .content ol > li::before {
  content: counter(list-item);
  background: #ebf4f9;
  color: #343a40;
  font-size: 12px;
  font-weight: 500;
  line-height: 10px;
  text-align: center;
  padding: 5px 0;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  position: absolute;
  left: 0;
  top: 3px;
}

.dark #content > .content ol > li::before {
  background: #374151;
  color: #d1d5db;
}

/* Nested ordered lists: lowercase letters.
   `:not([start])` so that an explicit `<ol start="N">` continues the
   counter from the prior sibling nested ol — needed when a list-item's
   content includes a block (HTML pre, etc.) that Goldmark renders
   outside the parent <li>, splitting one logical list into two
   sibling <ol>s. Without this, item 9 after the split would render
   as "a" instead of "i". */
#content > .content ol ol:not([start]) {
  counter-reset: sublistitem;
}

#content > .content ol ol > li {
  counter-increment: sublistitem list-item 0;
}

#content > .content ol ol > li::before {
  content: counter(sublistitem, lower-alpha);
}

/* Doubly-nested ordered lists: lowercase roman numerals */
#content > .content ol ol ol:not([start]) {
  counter-reset: subsublistitem;
}

#content > .content ol ol ol > li {
  counter-increment: subsublistitem list-item 0;
}

#content > .content ol ol ol > li::before {
  content: counter(subsublistitem, lower-roman);
}

/* ── Sidebar ─────────────────────────────────────────────────────────── */
/* Tighten sidebar font to match old theme */
.hextra-sidebar-container {
  font-size: 0.875rem;
}

/* Hide the sidebar's scrollable content briefly on first paint to avoid the
   visible "scrolled to top → jump to active item" flash. Hextra's
   sidebar.js sets scrollTop on DOMContentLoaded; head-end.html adds the
   .sidebar-loading class during <head> parse and removes it via rAF
   after DCL, so the sidebar reveals at the correct scroll position. */
html.sidebar-loading .hextra-sidebar-container .hextra-scrollbar {
  visibility: hidden;
}

/* Product logo in sidebar */
.sidebar-product-logo {
  padding: 0.5rem 0 0.25rem;
}

/* Short, centered hairline beneath the logo. A full-width border-bottom
   read as an unfinished frame edge (no matching rule on the right or
   bottom to terminate it), so this inset rule reads as decoration
   between sections instead. */
.sidebar-product-logo::after {
  content: "";
  display: block;
  width: 85%;
  height: 1px;
  margin: 0.75rem auto 0;
  background: #e5e7eb;
}

.sidebar-product-logo img {
  width: 108%;
  max-width: 108%;
  height: auto;
}

.sidebar-logo-light { display: block; }
.sidebar-logo-dark { display: none; }
.dark .sidebar-logo-light { display: none; }
.dark .sidebar-logo-dark { display: block; }
.dark .sidebar-product-logo::after { background: #374151; }

/* In the mobile slide-in panel the sidebar is a fixed 280px, so the desktop
   logo overscan (width: 108% above) overflows the panel and crowds the logo
   against the right edge. Below xl, fit the logo inside the panel and give it
   symmetric horizontal padding so it sits centered with breathing room. The
   desktop (>= 1280px) sidebar keeps its overscan. */
@media (max-width: 1279px) {
  .sidebar-product-logo {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .sidebar-product-logo img {
    width: 100%;
    max-width: 100%;
  }
}

/* Darken sidebar link text */
.hextra-sidebar-container .hextra-sidebar-item a {
  color: #1f2937 !important;
}
.dark .hextra-sidebar-container .hextra-sidebar-item a {
  color: #d1d5db !important;
}

/* Nested sidebar children: indent + left border so the parent/child
   hierarchy reads visually. Matches the agw-oss sidebar design (0.75rem
   indent on both margin and padding, hairline left border). Applied to
   every <ul> inside another <ul> within .sidebar-container so the rule
   covers kgateway's recursive sidebar template AND any consumer using
   hextra's default sidebar — neither template needs to ship inline
   margins for nested levels. */
.sidebar-container ul ul {
  margin-left: 0.75rem;
  margin-top: 0.25rem;
  padding-left: 0.75rem;
  border-left: 1px solid #e5e7eb;
}
.dark .sidebar-container ul ul {
  border-left-color: #374151;
}

/* Sidebar active item — matches old theme's grey instead of hextra's blue tint */
.hextra-sidebar-container .hextra-sidebar-active-item {
  background-color: #e8eaed !important;
  color: #1f2937 !important;
  border-radius: 6px !important;
}
.dark .hextra-sidebar-container .hextra-sidebar-active-item {
  background-color: #363c47 !important;
  color: #d1d5db !important;
}
/* Sidebar hover — matches old theme */
.hextra-sidebar-container .hextra-sidebar-item a:hover {
  background-color: #eff1f4 !important;
}
.dark .hextra-sidebar-container .hextra-sidebar-item a:hover {
  background-color: #2b303b !important;
}

/* ── Figure images in dark mode ──────────────────────────────────────────
   No automatic white-card wrapper. Authors that need a dark-mode variant
   of a screenshot use `reuse-image-dark` (wraps the dark image in
   `<div class="toggle-light">`, shown only on dark pages). Images without
   a dark variant render as-is on dark pages. Mermaid diagrams use
   Mermaid's built-in dark theme; see layouts/partials/scripts/mermaid.html. */

/* ── Solo footer ─────────────────────────────────────────────────────── */
.solo-footer {
  border-top: 1px solid #e5e7eb;
  padding: 1rem 1.5rem 1.25rem;
  background: #fff;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #6b7280;
}
.solo-footer-inner {
  max-width: var(--hextra-max-page-width, 100%);
  margin: 0 auto;
  text-align: center;
}
.solo-footer p {
  margin: 0;
}
.dark .solo-footer {
  background: transparent;
  border-top-color: rgba(255, 255, 255, 0.1);
  color: #9ca3af;
}

#solo-back-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--theme-primary);
  color: #fff;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 30;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
#solo-back-to-top:hover {
  background: var(--theme-primary-hover);
  transform: translateY(-1px);
}
#solo-back-to-top[hidden] {
  display: none;
}
.dark #solo-back-to-top {
  background: #2b3340;
  color: #d1d5db;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.dark #solo-back-to-top:hover {
  background: #3a4350;
}

/* ── TOC (right-hand "On this page" nav) ────────────────────────────────
   Rendered by layouts/_partials/toc.html. Class hooks are .solo-toc-*
   (plus the outer hextra-toc wrapper that hextra owns). Centralized
   from kgateway + agentgateway-oss inline styles so the right rail
   matches across both sites. */

.solo-toc-inner {
  position: sticky;
  top: 4rem;
  overflow-y: auto;
  padding-right: 1rem;
  padding-top: 0.5rem;
  font-size: 0.875rem;
  hyphens: auto;
  max-height: calc(100vh - var(--navbar-height) - env(safe-area-inset-bottom));
  margin-right: -1rem;
}
.solo-toc-heading {
  margin-top: 0.1875rem;
  margin-bottom: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.solo-toc-sublist {
  margin-left: 1rem;
  margin-top: 0.25rem;
}
.solo-toc-item {
  margin: 0.5rem 0;
  scroll-margin-top: 1.5rem;
  scroll-padding-top: 1.5rem;
}
.solo-toc-link {
  display: inline-block;
  width: 100%;
  word-break: break-word;
  color: #6b7280;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 400 !important;
  padding: 2px 8px;
  transition: none !important;
}
.dark .solo-toc-link {
  color: #9ca3af;
}
.solo-toc-link:hover {
  color: inherit !important;
  background-color: #f5f6f8;
  border-radius: 6px;
}
.dark .solo-toc-link:hover {
  background-color: #2b303b;
}
.solo-toc-link.toc-active {
  color: #111827 !important;
  background-color: #e8eaed;
  border-radius: 6px;
}
.dark .solo-toc-link.toc-active {
  color: #f9fafb !important;
  background-color: #363c47;
}

/* Sticky footer of the TOC (back-to-top + future links). Background is
   transparent so it reveals whatever page/brand background is painted behind
   it (kgw dark #111, agw-oss dark #030712, light-mode white) rather than
   hardcoding one dark hex that only matches a single brand. Tradeoff: no
   solid-fill fade for TOC links that scroll behind it. */
.solo-toc-bottom {
  margin-top: 2rem;
  border-top: 1px solid #e5e7eb;
  padding-top: 2rem;
  padding-bottom: 2rem;
  position: sticky;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  background: transparent;
}
.dark .solo-toc-bottom {
  border-top-color: #374151;
}
.solo-toc-back-to-top {
  font-size: 0.75rem;
  font-weight: 500;
  color: #6b7280;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  /* opacity transitions the hx:opacity-0 reveal/hide toggled by Hextra's
     main.js on scroll; color handles hover. */
  transition: color 0.15s, opacity 0.15s;
}
.solo-toc-back-to-top:hover {
  color: #111827;
}
.dark .solo-toc-back-to-top {
  color: #9ca3af;
}
.dark .solo-toc-back-to-top:hover {
  color: #e5e7eb;
}
.solo-toc-back-to-top svg {
  display: inline;
  height: 0.875rem;
  width: 0.875rem;
  border: 1px solid #9ca3af;
  border-radius: 9999px;
  margin-left: 0.25rem;
}
.dark .solo-toc-back-to-top svg {
  border-color: #6b7280;
}

/* ── Page description (subtitle under <h1>) ──────────────────────────── */
/* Auto-rendered from front matter `description` by docs/single.html and
   docs/list.html. Matches the lead-paragraph styling from docs-theme-lotus. */
.page-description {
  font-size: 1.125rem;
  line-height: 1.6;
  color: #6b7280;
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
}
.dark .page-description {
  color: #9ca3af;
}

/* ── Copy-as-Markdown only blocks ────────────────────────────────────── */
/* Content emitted purely for transform.HTMLToMarkdown to capture (e.g. an
   OpenAPI summary inside the openapi shortcode). Hidden from readers but
   visible to the "Copy as Markdown" extraction. */
.copy-md-only {
  display: none !important;
}

/* ── Code blocks ─────────────────────────────────────────────────────── */
/* Match old theme: white background in light mode, dark grey in dark mode */
.content pre {
  border-radius: 6px;
  padding: 1rem;
  background-color: #fff !important;
  border: 1px solid #e5e7eb;
}

.content .highlight pre,
.content .chroma {
  background-color: #fff !important;
}

/* Syntax-highlighted blocks with line numbering: put the border/radius
   on the outer .chroma wrapper so lntable's two-cell layout renders as
   a single box, not one border per <pre>. Inner <pre>s keep their
   padding for code spacing.

   Scoped to `div.chroma` because Hugo emits `<pre class="chroma">` for
   plain blocks and `<div class="chroma">` for line-numbered ones. The
   non-`div` form is the <pre> itself; applying overflow:hidden there
   killed horizontal scroll on every plain code block. */
.content div.chroma {
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}
.content div.chroma pre {
  border: 0 !important;
  border-radius: 0 !important;
}

.dark .content pre {
  background-color: #1a1a2e !important;
  border-color: #374151;
}

.dark .content .highlight pre,
.dark .content .chroma {
  background-color: #1a1a2e !important;
}

.dark .content div.chroma {
  border-color: #374151;
}

/* Chroma error tokens get a light background in the default theme.
   Clear it in dark mode so code blocks don't show light patches
   (common when non-JSON content is fenced as ```json). */
.dark .chroma .err {
  background-color: transparent !important;
}

/* ── Footnotes ───────────────────────────────────────────────────────── */
/* Goldmark emits `<hr class="footnotes-sep">` immediately before a
   footnotes section. The horizontal line clashes with our typography
   (tables already have a bottom border, headings have spacing) and reads
   as a visual artifact rather than a structural separator. Hide it; the
   `<section class="footnotes">` heading already separates the block. */
.footnotes-sep,
hr.footnotes-sep,
.footnotes > hr:first-child {
  display: none;
}

/* ── Tables ──────────────────────────────────────────────────────────── */
/* Match old table styling */
.content .table-wrapper {
  margin-top: 1rem;
}
.content table {
  font-size: 0.9375rem;
}
.content table th {
  font-weight: 600;
}
/* Tailwind preflight sets img{display:block} and the Hextra typography layer
   adds margin:1rem auto to all content images — override both for inline
   badge images (e.g. shields.io) used inside table cells. */
.content table td img {
  display: inline;
  vertical-align: middle;
  margin: 0 2px;
}

/* Responsive table wrapper styling (the wrapper itself comes from
   _markup/render-table.html, which inlines `overflow-x` for safety). These
   rules add the cell padding/border treatment that the inline style alone
   doesn't cover. */
.table-wrapper {
  margin: 1.5rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-wrapper table {
  width: 100%;
  table-layout: auto;
  border-collapse: collapse;
}
.table-wrapper th,
.table-wrapper td {
  padding: 0.5rem 0.75rem;
  border: 1px solid #e5e7eb;
  white-space: normal;
  word-wrap: break-word;
}
.dark .table-wrapper th,
.dark .table-wrapper td {
  border-color: #374151;
}

/* ── Section cards (auto-generated on list pages) ────────────────────── */
/* Replicates the docs-theme-lotus card grid on parent sections */
.section-cards {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: auto;
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (min-width: 640px) {
  .section-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .section-cards {
    /* --section-cards-cols is set inline by the {{< cards >}} shortcode
       when an author passes a `cols=N` attribute. Auto-card grids leave
       it unset and fall back to 3. */
    grid-template-columns: repeat(var(--section-cards-cols, 3), 1fr);
    grid-auto-rows: 1fr;
  }
}

.section-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  height: 100%;
  /* Prevent the grid cell from expanding to the image's intrinsic width.
     Without this, a wide-aspect SVG with no explicit dimensions (only a
     viewBox) can force all 1fr columns wider than the available space in
     Firefox and WebKit. */
  min-width: 0;
}

.section-card:hover {
  border-color: var(--theme-primary);
  box-shadow: 0 2px 8px var(--theme-primary-tint);
}

/* Icons. Auto-cards emit <i class="material-icons section-card-icon">
   (font icon, sized via font-size); the {{< card >}} shortcode emits an
   inline <svg class="section-card-icon"> via utils/icon.html. Cover both. */
.section-card-icon {
  font-size: 28px;
  color: var(--theme-primary);
  flex-shrink: 0;
  margin-top: 2px;
}
svg.section-card-icon {
  width: 28px;
  height: 28px;
  margin-bottom: 0.25rem;
}

/* Optional leading image for manual cards ({{< card image="..." >}}). */
.section-card-image {
  max-height: 4rem;
  max-width: 100%;
  width: auto;
  object-fit: contain;
  margin-bottom: 1rem;
  align-self: flex-start;
}

/* The body wrapper is a <div> in auto-cards (block by default) and a
   <span class="section-card-body"> in shortcode-rendered cards (to stay
   valid HTML inside a Goldmark-added <p>). Force flex column on both. */
.section-card-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

/* Title + desc are <p> in auto-cards and <span> in shortcode cards.
   display: block makes the span behave like a block so the margins
   below apply. */
.section-card-title {
  display: block;
  font-size: 1rem !important;
  font-weight: 600 !important;
  margin: 16px 0 4px !important;
  color: #111827;
}

.section-card-desc {
  display: block;
  font-size: 0.75rem !important;
  color: #374151;
  margin: 0 !important;
  line-height: 1.5;
}
/* When the shortcode passes the subtitle through markdownify, Goldmark
   may wrap the rendered prose in a <p> inside the .section-card-desc
   <span>. That nested <p> picks up the default browser margins and
   spaces the description awkwardly. Zero them. */
.section-card-desc > p {
  margin: 0 !important;
}

.section-card-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e5e7eb;
  color: #374151;
  vertical-align: middle;
  margin-left: 4px;
}

.section-card-badge.badge-tag {
  background: #dbeafe;
  color: #1e40af;
}

.section-card-badge.badge-oss {
  background: #d1fae5;
  color: #065f46;
}

/* Section cards dark mode */
.dark .section-card {
  border-color: #374151;
}

.dark .section-card:hover {
  border-color: var(--theme-primary);
  box-shadow: 0 2px 8px var(--theme-primary-tint);
}

.dark .section-card-title {
  color: #f3f4f6;
}

.dark .section-card-desc {
  color: #9ca3af;
}

.dark .section-card-badge {
  background: #374151;
  color: #d1d5db;
}

.dark .section-card-badge.badge-tag {
  background: #1e3a5f;
  color: #93c5fd;
}

.dark .section-card-badge.badge-oss {
  background: #064e3b;
  color: #6ee7b7;
}

/* ── Page title badges (Enterprise / Alpha / Beta / etc.) ────────────── */
.page-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.page-badges .section-card-badge {
  margin-left: 0;
}

/* ── Sidebar nav badges (Enterprise / Open Source) ───────────────────── */
.sidebar-badge {
  display: inline-block;
  font-size: 0.4375rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 1px 3px;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 2px;
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1.4;
}

.sidebar-badge-enterprise {
  background: #1f2937;
  color: #f9fafb;
}

.sidebar-badge-oss {
  background: #d1fae5;
  color: #065f46;
}

.dark .sidebar-badge-enterprise {
  background: #4b5563;
  color: #f9fafb;
}

.dark .sidebar-badge-oss {
  background: #064e3b;
  color: #6ee7b7;
}

/* ── Sidebar icons ───────────────────────────────────────────────────── */
/* Material Symbols in sidebar — matches old docs-theme-lotus */
.material-icons {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  display: inline-block;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;
}

.sidebar-icon {
  font-size: 20px;
  width: 24px;
  height: 24px;
  margin-right: 6px;
  opacity: 0.7;
  flex-shrink: 0;
}

/* Keep icon + text left-aligned */
.hextra-sidebar-item a:has(.sidebar-icon) {
  justify-content: flex-start !important;
}

/* ── Version dropdown ────────────────────────────────────────────────── */
/* Replicates the docs-theme-lotus version switcher styling */

.version-dropdown {
  position: relative;
}

/* Below xl (1280px) the mobile slide-out sidebar renders its own version
   selector (.sidebar-mobile-version-row), so hide the navbar version dropdown
   there to avoid showing it in two places on mobile. Scoped to pages that
   actually have a slide-out panel, so landing / non-docs pages keep the navbar
   dropdown as their only selector. The 1279px bound matches the
   .sidebar-mobile-panel breakpoint. The dropdown stays on desktop (>= 1280px). */
@media (max-width: 1279px) {
  body:has(.sidebar-mobile-panel) .version-dropdown {
    display: none !important;
  }
}

.version-product-name {
  display: none;
}

@media (min-width: 768px) {
  .version-product-name {
    display: inline;
  }
}

.version-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  color: inherit;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}

.version-dropdown-btn:hover {
  color: var(--theme-primary);
}

.version-dropdown-btn svg {
  transition: transform 0.2s;
}

.version-dropdown.open .version-dropdown-btn svg {
  transform: rotate(180deg);
}

/* Menu — hidden by default, shown when .open is on parent */
.version-dropdown-menu {
  display: none !important;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 180px;
  max-height: 300px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 4px 0;
  z-index: 50;
  list-style: none;
}

.version-dropdown.open .version-dropdown-menu {
  display: block !important;
}

.version-dropdown-item {
  display: block;
  padding: 8px 16px;
  font-size: 0.875rem;
  color: #374151;
  text-decoration: none;
  transition: color 0.15s;
}

.version-dropdown-item:hover {
  color: var(--theme-primary);
  background: #f9fafb;
}

/* ── Version dropdown dark mode ──────────────────────────────────────── */
.dark .version-dropdown-btn {
  color: #d1d5db;
}

.dark .version-dropdown-btn:hover {
  color: var(--theme-primary);
}

.dark .version-dropdown-menu {
  background: #1a1a1a;
  border-color: #333;
}

.dark .version-dropdown-item {
  color: #d1d5db;
}

.dark .version-dropdown-item:hover {
  color: var(--theme-primary);
  background: #262626;
}

.version-dropdown-divider {
  height: 0;
  margin: 4px 0;
  border-top: 1px solid #e5e7eb;
}

.dark .version-dropdown-divider {
  border-color: #444;
}

.version-dropdown-header {
  padding: 6px 16px 2px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dark .version-dropdown-header {
  color: #9ca3af;
}

.version-dropdown-hidden {
  padding: 2px 16px;
  font-size: 0;
  line-height: 0;
}

/* Search: "Other versions" collapsible section */
.hextra-search-other-versions {
  border-top: 1px solid #e5e7eb;
  margin-top: 4px;
}
.dark .hextra-search-other-versions {
  border-top-color: #374151;
}
.hextra-search-other-versions > summary {
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  user-select: none;
}
.hextra-search-other-versions > summary::-webkit-details-marker {
  display: none;
}
.hextra-search-other-versions > summary::before {
  content: '▶ ';
  font-size: 0.6rem;
  vertical-align: middle;
  margin-right: 2px;
}
details[open].hextra-search-other-versions > summary::before {
  content: '▼ ';
}
.dark .hextra-search-other-versions > summary {
  color: #9ca3af;
}
.hextra-search-other-versions > ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ── Hextra v0.12 missing compiled variants ──────────────────────────── */
/* hextra's compiled main.css includes hx:dark:block but not its responsive
   variants. These are used in navbar-title.html for the dark-mode logos. */
@media (min-width: 48rem) {
  .hx\:md\:dark\:block:where(.dark, .dark *) { display: block; }
}
@media not all and (min-width: 48rem) {
  .hx\:max-md\:dark\:block:where(.dark, .dark *) { display: block; }
}

/* ── Print styles ─────────────────────────────────────────────────────── */
@media print {
  @page { margin: 1.5cm 2cm; }

  /* Hide UI chrome — sidebar/TOC already have hx:print:hidden from hextra */
  .copy-md-wrapper,
  .nav-container,
  .hextra-nav-container,
  footer,
  .hextra-component-issue,
  [class*="pager"],
  [class*="page-feedback"],
  [class*="last-updated"],
  [class*="comments"],
  #chatbot-container { display: none !important; }

  /* Let article fill the printable area */
  body, html { overflow: visible !important; }
  article {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-right: 0 !important;
    min-height: 0 !important;
  }
  article > main {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Fix the main cause: code blocks clip at the paper edge on screen overflow */
  pre, code {
    white-space: pre-wrap !important;
    overflow: visible !important;
    word-break: break-word !important;
    max-width: 100% !important;
  }

  /* Chroma lntable: the general pre/code rules above collapse the line-number
     column at page breaks, causing two-digit numbers to split across lines.
     Undo word-break and max-width constraints for that column only. */
  .lntable { width: 100%; }
  .lntable .lntd:first-child pre,
  .lntable .lntd:first-child code {
    white-space: pre !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    max-width: none !important;
    min-width: 2.5em;
  }

  /* Avoid breaking inside short blocks; don't force headings to next page */
  blockquote, figure, img { break-inside: avoid; }
}

/* ──────────────────────────────────────────────────────────────────────
 * Tailwind 4 hx: utility fallbacks.
 *
 * Hextra v0.12.3 ships a precompiled main.css generated from its own
 * template scan. Utilities Hextra doesn't use internally aren't in the
 * bundle — so any class extras' or a consumer's templates emit that
 * Hextra doesn't happen to use silently no-ops.
 *
 * These rules fill the specific gaps extras' own templates introduce
 * (currently the taller navbar height). They use Hextra's --hx-spacing
 * token so they track the same scale.
 * ────────────────────────────────────────────────────────────────────── */

.hx\:h-20 { height: calc(var(--hx-spacing) * 20) }
.hx\:h-24 { height: calc(var(--hx-spacing) * 24) }

/* Navbar bottom border. Hextra's navbar template emits an arbitrary-value
   shadow class — `hx:shadow-[0_2px_4px_rgba(0,0,0,.02),0_1px_0_rgba(0,0,0,.06)]`
   — to paint a subtle bottom hairline + soft drop shadow. Hextra's
   precompiled bundle does NOT include this class (the comma + bracket
   form gets skipped by their template scanner), so the navbar renders
   without any separation from content. The matching `dark:` and
   `contrast-more:` variants are also missing. Rebuild them as direct
   rules on .nav-container-blur. */
.nav-container-blur {
  box-shadow: 0 2px 4px rgba(0,0,0,.02), 0 1px 0 rgba(0,0,0,.06);
}
:where(.dark, .dark *) .nav-container-blur {
  box-shadow: 0 -1px 0 rgba(255,255,255,.1) inset;
}
@media (prefers-contrast: more) {
  .nav-container-blur { box-shadow: 0 0 0 1px #000; }
  :where(.dark, .dark *) .nav-container-blur { box-shadow: 0 0 0 1px #fff; }
}

/* ── Breadcrumb ─────────────────────────────────────────────────────────
   Rendered by layouts/_partials/breadcrumb.html. The partial emits plain
   class hooks (no Tailwind utilities) so styling doesn't depend on
   Hextra's precompiled bundle picking up the right variants. */
.solo-breadcrumb {
  margin-top: 0.1875rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: #6b7280;
  flex-wrap: wrap;
}
.solo-breadcrumb-home,
.solo-breadcrumb-link {
  color: #6b7280;
  text-decoration: none;
}
.solo-breadcrumb-home {
  display: flex;
  align-items: center;
}
.solo-breadcrumb-link:hover,
.solo-breadcrumb-home:hover {
  color: #374151;
}
.solo-breadcrumb-sep {
  color: #d1d5db;
}
.dark .solo-breadcrumb,
.dark .solo-breadcrumb-home,
.dark .solo-breadcrumb-link {
  color: #9ca3af;
}
.dark .solo-breadcrumb-sep {
  color: #4b5563;
}
.dark .solo-breadcrumb-link:hover,
.dark .solo-breadcrumb-home:hover {
  color: #e5e7eb;
}

/* ── Navbar dropdowns ────────────────────────────────────────────────────
   Hover-based dropdowns in the top navbar (e.g. version switcher, "Docs"
   sub-menu). Each `<div class="dropdown">` wraps a trigger element plus a
   `<div|ul class="dropdown-content navbar-dropdown-content">` popover.
   Hover on the parent shows the popover.

   This used to live in kgateway's _partials/navbar.html and a near-
   identical copy in agentgateway-oss-website's partials/nav.html. Moved
   here so a single rule applies to both consumers (and any future ones).
   Note: agw's local copy can be deleted on the next docs-theme-extras
   release bump.

   `font` is explicitly inherited on the trigger to defeat the user-agent
   stylesheet's button defaults — without this, Safari ships a slightly
   heavier weight on `<button>` triggers than on sibling `<a>` triggers,
   making the version dropdown visually taller and bolder than the Docs
   dropdown trigger right next to it. */
.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-content {
  display: none;
  min-width: 160px;
}
.dropdown:hover .dropdown-content {
  display: block;
}
/* Invisible hover bridge between the trigger and the popover so moving
   the cursor across the 0.25rem gap doesn't close the menu. */
.dropdown::before {
  content: '';
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  height: 0.5rem;
  z-index: 49;
}

.navbar-dropdown-content {
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  background-color: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 50;
  padding-top: 0.25rem;
}
:where(.dark, .dark *) .navbar-dropdown-content {
  background-color: rgb(17, 24, 39); /* gray-900 */
  border-color: rgba(255, 255, 255, 0.1);
}

/* Normalize trigger typography across <button> and <a> triggers. Tailwind
   4's preflight already does `button { font: inherit }` but Safari is
   inconsistent about applying the inherited weight; lock it in. */
.nav-container .dropdown > button,
.nav-container .dropdown > a {
  font-family: inherit;
  font-size: 0.875rem; /* text-sm — match other nav links */
  font-weight: 400;
  line-height: 1.25rem;
  letter-spacing: inherit;
}

/* Popover items. Single source for color + sizing so the Docs dropdown
   items and the version dropdown items render identically. */
.navbar-dropdown-content a {
  display: block;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 400;
  color: rgb(55, 65, 81); /* gray-700 */
  white-space: nowrap;
  text-decoration: none;
}
:where(.dark, .dark *) .navbar-dropdown-content a {
  color: rgb(209, 213, 219); /* gray-300 */
}
.navbar-dropdown-content a:hover {
  background-color: rgb(243, 244, 246); /* gray-100 */
  color: rgb(17, 24, 39); /* gray-900 */
}
:where(.dark, .dark *) .navbar-dropdown-content a:hover {
  background-color: rgb(31, 41, 55); /* gray-800 */
  color: rgb(255, 255, 255);
}


/* ── Sidebar ─────────────────────────────────────────────────────────── */
/* Centralized sidebar styling. The template lives in _partials/sidebar.html;
   the chevron-toggle / mobile-panel JS lives in themeExtras/head-end.html.
   These rules cover:
     - Mobile slide-in panel + overlay (< xl)
     - Mobile-only section/version chip rows
     - Expand/collapse chevron button styling
     - Sidebar link colors (light + dark)
     - Tree indentation with left rule
   Site-specific palettes (e.g. active link color, active background) can
   still be overridden in the consumer's custom.css. */

/* Mobile slide-in panel (< xl). Hidden on desktop; rendered in same DOM
   as the desktop aside, just promoted to position:fixed on mobile.

   Bound uses 1279px (integer), not 1279.99px: Chromium rounds fractional
   max-width comparisons in ways that can spuriously match at exactly
   1280px viewport, which left the panel position:fixed + translateX(-100%)
   on desktop and broke `await expect(sidebar).toBeVisible()` in Playwright. */
@media (max-width: 1279px) {
  .sidebar-mobile-panel {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 280px !important;
    z-index: 90 !important;
    transform: translateX(-100%);
    transition: transform 300ms ease-in-out;
    background: white;
    padding-top: 64px;
    visibility: hidden;
    overflow-y: auto;
    display: flex !important;
    flex-direction: column !important;
  }
  .dark .sidebar-mobile-panel {
    background: rgb(17, 24, 39);
  }
  .sidebar-mobile-panel.mobile-sidebar-open {
    transform: translateX(0);
    visibility: visible;
  }
}
.sidebar-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 89;
}
.sidebar-mobile-overlay.active {
  display: block;
}

/* Hide mobile-only chrome on desktop. */
@media (min-width: 1280px) {
  .sidebar-mobile-only {
    display: none !important;
  }
}

/* Mobile section + version chip rows. */
.sidebar-mobile-header {
  border-bottom: 1px solid #e5e7eb;
}
.dark .sidebar-mobile-header {
  border-bottom-color: #374151;
}
.sidebar-mobile-section-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
}
.sidebar-mobile-section-link {
  flex: 1;
  text-align: center;
  padding: 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(75, 85, 99);
  text-decoration: none;
}
.sidebar-mobile-section-link:hover {
  background: rgb(243, 244, 246);
}
.dark .sidebar-mobile-section-link {
  color: rgb(156, 163, 175);
}
.dark .sidebar-mobile-section-link:hover {
  background: rgb(31, 41, 55);
}
.sidebar-mobile-section-active {
  background: rgb(219, 234, 254);
  color: rgb(30, 64, 175);
}
.dark .sidebar-mobile-section-active {
  background: rgba(96, 165, 250, 0.1);
  color: rgb(96, 165, 250);
}
.sidebar-mobile-version-row {
  padding: 0 0.75rem 0.75rem;
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.sidebar-mobile-version-group {
  flex-basis: 100%;
  margin-top: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: rgb(107, 114, 128);
}
.sidebar-mobile-version-group:first-child {
  margin-top: 0;
}
.dark .sidebar-mobile-version-group {
  color: rgb(156, 163, 175);
}
.sidebar-mobile-version-link {
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgb(107, 114, 128);
  text-decoration: none;
}
.sidebar-mobile-version-link:hover {
  background: rgb(243, 244, 246);
}
.dark .sidebar-mobile-version-link {
  color: rgb(156, 163, 175);
}
.dark .sidebar-mobile-version-link:hover {
  background: rgb(31, 41, 55);
}
.sidebar-mobile-version-active {
  background: rgb(229, 231, 235);
  color: rgb(17, 24, 39);
}
.dark .sidebar-mobile-version-active {
  background: rgb(55, 65, 81);
  color: rgb(255, 255, 255);
}

/* Sidebar nav wrapper. No internal scroll: the sidebar grows with its tree
   and scrolls with the page rather than getting an inner overflow bar. */
.sidebar-nav-wrapper {
  padding: 0 1rem 1rem;
  flex-grow: 1;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.875rem;
}

/* Tree lists. Depth 0 sits at the section root; deeper levels indent under
   a thin left rule that mirrors the docs-theme-lotus pattern. */
.sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar-list-depth-0 {
  margin-top: 0;
}
.sidebar-list:not(.sidebar-list-depth-0) {
  margin-left: 0.75rem;
  margin-top: 0.25rem;
  padding-left: 0.75rem;
  border-left: 1px solid #e5e7eb;
}
.dark .sidebar-list:not(.sidebar-list-depth-0) {
  border-left-color: #374151;
}
.sidebar-list > li + li {
  margin-top: 0.25rem;
}

/* Link row: link + chevron toggle button live in a flex wrapper so clicking
   the chevron doesn't fire the link's navigation. */
.sidebar-link-wrapper {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.sidebar-link-wrapper .sidebar-link {
  flex: 1;
  min-width: 0;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  transition: color 0.15s;
  text-decoration: none;
  color: rgb(75, 85, 99);
}
.sidebar-link:hover {
  color: rgb(17, 24, 39);
  background: rgb(243, 244, 246);
}
.sidebar-link.sidebar-active-item {
  color: rgb(30, 64, 175);
  background: rgb(219, 234, 254);
  font-weight: 600;
}
.dark .sidebar-link {
  color: rgb(156, 163, 175);
}
.dark .sidebar-link:hover {
  color: rgb(229, 231, 235);
  background: rgba(255, 255, 255, 0.05);
}
.dark .sidebar-link.sidebar-active-item {
  color: rgb(199, 210, 254);
  background: rgba(99, 102, 241, 0.1);
}

/* Chevron toggle button — flips 0deg → 90deg on data-expanded="true". */
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem;
  background: transparent;
  border: 0;
  border-radius: 0.25rem;
  color: inherit;
  cursor: pointer;
  flex-shrink: 0;
}
.sidebar-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
}
.dark .sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
}
.sidebar-toggle svg {
  transition: transform 0.15s ease;
  width: 1rem;
  height: 1rem;
}
.sidebar-toggle[aria-expanded="true"] svg {
  transform: rotate(90deg);
}

/* Sidebar mobile trigger — opens the docs sidebar slide-in panel.
   Pure-text/icon style matching agw production: no border, no background,
   just the colored hamburger icon with padding. The boxed look is reserved
   for the global nav drawer trigger (which is a heavier UI element). */
.solo-sidebar-mobile-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  margin-left: -0.5rem;
  margin-right: 0.25rem;
  background: transparent;
  border: 0;
  color: rgb(55, 65, 81);
  cursor: pointer;
}
.solo-sidebar-mobile-trigger:hover {
  color: rgb(17, 24, 39);
}
.dark .solo-sidebar-mobile-trigger {
  color: rgb(209, 213, 219);
}
.dark .solo-sidebar-mobile-trigger:hover {
  color: rgb(243, 244, 246);
}
@media (min-width: 1280px) {
  .solo-sidebar-mobile-trigger {
    display: none !important;
  }
}
/* `hidden` attribute must win over the base `display: inline-flex` above (a
   class selector otherwise beats the UA [hidden] rule). The theme navbar
   renders its trigger with `hidden` and themeExtras/head-end.html removes it
   only when a `.sidebar-mobile-panel` exists, so landing / non-docs pages
   never show a dead button. Consumer navbars (kgw/agw) render the trigger
   without `hidden`, so this rule does not affect them. */
.solo-sidebar-mobile-trigger[hidden] {
  display: none !important;
}
/* Tablet-band scope for the theme-navbar trigger only: below md the wired
   `.hextra-hamburger-menu` already toggles the sidebar, so suppress the
   second trigger there to avoid two hamburgers on mobile. (Combined with the
   >= 1280 rule above, the trigger shows only across 768–1279px.) Consumer
   triggers omit this class and stay visible across the full < 1280 range. */
@media (max-width: 767px) {
  .solo-sidebar-trigger-tabletonly {
    display: none !important;
  }
}

/* ── Mobile drawer "closed" state: visibility instead of display ─────────
   Hextra v0.12.3's `en.search.js` defines:
     function getActiveSearchElement() {
       const inputs = Array.from(document.querySelectorAll('.hextra-search-wrapper'))
         .filter(el => el.clientHeight > 0);
       if (inputs.length === 1) { return {...}; }
       // implicit undefined when 0 or 2+ visible
     }
   Its mousedown/keydown handlers destructure the result without a null
   guard, so every event throws when no `.hextra-search-wrapper` has
   `clientHeight > 0`. Crucially, that includes every keystroke INSIDE
   the drawer's search input — typing crashes the search.

   The drawer toggles `hx:hidden` (display: none) for its closed state.
   `display: none` collapses descendants' clientHeight to 0, so when the
   drawer holds the only search wrapper on mobile, "closed" means the
   wrapper has clientHeight 0 → filter returns []. Worse, typing in the
   open drawer still triggers keydown on the document, and Hextra's
   handler queries again — if anything else collapses height between
   keystrokes the same throw fires.

   Fix: override `display: none` from `hx:hidden` with `visibility:
   hidden` for `#mobile-icons-menu` specifically. visibility-hidden
   elements stay in layout (descendants keep non-zero clientHeight) so
   Hextra's filter still finds the wrapper. Pointer-events: none keeps
   invisible content from blocking clicks. `position: absolute` is
   already set on the drawer so it doesn't take normal-flow space.

   ID selector (specificity 100) wins over `.hx\:hidden`'s class
   selector (specificity 10) without needing !important. */
#mobile-icons-menu.hx\:hidden {
  display: block;
  visibility: hidden;
  pointer-events: none;
}

/* ── Mobile drawer search ─────────────────────────────────────────────────
   Hextra hides the navbar search below md via `nav .hextra-search-wrapper {
   display: none }` (re-shown only at >= 48rem), because stock Hextra relocates
   search into its own mobile menu. Our `#mobile-icons-menu` lives inside <nav>,
   so the search we render there inherits that hide. Re-show it: the ID selector
   (specificity 100) beats Hextra's `nav .hextra-search-wrapper` (11) without
   !important, and at >= 768px the drawer's parent is `hx:md:hidden`
   (display: none), so this never produces a second visible search wrapper on
   desktop — keeping exactly one for Hextra's getActiveSearchElement(). */
#mobile-icons-menu .hextra-search-wrapper {
  display: block;
  width: 100%;
}
.solo-mobile-drawer-search {
  width: 16rem;
  max-width: 80vw;
  padding: 0.25rem 0.25rem 0.5rem;
}
