         buttonContainer.snp.makeConstraints { make in
             make.top.bottom.equalTo(urlTextContainer)
 
-            make.width.greaterThanOrEqualTo(deleteButton).inset(-UIConstants.layout.urlBarMargin).priority(999)
-            make.width.greaterThanOrEqualTo(cancelButton).inset(-UIConstants.layout.urlBarMargin).priority(999)
-            make.width.greaterThanOrEqualTo(toolset.backButton).priority(999)
-
-            // This will shrink the container to be as small as possible.
+            make.width.greaterThanOrEqualTo(deleteButton).inset(-UIConstants.layout.urlBarMargin).priority(998)
+            make.width.greaterThanOrEqualTo(cancelButton).inset(-UIConstants.layout.urlBarMargin).priority(998)
+            make.width.greaterThanOrEqualTo(toolset.backButton).priority(998)
+
+            // This will shrink the container to be as small as possible while still meeting the width requirements above.
             make.width.equalTo(0).priority(500)
 
             // Keep the button container hidden until we start browsing.
-            hideButtonContainerConstraint = make.width.equalTo(UIConstants.layout.urlBarMargin).constraint
+            // Set the width equal to the URL bar margin so there's still a gap between the trailing edges...
+            hideButtonContainerConstraint = make.width.equalTo(UIConstants.layout.urlBarMargin).priority(999).constraint
+
+            /// ...unless we're showing the Settings button.
+            showSettingsConstraints.append(make.width.equalTo(0).constraint)
         }
 
         toolset.sendButton.snp.makeConstraints { make in


    private var hideButtonContainerConstraint: Constraint!
    private var fullWidthURLTextConstraint: Constraint!
    private var hideLockConstraints = [Constraint]()
    private var hideToolsetConstraints = [Constraint]()
    private var showToolsetConstraints = [Constraint]()

    /// Show the URL toolset buttons if we're on iPad/landscape and not editing; hide them otherwise.
    /// This method is intended to be called inside `UIView.animate` block.
    private func updateToolsetConstraints() {
        let isHidden = !showButtons || !showToolset
        toolset.backButton.animateHidden(isHidden, duration: 0.3)
        toolset.forwardButton.animateHidden(isHidden, duration: 0.3)
        toolset.stopReloadButton.animateHidden(isHidden, duration: 0.3)
        toolset.sendButton.animateHidden(isHidden, duration: 0.3)

        // We always show the settings button in the toolset -- even before we've started browsing.
        if isActivated && showToolset && !showButtons {
            showSettingsConstraints.forEach { $0.activate() }
        } else {
            showSettingsConstraints.forEach { $0.deactivate() }
        }
        toolset.settingsButton.animateHidden(!showToolset, duration: 0.3)

        if isHidden {
            // If we're hidden, hide the toolset buttons.
            showToolsetConstraints.forEach { $0.deactivate() }
            hideToolsetConstraints.forEach { $0.activate() }
            fullWidthURLTextConstraint.activate()
        } else {
            // If we're visible, show the toolset buttons.
            hideToolsetConstraints.forEach { $0.deactivate() }
            showToolsetConstraints.forEach { $0.activate() }

            // If we're editing, stretch the text field to the full width of its container.
            // Otherwise it will size to fit, allowing it to be centered in the container.
            if isEditing {
                fullWidthURLTextConstraint.activate()
            } else {
