.pi037-nav-search {
  position: sticky;
  right: 0;
  margin-left: auto;
  padding-left: 0;
  flex: 0 0 380px;
  min-width: 380px;
  z-index: 24;
  background: linear-gradient(90deg, rgba(3,9,17,0), var(--bg) 20%);
}

.pi037-search-box {
  width: 100%;
  height: 38px;
  padding: 7px 10px;
  background: rgba(0,0,0,.2);
}

.pi037-search-box input {
  width: 100%;
  min-width: 0;
}

.pi037-function-config-button {
  flex: 0 0 auto;
  min-width: 168px;
  height: 44px;
  min-height: 44px;
  padding: 0 15px;
  white-space: nowrap;
}

.pi037-search-results {
  position: fixed;
  z-index: 1200;
  display: grid;
  gap: 0;
  padding: 6px;
  background: linear-gradient(180deg, rgba(10,27,42,.995), rgba(5,15,24,.995));
  border: 1px solid var(--line, rgba(255,255,255,0.12));
  border-radius: 12px;
  box-shadow: 0 20px 55px rgba(0,0,0,.48);
  max-height: min(420px, 60vh);
  overflow: auto;
}

.pi037-search-results[hidden] {
  display: none;
}

.pi037-search-result {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.25rem;
  align-items: center;
  text-align: left;
  border: 0;
  border-bottom: 1px solid rgba(52,94,120,.22);
  background: transparent;
  color: inherit;
  border-radius: 8px;
  padding: 0.7rem 0.75rem;
  cursor: pointer;
}

.pi037-search-result:last-child {
  border-bottom: 0;
}

.pi037-search-result:hover,
.pi037-search-result:focus-visible {
  background: rgba(0,162,255,.08);
}

.pi037-search-result-id {
  font-weight: 800;
  color: var(--brand2);
  letter-spacing: 0.02em;
}

.pi037-search-result-body {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.pi037-search-result-body strong,
.pi037-search-result-body small {
  white-space: normal;
  overflow-wrap: anywhere;
}

.pi037-search-result-body small,
.pi037-search-empty {
  color: var(--muted);
}

.pi037-search-empty {
  padding: 0.8rem;
}

.pi037-guide-panel {
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.pi037-guide-panel h2 {
  margin: 0.15rem 0 0.35rem;
}

.pi037-guide-panel p {
  margin: 0;
}

.pi037-guide-panel > div {
  flex: 1 1 auto;
}

.pi037-guide-link {
  flex: 0 0 auto;
  text-decoration: none;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .pi037-nav-search {
    flex-basis: 225px;
    min-width: 200px;
  }
}

@media (max-width: 760px) {
  .pi037-nav-search {
    flex: 0 0 42px;
    min-width: 42px;
    width: 42px;
    padding-left: 0;
    transition: flex-basis .16s ease, width .16s ease;
  }

  .pi037-nav-search:focus-within {
    flex-basis: 220px;
    width: 220px;
  }

  .pi037-search-box {
    overflow: hidden;
  }

  .pi037-search-box input {
    width: 0;
    opacity: 0;
    transition: width .16s ease, opacity .16s ease;
  }

  .pi037-nav-search:focus-within .pi037-search-box input {
    width: 100%;
    opacity: 1;
  }

  .pi037-function-config-button {
    min-width: 0;
  }

  .pi037-guide-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .pi037-guide-link {
    text-align: center;
    white-space: normal;
  }

  .pi037-search-result {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}
