.navigation.has-nav-search { --search-width: clamp(190px, 20vw, 320px); --search-space: calc(var(--search-width) + 16px); padding-right: var(--search-space); box-sizing: border-box; }
.navigation.has-nav-search .nav-scroll-right { right: var(--search-space); }
.editor-preview .navigation.has-nav-search { --search-space: 0px; }
.editor-preview .nav-search, .editor-preview .nav-search-toggle { display: none; }
.nav-search-toggle { display: none; }
.nav-search, .nav-search *, .bot-container, .bot-container * { box-sizing: border-box; font-family:Source Sans Pro, Arial, sans-serif; }
.nav-search { position: absolute; right: 8px; top: 3px; width: var(--search-width); height: 34px; display: flex; margin: 0; border: 1px solid #c8d1db; border-radius: 6px; background: #fff; box-shadow: 0 1px 3px #19334b0c; }
.nav-search:focus-within { border-color: #1768ad; box-shadow: 0 0 0 2px #1768ad18; }
#chat-input { width: 100%; min-width: 0; flex: 1; padding: 6px 0 6px 11px; border: 0; border-radius: 6px; background: #fff; color: #000; font-size: 14px; outline: none; }
#chat-input::placeholder { color: #000; opacity: 1; }
#chat-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.nav-search-clear { flex: 0 0 28px; width: 28px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: #000; font-size: 21px; cursor: pointer; }
.nav-search-clear[hidden] { display: none; }
.nav-search-clear:hover { background: #333; color: #fff; }
#chat-send { display: grid; place-items: center; flex: 0 0 36px; width: 36px; border: 0; border-radius: 0 6px 6px 0; background: transparent; color: #000; cursor: pointer; }
#chat-send svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
#chat-send:hover { color: #fff; background: #333; }
.bot-container { position: absolute; top: calc(100% + 6px); right: 8px; width: min(440px, calc(100% - 16px)); max-height: min(440px, 70dvh); display: flex; flex-direction: column; border: 1px solid #c8d5e1; border-radius: 8px; background: #fff; box-shadow: 0 10px 28px #19334b26; z-index: 30; overflow: hidden; visibility: hidden; opacity: 0; transform: translateY(-6px); transform-origin: top right; transition: opacity .15s ease, transform .15s ease, visibility .15s; }
.bot-container.open { visibility: visible; opacity: 1; transform: none; }
.bot-container[hidden] { display: none; }
.navigator-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px; border-bottom: 1px solid #e4ebf2; background: #f5f8fb; flex: 0 0 auto; }
#bot-close { flex: 0 0 32px; margin-left: auto; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #556b7e; font-size: 24px; cursor: pointer; }
#bot-close:hover { background: #e6edf4; }
#search-status { flex: 1 1 auto; margin: 0; padding: 4px; font: 400 13px/1.4 Source Sans Pro, Arial, sans-serif; color: #627487; }
#chat-messages { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.navigation .navigator-results { list-style: none; padding: 0 6px 6px; margin: 0; }
.navigator-results a { display: block; position: relative; min-height: 48px; padding: 10px 28px 10px 10px; border-radius: 5px; color: #234866; font-size: 14px; line-height: 1.4; text-decoration: none; overflow-wrap: anywhere; }
.search-result-title { display: block; font-weight: 600; }
.search-result-context { display: block; margin-top: 3px; color: #627487; font-size: 12px; }
.search-external { position: absolute; right: 10px; top: 12px; color: #627487; font-size: 15px; }
.navigator-results li + li { border-top: 1px solid #edf1f5; }
.navigator-results a:hover { background: #eef5fb; color: #12568f; }
.bot-container :focus-visible, #chat-send:focus-visible, .nav-search-toggle:focus-visible, .nav-search-clear:focus-visible { outline: 2px solid #1768ad; outline-offset: -2px; }
@media (min-width: 1025px) {
  .nav-search { background: #fff; box-shadow: none; }
  .nav-search:focus-within { border-color: #666; box-shadow: none; }
  #chat-input { color: #000; text-shadow: none; }
  #chat-input::placeholder { color: #000; opacity: 1; }
  #chat-send, .nav-search-clear { color: #000; }
  #chat-send:hover, .nav-search-clear:hover { color: #fff; background: #333; }
  #chat-send:focus-visible, .nav-search-clear:focus-visible { outline-color: #2475d8; }
}
@media (max-width: 1024px) {
  .navigation.has-nav-search { --search-width: 36px; }
  .nav-search-toggle { position: absolute; right: 8px; top: 3px; display: grid; place-items: center; width: 36px; height: 34px; padding: 0; border: 1px solid transparent; border-radius: 6px; background: #fff; color: #000; cursor: pointer; }
  .nav-search-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .nav-search-toggle:hover, .nav-search-toggle[aria-expanded=true] { color: #fff; background: #333; }
  .nav-search-toggle:focus-visible { outline-color: #2475d8; }
  .nav-search { top: calc(100% + 6px); width: min(440px, calc(100% - 16px)); height: 40px; z-index: 31; border-radius: 8px 8px 0 0; visibility: hidden; opacity: 0; transform: translateY(-6px); transition: opacity .15s ease, transform .15s ease; }
  .search-open .nav-search { visibility: visible; opacity: 1; transform: none; }
  .search-open:not(.search-results-open) .nav-search { border-radius: 8px; }
  #chat-input { font-size: 16px; }
  .bot-container { top: calc(100% + 46px); border-radius: 0 0 8px 8px; }
}
@media (max-width: 620px) {
  #chat-input { font-size: 16px; padding-left: 8px; }
  #chat-send { flex-basis: 32px; width: 32px; }
  .bot-container { left: 8px; right: 8px; width: auto; }
}
@media (prefers-reduced-motion: reduce) { .bot-container, .nav-search { transition: none; } }

.nav-search-voice { display:grid; place-items:center; flex:0 0 32px; width:32px; padding:0; border:0; border-radius:5px; background:transparent; color:#000; cursor:pointer; }
.nav-search-voice[hidden] { display:none; }
.nav-search-voice svg { width:19px; height:19px; }
.nav-search-voice:hover { background:#eee; }
.nav-search-voice.listening { background:#ffe5e5; color:#b71c1c; }
.nav-search-voice.error { color:#b71c1c; }
.nav-search-voice:focus-visible { outline:2px solid #1768ad; outline-offset:-2px; }

.nav-voice-hint { position:absolute; top:calc(100% + 8px); right:0; z-index:35; width: min(320px, 85vw); margin:0; padding:12px; border:1px solid #c8d5e1; border-radius:8px; background:#fff; color:#234866; box-shadow:0 4px 16px #19334b26; font-size:14px; line-height:1.4; }
.nav-voice-hint[hidden], .navigation:not(.search-open) .nav-voice-hint { display:none; }

/* Keep interaction and recording feedback visible above the shared dark controls. */
.home-layout[data-project-theme=dark] .nav-search:focus-within { border-color:#9dccf4; box-shadow:0 0 0 2px #9dccf426; }
.home-layout[data-project-theme=dark] :is(#chat-send, .nav-search-toggle, .nav-search-clear, .nav-search-voice):is(:hover, :focus-visible) { background:#374e5e; color:#fff; }
.home-layout[data-project-theme=dark] :is(#chat-send, .nav-search-toggle, .nav-search-clear, .nav-search-voice):active { background:#48667c; color:#fff; }
.home-layout[data-project-theme=dark] :is(#chat-send, .nav-search-toggle)[aria-expanded=true] { background:#374e5e; color:#fff; }
.home-layout[data-project-theme=dark] :is(#chat-send, .nav-search-toggle, .nav-search-clear, .nav-search-voice):focus-visible { outline:2px solid #9dccf4; outline-offset:-2px; }
.home-layout[data-project-theme=dark] #nav-search-form .nav-search-voice:is(.listening, [aria-pressed=true]) { background:#722f40; color:#fff0f2; box-shadow:inset 0 0 0 1px #f5a2b4; }
.home-layout[data-project-theme=dark] #nav-search-form .nav-search-voice.error { background:#542c37; color:#ffbdc8; }
.home-layout[data-project-theme=dark] :is(#search-status, #bot-close) { color:#d4e2ec; }
.home-layout[data-project-theme=dark] #bot-close:is(:hover, :focus-visible) { background:#374e5e; color:#fff; }
.home-layout[data-project-theme=dark] #bot-close:focus-visible { outline:2px solid #9dccf4; outline-offset:-2px; }
.home-layout[data-project-theme=dark] .nav-voice-hint { background:#263643; color:#e3eaf0; border-color:#71889d; }
