.home-search-shell {
  position: relative;
  z-index: 20;
  width: min(100%, 760px);
  margin: 30px auto 0;
  text-align: left;
}

.home-search-shell .hero-search {
  width: 100%;
  margin: 0;
}

.home-search-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  left: 0;
  z-index: 40;
  max-height: min(430px, calc(100vh - 150px));
  padding: 18px;
  overflow-y: auto;
  border: 1px solid #d8e2f0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 22px 55px rgba(23, 37, 84, .18);
}

.home-search-panel[hidden],
.home-recommendation-list[hidden] {
  display: none;
}

.home-search-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.home-search-panel-heading strong,
.home-search-panel-subtitle {
  color: #182235;
  font-size: 14px;
  font-weight: 800;
}

.home-search-clear {
  min-height: 44px;
  padding: 5px 8px;
  border: 0;
  background: transparent;
  color: #667085;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.home-search-clear:hover,
.home-search-clear:focus-visible {
  color: #2563eb;
}

.home-recent-search-list {
  display: grid;
  gap: 2px;
  margin-top: 8px;
}

.home-recent-search-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  border-radius: 12px;
}

.home-recent-search-item:hover,
.home-recent-search-item:focus-within {
  background: #f5f8ff;
}

.home-recent-search-link {
  min-width: 0;
  padding: 11px 10px;
  overflow: hidden;
  color: #26334a;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-recent-search-remove {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #98a2b3;
  cursor: pointer;
  font-size: 21px;
  line-height: 1;
}

.home-recent-search-remove:hover,
.home-recent-search-remove:focus-visible {
  background: #eaf1ff;
  color: #2563eb;
}

.home-search-empty {
  margin: 13px 0 2px;
  color: #98a2b3;
  font-size: 13px;
}

.home-search-panel-recommendations {
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid #edf1f6;
}

.home-search-panel-subtitle {
  display: block;
  margin-bottom: 10px;
}

