.institutionSearch__input {
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--color-dark-1);
}

.institutionSearch__input:focus {
  outline: none;
}

.institutionSearch__input::-moz-placeholder {
  color: var(--color-light-1);
}

.institutionSearch__input::placeholder {
  color: var(--color-light-1);
}

.headerSearchToggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: transparent;
  transition: all 0.2s ease;
}

.headerSearchToggle:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.45);
}

.headerSearchPanel {
  position: fixed;
  inset: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  padding: 32px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.headerSearchPanel.is-active {
  pointer-events: auto;
  opacity: 1;
}

.headerSearchPanel__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 16, 54, 0.76);
  backdrop-filter: blur(4px);
  border: 0;
}

.headerSearchPanel__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 680px;
}

.headerSearchPanel__inner {
  padding: 28px 24px 24px;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 32px 90px rgba(5, 16, 54, 0.28);
}

.headerSearchPanel__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 0 0 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid #e7e9ef;
}

.headerSearchPanel__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #8e95a5;
  transition: all 0.2s ease;
}

.headerSearchPanel__close:hover {
  background: #f4f5f8;
  color: var(--color-dark-1);
}

.headerSearchPanel__form {
  display: block;
}

.headerSearchPanel__field {
  margin-bottom: 18px;
}

.headerSearchPanel__searchShell {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 66px;
  padding: 0 16px 0 18px;
  border: 2px solid #d9dce3;
  border-radius: 18px;
  background: #fbfbfc;
  box-shadow: inset 0 0 0 1px rgba(5, 16, 54, 0.03);
}

.headerSearchPanel__searchShell:focus-within {
  border-color: #a9b6df;
  background: #ffffff;
}

.headerSearchPanel__searchIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #eef1f7;
  color: var(--color-blue-1);
}

.headerSearchPanel__input {
  font-size: 20px;
  font-weight: 500;
}

.headerSearchPanel__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 0;
  border-radius: 999px;
  background: #e3e5ea;
  color: #676d79;
  transition: all 0.2s ease;
}

.headerSearchPanel__clear:hover {
  background: #d6d9df;
}

.headerSearchPanel__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: min(48vh, 420px);
  overflow-y: auto;
  padding-right: 4px;
}

.headerSearchCard {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 16px 16px 16px 14px;
  border: 1px solid #e8ebf0;
  border-radius: 16px;
  background: #fafafb;
  text-align: left;
  transition: all 0.2s ease;
}

.headerSearchCard:hover {
  border-color: #ccd6f6;
  background: #ffffff;
  transform: translateY(-1px);
}

.headerSearchCard.is-active {
  border-color: #9db0ef;
  background: #f7f9ff;
  box-shadow: 0 10px 25px rgba(53, 84, 209, 0.08);
}

.headerSearchCard__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f0f1f4;
}

.headerSearchCard__check span {
  width: 14px;
  height: 14px;
  border: 1.5px solid #51627a;
  border-radius: 4px;
  background: transparent;
  transition: all 0.2s ease;
}

.headerSearchCard.is-active .headerSearchCard__check span {
  border-color: var(--color-blue-1);
  background: var(--color-blue-1);
  box-shadow: inset 0 0 0 3px #ffffff;
}

.headerSearchCard__content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.headerSearchCard__title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--color-dark-1);
}

.headerSearchCard__meta {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  color: #8b909b;
  text-transform: uppercase;
}

.headerSearchCard__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 0 14px;
  height: 34px;
  border-radius: 999px;
  background: #ef4b9b;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
}

.headerSearchPanel__empty {
  padding: 18px 6px 4px;
  color: var(--color-light-1);
  text-align: center;
}

.headerSearchPanel__actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 20px;
}

.js-search-select.-right .searchMenu-loc__field {
  left: auto;
  right: 0;
}

.js-search-select .searchMenu-loc__field {
  min-width: 320px;
}

.js-search-select.is-disabled [data-x-dd-click] {
  opacity: 0.55;
  cursor: not-allowed;
}

.js-search-select.is-disabled .institutionSearch__input {
  cursor: not-allowed;
  color: #9aa3b2;
}

.js-search-select .searchMenu-loc__field .bg-white {
  max-height: min(420px, calc(100vh - 220px));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.institutionSearch__empty {
  padding: 12px 20px;
  color: var(--color-light-1);
}

.headerMenuCount {
  margin-left: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #5d6478;
}

.header .header-menu .menu .mega.mega--compact {
  width: min(560px, calc(100vw - 40px));
}

.header .header-menu .menu .mega.mega--compact .mega__content {
  display: block;
}

.header .header-menu .menu .mega.mega--compact .mega__grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.header .header-menu .menu .mega.mega--compact .mega__image {
  display: none;
}

[data-institution-filter-form] .button-grid > * {
  min-width: 0;
}

[data-institution-filter-form] .searchMenu-loc {
  min-width: 0;
}

[data-institution-filter-form] .mainSearch__submit {
  white-space: nowrap;
}

@media (max-width: 1199px) {
  [data-institution-filter-form].mainSearch .button-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  [data-institution-filter-form].mainSearch .button-grid > * {
    border-left: 0;
  }

  [data-institution-filter-form].mainSearch .button-grid > *:nth-child(even):not(.button-item) {
    border-left: 1px solid var(--color-border);
  }

  [data-institution-filter-form].mainSearch .button-grid > *:nth-child(n + 3) {
    border-top: 1px solid var(--color-border);
  }

  [data-institution-filter-form].mainSearch .button-grid > .button-item {
    grid-column: 1 / -1;
  }

  [data-institution-filter-form] .searchMenu-loc__field,
  [data-institution-filter-form] .js-search-select.-right .searchMenu-loc__field {
    left: 0;
    right: 0;
    width: auto;
    min-width: 0;
    max-width: none;
  }
}

@media (max-width: 767px) {
  [data-institution-filter-form].mainSearch .button-grid {
    grid-template-columns: 1fr;
  }

  [data-institution-filter-form].mainSearch .button-grid > * {
    border-left: 0;
  }

  [data-institution-filter-form].mainSearch .button-grid > * + * {
    border-top: 1px solid var(--color-border);
  }

  [data-institution-filter-form].mainSearch .button-grid > *:nth-child(even):not(.button-item) {
    border-left: 0;
  }

  [data-institution-filter-form].mainSearch .button-grid > .button-item {
    grid-column: auto;
  }

  [data-institution-filter-form] .searchMenu-loc__field {
    margin-top: 16px;
  }
}

@media (max-width: 991px) {
  .headerSearchPanel {
    padding: 20px 14px;
  }

  .headerSearchPanel__inner {
    padding: 20px;
  }

  .headerSearchPanel__input {
    font-size: 17px;
  }

  .headerSearchCard {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .headerSearchCard__badge {
    grid-column: 2;
    justify-self: flex-start;
  }

  .headerSearchPanel__actions {
    justify-content: stretch;
  }

  .headerSearchPanel__actions .button {
    width: 100%;
  }

  .js-search-select .searchMenu-loc__field {
    min-width: 0;
    width: auto;
    left: -20px;
    right: -20px;
  }

  .js-search-select .searchMenu-loc__field .bg-white {
    max-height: min(360px, calc(100vh - 180px));
  }
}

@media (max-width: 575px) {
  .headerSearchToggle {
    width: 44px;
    height: 44px;
  }

  .headerSearchPanel__dialog {
    width: 100%;
  }

  .headerSearchPanel__top {
    align-items: center;
  }

  .js-search-select .searchMenu-loc__field {
    left: -10px;
    right: -10px;
  }
}
