/* OpenFollow Manual – layout & typography */

html {
  scroll-behavior: smooth;
}

body.docs {
  background: #06140d;
}

.docs-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 19, 13, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.docs-header-inner {
  width: min(1280px, calc(100% - 2rem));
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0;
}

.docs-brand {
  display: inline-flex;
  align-items: center;
}

.docs-brand img {
  height: 32px;
  display: block;
}

.docs-section-label {
  color: rgba(255, 188, 0, 0.9);
  font-weight: 600;
  font-size: 0.95rem;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  padding-left: 1rem;
  text-decoration: none;
}

a.docs-section-label:hover {
  color: rgba(255, 188, 0, 1);
}

.docs-version-tag {
  margin-left: auto;
  font-size: 0.78rem;
  color: rgba(247, 245, 233, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.docs-nav-toggle {
  display: none;
  background: transparent;
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}

.docs-layout {
  width: min(1280px, calc(100% - 2rem));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 3rem;
  padding: 0 0 3rem;
}

.docs-sidebar {
  position: sticky;
  top: 3.75rem;
  align-self: start;
  height: calc(100vh - 3.75rem);
  overflow-y: auto;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
  font-size: 0.95rem;
  padding: 1.75rem 0.75rem 2rem 0;
}

.docs-sidebar::-webkit-scrollbar {
  width: 6px;
}

.docs-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.docs-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 3px;
}

.docs-sidebar nav h4 {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  margin: 0.15rem 0;
  font-weight: 600;
}

.docs-sidebar nav h4 a {
  display: block;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  border-radius: 6px;
  border-left: 2px solid transparent;
  line-height: 1.35;
}

.docs-section-collapsed a {
  color: rgba(247, 245, 233, 0.7);
}

.docs-section-collapsed a:hover {
  color: #f7f5e9;
  background: rgba(255, 255, 255, 0.04);
}

.docs-section-active a {
  color: #ffbc00;
  border-left-color: #ffbc00;
  background: rgba(255, 188, 0, 0.07);
}

.docs-sidebar nav h4 + ul {
  margin: 0.1rem 0 0.6rem 0.6rem;
  padding-left: 0.4rem;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.docs-sidebar nav h4:first-of-type {
  margin-top: 0;
}

.docs-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.docs-sidebar li a {
  display: block;
  padding: 0.4rem 0.75rem;
  color: rgba(247, 245, 233, 0.75);
  text-decoration: none;
  border-radius: 6px;
  border-left: 2px solid transparent;
  line-height: 1.4;
}

.docs-sidebar li a:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #f7f5e9;
}

.docs-sidebar li a.active {
  color: #ffbc00;
  border-left-color: #ffbc00;
  background: rgba(255, 188, 0, 0.07);
}

.docs-sidebar-sub {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0.5rem 1rem;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.docs-sidebar-sub li a {
  display: block;
  padding: 0.3rem 0.7rem;
  font-size: 0.86rem;
  color: rgba(247, 245, 233, 0.55);
  text-decoration: none;
  border-radius: 4px;
  border-left: 2px solid transparent;
  margin-left: -1px;
  line-height: 1.35;
}

.docs-sidebar-sub li a:hover {
  color: #f7f5e9;
  background: rgba(255, 255, 255, 0.03);
}

.docs-sidebar-sub li a.active {
  color: #ffbc00;
  border-left-color: #ffbc00;
  background: rgba(255, 188, 0, 0.05);
}

/* Second level of the sub-nav (nested opt-in, e.g. Troubleshooting): h3 sit
   indented under their h2 group, dimmer and a notch smaller. Rules follow the
   base .docs-sidebar-sub block so they win on source order at equal specificity. */
.docs-sidebar-sub-nested {
  margin: 0.15rem 0 0.4rem 0.7rem;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.docs-sidebar-sub-nested li a {
  padding: 0.25rem 0.65rem;
  font-size: 0.82rem;
  color: rgba(247, 245, 233, 0.48);
}

.docs-main {
  min-width: 0;
  padding-top: 2.5rem;
}

.docs-content {
  max-width: 48rem;
}

.docs-eyebrow {
  display: inline-block;
  margin: 0 0 0.75rem !important;
  color: rgba(255, 188, 0, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
}

.docs-content h1 {
  font-size: clamp(2rem, 3vw, 2.8rem);
  margin: 0 0 1.5rem;
  line-height: 1.1;
}

.docs-content h2 {
  margin: 2.6rem 0 1rem;
  font-size: 1.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 2.2rem;
  scroll-margin-top: 5rem;
}

.docs-content h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.docs-content h3 {
  margin: 1.8rem 0 0.6rem;
  font-size: 1.15rem;
  scroll-margin-top: 5rem;
}

/* Shareable heading anchors: a chain-link icon trails the page title and every
   h2/h3; clicking it copies a direct link. Faint at rest, brighter on hover. */
.docs-content .docs-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 0.4em;
  color: inherit;
  opacity: 0.3;
  text-decoration: none;
  vertical-align: middle;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.docs-content h1:hover .docs-anchor,
.docs-content h2:hover .docs-anchor,
.docs-content h3:hover .docs-anchor {
  opacity: 0.6;
}

.docs-content .docs-anchor:hover,
.docs-content .docs-anchor:focus-visible {
  opacity: 1;
  color: #ffbc00;
}

.docs-content .docs-anchor:focus-visible {
  outline: 2px solid #ffbc00;
  outline-offset: 2px;
  border-radius: 3px;
}

.docs-anchor svg {
  width: 0.8em;
  height: 0.8em;
  display: block;
}

/* "Copied" confirmation bubble above the icon. */
.docs-anchor.copied::after {
  content: "Copied";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  padding: 0.2rem 0.45rem;
  background: #0a1c12;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 5px;
  color: #f7f5e9;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
}

.docs-content p,
.docs-content ul,
.docs-content ol {
  font-size: 1.0625rem;
  color: rgba(247, 245, 233, 0.88);
}

.docs-content ul,
.docs-content ol {
  padding-left: 1.4rem;
  margin-bottom: 1.25rem;
}

.docs-content li {
  margin-bottom: 0.35rem;
}

.docs-content code {
  background: rgba(255, 255, 255, 0.07);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
}

.docs-content pre {
  background: #0a1c12;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1rem 1.2rem;
  border-radius: 0.85rem;
  overflow-x: auto;
  font-size: 0.92rem;
  line-height: 1.55;
}

.docs-content pre code {
  background: transparent;
  padding: 0;
}

.docs-content a {
  color: #ffbc00;
}

/* Footnotes run at half size in the manual. Scoped here (not in the shared
   .footnote rule) to leave the landing page untouched, and specific enough
   to win over .docs-content p. */
.docs-content .footnote {
  font-size: 50%;
  color: rgba(255, 255, 255, 0.8);
}

/* Footnote links read as light grey, not the golden body-link colour. */
.docs-content .footnote a {
  color: rgba(255, 255, 255, 0.7);
}

.docs-content .footnote a:hover {
  color: rgba(255, 255, 255, 0.92);
}

.docs-callout {
  border-left: 3px solid #ffbc00;
  background: rgba(255, 188, 0, 0.06);
  padding: 0.9rem 1.1rem;
  border-radius: 0 8px 8px 0;
  margin: 1.25rem 0;
}

.docs-callout.warning {
  border-left-color: #ff8a00;
  background: rgba(255, 138, 0, 0.08);
}

.docs-callout p:last-child {
  margin-bottom: 0 !important;
}

/* Troubleshooting "Jump to your symptom" router: a compact category grid that
   sends the reader straight to a problem section, since those sections now sit
   a level deeper under group headers. */
.docs-symptom-index {
  margin: 1.5rem 0 2.5rem;
  padding: 1.25rem 1.4rem 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.025);
}

.docs-content .docs-symptom-lead {
  margin: 0 0 1rem;
  color: rgba(255, 188, 0, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
}

.docs-symptom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.4rem 1.75rem;
}

.docs-symptom-cat {
  margin-bottom: 1.1rem;
}

.docs-content .docs-symptom-cat-title {
  margin: 0 0 0.4rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: #f7f5e9;
}

.docs-content .docs-symptom-cat ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-content .docs-symptom-cat li {
  margin-bottom: 0.25rem;
}

.docs-symptom-cat a {
  font-size: 0.97rem;
}

/* IP-fill helper on the NDI install page: type an IP once, every
   <device-ip> in the commands below updates live (.ip-ph spans). */
.ip-fill {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
  margin: 1.25rem 0;
  padding: 0.9rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.ip-fill label {
  font-weight: 600;
}

.ip-fill input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.95rem;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #0a1c12;
  color: inherit;
  min-width: 12rem;
}

.ip-fill input:focus {
  outline: none;
  border-color: #ffbc00;
}

.ip-fill .ip-fill-hint {
  flex-basis: 100%;
  font-size: 0.85rem;
  opacity: 0.7;
}

.docs-content .ip-ph,
.docs-content .fill-ph {
  color: #ffbc00;
}

/* Fill-field (.deb install): a labelled input embedded in the steps; type your
   username / IP once and every matching placeholder below (.fill-ph spans)
   updates live. */
.fill-field {
  display: inline-flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0.75rem 0;
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.fill-field label {
  font-weight: 600;
  font-size: 0.9rem;
}

.fill-field input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.95rem;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #0a1c12;
  color: inherit;
  min-width: 12rem;
}

.fill-field input:focus {
  outline: none;
  border-color: #ffbc00;
}

.doc-tabs {
  margin: 1.5rem 0 0;
}

.doc-tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 1.75rem;
}

.doc-tab {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 0.6rem 0.95rem;
  color: rgba(247, 245, 233, 0.6);
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
}

.doc-tab:hover {
  color: rgba(247, 245, 233, 0.92);
}

.doc-tab[aria-selected="true"] {
  color: #ffbc00;
  border-bottom-color: #ffbc00;
}

.doc-tab:focus-visible {
  outline: 2px solid #ffbc00;
  outline-offset: 2px;
  border-radius: 4px;
}

.doc-tabpanel:focus {
  outline: none;
}

.doc-steps > li {
  margin-bottom: 1.2rem;
}

.doc-steps > li > strong:first-child {
  display: block;
  margin-bottom: 0.35rem;
}

.docs-stub {
  margin-top: 1.5rem;
  padding: 1rem 1.2rem;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  color: rgba(247, 245, 233, 0.7);
  font-size: 0.95rem;
}

.docs-screenshot {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  margin: 1.25rem 0;
  padding: 1.25rem;
  border: 2px dashed rgba(255, 188, 0, 0.35);
  border-radius: 0.85rem;
  background: rgba(255, 188, 0, 0.04);
  color: rgba(255, 188, 0, 0.85);
  text-align: center;
  font-size: 0.92rem;
  font-weight: 500;
}

.docs-screenshot::before {
  content: "📷  ";
}

.docs-keys kbd {
  display: inline-block;
  padding: 0.1em 0.45em;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85em;
  font-weight: 600;
  line-height: 1;
}

.docs-content kbd {
  display: inline-block;
  padding: 0.1em 0.45em;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85em;
  font-weight: 600;
  line-height: 1;
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.95rem;
}

.docs-table th,
.docs-table td {
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: top;
}

.docs-table td p {
  font-size: inherit;
  color: inherit;
  margin: 0 0 0.5rem !important;
}

.docs-table td p:last-child {
  margin-bottom: 0 !important;
}

.docs-table th {
  color: rgba(255, 188, 0, 0.9);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.02);
}

.docs-table tr:last-child td {
  border-bottom: none;
}

.docs-table tr.is-recommended {
  background: rgba(255, 188, 0, 0.06);
}

.docs-table tr.is-recommended td:first-child {
  white-space: nowrap;
}

.docs-table .status-badge {
  vertical-align: middle;
  font-size: 0.7rem;
  padding: 0.12em 0.6em;
}

.docs-content ol.docs-steps {
  counter-reset: docs-step;
  list-style: none;
  padding-left: 0;
}

.docs-content ol.docs-steps > li {
  counter-increment: docs-step;
  position: relative;
  padding: 0.85rem 1rem 0.85rem 3rem;
  margin-bottom: 0.75rem;
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.docs-content ol.docs-steps > li::before {
  content: counter(docs-step);
  position: absolute;
  left: 0.85rem;
  top: 0.85rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: #ffbc00;
  color: #07130d;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.docs-content ol.docs-steps > li > strong:first-child {
  display: inline-block;
  margin-bottom: 0.25rem;
}

.docs-page-nav {
  display: flex;
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.docs-page-nav a {
  color: #ffbc00;
  text-decoration: none;
  font-weight: 600;
}

.docs-page-nav .docs-prev {
  margin-right: auto;
}

.docs-page-nav .docs-next {
  margin-left: auto;
}

.docs-toc-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 1.5rem 0;
}

.docs-toc-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.25rem;
  border-radius: 0.85rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.docs-toc-card:hover {
  border-color: rgba(255, 188, 0, 0.4);
  transform: translateY(-1px);
}

.docs-toc-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  color: #ffbc00;
}

.docs-toc-card p {
  margin: 0;
  font-size: 0.92rem;
  color: rgba(247, 245, 233, 0.75);
}

/* OSC Dictionary – one repeatable .osc-entry per inbound address, grouped
   under <h2> families, all reachable from the Message index at the top.
   Built to stay uniform as the vocabulary grows: every entry, whether the
   first or the fiftieth, renders the same. */
.osc-entry {
  margin: 1.1rem 0 1.6rem;
  padding: 1.05rem 1.25rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-left: 3px solid rgba(255, 188, 0, 0.5);
  border-radius: 0 0.85rem 0.85rem 0;
  background: rgba(255, 255, 255, 0.02);
  scroll-margin-top: 5rem;
}

.docs-content .osc-entry > h3 {
  margin: 0 0 0.55rem;
  font-size: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.7rem;
  scroll-margin-top: 5rem;
}

.docs-content .osc-entry .osc-addr {
  background: rgba(255, 188, 0, 0.12);
  color: #ffd24a;
}

.docs-content .osc-entry .osc-args {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  opacity: 0.72;
}

.docs-content .osc-entry > p:last-child,
.docs-content .osc-entry > pre:last-child,
.docs-content .osc-entry > .docs-table:last-child {
  margin-bottom: 0.65rem;
}

/* Subheader rows that group the Message index by family. */
.docs-table tr.osc-idx-group td {
  color: rgba(255, 188, 0, 0.9);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.03);
  padding-top: 0.7rem;
}

