predictive-search:not([loading]) .predictive-search__loading-state {
  display: none;
}

predictive-search[loading] .predictive-search__loading-state {
  display: block;
}

predictive-search[loading] .predictive-search__results {
  display: none;
}

predictive-search:not(.run-top) .predictive-search {
  opacity: 0;
}

.predictive-search {
  transition: opacity 300ms ease 0.5s;
}

[data-predictive-search] {
  position: absolute;
  top: calc(100% + 3rem);
  width: calc(100vw - 3rem);
  padding: 2.5rem 0;
  box-shadow: 0 0 4rem 0 rgba(var(--color-overlay), 0.1);
  background: rgb(var(--color-background));
  border-radius: 0.8rem;
  transition: top 300ms ease, opacity 300ms ease;
  opacity: 0;
  visibility: hidden;
  max-height: 60vh;
  overflow-y: auto;
}

@media screen and (min-width: 475px) {
  [data-predictive-search] {
    inset-inline-end: 0;
    width: 100%;
  }
}

predictive-search[open].run-top [data-predictive-search] {
  top: calc(100% + 1rem);
  opacity: 1;
  visibility: visible;
}

predictive-search[open] .search__input {
  background: rgb(var(--color-background));
}

.search__input {
  transition: background 300ms ease;
}

.predictive-search__notification, .predictive-search__search-url {
  padding: 0 2.5rem;
}

.predictive-search__header {
  margin: -2.5rem 0;
  padding: 2.5rem;
}

.predictive-search__header:hover {
  background: rgb(var(--color-foreground), 0.05);
}

.predictive-search__group {
  border-top: 1px dashed var(--color-line);
  padding: 1.5rem 2.5rem;
}

.predictive-search__group:last-of-type {
  border-bottom: 1px dashed var(--color-line);
}

.predictive-search__query-list {
  gap: 1rem;
  padding-top: 1rem;
}

.predictive-search__item-query {
  --outline-focus-offset: -0.3rem;
  white-space: nowrap;
  border-radius: 0.8rem;
  padding: 0.1rem 1rem;
  background: rgb(var(--color-foreground), 0.05);
  transition: background 300ms ease;
}

.predictive-search__item-query:hover {
  background: rgb(var(--color-foreground), 0.1);
}

.predictive-search__item-query-result {
  color: rgb(var(--color-highlight));
  margin: .7rem 0;
}

.predictive-search__item-query-result mark {
  color: rgb(var(--color-foreground));
  background: none;
}

.predictive-search__group--with-media {
  padding-inline: 0;
  padding-bottom: 0;
}

.predictive-search__item {
  display: grid;
  grid-template-columns: 7rem 1fr;
  column-gap: 1.5rem;
  padding: 1.5rem 2.5rem;
}

a.predictive-search__item {
  --outline-focus-offset: -0.5rem;
}

.predictive-search__item--empty {
  grid-template-columns: auto;
}

.predictive-search__item + .predictive-search__item {
  border-top: 1px solid rgb(var(--color-foreground), 0.1);
}

.predictive-search__item:hover {
  background: rgb(var(--color-foreground), 0.05);
}

.predictive-search__item__title.card__heading {
  margin-top: 0;
}

.predictive-search__item__title .link {
  z-index: 1;
}

.predictive-search__button {
  padding: 1rem 2rem;
  background: rgb(var(--color-foreground), .05);
  color: rgb(var(--color-foreground));
  border-radius: 0.5rem;
  text-decoration: none;
  font-size: 1.2rem;
  text-transform: uppercase;
  font-family: var(--font-button-family);
  font-style: var(--font-button-style);
  font-weight: var(--font-button-weight-bold);
  transition: background 500ms ease;
}

.predictive-search__button:hover {
  background: rgb(var(--color-foreground), .1);
}

.predictive-search[open] > form,
.predictive-search[open] > [data-predictive-search],
.header__search--has-predictive > details[open] .search--header {
  z-index: 4;
}

.predictive-search[open] .predictive-search__overlay,
.header__search--has-predictive > details[open] .predictive-search__overlay {
  position: fixed;
  inset-inline-start: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  cursor: pointer;
  display: block;
  opacity: 0;
  transition: opacity 300ms ease;
  background: rgb(var(--color-overlay), 0.1);
}

.predictive-search.run-top .predictive-search__overlay, .header__search--has-predictive > details[open] .predictive-search__overlay {
  opacity: 1;
}

.predictive-search__padding {
  padding: 0 2.5rem;
}

@media(min-width: 990px) {
  [data-predictive-search]:not(.predictive-search__full) {
    min-width: 40rem;
    max-width: 50rem;
  }
}