.home-search-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.home-search-chip {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid #d9e4f5;
  border-radius: 999px;
  background: #f8faff;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

.home-search-chip:hover,
.home-search-chip:focus-visible {
  border-color: #93b4ff;
  background: #eef4ff;
  color: #1d4ed8;
}

.home-recommendation-rotator {
  position: relative;
  z-index: 16;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 44px;
  width: min(100%, 760px);
  min-height: 48px;
  align-items: center;
  gap: 12px;
  margin: 9px auto 0;
  padding: 0 0 0 18px;
  color: #344054;
  text-align: left;
  -webkit-font-smoothing: antialiased;
}

.home-recommendation-label {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  color: #778196;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.025em;
  white-space: nowrap;
}

.home-recommendation-label::before {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
  content: '';
}

.home-recommendation-viewport {
  position: relative;
  min-width: 0;
  height: 26px;
  overflow: hidden;
}

.home-recommendation-track {
  display: flex;
  min-width: 0;
  flex-direction: column;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.home-recommendation-track.is-rolling {
  transition: transform .52s cubic-bezier(.22, .61, .36, 1);
}

.home-recommendation-item {
  display: grid;
  width: 100%;
  min-width: 0;
  height: 26px;
  flex: 0 0 26px;
  grid-template-columns: 21px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  color: #172033;
  pointer-events: none;
  white-space: nowrap;
}

.home-recommendation-item.is-active {
  pointer-events: auto;
}

.home-recommendation-rank {
  color: #2563eb;
  font-size: 14px;
  font-weight: 700;
  font-synthesis: none;
  line-height: 1;
  text-align: right;
}

.home-recommendation-keyword {
  min-width: 0;
  overflow: hidden;
  color: #172033;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  font-synthesis: none;
  line-height: 1.35;
  letter-spacing: -.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-recommendation-item:hover .home-recommendation-keyword,
.home-recommendation-item:focus-visible .home-recommendation-keyword {
  color: #2563eb;
}

.home-recommendation-item:focus-visible,
.home-recommendation-toggle:focus-visible,
.home-recommendation-list a:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .2);
  outline-offset: 2px;
}

.home-recommendation-toggle {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid #e7ecf3;
  border-radius: 11px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 5px 16px rgba(23, 37, 84, .08);
  color: #5d6778;
  cursor: pointer;
  transition:
    border-color .18s ease,
    box-shadow .18s ease,
    color .18s ease,
    transform .18s ease;
}

.home-recommendation-toggle:hover,
.home-recommendation-toggle:focus-visible,
.home-recommendation-rotator.is-expanded .home-recommendation-toggle {
  border-color: #b8cbf4;
  box-shadow: 0 7px 18px rgba(37, 99, 235, .12);
  color: #2563eb;
}

.home-recommendation-toggle-icon {
  width: 8px;
  height: 8px;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .24s cubic-bezier(.22, 1, .36, 1);
}

.home-recommendation-rotator.is-expanded .home-recommendation-toggle-icon {
  transform: translateY(2px) rotate(225deg);
}

.home-recommendation-list {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 45;
  display: grid;
  width: min(100%, 360px);
  max-height: min(460px, calc(100dvh - 180px));
  gap: 2px;
  padding: 8px;
  overflow-y: auto;
  border: 1px solid #dfe7f2;
  border-radius: 16px;
  background: rgba(255, 255, 255, .985);
  box-shadow: 0 20px 46px rgba(23, 37, 84, .16);
  transform-origin: top right;
  animation: home-recommendation-list-in .2s cubic-bezier(.22, 1, .36, 1) both;
}

.home-recommendation-list a {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  min-height: 44px;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 11px;
  color: #26334a;
  font-family: inherit;
  font-weight: 400;
  font-synthesis: none;
}

.home-recommendation-list a:hover,
.home-recommendation-list a:focus-visible {
  background: #f3f7ff;
}

.home-recommendation-list a:hover .home-recommendation-keyword,
.home-recommendation-list a:focus-visible .home-recommendation-keyword,
.home-recommendation-list a:hover .home-recommendation-rank,
.home-recommendation-list a:focus-visible .home-recommendation-rank {
  color: #1d4ed8;
}

.home-recommendation-list .home-recommendation-rank {
  color: #2563eb;
  font-weight: 700;
}

.home-recommendation-list .home-recommendation-keyword {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  font-synthesis: none;
  letter-spacing: -.015em;
}

@keyframes home-recommendation-list-in {
  from {
    opacity: 0;
    transform: translateY(-5px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.home-hero {
  padding-bottom: clamp(38px, 4.4vw, 52px);
}

.home-hero + .home-section {
  margin-top: clamp(34px, 4vw, 48px);
}

@media (max-width: 640px) {
  .home-search-shell {
    margin-top: 24px;
  }

  .home-search-shell .hero-search input {
    font-size: 16px;
  }

  .home-search-panel {
    top: calc(100% + 8px);
    max-height: min(420px, calc(100dvh - 120px));
    padding: 15px;
    border-radius: 16px;
  }

  .home-recommendation-rotator {
    grid-template-columns: auto minmax(0, 1fr) 44px;
    min-height: 48px;
    gap: 8px;
    margin-top: 8px;
    padding: 0 0 0 10px;
  }

  .home-recommendation-label {
    gap: 6px;
    font-size: 11.5px;
  }

  .home-recommendation-label::before {
    width: 4px;
    height: 4px;
  }

  .home-recommendation-item {
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 6px;
  }

  .home-recommendation-rank {
    font-size: 13px;
  }

  .home-recommendation-keyword {
    font-size: 13.5px;
  }

  .home-recommendation-toggle {
    width: 44px;
    height: 44px;
  }

  .home-recommendation-list {
    right: 0;
    left: 0;
    width: auto;
    transform-origin: top center;
  }

  .home-hero {
    padding-bottom: 34px;
  }

  .home-hero + .home-section {
    margin-top: 30px;
  }
}

@media (max-width: 350px) {
  .home-recommendation-rotator {
    gap: 6px;
    padding-left: 6px;
  }

  .home-recommendation-label {
    font-size: 11px;
  }

  .home-recommendation-keyword {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-recommendation-track,
  .home-recommendation-toggle-icon,
  .home-recommendation-list {
    transition: none;
    animation: none;
  }
}
