/* Shared discovery row: the separate catalog control can precede the search. */
.header-discovery { display: flex; align-items: center; gap: 12px; padding: 0 0 16px; }
.header-search { position: relative; flex: 1; min-width: 0; margin: 0; color: var(--site-text, #444); }
.header-search [hidden] { display: none !important; }
.header:has(.header-search__dropdown:not([hidden])) { z-index: 1100; }
.header-search__shade { position: fixed; inset: 0; z-index: 1100; background: rgba(0,0,0,.2); backdrop-filter: blur(2px); }
.header-search:has(.header-search__dropdown:not([hidden])) .header-search__field { position: relative; z-index: 1104; }
.header-search__field { display: flex; align-items: center; height: 44px; border: 1px solid var(--site-border-soft, #ebe7e7); border-radius: 10px; background: var(--site-card, #fff); }
.header-search__field:focus-within { border-color: var(--site-mark, #fd5a3c); }
.header-search input { flex: 1; width: 0; min-width: 0; height: 42px; padding: 0 8px; border: 0; outline: 0; background: transparent; color: var(--site-title, #222); font: inherit; font-size: 16px; }
.header-search input::-webkit-search-cancel-button { display: none; }
.header-search input::placeholder { color: var(--site-text-dim, #666); }
.header-search__submit, .header-search__clear, .header-search__close { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: inherit; cursor: pointer; }
.header-search__clear, .header-search__close { font-size: 26px; }
.header-search__dropdown { position: absolute; z-index: 1104; top: calc(100% + 6px); left: 0; right: 0; max-height: min(60vh, 560px); overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--site-border-soft, #ebe7e7); border-radius: 10px; background: var(--site-card, #fff); box-shadow: 0 8px 24px #0002; }
.header-search__top { display: flex; align-items: center; justify-content: space-between; padding-left: 16px; font-weight: 600; }
.header-search__items, .header-search-results__items { margin: 0; padding: 0; list-style: none; }
.header-search__result { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 12px 16px; border-top: 1px solid var(--site-border-soft, #ebe7e7); color: var(--site-title, #222); text-decoration: none; overflow-wrap: anywhere; }
.header-search__result:hover, .header-search__result:focus-visible { background: var(--site-surface, #f7f5f6); color: var(--site-title, #222); }
.header-search__kind, .header-search__context { color: var(--site-text-dim, #666); font-size: 13px; }
.header-search__name { flex: 1; min-width: 45%; }
.header-search__icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 24px; width: 24px; height: 24px; align-self: center; }
.header-search__icon:empty { width: 18px; height: 18px; flex-basis: 18px; border: 2px solid var(--site-text-dim, #666); border-radius: 50%; }
.header-search__icon img { width: 100%; height: 100%; object-fit: contain; }
.header-search__all { display: block; padding: 14px 16px; border-top: 1px solid var(--site-border-soft, #ebe7e7); color: var(--site-mark, #fd5a3c); font-weight: 600; }
.header-search__footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px; border-top: 1px solid var(--site-border-soft, #ebe7e7); }
.header-search__footer .header-search__all { border: 0; padding-left: 0; }
.header-search__close-text { margin-left: auto; min-height: 40px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--site-surface, #f7f5f6); color: inherit; font: inherit; cursor: pointer; }
.header-search__status:not(:empty) { padding: 12px 16px; }
.header-search-results { padding-top: 24px; padding-bottom: 40px; }
.header-search-results h1 { font-size: 26px; margin-bottom: 12px; }
.header-search-results__query { overflow-wrap: anywhere; margin-bottom: 16px; }
.header-search-results__items { border-radius: 10px; overflow: hidden; background: var(--site-card, #fff); }
.header-search-results__pages { display: flex; gap: 24px; padding-top: 20px; }
@media (max-width: 576px) {
    .header-discovery { gap: 8px; padding-bottom: 12px; }
    .header-search__dropdown { max-height: 55vh; }
    .header-search__result { padding: 10px 12px; }
    .header-search__context { flex-basis: 100%; }
    .header-search-results h1 { font-size: 22px; }
}
