:root {
  --arrowpanel-menuitem-margin-block: 0; /* FF 102 compatibility */
  --arrowpanel-menuitem-margin-inline: 8px;
  --arrowpanel-menuitem-margin: var(--arrowpanel-menuitem-margin-block) var(--arrowpanel-menuitem-margin-inline) !important; /* Original: 0 8px */
  --arrowpanel-menuitem-padding-block: 5px !important; /* Original: 8px */
  --arrowpanel-menuitem-padding-inline: 5px !important; /* Original: 8px */
  --arrowpanel-menuitem-padding: var(--arrowpanel-menuitem-padding-block) var(--arrowpanel-menuitem-padding-inline) !important; /* Compatibility */
  --arrowpanel-padding: 0.8em !important; /* Original: 16px or .cui-widget-panel, .cui-widget-panel::part(arrowcontent) => 4px 0 */
}

:root[uidensity="compact"] {
  --arrowpanel-menuitem-margin-inline: 4px; /* FF 102 compatibility */
  --arrowpanel-menuitem-padding-block: 3px !important;
  --arrowpanel-menuitem-padding-inline: 3px !important;
}
:root[uidensity="touch"] {
  --arrowpanel-menuitem-padding-block: 8px !important; /* Original: 8px */
  --arrowpanel-menuitem-padding-inline: 8px !important; /* Original: 8px */
}

.all-tabs-item {
  margin: var(--arrowpanel-menuitem-margin) !important;
}

@include NotOption("userChrome.icon.disabled") {
  @include NotOption("userChrome.icon.panel") {
    .subviewbutton {
      min-height: calc(16px + (var(--arrowpanel-menuitem-padding-block) * 2)) !important;
    }
  }
}

.unified-extensions-item {
  // #603, #735
  &-menu-button.subviewbutton {
    padding: 0 !important; /* Original: calc(var(--arrowpanel-menuitem-margin-inline) - 1px) var(--arrowpanel-menuitem-margin-inline) */

    @include Option("userChrome.panel.full_width_padding") {
      --arrowpanel-menuitem-padding-inline: var(--arrowpanel-menuitem-padding-block);
    }
  }

  // #711
  :root[uidensity="compact"] :is(&, &-action-button) {
    padding-block: 0 !important;
  }
}
