.filter-grid {
  align-items: start;
  gap: 18px 16px;
}

.filter-grid > label {
  display: flex;
  min-width: 0;
  height: 100%;
  flex-direction: column;
}

.field-head,
label > .field-head {
  position: relative;
  display: flex;
  min-height: 32px;
  align-items: flex-start;
  gap: 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.field-unit,
.field-head > .field-unit {
  display: block;
  margin-top: 1px;
  color: #71858f;
  font-size: 9px;
  font-weight: 550;
  line-height: 1.35;
}

.field-head > .required {
  display: inline-flex;
  margin: 0 0 0 2px;
  color: #9c6224;
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: .7px;
}

.field-note,
label > .field-note {
  display: block;
  min-height: 28px;
  margin-top: 7px;
  color: #71858f;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
}

.filter-grid > label > input,
.filter-grid > label > select {
  margin-top: 0;
}

.help-tip,
.field-head > .help-tip {
  position: relative;
  z-index: 4;
  display: inline-grid;
  place-items: center;
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  margin-left: auto;
  border: 1px solid #bdcad0;
  border-radius: 50%;
  background: #f6f9f8;
  color: #496472;
  font: 800 10px Manrope, sans-serif;
  cursor: help;
  outline: none;
}

.help-tip::before {
  content: attr(data-tooltip);
  position: absolute;
  right: -8px;
  bottom: calc(100% + 9px);
  width: 230px;
  padding: 10px 12px;
  border-radius: 9px;
  background: #12384b;
  color: #fff;
  font: 500 11px/1.45 "DM Sans", sans-serif;
  text-align: left;
  box-shadow: 0 10px 25px rgba(18, 56, 75, .2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(5px);
  transition: .16s opacity, .16s transform;
}

.help-tip::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: calc(100% + 4px);
  border: 5px solid transparent;
  border-top-color: #12384b;
  opacity: 0;
  pointer-events: none;
  transition: .16s opacity;
}

.help-tip:hover,
.help-tip:focus {
  border-color: var(--blue);
  color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 91, 234, .1);
}

.help-tip:hover::before,
.help-tip:focus::before,
.help-tip:hover::after,
.help-tip:focus::after {
  opacity: 1;
  transform: translateY(0);
}

.date-fieldset legend .field-head {
  min-height: 24px;
}

.tolerance-field > .field-head {
  min-height: 24px;
}

.input-feedback {
  display: block;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid #ebce91;
  border-radius: 10px;
  background: #fff8e9;
  color: #795114;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.input-feedback[hidden] { display: none; }
.input-feedback[data-state="error"] {
  color: #a12f36;
  background: #fff2f2;
  border-color: #edbdc1;
}

.filter-grid input[data-input-state="warning"] {
  border-color: #c78a24;
  box-shadow: 0 0 0 3px rgba(199,138,36,.08);
}

.filter-grid input[data-input-state="error"] {
  border-color: #c94d57;
  box-shadow: 0 0 0 3px rgba(201,77,87,.08);
}

@media (max-width: 760px) {
  .field-head {
    min-height: auto;
  }

  .help-tip::before {
    right: -4px;
    width: min(230px, calc(100vw - 60px));
  }
}
