/* ==========================================================================
   Fleetmesh Documentation Stylesheet
   - Fixed high-contrast sidebar navigation (no faint or low-contrast text)
   - Full Dark Mode & Light Mode support with system preference detection
   - Clean autodoc signature banners and modern typography
   ========================================================================== */

/* Color Design Tokens */
:root {
  --fm-accent: #2563eb;
  --fm-accent-light: #38bdf8;
  --fm-bg-page: #f8fafc;
  --fm-bg-content: #ffffff;
  --fm-text-primary: #1e293b;
  --fm-text-secondary: #334155;
  --fm-text-muted: #64748b;
  --fm-border: #e2e8f0;
  
  --fm-sidebar-bg: #0f172a;
  --fm-sidebar-active: #1e293b;
  --fm-sidebar-text: #94a3b8;
  --fm-sidebar-text-hover: #ffffff;
  --fm-sidebar-text-active: #38bdf8;
  
  --fm-link: #2563eb;
  --fm-link-hover: #1d4ed8;
  
  --fm-sig-bg: #f8fafc;
  --fm-sig-border: #2563eb;
  --fm-sig-name: #1e3a8a;
  
  --fm-code-bg: #f1f5f9;
  --fm-code-border: #e2e8f0;
  --fm-code-text: #0f172a;
  
  --fm-pre-bg: #f8fafc;
  --fm-pre-border: #e2e8f0;
  --fm-pre-text: #1e293b;

  --fm-syn-comment: #64748b;
  --fm-syn-string: #15803d;
  --fm-syn-docstring: #0369a1;
  --fm-syn-keyword: #7c3aed;
  --fm-syn-func: #0284c7;
  --fm-syn-class: #b45309;
  --fm-syn-builtin: #0e7490;
  --fm-syn-number: #c2410c;
  --fm-syn-op: #475569;
  --fm-syn-decorator: #be185d;
  --fm-syn-variable: #1e293b;
  --fm-syn-hll: rgba(37, 99, 235, 0.08);
  
  --fm-table-th: #f1f5f9;
  --fm-table-bg: #ffffff;
  --fm-table-alt: #f8fafc;
  --fm-table-border: #e2e8f0;
  --fm-table-hover: #edf2f7;

  --fm-exp-bg: #fffbeb;
  --fm-exp-border: #d97706;
  --fm-exp-title: #92400e;
}

/* Explicit Light Mode Tokens */
html[data-theme="light"] {
  --fm-bg-page: #f8fafc;
  --fm-bg-content: #ffffff;
  --fm-text-primary: #1e293b;
  --fm-text-secondary: #334155;
  --fm-text-muted: #64748b;
  --fm-border: #e2e8f0;
  
  --fm-sidebar-bg: #0f172a;
  --fm-sidebar-active: #1e293b;
  --fm-sidebar-text: #94a3b8;
  --fm-sidebar-text-hover: #ffffff;
  --fm-sidebar-text-active: #38bdf8;
  
  --fm-link: #2563eb;
  --fm-link-hover: #1d4ed8;
  
  --fm-sig-bg: #f8fafc;
  --fm-sig-border: #2563eb;
  --fm-sig-name: #1e3a8a;
  
  --fm-code-bg: #f1f5f9;
  --fm-code-border: #e2e8f0;
  --fm-code-text: #0f172a;
  
  --fm-pre-bg: #f8fafc;
  --fm-pre-border: #e2e8f0;
  --fm-pre-text: #1e293b;

  --fm-syn-comment: #64748b;
  --fm-syn-string: #15803d;
  --fm-syn-docstring: #0369a1;
  --fm-syn-keyword: #7c3aed;
  --fm-syn-func: #0284c7;
  --fm-syn-class: #b45309;
  --fm-syn-builtin: #0e7490;
  --fm-syn-number: #c2410c;
  --fm-syn-op: #475569;
  --fm-syn-decorator: #be185d;
  --fm-syn-variable: #1e293b;
  --fm-syn-hll: rgba(37, 99, 235, 0.08);

  --fm-table-th: #f1f5f9;
  --fm-table-bg: #ffffff;
  --fm-table-alt: #f8fafc;
  --fm-table-border: #e2e8f0;
  --fm-table-hover: #edf2f7;
}

/* Dark Mode Tokens (manual toggle or system preference) */
html[data-theme="dark"] {
  --fm-bg-page: #080c14;
  --fm-exp-bg: #1f1a0e;
  --fm-exp-border: #f59e0b;
  --fm-exp-title: #fbbf24;
  --fm-bg-content: #0f172a;
  --fm-text-primary: #f8fafc;
  --fm-text-secondary: #cbd5e1;
  --fm-text-muted: #94a3b8;
  --fm-border: #1e293b;
  
  --fm-sidebar-bg: #080c14;
  --fm-sidebar-active: #1e293b;
  --fm-sidebar-text: #94a3b8;
  --fm-sidebar-text-hover: #ffffff;
  --fm-sidebar-text-active: #38bdf8;
  
  --fm-link: #38bdf8;
  --fm-link-hover: #60a5fa;
  
  --fm-sig-bg: #1e293b;
  --fm-sig-border: #38bdf8;
  --fm-sig-name: #38bdf8;
  
  --fm-code-bg: #1e293b;
  --fm-code-border: #334155;
  --fm-code-text: #f43f5e;
  
  --fm-pre-bg: #050811;
  --fm-pre-border: #1e293b;
  --fm-pre-text: #f1f5f9;

  --fm-syn-comment: #64748b;
  --fm-syn-string: #98c379;
  --fm-syn-docstring: #7dd3fc;
  --fm-syn-keyword: #c084fc;
  --fm-syn-func: #38bdf8;
  --fm-syn-class: #fbbf24;
  --fm-syn-builtin: #22d3ee;
  --fm-syn-number: #fb923c;
  --fm-syn-op: #94a3b8;
  --fm-syn-decorator: #f472b6;
  --fm-syn-variable: #f1f5f9;
  --fm-syn-hll: rgba(56, 189, 248, 0.12);
  
  --fm-table-th: #1e293b;
  --fm-table-bg: #0b1120;
  --fm-table-alt: #131d31;
  --fm-table-border: #1e293b;
  --fm-table-hover: #1e293b;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --fm-bg-page: #080c14;
    --fm-exp-bg: #1f1a0e;
    --fm-exp-border: #f59e0b;
    --fm-exp-title: #fbbf24;
    --fm-bg-content: #0f172a;
    --fm-text-primary: #f8fafc;
    --fm-text-secondary: #cbd5e1;
    --fm-text-muted: #94a3b8;
    --fm-border: #1e293b;
    
    --fm-sidebar-bg: #080c14;
    --fm-sidebar-active: #1e293b;
    --fm-sidebar-text: #94a3b8;
    --fm-sidebar-text-hover: #ffffff;
    --fm-sidebar-text-active: #38bdf8;
    
    --fm-link: #38bdf8;
    --fm-link-hover: #60a5fa;
    
    --fm-sig-bg: #1e293b;
    --fm-sig-border: #38bdf8;
    --fm-sig-name: #38bdf8;
    
    --fm-code-bg: #1e293b;
    --fm-code-border: #334155;
    --fm-code-text: #f43f5e;
    
    --fm-pre-bg: #050811;
    --fm-pre-border: #1e293b;
    --fm-pre-text: #f1f5f9;

    --fm-syn-comment: #64748b;
    --fm-syn-string: #98c379;
    --fm-syn-docstring: #7dd3fc;
    --fm-syn-keyword: #c084fc;
    --fm-syn-func: #38bdf8;
    --fm-syn-class: #fbbf24;
    --fm-syn-builtin: #22d3ee;
    --fm-syn-number: #fb923c;
    --fm-syn-op: #94a3b8;
    --fm-syn-decorator: #f472b6;
    --fm-syn-variable: #f1f5f9;
    --fm-syn-hll: rgba(56, 189, 248, 0.12);
    
    --fm-table-th: #1e293b;
    --fm-table-bg: #0b1120;
    --fm-table-alt: #131d31;
    --fm-table-border: #1e293b;
    --fm-table-hover: #1e293b;
  }
}

