.civic-ai-search-replaced {
  display: none !important;
}

.civic-ai-search-header {
  display: inline-block;
  position: relative;
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  vertical-align: middle;
  touch-action: manipulation;
}

/* The field should appear on the click, without host-theme reveal effects. */
#civic-ai-search-header,
#civic-ai-search-header * {
  animation: none !important;
  transition: none !important;
}

.civic-ai-search-header__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0;
  color: inherit;
  font: inherit;
  line-height: 1;
  list-style: none;
  white-space: nowrap;
  cursor: pointer;
}

.civic-ai-search-header__toggle::-webkit-details-marker {
  display: none;
}

.civic-ai-search-header__toggle svg {
  flex: 0 0 18px;
}

.civic-ai-search-header__toggle .civic-ai-search-header__close,
.civic-ai-search-header[open] .civic-ai-search-header__icon {
  display: none;
}

.civic-ai-search-header[open] .civic-ai-search-header__close {
  display: block;
}

/* The theme hides every form beneath its search menu item. Override that only
 * for this control, respecting the native details element's open state. */
#civic-ai-search-header > .civic-ai-search-header__form {
  display: none !important;
  position: absolute;
  right: 45px;
  bottom: auto;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 45vw;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #222;
  box-shadow: none;
}

#civic-ai-search-header[open] > .civic-ai-search-header__form {
  display: block !important;
}

body.user-logged-in #civic-ai-search-header:not(.civic-ai-search-header--mobile) > .civic-ai-search-header__form {
  width: 48vw;
}

.civic-ai-search-header__label,
.civic-ai-search-header__form .civic-ai-search-header__submit {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.civic-ai-search-header__form input[type="search"] {
  box-sizing: border-box;
  width: 100%;
  height: 40px;
  min-width: 0;
  margin: 0;
  padding: 0 12px;
  border: 1px solid #ff8500;
  border-radius: 8px;
  background: #fff7ef;
  color: #222;
  font: inherit;
  font-size: 16px;
  line-height: 24px;
  appearance: none;
}

/* One close control lives at the original header magnifier position. Avoid
 * also showing the browser's built-in search clear icon inside the field. */
.civic-ai-search-header__form input[type="search"]::-webkit-search-decoration,
.civic-ai-search-header__form input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.civic-ai-search-header__form input:focus-visible,
.civic-ai-search-header__form button:focus-visible,
.civic-ai-search-header__toggle:focus-visible {
  outline: 2px solid #b85f00;
  outline-offset: 2px;
}

#civic-ai-search-header.civic-ai-search-header--mobile {
  display: block;
  width: 100%;
  /* Match the original menu link's 21.86px line plus 16px vertical padding. */
  height: 53.86px;
  margin: 0;
}

#civic-ai-search-header.civic-ai-search-header--mobile > summary {
  display: none;
}

#civic-ai-search-header.civic-ai-search-header--mobile > .civic-ai-search-header__form {
  width: 100%;
  right: 0;
  padding: 0 15px;
  box-sizing: border-box;
}

.civic-ai-search-header--mobile input[type="search"] {
  font-size: 16px;
  line-height: 24px;
}
