/* SEARCH-LIVE-UI-1: dedicated theme surface, no global input overrides. */
/* One surface per theme; never inherit the Header background unchanged. */
.saniyar-live-search {
  position: relative; min-width: 0; isolation: isolate;
  --live-search-popover-bg: #ffffff;
  --live-search-popover-card: #f5f7fc;
  --live-search-popover-border: #dce3ee;
  --live-search-popover-shadow: 0 26px 64px rgba(16, 35, 64, .20), 0 8px 20px rgba(16, 35, 64, .08);
}
html[data-bs-theme="dark"] .saniyar-live-search {
  --live-search-popover-bg: #252f3d;
  --live-search-popover-card: #2d3949;
  --live-search-popover-border: rgba(189, 211, 239, .22);
  --live-search-popover-shadow: 0 30px 78px rgba(0, 0, 0, .58), 0 8px 20px rgba(0, 0, 0, .29);
}
.saniyar-live-search > form { margin: 0; }
.saniyar-live-search.is-open { z-index: 10; }
/* Raise Header only while suggestions are open: preserve Bootstrap modal stack. */
#saniyar-page-top:has(.saniyar-live-search.is-open) {
  position: relative; z-index: 1035; overflow: visible;
}
.saniyar-live-search.is-open .saniyar-live-search__field .search-input {
  border-end-end-radius: .35rem; border-end-start-radius: .35rem;
  border-bottom-color: var(--live-search-popover-border);
}
.saniyar-live-search__field .search-input { padding-inline-start: 1.15rem; padding-inline-end: 3.8rem; width: 100%; }
.saniyar-live-search__field .search-btn { left: 8px; right: auto; }
.saniyar-live-search__panel[hidden] { display: none !important; }
.saniyar-live-search__panel {
  position: absolute; z-index: 1100; top: 100%; right: 0; left: auto;
  transform: none; width: min(1020px, calc(100vw - 32px));
  border: 1px solid var(--live-search-popover-border);
  border-radius: 1.25rem 0 1.35rem 1.35rem;
  background: var(--live-search-popover-bg); color: var(--text-primary, #182230);
  box-shadow: var(--live-search-popover-shadow);
  overflow: hidden; text-align: right;
}
.saniyar-live-search__panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; gap: .6rem;
  border-bottom: 1px solid var(--live-search-popover-border);
  background: linear-gradient(125deg, color-mix(in srgb, var(--main-color-one, #2563eb) 7%, transparent), transparent 85%), var(--live-search-popover-card);
}
.saniyar-live-search__eyebrow { display: block; color: var(--main-color-one, #2563eb); font-size: .7rem; font-weight: 600; margin-bottom: .15rem; }
.saniyar-live-search__panel-title { display: block; font-size: 1.05rem; }
.saniyar-live-search__dismiss {
  appearance: none; border: 0; border-radius: 50%; width: 2rem; height: 2rem;
  background: var(--surface-secondary, #f3f4f6); color: inherit;
  display: inline-flex; align-items: center; justify-content: center;
}
.saniyar-live-search__status {
  margin: 0; padding: .55rem 1.25rem; color: var(--text-secondary, #64748b);
  font-size: .78rem; min-height: 1.9rem;
}
.saniyar-live-search__groups {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0 .65rem .85rem; gap: .45rem; max-height: min(65vh, 570px);
  overflow: auto; overscroll-behavior: contain;
}
.saniyar-live-search__group {
  min-width: 0; display: flex; flex-direction: column; padding: .35rem;
  background: var(--live-search-popover-card); border-radius: .95rem;
}
.saniyar-live-search__group + .saniyar-live-search__group {
  border-inline-start: 1px solid var(--live-search-popover-border);
}
.saniyar-live-search__group-title {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  font-size: .85rem; font-weight: 700; padding: .5rem .65rem .7rem;
}
.saniyar-live-search__group-name { display: inline-flex; align-items: center; gap: .5rem; }
.saniyar-live-search__group-name i { color: var(--main-color-one, #2563eb); font-size: 1rem; }
.saniyar-live-search__count {
  display: inline-flex; justify-content: center; align-items: center;
  border-radius: 99px; min-width: 1.5rem; height: 1.5rem;
  background: var(--surface-secondary, #f3f4f6); color: var(--text-secondary, #667085);
  font-size: .75rem; font-weight: 500;
}
.saniyar-live-search__list { flex: 1; }
.saniyar-live-search__result {
  display: flex; align-items: center; gap: .65rem; padding: .55rem .5rem;
  color: inherit; text-decoration: none; border-radius: .9rem; min-height: 3.65rem;
  transition: background-color .16s ease, transform .16s ease;
}
.saniyar-live-search__result:hover, .saniyar-live-search__result:focus-visible {
  color: inherit; background: color-mix(in srgb, var(--main-color-one, #2563eb) 9%, transparent);
  transform: translateY(-1px); outline-offset: 2px;
}
.saniyar-live-search__thumbnail {
  display: flex; align-items: center; justify-content: center; flex: 0 0 2.8rem;
  width: 2.8rem; height: 2.8rem; border-radius: .75rem;
  background: var(--surface-secondary, #f3f4f6); overflow: hidden;
  color: var(--main-color-one, #2563eb);
}
.saniyar-live-search__thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.saniyar-live-search__result-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.saniyar-live-search__result-title { display: block; font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saniyar-live-search__result-subtitle { display: block; font-size: .7rem; color: var(--text-secondary, #667085); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saniyar-live-search__result > i { color: var(--text-secondary, #94a3b8); font-size: .72rem; }
.saniyar-live-search__empty { font-size: .78rem; padding: 1rem .6rem; color: var(--text-secondary, #667085); }
.saniyar-live-search__more {
  display: flex; justify-content: space-between; align-items: center; gap: .3rem;
  padding: .65rem; margin-top: .45rem; text-decoration: none;
  color: var(--main-color-one, #2563eb); font-size: .78rem; font-weight: 650;
  border-radius: .7rem; background: color-mix(in srgb, var(--main-color-one, #2563eb) 6%, transparent);
}
.saniyar-live-search__more:hover { color: var(--main-color-one, #2563eb); text-decoration: underline; }
.saniyar-live-search__all {
  display: flex; align-items: center; justify-content: center; gap: .65rem;
  background: var(--main-color-one, #2563eb); color: #fff; padding: .9rem 1rem;
  font-weight: 650; font-size: .85rem; text-decoration: none;
}
.saniyar-live-search__all:hover, .saniyar-live-search__all:focus-visible { color: #fff; filter: brightness(.92); }
.saniyar-live-search__all i:last-child { margin-inline-start: auto; }
.saniyar-live-search__mobile-launch {
  border: 1px solid var(--border-soft, #e5e7eb); border-radius: 999px;
  background: var(--surface-secondary, #f3f4f6); color: var(--text-secondary, #667085);
  padding: .8rem 1rem; font-size: .82rem;
  box-shadow: 0 2px 6px rgba(15,23,42,.035);
}
.saniyar-live-search__mobile-launch i { color: var(--main-color-one, #2563eb); }
.saniyar-live-search__mobile-launch:hover { color: var(--text-primary, #182230); }
.saniyar-live-search__page-form { max-width: 920px; margin-inline: auto; }
.saniyar-live-search__modal .modal-dialog { max-width: 780px; margin-top: 1.25rem; }
.saniyar-live-search__modal .modal-content {
  background: var(--surface-primary, #fff); color: var(--text-primary, #182230);
  border-radius: 1.35rem; border: 1px solid var(--border-soft, #e5e7eb);
}
.saniyar-live-search__modal .modal-header { border-bottom-color: var(--border-soft, #e5e7eb); }
.saniyar-live-search__modal .saniyar-live-search__panel {
  width: 100%; left: auto; right: auto; transform: none;
  position: relative; top: auto; margin-top: 0;
  border-top-right-radius: 0; border-top-left-radius: 0;
  box-shadow: none;
}
.saniyar-live-search__modal .saniyar-live-search__groups { max-height: min(55vh, 420px); }
@media (max-width: 991.98px) {
  .saniyar-live-search__groups { grid-template-columns: 1fr; }
  .saniyar-live-search__group + .saniyar-live-search__group {
    border-inline-start: 0; border-top: 1px solid var(--live-search-popover-border);
  }
  .saniyar-live-search__modal .modal-dialog { margin: .7rem; }
  .saniyar-live-search__modal .modal-body { padding: .8rem; }
  .saniyar-live-search__panel { max-height: calc(100dvh - 10rem); overflow-y: auto; }
  .saniyar-live-search__groups { max-height: none; }
  .saniyar-live-search__result { min-height: 3.3rem; }
}
@media (prefers-reduced-motion: reduce) {
  .saniyar-live-search__result { transition: none; transform: none !important; }
}

/* The advanced page form is centered; keep its panel within its own footprint. */
.saniyar-live-search__page-form .saniyar-live-search__panel {
  width: 100%; max-width: 100%; border-top-left-radius: 0;
}
