.lang-switcher {
  font-size: 20px;
  line-height: 1.3;
}

.lang-switcher a {
  text-decoration: none;
  margin-left: 6px;
  color: #007acc;
  font-weight: 600;
}

.lang-switcher a:hover {
  text-decoration: underline;
}

.lang-switcher-inline {
  margin: 6px 0 12px;
  padding: 0;
  border: 0;
  background: transparent;
  display: inline-block;
}

.version-switcher {
  margin: 6px auto 10px;
  width: 65%;
}

.version-switcher select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #d0d5da;
  border-radius: 4px;
  background: #f8f9fa;
  font-size: 13px;
  cursor: pointer;
}

.wy-side-nav-search {
  display: flex;
  flex-direction: column;
}

.wy-side-nav-search > a {
  order: 1;
}

.wy-side-nav-search #version-switcher-placeholder {
  order: 2;
}

.wy-side-nav-search > div[role="search"] {
  order: 3;
}

.wy-side-nav-search > a {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  display: block;
}

.wy-side-nav-search #version-switcher-placeholder {
  order: 2;
}

.wy-side-nav-search > div[role="search"] {
  order: 3;
}

/* ==========================================================================
   Global Table Styles for Sphinx RTD Theme
   Default behavior:
   - tables can wrap content
   - outer container keeps horizontal scrolling when needed

   For protocol / frame / register tables:
   - add wrapper class: table-nowrap
   ========================================================================== */

/* 1. Responsive table wrapper from sphinx_rtd_theme */
.rst-content .wy-table-responsive {
  width: 100%;
  margin-bottom: 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

/* 2. Base table layout */
.rst-content .wy-table-responsive table,
.rst-content table.docutils {
  width: 100%;
  max-width: 100%;
  table-layout: auto;
}

/* 3. Cell readability */
.rst-content .wy-table-responsive table th,
.rst-content .wy-table-responsive table td,
.rst-content table.docutils th,
.rst-content table.docutils td {
  vertical-align: top;
  line-height: 1.5;
  padding: 8px 12px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* 4. Keep paragraphs and lists inside cells compact */
.rst-content .wy-table-responsive table td p,
.rst-content .wy-table-responsive table td ul,
.rst-content .wy-table-responsive table td ol,
.rst-content .wy-table-responsive table th p,
.rst-content .wy-table-responsive table th ul,
.rst-content .wy-table-responsive table th ol,
.rst-content table.docutils td p,
.rst-content table.docutils td ul,
.rst-content table.docutils td ol,
.rst-content table.docutils th p,
.rst-content table.docutils th ul,
.rst-content table.docutils th ol {
  margin-bottom: 0.35rem;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.rst-content .wy-table-responsive table td p:last-child,
.rst-content .wy-table-responsive table td ul:last-child,
.rst-content .wy-table-responsive table td ol:last-child,
.rst-content .wy-table-responsive table th p:last-child,
.rst-content .wy-table-responsive table th ul:last-child,
.rst-content .wy-table-responsive table th ol:last-child,
.rst-content table.docutils td p:last-child,
.rst-content table.docutils td ul:last-child,
.rst-content table.docutils td ol:last-child,
.rst-content table.docutils th p:last-child,
.rst-content table.docutils th ul:last-child,
.rst-content table.docutils th ol:last-child {
  margin-bottom: 0;
}

/* 5. Slightly improve header readability */
.rst-content .wy-table-responsive table th,
.rst-content table.docutils th {
  font-weight: 600;
}

/* 6. Improve scrollbar visibility */
.rst-content .wy-table-responsive::-webkit-scrollbar {
  height: 10px;
}

.rst-content .wy-table-responsive::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 999px;
}

.rst-content .wy-table-responsive::-webkit-scrollbar-thumb {
  background: #b5b5b5;
  border-radius: 999px;
}

.rst-content .wy-table-responsive::-webkit-scrollbar-thumb:hover {
  background: #8f8f8f;
}

/* ==========================================================================
   No-wrap table mode
   Usage:
   <div class="table-nowrap">
   ... markdown table ...
   </div>
   ========================================================================== */

/* Keep wrapper scrollable */
.rst-content .table-nowrap .wy-table-responsive {
  overflow-x: auto;
  overflow-y: hidden;
}

/* Let content define width so horizontal scrolling works naturally */
.rst-content .table-nowrap .wy-table-responsive table,
.rst-content .table-nowrap table.docutils {
  width: max-content;
  min-width: 100%;
}

/* Prevent wrapping in protocol-like tables */
.rst-content .table-nowrap .wy-table-responsive table th,
.rst-content .table-nowrap .wy-table-responsive table td,
.rst-content .table-nowrap table.docutils th,
.rst-content .table-nowrap table.docutils td {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

/* Also prevent wrapping for nested text blocks in no-wrap tables */
.rst-content .table-nowrap .wy-table-responsive table td p,
.rst-content .table-nowrap .wy-table-responsive table td ul,
.rst-content .table-nowrap .wy-table-responsive table td ol,
.rst-content .table-nowrap .wy-table-responsive table th p,
.rst-content .table-nowrap .wy-table-responsive table th ul,
.rst-content .table-nowrap .wy-table-responsive table th ol,
.rst-content .table-nowrap table.docutils td p,
.rst-content .table-nowrap table.docutils td ul,
.rst-content .table-nowrap table.docutils td ol,
.rst-content .table-nowrap table.docutils th p,
.rst-content .table-nowrap table.docutils th ul,
.rst-content .table-nowrap table.docutils th ol {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}