@media (max-width: 900px) {
  .docs-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1rem 0 2rem;
  }
  .docs-sidebar {
    position: static;
    height: auto;
    overflow: visible;
    padding: 0 0 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: none;
  }
  .docs-sidebar.open {
    display: block;
  }
  .docs-main {
    padding-top: 0;
  }
  .docs-nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }
}

@media (max-width: 600px) {
  .docs-toc-grid {
    grid-template-columns: 1fr;
  }
}

/* Search -------------------------------------------------------------------
   Injected into the header by wireSearch() in docs.js, so no page markup
   carries it. The field sits at the right of the header next to the version
   tag; the results drop out of it. */

.docs-search {
  position: relative;
  margin-left: auto;
  flex: 0 1 16rem;
  min-width: 0;
}

.docs-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.4rem 2rem 0.4rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #f7f5e9;
  font: inherit;
  font-size: 0.85rem;
  line-height: 1.4;
}

.docs-search-input::placeholder {
  color: rgba(247, 245, 233, 0.45);
}

.docs-search-input:focus {
  outline: none;
  border-color: rgba(255, 188, 0, 0.55);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(255, 188, 0, 0.12);
}

/* The dark native clear button is invisible on this ground, and Esc already
   clears the field. */
.docs-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.docs-search-key {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  pointer-events: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
  line-height: 1;
  padding: 0.15rem 0.35rem;
  color: rgba(247, 245, 233, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
}

.docs-search:focus-within .docs-search-key {
  display: none;
}

.docs-search-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 60;
  width: min(32rem, calc(100vw - 2rem));
  max-height: min(70vh, 34rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #0a1a11;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  padding: 0.35rem;
}

.docs-search-hit {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  text-decoration: none;
  border-left: 2px solid transparent;
}

.docs-search-hit:hover,
.docs-search-hit.active {
  background: rgba(255, 188, 0, 0.08);
  border-left-color: #ffbc00;
}

.docs-search-crumb {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(247, 245, 233, 0.45);
}

.docs-search-title {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: #f7f5e9;
}

.docs-search-hit.active .docs-search-title {
  color: #ffbc00;
}

.docs-search-aka {
  margin-left: 0.4rem;
  font-weight: 400;
  font-style: italic;
  font-size: 0.85em;
  color: rgba(247, 245, 233, 0.5);
}

.docs-search-text {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: rgba(247, 245, 233, 0.62);
}

.docs-search-panel mark {
  background: rgba(255, 188, 0, 0.2);
  color: #ffd45e;
  padding: 0 0.15em;
  border-radius: 2px;
}

.docs-search-empty {
  margin: 0;
  padding: 0.9rem 0.7rem;
  font-size: 0.85rem;
  color: rgba(247, 245, 233, 0.6);
}

.docs-search-empty strong {
  color: #f7f5e9;
}

.docs-search-foot {
  margin: 0.35rem 0 0;
  padding: 0.45rem 0.7rem 0.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.72rem;
  color: rgba(247, 245, 233, 0.4);
}

.docs-search-foot kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95em;
  color: rgba(247, 245, 233, 0.6);
}

