/* ==========================================================
   Aplify – Search form, the "clean" look
   ==========================================================
   One bar of icon-led segments with a round search button, dropdowns
   that open as panels, and a single card of rows when the space is
   narrow. Used by [aplify_quick_search] always, and by
   [aplify_search_form] when the Search style setting (or style="clean"
   on the shortcode) asks for it.

   Every rule is scoped to .aplify-search--clean, so a classic form is
   untouched. Loaded after search_form.css and selectify.css; the
   !important flags are there to win over those files' own !important
   rules and over page builders' global button and input styles.

   Layouts, picked by the width of the form's own container (not the
   window), so the same shortcode adapts to a hero, a column or a phone:
     under 640px   one card of stacked rows, full-width button below
     640px up      one bar, first two fields in it
     960px up      one bar, first three fields in it
   Fields past what a layout shows go behind "More filters".
   .aplify-quick-search--card keeps the card at every width.

   Positions come from the markup: .aplify-f1 … .aplify-f6 is a field's
   place among the visible ones, .aplify-f-last marks the final one, and
   .aplify-fields-N on the form is how many there are.
   ========================================================== */

.aplify-search--clean {
  /* Sizes */
  --sc-bar-h: var(--clean-bar-height, 72px);
  --sc-row-h: var(--clean-row-height, 64px);
  --sc-btn: var(--clean-button-size, 56px);
  --sc-pad: var(--clean-field-padding, 26px);
  --sc-icon: var(--clean-icon-size, 20px);
  --sc-icon-gap: 12px;
  --sc-font-size: var(--clean-font-size, 17px);

  /* Colours */
  --sc-surface: var(--clean-surface, #fff);
  --sc-text: var(--clean-text, var(--fg, #101318));
  /* Hint text is the only visible name a field has here, so it is darker
     than the classic placeholder: 5.3:1 on white, where 4.5:1 is the bar. */
  --sc-muted: var(--clean-muted, #646c79);
  --sc-accent: var(--clean-accent, var(--primary));
  --sc-hairline: var(--clean-hairline, rgb(16 19 24 / .12));
  --sc-outline: var(--clean-outline, rgb(16 19 24 / .1));
  --sc-item-hover: var(--clean-item-hover, var(--dropdown-hover, #eef0f5));

  /* Shapes */
  --sc-bar-radius: var(--clean-bar-radius, 999px);
  --sc-card-radius: var(--clean-card-radius, 24px);
  --sc-panel-radius: var(--clean-panel-radius, 28px);
  --sc-bar-shadow: var(--clean-bar-shadow, 0 2px 14px rgb(16 19 24 / .08));
  --sc-panel-shadow: var(--clean-panel-shadow, 0 24px 60px rgb(16 19 24 / .22));

  /* Icons (Lucide, ISC licence), drawn as masks in the current text
     colour. A theme can swap any of them by setting the variable. */
  --aplify-icon-search: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='m21 21-4.3-4.3'/></svg>");
  --aplify-icon-location: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0'/><circle cx='12' cy='10' r='3'/></svg>");
  --aplify-icon-locate: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><line x1='2' x2='5' y1='12' y2='12'/><line x1='19' x2='22' y1='12' y2='12'/><line x1='12' x2='12' y1='2' y2='5'/><line x1='12' x2='12' y1='19' y2='22'/><circle cx='12' cy='12' r='7'/><circle cx='12' cy='12' r='3'/></svg>");
  --aplify-icon-category: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 12h.01'/><path d='M16 6V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2'/><path d='M22 13a18.15 18.15 0 0 1-20 0'/><rect width='20' height='14' x='2' y='6' rx='2'/></svg>");
  --aplify-icon-role: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='8' r='5'/><path d='M20 21a8 8 0 0 0-16 0'/></svg>");
  --aplify-icon-region: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z'/><path d='M15 5.764v15'/><path d='M9 3.236v15'/></svg>");
  --aplify-icon-filters: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><line x1='21' x2='14' y1='4' y2='4'/><line x1='10' x2='3' y1='4' y2='4'/><line x1='21' x2='12' y1='12' y2='12'/><line x1='8' x2='3' y1='12' y2='12'/><line x1='21' x2='16' y1='20' y2='20'/><line x1='12' x2='3' y1='20' y2='20'/><line x1='14' x2='14' y1='2' y2='6'/><line x1='8' x2='8' y1='10' y2='14'/><line x1='16' x2='16' y1='18' y2='22'/></svg>");
  --aplify-icon-hours: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><polyline points='12 6 12 12 16 14'/></svg>");
  --aplify-icon-chevron: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
}

/* Which icon leads each field, and the heading on its panel. The heading
   can be set per shortcode (categories_heading="Job families" and so on),
   which arrives as --sc-heading on the field. */
.aplify-search--clean .aplify-field--keywords { --sc-field-icon: var(--aplify-icon-search); }
.aplify-search--clean .aplify-field--location { --sc-field-icon: var(--aplify-icon-location); }
.aplify-search--clean .aplify-field--category { --sc-field-icon: var(--aplify-icon-category); }
.aplify-search--clean .aplify-field--roles { --sc-field-icon: var(--aplify-icon-role); }
.aplify-search--clean .aplify-field--employment-type { --sc-field-icon: var(--aplify-icon-hours); }
.aplify-search--clean .aplify-field--region,
.aplify-search--clean .aplify-field--normalised-uk-region { --sc-field-icon: var(--aplify-icon-region); }

/* On a dark page: nothing outlines the white surfaces, and the bits that
   sit on the page itself (the chips under the form) turn light. */
.aplify-search--clean.aplify-search--on-dark {
  --sc-outline: transparent;
  --sc-bar-shadow: none;
  --filter-chip-bg: rgb(255 255 255 / .16);
  --filter-chip-text: #fff;
  --clear-filters-text: #fff;
}

/* Results placed straight after the form get some air. The classic look
   has its panel's padding for this; the bar has none. Only when the two
   are neighbours: a page builder that spaces its own widgets is left alone. */
.aplify-search--clean + .aplify-search-results,
.aplify-search--clean + div:has(> .aplify-search-results) {
  margin-top: var(--clean-results-gap, 28px);
}

/* ----------------------------------------------------------
   Base: one card of stacked rows (also the narrow layout)
   ---------------------------------------------------------- */

.aplify-search--clean .aplify-search-form {
  position: relative;
  /* Its own layer, so the bar's background can sit behind the fields and
     the panels stay above whatever follows the form on the page. */
  z-index: var(--clean-z-index, 30);
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  font-size: var(--sc-font-size);
  color: var(--sc-text);
  background: transparent;
  border-radius: 0;
}

/* The wrapper around the dropdown fields steps aside: each field is laid
   out on its own, and "More filters" works by position, not by wrapper. */
.aplify-search--clean .aplify-form-secondary {
  display: contents !important;
}

/* Labels stay for screen readers; the icon and placeholder do the telling */
.aplify-search--clean .aplify-form-group > label {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* A field is a row of the card */
.aplify-search--clean .aplify-search-form .aplify-field {
  position: relative;
  display: block;
  flex: 0 0 auto;
  box-sizing: border-box;
  min-width: 0;
  max-width: none;
  height: var(--sc-row-h);
  margin: 0;
  padding: 0;
  background: var(--sc-surface);
  border: solid var(--sc-outline);
  border-width: 0 1px;
  border-top: 1px solid var(--sc-hairline);
  border-radius: 0;
}

.aplify-search--clean .aplify-search-form .aplify-f1 {
  order: 1;
  border-top-color: var(--sc-outline);
  border-radius: var(--sc-card-radius) var(--sc-card-radius) 0 0;
}
.aplify-search--clean .aplify-search-form .aplify-f2 { order: 2; }
.aplify-search--clean .aplify-search-form .aplify-f3 { order: 3; }
.aplify-search--clean .aplify-search-form .aplify-f4 { order: 14; }
.aplify-search--clean .aplify-search-form .aplify-f5 { order: 15; }
.aplify-search--clean .aplify-search-form .aplify-f6 { order: 16; }

.aplify-search--clean .aplify-search-form .aplify-f-last {
  border-bottom: 1px solid var(--sc-outline);
  border-radius: 0 0 var(--sc-card-radius) var(--sc-card-radius);
}
.aplify-search--clean .aplify-search-form .aplify-f1.aplify-f-last {
  border-radius: var(--sc-card-radius);
}

/* Fields four and up wait behind "More filters" */
.aplify-search--clean .aplify-search-form:not(.is-filters-open) :is(.aplify-f4, .aplify-f5, .aplify-f6) {
  display: none !important;
}

/* ---- The controls inside a field: text after an icon, no box ---- */

.aplify-search--clean .aplify-search-form .aplify-field input[type="text"],
.aplify-search--clean .aplify-search-form .aplify-field select,
.aplify-search--clean .aplify-search-form .selectify__button {
  appearance: none;
  box-sizing: border-box;
  display: block !important;
  width: 100%;
  height: 100% !important;
  margin: 0;
  padding: 0 var(--sc-pad) 0 calc(var(--sc-pad) + var(--sc-icon) + var(--sc-icon-gap)) !important;
  font-family: var(--font-family);
  font-size: var(--sc-font-size) !important;
  font-weight: 400;
  line-height: 1.3;
  text-align: left;
  color: var(--sc-text) !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: inherit !important;
  box-shadow: none !important;
  outline: none;
}

.aplify-search--clean .aplify-search-form .aplify-field input[type="text"]::placeholder {
  color: var(--sc-muted);
  opacity: 1;
}

/* Focus: no fill. A short accent line draws in under the text and the
   field's icon takes the accent colour. Keyboard focus on the buttons gets
   a ring as well. */
.aplify-search--clean .aplify-search-form .aplify-field input[type="text"],
.aplify-search--clean .aplify-search-form .selectify__button {
  --sc-line-start: calc(var(--sc-pad) + var(--sc-icon) + var(--sc-icon-gap));
  --sc-line-end: var(--sc-pad);
  background-image: linear-gradient(var(--sc-accent), var(--sc-accent)) !important;
  background-repeat: no-repeat !important;
  background-position: left var(--sc-line-start) bottom calc(50% - 19px) !important;
  background-size: 0 2px !important;
  transition: background-size .2s ease;
}

.aplify-search--clean .aplify-search-form .location-input-wrapper:has(.use-my-location-btn) .search-location {
  --sc-line-end: calc(var(--sc-pad) + 30px);
}

.aplify-search--clean .aplify-search-form .selectify__button {
  --sc-line-end: calc(var(--sc-pad) + var(--sc-icon) + 10px);
}

.aplify-search--clean .aplify-search-form .aplify-field input[type="text"]:focus,
.aplify-search--clean .aplify-search-form .selectify[aria-expanded="true"] .selectify__button {
  background-size: calc(100% - var(--sc-line-start) - var(--sc-line-end)) 2px !important;
  border: 0 !important;
  box-shadow: none !important;
}

.aplify-search--clean .aplify-search-form .selectify__button:focus-visible,
.aplify-search--clean .aplify-search-form .aplify-more-filters-toggle:focus-visible,
.aplify-search--clean .aplify-search-form .use-my-location-btn:focus-visible {
  outline: 2px solid var(--sc-accent) !important;
  outline-offset: -4px;
}

.aplify-search--clean .aplify-search-form button[data-testid="search-button"]:focus-visible {
  outline: 2px solid var(--sc-accent) !important;
  outline-offset: 2px;
}

/* Leading icons. Keywords has no wrapper of its own, so the icon hangs
   off the field; location and the dropdowns hang it off their control,
   which leaves the field free to be un-positioned in the bar (below). */
.aplify-search--clean .aplify-field--keywords::before,
.aplify-search--clean .aplify-search-form .location-input-wrapper::before,
.aplify-search--clean .aplify-search-form .selectify__button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: var(--sc-pad);
  z-index: 1;
  width: var(--sc-icon);
  height: var(--sc-icon);
  background-color: var(--sc-text);
  -webkit-mask: var(--sc-field-icon) center / contain no-repeat;
          mask: var(--sc-field-icon) center / contain no-repeat;
  transform: translateY(-50%);
  pointer-events: none;
  transition: background-color .15s ease;
}

.aplify-search--clean .aplify-field--keywords:focus-within::before,
.aplify-search--clean .aplify-search-form .location-input-wrapper:focus-within::before,
.aplify-search--clean .aplify-search-form .selectify[aria-expanded="true"] .selectify__button::before {
  background-color: var(--sc-accent);
}

/* ---- Location ---- */

.aplify-search--clean .aplify-search-form .location-input-wrapper {
  position: relative;
  height: 100%;
  overflow: visible;
  border: 0;
  border-radius: inherit;
  box-shadow: none;
}

.aplify-search--clean .aplify-search-form .location-input-wrapper:focus-within {
  border: 0;
  box-shadow: none;
}

.aplify-search--clean .aplify-search-form .location-input-wrapper:has(.use-my-location-btn) .search-location {
  padding-right: calc(var(--sc-pad) + 30px) !important;
}

/* "Use my location": a quiet crosshair at the end of the field. Only its
   colour changes; there's no fill behind it. */
.aplify-search--clean .aplify-search-form .use-my-location-btn {
  top: 50% !important;
  right: calc(var(--sc-pad) - 14px) !important;
  bottom: auto !important;
  display: flex !important;
  justify-content: center;
  align-items: center;
  width: 44px !important;
  height: 44px !important;
  padding: 0 !important;
  font-size: 0 !important;
  color: var(--sc-muted) !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 50% !important;
  filter: none !important;
  transform: translateY(-50%);
}

.aplify-search--clean .aplify-search-form .use-my-location-btn::before {
  width: var(--sc-icon) !important;
  height: var(--sc-icon) !important;
  margin: 0 !important;
  background-color: currentColor !important;
  -webkit-mask: var(--aplify-icon-locate) center / contain no-repeat !important;
          mask: var(--aplify-icon-locate) center / contain no-repeat !important;
}

.aplify-search--clean .aplify-search-form .use-my-location-btn.active,
.aplify-search--clean .aplify-search-form .use-my-location-btn.active:hover {
  color: var(--sc-accent) !important;
  background: transparent !important;
}

/* Location in use: the field says so, in the accent colour, so it reads
   as a choice and not as a hint */
.aplify-search--clean .aplify-location-autocomplete.is-using-location .search-location::placeholder {
  font-weight: 600;
  color: var(--sc-accent);
}

.aplify-search--clean .aplify-search-form .aplify-location-autocomplete.is-using-location .location-input-wrapper::before {
  background-color: var(--sc-accent);
}

/* ---- Dropdowns ---- */

.aplify-search--clean .aplify-search-form .selectify {
  position: static;
  height: 100%;
  border-radius: inherit;
}

.aplify-search--clean .aplify-search-form .selectify__button {
  position: relative;
  padding-right: calc(var(--sc-pad) + var(--sc-icon) + 10px) !important;
  cursor: pointer;
}

/* Chevron at the end, turning over while the panel is open */
.aplify-search--clean .aplify-search-form .selectify__button::after {
  right: var(--sc-pad);
  width: var(--sc-icon);
  height: var(--sc-icon);
  background: currentColor;
  -webkit-mask: var(--aplify-icon-chevron) center / contain no-repeat;
          mask: var(--aplify-icon-chevron) center / contain no-repeat;
  transition: transform .2s ease;
}

.aplify-search--clean .aplify-search-form .selectify[aria-expanded="true"] .selectify__button::after {
  transform: translateY(-50%) rotate(180deg);
}

/* ---- Panels: places, dropdown lists, and "Finding places…" ---- */

.aplify-search--clean .aplify-search-form .location-suggestions,
.aplify-search--clean .aplify-search-form .selectify__list,
.aplify-search--clean .aplify-search-form .aplify-places-loading {
  position: absolute;
  top: calc(100% + 8px);
  left: -1px;
  right: -1px;
  z-index: 40;
  box-sizing: border-box;
  width: auto;
  max-height: 340px;
  margin: 0;
  padding: 20px 20px 24px;
  overflow-y: auto;
  list-style: none;
  color: var(--sc-text);
  background: var(--sc-surface);
  border: 0;
  border-radius: min(var(--sc-panel-radius), 24px);
  box-shadow: var(--sc-panel-shadow);
}

/* Panel headings ("Places", "Categories"…) */
.aplify-search--clean .aplify-search-form .location-suggestions::before,
.aplify-search--clean .aplify-search-form .selectify__list::before {
  content: var(--sc-heading, none);
  display: block;
  grid-column: 1 / -1;
  margin: 0 0 12px 12px;
  font-size: calc(var(--sc-font-size) + 1px);
  font-weight: 600;
  line-height: 1.3;
  color: var(--sc-text);
}

.aplify-search--clean.aplify-search--no-headings .aplify-search-form .location-suggestions::before,
.aplify-search--clean.aplify-search--no-headings .aplify-search-form .selectify__list::before {
  content: none;
}

.aplify-search--clean .aplify-search-form .aplify-places-loading {
  padding-left: 32px;
  font-size: var(--sc-font-size);
  color: var(--sc-muted);
}

/* The list lays its items out in columns when there's room for them */
.aplify-search--clean .aplify-search-form .selectify[aria-expanded="true"] .selectify__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  column-gap: 16px;
  align-content: start;
}

/* Items: an icon, then the name */
.aplify-search--clean .aplify-search-form .location-suggestions li,
.aplify-search--clean .aplify-search-form .selectify__option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 12px;
  font-family: var(--font-family);
  font-size: var(--sc-font-size);
  font-weight: 400;
  line-height: 1.35;
  color: var(--sc-text);
  background: transparent;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}

.aplify-search--clean .aplify-search-form .location-suggestions li::before,
.aplify-search--clean .aplify-search-form .selectify__option::before {
  content: "";
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  background-color: var(--sc-accent);
  -webkit-mask: var(--sc-field-icon) center / contain no-repeat;
          mask: var(--sc-field-icon) center / contain no-repeat;
}

/* The first option ("All categories") reads as the reset */
.aplify-search--clean .aplify-search-form .selectify__option[data-value=""]::before {
  -webkit-mask-image: var(--aplify-icon-search);
          mask-image: var(--aplify-icon-search);
}

.aplify-search--clean .aplify-search-form .location-suggestions li.is-highlighted,
.aplify-search--clean .aplify-search-form .selectify__option[data-highlighted] {
  color: var(--sc-text);
  background: var(--sc-item-hover);
}

.aplify-search--clean .aplify-search-form .selectify__option[aria-selected="true"] {
  font-weight: 600;
  color: var(--sc-accent);
}

/* ---- More filters: a row of the card, shown only when there are
   fields behind it ---- */

.aplify-search--clean .aplify-search-form .aplify-more-filters-toggle {
  display: none;
}

/* The icon is drawn in the text colour, so hold that colour in every state:
   themes commonly turn button text white on hover and focus, which left a
   white icon on a white bar once the toggle had been clicked. Hover keeps
   its accent (set further down). */
.aplify-search--clean .aplify-search-form .aplify-more-filters-toggle,
.aplify-search--clean .aplify-search-form .aplify-more-filters-toggle:focus:not(:hover),
.aplify-search--clean .aplify-search-form .aplify-more-filters-toggle:active {
  color: var(--sc-text) !important;
}

.aplify-search--clean .aplify-search-form:is(.aplify-fields-4, .aplify-fields-5, .aplify-fields-6) .aplify-more-filters-toggle {
  position: relative;
  order: 10;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  width: auto;
  max-width: none;
  height: var(--sc-row-h);
  margin: 0;
  padding: 0 var(--sc-pad) 0 calc(var(--sc-pad) + var(--sc-icon) + var(--sc-icon-gap));
  font-family: var(--font-family);
  font-size: var(--sc-font-size);
  font-weight: 400;
  text-align: left;
  color: var(--sc-text) !important;
  background: var(--sc-surface) !important;
  border: solid var(--sc-outline) !important;
  border-width: 0 1px !important;
  border-top: 1px solid var(--sc-hairline) !important;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
}

/* Closed, it's the last row of the card */
.aplify-search--clean .aplify-search-form:not(.is-filters-open) .aplify-more-filters-toggle {
  border-bottom: 1px solid var(--sc-outline) !important;
  border-radius: 0 0 var(--sc-card-radius) var(--sc-card-radius);
}

.aplify-search--clean .aplify-search-form .aplify-more-filters-toggle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: var(--sc-pad);
  width: var(--sc-icon);
  height: var(--sc-icon);
  background-color: currentColor;
  -webkit-mask: var(--aplify-icon-filters) center / contain no-repeat;
          mask: var(--aplify-icon-filters) center / contain no-repeat;
  transform: translateY(-50%);
}

.aplify-search--clean .aplify-search-form .aplify-more-filters-toggle.is-active::before {
  background-color: var(--sc-accent);
}

/* The plus and minus from the classic look aren't used here */
.aplify-search--clean .aplify-search-form .aplify-more-filters-icon {
  display: none !important;
}

.aplify-search--clean .aplify-search-form .aplify-more-filters-count {
  padding: 1px 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--button-text-color, #fff);
  background: var(--sc-accent);
  border-radius: 999px;
}

/* ---- Search button: a full-width pill under the card ---- */

.aplify-search--clean .aplify-search-form .aplify-search-submit {
  order: 60;
  display: block;
  flex: 0 0 auto;
  max-width: none;
  margin: 12px 0 0;
  padding: 0;
}

.aplify-search--clean .aplify-search-form button[data-testid="search-button"] {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: var(--sc-btn);
  padding: 0 24px;
  font-family: var(--font-family);
  font-size: calc(var(--sc-font-size) + 1px);
  font-weight: 600;
  line-height: 1;
  color: var(--search-btn-text, var(--button-text-color)) !important;
  background: var(--search-btn-bg, var(--highlight)) !important;
  border: 2px solid transparent;
  border-radius: 999px;
  box-shadow: none;
  transform: none;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.aplify-search--clean .aplify-search-form button[data-testid="search-button"]::before {
  content: "";
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  background-color: currentColor;
  -webkit-mask: var(--aplify-icon-search) center / contain no-repeat;
          mask: var(--aplify-icon-search) center / contain no-repeat;
}

/* Pressed looks like hovered, so a tap on a phone gets the same feedback.
   The text keeps its own colour unless a hover colour has been set. */
.aplify-search--clean .aplify-search-form button[data-testid="search-button"]:active {
  color: var(--search-btn-text-hover, var(--search-btn-text, var(--button-text-color))) !important;
  background: var(--search-btn-bg-hover, var(--primary-hover)) !important;
  box-shadow: none;
  transform: none;
}

/* On a dark page the pill turns to an outline when pressed */
.aplify-search--clean.aplify-search--on-dark .aplify-search-form button[data-testid="search-button"]:active {
  color: #fff !important;
  background: transparent !important;
  border-color: #fff;
}

/* ---- Hover, for real pointers only: a tap on a phone would otherwise
   leave the thing it touched looking hovered ---- */

@media (hover: hover) {
  .aplify-search--clean .aplify-search-form .selectify__button:hover {
    background-color: transparent !important;
  }

  .aplify-search--clean .aplify-search-form .selectify__button:hover::before {
    background-color: var(--sc-accent);
  }

  .aplify-search--clean .aplify-search-form .use-my-location-btn:hover {
    color: var(--sc-accent) !important;
    background: transparent !important;
  }

  .aplify-search--clean .aplify-search-form .location-suggestions li:hover,
  .aplify-search--clean .aplify-search-form .selectify__option:hover {
    color: var(--sc-text);
    background: var(--sc-item-hover);
  }

  .aplify-search--clean .aplify-search-form .selectify__option[aria-selected="true"]:hover {
    color: var(--sc-accent);
  }

  .aplify-search--clean .aplify-search-form .aplify-more-filters-toggle:hover {
    color: var(--sc-accent) !important;
  }

  .aplify-search--clean .aplify-search-form button[data-testid="search-button"]:hover {
    color: var(--search-btn-text-hover, var(--search-btn-text, var(--button-text-color))) !important;
    background: var(--search-btn-bg-hover, var(--primary-hover)) !important;
    box-shadow: none;
    transform: none;
  }

  .aplify-search--clean.aplify-search--on-dark .aplify-search-form button[data-testid="search-button"]:hover {
    color: #fff !important;
    background: transparent !important;
    border-color: #fff;
  }
}

/* Without a pointer the classic hover rules must not stick either */
@media (hover: none) {
  .aplify-search--clean .aplify-search-form .selectify__button:hover {
    background-color: transparent !important;
  }

  .aplify-search--clean .aplify-search-form .use-my-location-btn:not(.active):hover {
    color: var(--sc-muted) !important;
  }

  .aplify-search--clean .aplify-search-form button[data-testid="search-button"]:hover:not(:active) {
    color: var(--search-btn-text, var(--button-text-color)) !important;
    background: var(--search-btn-bg, var(--highlight)) !important;
    transform: none;
  }

  .aplify-search--clean .aplify-search-form .selectify__option:hover:not([data-highlighted]) {
    color: inherit;
    background: transparent;
  }
}

/* ----------------------------------------------------------
   640px and up: one bar, the first two fields in it
   ---------------------------------------------------------- */

@container aplify-search-form (min-width: 640px) {

  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form {
    flex-direction: row;
    flex-wrap: wrap;
  }

  /* The bar itself, drawn behind the first row. The rows under it (more
     filters, when open) are cards of their own. */
  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: -1;
    box-sizing: border-box;
    height: var(--sc-bar-h);
    background: var(--sc-surface);
    border: 1px solid var(--sc-outline);
    border-radius: var(--sc-bar-radius);
    box-shadow: var(--sc-bar-shadow);
    pointer-events: none;
  }

  /* Fields in the bar: segments edge to edge, a hairline between them.
     Un-positioned, so their panels hang from the whole bar. */
  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form :is(.aplify-f1, .aplify-f2) {
    position: static;
    flex: 1 1 0;
    height: var(--sc-bar-h);
    margin: 0;
    padding-left: 1px;
    background: linear-gradient(var(--sc-hairline), var(--sc-hairline)) left center / 1px calc(100% - 32px) no-repeat;
    border: 0;
    border-radius: 0;
  }

  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form .aplify-f1 {
    padding-left: 0;
    background: none;
    border-radius: var(--sc-bar-radius) 0 0 var(--sc-bar-radius);
  }

  /* Keywords is where people type, so it gets the widest segment. It has
     no panel, so it can stay positioned for its icon. */
  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form .aplify-field--keywords:is(.aplify-f1, .aplify-f2) {
    position: relative;
    flex-grow: 1.5;
  }

  /* Location carries a button as well as its text */
  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form .aplify-field--location:is(.aplify-f1, .aplify-f2) {
    flex-grow: 1.25;
  }

  /* Panels span the whole bar */
  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form :is(.aplify-f1, .aplify-f2) :is(.location-suggestions, .selectify__list, .aplify-places-loading) {
    top: calc(var(--sc-bar-h) + 12px);
    left: 0;
    right: 0;
    max-height: 440px;
    padding: 28px 32px 32px;
    border-radius: var(--sc-panel-radius);
  }

  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form :is(.aplify-f1, .aplify-f2) .aplify-places-loading {
    padding-left: 44px;
  }

  /* The third field starts the card under the bar */
  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form .aplify-f3 {
    order: 83;
    flex: 0 0 100%;
    margin-top: 12px;
    border-top-color: var(--sc-outline);
    border-radius: var(--sc-card-radius) var(--sc-card-radius) 0 0;
  }
  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form .aplify-f3.aplify-f-last {
    border-radius: var(--sc-card-radius);
  }
  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form .aplify-f4 { order: 84; flex: 0 0 100%; }
  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form .aplify-f5 { order: 85; flex: 0 0 100%; }
  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form .aplify-f6 { order: 86; flex: 0 0 100%; }

  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form:not(.is-filters-open) .aplify-f3 {
    display: none !important;
  }

  /* More filters: a segment before the button. Positioned here as well as in
     the card rule above: that one leaves out three-field forms, and without
     it the icon is placed from the bar's edge, on top of the location pin. */
  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form:is(.aplify-fields-3, .aplify-fields-4, .aplify-fields-5, .aplify-fields-6) .aplify-more-filters-toggle {
    position: relative;
    align-items: center;
    order: 50;
    display: flex;
    flex: 0 0 auto;
    height: var(--sc-bar-h);
    padding: 0 20px 0 calc(21px + var(--sc-icon) + 10px);
    white-space: nowrap;
    background: linear-gradient(var(--sc-hairline), var(--sc-hairline)) left center / 1px calc(100% - 32px) no-repeat !important;
    border: 0 !important;
    border-radius: 0;
  }

  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form .aplify-more-filters-toggle::before {
    left: 21px;
  }

  /* Round search button, inset at the end of the bar. The word stays in
     the button for screen readers. */
  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form .aplify-search-submit {
    order: 60;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    height: var(--sc-bar-h);
    margin: 0;
    padding: 0 calc((var(--sc-bar-h) - var(--sc-btn)) / 2);
  }

  .aplify-search--clean:not(.aplify-quick-search--card):not(.aplify-search-btn--text) .aplify-search-form button[data-testid="search-button"] {
    gap: 0;
    width: var(--sc-btn);
    padding: 0;
    font-size: 0;
    border-radius: 50%;
  }

  /* button_style="text": a pill with the icon and the word */
  .aplify-search--clean.aplify-search-btn--text:not(.aplify-quick-search--card) .aplify-search-form button[data-testid="search-button"] {
    width: auto;
  }

  /* In the bar the button sits on white whatever the page behind it, so
     it keeps its fill when pressed */
  .aplify-search--clean.aplify-search--on-dark:not(.aplify-quick-search--card) .aplify-search-form button[data-testid="search-button"]:active {
    color: var(--search-btn-text-hover, var(--search-btn-text, var(--button-text-color))) !important;
    background: var(--search-btn-bg-hover, var(--primary-hover)) !important;
    border-color: transparent;
  }
}

@container aplify-search-form (min-width: 640px) {
  @media (hover: hover) {
    .aplify-search--clean.aplify-search--on-dark:not(.aplify-quick-search--card) .aplify-search-form button[data-testid="search-button"]:hover {
      color: var(--search-btn-text-hover, var(--search-btn-text, var(--button-text-color))) !important;
      background: var(--search-btn-bg-hover, var(--primary-hover)) !important;
      border-color: transparent;
    }
  }
}

/* A bar with little room to spare gets tighter segments */
@container aplify-search-form (min-width: 640px) and (max-width: 1099px) {
  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form {
    --sc-pad: min(var(--clean-field-padding, 26px), 20px);
  }

  /* "More filters" is its icon alone here; the words stay for screen readers */
  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form .aplify-more-filters-toggle > span:first-of-type {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form:is(.aplify-fields-3, .aplify-fields-4, .aplify-fields-5, .aplify-fields-6) .aplify-more-filters-toggle {
    gap: 6px;
    padding-right: 16px;
    padding-left: calc(21px + var(--sc-icon));
  }
}

/* ----------------------------------------------------------
   960px and up: room for a third field in the bar
   ---------------------------------------------------------- */

@container aplify-search-form (min-width: 960px) {

  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form .aplify-f3,
  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form:not(.is-filters-open) .aplify-f3 {
    position: static;
    order: 3;
    display: block !important;
    flex: 1 1 0;
    height: var(--sc-bar-h);
    margin: 0;
    padding-left: 1px;
    background: linear-gradient(var(--sc-hairline), var(--sc-hairline)) left center / 1px calc(100% - 32px) no-repeat;
    border: 0;
    border-radius: 0;
  }

  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form .aplify-field--keywords.aplify-f3 {
    position: relative;
    flex-grow: 1.5;
  }

  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form .aplify-field--location.aplify-f3 {
    flex-grow: 1.25;
  }

  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form .aplify-f3 :is(.location-suggestions, .selectify__list, .aplify-places-loading) {
    top: calc(var(--sc-bar-h) + 12px);
    left: 0;
    right: 0;
    max-height: 440px;
    padding: 28px 32px 32px;
    border-radius: var(--sc-panel-radius);
  }

  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form .aplify-f3 .aplify-places-loading {
    padding-left: 44px;
  }

  /* The fourth field now starts the card under the bar */
  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form .aplify-f4 {
    margin-top: 12px;
    border-top-color: var(--sc-outline);
    border-radius: var(--sc-card-radius) var(--sc-card-radius) 0 0;
  }
  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form .aplify-f4.aplify-f-last {
    border-radius: var(--sc-card-radius);
  }

  /* With three fields there's nothing left to tuck away */
  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form.aplify-fields-3 .aplify-more-filters-toggle {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aplify-search--clean .aplify-search-form *,
  .aplify-search--clean .aplify-search-form *::before,
  .aplify-search--clean .aplify-search-form *::after {
    transition: none !important;
  }
}

/* ----------------------------------------------------------
   A field that isn't on offer (employment type, until the jobs have two
   or more types) must not leave "More filters" with nothing behind it,
   or the card without its rounded end.
   ---------------------------------------------------------- */

.aplify-search--clean .aplify-search-form:not(:has(:is(.aplify-f4, .aplify-f5, .aplify-f6):not(.is-unavailable))) .aplify-more-filters-toggle {
  display: none !important;
}

@container aplify-search-form (min-width: 640px) and (max-width: 959px) {
  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form:has(.aplify-f3:not(.is-unavailable)) .aplify-more-filters-toggle {
    display: flex !important;
  }
}

.aplify-search--clean .aplify-search-form:has(.aplify-f-last.is-unavailable) .aplify-f-penultimate {
  border-bottom: 1px solid var(--sc-outline);
  border-bottom-left-radius: var(--sc-card-radius);
  border-bottom-right-radius: var(--sc-card-radius);
}

@container aplify-search-form (min-width: 640px) {
  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form:has(.aplify-f-last.is-unavailable) .aplify-f-penultimate:is(.aplify-f1, .aplify-f2) {
    border-bottom: 0;
    border-radius: 0;
  }
  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form:has(.aplify-f-last.is-unavailable) .aplify-f-penultimate.aplify-f1 {
    border-radius: var(--sc-bar-radius) 0 0 var(--sc-bar-radius);
  }
}

@container aplify-search-form (min-width: 960px) {
  .aplify-search--clean:not(.aplify-quick-search--card) .aplify-search-form:has(.aplify-f-last.is-unavailable) .aplify-f-penultimate.aplify-f3 {
    border-bottom: 0;
    border-radius: 0;
  }
}