/* ==========================================================================
   SIDEBAR NAVIGATION (Fixed Contrast & Structure)
   ========================================================================== */

.wy-nav-side,
.wy-side-scroll {
  background: var(--fm-sidebar-bg) !important;
}

.wy-side-nav-search {
  background-color: var(--fm-sidebar-bg) !important;
  padding: 1.25rem 1rem 0.75rem 1rem !important;
  border-bottom: 1px solid #1e293b;
}

.wy-side-nav-search .wy-dropdown>a,
.wy-side-nav-search>a {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: #f8fafc !important;
  display: block;
}

.wy-side-nav-search .logo {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0.25rem auto 0.75rem auto;
  border-radius: 0;
}

.wy-side-nav-search input[type="text"] {
  border-radius: 6px;
  border: 1px solid #334155 !important;
  background: #1e293b !important;
  color: #f8fafc !important;
  box-shadow: none !important;
  padding: 8px 12px !important;
  font-size: 0.85rem;
}

.wy-side-nav-search input[type="text"]::placeholder {
  color: #64748b !important;
}

.wy-side-nav-search input[type="text"]:focus {
  border-color: #38bdf8 !important;
  outline: none !important;
}

/* ==========================================================================
   SIDEBAR SECTION HEADERS (e.g. MESHNODE HOST DAEMON, CORE PROTOCOL LIBRARY)
   ========================================================================== */

.wy-menu-vertical header,
.wy-menu-vertical p.caption {
  color: #e2e8f0 !important;
  font-size: 0.78rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  margin: 1.85rem 0 0.35rem 0 !important;
  padding: 0.95rem 1.25rem 0.45rem 1.25rem !important;
  border-top: 1px solid rgba(148, 163, 184, 0.16) !important;
  border-bottom: none !important;
  line-height: 1.3 !important;
}

/* First caption directly below the search bar */
.wy-menu-vertical > p.caption:first-of-type,
.wy-menu-vertical > header:first-child {
  margin-top: 0.85rem !important;
  padding-top: 0.5rem !important;
  border-top: none !important;
}

/* Caption text with crisp accent marker */
.wy-menu-vertical p.caption span.caption-text {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  color: #e2e8f0 !important;
}

.wy-menu-vertical p.caption span.caption-text::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.45);
  flex-shrink: 0;
}

.wy-menu-vertical ul {
  margin-bottom: 0.5rem !important;
}

