/* AJAX header search — isolated under .hs-* so it cannot affect other UI. */

.hs-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  direction: ltr;
}

.hs-overlay[hidden] { display: none !important; }

.hs-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .38);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.hs-panel {
  position: absolute;
  top: 68px;
  left: 50%;
  width: min(640px, calc(100vw - 24px));
  max-height: calc(100vh - 92px);
  transform: translateX(-50%);
  overflow: hidden auto;
  border: 1px solid rgba(15, 23, 42, .07);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 22px 60px -18px rgba(15, 23, 42, .35), 0 4px 12px -6px rgba(15, 23, 42, .12);
  animation: hs-in .16s ease-out;
}

@keyframes hs-in {
  from { opacity: 0; transform: translate(-50%, -6px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.dark .hs-panel {
  border-color: rgba(255, 255, 255, .1);
  background: #0b1120;
  box-shadow: 0 22px 60px -18px rgba(0, 0, 0, .6);
}

.hs-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hs-form {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  border-bottom: 1px solid rgba(15, 23, 42, .07);
  background: #fff;
}

.dark .hs-form {
  border-bottom-color: rgba(255, 255, 255, .08);
  background: #0b1120;
}

.hs-form-ico {
  width: 20px;
  height: 20px;
  flex: none;
  color: #94a3b8;
}

.hs-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: #0f172a;
}

.hs-form input::placeholder { color: #94a3b8; }
.dark .hs-form input { color: #e2e8f0; }
.dark .hs-form input::placeholder { color: #64748b; }

.hs-form input::-webkit-search-cancel-button { display: none; }

.hs-spinner {
  width: 16px;
  height: 16px;
  flex: none;
  border: 2px solid #dbe3f0;
  border-top-color: #00408a;
  border-radius: 999px;
  animation: hs-spin .7s linear infinite;
}

.dark .hs-spinner { border-color: rgba(255,255,255,.15); border-top-color: #60a5fa; }

@keyframes hs-spin { to { transform: rotate(360deg); } }

.hs-close {
  flex: none;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.hs-close:hover { background: #f1f5f9; color: #0f172a; }
.dark .hs-close:hover { background: rgba(255,255,255,.08); color: #fff; }

.hs-status {
  padding: 14px 16px;
  font-size: 13px;
  color: #64748b;
}

.hs-results { padding: 6px; }

.hs-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  transition: background .15s;
}

.hs-result:hover,
.hs-result.is-active { background: #f1f5f9; }
.dark .hs-result:hover,
.dark .hs-result.is-active { background: rgba(255,255,255,.06); }

.hs-thumb {
  width: 58px;
  height: 44px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
  background: #eef2ff;
  color: #00408a;
  font-size: 15px;
  font-weight: 700;
}

.hs-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dark .hs-thumb { background: rgba(255,255,255,.08); color: #93c5fd; }

.hs-copy { min-width: 0; flex: 1; }

.hs-title {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hs-meta {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dark .hs-title { color: #e2e8f0; }
.dark .hs-meta { color: #94a3b8; }

.hs-empty {
  padding: 30px 18px;
  text-align: center;
  font-size: 14px;
  color: #64748b;
}

.hs-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid rgba(15, 23, 42, .07);
  color: #00408a;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.hs-all:hover { background: #f8fafc; }
.dark .hs-all { border-top-color: rgba(255,255,255,.08); color: #93c5fd; }
.dark .hs-all:hover { background: rgba(255,255,255,.04); }

@media (max-width: 640px) {
  .hs-panel {
    top: 64px;
    width: calc(100vw - 16px);
    max-height: calc(100vh - 80px);
    border-radius: 14px;
  }
}
