.recipe-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.recipe-tools:has(.recipe-filters__toggle) {
  grid-template-columns: minmax(0, 1fr) 44px;
}

.recipe-tools [hidden],
.recipe-tools[hidden],
.recipe-tools > div:empty {
  display: none;
}

.recipe-tools input[type="search"] {
  width: 100%;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  padding-inline: 12px;
}

.recipe-filters {
  display: contents;
}

.recipe-filters__toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  grid-column: 2;
  grid-row: 1;
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--recipe-line);
  border-radius: 12px;
  background: var(--recipe-fill);
  cursor: pointer;
}

.recipe-filters__toggle::before {
  content: "";
  width: 16px;
  height: 16px;
  background:
    radial-gradient(circle at 5px 5px, currentColor 2.5px, transparent 3px),
    radial-gradient(circle at 11px 11px, currentColor 2.5px, transparent 3px),
    linear-gradient(currentColor, currentColor) center 4px / 16px 2px no-repeat,
    linear-gradient(currentColor, currentColor) center 10px / 16px 2px no-repeat;
}

.recipe-filters[data-active="true"] .recipe-filters__toggle {
  background: var(--recipe-active);
  box-shadow: inset 0 0 0 1px var(--recipe-focus);
}

.recipe-filters__select {
  position: absolute;
  inset: 0;
  min-width: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 16px;
  appearance: auto;
}

.recipe-tools input:focus-visible,
.recipe-filters__toggle:has(.recipe-filters__select:focus-visible) {
  outline: 2px solid var(--recipe-focus);
  outline-offset: 1px;
}

.recipe-result-count {
  margin: 0 0 9px;
  color: var(--text-soft, var(--muted));
  font-size: 13px;
}

.recipe-result-count:empty {
  display: none;
}

@media (max-width: 600px), (pointer: coarse) {
  .recipe-tools input[type="search"] {
    font-size: 16px;
  }
}
