/* ===== Site search (button in the top nav + dropdown panel). Added by search.js. ===== */
.nav.has-search .nav-links { margin-left: auto; }
.fd-search { position: static; flex: none; margin-left: 10px; }
.fd-search-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; padding: 0; border-radius: 8px;
    background: transparent; color: var(--text, #e8e8ed);
    border: 1px solid var(--border, #2a2a32); cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}
.fd-search-btn:hover, .fd-search-btn:focus-visible, .fd-search.is-open .fd-search-btn { color: var(--accent, #00a8ff); border-color: var(--accent, #00a8ff); }
.fd-search-btn:focus-visible { outline: 2px solid var(--accent, #00a8ff); outline-offset: 2px; }
.fd-search-panel {
    position: absolute; top: 100%; right: 16px; z-index: 1001;
    width: min(440px, calc(100vw - 24px)); box-sizing: border-box;
    margin-top: 1px; padding: 12px;
    background: rgba(14, 14, 17, 0.98); border: 1px solid var(--border, #2a2a32); border-top: 0;
    border-radius: 0 0 12px 12px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; text-align: left;
}
.fd-search-panel[hidden] { display: none; }
.fd-search-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fd-search-input {
    display: block; width: 100%; box-sizing: border-box; height: 42px; padding: 0 12px;
    font: 500 1rem/1.2 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text, #e8e8ed); background: var(--bg-card, #141418);
    border: 1px solid #3a3a46; border-radius: 8px; -webkit-appearance: none; appearance: none;
}
.fd-search-input::placeholder { color: var(--text-muted, #a0a0b0); }
.fd-search-input:focus { outline: none; border-color: var(--accent, #00a8ff); box-shadow: 0 0 0 3px rgba(0, 168, 255, 0.18); }
.fd-search-status { margin: 8px 2px 0; font-size: 0.8rem; color: var(--text-muted, #a0a0b0); }
.fd-search-status:empty { display: none; }
.fd-search-status.is-empty { font-size: 0.9rem; }
.fd-search-results { list-style: none; margin: 6px 0 0; padding: 0; max-height: min(60vh, 460px); overflow-y: auto; overscroll-behavior: contain; }
.fd-search-results:empty { display: none; }
.fd-search-item { margin: 0; border-radius: 8px; }
.fd-search-item.is-active { background: rgba(0, 168, 255, 0.1); }
.fd-search-link { display: block; padding: 9px 10px; color: var(--text, #e8e8ed) !important; text-decoration: none !important; border-radius: 8px; }
.fd-search-item.is-active .fd-search-link { box-shadow: inset 2px 0 0 var(--accent, #00a8ff); }
.fd-search-title { display: block; font-weight: 600; font-size: 0.97rem; line-height: 1.3; overflow-wrap: anywhere; }
.fd-search-sub { display: block; font-size: 0.8rem; color: var(--accent, #00a8ff); margin-top: 1px; line-height: 1.3; overflow-wrap: anywhere; }
.fd-search-snip { display: block; font-size: 0.84rem; line-height: 1.45; color: var(--text-muted, #a0a0b0); margin-top: 3px; overflow-wrap: anywhere; }
.fd-search-mark { background: rgba(0, 168, 255, 0.24); color: inherit; border-radius: 2px; padding: 0 1px; }
@media (max-width: 900px) {
    .nav-js .nav.has-search .fd-search { order: 1; margin-left: auto; margin-right: 8px; }
    .nav-js .nav.has-search .nav-toggle { order: 2; }
    .fd-search-panel { left: 12px; right: 12px; width: auto; }
}
/* Search item inside the mobile menu: narrow phones only (the header button is hidden there) */
.fd-search-menu-item { display: none; }
.fd-search-menu-btn {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 4px;
    background: transparent; border: 0; color: var(--text, #e8e8ed); cursor: pointer; text-align: left;
    font: 500 1.05rem/1.6 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
.fd-search-menu-btn:hover, .fd-search-menu-btn:focus-visible { color: var(--accent, #00a8ff); }
.fd-search-menu-btn:focus-visible { outline: 2px solid var(--accent, #00a8ff); outline-offset: 2px; }
@media (max-width: 900px) {
    .nav-js .nav.has-search .fd-search { margin-right: 0; }
    .nav-js .nav.has-search .fd-search-btn { width: 40px; height: 44px; }
}
@media (max-width: 440px) {
    .nav-js .nav.has-search .fd-search { margin: 0; display: contents; } /* no flex gap for the hidden button */
    .nav-js .nav.has-search .fd-search-btn { display: none; }
    .nav-js .nav-links .fd-search-menu-item { display: block; }
}
@media (prefers-reduced-motion: reduce) { .fd-search-btn { transition: none; } }
@media print { .fd-search { display: none !important; } }
