.echo-site-search {
  position: relative;
  z-index: 80;
  flex: 0 0 auto;
}

header a[href="/contact"],
header a[href="/contact/"] {
  flex-shrink: 0;
  white-space: nowrap;
}

.echo-search-form {
  position: relative;
  display: flex;
  align-items: center;
  width: 210px;
  height: 40px;
  border: 1px solid rgba(0, 78, 146, 0.2);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 39, 71, 0.06);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.echo-search-form:focus-within {
  border-color: rgba(0, 78, 146, 0.5);
  box-shadow: 0 10px 26px rgba(0, 78, 146, 0.12);
}

.echo-search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.echo-search-form input {
  min-width: 0;
  flex: 1;
  height: 100%;
  border: 0;
  background: transparent;
  padding: 0 8px 0 16px;
  color: #142033;
  font-size: 14px;
  line-height: 40px;
  outline: none;
}

.echo-search-form input::placeholder {
  color: #6f7f94;
}

.echo-search-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-right: 2px;
  border: 0;
  border-radius: 999px;
  background: #f2f7fc;
  color: #004e92;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.echo-search-form button:hover,
.echo-search-form button:focus-visible {
  background: #004e92;
  color: #ffffff;
  outline: none;
}

.echo-search-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(520px, calc(100vw - 32px));
  max-height: min(560px, calc(100vh - 92px));
  overflow: hidden;
  border: 1px solid #d8e3f0;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 26px 60px rgba(15, 39, 71, 0.2);
}

.echo-search-panel[hidden] {
  display: none;
}

.echo-search-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e7eef6;
  padding: 12px 14px;
  color: #5b6b80;
  font-size: 13px;
}

.echo-search-panel-head strong {
  color: #004e92;
  font-weight: 700;
}

.echo-search-results {
  max-height: min(500px, calc(100vh - 150px));
  overflow-y: auto;
  padding: 8px;
}

.echo-search-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  border-radius: 12px;
  padding: 10px;
  text-decoration: none;
  color: #142033;
}

.echo-search-result:hover,
.echo-search-result.is-active {
  background: #f2f7fc;
}

.echo-search-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #e7f3e3;
  color: #1f6f2a;
  font-size: 12px;
  font-weight: 700;
}

.echo-search-result[href*="/media/"] .echo-search-badge {
  background: #e7eef9;
  color: #004e92;
}

.echo-search-result-body {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.echo-search-result-body strong {
  overflow: hidden;
  color: #142033;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.echo-search-result-body small {
  overflow: hidden;
  color: #004e92;
  font-size: 12px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.echo-search-result-body em {
  display: -webkit-box;
  overflow: hidden;
  color: #637185;
  font-size: 12px;
  font-style: normal;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.echo-search-status {
  padding: 18px;
  color: #5b6b80;
  font-size: 14px;
}

@media (max-width: 1130px) {
  .echo-search-form {
    width: 170px;
  }

  .echo-search-form input {
    font-size: 13px;
  }
}

@media (max-width: 767px) {
  .echo-site-search {
    order: -1;
  }

  .echo-search-form {
    width: 42px;
    overflow: hidden;
    justify-content: center;
  }

  .echo-site-search:focus-within .echo-search-form {
    position: fixed;
    top: 12px;
    right: 72px;
    left: 12px;
    z-index: 140;
    width: auto;
  }

  .echo-search-form input {
    width: 0;
    flex: 0 0 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
  }

  .echo-site-search:focus-within .echo-search-form input {
    flex: 1 1 auto;
    width: auto;
    padding-left: 14px;
    opacity: 1;
    pointer-events: auto;
  }

  .echo-search-form button {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    margin-right: 0;
  }

  .echo-search-panel {
    position: fixed;
    top: 70px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}
