/* fix urlbar being too high in ff 128 */
* {
  --urlbar-toolbar-height: 32px !important;
  --urlbar-container-height: 32px !important;
}

/* hide stuff */
#userContext-icons,
#translations-button-icon,
#tracking-protection-icon-container,
#star-button-box,
.urlbar-page-action:not([hidden="true"]) {
  display: var(--tf-display-urlbar-icons);
}

/* configurable navigation buttons */
#back-button,
#forward-button {
  display: var(--tf-display-nav-buttons);
}

/* 
   hide elements of the identity box when:
   the page is secure (using https) and the domain is verified
   or when mixed content is blocked
*/
#identity-box[pageproxystate="valid"] {
  &.verifiedDomain {
    #identity-permission-box:not([hasSharingIcon]),
    #permissions-granted-icon {
      display: var(--tf-display-urlbar-icons) !important;
    }
    #permissions-granted-icon + box:has(image[sharing="true"]) {
      margin-left: -4px;
    }
    #identity-icon {
      list-style-image: unset !important;
    }
  }
  &.mixedActiveBlocked {
    #permissions-granted-icon,
    #identity-permission-box:not([hasSharingIcon]) {
      display: var(--tf-display-urlbar-icons) !important;
    }
    #permissions-granted-icon + box:has(image[sharing="true"]) {
      margin-left: -4px;
    }
  }
}

#navigator-toolbox {
  border-bottom: var(--border-width) !important;
}

#nav-bar {
  margin: var(--tf-navbar-margin);
  padding: var(--tf-navbar-padding) !important;
  border-top: var(--border-width) !important;
  border-style: solid !important;
  border-width: var(--border-width);
  border-color: var(--tf-border) !important;
  border-radius: var(--tf-rounding);
  transition: border-color var(--tf-border-transition) !important;
  &:hover,
  &:focus {
    border-color: var(--tf-accent) !important;
  }
  &::before {
    display: var(--tf-display-titles);
    content: "navbar";
    background-color: var(--tf-bg);
    position: absolute;
    margin: -16px 8px;
    padding: 0 2px;
  }
  &:hover::before {
    color: var(--tf-accent);
  }

  &:not([urlbar-exceeds-toolbar-bounds]) {
    overflow: unset !important;
  }
}
#PersonalToolbar {
  margin: 8px 8px 2px;
  padding: 4px !important;
  border-top: var(--border-width) !important;
  border-style: solid !important;
  border-width: var(--border-width);
  border-color: var(--tf-border) !important;
  border-radius: var(--tf-rounding);
  transition: border-color var(--tf-border-transition) !important;
  &:hover,
  &:focus {
    border-color: var(--tf-accent) !important;
  }
  &::before {
    display: var(--tf-display-titles);
    content: "bookmarks";
    background-color: var(--tf-bg);
    position: absolute;
    margin: -1.25rem .4rem;
    padding: 0 2px;
  }
  &:hover::before {
    color: var(--tf-accent);
  }
}

#PlacesToolbarItems {
  display: flex;
  justify-content: center;
}

toolbarbutton.bookmark-item:not(.subviewbutton) {
  padding: 8px !important;
}

:root[tabsintitlebar] #toolbar-menubar[autohide="true"] {
  --tab-min-height: fit-content !important;
  min-height: fit-content !important;
  padding-top: 3px !important;
}

.browser-toolbar {
  &:not(.titlebar-color) {
    background-color: transparent !important;
  }
}

@media (-moz-bool-pref: "sidebar.revamp") {
  #nav-bar::before {
    margin: -1.35rem .75rem;
    left: 0;
  }

  .titlebar-spacer[type="pre-tabs"],
  .titlebar-spacer[type="post-tabs"] {
    width: 0 !important;
  }
}