/* Below the sidebar breakpoint the header row is already full: the search field
   takes a row of its own rather than competing with the Menu toggle and the
   version tag for the right-hand slot. */
@media (max-width: 900px) {
  .docs-header-inner {
    flex-wrap: wrap;
    row-gap: 0.6rem;
  }
  .docs-search {
    order: 10;
    flex: 1 0 100%;
    margin-left: 0;
  }
  .docs-search-panel {
    left: 0;
    right: 0;
    width: auto;
  }
}

/* Keyword index -----------------------------------------------------------
   The A-Z index is a few hundred short entries, so it reads as a two-column
   reference rather than prose: term and alias in a fixed left column, the
   definition and its chapter links beside them. It runs wider than a chapter
   to make room, and carries a filter field over sticky letter headings.
   The letter headings stay out of the sidebar sub-nav via data-subnav="none"
   on the article - 25 of them would be longer than the chapter list itself. */

.docs-content.kw-page {
  max-width: 62rem;
}

/* Filter field. Sticky under the header so it stays reachable from anywhere in
   the list; static below the sidebar breakpoint, where the header wraps to two
   rows and its height is no longer a constant to offset against. */
.kw-filter {
  position: sticky;
  top: 3.75rem;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.75rem 0 0;
  padding: 0.85rem 0;
  background: #06140d;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.kw-filter-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.55rem 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  color: #f7f5e9;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
}

