/* Search / Ask control — owns the centered navbar search slot (.adt-navbar-search). */
:root {
  /* Match Valentus --adt-transition so light↔dark does not snap the omnibox chrome. */
  --adt-search-theme-transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease,
    box-shadow 0.25s ease;
  /* Opaque fills only. Literal hex — never var(--adt-border) / --adt-accent-soft (those are rgba). */
  --adt-search-surface: #ffffff;
  --adt-search-surface-hover: #deefed;
  --adt-search-rim: #acced2;
  --adt-search-ink: #141820;
  --adt-search-muted: #5a6270;
  --adt-search-chip: #f3f5f8;
  --adt-search-ask: #e7f4f3;
  --adt-search-ask-error: #f7e4e4;
  --adt-search-hit: #e8f1fb;
}

html.dark-theme {
  --adt-search-surface: #141a22;
  --adt-search-surface-hover: #193b3e;
  --adt-search-rim: #3a4454;
  --adt-search-ink: #e8ebf0;
  --adt-search-muted: #9aa3b2;
  --adt-search-chip: #1e2630;
  --adt-search-ask: #16323a;
  --adt-search-ask-error: #281a21;
  --adt-search-hit: #1d3042;
}

.adt-search-chat {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Navbar: one column for the scope row and the query field. */
.adt-site-navbar .adt-search-chat,
.adt-navbar-search .adt-search-chat {
  gap: 0;
  min-height: 2.15rem;
}

.adt-search-chat__popover {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.adt-search-chat__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.adt-search-chat__omnibox {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0;
  min-width: 0;
}

/* ——— Collapse-to-icon (narrow / collision) ——— */
.adt-search-chat__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2.15rem;
  height: 2.15rem;
  margin: 0;
  padding: 0;
  border: 1px solid var(--adt-search-rim);
  border-radius: 0.5rem;
  background: var(--adt-elevated, #fff);
  color: var(--adt-ink, #141820);
  cursor: pointer;
  box-sizing: border-box;
  transition: var(--adt-search-theme-transition);
}

.adt-search-chat__toggle:hover,
.adt-search-chat__toggle:focus-visible {
  border-color: var(--adt-accent, #0d9488);
  background-color: var(--adt-search-surface-hover);
  outline: none;
}

.adt-search-chat__toggle:focus-visible {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--adt-accent, #0d9488) 35%, transparent);
}

.adt-search-chat__toggle-icon {
  display: block;
}

html.dark-theme .adt-search-chat__toggle {
  background: var(--adt-elevated, #1a1a1a);
  color: var(--adt-ink, #e8eaed);
  border-color: var(--adt-search-rim);
}

html.dark-theme .adt-search-chat__toggle:hover,
html.dark-theme .adt-search-chat__toggle:focus-visible {
  background-color: var(--adt-search-surface-hover);
}

/* Collapsed to icon: only the toggle shows until opened. */
.adt-search-chat.is-collapsed {
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  width: auto;
  min-width: 0;
}

.adt-search-chat.is-collapsed .adt-search-chat__toggle {
  display: inline-flex;
}

.adt-search-chat.is-collapsed .adt-search-chat__popover {
  display: none;
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.4rem);
  inset-inline-end: 0;
  width: min(36rem, calc(100vw - 1.5rem));
  min-width: min(18rem, calc(100vw - 1.5rem));
  padding: 0.55rem;
  border: 1px solid var(--adt-search-rim);
  border-radius: 0.65rem;
  background-color: var(--adt-search-surface);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--adt-ink, #141820) 5%, transparent),
    0 0.45rem 1.25rem color-mix(in srgb, var(--adt-ink, #141820) 14%, transparent);
  box-sizing: border-box;
  transition: var(--adt-search-theme-transition);
}

.adt-search-chat.is-collapsed.is-open .adt-search-chat__popover {
  display: block;
}

.adt-search-chat.is-collapsed.is-open .adt-search-chat__toggle {
  border-color: var(--adt-accent, #0d9488);
  color: var(--adt-accent, #0d9488);
}

html.dark-theme .adt-search-chat.is-collapsed .adt-search-chat__popover {
  background: var(--adt-search-surface);
  background-color: var(--adt-search-surface);
  border-color: var(--adt-search-rim);
}

.adt-search-chat__tabs {
  display: flex;
  gap: 0.35rem;
  order: 0;
}

.adt-search-chat__tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex: 1 1 auto;
  margin: 0;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--adt-search-rim);
  border-radius: 0.35rem;
  background: var(--adt-search-surface);
  background-color: var(--adt-search-surface);
  color: inherit;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
}

.adt-search-chat__hint,
.adt-search-chat__field-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  padding: 0.05rem 0.3rem;
  border: 1px solid var(--adt-search-rim);
  border-radius: 0.25rem;
  background: var(--adt-search-chip);
  background-color: var(--adt-search-chip);
  color: var(--adt-search-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.2;
  opacity: 1;
}

.adt-search-chat__field {
  position: relative;
}

/* Stacked scope + input: one rounded card, scope row on top, query field below.
   Must stay overflow:visible — legacy lunr mounts results on .adt-search-input-wrap;
   hybrid dock will mount dual zones above the whole compound.
   container-type: inline-size → 100cqi = full dock width for results alignment. */
.adt-search-compound {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
  min-height: 2.15rem;
  border: 1px solid var(--adt-search-rim);
  border-radius: 0.5rem;
  background-color: var(--adt-search-surface);
  overflow: visible;
  color: var(--adt-ink, #141820);
  container-type: inline-size;
  container-name: adt-search-compound;
  transition: var(--adt-search-theme-transition);
}

/* Accent border whenever something inside is focused; glow only while typing. */
.adt-search-compound:focus-within {
  border-color: var(--adt-accent, #0d9488);
}

.adt-search-compound:focus-within:has(#search-input:focus) {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--adt-accent, #0d9488) 35%, transparent);
}

/* Scope/context row — full width above the input (floating dock layout).
   overflow stays visible so the tree menu can drop below the trigger. */
.adt-search-scope-slot {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  max-width: none;
  min-height: 2rem;
  box-sizing: border-box;
  border-inline-end: 0;
  border-block-end: 1px solid var(--adt-search-rim);
  border-start-start-radius: calc(0.5rem - 1px);
  border-start-end-radius: calc(0.5rem - 1px);
  border-end-start-radius: 0;
  border-end-end-radius: 0;
  background-color: var(--adt-search-surface);
  overflow: visible;
  cursor: default;
  transition: var(--adt-search-theme-transition);
}

/* Closed face: selected scope label only (no Antora "Component"/"Version" kind prefix). */
.adt-search-scope-face {
  display: flex;
  align-items: center;
  min-width: 0;
  pointer-events: none;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
}

.adt-search-scope-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--adt-ink, #141820);
}

/* Chevron lives on the slot (::after). */
.adt-search-scope-slot::after {
  content: "";
  position: absolute;
  right: 0.45rem;
  top: 50%;
  z-index: 2;
  width: 0.55rem;
  height: 0.55rem;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--adt-ink-muted, #5a6270);
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 6L8 11L12.5 6' stroke='black' stroke-width='1.85' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 6L8 11L12.5 6' stroke='black' stroke-width='1.85' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

/* One hit target for the whole visible bar. The slot paints the rounded fill;
   this button covers that box (including the lower half) without a second layer. */
.adt-search-scope-trigger {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0 1.65rem 0 0.65rem;
  border: 0;
  border-start-start-radius: calc(0.5rem - 1px);
  border-start-end-radius: calc(0.5rem - 1px);
  border-end-start-radius: 0;
  border-end-end-radius: 0;
  background: transparent;
  background-color: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  cursor: default;
  outline: none;
  box-shadow: none;
}

.adt-search-scope-trigger:focus,
.adt-search-scope-trigger:focus-visible,
.adt-search-scope-trigger:active {
  outline: none;
  box-shadow: none;
}

/* Static hierarchy tree (All docs → component → versions). Not expandable. */
.adt-search-scope-menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  z-index: 40;
  min-width: max(100%, 14rem);
  max-width: min(22rem, 80vw);
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  border-radius: 0.45rem;
  background-color: var(--adt-search-surface);
  border: 1px solid var(--adt-search-rim);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--adt-ink, #141820) 5%, transparent),
    0 0.45rem 1.1rem color-mix(in srgb, var(--adt-ink, #141820) 12%, transparent);
  color: var(--adt-ink, #141820);
  font-size: 0.78rem;
  line-height: 1.25;
}

.adt-search-scope-option {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin: 0;
  padding: 0.35rem 0.7rem;
  cursor: default;
  outline: none;
  white-space: nowrap;
}

.adt-search-scope-option--depth-1 {
  padding-inline-start: 1.15rem;
}

.adt-search-scope-option--depth-2 {
  padding-inline-start: 2rem;
}

.adt-search-scope-tree-mark {
  flex: 0 0 auto;
  color: var(--adt-ink-muted, #5a6270);
  font-weight: 500;
}

.adt-search-scope-option-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.adt-search-scope-option:hover,
.adt-search-scope-option:focus {
  background-color: var(--adt-search-surface-hover);
}

.adt-search-scope-option.is-selected {
  font-weight: 600;
}

.adt-search-scope-option[hidden] {
  display: none !important;
}

html.dark-theme .adt-search-compound,
html.dark-theme .adt-search-scope-slot,
html.dark-theme .adt-search-scope-menu {
  background-color: var(--adt-elevated, #1a1a1a);
  color: var(--adt-ink, #e8eaed);
}

html.dark-theme .adt-search-scope-label {
  color: var(--adt-ink, #e8eaed);
}

html.dark-theme .adt-search-scope-slot {
  border-inline-end-color: var(--adt-search-rim);
}

html.dark-theme .adt-search-scope-slot::after,
html.dark-theme .adt-search-scope-tree-mark {
  color: var(--adt-ink-muted, #9aa3b2);
}

html.dark-theme .adt-search-scope-menu {
  border-color: var(--adt-search-rim);
  box-shadow: 0 0.45rem 1.1rem #000000;
}

/* Soft fill on the whole left segment. */
.adt-search-scope-slot:hover,
.adt-search-scope-slot:focus-within,
.adt-search-scope-slot.is-open {
  background-color: var(--adt-search-surface-hover);
}

.adt-search-scope-slot.is-disabled,
.adt-search-scope-slot.is-disabled:hover,
.adt-search-scope-slot.is-disabled:focus-within {
  background-color: var(--adt-search-chip);
  color: var(--adt-search-muted);
  cursor: not-allowed;
  opacity: 1;
}

.adt-search-scope-slot.is-disabled .adt-search-scope-trigger {
  cursor: not-allowed;
  pointer-events: none;
}

html.dark-theme .adt-search-scope-slot:hover,
html.dark-theme .adt-search-scope-slot:focus-within,
html.dark-theme .adt-search-scope-slot.is-open {
  background-color: var(--adt-search-surface-hover);
}

html.dark-theme .adt-search-scope-option:hover,
html.dark-theme .adt-search-scope-option:focus {
  background-color: var(--adt-search-surface-hover);
}

/* Query slot: stable height when swapping Search input vs Ask textarea. */
.adt-search-chat__query-slot {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 2.65rem;
  border-start-start-radius: 0;
  border-start-end-radius: 0;
  border-end-start-radius: calc(0.5rem - 1px);
  border-end-end-radius: calc(0.5rem - 1px);
  overflow: visible;
  background-color: var(--adt-search-surface);
}

.adt-search-ask-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: inherit;
  border-end-start-radius: calc(0.5rem - 1px);
  border-end-end-radius: calc(0.5rem - 1px);
  background-color: var(--adt-search-surface);
}

.adt-search-ask-wrap[hidden] {
  display: none !important;
}

.adt-search-input-wrap[hidden] {
  display: none !important;
}

/* Input + fake placeholder — full width under the scope row. */
.adt-search-input-wrap {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: stretch;
  overflow: visible;
  background-color: var(--adt-search-surface);
}

/* Results menu spans the full stacked compound width (100cqi), not the input cell only. */
.adt-search-compound .search-result-dropdown-menu,
.adt-search-input-wrap > .search-result-dropdown-menu {
  left: auto;
  right: 0;
  width: 100cqi;
  min-width: 100cqi;
  max-width: 100cqi;
  box-sizing: border-box;
  z-index: 40;
}

/* Beat theme .adt-nav-search #search-input !important rules.
   Clip typed text on the input itself (not the wrap that hosts lunr results). */
.adt-search-compound #search-input {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: auto !important;
  margin: 0;
  padding: 0.35rem 0.65rem !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--adt-search-surface) !important;
  background-color: var(--adt-search-surface) !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  color: var(--adt-ink, #141820) !important;
  font: inherit;
  font-size: 0.875rem;
  -webkit-user-select: text;
  user-select: text;
  overflow: hidden !important;
  text-overflow: clip;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.adt-search-compound #search-input::placeholder {
  color: var(--adt-search-muted);
  opacity: 1;
}

.adt-search-compound #search-input:hover,
.adt-search-compound #search-input:focus {
  background: var(--adt-search-surface) !important;
  background-color: var(--adt-search-surface) !important;
  border-color: var(--adt-search-surface) !important;
  box-shadow: none !important;
  outline: none;
}

/* Compound field uses .adt-search-chat__field-hint; hide theme ::after "/" badge. */
.adt-search-chat #search-field::after,
.adt-search-compound::after {
  content: none !important;
  display: none !important;
}

/* Native <input placeholder> cannot style part of the string — overlay instead.
   pointer-events: none is required so clicks/dblclick reach #search-input. */
.adt-search-ph {
  position: absolute;
  inset-inline-start: 0.65rem;
  inset-inline-end: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  border: 0;
  max-width: calc(100% - 2.4rem);
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  color: var(--adt-search-muted);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
  user-select: none;
}

.adt-search-ph.is-hidden {
  visibility: hidden;
}

.adt-search-ph-main {
  color: inherit;
}

/* Slash shortcut, set as inline code. Same mono family as site <code> (IBM Plex Mono). */
.adt-search-ph-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0.05em 0.35em;
  border: 1px solid var(--adt-search-rim);
  border-radius: 0.25rem;
  background: var(--adt-search-chip);
  background-color: var(--adt-search-chip);
  color: var(--adt-search-ink);
  font-family: var(--adt-font-mono, "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
  font-size: 0.85em;
  font-weight: 500;
  line-height: 1.2;
}

.adt-search-chat__field:not(.adt-search-compound) #search-input {
  width: 100%;
  box-sizing: border-box;
  padding-inline-end: 1.75rem;
}

.adt-search-chat__field-hint {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  inset-inline-end: 0.45rem;
  pointer-events: none;
}

.adt-search-ask-wrap .adt-search-chat__field-hint {
  top: 0.5rem;
}

.adt-search-chat__tab.is-active {
  border-color: var(--adt-accent, #0d9488);
  color: var(--adt-accent, #0d9488);
}

.adt-search-chat__tab:focus-visible {
  outline: 2px solid var(--adt-accent, #0d9488);
  outline-offset: 2px;
}

.adt-search-chat__ask-input {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.35rem 1.75rem 0.35rem 0.65rem;
  border: 0;
  border-radius: 0;
  background-color: var(--adt-search-surface);
  color: var(--adt-ink, inherit);
  font: inherit;
  font-size: 0.875rem;
  resize: vertical;
  min-height: 2.65rem;
  outline: none;
  box-shadow: none;
}

.adt-search-chat__ask-result {
  margin: 0;
  padding: 0.5rem 0.6rem;
  border-radius: 0.35rem;
  font-size: 0.8rem;
  line-height: 1.4;
  background-color: var(--adt-search-ask);
  border: 1px solid var(--adt-search-rim);
}

.adt-search-chat__ask-result.is-error {
  background-color: var(--adt-search-ask-error);
  border-color: #b91c1c;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ——— Top layer: search menus/results above everything ———
   The scope menu, collapsed popover, Ask panel, and Lunr results must paint
   over the doc mast and page chrome. Valentus lifts .adt-site-navbar above
   .adt-doc-mast inside the sticky header; these z-indexes win inside that
   context and against body-level layers. */
:root {
  --adt-search-top-z: 200;
}

.adt-search-chat .adt-search-scope-menu:not([hidden]),
.adt-search-chat.is-collapsed .adt-search-chat__popover {
  z-index: var(--adt-search-top-z);
}

.adt-search-chat .search-result-dropdown-menu {
  z-index: var(--adt-search-top-z);
  /* Lunr default: background transparent — only .search-result-dataset is filled. */
  background-color: var(--adt-search-surface);
  border: 1px solid var(--adt-search-rim);
  border-radius: 0.55rem;
  padding: 0;
  /* One scrollport for keyword results. Empty menus are hidden below. */
  max-height: min(65vh, calc(100vh - 12rem));
  overflow-x: hidden;
  overflow-y: auto;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--adt-ink, #141820) 5%, transparent),
    0 0.45rem 1.25rem color-mix(in srgb, var(--adt-ink, #141820) 14%, transparent);
}

.adt-search-chat .search-result-dataset {
  background-color: var(--adt-search-surface);
  border: none;
  border-radius: calc(0.55rem - 1px);
  color: var(--adt-ink, #141820);
  /* Lunr sets overflow:auto and a max-height taller than the menu, which
     nested a second scrollbar. The menu (or a result zone) is the scrollport. */
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
}

/* Lunr inserts an empty .search-result-dropdown-menu before any query.
   Its border paints a stray line until the first search. */
.adt-search-chat .search-result-dropdown-menu:empty,
.adt-search-chat .search-result-dropdown-menu:not(:has(.search-result-dataset)),
.adt-search-chat .search-result-dropdown-menu.is-idle {
  display: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

.adt-search-chat .search-result-component-header,
.adt-search-chat .search-result-document-title,
.adt-search-chat .search-result-document-hit,
.adt-search-chat .search-result-document {
  background-color: var(--adt-search-surface);
}

.adt-search-chat .search-result-component-header {
  border-bottom-color: var(--adt-search-rim);
}

.adt-search-chat .search-result-document-title {
  border-right-color: var(--adt-search-rim);
}

.adt-search-chat .search-result-document-hit:hover,
.adt-search-chat .search-result-document-hit:focus-within {
  background-color: var(--adt-search-surface-hover);
}

/* ——— Capability strip (Keyword / Semantic / Chat status) ———
   Bottom of the overlay (dock); hidden in navbar where space is tight. */
.adt-search-capabilities {
  display: none;
  flex-wrap: wrap;
  gap: 0.25rem 0.9rem;
  align-items: center;
  order: 2;
  margin-top: auto;
  padding: 0.45rem 0.1rem 0.1rem;
  border-top: 1px solid var(--adt-search-rim);
  font-size: 0.72rem;
  color: var(--adt-muted, #5b6472);
  background-color: var(--adt-search-surface);
}

.adt-search-chat[data-placement='dock'] .adt-search-capabilities {
  display: flex;
}

.adt-search-capability {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background-color: var(--adt-search-chip);
  cursor: default;
}

.adt-search-capability input {
  margin: 0;
  accent-color: var(--adt-accent, #0d9488);
}

.adt-search-capability.is-off {
  opacity: 1;
  color: var(--adt-search-muted);
  background-color: var(--adt-search-chip);
}

/* Dock placement vacates the navbar slot. The dock node is moved into the
   page column, so this only collapses the empty host (no leftover gap). */
.adt-navbar-search:has(> .adt-search-chat[data-placement='dock']),
.adt-navbar-search.adt-search-slot-vacated,
.adt-site-navbar .adt-nav-search:has(> .adt-search-chat[data-placement='dock']) {
  flex: 0 0 0;
  width: 0;
  min-width: 0;
  max-width: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
}

/* ——— In-flow sticky dock ———
   JS appends the dock to .adt-shell (class adt-search-dock-column), the
   page column that ends immediately before footer.footer. Sticky keeps the
   bar on screen while that column fills the viewport; the dock's own flow
   box stays between the article and the footer, so footer links, the edit
   link, and the extension lister are not under a fixed overlay.
   Scope menu, Lunr results, and Ask panel still open UPWARD. */
.adt-search-chat[data-placement='dock'] {
  position: relative;
  z-index: var(--adt-search-top-z);
  align-self: center;
  flex: 0 0 auto;
  width: min(42rem, calc(100% - 2rem));
  max-width: calc(100vw - 2rem);
  margin-top: 0.75rem;
  margin-bottom: max(0.75rem, env(safe-area-inset-bottom));
  margin-inline: auto;
  overflow-anchor: none;
  padding: 0.65rem 0.65rem 0.55rem;
  border: 1px solid var(--adt-search-rim);
  border-radius: 1rem;
  background-color: var(--adt-search-surface);
  isolation: isolate;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--adt-accent, #0d9488) 12%, transparent),
    0 0.75rem 2rem color-mix(in srgb, var(--adt-ink, #141820) 16%, transparent);
  color: var(--adt-ink, #141820);
  transition: var(--adt-search-theme-transition);
}

/* Sticky only when the column ends before the footer (adt-search-dock-column).
   Otherwise the dock stays in normal flow directly above the footer. */
.adt-search-dock-column > .adt-search-chat[data-placement='dock'] {
  position: sticky;
  bottom: 0;
}

/* Dock: scope menu opens upward above the scope row. */
.adt-search-chat[data-placement='dock'] .adt-search-scope-menu {
  top: auto;
  bottom: calc(100% + 0.35rem);
  /* (top:auto above cancels the navbar drop-down anchor) */
  box-shadow: 0 -0.45rem 1.25rem color-mix(in srgb, currentColor 14%, transparent);
}

/* Dock: Lunr results pop above the input wrap instead of below it. */
.adt-search-chat[data-placement='dock'] .search-result-dropdown-menu {
  top: auto !important;
  bottom: calc(100% + 0.35rem);
  box-shadow: 0 -0.45rem 1.25rem color-mix(in srgb, currentColor 14%, transparent);
}

/* Dock: JS portals the scope menu and Lunr results to direct children of the
   dock root, so they anchor above the whole outer box (capability strip
   included), not just above the input row. */
.adt-search-chat[data-placement='dock'] > .adt-search-scope-menu {
  top: auto;
  bottom: calc(100% + 0.5rem);
  inset-inline: 0;
  width: auto;
  min-width: 0;
  max-width: none;
}

.adt-search-chat[data-placement='dock'] > .search-result-dropdown-menu {
  top: auto !important;
  bottom: calc(100% + 0.5rem);
  inset-inline: 0;
  width: auto !important;
  /* Anchored to the viewport bottom: cap height so the first results stay
     on screen; the list scrolls internally. */
  max-height: min(65vh, calc(100vh - 12rem));
  overflow-y: auto;
}

/* Semantic on: two stacked zones, each its own scrollport. The menu does not scroll. */
.adt-search-chat .search-result-dropdown-menu.adt-search-results--split {
  display: flex;
  flex-direction: column;
  height: min(65vh, calc(100vh - 12rem));
  max-height: min(65vh, calc(100vh - 12rem));
  overflow: hidden !important;
}

.adt-search-chat[data-placement='dock'] > .search-result-dropdown-menu.adt-search-results--split {
  overflow: hidden !important;
}

.adt-search-zone {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  background-color: var(--adt-search-surface);
}

.adt-search-zone + .adt-search-zone {
  border-top: 1px solid var(--adt-search-rim);
}

.adt-search-zone__title {
  position: sticky;
  top: 0;
  z-index: 1;
  flex: 0 0 auto;
  margin: 0;
  padding: 0.35rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--adt-search-muted);
  background-color: var(--adt-search-surface);
  border-bottom: 1px solid var(--adt-search-rim);
}

.adt-search-zone__empty {
  margin: 0;
  padding: 0.55rem 0.75rem;
  color: var(--adt-search-muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.adt-search-chat:not([data-semantic-enabled='true']) .adt-search-zone--semantic {
  display: none !important;
}

/* Dock: Ask answers stay in-flow under the query field (same shell as search). */
.adt-search-chat[data-placement='dock'] .adt-search-chat__ask-result:not([hidden]) {
  max-height: min(40vh, 14rem);
  overflow-y: auto;
}

/* Valentus sets `.adt-nav-search` (and :hover / :focus / :focus-within) to
   `background: transparent !important`. The dock root carries that class, so
   the overlay shell was see-through even when the inner card was solid.
   These selectors are more specific and !important, and every fill is a hex
   custom property (no rgba, no color-mix with a translucent theme token). */
.adt-search-chat.adt-nav-search,
.adt-search-chat.adt-tool-search,
.adt-search-chat.adt-nav-search:hover,
.adt-search-chat.adt-nav-search:focus,
.adt-search-chat.adt-nav-search:focus-within,
.adt-search-chat.adt-tool-search:hover,
.adt-search-chat.adt-tool-search:focus,
.adt-search-chat.adt-tool-search:focus-within,
.adt-search-chat[data-placement='dock'],
.adt-search-chat[data-placement='dock']:hover,
.adt-search-chat[data-placement='dock']:focus,
.adt-search-chat[data-placement='dock']:focus-within {
  background: var(--adt-search-surface) !important;
  border-color: var(--adt-search-rim) !important;
}

.adt-search-chat .adt-search-chat__popover,
.adt-search-chat .adt-search-compound,
.adt-search-chat .adt-search-scope-slot,
.adt-search-chat .adt-search-scope-menu,
.adt-search-chat .adt-search-scope-option,
.adt-search-chat .adt-search-chat__query-slot,
.adt-search-chat .adt-search-input-wrap,
.adt-search-chat .adt-search-ask-wrap,
.adt-search-chat .adt-search-chat__ask-input,
.adt-search-chat .adt-search-chat__tabs,
.adt-search-chat .adt-search-chat__tab,
.adt-search-chat .adt-search-capabilities,
.adt-search-chat .adt-search-chat__toggle,
.adt-search-chat .search-result-dropdown-menu,
.adt-search-chat .search-result-dataset,
.adt-search-chat .adt-search-zone,
.adt-search-chat .adt-search-zone__title,
.adt-search-chat .search-result-component-header,
.adt-search-chat .search-result-document-title,
.adt-search-chat .search-result-document-hit,
.adt-search-chat .search-result-document {
  background: var(--adt-search-surface) !important;
}

.adt-search-chat .adt-search-scope-trigger,
.adt-search-chat .adt-search-scope-trigger:hover,
.adt-search-chat .adt-search-scope-trigger:focus,
.adt-search-chat .adt-search-scope-trigger:focus-visible {
  background: transparent !important;
  background-color: transparent !important;
}

.adt-search-chat .adt-search-ph-code {
  background: var(--adt-search-chip) !important;
  background-color: var(--adt-search-chip) !important;
}

.adt-search-compound #search-input,
.adt-search-compound #search-input:hover,
.adt-search-compound #search-input:focus,
.adt-nav-search.adt-search-chat #search-input,
.adt-nav-search.adt-search-chat #search-input:hover,
.adt-nav-search.adt-search-chat #search-input:focus,
.adt-tool-search.adt-search-chat #search-input,
.adt-tool-search.adt-search-chat #search-input:hover,
.adt-tool-search.adt-search-chat #search-input:focus {
  background: var(--adt-search-surface) !important;
}

.adt-search-chat .adt-search-scope-slot:hover,
.adt-search-chat .adt-search-scope-slot:focus-within,
.adt-search-chat .adt-search-scope-slot.is-open,
.adt-search-chat .adt-search-scope-option:hover,
.adt-search-chat .adt-search-scope-option:focus,
.adt-search-chat .search-result-document-hit:hover,
.adt-search-chat .search-result-document-hit:focus-within,
.adt-search-chat .search-result-document-hit > a:hover,
.adt-search-chat .search-result-document-hit > a:focus,
.adt-search-chat .adt-search-chat__tab:hover,
.adt-search-chat .adt-search-chat__tab:focus-visible,
.adt-search-chat .adt-search-chat__tab.is-active,
.adt-search-chat .adt-search-chat__toggle:hover,
.adt-search-chat .adt-search-chat__toggle:focus-visible {
  background: var(--adt-search-surface-hover) !important;
}

.adt-search-chat .adt-search-scope-slot.is-disabled,
.adt-search-chat .adt-search-scope-slot.is-disabled:hover,
.adt-search-chat .adt-search-scope-slot.is-disabled:focus-within,
.adt-search-chat .adt-search-capability,
.adt-search-chat .adt-search-capability.is-off,
html.dark-theme .adt-search-chat kbd.adt-search-chat__hint,
html.dark-theme .adt-search-chat kbd.adt-search-chat__field-hint,
.adt-search-chat kbd.adt-search-chat__hint,
.adt-search-chat kbd.adt-search-chat__field-hint {
  background: var(--adt-search-chip) !important;
  opacity: 1 !important;
}

.adt-search-chat .adt-search-chat__ask-result {
  background: var(--adt-search-ask) !important;
}

.adt-search-chat .adt-search-chat__ask-result.is-error {
  background: var(--adt-search-ask-error) !important;
}

.adt-search-chat .search-result-highlight,
html.dark-theme .adt-search-chat .search-result-document-hit .search-result-highlight {
  background: var(--adt-search-hit) !important;
}
