.hsb-community-search-access { display:none; position:fixed; right:calc(16px + env(safe-area-inset-right, 0px)); top:calc(var(--hsb-search-header-bottom, 60px) + 12px); z-index:1033; align-items:center; justify-content:center; width:44px; height:44px; margin:0; padding:0; border:1px solid var(--hsb-gold-line); border-radius:50%; background:#151619; color:var(--hsb-gold); font-size:18px; box-shadow:0 4px 14px rgba(0,0,0,.35); }
body:has(#nav-publications.show.active #nav-searchPublications.show.active) .hsb-community-search-access { display:inline-flex; }
.hsb-community-search-access:hover { background:#242225; }
.hsb-community-search-access i { color:var(--hsb-gold); }
#hsbCommunitySearch { padding:0 4px 24px; color:var(--hsb-text); }
.hsb-search-header { position:sticky; top:60px; z-index:1020; background:#111115; padding:8px 0 0; }
.hsb-search-form { display:flex; align-items:center; gap:6px; margin:0; }
.hsb-search-form button { flex-shrink:0; width:44px; min-height:44px; border:0; background:transparent; color:var(--hsb-gold); border-radius:10px; }
.hsb-search-field { display:flex; align-items:center; flex:1; min-width:0; background:#202027; border:1px solid var(--hsb-border-2); border-radius:14px; padding-left:12px; }
.hsb-search-field>i { color:var(--hsb-text-dim); }
.hsb-search-field input { width:100%; min-width:0; height:44px; padding:8px 10px; background:transparent; color:#fff; border:0; outline:none; font-size:16px; }
.hsb-search-field:focus-within { border-color:var(--hsb-gold-line); }
.hsb-search-field input::-webkit-search-cancel-button { display:none; }
.hsb-search-tabs { display:flex; overflow-x:auto; scrollbar-width:none; white-space:nowrap; gap:4px; }
.hsb-search-tabs::-webkit-scrollbar { display:none; }
.hsb-search-tabs button { flex-shrink:0; position:relative; background:transparent; border:0; padding:14px 12px; min-height:48px; color:#b8b7c0; font-size:14px; }
.hsb-search-tabs button[aria-selected="true"] { color:var(--hsb-gold); }
.hsb-search-tabs button[aria-selected="true"]::after { content:''; position:absolute; bottom:0; height:2px; left:12px; right:12px; border-radius:2px; background:var(--hsb-gold); }
#hsbCommunitySearch button:focus-visible,.hsb-community-search-access:focus-visible { outline:2px solid var(--hsb-gold); outline-offset:2px; }
.hsb-search-empty,.hsb-search-status { margin:16px 4px; font-size:14px; color:#b8b7c0; }
.hsb-search-empty p { margin:0 0 8px; }
.hsb-search-empty small { color:#93919e; }
.hsb-search-recent-heading,.hsb-search-recent { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.hsb-search-recent-heading strong { color:#eee; }
.hsb-search-empty button { background:transparent; border:0; color:#ddd; min-height:44px; padding:8px; text-align:left; }
.hsb-search-recent-heading button { color:var(--hsb-gold); font-size:13px; }
.hsb-search-recent>button:first-child { flex:1; overflow-wrap:anywhere; }
.hsb-search-recent>button:last-child { width:44px; flex-shrink:0; text-align:center; }
#hsbCommunitySearchResults { display:grid; gap:8px; }
#hsbCommunitySearchResults .hsb-thread-post { margin:0!important; padding:12px!important; border-radius:14px; min-width:0; }
#hsbCommunitySearchResults .hsb-thread-body { min-width:0; }
#hsbCommunitySearchResults .hsb-thread-body strong,#hsbCommunitySearchResults .hsb-community-person-details { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
#hsbCommunitySearchResults .hsb-community-person-details { font-size:12px; }
#hsbCommunitySearchResults .hsb-community-place-image { width:56px; height:56px; flex:0 0 56px; }
#hsbCommunitySearchResults .hsb-community-place-image img { object-fit:contain; }
.hsb-search-more { display:block; margin:16px auto; min-height:44px; background:#202027; border:1px solid var(--hsb-gold-line); border-radius:12px; color:var(--hsb-gold); padding:8px 16px; }
#hsbCommunitySearch [hidden] { display:none!important; }
@media(min-width:768px) { #hsbCommunitySearch { max-width:640px; margin:auto; } .hsb-community-search-access { left:var(--hsb-search-access-left); right:auto; } }

/* Authenticated search owns the viewport below the main header, independently
   of the feed wrappers' spacing and the bottom navigation. */
#nav-communitySearch {
  position: fixed;
  inset: var(--hsb-search-header-bottom, 60px) 0 0;
  z-index: 1038;
  margin: 0 !important;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #111115;
}
#nav-communitySearch #hsbCommunitySearch { min-height: 100%; padding-bottom: max(24px, env(safe-area-inset-bottom, 0px)); }
#nav-communitySearch .hsb-search-header { top: 0; }
body:has(#nav-publications.active #nav-communitySearch.active) { overflow: hidden; }
body:has(#nav-publications.active #nav-communitySearch.active) .hsb-panel-bottom-nav { visibility: hidden; pointer-events: none; }

/* The search surface expands from the floating trigger without affecting layout. */
.hsb-search-switching > .tab-pane { transition: none !important; }
.hsb-community-search-access.hsb-search-origin-visible { display: inline-flex; pointer-events: none; }
#hsbCommunitySearch.hsb-search-morphing { position: relative; z-index: 1020; background: #111115; will-change: opacity; }
.hsb-search-motion-surface { position: fixed; z-index: 1019; pointer-events: none; background: #111115; box-shadow: 0 8px 28px rgba(0,0,0,.2); transform-origin: center; will-change: transform, opacity; }
@media (prefers-reduced-motion: reduce) {
  #hsbCommunitySearch.hsb-search-morphing { will-change: auto; }
}