.kw-filter-input::placeholder {
  color: rgba(247, 245, 233, 0.45);
}

.kw-filter-input:focus {
  outline: none;
  border-color: rgba(255, 188, 0, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 188, 0, 0.12);
}

.docs-content .kw-filter-count {
  flex: 0 0 auto;
  margin: 0;
  font-size: 0.85rem;
  color: rgba(247, 245, 233, 0.62);
  white-space: nowrap;
}

/* Letter headings ride along under the filter, so the current letter is always
   on screen. Nothing like the chapter h2 rule, which they would otherwise pick
   up a 2.6rem top margin and a rule line from. */
.docs-content .kw-entries .kw-section {
  position: sticky;
  top: 8rem;
  z-index: 4;
  margin: 1.5rem 0 0;
  padding: 0.35rem 0 0.5rem;
  border-top: none;
  border-bottom: 1px solid rgba(255, 188, 0, 0.35);
  background: #06140d;
  color: rgba(255, 188, 0, 0.95);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  scroll-margin-top: 9rem;
}

.docs-content .kw-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-content .kw-list li {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  column-gap: 1.75rem;
  margin: 0;
  padding: 0.65rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  scroll-margin-top: 9rem;
}

.docs-content .kw-list li:first-child {
  padding-top: 0.85rem;
  border-top: none;
}

/* [hidden] loses to the display rules above, so filtering needs it back. */
.docs-content .kw-list li[hidden],
.docs-content .kw-entries .kw-section[hidden],
.docs-content .kw-list[hidden] {
  display: none;
}

/* Term and alias share the left cell, definition and links the right one, so a
   long definition never pushes the alias away from its term. */
.kw-term {
  display: block;
  color: #f7f5e9;
  font-weight: 600;
}

.kw-aka {
  display: block;
  color: rgba(247, 245, 233, 0.58);
  font-size: 0.88em;
  font-style: italic;
}

.kw-gloss {
  display: block;
  color: rgba(247, 245, 233, 0.78);
  font-size: 0.97em;
}

.kw-links {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.88em;
}

.kw-filter-empty {
  margin: 2rem 0;
  color: rgba(247, 245, 233, 0.7);
}

@media (max-width: 900px) {
  .kw-filter {
    position: static;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
  }
  .docs-content .kw-entries .kw-section {
    top: 6.5rem;
    scroll-margin-top: 7.5rem;
  }
  .docs-content .kw-list li {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0.3rem;
  }
}
