.site-header-tools,.header-tools{display:flex;flex-wrap:wrap;gap:.4rem;align-items:center;justify-content:flex-end}
.search-wrap{position:relative;flex:1 1 180px;min-width:140px;max-width:420px}
.search-wrap input[type=search]{
  width:100%;box-sizing:border-box;border:2px solid var(--line,#c9d0d4);background:var(--surface,var(--card,#fff));
  color:var(--fg,#102028);border-radius:10px;padding:.45rem .65rem;font:600 .9rem/1.2 var(--font-sans,system-ui,sans-serif)
}
.search-wrap input[type=search]::placeholder{color:var(--muted,#667680);font-weight:500;font-size:.82rem}
.search-results{
  position:absolute;left:0;right:0;top:calc(100% + 4px);z-index:60;
  background:var(--surface,var(--card,#fff));color:var(--fg,#102028);
  border:1px solid var(--line,#c9d0d4);border-radius:12px;box-shadow:0 8px 24px rgba(0,0,0,.18);
  max-height:min(70vh,420px);overflow:auto;padding:.35rem
}
.search-results[hidden]{display:none!important}
.search-results a{
  display:block;padding:.55rem .65rem;border-radius:8px;color:inherit;text-decoration:none;font:600 .92rem/1.25 var(--font-sans,system-ui,sans-serif)
}
.search-results a:hover,.search-results a:focus{background:rgba(0,115,154,.12);outline:2px solid var(--cyan,#00739A)}
.search-results .sr-meta{display:block;font:500 .78rem/1.3 var(--font-sans,system-ui,sans-serif);color:var(--muted,#667680);margin-top:.15rem}
.search-results .sr-empty,.search-results .sr-status{padding:.65rem;color:var(--muted,#667680);font:500 .88rem/1.3 var(--font-sans,system-ui,sans-serif)}
:root[data-theme=dark] .search-wrap input[type=search],
html[data-theme=dark] .search-wrap input[type=search]{background:#1a2228;border-color:#3a4650;color:#e8eef2}
:root[data-theme=dark] .search-results,
html[data-theme=dark] .search-results{background:#1a2228;border-color:#3a4650;color:#e8eef2;box-shadow:0 8px 24px rgba(0,0,0,.45)}
@media (max-width:420px){
  /* v4-14: keep search on the controls row; shrink instead of order:-1 wrap */
  .search-wrap{flex:1 1 auto;min-width:0;max-width:none;order:0}
  .search-results{max-height:60vh}
}
.visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