/* Base Nav Links */
.wy-menu-vertical a {
  color: var(--fm-sidebar-text) !important;
  font-size: 0.88rem !important;
  line-height: 1.35 !important;
  padding: 0.45rem 1.25rem !important;
  border: none !important;
  background: transparent !important;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.wy-menu-vertical a:hover {
  background-color: var(--fm-sidebar-active) !important;
  color: var(--fm-sidebar-text-hover) !important;
}

/* OVERRIDE RTD's default light-gray/white backgrounds on active elements */
.wy-menu-vertical li,
.wy-menu-vertical li.current,
.wy-menu-vertical li.current > ul,
.wy-menu-vertical li.on,
.wy-menu-vertical li.on > ul {
  background: transparent !important;
}

/* Active Level 1 Item (e.g., 2. Application Host & Subsystems) */
.wy-menu-vertical li.toctree-l1.current > a,
.wy-menu-vertical li.current > a {
  background: var(--fm-sidebar-active) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  border-left: 3px solid var(--fm-accent-light) !important;
}

/* Submenu container under active item: ALWAYS DARK BACKGROUND */
.wy-menu-vertical li.current ul {
  background: var(--fm-sidebar-bg) !important;
  border-left: 1px solid #1e293b;
  margin-left: 0.75rem;
  padding-left: 0;
}

/* Nested Submenu Links (2.1 Host Core, 2.2 Config Assembler, etc.) */
.wy-menu-vertical li.current li a,
.wy-menu-vertical li.toctree-l2 a,
.wy-menu-vertical li.toctree-l3 a,
.wy-menu-vertical li.toctree-l4 a {
  color: var(--fm-sidebar-text) !important;
  background: transparent !important;
  border: none !important;
  padding: 0.35rem 1rem !important;
  font-size: 0.84rem !important;
  font-weight: 400 !important;
}

/* Hover on nested submenu links */
.wy-menu-vertical li.current li a:hover,
.wy-menu-vertical li.toctree-l2 a:hover,
.wy-menu-vertical li.toctree-l3 a:hover,
.wy-menu-vertical li.toctree-l4 a:hover {
  color: #ffffff !important;
  background: var(--fm-sidebar-active) !important;
}

/* Currently viewed nested item (e.g., currently scrolled or active) */
.wy-menu-vertical li.toctree-l2.current > a,
.wy-menu-vertical li.toctree-l3.current > a,
.wy-menu-vertical li.current li.current > a,
.wy-menu-vertical li.current a.current {
  color: var(--fm-sidebar-text-active) !important;
  background: var(--fm-sidebar-active) !important;
  font-weight: 600 !important;
}

/* Expand / Collapse buttons */
.wy-menu-vertical button.toctree-expand {
  color: #64748b !important;
}

.wy-menu-vertical button.toctree-expand:hover,
.wy-menu-vertical a:hover button.toctree-expand {
  color: #ffffff !important;
}

.wy-menu-vertical li.current > a button.toctree-expand {
  color: #94a3b8 !important;
}

/* ==========================================================================
   CONTENT AREA & TYPOGRAPHY
   ========================================================================== */

.wy-body-for-nav,
.wy-grid-for-nav,
.wy-nav-content-wrap {
  background: var(--fm-bg-page) !important;
  color: var(--fm-text-primary) !important;
}

.wy-nav-content {
  background: var(--fm-bg-content) !important;
  color: var(--fm-text-primary) !important;
  max-width: 1040px !important;
  padding: 2.25rem 3.5rem !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  min-height: 100vh;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  color: var(--fm-text-primary) !important;
  font-weight: 600;
  letter-spacing: -0.025em;
}

h1 {
  border-bottom: 2px solid var(--fm-border) !important;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 2.1rem;
}

h2 {
  border-bottom: 1px solid var(--fm-border) !important;
  padding-bottom: 0.35rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

/* Clean inline code in headings */
h1 code, h2 code, h3 code, h4 code,
h1 .sig-name, h2 .sig-name {
  color: var(--fm-accent-light) !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  font-size: 0.95em !important;
}

/* Paragraphs & Text */
.rst-content p,
.rst-content li,
.rst-content dd {
  color: var(--fm-text-secondary);
  line-height: 1.65;
  font-size: 0.95rem;
}

/* Content Links */
.rst-content a {
  color: var(--fm-link);
  text-decoration: none;
}

.rst-content a:hover {
  color: var(--fm-link-hover);
  text-decoration: underline;
}

/* ==========================================================================
   AUTODOC & PYTHON API SIGNATURES
   ========================================================================== */

/* Python Object Signature banner (classes, methods, functions) */
.rst-content dl.py > dt,
.rst-content dl[class*="py"] > dt,
.rst-content dt.sig-object.py,
.rst-content dt.sig {
  background: var(--fm-sig-bg) !important;
  border-top: 3px solid var(--fm-sig-border) !important;
  border-bottom: 1px solid var(--fm-border) !important;
  border-left: 1px solid var(--fm-border) !important;
  border-right: 1px solid var(--fm-border) !important;
  border-radius: 6px 6px 0 0;
  color: var(--fm-text-primary) !important;
  padding: 0.65rem 1rem !important;
  font-family: ui-monospace, "SF Mono", "Cascadia Code", "Fira Code", Menlo, Monaco, Consolas, monospace !important;
  font-size: 0.9rem !important;
  margin-top: 1.5rem;
  margin-bottom: 0;
  width: auto !important;
  float: none !important;
}

.rst-content dl.py > dt .sig-name,
.rst-content dl[class*="py"] > dt .sig-name,
.rst-content dt.sig .sig-name {
  color: var(--fm-sig-name) !important;
  font-weight: 700;
}

.rst-content dl.py > dt .sig-prename,
.rst-content dl[class*="py"] > dt .sig-prename,
.rst-content dt.sig .sig-prename {
  color: var(--fm-text-muted) !important;
}

.rst-content dl.py > dt .sig-param,
.rst-content dl[class*="py"] > dt .sig-param,
.rst-content dt.sig .sig-param {
  color: var(--fm-text-secondary) !important;
}

.rst-content dl.py > dt a.viewcode-link,
.rst-content dl.py > dt a.headerlink,
.rst-content dt.sig a.viewcode-link,
.rst-content dt.sig a.headerlink {
  color: var(--fm-link) !important;
  margin-left: 0.5rem;
  font-size: 0.85em;
}

/* Description body under signature */
.rst-content dl.py > dd,
.rst-content dl[class*="py"] > dd {
  background: transparent !important;
  border-left: 2px solid var(--fm-border);
  border-bottom: none;
  margin: 0 0 1.5rem 0.5rem !important;
  padding: 0.75rem 1.25rem !important;
}

/* Generic Definition Lists (prose terms & definitions, not Python APIs) */
.rst-content dl:not(.py):not([class*="py"]):not(.field-list) {
  margin: 1rem 0 1.5rem 0;
}

.rst-content dl:not(.py):not([class*="py"]):not(.field-list) > dt {
  font-weight: 600 !important;
  color: var(--fm-text-primary) !important;
  font-family: inherit !important;
  font-size: 0.95rem !important;
  background: transparent !important;
  border: none !important;
  padding: 0.35rem 0 0.15rem 0 !important;
  margin-top: 0.75rem !important;
  margin-bottom: 0.25rem !important;
  width: auto !important;
  float: none !important;
  border-radius: 0 !important;
}

.rst-content dl:not(.py):not([class*="py"]):not(.field-list) > dd {
  margin-left: 1.5rem !important;
  margin-bottom: 0.75rem !important;
  padding: 0 !important;
  border-left: none !important;
  background: transparent !important;
  color: var(--fm-text-secondary) !important;
  line-height: 1.6 !important;
}

/* Blockquotes & Description Quote Blocks */
.rst-content blockquote {
  margin: 1.25rem 0 1.25rem 0.5rem !important;
  padding: 0.75rem 1.25rem !important;
  border-left: 3px solid var(--fm-accent-light, #38bdf8) !important;
  border-top: none !important;
  border-right: none !important;
  border-bottom: none !important;
  background: rgba(56, 189, 248, 0.04) !important;
  border-radius: 0 6px 6px 0 !important;
  color: var(--fm-text-secondary) !important;
  box-shadow: none !important;
}

html[data-theme="light"] .rst-content blockquote,
html:not([data-theme="dark"]) .rst-content blockquote {
  border-left-color: var(--fm-accent, #2563eb) !important;
  background: rgba(37, 99, 235, 0.04) !important;
}

/* Prevent double-bordering on nested blockquotes or autodoc description blockquotes */
.rst-content dd > blockquote,
.rst-content blockquote blockquote {
  border-left: none !important;
  border: none !important;
  background: transparent !important;
  padding-left: 0.5rem !important;
  margin: 0.5rem 0 !important;
  box-shadow: none !important;
}

.rst-content blockquote p {
  margin-bottom: 0.5rem !important;
  color: inherit !important;
  line-height: 1.6 !important;
}

.rst-content blockquote p:last-child {
  margin-bottom: 0 !important;
}

/* ==========================================================================
   FIELD LISTS (Parameters, Returns, Return type, Raises, etc.)
   ========================================================================== */

html.writer-html5 .rst-content dl.field-list,
.rst-content dl.field-list {
  display: grid !important;
  grid-template-columns: minmax(7.5rem, max-content) 1fr !important;
  column-gap: 1.25rem !important;
  row-gap: 0.55rem !important;
  margin: 0.85rem 0 1.25rem 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  align-items: start !important;
}

/* Left Column: Field Names (Parameters:, Return type:, Returns:, etc.) */
html.writer-html5 .rst-content dl.field-list > dt,
.rst-content dl.field-list > dt {
  grid-column: 1 !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  color: var(--fm-text-primary) !important;
  font-weight: 600 !important;
  font-family: inherit !important;
  font-size: 0.92rem !important;
  line-height: 1.6 !important;
  white-space: nowrap !important;
  align-self: start !important;
  float: none !important;
  width: auto !important;
  display: block !important;
}

.rst-content dl.field-list > dt .colon {
  display: inline !important;
  color: var(--fm-text-secondary) !important;
  font-weight: 500 !important;
}

/* Right Column: Field Bodies (Parameters list, Return type values, etc.) */
html.writer-html5 .rst-content dl.field-list > dd,
.rst-content dl.field-list > dd {
  grid-column: 2 !important;
  background: transparent !important;
  border: none !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--fm-text-secondary) !important;
  font-size: 0.92rem !important;
  line-height: 1.6 !important;
  align-self: start !important;
  min-width: 0 !important;
}

/* Ensure direct paragraphs in field body align flush with the label */
html.writer-html5 .rst-content dl.field-list > dd > p,
.rst-content dl.field-list > dd > p {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.6 !important;
  color: inherit !important;
}

html.writer-html5 .rst-content dl.field-list > dd > p:not(:last-child),
.rst-content dl.field-list > dd > p:not(:last-child) {
  margin-bottom: 0.35rem !important;
}

/* Parameter lists & multi-item fields in field body */
html.writer-html5 .rst-content dl.field-list > dd > ul,
html.writer-html5 .rst-content dl.field-list > dd > ul.simple,
html.writer-html5 .rst-content dl.field-list > dd > ol,
html.writer-html5 .rst-content dl.field-list > dd > ol.simple,
.rst-content dl.field-list > dd > ul,
.rst-content dl.field-list > dd > ul.simple,
.rst-content dl.field-list > dd > ol,
.rst-content dl.field-list > dd > ol.simple,
.rst-content section dl.field-list > dd > ul,
.rst-content section dl.field-list > dd > ul.simple {
  margin: 0 !important;
  padding: 0 !important;
  padding-left: 0 !important;
  margin-left: 0 !important;
  list-style: none !important;
  list-style-type: none !important;
}

html.writer-html5 .rst-content dl.field-list > dd > ul > li,
html.writer-html5 .rst-content dl.field-list > dd > ul.simple > li,
html.writer-html5 .rst-content dl.field-list > dd > ol > li,
html.writer-html5 .rst-content dl.field-list > dd > ol.simple > li,
.rst-content dl.field-list > dd > ul > li,
.rst-content dl.field-list > dd > ul.simple > li,
.rst-content dl.field-list > dd > ol > li,
.rst-content dl.field-list > dd > ol.simple > li,
.rst-content section dl.field-list > dd > ul > li,
.rst-content section dl.field-list > dd > ul.simple > li {
  margin: 0 0 0.35rem 0 !important;
  margin-left: 0 !important;
  padding: 0 !important;
  padding-left: 0 !important;
  line-height: 1.6 !important;
  list-style: none !important;
  list-style-type: none !important;
  display: block !important;
}

html.writer-html5 .rst-content dl.field-list > dd > ul > li::before,
html.writer-html5 .rst-content dl.field-list > dd > ul.simple > li::before,
.rst-content dl.field-list > dd > ul > li::before,
.rst-content dl.field-list > dd > ul.simple > li::before {
  content: none !important;
  display: none !important;
}

html.writer-html5 .rst-content dl.field-list > dd > ul > li:last-child,
html.writer-html5 .rst-content dl.field-list > dd > ul.simple > li:last-child,
html.writer-html5 .rst-content dl.field-list > dd > ol > li:last-child,
html.writer-html5 .rst-content dl.field-list > dd > ol.simple > li:last-child,
.rst-content dl.field-list > dd > ul > li:last-child,
.rst-content dl.field-list > dd > ul.simple > li:last-child,
.rst-content dl.field-list > dd > ol > li:last-child,
.rst-content dl.field-list > dd > ol.simple > li:last-child {
  margin-bottom: 0 !important;
}

html.writer-html5 .rst-content dl.field-list > dd > ul > li > p,
html.writer-html5 .rst-content dl.field-list > dd > ul.simple > li > p,
html.writer-html5 .rst-content dl.field-list > dd > ol > li > p,
html.writer-html5 .rst-content dl.field-list > dd > ol.simple > li > p,
.rst-content dl.field-list > dd > ul > li > p,
.rst-content dl.field-list > dd > ul.simple > li > p,
.rst-content dl.field-list > dd > ol > li > p,
.rst-content dl.field-list > dd > ol.simple > li > p {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.6 !important;
  display: block !important;
}

.rst-content dl.field-list > dd strong {
  color: var(--fm-text-primary) !important;
  font-weight: 600 !important;
}

.rst-content dl.field-list > dd em {
  color: var(--fm-accent-light, #38bdf8) !important;
  font-style: normal !important;
}

html[data-theme="light"] .rst-content dl.field-list > dd em,
html:not([data-theme="dark"]) .rst-content dl.field-list > dd em {
  color: var(--fm-accent, #2563eb) !important;
}

@media (max-width: 768px) {
  html.writer-html5 .rst-content dl.field-list,
  .rst-content dl.field-list {
    grid-template-columns: 1fr !important;
    row-gap: 0.35rem !important;
  }
  html.writer-html5 .rst-content dl.field-list > dt,
  .rst-content dl.field-list > dt {
    grid-column: 1 !important;
    margin-top: 0.4rem !important;
  }
  html.writer-html5 .rst-content dl.field-list > dd,
  .rst-content dl.field-list > dd {
    grid-column: 1 !important;
    padding-left: 0.5rem !important;
  }
}

/* ==========================================================================
   CODE & PRE BLOCKS (Modern Syntax Highlighting & Container Styling)
   ========================================================================== */

.rst-content code,
.rst-content tt {
  background: var(--fm-code-bg) !important;
  color: var(--fm-code-text) !important;
  border: 1px solid var(--fm-code-border) !important;
  border-radius: 4px;
  padding: 0.15rem 0.35rem;
  font-size: 0.88em;
  font-family: ui-monospace, "SF Mono", "Cascadia Code", "Fira Code", Menlo, Monaco, Consolas, monospace;
}

/* ==========================================================================
   Code Blocks & Preformatted Containers
   (Ensure exactly ONE outer border and zero nested/double borders)
   ========================================================================== */

/* Outer Code Block Container: exactly one border, background, radius, and shadow */
.rst-content div[class*='highlight-'],
.rst-content > div.highlight,
.rst-content section > div.highlight,
.rst-content blockquote > div.highlight,
.rst-content pre.literal-block:not(.rst-content div[class*='highlight'] pre) {
  border: 1px solid var(--fm-pre-border) !important;
  background: var(--fm-pre-bg) !important;
  border-radius: 8px !important;
  margin: 1.25rem 0 1.75rem 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.12) !important;
}

/* Inner highlight wrapper: ALWAYS borderless and transparent to eliminate double borders */
.rst-content div[class*='highlight-'] div,
.rst-content div[class*='highlight-'] .highlight,
.rst-content div.highlight div.highlight,
.rst-content .highlight .highlight {
  border: none !important;
  background: transparent !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
}

/* Inner Preformatted Code Element: typography, padding, no borders */
.rst-content div[class*='highlight'] pre,
.rst-content div.highlight pre,
.rst-content .highlight pre {
  border: none !important;
  background: transparent !important;
  color: var(--fm-pre-text) !important;
  border-radius: 0 !important;
  padding: 1rem 1.25rem !important;
  margin: 0 !important;
  font-size: 0.84rem !important;
  line-height: 1.42 !important;
  letter-spacing: -0.01em;
  font-family: ui-monospace, "SF Mono", "Cascadia Code", "Fira Code", Menlo, Monaco, Consolas, "Liberation Mono", monospace !important;
  tab-size: 4 !important;
  -moz-tab-size: 4 !important;
  box-shadow: none !important;
  overflow-x: auto !important;
  white-space: pre !important;
}

/* Sphinx Viewcode Block Container */
.rst-content .viewcode-block {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  display: block !important;
}

/* Sphinx Viewcode "[docs]" back link */
.rst-content .viewcode-back {
  float: right !important;
  text-align: right !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 0.72rem !important;
  font-weight: 500 !important;
  padding: 0.15rem 0.5rem !important;
  border-radius: 4px !important;
  background: rgba(56, 189, 248, 0.12) !important;
  color: var(--fm-accent-light, #38bdf8) !important;
  border: 1px solid rgba(56, 189, 248, 0.28) !important;
  text-decoration: none !important;
  line-height: 1.2 !important;
  margin-top: 0.1rem !important;
  transition: all 0.15s ease-in-out !important;
  user-select: none !important;
}

.rst-content .viewcode-back:hover {
  background: rgba(56, 189, 248, 0.25) !important;
  border-color: var(--fm-accent-light, #38bdf8) !important;
  color: #ffffff !important;
  text-decoration: none !important;
}

html[data-theme="light"] .rst-content .viewcode-back,
html:not([data-theme="dark"]) .rst-content .viewcode-back {
  background: rgba(37, 99, 235, 0.08) !important;
  color: #2563eb !important;
  border: 1px solid rgba(37, 99, 235, 0.25) !important;
}

html[data-theme="light"] .rst-content .viewcode-back:hover,
html:not([data-theme="dark"]) .rst-content .viewcode-back:hover {
  background: rgba(37, 99, 235, 0.18) !important;
  color: #1d4ed8 !important;
}

/* Line Number Columns (autodoc / viewcode) */
.rst-content .linenodiv pre {
  border-right: 1px solid var(--fm-pre-border) !important;
  color: var(--fm-syn-comment) !important;
  opacity: 0.7;
}

/* ==========================================================================
   PYGMENTS SYNTAX HIGHLIGHTING (High Contrast, Readable & Soothing)
   ========================================================================== */

/* Comments */
.rst-content .highlight .c,
.rst-content .highlight .c1,
.rst-content .highlight .ch,
.rst-content .highlight .cm,
.rst-content .highlight .cp,
.rst-content .highlight .cpf,
.rst-content .highlight .cs {
  color: var(--fm-syn-comment) !important;
  font-style: italic !important;
}

/* Keywords */
.rst-content .highlight .k,
.rst-content .highlight .kc,
.rst-content .highlight .kd,
.rst-content .highlight .kn,
.rst-content .highlight .kp,
.rst-content .highlight .kr,
.rst-content .highlight .kt,
.rst-content .highlight .ow {
  color: var(--fm-syn-keyword) !important;
  font-weight: 600 !important;
}

/* Regular Strings */
.rst-content .highlight .s,
.rst-content .highlight .s1,
.rst-content .highlight .s2,
.rst-content .highlight .sa,
.rst-content .highlight .sb,
.rst-content .highlight .sc,
.rst-content .highlight .dl,
.rst-content .highlight .sh,
.rst-content .highlight .si,
.rst-content .highlight .sx,
.rst-content .highlight .sr,
.rst-content .highlight .ss {
  color: var(--fm-syn-string) !important;
}

/* Docstrings (Soothing Sky Blue / Mint, NEVER blood red) */
.rst-content .highlight .sd {
  color: var(--fm-syn-docstring) !important;
  font-style: italic !important;
}

/* Functions & Methods */
.rst-content .highlight .nf,
.rst-content .highlight .fm {
  color: var(--fm-syn-func) !important;
  font-weight: 500 !important;
}

/* Classes & Types */
.rst-content .highlight .nc {
  color: var(--fm-syn-class) !important;
  font-weight: 600 !important;
}

/* Built-in Functions & Types */
.rst-content .highlight .nb,
.rst-content .highlight .bp {
  color: var(--fm-syn-builtin) !important;
}

/* Decorators */
.rst-content .highlight .nd {
  color: var(--fm-syn-decorator) !important;
  font-weight: 500 !important;
}

/* Numbers & Literals */
.rst-content .highlight .m,
.rst-content .highlight .mb,
.rst-content .highlight .mf,
.rst-content .highlight .mh,
.rst-content .highlight .mi,
.rst-content .highlight .mo,
.rst-content .highlight .il {
  color: var(--fm-syn-number) !important;
}

/* Operators & Punctuation */
.rst-content .highlight .o,
.rst-content .highlight .p {
  color: var(--fm-syn-op) !important;
}

/* Variables, Identifiers, Namespaces */
.rst-content .highlight .n,
.rst-content .highlight .nn,
.rst-content .highlight .nx,
.rst-content .highlight .nv,
.rst-content .highlight .vc,
.rst-content .highlight .vg,
.rst-content .highlight .vi,
.rst-content .highlight .vm,
.rst-content .highlight .na {
  color: var(--fm-syn-variable) !important;
}

/* Highlighted lines */
.rst-content .highlight .hll {
  background-color: var(--fm-syn-hll) !important;
  display: block;
  margin: 0 -1.25rem;
  padding: 0 1.25rem;
}

/* Line numbers */
.rst-content .highlight .linenos,
.rst-content .highlight span.linenos {
  color: var(--fm-text-muted) !important;
  opacity: 0.6;
}

/* ==========================================================================
   TABLES (High-Contrast Light & Dark Mode)
   ========================================================================== */

.rst-content table.docutils:not(.field-list):not(.modindextable):not(.indextable),
.rst-content table:not(.field-list):not(.modindextable):not(.indextable) {
  background: var(--fm-table-bg) !important;
  border: 1px solid var(--fm-table-border) !important;
  border-radius: 8px;
  overflow: hidden;
  margin: 1.5rem 0;
  width: 100%;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

.rst-content table.docutils:not(.field-list):not(.modindextable):not(.indextable) thead,
.rst-content table:not(.field-list):not(.modindextable):not(.indextable) thead {
  background: var(--fm-table-th) !important;
}

.rst-content table.docutils:not(.field-list):not(.modindextable):not(.indextable) thead th,
.rst-content table:not(.field-list):not(.modindextable):not(.indextable) thead th,
.rst-content table:not(.field-list):not(.modindextable):not(.indextable) th {
  background: var(--fm-table-th) !important;
  color: var(--fm-text-primary) !important;
  font-weight: 600;
  border: none !important;
  border-bottom: 2px solid var(--fm-table-border) !important;
  padding: 0.75rem 1rem !important;
  text-align: left;
}

.rst-content table.docutils:not(.field-list):not(.modindextable):not(.indextable) thead th p,
.rst-content table:not(.field-list):not(.modindextable):not(.indextable) th p {
  color: var(--fm-text-primary) !important;
  font-weight: 600;
  margin-bottom: 0 !important;
}

.rst-content table.docutils:not(.field-list):not(.modindextable):not(.indextable) tbody,
.rst-content table:not(.field-list):not(.modindextable):not(.indextable) tbody {
  background: var(--fm-table-bg) !important;
}

.rst-content table.docutils:not(.field-list):not(.modindextable):not(.indextable) tr,
.rst-content table:not(.field-list):not(.modindextable):not(.indextable) tr {
  background: var(--fm-table-bg) !important;
}

.rst-content table.docutils:not(.field-list):not(.modindextable):not(.indextable) td,
.rst-content table:not(.field-list):not(.modindextable):not(.indextable) td {
  background-color: var(--fm-table-bg) !important;
  border: none !important;
  border-bottom: 1px solid var(--fm-table-border) !important;
  color: var(--fm-text-secondary) !important;
  padding: 0.75rem 1rem !important;
  line-height: 1.55;
}

.rst-content table.docutils:not(.field-list):not(.modindextable):not(.indextable) td p,
.rst-content table:not(.field-list):not(.modindextable):not(.indextable) td p {
  color: var(--fm-text-secondary) !important;
  margin-bottom: 0 !important;
}

/* Fallback for table-based field lists (HTML4 / non-dl) */
.rst-content table.field-list {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  margin: 0.85rem 0 1.25rem 0 !important;
  width: 100% !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
}

.rst-content table.field-list td,
.rst-content table.field-list th {
  border: none !important;
  background: transparent !important;
  padding: 0.2rem 0 !important;
  vertical-align: top !important;
  box-shadow: none !important;
}

.rst-content table.field-list .field-name {
  font-weight: 600 !important;
  color: var(--fm-text-primary) !important;
  white-space: nowrap !important;
  padding-right: 1.25rem !important;
  width: 1% !important;
  font-size: 0.92rem !important;
}

.rst-content table.field-list .field-body {
  color: var(--fm-text-secondary) !important;
  font-size: 0.92rem !important;
}

/* OVERRIDE RTD's default light/white striping in both odd and even rows */
.rst-content table.docutils:not(.field-list):not(.modindextable):not(.indextable) tr:nth-child(2n-1) td,
.rst-content table.docutils:not(.modindextable):not(.indextable) tr:nth-child(odd) td,
.rst-content table.docutils:not(.modindextable):not(.indextable) tr.row-odd td,
.rst-content table:not(.modindextable):not(.indextable) tr:nth-child(odd) td,
.wy-table-odd td,
.wy-table-striped tr:nth-child(2n-1) td {
  background-color: var(--fm-table-bg) !important;
}

.rst-content table.docutils:not(.field-list):not(.modindextable):not(.indextable) tr:nth-child(2n) td,
.rst-content table.docutils:not(.modindextable):not(.indextable) tr:nth-child(even) td,
.rst-content table.docutils:not(.modindextable):not(.indextable) tr.row-even td,
.rst-content table:not(.modindextable):not(.indextable) tr:nth-child(even) td,
.wy-table-even td,
.wy-table-striped tr:nth-child(2n) td {
  background-color: var(--fm-table-alt) !important;
}


/* Row hover highlight */
.rst-content table.docutils tbody tr:hover td,
.rst-content table tbody tr:hover td {
  background-color: var(--fm-table-hover) !important;
}

/* Links inside tables */
.rst-content table.docutils td a,
.rst-content table td a {
  color: var(--fm-link) !important;
  font-weight: 500;
}

.rst-content table.docutils td a:hover,
.rst-content table td a:hover {
  color: var(--fm-link-hover) !important;
  text-decoration: underline;
}

/* Code literals inside tables */
.rst-content table.docutils td code,
.rst-content table td code {
  background: var(--fm-code-bg) !important;
  color: var(--fm-code-text) !important;
  border: 1px solid var(--fm-code-border) !important;
}

/* ==========================================================================
   BREADCRUMBS & PAGER
   ========================================================================== */

.wy-breadcrumbs {
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--fm-border);
  line-height: 28px;
}

div[role="navigation"] hr,
.wy-breadcrumbs + hr {
  display: none !important;
}

.wy-breadcrumbs li {
  color: var(--fm-text-muted) !important;
  font-size: 0.85rem;
  display: inline-block;
  white-space: nowrap;
}

.wy-breadcrumbs li a {
  color: var(--fm-link) !important;
}

.wy-breadcrumbs li code {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  color: inherit !important;
  font-size: inherit !important;
  display: inline !important;
}

.wy-breadcrumbs-aside {
  float: right !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.btn-neutral {
  background: var(--fm-bg-content) !important;
  color: var(--fm-text-primary) !important;
  border: 1px solid var(--fm-border) !important;
  border-radius: 6px !important;
  padding: 0.45rem 1rem !important;
  font-weight: 500;
  box-shadow: none !important;
}

.btn-neutral:hover {
  background: var(--fm-border) !important;
  color: var(--fm-text-primary) !important;
}

footer {
  color: var(--fm-text-muted) !important;
  border-top: 1px solid var(--fm-border) !important;
  padding-top: 1.5rem !important;
  margin-top: 3rem !important;
}

/* ==========================================================================
   THEME TOGGLE CONTROL (Icon-only Lucide Top Right Button)
   ========================================================================== */

.fm-theme-toggle-container {
  display: inline-flex;
  align-items: center;
  list-style: none !important;
}

.fm-theme-toggle-btn {
  background: var(--fm-code-bg);
  color: var(--fm-text-secondary);
  border: 1px solid var(--fm-border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  user-select: none;
  -webkit-user-select: none;
}

.fm-theme-toggle-btn *,
.fm-theme-toggle-btn svg {
  pointer-events: none !important;
}

.fm-theme-toggle-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.fm-theme-toggle-btn:hover {
  border-color: var(--fm-accent-light);
  color: var(--fm-accent-light);
  background: var(--fm-border);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.fm-theme-toggle-btn:active {
  transform: scale(0.92);
}

.fm-theme-toggle-btn:focus-visible {
  outline: 2px solid var(--fm-accent-light);
  outline-offset: 2px;
}

/* ==========================================================================
   GITLAB CODE JUMP LINKS
   ========================================================================== */

.fm-gitlab-code-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--fm-link) !important;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  border-radius: 4px;
  padding: 0 2px;
}

.fm-gitlab-code-link:hover {
  color: var(--fm-link-hover) !important;
  text-decoration: none !important;
  transform: translateY(-1px);
}

.fm-gitlab-code-link .fm-gitlab-ext-icon {
  width: 12px;
  height: 12px;
  opacity: 0.7;
  transition: opacity 0.15s ease, transform 0.15s ease;
  vertical-align: middle;
  flex-shrink: 0;
  display: inline-block;
}

.fm-gitlab-code-link:hover .fm-gitlab-ext-icon {
  opacity: 1;
  transform: translate(1px, -1px);
}

/* Headings (h1, h2, h3, etc.) */
h1 .fm-gitlab-code-link,
h2 .fm-gitlab-code-link,
h3 .fm-gitlab-code-link,
h4 .fm-gitlab-code-link {
  color: var(--fm-accent-light) !important;
  border-bottom: 1.5px dashed rgba(56, 189, 248, 0.45);
  font-size: 0.9em;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.06);
}

h1 .fm-gitlab-code-link:hover,
h2 .fm-gitlab-code-link:hover,
h3 .fm-gitlab-code-link:hover,
h4 .fm-gitlab-code-link:hover {
  background: rgba(56, 189, 248, 0.14);
  border-bottom-color: var(--fm-accent-light);
  color: var(--fm-accent-light) !important;
}

h1 .fm-gitlab-code-link code,
h2 .fm-gitlab-code-link code,
h3 .fm-gitlab-code-link code,
h4 .fm-gitlab-code-link code {
  color: inherit !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}


/* Regular text paragraphs & tables */
.rst-content p .fm-gitlab-code-link,
.rst-content td .fm-gitlab-code-link,
.rst-content li .fm-gitlab-code-link {
  background: var(--fm-code-bg);
  border: 1px solid var(--fm-code-border);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-size: 0.88em;
}

.rst-content p .fm-gitlab-code-link:hover,
.rst-content td .fm-gitlab-code-link:hover,
.rst-content li .fm-gitlab-code-link:hover {
  border-color: var(--fm-accent-light);
  background: var(--fm-border);
}

.rst-content p .fm-gitlab-code-link code,
.rst-content td .fm-gitlab-code-link code,
.rst-content li .fm-gitlab-code-link code {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  color: inherit !important;
}

/* ==========================================================================
   Release label (under the logo, above the search bar)
   ========================================================================== */

.fleetmesh-version-wrapper {
  margin: 0 0 0.5rem 0;
  width: 100%;
}

.fleetmesh-version-label {
  box-sizing: border-box;
  width: 100%;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #334155;
  background-color: #1e293b;
  color: #f8fafc;
  font-size: 0.85rem;
  text-align: left;
}

/* ==========================================================================
   Content Logo Styling
   ========================================================================== */

.rst-content img[src*="logo-fleetmesh"] {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem auto 2rem auto;
}

/* ==========================================================================
   PYTHON MODULE INDEX (py-modindex) & GENERAL INDEX (genindex)
   ========================================================================== */

.modindex-jumpbox {
  display: inline-flex !important;
  gap: 0.5rem !important;
  margin: 1rem 0 1.5rem 0 !important;
  align-items: center !important;
  padding: 0.5rem 0.85rem !important;
  background: var(--fm-bg-secondary) !important;
  border: 1px solid var(--fm-border-color) !important;
  border-radius: 8px !important;
  color: var(--fm-text-muted) !important;
}

.modindex-jumpbox a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 28px !important;
  height: 28px !important;
  padding: 0 0.55rem !important;
  border-radius: 6px !important;
  background: var(--fm-code-bg) !important;
  border: 1px solid var(--fm-code-border) !important;
  color: var(--fm-accent, #38BDF8) !important;
  font-weight: 700 !important;
  font-family: var(--fm-font-mono) !important;
  font-size: 0.95rem !important;
  text-decoration: none !important;
  text-transform: uppercase !important;
  transition: all 0.15s ease !important;
}

.modindex-jumpbox a:hover {
  background: var(--fm-accent-muted, rgba(56, 189, 248, 0.15)) !important;
  border-color: var(--fm-accent, #38BDF8) !important;
  color: var(--fm-accent, #38BDF8) !important;
  transform: translateY(-1px);
}

.rst-content table.modindextable,
.rst-content table.indextable {
  width: 100% !important;
  border-collapse: collapse !important;
  border: 1px solid var(--fm-table-border) !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  margin: 1.5rem 0 !important;
  background: var(--fm-table-bg) !important;
  table-layout: fixed !important;
}

/* Spacer rows */
.rst-content table.modindextable tr.pcap,
.rst-content table.indextable tr.pcap {
  display: none !important;
}

/* Letter Category Rows (f, n, etc.) */
.rst-content table.modindextable tr.cap,
.rst-content table.indextable tr.cap {
  background: var(--fm-table-th) !important;
  border-top: 1px solid var(--fm-table-border) !important;
  border-bottom: 2px solid var(--fm-table-border) !important;
}

.rst-content table.modindextable tr.cap td,
.rst-content table.indextable tr.cap td {
  background: var(--fm-table-th) !important;
  padding: 0.65rem 0.85rem !important;
  border: none !important;
}

.rst-content table.modindextable tr.cap td strong,
.rst-content table.indextable tr.cap td strong {
  font-size: 1.25rem !important;
  font-weight: 800 !important;
  color: var(--fm-accent, #38BDF8) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}

/* Standard module rows */
.rst-content table.modindextable tr,
.rst-content table.indextable tr {
  border-bottom: 1px solid var(--fm-table-border) !important;
  background: var(--fm-table-bg) !important;
  transition: background-color 0.12s ease !important;
}

.rst-content table.modindextable tr:hover td,
.rst-content table.indextable tr:hover td {
  background-color: var(--fm-table-hover) !important;
}

/* Column 1: Toggle Icon [+] / [-] */
.rst-content table.modindextable td:first-child,
.rst-content table.indextable td:first-child {
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  padding: 0.45rem 0.25rem 0.45rem 0.75rem !important;
  text-align: center !important;
  vertical-align: middle !important;
  background: transparent !important;
  border: none !important;
}

.rst-content table.modindextable td:first-child img.toggler {
  cursor: pointer !important;
  vertical-align: middle !important;
  opacity: 0.75 !important;
  transition: opacity 0.15s ease, transform 0.15s ease !important;
  display: inline-block !important;
}

.rst-content table.modindextable td:first-child img.toggler:hover {
  opacity: 1 !important;
  transform: scale(1.15);
}

/* Column 2: Module Name */
.rst-content table.modindextable td:nth-child(2),
.rst-content table.indextable td:nth-child(2) {
  width: auto !important;
  padding: 0.45rem 0.75rem !important;
  text-align: left !important;
  vertical-align: middle !important;
  background: transparent !important;
  border: none !important;
}

.rst-content table.modindextable td:nth-child(2) a {
  text-decoration: none !important;
}

.rst-content table.modindextable td:nth-child(2) code {
  font-family: var(--fm-font-mono) !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  color: var(--fm-code-text) !important;
  background: var(--fm-code-bg) !important;
  padding: 0.22rem 0.5rem !important;
  border-radius: 4px !important;
  border: 1px solid var(--fm-code-border) !important;
  display: inline-block !important;
  transition: all 0.15s ease !important;
}

.rst-content table.modindextable td:nth-child(2) a:hover code {
  color: var(--fm-accent, #38BDF8) !important;
  border-color: var(--fm-accent, #38BDF8) !important;
  background: var(--fm-accent-muted, rgba(56, 189, 248, 0.12)) !important;
}

/* Child module rows indentation & styling */
.rst-content table.modindextable tr[class*="cg-"] td:nth-child(2) {
  padding-left: 2.2rem !important;
}

.rst-content table.modindextable tr[class*="cg-"] td:nth-child(2) code {
  font-weight: 500 !important;
  font-size: 0.84rem !important;
}

/* Column 3: Synopsis / Description */
.rst-content table.modindextable td:nth-child(3),
.rst-content table.indextable td:nth-child(3) {
  width: 35% !important;
  padding: 0.45rem 0.75rem !important;
  text-align: left !important;
  vertical-align: middle !important;
  color: var(--fm-text-muted) !important;
  font-size: 0.85rem !important;
  font-style: italic !important;
  background: transparent !important;
  border: none !important;
}





/* `.. experimental::` (conf.py): what ALPHA.md calls experimental */
.rst-content .admonition.experimental {
  background: var(--fm-exp-bg);
  border-left: 4px solid var(--fm-exp-border);
}
.rst-content .admonition.experimental .admonition-title {
  background: transparent;
  color: var(--fm-exp-title);
}
.rst-content .admonition.experimental p {
  color: var(--fm-text-primary);
}

/* The theme keeps every table cell on one line, so a list-table of prose
   (the index, experimental.rst) ran off the page. Let cells wrap. */
.rst-content .wy-table-responsive table td,
.rst-content .wy-table-responsive table th {
  white-space: normal;
}
