/* Search uses the existing site's colors and card layouts. */
[hidden] { display: none !important; }
.scoped-search-form { display: none; }
.nav-search.active { position: static; }
.nav-search.active .scoped-search-form {
    display: flex; align-items: center; gap: 5px; position: absolute;
    right: 28px; top: calc(100% + 8px); width: 410px; max-width: calc(100vw - 32px);
    padding: 8px; border: 1px solid var(--border-strong); border-radius: 12px;
    background: var(--bg-card); box-shadow: var(--shadow-lg);
}
.nav-right { position: relative; }
.nav-search.active .search-btn { position: static; }
.nav-search.active .scoped-search-form input[type="search"], .nav-search-row input[type="search"] { min-width: 0; flex: 1; width: 0; padding: 4px; border: 0; border-radius: 0; background: transparent; color: var(--text); outline: none; font-family: inherit; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-clear, .search-submit { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 28px; width: 28px; height: 28px; border: 0; border-radius: 7px; color: var(--text-secondary); background: transparent; cursor: pointer; }
.search-submit:hover, .search-clear:hover { color: var(--accent); background: var(--accent-light); }
[data-search-form]:focus-within { border-color: var(--accent); }
.search-submit:focus-visible, .search-clear:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.nav-search .search-history { left: auto; right: 28px; top: calc(100% + 58px); width: 410px; max-width: calc(100vw - 32px); }
.search-history-item .history-query { flex: 1; min-width: 0; text-align: left; border: 0; background: transparent; color: var(--text-secondary); padding: 0; font: inherit; font-size: .82rem; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scoped-search-feedback { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 0 0 20px; padding: 12px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; color: var(--text-secondary); font-size: .88rem; overflow-wrap: anywhere; }
.scoped-search-feedback a, .search-widen { color: var(--accent); }
.search-results-heading { display: flex; align-items: center; gap: 10px; margin: 28px 0 16px; font-size: 1.1rem; }
.search-results-heading span { font-size: .8rem; color: var(--text-muted); font-weight: 400; }
.search-tabs { flex-wrap: wrap; }
.search-tabs a { white-space: nowrap; }
@media (max-width: 768px) {
    .nav-search-row { gap: 3px; padding-left: 9px; padding-right: 5px; }
    .nav-search-row .search-clear, .nav-search-row .search-submit { flex-basis: 26px; width: 26px; }
    .nav-right .nav-search, .nav-right .nav-search.active { display: none; }
    .scoped-search-feedback { padding: 10px 12px; }
}
